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

Plasma

runnercontext.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 PLASMA_RUNNERCONTEXT_H
00021 #define PLASMA_RUNNERCONTEXT_H
00022 
00023 #include <QtCore/QList>
00024 #include <QtCore/QObject>
00025 #include <QtCore/QSharedDataPointer>
00026 
00027 #include <plasma/plasma_export.h>
00028 
00029 class KCompletion;
00030 class KConfigGroup;
00031 
00032 namespace Plasma
00033 {
00034 
00035 class QueryMatch;
00036 class AbstractRunner;
00037 class RunnerContextPrivate;
00038 
00046 class PLASMA_EXPORT RunnerContext : public QObject
00047 {
00048     Q_OBJECT
00049 
00050     public:
00051         enum Type {
00052             None = 0,
00053             UnknownType = 1,
00054             Directory = 2,
00055             File = 4,
00056             NetworkLocation = 8,
00057             Executable = 16,
00058             ShellCommand = 32,
00059             Help = 64,
00060             FileSystem = Directory | File | Executable | ShellCommand
00061         };
00062 
00063         Q_DECLARE_FLAGS(Types, Type)
00064 
00065         explicit RunnerContext(QObject *parent = 0);
00066 
00070         explicit RunnerContext(RunnerContext &other, QObject *parent = 0);
00071 
00072         ~RunnerContext();
00073 
00078         void reset();
00079 
00084         void setQuery(const QString &term);
00085 
00089         QString query() const;
00090 
00095         Type type() const;
00096 
00104         QString mimeType() const;
00105 
00124         bool isValid() const;
00125 
00133         // trueg: what do we need the term for? It is stored in the context anyway! Plus: matches() does not have a term parameter!
00134         //        plus: it is Q_UNUSED
00135         bool addMatches(const QString &term, const QList<QueryMatch> &matches);
00136 
00147         // trueg: what do we need the term for? It is stored in the context anyway! Plus: matches() does not have a term parameter!
00148         //        plus: it is Q_UNUSED
00149         bool addMatch(const QString &term, const QueryMatch &match);
00150 
00156         QList<QueryMatch> matches() const;
00157 
00165         QueryMatch match(const QString &id) const;
00166 
00177         void restore(const KConfigGroup &config);
00178 
00182         void save(KConfigGroup &config);
00183 
00192         void run(const QueryMatch &match);
00193 
00194     Q_SIGNALS:
00195         void matchesChanged();
00196 
00197     private:
00198         QExplicitlySharedDataPointer<RunnerContextPrivate> d;
00199 };
00200 
00201 }
00202 
00203 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::RunnerContext::Types)
00204 
00205 #endif

Plasma

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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