#include <PkgModuleCallbacks.YCP.h>
Public Types | |
| enum | CBid { CB_StartRebuildDb, CB_ProgressRebuildDb, CB_NotifyRebuildDb, CB_StopRebuildDb, CB_StartConvertDb, CB_ProgressConvertDb, CB_NotifyConvertDb, CB_StopConvertDb, CB_StartProvide, CB_ProgressProvide, CB_DoneProvide, CB_StartPackage, CB_ProgressPackage, CB_DonePackage, CB_StartDownload, CB_ProgressDownload, CB_DoneDownload, CB_MediaChange, CB_SourceChange, CB_YouProgress, CB_YouPatchProgress, CB_YouError, CB_YouMessage, CB_YouLog, CB_YouExecuteYcpScript, CB_YouScriptProgress } |
Public Member Functions | |
| YCPCallbacks () | |
| void | popCallback (CBid id_r) |
| void | setCallback (CBid id_r, const string &name_r) |
| bool | setCallback (CBid id_r, const YCPString &args) |
| YCPValue | setYCPCallback (CBid id_r, const YCPString &args_r) |
| bool | isSet (CBid id_r) const |
| Y2Function * | createCallback (CBid id_r) const |
Static Public Member Functions | |
| string | cbName (CBid id_r) |
Private Types | |
| typedef map< CBid, stack< CBdata > > | _cbdata_t |
Private Attributes | |
| _cbdata_t | _cbdata |
For each YCPCallback it's data, identified by a CBid, are stored in maps.
To invoke a YCPCallback:
YCPTerm callback = createCallback( CB_PatchProgress ); // create callback Term callback->add( YCPInteger ( percent ) ); // add arguments callback->add( YCPString ( pkg ) ); bool result = evaluateBool( callback ); // evaluate
Member Typedef Documentation
|
|
|
|
|
Unique id for each YCPCallback we may have to trigger. On changes here, adapt cbName.
|
|
|
Constructor. |
|
|
Returns the enum name without the leading "CB_" (e.g. "StartProvide" for CB_StartProvide). Should be in sync with CBid. |
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Set a YCPCallbacks data according to args_r. |
|
||||||||||||
|
Set a YCPCallbacks data from string "module::symbol" |
|
||||||||||||
|
Set the YCPCallback according to args_r.
|
|
|
|
1.3.6