Akonadi

agentactionmanager.h
1 /*
2  Copyright (c) 2010 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_AGENTACTIONMANAGER_H
21 #define AKONADI_AGENTACTIONMANAGER_H
22 
23 #include "akonadiwidgets_export.h"
24 #include "agentinstance.h"
25 
26 #include <QObject>
27 
28 class QAction;
29 class KActionCollection;
30 class KLocalizedString;
32 class QWidget;
33 
34 namespace Akonadi
35 {
36 
43 class AKONADIWIDGETS_EXPORT AgentActionManager : public QObject
44 {
45  Q_OBJECT
46 public:
50  enum Type {
54  LastType
55  };
56 
60  enum TextContext {
67  ErrorMessageText
68  };
69 
76  explicit AgentActionManager(KActionCollection *actionCollection, QWidget *parent = nullptr);
77 
82 
88  void setSelectionModel(QItemSelectionModel *model);
89 
93  void setMimeTypeFilter(const QStringList &mimeTypes);
94 
98  void setCapabilityFilter(const QStringList &capabilities);
99 
106  Q_REQUIRED_RESULT QAction *createAction(Type type);
107 
112  void createAllActions();
113 
117  Q_REQUIRED_RESULT QAction *action(Type type) const;
118 
128  void interceptAction(Type type, bool intercept = true);
129 
136  Q_REQUIRED_RESULT Akonadi::AgentInstance::List selectedAgentInstances() const;
137 
147  void setContextText(Type type, TextContext context, const QString &text);
148 
157  void setContextText(Type type, TextContext context, const KLocalizedString &text);
158 
159 Q_SIGNALS:
165  void actionStateUpdated();
166 
167 private:
168  //@cond PRIVATE
169  class Private;
170  Private *const d;
171 
172  Q_PRIVATE_SLOT(d, void updateActions())
173 
174  Q_PRIVATE_SLOT(d, void slotCreateAgentInstance())
175  Q_PRIVATE_SLOT(d, void slotDeleteAgentInstance())
176  Q_PRIVATE_SLOT(d, void slotConfigureAgentInstance())
177 
178  Q_PRIVATE_SLOT(d, void slotAgentInstanceCreationResult(KJob *))
179  //@endcond
180 };
181 
182 }
183 
184 #endif
Configures the selected agent instance.
Manages generic actions for agent and agent instance views.
The window title of a dialog.
Type
Describes the supported actions.
The window title of an error message.
The window title of a message box.
TextContext
Describes the text context that can be customized.
Deletes the selected agent instance.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jun 4 2020 23:08:40 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.