00001 /* 00002 Copyright (C) 2008-2009 Tim Fechtner < urwald at users dot sourceforge dot net > 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 #include "stationdirectorytree.h" 00022 00023 #include <KDebug> 00024 #include "streamdirectoryservice.h" 00025 00026 stationDirectoryTree::stationDirectoryTree(QWidget *parent, const QString & genreIconFileName) 00027 : QTreeWidget(parent) 00028 { 00029 // variables 00030 QTreeWidgetItem *m_item; 00031 00032 // code 00033 00034 // appearance 00035 setColumnCount(3); // This MUST be done before adding items! TODO use a value that makes sense 00036 setVerticalScrollMode(QAbstractItemView::ScrollPerPixel); 00037 setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel); 00038 setAnimated(true); 00039 setAlternatingRowColors(true); 00040 00041 // scale icon size automatically 00042 m_item = new QTreeWidgetItem(this); 00043 setIconSize(QSize(32767, sizeHintForRow(0))); 00044 delete m_item; 00045 00046 // internals 00047 genreIcon = KIcon(genreIconFileName); 00048 }; 00049 00050 stationDirectoryTree::~stationDirectoryTree() 00051 { 00052 } 00053 00054 void stationDirectoryTree::addStreamToWidget(streamDirectoryService *plugin,//TODO makethis const!? 00055 const QString & genre, 00056 const QString & streamName, 00057 const quint64 bitrate, 00058 const QString & currentlyPlaying) 00059 { 00060 if (plugin) { 00061 // TODO 00062 }; 00063 } 00064 00065 void stationDirectoryTree::registerPlugin(streamDirectoryService *plugin) 00066 { 00067 if (plugin) { 00068 plugin->setWidget(this); 00069 }; 00070 } 00071 00072 void stationDirectoryTree::removeAllStreamsOfThisService(const streamDirectoryService *plugin) 00073 { 00074 if (plugin) { 00075 // TODO 00076 }; 00077 }