• Skip to content
  • Skip to link menu
KDE 4.1 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/QMutex>
00025 #include <QtCore/QStringList>
00026 
00027 #include <KDE/KConfigGroup>
00028 #include <KDE/KService>
00029 
00030 #include <plasma/plasma_export.h>
00031 #include <plasma/runnercontext.h>
00032 #include <plasma/querymatch.h>
00033 #include <plasma/version.h>
00034 
00035 class KCompletion;
00036 
00037 namespace Plasma
00038 {
00039 
00040 class Package;
00041 class RunnerScript;
00042 class QueryMatch;
00043 class AbstractRunnerPrivate;
00044 
00053 class PLASMA_EXPORT AbstractRunner : public QObject
00054 {
00055     Q_OBJECT
00056 
00057     public:
00058         enum Speed { SlowSpeed,
00059                      NormalSpeed
00060                    };
00061 
00062         enum Priority { LowestPriority = 0,
00063                         LowPriority,
00064                         NormalPriority,
00065                         HighPriority,
00066                         HighestPriority
00067                       };
00068 
00069         typedef QList<AbstractRunner*> List;
00070 
00071         virtual ~AbstractRunner();
00072 
00094         virtual void match(Plasma::RunnerContext &context);
00095 
00101         void performMatch(Plasma::RunnerContext &context);
00102 
00108         bool hasRunOptions();
00109 
00117         virtual void createRunOptions(QWidget *widget);
00118 
00123         virtual void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action);
00124 
00129         Speed speed() const;
00130 
00135         Priority priority() const;
00136 
00142         RunnerContext::Types ignoredTypes() const;
00143 
00148         void setIgnoredTypes(RunnerContext::Types types);
00149 
00153         QString name() const;
00154 
00158         QString id() const;
00159 
00163         QString description() const;
00164 
00170         const Package* package() const;
00171 
00175         virtual void reloadConfiguration();
00176 
00177     protected:
00178         friend class RunnerManager;
00179         friend class RunnerManagerPrivate;
00180 
00186         explicit AbstractRunner(QObject* parent = 0, const QString& serviceId = QString());
00187         AbstractRunner(QObject* parent, const QVariantList& args);
00188 
00192         KConfigGroup config() const;
00193 
00197         void setHasRunOptions(bool hasRunOptions);
00198 
00205         void setSpeed(Speed newSpeed);
00206 
00211         void setPriority(Priority newPriority);
00212 
00224         KService::List serviceQuery(const QString &serviceType,
00225                                     const QString &constraint = QString()) const;
00226 
00227         QMutex* bigLock() const;
00228 
00229     protected Q_SLOTS:
00230         void init();
00231 
00232     private:
00233         AbstractRunnerPrivate* const d;
00234 };
00235 
00236 } // Plasma namespace
00237 
00238 #define K_EXPORT_PLASMA_RUNNER( libname, classname )     \
00239 K_PLUGIN_FACTORY(factory, registerPlugin<classname>();) \
00240 K_EXPORT_PLUGIN(factory("plasma_runner_" #libname)) \
00241 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
00242 
00243 
00244 #define K_EXPORT_RUNNER_CONFIG( name, classname )     \
00245 K_PLUGIN_FACTORY(ConfigFactory, registerPlugin<classname>();) \
00246 K_EXPORT_PLUGIN(ConfigFactory("kcm_krunner_" #name)) \
00247 K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
00248 
00249 #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
  •   libsolidcontrol
  •   libtaskmanager
  • 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