xref: /trunk/main/sc/inc/defltuno.hxx (revision cdf0e10c)
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 SC_DEFLTUNO_HXX
29 #define SC_DEFLTUNO_HXX
30 
31 #include <svl/lstner.hxx>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <com/sun/star/beans/XPropertyState.hpp>
35 #include <cppuhelper/implbase3.hxx>
36 #include <svl/itemprop.hxx>
37 
38 class ScDocShell;
39 
40 
41 class ScDocDefaultsObj : public ::cppu::WeakImplHelper3<
42 							::com::sun::star::beans::XPropertySet,
43 							::com::sun::star::beans::XPropertyState,
44 							::com::sun::star::lang::XServiceInfo >,
45 						public SfxListener
46 {
47 private:
48 	ScDocShell*				pDocShell;
49     SfxItemPropertyMap      aPropertyMap;
50 
51 	void					ItemsChanged();
52 
53 public:
54 							ScDocDefaultsObj(ScDocShell* pDocSh);
55 	virtual					~ScDocDefaultsObj();
56 
57 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
58 
59 							// XPropertySet
60 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
61 							SAL_CALL getPropertySetInfo()
62 								throw(::com::sun::star::uno::RuntimeException);
63 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
64 									const ::com::sun::star::uno::Any& aValue )
65 								throw(::com::sun::star::beans::UnknownPropertyException,
66 									::com::sun::star::beans::PropertyVetoException,
67 									::com::sun::star::lang::IllegalArgumentException,
68 									::com::sun::star::lang::WrappedTargetException,
69 									::com::sun::star::uno::RuntimeException);
70 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
71 									const ::rtl::OUString& PropertyName )
72 								throw(::com::sun::star::beans::UnknownPropertyException,
73 									::com::sun::star::lang::WrappedTargetException,
74 									::com::sun::star::uno::RuntimeException);
75 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
76 									const ::com::sun::star::uno::Reference<
77 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
78 								throw(::com::sun::star::beans::UnknownPropertyException,
79 									::com::sun::star::lang::WrappedTargetException,
80 									::com::sun::star::uno::RuntimeException);
81 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
82 									const ::com::sun::star::uno::Reference<
83 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
84 								throw(::com::sun::star::beans::UnknownPropertyException,
85 									::com::sun::star::lang::WrappedTargetException,
86 									::com::sun::star::uno::RuntimeException);
87 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
88 									const ::com::sun::star::uno::Reference<
89 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
90 								throw(::com::sun::star::beans::UnknownPropertyException,
91 									::com::sun::star::lang::WrappedTargetException,
92 									::com::sun::star::uno::RuntimeException);
93 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
94 									const ::com::sun::star::uno::Reference<
95 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
96 								throw(::com::sun::star::beans::UnknownPropertyException,
97 									::com::sun::star::lang::WrappedTargetException,
98 									::com::sun::star::uno::RuntimeException);
99 
100 							// XPropertyState
101 	virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(
102 									const ::rtl::OUString& PropertyName )
103 								throw(::com::sun::star::beans::UnknownPropertyException,
104 									::com::sun::star::uno::RuntimeException);
105 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL
106 							getPropertyStates( const ::com::sun::star::uno::Sequence<
107 										::rtl::OUString >& aPropertyName )
108 								throw(::com::sun::star::beans::UnknownPropertyException,
109 									::com::sun::star::uno::RuntimeException);
110 	virtual void SAL_CALL	setPropertyToDefault( const ::rtl::OUString& PropertyName )
111 								throw(::com::sun::star::beans::UnknownPropertyException,
112 									::com::sun::star::uno::RuntimeException);
113 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault(
114 									const ::rtl::OUString& aPropertyName )
115 								throw(::com::sun::star::beans::UnknownPropertyException,
116 									::com::sun::star::lang::WrappedTargetException,
117 									::com::sun::star::uno::RuntimeException);
118 
119 							// XServiceInfo
120 	virtual ::rtl::OUString SAL_CALL getImplementationName()
121 								throw(::com::sun::star::uno::RuntimeException);
122 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
123 								throw(::com::sun::star::uno::RuntimeException);
124 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
125 								throw(::com::sun::star::uno::RuntimeException);
126 };
127 
128 
129 #endif
130 
131