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


C++ CBookmarkFolder类代码示例

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


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

示例1: sizeof

void CIPBookmarkObserver::BookmarkItemAdded(void *pData,bool bFolder)
{
	IPBookmarkAddedNotification_t *pipban = reinterpret_cast<IPBookmarkAddedNotification_t *>(pData);

	/* TODO: Find the parent with the specified GUID. */
	//pipban->guidParent
	CBookmarkFolder *pParentBookmarkFolder = m_pAllBookmarks;

	m_pipbns->SetIPBroadcast(false);

	char *pSerializedData = reinterpret_cast<char *>(pData) + sizeof(IPBookmarkAddedNotification_t);

	try
	{
		if(bFolder)
		{
			CBookmarkFolder BookmarkFolder = CBookmarkFolder::Unserialize(pSerializedData);
			pParentBookmarkFolder->InsertBookmarkFolder(BookmarkFolder,pipban->uPosition);
		}
		else
		{
			CBookmark Bookmark(pSerializedData);
			pParentBookmarkFolder->InsertBookmark(Bookmark,pipban->uPosition);
		}
	}
	catch(int)
	{
		/* The actual content of the error here
		is unimportant. May be needed in the
		future if an error message will be shown
		to the user. */
	}

	m_pipbns->SetIPBroadcast(true);
}
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:35,代码来源:BookmarkIPHelper.cpp

示例2: TEST

TEST(BookmarkTest,BookmarkFolderCreation)
{
	std::wstring Name(L"Test folder name");
	CBookmarkFolder BookmarkFolder = CBookmarkFolder::Create(Name);

	EXPECT_EQ(Name,BookmarkFolder.GetName());
}
开发者ID:Rajuk-,项目名称:explorerplusplus,代码行数:7,代码来源:TestBookmarks.cpp

示例3: SecurityTestsL

LOCAL_D void SecurityTestsL()
	{
	gTestWrapper->Next(_L("[CBookmarkDb tests] Security"));
	CBookmarkDb* db = CBookmarkDb::NewL(Bookmark::EVisibilityManager, NULL);
	CleanupStack::PushL(db);
	CreateSecurityTreeL(*db);
	CheckAllL(*db);
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityDefault, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CheckAllL(*db);
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityPublic, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CheckPublicL(*db);
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityPrivate, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CheckPrivateL(*db);
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityManager, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CBookmarkFolder* publicFolder = db->FindFolder(KTxtNewFolder2);
	publicFolder->SetOwnerL(0x00001234); 
	db->CommitL();
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityAll, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CheckAllMinusOneL(*db);
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityManager, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CheckAllL(*db);
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityDefault, NULL);
	CleanupStack::PushL(db);
	db->ConstructTreeL();
	CBookmarkFolder* folder = db->FindFolder(KTxtNewFolder);
	gTestWrapper->TEST(folder != NULL);
	db->DeleteItemL(folder->Id(), ETrue);
	db->CommitL();
	CleanupStack::PopAndDestroy(db);
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:56,代码来源:t_cbookmarkdb.cpp

示例4: CheckPublicL

LOCAL_D void CheckPublicL(CBookmarkDb& aDb)
	{
	CBookmarkFolder& root = aDb.RootL();
	gTestWrapper->TEST(root.Count() == 2);
	
	CBookmarkFolder* folder = aDb.FindFolder(KTxtNewFolder);
	gTestWrapper->TEST(folder != NULL);
	gTestWrapper->TEST(folder->Count() == 2);
	
	folder = aDb.FindFolder(KTxtNewFolder2);
	gTestWrapper->TEST(folder != NULL);
	gTestWrapper->TEST(folder->Count() == 0);
	
	folder = aDb.FindFolder(KTxtNewFolder3);
	gTestWrapper->TEST(!folder);
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:16,代码来源:t_cbookmarkdb.cpp

示例5: OnBookmarkAdded

void CManageBookmarksDialog::OnBookmarkAdded(const CBookmarkFolder &ParentBookmarkFolder,
	const CBookmark &Bookmark,std::size_t Position)
{
	if(IsEqualGUID(ParentBookmarkFolder.GetGUID(),m_guidCurrentFolder))
	{
		m_pBookmarkListView->InsertBookmarkIntoListView(Bookmark,static_cast<int>(Position));
	}
}
开发者ID:menghun3,项目名称:explorerplusplus,代码行数:8,代码来源:ManageBookmarksDialog.cpp

示例6: BrowseBookmarkFolder

void CManageBookmarksDialog::BrowseBookmarkFolder(const CBookmarkFolder &BookmarkFolder)
{
	/* Temporary flag used to indicate whether history should
	be saved. It will be reset each time a folder is browsed. */
	if(m_bSaveHistory)
	{
		m_stackBack.push(m_guidCurrentFolder);
	}

	m_bSaveHistory = true;

	m_guidCurrentFolder = BookmarkFolder.GetGUID();
	m_pBookmarkTreeView->SelectFolder(BookmarkFolder.GetGUID());
	m_pBookmarkListView->InsertBookmarksIntoListView(BookmarkFolder);

	UpdateToolbarState();
}
开发者ID:menghun3,项目名称:explorerplusplus,代码行数:17,代码来源:ManageBookmarksDialog.cpp

示例7: OnBookmarkFolderAdded

void CBookmarksToolbar::OnBookmarkFolderAdded(const CBookmarkFolder &ParentBookmarkFolder,
	const CBookmarkFolder &BookmarkFolder,std::size_t Position)
{
	if(IsEqualGUID(ParentBookmarkFolder.GetGUID(),m_guidBookmarksToolbar))
	{
		InsertBookmarkFolder(BookmarkFolder,Position);
	}
}
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:8,代码来源:BookmarksToolbar.cpp

示例8: OnBookmarkFolderAdded

void CIPBookmarkItemNotifier::OnBookmarkFolderAdded(const CBookmarkFolder &ParentBookmarkFolder,
	const CBookmarkFolder &BookmarkFolder,std::size_t Position)
{
	NBookmark::SerializedData_t sd = BookmarkFolder.Serialize();
	BookmarkItemAdded(ParentBookmarkFolder,sd,Position,true);

	delete sd.pData;
}
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:8,代码来源:BookmarkIPHelper.cpp

示例9: CommitTestsL

LOCAL_D void CommitTestsL()
	{
	gTestWrapper->Next(_L("[CBookmarkDb tests] Commit"));
	CBookmarkDb* db = CBookmarkDb::NewL(Bookmark::EVisibilityDefault, NULL);
	CleanupStack::PushL(db);
	CreateTreeL(db);
	db->CommitL();
	CleanupStack::PopAndDestroy(db);
	
	db = CBookmarkDb::NewL(Bookmark::EVisibilityDefault, NULL);
	CleanupStack::PushL(db);
	
	CheckDatabaseL(*db);
	
	CBookmarkFolder* folder = db->FindFolder(KTxtFolder1);
	db->DeleteItemL(folder->Id(), ETrue);
	gTestWrapper->TEST(db->RootL().Count() == 0);
	
	CleanupStack::PopAndDestroy(db);
	
	// The delete has not been committed so it should reload 
	db = CBookmarkDb::NewL(Bookmark::EVisibilityDefault, NULL);
	CleanupStack::PushL(db);
	
	CheckDatabaseL(*db);
	
	folder = db->FindFolder(KTxtFolder1);
	db->DeleteItemL(folder->Id(), ETrue);
	gTestWrapper->TEST(db->RootL().Count() == 0);
	
	User::LeaveIfError(db->DeleteIconL(gIconId1));
	User::LeaveIfError(db->DeleteIconL(gIconId2));
	
	db->CommitL();
	
	CleanupStack::PopAndDestroy(db);
	
	// The delete has been committed so it should not reload 
	db = CBookmarkDb::NewL(Bookmark::EVisibilityDefault, NULL);
	CleanupStack::PushL(db);
	CBookmarkFolder& root = db->RootL();
	gTestWrapper->TEST(root.Count() == 0);
	CleanupStack::PopAndDestroy(db);
	}
开发者ID:kuailexs,项目名称:symbiandump-mw2,代码行数:44,代码来源:t_cbookmarkdb.cpp

示例10: GetBookmarkFolderColumnInfo

void CManageBookmarksDialog::GetBookmarkFolderColumnInfo(const CBookmarkFolder &BookmarkFolder,
	CManageBookmarksDialogPersistentSettings::ColumnType_t ColumnType,TCHAR *szColumn,size_t cchBuf)
{
	switch(ColumnType)
	{
	case CManageBookmarksDialogPersistentSettings::COLUMN_TYPE_NAME:
		StringCchCopy(szColumn,cchBuf,BookmarkFolder.GetName().c_str());
		break;

	case CManageBookmarksDialogPersistentSettings::COLUMN_TYPE_LOCATION:
		StringCchCopy(szColumn,cchBuf,EMPTY_STRING);
		break;

	case CManageBookmarksDialogPersistentSettings::COLUMN_TYPE_VISIT_DATE:
		StringCchCopy(szColumn,cchBuf,EMPTY_STRING);
		break;

	case CManageBookmarksDialogPersistentSettings::COLUMN_TYPE_VISIT_COUNT:
		StringCchCopy(szColumn,cchBuf,EMPTY_STRING);
		break;

	case CManageBookmarksDialogPersistentSettings::COLUMN_TYPE_ADDED:
		{
			/* TODO: Friendly dates. */
			FILETIME ftCreated = BookmarkFolder.GetDateCreated();
			CreateFileTimeString(&ftCreated,szColumn,static_cast<int>(cchBuf),FALSE);
		}
		break;

	case CManageBookmarksDialogPersistentSettings::COLUMN_TYPE_LAST_MODIFIED:
		{
			/* TODO: Friendly dates. */
			FILETIME ftModified = BookmarkFolder.GetDateModified();
			CreateFileTimeString(&ftModified,szColumn,static_cast<int>(cchBuf),FALSE);
		}
		break;

	default:
		assert(FALSE);
		break;
	}
}
开发者ID:menghun3,项目名称:explorerplusplus,代码行数:42,代码来源:ManageBookmarksDialog.cpp

示例11: LoadString

void CManageBookmarksDialog::OnNewFolder()
{
	TCHAR szTemp[64];
	LoadString(GetInstance(),IDS_BOOKMARKS_NEWBOOKMARKFOLDER,szTemp,SIZEOF_ARRAY(szTemp));
	CBookmarkFolder NewBookmarkFolder = CBookmarkFolder::Create(szTemp);

	/* Save the folder GUID, so that it can be selected and
	placed into edit mode once the bookmark notification
	comes through. */
	m_bNewFolderAdded = true;
	m_guidNewFolder = NewBookmarkFolder.GetGUID();

	HWND hTreeView = GetDlgItem(m_hDlg,IDC_BOOKMARK_TREEVIEW);
	HTREEITEM hSelectedItem = TreeView_GetSelection(hTreeView);

	assert(hSelectedItem != NULL);

	CBookmarkFolder &ParentBookmarkFolder = m_pBookmarkTreeView->GetBookmarkFolderFromTreeView(
		hSelectedItem);
	ParentBookmarkFolder.InsertBookmarkFolder(NewBookmarkFolder);
}
开发者ID:menghun3,项目名称:explorerplusplus,代码行数:21,代码来源:ManageBookmarksDialog.cpp

示例12: OnBookmarkFolderAdded

void CManageBookmarksDialog::OnBookmarkFolderAdded(const CBookmarkFolder &ParentBookmarkFolder,
	const CBookmarkFolder &BookmarkFolder,std::size_t Position)
{
	m_pBookmarkTreeView->BookmarkFolderAdded(ParentBookmarkFolder,BookmarkFolder,Position);

	if(IsEqualGUID(ParentBookmarkFolder.GetGUID(),m_guidCurrentFolder))
	{
		int iItem = m_pBookmarkListView->InsertBookmarkFolderIntoListView(BookmarkFolder,static_cast<int>(Position));

		if(IsEqualGUID(BookmarkFolder.GetGUID(),m_guidNewFolder))
		{
			HWND hListView = GetDlgItem(m_hDlg,IDC_MANAGEBOOKMARKS_LISTVIEW);

			SetFocus(hListView);
			NListView::ListView_SelectAllItems(hListView,FALSE);
			NListView::ListView_SelectItem(hListView,iItem,TRUE);
			ListView_EditLabel(hListView,iItem);

			m_bNewFolderAdded = false;
		}
	}
}
开发者ID:menghun3,项目名称:explorerplusplus,代码行数:22,代码来源:ManageBookmarksDialog.cpp

示例13:

CManageBookmarksDialog::CManageBookmarksDialog(HINSTANCE hInstance,int iResource,HWND hParent,
	CBookmarkFolder &AllBookmarks) :
m_AllBookmarks(AllBookmarks),
m_guidCurrentFolder(AllBookmarks.GetGUID()),
m_bNewFolderAdded(false),
m_bListViewInitialized(false),
m_bSearchFieldBlank(true),
m_bEditingSearchField(false),
m_hEditSearchFont(NULL),
m_bSaveHistory(true),
CBaseDialog(hInstance,iResource,hParent,true)
{
	m_pmbdps = &CManageBookmarksDialogPersistentSettings::GetInstance();

	if(!m_pmbdps->m_bInitialized)
	{
		m_pmbdps->m_guidSelected = AllBookmarks.GetGUID();
		m_pmbdps->m_setExpansion.insert(AllBookmarks.GetGUID());

		m_pmbdps->m_bInitialized = true;
	}
}
开发者ID:menghun3,项目名称:explorerplusplus,代码行数:22,代码来源:ManageBookmarksDialog.cpp

示例14:

CAddBookmarkDialog::CAddBookmarkDialog(HINSTANCE hInstance,int iResource,HWND hParent,
	CBookmarkFolder &AllBookmarks,CBookmark &Bookmark) :
	CBaseDialog(hInstance, iResource, hParent, true),
	m_AllBookmarks(AllBookmarks),
	m_Bookmark(Bookmark),
	m_ErrorBrush(CreateSolidBrush(ERROR_BACKGROUND_COLOR))
{
	m_pabdps = &CAddBookmarkDialogPersistentSettings::GetInstance();

	/* If the singleton settings class has not been initialized
	yet, mark the root bookmark as selected and expanded. This
	is only needed the first time this dialog is shown, as
	selection and expansion info will be saved each time after
	that. */
	if(!m_pabdps->m_bInitialized)
	{
		m_pabdps->m_guidSelected = AllBookmarks.GetGUID();
		m_pabdps->m_setExpansion.insert(AllBookmarks.GetGUID());

		m_pabdps->m_bInitialized = true;
	}
}
开发者ID:derceg,项目名称:explorerplusplus,代码行数:22,代码来源:AddBookmarkDialog.cpp

示例15: BookmarkItemAdded

void CIPBookmarkItemNotifier::BookmarkItemAdded(const CBookmarkFolder &ParentBookmarkFolder,
	const NBookmark::SerializedData_t &sd,std::size_t Position,bool bFolder)
{
	IPBookmarkAddedNotification_t ipban;

	if(bFolder)
	{
		ipban.Type = NExplorerplusplus::IP_NOTIFICATION_TYPE_BOOKMARK_FOLDER_ADDED;
	}
	else
	{
		ipban.Type = NExplorerplusplus::IP_NOTIFICATION_TYPE_BOOKMARK_ADDED;
	}

	ipban.guidParent = ParentBookmarkFolder.GetGUID();
	ipban.uPosition = static_cast<UINT>(Position);

	EnumerationData_t ed = SetupIPData(&ipban,sizeof(ipban),sd.pData,sd.uSize);

	EnumWindows(BookmarkNotifierEnumWindowsStub,reinterpret_cast<LPARAM>(&ed));

	delete ed.pData;
}
开发者ID:linquize,项目名称:explorerplus-custom,代码行数:23,代码来源:BookmarkIPHelper.cpp


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