summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorMarcos Paulo de Souza <marcos.souza.org@gmail.com>2013-10-25 13:56:34 -0200
committerStephan Bergmann <sbergman@redhat.com>2013-11-04 13:15:45 +0100
commitb40ffd288baf6dc5989cc09c5b5007eee97dd1bf (patch)
tree8479a07443a2740f342419ee3517c0eff47ef8cb /fpicker
parent832586588c3ed5f1686a4ecebc2ed198ce049b24 (diff)
fdo#60698: Move generic fpicker to svtools
Signed-off-by: Stephan Bergmann <sbergman@redhat.com> Conflicts: dictionaries Change-Id: I6af478d7d6952e0e8f6c8f1b0575fcd50f2ba0e4
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/Library_fpicker.mk33
-rw-r--r--fpicker/Module_fpicker.mk1
-rw-r--r--fpicker/source/generic/fpicker.component28
-rw-r--r--fpicker/source/generic/fpicker.cxx223
4 files changed, 0 insertions, 285 deletions
diff --git a/fpicker/Library_fpicker.mk b/fpicker/Library_fpicker.mk
deleted file mode 100644
index 36ae9f336ea6..000000000000
--- a/fpicker/Library_fpicker.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- 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:
diff --git a/fpicker/Module_fpicker.mk b/fpicker/Module_fpicker.mk
index 1dc3181477e3..d4a1e1f23200 100644
--- a/fpicker/Module_fpicker.mk
+++ b/fpicker/Module_fpicker.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_Module_Module,fpicker))
$(eval $(call gb_Module_add_targets,fpicker,\
AllLangResTarget_fps_office \
- Library_fpicker \
Library_fps_office \
))
diff --git a/fpicker/source/generic/fpicker.component b/fpicker/source/generic/fpicker.component
deleted file mode 100644
index 7aee017dc99a..000000000000
--- a/fpicker/source/generic/fpicker.component
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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>
diff --git a/fpicker/source/generic/fpicker.cxx b/fpicker/source/generic/fpicker.cxx
deleted file mode 100644
index ea352268ef81..000000000000
--- a/fpicker/source/generic/fpicker.cxx
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- 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 .
- */
-
-#include "sal/types.h"
-#include "rtl/ustring.hxx"
-
-#include "cppuhelper/implementationentry.hxx"
-#include "com/sun/star/lang/XMultiComponentFactory.hpp"
-
-#include "svtools/miscopt.hxx"
-#include "svl/pickerhistoryaccess.hxx"
-
-#include "vcl/svapp.hxx"
-
-#ifdef WNT
-#include <windows.h>
-#endif
-
-using css::uno::Reference;
-using css::uno::Sequence;
-
-/*
- * FilePicker implementation.
- */
-static OUString FilePicker_getSystemPickerServiceName()
-{
-#ifdef UNX
- OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
- if (aDesktopEnvironment.equalsIgnoreAsciiCase("tde"))
- return OUString ("com.sun.star.ui.dialogs.TDEFilePicker");
- else if (aDesktopEnvironment.equalsIgnoreAsciiCase("kde"))
- return OUString ("com.sun.star.ui.dialogs.KDEFilePicker");
- else if (aDesktopEnvironment.equalsIgnoreAsciiCase("kde4"))
- return OUString ("com.sun.star.ui.dialogs.KDE4FilePicker");
- else if (aDesktopEnvironment.equalsIgnoreAsciiCase("macosx"))
- return OUString ("com.sun.star.ui.dialogs.AquaFilePicker");
- else
- return OUString ("com.sun.star.ui.dialogs.SystemFilePicker");
-#endif
-#ifdef WNT
- return OUString ("com.sun.star.ui.dialogs.Win32FilePicker");
-#endif
-}
-
-static Reference< css::uno::XInterface > FilePicker_createInstance (
- Reference< css::uno::XComponentContext > const & rxContext)
-{
- Reference< css::uno::XInterface > xResult;
-
- if (!rxContext.is())
- return xResult;
-
- Reference< css::lang::XMultiComponentFactory > xFactory (rxContext->getServiceManager());
- if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
- {
- xResult = Reference< css::uno::XInterface >( Application::createFilePicker( rxContext ) );
-
- if (!xResult.is())
- {
- try
- {
- xResult = xFactory->createInstanceWithContext (
- FilePicker_getSystemPickerServiceName(),
- rxContext);
- }
- catch (css::uno::Exception const &)
- {
- // Handled below (see @ fallback).
- }
- }
- }
-
-
- if (!xResult.is() && xFactory.is())
- {
- // Always fall back to OfficeFilePicker.
- xResult = xFactory->createInstanceWithContext (
- OUString( "com.sun.star.ui.dialogs.OfficeFilePicker"),
- rxContext);
- }
- if (xResult.is())
- {
- // Add to FilePicker history.
- svt::addFilePicker (xResult);
- }
- return xResult;
-}
-
-static OUString FilePicker_getImplementationName()
-{
- return OUString("com.sun.star.comp.fpicker.FilePicker");
-}
-
-static Sequence< OUString > FilePicker_getSupportedServiceNames()
-{
- Sequence< OUString > aServiceNames(1);
- aServiceNames.getArray()[0] =
- OUString( "com.sun.star.ui.dialogs.FilePicker");
- return aServiceNames;
-}
-
-/*
- * FolderPicker implementation.
- */
-static OUString FolderPicker_getSystemPickerServiceName()
-{
- OUString aDesktopEnvironment (Application::GetDesktopEnvironment());
-#ifdef UNX
- if (aDesktopEnvironment.equalsIgnoreAsciiCase("tde"))
- return OUString("com.sun.star.ui.dialogs.TDEFolderPicker");
- else if (aDesktopEnvironment.equalsIgnoreAsciiCase("kde"))
- return OUString("com.sun.star.ui.dialogs.KDEFolderPicker");
- else if (aDesktopEnvironment.equalsIgnoreAsciiCase("macosx"))
- return OUString("com.sun.star.ui.dialogs.AquaFolderPicker");
-#endif
- return OUString("com.sun.star.ui.dialogs.SystemFolderPicker");
-}
-
-static Reference< css::uno::XInterface > FolderPicker_createInstance (
- Reference< css::uno::XComponentContext > const & rxContext)
-{
- Reference< css::uno::XInterface > xResult;
-
- if (!rxContext.is())
- return xResult;
-
- Reference< css::lang::XMultiComponentFactory > xFactory (rxContext->getServiceManager());
- if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
- {
- xResult = Reference< css::uno::XInterface >( Application::createFolderPicker( rxContext ) );
- if (!xResult.is())
- {
- try
- {
- xResult = xFactory->createInstanceWithContext (
- FolderPicker_getSystemPickerServiceName(),
- rxContext);
- }
- catch (css::uno::Exception const &)
- {
- // Handled below (see @ fallback).
- }
- }
- }
- if (!xResult.is() && xFactory.is() )
- {
- // Always fall back to OfficeFolderPicker.
- xResult = xFactory->createInstanceWithContext (
- OUString( "com.sun.star.ui.dialogs.OfficeFolderPicker"),
- rxContext);
- }
- if (xResult.is())
- {
- // Add to FolderPicker history.
- svt::addFolderPicker (xResult);
- }
- return xResult;
-}
-
-static OUString FolderPicker_getImplementationName()
-{
- return OUString("com.sun.star.comp.fpicker.FolderPicker");
-}
-
-static Sequence< OUString > FolderPicker_getSupportedServiceNames()
-{
- Sequence< OUString > aServiceNames(1);
- aServiceNames.getArray()[0] =
- OUString( "com.sun.star.ui.dialogs.FolderPicker");
- 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: */