mainwindow.h
author insilmaril
Fri Dec 29 13:52:17 2006 +0000 (2006-12-29)
changeset 412 8059b6aa74d7
parent 406 1c8ff1928b97
child 417 1cc7bbf75f0b
permissions -rw-r--r--
Removed some FIXMEs. Added translations
     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 formatSelectBackImage();
   147     void formatSelectLinkColor();
   148     void formatToggleLinkColorHint();
   149 	void formatFrameNone();
   150 	void formatFrameRectangle();
   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 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 	QList <QAction*> actionListBranches;
   204 
   205 	QColor currentColor;
   206 
   207 	QMenu *recentFilesMenu;
   208 	enum { MaxRecentFiles = 9 };
   209     QAction *recentFileActs[MaxRecentFiles];
   210 
   211 	QAction* actionFileSave;
   212 	QAction* actionFilePrint;
   213 	QAction* actionEditUndo;
   214 	QAction* actionEditRedo;
   215 	QAction *actionEditCopy;
   216 	QAction *actionEditCut;
   217 	QAction *actionEditPaste;
   218 	QAction *actionEditMoveUp;
   219 	QAction *actionEditMoveDown;
   220 	QAction *actionEditToggleScroll;
   221 	QAction* actionEditOpenURL;
   222 	QAction* actionEditOpenURLTab;
   223 	QAction* actionEditOpenMultipleURLTabs;
   224 	QAction* actionEditURL;
   225 	QAction* actionEditHeading2URL;
   226 	QAction* actionEditBugzilla2URL;
   227 	QAction* actionEditFATE2URL;
   228 	QAction *actionEditOpenVymLink;
   229 	QAction *actionEditOpenMultipleVymLinks;
   230 	QAction *actionEditVymLink;
   231 	QAction *actionEditDeleteVymLink;
   232 	QAction *actionEditToggleHideExport;
   233 	QAction *actionEditMapInfo;
   234 	QAction *actionEditHeading;
   235 	QAction *actionEditDelete;
   236 	QAction *actionEditAddBranch;
   237 	QAction *actionEditAddBranchBefore;
   238 	QAction *actionEditAddBranchAbove;
   239 	QAction *actionEditAddBranchBelow;
   240 	QAction *actionEditDeleteKeepChilds;
   241 	QAction *actionEditDeleteChilds;
   242 	QAction *actionEditImportAdd;
   243 	QAction *actionEditImportReplace;
   244 	QAction *actionEditSaveBranch;
   245 	QAction *actionEditSelectFirst;
   246 	QAction *actionEditSelectLast;
   247 	QAction *actionEditLoadImage;
   248 
   249 	QAction* actionFormatColor;
   250 	QAction* actionFormatPickColor;
   251 	QAction* actionFormatColorBranch;
   252 	QAction* actionFormatColorSubtree;
   253 	QAction* actionFormatLinkColorHint;
   254 	QAction* actionFormatBackColor;
   255 	QAction* actionFormatBackImage;
   256 	QAction* actionFormatLinkColor;
   257 	QAction *actionFormatIncludeImagesVer;
   258 	QAction *actionFormatIncludeImagesHor;
   259 
   260 	QActionGroup* actionGroupModModes;
   261 	QAction* actionModModeColor;
   262 	QAction* actionModModeXLink;
   263 	QAction* actionModModeCopy;
   264 
   265 	QActionGroup *actionGroupFormatFrameTypes;
   266 	QAction *actionFormatFrameNone;
   267 	QAction *actionFormatFrameRectangle;
   268 
   269 	QActionGroup *actionGroupFormatLinkStyles;
   270 	QAction *actionFormatLinkStyleLine;
   271 	QAction *actionFormatLinkStyleParabel;
   272 	QAction *actionFormatLinkStylePolyLine;
   273 	QAction *actionFormatLinkStylePolyParabel;
   274 	QAction *actionFormatHideLinkUnselected;
   275 
   276 	QAction *actionViewToggleNoteEditor;
   277 	QAction *actionViewToggleHistoryWindow;
   278 	QAction *actionViewToggleAntiAlias;
   279 	QAction *actionViewToggleSmoothPixmapTransform;
   280 
   281 	QAction* actionSettingsAutoEdit;
   282 	QAction* actionSettingsAutoSelectHeading;
   283 	QAction* actionSettingsAutoSelectText;
   284 	QAction* actionSettingsUseDelKey;
   285 	QAction* actionSettingsUseFlagGroups;
   286 	QAction* actionSettingsUseHideExport;
   287 };
   288 
   289 
   290 #endif
   291