ACF $AcfVersion:0$
IMultiPageWidgetDelegate.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QtGlobal>
7#include <QtCore/QSize>
8#if QT_VERSION >= 0x050000
9#include <QtWidgets/QWidget>
10#else
11#include <QtGui/QWidget>
12#endif
13
14// ACF includes
15#include <istd/IPolymorphic.h>
16#include <iwidgets/iwidgets.h>
17
18
19namespace iwidgets
20{
21
22
29{
30public:
61
87
91 virtual QWidget* CreateContainerWidget(
92 QWidget* parentWidgetPtr,
93 int containerGuiFlags = CGF_NONE,
94 int orientation = Qt::Horizontal) = 0;
95
103 QWidget& containerWidget,
104 QObject* receiverPtr,
105 const char* receiverSlotName) = 0;
106
110 virtual bool SetPageHeaderPosition(QWidget& containerWidget, PageHeaderPosition pageHeaderPosition) = 0;
111
117 virtual int InsertPage(
118 QWidget& containerWidget,
119 QWidget* pageWidgetPtr,
120 const QString& pageTitle,
121 int pageIndex = -1) = 0;
122
126 virtual void RemovePage(QWidget& containerWidget, int pageIndex) = 0;
127
131 virtual void ResetPages(QWidget& containerWidget) = 0;
132
136 virtual int GetPagesCount(const QWidget& containerWidget) const = 0;
137
141 virtual QWidget* GetPageWidgetPtr(const QWidget& containerWidget, int pageIndex) const = 0;
142
146 virtual int GetCurrentPage(const QWidget& containerWidget) const = 0;
147
151 virtual bool SetCurrentPage(QWidget& containerWidget, int pageIndex) = 0;
152
156 virtual QString GetPageTitle(const QWidget& containerWidget, int pageIndex) const = 0;
157
161 virtual void SetPageTitle(QWidget& containerWidget, int pageIndex, const QString& pageTitle) = 0;
162
166 virtual QIcon GetPageIcon(const QWidget& containerWidget, int pageIndex) const = 0;
167
171 virtual void SetPageIcon(QWidget& containerWidget, int pageIndex, const QIcon& pageIcon) = 0;
172
176 virtual QString GetPageToolTip(const QWidget& containerWidget, int pageIndex) const = 0;
177
181 virtual void SetPageToolTip(QWidget& containerWidget, int pageIndex, const QString& pageToolTip) = 0;
182
186 virtual bool IsPageEnabled(const QWidget& containerWidget, int pageIndex) const = 0;
187
191 virtual bool SetPageEnabled(QWidget& containerWidget, int pageIndex, bool isPageEnabled = true) = 0;
192
196 virtual bool IsPageVisible(const QWidget& containerWidget, int pageIndex) const = 0;
197
201 virtual bool SetPageVisible(QWidget& containerWidget, int pageIndex, bool isPageVisible = true) = 0;
202
206 virtual QSize GetPageIconSize(const QWidget& containerWidget) const = 0;
207
211 virtual bool SetPageIconSize(QWidget& containerWidget, const QSize& pageIconSize) = 0;
212};
213
214
215} // namespace iwidgets
216
217
218
219
Base interface for all used interfaces and implementations.
Interface of a delegate object used for operating on concrete UI-container implementation.
virtual bool SetPageEnabled(QWidget &containerWidget, int pageIndex, bool isPageEnabled=true)=0
Set page enabled/disabled.
ContainerGuiFlags
Flags for specifying the visual behavior of the page widgets in the UI-container.
@ CGF_FILTER_WHEEL_EVENTS
If set, the container will filter the wheel events for ComboBoxes and SpinBoxes to avoid an accident ...
@ CGF_UNIFORM_SIZES
If set, the container will try to preserve the same size of the page widgets.
@ CGF_COMPACT
If set, the container will try to minimize the size of the page content.
@ CGF_NONE
Default behavior of the UI container.
virtual bool IsPageEnabled(const QWidget &containerWidget, int pageIndex) const =0
Get if the page enabled/disabled.
virtual void SetPageIcon(QWidget &containerWidget, int pageIndex, const QIcon &pageIcon)=0
Set the page icon.
virtual int InsertPage(QWidget &containerWidget, QWidget *pageWidgetPtr, const QString &pageTitle, int pageIndex=-1)=0
Add a new page to the container.
virtual void SetPageToolTip(QWidget &containerWidget, int pageIndex, const QString &pageToolTip)=0
Set the page tool tip.
PageHeaderPosition
Enum for describing of page header bar position on the container widget.
@ PHP_AUTO
Default page header position (decided by container implementation)
@ PHP_RIGHT
The page header will be placed on the right side of the container if possible.
@ PHP_TOP
The page header will be placed on the top side of the container if possible.
@ PHP_LEFT
The page header will be placed on the left side of the container if possible.
@ PHP_BOTTOM
The page header will be placed on the bottom side of the container if possible.
virtual QString GetPageTitle(const QWidget &containerWidget, int pageIndex) const =0
Get the title of the given page.
virtual QWidget * CreateContainerWidget(QWidget *parentWidgetPtr, int containerGuiFlags=CGF_NONE, int orientation=Qt::Horizontal)=0
Create container for the page widgets.
virtual QWidget * GetPageWidgetPtr(const QWidget &containerWidget, int pageIndex) const =0
Get page's widget from the container.
virtual int GetCurrentPage(const QWidget &containerWidget) const =0
Get currently active page in the container.
virtual void SetPageTitle(QWidget &containerWidget, int pageIndex, const QString &pageTitle)=0
Set the page title.
virtual void ResetPages(QWidget &containerWidget)=0
Remove all pages from the container.
virtual bool SetCurrentPage(QWidget &containerWidget, int pageIndex)=0
Set active page in the container.
virtual bool SetPageIconSize(QWidget &containerWidget, const QSize &pageIconSize)=0
Set the size of the icon for all pages in the container.
virtual QString GetPageToolTip(const QWidget &containerWidget, int pageIndex) const =0
Get the page tool tip.
virtual int GetPagesCount(const QWidget &containerWidget) const =0
Get the number of the pages in the container.
virtual void RemovePage(QWidget &containerWidget, int pageIndex)=0
Remove the page from the container.
virtual bool SetPageHeaderPosition(QWidget &containerWidget, PageHeaderPosition pageHeaderPosition)=0
Set the position of the page header bar on the container UI.
virtual bool ConnectPageIndexListener(QWidget &containerWidget, QObject *receiverPtr, const char *receiverSlotName)=0
Connect object, which will be notified about changing of the current selected page index.
virtual bool IsPageVisible(const QWidget &containerWidget, int pageIndex) const =0
Get if the page visible/hidden.
virtual QIcon GetPageIcon(const QWidget &containerWidget, int pageIndex) const =0
Get the page icon.
virtual bool SetPageVisible(QWidget &containerWidget, int pageIndex, bool isPageVisible=true)=0
Set page visible/hidden.
virtual QSize GetPageIconSize(const QWidget &containerWidget) const =0
Get the size page icon.
Namespace contains implementation of Qt widget extensions.