/usr/include/tulip/TulipItemEditorCreators.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 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | /*
*
* 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 TULIPITEMEDITORCREATORS_H
#define TULIPITEMEDITORCREATORS_H
#include <tulip/tulipconf.h>
#include <tulip/PropertyTypes.h>
#include <QVariant>
#include <QSize>
class QWidget;
class QPainter;
class QStyleOptionViewItem;
class QModelIndex;
namespace tlp {
class PropertyInterface;
class TLP_QT_SCOPE TulipItemEditorCreator {
public:
virtual ~TulipItemEditorCreator() {}
virtual QWidget* createWidget(QWidget*) const=0;
virtual bool paint(QPainter*, const QStyleOptionViewItem&, const QVariant&) const;
virtual QString displayText(const QVariant &) const {
return "";
}
virtual QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
virtual void setEditorData(QWidget*,const QVariant&,bool isMandatory,tlp::Graph* g=NULL)=0;
virtual QVariant editorData(QWidget*,tlp::Graph* g=NULL)=0;
virtual void setPropertyToEdit(tlp::PropertyInterface*) {}
};
template<typename T>
class TLP_QT_SCOPE StringDisplayEditorCreator: public TulipItemEditorCreator {
public:
inline QString displayText(const QVariant& v) const {
return QString::fromUtf8(T::toString(v.value<typename T::RealType>()).c_str());
}
};
class TLP_QT_SCOPE ColorEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
bool paint(QPainter*, const QStyleOptionViewItem&, const QVariant&) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
};
template<typename T>
class LineEditEditorCreator: public StringDisplayEditorCreator<T> {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
};
template<typename T>
class MultiLinesEditEditorCreator: public StringDisplayEditorCreator<T> {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
bool paint(QPainter*, const QStyleOptionViewItem&, const QVariant&) const;
};
class TLP_QT_SCOPE BooleanEditorCreator: public TulipItemEditorCreator {
public:
virtual QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*,const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE CoordEditorCreator: public StringDisplayEditorCreator<tlp::PointType> {
bool editSize;
public:
CoordEditorCreator():editSize(false) {}
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual void setPropertyToEdit(tlp::PropertyInterface* prop);
};
template<typename PROP>
class PropertyEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE PropertyInterfaceEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE NumericPropertyEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE ColorScaleEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
bool paint(QPainter*, const QStyleOptionViewItem&, const QVariant&) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
};
class TLP_QT_SCOPE StringCollectionEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE TulipFileDescriptorEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual bool paint(QPainter *, const QStyleOptionViewItem &, const QVariant &) const;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
};
class TLP_QT_SCOPE TulipFontAwesomeIconCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual bool paint(QPainter *, const QStyleOptionViewItem &, const QVariant &) const;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
virtual QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE NodeShapeEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
virtual bool paint(QPainter*, const QStyleOptionViewItem&, const QVariant&) const;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
};
class TLP_QT_SCOPE EdgeExtremityShapeEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
virtual bool paint(QPainter*, const QStyleOptionViewItem&, const QVariant&) const;
QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const;
};
class TLP_QT_SCOPE EdgeShapeEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
virtual void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
virtual QVariant editorData(QWidget*,tlp::Graph*);
virtual QString displayText(const QVariant &) const;
};
template<typename ElementType>
class VectorEditorCreator : public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget* parent) const;
virtual void setEditorData(QWidget* editor, const QVariant& data,bool,tlp::Graph*);
virtual QVariant editorData(QWidget* editor,tlp::Graph*);
virtual QString displayText(const QVariant &data) const;
};
class QVectorBoolEditorCreator : public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget* parent) const;
virtual void setEditorData(QWidget* editor, const QVariant& data,bool,tlp::Graph*);
virtual QVariant editorData(QWidget* editor,tlp::Graph*);
virtual QString displayText(const QVariant &data) const;
};
class TLP_QT_SCOPE TulipFontEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget*) const;
void setEditorData(QWidget*, const QVariant&,bool,tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE TulipLabelPositionEditorCreator: public tlp::TulipItemEditorCreator {
static QVector<QString> POSITION_LABEL;
public:
QWidget* createWidget(QWidget*) const;
void setEditorData(QWidget*w, const QVariant&var, bool, tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE GraphEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget* parent) const;
void setEditorData(QWidget*w, const QVariant&var, bool, tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE EdgeSetEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget* parent) const;
void setEditorData(QWidget*w, const QVariant&var, bool, tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE QStringEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget* parent) const;
void setEditorData(QWidget*w, const QVariant&var, bool, tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
void setPropertyToEdit(tlp::PropertyInterface* prop);
protected:
std::string propName;
};
class TLP_QT_SCOPE StdStringEditorCreator: public QStringEditorCreator {
public:
void setEditorData(QWidget*w, const QVariant&var, bool, tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
};
class TLP_QT_SCOPE QStringListEditorCreator: public tlp::TulipItemEditorCreator {
public:
QWidget* createWidget(QWidget* parent) const;
void setEditorData(QWidget*w, const QVariant& var, bool, tlp::Graph*);
QVariant editorData(QWidget*,tlp::Graph*);
QString displayText(const QVariant &) const;
};
}
#if defined(__clang__)
template class tlp::StringDisplayEditorCreator<tlp::PointType>;
template class tlp::StringDisplayEditorCreator<tlp::SizeType>;
#endif
#include "cxx/TulipItemEditorCreators.cxx"
#endif // TULIPITEMEDITORCREATORS_H
///@endcond
|