Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / inc / appluno.hxx
blobb63fdab835eee3dc648ca3df4722c34ffe17c9ad
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 SC_APPLUNO_HXX
21 #define SC_APPLUNO_HXX
23 #include <svl/itemprop.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/beans/XPropertySet.hpp>
26 #include <com/sun/star/sheet/XRecentFunctions.hpp>
27 #include <com/sun/star/sheet/XFunctionDescriptions.hpp>
28 #include <com/sun/star/sheet/XGlobalSheetSettings.hpp>
29 #include <com/sun/star/container/XEnumerationAccess.hpp>
30 #include <com/sun/star/container/XNameAccess.hpp>
31 #include <cppuhelper/implbase2.hxx>
32 #include <cppuhelper/implbase3.hxx>
33 #include <cppuhelper/implbase4.hxx>
34 #include <rtl/ustring.hxx>
38 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
39 ScSpreadsheetSettings_CreateInstance(
40 const com::sun::star::uno::Reference<
41 com::sun::star::lang::XMultiServiceFactory>& rSMgr );
42 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
43 ScRecentFunctionsObj_CreateInstance(
44 const com::sun::star::uno::Reference<
45 com::sun::star::lang::XMultiServiceFactory>& rSMgr );
46 com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
47 ScFunctionListObj_CreateInstance(
48 const com::sun::star::uno::Reference<
49 com::sun::star::lang::XMultiServiceFactory>& rSMgr );
52 class ScSpreadsheetSettings : public cppu::WeakImplHelper3<
53 com::sun::star::sheet::XGlobalSheetSettings,
54 com::sun::star::beans::XPropertySet,
55 com::sun::star::lang::XServiceInfo>
57 private:
58 SfxItemPropertySet aPropSet;
61 sal_Bool getPropertyBool(const OUString& aPropertyName) throw (css::uno::RuntimeException);
62 sal_Int16 getPropertyInt16(const OUString& aPropertyName) throw (css::uno::RuntimeException);
63 void setProperty(const OUString& aPropertyName, sal_Bool p1) throw (css::uno::RuntimeException)
64 { setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
65 void setProperty(const OUString& aPropertyName, sal_Int16 p1) throw (css::uno::RuntimeException)
66 { setPropertyValue( aPropertyName, css::uno::Any(p1) ); }
67 public:
68 ScSpreadsheetSettings();
69 virtual ~ScSpreadsheetSettings();
71 static OUString getImplementationName_Static();
72 static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
74 // XGlobalSheetSettings
75 virtual sal_Bool SAL_CALL getMoveSelection() throw (css::uno::RuntimeException)
76 { return getPropertyBool("MoveSelection"); }
77 virtual void SAL_CALL setMoveSelection(sal_Bool p1) throw (css::uno::RuntimeException)
78 { setProperty("MoveSelection", p1); }
79 virtual sal_Int16 SAL_CALL getMoveDirection() throw (css::uno::RuntimeException)
80 { return getPropertyInt16("MoveDirection"); }
81 virtual void SAL_CALL setMoveDirection(sal_Int16 p1) throw (css::uno::RuntimeException)
82 { setProperty("MoveDirection", p1); }
83 virtual sal_Bool SAL_CALL getEnterEdit() throw (css::uno::RuntimeException)
84 { return getPropertyBool("EnterEdit"); }
85 virtual void SAL_CALL setEnterEdit(sal_Bool p1) throw (css::uno::RuntimeException)
86 { setProperty("EnterEdit", p1); }
87 virtual sal_Bool SAL_CALL getExtendFormat() throw (css::uno::RuntimeException)
88 { return getPropertyBool("ExtendFormat"); }
89 virtual void SAL_CALL setExtendFormat(sal_Bool p1) throw (css::uno::RuntimeException)
90 { setProperty("ExtendFormat", p1); }
91 virtual sal_Bool SAL_CALL getRangeFinder() throw (css::uno::RuntimeException)
92 { return getPropertyBool("RangeFinder"); }
93 virtual void SAL_CALL setRangeFinder(sal_Bool p1) throw (css::uno::RuntimeException)
94 { setProperty("RangeFinder", p1); }
95 virtual sal_Bool SAL_CALL getExpandReferences() throw (css::uno::RuntimeException)
96 { return getPropertyBool("ExpandReferences"); }
97 virtual void SAL_CALL setExpandReferences(sal_Bool p1) throw (css::uno::RuntimeException)
98 { setProperty("ExpandReferences", p1); }
99 virtual sal_Bool SAL_CALL getMarkHeader() throw (css::uno::RuntimeException)
100 { return getPropertyBool("MarkHeader"); }
101 virtual void SAL_CALL setMarkHeader(sal_Bool p1) throw (css::uno::RuntimeException)
102 { setProperty("MarkHeader", p1); }
103 virtual sal_Bool SAL_CALL getUseTabCol() throw (css::uno::RuntimeException)
104 { return getPropertyBool("UseTabCol"); }
105 virtual void SAL_CALL setUseTabCol(sal_Bool p1) throw (css::uno::RuntimeException)
106 { setProperty("UseTabCol", p1); }
107 virtual sal_Int16 SAL_CALL getMetric() throw (css::uno::RuntimeException)
108 { return getPropertyInt16("Metric"); }
109 virtual void SAL_CALL setMetric(sal_Int16 p1) throw (css::uno::RuntimeException)
110 { setProperty("Metric", p1); }
111 virtual sal_Int16 SAL_CALL getScale() throw (css::uno::RuntimeException)
112 { return getPropertyInt16("Scale"); }
113 virtual void SAL_CALL setScale(sal_Int16 p1) throw (css::uno::RuntimeException)
114 { setProperty("Scale", p1); }
115 virtual sal_Bool SAL_CALL getDoAutoComplete() throw (css::uno::RuntimeException)
116 { return getPropertyBool("DoAutoComplete"); }
117 virtual void SAL_CALL setDoAutoComplete(sal_Bool p1) throw (css::uno::RuntimeException)
118 { setProperty("DoAutoComplete", p1); }
119 virtual sal_Int16 SAL_CALL getStatusBarFunction() throw (css::uno::RuntimeException)
120 { return getPropertyInt16("StatusBarFunction"); }
121 virtual void SAL_CALL setStatusBarFunction(sal_Int16 p1) throw (css::uno::RuntimeException)
122 { setProperty("StatusBarFunction", p1); }
123 virtual css::uno::Sequence<OUString> SAL_CALL getUserLists() throw (css::uno::RuntimeException)
125 css::uno::Any any = getPropertyValue("UserLists");
126 css::uno::Sequence<OUString> b;
127 any >>= b;
128 return b;
130 virtual void SAL_CALL setUserLists(const css::uno::Sequence<OUString>& p1) throw (css::uno::RuntimeException)
131 { setPropertyValue( "UserLists", css::uno::Any(p1) ); }
132 virtual sal_Int16 SAL_CALL getLinkUpdateMode() throw (css::uno::RuntimeException)
133 { return getPropertyInt16("LinkUpdateMode"); }
134 virtual void SAL_CALL setLinkUpdateMode(sal_Int16 p1) throw (css::uno::RuntimeException)
135 { setProperty("LinkUpdateMode", p1); }
136 virtual sal_Bool SAL_CALL getPrintAllSheets() throw (css::uno::RuntimeException)
137 { return getPropertyBool("PrintAllSheets"); }
138 virtual void SAL_CALL setPrintAllSheets(sal_Bool p1) throw (css::uno::RuntimeException)
139 { setProperty("PrintAllSheets", p1); }
140 virtual sal_Bool SAL_CALL getPrintEmptyPages() throw (css::uno::RuntimeException)
141 { return getPropertyBool("PrintEmptyPages"); }
142 virtual void SAL_CALL setPrintEmptyPages(sal_Bool p1) throw (css::uno::RuntimeException)
143 { setProperty("PrintEmptyPages", p1); }
144 virtual sal_Bool SAL_CALL getUsePrinterMetrics() throw (css::uno::RuntimeException)
145 { return getPropertyBool("UsePrinterMetrics"); }
146 virtual void SAL_CALL setUsePrinterMetrics(sal_Bool p1) throw (css::uno::RuntimeException)
147 { setProperty("UsePrinterMetrics", p1); }
148 virtual sal_Bool SAL_CALL getReplaceCellsWarning() throw (css::uno::RuntimeException)
149 { return getPropertyBool("ReplaceCellsWarning"); }
150 virtual void SAL_CALL setReplaceCellsWarning(sal_Bool p1) throw (css::uno::RuntimeException)
151 { setProperty("ReplaceCellsWarning", p1); }
153 // XPropertySet
154 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
155 SAL_CALL getPropertySetInfo()
156 throw(::com::sun::star::uno::RuntimeException);
157 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName,
158 const ::com::sun::star::uno::Any& aValue )
159 throw(::com::sun::star::beans::UnknownPropertyException,
160 ::com::sun::star::beans::PropertyVetoException,
161 ::com::sun::star::lang::IllegalArgumentException,
162 ::com::sun::star::lang::WrappedTargetException,
163 ::com::sun::star::uno::RuntimeException);
164 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
165 const OUString& PropertyName )
166 throw(::com::sun::star::beans::UnknownPropertyException,
167 ::com::sun::star::lang::WrappedTargetException,
168 ::com::sun::star::uno::RuntimeException);
169 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName,
170 const ::com::sun::star::uno::Reference<
171 ::com::sun::star::beans::XPropertyChangeListener >& xListener )
172 throw(::com::sun::star::beans::UnknownPropertyException,
173 ::com::sun::star::lang::WrappedTargetException,
174 ::com::sun::star::uno::RuntimeException);
175 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName,
176 const ::com::sun::star::uno::Reference<
177 ::com::sun::star::beans::XPropertyChangeListener >& aListener )
178 throw(::com::sun::star::beans::UnknownPropertyException,
179 ::com::sun::star::lang::WrappedTargetException,
180 ::com::sun::star::uno::RuntimeException);
181 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName,
182 const ::com::sun::star::uno::Reference<
183 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
184 throw(::com::sun::star::beans::UnknownPropertyException,
185 ::com::sun::star::lang::WrappedTargetException,
186 ::com::sun::star::uno::RuntimeException);
187 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName,
188 const ::com::sun::star::uno::Reference<
189 ::com::sun::star::beans::XVetoableChangeListener >& aListener )
190 throw(::com::sun::star::beans::UnknownPropertyException,
191 ::com::sun::star::lang::WrappedTargetException,
192 ::com::sun::star::uno::RuntimeException);
194 // XServiceInfo
195 virtual OUString SAL_CALL getImplementationName()
196 throw(::com::sun::star::uno::RuntimeException);
197 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
198 throw(::com::sun::star::uno::RuntimeException);
199 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
200 throw(::com::sun::star::uno::RuntimeException);
204 class ScRecentFunctionsObj : public cppu::WeakImplHelper2<
205 com::sun::star::sheet::XRecentFunctions,
206 com::sun::star::lang::XServiceInfo>
208 public:
209 ScRecentFunctionsObj();
210 virtual ~ScRecentFunctionsObj();
212 static OUString getImplementationName_Static();
213 static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
215 // XRecentFunctions
216 virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL getRecentFunctionIds()
217 throw(::com::sun::star::uno::RuntimeException);
218 virtual void SAL_CALL setRecentFunctionIds( const ::com::sun::star::uno::Sequence<
219 sal_Int32 >& aRecentFunctionIds )
220 throw(::com::sun::star::uno::RuntimeException);
221 virtual sal_Int32 SAL_CALL getMaxRecentFunctions()
222 throw(::com::sun::star::uno::RuntimeException);
224 // XServiceInfo
225 virtual OUString SAL_CALL getImplementationName()
226 throw(::com::sun::star::uno::RuntimeException);
227 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
228 throw(::com::sun::star::uno::RuntimeException);
229 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
230 throw(::com::sun::star::uno::RuntimeException);
234 class ScFunctionListObj : public cppu::WeakImplHelper4<
235 com::sun::star::sheet::XFunctionDescriptions,
236 com::sun::star::container::XEnumerationAccess,
237 com::sun::star::container::XNameAccess,
238 com::sun::star::lang::XServiceInfo>
240 public:
241 ScFunctionListObj();
242 virtual ~ScFunctionListObj();
244 static OUString getImplementationName_Static();
245 static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static();
247 // XFunctionDescriptions
248 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
249 getById( sal_Int32 nId )
250 throw(::com::sun::star::lang::IllegalArgumentException,
251 ::com::sun::star::uno::RuntimeException);
253 // XNameAccess
254 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const OUString& aName )
255 throw(::com::sun::star::container::NoSuchElementException,
256 ::com::sun::star::lang::WrappedTargetException,
257 ::com::sun::star::uno::RuntimeException);
258 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getElementNames()
259 throw(::com::sun::star::uno::RuntimeException);
260 virtual sal_Bool SAL_CALL hasByName( const OUString& aName )
261 throw(::com::sun::star::uno::RuntimeException);
263 // XIndexAccess
264 virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException);
265 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index )
266 throw(::com::sun::star::lang::IndexOutOfBoundsException,
267 ::com::sun::star::lang::WrappedTargetException,
268 ::com::sun::star::uno::RuntimeException);
270 // XEnumerationAccess
271 virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL
272 createEnumeration() throw(::com::sun::star::uno::RuntimeException);
274 // XElementAccess
275 virtual ::com::sun::star::uno::Type SAL_CALL getElementType()
276 throw(::com::sun::star::uno::RuntimeException);
277 virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException);
279 // XServiceInfo
280 virtual OUString SAL_CALL getImplementationName()
281 throw(::com::sun::star::uno::RuntimeException);
282 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
283 throw(::com::sun::star::uno::RuntimeException);
284 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
285 throw(::com::sun::star::uno::RuntimeException);
290 #endif
292 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */