mainwindow.h
author insilmaril
Mon, 16 Oct 2006 12:42:54 +0000
changeset 391 59106708b5b5
parent 390 0e1aeb21cb78
child 393 053b8645e3e9
permissions -rw-r--r--
Code simplifications
     1 #ifndef MAINWINDOW_H 
     2 #define MAINWINDOW_H
     3 
     4 #include <QMainWindow>
     5 
     6 #include "file.h"
     7 #include "findwindow.h"
     8 #include "mapeditor.h"
     9 #include "texteditor.h"
    10 #include "xml.h"
    11 
    12 enum ModMode {ModModeNone,ModModeColor,ModModeCopy,ModModeXLink};
    13 
    14 class Main : public QMainWindow 
    15 {
    16     Q_OBJECT
    17 
    18 public:
    19     Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
    20     ~Main();
    21 	void loadCmdLine();
    22 	void statusMessage (const QString &);
    23 
    24 public slots:
    25     void fileNew();
    26 
    27 protected:
    28 	void closeEvent( QCloseEvent* );
    29 
    30 private:
    31     void setupFileActions();
    32     void setupEditActions();
    33     void setupFormatActions();
    34     void setupViewActions();
    35     void setupModeActions();
    36     void setupWindowActions();
    37     void setupFlagActions();
    38     void setupSettingsActions();
    39     void setupTestActions();
    40     void setupHelpActions();
    41     void setupContextMenus();
    42 	void setupLastMapsMenu();
    43 	void hideEvent (QHideEvent * );
    44 	void showEvent (QShowEvent * );
    45 	bool reallyWriteDirectory(const QString&);
    46 	QString browseDirectory(const QString&);
    47 	MapEditor* currentMapEditor() const;
    48     
    49 private slots:
    50     void newView();
    51 	void editorChanged(QWidget*);
    52 
    53     ErrorCode fileLoad(QString ,const LoadMode &);
    54     void fileLoad(const LoadMode &);
    55     void fileLoad();
    56 	void fileLoadLast(QAction *);
    57     void fileSave(const SaveMode & );
    58     void fileSave();
    59     void fileSaveAs(const SaveMode &);
    60     void fileSaveAs();
    61     void fileImportKDEBookmarks();
    62     void fileImportFirefoxBookmarks();
    63     void fileImportMM();
    64     void fileImportDir();
    65     void fileExportXML();
    66     void fileExportXHTML();
    67     void fileExportImage();
    68     void fileExportASCII();
    69     void fileExportLaTeX();
    70     void fileExportKDEBookmarks();
    71     void fileExportTaskjuggler();
    72     void fileExportOOPresentation();
    73     void fileCloseMap();
    74     void filePrint();
    75     void fileExitVYM();
    76 
    77     void editUndo();	
    78     void editRedo();	
    79     void editCopy();	
    80     void editPaste();	
    81     void editCut();	
    82     void editOpenFindWindow();
    83 	void editFind(QString);
    84 	void editFindChanged();
    85 private:
    86 	void openTabs(QStringList);
    87 public slots:
    88 	void editOpenURL();
    89 	void editOpenURLTab();
    90 private slots:
    91 	void editOpenMultipleURLTabs();
    92 	void editURL();
    93 	void editHeading2URL();
    94 	void editBugzilla2URL();
    95 	void editFATE2URL();
    96 	void openVymLinks(const QStringList &);
    97 	void editVymLink();
    98 	void editOpenMultipleVymLinks();
    99 public slots:
   100     void editHeading();
   101 	void editOpenVymLink();
   102 private slots:
   103 	void editDeleteVymLink();
   104 	void editToggleHideExport();
   105 	void editMapInfo();
   106     void editMoveUp();	
   107     void editMoveDown();	
   108     void editToggleScroll();
   109     void editUnScrollAll();
   110     void editNewBranch();
   111     void editNewBranchHere();
   112     void editNewBranchAbove();
   113     void editNewBranchBelow();
   114     void editImportAdd();
   115     void editImportReplace();
   116     void editSaveBranch();
   117     void editRemoveBranchKeepChilds();
   118     void editRemoveChilds();
   119     void editDeleteSelection();
   120     void editUpperBranch();
   121     void editLowerBranch();
   122     void editLeftBranch();
   123     void editRightBranch();
   124     void editFirstBranch();
   125     void editLastBranch();
   126     void editLoadImage();
   127     void editSaveImage();
   128     void editFollowXLink (QAction *);
   129     void editEditXLink (QAction *);
   130 
   131     void formatSelectColor();
   132     void formatPickColor();
   133     void colorChanged(QColor);
   134     void formatColorItem();
   135     void formatColorBranch();
   136 	void formatLinkStyleLine();
   137 	void formatLinkStyleParabel();
   138 	void formatLinkStylePolyLine();
   139 	void formatLinkStylePolyParabel();
   140     void formatSelectBackColor();
   141     void formatSelectLinkColor();
   142     void formatToggleLinkColorHint();
   143 	void formatFrameNone();
   144 	void formatFrameRectangle();
   145 	void formatIncludeImagesVer();
   146 	void formatIncludeImagesHor();
   147 	void formatHideLinkUnselected();
   148 
   149     void viewZoomReset();
   150     void viewZoomIn();
   151     void viewZoomOut();
   152 
   153 public slots:
   154 	bool settingsPDF();
   155 	bool settingsURL();
   156 	void settingsToggleDelKey();
   157 
   158 	void windowToggleNoteEditor();
   159 	void windowToggleHistory();
   160 	void updateNoteFlag();
   161 	void updateActions();
   162 	ModMode getModMode();
   163 	bool autoEdit();
   164 	bool autoSelectHeading();
   165 	bool useFlagGroups();
   166 
   167 private slots:
   168 	void windowNextEditor();
   169 	void windowPreviousEditor();
   170 	void windowShowNoteEditor();
   171 	void windowHideNoteEditor();
   172 
   173 	void standardFlagChanged();
   174 
   175     void testFunction();
   176 
   177     void helpDoc();
   178     void helpAbout();
   179     void helpAboutQT();
   180 
   181 private:
   182 	QTabWidget *tabWidget;
   183 	FindWindow *findWindow;
   184 	QStringList lastMaps;
   185 	int maxLastMaps;
   186 	QProcess *procBrowser;
   187 
   188 	QStringList imageTypes;
   189 
   190 	QLineEdit *lineedit;	// to enter headings of branches
   191 	QString editSel;
   192 
   193 	Q3PtrList <QAction> actionListBranches;
   194 
   195 	QAction* actionFileSave;
   196 	QAction* actionFilePrint;
   197 	QAction* actionEditUndo;
   198 	QAction* actionEditRedo;
   199 	QAction *actionEditCopy;
   200 	QAction *actionEditCut;
   201 	QAction *actionEditPaste;
   202 	QAction *actionEditMoveUp;
   203 	QAction *actionEditMoveDown;
   204 	QAction *actionEditToggleScroll;
   205 	QAction* actionEditOpenURL;
   206 	QAction* actionEditOpenURLTab;
   207 	QAction* actionEditOpenMultipleURLTabs;
   208 	QAction* actionEditURL;
   209 	QAction* actionEditHeading2URL;
   210 	QAction* actionEditBugzilla2URL;
   211 	QAction* actionEditFATE2URL;
   212 	QAction *actionEditOpenVymLink;
   213 	QAction *actionEditOpenMultipleVymLinks;
   214 	QAction *actionEditVymLink;
   215 	QAction *actionEditDeleteVymLink;
   216 	QAction *actionEditToggleHideExport;
   217 	QAction *actionEditMapInfo;
   218 	QAction *actionEditHeading;
   219 	QAction *actionEditDelete;
   220 	QAction *actionEditAddBranch;
   221 	QAction *actionEditAddBranchHere;
   222 	QAction *actionEditAddBranchAbove;
   223 	QAction *actionEditAddBranchBelow;
   224 	QAction *actionEditRemoveBranchKeepChilds;
   225 	QAction *actionEditRemoveChilds;
   226 	QAction *actionEditImportAdd;
   227 	QAction *actionEditImportReplace;
   228 	QAction *actionEditSaveBranch;
   229 	QAction *actionEditSelectFirst;
   230 	QAction *actionEditSelectLast;
   231 	QAction *actionEditLoadImage;
   232 
   233 	QAction* actionFormatColor;
   234 	QAction* actionFormatPickColor;
   235 	QAction* actionFormatColorBranch;
   236 	QAction* actionFormatColorSubtree;
   237 	QAction* actionFormatLinkColorHint;
   238 	QAction* actionFormatBackColor;
   239 	QAction* actionFormatLinkColor;
   240 	QAction *actionFormatIncludeImagesVer;
   241 	QAction *actionFormatIncludeImagesHor;
   242 
   243 	QActionGroup* actionGroupModModes;
   244 	QAction* actionModModeColor;
   245 	QAction* actionModModeXLink;
   246 	QAction* actionModModeCopy;
   247 
   248 	QActionGroup *actionGroupFormatFrameTypes;
   249 	QAction *actionFormatFrameNone;
   250 	QAction *actionFormatFrameRectangle;
   251 
   252 	QActionGroup *actionGroupFormatLinkStyles;
   253 	QAction *actionFormatLinkStyleLine;
   254 	QAction *actionFormatLinkStyleParabel;
   255 	QAction *actionFormatLinkStylePolyLine;
   256 	QAction *actionFormatLinkStylePolyParabel;
   257 	QAction *actionFormatHideLinkUnselected;
   258 
   259 	QAction *actionViewToggleNoteEditor;
   260 	QAction *actionViewToggleHistoryWindow;
   261 
   262 	QAction* actionSettingsAutoEdit;
   263 	QAction* actionSettingsAutoSelectHeading;
   264 	QAction* actionSettingsAutoSelectText;
   265 	QAction* actionSettingsUseDelKey;
   266 	QAction* actionSettingsUseFlagGroups;
   267 	QAction* actionSettingsUseHideExport;
   268 };
   269 
   270 
   271 #endif
   272