mainwindow.h
author insilmaril
Wed, 24 Oct 2007 14:41:34 +0000
changeset 614 040f32294895
parent 608 6cdc2e7b1937
child 616 16d63fc9ae42
permissions -rw-r--r--
Fixed present flag
     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 
    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 editSortChildren();
   130     void editToggleScroll();
   131     void editUnscrollChilds();
   132     void editNewBranch();
   133     void editNewBranchBefore();
   134     void editNewBranchAbove();
   135     void editNewBranchBelow();
   136     void editImportAdd();
   137     void editImportReplace();
   138     void editSaveBranch();
   139     void editDeleteKeepChilds();
   140     void editDeleteChilds();
   141     void editDeleteSelection();
   142     void editUpperBranch();
   143     void editLowerBranch();
   144     void editLeftBranch();
   145     void editRightBranch();
   146     void editFirstBranch();
   147     void editLastBranch();
   148     void editLoadImage();
   149     void editSaveImage();
   150     void editFollowXLink (QAction *);
   151     void editEditXLink (QAction *);
   152 
   153     void formatSelectColor();
   154     void formatPickColor();
   155     void colorChanged(QColor);
   156     void formatColorBranch();
   157     void formatColorSubtree();
   158 	void formatLinkStyleLine();
   159 	void formatLinkStyleParabel();
   160 	void formatLinkStylePolyLine();
   161 	void formatLinkStylePolyParabel();
   162     void formatSelectBackColor();
   163     void formatSelectBackImage();
   164     void formatSelectLinkColor();
   165     void formatSelectSelectionColor();
   166     void formatToggleLinkColorHint();
   167 	void formatHideLinkUnselected();
   168 
   169     void viewZoomReset();
   170     void viewZoomIn();
   171     void viewZoomOut();
   172     void viewCenter();
   173 
   174 public slots:
   175 	void networkStartServer();
   176 	void networkConnect();
   177 	bool settingsPDF();
   178 	bool settingsURL();
   179 	void settingsMacroDir();
   180 	void settingsToggleDelKey();
   181 	void settingsUndoLevels();
   182 	void settingsAutosaveToggle();
   183 	void settingsAutosaveTime();
   184 
   185 	void windowToggleNoteEditor();
   186 	void windowToggleHistory();
   187 	void windowToggleProperty();
   188 	void updateHistory(SimpleSettings &);
   189 	void windowToggleAntiAlias();
   190 	void windowToggleSmoothPixmap();
   191 	void updateNoteFlag();
   192 	void updateSatellites(MapEditor *);
   193 	void updateActions();
   194 	ModMode getModMode();
   195 	bool autoEditNewBranch();
   196 	bool autoSelectNewBranch();
   197 	bool useFlagGroups();
   198 	void setScript(const QString &);
   199 	void runScript(const QString &);
   200 	void runScriptEverywhere (const QString &);
   201 
   202 private slots:
   203 	void windowNextEditor();
   204 	void windowPreviousEditor();
   205 	void windowShowNoteEditor();
   206 	void windowHideNoteEditor();
   207 
   208 	void standardFlagChanged();
   209 
   210     void testFunction1();
   211     void testFunction2();
   212     void testCommand();
   213 
   214     void helpDoc();
   215     void helpDemo();
   216     void helpAbout();
   217     void helpAboutQT();
   218 
   219 	void callMacro ();
   220 
   221 private:
   222 	QTabWidget *tabWidget;
   223 	FindWindow *findWindow;
   224 	QProcess *procBrowser;
   225 
   226 	QStringList imageTypes;
   227 
   228 	QLineEdit *lineedit;	// to enter headings of branches
   229 	QString prevSelection;
   230 
   231 	HistoryWindow *historyWindow;
   232 
   233 	BranchPropertyWindow *branchPropertyWindow;
   234 	SimpleScriptEditor *scriptEditor;
   235 
   236 	QList <QAction*> actionListBranches;
   237 
   238 	QColor currentColor;
   239 
   240 	int xLinkMenuWidth;
   241 
   242 	QMenu *recentFilesMenu;
   243 	enum { MaxRecentFiles = 9 };
   244     QAction *recentFileActions[MaxRecentFiles];
   245 
   246     QAction *macroActions[12];
   247 	QStringList macro;
   248 
   249 	QAction* actionFileSave;
   250 	QAction* actionFilePrint;
   251 	QAction* actionEditUndo;
   252 	QAction* actionEditRedo;
   253 	QAction *actionEditCopy;
   254 	QAction *actionEditCut;
   255 	QAction *actionEditPaste;
   256 	QAction *actionEditMoveUp;
   257 	QAction *actionEditMoveDown;
   258 	QAction *actionEditSortChildren;
   259 	QAction *actionEditToggleScroll;
   260 	QAction* actionEditOpenURL;
   261 	QAction* actionEditOpenURLTab;
   262 	QAction* actionEditOpenMultipleURLTabs;
   263 	QAction* actionEditURL;
   264 	QAction* actionEditLocalURL;
   265 	QAction* actionEditHeading2URL;
   266 	QAction* actionEditBugzilla2URL;
   267 	QAction* actionEditFATE2URL;
   268 	QAction *actionEditOpenVymLink;
   269 	QAction *actionEditOpenMultipleVymLinks;
   270 	QAction *actionEditVymLink;
   271 	QAction *actionEditDeleteVymLink;
   272 	QAction *actionEditToggleHideExport;
   273 	QAction *actionEditMapInfo;
   274 	QAction *actionEditHeading;
   275 	QAction *actionEditDelete;
   276 	QAction *actionEditAddBranch;
   277 	QAction *actionEditAddBranchBefore;
   278 	QAction *actionEditAddBranchAbove;
   279 	QAction *actionEditAddBranchBelow;
   280 	QAction *actionEditDeleteKeepChilds;
   281 	QAction *actionEditDeleteChilds;
   282 	QAction *actionEditImportAdd;
   283 	QAction *actionEditImportReplace;
   284 	QAction *actionEditSaveBranch;
   285 	QAction *actionEditSelectFirst;
   286 	QAction *actionEditSelectLast;
   287 	QAction *actionEditLoadImage;
   288 
   289 	QAction* actionFormatColor;
   290 	QAction* actionFormatPickColor;
   291 	QAction* actionFormatColorBranch;
   292 	QAction* actionFormatColorSubtree;
   293 	QAction* actionFormatLinkColorHint;
   294 	QAction* actionFormatBackColor;
   295 	QAction* actionFormatBackImage;
   296 	QAction* actionFormatLinkColor;
   297 	QAction* actionFormatSelectionColor;
   298 
   299 	QActionGroup* actionGroupModModes;
   300 	QAction* actionModModeColor;
   301 	QAction* actionModModeXLink;
   302 	QAction* actionModModeCopy;
   303 
   304 	QActionGroup *actionGroupFormatFrameTypes;
   305 
   306 
   307 	QActionGroup *actionGroupFormatLinkStyles;
   308 	QAction *actionFormatLinkStyleLine;
   309 	QAction *actionFormatLinkStyleParabel;
   310 	QAction *actionFormatLinkStylePolyLine;
   311 	QAction *actionFormatLinkStylePolyParabel;
   312 	QAction *actionFormatHideLinkUnselected;
   313 
   314 	QAction *actionViewToggleNoteEditor;
   315 	QAction *actionViewToggleHistoryWindow;
   316 	QAction *actionViewTogglePropertyWindow;
   317 	QAction *actionViewToggleAntiAlias;
   318 	QAction *actionViewToggleSmoothPixmapTransform;
   319 	QAction* actionViewCenter;
   320 
   321 	QAction* actionSettingsAutoEditNewBranch;
   322 	QAction* actionSettingsAutoSelectNewBranch;
   323 	QAction* actionSettingsAutoSelectText;
   324 	QAction* actionSettingsUseDelKey;
   325 	QAction* actionSettingsUseFlagGroups;
   326 	QAction* actionSettingsUseHideExport;
   327 	QAction* actionSettingsAutosaveToggle;
   328 	QAction* actionSettingsAutosaveTime;
   329 };
   330 
   331 
   332 #endif
   333