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