Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <uielement/logotextstatusbarcontroller.hxx>
21 : #include <classes/fwlresid.hxx>
22 : #include <services.h>
23 : #include <classes/resource.hrc>
24 : #include <osl/mutex.hxx>
25 : #include <vcl/svapp.hxx>
26 : #include <vcl/window.hxx>
27 : #include <vcl/status.hxx>
28 : #include <toolkit/unohlp.hxx>
29 : #include <toolkit/helper/convert.hxx>
30 :
31 : using namespace ::rtl;
32 : using namespace ::cppu;
33 : using namespace ::com::sun::star;
34 : using namespace ::com::sun::star::awt;
35 : using namespace ::com::sun::star::uno;
36 : using namespace ::com::sun::star::lang;
37 : using namespace ::com::sun::star::frame;
38 :
39 : namespace framework
40 : {
41 :
42 0 : DEFINE_XSERVICEINFO_MULTISERVICE ( LogoTextStatusbarController ,
43 : OWeakObject ,
44 : SERVICENAME_STATUSBARCONTROLLER ,
45 : IMPLEMENTATIONNAME_LOGOTEXTSTATUSBARCONTROLLER
46 : )
47 :
48 0 : DEFINE_INIT_SERVICE ( LogoTextStatusbarController, {} )
49 :
50 0 : LogoTextStatusbarController::LogoTextStatusbarController( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) :
51 0 : svt::StatusbarController( xServiceManager, uno::Reference< frame::XFrame >(), rtl::OUString(), 0 )
52 : {
53 0 : m_aLogoText = String( FwlResId( STR_STATUSBAR_LOGOTEXT ));
54 0 : }
55 :
56 0 : LogoTextStatusbarController::~LogoTextStatusbarController()
57 : {
58 0 : }
59 :
60 : // XInterface
61 0 : Any SAL_CALL LogoTextStatusbarController::queryInterface( const Type& rType )
62 : throw ( RuntimeException )
63 : {
64 0 : return svt::StatusbarController::queryInterface( rType );
65 : }
66 :
67 0 : void SAL_CALL LogoTextStatusbarController::acquire() throw ()
68 : {
69 0 : svt::StatusbarController::acquire();
70 0 : }
71 :
72 0 : void SAL_CALL LogoTextStatusbarController::release() throw ()
73 : {
74 0 : svt::StatusbarController::release();
75 0 : }
76 :
77 0 : void SAL_CALL LogoTextStatusbarController::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
78 : throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
79 : {
80 0 : SolarMutexGuard aSolarMutexGuard;
81 :
82 0 : svt::StatusbarController::initialize( aArguments );
83 :
84 0 : if ( m_xParentWindow.is() && m_nID > 0 )
85 : {
86 0 : Window* pWindow = VCLUnoHelper::GetWindow( m_xParentWindow );
87 0 : if ( pWindow && ( pWindow->GetType() == WINDOW_STATUSBAR ))
88 : {
89 0 : StatusBar* pStatusBar = (StatusBar *)pWindow;
90 0 : pStatusBar->SetItemText( m_nID, m_aLogoText );
91 : }
92 0 : }
93 0 : }
94 :
95 : // XComponent
96 0 : void SAL_CALL LogoTextStatusbarController::dispose()
97 : throw (::com::sun::star::uno::RuntimeException)
98 : {
99 0 : svt::StatusbarController::dispose();
100 0 : }
101 :
102 : // XEventListener
103 0 : void SAL_CALL LogoTextStatusbarController::disposing( const EventObject& Source )
104 : throw ( RuntimeException )
105 : {
106 0 : svt::StatusbarController::disposing( Source );
107 0 : }
108 :
109 : // XStatusListener
110 0 : void SAL_CALL LogoTextStatusbarController::statusChanged( const FeatureStateEvent& )
111 : throw ( RuntimeException )
112 : {
113 0 : }
114 :
115 : // XStatusbarController
116 0 : ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseButtonDown(
117 : const ::com::sun::star::awt::MouseEvent& )
118 : throw (::com::sun::star::uno::RuntimeException)
119 : {
120 0 : return sal_False;
121 : }
122 :
123 0 : ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseMove(
124 : const ::com::sun::star::awt::MouseEvent& )
125 : throw (::com::sun::star::uno::RuntimeException)
126 : {
127 0 : return sal_False;
128 : }
129 :
130 0 : ::sal_Bool SAL_CALL LogoTextStatusbarController::mouseButtonUp(
131 : const ::com::sun::star::awt::MouseEvent& )
132 : throw (::com::sun::star::uno::RuntimeException)
133 : {
134 0 : return sal_False;
135 : }
136 :
137 0 : void SAL_CALL LogoTextStatusbarController::command(
138 : const ::com::sun::star::awt::Point& aPos,
139 : ::sal_Int32 nCommand,
140 : ::sal_Bool bMouseEvent,
141 : const ::com::sun::star::uno::Any& aData )
142 : throw (::com::sun::star::uno::RuntimeException)
143 : {
144 0 : svt::StatusbarController::command( aPos, nCommand, bMouseEvent, aData );
145 0 : }
146 :
147 0 : void SAL_CALL LogoTextStatusbarController::paint(
148 : const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& xGraphics,
149 : const ::com::sun::star::awt::Rectangle& rOutputRectangle,
150 : ::sal_Int32 nItemId,
151 : ::sal_Int32 nStyle )
152 : throw (::com::sun::star::uno::RuntimeException)
153 : {
154 0 : svt::StatusbarController::paint( xGraphics, rOutputRectangle, nItemId, nStyle );
155 0 : }
156 :
157 0 : void SAL_CALL LogoTextStatusbarController::click()
158 : throw (::com::sun::star::uno::RuntimeException)
159 : {
160 0 : svt::StatusbarController::click();
161 0 : }
162 :
163 0 : void SAL_CALL LogoTextStatusbarController::doubleClick() throw (::com::sun::star::uno::RuntimeException)
164 : {
165 0 : svt::StatusbarController::doubleClick();
166 0 : }
167 :
168 : }
169 :
170 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|