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


C++ KviWindow::outputNoFmt方法代码示例

本文整理汇总了C++中KviWindow::outputNoFmt方法的典型用法代码示例。如果您正苦于以下问题:C++ KviWindow::outputNoFmt方法的具体用法?C++ KviWindow::outputNoFmt怎么用?C++ KviWindow::outputNoFmt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KviWindow的用法示例。


在下文中一共展示了KviWindow::outputNoFmt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: internalOutput

void KviWindow::internalOutput(KviIrcView * pView, int iMsgType, const kvi_wchar_t * pwText, int iFlags)
{
    // all roads lead to Rome :)

    if(pView)
    {
        if(!hasAttention())
        {
            iFlags |= KviIrcView::TriggersNotification;
            if(!pView->hasLineMark())
            {
                iFlags |= KviIrcView::SetLineMark;
            }
        }
        pView->appendText(iMsgType,pwText,iFlags);
    } else {
        // Redirect to the output proxy
        KviWindow * pWnd = outputProxy();
        if(pWnd)
            pWnd->outputNoFmt(iMsgType,pwText,iFlags);
    }

    if(!m_pWindowListItem)
        return;

    // if this option is checked we don't highlight other than channel msg
    if(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg))
    {
        if((iMsgType != KVI_OUT_CHANPRIVMSG) && (iMsgType != KVI_OUT_CHANPRIVMSGCRYPTED))
        {
            if(!(
                        (
                            KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsgQueryToo) &&
                            (
                                (iMsgType == KVI_OUT_QUERYPRIVMSG) || (iMsgType == KVI_OUT_QUERYTRACE) ||
                                (iMsgType == KVI_OUT_QUERYPRIVMSGCRYPTED) || (iMsgType == KVI_OUT_QUERYNOTICE) || (iMsgType == KVI_OUT_QUERYNOTICECRYPTED)
                            )
                        )
                        ||
                        (
                            KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsgHighlightInChanToo) && (iMsgType == KVI_OUT_HIGHLIGHT)
                        )
                    )
              )
                return;
        }
    }

    if(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyAtCostumHighlightLevel) &&
            (KVI_OPTION_MSGTYPE(iMsgType).level() < ((int)(KVI_OPTION_UINT(KviOption_uintMinHighlightLevel)))))
    {
        return;
    }

    m_pWindowListItem->highlight(KVI_OPTION_MSGTYPE(iMsgType).level());
}
开发者ID:wodim,项目名称:kronos,代码行数:56,代码来源:KviWindow.cpp

示例2: notifyOffLine

void KviNotifyListManager::notifyOffLine(const QString & szNick, const QString & szUser, const QString & szHost, const QString & szReason)
{
	KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole;
	if(!KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOffLine, pOut, szNick))
	{
		QString szWho;

		if(!(szUser.isEmpty() || szHost.isEmpty()))
			szWho = QString("\r!n\r%1\r [%[email protected]\r!h\r%3\r]").arg(szNick, szUser, szHost);
		else
			szWho = QString("\r!n\r%1\r").arg(szNick);

		QString szMsg;

		KviPointerHashTable<QString, KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
		KviPointerHashTableIterator<QString, KviRegisteredUser> it(*d);

		while(KviRegisteredUser * pUser = it.current())
		{
			QString szProp = pUser->getProperty("notify");
			if(!szProp.isEmpty())
			{
				if(szProp.split(",", QString::SkipEmptyParts).indexOf(szNick) != -1)
				{
					QString szComment = pUser->getProperty("comment");
					if(!szComment.isEmpty())
						szMsg = QString("%1 (%2), Group \"%3\" has left IRC as (%4)").arg(pUser->name(), szComment, pUser->group(), szWho);
					else
						szMsg = QString("%1, Group \"%2\" has left IRC as (%3)").arg(pUser->name(), pUser->group(), szWho);
					break;
				}
			}
			++it;
		}

		if(szMsg.isEmpty())
			szMsg = QString(__tr2qs("%1 has left IRC")).arg(szWho);

		if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE))
		{
			szMsg += "(";
			szMsg += szReason;
			szMsg += ")";
		}

		pOut->outputNoFmt(KVI_OUT_NOTIFYOFFLINE, szMsg);
	}

	m_pConsole->notifyListView()->part(szNick);
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:50,代码来源:KviNotifyList.cpp

示例3: notifyOnLine

void KviNotifyListManager::notifyOnLine(const QString & szNick, const QString & szUser, const QString & szHost, const QString & szReason, bool bJoin)
{
	if(bJoin)
		m_pConsole->notifyListView()->join(szNick, szUser, szHost);

	KviWindow * pOut = KVI_OPTION_BOOL(KviOption_boolNotifyListChangesToActiveWindow) ? m_pConsole->activeWindow() : m_pConsole;
	if(KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnNotifyOnLine, pOut, szNick))
		return;

	QString szWho;
	QString szMsg;

	if(!(szUser.isEmpty() || szHost.isEmpty()))
		szWho = QString("\r!n\r%1\r [%[email protected]\r!h\r%3\r]").arg(szNick, szUser, szHost);
	else
		szWho = QString("\r!n\r%1\r").arg(szNick);

	KviPointerHashTable<QString, KviRegisteredUser> * d = g_pRegisteredUserDataBase->userDict();
	KviPointerHashTableIterator<QString, KviRegisteredUser> it(*d);

	while(KviRegisteredUser * pUser = it.current())
	{
		QString szProp = pUser->getProperty("notify");
		if(!szProp.isEmpty())
		{
			if(szProp.split(",", QString::SkipEmptyParts).indexOf(szNick) != -1)
			{
				QString szComment = pUser->getProperty("comment");
				if(!szComment.isEmpty())
					szMsg = QString("%1 (%2), Group \"%3\" is on IRC as (%4)").arg(pUser->name(), szComment, pUser->group(), szWho);
				else
					szMsg = QString("%1, Group \"%2\" is on IRC as (%3)").arg(pUser->name(), pUser->group(), szWho);
				break;
			}
		}
		++it;
	}

	QString szFmt = __tr2qs("%1 is on IRC");

	if(szMsg.isEmpty())
		szMsg = QString(szFmt).arg(szWho);

	if((!szReason.isEmpty()) && (_OUTPUT_VERBOSE))
	{
		szMsg += "(";
		szMsg += szReason;
		szMsg += ")";
	}

	pOut->outputNoFmt(KVI_OUT_NOTIFYONLINE, szMsg);

	if(!(pOut->hasAttention(KviWindow::MainWindowIsVisible)))
	{
		if(KVI_OPTION_BOOL(KviOption_boolFlashWindowOnNotifyOnLine))
			pOut->demandAttention();
		if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNotifyOnLine))
		{
			szWho = "<b>";
			szWho += szNick;
			szWho += "</b>";
			szMsg = QString(szFmt).arg(szWho);
			g_pApp->notifierMessage(pOut, KVI_OPTION_MSGTYPE(KVI_OUT_NOTIFYONLINE).pixId(), szMsg, KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime));
		}
	}
}
开发者ID:un1versal,项目名称:KVIrc,代码行数:66,代码来源:KviNotifyList.cpp


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