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/vclreferencebase.hxx>
32 #include <vcl/vclevent.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 struct SystemMenuData;
53 enum class FloatWinPopupFlags;
54 
55 namespace com::sun::star::awt { class XPopupMenu; }
56 namespace com::sun::star::accessibility { class XAccessible; }
57 namespace com::sun::star::frame { class XFrame; }
58 
59 namespace vcl
60 {
61 class Window;
63 typedef OutputDevice RenderContext; // same as in include/vcl/outdev.hxx
64 class ILibreOfficeKitNotifier;
65 }
66 
67 constexpr sal_uInt16 MENU_APPEND = 0xFFFF;
68 constexpr sal_uInt16 MENU_ITEM_NOTFOUND = 0xFFFF;
69 
70 // Must match the definitions in css::awt::PopupMenuDirection.idl
71 enum class PopupMenuFlags
72 {
73  NONE = 0x0000,
74  ExecuteDown = 0x0001,
75  ExecuteUp = 0x0002,
76  ExecuteRight = 0x0008,
77  NoMouseUpClose = 0x0010,
78 //If there isn't enough space to put the menu where it wants
79 //to go, then they will be autoplaced. Toggle this bit
80 //on to force menus to be placed either above or below
81 //the starting rectangle and shrunk to fit and then scroll rather than place
82 //the menu beside that rectangle
83  NoHorzPlacement = 0x0020,
84 };
85 
86 namespace o3tl
87 {
88  template<> struct typed_flags<PopupMenuFlags> : is_typed_flags<PopupMenuFlags, 0x003b> {};
89 }
90 
91 enum class MenuFlags
92 {
93  NONE = 0x0000,
94  NoAutoMnemonics = 0x0001,
95  HideDisabledEntries = 0x0002,
96  // overrides default hiding of disabled entries in popup menus
98 };
99 
100 namespace o3tl
101 {
102  template<> struct typed_flags<MenuFlags> : is_typed_flags<MenuFlags, 0x0007> {};
103 }
104 
106 constexpr auto ITEMPOS_INVALID = 0xFFFF;
107 
109 {
112 
113  explicit ImplMenuDelData( const Menu* );
115 
116  bool isDeleted() const { return mpMenu == nullptr; }
117 };
118 
120 
122 {
123  friend class MenuBar;
124  friend class MenuBarWindow;
125  friend class MenuButton;
126  friend class MenuFloatingWindow;
127  friend class PopupMenu;
128  friend class SystemWindow;
129  friend struct ImplMenuDelData;
130 private:
132  std::unique_ptr<MenuItemList> pItemList; // list with MenuItems
135 
136  Link<Menu*, bool> aActivateHdl; // Active-Handler
137  Link<Menu*, bool> aDeactivateHdl; // Deactivate-Handler
138  Link<Menu*, bool> aSelectHdl; // Select-Handler
139 
140  std::list<Link<VclMenuEvent&,void> > maEventListeners;
141 
142  OUString maID;
143 
144  OUString aTitleText; // PopupMenu text
145  sal_uInt16 nTitleHeight;
146 
148  sal_uInt16 mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
150  sal_uInt16 nSelectedId;
151  OString sSelectedIdent;
152 
153  // for output:
154  sal_uInt16 nImgOrChkPos;
155  sal_uInt16 nTextPos;
156 
157  bool bCanceled : 1;
158  bool bInCallback : 1;
159  bool bKilled : 1;
160 
161  css::uno::Reference<css::accessibility::XAccessible > mxAccessible;
162  mutable std::unique_ptr<vcl::MenuLayoutData> mpLayoutData;
163  std::unique_ptr<SalMenu> mpSalMenu;
164 
165 protected:
166  SAL_DLLPRIVATE Menu* ImplGetStartMenu();
167  SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
168  SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
169  SAL_DLLPRIVATE Size ImplCalcSize( vcl::Window* pWin );
170  SAL_DLLPRIVATE bool ImplIsVisible( sal_uInt16 nPos ) const;
171  SAL_DLLPRIVATE bool ImplCurrentlyHiddenOnGUI(sal_uInt16 nPos) const;
172  SAL_DLLPRIVATE bool ImplIsSelectable( sal_uInt16 nPos ) const;
173  SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
174  SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
175  SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
176  SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
177  SAL_DLLPRIVATE void ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize,
178  sal_uInt16 nBorder, tools::Long nOffY = 0, MenuItemData const * pThisDataOnly = nullptr,
179  bool bHighlighted = false, bool bLayout = false, bool bRollover = false ) const;
180  SAL_DLLPRIVATE void ImplPaintMenuTitle(vcl::RenderContext&, const tools::Rectangle& rRect) const;
181  SAL_DLLPRIVATE void ImplSelect();
182  SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
183  SAL_DLLPRIVATE void ImplCallEventListeners( VclEventId nEvent, sal_uInt16 nPos );
184  DECL_DLLPRIVATE_LINK(ImplCallSelect, void*, void );
185 
186  SAL_DLLPRIVATE void ImplFillLayoutData() const;
187  SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); }
188  SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const;
189 
190  // returns native check and option menu symbol height in rCheckHeight and rRadioHeight
191  // return value is maximum width and height of checkboxes and radiobuttons
192  SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderContext, tools::Long& rCheckHeight, tools::Long& rRadioHeight) const;
193 
194  // returns native submenu arrow size and spacing from right border
195  // return value is whether it's supported natively
196  SAL_DLLPRIVATE static bool ImplGetNativeSubmenuArrowSize(vcl::RenderContext const & rRenderContext, Size& rArrowSize, tools::Long& rArrowSpacing);
197 
198  SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
199  SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
200 
201  SAL_DLLPRIVATE MenuItemData* NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits,
202  const OUString& rStr, Menu* pMenu,
203  size_t nPos, const OString &rIdent);
204 
206  virtual void ClosePopup(Menu* pMenu) = 0;
207 
209  virtual void MenuBarKeyInput(const KeyEvent& rEvent);
210 
211 public:
212  SAL_DLLPRIVATE void ImplKillLayoutData() const;
213 
214  SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; }
215 #if defined(MACOSX)
216  void ImplSelectWithStart( Menu* pStartMenu = nullptr );
217 #endif
218 
219 protected:
220 
226  Menu();
227 
228 public:
229  virtual ~Menu() override;
230  virtual void dispose() override;
231 
232  void Activate();
233  void Deactivate();
234  virtual void Select();
235 
236  void InsertItem(sal_uInt16 nItemId, const OUString& rStr,
237  MenuItemBits nItemBits = MenuItemBits::NONE,
238  const OString &rIdent = OString(),
239  sal_uInt16 nPos = MENU_APPEND);
240  void InsertItem(sal_uInt16 nItemId, const Image& rImage,
241  MenuItemBits nItemBits = MenuItemBits::NONE,
242  const OString &rIdent = OString(),
243  sal_uInt16 nPos = MENU_APPEND);
244  void InsertItem(sal_uInt16 nItemId,
245  const OUString& rString, const Image& rImage,
246  MenuItemBits nItemBits = MenuItemBits::NONE,
247  const OString &rIdent = OString(),
248  sal_uInt16 nPos = MENU_APPEND);
249  void InsertItem(const OUString& rCommand,
250  const css::uno::Reference<css::frame::XFrame>& rFrame);
251  void InsertSeparator(const OString &rIdent = OString(), sal_uInt16 nPos = MENU_APPEND);
252  void RemoveItem( sal_uInt16 nPos );
253  void Clear();
254 
255  void CreateAutoMnemonics();
256 
257  void SetMenuFlags( MenuFlags nFlags ) { nMenuFlags = nFlags; }
258  MenuFlags GetMenuFlags() const { return nMenuFlags; }
259 
260  sal_uInt16 GetItemCount() const;
261  sal_uInt16 GetItemId(sal_uInt16 nPos) const;
262  sal_uInt16 GetItemId(std::string_view rIdent) const;
263  sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
264  OString GetItemIdent(sal_uInt16 nItemId) const;
265  MenuItemType GetItemType( sal_uInt16 nPos ) const;
266  sal_uInt16 GetCurItemId() const { return nSelectedId;}
267  OString const & GetCurItemIdent() const { return sSelectedIdent; }
268  void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
269  MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
270 
271  void SetUserValue(sal_uInt16 nItemId, void* nUserValue, MenuUserDataReleaseFunction aFunc=nullptr);
272  void* GetUserValue(sal_uInt16 nItemId) const;
273 
274  void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
275  PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
276 
277  void SetAccelKey( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode );
278  vcl::KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
279 
280  void CheckItem( sal_uInt16 nItemId, bool bCheck = true );
281  void CheckItem( std::string_view rIdent, bool bCheck = true );
282  bool IsItemChecked( sal_uInt16 nItemId ) const;
283 
284  virtual void SelectItem(sal_uInt16 nItemId) = 0;
285 
286  void EnableItem( sal_uInt16 nItemId, bool bEnable = true );
287  void EnableItem(std::string_view rIdent, bool bEnable = true)
288  {
289  EnableItem(GetItemId(rIdent), bEnable);
290  }
291  bool IsItemEnabled( sal_uInt16 nItemId ) const;
292 
293  void ShowItem( sal_uInt16 nItemId, bool bVisible = true );
294  void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, false ); }
295 
296  bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
297  bool IsMenuVisible() const;
298  virtual bool IsMenuBar() const = 0;
299 
300  void RemoveDisabledEntries( bool bCheckPopups = true, bool bRemoveEmptyPopups = false );
301 
302  void UpdateNativeMenu();
303 
304  void SetItemText( sal_uInt16 nItemId, const OUString& rStr );
305  OUString GetItemText( sal_uInt16 nItemId ) const;
306 
307  void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
308  Image GetItemImage( sal_uInt16 nItemId ) const;
309 
310  void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
311  OUString GetItemCommand( sal_uInt16 nItemId ) const;
312 
313  void SetHelpText( sal_uInt16 nItemId, const OUString& rString );
314  OUString GetHelpText( sal_uInt16 nItemId ) const;
315 
316  void SetTipHelpText( sal_uInt16 nItemId, const OUString& rString );
317  OUString GetTipHelpText( sal_uInt16 nItemId ) const;
318 
319  void SetHelpCommand( sal_uInt16 nItemId, const OUString& rString );
320  OUString GetHelpCommand( sal_uInt16 nItemId ) const;
321 
322  void SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
323  OString GetHelpId( sal_uInt16 nItemId ) const;
324 
325  void SetActivateHdl( const Link<Menu *, bool>& rLink )
326  {
327  aActivateHdl = rLink;
328  }
329 
331  {
332  aDeactivateHdl = rLink;
333  }
334 
335  void SetSelectHdl( const Link<Menu*,bool>& rLink )
336  {
337  aSelectHdl = rLink;
338  }
339 
340  sal_uInt16 GetTitleHeight() const
341  {
342  return nTitleHeight;
343  }
344 
345  void AddEventListener( const Link<VclMenuEvent&,void>& rEventListener );
346  void RemoveEventListener( const Link<VclMenuEvent&,void>& rEventListener );
347 
348  Menu& operator =( const Menu& rMenu );
349 
350  // for menu functions
352  {
353  return pItemList.get();
354  }
355 
356  // returns the system's menu handle if native menus are supported
357  // pData must point to a SystemMenuData structure
358  void GetSystemMenuData( SystemMenuData* pData ) const;
359 
360  // accessibility helpers
361 
362  // returns the bounding box for the character at index nIndex
363  // where nIndex is relative to the starting index of the item
364  // with id nItemId (in coordinates of the displaying window)
365  tools::Rectangle GetCharacterBounds( sal_uInt16 nItemId, tools::Long nIndex ) const;
366  // -1 is returned if no character is at that point
367  // if an index is found the corresponding item id is filled in (else 0)
368  tools::Long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
369  // returns the bounding rectangle for an item at pos nItemPos
370  tools::Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
371 
372  css::uno::Reference<css::accessibility::XAccessible> GetAccessible();
373  void SetAccessible(const css::uno::Reference<css::accessibility::XAccessible >& rxAccessible);
374 
375  // gets the activation key of the specified item
376  KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
377 
378  vcl::Window* GetWindow() const { return pWindow; }
379 
380  void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
381  OUString GetAccessibleName( sal_uInt16 nItemId ) const;
382 
383  void SetAccessibleDescription( sal_uInt16 nItemId, const OUString& rStr );
384  OUString GetAccessibleDescription( sal_uInt16 nItemId ) const;
385 
386  // returns whether the item a position nItemPos is highlighted or not.
387  bool IsHighlighted( sal_uInt16 nItemPos ) const;
388 
389  void HighlightItem( sal_uInt16 nItemPos );
390  void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
391 
392  bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
393  bool HandleMenuActivateEvent(Menu *pMenu) const;
394  bool HandleMenuDeActivateEvent(Menu *pMenu) const;
395 
399  void set_id(const OUString& rID) { maID = rID; }
400 
404  const OUString& get_id() const { return maID; }
405 };
406 
407 class VCL_DLLPUBLIC MenuBar : public Menu
408 {
410  bool mbCloseBtnVisible : 1;
411  bool mbFloatBtnVisible : 1;
412  bool mbHideBtnVisible : 1;
413  bool mbDisplayable : 1;
414 
415  friend class Application;
416  friend class Menu;
417  friend class MenuBarWindow;
418  friend class MenuFloatingWindow;
419  friend class SystemWindow;
420 
421  SAL_DLLPRIVATE static VclPtr<vcl::Window> ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu);
422  SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete);
423  SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent);
424  SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent& rCEvent);
425 
426 protected:
427 
429  MenuBarWindow* getMenuBarWindow();
430 
431 public:
432  MenuBar();
433  MenuBar( const MenuBar& rMenu );
434  virtual ~MenuBar() override;
435  virtual void dispose() override;
436 
437  MenuBar& operator =( const MenuBar& rMenu );
438 
439  virtual bool IsMenuBar() const override { return true; }
440 
442  virtual void ClosePopup(Menu* pMenu) override;
443 
445  virtual void MenuBarKeyInput(const KeyEvent& rEvent) override;
446 
447  void ShowCloseButton( bool bShow );
448  bool HasCloseButton() const { return mbCloseBtnVisible; }
449  bool HasFloatButton() const { return mbFloatBtnVisible; }
450  bool HasHideButton() const { return mbHideBtnVisible; }
451  void ShowButtons( bool bClose, bool bFloat, bool bHide );
452 
453  virtual void SelectItem(sal_uInt16 nId) override;
454  bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const;
455  bool HandleMenuButtonEvent(sal_uInt16 nEventId);
456 
457  void SetCloseButtonClickHdl( const Link<void*,void>& rLink ) { maCloseHdl = rLink; }
458  const Link<void*,void>& GetCloseButtonClickHdl() const { return maCloseHdl; }
459 
460  // - by default a menubar is displayable
461  // - if a menubar is not displayable, its MenuBarWindow will never be shown
462  // and it will be hidden if it was visible before
463  // - note: if a menubar is displayable, this does not necessarily mean that it is currently visible
464  void SetDisplayable( bool bDisplayable );
465  bool IsDisplayable() const { return mbDisplayable; }
466 
468  {
469  sal_uInt16 nId; // Id of the button
470  bool bHighlight; // highlight on/off
471  };
472  // add an arbitrary button to the menubar (will appear next to closer)
473  // passed link will be call with a MenuBarButtonCallbackArg on press
474  // passed string will be set as tooltip
475  sal_uInt16 AddMenuBarButton( const Image&, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>&, const OUString& );
476  // set the highlight link for additional button with ID nId
477  // highlight link will be called with a MenuBarButtonHighlightArg
478  // the bHighlight member of that struct shall contain the new state
479  void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>& );
480  // returns the rectangle occupied by the additional button named nId
481  // coordinates are relative to the systemwindow the menubar is attached to
482  // if the menubar is unattached an empty rectangle is returned
483  tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
484  void RemoveMenuBarButton( sal_uInt16 nId );
485  void LayoutChanged();
486  // get the height of the menubar, return the native menubar height if that is active or the vcl
487  // one if not
488  int GetMenuBarHeight() const;
489 };
490 
491 inline MenuBar& MenuBar::operator=( const MenuBar& rMenu )
492 {
493  Menu::operator=(rMenu);
494  return *this;
495 }
496 
498 {
499  friend class Menu;
500  friend class MenuFloatingWindow;
501  friend class MenuBarWindow;
502  friend struct MenuItemData;
503 
504 private:
505  SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
506 
507 protected:
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:448
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
OUString maID
Definition: menu.hxx:142
void SetCloseButtonClickHdl(const Link< void *, void > &rLink)
Definition: menu.hxx:457
long Long
bool HasFloatButton() const
Definition: menu.hxx:449
void DeHighlight()
Definition: menu.hxx:390
bool isDeleted() const
Definition: menu.hxx:116
Link< Menu *, bool > aSelectHdl
Definition: menu.hxx:138
void SetDeactivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:330
Link< Menu *, bool > aDeactivateHdl
Definition: menu.hxx:137
friend class PopupMenu
Definition: menu.hxx:127
VclPtr< vcl::Window > pWindow
Definition: menu.hxx:134
OUString aTitleText
Definition: menu.hxx:144
void EnableItem(std::string_view rIdent, bool bEnable=true)
Definition: menu.hxx:287
void HideItem(sal_uInt16 nItemId)
Definition: menu.hxx:294
VclPtr< Menu > pStartedFrom
Definition: menu.hxx:133
std::list< Link< VclMenuEvent &, void > > maEventListeners
Definition: menu.hxx:140
MenuItemBits
Definition: vclenum.hxx:32
OString const & GetCurItemIdent() const
Definition: menu.hxx:267
OString sSelectedIdent
Definition: menu.hxx:151
sal_uInt16 nImgOrChkPos
Definition: menu.hxx:154
sal_uInt16 nTextPos
Definition: menu.hxx:155
sal_uInt16 GetTitleHeight() const
Definition: menu.hxx:340
ImplMenuDelData * mpNext
Definition: menu.hxx:110
Class that implements the actual window of the floating menu.
void SetMenuFlags(MenuFlags nFlags)
Definition: menu.hxx:257
VclEventId
Definition: vclevent.hxx:37
SAL_DLLPRIVATE SalMenu * ImplGetSalMenu()
Definition: menu.hxx:187
virtual bool IsMenuBar() const override
Definition: menu.hxx:439
Class that implements the actual window of the menu bar.
bool IsDisplayable() const
Definition: menu.hxx:465
Link< void *, void > maCloseHdl
Definition: menu.hxx:409
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:335
sal_uInt16 GetCurItemId() const
Definition: menu.hxx:266
sal_uInt16 nId
ImplMenuDelData(const Menu *)
Definition: menu.cxx:3127
std::unique_ptr< MenuItemList > pItemList
Definition: menu.hxx:132
Menu & operator=(const Menu &rMenu)
Definition: menu.cxx:1156
const OUString & get_id() const
Get the ID of the window.
Definition: menu.hxx:404
VclPtr< const Menu > mpMenu
Definition: menu.hxx:111
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:544
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:232
MenuItemList * GetItemList() const
Definition: menu.hxx:351
FloatWinPopupFlags
Definition: floatwin.hxx:31
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:214
virtual void dispose()
virtual void ClosePopup(Menu *pMenu)=0
Close the 'pStartedFrom' menu window.
friend class MenuBar
Definition: menu.hxx:123
std::unique_ptr< vcl::MenuLayoutData > mpLayoutData
Definition: menu.hxx:162
Definition: menu.hxx:121
virtual void MenuBarKeyInput(const KeyEvent &rEvent)
Forward the KeyInput call to the MenuBar.
Definition: menu.cxx:2210
void set_id(const OUString &rID)
Sets an ID.
Definition: menu.hxx:399
vcl::Window * GetWindow() const
Definition: menu.hxx:378
OutputDevice RenderContext
Definition: outdev.hxx:291
MenuFlags GetMenuFlags() const
Definition: menu.hxx:258
ImplMenuDelData * mpFirstDel
Definition: menu.hxx:131
virtual bool IsMenuBar() const override
Definition: menu.hxx:518
Definition: image.hxx:39
sal_uInt16 nSelectedId
Definition: menu.hxx:150
sal_uInt16 nTitleHeight
Definition: menu.hxx:145
sal_uInt16 mnHighlightedItemPos
Definition: menu.hxx:148
MenuBar & operator=(const MenuBar &rMenu)
Definition: menu.hxx:491
bool HasHideButton() const
Definition: menu.hxx:450
std::unique_ptr< SalMenu > mpSalMenu
Definition: menu.hxx:163
css::uno::Reference< css::accessibility::XAccessible > mxAccessible
Definition: menu.hxx:161
ImplSVEvent * nEventId
Definition: menu.hxx:147
void SetActivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:325
virtual void SelectItem(sal_uInt16 nItemId)=0
Link< Menu *, bool > aActivateHdl
Definition: menu.hxx:136
const Link< void *, void > & GetCloseButtonClickHdl() const
Definition: menu.hxx:458
virtual void dispose() override
Definition: menu.cxx:181
MenuFlags nMenuFlags
Definition: menu.hxx:149
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo