diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-12-21 14:27:50 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-21 14:27:50 +0100 |
commit | 124396ecc6185ac05be80840cfdb5e84d8d41206 (patch) | |
tree | 3527f032bfd2bc8044b1e0b08b19a0f2027cc4bc /svtools | |
parent | e5a5e3d34a91748bab3bc3d47c6b13227d011b6f (diff) |
Merge provider.hxx into .cxx
Change-Id: I361d044643b8f886f68e424e531f2fc82b8c5e40
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/graphic/provider.cxx | 40 | ||||
-rw-r--r-- | svtools/source/inc/provider.hxx | 68 |
2 files changed, 36 insertions, 72 deletions
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 1f559d6c5e28..908d8166efca 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -33,17 +33,20 @@ #include <svl/solar.hrc> #include <vcl/virdev.hxx> #include <vcl/settings.hxx> +#include <com/sun/star/awt/XBitmap.hpp> +#include <com/sun/star/graphic/XGraphicProvider.hpp> #include <com/sun/star/io/XStream.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/text/GraphicCrop.hpp> #include <com/sun/star/uno/XComponentContext.hpp> #include <comphelper/servicehelper.hxx> +#include <cppuhelper/implbase.hxx> #include <cppuhelper/supportsservice.hxx> #include "descriptor.hxx" #include "graphic.hxx" #include <rtl/ref.hxx> #include <svtools/grfmgr.hxx> -#include "provider.hxx" #include <vcl/dibtools.hxx> #include <memory> @@ -53,11 +56,40 @@ namespace { #define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" -GraphicProvider::GraphicProvider() +class GraphicProvider : public ::cppu::WeakImplHelper< css::graphic::XGraphicProvider, + css::lang::XServiceInfo > { -} +public: + + GraphicProvider(); + +protected: + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override; -GraphicProvider::~GraphicProvider() + // XTypeProvider + virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException, std::exception) override; + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(css::uno::RuntimeException, std::exception) override; + + // XGraphicProvider + virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL queryGraphicDescriptor( const css::uno::Sequence< css::beans::PropertyValue >& MediaProperties ) throw (css::io::IOException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; + virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL queryGraphic( const css::uno::Sequence< css::beans::PropertyValue >& MediaProperties ) throw (css::io::IOException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; + virtual void SAL_CALL storeGraphic( const css::uno::Reference< css::graphic::XGraphic >& Graphic, const css::uno::Sequence< css::beans::PropertyValue >& MediaProperties ) throw (css::io::IOException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; + +private: + + static css::uno::Reference< css::graphic::XGraphic > implLoadMemory( const OUString& rResourceURL ); + static css::uno::Reference< css::graphic::XGraphic > implLoadGraphicObject( const OUString& rResourceURL ); + static css::uno::Reference< css::graphic::XGraphic > implLoadResource( const OUString& rResourceURL ); + static css::uno::Reference< css::graphic::XGraphic > implLoadRepositoryImage( const OUString& rResourceURL ); + static css::uno::Reference< css::graphic::XGraphic > implLoadBitmap( const css::uno::Reference< css::awt::XBitmap >& rBitmap ); + static css::uno::Reference< css::graphic::XGraphic > implLoadStandardImage( const OUString& rResourceURL ); +}; + +GraphicProvider::GraphicProvider() { } diff --git a/svtools/source/inc/provider.hxx b/svtools/source/inc/provider.hxx deleted file mode 100644 index 346429d3979c..000000000000 --- a/svtools/source/inc/provider.hxx +++ /dev/null @@ -1,68 +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 . - */ - -#ifndef INCLUDED_SVTOOLS_SOURCE_INC_PROVIDER_HXX -#define INCLUDED_SVTOOLS_SOURCE_INC_PROVIDER_HXX - -#include <cppuhelper/implbase.hxx> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/graphic/XGraphicProvider.hpp> -#include <com/sun/star/awt/XBitmap.hpp> - -namespace { - -class GraphicProvider : public ::cppu::WeakImplHelper< css::graphic::XGraphicProvider, - css::lang::XServiceInfo > -{ -public: - - GraphicProvider(); - virtual ~GraphicProvider() override; - -protected: - - // XServiceInfo - virtual OUString SAL_CALL getImplementationName() throw( css::uno::RuntimeException, std::exception ) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( css::uno::RuntimeException, std::exception ) override; - - // XTypeProvider - virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) throw(css::uno::RuntimeException, std::exception) override; - virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(css::uno::RuntimeException, std::exception) override; - - // XGraphicProvider - virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL queryGraphicDescriptor( const css::uno::Sequence< css::beans::PropertyValue >& MediaProperties ) throw (css::io::IOException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; - virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL queryGraphic( const css::uno::Sequence< css::beans::PropertyValue >& MediaProperties ) throw (css::io::IOException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; - virtual void SAL_CALL storeGraphic( const css::uno::Reference< css::graphic::XGraphic >& Graphic, const css::uno::Sequence< css::beans::PropertyValue >& MediaProperties ) throw (css::io::IOException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) override; - -private: - - static css::uno::Reference< css::graphic::XGraphic > implLoadMemory( const OUString& rResourceURL ); - static css::uno::Reference< css::graphic::XGraphic > implLoadGraphicObject( const OUString& rResourceURL ); - static css::uno::Reference< css::graphic::XGraphic > implLoadResource( const OUString& rResourceURL ); - static css::uno::Reference< css::graphic::XGraphic > implLoadRepositoryImage( const OUString& rResourceURL ); - static css::uno::Reference< css::graphic::XGraphic > implLoadBitmap( const css::uno::Reference< css::awt::XBitmap >& rBitmap ); - static css::uno::Reference< css::graphic::XGraphic > implLoadStandardImage( const OUString& rResourceURL ); -}; - -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |