1*3334a7e6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*3334a7e6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3334a7e6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3334a7e6SAndrew Rist  * distributed with this work for additional information
6*3334a7e6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3334a7e6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3334a7e6SAndrew Rist  * "License"); you may not use this file except in compliance
9*3334a7e6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3334a7e6SAndrew Rist  *
11*3334a7e6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3334a7e6SAndrew Rist  *
13*3334a7e6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3334a7e6SAndrew Rist  * software distributed under the License is distributed on an
15*3334a7e6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3334a7e6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3334a7e6SAndrew Rist  * specific language governing permissions and limitations
18*3334a7e6SAndrew Rist  * under the License.
19*3334a7e6SAndrew Rist  *
20*3334a7e6SAndrew Rist  *************************************************************/
21*3334a7e6SAndrew Rist 
22*3334a7e6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SVX_UNOGALITEM_HXX
25cdf0e10cSrcweir #define _SVX_UNOGALITEM_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <svx/unomodel.hxx>
28cdf0e10cSrcweir #include <comphelper/servicehelper.hxx>
29cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
30cdf0e10cSrcweir #include <com/sun/star/gallery/XGalleryItem.hpp>
31cdf0e10cSrcweir #include <comphelper/propertysethelper.hxx>
32cdf0e10cSrcweir #ifndef _COMPHELPER_PROPERTYSETINFO_HXX_
33cdf0e10cSrcweir #include <comphelper/propertysetinfo.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class GalleryTheme;
37cdf0e10cSrcweir struct GalleryObject;
38cdf0e10cSrcweir namespace unogallery { class GalleryTheme; }
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace unogallery {
41cdf0e10cSrcweir 
42cdf0e10cSrcweir // ---------------
43cdf0e10cSrcweir // - GalleryItem -
44cdf0e10cSrcweir // ---------------
45cdf0e10cSrcweir 
46cdf0e10cSrcweir class GalleryItem : public ::cppu::OWeakAggObject,
47cdf0e10cSrcweir 					public ::com::sun::star::lang::XServiceInfo,
48cdf0e10cSrcweir 					public ::com::sun::star::lang::XTypeProvider,
49cdf0e10cSrcweir 					public ::com::sun::star::gallery::XGalleryItem,
50cdf0e10cSrcweir 					public ::comphelper::PropertySetHelper
51cdf0e10cSrcweir {
52cdf0e10cSrcweir 	friend class ::unogallery::GalleryTheme;
53cdf0e10cSrcweir 
54cdf0e10cSrcweir public:
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 			GalleryItem( ::unogallery::GalleryTheme& rTheme, const GalleryObject& rObject );
57cdf0e10cSrcweir 			~GalleryItem() throw();
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 	bool	isValid() const;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir     static ::rtl::OUString getImplementationName_Static() throw();
62cdf0e10cSrcweir     static ::com::sun::star::uno::Sequence< ::rtl::OUString >  getSupportedServiceNames_Static() throw();
63cdf0e10cSrcweir 
64cdf0e10cSrcweir protected:
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	// XInterface
67cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir 	virtual void SAL_CALL acquire() throw();
70cdf0e10cSrcweir 	virtual void SAL_CALL release() throw();
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 	// XServiceInfo
73cdf0e10cSrcweir     virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
74cdf0e10cSrcweir     virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
75cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
76cdf0e10cSrcweir 
77cdf0e10cSrcweir 	// XTypeProvider
78cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
79cdf0e10cSrcweir     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 	// XGalleryItem
82cdf0e10cSrcweir     virtual ::sal_Int8 SAL_CALL getType(  ) throw (::com::sun::star::uno::RuntimeException);
83cdf0e10cSrcweir 
84cdf0e10cSrcweir 	// PropertySetHelper
85cdf0e10cSrcweir     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 );
86cdf0e10cSrcweir     virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
87cdf0e10cSrcweir 
88cdf0e10cSrcweir protected:
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	::comphelper::PropertySetInfo* createPropertySetInfo();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir private:
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	::unogallery::GalleryTheme* mpTheme;
95cdf0e10cSrcweir 	const ::GalleryObject*		mpGalleryObject;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	const ::GalleryObject*		implGetObject() const;
98cdf0e10cSrcweir 	void 						implSetInvalid();
99cdf0e10cSrcweir 
100cdf0e10cSrcweir 								// not available
101cdf0e10cSrcweir 								GalleryItem();
102cdf0e10cSrcweir 								GalleryItem( const GalleryItem& );
103cdf0e10cSrcweir 								GalleryItem& operator=( const GalleryItem& );
104cdf0e10cSrcweir };
105cdf0e10cSrcweir 
106cdf0e10cSrcweir // -----------------------
107cdf0e10cSrcweir // - GalleryDrawingModel -
108cdf0e10cSrcweir // -----------------------
109cdf0e10cSrcweir 
110cdf0e10cSrcweir class GalleryDrawingModel : public SvxUnoDrawingModel
111cdf0e10cSrcweir {
112cdf0e10cSrcweir public:
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 				GalleryDrawingModel( SdrModel* pDoc ) throw();
115cdf0e10cSrcweir 	virtual 	~GalleryDrawingModel() throw();
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 				UNO3_GETIMPLEMENTATION_DECL( GalleryDrawingModel )
118cdf0e10cSrcweir };
119cdf0e10cSrcweir 
120cdf0e10cSrcweir }
121cdf0e10cSrcweir 
122cdf0e10cSrcweir #endif
123