1818** License along with this library; If not, see <http://www.gnu.org/licenses/>.
1919******************************************************************************/
2020
21+
2122// ============================================================================
2223// / \file AutoHideDockContainer.h
2324// / \author Syarif Fakhri
2829// ============================================================================
2930// INCLUDES
3031// ============================================================================
31- #include < QSplitter >
32+ #include " ads_globals.h "
3233
34+ #include < QSplitter>
3335#include " AutoHideTab.h"
34- #include " ads_globals.h"
3536
3637QT_FORWARD_DECLARE_CLASS (QXmlStreamWriter)
3738
@@ -51,153 +52,152 @@ struct SideTabBarPrivate;
5152 */
5253class ADS_EXPORT CAutoHideDockContainer : public QFrame
5354{
54- Q_OBJECT
55+ Q_OBJECT
5556 Q_PROPERTY (int sideBarLocation READ sideBarLocation)
5657private:
57- AutoHideDockContainerPrivate* d; // /< private data (pimpl)
58- friend struct AutoHideDockContainerPrivate ;
59- friend CAutoHideSideBar;
60- friend SideTabBarPrivate;
58+ AutoHideDockContainerPrivate* d; // /< private data (pimpl)
59+ friend struct AutoHideDockContainerPrivate ;
60+ friend CAutoHideSideBar;
61+ friend SideTabBarPrivate;
6162
6263protected:
63- virtual bool eventFilter (QObject* watched, QEvent* event) override ;
64- virtual void resizeEvent (QResizeEvent* event) override ;
65- virtual void leaveEvent (QEvent* event) override ;
66- virtual bool event (QEvent* event) override ;
64+ virtual bool eventFilter (QObject* watched, QEvent* event) override ;
65+ virtual void resizeEvent (QResizeEvent* event) override ;
66+ virtual void leaveEvent (QEvent * event) override ;
67+ virtual bool event (QEvent* event) override ;
6768 virtual void dragLeaveEvent (QDragLeaveEvent* ev) override ;
6869
69- /* *
70- * Updates the size considering the size limits and the resize margins
71- */
72- void updateSize ();
70+ /* *
71+ * Updates the size considering the size limits and the resize margins
72+ */
73+ void updateSize ();
7374
74- /*
75- * Saves the state and size
76- */
77- void saveState (QXmlStreamWriter& Stream);
75+ /*
76+ * Saves the state and size
77+ */
78+ void saveState (QXmlStreamWriter& Stream);
7879
7980public:
80- using Super = QFrame;
81-
82- /* *
83- * Create Auto Hide widget with the given dock widget
84- */
85- CAutoHideDockContainer (CDockWidget* DockWidget, SideBarLocation area,
86- CDockContainerWidget* parent);
87-
88- /* *
89- * Virtual Destructor
90- */
91- virtual ~CAutoHideDockContainer ();
92-
93- /* *
94- * Gets the side tab bar
95- */
96- CAutoHideSideBar* autoHideSideBar () const ;
97-
98- /* *
99- * Returns the side tab
100- */
101- CAutoHideTab* autoHideTab () const ;
102-
103- /* *
104- * Gets the dock widget in this dock container
105- */
106- CDockWidget* dockWidget () const ;
107-
108- /* *
109- * Returns the index of this container in the sidebar
110- */
111- int tabIndex () const ;
112-
113- /* *
114- * Adds a dock widget and removes the previous dock widget
115- */
116- void addDockWidget (CDockWidget* DockWidget);
117-
118- /* *
119- * Returns the side tab bar area of this Auto Hide dock container
120- */
121- SideBarLocation sideBarLocation () const ;
122-
123- /* *
124- * Sets a new SideBarLocation.
125- * If a new side bar location is set, the auto hide dock container needs
126- * to update its resize handle position
127- */
128- void setSideBarLocation (SideBarLocation SideBarLocation);
129-
130- /* *
131- * Returns the dock area widget of this Auto Hide dock container
132- */
133- CDockAreaWidget* dockAreaWidget () const ;
134-
135- /* *
136- * Returns the parent container that hosts this auto hide container
137- */
138- CDockContainerWidget* dockContainer () const ;
139-
140- /* *
141- * Moves the contents to the parent container widget
142- * Used before removing this Auto Hide dock container
143- */
81+ using Super = QFrame;
82+
83+ /* *
84+ * Create Auto Hide widget with the given dock widget
85+ */
86+ CAutoHideDockContainer (CDockWidget* DockWidget, SideBarLocation area,
87+ CDockContainerWidget* parent);
88+
89+ /* *
90+ * Virtual Destructor
91+ */
92+ virtual ~CAutoHideDockContainer ();
93+
94+ /* *
95+ * Gets the side tab bar
96+ */
97+ CAutoHideSideBar* autoHideSideBar () const ;
98+
99+ /* *
100+ * Returns the side tab
101+ */
102+ CAutoHideTab* autoHideTab () const ;
103+
104+ /* *
105+ * Gets the dock widget in this dock container
106+ */
107+ CDockWidget* dockWidget () const ;
108+
109+ /* *
110+ * Returns the index of this container in the sidebar
111+ */
112+ int tabIndex () const ;
113+
114+ /* *
115+ * Adds a dock widget and removes the previous dock widget
116+ */
117+ void addDockWidget (CDockWidget* DockWidget);
118+
119+ /* *
120+ * Returns the side tab bar area of this Auto Hide dock container
121+ */
122+ SideBarLocation sideBarLocation () const ;
123+
124+ /* *
125+ * Sets a new SideBarLocation.
126+ * If a new side bar location is set, the auto hide dock container needs
127+ * to update its resize handle position
128+ */
129+ void setSideBarLocation (SideBarLocation SideBarLocation);
130+
131+ /* *
132+ * Returns the dock area widget of this Auto Hide dock container
133+ */
134+ CDockAreaWidget* dockAreaWidget () const ;
135+
136+ /* *
137+ * Returns the parent container that hosts this auto hide container
138+ */
139+ CDockContainerWidget* dockContainer () const ;
140+
141+ /* *
142+ * Moves the contents to the parent container widget
143+ * Used before removing this Auto Hide dock container
144+ */
144145 void moveContentsToParent ();
145146
146- /* *
147- * Cleanups up the side tab widget and then deletes itself
148- */
149- void cleanupAndDelete ();
150-
151- /*
152- * Toggles the auto Hide dock container widget
153- * This will also hide the side tab widget
154- */
155- void toggleView (bool Enable);
156-
157- /*
158- * Collapses the auto hide dock container widget
159- * Does not hide the side tab widget
160- */
161- void collapseView (bool Enable);
162-
163- /* *
164- * Toggles the current collapse state
165- */
166- void toggleCollapseState ();
167-
168- /* *
169- * Use this instead of resize.
170- * Depending on the sidebar location this will set the width or height
171- * of this auto hide container.
172- */
173- void setSize (int Size);
174-
175- /* *
176- * Resets the width or height to the initial dock widget size dependinng on
177- * the orientation.
178- * If the orientation is Qt::Horizontal, then the height is reset to
179- * the initial size and if orientation is Qt::Vertical, then the width is
180- * reset to the initial size
181- */
182- void resetToInitialDockWidgetSize ();
183-
184- /* *
185- * Returns orientation of this container.
186- * Left and right containers have a Qt::Vertical orientation and top / bottom
187- * containers have a Qt::Horizontal orientation.
188- * The function returns the orientation of the corresponding auto hide
189- * side bar.
190- */
191- Qt::Orientation orientation () const ;
192-
193- /* *
194- * Removes the AutoHide container from the current side bar and adds
195- * it to the new side bar given in SideBarLocation
196- */
197- void moveToNewSideBarLocation (SideBarLocation SideBarLocation,
198- int TabIndex = -1 );
147+ /* *
148+ * Cleanups up the side tab widget and then deletes itself
149+ */
150+ void cleanupAndDelete ();
151+
152+ /*
153+ * Toggles the auto Hide dock container widget
154+ * This will also hide the side tab widget
155+ */
156+ void toggleView (bool Enable);
157+
158+ /*
159+ * Collapses the auto hide dock container widget
160+ * Does not hide the side tab widget
161+ */
162+ void collapseView (bool Enable);
163+
164+ /* *
165+ * Toggles the current collapse state
166+ */
167+ void toggleCollapseState ();
168+
169+ /* *
170+ * Use this instead of resize.
171+ * Depending on the sidebar location this will set the width or height
172+ * of this auto hide container.
173+ */
174+ void setSize (int Size);
175+
176+ /* *
177+ * Resets the width or height to the initial dock widget size dependinng on
178+ * the orientation.
179+ * If the orientation is Qt::Horizontal, then the height is reset to
180+ * the initial size and if orientation is Qt::Vertical, then the width is
181+ * reset to the initial size
182+ */
183+ void resetToInitialDockWidgetSize ();
184+
185+ /* *
186+ * Returns orientation of this container.
187+ * Left and right containers have a Qt::Vertical orientation and top / bottom
188+ * containers have a Qt::Horizontal orientation.
189+ * The function returns the orientation of the corresponding auto hide
190+ * side bar.
191+ */
192+ Qt::Orientation orientation () const ;
193+
194+ /* *
195+ * Removes the AutoHide container from the current side bar and adds
196+ * it to the new side bar given in SideBarLocation
197+ */
198+ void moveToNewSideBarLocation (SideBarLocation SideBarLocation, int TabIndex = -1 );
199199};
200- } // namespace ads
200+ } // namespace ads
201201
202202// -----------------------------------------------------------------------------
203203#endif
0 commit comments