Akonadi
9 #include "controlinterface.h"
10 #include "preprocessorinterface.h"
11 #include "resourceinterface.h"
12 #include "searchinterface.h"
13 #include "statusinterface.h"
15 #include <private/dbus_p.h>
18 #include <QSharedPointer>
54 Q_REQUIRED_RESULT
QString agentType()
const
59 Q_REQUIRED_RESULT
int status()
const
64 Q_REQUIRED_RESULT
QString statusMessage()
const
66 return mStatusMessage;
69 Q_REQUIRED_RESULT
int progress()
const
74 Q_REQUIRED_RESULT
bool isOnline()
const
79 Q_REQUIRED_RESULT
QString resourceName()
const
84 virtual bool start(
const AgentType &agentInfo) = 0;
86 virtual void cleanup();
87 virtual void restartWhenIdle() = 0;
88 virtual void configure(qlonglong windowId) = 0;
90 Q_REQUIRED_RESULT
bool hasResourceInterface()
const
92 return mResourceInterface !=
nullptr;
95 Q_REQUIRED_RESULT
bool hasAgentInterface()
const
97 return mAgentControlInterface !=
nullptr && mAgentStatusInterface !=
nullptr;
100 Q_REQUIRED_RESULT
bool hasPreprocessorInterface()
const
102 return mPreprocessorInterface !=
nullptr;
105 org::freedesktop::Akonadi::Agent::Control *controlInterface()
const
107 return mAgentControlInterface.get();
110 org::freedesktop::Akonadi::Agent::Status *statusInterface()
const
112 return mAgentStatusInterface.get();
115 org::freedesktop::Akonadi::Agent::Search *searchInterface()
const
117 return mSearchInterface.get();
120 org::freedesktop::Akonadi::Resource *resourceInterface()
const
122 return mResourceInterface.get();
125 org::freedesktop::Akonadi::Preprocessor *preProcessorInterface()
const
127 return mPreprocessorInterface.get();
130 bool obtainAgentInterface();
131 bool obtainResourceInterface();
132 bool obtainPreprocessorInterface();
135 void statusChanged(
int status,
const QString &statusMsg);
136 void advancedStatusChanged(
const QVariantMap &status);
137 void statusStateChanged(
int status);
138 void statusMessageChanged(
const QString &msg);
139 void percentChanged(
int percent);
140 void warning(
const QString &msg);
141 void error(
const QString &msg);
142 void onlineChanged(
bool state);
143 void resourceNameChanged(
const QString &name);
145 void refreshAgentStatus();
146 void refreshResourceStatus();
151 template<
typename T> std::unique_ptr<T> findInterface(Akonadi::DBus::AgentType agentType,
const char *path =
nullptr);
154 void setAgentType(
const QString &agentType)
163 std::unique_ptr<org::freedesktop::Akonadi::Agent::Control> mAgentControlInterface;
164 std::unique_ptr<org::freedesktop::Akonadi::Agent::Status> mAgentStatusInterface;
165 std::unique_ptr<org::freedesktop::Akonadi::Agent::Search> mSearchInterface;
166 std::unique_ptr<org::freedesktop::Akonadi::Resource> mResourceInterface;
167 std::unique_ptr<org::freedesktop::Akonadi::Preprocessor> mPreprocessorInterface;
173 bool mOnline =
false;
174 bool mPendingQuit =
false;
The agent manager has knowledge about all available agents (it scans for .desktop files in the agent ...
Represents one agent instance and takes care of communication with it.
QString identifier() const
Set/get the unique identifier of this AgentInstance.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon Jun 27 2022 04:01:05 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.