本文整理汇总了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);
}
示例2: TEST
TEST(BookmarkTest,BookmarkFolderCreation)
{
std::wstring Name(L"Test folder name");
CBookmarkFolder BookmarkFolder = CBookmarkFolder::Create(Name);
EXPECT_EQ(Name,BookmarkFolder.GetName());
}
示例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);
}
示例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);
}
示例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));
}
}
示例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();
}
示例7: OnBookmarkFolderAdded
void CBookmarksToolbar::OnBookmarkFolderAdded(const CBookmarkFolder &ParentBookmarkFolder,
const CBookmarkFolder &BookmarkFolder,std::size_t Position)
{
if(IsEqualGUID(ParentBookmarkFolder.GetGUID(),m_guidBookmarksToolbar))
{
InsertBookmarkFolder(BookmarkFolder,Position);
}
}
示例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;
}
示例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);
}
示例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;
}
}
示例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);
}
示例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;
}
}
}
示例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;
}
}
示例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;
}
}
示例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;
}