update credits
[LibreOffice.git] / include / svtools / imageresourceaccess.hxx
blobb8282da72167d35299bf90afe698ff065b9c30bc
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
21 #define SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
23 #include "svtools/svtdllapi.h"
25 #include <com/sun/star/io/XInputStream.hpp>
26 #include <com/sun/star/uno/XComponentContext.hpp>
28 class SvStream;
29 //........................................................................
30 namespace svt
32 //........................................................................
34 //====================================================================
35 //= GraphicAccess
36 //====================================================================
37 /** helper class for obtaining streams (which also can be used with the ImageProducer)
38 from a resource
40 class GraphicAccess
42 private:
43 GraphicAccess(); // never implemented
45 public:
46 /** determines whether the given URL denotes an image within a resource
47 ( or an image specified by a vnd.sun.star.GraphicObject scheme URL )
49 SVT_DLLPUBLIC static bool isSupportedURL( const OUString& _rURL );
51 /** for a given URL of an image within a resource ( or an image specified by a vnd.sun.star.GraphicObject scheme URL ), this method retrieves
52 an SvStream for this image.
54 This method works for arbitrary URLs denoting an image, since the
55 <type scope="com::sun::star::graphics">GraphicsProvider</type> service is used
56 to resolve the URL. However, obtaining the stream is expensive (since
57 the image must be copied), so you are strongly encouraged to only use it
58 when you know that the image is small enough.
60 SVT_DLLPUBLIC static SvStream* getImageStream(
61 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
62 const OUString& _rImageResourceURL
65 /** for a given URL of an image within a resource ( or an image specified by a vnd.sun.star.GraphicObject scheme URL ), this method retrieves
66 an <type scope="com::sun::star::io">XInputStream</type> for this image.
68 SVT_DLLPUBLIC static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
69 getImageXStream(
70 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
71 const OUString& _rImageResourceURL
75 //........................................................................
76 } // namespace svt
77 //........................................................................
79 #endif // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */