Akonadi

agenttypedialog.h
1 /*
2  SPDX-FileCopyrightText: 2006 Tobias Koenig <[email protected]>
3  SPDX-FileCopyrightText: 2008 Omat Holding B.V. <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-or-later
6 */
7 
8 #pragma once
9 
10 #include "agenttypewidget.h"
11 // AkonadiCore
12 #include <akonadi/agenttype.h>
13 
14 #include <QDialog>
15 
16 #include <memory>
17 
18 namespace Akonadi
19 {
20 class AgentTypeDialogPrivate;
21 
22 /**
23  * @short A dialog to select an available agent type.
24  *
25  * This dialogs allows the user to select an agent type from the
26  * list of all available agent types. The list can be filtered
27  * by the proxy model returned by agentFilterProxyModel().
28  *
29  * @code
30  *
31  * Akonadi::AgentTypeDialog dlg( this );
32  *
33  * // only list agent types that provide contacts
34  * dlg.agentFilterProxyModel()->addMimeTypeFilter( "text/directory" );
35  *
36  * if ( dlg.exec() ) {
37  * const AgentType agentType = dlg.agentType();
38  * ...
39  * }
40  *
41  * @endcode
42  *
43  * @author Tom Albers <[email protected]>
44  * @since 4.2
45  */
46 class AKONADIWIDGETS_EXPORT AgentTypeDialog : public QDialog
47 {
48  Q_OBJECT
49 
50 public:
51  /**
52  * Creates a new agent type dialog.
53  *
54  * @param parent The parent widget of the dialog.
55  */
56  explicit AgentTypeDialog(QWidget *parent = nullptr);
57 
58  /**
59  * Destroys the agent type dialog.
60  */
61  ~AgentTypeDialog() override;
62 
63  /**
64  * Returns the agent type that was selected by the user,
65  * or an empty agent type object if no agent type has been selected.
66  */
67  Q_REQUIRED_RESULT AgentType agentType() const;
68 
69  /**
70  * Returns the agent filter proxy model that can be used
71  * to filter the agent types that shall be shown in the
72  * dialog.
73  */
74  Q_REQUIRED_RESULT AgentFilterProxyModel *agentFilterProxyModel() const;
75 
76 public Q_SLOTS:
77  void done(int result) override;
78 
79 private:
80  /// @cond PRIVATE
81  std::unique_ptr<AgentTypeDialogPrivate> const d;
82  /// @endcond
83 };
84 
85 }
86 
A representation of an agent type.
A proxy model for filtering AgentType or AgentInstance.
A dialog to select an available agent type.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jun 25 2022 06:00:31 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.