mainwindow.h
author insilmaril
Tue, 29 Aug 2006 08:31:42 +0000
branchqt4-port
changeset 16 41c3d7f9f532
parent 15 699f28529079
child 17 557239819c45
permissions -rw-r--r--
Runs basically on Mac now. Undo debug output still enabled
     1 #ifndef MAINWINDOW_H 
     2 #define MAINWINDOW_H
     3 
     4 #include <QAction>
     5 #include <QCursor>
     6 #include <QMainWindow>
     7 #include <QProcess>
     8 #include <QToolBar>
     9 #include <QTabWidget>
    10 //Added by qt3to4:
    11 #include <QCloseEvent>
    12 #include <QShowEvent>
    13 #include <QHideEvent>
    14 
    15 #include "file.h"
    16 #include "findwindow.h"
    17 #include "mapeditor.h"
    18 #include "texteditor.h"
    19 #include "xml.h"
    20 
    21 class Main : public QMainWindow 
    22 {
    23     Q_OBJECT
    24 
    25 public:
    26     Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
    27     ~Main();
    28 	void loadCmdLine();
    29 	void statusMessage (const QString &);
    30 
    31 public slots:
    32     void fileNew();
    33 
    34 protected:
    35 	void closeEvent( QCloseEvent* );
    36 
    37 private:
    38     void setupFileActions();
    39     void setupEditActions();
    40     void setupFormatActions();
    41     void setupViewActions();
    42     void setupModeActions();
    43     void setupWindowActions();
    44     void setupFlagActions();
    45     void setupSettingsActions();
    46     void setupTestActions();
    47     void setupHelpActions();
    48     void setupContextMenus();
    49 	void setupLastMapsMenu();
    50 	void hideEvent (QHideEvent * );
    51 	void showEvent (QShowEvent * );
    52 	bool reallyWriteDirectory(const QString&);
    53 	QString browseDirectory(const QString&);
    54 	MapEditor* currentMapEditor() const;
    55     
    56 private slots:
    57     void newView();
    58 	void editorChanged(QWidget*);
    59 
    60     ErrorCode fileLoad(QString ,const LoadMode &);
    61     void fileLoad(const LoadMode &);
    62     void fileLoad();
    63 	void fileLoadLast(QAction *);
    64     void fileSave(const SaveMode & );
    65     void fileSave();
    66     void fileSaveAs(const SaveMode &);
    67     void fileSaveAs();
    68     void fileImportKDEBookmarks();
    69     void fileImportFirefoxBookmarks();
    70     void fileImportMM();
    71     void fileImportDir();
    72     void fileExportXML();
    73     void fileExportXHTML();
    74     void fileExportImage();
    75     void fileExportASCII();
    76     void fileExportLaTeX();
    77     void fileExportKDEBookmarks();
    78     void fileExportTaskjuggler();
    79     void fileExportOOPresentation();
    80     void fileCloseMap();
    81     void filePrint();
    82     void fileExitVYM();
    83 
    84     void editUndo();	
    85     void editRedo();	
    86     void editCopy();	
    87     void editPaste();	
    88     void editCut();	
    89     void editOpenFindWindow();
    90 	void editFind(QString);
    91 	void editFindChanged();
    92 private:
    93 	void openTabs(QStringList);
    94 public slots:
    95 	void editOpenURL();
    96 	void editOpenURLTab();
    97 private slots:
    98 	void editOpenMultipleURLTabs();
    99 	void editURL();
   100 	void editHeading2URL();
   101 	void editBugzilla2URL();
   102 	void editFATE2URL();
   103 	void editVymLink();
   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 editNewBranchHere();
   117     void editNewBranchAbove();
   118     void editNewBranchBelow();
   119     void editImportAdd();
   120     void editImportReplace();
   121     void editSaveBranch();
   122     void editRemoveBranchKeepChilds();
   123     void editRemoveChilds();
   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 formatSelectLinkColor();
   147     void formatToggleLinkColorHint();
   148 	void formatFrameNone();
   149 	void formatFrameRectangle();
   150 	void formatIncludeImagesVer();
   151 	void formatIncludeImagesHor();
   152 	void formatHideLinkUnselected();
   153 
   154     void viewZoomReset();
   155     void viewZoomIn();
   156     void viewZoomOut();
   157 
   158 	void modModeColor();
   159 	void modModeLink();
   160 
   161 public slots:
   162 	bool settingsPDF();
   163 	bool settingsURL();
   164 	void settingsToggleDelKey();
   165 
   166 	void windowToggleNoteEditor();
   167 	void windowToggleHistory();
   168 	void updateNoteFlag();
   169 
   170 private slots:
   171 	void windowNextEditor();
   172 	void windowPreviousEditor();
   173 	void windowShowNoteEditor();
   174 	void windowHideNoteEditor();
   175 
   176 	void standardFlagChanged();
   177 
   178     void testFunction();
   179 
   180     void helpDoc();
   181     void helpAbout();
   182     void helpAboutQT();
   183 
   184 private:
   185 	QTabWidget *tabWidget;
   186 	FindWindow *findWindow;
   187 	QStringList lastMaps;
   188 	int maxLastMaps;
   189 	QProcess *procBrowser;
   190 
   191 	QStringList imageTypes;
   192 
   193 	QLineEdit *lineedit;	// to enter headings of branches
   194 };
   195 
   196 
   197 #endif
   198