Tulip  5.2.1
Large graphs analysis and drawing
SimpleStringsListSelectionWidget.h
1 /*
2  *
3  * This file is part of Tulip (http://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  ~SimpleStringsListSelectionWidget() override;
47 
48  void setUnselectedStringsList(const std::vector<std::string> &unselectedStringsList) override;
49 
50  void setSelectedStringsList(const std::vector<std::string> &selectedStringsList) override;
51 
52  void clearUnselectedStringsList() override;
53 
54  void clearSelectedStringsList() override;
55 
56  void setMaxSelectedStringsListSize(const unsigned int maxSelectedStringsListSize) override;
57 
58  std::vector<std::string> getSelectedStringsList() const override;
59 
60  std::vector<std::string> getUnselectedStringsList() const override;
61 
62  void selectAllStrings() override;
63 
64  void unselectAllStrings() override;
65 
66 private slots:
67 
68  void pressButtonSelectAll();
69  void pressButtonUnselectAll();
70  void listItemClicked(QListWidgetItem *item);
71  void pressButtonUp();
72  void pressButtonDown();
73 
74 private:
75  void qtWidgetsConnection();
76 
77  unsigned int maxSelectedStringsListSize;
78 };
79 } // namespace tlp
80 
81 #endif /* SIMPLESTRINGSLISTSELECTIONWIDGET_H_ */
82 ///@endcond