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


C++ BMailAccountSettings::Name方法代码示例

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


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

示例1: BPopUpMenu

BPopUpMenu*
TPrefsWindow::_BuildAccountMenu(int32 account)
{
	BPopUpMenu* menu = new BPopUpMenu("");
	BMenuItem* item;

	//menu->SetRadioMode(true);
	BMailAccounts accounts;
	if (accounts.CountAccounts() == 0) {
		menu->AddItem(item = new BMenuItem(B_TRANSLATE("<no account found>"), NULL));
		item->SetEnabled(false);
		return menu;
	}

	BMessage* msg;
	for (int32 i = 0; i < accounts.CountAccounts(); i++) {
		BMailAccountSettings* settings = accounts.AccountAt(i);
		item = new BMenuItem(settings->Name(), msg = new BMessage(P_ACCOUNT));

		msg->AddInt32("id", settings->AccountID());

		if (account == settings->AccountID())
			item->SetMarked(true);

		menu->AddItem(item);
	}
	return menu;
}
开发者ID:simonsouth,项目名称:haiku,代码行数:28,代码来源:Prefs.cpp

示例2: DefaultNotifier

void
MailDaemonApp::_InitAccount(BMailAccountSettings& settings)
{
	account_protocols account;
	// inbound
	if (settings.IsInboundEnabled()) {
		account.inboundProtocol = _CreateInboundProtocol(settings,
			account.inboundImage);
	} else {
		account.inboundProtocol = NULL;
	}
	if (account.inboundProtocol) {
		DefaultNotifier* notifier = new DefaultNotifier(settings.Name(), true,
			fErrorLogWindow, fNotifyMode);
		account.inboundProtocol->SetMailNotifier(notifier);

		account.inboundThread = new InboundProtocolThread(
			account.inboundProtocol);
		account.inboundThread->Run();
	}

	// outbound
	if (settings.IsOutboundEnabled()) {
		account.outboundProtocol = _CreateOutboundProtocol(settings,
			account.outboundImage);
	} else {
		account.outboundProtocol = NULL;
	}
	if (account.outboundProtocol) {
		DefaultNotifier* notifier = new DefaultNotifier(settings.Name(), false,
			fErrorLogWindow, fNotifyMode);
		account.outboundProtocol->SetMailNotifier(notifier);

		account.outboundThread = new OutboundProtocolThread(
			account.outboundProtocol);
		account.outboundThread->Run();
	}

	printf("account name %s, id %i, in %p, out %p\n", settings.Name(),
		(int)settings.AccountID(), account.inboundProtocol,
		account.outboundProtocol);
	if (!account.inboundProtocol && !account.outboundProtocol)
		return;
	fAccounts[settings.AccountID()] = account;
}
开发者ID:,项目名称:,代码行数:45,代码来源:

示例3:

HaikuMailFormatFilter::HaikuMailFormatFilter(BMailProtocol& protocol,
	const BMailAccountSettings& settings)
	:
	BMailFilter(protocol, NULL),
	fAccountID(settings.AccountID()),
	fAccountName(settings.Name())
{
	const BMessage& outboundSettings = settings.OutboundSettings();
	outboundSettings.FindString("destination", &fOutboundDirectory);
}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:10,代码来源:HaikuMailFormatFilter.cpp

示例4:

BMailAccountSettings*
BMailAccounts::AccountByName(const char* name)
{
	for (int i = 0; i < fAccounts.CountItems(); i++) {
		BMailAccountSettings* account = fAccounts.ItemAt(i);
		if (strcmp(account->Name(), name) == 0)
			return account;
	}
	return NULL;
}
开发者ID:mmadia,项目名称:Haiku-services-branch,代码行数:10,代码来源:MailSettings.cpp

示例5: sizeof

