本文整理汇总了C++中BMailAccountSettings::IsInboundEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ BMailAccountSettings::IsInboundEnabled方法的具体用法?C++ BMailAccountSettings::IsInboundEnabled怎么用?C++ BMailAccountSettings::IsInboundEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMailAccountSettings
的用法示例。
在下文中一共展示了BMailAccountSettings::IsInboundEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: autoConfigRect
void
ConfigWindow::MessageReceived(BMessage *msg)
{
float fontFactor = be_plain_font->Size() / 12.0f;
BRect autoConfigRect(0, 0, 400 * fontFactor, 300 * fontFactor);
BRect frame;
AutoConfigWindow *autoConfigWindow = NULL;
switch (msg->what) {
case B_COLORS_UPDATED:
{
rgb_color textColor;
if (msg->FindColor(ui_color_name(B_PANEL_TEXT_COLOR), &textColor)
== B_OK) {
BFont font;
fHowToTextView->SetFontAndColor(&font, 0, &textColor);
}
break;
}
case kMsgAccountsRightClicked:
{
BPoint point;
msg->FindPoint("point", &point);
int32 index = msg->FindInt32("index");
AccountItem* clickedItem = dynamic_cast<AccountItem*>(
fAccountsListView->ItemAt(index));
if (clickedItem == NULL || clickedItem->Type() != ACCOUNT_ITEM)
break;
BPopUpMenu rightClickMenu("accounts", false, false);
BMenuItem* inMenuItem = new BMenuItem(B_TRANSLATE("Incoming"),
NULL);
BMenuItem* outMenuItem = new BMenuItem(B_TRANSLATE("Outgoing"),
NULL);
rightClickMenu.AddItem(inMenuItem);
rightClickMenu.AddItem(outMenuItem);
BMailAccountSettings* settings = clickedItem->Account();
if (settings->IsInboundEnabled())
inMenuItem->SetMarked(true);
if (settings->IsOutboundEnabled())
outMenuItem->SetMarked(true);
BMenuItem* selectedItem = rightClickMenu.Go(point);
if (selectedItem == NULL)
break;
if (selectedItem == inMenuItem) {
AccountItem* item = dynamic_cast<AccountItem*>(
fAccountsListView->ItemAt(index + 1));
if (item == NULL)
break;
if (settings->IsInboundEnabled()) {
settings->SetInboundEnabled(false);
item->SetEnabled(false);
} else {
settings->SetInboundEnabled(true);
item->SetEnabled(true);
}
} else {
AccountItem* item = dynamic_cast<AccountItem*>(
fAccountsListView->ItemAt(index + 2));
if (item == NULL)
break;
if (settings->IsOutboundEnabled()) {
settings->SetOutboundEnabled(false);
item->SetEnabled(false);
} else {
settings->SetOutboundEnabled(true);
item->SetEnabled(true);
}
}
}
case kMsgAccountSelected:
{
int32 index;
if (msg->FindInt32("index", &index) != B_OK || index < 0) {
// deselect current item
_ReplaceConfigView(_BuildHowToView());
break;
}
AccountItem* item = (AccountItem*)fAccountsListView->ItemAt(index);
if (item != NULL)
_AccountSelected(item);
break;
}
case kMsgAddAccount:
{
frame = Frame();
autoConfigRect.OffsetTo(
frame.left + (frame.Width() - autoConfigRect.Width()) / 2,
frame.top + (frame.Width() - autoConfigRect.Height()) / 2);
autoConfigWindow = new AutoConfigWindow(autoConfigRect, this);
autoConfigWindow->Show();
break;
}
//.........这里部分代码省略.........