Line data Source code
1 : /*
2 : * This file is part of the LibreOffice project.
3 : *
4 : * This Source Code Form is subject to the terms of the Mozilla Public
5 : * License, v. 2.0. If a copy of the MPL was not distributed with this
6 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 : *
8 : * This file incorporates work covered by the following license notice:
9 : *
10 : * Licensed to the Apache Software Foundation (ASF) under one or more
11 : * contributor license agreements. See the NOTICE file distributed
12 : * with this work for additional information regarding copyright
13 : * ownership. The ASF licenses this file to you under the Apache
14 : * License, Version 2.0 (the "License"); you may not use this file
15 : * except in compliance with the License. You may obtain a copy of
16 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
17 : */
18 : #ifndef _SVX_GALLERYITEMITEM_HXX
19 : #define _SVX_GALLERYITEMITEM_HXX
20 :
21 : #include <svx/svxdllapi.h>
22 : #include <svl/poolitem.hxx>
23 :
24 : #include <com/sun/star/uno/Reference.hxx>
25 : #include <com/sun/star/graphic/XGraphic.hpp>
26 : #include <com/sun/star/lang/XComponent.hpp>
27 :
28 : // property names map those from css::gallery::GalleryItem
29 : // with exception of "AsLink" and "FilterName"
30 : #define SVXGALLERYITEM_TYPE "GalleryItemType"
31 : #define SVXGALLERYITEM_LINK "AsLink"
32 : #define SVXGALLERYITEM_URL "URL"
33 : #define SVXGALLERYITEM_FILTER "FilterName"
34 : #define SVXGALLERYITEM_DRAWING "Drawing"
35 : #define SVXGALLERYITEM_GRAPHIC "Graphic"
36 : #define SVXGALLERYITEM_PARAMS 6
37 : #define SVXGALLERYITEM_ARGNAME "GalleryItem"
38 :
39 : DBG_NAMEEX_VISIBILITY( SvxGalleryItem, SVX_DLLPUBLIC )
40 :
41 : class SVX_DLLPUBLIC SvxGalleryItem : public SfxPoolItem
42 : {
43 : sal_Int8 m_nType;
44 : sal_Bool m_bIsLink;
45 : rtl::OUString m_aURL;
46 : rtl::OUString m_aFilterName;
47 : com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xDrawing;
48 : com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > m_xGraphic;
49 :
50 : public:
51 : TYPEINFO();
52 :
53 : SvxGalleryItem();
54 : SvxGalleryItem( const SvxGalleryItem& );
55 : SvxGalleryItem( const sal_uInt16 nId );
56 : ~SvxGalleryItem();
57 :
58 0 : sal_Int8 GetType() const { return m_nType; }
59 0 : sal_Bool IsLink() const { return m_bIsLink; }
60 0 : const rtl::OUString GetURL() const { return m_aURL; }
61 0 : const rtl::OUString GetFilterName() const { return m_aFilterName; }
62 : const com::sun::star::uno::Reference< com::sun::star::lang::XComponent > GetDrawing() const { return m_xDrawing; }
63 0 : const com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > GetGraphic() const { return m_xGraphic; }
64 :
65 : // pure virtual methods from SfxPoolItem
66 : virtual int operator==( const SfxPoolItem& ) const;
67 : virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
68 : // bridge to UNO
69 : virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const;
70 : virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 );
71 : // not implemented
72 : virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
73 : virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const;
74 : };
75 :
76 : #endif
|