summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/oblique/selector.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /noatun-plugins/oblique/selector.h
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'noatun-plugins/oblique/selector.h')
-rw-r--r--noatun-plugins/oblique/selector.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/noatun-plugins/oblique/selector.h b/noatun-plugins/oblique/selector.h
new file mode 100644
index 0000000..1447dec
--- /dev/null
+++ b/noatun-plugins/oblique/selector.h
@@ -0,0 +1,76 @@
+// Copyright (c) 2003 Charles Samuels <charles@kde.org>
+// See the file COPYING for redistribution terms.
+
+#ifndef SELECTOR_H
+#define SELECTOR_H
+
+#include <noatun/playlist.h>
+#include "file.h"
+
+class Item : public PlaylistItemData
+{
+ File mFile;
+
+public:
+ Item(const File &file);
+
+ File itemFile() const { return mFile; }
+
+ virtual QString property(const QString &key, const QString &def=0) const;
+ virtual void setProperty(const QString &key, const QString &property);
+ virtual void clearProperty (const QString &key);
+ virtual QStringList properties() const;
+
+ virtual bool isProperty(const QString &key) const;
+
+ virtual bool operator==(const PlaylistItemData &d) const;
+ virtual void remove();
+};
+
+/**
+ * a selector is an object that can get items from the
+ * playlist in a certain order
+ **/
+class Selector
+{
+public:
+ Selector();
+ virtual ~Selector();
+ virtual Item *next()=0;
+ virtual Item *previous()=0;
+ virtual Item *current()=0;
+ virtual void setCurrent(const Item &item)=0;
+};
+
+class Tree;
+class TreeItem;
+
+class SequentialSelector : public Selector
+{
+ Tree *mTree;
+
+public:
+ SequentialSelector(Tree *tree);
+ virtual ~SequentialSelector();
+ virtual Item *next();
+ virtual Item *previous();
+ virtual Item *current();
+ virtual void setCurrent(const Item &item);
+ virtual void setCurrent(TreeItem *current);
+};
+
+class RandomSelector : public Selector
+{
+ Tree *mTree;
+ TreeItem *mPrevious;
+public:
+ RandomSelector(Tree *tree);
+
+ virtual Item *next();
+ virtual Item *previous();
+ virtual Item *current();
+ virtual void setCurrent(const Item &item);
+ virtual void setCurrent(TreeItem *item, TreeItem *previous);
+};
+
+#endif