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/logoimagestatusbarcontroller.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::uno;
44 : : using namespace ::com::sun::star::lang;
45 : : using namespace ::com::sun::star::frame;
46 : :
47 : : namespace framework
48 : : {
49 : :
50 [ # # ][ # # ]: 29 : DEFINE_XSERVICEINFO_MULTISERVICE ( LogoImageStatusbarController ,
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
51 : : OWeakObject ,
52 : : SERVICENAME_STATUSBARCONTROLLER ,
53 : : IMPLEMENTATIONNAME_LOGOIMAGESTATUSBARCONTROLLER
54 : : )
55 : :
56 : 0 : DEFINE_INIT_SERVICE ( LogoImageStatusbarController, {} )
57 : :
58 : 0 : LogoImageStatusbarController::LogoImageStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
59 [ # # ][ # # ]: 0 : svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
60 : : {
61 [ # # ][ # # ]: 0 : Image aImage( FwlResId( RID_IMAGE_STATUSBAR_LOGO ));
62 [ # # ][ # # ]: 0 : m_aLogoImage = aImage;
63 : 0 : }
64 : :
65 [ # # ]: 0 : LogoImageStatusbarController::~LogoImageStatusbarController()
66 : : {
67 [ # # ]: 0 : }
68 : :
69 : : // XInterface
70 : 0 : Any SAL_CALL LogoImageStatusbarController::queryInterface( const Type& rType )
71 : : throw ( RuntimeException )
72 : : {
73 : 0 : return svt::StatusbarController::queryInterface( rType );
74 : : }
75 : :
76 : 0 : void SAL_CALL LogoImageStatusbarController::acquire() throw ()
77 : : {
78 : 0 : svt::StatusbarController::acquire();
79 : 0 : }
80 : :
81 : 0 : void SAL_CALL LogoImageStatusbarController::release() throw ()
82 : : {
83 : 0 : svt::StatusbarController::release();
84 : 0 : }
85 : :
86 : 0 : void SAL_CALL LogoImageStatusbarController::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 : 0 : }
93 : :
94 : : // XComponent
95 : 0 : void SAL_CALL LogoImageStatusbarController::dispose()
96 : : throw (::com::sun::star::uno::RuntimeException)
97 : : {
98 : 0 : svt::StatusbarController::dispose();
99 : 0 : }
100 : :
101 : : // XEventListener
102 : 0 : void SAL_CALL LogoImageStatusbarController::disposing( const EventObject& Source )
103 : : throw ( RuntimeException )
104 : : {
105 : 0 : svt::StatusbarController::disposing( Source );
106 : 0 : }
107 : :
108 : : // XStatusListener
109 : 0 : void SAL_CALL LogoImageStatusbarController::statusChanged( const FeatureStateEvent& )
110 : : throw ( RuntimeException )
111 : : {
112 : 0 : }
113 : :
114 : : // XStatusbarController
115 : 0 : ::sal_Bool SAL_CALL LogoImageStatusbarController::mouseButtonDown(
116 : : const awt::MouseEvent& )
117 : : throw (::com::sun::star::uno::RuntimeException)
118 : : {
119 : 0 : return sal_False;
120 : : }
121 : :
122 : 0 : ::sal_Bool SAL_CALL LogoImageStatusbarController::mouseMove(
123 : : const awt::MouseEvent& )
124 : : throw (::com::sun::star::uno::RuntimeException)
125 : : {
126 : 0 : return sal_False;
127 : : }
128 : :
129 : 0 : ::sal_Bool SAL_CALL LogoImageStatusbarController::mouseButtonUp(
130 : : const awt::MouseEvent& )
131 : : throw (::com::sun::star::uno::RuntimeException)
132 : : {
133 : 0 : return sal_False;
134 : : }
135 : :
136 : 0 : void SAL_CALL LogoImageStatusbarController::command(
137 : : const awt::Point& aPos,
138 : : ::sal_Int32 nCommand,
139 : : ::sal_Bool bMouseEvent,
140 : : const ::com::sun::star::uno::Any& aData )
141 : : throw (::com::sun::star::uno::RuntimeException)
142 : : {
143 : 0 : svt::StatusbarController::command( aPos, nCommand, bMouseEvent, aData );
144 : 0 : }
145 : :
146 : 0 : void SAL_CALL LogoImageStatusbarController::paint(
147 : : const ::com::sun::star::uno::Reference< awt::XGraphics >& xGraphics,
148 : : const awt::Rectangle& rOutputRectangle,
149 : : ::sal_Int32 /*nItemId*/,
150 : : ::sal_Int32 /*nStyle*/ )
151 : : throw (::com::sun::star::uno::RuntimeException)
152 : : {
153 [ # # ]: 0 : SolarMutexGuard aGuard;
154 : :
155 [ # # ]: 0 : OutputDevice* pOutDev = VCLUnoHelper::GetOutputDevice( xGraphics );;
156 [ # # ]: 0 : if ( pOutDev )
157 : : {
158 [ # # ]: 0 : ::Rectangle aRect = VCLRectangle( rOutputRectangle );
159 [ # # ][ # # ]: 0 : pOutDev->DrawImage( aRect.TopLeft(), aRect.GetSize(), m_aLogoImage );
160 [ # # ]: 0 : }
161 : 0 : }
162 : :
163 : 0 : void SAL_CALL LogoImageStatusbarController::click()
164 : : throw (::com::sun::star::uno::RuntimeException)
165 : : {
166 : 0 : svt::StatusbarController::click();
167 : 0 : }
168 : :
169 : 0 : void SAL_CALL LogoImageStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
170 : : {
171 : 0 : svt::StatusbarController::doubleClick();
172 : 0 : }
173 : :
174 : : }
175 : :
176 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|