status_t
BEmailMessage::GetAccountName(BString& accountName) const
{
	BFile *file = dynamic_cast<BFile *>(fData);
	if (file == NULL)
		return B_ERROR;

	int32 accountId;
	size_t read = file->ReadAttr(B_MAIL_ATTR_ACCOUNT, B_INT32_TYPE, 0,
		&accountId, sizeof(int32));
	if (read < sizeof(int32))
		return B_ERROR;

	BMailAccounts accounts;
	BMailAccountSettings* account =  accounts.AccountByID(accountId);
	if (account)
		accountName = account->Name();
	else
		accountName = "";

	return B_OK;
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例6: BMessage


//.........这里部分代码省略.........
		}
		if (count > 0)
			menu->AddSeparatorItem();
	}

	// Hack for R5's buggy Query Notification
	#ifdef HAIKU_TARGET_PLATFORM_BEOS
		menu->AddItem(new BMenuItem(
			MDR_DIALECT_CHOICE("Refresh New Mail Count",
				"未読メールカウントを更新"),
			new BMessage(MD_REFRESH_QUERY)));
	#endif

	// The New E-mail query

	if (fNewMessages > 0) {
		BString string;
		MDR_DIALECT_CHOICE(
			string << fNewMessages << " new message"
				<< (fNewMessages != 1 ? "s" : B_EMPTY_STRING),
			string << fNewMessages << " 通の未読メッセージ");

		_GetNewQueryRef(ref);

		item = new BMenuItem(navMenu = new BNavMenu(string.String(),
			B_REFS_RECEIVED, BMessenger(kTrackerSignature)),
			msg = new BMessage(B_REFS_RECEIVED));
		msg->AddRef("refs", &ref);
		navMenu->SetNavDir(&ref);

		menu->AddItem(item);
	} else {
		menu->AddItem(item = new BMenuItem(
			MDR_DIALECT_CHOICE ("No new messages","未読メッセージなし"), NULL));
		item->SetEnabled(false);
	}

	BMailAccounts accounts;
	if (modifiers() & B_SHIFT_KEY) {
		BMenu *accountMenu = new BMenu(
			MDR_DIALECT_CHOICE ("Check for mails only","R) メール受信のみ"));
		BFont font;
		menu->GetFont(&font);
		accountMenu->SetFont(&font);

		for (int32 i = 0; i < accounts.CountAccounts(); i++) {
			BMailAccountSettings* account = accounts.AccountAt(i);

			BMessage* message = new BMessage(MD_CHECK_FOR_MAILS);
			message->AddInt32("account", account->AccountID());

			accountMenu->AddItem(new BMenuItem(account->Name(), message));
		}
		if (accounts.CountAccounts() == 0) {
			item = new BMenuItem("<no accounts>", NULL);
			item->SetEnabled(false);
			accountMenu->AddItem(item);
		}
		accountMenu->SetTargetForItems(this);
		menu->AddItem(new BMenuItem(accountMenu,
			new BMessage(MD_CHECK_FOR_MAILS)));

		// Not used:
		// menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE (
		// "Check For Mails Only","メール受信のみ"), new BMessage(MD_CHECK_FOR_MAILS)));
		menu->AddItem(new BMenuItem(
			MDR_DIALECT_CHOICE ("Send pending mails", "M) 保留メールを送信"),
		new BMessage(MD_SEND_MAILS)));
	} else {
		menu->AddItem(item = new BMenuItem(
			MDR_DIALECT_CHOICE ("Check for mail now", "C) メールチェック"),
			new BMessage(MD_CHECK_SEND_NOW)));
		if (accounts.CountAccounts() == 0)
			item->SetEnabled(false);
	}

	menu->AddSeparatorItem();
	menu->AddItem(new BMenuItem(
		MDR_DIALECT_CHOICE ("Preferences", "P) メール環境設定") B_UTF8_ELLIPSIS,
		new BMessage(MD_OPEN_PREFS)));

	if (modifiers() & B_SHIFT_KEY) {
		menu->AddItem(new BMenuItem(
			MDR_DIALECT_CHOICE ("Shutdown mail services", "Q) 終了"),
			new BMessage(B_QUIT_REQUESTED)));
	}

	// Reset Item Targets (only those which aren't already set)

	for (int32 i = menu->CountItems(); i-- > 0;) {
		item = menu->ItemAt(i);
		if (item && (msg = item->Message()) != NULL) {
			if (msg->what == B_REFS_RECEIVED)
				item->SetTarget(tracker);
			else
				item->SetTarget(this);
		}
	}
	return menu;
}
开发者ID:,项目名称:,代码行数:101,代码来源:

