Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / inc / appluno.hxx
blobd442bd56f8f75af276d1f3845a4426b3849ed21c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_INC_APPLUNO_HXX
21 #define INCLUDED_SC_INC_APPLUNO_HXX
23 #include <svl/itemprop.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <com/sun/star/beans/XPropertySet.hpp>
27 #include <com/sun/star/sheet/XRecentFunctions.hpp>
28 #include <com/sun/star/sheet/XFunctionDescriptions.hpp>
29 #include <com/sun/star/sheet/XGlobalSheetSettings.hpp>
30 #include <com/sun/star/container/XEnumerationAccess.hpp>
31 #include <com/sun/star/container/XNameAccess.hpp>
32 #include <cppuhelper/implbase.hxx>
33 #include <rtl/ustring.hxx>
34 #include <sfx2/sfxmodelfactory.hxx>
36 css::uno::Reference<css::uno::XInterface> SAL_CALL
37 ScSpreadsheetSettings_CreateInstance(
38 const css::uno::Reference< css::lang::XMultiServiceFactory>& rSMgr );
39 css::uno::Reference<css::uno::XInterface> SAL_CALL
40 ScRecentFunctionsObj_CreateInstance(
41 const css::uno::Reference< css::lang::XMultiServiceFactory>& rSMgr );
42 css::uno::Reference<css::uno::XInterface> SAL_CALL
43 ScFunctionListObj_CreateInstance(
44 const css::uno::Reference< css::lang::XMultiServiceFactory>& rSMgr );
46 // Calc document
47 css::uno::Sequence< OUString > SAL_CALL ScDocument_getSupportedServiceNames() throw();
48 OUString SAL_CALL ScDocument_getImplementationName() throw();
49 css::uno::Reference< css::uno::XInterface > SAL_CALL ScDocument_createInstance(
50 const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr, SfxModelFlags _nCreationFlags ) throw( css::uno::Exception, std::exception );
52 // Calc XML import
53 css::uno::Sequence< OUString > SAL_CALL ScXMLImport_getSupportedServiceNames() throw();
54 OUString SAL_CALL ScXMLImport_getImplementationName() throw();
55 css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLImport_createInstance(
56 const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( css::uno::Exception );
57 css::uno::Sequence< OUString > SAL_CALL ScXMLImport_Meta_getSupportedServiceNames() throw();
58 OUString SAL_CALL ScXMLImport_Meta_getImplementationName() throw();
59 css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLImport_Meta_createInstance(
60 const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( css::uno::Exception );
61 css::uno::Sequence< OUString > SAL_CALL ScXMLImport_Styles_getSupportedServiceNames() throw();
62 OUString SAL_CALL ScXMLImport_Styles_getImplementationName() throw();
63 css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLImport_Styles_createInstance(
64 const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( css::uno::Exception );
65 css::uno::Sequence< OUString > SAL_CALL ScXMLImport_Content_getSupportedServiceNames() throw();
66 OUString SAL_CALL ScXMLImport_Content_getImplementationName() throw();
67 css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLImport_Content_createInstance(
68 const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( css::uno::Exception );
69 css::uno::Sequence< OUString > SAL_CALL ScXMLImport_Settings_getSupportedServiceNames() throw();
70 OUString SAL_CALL ScXMLImport_Settings_getImplementationName() throw();
71 css::uno::Reference< css::uno::XInterface > SAL_CALL ScXMLImport_Settings_createInstance(
72 const css::uno::Reference< css::lang::XMultiServiceFactory > & rSMgr ) throw( css::uno::Exception );
74 class ScSpreadsheetSettings : public cppu::WeakImplHelper<
75 css::sheet::XGlobalSheetSettings,
76 css::beans::XPropertySet,
77 css::lang::XServiceInfo>
79 private:
80 SfxItemPropertySet aPropSet;
82 bool getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException);
83 sal_Int16 getPropertyInt16(const OUString& aPropertyName) throw (css::uno::RuntimeException);
84 void setProperty(const OUString& aPropertyName, bool p1) throw (css::uno::RuntimeException)
85 { setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
86 void setProperty(const OUString& aPropertyName, sal_Int16 p1) throw (css::uno::RuntimeException)
87 { setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
88 public:
89 ScSpreadsheetSettings();
90 virtual ~ScSpreadsheetSettings();
92 static OUString getImplementationName_Static();
93 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
95 // XGlobalSheetSettings
96 virtual sal_Bool SAL_CALL getMoveSelection() throw (css::uno::RuntimeException, std::exception) override
97 { return getPropertyBool("MoveSelection"); }
98 virtual void SAL_CALL setMoveSelection(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
99 { setProperty("MoveSelection", (bool)p1); }
100 virtual sal_Int16 SAL_CALL getMoveDirection() throw (css::uno::RuntimeException, std::exception) override
101 { return getPropertyInt16("MoveDirection"); }
102 virtual void SAL_CALL setMoveDirection(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) override
103 { setProperty("MoveDirection", p1); }
104 virtual sal_Bool SAL_CALL getEnterEdit() throw (css::uno::RuntimeException, std::exception) override
105 { return getPropertyBool("EnterEdit"); }
106 virtual void SAL_CALL setEnterEdit(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
107 { setProperty("EnterEdit", (bool)p1); }
108 virtual sal_Bool SAL_CALL getExtendFormat() throw (css::uno::RuntimeException, std::exception) override
109 { return getPropertyBool("ExtendFormat"); }
110 virtual void SAL_CALL setExtendFormat(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
111 { setProperty("ExtendFormat", (bool)p1); }
112 virtual sal_Bool SAL_CALL getRangeFinder() throw (css::uno::RuntimeException, std::exception) override
113 { return getPropertyBool("RangeFinder"); }
114 virtual void SAL_CALL setRangeFinder(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
115 { setProperty("RangeFinder", (bool)p1); }
116 virtual sal_Bool SAL_CALL getExpandReferences() throw (css::uno::RuntimeException, std::exception) override
117 { return getPropertyBool("ExpandReferences"); }
118 virtual void SAL_CALL setExpandReferences(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
119 { setProperty("ExpandReferences", (bool)p1); }
120 virtual sal_Bool SAL_CALL getMarkHeader() throw (css::uno::RuntimeException, std::exception) override
121 { return getPropertyBool("MarkHeader"); }
122 virtual void SAL_CALL setMarkHeader(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
123 { setProperty("MarkHeader", (bool)p1); }
124 virtual sal_Bool SAL_CALL getUseTabCol() throw (css::uno::RuntimeException, std::exception) override
125 { return getPropertyBool("UseTabCol"); }
126 virtual void SAL_CALL setUseTabCol(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
127 { setProperty("UseTabCol", (bool)p1); }
128 virtual sal_Int16 SAL_CALL getMetric() throw (css::uno::RuntimeException, std::exception) override
129 { return getPropertyInt16("Metric"); }
130 virtual void SAL_CALL setMetric(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) override
131 { setProperty("Metric", p1); }
132 virtual sal_Int16 SAL_CALL getScale() throw (css::uno::RuntimeException, std::exception) override
133 { return getPropertyInt16("Scale"); }
134 virtual void SAL_CALL setScale(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) override
135 { setProperty("Scale", p1); }
136 virtual sal_Bool SAL_CALL getDoAutoComplete() throw (css::uno::RuntimeException, std::exception) override
137 { return getPropertyBool("DoAutoComplete"); }
138 virtual void SAL_CALL setDoAutoComplete(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
139 { setProperty("DoAutoComplete", (bool)p1); }
140 virtual sal_Int16 SAL_CALL getStatusBarFunction() throw (css::uno::RuntimeException, std::exception) override
141 { return getPropertyInt16("StatusBarFunction"); }
142 virtual void SAL_CALL setStatusBarFunction(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) override
143 { setProperty("StatusBarFunction", p1); }
144 virtual css::uno::Sequence<OUString> SAL_CALL getUserLists() throw (css::uno::RuntimeException, std::exception) override
146 css::uno::Any any = getPropertyValue("UserLists");
147 css::uno::Sequence<OUString> b;
148 any >>= b;
149 return b;
151 virtual void SAL_CALL setUserLists(const css::uno::Sequence<OUString>& p1) throw (css::uno::RuntimeException, std::exception) override
152 { setPropertyValue( "UserLists", css::uno::Any(p1) ); }
153 virtual sal_Int16 SAL_CALL getLinkUpdateMode() throw (css::uno::RuntimeException, std::exception) override
154 { return getPropertyInt16("LinkUpdateMode"); }
155 virtual void SAL_CALL setLinkUpdateMode(sal_Int16 p1) throw (css::uno::RuntimeException, std::exception) override
156 { setProperty("LinkUpdateMode", p1); }
157 virtual sal_Bool SAL_CALL getPrintAllSheets() throw (css::uno::RuntimeException, std::exception) override
158 { return getPropertyBool("PrintAllSheets"); }
159 virtual void SAL_CALL setPrintAllSheets(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
160 { setProperty("PrintAllSheets", (bool)p1); }
161 virtual sal_Bool SAL_CALL getPrintEmptyPages() throw (css::uno::RuntimeException, std::exception) override
162 { return getPropertyBool("PrintEmptyPages"); }
163 virtual void SAL_CALL setPrintEmptyPages(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
164 { setProperty("PrintEmptyPages", (bool)p1); }
165 virtual sal_Bool SAL_CALL getUsePrinterMetrics() throw (css::uno::RuntimeException, std::exception) override
166 { return getPropertyBool("UsePrinterMetrics"); }
167 virtual void SAL_CALL setUsePrinterMetrics(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
168 { setProperty("UsePrinterMetrics", (bool)p1); }
169 virtual sal_Bool SAL_CALL getReplaceCellsWarning() throw (css::uno::RuntimeException, std::exception) override
170 { return getPropertyBool("ReplaceCellsWarning"); }
171 virtual void SAL_CALL setReplaceCellsWarning(sal_Bool p1) throw (css::uno::RuntimeException, std::exception) override
172 { setProperty("ReplaceCellsWarning", (bool)p1); }
174 // XPropertySet
175 virtual css::uno::Reference< css::beans::XPropertySetInfo >
176 SAL_CALL getPropertySetInfo()
177 throw(css::uno::RuntimeException, std::exception) override;
178 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
179 const css::uno::Any& aValue )
180 throw (css::beans::UnknownPropertyException,
181 css::beans::PropertyVetoException,
182 css::lang::IllegalArgumentException,
183 css::lang::WrappedTargetException,
184 css::uno::RuntimeException,
185 std::exception) override;
186 virtual css::uno::Any SAL_CALL getPropertyValue(
187 const OUString& PropertyName )
188 throw (css::beans::UnknownPropertyException,
189 css::lang::WrappedTargetException,
190 css::uno::RuntimeException,
191 std::exception) override;
192 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
193 const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener )
194 throw(css::beans::UnknownPropertyException,
195 css::lang::WrappedTargetException,
196 css::uno::RuntimeException, std::exception) override;
197 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
198 const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener )
199 throw(css::beans::UnknownPropertyException,
200 css::lang::WrappedTargetException,
201 css::uno::RuntimeException, std::exception) override;
202 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
203 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener )
204 throw(css::beans::UnknownPropertyException,
205 css::lang::WrappedTargetException,
206 css::uno::RuntimeException, std::exception) override;
207 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
208 const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener )
209 throw(css::beans::UnknownPropertyException,
210 css::lang::WrappedTargetException,
211 css::uno::RuntimeException, std::exception) override;
213 // XServiceInfo
214 virtual OUString SAL_CALL getImplementationName()
215 throw(css::uno::RuntimeException, std::exception) override;
216 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
217 throw(css::uno::RuntimeException, std::exception) override;
218 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
219 throw(css::uno::RuntimeException, std::exception) override;
222 class ScRecentFunctionsObj : public cppu::WeakImplHelper<
223 css::sheet::XRecentFunctions,
224 css::lang::XServiceInfo>
226 public:
227 ScRecentFunctionsObj();
228 virtual ~ScRecentFunctionsObj();
230 // XRecentFunctions
231 virtual css::uno::Sequence< sal_Int32 > SAL_CALL getRecentFunctionIds()
232 throw(css::uno::RuntimeException, std::exception) override;
233 virtual void SAL_CALL setRecentFunctionIds( const css::uno::Sequence< sal_Int32 >& aRecentFunctionIds )
234 throw(css::uno::RuntimeException, std::exception) override;
235 virtual sal_Int32 SAL_CALL getMaxRecentFunctions()
236 throw(css::uno::RuntimeException, std::exception) override;
238 // XServiceInfo
239 virtual OUString SAL_CALL getImplementationName()
240 throw(css::uno::RuntimeException, std::exception) override;
241 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
242 throw(css::uno::RuntimeException, std::exception) override;
243 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
244 throw(css::uno::RuntimeException, std::exception) override;
247 class ScFunctionListObj : public cppu::WeakImplHelper<
248 css::sheet::XFunctionDescriptions,
249 css::container::XEnumerationAccess,
250 css::container::XNameAccess,
251 css::lang::XServiceInfo>
253 public:
254 ScFunctionListObj();
255 virtual ~ScFunctionListObj();
257 // XFunctionDescriptions
258 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL
259 getById( sal_Int32 nId )
260 throw(css::lang::IllegalArgumentException,
261 css::uno::RuntimeException, std::exception) override;
263 // XNameAccess
264 virtual css::uno::Any SAL_CALL getByName( const OUString& aName )
265 throw(css::container::NoSuchElementException,
266 css::lang::WrappedTargetException,
267 css::uno::RuntimeException, std::exception) override;
268 virtual css::uno::Sequence< OUString > SAL_CALL getElementNames()
269 throw(css::uno::RuntimeException, std::exception) override;
270 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
271 throw(css::uno::RuntimeException, std::exception) override;
273 // XIndexAccess
274 virtual sal_Int32 SAL_CALL getCount() throw(css::uno::RuntimeException, std::exception) override;
275 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
276 throw(css::lang::IndexOutOfBoundsException,
277 css::lang::WrappedTargetException,
278 css::uno::RuntimeException, std::exception) override;
280 // XEnumerationAccess
281 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL
282 createEnumeration() throw(css::uno::RuntimeException, std::exception) override;
284 // XElementAccess
285 virtual css::uno::Type SAL_CALL getElementType()
286 throw(css::uno::RuntimeException, std::exception) override;
287 virtual sal_Bool SAL_CALL hasElements() throw(css::uno::RuntimeException, std::exception) override;
289 // XServiceInfo
290 virtual OUString SAL_CALL getImplementationName()
291 throw(css::uno::RuntimeException, std::exception) override;
292 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
293 throw(css::uno::RuntimeException, std::exception) override;
294 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
295 throw(css::uno::RuntimeException, std::exception) override;
298 #endif
300 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */