ReactOS 0.4.15-dev-7942-gd23573b
FavoritesMenu Struct Reference

Bookmarks sub-startmenu. More...

#include <startmenu.h>

Inheritance diagram for FavoritesMenu:
Collaboration diagram for FavoritesMenu:

Public Types

typedef StartMenu super
 
- Public Types inherited from StartMenu
typedef ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > > super
 
- Public Types inherited from ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >
typedef OwnerDrawParent< DialogWindowsuper
 
- Public Types inherited from OwnerDrawParent< DialogWindow >
typedef DialogWindow super
 
- Public Types inherited from DialogWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 FavoritesMenu (HWND hwnd, const StartMenuCreateInfo &create_info)
 
- Public Member Functions inherited from StartMenu
 StartMenu (HWND hwnd, int icon_size=ICON_SIZE_SMALL)
 
 StartMenu (HWND hwnd, const StartMenuCreateInfo &create_info, int icon_size=ICON_SIZE_SMALL)
 
 ~StartMenu ()
 
- Public Member Functions inherited from ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >
 ExtContextMenuHandlerT (HWND hwnd)
 
 ExtContextMenuHandlerT (HWND hwnd, const PARA &info)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from OwnerDrawParent< DialogWindow >
 OwnerDrawParent (HWND hwnd)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from DialogWindow
 DialogWindow (HWND hwnd)
 
 ~DialogWindow ()
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

Protected Member Functions

virtual int Command (int id, int code)
 
virtual void AddEntries ()
 
- Protected Member Functions inherited from StartMenu
LRESULT Init (LPCREATESTRUCT pcs)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
int Command (int id, int code)
 
void ResizeButtons (int cx)
 
virtual void AddEntries ()
 
ShellEntryMap::iterator AddEntry (const String &title, ICON_ID icon_id, Entry *entry)
 
ShellEntryMap::iterator AddEntry (const String &title, ICON_ID icon_id=ICID_NONE, int id=-1)
 
ShellEntryMap::iterator AddEntry (const ShellFolder folder, ShellEntry *entry)
 
ShellEntryMap::iterator AddEntry (const ShellFolder folder, Entry *entry)
 
void AddShellEntries (const ShellDirectory &dir, int max=-1, const String &ignore="")
 
void AddButton (LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true)
 
void AddSeparator ()
 
bool CloseSubmenus ()
 
bool CloseOtherSubmenus (int id=0)
 
