Kaydet (Commit) b40ffd28 authored tarafından Marcos Paulo de Souza's avatar Marcos Paulo de Souza Kaydeden (comit) Stephan Bergmann

fdo#60698: Move generic fpicker to svtools

Signed-off-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Conflicts:
	dictionaries

Change-Id: I6af478d7d6952e0e8f6c8f1b0575fcd50f2ba0e4
üst 83258658
# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
#
#
# 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/.
#
$(eval $(call gb_Library_Library,fpicker))
$(eval $(call gb_Library_set_componentfile,fpicker,fpicker/source/generic/fpicker))
$(eval $(call gb_Library_use_external,fpicker,boost_headers))
$(eval $(call gb_Library_use_sdk_api,fpicker))
$(eval $(call gb_Library_use_libraries,fpicker,\
cppu \
cppuhelper \
sal \
svl \
svt \
vcl \
$(gb_UWINAPI) \
))
$(eval $(call gb_Library_add_exception_objects,fpicker,\
fpicker/source/generic/fpicker \
))
# vim: set noet sw=4 ts=4:
...@@ -12,7 +12,6 @@ $(eval $(call gb_Module_Module,fpicker)) ...@@ -12,7 +12,6 @@ $(eval $(call gb_Module_Module,fpicker))
$(eval $(call gb_Module_add_targets,fpicker,\ $(eval $(call gb_Module_add_targets,fpicker,\
AllLangResTarget_fps_office \ AllLangResTarget_fps_office \
Library_fpicker \
Library_fps_office \ Library_fps_office \
)) ))
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
* 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 .
-->
<component loader="com.sun.star.loader.SharedLibrary" prefix="fpicker"
xmlns="http://openoffice.org/2010/uno-components">
<implementation name="com.sun.star.comp.fpicker.FilePicker">
<service name="com.sun.star.ui.dialogs.FilePicker"/>
</implementation>
<implementation name="com.sun.star.comp.fpicker.FolderPicker">
<service name="com.sun.star.ui.dialogs.FolderPicker"/>
</implementation>
</component>
...@@ -41,7 +41,6 @@ $(eval $(call gb_Rdb_add_components,services,\ ...@@ -41,7 +41,6 @@ $(eval $(call gb_Rdb_add_components,services,\
filter/source/xsltdialog/xsltdlg \ filter/source/xsltdialog/xsltdlg \
filter/source/xsltfilter/xsltfilter \ filter/source/xsltfilter/xsltfilter \
formula/util/for \ formula/util/for \
fpicker/source/generic/fpicker \
fpicker/source/office/fps_office \ fpicker/source/office/fps_office \
framework/util/fwk \ framework/util/fwk \
framework/util/fwl \ framework/util/fwl \
......
...@@ -220,6 +220,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ ...@@ -220,6 +220,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/toolpanel/toolpaneldrawerpeer \ svtools/source/toolpanel/toolpaneldrawerpeer \
svtools/source/uno/addrtempuno \ svtools/source/uno/addrtempuno \
svtools/source/uno/contextmenuhelper \ svtools/source/uno/contextmenuhelper \
svtools/source/uno/fpicker \
svtools/source/uno/framestatuslistener \ svtools/source/uno/framestatuslistener \
svtools/source/uno/generictoolboxcontroller \ svtools/source/uno/generictoolboxcontroller \
svtools/source/uno/genericunodialog \ svtools/source/uno/genericunodialog \
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "sal/types.h" #include "sal/types.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "cppuhelper/implementationentry.hxx"
#include "com/sun/star/lang/XMultiComponentFactory.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp"
#include "svtools/miscopt.hxx" #include "svtools/miscopt.hxx"
...@@ -58,7 +57,7 @@ static OUString FilePicker_getSystemPickerServiceName() ...@@ -58,7 +57,7 @@ static OUString FilePicker_getSystemPickerServiceName()
#endif #endif
} }
static Reference< css::uno::XInterface > FilePicker_createInstance ( Reference< css::uno::XInterface > FilePicker_CreateInstance (
Reference< css::uno::XComponentContext > const & rxContext) Reference< css::uno::XComponentContext > const & rxContext)
{ {
Reference< css::uno::XInterface > xResult; Reference< css::uno::XInterface > xResult;
...@@ -102,12 +101,12 @@ static Reference< css::uno::XInterface > FilePicker_createInstance ( ...@@ -102,12 +101,12 @@ static Reference< css::uno::XInterface > FilePicker_createInstance (
return xResult; return xResult;
} }
static OUString FilePicker_getImplementationName() OUString SAL_CALL FilePicker_getImplementationName()
{ {
return OUString("com.sun.star.comp.fpicker.FilePicker"); return OUString("com.sun.star.comp.svt.FilePicker");
} }
static Sequence< OUString > FilePicker_getSupportedServiceNames() Sequence< OUString > FilePicker_getSupportedServiceNames()
{ {
Sequence< OUString > aServiceNames(1); Sequence< OUString > aServiceNames(1);
aServiceNames.getArray()[0] = aServiceNames.getArray()[0] =
...@@ -132,7 +131,7 @@ static OUString FolderPicker_getSystemPickerServiceName() ...@@ -132,7 +131,7 @@ static OUString FolderPicker_getSystemPickerServiceName()
return OUString("com.sun.star.ui.dialogs.SystemFolderPicker"); return OUString("com.sun.star.ui.dialogs.SystemFolderPicker");
} }
static Reference< css::uno::XInterface > FolderPicker_createInstance ( Reference< css::uno::XInterface > FolderPicker_CreateInstance (
Reference< css::uno::XComponentContext > const & rxContext) Reference< css::uno::XComponentContext > const & rxContext)
{ {
Reference< css::uno::XInterface > xResult; Reference< css::uno::XInterface > xResult;
...@@ -173,12 +172,12 @@ static Reference< css::uno::XInterface > FolderPicker_createInstance ( ...@@ -173,12 +172,12 @@ static Reference< css::uno::XInterface > FolderPicker_createInstance (
return xResult; return xResult;
} }
static OUString FolderPicker_getImplementationName() OUString SAL_CALL FolderPicker_getImplementationName()
{ {
return OUString("com.sun.star.comp.fpicker.FolderPicker"); return OUString("com.sun.star.comp.svt.FolderPicker");
} }
static Sequence< OUString > FolderPicker_getSupportedServiceNames() Sequence< OUString > FolderPicker_getSupportedServiceNames()
{ {
Sequence< OUString > aServiceNames(1); Sequence< OUString > aServiceNames(1);
aServiceNames.getArray()[0] = aServiceNames.getArray()[0] =
...@@ -186,38 +185,4 @@ static Sequence< OUString > FolderPicker_getSupportedServiceNames() ...@@ -186,38 +185,4 @@ static Sequence< OUString > FolderPicker_getSupportedServiceNames()
return aServiceNames; return aServiceNames;
} }
/*
* Implementation entries.
*/
static const cppu::ImplementationEntry g_entries[] =
{
{
FilePicker_createInstance,
FilePicker_getImplementationName,
FilePicker_getSupportedServiceNames,
cppu::createSingleComponentFactory, 0, 0
},
{
FolderPicker_createInstance,
FolderPicker_getImplementationName,
FolderPicker_getSupportedServiceNames,
cppu::createSingleComponentFactory, 0, 0
},
{ 0, 0, 0, 0, 0, 0 }
};
/*
* Public (exported) interface.
*/
extern "C"
{
SAL_DLLPUBLIC_EXPORT void * SAL_CALL fpicker_component_getFactory (
const sal_Char * pImplementationName, void * pServiceManager, void * pRegistryKey)
{
return cppu::component_getFactoryHelper (
pImplementationName, pServiceManager, pRegistryKey, g_entries);
}
} // extern "C"
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* 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 .
*/
#ifndef INCLUDED_SVT_SOURCE_UNO_FILEPICKER_HXX
#define INCLUDED_SVT_SOURCE_UNO_FILEPICKER_HXX
#include "sal/config.h"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
#include "rtl/ustring.hxx"
#include "sal/types.h"
namespace com { namespace sun { namespace star {
namespace lang { class XMultiServiceFactory; }
namespace uno { class XInterface; }
} } }
css::uno::Reference<css::uno::XInterface> SAL_CALL FilePicker_CreateInstance(
css::uno::Reference< css::uno::XComponentContext > const & context);
css::uno::Sequence<OUString> FilePicker_getSupportedServiceNames();
OUString FilePicker_getImplementationName();
css::uno::Reference<css::uno::XInterface> SAL_CALL FolderPicker_CreateInstance(
css::uno::Reference< css::uno::XComponentContext > const & context);
css::uno::Sequence<OUString> FolderPicker_getSupportedServiceNames();
OUString FolderPicker_getImplementationName();
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/registry/XRegistryKey.hpp>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <uno/mapping.hxx> #include <uno/mapping.hxx>
#include "fpicker.hxx"
#include "provider.hxx" #include "provider.hxx"
#include "renderer.hxx" #include "renderer.hxx"
#include "unowizard.hxx" #include "unowizard.hxx"
...@@ -69,6 +70,18 @@ namespace ...@@ -69,6 +70,18 @@ namespace
::svt::uno::Wizard::getSupportedServiceNames_static, ::svt::uno::Wizard::getSupportedServiceNames_static,
::cppu::createSingleComponentFactory, NULL, 0 ::cppu::createSingleComponentFactory, NULL, 0
}, },
{
FilePicker_CreateInstance,
FilePicker_getImplementationName,
FilePicker_getSupportedServiceNames,
::cppu::createSingleComponentFactory, 0, 0
},
{
FolderPicker_CreateInstance,
FolderPicker_getImplementationName,
FolderPicker_getSupportedServiceNames,
::cppu::createSingleComponentFactory, 0, 0
},
{ 0, 0, 0, 0, 0, 0 } { 0, 0, 0, 0, 0, 0 }
}; };
} }
...@@ -90,6 +103,8 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( ...@@ -90,6 +103,8 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
void * pResult = 0; void * pResult = 0;
if ( _pServiceManager ) if ( _pServiceManager )
{ {
Reference< XMultiServiceFactory > xSMgr(reinterpret_cast< XMultiServiceFactory * >( _pServiceManager ) );
Reference< XSingleServiceFactory > xFactory; Reference< XSingleServiceFactory > xFactory;
if (rtl_str_compare ( if (rtl_str_compare (
pImplementationName, "com.sun.star.comp.svtools.OAddressBookSourceDialogUno") == 0) pImplementationName, "com.sun.star.comp.svtools.OAddressBookSourceDialogUno") == 0)
...@@ -98,8 +113,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( ...@@ -98,8 +113,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
aServiceNames.getArray()[0] = aServiceNames.getArray()[0] =
OUString( "com.sun.star.ui.AddressBookSourceDialog" ); OUString( "com.sun.star.ui.AddressBookSourceDialog" );
xFactory = ::cppu::createSingleFactory ( xFactory = ::cppu::createSingleFactory (xSMgr,
reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
OUString::createFromAscii( pImplementationName ), OUString::createFromAscii( pImplementationName ),
svt::OAddressBookSourceDialogUno_CreateInstance, svt::OAddressBookSourceDialogUno_CreateInstance,
aServiceNames); aServiceNames);
...@@ -111,31 +125,28 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory ( ...@@ -111,31 +125,28 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL svt_component_getFactory (
aServiceNames.getArray()[0] = aServiceNames.getArray()[0] =
OUString( "com.sun.star.ui.dialogs.FilterOptionsDialog" ); OUString( "com.sun.star.ui.dialogs.FilterOptionsDialog" );
xFactory = ::cppu::createSingleFactory ( xFactory = ::cppu::createSingleFactory (xSMgr,
reinterpret_cast< XMultiServiceFactory* >( _pServiceManager ),
OUString::createFromAscii( pImplementationName ), OUString::createFromAscii( pImplementationName ),
SvFilterOptionsDialog_CreateInstance, SvFilterOptionsDialog_CreateInstance,
aServiceNames); aServiceNames);
} }
else if( 0 == GraphicProvider::getImplementationName_Static().compareToAscii( pImplementationName ) ) else if( 0 == GraphicProvider::getImplementationName_Static().compareToAscii( pImplementationName ) )
{ {
xFactory = ::cppu::createOneInstanceFactory( xFactory = ::cppu::createOneInstanceFactory(xSMgr,
reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),
GraphicProvider::getImplementationName_Static(), GraphicProvider::getImplementationName_Static(),
GraphicProvider_CreateInstance, GraphicProvider_CreateInstance,
GraphicProvider::getSupportedServiceNames_Static() ); GraphicProvider::getSupportedServiceNames_Static() );
} }
else if( 0 == GraphicRendererVCL::getImplementationName_Static().compareToAscii( pImplementationName ) ) else if( 0 == GraphicRendererVCL::getImplementationName_Static().compareToAscii( pImplementationName ) )
{ {
xFactory = ::cppu::createOneInstanceFactory( xFactory = ::cppu::createOneInstanceFactory(xSMgr,
reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),
GraphicRendererVCL::getImplementationName_Static(), GraphicRendererVCL::getImplementationName_Static(),
GraphicRendererVCL_CreateInstance, GraphicRendererVCL_CreateInstance,
GraphicRendererVCL::getSupportedServiceNames_Static() ); GraphicRendererVCL::getSupportedServiceNames_Static() );
} }
else else
{ {
pResult = component_getFactoryHelper( pImplementationName, reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ),reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl ); pResult = component_getFactoryHelper( pImplementationName, reinterpret_cast< lang::XMultiServiceFactory * >( _pServiceManager ), reinterpret_cast< registry::XRegistryKey* >( pRegistryKey ), serviceDecl );
if ( !pResult ) if ( !pResult )
pResult = ::cppu::component_getFactoryHelper( pImplementationName, _pServiceManager, pRegistryKey, s_aServiceEntries ); pResult = ::cppu::component_getFactoryHelper( pImplementationName, _pServiceManager, pRegistryKey, s_aServiceEntries );
} }
......
...@@ -37,4 +37,10 @@ ...@@ -37,4 +37,10 @@
<implementation name="com.sun.star.svtools.SvFilterOptionsDialog"> <implementation name="com.sun.star.svtools.SvFilterOptionsDialog">
<service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/> <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.svt.FilePicker">
<service name="com.sun.star.ui.dialogs.FilePicker"/>
</implementation>
<implementation name="com.sun.star.comp.svt.FolderPicker">
<service name="com.sun.star.ui.dialogs.FolderPicker"/>
</implementation>
</component> </component>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment