2
* Copyright 2011 Kurtis L. Nusbaum
4
* This file is part of UDJ.
6
* UDJ is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation, either version 2 of the License, or
9
* (at your option) any later version.
11
* UDJ is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with UDJ. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef ACTIVITY_LIST_HPP
20
#define ACTIVITY_LIST_HPP
22
#include "ConfigDefs.hpp"
24
class QStandardItemModel;
34
* \brief Displays the various activities that can be done in UDJ.
36
class ActivityList : public QTreeView{
39
/** @name Constructors */
43
* \brief Constructs an ActivityList
45
* @param dataStore The DataStore backing this instance of UDJ.
46
* @param parent The parent widget.
48
ActivityList(DataStore *dataStore, QWidget *parent=0);
52
/** @name Public Slots */
58
* \brief Switches the selected activity to Library.
60
void switchToLibrary();
69
* \brief Emitted when the library activity is clicked.
71
void libraryClicked();
74
* \brief emited when the playlist activity is clicked.
76
void playlistClicked();
81
/** @name Private Functions */
85
* \brief Does UI initialization.
90
* \brief Gets the name of the library activity.
92
* @return The name of the library activity.
94
static const QString& getLibraryTitle(){
95
static const QString libraryTitle(tr("Library"));
100
* \brief Gets the name of the Playlist activity.
102
* @return The name of the Playlist activity.
104
static const QString& getPlaylistTitle(){
105
static const QString playlistTitle(tr("Playlist"));
106
return playlistTitle;
112
/** @name Private Memeber */
115
/** \brief Pointer to the DataStore backing this instance of UDJ */
116
DataStore *dataStore;
118
/** \brief Model used to list the activities. */
119
QStandardItemModel *model;
121
/** \brief The item representing the library activity. */
122
QStandardItem *libraryItem;
124
/** \brief The item representing the playlist activity. */
125
QStandardItem *playlistItem;
131
/** @name Private Slots */
135
* \brief Emits the appropriate signals when an activity is clicked.
137
* @param index The index of the activity that was clicked.
139
void itemClicked(const QModelIndex& index);
146
#endif //ACTIVITY_LIST_HPP