2007-12-01 10:47:15 +00:00
|
|
|
|
/*
|
2008-02-06 19:40:45 +00:00
|
|
|
|
Copyright 2006-2008 Xavier Guerrin
|
2007-12-01 10:47:15 +00:00
|
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
2007-09-21 12:35:28 +00:00
|
|
|
|
#ifndef QET_DIAGRAM_EDITOR_H
|
|
|
|
|
#define QET_DIAGRAM_EDITOR_H
|
2007-04-12 03:13:13 +00:00
|
|
|
|
#include <QtGui>
|
2007-12-01 10:29:03 +00:00
|
|
|
|
#include "insetproperties.h"
|
2007-04-12 03:13:13 +00:00
|
|
|
|
class DiagramView;
|
|
|
|
|
class ElementsPanelWidget;
|
2008-07-30 11:51:27 +00:00
|
|
|
|
class RecentFiles;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
/**
|
|
|
|
|
Cette classe represente la fenetre principale de QElectroTech et,
|
|
|
|
|
ipso facto, la plus grande partie de l'interface graphique de QElectroTech.
|
|
|
|
|
Il s'agit d'un objet QMainWindow avec un QWorkSpace contenant des objets
|
2007-12-30 19:10:51 +00:00
|
|
|
|
<EFBFBD> DiagramView <EFBFBD> en guise de widget central et un <EFBFBD> Panel d'Elements <EFBFBD> en
|
2007-10-10 17:50:26 +00:00
|
|
|
|
guise de widget <EFBFBD> Dock <EFBFBD>.
|
2007-04-12 03:13:13 +00:00
|
|
|
|
*/
|
2007-09-21 12:35:28 +00:00
|
|
|
|
class QETDiagramEditor : public QMainWindow {
|
2007-04-12 03:13:13 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
// constructeurs, destructeur
|
|
|
|
|
public:
|
2007-09-22 13:27:14 +00:00
|
|
|
|
QETDiagramEditor(const QStringList & = QStringList(), QWidget * = 0);
|
2007-09-21 12:35:28 +00:00
|
|
|
|
virtual ~QETDiagramEditor();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
|
|
private:
|
2007-09-21 12:35:28 +00:00
|
|
|
|
QETDiagramEditor(const QETDiagramEditor &);
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
|
|
// methodes
|
|
|
|
|
public:
|
|
|
|
|
void closeEvent(QCloseEvent *);
|
|
|
|
|
void addDiagramView(DiagramView *);
|
2008-07-20 11:37:31 +00:00
|
|
|
|
QList<DiagramView *> diagramViews() const;
|
|
|
|
|
QList<QString> editedFiles() const;
|
|
|
|
|
DiagramView *viewForFile(const QString &) const;
|
2007-12-01 10:29:03 +00:00
|
|
|
|
static InsetProperties defaultInsetProperties();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
void actions();
|
|
|
|
|
|
|
|
|
|
private:
|
2007-09-25 23:24:36 +00:00
|
|
|
|
DiagramView *currentDiagram() const;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
void menus();
|
|
|
|
|
void toolbar();
|
|
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
void toggleFullScreen();
|
2007-11-18 00:22:19 +00:00
|
|
|
|
void configureQET();
|
2007-09-29 12:54:01 +00:00
|
|
|
|
void aboutQET();
|
|
|
|
|
void printDialog();
|
|
|
|
|
void exportDialog();
|
|
|
|
|
bool saveAsDialog();
|
|
|
|
|
bool save();
|
|
|
|
|
bool newDiagram();
|
|
|
|
|
bool openDiagram();
|
2008-07-30 11:51:27 +00:00
|
|
|
|
bool openRecentFile(const QString &);
|
2008-07-17 19:25:57 +00:00
|
|
|
|
bool openAndAddDiagram(const QString &);
|
2007-09-29 12:54:01 +00:00
|
|
|
|
bool closeDiagram();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
void slot_editInfos();
|
2007-09-29 12:54:01 +00:00
|
|
|
|
void slot_cut();
|
|
|
|
|
void slot_copy();
|
|
|
|
|
void slot_paste();
|
|
|
|
|
void slot_zoomIn();
|
|
|
|
|
void slot_zoomOut();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
void slot_zoomFit();
|
|
|
|
|
void slot_zoomReset();
|
|
|
|
|
void slot_selectAll();
|
|
|
|
|
void slot_selectNothing();
|
|
|
|
|
void slot_selectInvert();
|
2007-09-29 12:54:01 +00:00
|
|
|
|
void slot_delete();
|
|
|
|
|
void slot_rotate();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
void slot_setSelectionMode();
|
|
|
|
|
void slot_setVisualisationMode();
|
|
|
|
|
void slot_updateActions();
|
2007-10-28 00:16:32 +00:00
|
|
|
|
void slot_updateModeActions();
|
|
|
|
|
void slot_updateComplexActions();
|
|
|
|
|
void slot_updatePasteAction();
|
2007-09-29 12:54:01 +00:00
|
|
|
|
void slot_updateWindowsMenu();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
void slot_addColumn();
|
|
|
|
|
void slot_removeColumn();
|
2008-08-10 15:07:59 +00:00
|
|
|
|
void slot_addRow();
|
|
|
|
|
void slot_removeRow();
|
2007-10-03 17:02:39 +00:00
|
|
|
|
void slot_editConductor();
|
2007-10-06 18:37:21 +00:00
|
|
|
|
void slot_resetConductors();
|
2007-10-14 15:16:37 +00:00
|
|
|
|
void slot_editDefaultConductors();
|
2007-10-27 13:18:17 +00:00
|
|
|
|
void slot_addText();
|
2007-11-12 15:21:14 +00:00
|
|
|
|
void readSettings();
|
|
|
|
|
void writeSettings();
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
|
|
// attributs
|
2007-11-02 18:04:13 +00:00
|
|
|
|
public:
|
2007-04-12 03:13:13 +00:00
|
|
|
|
// Actions faisables au travers de menus dans l'application QElectroTech
|
2007-12-16 14:05:39 +00:00
|
|
|
|
QActionGroup *grp_visu_sel; ///< Groupe d'actions pour les modes (edition et visualisation)
|
|
|
|
|
QAction *mode_selection; ///< Passe en mode edition
|
|
|
|
|
QAction *mode_visualise; ///< Passe en mode visualisation
|
|
|
|
|
QAction *new_file; ///< Cree un nouveau schema
|
|
|
|
|
QAction *open_file; ///< OUvre un fichier
|
|
|
|
|
QAction *close_file; ///< Ferme le fichier
|
|
|
|
|
QAction *save_file; ///< Enregistre le fichier
|
|
|
|
|
QAction *save_file_sous; ///< Enregistrer le fichier sous un nom donne
|
|
|
|
|
QAction *import_diagram; ///< Importe un schema existant (non implemente)
|
|
|
|
|
QAction *export_diagram; ///< Exporte le schema sous forme d'image
|
|
|
|
|
QAction *print; ///< Imprime le schema
|
|
|
|
|
QAction *quit_editor; ///< Quitte l'editeur de schema
|
|
|
|
|
QAction *undo; ///< Annule la derniere action
|
|
|
|
|
QAction *redo; ///< Refait une action annulee
|
|
|
|
|
QAction *cut; ///< Coupe la selection dans le presse-papier
|
|
|
|
|
QAction *copy; ///< Copie la selection dans le presse-papier
|
|
|
|
|
QAction *paste; ///< Colle le contenu du presse-papier sur le schema
|
|
|
|
|
QAction *select_all; ///< Selectionne tout
|
|
|
|
|
QAction *select_nothing; ///< Deselectionne tout
|
|
|
|
|
QAction *select_invert; ///< Inverse la selection
|
|
|
|
|
QAction *delete_selection; ///< Supprime la selection
|
|
|
|
|
QAction *rotate_selection; ///< Pivote les elements selectionnes
|
|
|
|
|
QAction *conductor_prop; ///< Lance le dialogue d'edition du conducteur selectionne
|
|
|
|
|
QAction *conductor_reset; ///< Reinitialise les conducteurs selectionnes
|
|
|
|
|
QAction *conductor_default; ///< Lance le dialogue d'edition des conducteurs par defaut
|
|
|
|
|
QAction *infos_diagram; ///< Lance le dialogue d'edition des proprietes du schema
|
|
|
|
|
QAction *add_text; ///< Passe en mode "Ajout de texte"
|
|
|
|
|
QAction *add_column; ///< Ajoute une colonne au schema
|
|
|
|
|
QAction *remove_column; ///< Enleve une colonne du schema
|
2008-08-10 15:07:59 +00:00
|
|
|
|
QAction *add_row; ///< Augmente la hauteur du schema
|
|
|
|
|
QAction *remove_row; ///< Reduit la hauteur du schema
|
2007-12-16 14:05:39 +00:00
|
|
|
|
QAction *zoom_in; ///< Zoome avant
|
|
|
|
|
QAction *zoom_out; ///< Zoome arriere
|
|
|
|
|
QAction *zoom_fit; ///< Ajuste le zoom de facon a voir l'integralite des elements
|
|
|
|
|
QAction *zoom_reset; ///< Remet le zoom 1:1
|
|
|
|
|
QAction *about_qet; ///< Lance le dialogue "A propos de QElectroTech"
|
|
|
|
|
QAction *about_qt; ///< Lance le dialogue "A propos de Qt"
|
|
|
|
|
QAction *configure; ///< Lance le dialogue de configuration de QElectroTech
|
|
|
|
|
QAction *fullscreen_on; ///< Passe en mode plein ecran
|
|
|
|
|
QAction *fullscreen_off; ///< Sort du mode plein ecran
|
|
|
|
|
QAction *tile_window; ///< Affiche les fenetre MDI en mosaique
|
|
|
|
|
QAction *cascade_window; ///< Affiche les fenetres MDI en cascade
|
|
|
|
|
QAction *arrange_window; ///< Reorganise les fenetres MDI
|
|
|
|
|
QAction *prev_window; ///< Affiche la fenetre MDI precedente
|
|
|
|
|
QAction *next_window; ///< Affiche la fenetre MDI suivante
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QWorkspace workspace;
|
|
|
|
|
QSignalMapper windowMapper;
|
2007-10-21 12:53:57 +00:00
|
|
|
|
/// Dossier a utiliser pour Fichier > ouvrir
|
|
|
|
|
QDir open_dialog_dir;
|
2007-12-30 19:10:51 +00:00
|
|
|
|
/// Dock pour le Panel d'Elements
|
2007-04-12 03:13:13 +00:00
|
|
|
|
QDockWidget *qdw_pa;
|
2007-11-09 15:16:54 +00:00
|
|
|
|
/// Dock pour la liste des annulations
|
|
|
|
|
QDockWidget *qdw_undo;
|
2007-12-30 19:10:51 +00:00
|
|
|
|
/// Panel d'Elements
|
2007-04-12 03:13:13 +00:00
|
|
|
|
ElementsPanelWidget *pa;
|
2007-09-29 12:54:01 +00:00
|
|
|
|
QMenu *windows_menu;
|
2007-10-13 17:04:52 +00:00
|
|
|
|
QToolBar *main_bar;
|
|
|
|
|
QToolBar *view_bar;
|
|
|
|
|
QToolBar *diagram_bar;
|
2007-09-25 23:24:36 +00:00
|
|
|
|
QUndoGroup undo_group;
|
2007-04-12 03:13:13 +00:00
|
|
|
|
};
|
2006-10-27 15:47:22 +00:00
|
|
|
|
#endif
|