~ubuntu-branches/debian/experimental/udj-desktop-client/experimental

« back to all changes in this revision

Viewing changes to src/ActivityList.hpp

  • Committer: Package Import Robot
  • Author(s): Nathan Handler
  • Date: 2012-06-14 10:21:47 UTC
  • Revision ID: package-import@ubuntu.com-20120614102147-0hd10fim35ov37qk
Tags: upstream-0.5.0
ImportĀ upstreamĀ versionĀ 0.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * Copyright 2011 Kurtis L. Nusbaum
 
3
 * 
 
4
 * This file is part of UDJ.
 
5
 * 
 
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.
 
10
 * 
 
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.
 
15
 * 
 
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/>.
 
18
 */
 
19
#ifndef ACTIVITY_LIST_HPP
 
20
#define ACTIVITY_LIST_HPP
 
21
#include <QTreeView>
 
22
#include "ConfigDefs.hpp"
 
23
 
 
24
class QStandardItemModel;
 
25
class QStandardItem;
 
26
class QActivity;
 
27
namespace UDJ{
 
28
 
 
29
 
 
30
class DataStore;
 
31
 
 
32
 
 
33
/**
 
34
 * \brief Displays the various activities that can be done in UDJ.
 
35
 */
 
36
class ActivityList : public QTreeView{
 
37
Q_OBJECT
 
38
public:
 
39
  /** @name Constructors */
 
40
  //@{
 
41
 
 
42
  /**
 
43
   * \brief Constructs an ActivityList
 
44
   *
 
45
   * @param dataStore The DataStore backing this instance of UDJ.
 
46
   * @param parent The parent widget.
 
47
   */
 
48
  ActivityList(DataStore *dataStore, QWidget *parent=0);
 
49
 
 
50
  //@}
 
51
 
 
52
  /** @name Public Slots */
 
53
  //@{
 
54
 
 
55
public slots:
 
56
 
 
57
  /**
 
58
   * \brief Switches the selected activity to Library.
 
59
   */
 
60
  void switchToLibrary();
 
61
 
 
62
  //@}
 
63
 
 
64
signals:
 
65
  /** @name Signals */
 
66
  //@{
 
67
 
 
68
  /** 
 
69
   * \brief Emitted when the library activity is clicked.
 
70
   */
 
71
  void libraryClicked();
 
72
 
 
73
  /**
 
74
   * \brief emited when the playlist activity is clicked.
 
75
   */
 
76
  void playlistClicked();
 
77
  //@}
 
78
 
 
79
private:
 
80
 
 
81
  /** @name Private Functions */
 
82
  //@{
 
83
 
 
84
  /**
 
85
   * \brief Does UI initialization.
 
86
   */
 
87
  void setupUi();
 
88
 
 
89
  /**
 
90
   * \brief Gets the name of the library activity.
 
91
   *
 
92
   * @return The name of the library activity.
 
93
   */
 
94
  static const QString& getLibraryTitle(){
 
95
    static const QString libraryTitle(tr("Library"));
 
96
    return libraryTitle;
 
97
  }
 
98
 
 
99
  /** 
 
100
   * \brief Gets the name of the Playlist activity.
 
101
   *
 
102
   * @return The name of the Playlist activity.
 
103
   */
 
104
  static const QString& getPlaylistTitle(){
 
105
    static const QString playlistTitle(tr("Playlist"));
 
106
    return playlistTitle;
 
107
  }
 
108
 
 
109
 
 
110
  //@}
 
111
 
 
112
  /** @name Private Memeber */
 
113
  //@{
 
114
 
 
115
  /** \brief Pointer to the DataStore backing this instance of UDJ */
 
116
  DataStore *dataStore;
 
117
 
 
118
  /** \brief Model used to list the activities. */
 
119
  QStandardItemModel *model;
 
120
 
 
121
  /** \brief The item representing the library activity. */
 
122
  QStandardItem *libraryItem;
 
123
 
 
124
  /** \brief The item representing the playlist activity. */
 
125
  QStandardItem *playlistItem;
 
126
 
 
127
  //@}
 
128
 
 
129
private slots:
 
130
 
 
131
  /** @name Private Slots */
 
132
  //@{
 
133
 
 
134
  /**
 
135
   * \brief Emits the appropriate signals when an activity is clicked.
 
136
   *
 
137
   * @param index The index of the activity that was clicked.
 
138
   */
 
139
  void itemClicked(const QModelIndex& index);
 
140
 
 
141
  //@}
 
142
};
 
143
 
 
144
 
 
145
}//end namespace UDJ
 
146
#endif //ACTIVITY_LIST_HPP