1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_SC_SOURCE_UI_INC_NAMEMGRTABLE_HXX
11 #define INCLUDED_SC_SOURCE_UI_INC_NAMEMGRTABLE_HXX
13 #include <svtools/simptabl.hxx>
14 #include <vcl/ctrl.hxx>
16 #include "scresid.hxx"
17 #include "address.hxx"
20 #include <boost/ptr_container/ptr_map.hpp>
25 struct ScRangeNameLine
32 //Implements the table for the manage names dialog
33 //TODO: cache the lines for performance improvements
34 //otherwise handling of a large set of range names might get extremely slow
35 //Need some sort of a filter to handle several range names
36 class SC_DLLPUBLIC ScRangeManagerTable
: public SvSimpleTable
42 virtual ~InitListener();
43 virtual void tableInitialized() = 0;
47 OUString maGlobalString
;
49 // should be const because we should not modify it here
50 const boost::ptr_map
<OUString
, ScRangeName
>& mrRangeMap
;
51 // for performance, save which entries already have the formula entry
52 // otherwise opening the dialog with a lot of range names is extremelly slow because
53 // we would calculate all formula strings during opening
54 std::map
<SvTreeListEntry
*, bool> maCalculatedFormulaEntries
;
55 const ScAddress maPos
;
57 InitListener
* mpInitListener
;
59 static void GetLine(ScRangeNameLine
& aLine
, SvTreeListEntry
* pEntry
);
61 void CheckForFormulaString();
62 const ScRangeData
* findRangeData(const ScRangeNameLine
& rLine
);
67 ScRangeManagerTable( SvSimpleTableContainer
& rParent
, boost::ptr_map
<OUString
, ScRangeName
>& aTabRangeNames
, const ScAddress
& rPos
);
68 virtual ~ScRangeManagerTable();
69 virtual void dispose() SAL_OVERRIDE
;
71 virtual void Resize() SAL_OVERRIDE
;
72 virtual void StateChanged( StateChangedType nStateChange
) SAL_OVERRIDE
;
74 void setInitListener( InitListener
* pListener
);
76 void addEntry( const ScRangeNameLine
& rLine
, bool bSetCurEntry
= true );
77 void DeleteSelectedEntries();
78 void SetEntry( const ScRangeNameLine
& rLine
);
80 void GetCurrentLine(ScRangeNameLine
& rLine
);
81 bool IsMultiSelection();
82 std::vector
<ScRangeNameLine
> GetSelectedEntries();
84 DECL_LINK( ScrollHdl
, void*);
85 DECL_LINK( HeaderEndDragHdl
, void*);
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */