LibreOffice Module vcl (master) 1
menu.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_VCL_MENU_HXX
21#define INCLUDED_VCL_MENU_HXX
22
23#include <memory>
24#include <string_view>
25
26#include <vcl/vclenum.hxx>
27#include <tools/link.hxx>
28#include <tools/long.hxx>
29#include <vcl/dllapi.h>
30#include <vcl/keycod.hxx>
31#include <vcl/vclptr.hxx>
33#include <com/sun/star/uno/Reference.hxx>
35#include <list>
36
37class OutputDevice;
38struct ImplSVEvent;
39struct MenuItemData;
40class Point;
41class Size;
42namespace tools { class Rectangle; }
43class Menu;
44class MenuItemList;
45class Image;
46class PopupMenu;
47class KeyEvent;
49class SalMenu;
50class MenuBarWindow;
51class VclMenuEvent;
52struct SystemMenuData;
53enum class FloatWinPopupFlags;
54enum class VclEventId;
55
56namespace com::sun::star::awt { class XPopupMenu; }
57namespace com::sun::star::accessibility { class XAccessible; }
58
59namespace vcl
60{
61class Window;
62struct MenuLayoutData;
63typedef OutputDevice RenderContext; // same as in include/vcl/outdev.hxx
65}
66
67constexpr sal_uInt16 MENU_APPEND = 0xFFFF;
68constexpr sal_uInt16 MENU_ITEM_NOTFOUND = 0xFFFF;
69
70// Must match the definitions in css::awt::PopupMenuDirection.idl
72{
73 NONE = 0x0000,
74 ExecuteDown = 0x0001,
75 ExecuteUp = 0x0002,
76 ExecuteRight = 0x0008,
77 NoMouseUpClose = 0x0010,
78};
79
80namespace o3tl
81{
82 template<> struct typed_flags<PopupMenuFlags> : is_typed_flags<PopupMenuFlags, 0x001b> {};
83}
84
85enum class MenuFlags
86{
87 NONE = 0x0000,
88 NoAutoMnemonics = 0x0001,
89 HideDisabledEntries = 0x0002,
90 // overrides default hiding of disabled entries in popup menus
92};
93
94namespace o3tl
95{
96 template<> struct typed_flags<MenuFlags> : is_typed_flags<MenuFlags, 0x0007> {};
97}
98
100constexpr auto ITEMPOS_INVALID = 0xFFFF;
101
103{
106
107 explicit ImplMenuDelData( const Menu* );
109
110 bool isDeleted() const { return mpMenu == nullptr; }
111};
112
113typedef void (*MenuUserDataReleaseFunction)(void*);
114
116{
117 friend class MenuBar;
118 friend class MenuBarWindow;
119 friend class MenuButton;
120 friend class MenuFloatingWindow;
121 friend class PopupMenu;
122 friend class SystemWindow;
123 friend struct ImplMenuDelData;
124private:
126 std::unique_ptr<MenuItemList> pItemList; // list with MenuItems
129
131 Link<Menu*, bool> aDeactivateHdl; // Deactivate-Handler
132 Link<Menu*, bool> aSelectHdl; // Select-Handler
133
134 std::list<Link<VclMenuEvent&,void> > maEventListeners;
135
136 OUString maID;
137
138 OUString aTitleText; // PopupMenu text
139 sal_uInt16 nTitleHeight;
140
142 sal_uInt16 mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
144 sal_uInt16 nSelectedId;
146
147 // for output:
148 sal_uInt16 nImgOrChkPos;
149 sal_uInt16 nTextPos;
150
151 bool bCanceled : 1;
152 bool bInCallback : 1;
153 bool bKilled : 1;
154
155 css::uno::Reference<css::accessibility::XAccessible > mxAccessible;
156 mutable std::unique_ptr<vcl::MenuLayoutData> mpLayoutData;
157 std::unique_ptr<SalMenu> mpSalMenu;
158
159 // Stores the help ID of the menu
161
162protected:
163 SAL_DLLPRIVATE Menu* ImplGetStartMenu();
164 SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
165 SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
166 SAL_DLLPRIVATE Size ImplCalcSize( vcl::Window* pWin );
167 SAL_DLLPRIVATE bool ImplIsVisible( sal_uInt16 nPos ) const;
168 SAL_DLLPRIVATE bool ImplCurrentlyHiddenOnGUI(sal_uInt16 nPos) const;
169 SAL_DLLPRIVATE bool ImplIsSelectable( sal_uInt16 nPos ) const;
170 SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
171 SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
172 SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
173 SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
174 SAL_DLLPRIVATE void ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize,
175 sal_uInt16 nBorder, tools::Long nOffY = 0, MenuItemData const * pThisDataOnly = nullptr,
176 bool bHighlighted = false, bool bLayout = false, bool bRollover = false ) const;
177 SAL_DLLPRIVATE void ImplPaintMenuTitle(vcl::RenderContext&, const tools::Rectangle& rRect) const;
178 SAL_DLLPRIVATE void ImplSelect();
179 SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
180 SAL_DLLPRIVATE void ImplCallEventListeners( VclEventId nEvent, sal_uInt16 nPos );
181 DECL_DLLPRIVATE_LINK(ImplCallSelect, void*, void );
182
183 SAL_DLLPRIVATE void ImplFillLayoutData() const;
184 SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu.get(); }
185 SAL_DLLPRIVATE OUString ImplGetHelpText( sal_uInt16 nItemId ) const;
186
187 // returns native check and option menu symbol height in rCheckHeight and rRadioHeight
188 // return value is maximum width and height of checkboxes and radiobuttons
189 SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderContext, tools::Long& rCheckHeight, tools::Long& rRadioHeight) const;
190
191 // returns native submenu arrow size and spacing from right border
192 // return value is whether it's supported natively
193 SAL_DLLPRIVATE static bool ImplGetNativeSubmenuArrowSize(vcl::RenderContext const & rRenderContext, Size& rArrowSize, tools::Long& rArrowSpacing);
194
195 SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
196 SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
197
198 SAL_DLLPRIVATE MenuItemData* NbcInsertItem(sal_uInt16 nId, MenuItemBits nBits,
199 const OUString& rStr, Menu* pMenu,
200 size_t nPos, const OUString &rIdent);
201
203 virtual void ClosePopup(Menu* pMenu) = 0;
204
206 virtual void MenuBarKeyInput(const KeyEvent& rEvent);
207
208public:
209 SAL_DLLPRIVATE void ImplKillLayoutData() const;
210
211 SAL_DLLPRIVATE vcl::Window* ImplGetWindow() const { return pWindow; }
212#if defined(MACOSX)
213 void ImplSelectWithStart( Menu* pStartMenu = nullptr );
214#endif
215
216protected:
217
223 Menu();
224
225public:
226 virtual ~Menu() override;
227 virtual void dispose() override;
228
229 void Activate();
230 void Deactivate();
231 void Select();
232
233 void InsertItem(sal_uInt16 nItemId, const OUString& rStr,
235 const OUString &rIdent = {},
236 sal_uInt16 nPos = MENU_APPEND);
237 void InsertItem(sal_uInt16 nItemId, const Image& rImage,
239 const OUString &rIdent = {},
240 sal_uInt16 nPos = MENU_APPEND);
241 void InsertItem(sal_uInt16 nItemId,
242 const OUString& rString, const Image& rImage,
244 const OUString &rIdent = {},
245 sal_uInt16 nPos = MENU_APPEND);
246 void InsertSeparator(const OUString &rIdent = {}, 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 bool HasValidEntries(bool bCheckPopups) const;
256 sal_uInt16 GetItemCount() const;
257 sal_uInt16 GetItemId(sal_uInt16 nPos) const;
258 sal_uInt16 GetItemId(std::u16string_view rIdent) const;
259 sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
260 OUString GetItemIdent(sal_uInt16 nItemId) const;
261 MenuItemType GetItemType( sal_uInt16 nPos ) const;
262 sal_uInt16 GetCurItemId() const { return nSelectedId;}
263 OUString const & GetCurItemIdent() const { return sSelectedIdent; }
264 void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
265 MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
266
267 void SetUserValue(sal_uInt16 nItemId, void* nUserValue, MenuUserDataReleaseFunction aFunc=nullptr);
268 void* GetUserValue(sal_uInt16 nItemId) const;
269
270 void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
271 PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
272
273 void SetAccelKey( sal_uInt16 nItemId, const vcl::KeyCode& rKeyCode );
274 vcl::KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
275
276 void CheckItem( sal_uInt16 nItemId, bool bCheck = true );
277 void CheckItem( std::u16string_view rIdent, bool bCheck = true );
278 bool IsItemChecked( sal_uInt16 nItemId ) const;
279
280 virtual void SelectItem(sal_uInt16 nItemId) = 0;
281
282 void EnableItem( sal_uInt16 nItemId, bool bEnable = true );
283 void EnableItem(std::u16string_view rIdent, bool bEnable = true)
284 {
285 EnableItem(GetItemId(rIdent), bEnable);
286 }
287 bool IsItemEnabled( sal_uInt16 nItemId ) const;
288
289 void ShowItem( sal_uInt16 nItemId, bool bVisible = true );
290 void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, false ); }
291
292 bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
293 bool IsMenuVisible() const;
294 virtual bool IsMenuBar() const = 0;
295
296 void RemoveDisabledEntries( bool bRemoveEmptyPopups = false );
297
298 void UpdateNativeMenu();
299
300 void SetItemText( sal_uInt16 nItemId, const OUString& rStr );
301 OUString GetItemText( sal_uInt16 nItemId ) const;
302
303 void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
304 Image GetItemImage( sal_uInt16 nItemId ) const;
305
306 void SetItemCommand( sal_uInt16 nItemId, const OUString& rCommand );
307 OUString GetItemCommand( sal_uInt16 nItemId ) const;
308
309 void SetHelpText( sal_uInt16 nItemId, const OUString& rString );
310 OUString GetHelpText( sal_uInt16 nItemId ) const;
311
312 void SetTipHelpText( sal_uInt16 nItemId, const OUString& rString );
313 OUString GetTipHelpText( sal_uInt16 nItemId ) const;
314
315 void SetHelpCommand( sal_uInt16 nItemId, const OUString& rString );
316 OUString GetHelpCommand( sal_uInt16 nItemId ) const;
317
318 void SetHelpId( sal_uInt16 nItemId, const OUString& rHelpId );
319 OUString GetHelpId( sal_uInt16 nItemId ) const;
320
321 void SetHelpId( const OUString& rHelpId ) { m_sMenuHelpId = rHelpId; }
322 OUString GetHelpId() const { return m_sMenuHelpId; }
323
325 {
326 aActivateHdl = rLink;
327 }
328
330 {
331 aDeactivateHdl = rLink;
332 }
333
334 void SetSelectHdl( const Link<Menu*,bool>& rLink )
335 {
336 aSelectHdl = rLink;
337 }
338
339 sal_uInt16 GetTitleHeight() const
340 {
341 return nTitleHeight;
342 }
343
344 void AddEventListener( const Link<VclMenuEvent&,void>& rEventListener );
345 void RemoveEventListener( const Link<VclMenuEvent&,void>& rEventListener );
346
347 Menu& operator =( const Menu& rMenu );
348
349 // for menu functions
351 {
352 return pItemList.get();
353 }
354
355 // returns the system's menu handle if native menus are supported
356 // pData must point to a SystemMenuData structure
357 void GetSystemMenuData( SystemMenuData* pData ) const;
358
359 // accessibility helpers
360
361 // returns the bounding box for the character at index nIndex
362 // where nIndex is relative to the starting index of the item
363 // with id nItemId (in coordinates of the displaying window)
364 tools::Rectangle GetCharacterBounds( sal_uInt16 nItemId, tools::Long nIndex ) const;
365 // -1 is returned if no character is at that point
366 // if an index is found the corresponding item id is filled in (else 0)
367 tools::Long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
368 // returns the bounding rectangle for an item at pos nItemPos
369 tools::Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
370
371 css::uno::Reference<css::accessibility::XAccessible> GetAccessible();
372 void SetAccessible(const css::uno::Reference<css::accessibility::XAccessible >& rxAccessible);
373
374 // gets the activation key of the specified item
375 KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
376
377 vcl::Window* GetWindow() const { return pWindow; }
378
379 void SetAccessibleName( sal_uInt16 nItemId, const OUString& rStr );
380 OUString GetAccessibleName( sal_uInt16 nItemId ) const;
381
382 void SetAccessibleDescription( sal_uInt16 nItemId, const OUString& rStr );
383 OUString GetAccessibleDescription( sal_uInt16 nItemId ) const;
384
385 // returns whether the item a position nItemPos is highlighted or not.
386 bool IsHighlighted( sal_uInt16 nItemPos ) const;
387
388 void HighlightItem( sal_uInt16 nItemPos );
389 void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
390
391 bool HandleMenuCommandEvent(Menu *pMenu, sal_uInt16 nEventId) const;
392 bool HandleMenuActivateEvent(Menu *pMenu) const;
393 bool HandleMenuDeActivateEvent(Menu *pMenu) const;
394
398 void set_id(const OUString& rID) { maID = rID; }
399
403 const OUString& get_id() const { return maID; }
404};
405
407{
408 sal_uInt16 nId; // Id of the button
409 bool bHighlight; // highlight on/off
410};
411
412class VCL_DLLPUBLIC MenuBar final : public Menu
413{
419
420 friend class Application;
421 friend class Menu;
422 friend class MenuBarWindow;
423 friend class MenuFloatingWindow;
424 friend class SystemWindow;
425
426 SAL_DLLPRIVATE static VclPtr<vcl::Window> ImplCreate(vcl::Window* pParent, vcl::Window* pWindow, MenuBar* pMenu);
427 SAL_DLLPRIVATE static void ImplDestroy(MenuBar* pMenu, bool bDelete);
428 SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent& rKEvent);
429
431 MenuBarWindow* getMenuBarWindow();
432
433public:
434 MenuBar();
435 MenuBar( const MenuBar& rMenu );
436 virtual ~MenuBar() override;
437 virtual void dispose() override;
438
439 MenuBar& operator =( const MenuBar& rMenu );
440
441 virtual bool IsMenuBar() const override { return true; }
442
444 virtual void ClosePopup(Menu* pMenu) override;
445
447 virtual void MenuBarKeyInput(const KeyEvent& rEvent) override;
448
449 void ShowCloseButton( bool bShow );
450 bool HasCloseButton() const { return mbCloseBtnVisible; }
451 bool HasFloatButton() const { return mbFloatBtnVisible; }
452 bool HasHideButton() const { return mbHideBtnVisible; }
453 void ShowButtons( bool bClose, bool bFloat, bool bHide );
454
455 virtual void SelectItem(sal_uInt16 nId) override;
456 bool HandleMenuHighlightEvent(Menu *pMenu, sal_uInt16 nEventId) const;
457 bool HandleMenuButtonEvent(sal_uInt16 nEventId);
458
459 void SetCloseButtonClickHdl( const Link<void*,void>& rLink ) { maCloseHdl = rLink; }
460 const Link<void*,void>& GetCloseButtonClickHdl() const { return maCloseHdl; }
461
462 // - by default a menubar is displayable
463 // - if a menubar is not displayable, its MenuBarWindow will never be shown
464 // and it will be hidden if it was visible before
465 // - note: if a menubar is displayable, this does not necessarily mean that it is currently visible
466 void SetDisplayable( bool bDisplayable );
467 bool IsDisplayable() const { return mbDisplayable; }
468
469 // add an arbitrary button to the menubar (will appear next to closer)
470 // passed link will be call with a MenuBarButtonCallbackArg on press
471 // passed string will be set as tooltip
472 sal_uInt16 AddMenuBarButton( const Image&, const Link<MenuBarButtonCallbackArg&,bool>&, const OUString& );
473 // set the highlight link for additional button with ID nId
474 // highlight link will be called with a MenuBarButtonHighlightArg
475 // the bHighlight member of that struct shall contain the new state
476 void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<MenuBarButtonCallbackArg&,bool>& );
477 // returns the rectangle occupied by the additional button named nId
478 // coordinates are relative to the systemwindow the menubar is attached to
479 // if the menubar is unattached an empty rectangle is returned
480 tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
481 void RemoveMenuBarButton( sal_uInt16 nId );
482 void LayoutChanged();
483 // get the height of the menubar, return the native menubar height if that is active or the vcl
484 // one if not
485 int GetMenuBarHeight() const;
486};
487
488inline MenuBar& MenuBar::operator=( const MenuBar& rMenu )
489{
490 Menu::operator=(rMenu);
491 return *this;
492}
493
494class VCL_DLLPUBLIC PopupMenu final : public Menu
495{
496 friend class Menu;
497 friend class MenuFloatingWindow;
498 friend class MenuBarWindow;
499 friend struct MenuItemData;
500
501private:
502 SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const;
503 SAL_DLLPRIVATE bool PrepareRun(const VclPtr<vcl::Window>& pParentWin, tools::Rectangle& rRect, FloatWinPopupFlags& nPopupModeFlags, Menu* pSFrom, bool& bRealExecute, VclPtr<MenuFloatingWindow>&);
504 SAL_DLLPRIVATE bool Run(const VclPtr<MenuFloatingWindow>&, bool bRealExecute, bool bPreSelectFirst, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, const tools::Rectangle& rRect);
505 SAL_DLLPRIVATE void FinishRun(const VclPtr<MenuFloatingWindow>&, const VclPtr<vcl::Window>& pParentWin, bool bRealExecute, bool bIsNativeMenu);
506 SAL_DLLPRIVATE sal_uInt16 ImplExecute(const VclPtr<vcl::Window>& pParentWin, const tools::Rectangle& rRect, FloatWinPopupFlags nPopupModeFlags, Menu* pSFrom, bool bPreSelectFirst);
507 SAL_DLLPRIVATE void ImplFlushPendingSelect();
508 SAL_DLLPRIVATE tools::Long ImplCalcHeight( sal_uInt16 nEntries ) const;
509 SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( tools::Long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible = nullptr ) const;
510
511public:
512 PopupMenu();
513 PopupMenu( const PopupMenu& rMenu );
514 virtual ~PopupMenu() override;
515
516 virtual bool IsMenuBar() const override { return false; }
517
519 virtual void ClosePopup(Menu* pMenu) override;
520
521 void SetText( const OUString& rTitle )
522 {
523 aTitleText = rTitle;
524 }
525
526 sal_uInt16 Execute( vcl::Window* pWindow, const Point& rPopupPos );
527 sal_uInt16 Execute( vcl::Window* pWindow, const tools::Rectangle& rRect, PopupMenuFlags nFlags = PopupMenuFlags::NONE );
528
529 // for the TestTool
530 void EndExecute();
531 virtual void SelectItem(sal_uInt16 nId) override;
532 void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
533
534 css::uno::Reference<css::awt::XPopupMenu> CreateMenuInterface();
535
536 static PopupMenu* GetActivePopupMenu();
537
538 PopupMenu& operator=( const PopupMenu& rMenu );
539};
540
542{
543 Menu::operator=( rMenu );
544 return *this;
545}
546
547#endif // INCLUDED_VCL_MENU_HXX
548
549/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class used mainly for the LibreOffice Desktop class.
Definition: svapp.hxx:237
Definition: image.hxx:40
Class that implements the actual window of the menu bar.
bool mbDisplayable
Definition: menu.hxx:418
Link< void *, void > maCloseHdl
Definition: menu.hxx:414
MenuBar & operator=(const MenuBar &rMenu)
Definition: menu.hxx:488
const Link< void *, void > & GetCloseButtonClickHdl() const
Definition: menu.hxx:460
bool mbFloatBtnVisible
Definition: menu.hxx:416
bool mbHideBtnVisible
Definition: menu.hxx:417
bool HasHideButton() const
Definition: menu.hxx:452
bool IsDisplayable() const
Definition: menu.hxx:467
void SetCloseButtonClickHdl(const Link< void *, void > &rLink)
Definition: menu.hxx:459
bool HasCloseButton() const
Definition: menu.hxx:450
virtual bool IsMenuBar() const override
Definition: menu.hxx:441
bool HasFloatButton() const
Definition: menu.hxx:451
bool mbCloseBtnVisible
Definition: menu.hxx:415
Class that implements the actual window of the floating menu.
Definition: menu.hxx:116
Menu & operator=(const Menu &rMenu)
Definition: menu.cxx:1173
bool bKilled
Killed.
Definition: menu.hxx:153
SAL_DLLPRIVATE SalMenu * ImplGetSalMenu()
Definition: menu.hxx:184
void set_id(const OUString &rID)
Sets an ID.
Definition: menu.hxx:398
void SetMenuFlags(MenuFlags nFlags)
Definition: menu.hxx:252
css::uno::Reference< css::accessibility::XAccessible > mxAccessible
Definition: menu.hxx:155
const OUString & get_id() const
Get the ID of the window.
Definition: menu.hxx:403
sal_uInt16 nImgOrChkPos
Definition: menu.hxx:148
Link< Menu *, bool > aActivateHdl
Definition: menu.hxx:130
std::unique_ptr< SalMenu > mpSalMenu
Definition: menu.hxx:157
void EnableItem(std::u16string_view rIdent, bool bEnable=true)
Definition: menu.hxx:283
sal_uInt16 nTextPos
Definition: menu.hxx:149
virtual bool IsMenuBar() const =0
void SetActivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:324
virtual void SelectItem(sal_uInt16 nItemId)=0
void SetSelectHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:334
VclPtr< Menu > pStartedFrom
Definition: menu.hxx:127
sal_uInt16 GetCurItemId() const
Definition: menu.hxx:262
OUString const & GetCurItemIdent() const
Definition: menu.hxx:263
OUString sSelectedIdent
Definition: menu.hxx:145
OUString aTitleText
Definition: menu.hxx:138
DECL_DLLPRIVATE_LINK(ImplCallSelect, void *, void)
bool bCanceled
Terminated during a callback.
Definition: menu.hxx:151
ImplSVEvent * nEventId
Definition: menu.hxx:141
OUString maID
Definition: menu.hxx:136
vcl::Window * GetWindow() const
Definition: menu.hxx:377
void SetHelpId(const OUString &rHelpId)
Definition: menu.hxx:321
Link< Menu *, bool > aDeactivateHdl
Definition: menu.hxx:131
void DeHighlight()
Definition: menu.hxx:389
virtual void ClosePopup(Menu *pMenu)=0
Close the 'pStartedFrom' menu window.
VclPtr< vcl::Window > pWindow
Definition: menu.hxx:128
MenuFlags nMenuFlags
Definition: menu.hxx:143
sal_uInt16 nTitleHeight
Definition: menu.hxx:139
OUString GetHelpId() const
Definition: menu.hxx:322
void SetDeactivateHdl(const Link< Menu *, bool > &rLink)
Definition: menu.hxx:329
sal_uInt16 nSelectedId
Definition: menu.hxx:144
void HideItem(sal_uInt16 nItemId)
Definition: menu.hxx:290
OUString m_sMenuHelpId
Definition: menu.hxx:160
bool bInCallback
In Activate/Deactivate.
Definition: menu.hxx:152
ImplMenuDelData * mpFirstDel
Definition: menu.hxx:125
std::unique_ptr< vcl::MenuLayoutData > mpLayoutData
Definition: menu.hxx:156
sal_uInt16 GetTitleHeight() const
Definition: menu.hxx:339
Link< Menu *, bool > aSelectHdl
Definition: menu.hxx:132
MenuItemList * GetItemList() const
Definition: menu.hxx:350
MenuFlags GetMenuFlags() const
Definition: menu.hxx:253
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:211
std::unique_ptr< MenuItemList > pItemList
Definition: menu.hxx:126
sal_uInt16 mnHighlightedItemPos
Definition: menu.hxx:142
std::list< Link< VclMenuEvent &, void > > maEventListeners
Definition: menu.hxx:134
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
void SetText(const OUString &rTitle)
Definition: menu.hxx:521
virtual bool IsMenuBar() const override
Definition: menu.hxx:516
PopupMenu & operator=(const PopupMenu &rMenu)
Definition: menu.hxx:541
int GetMenuBarHeight() const
Definition: syswin.cxx:1164
VclReferenceBase & operator=(const VclReferenceBase &)=delete
virtual void dispose()
virtual void SetHelpId(const OUString &) override
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
sal_uInt16 nPos
MenuFlags
Definition: menu.hxx:86
@ HideDisabledEntries
@ AlwaysShowDisabledEntries
constexpr auto ITEMPOS_INVALID
Invalid menu item id.
Definition: menu.hxx:100
PopupMenuFlags
Definition: menu.hxx:72
void(* MenuUserDataReleaseFunction)(void *)
Definition: menu.hxx:113
constexpr sal_uInt16 MENU_APPEND
Definition: menu.hxx:67
constexpr sal_uInt16 MENU_ITEM_NOTFOUND
Definition: menu.hxx:68
void Clear(EHistoryType eHistory)
NONE
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
long Long
OutputDevice RenderContext
Definition: outdev.hxx:159
VclPtr< const Menu > mpMenu
Definition: menu.hxx:105
ImplMenuDelData(const Menu *)
Definition: menu.cxx:3112
ImplMenuDelData * mpNext
Definition: menu.hxx:104
bool isDeleted() const
Definition: menu.hxx:110
sal_uInt16 nId
MenuItemType
Definition: vclenum.hxx:30
MenuItemBits
Definition: vclenum.hxx:33
FloatWinPopupFlags
Definition: vclenum.hxx:323
VclEventId
Definition: vclevent.hxx:38