~ubuntu-branches/ubuntu/gutsy/kde4libs/gutsy

« back to all changes in this revision

Viewing changes to kdeui/kpagemodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-02-21 11:00:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070221110012-6kw8khr9knv6lmg1
Tags: 3.80.3-0ubuntu1
New upstream unstable release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    This file is part of the KDE Libraries
3
 
 
4
 
    Copyright (C) 2006 Tobias Koenig (tokoe@kde.org)
5
 
 
6
 
    This library is free software; you can redistribute it and/or
7
 
    modify it under the terms of the GNU Library General Public
8
 
    License as published by the Free Software Foundation; either
9
 
    version 2 of the License, or (at your option) any later version.
10
 
 
11
 
    This library is distributed in the hope that it will be useful,
12
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
 
    Library General Public License for more details.
15
 
 
16
 
    You should have received a copy of the GNU Library General Public License
17
 
    along with this library; see the file COPYING.LIB. If not, write to
18
 
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
 
    Boston, MA 02110-1301, USA.
20
 
*/
21
 
 
22
 
#ifndef KPAGEMODEL_H
23
 
#define KPAGEMODEL_H
24
 
 
25
 
#include <QtCore/QAbstractItemModel>
26
 
 
27
 
#include <kdelibs_export.h>
28
 
 
29
 
/**
30
 
 *  @short A base class for a model used by KPageView.
31
 
 *
32
 
 *  This class is an abstract base class which must be used to
33
 
 *  implement custom models for KPageView. Additional to the the standard
34
 
 *  Qt::ItemDataRoles it provides the two roles
35
 
 *
36
 
 *    @li HeaderRole
37
 
 *    @li WidgetRole
38
 
 *
39
 
 *  which are used to return a header string for a page and a QWidget
40
 
 *  pointer to the page itself.
41
 
 *
42
 
 *  <b>Example:</b>\n
43
 
 *
44
 
 *  \code
45
 
 *    KPageView *view = new KPageView( this );
46
 
 *    KPageModel *model = new MyPageModel( this );
47
 
 *
48
 
 *    view->setModel( model );
49
 
 *  \endcode
50
 
 *
51
 
 *  @see KPageView
52
 
 *  @author Tobias Koenig <tokoe@kde.org>
53
 
 */
54
 
class KDEUI_EXPORT KPageModel : public QAbstractItemModel
55
 
{
56
 
  Q_OBJECT
57
 
 
58
 
  public:
59
 
    /**
60
 
     * Additional KPageModel specific roles.
61
 
     *
62
 
     * @li HeaderRole - The data to be rendered as page header (usually text).
63
 
     * @li WidgetRole - The data which contains a pointer to the page widget.
64
 
     */
65
 
    enum Role
66
 
    {
67
 
      HeaderRole = Qt::UserRole + 1,
68
 
      WidgetRole
69
 
    };
70
 
 
71
 
    /**
72
 
     * Constructs a page model with the given parent.
73
 
     */
74
 
    explicit KPageModel( QObject *parent = 0 );
75
 
 
76
 
    /**
77
 
     * Destroys the page model.
78
 
     */
79
 
    virtual ~KPageModel();
80
 
 
81
 
  private:
82
 
    class Private;
83
 
    Private* const d;
84
 
};
85
 
 
86
 
#endif