I love the smell of UnrealEd crashing in the morning. – tarquin

UE3:UIDataProvider (UDK)

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
UDK Object >> UIRoot >> UIDataProvider
Package: 
Engine
Direct subclasses:
UIConfigProvider, UIDataProvider_OnlinePlayerDataBase, UIDataProvider_OnlinePlayerStorageArray, UIDataProvider_SettingsArray, UIDataStore, UIDynamicFieldProvider, UIPropertyDataProvider, UIResourceCombinationProvider, UTUIDataProvider_Character, UTUIDataProvider_CharacterFaction, UTUIDataProvider_SimpleElementProvider
This class in other games:
UT3

Base class for all classes which provide data stores with data about specific instances of a particular data type.

Properties[edit]

ProviderChangedNotifies[edit]

Type: array<delegate<OnDataProviderPropertyChange> >

Modifiers: protected, transient

The list of delegates to call when data exposed by this provider has been updated.

Todo: change into a map of property name => delegate, so that when a property name is passed to NotifyPropertyChanged, only those delegates are called.

WriteAccessType[edit]

Type: EProviderAccessType

Determines whether/how subscribers to this data store are allowed to publish changes to property values.

Enums[edit]

EProviderAccessType[edit]

Types of write access that data providers can specify.

ACCESS_ReadOnly 
no fields are writeable - readonly
ACCESS_PerField 
write-access is controlled per field
ACCESS_WriteAll 
all fields are writeable

Structs[edit]

UIDataProviderField[edit]

Modifiers: native, transient

Contains data about a single data field exposed by this data provider.

name FieldTag 
the tag used to access this field
UIRoot.EUIDataProviderFieldType FieldType 
the type of field this tag corresponds to
array<UIDataProvider> FieldProviders 
The list of providers associated with this field. Only relevant if FieldType is DATATYPE_Provider or

DATATYPE_ProviderCollection. If FieldType is DATATYPE_Provider, the list should contain only one element.

Delegates[edit]

OnDataProviderPropertyChange[edit]

delegate transient OnDataProviderPropertyChange (UIDataProvider SourceProvider, optional name PropTag)

Delegate that notifies that a property has changed Intended only for use between data providers and their owning data stores. For external notifications, use the callbacks in UIDataStore instead.

Parameters:

  • SourceProvider - the data provider that generated the notification
  • PropTag - the property that changed

Functions[edit]

Native functions[edit]

GetProviderFieldType[edit]

native final function bool GetProviderFieldType (coerce string DataTag, out UIRoot.EUIDataProviderFieldType out_ProviderFieldType)

Retrieves the field type for the specified field

Parameters:

  • DataTag - the tag corresponding to the data field that we want the field type for
  • out_ProviderFieldType - will receive the fieldtype for the data field specified; if DataTag isn't supported by this provider, this value will not be modified.

Returns:

TRUE if the field specified is supported and out_ProviderFieldType was changed to the correct type.

ParseArrayDelimiter[edit]

native function int ParseArrayDelimiter (out string DataTag) const

Parses the string specified, separating the array index portion from the data field tag.

Parameters:

  • DataTag - the data tag that possibly contains an array index

Returns:

the array index that was parsed from DataTag, or INDEX_NONE if there was no array index in the string specified.

Events[edit]

AllowPublishingToField[edit]

event bool AllowPublishingToField (string FieldName, optional int ArrayIndex)

Callback for allowing script-only children to specify whether modification of a particular field is allowed. This callback will only be called if the provider's WriteAccessType is ACCESS_PerField.

Child classes should override this function to indicate which fields can be written to, if this provider's WriteAccessType is set to ACCESS_PerField. Otherwise, write access will not be allowed to any fields.

Parameters:

  • FieldName - the name of the field [within this provider] for the field to check
  • ArrayIndex - optional array index for use with data collections.

Returns:

TRUE if publishing data (change the value for) the field is allowed.

GenerateFillerData[edit]

