CTabWidgetDelegate.h
Go to the documentation of this file.
1 #ifndef iwidgets_CTabWidgetDelegate_included
2 #define iwidgets_CTabWidgetDelegate_included
3 
4 
5 // Qt includes
6 #include <QtCore/QtGlobal>
7 #if QT_VERSION >= 0x050000
8 #include <QtWidgets/QTabWidget>
9 #else
10 #include <QtGui/QTabWidget>
11 #endif
12 
13 // ACF includes
15 
16 
17 namespace iwidgets
18 {
19 
20 
25 {
26 public:
28  QTabWidget::TabPosition tabPosition = QTabWidget::North,
29  bool useDocumentMode = false);
30 
31  void SetTabPosition(QWidget& containerWidget, QTabWidget::TabPosition tabPosition);
32  void SetDocumentModeEnabled(QWidget& containerWidget, bool isDocumentModeEnabled = true);
33 
34  // reimplemented (iwidgets::IMultiPageWidgetDelegate)
35  virtual QWidget* CreateContainerWidget(
36  QWidget* parentWidgetPtr,
37  int containerGuiFlags = CGF_NONE,
38  int orientation = Qt::Horizontal);
39  virtual bool ConnectPageIndexListener(
40  QWidget& containerWidget,
41  QObject* receiverPtr,
42  const char* receiverSlotName);
43  virtual bool SetPageHeaderPosition(QWidget& containerWidget, PageHeaderPosition pageHeaderPosition);
44  virtual int InsertPage(
45  QWidget& containerWidget,
46  QWidget* pageWidgetPtr,
47  const QString& pageTitle,
48  int pageIndex = -1);
49  virtual void RemovePage(QWidget& containerWidget, int pageIndex);
50  virtual void ResetPages(QWidget& containerWidget);
51  virtual int GetPagesCount(const QWidget& containerWidget) const;
52  virtual QWidget* GetPageWidgetPtr(const QWidget& containerWidget, int pageIndex) const;
53  virtual int GetCurrentPage(const QWidget& containerWidget) const;
54  virtual bool SetCurrentPage(QWidget& containerWidget, int pageIndex);
55  virtual QString GetPageTitle(const QWidget& containerWidget, int pageIndex) const;
56  virtual void SetPageTitle(QWidget& containerWidget, int pageIndex, const QString& pageTitle);
57  virtual QIcon GetPageIcon(const QWidget& containerWidget, int pageIndex) const;
58  virtual void SetPageIcon(QWidget& containerWidget, int pageIndex, const QIcon& pageIcon);
59  virtual QString GetPageToolTip(const QWidget& containerWidget, int pageIndex) const;
60  virtual void SetPageToolTip(QWidget& containerWidget, int pageIndex, const QString& pageToolTip);
61  virtual bool IsPageEnabled(const QWidget& containerWidget, int pageIndex) const;
62  virtual bool SetPageEnabled(QWidget& containerWidget, int pageIndex, bool isPageEnabled = true);
63  virtual bool IsPageVisible(const QWidget& containerWidget, int pageIndex) const;
64  virtual bool SetPageVisible(QWidget& containerWidget, int pageIndex, bool isPageVisible = true);
65  virtual QSize GetPageIconSize(const QWidget& containerWidget) const;
66  virtual bool SetPageIconSize(QWidget& containerWidget, const QSize& pageIconSize);
67 
68 private:
69  QTabWidget::TabPosition m_tabPosition;
70  bool m_useDocumentMode;
71 
72  int m_containerGuiFlags;
73 };
74 
75 
76 } // namespace iwidgets
77 
78 
79 #endif // !iwidgets_CTabWidgetDelegate_included
80 
81 
void SetDocumentModeEnabled(QWidget &containerWidget, bool isDocumentModeEnabled=true)
virtual int GetPagesCount(const QWidget &containerWidget) const
Get the number of the pages in the container.
virtual void SetPageToolTip(QWidget &containerWidget, int pageIndex, const QString &pageToolTip)
Set the page tool tip.
virtual bool IsPageEnabled(const QWidget &containerWidget, int pageIndex) const
Get if the page enabled/disabled.
virtual QWidget * CreateContainerWidget(QWidget *parentWidgetPtr, int containerGuiFlags=CGF_NONE, int orientation=Qt::Horizontal)
Create container for the page widgets.
virtual void SetPageTitle(QWidget &containerWidget, int pageIndex, const QString &pageTitle)
Set the page title.
CTabWidgetDelegate(QTabWidget::TabPosition tabPosition=QTabWidget::North, bool useDocumentMode=false)
virtual QSize GetPageIconSize(const QWidget &containerWidget) const
Get the size page icon.
virtual bool IsPageVisible(const QWidget &containerWidget, int pageIndex) const
Get if the page visible/hidden.
virtual void RemovePage(QWidget &containerWidget, int pageIndex)
Remove the page from the container.
virtual QString GetPageTitle(const QWidget &containerWidget, int pageIndex) const
Get the title of the given page.
virtual bool SetPageIconSize(QWidget &containerWidget, const QSize &pageIconSize)
Set the size of the icon for all pages in the container.
virtual bool SetPageVisible(QWidget &containerWidget, int pageIndex, bool isPageVisible=true)
Set page visible/hidden.
virtual QIcon GetPageIcon(const QWidget &containerWidget, int pageIndex) const
Get the page icon.
virtual bool SetCurrentPage(QWidget &containerWidget, int pageIndex)
Set active page in the container.
virtual bool ConnectPageIndexListener(QWidget &containerWidget, QObject *receiverPtr, const char *receiverSlotName)
Connect object, which will be notified about changing of the current selected page index...
virtual void ResetPages(QWidget &containerWidget)
Remove all pages from the container.
Implementation of the IMultiPageWidgetDelegate interface for QTabWidget.
void SetTabPosition(QWidget &containerWidget, QTabWidget::TabPosition tabPosition)
virtual int GetCurrentPage(const QWidget &containerWidget) const
Get currently active page in the container.
virtual QString GetPageToolTip(const QWidget &containerWidget, int pageIndex) const
Get the page tool tip.
virtual bool SetPageEnabled(QWidget &containerWidget, int pageIndex, bool isPageEnabled=true)
Set page enabled/disabled.
PageHeaderPosition
Enum for describing of page header bar position on the container widget.
Interface of a delegate object used for operating on concrete UI-container implementation.
virtual bool SetPageHeaderPosition(QWidget &containerWidget, PageHeaderPosition pageHeaderPosition)
Set the position of the page header bar on the container UI.
virtual QWidget * GetPageWidgetPtr(const QWidget &containerWidget, int pageIndex) const
Get page's widget from the container.
Default behavior of the UI container.
virtual int InsertPage(QWidget &containerWidget, QWidget *pageWidgetPtr, const QString &pageTitle, int pageIndex=-1)
Add a new page to the container.
virtual void SetPageIcon(QWidget &containerWidget, int pageIndex, const QIcon &pageIcon)
Set the page icon.

© 2007-2017 Witold Gantzke and Kirill Lepskiy