X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fui%2Ftabbedpanel.h;h=87a056d44e303e213a0a7f6ff1e512d1271e94ec;hb=83b1d47ddd0006f846ff43fd0d3e83218081abd3;hp=06ab708d9722a8653a1365a0872e48ccae249728;hpb=bae5eff7a23b9f28c89a06c3eff10be6421871e6;p=situare diff --git a/src/ui/tabbedpanel.h b/src/ui/tabbedpanel.h index 06ab708..87a056d 100644 --- a/src/ui/tabbedpanel.h +++ b/src/ui/tabbedpanel.h @@ -20,7 +20,6 @@ USA. */ - #ifndef TABBEDPANEL_H #define TABBEDPANEL_H @@ -28,25 +27,22 @@ #include "panelcommon.h" -class QButtonGroup; -class QMouseEvent; -class QPaintEvent; -class QPixmap; class QPropertyAnimation; -class QRect; class QSignalTransition; -class QStackedWidget; class QState; class QStateMachine; +class ListItemContextButtonBar; class PanelBar; -class PanelContent; +class PanelContentStack; +class PanelContextButtonBar; +class PanelTabBar; /** * @brief Class for tabbed panels * * @author Kaj Wallin - kaj.wallin (at) ixonos.com - * @author Pekka Nissinen - pekka.nissinen@ixonos.com + * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com */ class TabbedPanel : public QWidget { @@ -75,7 +71,6 @@ public: */ int addTab(QWidget *widget, const QIcon& icon); - ///< @todo define "out of range" /** * @brief Inserts a tab to the panel * @@ -97,22 +92,33 @@ public: * Removes a tab and its widget from the panel at index position. The widget itself is not * deleted. * - * @todo: Fix tab drawing order - * * @param index Index of the tab */ void removeTab(int index); + /** + * @brief Sets tabs enabled. + * + * If disabled tab is currently selected, panel will be closed also + * @param tabIndexes tab indexes to set + * @param enabled true if should be enabled, false otherwise + */ + void setTabsEnabled(const QList &tabIndexes, bool enabled); + public slots: /** - * @brief Public slot that will close the panel unless already closed + * @brief Slot that closes the panel */ void closePanel(); /** - * @brief Public slot that will open the panel unless already open + * @brief Slot that opens the panel + * + * If widget pointer is provided the corresponding tab is also set active + * + * @param widget Widget */ - void openPanel(); + void openPanel(QWidget *widget = 0); /** * @brief Slot to redraw the panel after window resize event @@ -123,14 +129,26 @@ public slots: private slots: /** - * @brief Sets the tab at given index active + * @brief Calculates mask for tabbed panel * - * @param index Index of the tab + * Mask is constructed from PanelTabBar, PanelContextButtonBar and panel content sizes + */ + void calculateMask(); + + /** + * @brief Repositions context button bar + */ + void repositionContextButtonBar(); + + /** + * @brief Sets the panel at current index active + * + * @param index Index of the panel */ - void setActiveTab(int index); + void setCurrentIndex(int index); /** - * @brief Internal slot used to track statemachine state + * @brief Internal slot used to set the panel state */ void stateChanged(); @@ -139,6 +157,20 @@ private slots: ******************************************************************************/ signals: /** + * @brief This signal is emitted whenever the current tab page changes + * + * @param index Index of the new tab page + */ + void currentChanged(int index); + + /** + * @brief Emitted when there is a change in list item selection + * + * @param itemIsSelected True if any item is selected. + */ + void listItemSelectionChanged(bool itemIsSelected); + + /** * @brief Signal that is sent when panel is closed * * @sa openPanel @@ -155,12 +187,7 @@ signals: void panelOpened(); /** - * @brief Signal that is sent when user has clicked another tab active - */ - void tabChanged(); - - /** - * @brief Signal that is sent to state machine when state must be changed + * @brief Signal that is sent when the panel state must be changed * * @sa openPanel * @sa closePanel @@ -171,26 +198,17 @@ signals: * DATA MEMBERS ******************************************************************************/ private: - bool m_isOpen; ///< Boolean used to track the current state of the statemachine - - int m_activeTab; ///< Index of a active tab - - QButtonGroup *m_tabButtonGroup; ///< Button groub for tab buttons - - QPropertyAnimation *m_panelAnimation; ///< Animation for panel state changes - - QSignalTransition *m_panelTransitionClose; ///< Transition signal for closing the panel - QSignalTransition *m_panelTransitionOpen; ///< Transition signal for opening the panel - - QStackedWidget *m_panelWidgetStack; ///< Stack for panel widgets - - QState *m_panelStateClosed; ///< State of the closed panel - QState *m_panelStateOpened; ///< State of the opened panel + bool m_open; ///< Current state of the panel + bool m_closeRequestPending; ///< Indicates wheater the panel is waiting to be closed - QStateMachine *m_panelStateMachine; ///< State machine for sliding the panel + QState *m_stateClosed; ///< State of the closed panel + QState *m_stateOpened; ///< State of the opened panel - PanelBar *m_panelBar; ///< Widget for panel bar - PanelContent *m_panelContent; ///< Widget for panel content + ListItemContextButtonBar *m_itemContextButtonBar; ///< Widget for list item context button bar + PanelBar *m_panelBar; ///< Widget for panel bar + PanelContentStack *m_panelContentStack; ///< Stack for panel widgets + PanelContextButtonBar * m_panelContextButtonBar; ///< Widget for panel context button bar + PanelTabBar *m_panelTabBar; ///< Widget for panel tab bar }; #endif // TABBEDPANEL_H