LibreOffice Module vcl (master)  1
menu.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_MENU_HXX
21 #define INCLUDED_VCL_MENU_HXX
22 
23 #include <memory>
24 #include <string_view>
25 
26 #include <vcl/vclenum.hxx>
27 #include <tools/color.hxx>
28 #include <tools/link.hxx>
29 #include <tools/long.hxx>
30 #include <vcl/dllapi.h>
31 #include <vcl/keycod.hxx>
32 #include <vcl/vclptr.hxx>
33 #include <vcl/vclreferencebase.hxx>
34 #include <com/sun/star/uno/Reference.hxx>
35 #include <o3tl/typed_flags_set.hxx>
36 #include <list>
37 
38 class OutputDevice;
39 struct ImplSVEvent;
40 struct MenuItemData;
41 class Point;
42 class Size;
43 namespace tools { class Rectangle; }
44 class Menu;
45 class MenuItemList;
46 class Image;
47 class PopupMenu;
48 class KeyEvent;
49 class MenuFloatingWindow;
50 class SalMenu;
51 class MenuBarWindow;
52 class VclMenuEvent;
53 struct SystemMenuData;
54 enum class FloatWinPopupFlags;
55 enum class VclEventId;
56 
57 namespace com::sun::star::awt { class XPopupMenu; }
58 namespace com::sun::star::accessibility { class XAccessible; }
59 namespace com::sun::star::frame { class XFrame; }
60 
61 namespace vcl
62 {
63 class Window;
65 typedef OutputDevice RenderContext; // same as in include/vcl/outdev.hxx
66 class ILibreOfficeKitNotifier;
67 }
68 
69 constexpr sal_uInt16 MENU_APPEND = 0xFFFF;
70 constexpr sal_uInt16 MENU_ITEM_NOTFOUND = 0xFFFF;
71 
72 // Must match the definitions in css::awt::PopupMenuDirection.idl
73 enum class PopupMenuFlags
74 {
75  NONE = 0x0000,
76  ExecuteDown = 0x0001,
77  ExecuteUp = 0x0002,
78  ExecuteRight = 0x0008,
79  NoMouseUpClose = 0x0010,
80 //If there isn't enough space to put the menu where it wants
81 //to go, then they will be autoplaced. Toggle this bit
82 //on to force menus to be placed either above or below
83 //the starting rectangle and shrunk to fit and then scroll rather than place
84 //the menu beside that rectangle
85  NoHorzPlacement = 0x0020,
86 };
87 
88 namespace o3tl
89 {
90  template<> struct typed_flags<PopupMenuFlags> : is_typed_flags<PopupMenuFlags, 0x003b> {};
91 }
92 
93 enum class MenuFlags
94 {
95  NONE = 0x0000,
96  NoAutoMnemonics = 0x0001,
97  HideDisabledEntries = 0x0002,
98  // overrides default hiding of disabled entries in popup menus
100 };
101 
102 namespace o3tl
103 {
104  template<> struct typed_flags<MenuFlags> : is_typed_flags<MenuFlags, 0x0007> {};
105 }
106 
108 constexpr auto ITEMPOS_INVALID = 0xFFFF;
109 
111 {
114 
115  explicit ImplMenuDelData( const Menu* );
117 
118  bool isDeleted() const { return mpMenu == nullptr; }
119 };
120 
122 
124 {
125  friend class MenuBar;
126  friend class MenuBarWindow;
127  friend class MenuButton;
128  friend class MenuFloatingWindow;
129  friend class PopupMenu;
130  friend class SystemWindow;
131  friend struct ImplMenuDelData;
132 private:
134  std::unique_ptr<MenuItemList> pItemList; // list with MenuItems
137 
138  Link<Menu*, bool> aActivateHdl; // Active-Handler
139  Link<Menu*, bool> aDeactivateHdl; // Deactivate-Handler
140  Link<Menu*, bool> aSelectHdl; // Select-Handler
141 
142  std::list<Link<VclMenuEvent&,void> > maEventListeners;
143 
144  OUString maID;
145 
146  OUString aTitleText; // PopupMenu text
147  sal_uInt16 nTitleHeight;
148 
150  sal_uInt16 mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
152  sal_uInt16 nSelectedId;
153  OString sSelectedIdent;
154 
155  // for output:
156  sal_uInt16 nImgOrChkPos;
157  sal_uInt16 nTextPos;
158 
159  bool bCanceled : 1;
160  bool bInCallback : 1;
161  bool bKilled : 1;
162 
163  css::uno::Reference<css::accessibility::XAccessible > mxAccessible;
164  mutable std::unique_ptr<vcl::MenuLayoutData> mpLayoutData;
165  std::unique_ptr<SalMenu> mpSalMenu;
166 
167 protected:
168  SAL_DLLPRIVATE Menu* ImplGetStartMenu();
169  SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
170  SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
171  SAL_DLLPRIVATE Size ImplCalcSize( vcl::Window* pWin );
172  SAL_DLLPRIVATE bool ImplIsVisible( sal_uInt16 nPos ) const;
173  SAL_DLLPRIVATE bool ImplCurrentlyHiddenOnGUI(sal_uInt16 nPos) const;
174  SAL_DLLPRIVATE bool ImplIsSelectable( sal_uInt16 nPos ) const;
175  SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
176  SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
177  SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
178  SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
179  SAL_DLLPRIVATE void ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize,
180  sal_uInt16 nBorder, tools::Long nOffY = 0, MenuItemData const * pThisDataOnly = nullptr,
181  bool bHighlighted = false, bool bLayout = false, bool bRollover = false ) const;
182  SAL_DLLPRIVATE void ImplPaintMenuTitle(vcl::RenderContext&, const tools::Rectangle& rRect) const;
183  SAL_DLLPRIVATE void ImplSelect();
184  SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
185  SAL_DLLPRIVATE void ImplCallEventListeners( VclEventId nEvent, sal_uInt16 nPos );
186  DECL_DLLPRIVATE_LINK(ImplCallSelect, void*, void );
187 
188  SAL_DLLPRIVATE void ImplFillLayoutData() const;
189  SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); }
190  SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const;
191 
192  // returns native check and option menu symbol height in rCheckHeight and rRadioHeight
193  // return value is maximum width and height of checkboxes and radiobuttons
194  SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderContext, tools::Long& rCheckHeight, tools::Long& rRadioHeight) const;
195 
196  // returns native submenu arrow size and spacing from right border
197  // return value is whether it's supported natively
198  SAL_DLLPRIVATE static bool ImplGetNativeSubmenuArrowSize(vcl::RenderContext const & rRenderContext, Size& rArrowSize, tools::Long& rArrowSpacing);
199 
200  SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
201  SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
202 
203  SAL_DLLPRIVATE MenuItemData* NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits,
204  const OUString& rStr, Menu* pMenu,
205  size_t nPos, const OString &rIdent);
206 
208  virtual void ClosePopup(Menu* pMenu) = 0;
209 
211  virtual void MenuBarKeyInput(const KeyEvent& rEvent);
212 
213 public:
214  SAL_DLLPRIVATE void ImplKillLayoutData() const;
215 
216  SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; }
217 #if defined(MACOSX)
218  void ImplSelectWithStart( Menu* pStartMenu = nullptr );
219 #endif
220 
221 protected:
222 
228  Menu();
229 
230 public:
231  virtual ~Menu() override;
232  virtual void dispose() override;
233 
234  void Activate();
235  void Deactivate();
236  void Select();
237 
238  void InsertItem(sal_uInt16 nItemId, const OUString& rStr,
239  MenuItemBits nItemBits = MenuItemBits::NONE,
240  const OString &rIdent = OString(),
241  sal_uInt16 nPos = MENU_APPEND);
242  void InsertItem(sal_uInt16 nItemId, const Image& rImage,
243  MenuItemBits nItemBits = MenuItemBits::NONE,
244  const OString &rIdent = OString(),
245  sal_uInt16 nPos = MENU_APPEND);
246  void InsertItem(sal_uInt16 nItemId,
247  const OUString& rString, const Image& rImage,
248  MenuItemBits nItemBits = MenuItemBits::NONE,
249  const OString &rIdent = OString(),
250  sal_uInt16 nPos = MENU_APPEND);
251  void InsertItem(const OUString& rCommand,
252  const css::uno::Reference<css::frame::XFrame>& rFrame);
253  void InsertSeparator(const OString &rIdent = OString(), sal_uInt16 nPos = MENU_APPEND);
254  void RemoveItem( sal_uInt16 nPos );
255  void Clear();
256 
257  void CreateAutoMnemonics();
258 
259  void SetMenuFlags( MenuFlags nFlags ) { nMenuFlags = nFlags; }
260  MenuFlags GetMenuFlags() const { return nMenuFlags; }
261 
262  sal_uInt16 GetItemCount() const;
263  sal_uInt16 GetItemId(sal_uInt16 nPos) const;
264  sal_uInt16 GetItemId(std::string_view rIdent) const;
265  sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
266  OString GetItemIdent(sal_uInt16 nItemId) const;
267  MenuItemType GetItemType( sal_uInt16 nPos ) const;
268  sal_uInt16 GetCurItemId() const { return nSelectedId;}
269  OString const & GetCurItemIdent() const { return sSelectedIdent; }
270  void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
271  MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
272 
273  void SetUserValue(sal_uInt16 nItemId, void* nUserValue, MenuUserDataReleaseFunction aFunc=nullptr);
274  void* GetUserValue(sal_uInt16 nItemId) const;
275 
276  void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
277  PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
278 
279  void SetAccelKey( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode );
280  vcl::KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
281 
282  void CheckItem( sal_uInt16 nItemId, bool bCheck = true );
283  void CheckItem( std::string_view rIdent, bool bCheck = true );
284  bool IsItemChecked( sal_uInt16 nItemId ) const;
285 
286  virtual void SelectItem(sal_uInt16 nItemId) = 0;
287 
288  void EnableItem( sal_uInt16 nItemId, bool bEnable = true );
289  void EnableItem(std::string_view rIdent, bool bEnable = true)
290  {
291  EnableItem(GetItemId(rIdent), bEnable);
292  }
293  bool IsItemEnabled( sal_uInt16 nItemId ) const;
294 
295  void ShowItem( sal_uInt16 nItemId, bool bVisible = true );
296  void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, false ); }
297 
298  bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
299  bool IsMenuVisible() const;
300  virtual bool IsMenuBar() const = 0;
301 
302  void RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false );
303 
304  void UpdateNativeMenu();
305 
306  void SetItemText( sal_uInt16 nItemId, const OUString& rStr );
307  OUString GetItemText( sal_uInt16 nItemId ) const;
308 
309  void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
310  Image GetItemImage( sal_uInt16 nItemId ) const;
311 
312  // Instead of an image, draw a color
313  void SetItemColor( sal_uInt16 nItemId, const Color& rColor );
314 
315  void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
316  OUString GetItemCommand( sal_uInt16 nItemId ) const;
317 
318  void SetHelpText( sal_uInt16 nItemId, const OUString& rString );
319  OUString GetHelpText( sal_uInt16 nItemId ) const;
320 
321  void SetTipHelpText( sal_uInt16 nItemId, const OUString& rString );
322  OUString GetTipHelpText( sal_uInt16 nItemId ) const;
323 
324  void SetHelpCommand( sal_uInt16 nItemId, const OUString& rString );
325  OUString GetHelpCommand( sal_uInt16 nItemId ) const;
326 
327  void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
328  OString GetHelpId( sal_uInt16 nItemId ) const;
329 
330  void SetActivateHdl( const Link<Menu *, bool>& rLink )
331  {
332  aActivateHdl = rLink;
333  }
334 
336  {
337  aDeactivateHdl = rLink;
338  }
339 
340  void SetSelectHdl( const Link<Menu*,bool>& rLink )
341  {
342  aSelectHdl = rLink;
343  }
344 
345  sal_uInt16 GetTitleHeight() const
346  {
347  return nTitleHeight;
348  }
349 
350  void AddEventListener( const Link<VclMenuEvent&,void>& rEventListener );
351  void RemoveEventListener( const Link<VclMenuEvent&,void>& rEventListener );
352 
353  Menu& operator =( const Menu& rMenu );
354 
355  // for menu functions
357  {
358  return pItemList.get();
359  }
360 
361  // returns the system's menu handle if native menus are supported
362  // pData must point to a SystemMenuData structure
363  void GetSystemMenuData( SystemMenuData* pData ) const;
364 
365  // accessibility helpers
366 
367  // returns the bounding box for the character at index nIndex
368  // where nIndex is relative to the starting index of the item
369  // with id nItemId (in coordinates of the displaying window)
370  tools::Rectangle GetCharacterBounds( sal_uInt16 nItemId, tools::Long nIndex ) const;
371  // -1 is returned if no character is at that point
372  // if an index is found the corresponding item id is filled in (else 0)
373  tools::Long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
374  // returns the bounding rectangle for an item at pos nItemPos
375  tools::Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
376 
377  css::uno::Reference<css::accessibility::XAccessible> GetAccessible();
378  void SetAccessible(const css::uno::Reference<css::accessibility::XAccessible >& rxAccessible);
379 
380  // gets the activation key of the specified item
381  KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
382 
383  vcl::Window* GetWindow() const { return pWindow; }
384 
385  void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
386  OUString GetAccessibleName( sal_uInt16 nItemId ) const;
387 
388  void SetAccessibleDescription( sal_uInt16 nItemId, const OUString& rStr );
389  OUString GetAccessibleDescription( sal_uInt16 nItemId ) const;
390 
391  // returns whether the item a position nItemPos is highlighted or not.
392  bool IsHighlighted( sal_uInt16 nItemPos ) const;
393 
394  void HighlightItem( sal_uInt16 nItemPos );
395  void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
396 
397  bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
398  bool HandleMenuActivateEvent(Menu *pMenu) const;
399  bool HandleMenuDeActivateEvent(Menu *pMenu) const;
400 
404  void set_id(const OUString& rID) { maID = rID; }
405 
409  const OUString& get_id() const { return maID; }
410 };
411 
412 class VCL_DLLPUBLIC MenuBar final : public Menu
413 {
415  bool mbCloseBtnVisible : 1;
416  bool mbFloatBtnVisible : 1;
417  bool mbHideBtnVisible : 1;
418  bool mbDisplayable : 1;
419 
420  friend class Application;
421  friend class Menu;
422  friend class MenuBarWindow;
423  friend class MenuFloatingWindow;
424  friend class SystemWindow;
425 
426  SAL_DLLPRIVATE static VclPtr<vcl::Window> ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu);
427  SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete);
428  SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent);
429 
431  MenuBarWindow* getMenuBarWindow();
432 
433 public:
434  MenuBar();
435  MenuBar( const MenuBar& rMenu );
436  virtual ~MenuBar() override;
437  virtual void dispose() override;
438 
439  MenuBar& operator =( const MenuBar& rMenu );
440 
441  virtual bool IsMenuBar() const override { return true; }
442 
444  virtual void ClosePopup(Menu* pMenu) override;
445 
447  virtual void MenuBarKeyInput(const KeyEvent& rEvent) override;
448 
449  void ShowCloseButton( bool bShow );
450  bool HasCloseButton() const { return mbCloseBtnVisible; }
451  bool HasFloatButton() const { return mbFloatBtnVisible; }
452  bool HasHideButton() const { return mbHideBtnVisible; }
453  void ShowButtons( bool bClose, bool bFloat, bool bHide );
454 
455  virtual void SelectItem(sal_uInt16 nId) override;
456  bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const;
457  bool HandleMenuButtonEvent(sal_uInt16 nEventId);
458 
459  void SetCloseButtonClickHdl( const Link<void*,void>& rLink ) { maCloseHdl = rLink; }
460  const Link<void*,void>& GetCloseButtonClickHdl() const { return maCloseHdl; }
461 
462  // - by default a menubar is displayable
463  // - if a menubar is not displayable, its MenuBarWindow will never be shown
464  // and it will be hidden if it was visible before
465  // - note: if a menubar is displayable, this does not necessarily mean that it is currently visible
466  void SetDisplayable( bool bDisplayable );
467  bool IsDisplayable() const { return mbDisplayable; }
468 
470  {
471  sal_uInt16 nId; // Id of the button
472  bool bHighlight; // highlight on/off
473  };
474  // add an arbitrary button to the menubar (will appear next to closer)
475  // passed link will be call with a MenuBarButtonCallbackArg on press
476  // passed string will be set as tooltip
477  sal_uInt16 AddMenuBarButton( const Image&, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>&, const OUString& );
478  // set the highlight link for additional button with ID nId
479  // highlight link will be called with a MenuBarButtonHighlightArg
480  // the bHighlight member of that struct shall contain the new state
481  void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>& );
482  // returns the rectangle occupied by the additional button named nId
483  // coordinates are relative to the systemwindow the menubar is attached to
484  // if the menubar is unattached an empty rectangle is returned
485  tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
486  void RemoveMenuBarButton( sal_uInt16 nId );
487  void LayoutChanged();
488  // get the height of the menubar, return the native menubar height if that is active or the vcl
489  // one if not
490  int GetMenuBarHeight() const;
491 };
492 
493 inline MenuBar& MenuBar::operator=( const MenuBar& rMenu )
494 {
495  Menu::operator=(rMenu);
496  return *this;
497 }
498 
499 class VCL_DLLPUBLIC PopupMenu final : public Menu
500 {
501  friend class Menu;
502  friend class MenuFloatingWindow;
503  friend class MenuBarWindow;
504  friend struct MenuItemData;
505 
506 private:
507  SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
508  SAL_DLLPRIVATE sal_uInt16 ImplExecute( const VclPtr<vcl::Window>& pW, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst );
509  SAL_DLLPRIVATE void ImplFlushPendingSelect();
510  SAL_DLLPRIVATE tools::Long ImplCalcHeight( sal_uInt16 nEntries ) const;
511  SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
512 
513 public:
514  PopupMenu();
515  PopupMenu( const PopupMenu& rMenu );
516  virtual ~PopupMenu() override;
517 
518  virtual bool IsMenuBar() const override { return false; }
519 
521  virtual void ClosePopup(Menu* pMenu) override;
522 
523  void SetText( const OUString& rTitle )
524  {
525  aTitleText = rTitle;
526  }
527 
528  sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos );
529  sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE );
530 
531  // for the TestTool
532  void EndExecute();
533  virtual void SelectItem(sal_uInt16 nId) override;
534  void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
535 
536  css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface();
537 
538  static bool IsInExecute();
539  static PopupMenu* GetActivePopupMenu();
540 
541  PopupMenu& operator=( const PopupMenu& rMenu );
542 };
543 
544 inline PopupMenu& PopupMenu::operator=( const PopupMenu& rMenu )
545 {
546  Menu::operator=( rMenu );
547  return *this;
548 }
549 
550 #endif // INCLUDED_VCL_MENU_HXX
551 
552 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetText(const OUString &rTitle)
Definition: menu.hxx:523
VclReferenceBase & operator=(const VclReferenceBase &)=delete
MenuItemType
Definition: vclenum.hxx:30
bool HasCloseButton() const
Definition: menu.hxx:450
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
OUString maID
Definition: menu.hxx:144
void SetCloseButtonClickHdl(const Link< void *, void > &rLink)
Definition: menu.hxx:459
long Long
bool HasFloatButton() const
Definition: menu.hxx:451
void DeHighlight()
Definition: menu.hxx:395
bool isDeleted() const
Definition: menu.hxx:118
Link< Menu *, bool > aSelectHdl
Definition: menu.hxx:140
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
void SetDeactivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:335
Link< Menu *, bool > aDeactivateHdl
Definition: menu.hxx:139
friend class PopupMenu
Definition: menu.hxx:129
VclPtr< vcl::Window > pWindow
Definition: menu.hxx:136
FloatWinPopupFlags
Definition: vclenum.hxx:367
OUString aTitleText
Definition: menu.hxx:146
void EnableItem(std::string_view rIdent, bool bEnable=true)
Definition: menu.hxx:289
void HideItem(sal_uInt16 nItemId)
Definition: menu.hxx:296
VclPtr< Menu > pStartedFrom
Definition: menu.hxx:135
std::list< Link< VclMenuEvent &, void > > maEventListeners
Definition: menu.hxx:142
MenuItemBits
Definition: vclenum.hxx:32
OString const & GetCurItemIdent() const
Definition: menu.hxx:269
OString sSelectedIdent
Definition: menu.hxx:153
sal_uInt16 nImgOrChkPos
Definition: menu.hxx:156
sal_uInt16 nTextPos
Definition: menu.hxx:157
sal_uInt16 GetTitleHeight() const
Definition: menu.hxx:345
ImplMenuDelData * mpNext
Definition: menu.hxx:112
Class that implements the actual window of the floating menu.
void SetMenuFlags(MenuFlags nFlags)
Definition: menu.hxx:259
VclEventId
Definition: vclevent.hxx:37
SAL_DLLPRIVATE SalMenu * ImplGetSalMenu()
Definition: menu.hxx:189
virtual bool IsMenuBar() const override
Definition: menu.hxx:441
Class that implements the actual window of the menu bar.
bool IsDisplayable() const
Definition: menu.hxx:467
Link< void *, void > maCloseHdl
Definition: menu.hxx:414
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:340
sal_uInt16 GetCurItemId() const
Definition: menu.hxx:268
sal_uInt16 nId
ImplMenuDelData(const Menu *)
Definition: menu.cxx:3102
std::unique_ptr< MenuItemList > pItemList
Definition: menu.hxx:134
Menu & operator=(const Menu &rMenu)
Definition: menu.cxx:1180
const OUString & get_id() const
Get the ID of the window.
Definition: menu.hxx:409
VclPtr< const Menu > mpMenu
Definition: menu.hxx:113
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:168
PopupMenu & operator=(const PopupMenu &rMenu)
Definition: menu.hxx:544
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:233
MenuItemList * GetItemList() const
Definition: menu.hxx:356
void Clear(EHistoryType eHistory)
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:216
virtual void dispose()
virtual void ClosePopup(Menu *pMenu)=0
Close the 'pStartedFrom' menu window.
friend class MenuBar
Definition: menu.hxx:125
std::unique_ptr< vcl::MenuLayoutData > mpLayoutData
Definition: menu.hxx:164
Definition: menu.hxx:123
virtual void MenuBarKeyInput(const KeyEvent &rEvent)
Forward the KeyInput call to the MenuBar.
Definition: menu.cxx:2225
void set_id(const OUString &rID)
Sets an ID.
Definition: menu.hxx:404
vcl::Window * GetWindow() const
Definition: menu.hxx:383
OutputDevice RenderContext
Definition: outdev.hxx:156
MenuFlags GetMenuFlags() const
Definition: menu.hxx:260
ImplMenuDelData * mpFirstDel
Definition: menu.hxx:133
virtual bool IsMenuBar() const override
Definition: menu.hxx:518
Definition: image.hxx:39
sal_uInt16 nSelectedId
Definition: menu.hxx:152
sal_uInt16 nTitleHeight
Definition: menu.hxx:147
sal_uInt16 mnHighlightedItemPos
Definition: menu.hxx:150
MenuBar & operator=(const MenuBar &rMenu)
Definition: menu.hxx:493
bool HasHideButton() const
Definition: menu.hxx:452
std::unique_ptr< SalMenu > mpSalMenu
Definition: menu.hxx:165
css::uno::Reference< css::accessibility::XAccessible > mxAccessible
Definition: menu.hxx:163
ImplSVEvent * nEventId
Definition: menu.hxx:149
void SetActivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:330
virtual void SelectItem(sal_uInt16 nItemId)=0
Link< Menu *, bool > aActivateHdl
Definition: menu.hxx:138
const Link< void *, void > & GetCloseButtonClickHdl() const
Definition: menu.hxx:460
virtual void dispose() override
Definition: menu.cxx:181
MenuFlags nMenuFlags
Definition: menu.hxx:151
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo