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


C++ Account::GetIncomingIndexType方法代码示例

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


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

示例1: OnInputAction


//.........这里部分代码省略.........
				}
			}
			return TRUE;
		}
		case OpInputAction::ACTION_MAIL_HIDE_INDEX:
		{
			if (g_input_manager->GetActionState(action,this) & OpInputAction::STATE_ENABLED)
			{
				if (action->GetActionDataString())
				{
					Index* index = g_m2_engine->GetIndexer()->GetSubscribedFolderIndex(g_m2_engine->GetAccountById(id), action->GetActionDataString(), 0, action->GetActionText(), FALSE, FALSE);	
					if (index)
						OpStatus::Ignore(g_m2_engine->GetAccountById(id)->RemoveSubscribedFolder(index->GetId()));
				}
				else
				{
					if ((IndexTypes::FIRST_CATEGORY <= id && id <= IndexTypes::LAST_CATEGORY) ||
						(IndexTypes::FIRST_ACCOUNT <= id && id <= IndexTypes::LAST_ACCOUNT))
					{
						g_m2_engine->GetIndexer()->SetCategoryVisible(id, FALSE);
					}
					else
					{
						g_m2_engine->GetIndexer()->GetIndexById(id)->SetVisible(FALSE);
					}
				}
				return TRUE;
			}
			break;
		}
		case OpInputAction::ACTION_NEW_NEWSFEED:
		{
			OpAccordion::OpAccordionItem * accordion_item = m_accordion->GetItemById(action->GetActionData());
			if (accordion_item)
			{
				m_accordion->ExpandItem(accordion_item, TRUE);
				accordion_item->GetWidget()->OnInputAction(action);
			}
			return TRUE;
		}
		case OpInputAction::ACTION_NEW_FOLDER:
		{
			index_gid_t parent_id = 0;
			if (action->GetActionData())
			{
				parent_id = action->GetActionData();
			}
			else if (g_application->HasMail()) // clicking new folder outside an accordion item when you have a mail account should default back to new label
			{
				parent_id = IndexTypes::CATEGORY_LABELS;
			}
			else if (g_application->HasFeeds()) // but when there is no mail account, it should make a new feed folder
			{
				parent_id = g_m2_engine->GetAccountManager()->GetRSSAccount(FALSE)->GetAccountId() + IndexTypes::FIRST_ACCOUNT;
			}
			if (!parent_id)
				return TRUE;

			OpAccordion::OpAccordionItem * accordion_item = m_accordion->GetItemById(parent_id);

			if (!accordion_item) // the section is hidden... the action can still be performed in any accesstreeview, but won't make it appear
				accordion_item = m_accordion->GetItemByIndex(0);

			if (accordion_item)
			{
				m_accordion->ExpandItem(accordion_item, TRUE);
				static_cast<AccessTreeView*>(accordion_item->GetWidget())->CreateNewFolder(parent_id);
			}

			return TRUE;
		}
		case OpInputAction::ACTION_EDIT_PROPERTIES:
		{
			index_gid_t id = action->GetActionData();
			// Edit Properties for filters
			if (id == IndexTypes::CATEGORY_LABELS )
			{
				LabelPropertiesController* controller = OP_NEW(LabelPropertiesController, (id));
				ShowDialog(controller, g_global_ui_context, GetParentDesktopWindow());
			}
			// Edit Properties for accounts (imap, rss, pop, etc)
			else if (id >= IndexTypes::FIRST_ACCOUNT && id < IndexTypes::LAST_ACCOUNT)
			{
				Account* account = g_m2_engine->GetAccountById(id-IndexTypes::FIRST_ACCOUNT);
				if (account)
				{
					if (account->GetIncomingIndexType() == IndexTypes::NEWSFEED_INDEX)
					{
						AccountSubscriptionDialog* dialog = OP_NEW(AccountSubscriptionDialog, ());
						if (dialog)
							dialog->Init(AccountTypes::RSS, GetParentDesktopWindow());
					}
					else
					{
						AccountPropertiesDialog* dialog = OP_NEW(AccountPropertiesDialog, (FALSE));
						if (dialog)
							dialog->Init(account->GetAccountId(),GetParentDesktopWindow());
					}
				}
			}
开发者ID:prestocore,项目名称:browser,代码行数:101,代码来源:AccordionMailPanel.cpp


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