54 [[nodiscard]]
QString agentType()
const
59 [[nodiscard]]
int status()
const
64 [[nodiscard]]
QString statusMessage()
const
66 return mStatusMessage;
69 [[nodiscard]]
int progress()
const
74 [[nodiscard]]
bool isOnline()
const
79 [[nodiscard]]
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 [[nodiscard]]
bool hasResourceInterface()
const
92 return mResourceInterface !=
nullptr;
95 [[nodiscard]]
bool hasAgentInterface()
const
97 return mAgentControlInterface !=
nullptr && mAgentStatusInterface !=
nullptr;
100 [[nodiscard]]
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();
152 std::unique_ptr<T> findInterface(Akonadi::DBus::AgentType agentType,
const char *path =
nullptr);
155 void setAgentType(
const QString &agentType)
164 std::unique_ptr<org::freedesktop::Akonadi::Agent::Control> mAgentControlInterface;
165 std::unique_ptr<org::freedesktop::Akonadi::Agent::Status> mAgentStatusInterface;
166 std::unique_ptr<org::freedesktop::Akonadi::Agent::Search> mSearchInterface;
167 std::unique_ptr<org::freedesktop::Akonadi::Resource> mResourceInterface;
168 std::unique_ptr<org::freedesktop::Akonadi::Preprocessor> mPreprocessorInterface;
174 bool mOnline =
false;
175 bool mPendingQuit =
false;