merge the formfield patch from ooo-build
[ooovba.git] / framework / source / uielement / logoimagestatusbarcontroller.cxx
blob7158ccae239a1402c8884c5511df41c8aae614cb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: logoimagestatusbarcontroller.cxx,v $
10 * $Revision: 1.7.82.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_framework.hxx"
33 #include <uielement/logoimagestatusbarcontroller.hxx>
34 #include <classes/fwlresid.hxx>
35 #include <services.h>
36 #include <classes/resource.hrc>
37 #include <vos/mutex.hxx>
38 #include <vcl/svapp.hxx>
39 #include <vcl/window.hxx>
40 #include <vcl/status.hxx>
41 #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_
42 #include <toolkit/unohlp.hxx>
43 #endif
44 #include <toolkit/helper/convert.hxx>
46 using namespace ::rtl;
47 using namespace ::cppu;
48 using namespace ::com::sun::star;
49 using namespace ::com::sun::star::uno;
50 using namespace ::com::sun::star::lang;
51 using namespace ::com::sun::star::frame;
53 namespace framework
56 DEFINE_XSERVICEINFO_MULTISERVICE ( LogoImageStatusbarController ,
57 OWeakObject ,
58 SERVICENAME_STATUSBARCONTROLLER ,
59 IMPLEMENTATIONNAME_LOGOIMAGESTATUSBARCONTROLLER
62 DEFINE_INIT_SERVICE ( LogoImageStatusbarController, {} )
64 LogoImageStatusbarController::LogoImageStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
65 svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
67 Image aImage( FwlResId( RID_IMAGE_STATUSBAR_LOGO ));
68 m_aLogoImage = aImage;
71 LogoImageStatusbarController::~LogoImageStatusbarController()
75 // XInterface
76 Any SAL_CALL LogoImageStatusbarController::queryInterface( const Type& rType )
77 throw ( RuntimeException )
79 return svt::StatusbarController::queryInterface( rType );
82 void SAL_CALL LogoImageStatusbarController::acquire() throw ()
84 svt::StatusbarController::acquire();
87 void SAL_CALL LogoImageStatusbarController::release() throw ()
89 svt::StatusbarController::release();
92 void SAL_CALL LogoImageStatusbarController::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
93 throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
95 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
97 svt::StatusbarController::initialize( aArguments );
100 // XComponent
101 void SAL_CALL LogoImageStatusbarController::dispose()
102 throw (::com::sun::star::uno::RuntimeException)
104 svt::StatusbarController::dispose();
107 // XEventListener
108 void SAL_CALL LogoImageStatusbarController::disposing( const EventObject& Source )
109 throw ( RuntimeException )
111 svt::StatusbarController::disposing( Source );
114 // XStatusListener
115 void SAL_CALL LogoImageStatusbarController::statusChanged( const FeatureStateEvent& )
116 throw ( RuntimeException )
120 // XStatusbarController
121 ::sal_Bool SAL_CALL LogoImageStatusbarController::mouseButtonDown(
122 const awt::MouseEvent& )
123 throw (::com::sun::star::uno::RuntimeException)
125 return sal_False;
128 ::sal_Bool SAL_CALL LogoImageStatusbarController::mouseMove(
129 const awt::MouseEvent& )
130 throw (::com::sun::star::uno::RuntimeException)
132 return sal_False;
135 ::sal_Bool SAL_CALL LogoImageStatusbarController::mouseButtonUp(
136 const awt::MouseEvent& )
137 throw (::com::sun::star::uno::RuntimeException)
139 return sal_False;
142 void SAL_CALL LogoImageStatusbarController::command(
143 const awt::Point& aPos,
144 ::sal_Int32 nCommand,
145 ::sal_Bool bMouseEvent,
146 const ::com::sun::star::uno::Any& aData )
147 throw (::com::sun::star::uno::RuntimeException)
149 svt::StatusbarController::command( aPos, nCommand, bMouseEvent, aData );
152 void SAL_CALL LogoImageStatusbarController::paint(
153 const ::com::sun::star::uno::Reference< awt::XGraphics >& xGraphics,
154 const awt::Rectangle& rOutputRectangle,
155 ::sal_Int32 /*nItemId*/,
156 ::sal_Int32 /*nStyle*/ )
157 throw (::com::sun::star::uno::RuntimeException)
159 ::vos::OGuard aGuard( Application::GetSolarMutex() );
161 OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( xGraphics );;
162 if ( pOutDev )
164 ::Rectangle aRect = VCLRectangle( rOutputRectangle );
165 pOutDev->DrawImage( aRect.TopLeft(), aRect.GetSize(), m_aLogoImage );
169 void SAL_CALL LogoImageStatusbarController::click()
170 throw (::com::sun::star::uno::RuntimeException)
172 svt::StatusbarController::click();
175 void SAL_CALL LogoImageStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
177 svt::StatusbarController::doubleClick();