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