merge the formfield patch from ooo-build
[ooovba.git] / framework / source / uielement / logotextstatusbarcontroller.cxx
blobe11bfd1223164cb5fb168dc3654697d1dd185045
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: logotextstatusbarcontroller.cxx,v $
10 * $Revision: 1.6.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/logotextstatusbarcontroller.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::awt;
50 using namespace ::com::sun::star::uno;
51 using namespace ::com::sun::star::lang;
52 using namespace ::com::sun::star::frame;
54 namespace framework
57 DEFINE_XSERVICEINFO_MULTISERVICE ( LogoTextStatusbarController ,
58 OWeakObject ,
59 SERVICENAME_STATUSBARCONTROLLER ,
60 IMPLEMENTATIONNAME_LOGOTEXTSTATUSBARCONTROLLER
63 DEFINE_INIT_SERVICE ( LogoTextStatusbarController, {} )
65 LogoTextStatusbarController::LogoTextStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
66 svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
68 m_aLogoText = String( FwlResId( STR_STATUSBAR_LOGOTEXT ));
71 LogoTextStatusbarController::~LogoTextStatusbarController()
75 // XInterface
76 Any SAL_CALL LogoTextStatusbarController::queryInterface( const Type& rType )
77 throw ( RuntimeException )
79 return svt::StatusbarController::queryInterface( rType );
82 void SAL_CALL LogoTextStatusbarController::acquire() throw ()
84 svt::StatusbarController::acquire();
87 void SAL_CALL LogoTextStatusbarController::release() throw ()
89 svt::StatusbarController::release();
92 void SAL_CALL LogoTextStatusbarController::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 );
99 if ( m_xParentWindow.is() && m_nID > 0 )
101 Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
102 if ( pWindow && ( pWindow->GetType() == WINDOW_STATUSBAR ))
104 StatusBar* pStatusBar = (StatusBar *)pWindow;
105 pStatusBar->SetItemText( m_nID, m_aLogoText );
110 // XComponent
111 void SAL_CALL LogoTextStatusbarController::dispose()
112 throw (::com::sun::star::uno::RuntimeException)
114 svt::StatusbarController::dispose();
117 // XEventListener
118 void SAL_CALL LogoTextStatusbarController::disposing( const EventObject& Source )
119 throw ( RuntimeException )
121 svt::StatusbarController::disposing( Source );
124 // XStatusListener
125 void SAL_CALL LogoTextStatusbarController::statusChanged( const FeatureStateEvent& )
126 throw ( RuntimeException )
130 // XStatusbarController
131 ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseButtonDown(
132 const ::com::sun::star::awt::MouseEvent& )
133 throw (::com::sun::star::uno::RuntimeException)
135 return sal_False;
138 ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseMove(
139 const ::com::sun::star::awt::MouseEvent& )
140 throw (::com::sun::star::uno::RuntimeException)
142 return sal_False;
145 ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseButtonUp(
146 const ::com::sun::star::awt::MouseEvent& )
147 throw (::com::sun::star::uno::RuntimeException)
149 return sal_False;
152 void SAL_CALL LogoTextStatusbarController::command(
153 const ::com::sun::star::awt::Point& aPos,
154 ::sal_Int32 nCommand,
155 ::sal_Bool bMouseEvent,
156 const ::com::sun::star::uno::Any& aData )
157 throw (::com::sun::star::uno::RuntimeException)
159 svt::StatusbarController::command( aPos, nCommand, bMouseEvent, aData );
162 void SAL_CALL LogoTextStatusbarController::paint(
163 const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
164 const ::com::sun::star::awt::Rectangle& rOutputRectangle,
165 ::sal_Int32 nItemId,
166 ::sal_Int32 nStyle )
167 throw (::com::sun::star::uno::RuntimeException)
169 svt::StatusbarController::paint( xGraphics, rOutputRectangle, nItemId, nStyle );
172 void SAL_CALL LogoTextStatusbarController::click()
173 throw (::com::sun::star::uno::RuntimeException)
175 svt::StatusbarController::click();
178 void SAL_CALL LogoTextStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
180 svt::StatusbarController::doubleClick();