Added playlist actions (insert, delete, move up, move down), with only insert working...
[kworship.git] / kworship / archive / KwDataFile.h
blobaaa8bdf326c48512b559684ebd6db0ee40db0ebc
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 _KwDataFile_h_
21 #define _KwDataFile_h_
23 /**
24 * @file KwDataFile.h
25 * @brief A KWorship XML data file.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwResourceManager.h"
31 #include <QList>
33 class KwPlaylistItem;
34 class KwPlaylistList;
36 class QIODevice;
37 class QTextStream;
38 class QDomDocument;
39 class QDomElement;
41 /// A KWorship XML data file.
42 class KwDataFile : public KwResourceManager
44 public:
47 * Constructors + destructor
50 /// Default constructor.
51 KwDataFile();
53 /// Destructor.
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;
73 * Playlists
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
92 // Reimplemented
93 virtual void addResource(const KwResourceLink* link);
96 * Reading and writing
99 /// Read from device.
100 void readFrom(QIODevice* device);
102 /// Write to stream.
103 void writeTo(QTextStream& stream) const;
105 private:
108 * Variables
111 /// DOM document.
112 QDomDocument* m_domDocument;
116 #endif // _KwDataFile_h_