1
2/*
3 * kcmcontainer.h
4 *
5 * Copyright (C) 2010 David Hubner <hubnerd@ntlworld.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *
21 */
22
23#ifndef KCMCONTAINER
24#define KCMCONTAINER
25
26//KDE
27#include <KCModuleInfo>
28#include <KAboutData>
29#include <KCModule>
30#include <KCModuleProxy>
31
32//QT
33#include <QLabel>
34#include <QWidget>
35#include <QString>
36#include <QScrollArea>
37
38class KcmContainer : public QScrollArea
39{
40 public:
41
42 /**
43 * Widget to display and receive information
44 * about displayed KCM.
45 *
46 * @param parent objects parent
47 */
48 KcmContainer(QWidget *parent);
49
50 /**
51 * Destory KCMContainer
52 */
53 ~KcmContainer();
54
55 /**
56 * Set and show KCM in KCMContainer window
57 */
58 void setKcm(const KCModuleInfo &);
59
60 /**
61 * Move KCMContainer top edge to a certain position
62 *
63 * @param y y coordinates of top edge
64 */
65 void setKcmTopEdge(int y);
66
67 /**
68 * Get currently selected KCMs document path
69 * for .desktop
70 * X-KDE-DocPath
71 */
72 QString helpPath() const;
73
74 /**
75 * Get currently selected KCMs
76 * information on which buttons need to be shown
77 */
78 KCModule::Buttons buttons() const;
79
80 /**
81 * Get about data for currently selected KCM
82 */
83 const KAboutData *kcmAboutData() const;
84
85 /**
86 * Get currently selected KCMs export information
87 */
88 QString exportText() const;
89
90 /**
91 * Get currently selected KCMs name
92 */
93 QString name() const;
94
95 /**
96 * Get currently selected KCMs .desktop file name
97 */
98 QString fileName() const;
99
100 private:
101
102 /**
103 * Init and set KCMContainer Layout
104 */
105 void setContainerLayout();
106
107 /**
108 * Set top title in KCMContainer
109 */
110 void setKcmTitle(const KCModuleInfo &);
111
112 QLabel *m_titleLabel;
113 QWidget *m_centerWidget;
114 KCModuleProxy *m_mod;
115 KCModuleInfo m_modInfo;
116 int m_kcmTopEdge;
117};
118
119#endif //KCMCONTAINER
120