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  void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
376  OUString GetAccessibleName( sal_uInt16 nItemId ) const;
377 
378  void SetAccessibleDescription( sal_uInt16 nItemId, const OUString& rStr );
379  OUString GetAccessibleDescription( sal_uInt16 nItemId ) const;
380 
381  // returns whether the item a position nItemPos is highlighted or not.
382  bool IsHighlighted( sal_uInt16 nItemPos ) const;
383 
384  void HighlightItem( sal_uInt16 nItemPos );
385  void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
386 
387  bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
388  bool HandleMenuActivateEvent(Menu *pMenu) const;
389  bool HandleMenuDeActivateEvent(Menu *pMenu) const;
390 };
391 
392 class VCL_DLLPUBLIC MenuBar : public Menu
393 {
395  bool mbCloseBtnVisible : 1;
396  bool mbFloatBtnVisible : 1;
397  bool mbHideBtnVisible : 1;
398  bool mbDisplayable : 1;
399 
400  friend class Application;
401  friend class Menu;
402  friend class MenuBarWindow;
403  friend class MenuFloatingWindow;
404  friend class SystemWindow;
405 
406  SAL_DLLPRIVATE static VclPtr<vcl::Window> ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu);
407  SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete);
408  SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent);
409  SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent& rCEvent);
410 
411 protected:
412 
414  MenuBarWindow* getMenuBarWindow();
415 
416 public:
417  MenuBar();
418  MenuBar( const MenuBar& rMenu );
419  virtual ~MenuBar() override;
420  virtual void dispose() override;
421 
422  MenuBar& operator =( const MenuBar& rMenu );
423 
424  virtual bool IsMenuBar() const override { return true; }
425 
427  virtual void ClosePopup(Menu* pMenu) override;
428 
430  virtual void MenuBarKeyInput(const KeyEvent& rEvent) override;
431 
432  void ShowCloseButton( bool bShow );
433  bool HasCloseButton() const { return mbCloseBtnVisible; }
434  bool HasFloatButton() const { return mbFloatBtnVisible; }
435  bool HasHideButton() const { return mbHideBtnVisible; }
436  void ShowButtons( bool bClose, bool bFloat, bool bHide );
437 
438  virtual void SelectItem(sal_uInt16 nId) override;
439  bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const;
440  bool HandleMenuButtonEvent(sal_uInt16 nEventId);
441 
442  void SetCloseButtonClickHdl( const Link<void*,void>& rLink ) { maCloseHdl = rLink; }
443  const Link<void*,void>& GetCloseButtonClickHdl() const { return maCloseHdl; }
444 
445  // - by default a menubar is displayable
446  // - if a menubar is not displayable, its MenuBarWindow will never be shown
447  // and it will be hidden if it was visible before
448  // - note: if a menubar is displayable, this does not necessarily mean that it is currently visible
449  void SetDisplayable( bool bDisplayable );
450  bool IsDisplayable() const { return mbDisplayable; }
451 
453  {
454  sal_uInt16 nId; // Id of the button
455  bool bHighlight; // highlight on/off
456  };
457  // add an arbitrary button to the menubar (will appear next to closer)
458  // passed link will be call with a MenuBarButtonCallbackArg on press
459  // passed string will be set as tooltip
460  sal_uInt16 AddMenuBarButton( const Image&, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>&, const OUString& );
461  // set the highlight link for additional button with ID nId
462  // highlight link will be called with a MenuBarButtonHighlightArg
463  // the bHighlight member of that struct shall contain the new state
464  void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<MenuBar::MenuBarButtonCallbackArg&,bool>& );
465  // returns the rectangle occupied by the additional button named nId
466  // coordinates are relative to the systemwindow the menubar is attached to
467  // if the menubar is unattached an empty rectangle is returned
468  tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
469  void RemoveMenuBarButton( sal_uInt16 nId );
470  void LayoutChanged();
471  // get the height of the menubar, return the native menubar height if that is active or the vcl
472  // one if not
473  int GetMenuBarHeight() const;
474 };
475 
476 inline MenuBar& MenuBar::operator=( const MenuBar& rMenu )
477 {
478  Menu::operator=(rMenu);
479  return *this;
480 }
481 
483 {
484  friend class Menu;
485  friend class MenuFloatingWindow;
486  friend class MenuBarWindow;
487  friend struct MenuItemData;
488 
489 private:
490  const vcl::ILibreOfficeKitNotifier* mpLOKNotifier;
491 
492  SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
493 
494 protected:
495  SAL_DLLPRIVATE sal_uInt16 ImplExecute( const VclPtr<vcl::Window>& pW, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst );
496  SAL_DLLPRIVATE void ImplFlushPendingSelect();
497  SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
498  SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
499 
500 public:
501  PopupMenu();
502  PopupMenu( const PopupMenu& rMenu );
503  virtual ~PopupMenu() override;
504 
505  virtual bool IsMenuBar() const override { return false; }
506 
508  virtual void ClosePopup(Menu* pMenu) override;
509 
510  void SetText( const OUString& rTitle )
511  {
512  aTitleText = rTitle;
513  }
514 
515  sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos );
516  sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE );
517 
518  // for the TestTool
519  void EndExecute();
520  virtual void SelectItem(sal_uInt16 nId) override;
521  void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
522 
523  static bool IsInExecute();
524  static PopupMenu* GetActivePopupMenu();
525 
527  void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier)
528  {
529  mpLOKNotifier = pNotifier;
530  }
531 
532  PopupMenu& operator=( const PopupMenu& rMenu );
533 };
534 
535 inline PopupMenu& PopupMenu::operator=( const PopupMenu& rMenu )
536 {
537  Menu::operator=( rMenu );
538  return *this;
539 }
540 
541 #endif // INCLUDED_VCL_MENU_HXX
542 
543 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetText(const OUString &rTitle)
Definition: menu.hxx:510
VclReferenceBase & operator=(const VclReferenceBase &)=delete
MenuItemType
Definition: vclenum.hxx:30
bool HasCloseButton() const
Definition: menu.hxx:433
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
void SetCloseButtonClickHdl(const Link< void *, void > &rLink)
Definition: menu.hxx:442
bool HasFloatButton() const
Definition: menu.hxx:434
void DeHighlight()
Definition: menu.hxx:385
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:527
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:37
SAL_DLLPRIVATE SalMenu * ImplGetSalMenu()
Definition: menu.hxx:182
virtual bool IsMenuBar() const override
Definition: menu.hxx:424
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:490
bool IsDisplayable() const
Definition: menu.hxx:450
Link< void *, void > maCloseHdl
Definition: menu.hxx:394
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:3116
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:535
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:230
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:505
Definition: image.hxx:39
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:476
bool HasHideButton() const
Definition: menu.hxx:435
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:443
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