1 diff --git shell/source/backends/kde4be/exports.map shell/source/backends/kde4be/exports.map
5 +++ shell/source/backends/kde4be/exports.map
10 + component_getImplementationEnvironment;
11 + component_getFactory;
12 + component_writeInfo;
17 diff --git shell/source/backends/kde4be/kde4backend.cxx shell/source/backends/kde4be/kde4backend.cxx
19 index 0000000..a90cb3b
21 +++ shell/source/backends/kde4be/kde4backend.cxx
23 +/*************************************************************************
25 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
27 + * Copyright 2008 by Sun Microsystems, Inc.
29 + * OpenOffice.org - a multi-platform office productivity suite
31 + * $RCSfile: kde4backend.cxx,v $
34 + * This file is part of OpenOffice.org.
36 + * OpenOffice.org is free software: you can redistribute it and/or modify
37 + * it under the terms of the GNU Lesser General Public License version 3
38 + * only, as published by the Free Software Foundation.
40 + * OpenOffice.org is distributed in the hope that it will be useful,
41 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
42 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43 + * GNU Lesser General Public License version 3 for more details
44 + * (a copy is included in the LICENSE file that accompanied this code).
46 + * You should have received a copy of the GNU Lesser General Public License
47 + * version 3 along with OpenOffice.org. If not, see
48 + * <http://www.openoffice.org/license.html>
49 + * for a copy of the LGPLv3 License.
51 + ************************************************************************/
53 +// MARKER(update_precomp.py): autogen include statement, do not remove
54 +#include "precompiled_shell.hxx"
56 +#include "kde4backend.hxx"
57 +#include "kde4commonlayer.hxx"
58 +#include "kde4inetlayer.hxx"
59 +#include "kde4vcllayer.hxx"
60 +#include "kde4pathslayer.hxx"
62 +//------------------------------------------------------------------------------
64 +KDEBackend* KDEBackend::mInstance= 0;
66 +KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
70 + mInstance = new KDEBackend (xContext);
76 +//------------------------------------------------------------------------------
78 +KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
79 + throw (backend::BackendAccessException)
80 + : BackendBase(mMutex), m_xContext(xContext)
84 +//------------------------------------------------------------------------------
86 +KDEBackend::~KDEBackend(void)
90 +//------------------------------------------------------------------------------
92 +uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
93 + const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
94 + throw (backend::BackendAccessException, lang::IllegalArgumentException)
96 + uno::Reference<backend::XLayer> xLayer;
98 + if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
100 + xLayer = new KDECommonLayer(m_xContext);
102 + else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
104 + xLayer = new KDEInetLayer(m_xContext);
106 + else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
108 + xLayer = new KDEVCLLayer(m_xContext);
110 + else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
112 + xLayer = new KDEPathsLayer(m_xContext);
118 +//------------------------------------------------------------------------------
120 +uno::Reference<backend::XUpdatableLayer> SAL_CALL
121 +KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */)
122 + throw (backend::BackendAccessException,lang::NoSupportException,
123 + lang::IllegalArgumentException)
125 + throw lang::NoSupportException( rtl::OUString(
126 + RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
130 +//------------------------------------------------------------------------------
132 +rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
134 + return rtl::OUString(
135 + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") );
138 +//------------------------------------------------------------------------------
140 +rtl::OUString SAL_CALL KDEBackend::getImplementationName(void)
141 + throw (uno::RuntimeException)
143 + return getBackendName() ;
146 +//------------------------------------------------------------------------------
148 +uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void)
150 + uno::Sequence<rtl::OUString> aServices(1) ;
151 + aServices[0] = rtl::OUString(
152 + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ;
157 +//------------------------------------------------------------------------------
159 +sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName)
160 + throw (uno::RuntimeException)
162 + uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
164 + for(sal_Int32 i = 0; i < svc.getLength(); ++i )
165 + if(svc[i] == aServiceName)
171 +//------------------------------------------------------------------------------
173 +uno::Sequence<rtl::OUString>
174 +SAL_CALL KDEBackend::getSupportedServiceNames(void)
175 + throw (uno::RuntimeException)
177 + return getBackendServiceNames() ;
180 +// ---------------------------------------------------------------------------------------
181 diff --git shell/source/backends/kde4be/kde4backend.hxx shell/source/backends/kde4be/kde4backend.hxx
183 index 0000000..f2c258d
185 +++ shell/source/backends/kde4be/kde4backend.hxx
187 +/*************************************************************************
189 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
191 + * Copyright 2008 by Sun Microsystems, Inc.
193 + * OpenOffice.org - a multi-platform office productivity suite
195 + * $RCSfile: kde4backend.hxx,v $
198 + * This file is part of OpenOffice.org.
200 + * OpenOffice.org is free software: you can redistribute it and/or modify
201 + * it under the terms of the GNU Lesser General Public License version 3
202 + * only, as published by the Free Software Foundation.
204 + * OpenOffice.org is distributed in the hope that it will be useful,
205 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
206 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
207 + * GNU Lesser General Public License version 3 for more details
208 + * (a copy is included in the LICENSE file that accompanied this code).
210 + * You should have received a copy of the GNU Lesser General Public License
211 + * version 3 along with OpenOffice.org. If not, see
212 + * <http://www.openoffice.org/license.html>
213 + * for a copy of the LGPLv3 License.
215 + ************************************************************************/
219 +#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
220 +#include <com/sun/star/lang/XInitialization.hpp>
221 +#include <com/sun/star/uno/XComponentContext.hpp>
222 +#include <com/sun/star/lang/XServiceInfo.hpp>
223 +#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
224 +#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
225 +#include <cppuhelper/compbase2.hxx>
227 +#ifndef INCLUDED_MAP
229 +#define INCLUDED_MAP
232 +namespace css = com::sun::star ;
233 +namespace uno = css::uno ;
234 +namespace lang = css::lang ;
235 +namespace backend = css::configuration::backend ;
238 +//------------------------------------------------------------------------------
239 +typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
240 + lang::XServiceInfo> BackendBase ;
243 + Implements the SingleLayerStratum service for KDE access.
245 +class KDEBackend : public BackendBase {
248 + static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
251 + virtual rtl::OUString SAL_CALL getImplementationName( )
252 + throw (uno::RuntimeException) ;
254 + virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName )
255 + throw (uno::RuntimeException) ;
257 + virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames( )
258 + throw (uno::RuntimeException) ;
261 + Provides the implementation name.
263 + @return implementation name
265 + static rtl::OUString SAL_CALL getBackendName(void) ;
268 + Provides the supported services names
270 + @return service names
272 + static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
274 + //XSingleLayerStratum
275 + virtual uno::Reference<backend::XLayer> SAL_CALL
276 + getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
277 + throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
279 + virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
280 + getUpdatableLayer( const rtl::OUString& aLayerId )
281 + throw (backend::BackendAccessException, lang::NoSupportException,
282 + lang::IllegalArgumentException) ;
286 + Service constructor from a service factory.
288 + @param xContext component context
290 + KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
291 + throw (backend::BackendAccessException);
294 + ~KDEBackend(void) ;
298 + /** Build KDE/OO mapping table */
299 + void initializeMappingTable ();
302 + /** The component context */
303 + uno::Reference<uno::XComponentContext> m_xContext;
305 + /** Mutex for reOOurces protection */
306 + osl::Mutex mMutex ;
308 + static KDEBackend* mInstance;
310 diff --git shell/source/backends/kde4be/kde4be.xml shell/source/backends/kde4be/kde4be.xml
312 index 0000000..9396167
314 +++ shell/source/backends/kde4be/kde4be.xml
316 +<?xml version="1.0" encoding="UTF-8"?>
317 +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
318 +<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
319 + <module-name>kde4be</module-name>
320 + <component-description>
321 + <author> Éric Bischoff </author>
322 + <name>com.sun.star.comp.configuration.backend.KDE4Backend</name>
323 + <description> The KDE4 configuration backend </description>
324 + <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
325 + <language>c++</language>
326 + <status value="beta"/>
327 + <supported-service>com.sun.star.comp.configuration.backend.KDE4Backend</supported-service>
328 + <service-dependency>...</service-dependency>
329 + <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
330 + <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
331 + <type>com.sun.star.configuration.backend.XLayerHandler</type>
332 + <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
333 + <type>com.sun.star.lang.XMultiComponentFactory</type>
334 + <type>com.sun.star.lang.XServiceInfo</type>
335 + <type>com.sun.star.lang.XSingleComponentFactory</type>
336 + <type>com.sun.star.lang.XTypeProvider</type>
337 + <type>com.sun.star.uno.TypeClass</type>
338 + <type>com.sun.star.uno.XAggregation</type>
339 + <type>com.sun.star.uno.XComponentContext</type>
340 + <type>com.sun.star.uno.XCurrentContext</type>
341 + <type>com.sun.star.uno.XWeak</type>
342 + <type>com.sun.star.registry.XRegistryKey</type>
343 + </component-description>
344 + <project-build-dependency>cppuhelper</project-build-dependency>
345 + <project-build-dependency>cppu</project-build-dependency>
346 + <project-build-dependency>sal</project-build-dependency>
347 + <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
348 + <runtime-module-dependency>cppu3</runtime-module-dependency>
349 + <runtime-module-dependency>sal3</runtime-module-dependency>
350 +</module-description>
351 diff --git shell/source/backends/kde4be/kde4be1-ucd.txt shell/source/backends/kde4be/kde4be1-ucd.txt
353 index 0000000..9671199
355 +++ shell/source/backends/kde4be/kde4be1-ucd.txt
357 +[ComponentDescriptor]
358 +ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend
359 +ComponentName=kde4be1.uno.so
360 +LoaderName=com.sun.star.loader.SharedLibrary
362 +com.sun.star.configuration.backend.KDE4Backend
363 diff --git shell/source/backends/kde4be/kde4becdef.cxx shell/source/backends/kde4be/kde4becdef.cxx
365 index 0000000..2dba0ec
367 +++ shell/source/backends/kde4be/kde4becdef.cxx
369 +/*************************************************************************
371 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
373 + * Copyright 2008 by Sun Microsystems, Inc.
375 + * OpenOffice.org - a multi-platform office productivity suite
377 + * $RCSfile: kde4becdef.cxx,v $
380 + * This file is part of OpenOffice.org.
382 + * OpenOffice.org is free software: you can redistribute it and/or modify
383 + * it under the terms of the GNU Lesser General Public License version 3
384 + * only, as published by the Free Software Foundation.
386 + * OpenOffice.org is distributed in the hope that it will be useful,
387 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
388 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
389 + * GNU Lesser General Public License version 3 for more details
390 + * (a copy is included in the LICENSE file that accompanied this code).
392 + * You should have received a copy of the GNU Lesser General Public License
393 + * version 3 along with OpenOffice.org. If not, see
394 + * <http://www.openoffice.org/license.html>
395 + * for a copy of the LGPLv3 License.
397 + ************************************************************************/
399 +// MARKER(update_precomp.py): autogen include statement, do not remove
400 +#include "precompiled_shell.hxx"
401 +#include "kde4backend.hxx"
403 +#include <kapplication.h>
405 +#include <cppuhelper/implementationentry.hxx>
407 +#include <com/sun/star/registry/XRegistryKey.hpp>
408 +#include <com/sun/star/uno/XComponentContext.hpp>
410 +#include "uno/current_context.hxx"
412 +namespace css = com::sun::star ;
413 +namespace uno = css::uno ;
414 +namespace lang = css::lang ;
415 +namespace backend = css::configuration::backend ;
417 +//==============================================================================
419 +static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
422 + uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
424 + if (xCurrentContext.is())
426 + uno::Any aValue = xCurrentContext->getValueByName(
427 + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
429 + rtl::OUString aDesktopEnvironment;
430 + if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
431 + return * KDEBackend::createInstance(xContext);
434 + return uno::Reference<uno::XInterface>();
436 + } catch (uno::RuntimeException e) {
437 + return uno::Reference<uno::XInterface>();
442 +//==============================================================================
444 +static const cppu::ImplementationEntry kImplementations_entries[] =
448 + KDEBackend::getBackendName,
449 + KDEBackend::getBackendServiceNames,
450 + cppu::createSingleComponentFactory,
454 + { NULL, NULL, NULL, NULL, NULL, 0 }
456 +//------------------------------------------------------------------------------
458 +extern "C" void SAL_CALL component_getImplementationEnvironment(
459 + const sal_Char **aEnvTypeName,
460 + uno_Environment **) {
461 + *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
464 +//------------------------------------------------------------------------------
466 +extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
467 + void *pRegistryKey) {
469 + using namespace ::com::sun::star::registry;
474 + uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
475 + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
478 + // Register associated service names
479 + uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
480 + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
483 + uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
484 + for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
485 + xServicesKey->createKey(sServiceNames[i]);
490 + catch( InvalidRegistryException& )
492 + OSL_ENSURE(sal_False, "InvalidRegistryException caught");
499 +//------------------------------------------------------------------------------
501 +extern "C" void *component_getFactory(const sal_Char *aImplementationName,
502 + void *aServiceManager,
503 + void *aRegistryKey) {
505 + return cppu::component_getFactoryHelper(
506 + aImplementationName,
509 + kImplementations_entries) ;
511 +//------------------------------------------------------------------------------
512 diff --git shell/source/backends/kde4be/kde4commonlayer.cxx shell/source/backends/kde4be/kde4commonlayer.cxx
514 index 0000000..6e718cb
516 +++ shell/source/backends/kde4be/kde4commonlayer.cxx
518 +/*************************************************************************
520 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
522 + * Copyright 2008 by Sun Microsystems, Inc.
524 + * OpenOffice.org - a multi-platform office productivity suite
526 + * $RCSfile: kde4commonlayer.cxx,v $
529 + * This file is part of OpenOffice.org.
531 + * OpenOffice.org is free software: you can redistribute it and/or modify
532 + * it under the terms of the GNU Lesser General Public License version 3
533 + * only, as published by the Free Software Foundation.
535 + * OpenOffice.org is distributed in the hope that it will be useful,
536 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
537 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
538 + * GNU Lesser General Public License version 3 for more details
539 + * (a copy is included in the LICENSE file that accompanied this code).
541 + * You should have received a copy of the GNU Lesser General Public License
542 + * version 3 along with OpenOffice.org. If not, see
543 + * <http://www.openoffice.org/license.html>
544 + * for a copy of the LGPLv3 License.
546 + ************************************************************************/
548 +// MARKER(update_precomp.py): autogen include statement, do not remove
549 +#include "precompiled_shell.hxx"
551 +#include "kde4commonlayer.hxx"
553 +#include <kemailsettings.h>
554 +#include <kglobalsettings.h>
558 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
559 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
560 +#include <com/sun/star/uno/Sequence.hxx>
564 +//==============================================================================
566 +KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
568 + //Create instance of LayerContentDescriber Service
569 + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
570 + "com.sun.star.comp.configuration.backend.LayerDescriber"));
572 + typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
573 + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
574 + if( xServiceManager.is() )
576 + m_xLayerContentDescriber = LayerDescriber::query(
577 + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
581 + OSL_TRACE("Could not retrieve ServiceManager");
585 +//------------------------------------------------------------------------------
587 +void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
588 + throw ( backend::MalformedDataException, lang::NullPointerException,
589 + lang::WrappedTargetException, uno::RuntimeException)
591 + if( ! m_xLayerContentDescriber.is() )
593 + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
594 + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
595 + ) ), static_cast < backend::XLayer * > (this) );
598 + uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
599 + sal_Int32 nProperties = 0;
601 + // Email client settings
602 + KEMailSettings aEmailSettings;
603 + QString aClientProgram;
604 + ::rtl::OUString sClientProgram;
606 + aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
607 + if ( aClientProgram.isEmpty() )
608 + aClientProgram = "kmail";
610 + aClientProgram = aClientProgram.section(SPACE, 0, 0);
611 + sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
613 + aPropInfoList[nProperties].Name = rtl::OUString(
614 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
615 + aPropInfoList[nProperties].Type = rtl::OUString(
616 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
617 + aPropInfoList[nProperties].Protected = sal_False;
618 + aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
620 + // Source code font settings
623 + :: rtl::OUString sFontName;
626 + aFixedFont = KGlobalSettings::fixedFont();
627 + aFontName = aFixedFont.family();
628 + sFontName = (const sal_Unicode *) aFontName.utf16();
629 + nFontHeight = aFixedFont.pointSize();
631 + aPropInfoList[nProperties].Name = rtl::OUString(
632 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
633 + aPropInfoList[nProperties].Type = rtl::OUString(
634 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
635 + aPropInfoList[nProperties].Protected = sal_False;
636 + aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
638 + aPropInfoList[nProperties].Name = rtl::OUString(
639 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
640 + aPropInfoList[nProperties].Type = rtl::OUString(
641 + RTL_CONSTASCII_USTRINGPARAM( "short" ) );
642 + aPropInfoList[nProperties].Protected = sal_False;
643 + aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
645 + if( nProperties > 0 )
647 + aPropInfoList.realloc(nProperties);
648 + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
652 +//------------------------------------------------------------------------------
654 +rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void)
655 + throw (uno::RuntimeException)
657 + // Return the value as timestamp to avoid regenerating the binary cache
658 + // on each office launch.
660 + KEMailSettings aEmailSettings;
661 + QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
662 + aClientProgram = aClientProgram.section(SPACE, 0, 0);
664 + QString aFixedFont = KGlobalSettings::fixedFont().toString();
666 + ::rtl::OUString sTimeStamp,
667 + sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
669 + sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
671 + sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
675 diff --git shell/source/backends/kde4be/kde4commonlayer.hxx shell/source/backends/kde4be/kde4commonlayer.hxx
677 index 0000000..d37bab8
679 +++ shell/source/backends/kde4be/kde4commonlayer.hxx
683 +#include "kde4backend.hxx"
684 +#include <com/sun/star/uno/XComponentContext.hpp>
685 +#include <com/sun/star/configuration/backend/XLayer.hpp>
686 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
687 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
688 +#include <com/sun/star/util/XTimeStamped.hpp>
689 +#include <cppuhelper/implbase2.hxx>
691 +namespace css = com::sun::star ;
692 +namespace uno = css::uno ;
693 +namespace lang = css::lang ;
694 +namespace backend = css::configuration::backend ;
695 +namespace util = css::util ;
698 + Implementation of the XLayer interface for the KDE values mapped into
699 + the org.openoffice.Office.Common configuration component.
701 +class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
705 + Constructor given the component context
707 + @param xContext The component context
710 + KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
713 + virtual void SAL_CALL readData(
714 + const uno::Reference<backend::XLayerHandler>& xHandler)
715 + throw ( backend::MalformedDataException,
716 + lang::NullPointerException,
717 + lang::WrappedTargetException,
718 + uno::RuntimeException) ;
721 + virtual rtl::OUString SAL_CALL getTimestamp(void)
722 + throw (uno::RuntimeException);
727 + ~KDECommonLayer(void) {}
730 + uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
732 diff --git shell/source/backends/kde4be/kde4inetlayer.cxx shell/source/backends/kde4be/kde4inetlayer.cxx
734 index 0000000..01749d9
736 +++ shell/source/backends/kde4be/kde4inetlayer.cxx
738 +/*************************************************************************
740 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
742 + * Copyright 2008 by Sun Microsystems, Inc.
744 + * OpenOffice.org - a multi-platform office productivity suite
746 + * $RCSfile: kde4inetlayer.cxx,v $
749 + * This file is part of OpenOffice.org.
751 + * OpenOffice.org is free software: you can redistribute it and/or modify
752 + * it under the terms of the GNU Lesser General Public License version 3
753 + * only, as published by the Free Software Foundation.
755 + * OpenOffice.org is distributed in the hope that it will be useful,
756 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
757 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
758 + * GNU Lesser General Public License version 3 for more details
759 + * (a copy is included in the LICENSE file that accompanied this code).
761 + * You should have received a copy of the GNU Lesser General Public License
762 + * version 3 along with OpenOffice.org. If not, see
763 + * <http://www.openoffice.org/license.html>
764 + * for a copy of the LGPLv3 License.
766 + ************************************************************************/
768 +// MARKER(update_precomp.py): autogen include statement, do not remove
769 +#include "precompiled_shell.hxx"
771 +#include <kprotocolmanager.h>
773 +#include "kde4inetlayer.hxx"
774 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
775 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
776 +#include <com/sun/star/uno/Sequence.hxx>
779 +#define SEMI_COLON ';'
781 +//==============================================================================
783 +KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
785 + //Create instance of LayerContentDescriber Service
786 + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
787 + "com.sun.star.comp.configuration.backend.LayerDescriber"));
789 + typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
790 + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
791 + if( xServiceManager.is() )
793 + m_xLayerContentDescriber = LayerDescriber::query(
794 + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
798 + OSL_TRACE("Could not retrieve ServiceManager");
802 +//------------------------------------------------------------------------------
804 +void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
805 + throw ( backend::MalformedDataException, lang::NullPointerException,
806 + lang::WrappedTargetException, uno::RuntimeException)
808 + if( ! m_xLayerContentDescriber.is() )
810 + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
811 + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
812 + ) ), static_cast < backend::XLayer * > (this) );
815 + uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
816 + sal_Int32 nProperties = 0;
818 + switch ( KProtocolManager::proxyType() )
820 + case KProtocolManager::ManualProxy: // Proxies are manually configured
821 + setProxy(aPropInfoList, nProperties, 1,
822 + KProtocolManager::noProxyFor(),
823 + KProtocolManager::proxyFor( "HTTP" ),
824 + KProtocolManager::proxyFor( "FTP" ),
825 + KProtocolManager::proxyFor( "HTTPS" ));
827 + case KProtocolManager::PACProxy: // A proxy configuration URL has been given
828 + case KProtocolManager::WPADProxy: // A proxy should be automatically discovered
829 + case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
830 +// In such cases, the proxy address is not stored in KDE, but determined dynamically.
831 +// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
832 +// The best we can do here is to ask the current value for a given address.
833 + setProxy(aPropInfoList, nProperties, 1,
834 + KProtocolManager::noProxyFor(),
835 + KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
836 + KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
837 + KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
839 + default: // No proxy is used
840 + setProxy(aPropInfoList, nProperties, 0);
843 + if ( nProperties > 0 )
845 + aPropInfoList.realloc(nProperties);
846 + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
850 +//------------------------------------------------------------------------------
852 +rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void)
853 + throw (uno::RuntimeException)
855 + // Return the value as timestamp to avoid regenerating the binary cache
856 + // on each office launch.
858 + QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
860 + switch ( KProtocolManager::proxyType() )
862 + case KProtocolManager::ManualProxy:
864 + aNoProxyFor = KProtocolManager::noProxyFor();
865 + aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
866 + aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
867 + aFTPProxy = KProtocolManager::proxyFor( "FTP" );
869 + case KProtocolManager::PACProxy:
870 + case KProtocolManager::WPADProxy:
871 + case KProtocolManager::EnvVarProxy:
873 + aNoProxyFor = KProtocolManager::noProxyFor();
874 + aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
875 + aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
876 + aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
882 + ::rtl::OUString sTimeStamp,
883 + sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
885 + sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
887 + sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
889 + sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
891 + sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
893 + sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
898 +//------------------------------------------------------------------------------
900 +void SAL_CALL KDEInetLayer::setProxy
901 + (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
902 + int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
904 + aPropInfoList[nProperties].Name = rtl::OUString(
905 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
906 + aPropInfoList[nProperties].Type = rtl::OUString(
907 + RTL_CONSTASCII_USTRINGPARAM( "int" ) );
908 + aPropInfoList[nProperties].Protected = sal_False;
909 + aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
911 + if (nProxyType == 0) return;
913 + if ( !aNoProxy.isEmpty() )
915 + QString aNoProxyFor(aNoProxy);
916 + ::rtl::OUString sNoProxyFor;
918 + aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
919 + sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
921 + aPropInfoList[nProperties].Name = rtl::OUString(
922 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
923 + aPropInfoList[nProperties].Type = rtl::OUString(
924 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
925 + aPropInfoList[nProperties].Protected = sal_False;
926 + aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
929 + if ( !aHTTPProxy.isEmpty() )
931 + KUrl aProxy(aHTTPProxy);
932 + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
933 + sal_Int32 nPort = aProxy.port();
935 + aPropInfoList[nProperties].Name = rtl::OUString(
936 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
937 + aPropInfoList[nProperties].Type = rtl::OUString(
938 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
939 + aPropInfoList[nProperties].Protected = sal_False;
940 + aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
942 + aPropInfoList[nProperties].Name = rtl::OUString(
943 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
944 + aPropInfoList[nProperties].Type = rtl::OUString(
945 + RTL_CONSTASCII_USTRINGPARAM( "int" ) );
946 + aPropInfoList[nProperties].Protected = sal_False;
947 + aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
950 + if ( !aHTTPSProxy.isEmpty() )
952 + KUrl aProxy(aHTTPSProxy);
953 + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
954 + sal_Int32 nPort = aProxy.port();
956 + aPropInfoList[nProperties].Name = rtl::OUString(
957 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
958 + aPropInfoList[nProperties].Type = rtl::OUString(
959 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
960 + aPropInfoList[nProperties].Protected = sal_False;
961 + aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
963 + aPropInfoList[nProperties].Name = rtl::OUString(
964 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
965 + aPropInfoList[nProperties].Type = rtl::OUString(
966 + RTL_CONSTASCII_USTRINGPARAM( "int" ) );
967 + aPropInfoList[nProperties].Protected = sal_False;
968 + aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
971 + if ( !aFTPProxy.isEmpty() )
973 + KUrl aProxy(aFTPProxy);
974 + ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
975 + sal_Int32 nPort = aProxy.port();
977 + aPropInfoList[nProperties].Name = rtl::OUString(
978 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
979 + aPropInfoList[nProperties].Type = rtl::OUString(
980 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
981 + aPropInfoList[nProperties].Protected = sal_False;
982 + aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
984 + aPropInfoList[nProperties].Name = rtl::OUString(
985 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
986 + aPropInfoList[nProperties].Type = rtl::OUString(
987 + RTL_CONSTASCII_USTRINGPARAM( "int" ) );
988 + aPropInfoList[nProperties].Protected = sal_False;
989 + aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
993 diff --git shell/source/backends/kde4be/kde4inetlayer.hxx shell/source/backends/kde4be/kde4inetlayer.hxx
995 index 0000000..1724628
997 +++ shell/source/backends/kde4be/kde4inetlayer.hxx
1003 +#include "kde4backend.hxx"
1005 +#include <com/sun/star/uno/XComponentContext.hpp>
1006 +#include <com/sun/star/configuration/backend/XLayer.hpp>
1007 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
1008 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
1009 +#include <com/sun/star/util/XTimeStamped.hpp>
1010 +#include <cppuhelper/implbase2.hxx>
1012 +namespace css = com::sun::star ;
1013 +namespace uno = css::uno ;
1014 +namespace lang = css::lang ;
1015 +namespace backend = css::configuration::backend ;
1016 +namespace util = css::util ;
1019 + Implementation of the XLayer interface for the KDE values mapped into
1020 + the org.openoffice.Inet configuration component.
1022 +class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
1026 + Constructor given the component context
1028 + @param xContext The component context
1031 + KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
1034 + virtual void SAL_CALL readData(
1035 + const uno::Reference<backend::XLayerHandler>& xHandler)
1036 + throw ( backend::MalformedDataException,
1037 + lang::NullPointerException,
1038 + lang::WrappedTargetException,
1039 + uno::RuntimeException) ;
1042 + virtual rtl::OUString SAL_CALL getTimestamp(void)
1043 + throw (uno::RuntimeException);
1048 + ~KDEInetLayer(void) {}
1051 + uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
1053 + void SAL_CALL setProxy
1054 + (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
1055 + int nProxyType, const QString &aNoProxyfor = QString(),
1056 + const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
1058 diff --git shell/source/backends/kde4be/kde4pathslayer.cxx shell/source/backends/kde4be/kde4pathslayer.cxx
1059 new file mode 100644
1060 index 0000000..0791790
1062 +++ shell/source/backends/kde4be/kde4pathslayer.cxx
1064 +/*************************************************************************
1066 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1068 + * Copyright 2008 by Sun Microsystems, Inc.
1070 + * OpenOffice.org - a multi-platform office productivity suite
1072 + * $RCSfile: kde4pathslayer.cxx,v $
1073 + * $Revision: 1.5 $
1075 + * This file is part of OpenOffice.org.
1077 + * OpenOffice.org is free software: you can redistribute it and/or modify
1078 + * it under the terms of the GNU Lesser General Public License version 3
1079 + * only, as published by the Free Software Foundation.
1081 + * OpenOffice.org is distributed in the hope that it will be useful,
1082 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1083 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1084 + * GNU Lesser General Public License version 3 for more details
1085 + * (a copy is included in the LICENSE file that accompanied this code).
1087 + * You should have received a copy of the GNU Lesser General Public License
1088 + * version 3 along with OpenOffice.org. If not, see
1089 + * <http://www.openoffice.org/license.html>
1090 + * for a copy of the LGPLv3 License.
1092 + ************************************************************************/
1094 +// MARKER(update_precomp.py): autogen include statement, do not remove
1095 +#include "precompiled_shell.hxx"
1097 +#include "kde4pathslayer.hxx"
1100 +#include <kglobalsettings.h>
1102 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
1103 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
1105 +#include <osl/security.hxx>
1106 +#include <osl/file.hxx>
1107 +#include <com/sun/star/uno/Sequence.hxx>
1111 +//==============================================================================
1113 +KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
1115 + //Create instance of LayerContentDescriber Service
1116 + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
1117 + "com.sun.star.comp.configuration.backend.LayerDescriber"));
1119 + typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
1120 + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
1121 + if( xServiceManager.is() )
1123 + m_xLayerContentDescriber = LayerDescriber::query(
1124 + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
1128 + OSL_TRACE("Could not retrieve ServiceManager");
1132 +//------------------------------------------------------------------------------
1134 +void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
1135 + throw ( backend::MalformedDataException, lang::NullPointerException,
1136 + lang::WrappedTargetException, uno::RuntimeException)
1138 + if( ! m_xLayerContentDescriber.is() )
1140 + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
1141 + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
1142 + ) ), static_cast < backend::XLayer * > (this) );
1145 + uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
1146 + sal_Int32 nProperties = 0;
1148 + QString aDocumentsDir( KGlobalSettings::documentPath() );
1149 + rtl::OUString sDocumentsDir;
1150 + rtl::OUString sDocumentsURL;
1151 + if ( aDocumentsDir.endsWith(QChar('/')) )
1152 + aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
1153 + sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
1154 + osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
1156 + aPropInfoList[nProperties].Name = rtl::OUString(
1157 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
1158 + aPropInfoList[nProperties].Type = rtl::OUString(
1159 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
1160 + aPropInfoList[nProperties].Protected = sal_False;
1161 + aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
1163 + if( nProperties > 0 )
1165 + aPropInfoList.realloc(nProperties);
1166 + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
1170 +//------------------------------------------------------------------------------
1172 +rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void)
1173 + throw (uno::RuntimeException)
1175 + // Return the value as timestamp to avoid regenerating the binary cache
1176 + // on each office launch.
1178 + ::rtl::OUString sTimeStamp,
1179 + sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
1181 + QString aDocumentsDir;
1182 + aDocumentsDir = KGlobalSettings::documentPath();
1184 + sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
1186 + return sTimeStamp;
1188 diff --git shell/source/backends/kde4be/kde4pathslayer.hxx shell/source/backends/kde4be/kde4pathslayer.hxx
1189 new file mode 100644
1190 index 0000000..e3fc4dc
1192 +++ shell/source/backends/kde4be/kde4pathslayer.hxx
1194 +/*************************************************************************
1196 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1198 + * Copyright 2008 by Sun Microsystems, Inc.
1200 + * OpenOffice.org - a multi-platform office productivity suite
1202 + * $RCSfile: kde4pathslayer.hxx,v $
1203 + * $Revision: 1.3 $
1205 + * This file is part of OpenOffice.org.
1207 + * OpenOffice.org is free software: you can redistribute it and/or modify
1208 + * it under the terms of the GNU Lesser General Public License version 3
1209 + * only, as published by the Free Software Foundation.
1211 + * OpenOffice.org is distributed in the hope that it will be useful,
1212 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1213 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1214 + * GNU Lesser General Public License version 3 for more details
1215 + * (a copy is included in the LICENSE file that accompanied this code).
1217 + * You should have received a copy of the GNU Lesser General Public License
1218 + * version 3 along with OpenOffice.org. If not, see
1219 + * <http://www.openoffice.org/license.html>
1220 + * for a copy of the LGPLv3 License.
1222 + ************************************************************************/
1226 +#include "kde4backend.hxx"
1227 +#include <com/sun/star/uno/XComponentContext.hpp>
1228 +#include <com/sun/star/configuration/backend/XLayer.hpp>
1229 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
1230 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
1231 +#include <com/sun/star/util/XTimeStamped.hpp>
1233 +#include <cppuhelper/implbase2.hxx>
1235 +namespace css = com::sun::star ;
1236 +namespace uno = css::uno ;
1237 +namespace lang = css::lang ;
1238 +namespace backend = css::configuration::backend ;
1239 +namespace util = css::util ;
1242 + Implementation of the XLayer interface for the KDE values mapped into
1243 + the org.openoffice.Office.Paths configuration component.
1245 +class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
1249 + Constructor given the component context
1251 + @param xContext The component context
1254 + KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
1257 + virtual void SAL_CALL readData(
1258 + const uno::Reference<backend::XLayerHandler>& xHandler)
1259 + throw ( backend::MalformedDataException,
1260 + lang::NullPointerException,
1261 + lang::WrappedTargetException,
1262 + uno::RuntimeException) ;
1265 + virtual rtl::OUString SAL_CALL getTimestamp(void)
1266 + throw (uno::RuntimeException);
1271 + ~KDEPathsLayer(void) {}
1274 + uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
1276 diff --git shell/source/backends/kde4be/kde4vcllayer.cxx shell/source/backends/kde4be/kde4vcllayer.cxx
1277 new file mode 100644
1278 index 0000000..2705cb6
1280 +++ shell/source/backends/kde4be/kde4vcllayer.cxx
1282 +/*************************************************************************
1284 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1286 + * Copyright 2008 by Sun Microsystems, Inc.
1288 + * OpenOffice.org - a multi-platform office productivity suite
1290 + * $RCSfile: kde4vcllayer.cxx,v $
1291 + * $Revision: 1.5 $
1293 + * This file is part of OpenOffice.org.
1295 + * OpenOffice.org is free software: you can redistribute it and/or modify
1296 + * it under the terms of the GNU Lesser General Public License version 3
1297 + * only, as published by the Free Software Foundation.
1299 + * OpenOffice.org is distributed in the hope that it will be useful,
1300 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1301 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1302 + * GNU Lesser General Public License version 3 for more details
1303 + * (a copy is included in the LICENSE file that accompanied this code).
1305 + * You should have received a copy of the GNU Lesser General Public License
1306 + * version 3 along with OpenOffice.org. If not, see
1307 + * <http://www.openoffice.org/license.html>
1308 + * for a copy of the LGPLv3 License.
1310 + ************************************************************************/
1312 +// MARKER(update_precomp.py): autogen include statement, do not remove
1313 +#include "precompiled_shell.hxx"
1315 +#include "kde4vcllayer.hxx"
1317 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
1318 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
1319 +#include <com/sun/star/uno/Sequence.hxx>
1321 +//==============================================================================
1323 +KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
1325 + //Create instance of LayerContentDescriber Service
1326 + rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
1327 + "com.sun.star.comp.configuration.backend.LayerDescriber"));
1329 + typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber;
1330 + uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
1331 + if( xServiceManager.is() )
1333 + m_xLayerContentDescriber = LayerDescriber::query(
1334 + xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
1338 + OSL_TRACE("Could not retrieve ServiceManager");
1342 +//------------------------------------------------------------------------------
1344 +void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler)
1345 + throw ( backend::MalformedDataException, lang::NullPointerException,
1346 + lang::WrappedTargetException, uno::RuntimeException)
1348 + if( ! m_xLayerContentDescriber.is() )
1350 + throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
1351 + "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
1352 + ) ), static_cast < backend::XLayer * > (this) );
1355 + uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
1358 + Commenting out, does not make much sense without an accessibility bridge
1359 +===========================================================================
1360 +#if defined(QT_ACCESSIBILITY_SUPPORT)
1361 +// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
1362 + int nVersionMajor = 0;
1363 + const char *q = qVersion(); // "3.1.0" for example
1364 + while ('0' <= *q && *q <= '9')
1365 + nVersionMajor = nVersionMajor * 10 + *q++ - '0';
1366 + sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
1368 + sal_Bool ATToolSupport = sal_False;
1370 +===========================================================================
1371 + End of commented out section
1372 +*/ sal_Bool ATToolSupport = sal_False;
1374 + aPropInfoList[0].Name = rtl::OUString(
1375 + RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
1376 + aPropInfoList[0].Type = rtl::OUString(
1377 + RTL_CONSTASCII_USTRINGPARAM( "string" ) );
1378 + aPropInfoList[0].Protected = sal_False;
1379 + aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
1381 + m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
1384 +//------------------------------------------------------------------------------
1386 +rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void)
1387 + throw (uno::RuntimeException)
1389 + // Return the value as timestamp to avoid regenerating the binary cache
1390 + // on each office launch.
1392 + ::rtl::OUString sTimeStamp(
1393 + RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
1395 + return sTimeStamp;
1397 diff --git shell/source/backends/kde4be/kde4vcllayer.hxx shell/source/backends/kde4be/kde4vcllayer.hxx
1398 new file mode 100644
1399 index 0000000..aeed4e6
1401 +++ shell/source/backends/kde4be/kde4vcllayer.hxx
1405 +#include "kde4backend.hxx"
1407 +#include <com/sun/star/uno/XComponentContext.hpp>
1408 +#include <com/sun/star/configuration/backend/XLayer.hpp>
1409 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
1410 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
1411 +#include <com/sun/star/util/XTimeStamped.hpp>
1413 +#include <cppuhelper/implbase2.hxx>
1415 +namespace css = com::sun::star ;
1416 +namespace uno = css::uno ;
1417 +namespace lang = css::lang ;
1418 +namespace backend = css::configuration::backend ;
1419 +namespace util = css::util ;
1422 + Implementation of the XLayer interface for the KDE values mapped into
1423 + the org.openoffice.VCL configuration component.
1425 +class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
1429 + Constructor given the component context
1431 + @param xContext The component context
1434 + KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
1437 + virtual void SAL_CALL readData(
1438 + const uno::Reference<backend::XLayerHandler>& xHandler)
1439 + throw ( backend::MalformedDataException,
1440 + lang::NullPointerException,
1441 + lang::WrappedTargetException,
1442 + uno::RuntimeException) ;
1445 + virtual rtl::OUString SAL_CALL getTimestamp(void)
1446 + throw (uno::RuntimeException);
1451 + ~KDEVCLLayer(void) {}
1454 + uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
1456 diff --git shell/source/backends/kde4be/makefile.mk shell/source/backends/kde4be/makefile.mk
1457 new file mode 100644
1458 index 0000000..3a41296
1460 +++ shell/source/backends/kde4be/makefile.mk
1462 +#*************************************************************************
1464 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1466 +# Copyright 2008 by Sun Microsystems, Inc.
1468 +# OpenOffice.org - a multi-platform office productivity suite
1470 +# $RCSfile: makefile.mk,v $
1474 +# This file is part of OpenOffice.org.
1476 +# OpenOffice.org is free software: you can redistribute it and/or modify
1477 +# it under the terms of the GNU Lesser General Public License version 3
1478 +# only, as published by the Free Software Foundation.
1480 +# OpenOffice.org is distributed in the hope that it will be useful,
1481 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
1482 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1483 +# GNU Lesser General Public License version 3 for more details
1484 +# (a copy is included in the LICENSE file that accompanied this code).
1486 +# You should have received a copy of the GNU Lesser General Public License
1487 +# version 3 along with OpenOffice.org. If not, see
1488 +# <http://www.openoffice.org/license.html>
1489 +# for a copy of the LGPLv3 License.
1491 +#*************************************************************************
1498 +ENABLE_EXCEPTIONS=TRUE
1500 +COMP1TYPELIST=$(TARGET)
1501 +COMPRDB=$(SOLARBINDIR)$/types.rdb
1502 +UNOUCROUT=$(OUT)$/inc$/$(TARGET)
1503 +INCPRE=$(UNOUCROUT)
1507 +.INCLUDE : settings.mk
1509 +# For some of the included external KDE headers, GCC complains about shadowed
1510 +# symbols in instantiated template code only at the end of a compilation unit,
1511 +# so the only solution is to disable that warning here:
1512 +.IF "$(COM)" == "GCC"
1513 +CFLAGSCXX+=-Wno-shadow
1516 +UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
1521 +.IF "$(ENABLE_KDE4)" == "TRUE"
1523 +CFLAGS+=$(KDE4_CFLAGS)
1528 + $(SLO)$/kde4backend.obj \
1529 + $(SLO)$/kde4commonlayer.obj \
1530 + $(SLO)$/kde4inetlayer.obj \
1531 + $(SLO)$/kde4vcllayer.obj \
1532 + $(SLO)$/kde4pathslayer.obj \
1533 + $(SLO)$/kde4becdef.obj
1536 +SHL1TARGET=$(TARGET)1.uno
1537 +SHL1OBJS=$(SLOFILES)
1538 +SHL1DEF=$(MISC)$/$(SHL1TARGET).def
1540 +SHL1IMPLIB=i$(SHL1TARGET)
1542 + $(CPPUHELPERLIB) \
1545 + $(KDE4_LIBS) -lkio
1547 +SHL1VERSIONMAP=exports.map
1548 +SHL1DEF=$(MISC)$/$(SHL1TARGET).def
1549 +DEF1NAME=$(SHL1TARGET)
1555 +.INCLUDE : target.mk
1556 diff --git shell/source/backends/kdebe/makefile.mk shell/source/backends/kdebe/makefile.mk
1557 index 73ebf92..01037e7 100644
1558 --- shell/source/backends/kdebe/makefile.mk
1559 +++ shell/source/backends/kdebe/makefile.mk
1560 @@ -77,11 +77,12 @@ SHL1OBJS=$(SLOFILES)
1561 SHL1DEF=$(MISC)$/$(SHL1TARGET).def
1563 SHL1IMPLIB=i$(SHL1TARGET)
1564 +SHL1LINKFLAGS+=$(KDE_LIBS)
1572 SHL1VERSIONMAP=exports.map
1573 SHL1DEF=$(MISC)$/$(SHL1TARGET).def