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