File indexing completed on 2024-05-26 05:14:45
0001 /* 0002 SPDX-FileCopyrightText: 2015-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "akonadiwidgets_export.h" 0010 // AkonadiCore 0011 #include "akonadi/tag.h" 0012 0013 #include <QWidget> 0014 0015 #include <memory> 0016 0017 namespace Akonadi 0018 { 0019 class TagSelectWidgetPrivate; 0020 0021 /** 0022 * A widget that offers facilities to add/remove tags and provides a way to select tags. 0023 * 0024 * @since 4.14.6 0025 */ 0026 0027 class AKONADIWIDGETS_EXPORT TagSelectWidget : public QWidget 0028 { 0029 Q_OBJECT 0030 public: 0031 explicit TagSelectWidget(QWidget *parent = nullptr); 0032 ~TagSelectWidget() override; 0033 0034 void setSelection(const Akonadi::Tag::List &tags); 0035 [[nodiscard]] Akonadi::Tag::List selection() const; 0036 0037 /** 0038 * @brief tagToStringList 0039 * @return QStringList from selected tag (List of Url) 0040 */ 0041 [[nodiscard]] QStringList tagToStringList() const; 0042 /** 0043 * @brief setSelectionFromStringList, convert a QStringList to Tag (converted from url) 0044 */ 0045 void setSelectionFromStringList(const QStringList &lst); 0046 0047 private: 0048 /// @cond PRIVATE 0049 std::unique_ptr<TagSelectWidgetPrivate> const d; 0050 /// @endcond 0051 }; 0052 }