INTERFACE CosPropertyService;

TYPE TObject = RECORD
	aSBH : ilu.CString,
	aType : ilu.CString
	END;
TYPE TMimeObject = RECORD
	aContent-Type : ilu.CString,
	aBody : Any
	END;
TYPE anyType = ENUMERATION Any-void, Any-long, Any-ulong, Any-short, Any-boolean, Any-float, Any-char, Any-string, Any-Object, Any-PropertySet, Any-sequenceAny, Any-MimeObject, Any-Properties END;
TYPE AnonType-1- = SEQUENCE OF Any;
TYPE Any = anyType UNION
	a-void : SHORT INTEGER = 0 END,
	a-long : INTEGER = 1 END,
	a-ulong : CARDINAL = 2 END,
	a-short : SHORT INTEGER = 3 END,
	a-boolean : BOOLEAN = 4 END,
	a-float : SHORT REAL = 5 END,
	a-char : SHORT CHARACTER = 6 END,
	a-string : ilu.CString = 7 END,
	a-object : TObject = 8 END,
	a-propertyset : PropertySet = 9 END,
	a-sequenceany : AnonType-1- = 10 END,
	a-mime : TMimeObject = 11 END,
	a-proplist : Properties = 12 END
	END;
TYPE PropertyName = ilu.CString;
TYPE Property = RECORD
	property-name : PropertyName,
	property-value : Any
	END;
TYPE PropertyModeType = ENUMERATION normal, read-only, fixed-normal, fixed-readonly, undefined END;
TYPE PropertyDef = RECORD
	property-name : PropertyName,
	property-value : Any,
	property-mode : PropertyModeType
	END;
TYPE PropertyMode = RECORD
	property-name : PropertyName,
	property-mode : PropertyModeType
	END;
TYPE PropertyNames = SEQUENCE OF PropertyName;
TYPE Properties = SEQUENCE OF Property;
TYPE PropertyDefs = SEQUENCE OF PropertyDef;
TYPE PropertyModes = SEQUENCE OF PropertyMode;
TYPE PropertyTypes = SEQUENCE OF PropertyModeType;
EXCEPTION ConstraintNotSupported;
EXCEPTION InvalidPropertyName;
EXCEPTION ConflictingProperty;
EXCEPTION PropertyNotFound;
EXCEPTION UnsupportedTypeCode;
EXCEPTION UnsupportedProperty;
EXCEPTION UnsupportedMode;
EXCEPTION FixedProperty;
EXCEPTION ReadOnlyProperty;
TYPE ExceptionReason = ENUMERATION invalid-property-name, conflicting-property, property-not-found, unsupported-type-code, unsupported-property, unsupported-mode, fixed-property, read-only-property END;
TYPE PropertyException = RECORD
	reason : ExceptionReason,
	failing-property-name : PropertyName
	END;
TYPE PropertyExceptions = SEQUENCE OF PropertyException;
TYPE R-MultipleExceptions = RECORD
	exceptions : PropertyExceptions
	END;
EXCEPTION MultipleExceptions : R-MultipleExceptions;
TYPE PropertySetFactory = OBJECT OPTIONAL
	METHODS
		create-propertyset () : PropertySet,
		create-constrained-propertyset (allowed-property-types : PropertyTypes, allowed-properties : Properties) : PropertySet
			RAISES ConstraintNotSupported END,
		create-initial-propertyset (initial-properties : Properties) : PropertySet
			RAISES MultipleExceptions END
	END;
TYPE PropertySetDefFactory = OBJECT OPTIONAL
	METHODS
		create-propertysetdef () : PropertySetDef,
		create-constrained-propertysetdef (allowed-property-types : PropertyTypes, allowed-property-defs : PropertyDefs) : PropertySetDef
			RAISES ConstraintNotSupported END,
		create-initial-propertysetdef (initial-property-defs : PropertyDefs) : PropertySetDef
			RAISES MultipleExceptions END
	END;
TYPE PropertySet = OBJECT OPTIONAL
	METHODS
		define-property (property-name : PropertyName, property-value : Any)
			RAISES InvalidPropertyName, ConflictingProperty, UnsupportedTypeCode, UnsupportedProperty, ReadOnlyProperty END,
		define-properties (nproperties : Properties)
			RAISES MultipleExceptions END,
		get-number-of-properties () : CARDINAL,
		get-all-property-names (how-many : CARDINAL, OUT property-names : PropertyNames, OUT rest : PropertyNamesIterator),
		get-property-value (property-name : PropertyName) : Any
			RAISES PropertyNotFound, InvalidPropertyName END,
		get-properties (property-names : PropertyNames, OUT nproperties : Properties) : BOOLEAN,
		get-all-properties (how-many : CARDINAL, OUT nproperties : Properties, OUT rest : PropertiesIterator),
		delete-property (property-name : PropertyName)
			RAISES PropertyNotFound, InvalidPropertyName, FixedProperty END,
		delete-properties (property-names : PropertyNames)
			RAISES MultipleExceptions END,
		delete-all-properties () : BOOLEAN,
		is-property-defined (property-name : PropertyName) : BOOLEAN
			RAISES InvalidPropertyName END
	END;
TYPE PropertySetDef = OBJECT OPTIONAL
	SUPERCLASS PropertySet
	METHODS
		get-allowed-property-types (OUT property-types : PropertyTypes),
		get-allowed-properties (OUT property-defs : PropertyDefs),
		define-property-with-mode (property-name : PropertyName, property-value : Any, property-mode : PropertyModeType)
			RAISES InvalidPropertyName, ConflictingProperty, UnsupportedTypeCode, UnsupportedProperty, UnsupportedMode, ReadOnlyProperty END,
		define-properties-with-modes (property-defs : PropertyDefs)
			RAISES MultipleExceptions END,
		get-property-mode (property-name : PropertyName) : PropertyModeType
			RAISES PropertyNotFound, InvalidPropertyName END,
		get-property-modes (property-names : PropertyNames, OUT property-modes : PropertyModes) : BOOLEAN,
		set-property-mode (property-name : PropertyName, property-mode : PropertyModeType)
			RAISES InvalidPropertyName, PropertyNotFound, UnsupportedMode END,
		set-property-modes (property-modes : PropertyModes)
			RAISES MultipleExceptions END
	END;
TYPE PropertyNamesIterator = OBJECT OPTIONAL
	METHODS
		reset (),
		next-one (OUT property-name : PropertyName) : BOOLEAN,
		next-n (how-many : CARDINAL, OUT property-names : PropertyNames) : BOOLEAN,
		destroy ()
	END;
TYPE PropertiesIterator = OBJECT OPTIONAL
	METHODS
		reset (),
		next-one (OUT aproperty : Property) : BOOLEAN,
		next-n (how-many : CARDINAL, OUT nproperties : Properties) : BOOLEAN,
		destroy ()
	END;