Added files
svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=717930
This commit is contained in:
parent
b8343e6cf7
commit
ee2f663398
72
appletbrowser.cpp
Normal file
72
appletbrowser.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
|
||||||
|
*
|
||||||
|
* 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 <appletbrowser.h>
|
||||||
|
#include <appletbrowser/appletbrowserwindow.h>
|
||||||
|
|
||||||
|
#include <corona.h>
|
||||||
|
#include <containment.h>
|
||||||
|
|
||||||
|
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
|
57
appletbrowser.h
Normal file
57
appletbrowser.h
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2007 Ivan Cukic <ivan.cukic+kde@gmail.com>
|
||||||
|
*
|
||||||
|
* 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
|
Loading…
x
Reference in New Issue
Block a user