1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <toolkit/controls/unocontrolcontainermodel.hxx>
22 #include <toolkit/helper/property.hxx>
23 #include <toolkit/helper/servicenames.hxx>
24 #include <toolkit/helper/unopropertyarrayhelper.hxx>
26 // ----------------------------------------------------
27 // class UnoControlContainerModel
28 // ----------------------------------------------------
29 UnoControlContainerModel::UnoControlContainerModel( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& i_factory
)
30 :UnoControlModel( i_factory
)
32 ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR
);
33 ImplRegisterProperty( BASEPROPERTY_BORDER
);
34 ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR
);
35 ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL
);
36 ImplRegisterProperty( BASEPROPERTY_ENABLED
);
37 ImplRegisterProperty( BASEPROPERTY_HELPTEXT
);
38 ImplRegisterProperty( BASEPROPERTY_HELPURL
);
39 ImplRegisterProperty( BASEPROPERTY_PRINTABLE
);
40 ImplRegisterProperty( BASEPROPERTY_TEXT
);
43 ::rtl::OUString
UnoControlContainerModel::getServiceName() throw(::com::sun::star::uno::RuntimeException
)
45 return ::rtl::OUString::createFromAscii( szServiceName_UnoControlContainerModel
);
48 ::com::sun::star::uno::Any
UnoControlContainerModel::ImplGetDefaultValue( sal_uInt16 nPropId
) const
50 ::com::sun::star::uno::Any aDefault
;
51 if ( nPropId
== BASEPROPERTY_BORDER
)
52 aDefault
<<= (sal_Int16
) 0;
54 aDefault
<<= UnoControlModel::ImplGetDefaultValue( nPropId
);
59 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> UnoControlContainerModel::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
)
61 static ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
65 ::cppu::IPropertyArrayHelper
& UnoControlContainerModel::getInfoHelper()
67 ::osl::Guard
< ::osl::Mutex
> aGuard( ((UnoControlContainerModel
*)this)->GetMutex() );
69 static UnoPropertyArrayHelper
* pHelper
= NULL
;
72 ::com::sun::star::uno::Sequence
<sal_Int32
> aIDs
= ImplGetPropertyIds();
73 pHelper
= new UnoPropertyArrayHelper( aIDs
);
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */