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. | ||
38 | * | 37 | * | ||
39 | * @short Application Shell | 38 | * @short Application Shell | ||
40 | * @author Gael de Chalendar <kleag@free.fr> | 39 | * @author Gael de Chalendar <kleag@free.fr> | ||
41 | */ | 40 | */ | ||
42 | class KGraphViewerWindow : public KParts::MainWindow | 41 | class KGraphViewerWindow : public KParts::MainWindow { | ||
43 | { | | |||
44 | Q_OBJECT | 42 | Q_OBJECT | ||
45 | public: | 43 | public: | ||
46 | /** | 44 | /** | ||
47 | * Default Constructor | 45 | * Default Constructor | ||
48 | */ | 46 | */ | ||
49 | KGraphViewerWindow(); | 47 | KGraphViewerWindow(); | ||
50 | 48 | | |||
51 | /** | 49 | /** | ||
52 | * Default Destructor | 50 | * Default Destructor | ||
53 | */ | 51 | */ | ||
54 | ~KGraphViewerWindow() override; | 52 | ~KGraphViewerWindow() override; | ||
55 | 53 | | |||
56 | /** | 54 | /** | ||
57 | * Use this method to load whatever file/URL you have | 55 | * Use this method to load whatever file/URL you have | ||
58 | */ | 56 | */ | ||
59 | void openUrl(const QUrl& url); | 57 | void openUrl(const QUrl &url); | ||
60 | 58 | | |||
61 | void reloadPreviousFiles(); | 59 | void reloadPreviousFiles(); | ||
62 | 60 | | |||
63 | protected: | 61 | protected: | ||
64 | | ||||
65 | void closeEvent(QCloseEvent *event) override; | 62 | void closeEvent(QCloseEvent *event) override; | ||
66 | 63 | | |||
67 | Q_SIGNALS: | 64 | Q_SIGNALS: | ||
68 | void hide(KParts::Part* part); | 65 | void hide(KParts::Part *part); | ||
69 | 66 | | |||
70 | public Q_SLOTS: | 67 | public Q_SLOTS: | ||
71 | /** | 68 | /** | ||
72 | * Use this method to load whatever file/URL you have | 69 | * Use this method to load whatever file/URL you have | ||
73 | */ | 70 | */ | ||
74 | void openUrl(const QString& url) { | 71 | void openUrl(const QString &url) { | ||
75 | openUrl(QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile)); | 72 | openUrl(QUrl::fromUserInput(url, QDir::currentPath(), | ||
73 | QUrl::AssumeLocalFile)); | ||||
76 | } | 74 | } | ||
77 | 75 | | |||
78 | void close(); | 76 | void close(); | ||
79 | 77 | | |||
80 | void slotReloadOnChangeModeYesToggled(bool value); | 78 | void slotReloadOnChangeModeYesToggled(bool value); | ||
81 | void slotReloadOnChangeModeNoToggled(bool value); | 79 | void slotReloadOnChangeModeNoToggled(bool value); | ||
82 | void slotReloadOnChangeModeAskToggled(bool value); | 80 | void slotReloadOnChangeModeAskToggled(bool value); | ||
83 | void slotOpenInExistingWindowModeYesToggled(bool value); | 81 | void slotOpenInExistingWindowModeYesToggled(bool value); | ||
84 | void slotOpenInExistingWindowModeNoToggled(bool value); | 82 | void slotOpenInExistingWindowModeNoToggled(bool value); | ||
85 | void slotOpenInExistingWindowModeAskToggled(bool value); | 83 | void slotOpenInExistingWindowModeAskToggled(bool value); | ||
86 | void slotReopenPreviouslyOpenedFilesModeYesToggled(bool value); | 84 | void slotReopenPreviouslyOpenedFilesModeYesToggled(bool value); | ||
87 | void slotReopenPreviouslyOpenedFilesModeNoToggled(bool value); | 85 | void slotReopenPreviouslyOpenedFilesModeNoToggled(bool value); | ||
88 | void slotReopenPreviouslyOpenedFilesModeAskToggled(bool value); | 86 | void slotReopenPreviouslyOpenedFilesModeAskToggled(bool value); | ||
89 | void slotParsingModeExternalToggled(bool value); | 87 | void slotParsingModeExternalToggled(bool value); | ||
90 | void slotParsingModeInternalToggled(bool value); | 88 | void slotParsingModeInternalToggled(bool value); | ||
91 | 89 | | |||
92 | private Q_SLOTS: | 90 | private Q_SLOTS: | ||
93 | void fileNew(); | 91 | void fileNew(); | ||
94 | void fileOpen(); | 92 | void fileOpen(); | ||
95 | void close(int index); | 93 | void close(int index); | ||
96 | void slotURLSelected(const QUrl&); | 94 | void slotURLSelected(const QUrl &); | ||
97 | void optionsShowToolbar(); | 95 | void optionsShowToolbar(); | ||
98 | void optionsShowStatusbar(); | 96 | void optionsShowStatusbar(); | ||
99 | void optionsConfigureKeys(); | 97 | void optionsConfigureKeys(); | ||
100 | void optionsConfigureToolbars(); | 98 | void optionsConfigureToolbars(); | ||
101 | void optionsConfigure(); | 99 | void optionsConfigure(); | ||
102 | void newTabSelectedSlot(int index); | 100 | void newTabSelectedSlot(int index); | ||
103 | 101 | | |||
104 | void applyNewToolbarConfig(); | 102 | void applyNewToolbarConfig(); | ||
105 | 103 | | |||
106 | void slotHoverEnter(const QString&); | 104 | void slotHoverEnter(const QString &); | ||
107 | void slotHoverLeave(const QString&); | 105 | void slotHoverLeave(const QString &); | ||
108 | void slotBackgroundColorChanged(const QColor&); | 106 | void slotBackgroundColorChanged(const QColor &); | ||
109 | 107 | | |||
110 | private: | 108 | private: | ||
111 | void setupAccel(); | 109 | void setupAccel(); | ||
112 | void setupActions(); | 110 | void setupActions(); | ||
113 | 111 | | |||
114 | private: | 112 | private: | ||
115 | QTabWidget* m_widget; | 113 | QTabWidget *m_widget; | ||
116 | KRecentFilesAction* m_rfa; | 114 | KRecentFilesAction *m_rfa; | ||
117 | KParts::PartManager* m_manager; | 115 | KParts::PartManager *m_manager; | ||
118 | 116 | | |||
119 | KToggleAction *m_toolbarAction; | 117 | KToggleAction *m_toolbarAction; | ||
120 | KToggleAction *m_statusbarAction; | 118 | KToggleAction *m_statusbarAction; | ||
121 | QAction *m_closeAction; | 119 | QAction *m_closeAction; | ||
122 | 120 | | |||
123 | QStringList m_openedFiles; | 121 | QStringList m_openedFiles; | ||
124 | 122 | | |||
125 | QMap<QWidget*, KParts::Part*> m_tabsPartsMap; | 123 | QMap<QWidget *, KParts::Part *> m_tabsPartsMap; | ||
126 | QMap<QWidget*, QString> m_tabsFilesMap; | 124 | QMap<QWidget *, QString> m_tabsFilesMap; | ||
127 | }; | 125 | }; | ||
128 | 126 | | |||
129 | #endif // _KGRAPHVIEWER_H_ | 127 | #endif // _KGRAPHVIEWER_H_ |