1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: localelayer.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_shell.hxx"
33 #include "localelayer.hxx"
35 //------------------------------------------------------------------------------
37 LocaleLayer::LocaleLayer( const uno::Sequence
<backend::PropertyInfo
>& aPropInfoList
,
38 const rtl::OUString
& aTimestamp
,
39 const uno::Reference
<uno::XComponentContext
>& xContext
)
40 : m_aTimestamp(aTimestamp
), m_aPropInfoList(aPropInfoList
)
42 //Create instance of LayerContentDescriber Service
43 rtl::OUString
const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
44 "com.sun.star.comp.configuration.backend.LayerDescriber"));
46 typedef uno::Reference
<backend::XLayerContentDescriber
> LayerDescriber
;
47 uno::Reference
< lang::XMultiComponentFactory
> xServiceManager
= xContext
->getServiceManager();
48 if( xServiceManager
.is() )
50 m_xLayerContentDescriber
= LayerDescriber::query(
51 xServiceManager
->createInstanceWithContext(k_sLayerDescriberService
, xContext
));
55 OSL_TRACE("Could not retrieve ServiceManager");
60 //------------------------------------------------------------------------------
62 void SAL_CALL
LocaleLayer::readData(
63 const uno::Reference
<backend::XLayerHandler
>& xHandler
)
64 throw ( backend::MalformedDataException
,
65 lang::NullPointerException
,
66 lang::WrappedTargetException
,
67 uno::RuntimeException
)
70 if (m_xLayerContentDescriber
.is())
72 m_xLayerContentDescriber
->describeLayer(xHandler
, m_aPropInfoList
);
76 OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
80 //------------------------------------------------------------------------------
82 rtl::OUString SAL_CALL
LocaleLayer::getTimestamp(void)
83 throw (uno::RuntimeException
)
88 //------------------------------------------------------------------------------