Modified existing classes to use the new PanelTabBar class and its methods
[situare] / src / ui / tabbedpanel.h
index 9bc1fe4..5c9398a 100644 (file)
@@ -20,7 +20,6 @@
     USA.
 */
 
-
 #ifndef TABBEDPANEL_H
 #define TABBEDPANEL_H
 
 
 #include "panelcommon.h"
 
-class QButtonGroup;
-class QMouseEvent;
-class QPaintEvent;
-class QPixmap;
-class QRect;
+class QPropertyAnimation;
 class QSignalTransition;
 class QStackedWidget;
 class QState;
@@ -40,14 +35,13 @@ class QStateMachine;
 
 class PanelBar;
 class PanelContent;
+class PanelTabBar;
 
 /**
  * @brief Class for tabbed panels
  *
  * @author Kaj Wallin - kaj.wallin (at) ixonos.com
  * @author Pekka Nissinen - pekka.nissinen@ixonos.com
- *
- * @class TabbedPanel tabbedpanel.h "ui/tabbedpanel.h"
  */
 class TabbedPanel : public QWidget
 {
@@ -97,8 +91,6 @@ 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);
@@ -115,35 +107,35 @@ public slots:
     void openPanel();
 
     /**
-     * @brief Sets the tab at given index active
-     *
-     * @param index Index of the tab
-     */
-    void setActiveTab(int index);
-
-    /**
      * @brief Slot to redraw the panel after window resize event
      *
      * @param size Size of the new window
      */
     void resizePanel(const QSize &size);
 
-private slots:
     /**
-     * @brief Internal slot used to track statemachine state
+     * @brief Shows the tab at given index active
+     *
+     * @param index Index of the tab
      */
-    void stateChangedToClosed();
+    void showTab(int index);
 
+private slots:
     /**
      * @brief Internal slot used to track statemachine state
      */
-    void stateChangedToOpen();
+    void stateChanged();
 
 /*******************************************************************************
  * SIGNALS
  ******************************************************************************/
 signals:
     /**
+     * @brief This signal is emitted whenever the current page index changes
+     */
+    void currentChanged(int index);
+
+    /**
      * @brief Signal that is sent when panel is closed
      *
      * @sa openPanel
@@ -160,7 +152,7 @@ signals:
     void panelOpened();
 
     /**
-     * @brief Signal that is sent to state machine when state must be changed
+     * @brief Signal that is sent to state machine when panel state must be changed
      *
      * @sa openPanel
      * @sa closePanel
@@ -173,9 +165,7 @@ signals:
 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
@@ -189,6 +179,7 @@ private:
 
     PanelBar *m_panelBar;                       ///< Widget for panel bar
     PanelContent *m_panelContent;               ///< Widget for panel content
+    PanelTabBar *m_panelTabBar;                 ///< Widget for panel tab bar
 };
 
 #endif // TABBEDPANEL_H