当前位置: 首页>>代码示例>>C++>>正文


C++ sendNotification函数代码示例

本文整理汇总了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;
    }
}
开发者ID:adelcasse,项目名称:lipstick,代码行数:28,代码来源:batterynotifier.cpp

示例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;
    }
}
开发者ID:Nepta,项目名称:nixjdr,代码行数:33,代码来源:TokenMenu.cpp

示例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);
			}

		}
	}
}
开发者ID:178435865,项目名称:game,代码行数:29,代码来源:LoginCommand.cpp

示例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);
    		}

    	}
    }
    */
}
开发者ID:Ratel13,项目名称:game-2,代码行数:35,代码来源:EquipmentCommand.cpp

示例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;
    }
}
开发者ID:socam,项目名称:lipstick-socam,代码行数:25,代码来源:batterynotifier.cpp

示例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;
}
开发者ID:EQ4,项目名称:JamomaCore,代码行数:27,代码来源:TTClock.cpp

示例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;

    }
}
开发者ID:Morpog,项目名称:lipstick,代码行数:25,代码来源:batterynotifier.cpp

示例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;

    }
}
开发者ID:AOSC-Dev,项目名称:lipstick,代码行数:28,代码来源:batterynotifier.cpp

示例9: sendNotification

void BatteryNotifier::applyPSMState(MeeGo::QmDeviceMode::PSMState psmState)
{
    if (psmState == MeeGo::QmDeviceMode::PSMStateOff) {
        sendNotification(NotificationExitingPSM);
    } else if (psmState == MeeGo::QmDeviceMode::PSMStateOn) {
        sendNotification(NotificationEnteringPSM);
    }
}
开发者ID:Morpog,项目名称:lipstick,代码行数:8,代码来源:batterynotifier.cpp

示例10: sendNotification

void BatteryNotifier::devicePSMStateChanged(MeeGo::QmDeviceMode::PSMState PSMState)
{
    if (PSMState == MeeGo::QmDeviceMode::PSMStateOff) {
        sendNotification(NotificationExitingPSM);
    } else if (PSMState == MeeGo::QmDeviceMode::PSMStateOn) {
        sendNotification(NotificationEnteringPSM);
    }
}
开发者ID:adelcasse,项目名称:lipstick,代码行数:8,代码来源:batterynotifier.cpp

示例11: Notification

void Listener::notify(NotificationDomain domain,
	NotificationEvent event, uint32 sequence, const CssmData &data)
{
	Connection &current = 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);
	}
}
开发者ID:Apple-FOSS-Mirror,项目名称:securityd,代码行数:12,代码来源:notifications.cpp

示例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();
}
开发者ID:Ivaho,项目名称:Client,代码行数:7,代码来源:AMCPDevice.cpp

示例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();
}
开发者ID:shervinkh,项目名称:telegrambot,代码行数:28,代码来源:subscribe.cpp

示例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();
}
开发者ID:cguagliano,项目名称:communitymodules,代码行数:31,代码来源:mlMETKAutoFading.cpp

示例15: sendNotification

TTErr TTDictionaryBase::clear()
{
//	mList->clear();
	mMap.clear();
	sendNotification("change", TTValue());
	return kTTErrNone;
}
开发者ID:EQ4,项目名称:JamomaCore,代码行数:7,代码来源:TTDictionaryBase.cpp


注:本文中的sendNotification函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。