mainwindow.h
author insilmaril
Mon Mar 30 07:50:51 2009 +0000 (2009-03-30)
branchrelease-1-12-maintained
changeset 63 e4d3a9313d04
parent 0 7a96bd401351
permissions -rw-r--r--
Fixed export to KDE3 bookmarks
     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 
    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, bool aw, 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 &, const FileType & ftype=VymMap);
    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 fileImportKDE3Bookmarks();
    76     void fileImportKDE4Bookmarks();
    77     void fileImportFirefoxBookmarks();
    78     void fileImportFreemind();
    79     void fileImportMM();
    80     void fileImportDir();
    81     void fileExportXML();
    82     void fileExportXHTML();
    83     void fileExportImage();
    84     void fileExportASCII();
    85     void fileExportCSV();
    86     void fileExportLaTeX();
    87     void fileExportKDE3Bookmarks();
    88     void fileExportKDE4Bookmarks();
    89     void fileExportTaskjuggler();
    90     void fileExportOOPresentation();
    91     void fileCloseMap();
    92     void filePrint();
    93     void fileExitVYM();
    94 
    95 public slots:
    96     void editUndo();	
    97     void editRedo();	
    98 	void gotoHistoryStep (int);
    99 private slots:	
   100     void editCopy();	
   101     void editPaste();	
   102     void editCut();	
   103     void editOpenFindWindow();
   104 	void editFind(QString);
   105 	void editFindChanged();
   106 private:
   107 	void openTabs(QStringList);
   108 public slots:
   109 	void editOpenURL();
   110 	void editOpenURLTab();
   111 private slots:
   112 	void editOpenMultipleURLTabs();
   113 	void editURL();
   114 	void editLocalURL();
   115 	void editHeading2URL();
   116 	void editBugzilla2URL();
   117 	void editFATE2URL();
   118 	void openVymLinks(const QStringList &);
   119 	void editVymLink();
   120 	void editOpenMultipleVymLinks();
   121     void editHeadingFinished();
   122     void editAttributeFinished();
   123 public slots:
   124     void editHeading();
   125     void editAttribute();
   126 	void editOpenVymLink();
   127 private slots:
   128 	void editDeleteVymLink();
   129 	void editToggleHideExport();
   130 	void editMapInfo();
   131     void editMoveUp();	
   132     void editMoveDown();	
   133 	void editSortChildren();
   134     void editToggleScroll();
   135     void editUnscrollChilds();
   136     void editAddMapCenter();
   137     void editNewBranch();
   138     void editNewBranchBefore();
   139     void editNewBranchAbove();
   140     void editNewBranchBelow();
   141     void editImportAdd();
   142     void editImportReplace();
   143     void editSaveBranch();
   144     void editDeleteKeepChilds();
   145     void editDeleteChilds();
   146     void editDeleteSelection();
   147     void editUpperBranch();
   148     void editLowerBranch();
   149     void editLeftBranch();
   150     void editRightBranch();
   151     void editFirstBranch();
   152     void editLastBranch();
   153     void editLoadImage();
   154     void editSaveImage();
   155     void editFollowXLink (QAction *);
   156     void editEditXLink (QAction *);
   157 
   158     void formatSelectColor();
   159     void formatPickColor();
   160     void colorChanged(QColor);
   161     void formatColorBranch();
   162     void formatColorSubtree();
   163 	void formatLinkStyleLine();
   164 	void formatLinkStyleParabel();
   165 	void formatLinkStylePolyLine();
   166 	void formatLinkStylePolyParabel();
   167     void formatSelectBackColor();
   168     void formatSelectBackImage();
   169     void formatSelectLinkColor();
   170     void formatSelectSelectionColor();
   171     void formatToggleLinkColorHint();
   172 	void formatHideLinkUnselected();
   173 
   174     void viewZoomReset();
   175     void viewZoomIn();
   176     void viewZoomOut();
   177     void viewCenter();
   178 
   179 public slots:
   180 	void networkStartServer();
   181 	void networkConnect();
   182 	bool settingsPDF();
   183 	bool settingsURL();
   184 	void settingsMacroDir();
   185 	void settingsToggleDelKey();
   186 	void settingsUndoLevels();
   187 	void settingsAutosaveToggle();
   188 	void settingsAutosaveTime();
   189 	void settingsWriteBackupFileToggle();
   190 	void settingsToggleAnimation();
   191 
   192 	void windowToggleNoteEditor();
   193 	void windowToggleHistory();
   194 	void windowToggleProperty();
   195 	void updateHistory(SimpleSettings &);
   196 	void windowToggleAntiAlias();
   197 	void windowToggleSmoothPixmap();
   198 	void updateNoteFlag();
   199 	void updateSatellites(MapEditor *);
   200 	void updateActions();
   201 	ModMode getModMode();
   202 	bool autoEditNewBranch();
   203 	bool autoSelectNewBranch();
   204 	bool useFlagGroups();
   205 	void setScript(const QString &);
   206 	void runScript(const QString &);
   207 	void runScriptEverywhere (const QString &);
   208 
   209 private slots:
   210 	void windowNextEditor();
   211 	void windowPreviousEditor();
   212 	void windowShowNoteEditor();
   213 	void windowHideNoteEditor();
   214 
   215 	void standardFlagChanged();
   216 
   217     void testFunction1();
   218     void testFunction2();
   219     void testCommand();
   220 
   221     void helpDoc();
   222     void helpDemo();
   223     void helpAbout();
   224     void helpAboutQT();
   225 
   226 	void callMacro ();
   227 
   228 private:
   229 	QTabWidget *tabWidget;
   230 	FindWindow *findWindow;
   231 	QProcess *procBrowser;
   232 
   233 	QStringList imageTypes;
   234 
   235 	QLineEdit *lineedit;	// to enter headings of branches
   236 	QString prevSelection;
   237 
   238 	HistoryWindow *historyWindow;
   239 
   240 	BranchPropertyWindow *branchPropertyWindow;
   241 	SimpleScriptEditor *scriptEditor;
   242 
   243 	QList <QAction*> actionListBranches;
   244 
   245 	QColor currentColor;
   246 
   247 	int xLinkMenuWidth;
   248 
   249 	QMenu *recentFilesMenu;
   250 	enum { MaxRecentFiles = 9 };
   251     QAction *recentFileActions[MaxRecentFiles];
   252 
   253     QAction *macroActions[12];
   254 	QStringList macro;
   255 
   256 	QAction* actionFileNewCopy;
   257 	QAction* actionFileSave;
   258 	QAction* actionFilePrint;
   259 	QAction* actionEditUndo;
   260 	QAction* actionEditRedo;
   261 	QAction *actionEditCopy;
   262 	QAction *actionEditCut;
   263 	QAction *actionEditPaste;
   264 	QAction *actionEditMoveUp;
   265 	QAction *actionEditMoveDown;
   266 	QAction *actionEditSortChildren;
   267 	QAction *actionEditToggleScroll;
   268 	QAction* actionEditOpenURL;
   269 	QAction* actionEditOpenURLTab;
   270 	QAction* actionEditOpenMultipleURLTabs;
   271 	QAction* actionEditURL;
   272 	QAction* actionEditLocalURL;
   273 	QAction* actionEditHeading2URL;
   274 	QAction* actionEditBugzilla2URL;
   275 	QAction* actionEditFATE2URL;
   276 	QAction *actionEditOpenVymLink;
   277 	QAction *actionEditOpenMultipleVymLinks;
   278 	QAction *actionEditVymLink;
   279 	QAction *actionEditDeleteVymLink;
   280 	QAction *actionEditToggleHideExport;
   281 	QAction *actionEditMapInfo;
   282 	QAction *actionEditHeading;
   283 	QAction *actionEditDelete;
   284 	QAction *actionEditAddMapCenter;
   285 	QAction *actionEditAddBranch;
   286 	QAction *actionEditAddBranchBefore;
   287 	QAction *actionEditAddBranchAbove;
   288 	QAction *actionEditAddBranchBelow;
   289 	QAction *actionEditDeleteKeepChilds;
   290 	QAction *actionEditDeleteChilds;
   291 	QAction *actionEditImportAdd;
   292 	QAction *actionEditImportReplace;
   293 	QAction *actionEditSaveBranch;
   294 	QAction *actionEditSelectFirst;
   295 	QAction *actionEditSelectLast;
   296 	QAction *actionEditLoadImage;
   297 
   298 	QAction* actionFormatColor;
   299 	QAction* actionFormatPickColor;
   300 	QAction* actionFormatColorBranch;
   301 	QAction* actionFormatColorSubtree;
   302 	QAction* actionFormatLinkColorHint;
   303 	QAction* actionFormatBackColor;
   304 	QAction* actionFormatBackImage;
   305 	QAction* actionFormatLinkColor;
   306 	QAction* actionFormatSelectionColor;
   307 
   308 	QActionGroup* actionGroupModModes;
   309 	QAction* actionModModeColor;
   310 	QAction* actionModModeXLink;
   311 	QAction* actionModModeCopy;
   312 
   313 	QActionGroup *actionGroupFormatFrameTypes;
   314 
   315 
   316 	QActionGroup *actionGroupFormatLinkStyles;
   317 	QAction *actionFormatLinkStyleLine;
   318 	QAction *actionFormatLinkStyleParabel;
   319 	QAction *actionFormatLinkStylePolyLine;
   320 	QAction *actionFormatLinkStylePolyParabel;
   321 	QAction *actionFormatHideLinkUnselected;
   322 
   323 	QAction *actionViewToggleNoteEditor;
   324 	QAction *actionViewToggleHistoryWindow;
   325 	QAction *actionViewTogglePropertyWindow;
   326 	QAction *actionViewToggleAntiAlias;
   327 	QAction *actionViewToggleSmoothPixmapTransform;
   328 	QAction* actionViewCenter;
   329 
   330 	QAction* actionSettingsAutoEditNewBranch;
   331 	QAction* actionSettingsAutoSelectNewBranch;
   332 	QAction* actionSettingsAutoSelectText;
   333 	QAction* actionSettingsUseDelKey;
   334 	QAction* actionSettingsUseFlagGroups;
   335 	QAction* actionSettingsUseHideExport;
   336 	QAction* actionSettingsAutosaveToggle;
   337 	QAction* actionSettingsAutosaveTime;
   338 	QAction* actionSettingsWriteBackupFile;
   339 	QAction* actionSettingsUseAnimation;
   340 };
   341 
   342 
   343 #endif
   344