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