xref: /aoo42x/main/sc/inc/appluno.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_APPLUNO_HXX
25 #define SC_APPLUNO_HXX
26 
27 #include <svl/itemprop.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/beans/XPropertySet.hpp>
30 #include <com/sun/star/sheet/XRecentFunctions.hpp>
31 #include <com/sun/star/sheet/XFunctionDescriptions.hpp>
32 #include <com/sun/star/container/XEnumerationAccess.hpp>
33 #include <com/sun/star/container/XNameAccess.hpp>
34 #include <cppuhelper/implbase2.hxx>
35 #include <cppuhelper/implbase4.hxx>
36 
37 class ScFunctionDescriptionObj;
38 
39 
40 
41 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
42 	ScSpreadsheetSettings_CreateInstance(
43 		const com::sun::star::uno::Reference<
44 			com::sun::star::lang::XMultiServiceFactory>& rSMgr );
45 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
46 	ScRecentFunctionsObj_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 	ScFunctionListObj_CreateInstance(
51 		const com::sun::star::uno::Reference<
52 			com::sun::star::lang::XMultiServiceFactory>& rSMgr );
53 
54 
55 class ScSpreadsheetSettings : public cppu::WeakImplHelper2<
56 										com::sun::star::beans::XPropertySet,
57 										com::sun::star::lang::XServiceInfo>
58 {
59 private:
60 	SfxItemPropertySet		aPropSet;
61 
62 public:
63 							ScSpreadsheetSettings();
64 	virtual					~ScSpreadsheetSettings();
65 
66 	static ::rtl::OUString	getImplementationName_Static();
67 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
68 
69 							// XPropertySet
70 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
71 							SAL_CALL getPropertySetInfo()
72 								throw(::com::sun::star::uno::RuntimeException);
73 	virtual void SAL_CALL	setPropertyValue( const ::rtl::OUString& aPropertyName,
74 									const ::com::sun::star::uno::Any& aValue )
75 								throw(::com::sun::star::beans::UnknownPropertyException,
76 									::com::sun::star::beans::PropertyVetoException,
77 									::com::sun::star::lang::IllegalArgumentException,
78 									::com::sun::star::lang::WrappedTargetException,
79 									::com::sun::star::uno::RuntimeException);
80 	virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
81 									const ::rtl::OUString& PropertyName )
82 								throw(::com::sun::star::beans::UnknownPropertyException,
83 									::com::sun::star::lang::WrappedTargetException,
84 									::com::sun::star::uno::RuntimeException);
85 	virtual void SAL_CALL	addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
86 									const ::com::sun::star::uno::Reference<
87 										::com::sun::star::beans::XPropertyChangeListener >& xListener )
88 								throw(::com::sun::star::beans::UnknownPropertyException,
89 									::com::sun::star::lang::WrappedTargetException,
90 									::com::sun::star::uno::RuntimeException);
91 	virtual void SAL_CALL	removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
92 									const ::com::sun::star::uno::Reference<
93 										::com::sun::star::beans::XPropertyChangeListener >& aListener )
94 								throw(::com::sun::star::beans::UnknownPropertyException,
95 									::com::sun::star::lang::WrappedTargetException,
96 									::com::sun::star::uno::RuntimeException);
97 	virtual void SAL_CALL	addVetoableChangeListener( const ::rtl::OUString& PropertyName,
98 									const ::com::sun::star::uno::Reference<
99 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
100 								throw(::com::sun::star::beans::UnknownPropertyException,
101 									::com::sun::star::lang::WrappedTargetException,
102 									::com::sun::star::uno::RuntimeException);
103 	virtual void SAL_CALL	removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
104 									const ::com::sun::star::uno::Reference<
105 										::com::sun::star::beans::XVetoableChangeListener >& aListener )
106 								throw(::com::sun::star::beans::UnknownPropertyException,
107 									::com::sun::star::lang::WrappedTargetException,
108 									::com::sun::star::uno::RuntimeException);
109 
110 							// XServiceInfo
111 	virtual ::rtl::OUString SAL_CALL getImplementationName()
112 								throw(::com::sun::star::uno::RuntimeException);
113 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
114 								throw(::com::sun::star::uno::RuntimeException);
115 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
116 								throw(::com::sun::star::uno::RuntimeException);
117 };
118 
119 
120 class ScRecentFunctionsObj : public cppu::WeakImplHelper2<
121 										com::sun::star::sheet::XRecentFunctions,
122 										com::sun::star::lang::XServiceInfo>
123 {
124 public:
125 							ScRecentFunctionsObj();
126 	virtual					~ScRecentFunctionsObj();
127 
128 	static ::rtl::OUString	getImplementationName_Static();
129 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
130 
131 							// XRecentFunctions
132 	virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getRecentFunctionIds()
133 								throw(::com::sun::star::uno::RuntimeException);
134 	virtual void SAL_CALL setRecentFunctionIds( const ::com::sun::star::uno::Sequence<
135 												sal_Int32 >& aRecentFunctionIds )
136 								throw(::com::sun::star::uno::RuntimeException);
137 	virtual sal_Int32 SAL_CALL getMaxRecentFunctions()
138 								throw(::com::sun::star::uno::RuntimeException);
139 
140 							// XServiceInfo
141 	virtual ::rtl::OUString SAL_CALL getImplementationName()
142 								throw(::com::sun::star::uno::RuntimeException);
143 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
144 								throw(::com::sun::star::uno::RuntimeException);
145 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
146 								throw(::com::sun::star::uno::RuntimeException);
147 };
148 
149 
150 class ScFunctionListObj : public cppu::WeakImplHelper4<
151 										com::sun::star::sheet::XFunctionDescriptions,
152 										com::sun::star::container::XEnumerationAccess,
153 										com::sun::star::container::XNameAccess,
154 										com::sun::star::lang::XServiceInfo>
155 {
156 public:
157 							ScFunctionListObj();
158 	virtual					~ScFunctionListObj();
159 
160 	static ::rtl::OUString	getImplementationName_Static();
161 	static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static();
162 
163 							// XFunctionDescriptions
164 	virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
165 							getById( sal_Int32 nId )
166 								throw(::com::sun::star::lang::IllegalArgumentException,
167 								::com::sun::star::uno::RuntimeException);
168 
169 							// XNameAccess
170 	virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
171 								throw(::com::sun::star::container::NoSuchElementException,
172 									::com::sun::star::lang::WrappedTargetException,
173 									::com::sun::star::uno::RuntimeException);
174 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
175 								throw(::com::sun::star::uno::RuntimeException);
176 	virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName )
177 								throw(::com::sun::star::uno::RuntimeException);
178 
179 							// XIndexAccess
180 	virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
181 	virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
182 								throw(::com::sun::star::lang::IndexOutOfBoundsException,
183 									::com::sun::star::lang::WrappedTargetException,
184 									::com::sun::star::uno::RuntimeException);
185 
186 							// XEnumerationAccess
187 	virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
188 							createEnumeration() throw(::com::sun::star::uno::RuntimeException);
189 
190 							// XElementAccess
191 	virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
192 								throw(::com::sun::star::uno::RuntimeException);
193 	virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
194 
195 							// XServiceInfo
196 	virtual ::rtl::OUString SAL_CALL getImplementationName()
197 								throw(::com::sun::star::uno::RuntimeException);
198 	virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
199 								throw(::com::sun::star::uno::RuntimeException);
200 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
201 								throw(::com::sun::star::uno::RuntimeException);
202 };
203 
204 
205 
206 #endif
207 
208