Tulip  5.7.4
Large graphs analysis and drawing
SimpleStringsListSelectionWidget.h
1 /*
2  *
3  * This file is part of Tulip (https://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 #ifndef SIMPLESTRINGSLISTSELECTIONWIDGET_H_
22 #define SIMPLESTRINGSLISTSELECTIONWIDGET_H_
23 
24 #include <QWidget>
25 
26 #include "StringsListSelectionWidgetInterface.h"
27 
28 namespace Ui {
29 class SimpleStringsListSelectionData;
30 }
31 
32 class QListWidgetItem;
33 
34 namespace tlp {
35 
36 class TLP_QT_SCOPE SimpleStringsListSelectionWidget : public QWidget,
37  public StringsListSelectionWidgetInterface {
38 
39  Q_OBJECT
40 
41  Ui::SimpleStringsListSelectionData *_ui;
42 
43 public:
44  SimpleStringsListSelectionWidget(QWidget *parent = nullptr,
45  const unsigned int maxSelectedStringsListSize = 0,
46  bool orderable = true);
47  ~SimpleStringsListSelectionWidget() override;
48 
49  void setUnselectedStringsList(const std::vector<std::string> &unselectedStringsList) override;
50 
51  void setSelectedStringsList(const std::vector<std::string> &selectedStringsList) override;
52 
53  void clearUnselectedStringsList() override;
54 
55  void clearSelectedStringsList() override;
56 
57  void setMaxSelectedStringsListSize(const unsigned int maxSelectedStringsListSize) override;
58 
59  std::vector<std::string> getSelectedStringsList() const override;
60 
61  std::vector<std::string> getUnselectedStringsList() const override;
62 
63  void selectAllStrings() override;
64 
65  void unselectAllStrings() override;
66 
67 private slots:
68 
69  void pressButtonSelectAll();
70  void pressButtonUnselectAll();
71  void listItemClicked(QListWidgetItem *item);
72  void pressButtonUp();
73  void pressButtonDown();
74 
75 private:
76  unsigned int maxSelectedStringsListSize;
77 };
78 } // namespace tlp
79 
80 #endif /* SIMPLESTRINGSLISTSELECTIONWIDGET_H_ */
81 ///@endcond