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