Akonadi

core/agentinstance.h
1 /*
2  Copyright (c) 2008 Tobias Koenig <[email protected]>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #ifndef AKONADI_AGENTINSTANCE_H
21 #define AKONADI_AGENTINSTANCE_H
22 
23 #include "akonadicore_export.h"
24 
25 #include <QMetaType>
26 #include <QSharedDataPointer>
27 
28 class QString;
29 class QWidget;
30 
31 namespace Akonadi
32 {
33 
34 class AgentType;
35 
60 class AKONADICORE_EXPORT AgentInstance
61 {
62  friend class AgentManager;
63  friend class AgentManagerPrivate;
64 
65 public:
70 
74  enum Status {
75  Idle = 0,
78  NotConfigured
79  };
80 
84  AgentInstance();
85 
89  AgentInstance(const AgentInstance &other);
90 
94  ~AgentInstance();
95 
99  Q_REQUIRED_RESULT bool isValid() const;
100 
104  Q_REQUIRED_RESULT AgentType type() const;
105 
109  Q_REQUIRED_RESULT QString identifier() const;
110 
114  Q_REQUIRED_RESULT QString name() const;
115 
119  void setName(const QString &name);
120 
124  Q_REQUIRED_RESULT Status status() const;
125 
129  Q_REQUIRED_RESULT QString statusMessage() const;
130 
135  Q_REQUIRED_RESULT int progress() const;
136 
140  Q_REQUIRED_RESULT bool isOnline() const;
141 
145  void setIsOnline(bool online);
146 
156  AKONADICORE_DEPRECATED void configure(QWidget *parent = nullptr);
157 
161  void synchronize();
162 
166  void synchronizeCollectionTree();
167 
171  void synchronizeTags();
172 
176  void synchronizeRelations();
177 
182  AgentInstance &operator=(const AgentInstance &other);
183 
188  Q_REQUIRED_RESULT bool operator==(const AgentInstance &other) const;
189 
194  void abortCurrentTask() const;
195 
199  void reconfigure() const;
200 
204  void restart() const;
205 
206 private:
207  //@cond PRIVATE
208  class Private;
210  //@endcond
211 };
212 
213 }
214 
215 Q_DECLARE_TYPEINFO(Akonadi::AgentInstance, Q_MOVABLE_TYPE);
216 
217 Q_DECLARE_METATYPE(Akonadi::AgentInstance)
218 
219 #endif
Provides an interface to retrieve agent types and manage agent instances.
QVector< AgentInstance > List
Describes a list of agent instances.
The agent instance is working on something.
A representation of an agent type.
Helper integration between Akonadi and Qt.
Status
Describes the status of the agent instance.
A representation of an agent instance.
The agent instance encountered an error state.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue May 26 2020 22:46:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.