| 1 | /************************************************************************** |
| 2 | ** |
| 3 | ** This file is part of Qt Creator |
| 4 | ** |
| 5 | ** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 6 | ** |
| 7 | ** Contact: Nokia Corporation ([email protected]) |
| 8 | ** |
| 9 | ** Commercial Usage |
| 10 | ** |
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in |
| 12 | ** accordance with the Qt Commercial License Agreement provided with the |
| 13 | ** Software or, alternatively, in accordance with the terms contained in |
| 14 | ** a written agreement between you and Nokia. |
| 15 | ** |
| 16 | ** GNU Lesser General Public License Usage |
| 17 | ** |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 2.1 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements |
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
| 24 | ** |
| 25 | ** If you are unsure which license is appropriate for your use, please |
| 26 | ** contact the sales department at http://qt.nokia.com/contact. |
| 27 | ** |
| 28 | **************************************************************************/ |
| 29 | |
| 30 | #ifndef FANCYTABWIDGET_H |
| 31 | #define FANCYTABWIDGET_Hcxx . . $ `src/fancytabwidget.h:31:9`! |
| 32 | |
| 33 | #include <QIcon> |
| 34 | #include <QPropertyAnimation> |
| 35 | #include <QProxyStyle> |
| 36 | #include <QTabBar> |
| 37 | #include <QTimer> |
| 38 | #include <QWidget> |
| 39 | |
| 40 | //#include <boost/scoped_ptr.hpp> |
| 41 | |
| 42 | class QActionGroupcxx . . $ QActionGroup#; |
| 43 | class QMenucxx . . $ QMenu#; |
| 44 | class QPaintercxx . . $ QPainter#; |
| 45 | class QSignalMappercxx . . $ QSignalMapper#; |
| 46 | class QStackedLayoutcxx . . $ QStackedLayout#; |
| 47 | class QStatusBarcxx . . $ QStatusBar#; |
| 48 | class QVBoxLayoutcxx . . $ QVBoxLayout#; |
| 49 | |
| 50 | namespace Corecxx . . $ Core/ { |
| 51 | namespace Internalcxx . . $ Core/Internal/ { |
| 52 | |
| 53 | class FancyTabProxyStylecxx . . $ Core/Internal/FancyTabProxyStyle# : public QProxyStylecxx . . $ QProxyStyle# { |
| 54 | Q_OBJECTcxx . . $ Core/Internal/FancyTabProxyStyle#QPrivateSignal# |
| 55 | |
| 56 | public: |
| 57 | void drawControlcxx . . $ Core/Internal/FancyTabProxyStyle#drawControl(474ae36165ae066e).(ControlElementcxx . . $ QStyle#ControlElement# element, const QStyleOptioncxx . . $ QStyleOption#* option, |
| 58 | QPaintercxx . . $ QPainter#* painter, const QWidgetcxx . . $ QWidget#* widget) const; |
| 59 | void polishcxx . . $ Core/Internal/FancyTabProxyStyle#polish(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* widget); |
| 60 | void polishcxx . . $ Core/Internal/FancyTabProxyStyle#polish(d92ad49948ef73c2).(QApplicationcxx . . $ QApplication#* app); |
| 61 | void polishcxx . . $ Core/Internal/FancyTabProxyStyle#polish(a135350238a55bc8).(QPalettecxx . . $ QPalette#& palette); |
| 62 | |
| 63 | protected: |
| 64 | bool eventFiltercxx . . $ Core/Internal/FancyTabProxyStyle#eventFilter(978aa4af1d030efa).(QObjectcxx . . $ QObject#* o, QEventcxx . . $ QEvent#* e); |
| 65 | }; |
| 66 | |
| 67 | class FancyTabcxx . . $ Core/Internal/FancyTab# : public QWidgetcxx . . $ QWidget#{ |
| 68 | Q_OBJECTcxx . . $ Core/Internal/FancyTab#QPrivateSignal# |
| 69 | |
| 70 | Q_PROPERTYcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:104:9`!(float fader READ fader WRITE setFader) |
| 71 | public: |
| 72 | FancyTabcxx . . $ Core/Internal/FancyTab#FancyTab(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *tabbar); |
| 73 | float fadercxx . . $ Core/Internal/FancyTab#fader(9b8c9e39889c762c).() { return m_fadercxx . . $ Core/Internal/FancyTab#m_fader.; } |
| 74 | void setFadercxx . . $ Core/Internal/FancyTab#setFader(9364e6e7bff7660).(float value); |
| 75 | |
| 76 | QSizecxx . . $ QSize# sizeHintcxx . . $ Core/Internal/FancyTab#sizeHint(4b3b776e5ee2b367).() const; |
| 77 | |
| 78 | void fadeIncxx . . $ Core/Internal/FancyTab#fadeIn(49f6e7a06ebc5aa8).(); |
| 79 | void fadeOutcxx . . $ Core/Internal/FancyTab#fadeOut(49f6e7a06ebc5aa8).(); |
| 80 | |
| 81 | QIconcxx . . $ QIcon# iconcxx . . $ Core/Internal/FancyTab#icon.; |
| 82 | QStringcxx . . $ QString# textcxx . . $ Core/Internal/FancyTab#text.; |
| 83 | |
| 84 | protected: |
| 85 | void enterEventcxx . . $ Core/Internal/FancyTab#enterEvent(c2473e2e70986fd7).(QEventcxx . . $ QEvent# *); |
| 86 | void leaveEventcxx . . $ Core/Internal/FancyTab#leaveEvent(c2473e2e70986fd7).(QEventcxx . . $ QEvent# *); |
| 87 | |
| 88 | private: |
| 89 | QPropertyAnimationcxx . . $ QPropertyAnimation# animatorcxx . . $ Core/Internal/FancyTab#animator.; |
| 90 | QWidgetcxx . . $ QWidget# *tabbarcxx . . $ Core/Internal/FancyTab#tabbar.; |
| 91 | float m_fadercxx . . $ Core/Internal/FancyTab#m_fader.; |
| 92 | }; |
| 93 | |
| 94 | class FancyTabBarcxx . . $ Core/Internal/FancyTabBar# : public QWidgetcxx . . $ QWidget# |
| 95 | { |
| 96 | Q_OBJECTcxx . . $ Core/Internal/FancyTabBar#staticMetaObject. |
| 97 | |
| 98 | public: |
| 99 | FancyTabBarcxx . . $ Core/Internal/FancyTabBar#FancyTabBar(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget# *parent = 0); |
| 100 | ~cxx . . $ Core/Internal/FancyTabBar#`~FancyTabBar`(ced63f7c635d850d).FancyTabBarcxx . . $ Core/Internal/FancyTabBar#(); |
| 101 | |
| 102 | void paintEventcxx . . $ Core/Internal/FancyTabBar#paintEvent(f239c9e85d61a220).(QPaintEventcxx . . $ QPaintEvent# *event); |
| 103 | void paintTabcxx . . $ Core/Internal/FancyTabBar#paintTab(d955e0f0b944201a).(QPaintercxx . . $ QPainter# *painter, int tabIndex) const; |
| 104 | void mousePressEventcxx . . $ Core/Internal/FancyTabBar#mousePressEvent(702858a82d06265c).(QMouseEventcxx . . $ QMouseEvent# *); |
| 105 | bool validIndexcxx . . $ Core/Internal/FancyTabBar#validIndex(4a668f6de69bf818).(int index) const { return index >= 0 && index < m_tabscxx . . $ Core/Internal/FancyTabBar#m_tabs..countcxx . . $ QList#count(455f465bc33b4cdf).(); } |
| 106 | |
| 107 | QSizecxx . . $ QSize# sizeHintcxx . . $ Core/Internal/FancyTabBar#sizeHint(4b3b776e5ee2b367).() const; |
| 108 | QSizecxx . . $ QSize# minimumSizeHintcxx . . $ Core/Internal/FancyTabBar#minimumSizeHint(4b3b776e5ee2b367).() const; |
| 109 | |
| 110 | void addTabcxx . . $ Core/Internal/FancyTabBar#addTab(8d594714bb74b0ab).(const QIconcxx . . $ QIcon# &icon, const QStringcxx . . $ QString# &label); |
| 111 | void addSpacercxx . . $ Core/Internal/FancyTabBar#addSpacer(d4f767463ce0a6b3).(int size = 40); |
| 112 | void removeTabcxx . . $ Core/Internal/FancyTabBar#removeTab(d4f767463ce0a6b3).(int index) { |
| 113 | FancyTabcxx . . $ Core/Internal/FancyTab# *tab = m_tabscxx . . $ Core/Internal/FancyTabBar#m_tabs..takeAtcxx . . $ QList#takeAt(767fea59dce4185d).(index); |
| 114 | delete tab; |
| 115 | } |
| 116 | void setCurrentIndexcxx . . $ Core/Internal/FancyTabBar#setCurrentIndex(d4f767463ce0a6b3).(int index); |
| 117 | int currentIndexcxx . . $ Core/Internal/FancyTabBar#currentIndex(455f465bc33b4cdf).() const { return m_currentIndexcxx . . $ Core/Internal/FancyTabBar#m_currentIndex.; } |
| 118 | |
| 119 | void setTabToolTipcxx . . $ Core/Internal/FancyTabBar#setTabToolTip(4b11a7293b4ed91c).(int index, const QStringcxx . . $ QString#& toolTip); |
| 120 | QStringcxx . . $ QString# tabToolTipcxx . . $ Core/Internal/FancyTabBar#tabToolTip(3f3c3d0e9c0eb37f).(int index) const; |
| 121 | |
| 122 | QIconcxx . . $ QIcon# tabIconcxx . . $ Core/Internal/FancyTabBar#tabIcon(32078549dd1fc3ac).(int index) const {return m_tabscxx . . $ QIcon#QIcon(71dcdac178620ed6)..atcxx . . $ QList#at(e2681f9bb6b2f357).(index)->iconcxx . . $ Core/Internal/FancyTab#icon.; } |
| 123 | QStringcxx . . $ QString# tabTextcxx . . $ Core/Internal/FancyTabBar#tabText(3f3c3d0e9c0eb37f).(int index) const { return m_tabscxx . . $ Core/Internal/FancyTabBar#m_tabs..atcxx . . $ QList#at(e2681f9bb6b2f357).(index)->textcxx . . $ Core/Internal/FancyTab#text.; } |
| 124 | int countcxx . . $ Core/Internal/FancyTabBar#count(455f465bc33b4cdf).() const {return m_tabscxx . . $ Core/Internal/FancyTabBar#m_tabs..countcxx . . $ QList#count(455f465bc33b4cdf).(); } |
| 125 | QRectcxx . . $ QRect# tabRectcxx . . $ Core/Internal/FancyTabBar#tabRect(aeb380d106682fa3).(int index) const; |
| 126 | |
| 127 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 128 | void currentChangedcxx . . $ Core/Internal/FancyTabBar#currentChanged(d4f767463ce0a6b3).(int); |
| 129 | |
| 130 | public slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 131 | void emitCurrentIndexcxx . . $ Core/Internal/FancyTabBar#emitCurrentIndex(49f6e7a06ebc5aa8).(); |
| 132 | |
| 133 | private: |
| 134 | static const int m_roundingcxx . . $ Core/Internal/FancyTabBar#m_rounding.; |
| 135 | static const int m_textPaddingcxx . . $ Core/Internal/FancyTabBar#m_textPadding.; |
| 136 | int m_currentIndexcxx . . $ Core/Internal/FancyTabBar#m_currentIndex.; |
| 137 | QListcxx . . $ QList#<FancyTabcxx . . $ Core/Internal/FancyTab#*> m_tabscxx . . $ Core/Internal/FancyTabBar#m_tabs.; |
| 138 | QTimercxx . . $ QTimer# m_triggerTimercxx . . $ Core/Internal/FancyTabBar#m_triggerTimer.; |
| 139 | QSizecxx . . $ QSize# tabSizeHintcxx . . $ Core/Internal/FancyTabBar#tabSizeHint(482fa2bd80a86457).(bool minimum = false) const; |
| 140 | |
| 141 | }; |
| 142 | |
| 143 | class FancyTabWidgetcxx . . $ Core/Internal/FancyTabWidget# : public QWidgetcxx . . $ QWidget# { |
| 144 | Q_OBJECTcxx . . $ Core/Internal/FancyTabWidget#trUtf8(75d9f1c324b4579d). |
| 145 | |
| 146 | public: |
| 147 | FancyTabWidgetcxx . . $ Core/Internal/FancyTabWidget#FancyTabWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* parent = 0); |
| 148 | |
| 149 | // Values are persisted - only add to the end |
| 150 | enum Modecxx . . $ Core/Internal/FancyTabWidget#Mode# { |
| 151 | Mode_Nonecxx . . $ Core/Internal/FancyTabWidget#Mode_None. = 0, |
| 152 | |
| 153 | Mode_LargeSidebarcxx . . $ Core/Internal/FancyTabWidget#Mode_LargeSidebar. = 1, |
| 154 | Mode_SmallSidebarcxx . . $ Core/Internal/FancyTabWidget#Mode_SmallSidebar. = 2, |
| 155 | Mode_Tabscxx . . $ Core/Internal/FancyTabWidget#Mode_Tabs. = 3, |
| 156 | Mode_IconOnlyTabscxx . . $ Core/Internal/FancyTabWidget#Mode_IconOnlyTabs. = 4, |
| 157 | Mode_PlainSidebarcxx . . $ Core/Internal/FancyTabWidget#Mode_PlainSidebar. = 5, |
| 158 | }; |
| 159 | |
| 160 | struct Itemcxx . . $ Core/Internal/FancyTabWidget#Item# { |
| 161 | Itemcxx . . $ Core/Internal/FancyTabWidget#Item#Item(8d594714bb74b0ab).(const QIconcxx . . $ QIcon#& icon, const QStringcxx . . $ QString#& label) |
| 162 | : type_cxx . . $ Core/Internal/FancyTabWidget#Item#type_.(Type_Tabcxx . . $ Core/Internal/FancyTabWidget#Item#Type_Tab.), tab_label_cxx . . $ QString#QString(132dd6869045752b).(label), tab_icon_cxx . . $ Core/Internal/FancyTabWidget#Item#tab_icon_.(icon), spacer_size_cxx . . $ Core/Internal/FancyTabWidget#Item#spacer_size_.(0) {} |
| 163 | Itemcxx . . $ Core/Internal/FancyTabWidget#Item#Item(d4f767463ce0a6b3).(int size) : type_cxx . . $ Core/Internal/FancyTabWidget#Item#type_.(Type_Spacercxx . . $ Core/Internal/FancyTabWidget#Item#Type_Spacer.), spacer_size_cxx . . $ Core/Internal/FancyTabWidget#Item#spacer_size_.(size) {} |
| 164 | |
| 165 | enum Typecxx . . $ Core/Internal/FancyTabWidget#Item#Type# { |
| 166 | Type_Tabcxx . . $ Core/Internal/FancyTabWidget#Item#Type_Tab., |
| 167 | Type_Spacercxx . . $ Core/Internal/FancyTabWidget#Item#Type_Spacer., |
| 168 | }; |
| 169 | |
| 170 | Typecxx . . $ Core/Internal/FancyTabWidget#Item#Type# type_cxx . . $ Core/Internal/FancyTabWidget#Item#type_.; |
| 171 | QStringcxx . . $ QString# tab_label_cxx . . $ Core/Internal/FancyTabWidget#Item#tab_label_.; |
| 172 | QIconcxx . . $ QIcon# tab_icon_cxx . . $ Core/Internal/FancyTabWidget#Item#tab_icon_.; |
| 173 | int spacer_size_cxx . . $ Core/Internal/FancyTabWidget#Item#spacer_size_.; |
| 174 | }; |
| 175 | |
| 176 | void AddTabcxx . . $ Core/Internal/FancyTabWidget#AddTab(bc0b2a0f8cc7469d).(QWidgetcxx . . $ QWidget# *tab, const QIconcxx . . $ QIcon# &icon, const QStringcxx . . $ QString# &label); |
| 177 | void AddSpacercxx . . $ Core/Internal/FancyTabWidget#AddSpacer(d4f767463ce0a6b3).(int size = 40); |
| 178 | void SetBackgroundPixmapcxx . . $ Core/Internal/FancyTabWidget#SetBackgroundPixmap(8887f7d25b86c3f4).(const QPixmapcxx . . $ QPixmap#& pixmap); |
| 179 | |
| 180 | void AddBottomWidgetcxx . . $ Core/Internal/FancyTabWidget#AddBottomWidget(108f35f7aa7f3cf9).(QWidgetcxx . . $ QWidget#* widget); |
| 181 | |
| 182 | int current_indexcxx . . $ Core/Internal/FancyTabWidget#current_index(455f465bc33b4cdf).() const; |
| 183 | Modecxx . . $ Core/Internal/FancyTabWidget#Mode# modecxx . . $ Core/Internal/FancyTabWidget#mode(fcee280d3cd5cec1).() const { return mode_cxx . . $ Core/Internal/FancyTabWidget#mode_.; } |
| 184 | |
| 185 | public slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 186 | void SetCurrentIndexcxx . . $ Core/Internal/FancyTabWidget#SetCurrentIndex(d4f767463ce0a6b3).(int index); |
| 187 | void SetModecxx . . $ Core/Internal/FancyTabWidget#SetMode(dfd2534392596d8d).(Modecxx . . $ Core/Internal/FancyTabWidget#Mode# mode); |
| 188 | void SetModecxx . . $ Core/Internal/FancyTabWidget#SetMode(d4f767463ce0a6b3).(int mode) { SetModecxx . . $ Core/Internal/FancyTabWidget#SetMode(dfd2534392596d8d).(Modecxx . . $ Core/Internal/FancyTabWidget#Mode#(mode)); } |
| 189 | |
| 190 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 191 | void CurrentChangedcxx . . $ Core/Internal/FancyTabWidget#CurrentChanged(d4f767463ce0a6b3).(int index); |
| 192 | void ModeChangedcxx . . $ Core/Internal/FancyTabWidget#ModeChanged(dfd2534392596d8d).(FancyTabWidgetcxx . . $ Core/Internal/FancyTabWidget#::Modecxx . . $ Core/Internal/FancyTabWidget#Mode# mode); |
| 193 | |
| 194 | protected: |
| 195 | void paintEventcxx . . $ Core/Internal/FancyTabWidget#paintEvent(f239c9e85d61a220).(QPaintEventcxx . . $ QPaintEvent# *event); |
| 196 | void contextMenuEventcxx . . $ Core/Internal/FancyTabWidget#contextMenuEvent(ebb2569a74e11126).(QContextMenuEventcxx . . $ QContextMenuEvent#* e); |
| 197 | |
| 198 | private slotscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:88:14`!: |
| 199 | void ShowWidgetcxx . . $ Core/Internal/FancyTabWidget#ShowWidget(d4f767463ce0a6b3).(int index); |
| 200 | |
| 201 | private: |
| 202 | void MakeTabBarcxx . . $ Core/Internal/FancyTabWidget#MakeTabBar(232105a539837f0d).(QTabBarcxx . . $ QTabBar#::Shapecxx . . $ QTabBar#Shape# shape, bool text, bool icons, bool fancy); |
| 203 | void AddMenuItemcxx . . $ Core/Internal/FancyTabWidget#AddMenuItem(c323779ba22a3bb3).(QSignalMappercxx . . $ QSignalMapper#* mapper, QActionGroupcxx . . $ QActionGroup#* group, |
| 204 | const QStringcxx . . $ QString#& text, Modecxx . . $ Core/Internal/FancyTabWidget#Mode# mode); |
| 205 | |
| 206 | Modecxx . . $ Core/Internal/FancyTabWidget#Mode# mode_cxx . . $ Core/Internal/FancyTabWidget#mode_.; |
| 207 | QListcxx . . $ QList#<Itemcxx . . $ Core/Internal/FancyTabWidget#Item#> items_cxx . . $ Core/Internal/FancyTabWidget#items_.; |
| 208 | |
| 209 | QWidgetcxx . . $ QWidget#* tab_bar_cxx . . $ Core/Internal/FancyTabWidget#tab_bar_.; |
| 210 | QStackedLayoutcxx . . $ QStackedLayout#* stack_cxx . . $ Core/Internal/FancyTabWidget#stack_.; |
| 211 | QPixmapcxx . . $ QPixmap# background_pixmap_cxx . . $ Core/Internal/FancyTabWidget#background_pixmap_.; |
| 212 | QWidgetcxx . . $ QWidget#* side_widget_cxx . . $ Core/Internal/FancyTabWidget#side_widget_.; |
| 213 | QVBoxLayoutcxx . . $ QVBoxLayout#* side_layout_cxx . . $ Core/Internal/FancyTabWidget#side_layout_.; |
| 214 | QVBoxLayoutcxx . . $ QVBoxLayout#* top_layout_cxx . . $ Core/Internal/FancyTabWidget#top_layout_.; |
| 215 | |
| 216 | bool use_background_cxx . . $ Core/Internal/FancyTabWidget#use_background_.; |
| 217 | |
| 218 | QMenucxx . . $ QMenu#* menu_cxx . . $ Core/Internal/FancyTabWidget#menu_.; |
| 219 | |
| 220 | //boost::scoped_ptr<FancyTabProxyStyle> proxy_style_; |
| 221 | QScopedPointercxx . . $ QScopedPointer#<FancyTabProxyStylecxx . . $ Core/Internal/FancyTabProxyStyle#> proxy_style_cxx . . $ Core/Internal/FancyTabWidget#proxy_style_.; |
| 222 | }; |
| 223 | |
| 224 | } // namespace Internal |
| 225 | } // namespace Core |
| 226 | |
| 227 | Q_DECLARE_METATYPEcxx . . $ QPropertyAnimation#(QPropertyAnimation*); |
| 228 | |
| 229 | using Corecxx . . $ Core/::Internalcxx . . $ Core/Internal/::FancyTabcxx . . $ FancyTab#; |
| 230 | using Corecxx . . $ Core/::Internalcxx . . $ Core/Internal/::FancyTabBarcxx . . $ Core/Internal/FancyTabBar#; |
| 231 | using Corecxx . . $ Core/::Internalcxx . . $ Core/Internal/::FancyTabWidgetcxx . . $ Core/Internal/FancyTabWidget#; |
| 232 | |
| 233 | #endif // FANCYTABWIDGET_H |