LeechCraft 0.6.70-14794-g33744ae6ce
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
categoryselector.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <memory>
12#include <QDialog>
13#include <util/sll/util.h>
14#include "tagsconfig.h"
15
16class QStringList;
17class QString;
18
19namespace Ui
20{
21 class CategorySelector;
22}
23
24namespace LC::Util
25{
46 class UTIL_TAGS_API CategorySelector : public QDialog
47 {
48 Q_OBJECT
49
50 std::shared_ptr<Ui::CategorySelector> Ui_;
51
52 QString Caption_;
53 QString Separator_;
54 bool NotificationsEnabled_ = true;
55 public:
56 enum class ButtonsMode
57 {
58 NoButtons,
59 Close,
60 AcceptReject
61 };
62
71 explicit CategorySelector (QWidget *parent = nullptr);
72
79 void SetCaption (const QString& caption);
80
91 QStringList GetSelections () const;
92
102 QList<int> GetSelectedIndexes () const;
103
113 void SetSelections (const QStringList& subset);
114
120 QString GetSeparator () const;
121
128 void SetSeparator (const QString&);
129
132 void SetButtonsMode (ButtonsMode);
133
152 void SetPossibleSelections (QStringList selections, bool sort = true);
153
156 void SelectAll ();
157
160 void SelectNone ();
161
170 void SetSelectionsFromString (const QString& newText);
171 protected:
175 void moveEvent (QMoveEvent*) override;
176 private:
179 void NotifyTagsSelection ();
180
181 [[nodiscard]] Util::DefaultScopeGuard DisableNotifications (bool reemit = true);
182 signals:
187 void tagsSelectionChanged (const QStringList& newSelections);
188 };
189}
The CategorySelector widget provides a way to select amongst a group of items.
void tagsSelectionChanged(const QStringList &newSelections)
Indicates that selections have changed.
@ Close
Definition: winflags.h:46
#define UTIL_TAGS_API
Definition: tagsconfig.h:16