Now saves using KwKWorshipFilter instead of KwDocument
[kworship.git] / kworship / KwDocument.h
blob33eca0172f0c8e699052e67a0269464957ae5e46
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>
31 #include <QObject>
33 class KwPlaylistList;
34 class KwLoadSaveFilter;
36 /// A KWorship document (anything saved in a KWorship data file).
37 class KwDocument : public QObject
39 Q_OBJECT
41 public:
44 * Constructors + destructor
47 /// Primary constructor.
48 KwDocument(KwLoadSaveFilter* filter = 0, const QString& mimeType = QString(), KUrl url = KUrl(), QObject* parent = 0);
50 /// Destructor.
51 virtual ~KwDocument();
54 * Accessors
57 /// Find whether the document has been modified.
58 bool isModified() const;
60 /// Find whether the document has ever been saved.
61 bool isSaved() const;
63 /// Get the URL the document is saved at.
64 KUrl url() const;
66 /// Get the main playlist.
67 KwPlaylistList* playlist();
69 /// Get the current mime type.
70 const QString& mimeType() const;
73 * Mutators
76 /// Set the main playlist.
77 void setPlaylist(KwPlaylistList* playlist);
79 public slots:
82 * Saving and loading actions
85 /// Save the file.
86 void save();
88 /// Save the file to a different URL.
89 void saveAs(KwLoadSaveFilter* filter, const QString& mimeType, const KUrl& url);
92 * Other slots
95 /// Set whether the file is modified.
96 void setModified(bool modified);
98 signals:
101 * Signals
104 /// Emitted when the playlist is reset.
105 void playlistReset();
107 /// Emitted when the document modified status changes.
108 void modifiedChanged(bool modified);
110 private:
113 * Variables
116 /// The URL of the saved file.
117 KUrl m_url;
119 /// Active mime type.
120 QString m_mimeType;
122 /// Active save filter.
123 KwLoadSaveFilter* m_activeFilter;
125 /// Whether the document has been modified.
126 bool m_modified;
128 /// The main playlist item.
129 KwPlaylistList* m_playlist;
133 #endif // _KwDocument_h_