tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / framework / source / layoutmanager / helpers.hxx
blobb15ba4446cedfde6beba6e71050bb08712d4a185
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <com/sun/star/awt/XVclWindowPeer.hpp>
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <com/sun/star/frame/XFrame.hpp>
25 #include <com/sun/star/ui/XUIElement.hpp>
26 #include <com/sun/star/awt/Rectangle.hpp>
27 #include <com/sun/star/ui/DockingArea.hpp>
28 #include <com/sun/star/awt/Point.hpp>
30 #include <vcl/window.hxx>
31 #include <vcl/toolbox.hxx>
33 inline constexpr OUString UIRESOURCE_URL = u"private:resource"_ustr;
34 inline constexpr OUString UIRESOURCETYPE_TOOLBAR = u"toolbar"_ustr;
35 #define UIRESOURCETYPE_MENUBAR "menubar"
37 namespace framework
40 bool hasEmptySize( const css::awt::Size& rSize );
41 bool hasDefaultPosValue( const css::awt::Point& rPos );
42 bool isDefaultPos( const css::awt::Point& rPos );
43 bool isToolboxHorizontalAligned( ToolBox const * pToolBox );
44 bool isReverseOrderDockingArea( const sal_Int32 nDockArea );
45 bool isHorizontalDockingArea( const sal_Int32 nDockArea );
46 bool isHorizontalDockingArea( const css::ui::DockingArea& nDockArea );
47 OUString retrieveToolbarNameFromHelpURL( vcl::Window* pWindow );
48 ToolBox* getToolboxPtr( vcl::Window* pWindow );
49 vcl::Window* getWindowFromXUIElement( const css::uno::Reference< css::ui::XUIElement >& xUIElement );
50 SystemWindow* getTopSystemWindow( const css::uno::Reference< css::awt::XWindow >& xWindow );
51 bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
52 bool lcl_checkUIElement(const css::uno::Reference< css::ui::XUIElement >& xUIElement,css::awt::Rectangle& _rPosSize, css::uno::Reference< css::awt::XWindow >& _xWindow);
53 css::uno::Reference< css::awt::XVclWindowPeer > createToolkitWindow( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::awt::XVclWindowPeer >& rParent, const OUString& pService );
54 WindowAlign ImplConvertAlignment( css::ui::DockingArea aAlignment );
55 std::u16string_view getElementTypeFromResourceURL( std::u16string_view aResourceURL );
56 void parseResourceURL( std::u16string_view aResourceURL, OUString& aElementType, OUString& aElementName );
57 ::tools::Rectangle putAWTToRectangle( const css::awt::Rectangle& rRect );
58 css::awt::Rectangle putRectangleValueToAWT( const ::tools::Rectangle& rRect );
59 css::uno::Reference< css::frame::XModel > impl_getModelFromFrame( const css::uno::Reference< css::frame::XFrame >& rFrame );
60 bool implts_isPreviewModel( const css::uno::Reference< css::frame::XModel >& xModel );
61 bool implts_isFrameOrWindowTop( const css::uno::Reference< css::frame::XFrame >& xFrame );
62 void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rDockingWindowName, bool bVisible );
63 void impl_addWindowListeners( const css::uno::Reference< css::uno::XInterface >& xThis, const css::uno::Reference< css::ui::XUIElement >& xUIElement );
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */