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 "vbalabel.hxx"
21 : #include "vbanewfont.hxx"
22 :
23 : using namespace com::sun::star;
24 : using namespace ooo::vba;
25 :
26 2 : 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 )
27 : {
28 2 : }
29 :
30 : // Attributes
31 : OUString SAL_CALL
32 2 : ScVbaLabel::getCaption() throw (css::uno::RuntimeException, std::exception)
33 : {
34 2 : OUString Label;
35 2 : m_xProps->getPropertyValue( "Label" ) >>= Label;
36 2 : return Label;
37 : }
38 :
39 : void SAL_CALL
40 0 : ScVbaLabel::setCaption( const OUString& _caption ) throw (::com::sun::star::uno::RuntimeException, std::exception)
41 : {
42 0 : m_xProps->setPropertyValue( "Label", uno::makeAny( _caption ) );
43 0 : }
44 : uno::Any SAL_CALL
45 0 : ScVbaLabel::getValue() throw (css::uno::RuntimeException, std::exception)
46 : {
47 0 : return uno::makeAny( getCaption() );
48 : }
49 :
50 : void SAL_CALL
51 0 : ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException, std::exception)
52 : {
53 0 : OUString sCaption;
54 0 : _value >>= sCaption;
55 0 : setCaption( sCaption );
56 0 : }
57 :
58 : OUString SAL_CALL
59 0 : ScVbaLabel::getAccelerator() throw (css::uno::RuntimeException, std::exception)
60 : {
61 : // #STUB
62 0 : return OUString();
63 : }
64 :
65 : void SAL_CALL
66 0 : ScVbaLabel::setAccelerator( const OUString& /*_accelerator*/ ) throw (::com::sun::star::uno::RuntimeException, std::exception)
67 : {
68 : // #STUB
69 0 : }
70 :
71 0 : uno::Reference< msforms::XNewFont > SAL_CALL ScVbaLabel::getFont() throw (uno::RuntimeException, std::exception)
72 : {
73 0 : return new VbaNewFont( m_xProps );
74 : }
75 :
76 0 : OUString ScVbaLabel::getServiceImplName()
77 : {
78 0 : return OUString( "ScVbaLabel" );
79 : }
80 :
81 0 : sal_Int32 SAL_CALL ScVbaLabel::getBackColor() throw (uno::RuntimeException, std::exception)
82 : {
83 0 : return ScVbaControl::getBackColor();
84 : }
85 :
86 0 : void SAL_CALL ScVbaLabel::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException, std::exception)
87 : {
88 0 : ScVbaControl::setBackColor( nBackColor );
89 0 : }
90 :
91 0 : sal_Bool SAL_CALL ScVbaLabel::getAutoSize() throw (uno::RuntimeException, std::exception)
92 : {
93 0 : return ScVbaControl::getAutoSize();
94 : }
95 :
96 0 : void SAL_CALL ScVbaLabel::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException, std::exception)
97 : {
98 0 : ScVbaControl::setAutoSize( bAutoSize );
99 0 : }
100 :
101 : uno::Sequence< OUString >
102 0 : ScVbaLabel::getServiceNames()
103 : {
104 0 : static uno::Sequence< OUString > aServiceNames;
105 0 : if ( aServiceNames.getLength() == 0 )
106 : {
107 0 : aServiceNames.realloc( 1 );
108 0 : aServiceNames[ 0 ] = "ooo.vba.msforms.Label";
109 : }
110 0 : return aServiceNames;
111 6 : }
112 :
113 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|