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