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