2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2014-08-07 18:42:35 +02:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include <toolkit/controls/unocontrolcontainermodel.hxx>
|
|
|
|
#include <toolkit/helper/property.hxx>
|
|
|
|
#include <toolkit/helper/servicenames.hxx>
|
|
|
|
|
2014-04-19 11:24:35 +03:00
|
|
|
#include "helper/unopropertyarrayhelper.hxx"
|
2014-02-25 22:29:44 +01:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// class UnoControlContainerModel
|
2014-02-25 22:29:44 +01:00
|
|
|
|
2015-11-09 09:05:08 +02:00
|
|
|
UnoControlContainerModel::UnoControlContainerModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory )
|
2010-12-06 14:14:11 +01:00
|
|
|
:UnoControlModel( i_factory )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
|
|
|
|
ImplRegisterProperty( BASEPROPERTY_BORDER );
|
2004-07-05 14:56:44 +00:00
|
|
|
ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplRegisterProperty( BASEPROPERTY_DEFAULTCONTROL );
|
|
|
|
ImplRegisterProperty( BASEPROPERTY_ENABLED );
|
2001-10-25 09:34:24 +00:00
|
|
|
ImplRegisterProperty( BASEPROPERTY_HELPTEXT );
|
2000-09-18 16:07:07 +00:00
|
|
|
ImplRegisterProperty( BASEPROPERTY_HELPURL );
|
|
|
|
ImplRegisterProperty( BASEPROPERTY_PRINTABLE );
|
|
|
|
ImplRegisterProperty( BASEPROPERTY_TEXT );
|
|
|
|
}
|
|
|
|
|
2015-11-09 09:05:08 +02:00
|
|
|
OUString UnoControlContainerModel::getServiceName() throw(css::uno::RuntimeException, std::exception)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2013-04-07 12:06:47 +02:00
|
|
|
return OUString::createFromAscii( szServiceName_UnoControlContainerModel );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2015-03-17 12:25:11 +01:00
|
|
|
OUString UnoControlContainerModel::getImplementationName()
|
|
|
|
throw (css::uno::RuntimeException, std::exception)
|
|
|
|
{
|
|
|
|
return OUString("stardiv.Toolkit.UnoControlContainerModel");
|
|
|
|
}
|
|
|
|
|
|
|
|
css::uno::Sequence<OUString>
|
|
|
|
UnoControlContainerModel::getSupportedServiceNames()
|
|
|
|
throw (css::uno::RuntimeException, std::exception)
|
|
|
|
{
|
|
|
|
auto s(UnoControlModel::getSupportedServiceNames());
|
|
|
|
s.realloc(s.getLength() + 2);
|
|
|
|
s[s.getLength() - 2] = "com.sun.star.awt.UnoControlContainerModel";
|
|
|
|
s[s.getLength() - 1] = "stardiv.vcl.controlmodel.ControlContainer";
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
2015-11-09 09:05:08 +02:00
|
|
|
css::uno::Any UnoControlContainerModel::ImplGetDefaultValue( sal_uInt16 nPropId ) const
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-11-09 09:05:08 +02:00
|
|
|
css::uno::Any aDefault;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( nPropId == BASEPROPERTY_BORDER )
|
|
|
|
aDefault <<= (sal_Int16) 0;
|
|
|
|
else
|
|
|
|
aDefault <<= UnoControlModel::ImplGetDefaultValue( nPropId );
|
|
|
|
return aDefault;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-11-09 09:05:08 +02:00
|
|
|
css::uno::Reference< css::beans::XPropertySetInfo > UnoControlContainerModel::getPropertySetInfo( ) throw(css::uno::RuntimeException, std::exception)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2015-11-09 09:05:08 +02:00
|
|
|
static css::uno::Reference< css::beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
return xInfo;
|
|
|
|
}
|
|
|
|
|
|
|
|
::cppu::IPropertyArrayHelper& UnoControlContainerModel::getInfoHelper()
|
|
|
|
{
|
2015-05-11 12:51:19 +02:00
|
|
|
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2015-11-10 10:26:16 +01:00
|
|
|
static UnoPropertyArrayHelper* pHelper = nullptr;
|
2000-09-18 16:07:07 +00:00
|
|
|
if ( !pHelper )
|
|
|
|
{
|
2015-11-09 09:05:08 +02:00
|
|
|
css::uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
|
2000-09-18 16:07:07 +00:00
|
|
|
pHelper = new UnoPropertyArrayHelper( aIDs );
|
|
|
|
}
|
|
|
|
return *pHelper;
|
|
|
|
}
|
|
|
|
|
2014-01-24 10:52:11 +01:00
|
|
|
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
|
|
|
|
stardiv_Toolkit_UnoControlContainerModel_get_implementation(
|
|
|
|
css::uno::XComponentContext *context,
|
|
|
|
css::uno::Sequence<css::uno::Any> const &)
|
|
|
|
{
|
|
|
|
return cppu::acquire(new UnoControlContainerModel(context));
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2010-10-14 08:27:31 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|