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