ReactOS 0.4.15-dev-7958-gcd0bb1a
BookmarkList Struct Reference

#include <favorites.h>

Inheritance diagram for BookmarkList:
Collaboration diagram for BookmarkList:

Public Member Functions

void import_IE_favorites (struct ShellDirectory &dir, HWND hwnd)
 import Internet Explorer bookmarks from Favorites folder into bookmark list
 
void read (const_XMLPos &pos)
 read bookmark list from XBEL formated XML tree
 
void write (XMLPos &pos) const
 write bookmark list into XBEL formated XML tree
 
void fill_tree (HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const
 fill treeview control with bookmark tree content
 
- Public Member Functions inherited from list< BookmarkNode >
 list (size_type __n, const_reference __val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
 
 list (const value_type *__first, const value_type *__last, const allocator_type &__a=allocator_type())
 
 list (const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
 
 list (const allocator_type &__a=allocator_type())
 
 list (const _Self &__x)
 
 list (__move_source< _Self > src)
 
 list (const allocator_type &__a=allocator_type())
 
 list (size_type __n, const BookmarkNode &__x=BookmarkNode(), const allocator_type &__a=allocator_type())
 
 list (__move_source< _Self > src)
 
 list (const value_type *__first, const value_type *__last, const allocator_type &__a=allocator_type())
 
 list (const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
 
 list (const _Self &__x)
 
 list (const allocator_type &__a=allocator_type())
 
 list (size_type __n, const value_type &__val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
 
 list (const value_type *__first, const value_type *__last, const allocator_type &__a=allocator_type())
 
 list (const_iterator __first, const_iterator __last, const allocator_type &__a=allocator_type())
 
 list (const _Self &__x)
 
 list (__move_source< _Self > src)
 
 ~list ()
 
_Selfoperator= (const _Self &__x)
 
_Selfoperator= (const _Self &__x)
 
_Selfoperator= (const _Self &__x)
 
iterator begin ()
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator end ()
 
const_iterator end () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
size_type size () const
 
size_type size () const
 
size_type size () const
 
size_type max_size () const
 
size_type max_size () const
 
size_type max_size () const
 
reference front ()
 
const_reference front () const
 
reference front ()
 
const_reference front () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
reference back ()
 
const_reference back () const
 
reference back ()
 
const_reference back () const
 
void swap (_Self &__x)
 
void swap (_Self &__x)
 
void swap (_Self &__x)
 
iterator insert (iterator __pos, const_reference __x=value_type())
 
void insert (iterator __pos, const value_type *__first, const value_type *__last)
 
void insert (iterator __pos, const_iterator __first, const_iterator __last)
 
void insert (iterator __pos, size_type __n, const_reference __x)
 
iterator insert (iterator __pos, const BookmarkNode &__x=BookmarkNode())
 
void insert (iterator __pos, const BookmarkNode *__first, const BookmarkNode *__last)
 
void insert (iterator __pos, const_iterator __first, const_iterator __last)
 
void insert (iterator __pos, iterator __first, iterator __last)
 
void insert (iterator __pos, size_type __n, const BookmarkNode &__x)
 
iterator insert (iterator __pos, const_reference __x=_STLP_DEFAULT_CONSTRUCTED(value_type))
 
void insert (iterator __pos, const value_type *__first, const value_type *__last)
 
void insert (iterator __pos, const_iterator __first, const_iterator __last)
 
void insert (iterator __pos, size_type __n, const value_type &__x)
 
void push_front (const_reference __x)
 
void push_front (const_reference __x)
 
void push_front (const value_type &__x)
 
void push_back (const_reference __x)
 
void push_back (const_reference __x)
 
void push_back (const value_type &__x)
 
iterator erase (iterator __pos)
 
iterator erase (iterator __first, iterator __last)
 
iterator erase (iterator __pos)
 
iterator erase (iterator __first, iterator __last)
 
iterator erase (iterator __pos)
 
iterator erase (iterator __first, iterator __last)
 
void resize (size_type __new_size, const_reference __x=value_type())
 
void resize (size_type __new_size, const BookmarkNode &__x=BookmarkNode())
 
void resize (size_type __new_size, const value_type &__x=_STLP_DEFAULT_CONSTRUCTED(value_type))
 
void pop_front ()
 
void pop_front ()
 
void pop_front ()
 
void pop_back ()
 
void pop_back ()
 
void pop_back ()
 
void assign (size_type __n, const_reference __val)
 
void assign (const value_type *__first2, const value_type *__last2)
 
void assign (const_iterator __first2, const_iterator __last2)
 
void assign (const BookmarkNode *__first, const BookmarkNode *__last)
 
void assign (iterator __first, iterator __last)
 
void assign (const_iterator __first, const_iterator __last)
 
void assign (size_type __n, const BookmarkNode &__val)
 
void assign (size_type __n, const value_type &__val)
 
void assign (const value_type *__first, const value_type *__last)
 
void assign (const_iterator __first, const_iterator __last)
 
void _M_fill_assign (size_type __n, const_reference __val)
 
void splice (iterator __pos, _Self &__x)
 
void splice (iterator __pos, _Self &__x, iterator __i)
 
void splice (iterator __pos, _Self &__x, iterator __first, iterator __last)
 
void splice (iterator __pos, _Self &__x)
 
void splice (iterator __pos, _Self &__x, iterator __i)
 
void splice (iterator __pos, _Self &__x, iterator __first, iterator __last)
 
void splice (iterator __pos, _Self &__x)
 
void splice (iterator __pos, _Self &__x, iterator __i)
 
void splice (iterator __pos, _Self &__x, iterator __first, iterator __last)
 
void remove (const_reference __val)
 
void remove (const BookmarkNode &__x)
 
void remove (const_reference __val)
 
void unique ()
 
void unique ()
 
void unique ()
 
void merge (_Self &__x)
 
void merge (_Self &__x)
 
void merge (_Self &__x)
 
void reverse ()
 
void reverse ()
 
void reverse ()
 
void sort ()
 
void sort ()
 
void sort ()
 
allocator_type get_allocator () const
 
allocator_type get_allocator () const
 
bool empty () const
 
bool empty () const
 
void clear ()
 
void clear ()
 

Additional Inherited Members

- Public Types inherited from list< BookmarkNode >
typedef BookmarkNode value_type
 
typedef BookmarkNode value_type
 
typedef value_typepointer
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef const value_typeconst_reference
 
typedef size_t size_type
 
typedef size_t size_type
 
typedef ptrdiff_t difference_type
 
typedef ptrdiff_t difference_type
 
typedef _Base::allocator_type allocator_type
 
typedef _Alloc_traits< value_type, _Alloc >::allocator_type allocator_type
 
typedef bidirectional_iterator_tag _Iterator_category
 
typedef bidirectional_iterator_tag _Iterator_category
 
typedef _STLP_PRIV _List_iterator< BookmarkNode, _Nonconst_traits< BookmarkNode > > iterator
 
typedef _STLP_PRIV _DBG_iter< _Base, _STLP_PRIV _DbgTraits< _Nonconst_traits< value_type > > > iterator
 
typedef _STLP_PRIV _List_iterator< value_type, _Nonconst_traits< value_type > > iterator
 
typedef _STLP_PRIV _List_iterator< BookmarkNode, _Const_traits< BookmarkNode > > const_iterator
 
typedef _STLP_PRIV _DBG_iter< _Base, _STLP_PRIV _DbgTraits< _Const_traits< value_type > > > const_iterator
 
typedef _STLP_PRIV _List_iterator< value_type, _Const_traits< value_type > > const_iterator
 
- Public Attributes inherited from list< BookmarkNode >
 _STLP_DECLARE_BIDIRECTIONAL_REVERSE_ITERATORS
 
struct listnext
 
struct listprev
 
- Protected Member Functions inherited from list< BookmarkNode >
_Node_base_M_create_node (const_reference __x=value_type())
 

Detailed Description

Definition at line 76 of file favorites.h.

Member Function Documentation

◆ fill_tree()

void BookmarkList::fill_tree ( HWND  hwnd,
HTREEITEM  parent,
HIMAGELIST  himagelist,
HDC  hdc_wnd 
) const

fill treeview control with bookmark tree content

Definition at line 327 of file favorites.cpp.

328{
329 TV_INSERTSTRUCT tvi;
330
331 tvi.hParent = parent;
332 tvi.hInsertAfter = TVI_LAST;
333
334 TV_ITEM& tv = tvi.item;
336
337 for(const_iterator it=begin(); it!=end(); ++it) {
338 const BookmarkNode& node = *it;
339
340 tv.lParam = (LPARAM)&node;
341
342 if (node._type == BookmarkNode::BMNT_FOLDER) {
343 const BookmarkFolder& folder = *node._pfolder;
344
345 tv.pszText = (LPTSTR)folder._name.c_str();
346 tv.iImage = 3; // folder
347 tv.iSelectedImage = 4; // open folder
348 HTREEITEM hitem = TreeView_InsertItem(hwnd, &tvi);
349
350 folder._bookmarks.fill_tree(hwnd, hitem, himagelist, hdc_wnd);
351 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
352 const Bookmark& bookmark = *node._pbookmark;
353
354 tv.pszText = (LPTSTR)bookmark._name.c_str();
355 tv.iImage = 1; // bookmark
356 tv.iSelectedImage = 2; // selected bookmark
357
358 if (!bookmark._icon_path.empty()) {
359 const Icon& icon = g_Globals._icon_cache.extract(bookmark._icon_path, bookmark._icon_idx);
360
361 if ((ICON_ID)icon != ICID_NONE)
362 tv.iImage = tv.iSelectedImage = icon.add_to_imagelist(himagelist, hdc_wnd);
363 }
364
366 }
367 }
368}
_STLP_PRIV _List_iterator< BookmarkNode, _Const_traits< BookmarkNode > > const_iterator
Definition: _list.h:276
iterator begin()
Definition: _list.h:367
iterator end()
Definition: _list.h:370
r parent
Definition: btrfs.c:3010
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
ICON_ID
Definition: globals.h:62
@ ICID_NONE
Definition: globals.h:64
#define TVI_LAST
Definition: commctrl.h:3370
#define TVIF_TEXT
Definition: commctrl.h:3266
#define TVIF_IMAGE
Definition: commctrl.h:3267
#define TV_INSERTSTRUCT
Definition: commctrl.h:3377
#define TV_ITEM
Definition: commctrl.h:3300
#define TVIF_PARAM
Definition: commctrl.h:3268
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3412
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3271
int _icon_idx
Definition: favorites.h:40
String _icon_path
Definition: favorites.h:39
String _name
Definition: favorites.h:36
IconCache _icon_cache
Definition: globals.h:285
const Icon & extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: explorer.cpp:416
Definition: globals.h:96
int add_to_imagelist(HIMAGELIST himl, HDC hdc_wnd, COLORREF bk_color=GetSysColor(COLOR_WINDOW), HBRUSH bk_brush=GetSysColorBrush(COLOR_WINDOW)) const
Definition: explorer.cpp:306
Definition: fci.c:116
Definition: dlist.c:348
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LPARAM
Definition: windef.h:208
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by MainFrameBase::FillBookmarks().

◆ import_IE_favorites()

void BookmarkList::import_IE_favorites ( struct ShellDirectory dir,
HWND  hwnd 
)

import Internet Explorer bookmarks from Favorites folder into bookmark list

Todo:
read shell links

Definition at line 372 of file favorites.cpp.

373{
375
377
378 for(Entry*entry=dir._down; entry; entry=entry->_next) {
379 if (entry->_shell_attribs & SFGAO_HIDDEN) // ignore files like "desktop.ini"
380 continue;
381
382 String name;
383
384 if (entry->_etype == ET_SHELL)
385 name = dir._folder.get_name(static_cast<ShellEntry*>(entry)->_pidl);
386 else
387 name = entry->_display_name;
388
389 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
390 BookmarkFolder new_folder;
391
392 new_folder._name = DecodeXMLString(name);
393
394 if (entry->_etype == ET_SHELL) {
395 ShellDirectory new_dir(dir._folder, static_cast<ShellEntry*>(entry)->_pidl, hwnd);
397 } else {
398 entry->get_path(path, COUNTOF(path));
401 }
402
403 push_back(new_folder);
404 } else {
405 Bookmark bookmark;
406
407 bookmark._name = DecodeXMLString(name);
408
409 entry->get_path(path, COUNTOF(path));
410 _tsplitpath_s(path, NULL, 0, NULL, 0, NULL, 0, ext, COUNTOF(ext));
411
412 if (!_tcsicmp(ext, TEXT(".url"))) {
413 bookmark.read_url(path);
414 push_back(bookmark);
415 } else {
417 //assert(0);
418 }
419 }
420 }
421}
unsigned int dir
Definition: maze.c:112
void push_back(const_reference __x)
Definition: _list.h:509
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
static const WCHAR *const ext[]
Definition: module.c:53
@ SCAN_DONT_EXTRACT_ICONS
Definition: entries.h:53
@ ET_SHELL
Definition: entries.h:37
static void new_dir(void)
Definition: check.c:1099
#define _tsplitpath_s
Definition: tchar.h:687
uint32_t entry
Definition: isohybrid.c:63
#define TEXT(s)
Definition: k32.h:26
#define COUNTOF(x)
Definition: utility.h:93
#define _MAX_EXT
Definition: utility.h:76
XS_String DecodeXMLString(const std::string &str)
decode XML string literals
Definition: xmlstorage.cpp:478
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
ShellFolder & GetDesktopFolder()
String _name
Definition: favorites.h:88
BookmarkList _bookmarks
Definition: favorites.h:90
void import_IE_favorites(struct ShellDirectory &dir, HWND hwnd)
import Internet Explorer bookmarks from Favorites folder into bookmark list
Definition: favorites.cpp:372
bool read_url(LPCTSTR path)
read .URL file
Definition: favorites.cpp:54
base of all file and directory entries
Definition: entries.h:83
shell folder entry
Definition: shellfs.h:54
shell file/directory entry
Definition: shellfs.h:31
ShellPath _pidl
Definition: shellfs.h:44
Definition: name.c:39
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
char TCHAR
Definition: xmlstorage.h:189
#define _tcsicmp
Definition: xmlstorage.h:205
#define SORT_NAME
Definition: xpath.c:439

Referenced by Favorites::import_IE_favorites(), and import_IE_favorites().

◆ read()

void BookmarkList::read ( const_XMLPos &  pos)

read bookmark list from XBEL formated XML tree

Definition at line 281 of file favorites.cpp.

282{
283 const XMLNode::Children& children = pos->get_children();
284
285 for(XMLNode::Children::const_iterator it=children.begin(); it!=children.end(); ++it) {
286 const XMLNode& node = **it;
287 const_XMLPos sub_pos(&node);
288
289 if (node == "folder") {
291
292 folder.read(sub_pos);
293
295 } else if (node == "bookmark") {
296 Bookmark bookmark;
297
298 if (bookmark.read(sub_pos))
299 push_back(bookmark);
300 }
301 }
302}
bool read(const_XMLPos &pos)
convert XBEL bookmark node
Definition: favorites.cpp:86

Referenced by BookmarkFolder::read(), and Favorites::read().

◆ write()

void BookmarkList::write ( XMLPos &  pos) const

write bookmark list into XBEL formated XML tree

Definition at line 305 of file favorites.cpp.

306{
307 for(const_iterator it=begin(); it!=end(); ++it) {
308 const BookmarkNode& node = *it;
309
310 if (node._type == BookmarkNode::BMNT_FOLDER) {
311 const BookmarkFolder& folder = *node._pfolder;
312
313 folder.write(pos);
314
315 pos.back();
316 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
317 const Bookmark& bookmark = *node._pbookmark;
318
319 if (!bookmark._url.empty())
320 bookmark.write(pos);
321 }
322 }
323}
void write(XMLPos &pos) const
write XBEL bookmark node
Definition: favorites.cpp:125
String _url
Definition: favorites.h:38

Referenced by Favorites::write(), and BookmarkFolder::write().


The documentation for this struct was generated from the following files: