51 #include "elementInput.hh"
52 #include "elementOutput.hh"
53 #include "sceneElement.hh"
54 #include "connectionPoint.hh"
55 #include "connection.hh"
56 #include "graphicsScene.hh"
58 #include "../parser/element.hh"
59 #include "../parser/context.hh"
60 #include "../parser/type.hh"
61 #include "../parser/typeWidget.hh"
80 if (
state () & Input::Optional)
82 else if (
state () & Input::NoUserInput)
125 if (
isSet () || !(
state () & Input::NoRuntimeUserInput) ||
state () & Input::Optional)
136 return in_->state ();
162 else if (
state () & Input::Optional && !forceAsk_)
166 else if (
state () & Input::NoUserInput)
189 else if (
state () & Input::Optional && !forceAsk_)
193 else if (
state () & Input::NoUserInput)
208 if ((
state () & Input::NoRuntimeUserInput) && (
state () & Input::NoExternalInput))
220 QDomElement main = _doc.createElement(
"input");
221 _root.appendChild(main);
222 main.setAttribute (
"name",in_->
name ());
225 QDomElement
set = _doc.createElement(
"is_set");
226 main.appendChild(set);
227 t = _doc.createTextNode(isSet_ ?
"true" :
"false");
230 if (
state () & Input::Optional && forceAsk_)
232 QDomElement fA = _doc.createElement(
"force_ask");
233 main.appendChild(fA);
234 t = _doc.createTextNode(isSet_ ?
"true" :
"false");
240 QDomElement val = _doc.createElement(
"value");
241 main.appendChild(val);
242 t = _doc.createTextNode(value_);
248 QDomElement conn = _doc.createElement(
"connection");
249 main.appendChild(conn);
251 conn.setAttribute (
"element_id",QString::number (c->
output ()->
element ()->
id ()));
267 if (
state () & Input::Optional)
280 else if (
state () & Input::Optional && !forceAsk_)
284 else if (
state () & Input::NoUserInput)
298 if (value_ != _value)
int id()
Unique id for identification.
void addConnection(Connection *_conn)
Add connection.
void loadFromXml(QXmlQuery &_xml)
Load from xml.
void saveToXml(QDomDocument &_doc, QDomElement &_root)
Save to xml.
bool valid()
Returns state of valid flag (needed during code generation)
static bool strToBool(QString _str)
Converts the given string to bool.
virtual void removeConnection(Connection *_conn)
Remove the Connection.
void setBackground(bool _leftOut, bool _rightOut)
Enables background painting.
const QString & name() const
Name.
void setWidth(int _width)
Sets the diameter.
InOut * inOut() const
InOut context object.
const Element * element() const
Element of this input/output.
void setState(State _state)
sets the state
Text * descriptionTextItem() const
Short description widget.
static QString getXmlString(QXmlQuery &_xml, QString _expr, QString _default="")
Gets the string of a xml query.
bool isSet()
Return "set" flag.
virtual void setBackgroundBrush(QBrush _brush)
Sets the background brush.
Context * context() const
Context of element.
QString name() const
Element name.
ElementInput(Input *_in, SceneElement *_parent)
Constructor.
QList< Connection * > connections() const
Connections.
ConnectionPoint * connectionPointItem() const
Connection point widget.
GraphicsScene * graphicsScene()
Scene.
SceneElement * element()
Scene element.
void setValue(QString _value)
Set to a user value.
Element * element() const
Context VSI::Element.
virtual void addConnection(Connection *_conn)
Add the connection.
void contentChange()
handle content changes
virtual TypeWidget * widget(QMap< QString, QString >, QString, QWidget *=NULL)
Returns the configuration widget.
void removeConnection(Connection *_conn)
Remove connection.
ElementOutput * output()
Output of this connection.
virtual QString toValue()=0
Return the type configuration result to a string.
Text * typeTextItem() const
Type text widget.
unsigned int state()
VSI::Input state passthrough.
void set(bool _set)
"Set" flag to mark input as set by user
Type * getType(QString _type)
Get type object for given type name.
~ElementInput()
Destructor.