/usr/include/tulip/StringsListSelectionWidget.h is in libtulip-dev 4.8.0dfsg-2build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | /*
*
* This file is part of Tulip (www.tulip-software.org)
*
* Authors: David Auber and the Tulip development Team
* from LaBRI, University of Bordeaux
*
* Tulip is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* Tulip is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
*/
///@cond DOXYGEN_HIDDEN
#ifndef STRINGLISTSELECTIONWIDGET_H_
#define STRINGLISTSELECTIONWIDGET_H_
#include <vector>
#include <tulip/StringsListSelectionWidgetInterface.h>
#include <QWidget>
namespace tlp {
/** \brief A widget for selecting a set of strings
*
* This widget allow to select a subset of strings from an initial input strings list.
* The look of the widget can be set via the ListType parameter :
* -> SIMPLE_LIST : the widget contains only one strings list, the selection of strings is done via the checkboxes located on the left of the items list
* -> DOUBLE_LIST : the widget contains two lists, the left one contains the unselected string list and the right one the selected strings list. To select
* a string (resp. unselect a string), it has to be moved from the list on the left to the list on the right (resp. from the list on the right to
* the list on the left) via the buttons located between the two lists or by drag'n drop.
*/
class TLP_QT_SCOPE StringsListSelectionWidget: public QWidget,
public StringsListSelectionWidgetInterface {
public:
enum ListType {
SIMPLE_LIST, DOUBLE_LIST
};
/**
* Default constructor (for qt designer)
* \param parent the widget's parent
* \param listType this parameter defines the widget's look (see class description)
* \param maxSelectedStringsListSize the maximum number of strings that can be selected (if 0, no size restriction)
*/
StringsListSelectionWidget(QWidget *parent = NULL, const ListType listType =
DOUBLE_LIST, const unsigned int maxSelectedStringsListSize = 0);
/**
* This constructor creates the widget and initializes the unselected strings list
* \param unselectedStringsList a vector containing the set of strings that can be selected
* \param parent the widget's parent
* \param listType this parameter defines the widget's look (see class description)
* \param maxSelectedStringsListSize the maximum number of strings that can be selected (if 0, no size restriction)
*/
StringsListSelectionWidget(
const std::vector<std::string> &unselectedStringsList,
QWidget *parent = NULL, const ListType listType = DOUBLE_LIST,
const unsigned int maxSelectedStringsListSize = 0);
/**
* Method which sets the look of the widget
* \param listType this parameter defines the widget's look (see class description)
*/
void setListType(const ListType listType);
/**
* Method which sets the unselected strings list
* \param unselectedStringsList a vector containing a set of strings to be unselected
*/
void setUnselectedStringsList(
const std::vector<std::string> &unselectedStringsList);
/**
* Method which sets the selected strings list
* \param selectedStringsList a vector containing a set of strings to be selected
*/
void setSelectedStringsList(
const std::vector<std::string> &selectedStringsList);
/**
* Method which empty the unselected strings list
*/
void clearUnselectedStringsList();
/**
* Method which empty the selected strings list
*/
void clearSelectedStringsList();
/**
* Method which sets the label text value of the unselected strings list
* (this method does nothing if listType = SIMPLE_LIST)
*/
void setUnselectedStringsListLabel(
const std::string &unselectedStringsListLabel);
/**
* Method which sets the label text value of the selected strings list
* (this method does nothing if listType = SIMPLE_LIST)
*/
void setSelectedStringsListLabel(
const std::string &selectedStringsListLabel);
/**
* Method which sets the maximum size of the selected strings list
*/
void setMaxSelectedStringsListSize(
const unsigned int maxSelectedStringsListSize);
/**
* Method which returns the selected strings as a vector
*/
std::vector<std::string> getSelectedStringsList() const;
/**
* Method which returns the unselected strings as a vector
*/
std::vector<std::string> getUnselectedStringsList() const;
/**
* Method which returns both of the selected and unselected strings as a vector
*/
std::vector<std::string> getCompleteStringsList() const;
/**
* Method which selects all strings
*/
void selectAllStrings();
/**
* Method which unselect all strings
*/
void unselectAllStrings();
private:
ListType listType;
StringsListSelectionWidgetInterface *stringsListSelectionWidget;
};
}
#endif /* STRINGLISTSELECTIONWIDGET_H_ */
///@endcond
|