rwlogo
Rogue Wave Views 5.5.1

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliCallbackManager Class Reference

User Interface class. More...

#include <ilviews/dataccess/gcallbak.h>

List of all members.

Public Member Functions

IliGlobalGraphicCallback getCallback (const IlvSymbol *callbackName) const
 Returns the function implementing the callback.
const IlvSymbol ** getCallbackNames (IlUInt &count) const
 Returns the names of all currently registered global callbacks.
void registerCallback (const IlvSymbol *callbackName, IliGlobalGraphicCallback cb)
 Registers a global callback.
void unregisterCallback (const IlvSymbol *callbackName)
 Unregisters the global callback.

Detailed Description

User Interface class.

Library: dbgadget

When a gadget (or a graphic) needs to trigger a named callback, it uses the callback manager. The callback manager is responsible for binding the callback name to an actual function. If the callback name designates a global callback (for example, ), the function implementing the global callback will be called. Otherwise, if a callback function with this name has been registered in the container holding the graphic object, this function will be called (see the IlvContainer::registerCallback member function). The callback manager is the unique instance of the IliCallbackManager class and can be retrieved by calling the function IliGetCallbackManager. For the callback manager to be active, the include file dataccess/gcallbak.h has to be included in at least one of the modules of the application. If this is not the case, the global callbacks will not be available.

See also:
IliGetCallbackManager, IliGlobalGraphicCallback

Member Function Documentation

IliGlobalGraphicCallback IliCallbackManager::getCallback ( const IlvSymbol *  callbackName  )  const

Returns the function implementing the callback.

Parameters:
callbackName The callback name.
Returns:
The callback or NULL if no such global callback exists.
const IlvSymbol** IliCallbackManager::getCallbackNames ( IlUInt count  )  const

Returns the names of all currently registered global callbacks.

Predefined Global Callbacks

  • ()
  • (panelName)
  • (panelName)
  • (dataSourceName)
  • (dataSourceName)
  • (dataSourceName)
  • (dataSourceName)
  • (dataSourceName)
  • (sessionName)
  • (sessionName)
  • (sessionName)
  • (sessionName)
  • (sessionName)

The following example shows how to define a new global callback:

 #include <ilviews/dataccess/gcallbak.h>
 void MessageBoxCallback (IlvGraphic* g,
                          IlAny arg,
                          IlInt paramsCount,
                          const char* const* params) {
   IlvContainer* view = IlvContainer::getContainer(g);
   if (paramsCount == 1 && view != NULL) {
     IlvIMessageDialog msgBox(view->getDisplay(),
                              params[0],
                              NULL,
                              IlvDialogOk,
                              view->getSystemView());
     msgBox.show();
   }
 }
 int main () {
   ...
   IlvSymbol* callbackName = IlvGetSymbol("MsgBox");
   IliGetCallbackManager().registerCallback(callbackName,
                                            MessageBoxCallback);
   ...
 }
Parameters:
count The callback count.
Returns:
The list of callback names.
void IliCallbackManager::registerCallback ( const IlvSymbol *  callbackName,
IliGlobalGraphicCallback  cb 
)

Registers a global callback.

Parameters:
callbackName The callback name.
cb The callback.
void IliCallbackManager::unregisterCallback ( const IlvSymbol *  callbackName  ) 

Unregisters the global callback.

Parameters:
callbackName The callback name.

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