#include <datadescriptiondefinitiondatabase.h>
DataDescriptionDefinitionDatabaseInterface provides functions for loading, storing DescriptionDefinitions.
Public Member Functions | |
MAXON_OBSERVABLE_STATIC (Result< void >, ObservableSaveDatabase,(const Id &databaseId, const Url &dataBaseUrl, Bool beforeSave), ObservableCombinerRunAllComponent) | |
MAXON_OBSERVABLE_STATIC (Result< void >, ObservableDatabaseRegistrationChange,(const Id &databaseId, Bool added), ObservableCombinerRunAllComponent) | |
Static Public Member Functions | |
static MAXON_METHOD Result< DataDescriptionDefinition > | LoadDescription (LOADDESCRIPTIONMODE mode, const Id &category, const LanguageRef &language, const IdAndVersion &dataType, Id *foundInDatabase=nullptr) |
static MAXON_METHOD Result< void > | StoreDescription (const Id &databaseId, const Id &category, const LanguageRef &language, const IdAndVersion &dataType, const DataDescriptionDefinition &description, const DataDescriptionDefinition &overwrittenDescription, Bool usePendingSystem) |
static MAXON_METHOD Result< Bool > | DeleteDescription (const Id &category, const LanguageRef &language, const IdAndVersion &dataType) |
static MAXON_METHOD Result< BaseArray< IdAndVersion > > | GetRegisteredDescriptions (const Id &databaseId, const Id &category, const LanguageRef &language) |
static MAXON_METHOD Result< void > | WriteDataBases () |
static MAXON_METHOD Bool | QueryNeedsWriteDataBases () |
static MAXON_METHOD Result< Int > | RenameId (const Id &oldId, const Id &newId) |
static MAXON_METHOD Result< Int > | RenameAttribute (const InternedId &oldId, const InternedId &newId) |
static MAXON_METHOD Result< Bool > | CheckUniqueAttributeName (const InternedId &searchId) |
static MAXON_METHOD Result< DataDescription > | UpdateDescription (const Id &databaseId, const Id &category, const LanguageRef &language, const IdAndVersion &dataType, DataDescriptionDefinition &descRef, Bool notifyParents) |
static MAXON_METHOD Result< DataDescription > | UpdateDescriptionI (const Id &databaseId, const Id &category, const LanguageRef &language, DataDescriptionDefinition &descRef, const IdAndVersion &dataType) |
static MAXON_METHOD Result< void > | RegisterDatabaseWithUrl (const Id &databaseId, const Url &url) |
static MAXON_METHOD Result< void > | RegisterDatabase (const Id &databaseId, const DataDescriptionDefinitionDatabaseImplRef &ddb) |
static MAXON_METHOD Result< void > | UnregisterDatabase (const Id &databaseId) |
static MAXON_METHOD Bool | IsWritableDatabase (const Id &databaseId, const Id &languageId) |
static MAXON_METHOD Result< BaseArray< Id > > | GetRegisteredDatabases () |
static MAXON_METHOD Result< DataDescription > | BuildDescription (const Id &category, const IdAndVersion &dataTypeId, const LanguageRef &language) |
static MAXON_METHOD Result< void > | RegisterMessage (const Id &dataTypeId, const Id &attributeId, const Id &cmdId, const DescriptionMessageFunction &func) |
static MAXON_METHOD DescriptionMessageFunction * | FindNodeMessage (const Id &dataTypeId, const Id &attributeId, const Id &cmdId) |
static MAXON_METHOD Result< void > | FixDatabaseProps (DBVERSION version, DataDictionary &entry) |
Private Member Functions | |
MAXON_INTERFACE_NONVIRTUAL (DataDescriptionDefinitionDatabaseInterface, MAXON_REFERENCE_NONE, "net.maxon.interface.datadescriptiondefinitiondatabase") | |
|
private |
|
static |
Loads a description from the registered databases.
[in] | category | Database category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI). |
[in] | language | Language (only valid for category DATADESCRIPTION_CATEGORY_STRING). |
[in] | dataType | Data type id to load. |
[out] | foundInDatabase | Optional: Pointer to an Id of the database where the entry was found. |
|
static |
Stores the given description under the given values.
[in] | databaseId | Data base id (see RegisterDatabase()/GetRegisteredDatabases()). |
[in] | category | Database category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI). |
[in] | language | Language (only valid for category DATADESCRIPTION_CATEGORY_STRING). |
[in] | dataType | Data type id to store. |
[in] | description | Description data to store. |
|
static |
DeleteDescription deletes a description from the database.
[in] | category | Database category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI). |
[in] | language | Language (only valid for category DATADESCRIPTION_CATEGORY_STRING). |
[in] | dataType | Data type id to delete. |
|
static |
Return all registered descriptions.
[in] | databaseId | Unique id for the database. If Id() is given the result of all databases will be returned. |
[in] | category | Database category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI). |
[in] | language | Language (only valid for category DATADESCRIPTION_CATEGORY_STRING). |
|
static |
Save all databases.
|
static |
QueryNeedsWriteDataBases returns true if changes to the databases are pending and not saved.
|
static |
Renames a id in all databases to the new id.
[in] | oldId | Old id to rename |
[in] | newId | Id to replace. |
|
static |
Renames an attribute in all databases.
[in] | oldId | Old attribute key. |
[in] | newId | New attribute key. |
|
static |
Checks if the given id is unique in all data bases.
[in] | searchId | Id to search for. |
|
static |
UpdateDescription description.
[in] | databaseId | Unique id for the database. |
[in] | category | Database category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI). |
[in] | language | Language (only valid for category DATADESCRIPTION_CATEGORY_STRING). |
[in] | dataType | Data type id to store. |
[in] | descRef | Description ref to connect the update observable with. |
[in] | notifyParents | True if parents should be notified. |
|
static |
UpdateDescription description.
[in] | databaseId | Unique id for the database. |
[in] | category | Database category (e.g. DATADESCRIPTION_CATEGORY_DATA / DATADESCRIPTION_CATEGORY_UI). |
[in] | language | Language (only valid for category DATADESCRIPTION_CATEGORY_STRING). |
[in] | descRef | Description ref to connect the update observable with. |
[in] | dataType | TODO: (Tilo) describe |
|
static |
Registers a data base for a specific module under the given url.
[in] | databaseId | Unique id for the database. |
[in] | url | Absolute url to look for the data base. |
|
static |
Registers a special data base DataDescriptionDefinitionDatabaseImplRef under the given id.
[in] | databaseId | Unique id for the database. |
[in] | ddb | Data base implementation to register. |
|
static |
Unregisters the database from the system.
[in] | databaseId | Unique id of the database. |
|
static |
Returns true if the database is writable.
[in] | databaseId | Unique id of the database. |
[in] | languageId | Language id to check. |
|
static |
Returns the ids and urls of all registered databases.
|
static |
Updates the description from the definition for the given type.
[in] | dataTypeId | DataType id to check |
|
static |
|
static |
|
static |
Fixes an entry of the resource database.
[in] | version | last converted version. |
[in] | entry | DataDictionary to convert. |
MAXON_OBSERVABLE_STATIC | ( | Result< void > | , |
ObservableSaveDatabase | , | ||
(const Id &databaseId, const Url &dataBaseUrl, Bool beforeSave) | , | ||
ObservableCombinerRunAllComponent | |||
) |
ObservableSaveDatabase will be triggered before and after a database is/was written. This can be used to add source control callbacks etc.