summaryrefslogtreecommitdiffstats
path: root/src/sq_dragprovider.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/sq_dragprovider.h')
-rw-r--r--src/sq_dragprovider.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/sq_dragprovider.h b/src/sq_dragprovider.h
new file mode 100644
index 0000000..5d9d08f
--- /dev/null
+++ b/src/sq_dragprovider.h
@@ -0,0 +1,62 @@
+/***************************************************************************
+ sq_dragprovider.h - description
+ -------------------
+ begin : ??? Sep 17 2007
+ copyright : (C) 2007 by Baryshev Dmitry
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 <tqobject.h>
+
+#include <tdefileitem.h>
+
+class TQWidget;
+
+/*
+ * Class for making drag operations easier.
+ *
+ * All fileview types (Details, Thumbnails...) use an instance of
+ * this class in startDrag() method.
+ */
+
+class SQ_DragProvider : public TQObject
+{
+ public:
+ enum SourceType { Icons, Thumbnails };
+
+ SQ_DragProvider(TQObject *parent);
+ ~SQ_DragProvider();
+
+ /*
+ * Set drag source (fileview), file list and fileview type.
+ */
+ void setParams(TQWidget *_source, const KFileItemList &_files, SourceType tp);
+
+ /*
+ * Start drag operation.
+ */
+ void start();
+
+ static SQ_DragProvider* instance() { return m_inst; }
+
+ private:
+ TQWidget *source;
+ KFileItemList files;
+ SourceType type;
+
+ static SQ_DragProvider *m_inst;
+};
+
+#endif