示例7: name

THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
	bool resending, uint32 defaultCharacterSet, int32 defaultAccount)
	:
	BBox(rect, "m_header", B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW, B_NO_BORDER),

	fAccountMenu(NULL),
	fEncodingMenu(NULL),
	fAccountID(defaultAccount),
	fAccountTo(NULL),
	fAccount(NULL),
	fBcc(NULL),
	fCc(NULL),
	fSubject(NULL),
	fTo(NULL),
	fDateLabel(NULL),
	fDate(NULL),
	fIncoming(incoming),
	fCharacterSetUserSees(defaultCharacterSet),
	fResending(resending),
	fBccMenu(NULL),
	fCcMenu(NULL),
	fToMenu(NULL),
	fEmailList(NULL)
{
	BMenuField* field;
	BMessage* msg;

	float x = StringWidth( /* The longest title string in the header area */
		B_TRANSLATE("Attachments: ")) + 9;
	float y = TO_FIELD_V;

	BMenuBar* dummy = new BMenuBar(BRect(0, 0, 100, 15), "Dummy");
	AddChild(dummy);
	float width, menuBarHeight;
	dummy->GetPreferredSize(&width, &menuBarHeight);
	dummy->RemoveSelf();
	delete dummy;

	float menuFieldHeight = menuBarHeight + 6;
	float controlHeight = menuBarHeight + floorf(be_plain_font->Size() / 1.15);

	if (!fIncoming) {
		InitEmailCompletion();
		InitGroupCompletion();
	}

	// Prepare the character set selection pop-up menu (we tell the user that
	// it is the Encoding menu, even though it is really the character set).
	// It may appear in the first line, to the right of the From box if the
	// user is reading an e-mail.  It appears on the second line, to the right
	// of the e-mail account menu, if the user is composing a message.  It lets
	// the user quickly select a character set different from the application
	// wide default one, and also shows them which character set is active.  If
	// you are reading a message, you also see an item that says "Automatic"
	// for automatic decoding character set choice.  It can slide around as the
	// window is resized when viewing a message, but not when composing
	// (because the adjacent pop-up menu can't resize dynamically due to a BeOS
	// bug).

	float widestCharacterSet = 0;
	bool markedCharSet = false;
	BMenuItem* item;

	fEncodingMenu = new BPopUpMenu(B_EMPTY_STRING);

	BCharacterSetRoster roster;
	BCharacterSet charset;
	while (roster.GetNextCharacterSet(&charset) == B_OK) {
		BString name(charset.GetPrintName());
		const char* mime = charset.GetMIMEName();
		if (mime)
			name << " (" << mime << ")";

		uint32 convertID;
		if (mime == NULL || strcasecmp(mime, "UTF-8") != 0)
			convertID = charset.GetConversionID();
		else
			convertID = B_MAIL_UTF8_CONVERSION;

		msg = new BMessage(kMsgEncoding);
		msg->AddInt32("charset", convertID);
		fEncodingMenu->AddItem(item = new BMenuItem(name.String(), msg));
		if (convertID == fCharacterSetUserSees && !markedCharSet) {
			item->SetMarked(true);
			markedCharSet = true;
		}
		if (StringWidth(name.String()) > widestCharacterSet)
			widestCharacterSet = StringWidth(name.String());
	}

	msg = new BMessage(kMsgEncoding);
	msg->AddInt32("charset", B_MAIL_US_ASCII_CONVERSION);
	fEncodingMenu->AddItem(item = new BMenuItem("US-ASCII", msg));
	if (fCharacterSetUserSees == B_MAIL_US_ASCII_CONVERSION && !markedCharSet) {
		item->SetMarked(true);
		markedCharSet = true;
	}

	if (!resending && fIncoming) {
		// reading a message, display the Automatic item
//.........这里部分代码省略.........
开发者ID:sahil9912,项目名称:haiku,代码行数:101,代码来源:Header.cpp


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