18#include "kis_filter.h"
24#include "kis_filter_registry.h"
25#include "kis_transaction.h"
26#include "kis_undo_adapter.h"
27#include "kis_painter.h"
28#include "kis_selection.h"
30#include "kis_canvas_subject.h"
31#include "kis_progress_display_interface.h"
33#include "kis_filter_config_widget.h"
39 m_version = rhs.m_version;
40 m_properties = rhs.m_properties;
49 TQDomElement e = doc.documentElement();
50 TQDomNode n = e.firstChild();
52 m_name = e.attribute( "name");
53 m_version = e.attribute( "version").toInt();
57 TQDomElement e = n.toElement();
63 if (e.tagName() == "property") {
64 name = e.attribute( "name");
65 type = e.attribute( "type");
68 m_properties[ name] = TQVariant(value);
78 TQDomDocument doc = TQDomDocument( "filterconfig");
79 TQDomElement root = doc.createElement( "filterconfig" );
80 root.setAttribute( "name", m_name );
81 root.setAttribute( "version", m_version );
83 doc.appendChild( root );
85 TQStringVariantMap::Iterator it;
86 for ( it = m_properties.begin(); it != m_properties.end(); ++it ) {
87 TQDomElement e = doc.createElement( "property" );
88 e.setAttribute( "name", it.key().latin1() );
89 TQVariant v = it.data();
90 e.setAttribute( "type", v.typeName() );
91 TQString s = v.asString();
92 TQDomText text = doc.createCDATASection(v.asString() );
97 return doc.toString();
112 if ( m_properties.find( name ) == m_properties.end() ) {
113 m_properties.insert( name, value );
116 m_properties[ name] = value;
122 if ( m_properties.find( name ) == m_properties.end() ) {
126 value = m_properties[ name];
133 if ( m_properties.find( name ) == m_properties.end() ) {
137 return m_properties[ name];
142int KisFilterConfiguration::getInt( const TQString & name, int def)
152double KisFilterConfiguration::getDouble( const TQString & name, double def)
161bool KisFilterConfiguration::getBool( const TQString & name, bool def)
170TQString KisFilterConfiguration::getString( const TQString & name, TQString def)
179void KisFilterConfiguration::dump()
181 TQStringVariantMap::Iterator it;
182 for ( it = m_properties.begin(); it != m_properties.end(); ++it ) {
const TQString & name() const Get the unique, language independent name of the filter.
virtual void setProperty(const TQString &name, const TQVariant &value) Set the property with name to value.
virtual bool getProperty(const TQString &name, TQVariant &value) Set value to the value associated with property name.
TQ_INT32 version() const Get the version of the filter that has created this config.
KisFilterConfiguration(const TQString &name, TQ_INT32 version) Create a new filter config.
virtual TQString toString() Create a serialized version of this filter config.
virtual void fromXML(const TQString &) Fill the filter configuration object from the XML encoded representation in s.
|