31 #include <boost/tokenizer.hpp>
34 #include "exceptions/WPropertyUnknown.h"
36 #include "WPropertyHelper.h"
38 #include "WPropertyGroup.h"
60 return boost::shared_ptr< WPropertyGroup >(
new WPropertyGroup( *
this ) );
89 template<
typename T >
90 T _addDefaultConstraints(
T prop )
104 WPropSelection _addDefaultConstraints( WPropSelection prop )
119 WPropFilename _addDefaultConstraints( WPropFilename prop )
134 template<
typename T >
135 T addDefaultConstraints(
T prop )
137 if( prop->getPurpose() == PV_PURPOSE_INFORMATION )
142 return _addDefaultConstraints( prop );
168 prop->set( *it, recommendedOnly );
173 return ( c == r->get().size() );
185 l->get().erase( std::remove( l->get().begin(), l->get().end(), prop ), l->get().end() );
191 WPropGroup p = WPropGroup(
new WPropertyGroup( name, description ) );
192 p->setHidden( hide );
212 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_BOOL >( name, description, initial, hide ) );
217 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_INT >( name, description, initial, hide ) );
222 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_DOUBLE >( name, description, initial, hide ) );
227 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_STRING >( name, description, initial, hide ) );
232 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_PATH >( name, description, initial, hide ) );
237 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_SELECTION >( name, description, initial, hide ) );
242 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_POSITION >( name, description, initial, hide ) );
247 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_COLOR >( name, description, initial, hide ) );
252 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_TRIGGER >( name, description, initial, hide ) );
263 boost::shared_ptr< WCondition > condition,
bool hide )
265 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_BOOL >( name, description, initial, condition, hide ) );
269 boost::shared_ptr< WCondition > condition,
bool hide )
271 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_INT >( name, description, initial, condition, hide ) );
275 boost::shared_ptr< WCondition > condition,
bool hide )
277 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_DOUBLE >( name, description, initial, condition, hide ) );
281 boost::shared_ptr< WCondition > condition,
bool hide )
283 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_STRING >( name, description, initial, condition, hide ) );
287 boost::shared_ptr< WCondition > condition,
bool hide )
289 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_PATH >( name, description, initial, condition, hide ) );
293 boost::shared_ptr< WCondition > condition,
bool hide )
295 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_SELECTION >( name, description, initial, condition, hide ) );
299 boost::shared_ptr< WCondition > condition,
bool hide )
301 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_POSITION >( name, description, initial, condition, hide ) );
305 boost::shared_ptr< WCondition > condition,
bool hide )
307 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_COLOR >( name, description, initial, condition, hide ) );
311 boost::shared_ptr< WCondition > condition,
bool hide )
313 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_TRIGGER >( name, description, initial, condition, hide ) );
326 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_BOOL >( name, description, initial, notifier, hide ) );
332 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_INT >( name, description, initial, notifier, hide ) );
338 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_DOUBLE >( name, description, initial, notifier, hide ) );
344 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_STRING >( name, description, initial, notifier, hide ) );
350 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_PATH >( name, description, initial, notifier, hide ) );
356 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_SELECTION >( name, description, initial, notifier, hide ) );
362 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_POSITION >( name, description, initial, notifier, hide ) );
368 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_COLOR >( name, description, initial, notifier, hide ) );
374 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_TRIGGER >( name, description, initial, notifier, hide ) );
386 boost::shared_ptr< WCondition > condition,
389 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_BOOL >( name, description, initial, condition, notifier, hide ) );
393 boost::shared_ptr< WCondition > condition,
396 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_INT >( name, description, initial, condition, notifier, hide ) );
400 boost::shared_ptr< WCondition > condition,
403 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_DOUBLE >( name, description, initial, condition, notifier, hide ) );
407 boost::shared_ptr< WCondition > condition,
410 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_STRING >( name, description, initial, condition, notifier, hide ) );
414 boost::shared_ptr< WCondition > condition,
417 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_PATH >( name, description, initial, condition, notifier, hide ) );
421 boost::shared_ptr< WCondition > condition,
424 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_SELECTION >( name, description, initial, condition, notifier, hide ) );
428 boost::shared_ptr< WCondition > condition,
431 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_POSITION >( name, description, initial, condition, notifier, hide ) );
435 boost::shared_ptr< WCondition > condition,
438 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_COLOR >( name, description, initial, condition, notifier, hide ) );
442 boost::shared_ptr< WCondition > condition,
445 return addDefaultConstraints( addProperty< WPVBaseTypes::PV_TRIGGER >( name, description, initial, condition, notifier, hide ) );