1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
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. *
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. *
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_
24 * @file KwSongdbVersionItem.h
25 * @brief A list widget item for a song version.
26 * @author James Hogan <james@albanarts.com>
30 #include <QListWidgetItem>
35 class KwSongdbVersion
;
36 class KwSongdbSongBookSongItem
;
38 /// A list widget item for a song version.
39 class KwSongdbVersionItem
: public QObject
, public QListWidgetItem
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);
56 virtual ~KwSongdbVersionItem();
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();
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();
110 /// Original database version object.
111 KwSongdbVersion
* m_version
;
123 QString m_lyricsMarkup
;
125 /// Song book numbers.
126 QList
<KwSongdbSongBookSongItem
*> m_songBookNumbers
;
130 #endif // _KwSongdbVersionItem_h_