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