2
* Copyright (C) 2007 by Ivan Cukic <ivan.cukic+kde@gmail.com>
3
* Copyright (C) 2009 by Ana Cecília Martins <anaceciliamb@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU Library/Lesser General Public License
7
* version 2, or (at your option) any later version, as published by the
8
* Free Software Foundation
10
* This program 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
15
* You should have received a copy of the GNU Library/Lesser General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
#ifndef WIDGETEXPLORER_H
23
#define WIDGETEXPLORER_H
27
#include <KDE/KDialog>
29
#include <plasma/framesvg.h>
31
#include "plasmaappletitemmodel_p.h"
33
#include "plasmagenericshell_export.h"
41
class WidgetExplorerPrivate;
42
class WidgetExplorerPrivate;
44
class PLASMAGENERICSHELL_EXPORT WidgetExplorer : public QGraphicsWidget
50
explicit WidgetExplorer(Plasma::Location loc, QGraphicsItem *parent = 0);
51
explicit WidgetExplorer(QGraphicsItem *parent = 0);
54
QString application();
57
* Populates the widget list for the given application. This must be called
58
* before the widget explorer will be usable as the widget list will remain
59
* empty up to that point.
61
* @arg application the application which the widgets should be loaded for.
63
void populateWidgetList(const QString &application = QString());
66
* Changes the current default containment to add applets to
68
* @arg containment the new default
70
void setContainment(Plasma::Containment *containment);
73
* @return the current default containment to add applets to
75
Containment *containment() const;
77
* @return the current corona this widget is added to
79
Plasma::Corona *corona() const;
82
* Set the location of the widget explorer
84
* @arg the new location
86
void setLocation(const Plasma::Location loc);
89
* @return the location of the widget explorer
91
Plasma::Location location() const;
94
* Sets the icon size for the widget explorer
96
void setIconSize(int size);
99
* @return the icon size of the wiget explorer
101
int iconSize() const;
104
void locationChanged(Plasma::Location loc);
109
* Adds currently selected applets
116
void addApplet(PlasmaAppletItem *appletItem);
119
void immutabilityChanged(Plasma::ImmutabilityType);
122
void keyPressEvent(QKeyEvent *e);
123
bool event(QEvent *e);
124
void focusInEvent(QFocusEvent * event);
127
Q_PRIVATE_SLOT(d, void appletAdded(Plasma::Applet*))
128
Q_PRIVATE_SLOT(d, void appletRemoved(Plasma::Applet*))
129
Q_PRIVATE_SLOT(d, void containmentDestroyed())
131
WidgetExplorerPrivate * const d;
134
} // namespace Plasma
136
#endif // WIDGETEXPLORER_H