fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / inc / namedlg.hxx
blobcad2f9d8d36490a1d0319955f56c8f44534993e8
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_SOURCE_UI_INC_NAMEDLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_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>
36 #include <stack>
37 #include <map>
39 class ScViewData;
40 class ScDocument;
42 //logic behind the manage names dialog
43 class ScNameDlg : public ScAnyRefDlg, public ScRangeManagerTable::InitListener
45 private:
46 VclPtr<Edit> m_pEdName;
47 VclPtr<formula::RefEdit> m_pEdAssign;
48 VclPtr<formula::RefButton> m_pRbAssign;
49 VclPtr<ListBox> m_pLbScope;
51 VclPtr<CheckBox> m_pBtnPrintArea;
52 VclPtr<CheckBox> m_pBtnColHeader;
53 VclPtr<CheckBox> m_pBtnCriteria;
54 VclPtr<CheckBox> m_pBtnRowHeader;
56 VclPtr<PushButton> m_pBtnAdd;
57 VclPtr<PushButton> m_pBtnDelete;
58 VclPtr<PushButton> m_pBtnOk;
59 VclPtr<PushButton> m_pBtnCancel;
61 VclPtr<FixedText> m_pFtInfo;
63 VclPtr<ScRangeManagerTable> m_pRangeManagerTable;
65 const OUString maGlobalNameStr;
66 const OUString maErrInvalidNameStr;
67 const OUString maErrNameInUse;
68 const OUString maStrMultiSelect;
69 OUString maStrInfoDefault;
71 ScViewData* mpViewData;
72 ScDocument* mpDoc;
73 const ScAddress maCursorPos;
74 Selection maCurSel;
76 bool mbNeedUpdate;
77 bool mbDataChanged;
78 //ugly hack to call DefineNames from ManageNames
79 bool mbCloseWithoutUndo;
81 typedef boost::ptr_map<OUString, ScRangeName> RangeNameContainer;
83 RangeNameContainer maRangeMap;
85 private:
86 void Init();
87 void UpdateChecks(ScRangeData* pData);
88 void ShowOptions(const ScRangeNameLine& rLine);
89 void UpdateNames();
91 bool IsNameValid();
92 bool IsFormulaValid();
93 void CheckForEmptyTable();
95 ScRangeName* GetRangeName(const OUString& rScope);
97 bool AddPushed();
98 void RemovePushed();
99 void OKPushed();
100 void CancelPushed();
101 void NameSelected();
102 void ScopeChanged();
103 void NameModified();
105 void SelectionChanged();
107 // Handler:
108 DECL_LINK( OkBtnHdl, void * );
109 DECL_LINK( CancelBtnHdl, void * );
110 DECL_LINK( AddBtnHdl, void * );
111 DECL_LINK( RemoveBtnHdl, void * );
112 DECL_LINK( SelectBtnHdl, void * );
113 DECL_LINK( EdModifyHdl, void * );
114 DECL_LINK( AssignGetFocusHdl, void * );
115 DECL_LINK( SelectionChangedHdl_Impl, void* );
116 DECL_LINK( ScopeChangedHdl, void* );
118 protected:
119 virtual void RefInputDone( bool bForced = false ) SAL_OVERRIDE;
121 public:
122 ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
123 ScViewData* ptrViewData,
124 const ScAddress& aCursorPos, boost::ptr_map<OUString, ScRangeName>* pRangeMap = NULL );
125 virtual ~ScNameDlg();
126 virtual void dispose() SAL_OVERRIDE;
128 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) SAL_OVERRIDE;
129 virtual bool IsRefInputMode() const SAL_OVERRIDE;
131 virtual void SetActive() SAL_OVERRIDE;
132 virtual bool Close() SAL_OVERRIDE;
134 virtual void tableInitialized() SAL_OVERRIDE;
136 void GetRangeNames(boost::ptr_map<OUString, ScRangeName>& rRangeMap);
137 void SetEntry(const OUString& rName, const OUString& rScope);
140 #endif // INCLUDED_SC_SOURCE_UI_INC_NAMEDLG_HXX
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */