summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpicker/Library_fps_kde4.mk65
-rw-r--r--fpicker/Module_fpicker.mk5
-rw-r--r--fpicker/source/unx/kde4/KDE4FPEntry.cxx78
-rw-r--r--fpicker/source/unx/kde4/fps_kde4.component34
-rw-r--r--fpicker/source/unx/kde4/fps_kde4.xml51
-rw-r--r--vcl/Library_vclplug_kde4.mk2
-rw-r--r--vcl/unx/kde4/FPServiceInfo.hxx (renamed from fpicker/source/unx/kde4/FPServiceInfo.hxx)0
-rw-r--r--vcl/unx/kde4/KDE4FilePicker.cxx (renamed from fpicker/source/unx/kde4/KDE4FilePicker.cxx)18
-rw-r--r--vcl/unx/kde4/KDE4FilePicker.hxx (renamed from fpicker/source/unx/kde4/KDE4FilePicker.hxx)15
-rw-r--r--vcl/unx/kde4/KDESalInstance.cxx10
-rw-r--r--vcl/unx/kde4/KDESalInstance.hxx6
11 files changed, 41 insertions, 243 deletions
diff --git a/fpicker/Library_fps_kde4.mk b/fpicker/Library_fps_kde4.mk
deleted file mode 100644
index 7c3e95fd36bc..000000000000
--- a/fpicker/Library_fps_kde4.mk
+++ /dev/null
@@ -1,65 +0,0 @@
-# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
-#
-# Version: MPL 1.1 / GPLv3+ / LGPLv3+
-#
-# The contents of this file are subject to the Mozilla Public License Version
-# 1.1 (the "License"); you may not use this file except in compliance with
-# the License or as specified alternatively below. You may obtain a copy of
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS IS" basis,
-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-# for the specific language governing rights and limitations under the
-# License.
-#
-# Major Contributor(s):
-# Copyright (C) 2011 Matúš Kukan <matus.kukan@gmail.com> (initial developer)
-#
-# All Rights Reserved.
-#
-# For minor contributions see the git repository.
-#
-# Alternatively, the contents of this file may be used under the terms of
-# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
-# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
-# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
-# instead of those above.
-
-$(eval $(call gb_Library_Library,fps_kde4))
-
-$(eval $(call gb_Library_set_componentfile,fps_kde4,fpicker/source/unx/kde4/fps_kde4))
-
-$(eval $(call gb_Library_add_api,fps_kde4,\
- offapi \
- udkapi \
-))
-
-$(eval $(call gb_Library_add_defs,fps_kde4,\
- $(KDE4_CFLAGS) \
-))
-
-$(eval $(call gb_Library_add_linked_libs,fps_kde4,\
- cppu \
- cppuhelper \
- sal \
- tl \
- vcl \
- $(gb_STDLIBS) \
-))
-
-$(eval $(call gb_Library_add_libs,fps_kde4,\
- $(KDE4_LIBS) \
- -lkio -lkfile \
-))
-
-$(eval $(call gb_Library_add_exception_objects,fps_kde4,\
- fpicker/source/unx/kde4/KDE4FilePicker \
- fpicker/source/unx/kde4/KDE4FPEntry \
-))
-
-# KDE/Qt consider -Wshadow more trouble than benefit
-$(eval $(call gb_Library_add_cxxflags,fps_kde4,\
- -Wno-shadow \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/fpicker/Module_fpicker.mk b/fpicker/Module_fpicker.mk
index 2faa777f37e4..3111955d895a 100644
--- a/fpicker/Module_fpicker.mk
+++ b/fpicker/Module_fpicker.mk
@@ -59,11 +59,6 @@ $(eval $(call gb_Module_add_targets,fpicker,\
))
endif
-ifeq ($(ENABLE_KDE4),TRUE)
-$(eval $(call gb_Module_add_targets,fpicker,\
- Library_fps_kde4 \
-))
-endif
endif
endif
diff --git a/fpicker/source/unx/kde4/KDE4FPEntry.cxx b/fpicker/source/unx/kde4/KDE4FPEntry.cxx
deleted file mode 100644
index 1543645a0fcd..000000000000
--- a/fpicker/source/unx/kde4/KDE4FPEntry.cxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <cppuhelper/factory.hxx>
-
-#include <com/sun/star/container/XSet.hpp>
-
-#include <osl/diagnose.h>
-
-#include "KDE4FilePicker.hxx"
-#include "FPServiceInfo.hxx"
-
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-using namespace ::cppu;
-using ::com::sun::star::ui::dialogs::XFilePicker;
-
-static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& serviceManager )
-{
- return Reference< XInterface >(static_cast< XFilePicker* >( new KDE4FilePicker( serviceManager ) ) );
-}
-
-extern "C"
-{
- SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* )
- {
- void* pRet = 0;
-
- if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
- {
- Sequence< OUString > aSNS( 1 );
- aSNS.getArray( )[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( FILE_PICKER_SERVICE_NAME ));
-
- Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
- reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
- OUString::createFromAscii( pImplName ),
- createInstance,
- aSNS ) );
- if ( xFactory.is() )
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
-
- return pRet;
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/fpicker/source/unx/kde4/fps_kde4.component b/fpicker/source/unx/kde4/fps_kde4.component
deleted file mode 100644
index d627212b75e8..000000000000
--- a/fpicker/source/unx/kde4/fps_kde4.component
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--**********************************************************************
-*
-* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-*
-* Copyright 2000, 2010 Oracle and/or its affiliates.
-*
-* OpenOffice.org - a multi-platform office productivity suite
-*
-* This file is part of OpenOffice.org.
-*
-* OpenOffice.org is free software: you can redistribute it and/or modify
-* it under the terms of the GNU Lesser General Public License version 3
-* only, as published by the Free Software Foundation.
-*
-* OpenOffice.org is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU Lesser General Public License version 3 for more details
-* (a copy is included in the LICENSE file that accompanied this code).
-*
-* You should have received a copy of the GNU Lesser General Public License
-* version 3 along with OpenOffice.org. If not, see
-* <http://www.openoffice.org/license.html>
-* for a copy of the LGPLv3 License.
-*
-**********************************************************************-->
-
-<component loader="com.sun.star.loader.SharedLibrary"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.ui.dialogs.KDE4FilePicker">
- <service name="com.sun.star.ui.dialogs.KDE4FilePicker"/>
- </implementation>
-</component>
diff --git a/fpicker/source/unx/kde4/fps_kde4.xml b/fpicker/source/unx/kde4/fps_kde4.xml
deleted file mode 100644
index a12bf894186a..000000000000
--- a/fpicker/source/unx/kde4/fps_kde4.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
-<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
- <module-name>fps_kde4</module-name>
- <component-description>
- <author> Jan Holesovsky </author>
- <name> com.sun.star.comp.ui.dialogs.FilePicker </name>
- <description>
- The KDE implementation of the FilePicker service.
- </description>
- <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
- <language> c++ </language>
- <status value="beta"/>
- <supported-service> com.sun.star.ui.dialogs.FilePicker </supported-service>
- <service-dependency>...</service-dependency>
- <type> com.sun.star.ui.dialogs.XExecutableDialog </type>
- <type> com.sun.star.ui.dialogs.XFilePicker </type>
- <type> com.sun.star.ui.dialogs.XFilterManager </type>
- <type> com.sun.star.ui.dialogs.XFilterGroupManager </type>
- <type> com.sun.star.ui.dialogs.XFilePickerListener </type>
- <type> com.sun.star.ui.dialogs.ExecutableDialogException </type>
- <type> com.sun.star.ui.dialogs.XFilePickerNotifier </type>
- <type> com.sun.star.ui.dialogs.XFilePickerControlAccess </type>
- <type> com.sun.star.ui.dialogs.XFilePreview </type>
- <type> com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type>
- <type> com.sun.star.ui.dialogs.ExecutableDialogResults </type>
- <type> com.sun.star.ui.dialogs.FilePickerEvent </type>
- <type> com.sun.star.ui.dialogs.CommonFilePickerElementIds </type>
- <type> com.sun.star.ui.dialogs.ListboxControlActions </type>
- <type> com.sun.star.ui.dialogs.TemplateDescription </type>
- <type> com.sun.star.ui.dialogs.FilePreviewImageFormats </type>
- <type> com.sun.star.util.XCancellable </type>
- <type> com.sun.star.lang.XComponent </type>
- <type> com.sun.star.lang.XMultiServiceFactory </type>
- <type> com.sun.star.lang.XSingleServiceFactory </type>
- <type> com.sun.star.lang.XServiceInfo </type>
- <type> com.sun.star.lang.XTypeProvider </type>
- <type> com.sun.star.lang.IllegalArgumentException </type>
- <type> com.sun.star.uno.TypeClass </type>
- <type> com.sun.star.uno.XWeak </type>
- <type> com.sun.star.uno.XAggregation </type>
- <type> com.sun.star.registry.XRegistryKey </type>
- <type> com.sun.star.container.XSet </type>
- </component-description>
- <project-build-dependency> cppuhelper </project-build-dependency>
- <project-build-dependency> cppu </project-build-dependency>
- <project-build-dependency> sal </project-build-dependency>
- <runtime-module-dependency> cppuhelper </runtime-module-dependency>
- <runtime-module-dependency> cppu2 </runtime-module-dependency>
- <runtime-module-dependency> sal2 </runtime-module-dependency>
-</module-description>
diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk
index 9c47d1f7abe7..6c5fb1b46da4 100644
--- a/vcl/Library_vclplug_kde4.mk
+++ b/vcl/Library_vclplug_kde4.mk
@@ -51,6 +51,7 @@ $(eval $(call gb_Library_add_api,vclplug_kde4,\
$(eval $(call gb_Library_add_libs,vclplug_kde4,\
$$(KDE4_LIBS) \
+ -lkio -lkfile \
))
$(eval $(call gb_Library_add_linked_libs,vclplug_kde4,\
@@ -82,6 +83,7 @@ $(eval $(call gb_Library_use_externals,vclplug_kde4,\
$(eval $(call gb_Library_add_exception_objects,vclplug_kde4,\
vcl/unx/kde4/KDEData \
+ vcl/unx/kde4/KDE4FilePicker \
vcl/unx/kde4/KDESalDisplay \
vcl/unx/kde4/KDESalFrame \
vcl/unx/kde4/KDESalGraphics \
diff --git a/fpicker/source/unx/kde4/FPServiceInfo.hxx b/vcl/unx/kde4/FPServiceInfo.hxx
index 6dfb50e5d1ef..6dfb50e5d1ef 100644
--- a/fpicker/source/unx/kde4/FPServiceInfo.hxx
+++ b/vcl/unx/kde4/FPServiceInfo.hxx
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
index d8df515912b5..2388c13e4ba0 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -118,18 +118,18 @@ QString toQString(const rtl::OUString& s)
// KDE4FilePicker
//////////////////////////////////////////////////////////////////////////
-KDE4FilePicker::KDE4FilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
- : cppu::WeakComponentImplHelper8<
+KDE4FilePicker::KDE4FilePicker( const uno::Reference<uno::XComponentContext>& )
+ : cppu::WeakComponentImplHelper9<
XFilterManager,
XFilterGroupManager,
XFilePickerControlAccess,
XFilePickerNotifier,
// TODO XFilePreview,
+ XFilePicker2,
lang::XInitialization,
util::XCancellable,
lang::XEventListener,
lang::XServiceInfo>( _helperMutex ),
- m_xServiceMgr( xServiceMgr ),
_resMgr( ResMgr::CreateResMgr("fps_office") )
{
_extraControls = new QWidget();
@@ -287,6 +287,12 @@ uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles()
return seq;
}
+uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getSelectedFiles()
+ throw( uno::RuntimeException )
+{
+ return getFiles();
+}
+
void SAL_CALL KDE4FilePicker::appendFilter( const ::rtl::OUString &title, const ::rtl::OUString &filter )
throw( lang::IllegalArgumentException, uno::RuntimeException )
{
@@ -610,7 +616,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
{
throw lang::IllegalArgumentException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "no arguments" )),
- static_cast< XFilePicker* >( this ), 1 );
+ static_cast< XFilePicker2* >( this ), 1 );
}
arg = args[0];
@@ -620,7 +626,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
{
throw lang::IllegalArgumentException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "invalid argument type" )),
- static_cast< XFilePicker* >( this ), 1 );
+ static_cast< XFilePicker2* >( this ), 1 );
}
sal_Int16 templateId = -1;
@@ -692,7 +698,7 @@ void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &args )
default:
throw lang::IllegalArgumentException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Unknown template" )),
- static_cast< XFilePicker* >( this ),
+ static_cast< XFilePicker2* >( this ),
1 );
}
diff --git a/fpicker/source/unx/kde4/KDE4FilePicker.hxx b/vcl/unx/kde4/KDE4FilePicker.hxx
index 3518001d265e..abbf826fbb26 100644
--- a/fpicker/source/unx/kde4/KDE4FilePicker.hxx
+++ b/vcl/unx/kde4/KDE4FilePicker.hxx
@@ -28,7 +28,7 @@
#pragma once
-#include <cppuhelper/compbase8.hxx>
+#include <cppuhelper/compbase9.hxx>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -36,6 +36,8 @@
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XCancellable.hpp>
#include <osl/conditn.hxx>
@@ -53,19 +55,19 @@ class QLayout;
class ResMgr;
class KDE4FilePicker :
- public cppu::WeakComponentImplHelper8<
+ public cppu::WeakComponentImplHelper9<
::com::sun::star::ui::dialogs::XFilterManager,
::com::sun::star::ui::dialogs::XFilterGroupManager,
::com::sun::star::ui::dialogs::XFilePickerControlAccess,
::com::sun::star::ui::dialogs::XFilePickerNotifier,
// TODO ::com::sun::star::ui::dialogs::XFilePreview,
+ ::com::sun::star::ui::dialogs::XFilePicker2,
::com::sun::star::lang::XInitialization,
::com::sun::star::util::XCancellable,
::com::sun::star::lang::XEventListener,
::com::sun::star::lang::XServiceInfo >
{
protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr; // to instanciate own services
::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
@@ -89,7 +91,7 @@ protected:
QLayout* _layout;
public:
- KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
+ KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& );
virtual ~KDE4FilePicker();
// XFilePickerNotifier
@@ -139,6 +141,11 @@ public:
virtual sal_Bool SAL_CALL getShowState( ) throw (::com::sun::star::uno::RuntimeException);
*/
+ // XFilePicker2 functions
+
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedFiles()
+ throw (::com::sun::star::uno::RuntimeException);
+
// XInitialization
virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &rArguments ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
diff --git a/vcl/unx/kde4/KDESalInstance.cxx b/vcl/unx/kde4/KDESalInstance.cxx
index c63d328e29c3..6bb0adf55044 100644
--- a/vcl/unx/kde4/KDESalInstance.cxx
+++ b/vcl/unx/kde4/KDESalInstance.cxx
@@ -26,13 +26,23 @@
*
************************************************************************/
+#include "KDE4FilePicker.hxx"
#include "KDESalInstance.hxx"
#include "KDESalFrame.hxx"
+using namespace com::sun::star;
+
SalFrame* KDESalInstance::CreateFrame( SalFrame *pParent, sal_uLong nState )
{
return new KDESalFrame( pParent, nState );
}
+uno::Reference< ui::dialogs::XFilePicker2 > KDESalInstance::createFilePicker(
+ const uno::Reference< uno::XComponentContext >& xMSF )
+{
+ return uno::Reference< ui::dialogs::XFilePicker2 >(
+ new KDE4FilePicker( xMSF ) );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde4/KDESalInstance.hxx b/vcl/unx/kde4/KDESalInstance.hxx
index a8efcd4dcde1..8fb5be33f556 100644
--- a/vcl/unx/kde4/KDESalInstance.hxx
+++ b/vcl/unx/kde4/KDESalInstance.hxx
@@ -39,6 +39,12 @@ class KDESalInstance : public X11SalInstance
KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() {}
virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle );
+
+ virtual bool hasNativeFileSelection() const { return true; }
+
+ virtual com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 >
+ createFilePicker( const com::sun::star::uno::Reference<
+ com::sun::star::uno::XComponentContext >& );
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */