Akonadi

tageditwidget.h
1 /*
2  This file is part of Akonadi
3 
4  SPDX-FileCopyrightText: 2014 Christian Mollekopf <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #pragma once
10 
11 #include "akonadiwidgets_export.h"
12 // AkonadiCore
13 #include <akonadi/tag.h>
14 
15 #include <QWidget>
16 
17 #include <memory>
18 
19 namespace Akonadi
20 {
21 class TagModel;
22 class TagEditWidgetPrivate;
23 
24 /**
25  * A widget that offers facilities to add/remove tags and optionally provides a way to select tags.
26  *
27  * @since 4.13
28  */
29 class AKONADIWIDGETS_EXPORT TagEditWidget : public QWidget
30 {
31  Q_OBJECT
32 public:
33  explicit TagEditWidget(QWidget *parent = nullptr);
34  explicit TagEditWidget(Akonadi::TagModel *model, QWidget *parent = nullptr, bool enableSelection = false);
35  ~TagEditWidget() override;
36 
37  void setModel(Akonadi::TagModel *model);
38  Akonadi::TagModel *model() const;
39 
40  void setSelectionEnabled(bool enabled);
41  bool selectionEnabled() const;
42 
43  void setSelection(const Akonadi::Tag::List &tags);
44  Q_REQUIRED_RESULT Akonadi::Tag::List selection() const;
45 
46 protected:
47  bool eventFilter(QObject *watched, QEvent *event) override;
48 
49 private:
50  std::unique_ptr<TagEditWidgetPrivate> const d;
51 };
52 
53 }
A widget that offers facilities to add/remove tags and optionally provides a way to select tags.
Definition: tageditwidget.h:29
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Dec 6 2022 03:53:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.