Changeset View
Changeset View
Standalone View
Standalone View
src/ViewContainer.h
Show All 17 Lines | 1 | /* | |||
---|---|---|---|---|---|
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
19 | 02110-1301 USA. | 19 | 02110-1301 USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef VIEWCONTAINER_H | 22 | #ifndef VIEWCONTAINER_H | ||
23 | #define VIEWCONTAINER_H | 23 | #define VIEWCONTAINER_H | ||
24 | 24 | | |||
25 | // Qt | 25 | // Qt | ||
26 | #include <QObject> | | |||
27 | #include <QPointer> | | |||
28 | #include <QHash> | 26 | #include <QHash> | ||
29 | #include <QList> | 27 | #include <QList> | ||
30 | #include <QTabWidget> | 28 | #include <QTabWidget> | ||
31 | #include <QTabBar> | | |||
32 | 29 | | |||
33 | // Konsole | 30 | // Konsole | ||
34 | #include "Profile.h" | 31 | #include "Profile.h" | ||
35 | #include "ViewManager.h" | 32 | #include "ViewManager.h" | ||
36 | 33 | | |||
37 | // Qt | 34 | // Qt | ||
38 | class QPoint; | 35 | class QPoint; | ||
39 | class QToolButton; | 36 | class QToolButton; | ||
40 | class QMenu; | 37 | class QMenu; | ||
41 | class QDropEvent; | | |||
42 | 38 | | |||
43 | namespace Konsole { | 39 | namespace Konsole { | ||
44 | class IncrementalSearchBar; | | |||
45 | class ViewProperties; | 40 | class ViewProperties; | ||
46 | class ViewManager; | 41 | class ViewManager; | ||
47 | class TabbedViewContainer; | | |||
48 | 42 | | |||
49 | /** | 43 | /** | ||
50 | * An interface for container widgets which can hold one or more views. | 44 | * An interface for container widgets which can hold one or more views. | ||
51 | * | 45 | * | ||
52 | * The container widget typically displays a list of the views which | 46 | * The container widget typically displays a list of the views which | ||
53 | * it has and provides a means of switching between them. | 47 | * it has and provides a means of switching between them. | ||
54 | * | 48 | * | ||
55 | * Subclasses should reimplement the addViewWidget() and removeViewWidget() functions | 49 | * Subclasses should reimplement the addViewWidget() and removeViewWidget() functions | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 57 | public: | |||
130 | ViewManager *connectedViewManager(); | 124 | ViewManager *connectedViewManager(); | ||
131 | void currentTabChanged(int index); | 125 | void currentTabChanged(int index); | ||
132 | void closeCurrentTab(); | 126 | void closeCurrentTab(); | ||
133 | void wheelScrolled(int delta); | 127 | void wheelScrolled(int delta); | ||
134 | 128 | | |||
135 | void tabDoubleClicked(int index); | 129 | void tabDoubleClicked(int index); | ||
136 | void openTabContextMenu(const QPoint &point); | 130 | void openTabContextMenu(const QPoint &point); | ||
137 | void setNavigationVisibility(ViewManager::NavigationVisibility navigationVisibility); | 131 | void setNavigationVisibility(ViewManager::NavigationVisibility navigationVisibility); | ||
138 | 132 | void moveTabToWindow(int index, QWidget *window); | |||
139 | Q_SIGNALS: | 133 | Q_SIGNALS: | ||
140 | /** Emitted when the container has no more children */ | 134 | /** Emitted when the container has no more children */ | ||
141 | void empty(TabbedViewContainer *container); | 135 | void empty(TabbedViewContainer *container); | ||
142 | 136 | | |||
143 | /** Emitted when the user requests to open a new view */ | 137 | /** Emitted when the user requests to open a new view */ | ||
144 | void newViewRequest(); | 138 | void newViewRequest(); | ||
145 | 139 | | |||
146 | /** Requests creation of a new view, with the selected profile. */ | 140 | /** Requests creation of a new view, with the selected profile. */ | ||
147 | void newViewRequest(Profile::Ptr); | 141 | void newViewRequest(Profile::Ptr); | ||
148 | 142 | | |||
149 | /** | 143 | /** | ||
150 | * Emitted when the user requests to move a view from another container | 144 | * Emitted when the user requests to move a view from another container | ||
151 | * into this container. If 'success' is set to true by a connected slot | 145 | * into this container. If 'success' is set to true by a connected slot | ||
152 | * then the original view will be removed. | 146 | * then the original view will be removed. | ||
153 | * | 147 | * | ||
154 | * @param index Index at which to insert the new view in the container or -1 | 148 | * @param index Index at which to insert the new view in the container or -1 | ||
155 | * to append it. This index should be passed to addView() when the new view | 149 | * to append it. This index should be passed to addView() when the new view | ||
156 | * has been created. | 150 | * has been created. | ||
157 | * @param id The identifier of the view. | 151 | * @param id The identifier of the view. | ||
158 | * @param success The slot handling this signal should set this to true if the | | |||
159 | * new view was successfully created. | | |||
160 | * @param sourceContainer Initial move event Tabbed view container. | 152 | * @param sourceContainer Initial move event Tabbed view container. | ||
161 | */ | 153 | */ | ||
162 | void moveViewRequest(int index, int id, bool &success, TabbedViewContainer *sourceContainer); | 154 | void moveViewRequest(int index, int id, TabbedViewContainer *sourceContainer); | ||
163 | 155 | | |||
164 | /** Emitted when the active view changes */ | 156 | /** Emitted when the active view changes */ | ||
165 | void activeViewChanged(QWidget *view); | 157 | void activeViewChanged(QWidget *view); | ||
166 | 158 | | |||
167 | /** Emitted when a view is added to the container. */ | 159 | /** Emitted when a view is added to the container. */ | ||
168 | void viewAdded(QWidget *view, ViewProperties *properties); | 160 | void viewAdded(QWidget *view, ViewProperties *properties); | ||
169 | 161 | | |||
170 | /** Emitted when a view is removed from the container. */ | 162 | /** Emitted when a view is removed from the container. */ | ||
Show All 11 Lines | 168 | protected: | |||
182 | * | 174 | * | ||
183 | * @param fromIndex Current index of the widget to move | 175 | * @param fromIndex Current index of the widget to move | ||
184 | * @param toIndex New index for the widget | 176 | * @param toIndex New index for the widget | ||
185 | */ | 177 | */ | ||
186 | void moveViewWidget(int fromIndex, int toIndex); | 178 | void moveViewWidget(int fromIndex, int toIndex); | ||
187 | 179 | | |||
188 | // close tabs and unregister | 180 | // close tabs and unregister | ||
189 | void closeTerminalTab(int idx); | 181 | void closeTerminalTab(int idx); | ||
190 | | ||||
191 | private Q_SLOTS: | 182 | private Q_SLOTS: | ||
192 | void viewDestroyed(QObject *view); | 183 | void viewDestroyed(QObject *view); | ||
193 | void konsoleConfigChanged(); | 184 | void konsoleConfigChanged(); | ||
194 | 185 | | |||
195 | private: | 186 | private: | ||
196 | void forgetView(QWidget *view); | 187 | void forgetView(QWidget *view); | ||
197 | 188 | | |||
198 | QHash<QWidget *, ViewProperties *> _navigation; | 189 | QHash<QWidget *, ViewProperties *> _navigation; | ||
Show All 11 Lines |