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: kde4vcllayer.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"
34 #include "kde4vcllayer.hxx"
36 #include <com/sun/star/configuration/backend/PropertyInfo.hpp>
37 #include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
38 #include <com/sun/star/uno/Sequence.hxx>
40 //==============================================================================
42 KDEVCLLayer::KDEVCLLayer(const uno::Reference
<uno::XComponentContext
>& xContext
)
44 //Create instance of LayerContentDescriber Service
45 rtl::OUString
const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
46 "com.sun.star.comp.configuration.backend.LayerDescriber"));
48 typedef uno::Reference
<backend::XLayerContentDescriber
> LayerDescriber
;
49 uno::Reference
< lang::XMultiComponentFactory
> xServiceManager
= xContext
->getServiceManager();
50 if( xServiceManager
.is() )
52 m_xLayerContentDescriber
= LayerDescriber::query(
53 xServiceManager
->createInstanceWithContext(k_sLayerDescriberService
, xContext
));
57 OSL_TRACE("Could not retrieve ServiceManager");
61 //------------------------------------------------------------------------------
63 void SAL_CALL
KDEVCLLayer::readData( const uno::Reference
<backend::XLayerHandler
>& xHandler
)
64 throw ( backend::MalformedDataException
, lang::NullPointerException
,
65 lang::WrappedTargetException
, uno::RuntimeException
)
67 if( ! m_xLayerContentDescriber
.is() )
69 throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
70 "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
71 ) ), static_cast < backend::XLayer
* > (this) );
74 uno::Sequence
<backend::PropertyInfo
> aPropInfoList(1);
77 Commenting out, does not make much sense without an accessibility bridge
78 ===========================================================================
79 #if defined(QT_ACCESSIBILITY_SUPPORT)
80 // Accessibility tools under Qt for UNIX are available starting with Qt 4.0
81 int nVersionMajor = 0;
82 const char *q = qVersion(); // "3.1.0" for example
83 while ('0' <= *q && *q <= '9')
84 nVersionMajor = nVersionMajor * 10 + *q++ - '0';
85 sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
87 sal_Bool ATToolSupport = sal_False;
89 ===========================================================================
90 End of commented out section
91 */ sal_Bool ATToolSupport
= sal_False
;
93 aPropInfoList
[0].Name
= rtl::OUString(
94 RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
95 aPropInfoList
[0].Type
= rtl::OUString(
96 RTL_CONSTASCII_USTRINGPARAM( "string" ) );
97 aPropInfoList
[0].Protected
= sal_False
;
98 aPropInfoList
[0].Value
= uno::makeAny( rtl::OUString::valueOf( ATToolSupport
) );
100 m_xLayerContentDescriber
->describeLayer(xHandler
, aPropInfoList
);
103 //------------------------------------------------------------------------------
105 rtl::OUString SAL_CALL
KDEVCLLayer::getTimestamp(void)
106 throw (uno::RuntimeException
)
108 // Return the value as timestamp to avoid regenerating the binary cache
109 // on each office launch.
111 ::rtl::OUString
sTimeStamp(
112 RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );