1.1 --- a/mainwindow.h Sun Jan 30 12:58:47 2005 +0000
1.2 +++ b/mainwindow.h Fri Jul 24 08:55:40 2009 +0000
1.3 @@ -1,34 +1,38 @@
1.4 #ifndef MAINWINDOW_H
1.5 #define MAINWINDOW_H
1.6
1.7 -#include <qpopupmenu.h>
1.8 -#include <qmainwindow.h>
1.9 -#include <qtextedit.h>
1.10 -#include <qintdict.h>
1.11 -#include <qcanvas.h>
1.12 -#include <qlineedit.h>
1.13 -#include <qaction.h>
1.14 -#include <qcursor.h>
1.15 -#include <qtabwidget.h>
1.16 -#include <qmap.h>
1.17 +#include <QMainWindow>
1.18
1.19 -#include "xml.h"
1.20 +#include "branchpropwindow.h"
1.21 +#include "file.h"
1.22 +#include "findwindow.h"
1.23 +#include "historywindow.h"
1.24 +#include "mapeditor.h"
1.25 +#include "simplescripteditor.h"
1.26 #include "texteditor.h"
1.27 -#include "mapeditor.h"
1.28 -#include "findwindow.h"
1.29 +
1.30
1.31 class Main : public QMainWindow
1.32 {
1.33 Q_OBJECT
1.34
1.35 public:
1.36 - Main(QWidget* parent=0, const char* name=0, WFlags f=0);
1.37 + /*! Modifier modes are used when CTRL together with a mouse button is pressed */
1.38 + enum ModMode {
1.39 + ModModeNone, //!< Unused
1.40 + ModModeColor, //!< Pick color from object
1.41 + ModModeCopy, //!< Copy object
1.42 + ModModeXLink //!< Create a XLink (XLinkObj) from selected object
1.43 + };
1.44 +
1.45 + Main(QWidget* parent=0, const char* name=0, Qt::WFlags f=0);
1.46 ~Main();
1.47 void loadCmdLine();
1.48 void statusMessage (const QString &);
1.49
1.50 public slots:
1.51 void fileNew();
1.52 + void fileNewCopy();
1.53
1.54 protected:
1.55 void closeEvent( QCloseEvent* );
1.56 @@ -38,72 +42,107 @@
1.57 void setupEditActions();
1.58 void setupFormatActions();
1.59 void setupViewActions();
1.60 + void setupModeActions();
1.61 void setupWindowActions();
1.62 + void setupFlag(FlagObj *fo, QToolBar *tb, bool aw, const QString &name, const QString &tooltip);
1.63 void setupFlagActions();
1.64 + void setupNetworkActions();
1.65 void setupSettingsActions();
1.66 void setupTestActions();
1.67 void setupHelpActions();
1.68 void setupContextMenus();
1.69 - void setupLastMapsMenu();
1.70 + void setupRecentMapsMenu();
1.71 + void setupMacros();
1.72 void hideEvent (QHideEvent * );
1.73 void showEvent (QShowEvent * );
1.74 - bool reallyWriteDirectory(const QString&);
1.75 - QString browseDirectory(const QString&);
1.76 MapEditor* currentMapEditor() const;
1.77
1.78 private slots:
1.79 - void newView();
1.80 void editorChanged(QWidget*);
1.81
1.82 - void fileLoad(QString ,const LoadMode &);
1.83 + ErrorCode fileLoad(QString ,const LoadMode &, const FileType & ftype=VymMap);
1.84 void fileLoad(const LoadMode &);
1.85 void fileLoad();
1.86 - void fileLoadLast(int);
1.87 - void fileSave(const SaveMode & );
1.88 + void fileLoadRecent();
1.89 + void addRecentMap (const QString &);
1.90 + void fileSave(MapEditor*, const SaveMode & );
1.91 void fileSave();
1.92 +public slots:
1.93 + void fileSave(MapEditor *); // autosave from MapEditor
1.94 +private slots:
1.95 void fileSaveAs(const SaveMode &);
1.96 void fileSaveAs();
1.97 + void fileImportKDE3Bookmarks();
1.98 + void fileImportKDE4Bookmarks();
1.99 + void fileImportFirefoxBookmarks();
1.100 + void fileImportFreemind();
1.101 + void fileImportMM();
1.102 void fileImportDir();
1.103 void fileExportXML();
1.104 - void fileExportHTML();
1.105 void fileExportXHTML();
1.106 - void fileExportImage(int);
1.107 + void fileExportImage();
1.108 void fileExportASCII();
1.109 + void fileExportCSV();
1.110 + void fileExportLaTeX();
1.111 + void fileExportKDE3Bookmarks();
1.112 + void fileExportKDE4Bookmarks();
1.113 + void fileExportTaskjuggler();
1.114 + void fileExportOOPresentation();
1.115 void fileCloseMap();
1.116 void filePrint();
1.117 void fileExitVYM();
1.118
1.119 +public slots:
1.120 void editUndo();
1.121 void editRedo();
1.122 + void gotoHistoryStep (int);
1.123 +private slots:
1.124 void editCopy();
1.125 void editPaste();
1.126 void editCut();
1.127 void editOpenFindWindow();
1.128 void editFind(QString);
1.129 void editFindChanged();
1.130 +private:
1.131 + void openTabs(QStringList);
1.132 public slots:
1.133 void editOpenURL();
1.134 + void editOpenURLTab();
1.135 private slots:
1.136 + void editOpenMultipleURLTabs();
1.137 void editURL();
1.138 + void editLocalURL();
1.139 void editHeading2URL();
1.140 void editBugzilla2URL();
1.141 + void editFATE2URL();
1.142 + void openVymLinks(const QStringList &);
1.143 void editVymLink();
1.144 + void editOpenMultipleVymLinks();
1.145 + void editHeadingFinished();
1.146 + void editAttributeFinished();
1.147 public slots:
1.148 + void editHeading();
1.149 + void editAttribute();
1.150 void editOpenVymLink();
1.151 private slots:
1.152 void editDeleteVymLink();
1.153 + void editToggleHideExport();
1.154 void editMapInfo();
1.155 void editMoveUp();
1.156 void editMoveDown();
1.157 + void editSortChildren();
1.158 void editToggleScroll();
1.159 - void editUnScrollAll();
1.160 - void editHeading();
1.161 + void editUnscrollChilds();
1.162 + void editAddMapCenter();
1.163 void editNewBranch();
1.164 + void editNewBranchBefore();
1.165 void editNewBranchAbove();
1.166 void editNewBranchBelow();
1.167 void editImportAdd();
1.168 void editImportReplace();
1.169 void editSaveBranch();
1.170 + void editDeleteKeepChilds();
1.171 + void editDeleteChilds();
1.172 void editDeleteSelection();
1.173 void editUpperBranch();
1.174 void editLowerBranch();
1.175 @@ -112,33 +151,61 @@
1.176 void editFirstBranch();
1.177 void editLastBranch();
1.178 void editLoadImage();
1.179 - void editSaveImage(int);
1.180 - void editToggleFloatExport();
1.181 + void editSaveImage();
1.182 + void editFollowXLink (QAction *);
1.183 + void editEditXLink (QAction *);
1.184
1.185 void formatSelectColor();
1.186 void formatPickColor();
1.187 void colorChanged(QColor);
1.188 - void formatColorItem();
1.189 void formatColorBranch();
1.190 + void formatColorSubtree();
1.191 void formatLinkStyleLine();
1.192 void formatLinkStyleParabel();
1.193 void formatLinkStylePolyLine();
1.194 void formatLinkStylePolyParabel();
1.195 void formatSelectBackColor();
1.196 + void formatSelectBackImage();
1.197 void formatSelectLinkColor();
1.198 + void formatSelectSelectionColor();
1.199 void formatToggleLinkColorHint();
1.200 - void formatFrameNone();
1.201 - void formatFrameRectangle();
1.202 + void formatHideLinkUnselected();
1.203
1.204 void viewZoomReset();
1.205 void viewZoomIn();
1.206 void viewZoomOut();
1.207 + void viewCenter();
1.208
1.209 public slots:
1.210 + void networkStartServer();
1.211 + void networkConnect();
1.212 bool settingsPDF();
1.213 bool settingsURL();
1.214 + void settingsMacroDir();
1.215 + void settingsToggleDelKey();
1.216 + void settingsUndoLevels();
1.217 + void settingsAutosaveToggle();
1.218 + void settingsAutosaveTime();
1.219 + void settingsWriteBackupFileToggle();
1.220 + void settingsToggleAnimation();
1.221
1.222 void windowToggleNoteEditor();
1.223 + void windowToggleHistory();
1.224 + void windowToggleProperty();
1.225 + void updateHistory(SimpleSettings &);
1.226 + void windowToggleAntiAlias();
1.227 + void windowToggleSmoothPixmap();
1.228 + void updateNoteFlag();
1.229 + void updateSatellites(MapEditor *);
1.230 + void updateActions();
1.231 + ModMode getModMode();
1.232 + bool autoEditNewBranch();
1.233 + bool autoSelectNewBranch();
1.234 + bool useFlagGroups();
1.235 + void setScript(const QString &);
1.236 + void runScript(const QString &);
1.237 + void runScriptEverywhere (const QString &);
1.238 +
1.239 private slots:
1.240 void windowNextEditor();
1.241 void windowPreviousEditor();
1.242 @@ -147,20 +214,129 @@
1.243
1.244 void standardFlagChanged();
1.245
1.246 - void testFunction();
1.247 - void testShowClipboard();
1.248 + void testFunction1();
1.249 + void testFunction2();
1.250 + void testCommand();
1.251
1.252 void helpDoc();
1.253 + void helpDemo();
1.254 void helpAbout();
1.255 void helpAboutQT();
1.256
1.257 + void callMacro ();
1.258 +
1.259 private:
1.260 - QCanvas* canvas;
1.261 QTabWidget *tabWidget;
1.262 FindWindow *findWindow;
1.263 - QStringList lastMaps;
1.264 - int maxLastMaps;
1.265 - QString lastFileDir;
1.266 + QProcess *procBrowser;
1.267 +
1.268 + QStringList imageTypes;
1.269 +
1.270 + QLineEdit *lineedit; // to enter headings of branches
1.271 + QString prevSelection;
1.272 +
1.273 + HistoryWindow *historyWindow;
1.274 +
1.275 + BranchPropertyWindow *branchPropertyWindow;
1.276 + SimpleScriptEditor *scriptEditor;
1.277 +
1.278 + QList <QAction*> actionListBranches;
1.279 +
1.280 + QColor currentColor;
1.281 +
1.282 + int xLinkMenuWidth;
1.283 +
1.284 + QMenu *recentFilesMenu;
1.285 + enum { MaxRecentFiles = 9 };
1.286 + QAction *recentFileActions[MaxRecentFiles];
1.287 +
1.288 + QAction *macroActions[12];
1.289 + QStringList macro;
1.290 +
1.291 + QAction* actionFileNewCopy;
1.292 + QAction* actionFileSave;
1.293 + QAction* actionFilePrint;
1.294 + QAction* actionEditUndo;
1.295 + QAction* actionEditRedo;
1.296 + QAction *actionEditCopy;
1.297 + QAction *actionEditCut;
1.298 + QAction *actionEditPaste;
1.299 + QAction *actionEditMoveUp;
1.300 + QAction *actionEditMoveDown;
1.301 + QAction *actionEditSortChildren;
1.302 + QAction *actionEditToggleScroll;
1.303 + QAction* actionEditOpenURL;
1.304 + QAction* actionEditOpenURLTab;
1.305 + QAction* actionEditOpenMultipleURLTabs;
1.306 + QAction* actionEditURL;
1.307 + QAction* actionEditLocalURL;
1.308 + QAction* actionEditHeading2URL;
1.309 + QAction* actionEditBugzilla2URL;
1.310 + QAction* actionEditFATE2URL;
1.311 + QAction *actionEditOpenVymLink;
1.312 + QAction *actionEditOpenMultipleVymLinks;
1.313 + QAction *actionEditVymLink;
1.314 + QAction *actionEditDeleteVymLink;
1.315 + QAction *actionEditToggleHideExport;
1.316 + QAction *actionEditMapInfo;
1.317 + QAction *actionEditHeading;
1.318 + QAction *actionEditDelete;
1.319 + QAction *actionEditAddMapCenter;
1.320 + QAction *actionEditAddBranch;
1.321 + QAction *actionEditAddBranchBefore;
1.322 + QAction *actionEditAddBranchAbove;
1.323 + QAction *actionEditAddBranchBelow;
1.324 + QAction *actionEditDeleteKeepChilds;
1.325 + QAction *actionEditDeleteChilds;
1.326 + QAction *actionEditImportAdd;
1.327 + QAction *actionEditImportReplace;
1.328 + QAction *actionEditSaveBranch;
1.329 + QAction *actionEditSelectFirst;
1.330 + QAction *actionEditSelectLast;
1.331 + QAction *actionEditLoadImage;
1.332 +
1.333 + QAction* actionFormatColor;
1.334 + QAction* actionFormatPickColor;
1.335 + QAction* actionFormatColorBranch;
1.336 + QAction* actionFormatColorSubtree;
1.337 + QAction* actionFormatLinkColorHint;
1.338 + QAction* actionFormatBackColor;
1.339 + QAction* actionFormatBackImage;
1.340 + QAction* actionFormatLinkColor;
1.341 + QAction* actionFormatSelectionColor;
1.342 +
1.343 + QActionGroup* actionGroupModModes;
1.344 + QAction* actionModModeColor;
1.345 + QAction* actionModModeXLink;
1.346 + QAction* actionModModeCopy;
1.347 +
1.348 + QActionGroup *actionGroupFormatFrameTypes;
1.349 +
1.350 +
1.351 + QActionGroup *actionGroupFormatLinkStyles;
1.352 + QAction *actionFormatLinkStyleLine;
1.353 + QAction *actionFormatLinkStyleParabel;
1.354 + QAction *actionFormatLinkStylePolyLine;
1.355 + QAction *actionFormatLinkStylePolyParabel;
1.356 + QAction *actionFormatHideLinkUnselected;
1.357 +
1.358 + QAction *actionViewToggleNoteEditor;
1.359 + QAction *actionViewToggleHistoryWindow;
1.360 + QAction *actionViewTogglePropertyWindow;
1.361 + QAction *actionViewToggleAntiAlias;
1.362 + QAction *actionViewToggleSmoothPixmapTransform;
1.363 + QAction* actionViewCenter;
1.364 +
1.365 + QAction* actionSettingsAutoEditNewBranch;
1.366 + QAction* actionSettingsAutoSelectNewBranch;
1.367 + QAction* actionSettingsAutoSelectText;
1.368 + QAction* actionSettingsUseDelKey;
1.369 + QAction* actionSettingsUseFlagGroups;
1.370 + QAction* actionSettingsUseHideExport;
1.371 + QAction* actionSettingsAutosaveToggle;
1.372 + QAction* actionSettingsAutosaveTime;
1.373 + QAction* actionSettingsWriteBackupFile;
1.374 + QAction* actionSettingsUseAnimation;
1.375 };
1.376
1.377