merge the formfield patch from ooo-build
[ooovba.git] / shell / source / backends / kdebe / kdevcllayer.cxx
blobe2373e08a2ba0d799b6fbf777c029effb37b024c
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: kdevcllayer.cxx,v $
10 * $Revision: 1.5 $
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 "kdevcllayer.hxx"
34 #include <com/sun/star/configuration/backend/PropertyInfo.hpp>
35 #ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
36 #include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
37 #endif
38 #include <com/sun/star/uno/Sequence.hxx>
39 #include <vcl/kde_headers.h>
41 //==============================================================================
43 KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
45 //Create instance of LayerContentDescriber Service
46 rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
47 "com.sun.star.comp.configuration.backend.LayerDescriber"));
49 typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
50 uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
51 if( xServiceManager.is() )
53 m_xLayerContentDescriber = LayerDescriber::query(
54 xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
56 else
58 OSL_TRACE("Could not retrieve ServiceManager");
62 //------------------------------------------------------------------------------
64 void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
65 throw ( backend::MalformedDataException, lang::NullPointerException,
66 lang::WrappedTargetException, uno::RuntimeException)
68 if( ! m_xLayerContentDescriber.is() )
70 throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
71 "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
72 ) ), static_cast < backend::XLayer * > (this) );
75 uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
78 Commenting out, does not make much sense without an accessibility bridge
79 ===========================================================================
80 #if defined(QT_ACCESSIBILITY_SUPPORT)
81 // Accessibility tools under Qt for UNIX are available starting with Qt 4.0
82 int nVersionMajor = 0;
83 const char *q = qVersion(); // "3.1.0" for example
84 while ('0' <= *q && *q <= '9')
85 nVersionMajor = nVersionMajor * 10 + *q++ - '0';
86 sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
87 #else
88 sal_Bool ATToolSupport = sal_False;
89 #endif
90 ===========================================================================
91 End of commented out section
92 */ sal_Bool ATToolSupport = sal_False;
94 aPropInfoList[0].Name = rtl::OUString(
95 RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
96 aPropInfoList[0].Type = rtl::OUString(
97 RTL_CONSTASCII_USTRINGPARAM( "string" ) );
98 aPropInfoList[0].Protected = sal_False;
99 aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
101 m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
104 //------------------------------------------------------------------------------
106 rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
107 throw (uno::RuntimeException)
109 // Return the value as timestamp to avoid regenerating the binary cache
110 // on each office launch.
112 ::rtl::OUString sTimeStamp(
113 RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
115 return sTimeStamp;