LibreOffice Module framework (master) 1
helpers.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#pragma once
21
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>
29
30#include <vcl/window.hxx>
31#include <vcl/toolbox.hxx>
32
33inline constexpr OUStringLiteral UIRESOURCE_URL = u"private:resource";
34inline constexpr OUStringLiteral UIRESOURCETYPE_TOOLBAR = u"toolbar";
35#define UIRESOURCETYPE_MENUBAR "menubar"
36
37namespace framework
38{
39
40bool hasEmptySize( const css::awt::Size& rSize );
41bool hasDefaultPosValue( const css::awt::Point& rPos );
42bool isDefaultPos( const css::awt::Point& rPos );
43bool isToolboxHorizontalAligned( ToolBox const * pToolBox );
44bool isReverseOrderDockingArea( const sal_Int32 nDockArea );
45bool isHorizontalDockingArea( const sal_Int32 nDockArea );
46bool isHorizontalDockingArea( const css::ui::DockingArea& nDockArea );
49vcl::Window* getWindowFromXUIElement( const css::uno::Reference< css::ui::XUIElement >& xUIElement );
50SystemWindow* getTopSystemWindow( const css::uno::Reference< css::awt::XWindow >& xWindow );
51bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
52bool lcl_checkUIElement(const css::uno::Reference< css::ui::XUIElement >& xUIElement,css::awt::Rectangle& _rPosSize, css::uno::Reference< css::awt::XWindow >& _xWindow);
53css::uno::Reference< css::awt::XVclWindowPeer > createToolkitWindow( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::awt::XVclWindowPeer >& rParent, const char* pService );
54WindowAlign ImplConvertAlignment( css::ui::DockingArea aAlignment );
55std::u16string_view getElementTypeFromResourceURL( std::u16string_view aResourceURL );
56void parseResourceURL( std::u16string_view aResourceURL, OUString& aElementType, OUString& aElementName );
57::tools::Rectangle putAWTToRectangle( const css::awt::Rectangle& rRect );
58css::awt::Rectangle putRectangleValueToAWT( const ::tools::Rectangle& rRect );
59css::uno::Reference< css::frame::XModel > impl_getModelFromFrame( const css::uno::Reference< css::frame::XFrame >& rFrame );
60bool implts_isPreviewModel( const css::uno::Reference< css::frame::XModel >& xModel );
61bool implts_isFrameOrWindowTop( const css::uno::Reference< css::frame::XFrame >& xFrame );
62void impl_setDockingWindowVisibility( const css::uno::Reference< css::uno::XComponentContext>& rxContext, const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rDockingWindowName, bool bVisible );
63void impl_addWindowListeners( const css::uno::Reference< css::uno::XInterface >& xThis, const css::uno::Reference< css::ui::XUIElement >& xUIElement );
64
65}
66
67/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
float u
constexpr OUStringLiteral UIRESOURCETYPE_TOOLBAR
Definition: helpers.hxx:34
constexpr OUStringLiteral UIRESOURCE_URL
Definition: helpers.hxx:33
css::awt::Rectangle putRectangleValueToAWT(const ::tools::Rectangle &rRect)
Definition: helpers.cxx:211
WindowAlign ImplConvertAlignment(ui::DockingArea aAlignment)
Definition: helpers.cxx:178
void parseResourceURL(std::u16string_view aResourceURL, OUString &aElementType, OUString &aElementName)
Definition: helpers.cxx:201
OUString retrieveToolbarNameFromHelpURL(vcl::Window *pWindow)
Definition: helpers.cxx:83
bool isHorizontalDockingArea(const ui::DockingArea &nDockingArea)
Definition: helpers.cxx:72
ToolBox * getToolboxPtr(vcl::Window *pWindow)
Definition: helpers.cxx:103
uno::Reference< awt::XVclWindowPeer > createToolkitWindow(const uno::Reference< uno::XComponentContext > &rxContext, const uno::Reference< awt::XVclWindowPeer > &rParent, const char *pService)
Definition: helpers.cxx:157
void impl_addWindowListeners(const css::uno::Reference< css::uno::XInterface > &xThis, const css::uno::Reference< css::ui::XUIElement > &xUIElement)
Definition: helpers.cxx:315
::tools::Rectangle putAWTToRectangle(const css::awt::Rectangle &rRect)
Definition: helpers.cxx:222
bool isToolboxHorizontalAligned(ToolBox const *pToolBox)
Definition: helpers.cxx:65
SystemWindow * getTopSystemWindow(const uno::Reference< awt::XWindow > &xWindow)
Definition: helpers.cxx:120
vcl::Window * getWindowFromXUIElement(const uno::Reference< ui::XUIElement > &xUIElement)
Definition: helpers.cxx:111
uno::Reference< frame::XModel > impl_getModelFromFrame(const uno::Reference< frame::XFrame > &rFrame)
Definition: helpers.cxx:242
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)
Definition: helpers.cxx:290
std::u16string_view getElementTypeFromResourceURL(std::u16string_view aResourceURL)
Definition: helpers.cxx:190
bool implts_isPreviewModel(const uno::Reference< frame::XModel > &xModel)
Definition: helpers.cxx:256
bool hasEmptySize(const css::awt::Size &rSize)
Definition: helpers.cxx:43
bool implts_isFrameOrWindowTop(const uno::Reference< frame::XFrame > &xFrame)
Definition: helpers.cxx:272
bool equalRectangles(const css::awt::Rectangle &rRect1, const css::awt::Rectangle &rRect2)
Definition: helpers.cxx:233
bool isReverseOrderDockingArea(const sal_Int32 nDockArea)
Definition: helpers.cxx:58
bool lcl_checkUIElement(const uno::Reference< ui::XUIElement > &xUIElement, awt::Rectangle &_rPosSize, uno::Reference< awt::XWindow > &_xWindow)
Definition: helpers.cxx:137
bool isDefaultPos(const css::awt::Point &rPos)
Definition: helpers.cxx:53
bool hasDefaultPosValue(const css::awt::Point &rPos)
Definition: helpers.cxx:48
bool bVisible
WindowAlign