mainwindow.h
author insilmaril
Wed Apr 25 16:02:54 2007 +0000 (2007-04-25)
changeset 474 d9add21ee9d3
parent 450 beb875135811
child 486 9c86935835a4
permissions -rw-r--r--
started doxygen documentation
     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 
    36 protected:
    37 	void closeEvent( QCloseEvent* );
    38 
    39 private:
    40     void setupFileActions();
    41     void setupEditActions();
    42     void setupFormatActions();
    43     void setupViewActions();
    44     void setupModeActions();
    45     void setupWindowActions();
    46     void setupFlagActions();
    47     void setupSettingsActions();
    48     void setupTestActions();
    49     void setupHelpActions();
    50     void setupContextMenus();
    51 	void setupRecentMapsMenu();
    52     void setupMacros();
    53 	void hideEvent (QHideEvent * );
    54 	void showEvent (QShowEvent * );
    55 	bool reallyWriteDirectory(const QString&);
    56 	QString browseDirectory(const QString&);
    57 	MapEditor* currentMapEditor() const;
    58     
    59 private slots:
    60 	void editorChanged(QWidget*);
    61 
    62     ErrorCode fileLoad(QString ,const LoadMode &);
    63     void fileLoad(const LoadMode &);
    64     void fileLoad();
    65 	void fileLoadRecent();
    66 	void addRecentMap (const QString &);
    67     void fileSave(MapEditor*, const SaveMode & );
    68     void fileSave();
    69 public slots:	
    70     void fileSave(MapEditor *);	// autosave from MapEditor
    71 private slots:	
    72     void fileSaveAs(const SaveMode &);
    73     void fileSaveAs();
    74     void fileImportKDEBookmarks();
    75     void fileImportFirefoxBookmarks();
    76     void fileImportMM();
    77     void fileImportDir();
    78     void fileExportXML();
    79     void fileExportXHTML();
    80     void fileExportImage();
    81     void fileExportASCII();
    82     void fileExportLaTeX();
    83     void fileExportKDEBookmarks();
    84     void fileExportTaskjuggler();
    85     void fileExportOOPresentation();
    86     void fileCloseMap();
    87     void filePrint();
    88     void fileExitVYM();
    89 
    90 public slots:
    91     void editUndo();	
    92     void editRedo();	
    93 	void gotoHistoryStep (int);
    94 private slots:	
    95     void editCopy();	
    96     void editPaste();	
    97     void editCut();	
    98     void editOpenFindWindow();
    99 	void editFind(QString);
   100 	void editFindChanged();
   101 private:
   102 	void openTabs(QStringList);
   103 public slots:
   104 	void editOpenURL();
   105 	void editOpenURLTab();
   106 private slots:
   107 	void editOpenMultipleURLTabs();
   108 	void editURL();
   109 	void editHeading2URL();
   110 	void editBugzilla2URL();
   111 	void editFATE2URL();
   112 	void openVymLinks(const QStringList &);
   113 	void editVymLink();
   114 	void editOpenMultipleVymLinks();
   115     void editHeadingFinished();
   116 public slots:
   117     void editHeading();
   118 	void editOpenVymLink();
   119 private slots:
   120 	void editDeleteVymLink();
   121 	void editToggleHideExport();
   122 	void editMapInfo();
   123     void editMoveUp();	
   124     void editMoveDown();	
   125     void editToggleScroll();
   126     void editUnscrollChilds();
   127     void editNewBranch();
   128     void editNewBranchBefore();
   129     void editNewBranchAbove();
   130     void editNewBranchBelow();
   131     void editImportAdd();
   132     void editImportReplace();
   133     void editSaveBranch();
   134     void editDeleteKeepChilds();
   135     void editDeleteChilds();
   136     void editDeleteSelection();
   137     void editUpperBranch();
   138     void editLowerBranch();
   139     void editLeftBranch();
   140     void editRightBranch();
   141     void editFirstBranch();
   142     void editLastBranch();
   143     void editLoadImage();
   144     void editSaveImage();
   145     void editFollowXLink (QAction *);
   146     void editEditXLink (QAction *);
   147 
   148     void formatSelectColor();
   149     void formatPickColor();
   150     void colorChanged(QColor);
   151     void formatColorBranch();
   152     void formatColorSubtree();
   153 	void formatLinkStyleLine();
   154 	void formatLinkStyleParabel();
   155 	void formatLinkStylePolyLine();
   156 	void formatLinkStylePolyParabel();
   157     void formatSelectBackColor();
   158     void formatSelectBackImage();
   159     void formatSelectLinkColor();
   160     void formatSelectSelectionColor();
   161     void formatToggleLinkColorHint();
   162 	void formatHideLinkUnselected();
   163 
   164     void viewZoomReset();
   165     void viewZoomIn();
   166     void viewZoomOut();
   167 
   168 public slots:
   169 	bool settingsPDF();
   170 	bool settingsURL();
   171 	void settingsMacroDir();
   172 	void settingsToggleDelKey();
   173 	void settingsUndoLevels();
   174 	void settingsAutosaveToggle();
   175 	void settingsAutosaveTime();
   176 
   177 	void windowToggleNoteEditor();
   178 	void windowToggleHistory();
   179 	void windowToggleProperty();
   180 	void updateHistory(SimpleSettings &);
   181 	void windowToggleAntiAlias();
   182 	void windowToggleSmoothPixmap();
   183 	void updateNoteFlag();
   184 	void updateSatellites(MapEditor *);
   185 	void updateActions();
   186 	ModMode getModMode();
   187 	bool autoEdit();
   188 	bool autoSelectHeading();
   189 	bool useFlagGroups();
   190 	void setScript(const QString &);
   191 	void runScript(const QString &);
   192 
   193 private slots:
   194 	void windowNextEditor();
   195 	void windowPreviousEditor();
   196 	void windowShowNoteEditor();
   197 	void windowHideNoteEditor();
   198 
   199 	void standardFlagChanged();
   200 
   201     void testFunction();
   202     void testCommand();
   203 
   204     void helpDoc();
   205     void helpAbout();
   206     void helpAboutQT();
   207 
   208 	void callMacro ();
   209 
   210 private:
   211 	QTabWidget *tabWidget;
   212 	FindWindow *findWindow;
   213 	QProcess *procBrowser;
   214 
   215 	QStringList imageTypes;
   216 
   217 	QLineEdit *lineedit;	// to enter headings of branches
   218 	QString prevSelection;
   219 
   220 	HistoryWindow *historyWindow;
   221 
   222 	BranchPropertyWindow *branchPropertyWindow;
   223 	SimpleScriptEditor *scriptEditor;
   224 
   225 	QList <QAction*> actionListBranches;
   226 
   227 	QColor currentColor;
   228 
   229 	QMenu *recentFilesMenu;
   230 	enum { MaxRecentFiles = 9 };
   231     QAction *recentFileActions[MaxRecentFiles];
   232 
   233     QAction *macroActions[12];
   234 	QStringList macro;
   235 
   236 	QAction* actionFileSave;
   237 	QAction* actionFilePrint;
   238 	QAction* actionEditUndo;
   239 	QAction* actionEditRedo;
   240 	QAction *actionEditCopy;
   241 	QAction *actionEditCut;
   242 	QAction *actionEditPaste;
   243 	QAction *actionEditMoveUp;
   244 	QAction *actionEditMoveDown;
   245 	QAction *actionEditToggleScroll;
   246 	QAction* actionEditOpenURL;
   247 	QAction* actionEditOpenURLTab;
   248 	QAction* actionEditOpenMultipleURLTabs;
   249 	QAction* actionEditURL;
   250 	QAction* actionEditHeading2URL;
   251 	QAction* actionEditBugzilla2URL;
   252 	QAction* actionEditFATE2URL;
   253 	QAction *actionEditOpenVymLink;
   254 	QAction *actionEditOpenMultipleVymLinks;
   255 	QAction *actionEditVymLink;
   256 	QAction *actionEditDeleteVymLink;
   257 	QAction *actionEditToggleHideExport;
   258 	QAction *actionEditMapInfo;
   259 	QAction *actionEditHeading;
   260 	QAction *actionEditDelete;
   261 	QAction *actionEditAddBranch;
   262 	QAction *actionEditAddBranchBefore;
   263 	QAction *actionEditAddBranchAbove;
   264 	QAction *actionEditAddBranchBelow;
   265 	QAction *actionEditDeleteKeepChilds;
   266 	QAction *actionEditDeleteChilds;
   267 	QAction *actionEditImportAdd;
   268 	QAction *actionEditImportReplace;
   269 	QAction *actionEditSaveBranch;
   270 	QAction *actionEditSelectFirst;
   271 	QAction *actionEditSelectLast;
   272 	QAction *actionEditLoadImage;
   273 
   274 	QAction* actionFormatColor;
   275 	QAction* actionFormatPickColor;
   276 	QAction* actionFormatColorBranch;
   277 	QAction* actionFormatColorSubtree;
   278 	QAction* actionFormatLinkColorHint;
   279 	QAction* actionFormatBackColor;
   280 	QAction* actionFormatBackImage;
   281 	QAction* actionFormatLinkColor;
   282 	QAction* actionFormatSelectionColor;
   283 
   284 	QActionGroup* actionGroupModModes;
   285 	QAction* actionModModeColor;
   286 	QAction* actionModModeXLink;
   287 	QAction* actionModModeCopy;
   288 
   289 	QActionGroup *actionGroupFormatFrameTypes;
   290 
   291 	QAction *actionTogglePropertyWindow;
   292 
   293 	QActionGroup *actionGroupFormatLinkStyles;
   294 	QAction *actionFormatLinkStyleLine;
   295 	QAction *actionFormatLinkStyleParabel;
   296 	QAction *actionFormatLinkStylePolyLine;
   297 	QAction *actionFormatLinkStylePolyParabel;
   298 	QAction *actionFormatHideLinkUnselected;
   299 
   300 	QAction *actionViewToggleNoteEditor;
   301 	QAction *actionViewToggleHistoryWindow;
   302 	QAction *actionViewToggleAntiAlias;
   303 	QAction *actionViewToggleSmoothPixmapTransform;
   304 
   305 	QAction* actionSettingsAutoEdit;
   306 	QAction* actionSettingsAutoSelectHeading;
   307 	QAction* actionSettingsAutoSelectText;
   308 	QAction* actionSettingsUseDelKey;
   309 	QAction* actionSettingsUseFlagGroups;
   310 	QAction* actionSettingsUseHideExport;
   311 	QAction* actionSettingsAutosaveToggle;
   312 	QAction* actionSettingsAutosaveTime;
   313 };
   314 
   315 
   316 #endif
   317