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
- *
- * @class PanelBase panelbase.h "ui/panelbase.h"
+ * @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
+ * @author Sami Rämö - sami.ramo (at) ixonos.com
*/
class PanelBase : public QWidget
{
*
* @param parent Parent
*/
- PanelBase(QWidget *parent);
+ PanelBase(QWidget *parent = 0);
/*******************************************************************************
- * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ * MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
-protected:
+public:
+ /**
+ * @brief Getter for the generic panel related context buttons
+ *
+ * @returns Pointer to context buttons widget
+ */
+ QWidget* genericPanelButtons() const;
+
/**
- * @brief Draws the panel content base
+ * @brief Getter for the list item related context buttons
*
- * @param * QPaintEvent unused
+ * @returns Pointer to context buttons widget
*/
- void paintEvent(QPaintEvent *);
+ QWidget* itemButtons() const;
+
+protected slots:
+ /**
+ * @brief Call when there is a change in list item selection
+ *
+ * Emits listItemSelectionChanged(bool). Parameter is true if any item is selected.
+ */
+ 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);
+
+ /**
+ * @brief Emitted when there is a change in list item selection
+ *
+ * @param itemIsSelected True if any item is selected.
+ */
+ void listItemSelectionChanged(bool itemIsSelected);
/*******************************************************************************
* 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