LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
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 
16 class QStringList;
17 class QString;
18 
19 namespace Ui
20 {
21  class CategorySelector;
22 }
23 
24 namespace 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 }
QList
Definition: ianrulesstorage.h:14
LC::Util
Definition: icoreproxy.h:33
util.h
UTIL_TAGS_API
#define UTIL_TAGS_API
Definition: tagsconfig.h:16
LC::Util::CategorySelector
The CategorySelector widget provides a way to select amongst a group of items.
Definition: categoryselector.h:46
Ui
Definition: backendselector.h:15
LC::Util::detail::ScopeGuard
Definition: util.h:61
LC::Util::CategorySelector::ButtonsMode
ButtonsMode
Definition: categoryselector.h:56
tagsconfig.h
LC::Util::Close
@ Close
Definition: winflags.h:52