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 "vbabutton.hxx"
21 : #include "vbanewfont.hxx"
22 :
23 : using namespace com::sun::star;
24 : using namespace ooo::vba;
25 :
26 :
27 0 : const static OUString LABEL( "Label" );
28 0 : VbaButton::VbaButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
29 : {
30 0 : }
31 :
32 : // Attributes
33 : OUString SAL_CALL
34 0 : VbaButton::getCaption() throw (css::uno::RuntimeException, std::exception)
35 : {
36 0 : OUString Label;
37 0 : m_xProps->getPropertyValue( LABEL ) >>= Label;
38 0 : return Label;
39 : }
40 :
41 : void SAL_CALL
42 0 : VbaButton::setCaption( const OUString& _caption ) throw (::com::sun::star::uno::RuntimeException, std::exception)
43 : {
44 0 : m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
45 0 : }
46 :
47 0 : sal_Bool SAL_CALL VbaButton::getAutoSize() throw (uno::RuntimeException, std::exception)
48 : {
49 0 : return ScVbaControl::getAutoSize();
50 : }
51 :
52 0 : void SAL_CALL VbaButton::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException, std::exception)
53 : {
54 0 : ScVbaControl::setAutoSize( bAutoSize );
55 0 : }
56 :
57 0 : sal_Bool SAL_CALL VbaButton::getLocked() throw (uno::RuntimeException, std::exception)
58 : {
59 0 : return ScVbaControl::getLocked();
60 : }
61 :
62 0 : void SAL_CALL VbaButton::setLocked( sal_Bool bLocked ) throw (uno::RuntimeException, std::exception)
63 : {
64 0 : ScVbaControl::setLocked( bLocked );
65 0 : }
66 :
67 0 : sal_Bool SAL_CALL VbaButton::getCancel() throw (uno::RuntimeException, std::exception)
68 : {
69 0 : return sal_False;
70 : }
71 :
72 0 : void SAL_CALL VbaButton::setCancel( sal_Bool /*bCancel*/ ) throw (uno::RuntimeException, std::exception)
73 : {
74 : // #STUB
75 0 : }
76 :
77 0 : sal_Bool SAL_CALL VbaButton::getDefault() throw (uno::RuntimeException, std::exception)
78 : {
79 : // #STUB
80 0 : return sal_False;
81 : }
82 :
83 0 : void SAL_CALL VbaButton::setDefault( sal_Bool /*bDefault*/ ) throw (uno::RuntimeException, std::exception)
84 : {
85 : // #STUB
86 0 : }
87 :
88 0 : sal_Int32 SAL_CALL VbaButton::getBackColor() throw (uno::RuntimeException, std::exception)
89 : {
90 0 : return ScVbaControl::getBackColor();
91 : }
92 :
93 0 : void SAL_CALL VbaButton::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException, std::exception)
94 : {
95 0 : ScVbaControl::setBackColor( nBackColor );
96 0 : }
97 :
98 0 : sal_Int32 SAL_CALL VbaButton::getForeColor() throw (uno::RuntimeException)
99 : {
100 0 : return ScVbaControl::getForeColor();
101 : }
102 :
103 0 : void SAL_CALL VbaButton::setForeColor( sal_Int32 /*nForeColor*/ ) throw (uno::RuntimeException)
104 : {
105 : // #STUB
106 0 : }
107 :
108 0 : uno::Reference< msforms::XNewFont > SAL_CALL VbaButton::getFont() throw (uno::RuntimeException, std::exception)
109 : {
110 0 : return new VbaNewFont( this, mxContext, m_xProps );
111 : }
112 :
113 : OUString
114 0 : VbaButton::getServiceImplName()
115 : {
116 0 : return OUString("VbaButton");
117 : }
118 :
119 : uno::Sequence< OUString >
120 0 : VbaButton::getServiceNames()
121 : {
122 0 : static uno::Sequence< OUString > aServiceNames;
123 0 : if ( aServiceNames.getLength() == 0 )
124 : {
125 0 : aServiceNames.realloc( 1 );
126 0 : aServiceNames[ 0 ] = "ooo.vba.msforms.Button";
127 : }
128 0 : return aServiceNames;
129 0 : }
130 :
131 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|