• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libplasma

abstractrunner.h

Go to the documentation of this file.
00001 /*
00002  *   Copyright 2006-2007 Aaron Seigo <aseigo@kde.org>
00003  *
00004  *   This program is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU Library General Public License as
00006  *   published by the Free Software Foundation; either version 2, or
00007  *   (at your option) any later version.
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 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 RUNNER_H
00021 #define RUNNER_H
00022 
00023 #include <QtCore/QObject>
00024 #include <QtCore/QStringList>
00025 
00026 #include <KDE/KConfigGroup>
00027 
00028 #include <plasma/plasma_export.h>
00029 #include <plasma/searchmatch.h>
00030 #include <plasma/searchcontext.h>
00031 
00032 class KCompletion;
00033 
00034 namespace Plasma
00035 {
00036 
00040 class PLASMA_EXPORT AbstractRunner : public QObject
00041 {
00042     Q_OBJECT
00043 
00044     public:
00045         enum Speed { NormalSpeed,
00046               SlowSpeed };
00047 
00048         typedef QList<AbstractRunner*> List;
00049 
00055         static List loadRunners(QObject* parent, const QStringList& whitelist = QStringList() );
00056 
00062         explicit AbstractRunner(QObject* parent = 0);
00063         virtual ~AbstractRunner();
00064 
00068         KConfigGroup config() const;
00069 
00085         virtual void match(Plasma::SearchContext *search) = 0;
00086 
00087         void performMatch(Plasma::SearchContext &globalContext);
00088 
00094         bool hasMatchOptions();
00095 
00103         virtual void createMatchOptions(QWidget *widget);
00104 
00108         bool isConfigurable();
00109 
00117         virtual void createConfigurationInterface(QWidget *widget);
00118 
00123         virtual void exec(Plasma::SearchMatch *action);
00124 
00128     Speed speed() const;
00129 
00130     protected:
00134         void setHasMatchOptions(bool hasMatchOptions);
00135 
00139         void setIsConfigurable(bool canBeConfigured);
00140 
00147         void setSpeed(Speed newSpeed);
00148 
00149     private:
00150         class Private;
00151         Private* const d;
00152 };
00153 
00154 } // Plasma namespace
00155 
00156 #define K_EXPORT_PLASMA_RUNNER( libname, classname )     \
00157 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00158 K_EXPORT_PLUGIN(factory("plasma_runner_" #libname))
00159 
00160 #endif

libplasma

Skip menu "libplasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libplasma
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal