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 _KwDocument_h_
21 #define _KwDocument_h_
25 * @brief A KWorship document (anything saved in a KWorship data file).
26 * @author James Hogan <james@albanarts.com>
36 /// A KWorship document (anything saved in a KWorship data file).
37 class KwDocument
: public QObject
44 * Constructors + destructor
47 /// Primary constructor.
48 KwDocument(KUrl url
, QObject
* parent
= 0);
51 virtual ~KwDocument();
57 /// Find whether the document has been modified.
58 bool isModified() const;
60 /// Find whether the document has ever been saved.
63 /// Get the URL the document is saved at.
66 /// Get the main playlist.
67 KwPlaylistList
* playlist();
72 * Saving and loading actions
81 /// Save the file to a different URL.
82 void saveAs(const KUrl
& url
);
88 /// Set whether the file is modified.
89 void setModified(bool modified
);
97 /// Emitted when the playlist is reset.
100 /// Emitted when the document modified status changes.
101 void modifiedChanged(bool modified
);
109 /// Load from an archive.
110 void loadFromArchive(KwArchive
* archive
);
112 /// Save to an archive.
113 void saveToArchive(KwArchive
* archive
) const;
121 /// The URL of the saved file.
124 /// Whether the document has been modified.
127 /// The main playlist item.
128 KwPlaylistList
* m_playlist
;
132 #endif // _KwDocument_h_