mainwindow.h
author insilmaril
Mon, 30 Oct 2006 12:39:37 +0000
changeset 396 445a5d5ee20b
parent 395 7ced3733ba60
child 401 f364b13047ba
permissions -rw-r--r--
Spanish doc is found, if LANG is set. Fixed wrong position of floatimages
     1 #ifndef MAINWINDOW_H 
     2 #define MAINWINDOW_H
     3 
     4 #include <QMainWindow>
     5 
     6 #include "file.h"
     7 #include "findwindow.h"
     8 #include "mapeditor.h"
     9 #include "texteditor.h"
    10 #include "xml.h"
    11 
    12 enum ModMode {ModModeNone,ModModeColor,ModModeCopy,ModModeXLink};
    13 
    14 class Main : public QMainWindow 
    15 {
    16     Q_OBJECT
    17 
    18 public:
    19     Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
    20     ~Main();
    21 	void loadCmdLine();
    22 	void statusMessage (const QString &);
    23 
    24 public slots:
    25     void fileNew();
    26 
    27 protected:
    28 	void closeEvent( QCloseEvent* );
    29 
    30 private:
    31     void setupFileActions();
    32     void setupEditActions();
    33     void setupFormatActions();
    34     void setupViewActions();
    35     void setupModeActions();
    36     void setupWindowActions();
    37     void setupFlagActions();
    38     void setupSettingsActions();
    39     void setupTestActions();
    40     void setupHelpActions();
    41     void setupContextMenus();
    42 	void setupLastMapsMenu();
    43 	void hideEvent (QHideEvent * );
    44 	void showEvent (QShowEvent * );
    45 	bool reallyWriteDirectory(const QString&);
    46 	QString browseDirectory(const QString&);
    47 	MapEditor* currentMapEditor() const;
    48     
    49 private slots:
    50     void newView();
    51 	void editorChanged(QWidget*);
    52 
    53     ErrorCode fileLoad(QString ,const LoadMode &);
    54     void fileLoad(const LoadMode &);
    55     void fileLoad();
    56 	void fileLoadLast(QAction *);
    57     void fileSave(const SaveMode & );
    58     void fileSave();
    59     void fileSaveAs(const SaveMode &);
    60     void fileSaveAs();
    61     void fileImportKDEBookmarks();
    62     void fileImportFirefoxBookmarks();
    63     void fileImportMM();
    64     void fileImportDir();
    65     void fileExportXML();
    66     void fileExportXHTML();
    67     void fileExportImage();
    68     void fileExportASCII();
    69     void fileExportLaTeX();
    70     void fileExportKDEBookmarks();
    71     void fileExportTaskjuggler();
    72     void fileExportOOPresentation();
    73     void fileCloseMap();
    74     void filePrint();
    75     void fileExitVYM();
    76 
    77     void editUndo();	
    78     void editRedo();	
    79     void editCopy();	
    80     void editPaste();	
    81     void editCut();	
    82     void editOpenFindWindow();
    83 	void editFind(QString);
    84 	void editFindChanged();
    85 private:
    86 	void openTabs(QStringList);
    87 public slots:
    88 	void editOpenURL();
    89 	void editOpenURLTab();
    90 private slots:
    91 	void editOpenMultipleURLTabs();
    92 	void editURL();
    93 	void editHeading2URL();
    94 	void editBugzilla2URL();
    95 	void editFATE2URL();
    96 	void openVymLinks(const QStringList &);
    97 	void editVymLink();
    98 	void editOpenMultipleVymLinks();
    99     void editHeadingFinished();
   100 public slots:
   101     void editHeading();
   102 	void editOpenVymLink();
   103 private slots:
   104 	void editDeleteVymLink();
   105 	void editToggleHideExport();
   106 	void editMapInfo();
   107     void editMoveUp();	
   108     void editMoveDown();	
   109     void editToggleScroll();
   110     void editUnScrollAll();
   111     void editNewBranch();
   112     void editNewBranchBefore();
   113     void editNewBranchAbove();
   114     void editNewBranchBelow();
   115     void editImportAdd();
   116     void editImportReplace();
   117     void editSaveBranch();
   118     void editDeleteKeepChilds();
   119     void editDeleteChilds();
   120     void editDeleteSelection();
   121     void editUpperBranch();
   122     void editLowerBranch();
   123     void editLeftBranch();
   124     void editRightBranch();
   125     void editFirstBranch();
   126     void editLastBranch();
   127     void editLoadImage();
   128     void editSaveImage();
   129     void editFollowXLink (QAction *);
   130     void editEditXLink (QAction *);
   131 
   132     void formatSelectColor();
   133     void formatPickColor();
   134     void colorChanged(QColor);
   135     void formatColorItem();
   136     void formatColorBranch();
   137 	void formatLinkStyleLine();
   138 	void formatLinkStyleParabel();
   139 	void formatLinkStylePolyLine();
   140 	void formatLinkStylePolyParabel();
   141     void formatSelectBackColor();
   142     void formatSelectLinkColor();
   143     void formatToggleLinkColorHint();
   144 	void formatFrameNone();
   145 	void formatFrameRectangle();
   146 	void formatIncludeImagesVer();
   147 	void formatIncludeImagesHor();
   148 	void formatHideLinkUnselected();
   149 
   150     void viewZoomReset();
   151     void viewZoomIn();
   152     void viewZoomOut();
   153 
   154 public slots:
   155 	bool settingsPDF();
   156 	bool settingsURL();
   157 	void settingsToggleDelKey();
   158 
   159 	void windowToggleNoteEditor();
   160 	void windowToggleHistory();
   161 	void updateNoteFlag();
   162 	void updateActions();
   163 	ModMode getModMode();
   164 	bool autoEdit();
   165 	bool autoSelectHeading();
   166 	bool useFlagGroups();
   167 
   168 private slots:
   169 	void windowNextEditor();
   170 	void windowPreviousEditor();
   171 	void windowShowNoteEditor();
   172 	void windowHideNoteEditor();
   173 
   174 	void standardFlagChanged();
   175 
   176     void testFunction();
   177     void testCommand();
   178 
   179     void helpDoc();
   180     void helpAbout();
   181     void helpAboutQT();
   182 
   183 private:
   184 	QTabWidget *tabWidget;
   185 	FindWindow *findWindow;
   186 	QStringList lastMaps;
   187 	int maxLastMaps;
   188 	QProcess *procBrowser;
   189 
   190 	QStringList imageTypes;
   191 
   192 	QLineEdit *lineedit;	// to enter headings of branches
   193 	QString prevSelection;
   194 
   195 	Q3PtrList <QAction> actionListBranches;
   196 
   197 	QColor currentColor;
   198 
   199 	QAction* actionFileSave;
   200 	QAction* actionFilePrint;
   201 	QAction* actionEditUndo;
   202 	QAction* actionEditRedo;
   203 	QAction *actionEditCopy;
   204 	QAction *actionEditCut;
   205 	QAction *actionEditPaste;
   206 	QAction *actionEditMoveUp;
   207 	QAction *actionEditMoveDown;
   208 	QAction *actionEditToggleScroll;
   209 	QAction* actionEditOpenURL;
   210 	QAction* actionEditOpenURLTab;
   211 	QAction* actionEditOpenMultipleURLTabs;
   212 	QAction* actionEditURL;
   213 	QAction* actionEditHeading2URL;
   214 	QAction* actionEditBugzilla2URL;
   215 	QAction* actionEditFATE2URL;
   216 	QAction *actionEditOpenVymLink;
   217 	QAction *actionEditOpenMultipleVymLinks;
   218 	QAction *actionEditVymLink;
   219 	QAction *actionEditDeleteVymLink;
   220 	QAction *actionEditToggleHideExport;
   221 	QAction *actionEditMapInfo;
   222 	QAction *actionEditHeading;
   223 	QAction *actionEditDelete;
   224 	QAction *actionEditAddBranch;
   225 	QAction *actionEditAddBranchBefore;
   226 	QAction *actionEditAddBranchAbove;
   227 	QAction *actionEditAddBranchBelow;
   228 	QAction *actionEditDeleteKeepChilds;
   229 	QAction *actionEditDeleteChilds;
   230 	QAction *actionEditImportAdd;
   231 	QAction *actionEditImportReplace;
   232 	QAction *actionEditSaveBranch;
   233 	QAction *actionEditSelectFirst;
   234 	QAction *actionEditSelectLast;
   235 	QAction *actionEditLoadImage;
   236 
   237 	QAction* actionFormatColor;
   238 	QAction* actionFormatPickColor;
   239 	QAction* actionFormatColorBranch;
   240 	QAction* actionFormatColorSubtree;
   241 	QAction* actionFormatLinkColorHint;
   242 	QAction* actionFormatBackColor;
   243 	QAction* actionFormatLinkColor;
   244 	QAction *actionFormatIncludeImagesVer;
   245 	QAction *actionFormatIncludeImagesHor;
   246 
   247 	QActionGroup* actionGroupModModes;
   248 	QAction* actionModModeColor;
   249 	QAction* actionModModeXLink;
   250 	QAction* actionModModeCopy;
   251 
   252 	QActionGroup *actionGroupFormatFrameTypes;
   253 	QAction *actionFormatFrameNone;
   254 	QAction *actionFormatFrameRectangle;
   255 
   256 	QActionGroup *actionGroupFormatLinkStyles;
   257 	QAction *actionFormatLinkStyleLine;
   258 	QAction *actionFormatLinkStyleParabel;
   259 	QAction *actionFormatLinkStylePolyLine;
   260 	QAction *actionFormatLinkStylePolyParabel;
   261 	QAction *actionFormatHideLinkUnselected;
   262 
   263 	QAction *actionViewToggleNoteEditor;
   264 	QAction *actionViewToggleHistoryWindow;
   265 
   266 	QAction* actionSettingsAutoEdit;
   267 	QAction* actionSettingsAutoSelectHeading;
   268 	QAction* actionSettingsAutoSelectText;
   269 	QAction* actionSettingsUseDelKey;
   270 	QAction* actionSettingsUseFlagGroups;
   271 	QAction* actionSettingsUseHideExport;
   272 };
   273 
   274 
   275 #endif
   276