Fix compile and link problem with song database being turned into a plugin but still...
[kworship.git] / kworship / KwDocument.h
blobc2b99ae6b6538cb40edb8e7fa95db5565a0900e3
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 _KwDocument_h_
21 #define _KwDocument_h_
23 /**
24 * @file KwDocument.h
25 * @brief A KWorship document (anything saved in a KWorship data file).
26 * @author James Hogan <james@albanarts.com>
29 #include <KUrl>
30 #include <kdemacros.h>
32 #include <QObject>
34 class KwPlaylistList;
35 class KwLoadSaveFilter;
37 /// A KWorship document (anything saved in a KWorship data file).
38 class KDE_EXPORT KwDocument : public QObject
40 Q_OBJECT
42 public:
45 * Constructors + destructor
48 /// Primary constructor.
49 KwDocument(KwLoadSaveFilter* filter = 0, const QString& mimeType = QString(), KUrl url = KUrl(), QObject* parent = 0);
51 /// Destructor.
52 virtual ~KwDocument();
55 * Accessors
58 /// Find whether the document has been modified.
59 bool isModified() const;
61 /// Find whether the document has ever been saved.
62 bool isSaved() const;
64 /// Get the URL the document is saved at.
65 KUrl url() const;
67 /// Get the main playlist.
68 KwPlaylistList* playlist();
70 /// Get the current mime type.
71 const QString& mimeType() const;
74 * Mutators
77 /// Set the main playlist.
78 void setPlaylist(KwPlaylistList* playlist);
80 public slots:
83 * Saving and loading actions
86 /// Save the file.
87 void save();
89 /// Save the file to a different URL.
90 void saveAs(KwLoadSaveFilter* filter, const QString& mimeType, const KUrl& url);
93 * Other slots
96 /// Set whether the file is modified.
97 void setModified(bool modified);
99 signals:
102 * Signals
105 /// Emitted when the playlist is reset.
106 void playlistReset();
108 /// Emitted when the document modified status changes.
109 void modifiedChanged(bool modified);
111 private:
114 * Variables
117 /// The URL of the saved file.
118 KUrl m_url;
120 /// Active mime type.
121 QString m_mimeType;
123 /// Active save filter.
124 KwLoadSaveFilter* m_activeFilter;
126 /// Whether the document has been modified.
127 bool m_modified;
129 /// The main playlist item.
130 KwPlaylistList* m_playlist;
134 #endif // _KwDocument_h_