1*f8e07b45SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f8e07b45SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f8e07b45SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f8e07b45SAndrew Rist * distributed with this work for additional information 6*f8e07b45SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f8e07b45SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f8e07b45SAndrew Rist * "License"); you may not use this file except in compliance 9*f8e07b45SAndrew Rist * with the License. You may obtain a copy of the License at 10*f8e07b45SAndrew Rist * 11*f8e07b45SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*f8e07b45SAndrew Rist * 13*f8e07b45SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f8e07b45SAndrew Rist * software distributed under the License is distributed on an 15*f8e07b45SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f8e07b45SAndrew Rist * KIND, either express or implied. See the License for the 17*f8e07b45SAndrew Rist * specific language governing permissions and limitations 18*f8e07b45SAndrew Rist * under the License. 19*f8e07b45SAndrew Rist * 20*f8e07b45SAndrew Rist *************************************************************/ 21*f8e07b45SAndrew Rist 22*f8e07b45SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ 25cdf0e10cSrcweir #define __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ 26cdf0e10cSrcweir 27cdf0e10cSrcweir // my own includes 28cdf0e10cSrcweir #include <macros/generic.hxx> 29cdf0e10cSrcweir #include <stdtypes.h> 30cdf0e10cSrcweir #include <properties.h> 31cdf0e10cSrcweir 32cdf0e10cSrcweir // interface includes 33cdf0e10cSrcweir #include <com/sun/star/awt/XWindowPeer.hpp> 34cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp> 35cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp> 36cdf0e10cSrcweir #include <com/sun/star/ui/XUIElement.hpp> 37cdf0e10cSrcweir #include <com/sun/star/awt/Rectangle.hpp> 38cdf0e10cSrcweir #include <com/sun/star/ui/DockingArea.hpp> 39cdf0e10cSrcweir #include <com/sun/star/awt/Point.hpp> 40cdf0e10cSrcweir 41cdf0e10cSrcweir // other includes 42cdf0e10cSrcweir #include <vcl/window.hxx> 43cdf0e10cSrcweir #include <vcl/toolbox.hxx> 44cdf0e10cSrcweir 45cdf0e10cSrcweir #define UIRESOURCE_PROTOCO_ASCII "private:" 46cdf0e10cSrcweir #define UIRESOURCE_RESOURCE_ASCII "resource" 47cdf0e10cSrcweir #define UIRESOURCE_URL_ASCII "private:resource" 48cdf0e10cSrcweir #define UIRESOURCE_URL rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( UIRESOURCE_URL_ASCII )) 49cdf0e10cSrcweir #define UIRESOURCETYPE_TOOLBAR "toolbar" 50cdf0e10cSrcweir #define UIRESOURCETYPE_STATUSBAR "statusbar" 51cdf0e10cSrcweir #define UIRESOURCETYPE_MENUBAR "menubar" 52cdf0e10cSrcweir 53cdf0e10cSrcweir namespace framework 54cdf0e10cSrcweir { 55cdf0e10cSrcweir 56cdf0e10cSrcweir bool hasEmptySize( const:: Size& aSize ); 57cdf0e10cSrcweir bool hasDefaultPosValue( const ::Point& aPos ); 58cdf0e10cSrcweir bool isDefaultPos( const ::com::sun::star::awt::Point& aPos ); 59cdf0e10cSrcweir bool isDefaultPos( const ::Point& aPos ); 60cdf0e10cSrcweir bool isToolboxHorizontalAligned( ToolBox* pToolBox ); 61cdf0e10cSrcweir bool isReverseOrderDockingArea( const sal_Int32 nDockArea ); 62cdf0e10cSrcweir bool isHorizontalDockingArea( const sal_Int32 nDockArea ); 63cdf0e10cSrcweir bool isHorizontalDockingArea( const ::com::sun::star::ui::DockingArea& nDockArea ); 64cdf0e10cSrcweir ::rtl::OUString retrieveToolbarNameFromHelpURL( Window* pWindow ); 65cdf0e10cSrcweir ToolBox* getToolboxPtr( Window* pWindow ); 66cdf0e10cSrcweir Window* getWindowFromXUIElement( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& xUIElement ); 67cdf0e10cSrcweir SystemWindow* getTopSystemWindow( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& xWindow ); 68cdf0e10cSrcweir bool equalRectangles( const css::awt::Rectangle& rRect1, const css::awt::Rectangle& rRect2 ); 69cdf0e10cSrcweir void setZeroRectangle( ::Rectangle& rRect ); 70cdf0e10cSrcweir 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); 71cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > createToolkitWindow( const css::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rFactory, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent, const char* pService ); 72cdf0e10cSrcweir WindowAlign ImplConvertAlignment( sal_Int16 aAlignment ); 73cdf0e10cSrcweir ::rtl::OUString getElementTypeFromResourceURL( const ::rtl::OUString& aResourceURL ); 74cdf0e10cSrcweir void parseResourceURL( const rtl::OUString& aResourceURL, rtl::OUString& aElementType, rtl::OUString& aElementName ); 75cdf0e10cSrcweir ::Rectangle putAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); 76cdf0e10cSrcweir ::com::sun::star::awt::Rectangle putRectangleValueToAWT( const ::Rectangle& rRect ); 77cdf0e10cSrcweir ::com::sun::star::awt::Rectangle convertRectangleToAWT( const ::Rectangle& rRect ); 78cdf0e10cSrcweir ::Rectangle convertAWTToRectangle( const ::com::sun::star::awt::Rectangle& rRect ); 79cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > impl_getModelFromFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame ); 80cdf0e10cSrcweir sal_Bool implts_isPreviewModel( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel ); 81cdf0e10cSrcweir sal_Bool implts_isFrameOrWindowTop( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame ); 82cdf0e10cSrcweir void impl_setDockingWindowVisibility( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& rSMGR, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const ::rtl::OUString& rDockingWindowName, bool bVisible ); 83cdf0e10cSrcweir 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 ); 84cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > implts_createToolkitWindow( const css::uno::Reference< ::com::sun::star::awt::XToolkit >& rToolkit, const css::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rParent ); 85cdf0e10cSrcweir 86cdf0e10cSrcweir } 87cdf0e10cSrcweir 88cdf0e10cSrcweir #endif // __FRAMEWORK_LAYOUTMANAGER_HELPERS_HXX_ 89