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/.
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_NAMEDLG_HXX
21 #define SC_NAMEDLG_HXX
23 #include <vcl/morebtn.hxx>
24 #include <vcl/combobox.hxx>
25 #include <vcl/group.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/lstbox.hxx>
29 #include "rangenam.hxx"
30 #include "anyrefdg.hxx"
31 #include "namemgrtable.hxx"
33 #include <boost/ptr_container/ptr_map.hpp>
34 #include <boost/ptr_container/ptr_set.hpp>
43 //==================================================================
45 //logic behind the manage names dialog
46 class ScNameDlg
: public ScAnyRefDlg
50 formula::RefEdit
* m_pEdAssign
;
51 formula::RefButton
* m_pRbAssign
;
54 CheckBox
* m_pBtnPrintArea
;
55 CheckBox
* m_pBtnColHeader
;
56 CheckBox
* m_pBtnCriteria
;
57 CheckBox
* m_pBtnRowHeader
;
59 PushButton
* m_pBtnAdd
;
60 PushButton
* m_pBtnDelete
;
62 PushButton
* m_pBtnCancel
;
66 ScRangeManagerTable
* m_pRangeManagerTable
;
68 const OUString maGlobalNameStr
;
69 const OUString maErrInvalidNameStr
;
70 const OUString maErrNameInUse
;
71 const OUString maStrMultiSelect
;
72 OUString maStrInfoDefault
;
74 ScViewData
* mpViewData
;
76 const ScAddress maCursorPos
;
81 //ugly hack to call DefineNames from ManageNames
82 bool mbCloseWithoutUndo
;
84 typedef boost::ptr_map
<OUString
, ScRangeName
> RangeNameContainer
;
86 RangeNameContainer maRangeMap
;
90 void UpdateChecks(ScRangeData
* pData
);
91 void ShowOptions(const ScRangeNameLine
& rLine
);
95 bool IsFormulaValid();
96 void CheckForEmptyTable();
98 ScRangeName
* GetRangeName(const OUString
& rScope
);
108 void SelectionChanged();
111 DECL_LINK( OkBtnHdl
, void * );
112 DECL_LINK( CancelBtnHdl
, void * );
113 DECL_LINK( AddBtnHdl
, void * );
114 DECL_LINK( RemoveBtnHdl
, void * );
115 DECL_LINK( SelectBtnHdl
, void * );
116 DECL_LINK( EdModifyHdl
, void * );
117 DECL_LINK( AssignGetFocusHdl
, void * );
118 DECL_LINK( SelectionChangedHdl_Impl
, void* );
119 DECL_LINK( ScopeChangedHdl
, void* );
122 virtual void RefInputDone( sal_Bool bForced
= sal_False
);
125 ScNameDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
, Window
* pParent
,
126 ScViewData
* ptrViewData
,
127 const ScAddress
& aCursorPos
, boost::ptr_map
<OUString
, ScRangeName
>* pRangeMap
= NULL
);
128 virtual ~ScNameDlg();
130 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pDoc
);
131 virtual sal_Bool
IsRefInputMode() const;
133 virtual void SetActive();
134 virtual sal_Bool
Close();
136 void GetRangeNames(boost::ptr_map
<OUString
, ScRangeName
>& rRangeMap
);
137 void SetEntry(const OUString
& rName
, const OUString
& rScope
);
143 #endif // SC_NAMEDLG_HXX
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */