Version 4.2.0.1, tag libreoffice-4.2.0.1
[LibreOffice.git] / vbahelper / source / msforms / vbalabel.cxx
blob6a1d78f496f1267ac23c5a629e718ede52370f2e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "vbalabel.hxx"
21 #include "vbanewfont.hxx"
23 using namespace com::sun::star;
24 using namespace ooo::vba;
27 const static OUString LABEL( "Label" );
28 ScVbaLabel::ScVbaLabel( const css::uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : LabelImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
32 // Attributes
33 OUString SAL_CALL
34 ScVbaLabel::getCaption() throw (css::uno::RuntimeException)
36 OUString Label;
37 m_xProps->getPropertyValue( LABEL ) >>= Label;
38 return Label;
41 void SAL_CALL
42 ScVbaLabel::setCaption( const OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
44 m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
46 uno::Any SAL_CALL
47 ScVbaLabel::getValue() throw (css::uno::RuntimeException)
49 return uno::makeAny( getCaption() );
52 void SAL_CALL
53 ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
55 OUString sCaption;
56 _value >>= sCaption;
57 setCaption( sCaption );
60 OUString SAL_CALL
61 ScVbaLabel::getAccelerator() throw (css::uno::RuntimeException)
63 // #STUB
64 return OUString();
67 void SAL_CALL
68 ScVbaLabel::setAccelerator( const OUString& /*_accelerator*/ ) throw (::com::sun::star::uno::RuntimeException)
70 // #STUB
73 uno::Reference< msforms::XNewFont > SAL_CALL ScVbaLabel::getFont() throw (uno::RuntimeException)
75 return new VbaNewFont( this, mxContext, m_xProps );
78 OUString ScVbaLabel::getServiceImplName()
80 return OUString( "ScVbaLabel" );
83 sal_Int32 SAL_CALL ScVbaLabel::getBackColor() throw (uno::RuntimeException)
85 return ScVbaControl::getBackColor();
88 void SAL_CALL ScVbaLabel::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException)
90 ScVbaControl::setBackColor( nBackColor );
93 sal_Bool SAL_CALL ScVbaLabel::getAutoSize() throw (uno::RuntimeException)
95 return ScVbaControl::getAutoSize();
98 void SAL_CALL ScVbaLabel::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException)
100 ScVbaControl::setAutoSize( bAutoSize );
103 uno::Sequence< OUString >
104 ScVbaLabel::getServiceNames()
106 static uno::Sequence< OUString > aServiceNames;
107 if ( aServiceNames.getLength() == 0 )
109 aServiceNames.realloc( 1 );
110 aServiceNames[ 0 ] = "ooo.vba.msforms.Label";
112 return aServiceNames;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */