Plasma
appletbrowser.h
Go to the documentation of this file.00001 /* 00002 * Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library/Lesser General Public License 00006 * version 2, or (at your option) any later version, as published by the 00007 * Free Software Foundation 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library/Lesser General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLASMA_APPLETBROWSER_H 00021 #define PLASMA_APPLETBROWSER_H 00022 00023 #include <KDE/KDialog> 00024 00025 namespace Plasma 00026 { 00027 00028 class Corona; 00029 class Containment; 00030 class Applet; 00031 class AppletBrowserPrivate; 00032 class AppletBrowserWidgetPrivate; 00033 00034 class AppletBrowserWidget : public QWidget 00035 { 00036 Q_OBJECT 00037 public: 00038 explicit AppletBrowserWidget(QWidget *parent = 0, Qt::WindowFlags f = 0); 00039 virtual ~AppletBrowserWidget(); 00040 00041 void setApplication(const QString &application = QString()); 00042 QString application(); 00043 00049 void setContainment(Plasma::Containment *containment); 00050 00054 Containment *containment() const; 00055 00056 public Q_SLOTS: 00060 void addApplet(); 00061 00065 void destroyApplets(const QString &name); 00066 00074 void downloadWidgets(const QString &type = QString()); 00075 00079 void openWidgetFile(); 00080 00084 void infoAboutApplet(const QString &name); 00085 00086 private: 00087 Q_PRIVATE_SLOT(d, void appletAdded(Plasma::Applet*)) 00088 Q_PRIVATE_SLOT(d, void appletRemoved(Plasma::Applet*)) 00089 Q_PRIVATE_SLOT(d, void containmentDestroyed()) 00090 00091 AppletBrowserWidgetPrivate * const d; 00092 }; 00093 00094 class AppletBrowser: public KDialog 00095 { 00096 Q_OBJECT 00097 public: 00098 explicit AppletBrowser(QWidget *parent = 0, Qt::WindowFlags f = 0); 00099 virtual ~AppletBrowser(); 00100 00101 void setApplication(const QString &application = QString()); 00102 QString application(); 00103 00109 void setContainment(Plasma::Containment *containment); 00110 00114 Containment *containment() const; 00115 00116 private: 00117 Q_PRIVATE_SLOT(d, void populateWidgetsMenu()) 00118 AppletBrowserPrivate * const d; 00119 }; 00120 00121 } // namespace Plasma 00122 00123 #endif /*APPLETBROWSERWINDOW_H_*/