diff --git a/appletbrowser.cpp b/appletbrowser.cpp new file mode 100644 index 000000000..56b87bb3c --- /dev/null +++ b/appletbrowser.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2007 Ivan Cukic + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 (or, + * at your option, any later version) as published by the Free Software + * Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include + +#include +#include + +namespace Plasma +{ + +class AppletBrowser::Private +{ +public: + Private(AppletBrowser * parent, Corona * corona) + : q(parent), window(new AppletBrowserWindow(corona)) + {}; + + Private(AppletBrowser * parent, Containment * containment) + : q(parent), window(new AppletBrowserWindow(containment)) + {}; + + ~Private() { + delete window; + } + + void show() { if (window) window->show(); }; + void hide() { if (window) window->hide(); }; + + AppletBrowserWindow * window; + AppletBrowser * q; +}; + +AppletBrowser::AppletBrowser(Corona * corona) + : d(new Private(this, corona)) +{} + +AppletBrowser::AppletBrowser(Containment * containment) + : d(new Private(this, containment)) +{} + +AppletBrowser::~AppletBrowser() { + delete d; +} + +void AppletBrowser::show() { + d->window->show(); +} + +void AppletBrowser::hide() { + d->window->hide(); +} + + +} // namespace Plasma diff --git a/appletbrowser.h b/appletbrowser.h new file mode 100644 index 000000000..2f8648836 --- /dev/null +++ b/appletbrowser.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2007 Ivan Cukic + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 (or, + * at your option, any later version) as published by the Free Software + * Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details + * + * You should have received a copy of the GNU Library General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef PLASMA_APPLET_BROWSER_H +#define PLASMA_APPLET_BROWSER_H + +namespace Plasma +{ + + class Corona; + class Containment; + +/** + * Interface for applet browser + * + */ + class AppletBrowser + { + public: + explicit AppletBrowser(Corona * corona); + explicit AppletBrowser(Containment * corona); + virtual ~AppletBrowser(); + + /** + * Displays the applet browser window + */ + void show(); + + /** + * Hides the applet browser window + */ + void hide(); + + private: + class Private; + Private * d; + }; + +} // namespace Plasma + +#endif // PLASMA_APPLET_BROWSER_H