1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef _SVX_UNOGALITEM_HXX
29 #define _SVX_UNOGALITEM_HXX
30 
31 #include <svx/unomodel.hxx>
32 #include <comphelper/servicehelper.hxx>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/gallery/XGalleryItem.hpp>
35 #include <comphelper/propertysethelper.hxx>
36 #ifndef _COMPHELPER_PROPERTYSETINFO_HXX_
37 #include <comphelper/propertysetinfo.hxx>
38 #endif
39 
40 class GalleryTheme;
41 struct GalleryObject;
42 namespace unogallery { class GalleryTheme; }
43 
44 namespace unogallery {
45 
46 // ---------------
47 // - GalleryItem -
48 // ---------------
49 
50 class GalleryItem : public ::cppu::OWeakAggObject,
51 					public ::com::sun::star::lang::XServiceInfo,
52 					public ::com::sun::star::lang::XTypeProvider,
53 					public ::com::sun::star::gallery::XGalleryItem,
54 					public ::comphelper::PropertySetHelper
55 {
56 	friend class ::unogallery::GalleryTheme;
57 
58 public:
59 
60 			GalleryItem( ::unogallery::GalleryTheme& rTheme, const GalleryObject& rObject );
61 			~GalleryItem() throw();
62 
63 	bool	isValid() const;
64 
65     static ::rtl::OUString getImplementationName_Static() throw();
66     static ::com::sun::star::uno::Sequence< ::rtl::OUString >  getSupportedServiceNames_Static() throw();
67 
68 protected:
69 
70 	// XInterface
71 	virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
72 	virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
73 	virtual void SAL_CALL acquire() throw();
74 	virtual void SAL_CALL release() throw();
75 
76 	// XServiceInfo
77     virtual rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
78     virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw( ::com::sun::star::uno::RuntimeException );
79     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
80 
81 	// XTypeProvider
82     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes(  ) throw(::com::sun::star::uno::RuntimeException);
83     virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(  ) throw(::com::sun::star::uno::RuntimeException);
84 
85 	// XGalleryItem
86     virtual ::sal_Int8 SAL_CALL getType(  ) throw (::com::sun::star::uno::RuntimeException);
87 
88 	// PropertySetHelper
89     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 );
90     virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, ::com::sun::star::uno::Any* pValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException );
91 
92 protected:
93 
94 	::comphelper::PropertySetInfo* createPropertySetInfo();
95 
96 private:
97 
98 	::unogallery::GalleryTheme* mpTheme;
99 	const ::GalleryObject*		mpGalleryObject;
100 
101 	const ::GalleryObject*		implGetObject() const;
102 	void 						implSetInvalid();
103 
104 								// not available
105 								GalleryItem();
106 								GalleryItem( const GalleryItem& );
107 								GalleryItem& operator=( const GalleryItem& );
108 };
109 
110 // -----------------------
111 // - GalleryDrawingModel -
112 // -----------------------
113 
114 class GalleryDrawingModel : public SvxUnoDrawingModel
115 {
116 public:
117 
118 				GalleryDrawingModel( SdrModel* pDoc ) throw();
119 	virtual 	~GalleryDrawingModel() throw();
120 
121 				UNO3_GETIMPLEMENTATION_DECL( GalleryDrawingModel )
122 };
123 
124 }
125 
126 #endif
127