event string GenerateFillerData (string DataTag)

Callback to allow script-only child classes to return filler data for their own data fields.

Parameters:

  • DataTag - the tag corresponding to the data field that we want filler data for

Returns:

a string of made-up data which is indicative of the typical values for the specified field.

GenerateScriptMarkupString[edit]

event string GenerateScriptMarkupString (name DataTag)

Callback to allow script-only child classes to generate a markup string for their own data fields. Called from the native implementation of GenerateDataMarkupString if the tag specified doesn't correspond to any tags in the data store.

Parameters:

  • DataTag - the data field tag to generate the markup string for

Returns:

a datastore markup string which resolves to the datastore field associated with DataTag, in the format: <DataStoreTag:DataFieldTag>

GetFieldValue[edit]

event bool GetFieldValue (string FieldName, out UIRoot.UIProviderScriptFieldValue FieldValue, optional int ArrayIndex)

Resolves the value of the data field specified and stores it in the output parameter.

Parameters:

  • FieldName - the data field to resolve the value for; guaranteed to correspond to a property that this provider can resolve the value for (i.e. not a tag corresponding to an internal provider, etc.)
  • out_FieldValue - receives the resolved value for the property specified.
  • ArrayIndex - optional array index for use with data collections

Returns:

TRUE to indicate that this value was processed by script.

See: ParseDataStoreReference for additional notes

GetSupportedScriptFields[edit]

event GetSupportedScriptFields (out array<UIDataProviderFieldout_Fields)

Callback to allow script-only child classes to add their own supported tags when GetSupportedDataFields is called.

Parameters:

  • out_Fields - the list of data tags supported by this data store.

IsCollectionDataType[edit]

event bool IsCollectionDataType (UIRoot.EUIDataProviderFieldType FieldType)

Wrapper for determining whether the specified field type represents a collection of data.

IsProviderDisabled[edit]

event bool IsProviderDisabled ()

Allows a data provider instance to indicate that it should be unselectable in lists

Returns:

FALSE to indicate that list elements which represent this data provider should be considered unselectable or otherwise disabled (though it will still appear in the list).

NotifyPropertyChanged[edit]

event NotifyPropertyChanged (optional name PropTag)

Iterates over the list of subscribed delegates and fires off the event. Called whenever the value of a field managed by this data provider is modified.

Parameters:

  • PropTag - the name of the property that changed

SetFieldValue[edit]

event bool SetFieldValue (string FieldName, const out UIRoot.UIProviderScriptFieldValue FieldValue, optional int ArrayIndex)

Resolves the value of the data field specified and stores the value specified to the appropriate location for that field. Only called if WriteAccessType is ACCESS_WriteAll or AllowsPublishingToField returns TRUE.

Parameters:

  • FieldName - the data field to resolve the value for; guaranteed to correspond to a property that this provider can resolve the value for (i.e. not a tag corresponding to an internal provider, etc.)
  • FieldValue - the value to store for the property specified.
  • ArrayIndex - optional array index for use with data collections

Returns:

TRUE to indicate that this value was processed by script.

Other instance functions[edit]

AddPropertyNotificationChangeRequest[edit]

final function bool AddPropertyNotificationChangeRequest (delegate<OnDataProviderPropertyChangeInDelegate, optional bool bAllowDuplicates)

Subscribes a function for receiving notifications that a property in this data provider has changed. Intended only for use between data providers and their owning data stores. For external notifications, use the callbacks in UIDataStore instead.

Parameters:

  • InDelegate - the delegate to add to the notification list

ParseTagArrayDelimiter[edit]

final function int ParseTagArrayDelimiter (out name FieldName)

Wrapper for ParseArrayDelimiter that takes a name parameter.

RemovePropertyNotificationChangeRequest[edit]

final function bool RemovePropertyNotificationChangeRequest (delegate<OnDataProviderPropertyChangeInDelegate)

Removes the delegate from the notification list

Parameters:

  • InDelegate - the delegate to remove from the list