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 _KwDataFile_h_
21 #define _KwDataFile_h_
25 * @brief A KWorship XML data file.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwResourceManager.h"
41 /// A KWorship XML data file.
42 class KwDataFile
: public KwResourceManager
47 * Constructors + destructor
50 /// Default constructor.
54 virtual ~KwDataFile();
57 * Individual playlist items
60 /** Insert a set of playlist items.
61 * @param items List of playlist items to insert.
62 * @param resources Resource manager.
64 void insertPlaylistItems(const QList
<KwPlaylistItem
*>& items
, KwResourceManager
* resourceManager
);
66 /** Create a set of playlist items from the data.
67 * @param resources Resource manager.
68 * @returns Newly created playlist items which the user must delete.
70 QList
<KwPlaylistItem
*> extractPlaylistItems(KwResourceManager
* resourceManager
) const;
76 /** Insert a playlist.
77 * @param playlist Playlist to insert.
78 * @param resources Resource manager.
80 void insertPlaylist(const KwPlaylistList
* playlist
, KwResourceManager
* resourceManager
);
82 /** Create a playlist object from the data.
83 * @param resources Resource manager.
84 * @returns Newly created playlist which the user must delete.
86 KwPlaylistList
* extractPlaylist(KwResourceManager
* resourceManager
) const;
89 * Main resource interface
93 virtual void addResource(const KwResourceLink
* link
);
100 void readFrom(QIODevice
* device
);
103 void writeTo(QTextStream
& stream
) const;
112 QDomDocument
* m_domDocument
;
116 #endif // _KwDataFile_h_