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/link.hxx>
28 #include <tools/long.hxx>
29 #include <vcl/dllapi.h>
30 #include <vcl/keycod.hxx>
31 #include <vcl/vclptr.hxx>
32 #include <vcl/vclreferencebase.hxx>
33 #include <com/sun/star/uno/Reference.hxx>
34 #include <o3tl/typed_flags_set.hxx>
35 #include <list>
36 
37 class OutputDevice;
38 struct ImplSVEvent;
39 struct MenuItemData;
40 class Point;
41 class Size;
42 namespace tools { class Rectangle; }
43 class Menu;
44 class MenuItemList;
45 class Image;
46 class PopupMenu;
47 class KeyEvent;
48 class CommandEvent;
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  void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
313  OUString GetItemCommand( sal_uInt16 nItemId ) const;
314 
315  void SetHelpText( sal_uInt16 nItemId, const OUString& rString );
316  OUString GetHelpText( sal_uInt16 nItemId ) const;
317 
318  void SetTipHelpText( sal_uInt16 nItemId, const OUString& rString );
319  OUString GetTipHelpText( sal_uInt16 nItemId ) const;
320 
321  void SetHelpCommand( sal_uInt16 nItemId, const OUString& rString );
322  OUString GetHelpCommand( sal_uInt16 nItemId ) const;
323 
324  void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
325  OString GetHelpId( sal_uInt16 nItemId ) const;
326 
327  void SetActivateHdl( const Link<Menu *, bool>& rLink )
328  {
329  aActivateHdl = rLink;
330  }
331 
333  {
334  aDeactivateHdl = rLink;
335  }
336 
337  void SetSelectHdl( const Link<Menu*,bool>& rLink )
338  {
339  aSelectHdl = rLink;
340  }
341 
342  sal_uInt16 GetTitleHeight() const
343  {
344  return nTitleHeight;
345  }
346 
347  void AddEventListener( const Link<VclMenuEvent&,void>& rEventListener );
348  void RemoveEventListener( const Link<VclMenuEvent&,void>& rEventListener );
349 
350  Menu& operator =( const Menu& rMenu );
351 
352  // for menu functions
354  {
355  return pItemList.get();
356  }
357 
358  // returns the system's menu handle if native menus are supported
359  // pData must point to a SystemMenuData structure
360  void GetSystemMenuData( SystemMenuData* pData ) const;
361 
362  // accessibility helpers
363 
364  // returns the bounding box for the character at index nIndex
365  // where nIndex is relative to the starting index of the item
366  // with id nItemId (in coordinates of the displaying window)
367  tools::Rectangle GetCharacterBounds( sal_uInt16 nItemId, tools::Long nIndex ) const;
368  // -1 is returned if no character is at that point
369  // if an index is found the corresponding item id is filled in (else 0)
370  tools::Long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
371  // returns the bounding rectangle for an item at pos nItemPos
372  tools::Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
373 
374  css::uno::Reference<css::accessibility::XAccessible> GetAccessible();
375  void SetAccessible(const css::uno::Reference<css::accessibility::XAccessible >& rxAccessible);
376 
377  // gets the activation key of the specified item
378  KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
379 
380  vcl::Window* GetWindow() const { return pWindow; }
381 
382  void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
383  OUString GetAccessibleName( sal_uInt16 nItemId ) const;
384 
385  void SetAccessibleDescription( sal_uInt16 nItemId, const OUString& rStr );
386  OUString GetAccessibleDescription( sal_uInt16 nItemId ) const;
387 
388  // returns whether the item a position nItemPos is highlighted or not.
389  bool IsHighlighted( sal_uInt16 nItemPos ) const;
390 
391  void HighlightItem( sal_uInt16 nItemPos );
392  void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
393 
394  bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
395  bool HandleMenuActivateEvent(Menu *pMenu) const;
396  bool HandleMenuDeActivateEvent(Menu *pMenu) const;
397 
401  void set_id(const OUString& rID) { maID = rID; }
402 
406  const OUString& get_id() const { return maID; }
407 };
408 
409 class VCL_DLLPUBLIC MenuBar : public Menu
410 {
412  bool mbCloseBtnVisible : 1;
413  bool mbFloatBtnVisible : 1;
414  bool mbHideBtnVisible : 1;
415  bool mbDisplayable : 1;
416 
417  friend class Application;
418  friend class Menu;
419  friend class MenuBarWindow;
420  friend class MenuFloatingWindow;
421  friend class SystemWindow;
422 
423  SAL_DLLPRIVATE static VclPtr<vcl::Window> ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu);
424  SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete);
425  SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent);
426  SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent& rCEvent);
427 
428 protected:
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 
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 
509 protected:
510  SAL_DLLPRIVATE sal_uInt16 ImplExecute( const VclPtr<vcl::Window>& pW, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst );
511  SAL_DLLPRIVATE void ImplFlushPendingSelect();
512  SAL_DLLPRIVATE tools::Long ImplCalcHeight( sal_uInt16 nEntries ) const;
513  SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
514 
515 public:
516  PopupMenu();
517  PopupMenu( const PopupMenu& rMenu );
518  virtual ~PopupMenu() override;
519 
520  virtual bool IsMenuBar() const override { return false; }
521 
523  virtual void ClosePopup(Menu* pMenu) override;
524 
525  void SetText( const OUString& rTitle )
526  {
527  aTitleText = rTitle;
528  }
529 
530  sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos );
531  sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE );
532 
533  // for the TestTool
534  void EndExecute();
535  virtual void SelectItem(sal_uInt16 nId) override;
536  void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
537 
538  css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface();
539 
540  static bool IsInExecute();
541  static PopupMenu* GetActivePopupMenu();
542 
543  PopupMenu& operator=( const PopupMenu& rMenu );
544 };
545 
546 inline PopupMenu& PopupMenu::operator=( const PopupMenu& rMenu )
547 {
548  Menu::operator=( rMenu );
549  return *this;
550 }
551 
552 #endif // INCLUDED_VCL_MENU_HXX
553 
554 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetText(const OUString &rTitle)
Definition: menu.hxx:525
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:392
bool isDeleted() const
Definition: menu.hxx:118
Link< Menu *, bool > aSelectHdl
Definition: menu.hxx:140
void SetDeactivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:332
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:369
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:342
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:411
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:337
sal_uInt16 GetCurItemId() const
Definition: menu.hxx:268
sal_uInt16 nId
ImplMenuDelData(const Menu *)
Definition: menu.cxx:3136
std::unique_ptr< MenuItemList > pItemList
Definition: menu.hxx:134
Menu & operator=(const Menu &rMenu)
Definition: menu.cxx:1167
const OUString & get_id() const
Get the ID of the window.
Definition: menu.hxx:406
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:303
PopupMenu & operator=(const PopupMenu &rMenu)
Definition: menu.hxx:546
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:233
MenuItemList * GetItemList() const
Definition: menu.hxx:353
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:2219
void set_id(const OUString &rID)
Sets an ID.
Definition: menu.hxx:401
vcl::Window * GetWindow() const
Definition: menu.hxx:380
OutputDevice RenderContext
Definition: outdev.hxx:291
MenuFlags GetMenuFlags() const
Definition: menu.hxx:260
ImplMenuDelData * mpFirstDel
Definition: menu.hxx:133
virtual bool IsMenuBar() const override
Definition: menu.hxx:520
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:327
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