Rogue Wave Views 5.6 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
User interface class. More...
#include <ilviews/dataccess/reposit.h>
Static Public Member Functions | |
static IliDataSource * | FindDataSource (const char *dataSourceName, IlvGraphicHolder *holder) |
Attempts to find a registered data source. | |
static IliDataSource * | GetDataSource (IlInt index) |
Returns a registered data source. | |
static IlInt | GetDataSourcesCount () |
Returns the number of data sources that are currently registered. | |
static IlvSymbol * | GetScopeClass (IlvContainer *cont) |
Returns the scope class assigned to the container. | |
static IlBoolean | IsBadLicense () |
Returns IlTrue if the license is invalid. | |
static void | SetScopeClass (IlvContainer *cont, IlvSymbol *scopeClass) |
Sets the scope class of one container. | |
static void | SubscribeToDataSource (const char *dataSourceName, IliDataSourceCallback cb, IlvGraphic *subscriber, IlAny userData) |
Subscribes the graphic object to a data source. | |
static void | UnSubscribeToDataSource (const char *dataSourceName, IliDataSourceCallback cb, IlvGraphic *subscriber, IlAny userData) |
Unsubscribes the graphic object from a data source. |
User interface class.
Library: dataccess
The repository keeps track of all available data-sources. It can be used to find a data-source given its name or to enumerate all data-sources. For a more advanced usage, it can be used to subscribe a graphic object to a data-source. This may be useful when designing new graphic classes that need to be data-source aware.
About subscription A graphic object can subscribe itself to a data source name so that when a data source with that name becomes available, the graphic object will be notified. Similarly, if or when the data source is no longer available the graphic object will also be notified.
static IliDataSource* IliRepository::FindDataSource | ( | const char * | dataSourceName, | |
IlvGraphicHolder * | holder | |||
) | [static] |
Attempts to find a registered data source.
Attempts to find a registered data source according to the following rules:
name
exists in the given holder, this data source is returned. The data-source scope can be local or global. IlvContainer
and the container has been assigned a scope class (see the setScopeClass
static member function), all containers with the same scope class are considered. If a data source named name
exists in any of the containers, this data source is returned. The data-source scope can be local or global. If more than one data source matches, one is picked at random and is returned. IlvNotebook
gadget. Each notebook page contains a container.) If a data source named name
exists in any of these containers, this data source is returned. The data-source scope can be local or global. If more than one data source matches, one is picked at random and is returned. name
exists, this data source is returned. The data-source scope must be global. If more than one data source matches, one is picked at random and is returned. FindDataSource
static member function returns NULL
. dataSourceName | The data source name. | |
holder | The holder. |
static IliDataSource* IliRepository::GetDataSource | ( | IlInt | index | ) | [static] |
Returns a registered data source.
index | The data source index. |
NULL
if the index is out of bounds. static IlInt IliRepository::GetDataSourcesCount | ( | ) | [static] |
Returns the number of data sources that are currently registered.
static IlvSymbol* IliRepository::GetScopeClass | ( | IlvContainer * | cont | ) | [static] |
Returns the scope class assigned to the container.
Initially, the scope class of a container is NULL
.
cont | The container. |
static IlBoolean IliRepository::IsBadLicense | ( | ) | [static] |
Returns IlTrue
if the license is invalid.
IlTrue
if the license is invalid. static void IliRepository::SetScopeClass | ( | IlvContainer * | cont, | |
IlvSymbol * | scopeClass | |||
) | [static] |
Sets the scope class of one container.
This static member function should be called before any gadgets are added to the container or else the repository subscription mechanism may not function properly.
cont | The container. | |
scopeClass | The scope class, if NULL , the container is cleared from the previously set scope class. |
static void IliRepository::SubscribeToDataSource | ( | const char * | dataSourceName, | |
IliDataSourceCallback | cb, | |||
IlvGraphic * | subscriber, | |||
IlAny | userData | |||
) | [static] |
Subscribes the graphic object to a data source.
When such a data source becomes available, the callback function will be invoked with the following parameters:
cb(dataSource, subscriber, userData);
If the data source later goes out of scope, the callback function will be called again in the following way:
cb(NULL, subscriber, userData);
dataSourceName | The data source name. | |
cb | The callback. | |
subscriber | The graphic object which subscribes. | |
userData | The user data. |
static void IliRepository::UnSubscribeToDataSource | ( | const char * | dataSourceName, | |
IliDataSourceCallback | cb, | |||
IlvGraphic * | subscriber, | |||
IlAny | userData | |||
) | [static] |
Unsubscribes the graphic object from a data source.
The cb
and userData
parameter must match those that were given at subscription time. Note that if the subscriber has previously been notified of the presence of the data source then this member function will make the following call:
cb(NULL, subscriber, userData);
dataSourceName | The data source name. | |
cb | The callback. | |
subscriber | The graphic object which subscribes. | |
userData | The user data. |
© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.