Changeset View
Changeset View
Standalone View
Standalone View
kwrite/kwrite.h
Context not available. | |||||
23 | 23 | | |||
---|---|---|---|---|---|
24 | #include <ktexteditor/view.h> | 24 | #include <ktexteditor/view.h> | ||
25 | #include <ktexteditor/document.h> | 25 | #include <ktexteditor/document.h> | ||
26 | #include <ktexteditor/mainwindow.h> | ||||
26 | 27 | | |||
27 | #include <KParts/MainWindow> | 28 | #include <KParts/MainWindow> | ||
28 | #include <KConfigGroup> | 29 | #include <KConfigGroup> | ||
Context not available. | |||||
40 | class KToggleAction; | 41 | class KToggleAction; | ||
41 | class KRecentFilesAction; | 42 | class KRecentFilesAction; | ||
42 | class KSqueezedTextLabel; | 43 | class KSqueezedTextLabel; | ||
44 | class KWriteApplication; | ||||
43 | 45 | | |||
44 | class KWrite : public KParts::MainWindow | 46 | class KWrite : public KParts::MainWindow | ||
45 | { | 47 | { | ||
46 | Q_OBJECT | 48 | Q_OBJECT | ||
47 | 49 | | |||
48 | public: | 50 | public: | ||
49 | KWrite(KTextEditor::Document * = nullptr); | 51 | KWrite(KTextEditor::Document * = nullptr, KWriteApplication *app = nullptr); | ||
50 | ~KWrite() override; | 52 | ~KWrite() override; | ||
51 | 53 | | |||
52 | void loadURL(const QUrl &url); | 54 | void loadURL(const QUrl &url); | ||
53 | 55 | | |||
54 | KTextEditor::View *view() const { | | |||
55 | return m_view; | | |||
56 | } | | |||
57 | | ||||
58 | static bool noWindows() { | | |||
59 | return winList.isEmpty(); | | |||
60 | } | | |||
61 | | ||||
62 | private: | 56 | private: | ||
63 | void setupActions(); | 57 | void setupActions(); | ||
64 | 58 | | |||
Context not available. | |||||
113 | //session management | 107 | //session management | ||
114 | public: | 108 | public: | ||
115 | void restore(KConfig *, int); | 109 | void restore(KConfig *, int); | ||
116 | static void restore(); | 110 | | ||
111 | public: | ||||
112 | KTextEditor::MainWindow *mainWindow() { return &m_mainWindow; } | ||||
113 | | ||||
114 | public Q_SLOTS: | ||||
115 | QWidget *window() { return this; } | ||||
116 | QList<KTextEditor::View *> views(); | ||||
117 | KTextEditor::View *activeView() { return m_view; } | ||||
118 | KTextEditor::View *activateView(KTextEditor::Document *document); | ||||
117 | 119 | | |||
118 | private: | 120 | private: | ||
119 | void readProperties(const KConfigGroup &) override; | 121 | void readProperties(const KConfigGroup &) override; | ||
Context not available. | |||||
129 | KToggleAction *m_paShowStatusBar; | 131 | KToggleAction *m_paShowStatusBar; | ||
130 | QAction *m_closeAction; | 132 | QAction *m_closeAction; | ||
131 | KActivities::ResourceInstance *m_activityResource; | 133 | KActivities::ResourceInstance *m_activityResource; | ||
132 | 134 | KWriteApplication *m_app; | |||
133 | static QList<KTextEditor::Document *> docList; | 135 | KTextEditor::MainWindow m_mainWindow; | ||
134 | static QList<KWrite *> winList; | | |||
135 | 136 | | |||
136 | public Q_SLOTS: | 137 | public Q_SLOTS: | ||
137 | void documentNameChanged(); | 138 | void documentNameChanged(); | ||
138 | 139 | | |||
139 | protected: | 140 | protected: | ||
140 | /** | 141 | /** | ||
141 | * Event filter for QApplication to handle mac os like file open | 142 | * Event filter for QApplication to handle mac os like file open | ||
Context not available. | |||||
144 | }; | 145 | }; | ||
145 | 146 | | |||
146 | #endif | 147 | #endif | ||
147 | | ||||
Context not available. |