"Fossies" - the Fresh Open Source Software Archive

Member "vym-2.7.1/mainwindow.h" (14 May 2019, 15997 Bytes) of package /linux/privat/vym-2.7.1.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "mainwindow.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.7.0_vs_2.7.1.

    1 #ifndef MAINWINDOW_H
    2 #define MAINWINDOW_H
    3 
    4 #include <QMainWindow>
    5 #include <QPrinter>
    6 #include <QProgressDialog>
    7 #include <QScriptContext>
    8 #include <QScriptEngine>
    9 #include <QScriptValue>
   10 
   11 #include "branchpropeditor.h"
   12 #include "extrainfodialog.h"
   13 #include "flag.h"
   14 #include "file.h"
   15 #include "historywindow.h"
   16 #include "mapeditor.h"
   17 #include "scripting.h"
   18 #include "texteditor.h"
   19 #include "vymview.h"
   20 
   21 class Main : public QMainWindow 
   22 {
   23     Q_OBJECT
   24 
   25 public:
   26     /*! Modifier modes are used when CTRL together with a mouse button is pressed */
   27     enum ModMode {
   28     ModModeNone,    //!< Unused
   29     ModModeColor,   //!< Pick color from object
   30     ModModeCopy,    //!< Copy object
   31     ModModeXLink    //!< Create a XLink (XLinkObj) from selected object
   32     };
   33 
   34     Main(QWidget* parent=0, Qt::WindowFlags f=0);
   35     ~Main();
   36     void loadCmdLine();
   37 
   38 private:
   39     QProgressDialog progressDialog;
   40     int progressMax;
   41     int progressCounter;
   42     int progressCounterTotal;
   43 public: 
   44     void statusMessage (const QString &);
   45     void setProgressMaximum (int max);
   46     void addProgressValue (float v);
   47     void initProgressCounter(uint n=1);
   48     void removeProgressCounter();
   49 
   50 public slots:
   51     void fileNew();
   52     void fileNewCopy();
   53 
   54 protected:
   55     void closeEvent( QCloseEvent* );
   56 
   57 public:
   58     QPrinter* setupPrinter();
   59 
   60 private:
   61     void setupAPI();
   62 
   63     /*! Helper method to clone actions later in MapEditor */
   64     void cloneActionMapEditor( QAction *a, QKeySequence ks);
   65 
   66     void setupFileActions();
   67     void setupEditActions();
   68     void setupSelectActions();
   69     void setupFormatActions();
   70     void setupViewActions();
   71     void setupModeActions();
   72     void setupWindowActions();
   73     void setupFlag(
   74     Flag *flag, 
   75     QToolBar *tb, 
   76     const QString &name, 
   77     const QString &tooltip,
   78     const QKeySequence &ks=0
   79     );
   80     void setupFlagActions();
   81     void setupNetworkActions();
   82     void setupSettingsActions();
   83     void setupTestActions();
   84     void setupHelpActions();
   85     void setupContextMenus();
   86     void setupRecentMapsMenu();
   87     void setupMacros();
   88     void setupToolbars();
   89     VymView* currentView() const;
   90     VymView* view(const int i);
   91 
   92 public: 
   93     MapEditor* currentMapEditor() const;
   94     VymModel* currentModel() const;
   95     uint currentModelID() const;
   96     uint currentMapIndex() const;
   97     VymModel* getModel(uint);
   98     void gotoModel (VymModel *m);
   99     int modelCount();
  100     void updateTabName(VymModel *vm);
  101     
  102 private slots:
  103     void editorChanged();
  104 
  105 public slots:    
  106     File::ErrorCode fileLoad(QString ,const LoadMode &, const FileType &ftype);
  107     void fileLoad(const LoadMode &);
  108 private slots:
  109     void fileLoad();
  110     void fileSaveSession();
  111 public slots:    
  112     void fileRestoreSession();
  113 private slots:    
  114     void fileLoadRecent();
  115     void addRecentMap (const QString &);
  116     void fileSave(VymModel*, const SaveMode & );
  117     void fileSave();
  118 public slots:   
  119     void fileSave(VymModel*);   // autosave from MapEditor
  120 private slots:  
  121     void fileSaveAs();
  122     void fileSaveAs(const SaveMode &);
  123     void fileImportFirefoxBookmarks();
  124     void fileImportFreemind();
  125     void fileImportMM();
  126     void fileImportDir();
  127     void fileExportXML();
  128     void fileExportHTML();
  129     void fileExportImage();
  130     void fileExportPDF();
  131     void fileExportSVG();
  132     void fileExportAO();
  133     void fileExportASCII();
  134     void fileExportASCIITasks();
  135     void fileExportCSV();
  136     void fileExportOrgMode();
  137     void fileExportLaTeX();
  138     void fileExportMarkdown();
  139     void fileExportTaskjuggler();
  140     void fileExportImpress();
  141     void fileExportLast();
  142     bool fileCloseMap(int i = -1);  // Optionally pass number of tab
  143     void filePrint();
  144     bool fileExitVYM();
  145 
  146 public slots:
  147     void editUndo();    
  148     void editRedo();    
  149     void gotoHistoryStep (int);
  150 private slots:  
  151     void editCopy();    
  152     void editPaste();   
  153     void editCut(); 
  154 
  155 public slots:    
  156     void updateQueries (VymModel*);
  157 private:
  158     bool openURL(const QString &url);
  159     void openTabs(QStringList);
  160 public slots:
  161     void editOpenURL();
  162     void editOpenURLTab();
  163 private slots:
  164     void editOpenMultipleVisURLTabs(bool ignoreScrolled=true);
  165     void editOpenMultipleURLTabs();
  166     void editNote2URLs();
  167     void editURL();
  168     void editLocalURL();
  169     void editHeading2URL();
  170     void getJiraData();
  171     void getJiraDataSubtree();
  172     void editBugzilla2URL();
  173     void getBugzillaData();
  174     void getBugzillaDataSubtree();
  175     void editFATE2URL();
  176     void openVymLinks(const QStringList &, bool background=false);
  177     void editVymLink();
  178     void editOpenMultipleVymLinks();
  179 public slots:
  180     void editHeading();
  181     void editHeadingFinished(VymModel *m);
  182     void editOpenVymLink(bool background=false);
  183     void editOpenVymLinkBackground();
  184 private slots:
  185     void editDeleteVymLink();
  186     void editToggleHideExport();
  187     void editToggleTask();
  188     void editCycleTaskStatus();
  189     void editTaskSleepN();
  190     void editAddTimestamp();
  191     void editMapProperties();
  192     void editMoveUp();  
  193     void editMoveDown();    
  194     void editDetach();  
  195     void editSortChildren();
  196     void editSortBackChildren();
  197     void editToggleScroll();
  198     void editExpandAll();
  199     void editExpandOneLevel();
  200     void editCollapseOneLevel();
  201     void editCollapseUnselected();
  202     void editUnscrollChildren();
  203     void editGrowSelectionSize();
  204     void editShrinkSelectionSize();
  205     void editResetSelectionSize();
  206     void editAddAttribute();
  207     void editAddMapCenter();
  208     void editNewBranch();
  209     void editNewBranchBefore();
  210     void editNewBranchAbove();
  211     void editNewBranchBelow();
  212     void editImportAdd();
  213     void editImportReplace();
  214     void editSaveBranch();
  215     void editDeleteKeepChildren();
  216     void editDeleteChildren();
  217     void editDeleteSelection();
  218     void editLoadImage();
  219     void editSaveImage();
  220     void popupFollowXLink ();
  221     void editFollowXLink (QAction *);
  222     void editEditXLink (QAction *);
  223 
  224 private slots:    
  225     void editToggleTarget();
  226     bool initTargetsMenu( VymModel *model, QMenu *menu);
  227     void editGoToTarget();
  228     void editMoveToTarget();
  229     void editSelectPrevious();
  230     void editSelectNext();
  231     void editSelectNothing();
  232     void editOpenFindResultWidget();
  233     void editFindNext(QString s, bool searchNotesFlag);
  234     void editFindDuplicateURLs();
  235 
  236 public slots:
  237     void formatPickColor();
  238     QColor getCurrentColor();
  239     void setCurrentColor(QColor);
  240 
  241 private slots:    
  242     void formatSelectColor();
  243     void formatColorBranch();
  244     void formatColorSubtree();
  245     void formatLinkStyleLine();
  246     void formatLinkStyleParabel();
  247     void formatLinkStylePolyLine();
  248     void formatLinkStylePolyParabel();
  249     void formatSelectBackColor();
  250     void formatSelectBackImage();
  251     void formatSelectLinkColor();
  252     void formatSelectSelectionColor();
  253     void formatSelectFont();
  254     void formatToggleLinkColorHint();
  255     void formatHideLinkUnselected();
  256 
  257 public slots:
  258     void viewZoomReset();
  259     void viewZoomIn();
  260     void viewZoomOut();
  261     void viewRotateCounterClockwise();
  262     void viewRotateClockwise();
  263     void viewCenter();
  264 
  265 public slots:
  266     void networkStartServer();
  267     void networkConnect();
  268     void downloadFinished();
  269     bool settingsPDF();
  270     bool settingsURL();
  271     void settingsZipTool();
  272     void settingsMacroPath();
  273     void settingsUndoLevels();
  274 
  275 public:
  276     bool useAutosave();
  277     void setAutosave( bool b);
  278 
  279 public slots:
  280     void settingsAutosaveTime();
  281     void settingsDefaultMapAuthor();
  282     void settingsShowParentsLevelTasks();
  283     void settingsShowParentsLevelFindResults();
  284     void settingsToggleAutoLayout();
  285     void settingsToggleWriteBackupFile();
  286     void settingsToggleAnimation();
  287     void settingsToggleDownloads();
  288 
  289     void windowToggleNoteEditor();
  290     void windowToggleTreeEditor();
  291     void windowToggleTaskEditor();
  292     void windowToggleSlideEditor();
  293     void windowToggleScriptEditor();
  294     void windowToggleScriptOutput();
  295     void windowToggleHistory();
  296     void windowToggleProperty();
  297     void windowShowHeadingEditor();
  298     void windowToggleHeadingEditor();
  299     void updateHistory(SimpleSettings &);
  300     void windowToggleAntiAlias();
  301     bool isAliased();
  302     bool hasSmoothPixmapTransform();
  303     void windowToggleSmoothPixmap();
  304     void clearScriptOutput();
  305     void updateHeading();
  306     void updateNoteFlag();
  307     void updateNoteEditor (QModelIndex index);
  308     void selectInNoteEditor (QString s, int i);
  309     void setFocusMapEditor();
  310     void changeSelection (VymModel *model,const QItemSelection &newSel, const QItemSelection &delSel);
  311     void updateDockWidgetTitles(VymModel *model);
  312 
  313     void updateActions();
  314     ModMode getModMode();
  315     bool autoEditNewBranch();
  316     bool autoSelectNewBranch();
  317     QVariant runScript(const QString &);
  318     QObject* getCurrentModelWrapper();
  319     bool gotoWindow (const int &n);
  320 
  321 private slots:
  322     void windowNextEditor();
  323     void windowPreviousEditor();
  324     void nextSlide();
  325     void previousSlide();
  326 
  327     void standardFlagChanged();
  328 
  329     void testFunction1();
  330     void testFunction2();
  331     void toggleWinter();
  332     void toggleHideExport();
  333     void testCommand();
  334 
  335     void helpDoc();
  336     void helpDemo();
  337     void helpShortcuts();
  338     void helpMacros();
  339     void debugInfo();
  340     void helpAbout();
  341     void helpAboutQT();
  342 
  343     void callMacro ();
  344     void downloadReleaseNotesFinished();
  345 
  346 public slots:
  347     void checkReleaseNotes();
  348     bool downloadsEnabled(bool userTriggered = false);
  349     void downloadUpdatesFinished(bool userTriggered = false);
  350     void downloadUpdatesFinishedInt();
  351     void downloadUpdates(bool userTriggered);
  352     void checkUpdates();
  353 
  354 private:
  355     QString shortcutScope;          //! For listing shortcuts
  356     QTabWidget *tabWidget;
  357     qint64 *browserPID;
  358 
  359     QStringList imageTypes;
  360 
  361     QScriptEngine scriptEngine;
  362 
  363     QString prevSelection;
  364 
  365     HistoryWindow *historyWindow;
  366 
  367     QDockWidget *headingEditorDW;
  368     QDockWidget *noteEditorDW;
  369     QDockWidget *scriptEditorDW;
  370 
  371     BranchPropertyEditor *branchPropertyEditor;
  372 
  373 public:
  374     QList <QAction*> mapEditorActions;      //! allows mapEditor to clone actions and shortcuts
  375     QList <QAction*> taskEditorActions;     //! allows taskEditor to clone actions and shortcuts
  376 private:
  377     QList <QAction*> restrictedMapActions;  //! Actions reqire map and write access
  378     QList <QAction*> unrestrictedMapActions;//! Actions require map, but work also in readonly, e.g. print, copy
  379     QList <QAction*> actionListFiles;       //! File related actions, e.g. load, save, restore session
  380     QList <QAction*> actionListBranches;
  381     QList <QAction*> actionListItems;
  382 
  383     QColor currentColor;
  384 
  385     int xLinkMenuWidth;
  386 
  387     QMenu *recentFilesMenu;
  388     enum { MaxRecentFiles = 9 };
  389     QAction *recentFileActions[MaxRecentFiles];
  390 
  391     QAction *macroActions[24];
  392     QStringList macro;
  393 
  394     QMenu *toolbarsMenu;
  395     QToolBar *fileToolbar;
  396     QToolBar *clipboardToolbar;
  397     QToolBar *editActionsToolbar;
  398     QToolBar *selectionToolbar;
  399     QToolBar *editorsToolbar;
  400     QToolBar *colorsToolbar;
  401     QToolBar *zoomToolbar;
  402     QToolBar *modModesToolbar;
  403     QToolBar *referencesToolbar;
  404     QToolBar *standardFlagsToolbar;
  405 
  406     QAction* actionFileNew;
  407     QAction* actionFileNewCopy;
  408     QAction* actionFileOpen;
  409     QAction* actionFileRestoreSession;
  410     QAction* actionFileSave;
  411     QAction* actionFilePrint;
  412     QAction* actionMapProperties;
  413     QAction* actionFileExportLast;
  414     QAction* actionUndo;
  415     QAction* actionRedo;
  416     QAction *actionCopy;
  417     QAction *actionCut;
  418     QAction *actionPaste;
  419     QAction *actionMoveUp;
  420     QAction *actionMoveDown;
  421     QAction *actionDetach;
  422     QAction *actionSortChildren;
  423     QAction *actionSortBackChildren;
  424     QAction *actionToggleScroll;
  425     QAction *actionExpandAll;
  426     QAction *actionExpandOneLevel;
  427     QAction *actionCollapseOneLevel;
  428     QAction *actionCollapseUnselected;
  429     QAction* actionOpenURL;
  430     QAction* actionOpenURLTab;
  431     QAction* actionOpenMultipleVisURLTabs;
  432     QAction* actionOpenMultipleURLTabs;
  433     QAction* actionGetURLsFromNote;
  434     QAction* actionURLNew;
  435     QAction* actionLocalURL;
  436     QAction* actionHeading2URL;
  437     QAction* actionGetJiraData;
  438     QAction* actionGetJiraDataSubtree;
  439     QAction* actionBugzilla2URL;
  440     QAction* actionGetBugzillaData;
  441     QAction* actionGetBugzillaDataSubtree;
  442     QAction* actionFATE2URL;
  443     QAction *actionOpenVymLink;
  444     QAction *actionOpenVymLinkBackground;
  445     QAction *actionOpenMultipleVymLinks;
  446     QAction *actionEditVymLink;
  447     QAction *actionDeleteVymLink;
  448     QAction *actionAddTimestamp;
  449     QAction *actionToggleTask;
  450     QAction *actionCycleTaskStatus;
  451     QAction *actionTaskSleep0;
  452     QAction *actionTaskSleepN;
  453     QAction *actionTaskSleep1;
  454     QAction *actionTaskSleep2;
  455     QAction *actionTaskSleep3;
  456     QAction *actionTaskSleep4;
  457     QAction *actionTaskSleep5;
  458     QAction *actionTaskSleep7;
  459     QAction *actionTaskSleep14;
  460     QAction *actionTaskSleep28;
  461     QAction *actionToggleHideExport;
  462     QAction *actionMapInfo;
  463     QAction *actionHeading;
  464     QAction *actionDelete;
  465     QAction *actionDeleteAlt;
  466     QAction *actionAddAttribute;
  467 public:
  468     QAction *actionAddMapCenter;
  469 
  470 private:    
  471     QAction *actionAddBranch;
  472     QAction *actionAddBranchBefore;
  473     QAction *actionAddBranchAbove;
  474     QAction *actionAddBranchBelow;
  475     QAction *actionDeleteKeepChildren;
  476     QAction *actionDeleteChildren;
  477     QAction *actionImportAdd;
  478     QAction *actionImportReplace;
  479     QAction *actionSaveBranch;
  480     QAction *actionLoadImage;
  481 
  482     QAction *actionGrowSelectionSize;
  483     QAction *actionShrinkSelectionSize;
  484     QAction *actionResetSelectionSize;
  485 
  486     QAction *actionToggleTarget;
  487     QAction *actionGoToTarget;
  488     QAction *actionMoveToTarget;
  489     QAction *actionSelectPrevious;
  490     QAction *actionSelectNext;
  491     QAction *actionSelectNothing;
  492     QAction *actionFind;
  493 
  494     QAction *actionFormatColor;
  495     QAction *actionFormatPickColor;
  496     QAction *actionFormatColorBranch;
  497     QAction *actionFormatColorSubtree;
  498     QAction *actionFormatLinkColorHint;
  499     QAction *actionFormatBackColor;
  500     QAction *actionFormatBackImage;
  501     QAction *actionFormatLinkColor;
  502     QAction *actionFormatSelectionColor;
  503     QAction *actionFormatFont;
  504 
  505     QAction *actionZoomIn;
  506     QAction *actionZoomOut;
  507     QAction *actionZoomReset;
  508     QAction *actionRotateCounterClockwise;
  509     QAction *actionRotateClockwise;
  510     QAction *actionCenterOn;
  511 
  512     QActionGroup *actionGroupModModes;
  513     QAction *actionModModeColor;
  514     QAction *actionModModeXLink;
  515     QAction *actionModModeCopy;
  516 
  517     QAction *actionToggleHideMode;
  518 
  519     QAction *actionToggleWinter;
  520 
  521     QActionGroup *actionGroupFormatFrameTypes;
  522 
  523     QActionGroup *actionGroupFormatLinkStyles;
  524     QAction *actionFormatLinkStyleLine;
  525     QAction *actionFormatLinkStyleParabel;
  526     QAction *actionFormatLinkStylePolyLine;
  527     QAction *actionFormatLinkStylePolyParabel;
  528     QAction *actionFormatHideLinkUnselected;
  529 
  530     QAction *actionViewToggleNoteEditor;
  531     QAction *actionViewToggleHeadingEditor;
  532     QAction *actionViewToggleTreeEditor;
  533     QAction *actionViewToggleTaskEditor;
  534     QAction *actionViewToggleSlideEditor;
  535     QAction *actionViewToggleScriptEditor;
  536     QAction *actionViewToggleScriptOutput;
  537     QAction *actionViewToggleHistoryWindow;
  538     QAction *actionViewTogglePropertyEditor;
  539     QAction *actionViewToggleAntiAlias;
  540     QAction *actionViewToggleSmoothPixmapTransform;
  541     QAction* actionViewCenter;
  542 
  543     QAction* actionSettingsAutoEditNewBranch;
  544     QAction* actionSettingsAutoSelectNewBranch;
  545     QAction* actionSettingsAutoSelectText;
  546     QAction* actionSettingsUseFlagGroups;
  547     QAction* actionSettingsUseHideExport;
  548     QAction* actionSettingsToggleAutosave;
  549     QAction* actionSettingsAutosaveTime;
  550     QAction* actionSettingsShowParentsLevelTasks;
  551     QAction* actionSettingsShowParentsLevelFindResults;
  552     QAction* actionSettingsToggleAutoLayout;
  553     QAction* actionSettingsWriteBackupFile;
  554     QAction* actionSettingsToggleDownloads;
  555     QAction* actionSettingsUseAnimation;
  556 };
  557 
  558 #endif
  559