Destribes minimum required functionality of single state property to be correctly processed in Form Builder.
You can find more information in comments below.
class IProperty
{
public:
virtual IPropertyList *getPropertyList() = 0; // Return property list containing the property
virtual IClass *getParent() = 0; // Return owner of the property
virtual String getName() = 0; // Return name
virtual String getPropertyHandlerName() = 0; // Return name of property handler which can edit this property
virtual String getPreview() = 0; // Return preview of property value
virtual String getPreview(const String &state) = 0; // Return preview by state
virtual bool isChanged() = 0; // Return whether current value differs from one which was when property was created
virtual bool isSkip() = 0; // Return whether property should be skipped when saving in Form Builder
virtual bool isAffectItems() = 0; // Whether property change may affect control list items. By default false. If true, the Form Builder will perform list items(tree) update after property changes. Used only for components and controls(not for IListItem)
virtual void setParent(IClass *parent) = 0; // Set owner. Do not set null or object which is incompatible with prev parent. No checks are performed. Currently used only in saving list items to check if list item was changed(differs from same list item just created)
virtual IProperty *setAffectItems(const bool value) = 0; // Set whether changing the property affects on owner list items
virtual IProperty *setChanged(const bool value) = 0; // Mark as changed/unchanged
virtual void Release() = 0; // Destroy instance
virtual bool Copy(IProperty *dest) = 0; // Copy to destination. Can copy only if dest has same type(could be casted to same type). Copy only value part
virtual void Save(Variant &dest) = 0; // Save to Variant
virtual void Load(const Variant &src) = 0; // Load from Variant
/**
Should output property as c++ code(like setColor({255, 0, 0, 55});)
@param f File stream
@param shift Just a spaces for good code alignment. Add it to output
@param control Control/Component name
*/
virtual void Export(std::wofstream &f, const String &shift, const String &control) = 0;
};
Namespace: | nitisa |
Include: | Nitisa/Interfaces/IProperty.h |