summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sq_dragprovider.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 19:31:25 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-22 19:31:25 +0000
commit6afd9d8dddbe9e450690e05d498a503c00333a5e (patch)
treeee3eaca74e8e33dd66f24f5fb6c1431d7a9ff429 /ksquirrel/sq_dragprovider.h
downloadksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.tar.gz
ksquirrel-6afd9d8dddbe9e450690e05d498a503c00333a5e.zip
Added KDE3 version of ksquirrel photo manager
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ksquirrel@1094446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksquirrel/sq_dragprovider.h')
-rw-r--r--ksquirrel/sq_dragprovider.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/ksquirrel/sq_dragprovider.h b/ksquirrel/sq_dragprovider.h
new file mode 100644
index 0000000..425e967
--- /dev/null
+++ b/ksquirrel/sq_dragprovider.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ sq_dragprovider.h - description
+ -------------------
+ begin : ??? Sep 17 2007
+ copyright : (C) 2007 by Baryshev Dmitry
+ email : ksquirrel.iv@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef SQ_DRAGPROVIDER_H
+#define SQ_DRAGPROVIDER_H
+
+#include <qobject.h>
+
+#include <kfileitem.h>
+
+class QWidget;
+
+/*
+ * Class for making drag operations easier.
+ *
+ * All fileview types (Details, Thumbnails...) use an instance of
+ * this class in startDrag() method.
+ */
+
+class SQ_DragProvider : public QObject
+{
+ public:
+ enum SourceType { Icons, Thumbnails };
+
+ SQ_DragProvider(QObject *parent);
+ ~SQ_DragProvider();
+
+ /*
+ * Set drag source (fileview), file list and fileview type.
+ */
+ void setParams(QWidget *_source, const KFileItemList &_files, SourceType tp);
+
+ /*
+ * Start drag operation.
+ */
+ void start();
+
+ static SQ_DragProvider* instance() { return m_inst; }
+
+ private:
+ QWidget *source;
+ KFileItemList files;
+ SourceType type;
+
+ static SQ_DragProvider *m_inst;
+};
+
+#endif