plasma-framework/private/associatedapplicationmanager_p.h
Marco Martin 08d49e6fd0 introducing the concept of associated application:
an an application and/or an url list can be associated with an aplet
and a context menu entry and an applet handle button will be added to
launch that application.
the applet will be considered a preview of something, where the
application its full view, for example the picture frame can open
gwenview

svn path=/trunk/KDE/kdelibs/; revision=1024487
2009-09-16 17:08:45 +00:00

68 lines
2.2 KiB
C++

/*
* Copyright 2009 Marco Martin <notmart@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2, or
* (at your option) any later version.
*
* 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_ASSOCIATEDAPPLICATIONMANAGER_P_H
#define PLASMA_ASSOCIATEDAPPLICATIONMANAGER_P_H
#include <QObject>
#include <kurl.h>
namespace Plasma
{
class Applet;
class AssociatedApplicationManagerPrivate;
class AssociatedApplicationManager : public QObject
{
Q_OBJECT
public:
static AssociatedApplicationManager *self();
//set an application name for an applet
void setApplication(Plasma::Applet *applet, const QString &application);
//returns the application name associated to an applet
QString application(const Plasma::Applet *applet) const;
//sets the urls associated to an applet
void setUrls(Plasma::Applet *applet, const KUrl::List &urls);
//returns the urls associated to an applet
KUrl::List urls(const Plasma::Applet *applet) const;
//run the associated application or the urls if no app is associated
void run(Plasma::Applet *applet);
//returns true if the applet has a valid associated application or urls
bool appletHasValidAssociatedApplication(const Plasma::Applet *applet) const;
private:
AssociatedApplicationManager(QObject *parent = 0);
~AssociatedApplicationManager();
AssociatedApplicationManagerPrivate *const d;
friend class AssociatedApplicationManagerSingleton;
Q_PRIVATE_SLOT(d, void cleanupApplet(QObject *obj))
};
} // namespace Plasma
#endif // multiple inclusion guard