本文整理汇总了C++中sendNotification函数的典型用法代码示例。如果您正苦于以下问题:C++ sendNotification函数的具体用法?C++ sendNotification怎么用?C++ sendNotification使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sendNotification函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
void BatteryNotifier::batteryStateChanged(MeeGo::QmBattery::BatteryState state)
{
switch(state) {
case MeeGo::QmBattery::StateFull:
stopLowBatteryNotifier();
removeNotification(QStringList() << "x-nemo.battery");
sendNotification(NotificationChargingComplete);
break;
case MeeGo::QmBattery::StateOK:
stopLowBatteryNotifier();
break;
case MeeGo::QmBattery::StateLow:
if (qmBattery->getChargingState() != MeeGo::QmBattery::StateCharging) {
// The low battery notifications should be sent only if the battery is not charging
startLowBatteryNotifier();
}
break;
case MeeGo::QmBattery::StateEmpty:
sendNotification(NotificationRechargeBattery);
break;
case MeeGo::QmBattery::StateError:
break;
}
}
示例2: TokenItem
TokenItem* TokenMenu::addToken(QString text, QString filePath, int size, bool special, GameObject *gameObject)
{
// Check if the list already contains a token with the same text before insertion.
QList<QListWidgetItem*> items = ui->m_tokenList->findItems(text, Qt::MatchExactly);
if (items.empty()) {
TokenItem *item = new TokenItem(filePath, text, size, special);
if (!item->isPixLoaded()) {
emit sendNotification(QString("L'image spécifiée par le chemin %1 n'a pas pu être chargée.")
.arg(filePath));
}
item->setGameObject(gameObject);
// push the item into the database
RepositoryManager::s_TokenItemRepository.insertTokenItem(item);
// add the item to the tokenList
ui->m_tokenList->addItem(item);
ui->m_tokenList->setCurrentItem(item);
// Notifies everyone that an item has been added
QString msg = QString("%1").arg(item->id());
m_SenderClient->sendMessageToServer(msg, (quint16) TokenMenuCodes::ADD_TOKEN);
return item;
}
else {
emit sendNotification(QString("Un jeton nommé %1 existe déjà.").arg(text));
return NULL;
}
}
示例3: sendNotification
void LoginCommand::execute(Notification& noti)
{
const string& name=noti.m_strNotiName;
void* data=noti.m_pData;
if(StringHelper::isEqual(name,LoginFacade::COMMAND_EXIT))
{
sendNotification(LoginFacade::NOTIFICATION_CLOSE);
}
else if(StringHelper::isEqual(name,LoginFacade::COMMAND_LOGIN))
{
LoginVO vo=*((LoginVO*)data);
IProxy* proxy=getFacade()->getProxy(LoginFacade::PROXY_LOGIN);
LoginProxy* lp=dynamic_cast<LoginProxy*>(proxy);
if(lp)
{
bool ret=lp->checkLogin(vo);
if(ret)
{
//±¾µØ¼ì²é
sendNotification(LoginFacade::NOTIFICATION_LOGIN_SUCESS);
}
else
{
sendNotification(LoginFacade::NOTIFICATION_LOGIN_FAIL);
}
}
}
}
示例4: sendNotification
void EquipmentCommand::execute(Notification& noti)
{
const string& name=noti.m_strNotiName;
void* data=noti.m_pData;
if(StringHelper::isEqual(name,EquipmentFacade::COMMAND_SWITCH_SEARCHPAGE))
{
sendNotification(EquipmentFacade::NOTIFICATION_SWITCH_SRH_SUCCESS);
}
else if(StringHelper::isEqual(name,EquipmentFacade::COMMAND_SWITCH_ARSENALPAGE))
{
sendNotification(EquipmentFacade::NOTIFICATION_SWITCH_ARL_SUCCESS);
}
/**
else if(StringHelper::isEqual(name,EquipmentFacade::COMMAND_LOGIN))
{
EquipmentVO vo=*((EquipmentVO*)data);
IProxy* proxy=getFacade()->getProxy(EquipmentFacade::PROXY_LOGIN);
EquipmentProxy* lp=dynamic_cast<EquipmentProxy*>(proxy);
if(lp)
{
bool ret=lp->checkEquipment(vo);
if(ret)
{
//±¾µØ¼ì²é
sendNotification(EquipmentFacade::NOTIFICATION_LOGIN_SUCESS);
}
else
{
sendNotification(EquipmentFacade::NOTIFICATION_LOGIN_FAIL);
}
}
}
*/
}
示例5: switch
void BatteryNotifier::applyChargingState(QtMobility::QSystemBatteryInfo::ChargingState state)
{
switch(state) {
case QtMobility::QSystemBatteryInfo::Charging:
if (batteryInfo->chargerType() == QtMobility::QSystemBatteryInfo::USB_100mACharger) {
sendNotification(NotificationNoEnoughPower);
} else {
// The low battery notifications should not be sent when the battery is charging
stopLowBatteryNotifier();
removeNotification(QStringList() << "x-nemo.battery.removecharger" << "x-nemo.battery.chargingcomplete" << "x-nemo.battery.lowbattery");
sendNotification(NotificationCharging);
}
break;
case QtMobility::QSystemBatteryInfo::NotCharging:
removeNotification(QStringList() << "x-nemo.battery");
utiliseLED(false, QString("PatternBatteryCharging"));
break;
case QtMobility::QSystemBatteryInfo::ChargingError:
sendNotification(NotificationChargingNotStarted);
break;
}
}
示例6: sendNotification
TTErr TTClock::setDuration(const TTValue& value)
{
if (value.size() == 1) {
if (value[0].type() == kTypeFloat64) {
mDuration = value[0];
// update offset
if (mDuration < mOffset) {
mOffset = mDuration;
sendNotification(TTSymbol("ClockOffsetChanged"), mOffset);
}
mPosition = mOffset / mDuration;
mDate = mOffset;
sendNotification(TTSymbol("ClockDurationChanged"), mDuration);
return kTTErrNone;
}
}
return kTTErrGeneric;
}
示例7: switch
void BatteryNotifier::applyChargingState(int, QBatteryInfo::ChargingState state)
{
switch(state) {
case QBatteryInfo::Charging:
if (batteryInfo->chargerType() == QBatteryInfo::USBCharger && batteryInfo->currentFlow(0) <= 100) {
sendNotification(NotificationNoEnoughPower);
} else {
// The low battery notifications should not be sent when the battery is charging
stopLowBatteryNotifier();
removeNotification(QStringList() << "x-nemo.battery.removecharger" << "x-nemo.battery.chargingcomplete" << "x-nemo.battery.lowbattery");
sendNotification(NotificationCharging);
}
break;
case QBatteryInfo::NotCharging:
sendNotification(NotificationChargingNotStarted);
break;
default:
removeNotification(QStringList() << "x-nemo.battery");
break;
}
}
示例8: switch
void BatteryNotifier::applyChargingState(QBatteryInfo::ChargingState state)
{
switch(state) {
case QBatteryInfo::Charging:
if (batteryInfo->chargerType() == QBatteryInfo::USBCharger && batteryInfo->currentFlow() <= 100) {
sendNotification(NotificationNoEnoughPower);
} else {
// The low battery notifications should not be sent when the battery is charging
stopLowBatteryNotifier();
removeNotification(QStringList() << "x-nemo.battery.removecharger" << "x-nemo.battery.chargingcomplete" << "x-nemo.battery.lowbattery");
sendNotification(NotificationCharging);
}
break;
case QBatteryInfo::IdleChargingState:
if (batteryInfo->levelStatus() != QBatteryInfo::LevelFull) {
sendNotification(NotificationChargingNotStarted);
return;
}
// otherwise fallthrough, not charging because capacity is full
default:
removeNotification(QStringList() << "x-nemo.battery");
break;
}
}
示例9: sendNotification
void BatteryNotifier::applyPSMState(MeeGo::QmDeviceMode::PSMState psmState)
{
if (psmState == MeeGo::QmDeviceMode::PSMStateOff) {
sendNotification(NotificationExitingPSM);
} else if (psmState == MeeGo::QmDeviceMode::PSMStateOn) {
sendNotification(NotificationEnteringPSM);
}
}
示例10: sendNotification
void BatteryNotifier::devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState PSMState)
{
if (PSMState == MeeGo::QmDeviceMode::PSMStateOff) {
sendNotification(NotificationExitingPSM);
} else if (PSMState == MeeGo::QmDeviceMode::PSMStateOn) {
sendNotification(NotificationEnteringPSM);
}
}
示例11: Notification
void Listener::notify(NotificationDomain domain,
NotificationEvent event, uint32 sequence, const CssmData &data)
{
Connection ¤t = Server::active().connection();
RefPointer<Notification> message = new Notification(domain, event, sequence, data);
if (current.inSequence(message)) {
StLock<Mutex> _(setLock);
sendNotification(message);
while (RefPointer<Notification> next = current.popNotification())
sendNotification(next);
}
}
示例12: if
void AMCPDevice::parseMultiline(const QString& line)
{
if (line.length() > 0)
this->response.append(line);
else if (line.length() == 0 && this->line.length() == 0 && this->previousLine.length() == 0)
sendNotification();
}
示例13: QString
QVariant Subscribe::customCommand(const QString &command, const QList<QVariant> &args)
{
auto assertWhere = QString("Custom command \"%1\" from module \"%2\"")
.arg(command).arg(name()).toLocal8Bit();
auto assertWhatInvalidArgs = "Invalid number of arguments!";
auto assertWhatInvalidCommand = "Invalid command";
if (command == "sendNotification")
{
Q_ASSERT_X(args.size() == 3, assertWhere.data(), assertWhatInvalidArgs);
auto gid = args[0].toLongLong();
auto tag = args[1].toString();
auto text = args[2].toString();
sendNotification(gid, tag, text);
}
else if (command == "sendForward")
{
Q_ASSERT_X(args.size() == 3, assertWhere.data(), assertWhatInvalidArgs);
auto gid = args[0].toLongLong();
auto tag = args[1].toString();
auto msgId = args[2].toLongLong();
sendForward(gid, tag, msgId);
}
else
Q_ASSERT_X(false, assertWhere.data(), assertWhatInvalidCommand);
return QVariant();
}
示例14: double
void METKAutoFading::resetAllCurrentOccluders()
{
Appearance oldValues;
string objName = "";
set<string>::iterator iter;
for (iter = currentFading.begin(); iter != currentFading.end(); iter++)
{
objName = *iter;
std::cout << "Wiedereinblenden: " << objName << std::endl;
if (htOldValues.find(objName))
{
oldValues = *(htOldValues.find(objName));
myObjMgr->setObjAttribute(objName,LAY_APPEARANCE, INF_TRANSPARENCY, new double(oldValues.Transparency), omINFOTYPE_DOUBLE, true, false);
myObjMgr->setObjAttribute(objName,LAY_APPEARANCE, INF_SILHOUETTEWIDTH, new double(oldValues.SilhouetteWidth), omINFOTYPE_DOUBLE, true, false);
vec3* tempVec3 = new vec3(oldValues.SilhouetteColor[0],oldValues.SilhouetteColor[1],oldValues.SilhouetteColor[2]);
myObjMgr->setObjAttribute(objName,LAY_APPEARANCE, INF_SILHOUETTECOLOR, tempVec3, omINFOTYPE_DOUBLE, true, false);
delete tempVec3;
myObjMgr->setObjAttribute(objName,LAY_APPEARANCE, INF_SILHOUETTE, new bool(oldValues.SilhouetteVisible), omINFOTYPE_BOOL, true, false);
}
else
std::cout << "No oldValues found in Hashtable for " << objName << std::endl;
htOldValues.remove(objName);
}
currentFading.clear();
htOldValues.getTable()->clear();
sendNotification();
}
示例15: sendNotification
TTErr TTDictionaryBase::clear()
{
// mList->clear();
mMap.clear();
sendNotification("change", TTValue());
return kTTErrNone;
}