rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

List of all members | Static Public Member Functions
IliRepository Class Reference

User interface class. More...

#include <ilviews/dataccess/reposit.h>

Static Public Member Functions

static IliDataSourceFindDataSource (const char *dataSourceName, IlvGraphicHolder *holder)
 Attempts to find a registered data source. More...
 
static IliDataSourceGetDataSource (IlInt index)
 Returns a registered data source. More...
 
static IlInt GetDataSourcesCount ()
 Returns the number of data sources that are currently registered. More...
 
static IlvSymbolGetScopeClass (IlvContainer *cont)
 Returns the scope class assigned to the container. More...
 
static IlBoolean IsBadLicense ()
 Returns IlTrue if the license is invalid. More...
 
static void SetScopeClass (IlvContainer *cont, IlvSymbol *scopeClass)
 Sets the scope class of one container. More...
 
static void SubscribeToDataSource (const char *dataSourceName, IliDataSourceCallback cb, IlvGraphic *subscriber, IlAny userData)
 Subscribes the graphic object to a data source. More...
 
static void UnSubscribeToDataSource (const char *dataSourceName, IliDataSourceCallback cb, IlvGraphic *subscriber, IlAny userData)
 Unsubscribes the graphic object from a data source. More...
 

Detailed Description

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.

See Also
IliDataSource, IliDataSourceCallback

Member Function Documentation

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:

  • Same Holder: If a data source named name exists in the given holder, this data source is returned. The data-source scope can be local or global.
  • Same Scope Class: If the holder belongs to an 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.
  • Same Container Hierarchy: If the holder is contained in another holder or if the holder itself contains other holders, all holders related directly or indirectly to the holder by the containment relation are considered. (For example, this situation occurs when you use an 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.
  • Global Scope: If a global data source named 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.
  • If none of the previous conditions are met, the FindDataSource static member function returns NULL.
Parameters
dataSourceNameThe data source name.
holderThe holder.
Returns
The data source.
static IliDataSource* IliRepository::GetDataSource ( IlInt  index)
static

Returns a registered data source.

Parameters
indexThe data source index.
Returns
The data source, or NULL if the index is out of bounds.
static IlInt IliRepository::GetDataSourcesCount ( )
static

Returns the number of data sources that are currently registered.

Returns
The count.
static IlvSymbol* IliRepository::GetScopeClass ( IlvContainer cont)
static

Returns the scope class assigned to the container.

Initially, the scope class of a container is NULL.

Parameters
contThe container.
Returns
The scope class.
static IlBoolean IliRepository::IsBadLicense ( )
static

Returns IlTrue if the license is invalid.

Returns
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.

Parameters
contThe container.
scopeClassThe 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);
Parameters
dataSourceNameThe data source name.
cbThe callback.
subscriberThe graphic object which subscribes.
userDataThe 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);
Parameters
dataSourceNameThe data source name.
cbThe callback.
subscriberThe graphic object which subscribes.
userDataThe 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.