update dev300-m57
[ooovba.git] / svtools / inc / imageresourceaccess.hxx
blobdeeaa8eea2c570d7ab7ada192a9565cda6e70a87
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: imageresourceaccess.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
32 #define SVTOOLS_INC_IMAGERESOURCEACCESS_HXX
34 #include "svtools/svtdllapi.h"
36 /** === begin UNO includes === **/
37 #include <com/sun/star/io/XInputStream.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 /** === end UNO includes === **/
41 class SvStream;
42 //........................................................................
43 namespace svt
45 //........................................................................
47 //====================================================================
48 //= GraphicAccess
49 //====================================================================
50 /** helper class for obtaining streams (which also can be used with the ImageProducer)
51 from a resource
53 class GraphicAccess
55 private:
56 GraphicAccess(); // never implemented
58 public:
59 /** determines whether the given URL denotes an image within a resource
60 ( or an image specified by a vnd.sun.star.GraphicObject scheme URL )
62 SVT_DLLPUBLIC static bool isSupportedURL( const ::rtl::OUString& _rURL );
64 /** 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
65 an SvStream for this image.
67 This method works for arbitrary URLs denoting an image, since the
68 <type scope="com::sun::star::graphics">GraphicsProvider</type> service is used
69 to resolve the URL. However, obtaining the stream is expensive (since
70 the image must be copied), so you are strongly encouraged to only use it
71 when you know that the image is small enough.
73 SVT_DLLPUBLIC static SvStream* getImageStream(
74 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
75 const ::rtl::OUString& _rImageResourceURL
78 /** 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
79 an <type scope="com::sun::star::io">XInputStream</type> for this image.
81 SVT_DLLPUBLIC static ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >
82 getImageXStream(
83 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
84 const ::rtl::OUString& _rImageResourceURL
88 //........................................................................
89 } // namespace svt
90 //........................................................................
92 #endif // DBA14_SVTOOLS_INC_IMAGERESOURCEACCESS_HXX