void CreateSubmenu (int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
bool CreateSubmenu (int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
bool CreateSubmenu (int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
void CreateSubmenu (int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
void ActivateEntry (int id, const ShellEntrySet &entries)
 
virtual void CloseStartMenu (int id=0)
 close all windows of the start menu popup
 
bool GetButtonRect (int id, PRECT prect) const
 
void DrawFloatingButton (HDC hdc)
 
void GetFloatingButtonRect (LPRECT prect)
 
void GetArrowButtonRects (LPRECT prect_up, LPRECT prect_down, int icon_size)
 
void DrawArrows (HDC hdc, int icon_size)
 
void Paint (PaintCanvas &canvas)
 
void UpdateIcons ()
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 

Protected Attributes

BookmarkList _bookmarks
 
BookmarkMap _entries
 
- Protected Attributes inherited from StartMenu
int _next_id
 
ShellEntryMap _entries
 
StartMenuShellDirs _dirs
 
int _submenu_id
 
WindowHandle _submenu
 
int _border_left
 
int _border_top
 
int _bottom_max
 
bool _floating_btn
 
bool _arrow_btns
 
POINT _last_pos
 
enum StartMenu::SCROLL_MODE _scroll_mode
 
int _scroll_pos
 
int _invisible_lines
 
StartMenuCreateInfo _create_info
 
int _icon_size
 
- Protected Attributes inherited from ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >
CtxMenuInterfaces _cm_ifs
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Additional Inherited Members

- Static Public Member Functions inherited from StartMenu
static HWND Create (int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="")
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Public Attributes inherited from StartMenu
static CREATORFUNC_INFO s_def_creator = STARTMENU_CREATOR(StartMenu)
 
- Protected Types inherited from StartMenu
enum  SCROLL_MODE { SCROLL_NOT , SCROLL_UP , SCROLL_DOWN }
 
- Static Protected Member Functions inherited from StartMenu
static BtnWindowClassGetWndClasss ()
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Bookmarks sub-startmenu.

Definition at line 462 of file startmenu.h.

Member Typedef Documentation

◆ super

Definition at line 464 of file startmenu.h.

Constructor & Destructor Documentation

◆ FavoritesMenu()

FavoritesMenu::FavoritesMenu ( HWND  hwnd,
const StartMenuCreateInfo create_info 
)
inline

Definition at line 466 of file startmenu.h.

467 : super(hwnd, create_info),
468 _bookmarks(*(BookmarkList*)create_info._info)
469 {
470 }
BookmarkList _bookmarks
Definition: startmenu.h:476
StartMenu super
Definition: startmenu.h:464
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Member Function Documentation

◆ AddEntries()

void FavoritesMenu::AddEntries ( )
protectedvirtual

Reimplemented from StartMenu.

Definition at line 2224 of file startmenu.cpp.

2225{
2227
2228 String lwr_filter = _create_info._filter;
2229 lwr_filter.toLower();
2230
2231 for(BookmarkList::iterator it=_bookmarks.begin(); it!=_bookmarks.end(); ++it) {
2232 BookmarkNode& node = *it;
2233
2234 int id = ++_next_id;
2235
2236 _entries[id] = node;
2237
2238 if (node._type == BookmarkNode::BMNT_FOLDER) {
2239 BookmarkFolder& folder = *node._pfolder;
2240
2241 AddButton(folder._name, ICID_FOLDER, true, id);
2242 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
2243 Bookmark& bookmark = *node._pbookmark;
2244
2245 ICON_ID icon = ICID_NONE;
2246
2247 if (!bookmark._icon_path.empty())
2248 icon = g_Globals._icon_cache.extract(bookmark._icon_path, bookmark._icon_idx);
2249
2250 // filter non-directory entries
2251 if (!lwr_filter.empty()) {
2252 String lwr_name = bookmark._name;
2253 String lwr_desc = bookmark._description;
2254 String lwr_url = bookmark._url;
2255
2256 lwr_name.toLower();
2257 lwr_desc.toLower();
2258 lwr_url.toLower();
2259
2260 if (!_tcsstr(lwr_name,lwr_filter) && !_tcsstr(lwr_desc,lwr_filter) && !_tcsstr(lwr_url,lwr_filter))
2261 continue;
2262 }
2263
2264 AddButton(bookmark._name, icon!=ICID_NONE?icon:ICID_BOOKMARK, false, id);
2265 }
2266 }
2267}
iterator begin()
Definition: _list.h:367
_STLP_PRIV _List_iterator< BookmarkNode, _Nonconst_traits< BookmarkNode > > iterator
Definition: _list.h:275
iterator end()
Definition: _list.h:370
GLuint id
Definition: glext.h:5910
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
ICON_ID
Definition: globals.h:62
@ ICID_BOOKMARK
Definition: globals.h:85
@ ICID_NONE
Definition: globals.h:64
@ ICID_FOLDER
Definition: globals.h:66
String _description
Definition: favorites.h:37
int _icon_idx
Definition: favorites.h:40
String _url
Definition: favorites.h:38
String _icon_path
Definition: favorites.h:39
String _name
Definition: favorites.h:36
IconCache _icon_cache
Definition: globals.h:285
BookmarkMap _entries
Definition: startmenu.h:477
const Icon & extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
Definition: explorer.cpp:416
int _next_id
Definition: startmenu.h:230
StartMenuCreateInfo _create_info
Definition: startmenu.h:249
void AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true)
Definition: startmenu.cpp:1137
virtual void AddEntries()
Definition: startmenu.cpp:209
Definition: fci.c:116
Definition: dlist.c:348
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
#define _tcsstr
Definition: xmlstorage.h:199

◆ Command()

int FavoritesMenu::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from StartMenu.

Definition at line 2269 of file startmenu.cpp.

2270{
2272
2273 if (found != _entries.end()) {
2274 BookmarkNode& node = found->second;
2275
2276 if (node._type == BookmarkNode::BMNT_FOLDER) {
2277 BookmarkFolder& folder = *node._pfolder;
2278
2279 if (CloseOtherSubmenus(id))
2280 CreateSubmenu(id, folder._name, STARTMENU_CREATOR(FavoritesMenu), &static_cast<BookmarkList&>(folder._bookmarks));
2281 } else if (node._type == BookmarkNode::BMNT_BOOKMARK) {
2282 Bookmark& bookmark = *node._pbookmark;
2283
2284 String url = bookmark._url;
2285 HWND hparent = GetParent(_hwnd);
2286
2287 CloseStartMenu(id);
2288
2289 launch_file(hparent, url, SW_SHOWNORMAL);
2290 }
2291
2292 return 0;
2293 }
2294
2295 return super::Command(id, code);
2296}
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__x)
Definition: _map.h:210
iterator end()
Definition: _map.h:165
_Rep_type::iterator iterator
Definition: _map.h:85
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
Definition: utility.cpp:189
static const WCHAR url[]
Definition: encode.c:1432
#define STARTMENU_CREATOR(WND_CLASS)
Definition: startmenu.h:149
Bookmarks sub-startmenu.
Definition: startmenu.h:463
void CreateSubmenu(int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
Definition: startmenu.cpp:1217
bool CloseOtherSubmenus(int id=0)
Definition: startmenu.cpp:1197
virtual void CloseStartMenu(int id=0)
close all windows of the start menu popup
Definition: startmenu.cpp:1361
int Command(int id, int code)
Definition: startmenu.cpp:1041
Definition: inflate.c:139
#define SW_SHOWNORMAL
Definition: winuser.h:770
HWND WINAPI GetParent(_In_ HWND)

Member Data Documentation

◆ _bookmarks

BookmarkList FavoritesMenu::_bookmarks
protected

Definition at line 476 of file startmenu.h.

Referenced by AddEntries().

◆ _entries

BookmarkMap FavoritesMenu::_entries
protected

Definition at line 477 of file startmenu.h.

Referenced by AddEntries(), and Command().


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