Changeset View
Changeset View
Standalone View
Standalone View
src/kgraphviewer.h
Show All 10 Lines | 1 | /* This file is part of KGraphViewer. | |||
---|---|---|---|---|---|
11 | General Public License for more details. | 11 | General Public License for more details. | ||
12 | 12 | | |||
13 | You should have received a copy of the GNU General Public License | 13 | You should have received a copy of the GNU General Public License | ||
14 | along with this program; if not, write to the Free Software | 14 | along with this program; if not, write to the Free Software | ||
15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 15 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
16 | 02110-1301, USA | 16 | 02110-1301, USA | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | | ||||
20 | #ifndef _KGRAPHVIEWER_H_ | 19 | #ifndef _KGRAPHVIEWER_H_ | ||
21 | #define _KGRAPHVIEWER_H_ | 20 | #define _KGRAPHVIEWER_H_ | ||
22 | 21 | | |||
23 | //#include <config-kgraphviewer.h> | 22 | //#include <config-kgraphviewer.h> | ||
24 | 23 | | |||
24 | #include <KParts/MainWindow> | ||||
25 | #include <KRecentFilesAction> | ||||
25 | #include <QAction> | 26 | #include <QAction> | ||
26 | #include <QDir> | 27 | #include <QDir> | ||
27 | #include <QTabWidget> | 28 | #include <QTabWidget> | ||
28 | #include <KParts/MainWindow> | | |||
29 | #include <KRecentFilesAction> | | |||
30 | 29 | | |||
31 | #include <graphviz/gvc.h> | 30 | #include <graphviz/gvc.h> | ||
32 | 31 | | |||
33 | class KToggleAction; | 32 | class KToggleAction; | ||
34 | 33 | | |||
35 | /** | 34 | /** | ||
36 | * This is the application "Shell". It has a menubar, toolbar, and | 35 | * This is the application "Shell". It has a menubar, toolbar, and | ||
37 | * statusbar but relies on the "Part" to do all the real work. | 36 | * statusbar but relies on the "Part" to do all the real work. | ||
Show All 13 Lines | 44 | public: | |||
51 | /** | 50 | /** | ||
52 | * Default Destructor | 51 | * Default Destructor | ||
53 | */ | 52 | */ | ||
54 | ~KGraphViewerWindow() override; | 53 | ~KGraphViewerWindow() override; | ||
55 | 54 | | |||
56 | /** | 55 | /** | ||
57 | * Use this method to load whatever file/URL you have | 56 | * Use this method to load whatever file/URL you have | ||
58 | */ | 57 | */ | ||
59 | void openUrl(const QUrl& url); | 58 | void openUrl(const QUrl &url); | ||
60 | 59 | | |||
61 | void reloadPreviousFiles(); | 60 | void reloadPreviousFiles(); | ||
62 | 61 | | |||
63 | protected: | 62 | protected: | ||
64 | | ||||
65 | void closeEvent(QCloseEvent *event) override; | 63 | void closeEvent(QCloseEvent *event) override; | ||
66 | 64 | | |||
67 | Q_SIGNALS: | 65 | Q_SIGNALS: | ||
68 | void hide(KParts::Part* part); | 66 | void hide(KParts::Part *part); | ||
69 | 67 | | |||
70 | public Q_SLOTS: | 68 | public Q_SLOTS: | ||
71 | /** | 69 | /** | ||
72 | * Use this method to load whatever file/URL you have | 70 | * Use this method to load whatever file/URL you have | ||
73 | */ | 71 | */ | ||
74 | void openUrl(const QString& url) { | 72 | void openUrl(const QString &url) | ||
73 | { | ||||
75 | openUrl(QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile)); | 74 | openUrl(QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile)); | ||
76 | } | 75 | } | ||
77 | 76 | | |||
78 | void close(); | 77 | void close(); | ||
79 | 78 | | |||
80 | void slotReloadOnChangeModeYesToggled(bool value); | 79 | void slotReloadOnChangeModeYesToggled(bool value); | ||
81 | void slotReloadOnChangeModeNoToggled(bool value); | 80 | void slotReloadOnChangeModeNoToggled(bool value); | ||
82 | void slotReloadOnChangeModeAskToggled(bool value); | 81 | void slotReloadOnChangeModeAskToggled(bool value); | ||
83 | void slotOpenInExistingWindowModeYesToggled(bool value); | 82 | void slotOpenInExistingWindowModeYesToggled(bool value); | ||
84 | void slotOpenInExistingWindowModeNoToggled(bool value); | 83 | void slotOpenInExistingWindowModeNoToggled(bool value); | ||
85 | void slotOpenInExistingWindowModeAskToggled(bool value); | 84 | void slotOpenInExistingWindowModeAskToggled(bool value); | ||
86 | void slotReopenPreviouslyOpenedFilesModeYesToggled(bool value); | 85 | void slotReopenPreviouslyOpenedFilesModeYesToggled(bool value); | ||
87 | void slotReopenPreviouslyOpenedFilesModeNoToggled(bool value); | 86 | void slotReopenPreviouslyOpenedFilesModeNoToggled(bool value); | ||
88 | void slotReopenPreviouslyOpenedFilesModeAskToggled(bool value); | 87 | void slotReopenPreviouslyOpenedFilesModeAskToggled(bool value); | ||
89 | void slotParsingModeExternalToggled(bool value); | 88 | void slotParsingModeExternalToggled(bool value); | ||
90 | void slotParsingModeInternalToggled(bool value); | 89 | void slotParsingModeInternalToggled(bool value); | ||
91 | 90 | | |||
92 | private Q_SLOTS: | 91 | private Q_SLOTS: | ||
93 | void fileNew(); | 92 | void fileNew(); | ||
94 | void fileOpen(); | 93 | void fileOpen(); | ||
95 | void close(int index); | 94 | void close(int index); | ||
96 | void slotURLSelected(const QUrl&); | 95 | void slotURLSelected(const QUrl &); | ||
97 | void optionsShowToolbar(); | 96 | void optionsShowToolbar(); | ||
98 | void optionsShowStatusbar(); | 97 | void optionsShowStatusbar(); | ||
99 | void optionsConfigureKeys(); | 98 | void optionsConfigureKeys(); | ||
100 | void optionsConfigureToolbars(); | 99 | void optionsConfigureToolbars(); | ||
101 | void optionsConfigure(); | 100 | void optionsConfigure(); | ||
102 | void newTabSelectedSlot(int index); | 101 | void newTabSelectedSlot(int index); | ||
103 | 102 | | |||
104 | void applyNewToolbarConfig(); | 103 | void applyNewToolbarConfig(); | ||
105 | 104 | | |||
106 | void slotHoverEnter(const QString&); | 105 | void slotHoverEnter(const QString &); | ||
107 | void slotHoverLeave(const QString&); | 106 | void slotHoverLeave(const QString &); | ||
108 | void slotBackgroundColorChanged(const QColor&); | 107 | void slotBackgroundColorChanged(const QColor &); | ||
109 | 108 | | |||
110 | private: | 109 | private: | ||
111 | void setupAccel(); | 110 | void setupAccel(); | ||
112 | void setupActions(); | 111 | void setupActions(); | ||
113 | 112 | | |||
114 | private: | 113 | private: | ||
115 | QTabWidget* m_widget; | 114 | QTabWidget *m_widget; | ||
116 | KRecentFilesAction* m_rfa; | 115 | KRecentFilesAction *m_rfa; | ||
117 | KParts::PartManager* m_manager; | 116 | KParts::PartManager *m_manager; | ||
118 | 117 | | |||
119 | KToggleAction *m_toolbarAction; | 118 | KToggleAction *m_toolbarAction; | ||
120 | KToggleAction *m_statusbarAction; | 119 | KToggleAction *m_statusbarAction; | ||
121 | QAction *m_closeAction; | 120 | QAction *m_closeAction; | ||
122 | 121 | | |||
123 | QStringList m_openedFiles; | 122 | QStringList m_openedFiles; | ||
124 | 123 | | |||
125 | QMap<QWidget*, KParts::Part*> m_tabsPartsMap; | 124 | QMap<QWidget *, KParts::Part *> m_tabsPartsMap; | ||
126 | QMap<QWidget*, QString> m_tabsFilesMap; | 125 | QMap<QWidget *, QString> m_tabsFilesMap; | ||
127 | }; | 126 | }; | ||
128 | 127 | | |||
129 | #endif // _KGRAPHVIEWER_H_ | 128 | #endif // _KGRAPHVIEWER_H_ |