Basic reading and writing of quick notes to and from zionworx playlists
[kworship.git] / kworship / playlist / KwPlaylistPaged.h
blob000729535f93399138bde0ebef561a4b7aef90aa
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 _KwPlaylistPaged_h_
21 #define _KwPlaylistPaged_h_
23 /**
24 * @file KwPlaylistPaged.h
25 * @brief A paged plain text playlist item.
26 * @author James Hogan <james@albanarts.com>
29 #include "KwPlaylistItem.h"
31 #include <kdemacros.h>
33 #include <QStringList>
34 #include <QVector>
36 /// A paged plain text playlist item.
37 class KDE_EXPORT KwPlaylistPaged : public KwPlaylistItem
39 public:
42 * Constructors + destructor.
45 /// Default constructor.
46 KwPlaylistPaged();
48 /// Destructor.
49 virtual ~KwPlaylistPaged();
52 * Main interface
55 /// Get the number of text blocks.
56 unsigned int getBlockCount() const;
58 /// Get the number of pages.
59 unsigned int getPageCount() const;
61 /// Get a block's first page number.
62 unsigned int getBlockPageIndex(unsigned int blockIndex) const;
64 /// Get the number of pages in a block.
65 unsigned int getBlockPageCount(unsigned int blockIndex) const;
67 /// Get a page's block index.
68 unsigned int getPageBlockIndex(unsigned int pageIndex) const;
70 /// Get the content of a page.
71 QString getPageText(unsigned int pageIndex) const;
73 /// Get the list of blocks.
74 QStringList blocks() const;
76 virtual KwPlaylistNode* getNode(KwPlaylistNode* parent);
78 protected:
81 * Derived class block control interface
84 /// Set the text blocks.
85 void setTextBlocks(const QStringList& blocks);
87 private:
90 * Variables
93 /// Contents of the pages.
94 QStringList m_pageContents;
96 /// Starting page index of each block.
97 QVector<unsigned int> m_blockStarts;
100 #endif // _KwPlaylistPaged_h_