Rough implementation of the item related buttons
[situare] / src / ui / panelbase.h
index 91200a1..3da0f62 100644 (file)
@@ -3,6 +3,7 @@
     Copyright (C) 2010  Ixonos Plc. Authors:
 
         Pekka Nissinen - pekka.nissinen@ixonos.com
+        Sami Rämö - sami.ramo@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
 #ifndef PANELBASE_H
 #define PANELBASE_H
 
-#include <QPaintEvent>
-#include <QPixmap>
 #include <QWidget>
 
+class QHBoxLayout;
+class QListWidgetItem;
+class QVBoxLayout;
+
+class ImageButton;
+
 /**
- * @brief Base class for panel inner content
+ * @brief Base class for panels
  *
- * @author Pekka Nissinen - pekka.nissinen@ixonos.com
+ * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
+ * @author Sami Rämö - sami.ramo (at) ixonos.com
  */
 class PanelBase : public QWidget
 {
@@ -43,22 +49,43 @@ public:
      */
     PanelBase(QWidget *parent = 0);
 
+protected:
+    void resizeEvent(QResizeEvent *event);
+
 /*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
-protected:
+public:
     /**
-     * @brief Draws the panel content base
+     * @brief Getter for the generic panel related context buttons
      *
-     * @param * QPaintEvent unused
+     * @returns Pointer to context buttons widget
      */
-    void paintEvent(QPaintEvent *);
+    QWidget* genericPanelButtons() const;
+
+protected slots:
+    void onListItemSelectionChanged();
+
+/*******************************************************************************
+ * SIGNALS
+ ******************************************************************************/
+signals:
+    /**
+     * @brief Signal for requesting a panel to be opened
+     *
+     * @param widget Pointer to the widget that emitted the signal
+     */
+    void openPanelRequested(QWidget *widget);
 
 /*******************************************************************************
  * DATA MEMBERS
- *******************************************************************************/
+ ******************************************************************************/
+protected:
+    QVBoxLayout *m_genericButtonsLayout;    ///< Layout for generic context buttons
+    QHBoxLayout *m_itemButtonsLayout;       ///< Layout for item related context buttons
+
 private:
-    QPixmap m_menuDropShadowTile; ///< Pixmap for menu drop shadow
+    QWidget *m_genericButtons;              ///< Widget for generic context buttons
+    QWidget *m_itemButtons;                 ///< Widget for item related context buttons
 };
-
 #endif // PANELBASE_H