Mixxx

/home/maxime/Projets/Mixxx/1.10/mixxx/src/library/treeitem.h

Go to the documentation of this file.
00001 // treeitem.h
00002 // Created 10/02/2010 by Tobias Rafreider
00003 
00004 #ifndef TREEITEM_H
00005 #define TREEITEM_H
00006 
00007 #include <QList>
00008 #include <QString>
00009 #include <QVariant>
00010 
00011 #include "library/libraryfeature.h"
00012 
00013 class TreeItem {
00014   public:
00015     TreeItem(); //creates an invisible root item for the tree
00016     TreeItem(const QString &data,
00017              const QString &data_path,
00018              LibraryFeature* feature,
00019              TreeItem* parent);
00020     ~TreeItem();
00022     void appendChild(TreeItem *child);
00024     TreeItem *child(int row);
00026     int childCount() const;
00028     int row() const;
00030     TreeItem *parent();
00031 
00033     bool insertChildren(QList<TreeItem*> &data, int position, int count);
00035     bool removeChildren(int position, int count);
00036 
00038     bool setData(const QVariant &data, const QVariant &data_path);
00040     QVariant data() const;
00042     QVariant dataPath() const;
00044     bool isPlaylist() const;
00046     bool isFolder() const;
00047     /* Returns the Library feature object to which an item belongs to */
00048     LibraryFeature* getFeature();
00049 
00050     void setIcon(const QIcon& icon);
00051     QIcon getIcon();
00052 
00053   private:
00054     QList<TreeItem*> m_childItems;
00055     QString m_dataPath;
00056     QString m_data;
00057     LibraryFeature* m_feature;
00058 
00059     TreeItem *m_parentItem;
00060     QIcon m_icon;
00061 };
00062 
00063 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines