2011-05-25 14:05:29 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* 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 .
|
|
|
|
*/
|
2010-06-22 11:12:01 +02:00
|
|
|
|
2013-11-05 02:25:45 +01:00
|
|
|
#ifndef INCLUDED_FRAMEWORK_SOURCE_LAYOUTMANAGER_HELPERS_HXX
|
|
|
|
#define INCLUDED_FRAMEWORK_SOURCE_LAYOUTMANAGER_HELPERS_HXX
|
2010-06-22 11:12:01 +02:00
|
|
|
|
|
|
|
#include <macros/generic.hxx>
|
|
|
|
#include <stdtypes.h>
|
|
|
|
#include <properties.h>
|
|
|
|
|
|
|
|
#include <com/sun/star/awt/XWindowPeer.hpp>
|
2012-10-17 10:52:52 +02:00
|
|
|
#include <com/sun/star/awt/XToolkit2.hpp>
|
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
2010-06-22 11:12:01 +02:00
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#include <com/sun/star/frame/XFrame.hpp>
|
|
|
|
#include <com/sun/star/ui/XUIElement.hpp>
|
|
|
|
#include <com/sun/star/awt/Rectangle.hpp>
|
2010-10-26 14:58:05 +02:00
|
|
|
#include <com/sun/star/ui/DockingArea.hpp>
|
2010-10-28 14:13:05 +02:00
|
|
|
#include <com/sun/star/awt/Point.hpp>
|
2010-06-22 11:12:01 +02:00
|
|
|
|
|
|
|
#include <vcl/window.hxx>
|
2010-10-07 16:33:21 +02:00
|
|
|
#include <vcl/toolbox.hxx>
|
2010-06-22 11:12:01 +02:00
|
|
|
|
2013-03-08 03:07:46 +01:00
|
|
|
#define UIRESOURCE_URL "private:resource"
|
2010-10-07 16:33:21 +02:00
|
|
|
#define UIRESOURCETYPE_TOOLBAR "toolbar"
|
|
|
|
#define UIRESOURCETYPE_STATUSBAR "statusbar"
|
|
|
|
#define UIRESOURCETYPE_MENUBAR "menubar"
|
|
|
|
|
2010-06-22 11:12:01 +02:00
|
|
|
namespace framework
|
|
|
|
{
|
|
|
|
|
2011-07-06 12:47:10 +01:00
|
|
|
bool hasEmptySize( const ::com::sun::star::awt::Size& rSize );
|
|
|
|
bool hasDefaultPosValue( const ::com::sun::star::awt::Point& rPos );
|
|
|
|
bool isDefaultPos( const ::com::sun::star::awt::Point& rPos );
|
2010-10-26 14:58:05 +02:00
|
|
|
bool isToolboxHorizontalAligned( ToolBox* pToolBox );
|
2010-11-01 13:29:26 +01:00
|
|
|
bool isReverseOrderDockingArea( const sal_Int32 nDockArea );
|
|
|
|
bool isHorizontalDockingArea( const sal_Int32 nDockArea );
|
2010-10-26 14:58:05 +02:00
|
|
|
bool isHorizontalDockingArea( const ::com::sun::star::ui::DockingArea& nDockArea );
|
2013-03-08 03:07:46 +01:00
|
|
|
OUString retrieveToolbarNameFromHelpURL( Window* pWindow );
|
2010-10-07 16:33:21 +02:00
|
|
|
ToolBox* getToolboxPtr( Window* pWindow );
|
|
|
|
Window* getWindowFromXUIElement( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement );
|
|
|
|
SystemWindow* getTopSystemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& xWindow );
|
2010-09-24 16:25:13 +02:00
|
|
|
bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 );
|
|
|
|
void setZeroRectangle( ::Rectangle& rRect );
|
2010-06-22 11:12:01 +02:00
|
|
|
bool lcl_checkUIElement(const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement,::com::sun::star::awt::Rectangle& _rPosSize, ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xWindow);
|
2012-10-17 10:52:52 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService );
|
2010-06-22 11:12:01 +02:00
|
|
|
WindowAlign ImplConvertAlignment( sal_Int16 aAlignment );
|
2013-03-08 03:07:46 +01:00
|
|
|
OUString getElementTypeFromResourceURL( const OUString& aResourceURL );
|
|
|
|
void parseResourceURL( const OUString& aResourceURL, OUString& aElementType, OUString& aElementName );
|
2010-09-24 16:25:13 +02:00
|
|
|
::Rectangle putAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect );
|
|
|
|
::com::sun::star::awt::Rectangle putRectangleValueToAWT( const ::Rectangle& rRect );
|
2010-06-22 11:12:01 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > impl_getModelFromFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame );
|
|
|
|
sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
|
|
|
|
sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame );
|
2013-03-08 03:07:46 +01:00
|
|
|
void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>& rxContext, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const OUString& rDockingWindowName, bool bVisible );
|
2010-06-22 11:12:01 +02:00
|
|
|
void impl_addWindowListeners( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xThis, const ::com::sun::star::uno::Reference< css::ui::XUIElement >& xUIElement );
|
2012-10-17 10:52:52 +02:00
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit2 >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent );
|
2010-06-22 11:12:01 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2013-11-05 02:25:45 +01:00
|
|
|
#endif // INCLUDED_FRAMEWORK_SOURCE_LAYOUTMANAGER_HELPERS_HXX
|
2011-05-25 14:05:29 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|