nameuno.hxx (38d50f7b) nameuno.hxx (dffa72de)
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

--- 30 unchanged lines hidden (view full) ---

39#include <com/sun/star/lang/XUnoTunnel.hpp>
40#include <com/sun/star/beans/XPropertySet.hpp>
41#include <com/sun/star/document/XActionLockable.hpp>
42#include <cppuhelper/implbase2.hxx>
43#include <cppuhelper/implbase3.hxx>
44#include <cppuhelper/implbase5.hxx>
45#include <cppuhelper/implbase6.hxx>
46
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

--- 30 unchanged lines hidden (view full) ---

39#include <com/sun/star/lang/XUnoTunnel.hpp>
40#include <com/sun/star/beans/XPropertySet.hpp>
41#include <com/sun/star/document/XActionLockable.hpp>
42#include <cppuhelper/implbase2.hxx>
43#include <cppuhelper/implbase3.hxx>
44#include <cppuhelper/implbase5.hxx>
45#include <cppuhelper/implbase6.hxx>
46
47#include <global.hxx> //for EMPTY_STRING
48
47class ScDocShell;
48class ScRangeData;
49class ScTokenArray;
50
51
52class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
53 ::com::sun::star::sheet::XNamedRange,
54 ::com::sun::star::sheet::XFormulaTokens,
55 ::com::sun::star::sheet::XCellRangeReferrer,
56 ::com::sun::star::beans::XPropertySet,
57 ::com::sun::star::lang::XUnoTunnel,
58 ::com::sun::star::lang::XServiceInfo >,
59 public SfxListener
60{
61private:
62 ScDocShell* pDocShell;
63 String aName;
49class ScDocShell;
50class ScRangeData;
51class ScTokenArray;
52
53
54class ScNamedRangeObj : public ::cppu::WeakImplHelper6<
55 ::com::sun::star::sheet::XNamedRange,
56 ::com::sun::star::sheet::XFormulaTokens,
57 ::com::sun::star::sheet::XCellRangeReferrer,
58 ::com::sun::star::beans::XPropertySet,
59 ::com::sun::star::lang::XUnoTunnel,
60 ::com::sun::star::lang::XServiceInfo >,
61 public SfxListener
62{
63private:
64 ScDocShell* pDocShell;
65 String aName;
66 String aScopeName;
64
65private:
66 ScRangeData* GetRangeData_Impl();
67 void Modify_Impl( const String* pNewName,
68 const ScTokenArray* pNewTokens, const String* pNewContent,
69 const ScAddress* pNewPos, const sal_uInt16* pNewType,
67
68private:
69 ScRangeData* GetRangeData_Impl();
70 void Modify_Impl( const String* pNewName,
71 const ScTokenArray* pNewTokens, const String* pNewContent,
72 const ScAddress* pNewPos, const sal_uInt16* pNewType,
70 const formula::FormulaGrammar::Grammar eGrammar );
73 const formula::FormulaGrammar::Grammar eGrammar, const String* pNewScopeName = NULL );
71
72public:
74
75public:
73 ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm);
76 ScNamedRangeObj(ScDocShell* pDocSh, const String& rNm, const String& rScopeName = EMPTY_STRING);
74 virtual ~ScNamedRangeObj();
75
76 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
77
78 // XNamedRange
79 virtual ::rtl::OUString SAL_CALL getContent() throw(::com::sun::star::uno::RuntimeException);
80 virtual void SAL_CALL setContent( const ::rtl::OUString& aContent )
81 throw(::com::sun::star::uno::RuntimeException);
82 virtual ::com::sun::star::table::CellAddress SAL_CALL getReferencePosition()
83 throw(::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL setReferencePosition(
85 const ::com::sun::star::table::CellAddress& aReferencePosition )
86 throw(::com::sun::star::uno::RuntimeException);
87 virtual sal_Int32 SAL_CALL getType() throw(::com::sun::star::uno::RuntimeException);
88 virtual void SAL_CALL setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException);
77 virtual ~ScNamedRangeObj();
78
79 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
80
81 // XNamedRange
82 virtual ::rtl::OUString SAL_CALL getContent() throw(::com::sun::star::uno::RuntimeException);
83 virtual void SAL_CALL setContent( const ::rtl::OUString& aContent )
84 throw(::com::sun::star::uno::RuntimeException);
85 virtual ::com::sun::star::table::CellAddress SAL_CALL getReferencePosition()
86 throw(::com::sun::star::uno::RuntimeException);
87 virtual void SAL_CALL setReferencePosition(
88 const ::com::sun::star::table::CellAddress& aReferencePosition )
89 throw(::com::sun::star::uno::RuntimeException);
90 virtual sal_Int32 SAL_CALL getType() throw(::com::sun::star::uno::RuntimeException);
91 virtual void SAL_CALL setType( sal_Int32 nType ) throw(::com::sun::star::uno::RuntimeException);
92 virtual ::rtl::OUString SAL_CALL getScopeName() throw(::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL setScopeAndRangeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName ) throw(::com::sun::star::uno::RuntimeException);
89
90 // XFormulaTokens
91 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens()
92 throw (::com::sun::star::uno::RuntimeException);
93 virtual void SAL_CALL setTokens( const ::com::sun::star::uno::Sequence<
94 ::com::sun::star::sheet::FormulaToken >& aTokens )
95 throw (::com::sun::star::uno::RuntimeException);
96

--- 79 unchanged lines hidden (view full) ---

176 ::com::sun::star::lang::XServiceInfo >,
177 public SfxListener
178{
179private:
180 ScDocShell* pDocShell;
181
182 ScNamedRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
183 ScNamedRangeObj* GetObjectByName_Impl(const ::rtl::OUString& aName);
94
95 // XFormulaTokens
96 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL getTokens()
97 throw (::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL setTokens( const ::com::sun::star::uno::Sequence<
99 ::com::sun::star::sheet::FormulaToken >& aTokens )
100 throw (::com::sun::star::uno::RuntimeException);
101

--- 79 unchanged lines hidden (view full) ---

181 ::com::sun::star::lang::XServiceInfo >,
182 public SfxListener
183{
184private:
185 ScDocShell* pDocShell;
186
187 ScNamedRangeObj* GetObjectByIndex_Impl(sal_uInt16 nIndex);
188 ScNamedRangeObj* GetObjectByName_Impl(const ::rtl::OUString& aName);
189 ScNamedRangeObj* GetObjectByScopeName_Impl(const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName);
184
190
191 void ImplAddNewByScopeAndName(SCTAB aScope,const ::rtl::OUString& aRangeName, const ::rtl::OUString& aContent,
192 const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType)
193 throw(::com::sun::star::uno::RuntimeException);
194
195 void ImplRemoveByScopeAndName(SCTAB aScope,const ::rtl::OUString& aRangeName)
196 throw(::com::sun::star::uno::RuntimeException);
197
185protected:
186 /** called from the XActionLockable interface methods on initial locking */
187 virtual void lock();
188
189 /** called from the XActionLockable interface methods on final unlock */
190 virtual void unlock();
191
192public:
193 ScNamedRangesObj(ScDocShell* pDocSh);
194 virtual ~ScNamedRangesObj();
195
196 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
197
198 // XNamedRanges
199 virtual void SAL_CALL addNewByName( const ::rtl::OUString& aName, const ::rtl::OUString& aContent,
200 const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType )
201 throw(::com::sun::star::uno::RuntimeException);
198protected:
199 /** called from the XActionLockable interface methods on initial locking */
200 virtual void lock();
201
202 /** called from the XActionLockable interface methods on final unlock */
203 virtual void unlock();
204
205public:
206 ScNamedRangesObj(ScDocShell* pDocSh);
207 virtual ~ScNamedRangesObj();
208
209 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
210
211 // XNamedRanges
212 virtual void SAL_CALL addNewByName( const ::rtl::OUString& aName, const ::rtl::OUString& aContent,
213 const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType )
214 throw(::com::sun::star::uno::RuntimeException);
215
216 virtual void SAL_CALL addNewByScopeName( const ::rtl::OUString& aScopeName,const ::rtl::OUString& aRangeName, const ::rtl::OUString& aContent,
217 const ::com::sun::star::table::CellAddress& aPosition, sal_Int32 nType )
218 throw(::com::sun::star::uno::RuntimeException);
202 virtual void SAL_CALL addNewFromTitles( const ::com::sun::star::table::CellRangeAddress& aSource,
203 ::com::sun::star::sheet::Border aBorder )
204 throw(::com::sun::star::uno::RuntimeException);
205 virtual void SAL_CALL removeByName( const ::rtl::OUString& aName )
206 throw(::com::sun::star::uno::RuntimeException);
219 virtual void SAL_CALL addNewFromTitles( const ::com::sun::star::table::CellRangeAddress& aSource,
220 ::com::sun::star::sheet::Border aBorder )
221 throw(::com::sun::star::uno::RuntimeException);
222 virtual void SAL_CALL removeByName( const ::rtl::OUString& aName )
223 throw(::com::sun::star::uno::RuntimeException);
224 virtual void SAL_CALL removeByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName )
225 throw(::com::sun::star::uno::RuntimeException);
207 virtual void SAL_CALL outputList( const ::com::sun::star::table::CellAddress& aOutputPosition )
208 throw(::com::sun::star::uno::RuntimeException);
226 virtual void SAL_CALL outputList( const ::com::sun::star::table::CellAddress& aOutputPosition )
227 throw(::com::sun::star::uno::RuntimeException);
228 virtual sal_Bool SAL_CALL hasByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName )
229 throw(::com::sun::star::uno::RuntimeException);
230 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::RangeScopeName > SAL_CALL getElementScopeNames()
231 throw(::com::sun::star::uno::RuntimeException);
232 virtual ::com::sun::star::uno::Any SAL_CALL getByScopeName( const ::rtl::OUString& aScopeName, const ::rtl::OUString& aRangeName )
233 throw(::com::sun::star::container::NoSuchElementException,
234 ::com::sun::star::lang::WrappedTargetException,
235 ::com::sun::star::uno::RuntimeException);
209
210 // XNameAccess
211 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
212 throw(::com::sun::star::container::NoSuchElementException,
213 ::com::sun::star::lang::WrappedTargetException,
214 ::com::sun::star::uno::RuntimeException);
215 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
216 throw(::com::sun::star::uno::RuntimeException);

--- 131 unchanged lines hidden ---
236
237 // XNameAccess
238 virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName )
239 throw(::com::sun::star::container::NoSuchElementException,
240 ::com::sun::star::lang::WrappedTargetException,
241 ::com::sun::star::uno::RuntimeException);
242 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames()
243 throw(::com::sun::star::uno::RuntimeException);

--- 131 unchanged lines hidden ---