mainwindow.h
author insilmaril
Thu, 09 Aug 2007 18:34:08 +0000
changeset 584 95f1af9b525a
parent 582 a4c3dd0e48de
child 600 a9fe976e01a6
permissions -rw-r--r--
1.10.0
     1 #ifndef MAINWINDOW_H 
     2 #define MAINWINDOW_H
     3 
     4 #include <QMainWindow>
     5 
     6 #include "branchpropwindow.h"
     7 #include "file.h"
     8 #include "findwindow.h"
     9 #include "historywindow.h"
    10 #include "mapeditor.h"
    11 #include "simplescripteditor.h"
    12 #include "texteditor.h"
    13 //#include "xml.h"
    14 
    15 class Main : public QMainWindow 
    16 {
    17     Q_OBJECT
    18 
    19 public:
    20 	/*! Modifier modes are used when CTRL together with a mouse button is pressed */
    21 	enum ModMode {
    22 		ModModeNone,	//!< Unused
    23 		ModModeColor,	//!< Pick color from object
    24 		ModModeCopy,	//!< Copy object
    25 		ModModeXLink	//!< Create a XLink (XLinkObj) from selected object
    26 		};
    27 
    28     Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
    29     ~Main();
    30 	void loadCmdLine();
    31 	void statusMessage (const QString &);
    32 
    33 public slots:
    34     void fileNew();
    35     void fileNewCopy();
    36 
    37 protected:
    38 	void closeEvent( QCloseEvent* );
    39 
    40 private:
    41     void setupFileActions();
    42     void setupEditActions();
    43     void setupFormatActions();
    44     void setupViewActions();
    45     void setupModeActions();
    46     void setupWindowActions();
    47     void setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
    48     void setupFlagActions();
    49     void setupNetworkActions();
    50     void setupSettingsActions();
    51     void setupTestActions();
    52     void setupHelpActions();
    53     void setupContextMenus();
    54 	void setupRecentMapsMenu();
    55     void setupMacros();
    56 	void hideEvent (QHideEvent * );
    57 	void showEvent (QShowEvent * );
    58 	MapEditor* currentMapEditor() const;
    59     
    60 private slots:
    61 	void editorChanged(QWidget*);
    62 
    63     ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
    64     void fileLoad(const LoadMode &);
    65     void fileLoad();
    66 	void fileLoadRecent();
    67 	void addRecentMap (const QString &);
    68     void fileSave(MapEditor*, const SaveMode & );
    69     void fileSave();
    70 public slots:	
    71     void fileSave(MapEditor *);	// autosave from MapEditor
    72 private slots:	
    73     void fileSaveAs(const SaveMode &);
    74     void fileSaveAs();
    75     void fileImportKDEBookmarks();
    76     void fileImportFirefoxBookmarks();
    77     void fileImportFreemind();
    78     void fileImportMM();
    79     void fileImportDir();
    80     void fileExportXML();
    81     void fileExportXHTML();
    82     void fileExportImage();
    83     void fileExportASCII();
    84     void fileExportCSV();
    85     void fileExportLaTeX();
    86     void fileExportKDEBookmarks();
    87     void fileExportTaskjuggler();
    88     void fileExportOOPresentation();
    89     void fileCloseMap();
    90     void filePrint();
    91     void fileExitVYM();
    92 
    93 public slots:
    94     void editUndo();	
    95     void editRedo();	
    96 	void gotoHistoryStep (int);
    97 private slots:	
    98     void editCopy();	
    99     void editPaste();	
   100     void editCut();	
   101     void editOpenFindWindow();
   102 	void editFind(QString);
   103 	void editFindChanged();
   104 private:
   105 	void openTabs(QStringList);
   106 public slots:
   107 	void editOpenURL();
   108 	void editOpenURLTab();
   109 private slots:
   110 	void editOpenMultipleURLTabs();
   111 	void editURL();
   112 	void editLocalURL();
   113 	void editHeading2URL();
   114 	void editBugzilla2URL();
   115 	void editFATE2URL();
   116 	void openVymLinks(const QStringList &);
   117 	void editVymLink();
   118 	void editOpenMultipleVymLinks();
   119     void editHeadingFinished();
   120 public slots:
   121     void editHeading();
   122 	void editOpenVymLink();
   123 private slots:
   124 	void editDeleteVymLink();
   125 	void editToggleHideExport();
   126 	void editMapInfo();
   127     void editMoveUp();	
   128     void editMoveDown();	
   129     void editToggleScroll();
   130     void editUnscrollChilds();
   131     void editNewBranch();
   132     void editNewBranchBefore();
   133     void editNewBranchAbove();
   134     void editNewBranchBelow();
   135     void editImportAdd();
   136     void editImportReplace();
   137     void editSaveBranch();
   138     void editDeleteKeepChilds();
   139     void editDeleteChilds();
   140     void editDeleteSelection();
   141     void editUpperBranch();
   142     void editLowerBranch();
   143     void editLeftBranch();
   144     void editRightBranch();
   145     void editFirstBranch();
   146     void editLastBranch();
   147     void editLoadImage();
   148     void editSaveImage();
   149     void editFollowXLink (QAction *);
   150     void editEditXLink (QAction *);
   151 
   152     void formatSelectColor();
   153     void formatPickColor();
   154     void colorChanged(QColor);
   155     void formatColorBranch();
   156     void formatColorSubtree();
   157 	void formatLinkStyleLine();
   158 	void formatLinkStyleParabel();
   159 	void formatLinkStylePolyLine();
   160 	void formatLinkStylePolyParabel();
   161     void formatSelectBackColor();
   162     void formatSelectBackImage();
   163     void formatSelectLinkColor();
   164     void formatSelectSelectionColor();
   165     void formatToggleLinkColorHint();
   166 	void formatHideLinkUnselected();
   167 
   168     void viewZoomReset();
   169     void viewZoomIn();
   170     void viewZoomOut();
   171     void viewCenter();
   172 
   173 public slots:
   174 	void networkStartServer();
   175 	void networkConnect();
   176 	bool settingsPDF();
   177 	bool settingsURL();
   178 	void settingsMacroDir();
   179 	void settingsToggleDelKey();
   180 	void settingsUndoLevels();
   181 	void settingsAutosaveToggle();
   182 	void settingsAutosaveTime();
   183 
   184 	void windowToggleNoteEditor();
   185 	void windowToggleHistory();
   186 	void windowToggleProperty();
   187 	void updateHistory(SimpleSettings &);
   188 	void windowToggleAntiAlias();
   189 	void windowToggleSmoothPixmap();
   190 	void updateNoteFlag();
   191 	void updateSatellites(MapEditor *);
   192 	void updateActions();
   193 	ModMode getModMode();
   194 	bool autoEditNewBranch();
   195 	bool autoSelectNewBranch();
   196 	bool useFlagGroups();
   197 	void setScript(const QString &);
   198 	void runScript(const QString &);
   199 	void runScriptEverywhere (const QString &);
   200 
   201 private slots:
   202 	void windowNextEditor();
   203 	void windowPreviousEditor();
   204 	void windowShowNoteEditor();
   205 	void windowHideNoteEditor();
   206 
   207 	void standardFlagChanged();
   208 
   209     void testFunction1();
   210     void testFunction2();
   211     void testCommand();
   212 
   213     void helpDoc();
   214     void helpDemo();
   215     void helpAbout();
   216     void helpAboutQT();
   217 
   218 	void callMacro ();
   219 
   220 private:
   221 	QTabWidget *tabWidget;
   222 	FindWindow *findWindow;
   223 	QProcess *procBrowser;
   224 
   225 	QStringList imageTypes;
   226 
   227 	QLineEdit *lineedit;	// to enter headings of branches
   228 	QString prevSelection;
   229 
   230 	HistoryWindow *historyWindow;
   231 
   232 	BranchPropertyWindow *branchPropertyWindow;
   233 	SimpleScriptEditor *scriptEditor;
   234 
   235 	QList <QAction*> actionListBranches;
   236 
   237 	QColor currentColor;
   238 
   239 	QMenu *recentFilesMenu;
   240 	enum { MaxRecentFiles = 9 };
   241     QAction *recentFileActions[MaxRecentFiles];
   242 
   243     QAction *macroActions[12];
   244 	QStringList macro;
   245 
   246 	QAction* actionFileSave;
   247 	QAction* actionFilePrint;
   248 	QAction* actionEditUndo;
   249 	QAction* actionEditRedo;
   250 	QAction *actionEditCopy;
   251 	QAction *actionEditCut;
   252 	QAction *actionEditPaste;
   253 	QAction *actionEditMoveUp;
   254 	QAction *actionEditMoveDown;
   255 	QAction *actionEditToggleScroll;
   256 	QAction* actionEditOpenURL;
   257 	QAction* actionEditOpenURLTab;
   258 	QAction* actionEditOpenMultipleURLTabs;
   259 	QAction* actionEditURL;
   260 	QAction* actionEditLocalURL;
   261 	QAction* actionEditHeading2URL;
   262 	QAction* actionEditBugzilla2URL;
   263 	QAction* actionEditFATE2URL;
   264 	QAction *actionEditOpenVymLink;
   265 	QAction *actionEditOpenMultipleVymLinks;
   266 	QAction *actionEditVymLink;
   267 	QAction *actionEditDeleteVymLink;
   268 	QAction *actionEditToggleHideExport;
   269 	QAction *actionEditMapInfo;
   270 	QAction *actionEditHeading;
   271 	QAction *actionEditDelete;
   272 	QAction *actionEditAddBranch;
   273 	QAction *actionEditAddBranchBefore;
   274 	QAction *actionEditAddBranchAbove;
   275 	QAction *actionEditAddBranchBelow;
   276 	QAction *actionEditDeleteKeepChilds;
   277 	QAction *actionEditDeleteChilds;
   278 	QAction *actionEditImportAdd;
   279 	QAction *actionEditImportReplace;
   280 	QAction *actionEditSaveBranch;
   281 	QAction *actionEditSelectFirst;
   282 	QAction *actionEditSelectLast;
   283 	QAction *actionEditLoadImage;
   284 
   285 	QAction* actionFormatColor;
   286 	QAction* actionFormatPickColor;
   287 	QAction* actionFormatColorBranch;
   288 	QAction* actionFormatColorSubtree;
   289 	QAction* actionFormatLinkColorHint;
   290 	QAction* actionFormatBackColor;
   291 	QAction* actionFormatBackImage;
   292 	QAction* actionFormatLinkColor;
   293 	QAction* actionFormatSelectionColor;
   294 
   295 	QActionGroup* actionGroupModModes;
   296 	QAction* actionModModeColor;
   297 	QAction* actionModModeXLink;
   298 	QAction* actionModModeCopy;
   299 
   300 	QActionGroup *actionGroupFormatFrameTypes;
   301 
   302 
   303 	QActionGroup *actionGroupFormatLinkStyles;
   304 	QAction *actionFormatLinkStyleLine;
   305 	QAction *actionFormatLinkStyleParabel;
   306 	QAction *actionFormatLinkStylePolyLine;
   307 	QAction *actionFormatLinkStylePolyParabel;
   308 	QAction *actionFormatHideLinkUnselected;
   309 
   310 	QAction *actionViewToggleNoteEditor;
   311 	QAction *actionViewToggleHistoryWindow;
   312 	QAction *actionViewTogglePropertyWindow;
   313 	QAction *actionViewToggleAntiAlias;
   314 	QAction *actionViewToggleSmoothPixmapTransform;
   315 	QAction* actionViewCenter;
   316 
   317 	QAction* actionSettingsAutoEditNewBranch;
   318 	QAction* actionSettingsAutoSelectNewBranch;
   319 	QAction* actionSettingsAutoSelectText;
   320 	QAction* actionSettingsUseDelKey;
   321 	QAction* actionSettingsUseFlagGroups;
   322 	QAction* actionSettingsUseHideExport;
   323 	QAction* actionSettingsAutosaveToggle;
   324 	QAction* actionSettingsAutosaveTime;
   325 };
   326 
   327 
   328 #endif
   329