libplasma
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 APPLETBROWSERWINDOW_H_ 00021 #define APPLETBROWSERWINDOW_H_ 00022 00023 #include <KDE/KDialog> 00024 00025 #include <plasma/plasma_export.h> 00026 00027 namespace Plasma 00028 { 00029 00030 class Corona; 00031 class Containment; 00032 class Applet; 00033 00034 class PLASMA_EXPORT AppletBrowserWidget : public QWidget 00035 { 00036 Q_OBJECT 00037 public: 00038 AppletBrowserWidget(Plasma::Containment *containment, bool showButtons, 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 protected Q_SLOTS: 00060 void addApplet(); 00061 00065 void appletAdded(Plasma::Applet* applet); 00066 00070 void appletDestroyed(QObject* applet); 00071 00075 void destroyApplets(const QString name); 00076 00080 void downloadApplets(); 00081 00082 private: 00083 void init(); 00084 void initRunningApplets(); 00085 class Private; 00086 Private * const d; 00087 bool m_showButtons; 00088 }; 00089 00090 class PLASMA_EXPORT AppletBrowser: public KDialog 00091 { 00092 Q_OBJECT 00093 public: 00094 explicit AppletBrowser(Plasma::Containment *containment, QWidget *parent = 0, Qt::WindowFlags f = 0); 00095 virtual ~AppletBrowser(); 00096 00097 void setApplication(const QString& application = QString()); 00098 QString application(); 00099 00105 void setContainment(Plasma::Containment *containment); 00106 00110 Containment* containment() const; 00111 00112 private: 00113 void init(); 00114 AppletBrowserWidget *m_widget; 00115 }; 00116 00117 } // namespace Plasma 00118 00119 #endif /*APPLETBROWSERWINDOW_H_*/
KDE 4.0 API Reference