Difference between revisions of "Framework/Article/Asynchronous Callback Service"
| Line 24: | Line 24: | ||
</code> | </code> | ||
| + | <code>[cpp] | ||
| + | #ifndef __com_sun_star_awt_XCallback_idl__ | ||
| + | #define __com_sun_star_awt_XCallback_idl__ | ||
| + | |||
| + | #ifndef __com_sun_star_uno_XInterface_idl__ | ||
| + | #include <com/sun/star/uno/XInterface.idl> | ||
| + | #endif | ||
| + | |||
| + | //============================================================================= | ||
| + | |||
| + | module com { module sun { module star { module awt { | ||
| + | |||
| + | //============================================================================= | ||
| + | |||
| + | /** specifices an interface which can be used to call back | ||
| + | an implementation | ||
| + | */ | ||
| + | interface XCallback | ||
| + | { | ||
| + | //------------------------------------------------------------------------- | ||
| + | |||
| + | /** notifies the callback implementation | ||
| + | |||
| + | @param aData | ||
| + | private data which was provided when the callback was requested. | ||
| + | */ | ||
| + | void notify( [in] any aData ); | ||
| + | }; | ||
| + | |||
| + | //============================================================================= | ||
| + | |||
| + | }; }; }; }; | ||
| + | |||
| + | #endif | ||
| + | </code> | ||
<code>[cpp] | <code>[cpp] | ||
Revision as of 10:29, 2 November 2007
Asynchronous callback service
[cpp]
- ifndef __com_sun_star_awt_AsyncCallback_idl__
- define __com_sun_star_awt_AsyncCallback_idl__
- ifndef __com_sun_star_awt_XRequestCallback_idl__
- include <com/sun/star/awt/XRequestCallback.idl>
- endif
module com { module sun { module star { module awt {
//============================================================================
/** An implementation which uses the message queue to call the
callback implementation asynchronously.
@see XRequestCallback
*/
service AsyncCallback: XRequestCallback;
}; }; }; };
- endif
[cpp]
- ifndef __com_sun_star_awt_XCallback_idl__
- define __com_sun_star_awt_XCallback_idl__
- ifndef __com_sun_star_uno_XInterface_idl__
- include <com/sun/star/uno/XInterface.idl>
- endif
//=============================================================================
module com { module sun { module star { module awt {
//=============================================================================
/** specifices an interface which can be used to call back
an implementation
*/
interface XCallback
{
//-------------------------------------------------------------------------
/** notifies the callback implementation
@param aData
private data which was provided when the callback was requested.
*/
void notify( [in] any aData );
};
//=============================================================================
}; }; }; };
- endif
[cpp]
- ifndef __com_sun_star_awt_XRequestCallback_idl__
- define __com_sun_star_awt_XRequestCallback_idl__
- ifndef __com_sun_star_awt_XCallback_idl__
- include <com/sun/star/awt/XCallback.idl>
- endif
//=============================================================================
module com { module sun { module star { module awt {
//=============================================================================
/** specifices an interface which can be used to call back
an implementation
*/
interface XRequestCallback
{
//-------------------------------------------------------------------------
/** adds a callback request to the implementation
@param aData
any private data which will be provided to the callback implementation.
@param xCallback
a reference to the callback which should be called by the implementation
of this interface.
*/
void addCallback( [in] XCallback xCallback, [in] any aData );
};
//=============================================================================
}; }; }; };
- endif