ReactOS  0.4.12-dev-75-g00dd17e
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 More...
 
void read (const_XMLPos &pos)
 read bookmark list from XBEL formated XML tree More...
 
void write (XMLPos &pos) const
 write bookmark list into XBEL formated XML tree More...
 
void fill_tree (HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const
 fill treeview control with bookmark tree content More...
 
- 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.

Referenced by fill_tree(), and MainFrameBase::FillBookmarks().

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 
365  (void)TreeView_InsertItem(hwnd, &tvi);
366  }
367  }
368 }
Definition: graphics.c:170
iterator begin()
Definition: _list.h:367
Definition: fci.c:115
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
BookmarkList _bookmarks
Definition: favorites.h:90
ICON_ID
Definition: globals.h:62
int _icon_idx
Definition: favorites.h:40
#define TVIF_SELECTEDIMAGE
Definition: commctrl.h:3238
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define TreeView_InsertItem(hwnd, lpis)
Definition: commctrl.h:3379
const Icon & extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: explorer.cpp:416
Bookmark * _pbookmark
Definition: favorites.h:71
BookmarkFolder * _pfolder
Definition: favorites.h:72
String _name
Definition: favorites.h:88
#define TVI_LAST
Definition: commctrl.h:3337
_STLP_PRIV _List_iterator< BookmarkNode, _Const_traits< BookmarkNode > > const_iterator
Definition: _list.h:276
r parent
Definition: btrfs.c:2644
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
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
void fill_tree(HWND hwnd, HTREEITEM parent, HIMAGELIST, HDC hdc_wnd) const
fill treeview control with bookmark tree content
Definition: favorites.cpp:327
String _name
Definition: favorites.h:36
BOOKMARKNODE_TYPE _type
Definition: favorites.h:68
#define TV_ITEM
Definition: commctrl.h:3267
#define TVIF_TEXT
Definition: commctrl.h:3233
iterator end()
Definition: _list.h:370
#define TVIF_IMAGE
Definition: commctrl.h:3234
Definition: globals.h:96
#define TVIF_PARAM
Definition: commctrl.h:3235
#define TV_INSERTSTRUCT
Definition: commctrl.h:3344
String _icon_path
Definition: favorites.h:39
#define LPARAM
Definition: msvc.h:38
IconCache _icon_cache
Definition: globals.h:285

◆ 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.

Referenced by import_IE_favorites().

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);
396  new_folder._bookmarks.import_IE_favorites(new_dir, hwnd);
397  } else {
398  entry->get_path(path, COUNTOF(path));
399  ShellDirectory new_dir(GetDesktopFolder(), path, hwnd);
400  new_folder._bookmarks.import_IE_favorites(new_dir, hwnd);
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 }
void push_back(const_reference __x)
Definition: _list.h:509
#define _tsplitpath_s
Definition: tchar.h:687
BookmarkList _bookmarks
Definition: favorites.h:90
#define _tcsicmp
Definition: xmlstorage.h:205
uint8_t entry
Definition: isohybrid.c:63
shell folder entry
Definition: shellfs.h:53
static WCHAR String[]
Definition: stringtable.c:55
bool read_url(LPCTSTR path)
read .URL file
Definition: favorites.cpp:54
smooth NULL
Definition: ftsmooth.c:416
char ext[3]
Definition: mkdosfs.c:358
String _name
Definition: favorites.h:88
String get_name(LPCITEMIDLIST pidl, SHGDNF flags=SHGDN_NORMAL) const
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
XS_String DecodeXMLString(const std::string &str)
decode XML string literals
Definition: xmlstorage.cpp:478
char TCHAR
Definition: xmlstorage.h:189
void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:353
Entry * _down
Definition: entries.h:93
#define MAX_PATH
Definition: compat.h:26
#define SORT_NAME
Definition: xpath.c:441
ShellFolder _folder
Definition: shellfs.h:112
void import_IE_favorites(struct ShellDirectory &dir, HWND hwnd)
import Internet Explorer bookmarks from Favorites folder into bookmark list
Definition: favorites.cpp:372
String _name
Definition: favorites.h:36
ShellFolder & GetDesktopFolder()
#define _MAX_EXT
Definition: utility.h:76
#define TEXT(s)
Definition: k32.h:26
Definition: services.c:325
static void new_dir(void)
Definition: check.c:1099
#define COUNTOF(x)
Definition: utility.h:93
base of all file and directory entries
Definition: entries.h:82
GLuint const GLchar * name
Definition: glext.h:6031

◆ 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 
294  push_back(folder);
295  } else if (node == "bookmark") {
296  Bookmark bookmark;
297 
298  if (bookmark.read(sub_pos))
299  push_back(bookmark);
300  }
301  }
302 }
void push_back(const_reference __x)
Definition: _list.h:509
void read(const_XMLPos &pos)
read bookmark folder from XBEL formated XML tree
Definition: favorites.cpp:160
Definition: graphics.c:170
struct CFFOLDER folder
Definition: fdi.c:110
bool read(const_XMLPos &pos)
convert XBEL bookmark node
Definition: favorites.cpp:86

◆ 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 }
Definition: graphics.c:170
iterator begin()
Definition: _list.h:367
Definition: fci.c:115
Bookmark * _pbookmark
Definition: favorites.h:71
BookmarkFolder * _pfolder
Definition: favorites.h:72
_STLP_PRIV _List_iterator< BookmarkNode, _Const_traits< BookmarkNode > > const_iterator
Definition: _list.h:276
String _url
Definition: favorites.h:38
BOOKMARKNODE_TYPE _type
Definition: favorites.h:68
iterator end()
Definition: _list.h:370
void write(XMLPos &pos) const
write XBEL bookmark node
Definition: favorites.cpp:125
void write(XMLPos &pos) const
write bookmark folder content from XBEL formated XML tree
Definition: favorites.cpp:176

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