rwlogo

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator
List of all members | Public Member Functions
IliCallbackManager Class Reference

User Interface class. More...

#include <ilviews/dataccess/gcallbak.h>

Public Member Functions

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

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, @Quit), 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
callbackNameThe 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

  • @Quit()
  • @ShowPanel(panelName)
  • @HidePanel(panelName)
  • @Validate(dataSourceName)
  • @Cancel(dataSourceName)
  • @Clear(dataSourceName)
  • @Select(dataSourceName)
  • @StartInsert(dataSourceName)
  • @Commit(sessionName)
  • @Rollback(sessionName)
  • @Connect(sessionName)
  • @QueryConnect(sessionName)
  • @Disconnect(sessionName)

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

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,
view->getSystemView());
msgBox.show();
}
}
int main() {
...
IlvSymbol* callbackName = IlvGetSymbol("MsgBox");
MessageBoxCallback);
...
}
Parameters
countThe callback count.
Returns
The list of callback names.
void IliCallbackManager::registerCallback ( const IlvSymbol callbackName,
IliGlobalGraphicCallback  cb 
)

Registers a global callback.

Parameters
callbackNameThe callback name.
cbThe callback.
void IliCallbackManager::unregisterCallback ( const IlvSymbol callbackName)

Unregisters the global callback.

Parameters
callbackNameThe callback name.

© Copyright 2015, 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.