• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

Plasma

  • plasma
runnercontext.h
Go to the documentation of this file.
1/*
2 * Copyright 2006-2007 Aaron Seigo <aseigo@kde.org>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef PLASMA_RUNNERCONTEXT_H
21#define PLASMA_RUNNERCONTEXT_H
22
23#include <QtCore/QList>
24#include <QtCore/QObject>
25#include <QtCore/QSharedDataPointer>
26
27#include <plasma/plasma_export.h>
28
29class KCompletion;
30class KConfigGroup;
31
32namespace Plasma
33{
34
35class QueryMatch;
36class AbstractRunner;
37class RunnerContextPrivate;
38
46class PLASMA_EXPORT RunnerContext : public QObject
47{
48 Q_OBJECT
49
50 public:
51 enum Type {
52 None = 0,
53 UnknownType = 1,
54 Directory = 2,
55 File = 4,
56 NetworkLocation = 8,
57 Executable = 16,
58 ShellCommand = 32,
59 Help = 64,
60 FileSystem = Directory | File | Executable | ShellCommand
61 };
62
63 Q_DECLARE_FLAGS(Types, Type)
64
65 explicit RunnerContext(QObject *parent = 0);
66
70 RunnerContext(RunnerContext &other, QObject *parent = 0);
71
76 RunnerContext &operator=(const RunnerContext &other);
77
78 ~RunnerContext();
79
85 void reset();
86
91 void setQuery(const QString &term);
92
96 QString query() const;
97
102 Type type() const;
103
111 QString mimeType() const;
112
131 bool isValid() const;
132
140 // trueg: what do we need the term for? It is stored in the context anyway! Plus: matches() does not have a term parameter!
141 // plus: it is Q_UNUSED
142 bool addMatches(const QString &term, const QList<QueryMatch> &matches);
143
154 // trueg: what do we need the term for? It is stored in the context anyway! Plus: matches() does not have a term parameter!
155 // plus: it is Q_UNUSED
156 bool addMatch(const QString &term, const QueryMatch &match);
157
168 bool removeMatch(const QString matchId);
169
180 bool removeMatches(const QStringList matchIdList);
181
192 bool removeMatches(AbstractRunner *runner);
193
199 QList<QueryMatch> matches() const;
200
208 QueryMatch match(const QString &id) const;
209
217 void setSingleRunnerQueryMode(bool enabled);
218
223 bool singleRunnerQueryMode() const;
224
235 void restore(const KConfigGroup &config);
236
240 void save(KConfigGroup &config);
241
250 void run(const QueryMatch &match);
251
252 Q_SIGNALS:
253 void matchesChanged();
254
255 private:
256 QExplicitlySharedDataPointer<RunnerContextPrivate> d;
257};
258
259}
260
261Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::RunnerContext::Types)
262
263#endif
Plasma::AbstractRunner
An abstract base class for Plasma Runner plugins.
Definition: abstractrunner.h:64
Plasma::QueryMatch
A match returned by an AbstractRunner in response to a given RunnerContext.
Definition: querymatch.h:48
Plasma::RunnerContext
The RunnerContext class provides information related to a search, including the search term,...
Definition: runnercontext.h:47
Plasma::RunnerContext::matchesChanged
void matchesChanged()
Plasma::RunnerContext::Type
Type
Definition: runnercontext.h:51
QObject
Plasma
Namespace for everything in libplasma.
Definition: abstractdialogmanager.cpp:25
plasma_export.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal