1/*
2 This file is part of libkresources.
3
4 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
5 Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
6 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22*/
23/**
24 @file
25 This file is part of the KDE resource framework and defines the
26 ConfigPage class.
27
28 @author Tobias Koenig
29 @author Jan-Pascal van Best
30 @author Cornelius Schumacher
31*/
32
33#ifndef KRESOURCES_CONFIGPAGE_H
34#define KRESOURCES_CONFIGPAGE_H
35
36#include <QtCore/QStringList>
37#include <QWidget>
38#include <QtCore/QList>
39
40#include <ksharedptr.h>
41
42#include "manager.h"
43
44class QTreeWidget;
45class QTreeWidgetItem;
46
47namespace KRES {
48
49class KRESOURCES_EXPORT ResourcePageInfo : public KShared
50{
51 public:
52 ResourcePageInfo();
53 ~ResourcePageInfo();
54 Manager<Resource> *mManager;
55 KConfig *mConfig;
56
57 private:
58 class Private;
59 Private *const d;
60};
61
62class Resource;
63class ConfigViewItem;
64
65/**
66 @brief
67 A resource configuration page.
68
69 This class provides a page for a resource configuration dialog.
70*/
71class KRESOURCES_EXPORT ConfigPage : public QWidget, public ManagerObserver<Resource>
72{
73 Q_OBJECT
74
75 public:
76 ConfigPage( QWidget *parent = 0 );
77 virtual ~ConfigPage();
78
79 void load();
80 void save();
81 virtual void defaults();
82
83 public Q_SLOTS:
84 void slotFamilyChanged( int pos );
85 void slotAdd();
86 void slotRemove();
87 void slotEdit();
88 void slotStandard();
89 void slotSelectionChanged();
90
91 public:
92 // From ManagerObserver<Resource>
93 virtual void resourceAdded( Resource *resource );
94 virtual void resourceModified( Resource *resource );
95 virtual void resourceDeleted( Resource *resource );
96
97 protected:
98 ConfigViewItem *findItem( Resource *resource );
99
100 protected Q_SLOTS:
101 void slotItemClicked( QTreeWidgetItem *item );
102
103 Q_SIGNALS:
104 void changed( bool );
105
106 private:
107 class Private;
108 Private *const d;
109};
110
111}
112
113#endif
114