xref: /aoo41x/main/sc/inc/appluno.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_APPLUNO_HXX
29 #define SC_APPLUNO_HXX
30 
31 #include <svl/itemprop.hxx>
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <com/sun/star/sheet/XRecentFunctions.hpp>
35 #include <com/sun/star/sheet/XFunctionDescriptions.hpp>
36 #include <com/sun/star/container/XEnumerationAccess.hpp>
37 #include <com/sun/star/container/XNameAccess.hpp>
38 #include <cppuhelper/implbase2.hxx>
39 #include <cppuhelper/implbase4.hxx>
40 
41 class ScFunctionDescriptionObj;
42 
43 
44 
45 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
46 	ScSpreadsheetSettings_CreateInstance(
47 		const com::sun::star::uno::Reference<
48 			com::sun::star::lang::XMultiServiceFactory>& rSMgr );
49 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
50 	ScRecentFunctionsObj_CreateInstance(
51 		const com::sun::star::uno::Reference<
52 			com::sun::star::lang::XMultiServiceFactory>& rSMgr );
53 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
54 	ScFunctionListObj_CreateInstance(
55 		const com::sun::star::uno::Reference<
56 			com::sun::star::lang::XMultiServiceFactory>& rSMgr );
57 
58 
59 class ScSpreadsheetSettings : public cppu::WeakImplHelper2<
60 										com::sun::star::beans::XPropertySet,
61 										com::sun::star::lang::XServiceInfo>
62 {
63 private:
64 	SfxItemPropertySet		aPropSet;
65 
66 public:
67 							ScSpreadsheetSettings();
68 	virtual					~ScSpreadsheetSettings();
69 
70 	static ::rtl::OUString	getImplementationName_Static();
71 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
72 
73 							// XPropertySet
74 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
75 							SAL_CALL getPropertySetInfo()
76 								throw(::com::sun::star::uno::RuntimeException);
77 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
78 									const ::com::sun::star::uno::Any& aValue )
79 								throw(::com::sun::star::beans::UnknownPropertyException,
80 									::com::sun::star::beans::PropertyVetoException,
81 									::com::sun::star::lang::IllegalArgumentException,
82 									::com::sun::star::lang::WrappedTargetException,
83 									::com::sun::star::uno::RuntimeException);
84 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
85 									const ::rtl::OUString& PropertyName )
86 								throw(::com::sun::star::beans::UnknownPropertyException,
87 									::com::sun::star::lang::WrappedTargetException,
88 									::com::sun::star::uno::RuntimeException);
89 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
90 									const ::com::sun::star::uno::Reference<
91 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
92 								throw(::com::sun::star::beans::UnknownPropertyException,
93 									::com::sun::star::lang::WrappedTargetException,
94 									::com::sun::star::uno::RuntimeException);
95 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
96 									const ::com::sun::star::uno::Reference<
97 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
98 								throw(::com::sun::star::beans::UnknownPropertyException,
99 									::com::sun::star::lang::WrappedTargetException,
100 									::com::sun::star::uno::RuntimeException);
101 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
102 									const ::com::sun::star::uno::Reference<
103 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
104 								throw(::com::sun::star::beans::UnknownPropertyException,
105 									::com::sun::star::lang::WrappedTargetException,
106 									::com::sun::star::uno::RuntimeException);
107 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
108 									const ::com::sun::star::uno::Reference<
109 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
110 								throw(::com::sun::star::beans::UnknownPropertyException,
111 									::com::sun::star::lang::WrappedTargetException,
112 									::com::sun::star::uno::RuntimeException);
113 
114 							// XServiceInfo
115 	virtual ::rtl::OUString SAL_CALL getImplementationName()
116 								throw(::com::sun::star::uno::RuntimeException);
117 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
118 								throw(::com::sun::star::uno::RuntimeException);
119 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
120 								throw(::com::sun::star::uno::RuntimeException);
121 };
122 
123 
124 class ScRecentFunctionsObj : public cppu::WeakImplHelper2<
125 										com::sun::star::sheet::XRecentFunctions,
126 										com::sun::star::lang::XServiceInfo>
127 {
128 public:
129 							ScRecentFunctionsObj();
130 	virtual					~ScRecentFunctionsObj();
131 
132 	static ::rtl::OUString	getImplementationName_Static();
133 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
134 
135 							// XRecentFunctions
136 	virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getRecentFunctionIds()
137 								throw(::com::sun::star::uno::RuntimeException);
138 	virtual void SAL_CALL setRecentFunctionIds( const ::com::sun::star::uno::Sequence<
139 												sal_Int32 >& aRecentFunctionIds )
140 								throw(::com::sun::star::uno::RuntimeException);
141 	virtual sal_Int32 SAL_CALL getMaxRecentFunctions()
142 								throw(::com::sun::star::uno::RuntimeException);
143 
144 							// XServiceInfo
145 	virtual ::rtl::OUString SAL_CALL getImplementationName()
146 								throw(::com::sun::star::uno::RuntimeException);
147 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
148 								throw(::com::sun::star::uno::RuntimeException);
149 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
150 								throw(::com::sun::star::uno::RuntimeException);
151 };
152 
153 
154 class ScFunctionListObj : public cppu::WeakImplHelper4<
155 										com::sun::star::sheet::XFunctionDescriptions,
156 										com::sun::star::container::XEnumerationAccess,
157 										com::sun::star::container::XNameAccess,
158 										com::sun::star::lang::XServiceInfo>
159 {
160 public:
161 							ScFunctionListObj();
162 	virtual					~ScFunctionListObj();
163 
164 	static ::rtl::OUString	getImplementationName_Static();
165 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
166 
167 							// XFunctionDescriptions
168 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
169 							getById( sal_Int32 nId )
170 								throw(::com::sun::star::lang::IllegalArgumentException,
171 								::com::sun::star::uno::RuntimeException);
172 
173 							// XNameAccess
174 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
175 								throw(::com::sun::star::container::NoSuchElementException,
176 									::com::sun::star::lang::WrappedTargetException,
177 									::com::sun::star::uno::RuntimeException);
178 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
179 								throw(::com::sun::star::uno::RuntimeException);
180 	virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
181 								throw(::com::sun::star::uno::RuntimeException);
182 
183 							// XIndexAccess
184 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
185 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
186 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
187 									::com::sun::star::lang::WrappedTargetException,
188 									::com::sun::star::uno::RuntimeException);
189 
190 							// XEnumerationAccess
191 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
192 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
193 
194 							// XElementAccess
195 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
196 								throw(::com::sun::star::uno::RuntimeException);
197 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
198 
199 							// XServiceInfo
200 	virtual ::rtl::OUString SAL_CALL getImplementationName()
201 								throw(::com::sun::star::uno::RuntimeException);
202 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
203 								throw(::com::sun::star::uno::RuntimeException);
204 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
205 								throw(::com::sun::star::uno::RuntimeException);
206 };
207 
208 
209 
210 #endif
211 
212