Basic openoffice.org control, and listening for new presentation documents, still...
[kworship.git] / kworship / KwDocument.h
blob34a9b44831f04e4ada8add98cea4afe95bdacae8
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 "KwExport.h"
31 #include <KUrl>
33 #include <QObject>
35 class KwPlaylistList;
36 class KwLoadSaveFilter;
38 /// A KWorship document (anything saved in a KWorship data file).
39 class KWMAIN_EXPORT KwDocument : public QObject
41 Q_OBJECT
43 public:
46 * Constructors + destructor
49 /// Primary constructor.
50 KwDocument(KwLoadSaveFilter* filter = 0, const QString& mimeType = QString(), KUrl url = KUrl(), QObject* parent = 0);
52 /// Destructor.
53 virtual ~KwDocument();
56 * Accessors
59 /// Find whether the document has been modified.
60 bool isModified() const;
62 /// Find whether the document has ever been saved.
63 bool isSaved() const;
65 /// Get the URL the document is saved at.
66 KUrl url() const;
68 /// Get the main playlist.
69 KwPlaylistList* playlist();
71 /// Get the current mime type.
72 const QString& mimeType() const;
75 * Mutators
78 /// Set the main playlist.
79 void setPlaylist(KwPlaylistList* playlist);
81 public slots:
84 * Saving and loading actions
87 /// Save the file.
88 void save();
90 /// Save the file to a different URL.
91 void saveAs(KwLoadSaveFilter* filter, const QString& mimeType, const KUrl& url);
94 * Other slots
97 /// Set whether the file is modified.
98 void setModified(bool modified);
100 signals:
103 * Signals
106 /// Emitted when the playlist is reset.
107 void playlistReset();
109 /// Emitted when the document modified status changes.
110 void modifiedChanged(bool modified);
112 private:
115 * Variables
118 /// The URL of the saved file.
119 KUrl m_url;
121 /// Active mime type.
122 QString m_mimeType;
124 /// Active save filter.
125 KwLoadSaveFilter* m_activeFilter;
127 /// Whether the document has been modified.
128 bool m_modified;
130 /// The main playlist item.
131 KwPlaylistList* m_playlist;
135 #endif // _KwDocument_h_