Improve sword bible integration to get first preverse and multiple verses
[kworship.git] / kworship / songdb / KwSongdbSongBook.h
blob436a263420abc2cfdd242a95c455815c9a0debf3
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 _KwSongdbSongBook_h_
21 #define _KwSongdbSongBook_h_
23 /**
24 * @file KwSongdbSongBook.h
25 * @brief A song book of songs from the database.
26 * @author James Hogan <james@albanarts.com>
29 #include <QString>
30 #include <QFlags>
32 /// A song book of songs from the database.
33 class KwSongdbSongBook
35 public:
38 * Types
41 /// Version data fields.
42 enum Field
44 Abreviation = 0x1,
45 Name = 0x2,
46 Description = 0x4
48 Q_DECLARE_FLAGS(Fields, Field)
51 * Constructors + destructor
54 /** Construct a new song book for database insertion.
55 * This constructs a blank song book which will be inserted into the
56 * database when it is saved.
58 KwSongdbSongBook();
60 /** Construct from the database.
61 * Loads the song book information from the database.
62 * @param id Database id of song book.
64 KwSongdbSongBook(int id);
66 /// Destructor.
67 virtual ~KwSongdbSongBook();
70 * Accessors
73 /// Get the id.
74 int id() const;
76 /// Get the abreviation of the song book.
77 QString abreviation() const;
79 /// Get the name of the song book.
80 QString name() const;
82 /// Get the description of the song book.
83 QString description() const;
86 * Mutators
89 /// Set the abreviation.
90 void setAbreviation(const QString& abreviation);
92 /// Set the name.
93 void setName(const QString& name);
95 /// Set the description.
96 void setDescription(const QString& description);
98 /// Save changes to the song book data.
99 void save();
101 private:
104 * Variables
107 /// Song book id.
108 int m_id;
110 /// Which fields have been modified.
111 Fields m_modifiedFields;
113 /// Short abreviation text.
114 QString m_abreviation;
116 /// Name.
117 QString m_name;
119 /// Description.
120 QString m_description;
123 Q_DECLARE_OPERATORS_FOR_FLAGS(KwSongdbSongBook::Fields)
125 #endif // _KwSongdbSongBook_h_