Database: sqlite default to appdata kworship.db
[kworship.git] / kworship / songdb / KwSongdbVersionItem.h
blobd0bf9a11a98117ed9805095528027d2be5ecf628
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _KwSongdbVersionItem_h_
21 #define _KwSongdbVersionItem_h_
23 /**
24 * @file KwSongdbVersionItem.h
25 * @brief A list widget item for a song version.
26 * @author James Hogan <james@albanarts.com>
29 #include <QObject>
30 #include <QListWidgetItem>
31 #include <QString>
32 #include <QList>
34 class KwSongdbSong;
35 class KwSongdbVersion;
36 class KwSongdbSongBookSongItem;
38 /// A list widget item for a song version.
39 class KwSongdbVersionItem : public QObject, public QListWidgetItem
41 Q_OBJECT
43 public:
46 * Constructors + destructor
49 /// Construct a new song version.
50 KwSongdbVersionItem(QListWidget* parent = 0);
52 /// Construct from an existing song version.
53 KwSongdbVersionItem(KwSongdbVersion* version, QListWidget* parent = 0);
55 /// Destructor.
56 virtual ~KwSongdbVersionItem();
59 * Accessors
62 /// Get the song version.
63 KwSongdbVersion* version();
65 /// Get the version name.
66 QString versionName() const;
68 /// Get the name of the writer.
69 QString writer() const;
71 /// Get the copyright notice.
72 QString copyright() const;
74 /// Get the lyrics markup.
75 QString lyricsMarkup() const;
77 /// Get the list of song book number items.
78 QList<KwSongdbSongBookSongItem*> songBookNumbers();
80 public slots:
83 * Modifier slots
86 /// Save the changes to the version object.
87 void save(KwSongdbSong* song);
89 /// Set the version name.
90 void setVersionName(const QString& name);
92 /// Set the name of the writer.
93 void setWriter(const QString& writer);
95 /// Set the copyright notice.
96 void setCopyright(const QString& copyright);
98 /// Set the lyrics markup.
99 void setLyricsMarkup(const QString& lyricsMarkup);
101 /// Add a song book number.
102 KwSongdbSongBookSongItem* addSongBookNumber();
104 private:
107 * Variables
110 /// Original database version object.
111 KwSongdbVersion* m_version;
113 /// Version name.
114 QString m_name;
116 /// Writer.
117 QString m_writer;
119 /// Copyright.
120 QString m_copyright;
122 /// Lyrics markup.
123 QString m_lyricsMarkup;
125 /// Song book numbers.
126 QList<KwSongdbSongBookSongItem*> m_songBookNumbers;
130 #endif // _KwSongdbVersionItem_h_