Make a branch to make krunner Good Enough For Aaron™.
[kdebase/uwolfer.git] / workspace / libs / plasma / appletbrowser.h
blobf96e17be62841b39b00bbc1b3b8cb2d5e83b267e
1 /*
2 * Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library/Lesser General Public License
6 * version 2, or (at your option) any later version, as published by the
7 * Free Software Foundation
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library/Lesser General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef APPLETBROWSERWINDOW_H_
21 #define APPLETBROWSERWINDOW_H_
23 #include <KDE/KDialog>
25 #include <plasma/plasma_export.h>
27 namespace Plasma
30 class Corona;
31 class Containment;
32 class Applet;
34 class PLASMA_EXPORT AppletBrowserWidget : public QWidget
36 Q_OBJECT
37 public:
38 AppletBrowserWidget(Plasma::Containment *containment, QWidget *parent = 0, Qt::WindowFlags f = 0);
39 virtual ~AppletBrowserWidget();
41 void setApplication(const QString& application = QString());
42 QString application();
44 /**
45 * Changes the current default containment to add applets to
47 * @arg containment the new default
49 void setContainment(Plasma::Containment *containment);
51 /**
52 * @return the current default containment to add applets to
54 Containment* containment() const;
56 protected Q_SLOTS:
57 /**
58 * Adds currently selected applets
60 void addApplet();
62 /**
63 * Tracks a new running applet
65 void appletAdded(Plasma::Applet* applet);
67 /**
68 * A running applet is no more
70 void appletDestroyed(QObject* applet);
72 /**
73 * Destroy all applets with this name
75 void destroyApplets(const QString &name);
77 /**
78 * Launches a download dialog to retrieve new applets from the Internet
80 void downloadWidgets();
82 /**
83 * Opens a file dialog to open a widget from a local file
85 void openWidgetFile();
87 private:
88 void init();
89 void initRunningApplets();
90 class Private;
91 Private * const d;
94 class PLASMA_EXPORT AppletBrowser: public KDialog
96 Q_OBJECT
97 public:
98 explicit AppletBrowser(Plasma::Containment *containment, QWidget *parent = 0, Qt::WindowFlags f = 0);
99 virtual ~AppletBrowser();
101 void setApplication(const QString& application = QString());
102 QString application();
105 * Changes the current default containment to add applets to
107 * @arg containment the new default
109 void setContainment(Plasma::Containment *containment);
112 * @return the current default containment to add applets to
114 Containment* containment() const;
116 private:
117 class Private;
118 Private * const d;
121 } // namespace Plasma
123 #endif /*APPLETBROWSERWINDOW_H_*/