Changeset View
Changeset View
Standalone View
Standalone View
src/akonadicontrol/agentmanager.h
Show All 17 Lines | |||||
18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||
19 | ***************************************************************************/ | 19 | ***************************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef AGENTMANAGER_H | 21 | #ifndef AGENTMANAGER_H | ||
22 | #define AGENTMANAGER_H | 22 | #define AGENTMANAGER_H | ||
23 | 23 | | |||
24 | #include <QHash> | 24 | #include <QHash> | ||
25 | #include <QStringList> | 25 | #include <QStringList> | ||
26 | #include <QDBusServiceWatcher> | ||||
26 | 27 | | |||
27 | #include "agenttype.h" | 28 | #include "agenttype.h" | ||
28 | #include "agentinstance.h" | 29 | #include "agentinstance.h" | ||
30 | #include <private/dbus_p.h> | ||||
29 | 31 | | |||
30 | class QDir; | 32 | class QDir; | ||
31 | 33 | | |||
32 | namespace Akonadi | 34 | namespace Akonadi | ||
33 | { | 35 | { | ||
34 | class ProcessControl; | 36 | class ProcessControl; | ||
35 | } | 37 | } | ||
36 | 38 | | |||
▲ Show 20 Lines • Show All 281 Lines • ▼ Show 20 Line(s) | 239 | Q_SIGNALS: | |||
318 | 320 | | |||
319 | /** | 321 | /** | ||
320 | * Emitted when the online state of an agent changed. | 322 | * Emitted when the online state of an agent changed. | ||
321 | */ | 323 | */ | ||
322 | void agentInstanceOnlineChanged(const QString &agentIdentifier, bool state); | 324 | void agentInstanceOnlineChanged(const QString &agentIdentifier, bool state); | ||
323 | 325 | | |||
324 | private Q_SLOTS: | 326 | private Q_SLOTS: | ||
325 | void updatePluginInfos(); | 327 | void updatePluginInfos(); | ||
326 | void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner); | | |||
327 | void agentExeChanged(const QString &fileName); | 328 | void agentExeChanged(const QString &fileName); | ||
328 | 329 | | |||
329 | private: | 330 | private: | ||
330 | /** | 331 | /** | ||
331 | * Returns the list of directory paths where the .desktop files | 332 | * Returns the list of directory paths where the .desktop files | ||
332 | * for the plugins are located. | 333 | * for the plugins are located. | ||
333 | */ | 334 | */ | ||
334 | static QStringList pluginInfoPathList(); | 335 | static QStringList pluginInfoPathList(); | ||
Show All 16 Lines | |||||
351 | /** | 352 | /** | ||
352 | * Reads the plugin information from directory. | 353 | * Reads the plugin information from directory. | ||
353 | * | 354 | * | ||
354 | * @param directory the directory to get plugin information from | 355 | * @param directory the directory to get plugin information from | ||
355 | */ | 356 | */ | ||
356 | void readPluginInfos(const QDir &directory); | 357 | void readPluginInfos(const QDir &directory); | ||
357 | 358 | | |||
358 | AgentInstance::Ptr createAgentInstance(const AgentType &type); | 359 | AgentInstance::Ptr createAgentInstance(const AgentType &type); | ||
360 | bool checkServerIsOperational(const QString &serviceName) const; | ||||
359 | bool checkAgentInterfaces(const QString &identifier, const QString &method) const; | 361 | bool checkAgentInterfaces(const QString &identifier, const QString &method) const; | ||
360 | bool checkInstance(const QString &identifier) const; | 362 | bool checkInstance(const QString &identifier) const; | ||
361 | bool checkResourceInterface(const QString &identifier, const QString &method) const; | 363 | bool checkResourceInterface(const QString &identifier, const QString &method) const; | ||
362 | bool checkAgentExists(const QString &identifier) const; | 364 | bool checkAgentExists(const QString &identifier) const; | ||
363 | void ensureAutoStart(const AgentType &info); | 365 | void ensureAutoStart(const AgentType &info); | ||
364 | void continueStartup(); | 366 | void continueStartup(); | ||
365 | void registerAgentAtServer(const QString &agentIdentifier, const AgentType &type); | 367 | void registerAgentAtServer(const QString &agentIdentifier, const AgentType &type); | ||
366 | 368 | | |||
369 | void registerAgentService(const Akonadi::DBus::AgentService &service); | ||||
370 | void registerResourceService(const Akonadi::DBus::AgentService &service); | ||||
371 | void registerPreprocessorService(const Akonadi::DBus::AgentService &service); | ||||
372 | void unregisterPreprocessorService(const Akonadi::DBus::AgentService &service); | ||||
367 | private: | 373 | private: | ||
368 | /** | 374 | /** | ||
369 | * The map which stores the .desktop file | 375 | * The map which stores the .desktop file | ||
370 | * entries for every agent type. | 376 | * entries for every agent type. | ||
371 | * | 377 | * | ||
372 | * Key is the agent type (e.g. 'file' or 'imap'). | 378 | * Key is the agent type (e.g. 'file' or 'imap'). | ||
373 | */ | 379 | */ | ||
374 | QHash<QString, AgentType> mAgents; | 380 | QHash<QString, AgentType> mAgents; | ||
375 | 381 | | |||
376 | /** | 382 | /** | ||
377 | * The map which stores the active instances. | 383 | * The map which stores the active instances. | ||
378 | * | 384 | * | ||
379 | * Key is the instance identifier. | 385 | * Key is the instance identifier. | ||
380 | */ | 386 | */ | ||
381 | QHash<QString, AgentInstance::Ptr> mAgentInstances; | 387 | QHash<QString, AgentInstance::Ptr> mAgentInstances; | ||
382 | 388 | | |||
383 | std::unique_ptr<Akonadi::ProcessControl> mAgentServer; | 389 | std::unique_ptr<Akonadi::ProcessControl> mAgentServer; | ||
384 | std::unique_ptr<Akonadi::ProcessControl> mStorageController; | 390 | std::unique_ptr<Akonadi::ProcessControl> mStorageController; | ||
391 | QDBusServiceWatcher mWatcher; | ||||
385 | bool mAgentServerEnabled = false; | 392 | bool mAgentServerEnabled = false; | ||
386 | bool mVerbose = false; | 393 | bool mVerbose = false; | ||
387 | 394 | | |||
388 | friend class AgentInstance; | 395 | friend class AgentInstance; | ||
389 | }; | 396 | }; | ||
390 | 397 | | |||
391 | #endif | 398 | #endif |