stationlistitem.h

Go to the documentation of this file.
00001 /*
00002     Copyright (C) 2008-2010  Lukas Sommer < SommerLuk at gmail dot com >
00003 
00004     This program is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU General Public License as
00006     published by the Free Software Foundation; either version 2 of
00007     the License or (at your option) version 3 or any later version
00008     accepted by the membership of KDE e.V. (or its successor approved
00009     by the membership of KDE e.V.), which shall act as a proxy
00010     defined in Section 14 of version 3 of the license.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef STATIONLISTITEM_H
00022 #define STATIONLISTITEM_H
00023 
00024 #include <QList>
00025 #include <QPointer>
00026 #include <QString>
00027 #include "radiostation.h"
00028 
00035 class stationlistItem
00036 {
00037 
00038   public:
00042     enum itemType {
00043       folder,
00044       stream
00045     };
00048     explicit stationlistItem(const QString &folderName);
00052     explicit stationlistItem(radioStation *streamObject);
00058     virtual ~stationlistItem();
00064     bool appendChild(stationlistItem *child);
00068     stationlistItem *child(int row) const;
00070     int childCount() const;
00074     void detach();
00078     QString folderName() const;
00086     bool insertChild(stationlistItem *child, int row);
00088     stationlistItem *parent() const;
00091     int row() const;
00093     void setFolderName(const QString & folderName);
00097     radioStation *streamObject() const;
00099     stationlistItem::itemType type() const;
00100 
00101   private:
00103     QList<stationlistItem *> childItems;
00105     void initialize();
00107     QString m_folderName;
00109     itemType m_itemType;
00111     QPointer<radioStation> m_radiostation;
00114     stationlistItem *parentItem;
00116     stationlistItem *self;
00117 };
00118 
00119 #endif

doxygen