本文整理汇总了C++中BMailAccountSettings::RealName方法的典型用法代码示例。如果您正苦于以下问题:C++ BMailAccountSettings::RealName方法的具体用法?C++ BMailAccountSettings::RealName怎么用?C++ BMailAccountSettings::RealName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMailAccountSettings
的用法示例。
在下文中一共展示了BMailAccountSettings::RealName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
BEmailMessage::SendViaAccount(int32 account)
{
_account_id = account;
BMailAccounts accounts;
BMailAccountSettings* accountSettings = accounts.AccountByID(_account_id);
BString from;
if (accountSettings) {
from << '\"' << accountSettings->RealName() << "\" <"
<< accountSettings->ReturnAddress() << '>';
}
SetFrom(from);
}
示例2:
_EXPORT status_t
get_pop_account(mail_pop_account* account, int32 index)
{
BMailAccounts accounts;
BMailAccountSettings* accountSettings = accounts.AccountAt(index);
if (accountSettings == NULL)
return B_BAD_INDEX;
const BMessage& settings = accountSettings->InboundSettings();
strcpy(account->pop_name, settings.FindString("username"));
strcpy(account->pop_host, settings.FindString("server"));
strcpy(account->real_name, accountSettings->RealName());
strcpy(account->reply_to, accountSettings->ReturnAddress());
const char* encryptedPassword = get_passwd(&settings, "cpasswd");
const char* password = encryptedPassword;
if (password == NULL)
password = settings.FindString("password");
strcpy(account->pop_password, password);
delete[] encryptedPassword;
return B_OK;
}
示例3: name
//.........这里部分代码省略.........
field = new BMenuField(r, "", "", fToMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
field->SetDivider(0.0);
field->SetEnabled(true);
AddChild(field);
}
// "From:" accounts Menu and Encoding Menu.
if (!fIncoming || resending) {
// Put the character set box on the right of the From field.
r.Set(windowRect.Width() - widestCharacterSet -
StringWidth(B_TRANSLATE("Encoding:")) - 2 * SEPARATOR_MARGIN,
y - 2, windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
BMenuField* encodingField = new BMenuField(r, "encoding",
B_TRANSLATE("Encoding:"), fEncodingMenu, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
encodingField->SetDivider(encodingField->StringWidth(
B_TRANSLATE("Encoding:")) + 5);
AddChild(encodingField);
field = encodingField;
// And now the "from account" pop-up menu, on the left side, taking the
// remaining space.
fAccountMenu = new BPopUpMenu(B_EMPTY_STRING);
BMailAccounts accounts;
bool marked = false;
for (int32 i = 0; i < accounts.CountAccounts(); i++) {
BMailAccountSettings* account = accounts.AccountAt(i);
BString name = account->Name();
name << ": " << account->RealName() << " <"
<< account->ReturnAddress() << ">";
msg = new BMessage(kMsgFrom);
BMenuItem *item = new BMenuItem(name, msg);
msg->AddInt32("id", account->AccountID());
if (defaultAccount == account->AccountID()) {
item->SetMarked(true);
marked = true;
}
fAccountMenu->AddItem(item);
}
if (!marked) {
BMenuItem *item = fAccountMenu->ItemAt(0);
if (item != NULL) {
item->SetMarked(true);
fAccountID = item->Message()->FindInt32("id");
} else {
fAccountMenu->AddItem(
item = new BMenuItem(B_TRANSLATE("<none>"), NULL));
item->SetEnabled(false);
fAccountID = ~0UL;
}
// default account is invalid, set to marked
// TODO: do this differently, no casting and knowledge
// of TMailApp here....
if (TMailApp* app = dynamic_cast<TMailApp*>(be_app))
app->SetDefaultAccount(fAccountID);
}