┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontainer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/kitemviews/kitemlistcontainer.h')
-rw-r--r--src/kitemviews/kitemlistcontainer.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontainer.h b/src/kitemviews/kitemlistcontainer.h
new file mode 100644
index 000000000..83044c4f8
--- /dev/null
+++ b/src/kitemviews/kitemlistcontainer.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+ * Copyright (C) 2011 by Peter Penz <[email protected]> *
+ * *
+ * Based on the Itemviews NG project from Trolltech Labs: *
+ * http://qt.gitorious.org/qt-labs/itemviews-ng *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
+ ***************************************************************************/
+
+#ifndef KITEMLISTCONTAINER_H
+#define KITEMLISTCONTAINER_H
+
+#include <libdolphin_export.h>
+
+#include <QAbstractScrollArea>
+
+class KItemListController;
+class KItemListView;
+class KItemModelBase;
+
+/**
+ * @brief Provides a QWidget based scrolling view for a KItemListController.
+ *
+ * @see KItemListController
+ */
+class LIBDOLPHINPRIVATE_EXPORT KItemListContainer : public QAbstractScrollArea
+{
+ Q_OBJECT
+
+public:
+ explicit KItemListContainer(KItemListController* controller, QWidget* parent = 0);
+ KItemListContainer(QWidget* parent = 0);
+ virtual ~KItemListContainer();
+
+ KItemListController* controller() const;
+
+protected:
+ virtual void showEvent(QShowEvent* event);
+ virtual void resizeEvent(QResizeEvent* event);
+ virtual void scrollContentsBy(int dx, int dy);
+
+private slots:
+ void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
+ void slotViewChanged(KItemListView* current, KItemListView* previous);
+ void updateScrollBars();
+
+private:
+ void initialize();
+ void updateGeometries();
+
+private:
+ KItemListController* m_controller;
+};
+
+#endif
+
+