1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 #ifndef _SVX_GALLERYITEMITEM_HXX 23 #define _SVX_GALLERYITEMITEM_HXX 24 25 #include <svx/svxdllapi.h> 26 #include <svl/poolitem.hxx> 27 28 #include <com/sun/star/uno/Reference.hxx> 29 #include <com/sun/star/graphic/XGraphic.hpp> 30 #include <com/sun/star/lang/XComponent.hpp> 31 32 // property names map those from css::gallery::GalleryItem 33 // with exception of "AsLink" and "FilterName" 34 #define SVXGALLERYITEM_TYPE "GalleryItemType" 35 #define SVXGALLERYITEM_LINK "AsLink" 36 #define SVXGALLERYITEM_URL "URL" 37 #define SVXGALLERYITEM_FILTER "FilterName" 38 #define SVXGALLERYITEM_DRAWING "Drawing" 39 #define SVXGALLERYITEM_GRAPHIC "Graphic" 40 #define SVXGALLERYITEM_PARAMS 6 41 #define SVXGALLERYITEM_ARGNAME "GalleryItem" 42 43 DBG_NAMEEX_VISIBILITY( SvxGalleryItem, SVX_DLLPUBLIC ) 44 45 class SVX_DLLPUBLIC SvxGalleryItem : public SfxPoolItem 46 { 47 sal_Int8 m_nType; 48 sal_Bool m_bIsLink; 49 rtl::OUString m_aURL; 50 rtl::OUString m_aFilterName; 51 com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xDrawing; 52 com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > m_xGraphic; 53 54 public: 55 TYPEINFO(); 56 57 SvxGalleryItem(); 58 SvxGalleryItem( const SvxGalleryItem& ); 59 SvxGalleryItem( const sal_uInt16 nId ); 60 ~SvxGalleryItem(); 61 GetType() const62 sal_Int8 GetType() const { return m_nType; } IsLink() const63 sal_Bool IsLink() const { return m_bIsLink; } GetURL() const64 const rtl::OUString GetURL() const { return m_aURL; } GetFilterName() const65 const rtl::OUString GetFilterName() const { return m_aFilterName; } GetDrawing() const66 const com::sun::star::uno::Reference< com::sun::star::lang::XComponent > GetDrawing() const { return m_xDrawing; } GetGraphic() const67 const com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > GetGraphic() const { return m_xGraphic; } 68 69 // pure virtual methods from SfxPoolItem 70 virtual int operator==( const SfxPoolItem& ) const; 71 virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; 72 // bridge to UNO 73 virtual sal_Bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const; 74 virtual sal_Bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt8 nMemberId = 0 ); 75 // not implemented 76 virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; 77 virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion) const; 78 }; 79 80 #endif 81