Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <uielement/logotextstatusbarcontroller.hxx>
30 : : #include <classes/fwlresid.hxx>
31 : : #include <services.h>
32 : : #include <classes/resource.hrc>
33 : : #include <osl/mutex.hxx>
34 : : #include <vcl/svapp.hxx>
35 : : #include <vcl/window.hxx>
36 : : #include <vcl/status.hxx>
37 : : #include <toolkit/unohlp.hxx>
38 : : #include <toolkit/helper/convert.hxx>
39 : :
40 : : using namespace ::rtl;
41 : : using namespace ::cppu;
42 : : using namespace ::com::sun::star;
43 : : using namespace ::com::sun::star::awt;
44 : : using namespace ::com::sun::star::uno;
45 : : using namespace ::com::sun::star::lang;
46 : : using namespace ::com::sun::star::frame;
47 : :
48 : : namespace framework
49 : : {
50 : :
51 [ # # ][ # # ]: 29 : DEFINE_XSERVICEINFO_MULTISERVICE ( LogoTextStatusbarController ,
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
52 : : OWeakObject ,
53 : : SERVICENAME_STATUSBARCONTROLLER ,
54 : : IMPLEMENTATIONNAME_LOGOTEXTSTATUSBARCONTROLLER
55 : : )
56 : :
57 : 0 : DEFINE_INIT_SERVICE ( LogoTextStatusbarController, {} )
58 : :
59 : 0 : LogoTextStatusbarController::LogoTextStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
60 [ # # ]: 0 : svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
61 : : {
62 [ # # ][ # # ]: 0 : m_aLogoText = String( FwlResId( STR_STATUSBAR_LOGOTEXT ));
[ # # ][ # # ]
63 : 0 : }
64 : :
65 : 0 : LogoTextStatusbarController::~LogoTextStatusbarController()
66 : : {
67 [ # # ]: 0 : }
68 : :
69 : : // XInterface
70 : 0 : Any SAL_CALL LogoTextStatusbarController::queryInterface( const Type& rType )
71 : : throw ( RuntimeException )
72 : : {
73 : 0 : return svt::StatusbarController::queryInterface( rType );
74 : : }
75 : :
76 : 0 : void SAL_CALL LogoTextStatusbarController::acquire() throw ()
77 : : {
78 : 0 : svt::StatusbarController::acquire();
79 : 0 : }
80 : :
81 : 0 : void SAL_CALL LogoTextStatusbarController::release() throw ()
82 : : {
83 : 0 : svt::StatusbarController::release();
84 : 0 : }
85 : :
86 : 0 : void SAL_CALL LogoTextStatusbarController::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
87 : : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
88 : : {
89 [ # # ]: 0 : SolarMutexGuard aSolarMutexGuard;
90 : :
91 [ # # ]: 0 : svt::StatusbarController::initialize( aArguments );
92 : :
93 [ # # ][ # # ]: 0 : if ( m_xParentWindow.is() && m_nID > 0 )
[ # # ]
94 : : {
95 [ # # ]: 0 : Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
96 [ # # ][ # # ]: 0 : if ( pWindow && ( pWindow->GetType() == WINDOW_STATUSBAR ))
[ # # ][ # # ]
97 : : {
98 : 0 : StatusBar* pStatusBar = (StatusBar *)pWindow;
99 [ # # ][ # # ]: 0 : pStatusBar->SetItemText( m_nID, m_aLogoText );
[ # # ]
100 : : }
101 [ # # ]: 0 : }
102 : 0 : }
103 : :
104 : : // XComponent
105 : 0 : void SAL_CALL LogoTextStatusbarController::dispose()
106 : : throw (::com::sun::star::uno::RuntimeException)
107 : : {
108 : 0 : svt::StatusbarController::dispose();
109 : 0 : }
110 : :
111 : : // XEventListener
112 : 0 : void SAL_CALL LogoTextStatusbarController::disposing( const EventObject& Source )
113 : : throw ( RuntimeException )
114 : : {
115 : 0 : svt::StatusbarController::disposing( Source );
116 : 0 : }
117 : :
118 : : // XStatusListener
119 : 0 : void SAL_CALL LogoTextStatusbarController::statusChanged( const FeatureStateEvent& )
120 : : throw ( RuntimeException )
121 : : {
122 : 0 : }
123 : :
124 : : // XStatusbarController
125 : 0 : ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseButtonDown(
126 : : const ::com::sun::star::awt::MouseEvent& )
127 : : throw (::com::sun::star::uno::RuntimeException)
128 : : {
129 : 0 : return sal_False;
130 : : }
131 : :
132 : 0 : ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseMove(
133 : : const ::com::sun::star::awt::MouseEvent& )
134 : : throw (::com::sun::star::uno::RuntimeException)
135 : : {
136 : 0 : return sal_False;
137 : : }
138 : :
139 : 0 : ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseButtonUp(
140 : : const ::com::sun::star::awt::MouseEvent& )
141 : : throw (::com::sun::star::uno::RuntimeException)
142 : : {
143 : 0 : return sal_False;
144 : : }
145 : :
146 : 0 : void SAL_CALL LogoTextStatusbarController::command(
147 : : const ::com::sun::star::awt::Point& aPos,
148 : : ::sal_Int32 nCommand,
149 : : ::sal_Bool bMouseEvent,
150 : : const ::com::sun::star::uno::Any& aData )
151 : : throw (::com::sun::star::uno::RuntimeException)
152 : : {
153 : 0 : svt::StatusbarController::command( aPos, nCommand, bMouseEvent, aData );
154 : 0 : }
155 : :
156 : 0 : void SAL_CALL LogoTextStatusbarController::paint(
157 : : const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
158 : : const ::com::sun::star::awt::Rectangle& rOutputRectangle,
159 : : ::sal_Int32 nItemId,
160 : : ::sal_Int32 nStyle )
161 : : throw (::com::sun::star::uno::RuntimeException)
162 : : {
163 : 0 : svt::StatusbarController::paint( xGraphics, rOutputRectangle, nItemId, nStyle );
164 : 0 : }
165 : :
166 : 0 : void SAL_CALL LogoTextStatusbarController::click()
167 : : throw (::com::sun::star::uno::RuntimeException)
168 : : {
169 : 0 : svt::StatusbarController::click();
170 : 0 : }
171 : :
172 : 0 : void SAL_CALL LogoTextStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
173 : : {
174 : 0 : svt::StatusbarController::doubleClick();
175 : 0 : }
176 : :
177 : : }
178 : :
179 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|