本文整理汇总了C++中MessageHandler::SetCallBack方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageHandler::SetCallBack方法的具体用法?C++ MessageHandler::SetCallBack怎么用?C++ MessageHandler::SetCallBack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageHandler
的用法示例。
在下文中一共展示了MessageHandler::SetCallBack方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleCallback
void PrefsLoader::HandleCallback(OpMessage msg, MH_PARAM_1 par1, MH_PARAM_2 par2)
{
switch(msg)
{
case MSG_URL_LOADING_FAILED:
FinishLoading(par2);
break;
case MSG_URL_DATA_LOADED:
LoadData(par1);
break;
case MSG_URL_MOVED:
{
MessageHandler *mmh = g_main_message_handler;
mmh->UnsetCallBack(this, MSG_URL_DATA_LOADED);
mmh->UnsetCallBack(this, MSG_URL_LOADING_FAILED);
mmh->UnsetCallBack(this, MSG_URL_MOVED);
mmh->SetCallBack(this, MSG_URL_DATA_LOADED, par2);
mmh->SetCallBack(this, MSG_URL_LOADING_FAILED, par2);
mmh->SetCallBack(this, MSG_URL_MOVED, par2);
}
break;
}
}
示例2: StartLoading
OP_STATUS PrefsLoader::StartLoading()
{
MessageHandler *mmh = g_main_message_handler;
CommState stat = m_serverURL->Load(mmh, URL(),FALSE,FALSE,FALSE,FALSE);
if(stat == COMM_REQUEST_FAILED)
return OpStatus::ERR;
URL_ID url_id = m_serverURL->Id();
OP_STATUS rc = OpStatus::OK;
if (OpStatus::IsError(rc = mmh->SetCallBack(this, MSG_URL_DATA_LOADED, url_id)) ||
OpStatus::IsError(rc = mmh->SetCallBack(this, MSG_URL_MOVED, url_id)) ||
OpStatus::IsError(rc = mmh->SetCallBack(this, MSG_URL_LOADING_FAILED, url_id)))
{
mmh->UnsetCallBacks(this);
}
return rc;
}
示例3: ConstructL
void OpConsolePrefsHelper::ConstructL()
{
// Register as listener to relevant preferences
g_pccore->RegisterListenerL(this);
g_pcfiles->RegisterFilesListenerL(this);
// Register with the message handler
MessageHandler *mmh = g_main_message_handler;
mmh->SetCallBack(this, MSG_CONSOLE_RECONFIGURE, 0);
// Set up the logger later
mmh->PostMessage(MSG_CONSOLE_RECONFIGURE, 0, 0);
}