Added playlist actions (insert, delete, move up, move down), with only insert working...
[kworship.git] / kworship / songdb / KwSongdbSongBookSong.h
blobbc7952c11dba676095f6cc661b3255a95f06af07
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 _KwSongdbSongBookSong_h_
21 #define _KwSongdbSongBookSong_h_
23 /**
24 * @file KwSongdbSongBookSong.h
25 * @brief A song book song from the database.
26 * @author James Hogan <james@albanarts.com>
29 #include <QString>
30 #include <QFlags>
32 class KwSongdbSongBook;
33 class KwSongdbVersion;
35 /// A song book song from the database.
36 class KwSongdbSongBookSong
38 public:
41 * Types
44 /// Version data fields.
45 enum Field
47 SongBook = 0x1,
48 SongNumber = 0x2,
49 Version = 0x4
51 Q_DECLARE_FLAGS(Fields, Field)
54 * Constructors + destructor
57 /** Construct a new song book song for database insertion.
58 * This constructs a blank song book song which will be inserted into the
59 * database when it is saved.
61 KwSongdbSongBookSong();
63 /** Construct from the database from data.
64 * @param songBook Song book object.
65 * @param songNumber Number in the song book that the song is.
66 * @param version Version at the song position.
68 KwSongdbSongBookSong(KwSongdbSongBook* songBook, int songNumber, KwSongdbVersion* version);
70 /// Destructor.
71 virtual ~KwSongdbSongBookSong();
74 * Accessors
77 /// Get the song book.
78 KwSongdbSongBook* songBook();
80 /// Get the song number in the song book.
81 int songNumber() const;
83 /// Get the song version.
84 KwSongdbVersion* version();
87 * Mutators
90 /// Set the song book.
91 void setSongBook(KwSongdbSongBook* songBook);
93 /// Set the song number in the song book.
94 void setSongNumber(int songNumber);
96 /// Set the song version.
97 void setVersion(KwSongdbVersion* version);
99 /// Save changes to the song book data.
100 void save();
102 private:
105 * Variables
108 /// Original song book id.
109 int m_originalSongBookId;
111 /// Original song book number.
112 int m_originalSongNumber;
114 /// Which fields have been modified.
115 Fields m_modifiedFields;
117 /// Song book.
118 KwSongdbSongBook* m_songBook;
120 /// Song book number.
121 int m_songNumber;
123 /// Version.
124 KwSongdbVersion* m_version;
127 Q_DECLARE_OPERATORS_FOR_FLAGS(KwSongdbSongBookSong::Fields)
129 #endif // _KwSongdbSongBookSong_h_