/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
class OutputDevice; struct ImplSVEvent; struct MenuItemData; class Point; class Size; namespace tools { class Rectangle; } class Menu; class MenuItemList; class Image; class PopupMenu; class KeyEvent; class CommandEvent; class MenuFloatingWindow; class SalMenu; class MenuBarWindow; class VclMenuEvent; struct SystemMenuData; enumclass VclEventId;
namespace com::sun::star::awt { class XPopupMenu; } namespace com::sun::star::accessibility { class XAccessible; }
namespace vcl
{ class Window; struct MenuLayoutData; typedef OutputDevice RenderContext; // same as in include/vcl/outdev.hxx
}
// returns native check and option menu symbol height in rCheckHeight and rRadioHeight // return value is maximum width and height of checkboxes and radiobuttons
SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize(vcl::RenderContext const & rRenderContext, tools::Long& rCheckHeight, tools::Long& rRadioHeight) const;
// returns native submenu arrow size and spacing from right border // return value is whether it's supported natively
SAL_DLLPRIVATE staticbool ImplGetNativeSubmenuArrowSize(vcl::RenderContext const & rRenderContext, Size& rArrowSize, tools::Long& rArrowSpacing);
// for menu functions
MenuItemList* GetItemList() const
{ return pItemList.get();
}
// returns the system's menu handle if native menus are supported void GetSystemMenuData(SystemMenuData& rData) const;
// accessibility helpers
// returns the bounding box for the character at index nIndex // where nIndex is relative to the starting index of the item // with id nItemId (in coordinates of the displaying window)
tools::Rectangle GetCharacterBounds( sal_uInt16 nItemId, tools::Long nIndex ) const; // -1 is returned if no character is at that point // if an index is found the corresponding item id is filled in (else 0)
tools::Long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const; // returns the bounding rectangle for an item at pos nItemPos
tools::Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
// - by default a menubar is displayable // - if a menubar is not displayable, its MenuBarWindow will never be shown // and it will be hidden if it was visible before // - note: if a menubar is displayable, this does not necessarily mean that it is currently visible void SetDisplayable( bool bDisplayable ); bool IsDisplayable() const { return mbDisplayable; }
// add an arbitrary button to the menubar (will appear next to closer) // passed link will be call with a MenuBarButtonCallbackArg on press // passed string will be set as tooltip
SAL_DLLPRIVATE sal_uInt16 AddMenuBarButton( const Image&, const Link<MenuBarButtonCallbackArg&,bool>&, const OUString& ); // set the highlight link for additional button with ID nId // highlight link will be called with a MenuBarButtonHighlightArg // the bHighlight member of that struct shall contain the new state
SAL_DLLPRIVATE void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link<MenuBarButtonCallbackArg&,bool>& ); // returns the rectangle occupied by the additional button named nId // coordinates are relative to the systemwindow the menubar is attached to // if the menubar is unattached an empty rectangle is returned
SAL_DLLPRIVATE tools::Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
SAL_DLLPRIVATE void RemoveMenuBarButton( sal_uInt16 nId ); void LayoutChanged(); // get the height of the menubar, return the native menubar height if that is active or the vcl // one if not
SAL_DLLPRIVATE int GetMenuBarHeight() const;
};
class VCL_DLLPUBLIC PopupMenu final : public Menu
{ friendclass Menu; friendclass MenuFloatingWindow; friendclass MenuBarWindow; friendstruct MenuItemData;
// for the TestTool void EndExecute(); virtualvoid SelectItem(sal_uInt16 nId) override; void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.