merge the formfield patch from ooo-build
[ooovba.git] / svx / source / unogallery / unogalitem.hxx
blob6773591d503053f0371a548793b80e6b335678f0
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: unogalitem.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 _SVX_UNOGALITEM_HXX
32 #define _SVX_UNOGALITEM_HXX
34 #include <svx/unomodel.hxx>
35 #include <comphelper/servicehelper.hxx>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/gallery/XGalleryItem.hpp>
38 #include <comphelper/propertysethelper.hxx>
39 #ifndef _COMPHELPER_PROPERTYSETINFO_HXX_
40 #include <comphelper/propertysetinfo.hxx>
41 #endif
43 class GalleryTheme;
44 struct GalleryObject;
45 namespace unogallery { class GalleryTheme; }
47 namespace unogallery {
49 // ---------------
50 // - GalleryItem -
51 // ---------------
53 class GalleryItem : public ::cppu::OWeakAggObject,
54 public ::com::sun::star::lang::XServiceInfo,
55 public ::com::sun::star::lang::XTypeProvider,
56 public ::com::sun::star::gallery::XGalleryItem,
57 public ::comphelper::PropertySetHelper
59 friend class ::unogallery::GalleryTheme;
61 public:
63 GalleryItem( ::unogallery::GalleryTheme& rTheme, const GalleryObject& rObject );
64 ~GalleryItem() throw();
66 bool isValid() const;
68 static ::rtl::OUString getImplementationName_Static() throw();
69 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();
71 protected:
73 // XInterface
74 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
75 virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
76 virtual void SAL_CALL acquire() throw();
77 virtual void SAL_CALL release() throw();
79 // XServiceInfo
80 virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
81 virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
82 virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
84 // XTypeProvider
85 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
86 virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException);
88 // XGalleryItem
89 virtual ::sal_Int8 SAL_CALL getType( ) throw (::com::sun::star::uno::RuntimeException);
91 // PropertySetHelper
92 virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const ::com::sun::star::uno::Any* pValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException );
93 virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
95 protected:
97 ::comphelper::PropertySetInfo* createPropertySetInfo();
99 private:
101 ::unogallery::GalleryTheme* mpTheme;
102 const ::GalleryObject* mpGalleryObject;
104 const ::GalleryObject* implGetObject() const;
105 void implSetInvalid();
107 // not available
108 GalleryItem();
109 GalleryItem( const GalleryItem& );
110 GalleryItem& operator=( const GalleryItem& );
113 // -----------------------
114 // - GalleryDrawingModel -
115 // -----------------------
117 class GalleryDrawingModel : public SvxUnoDrawingModel
119 public:
121 GalleryDrawingModel( SdrModel* pDoc ) throw();
122 virtual ~GalleryDrawingModel() throw();
124 UNO3_GETIMPLEMENTATION_DECL( GalleryDrawingModel )
129 #endif