Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : */
9 :
10 : #include "anyrefdg.hxx"
11 : #include <vcl/button.hxx>
12 : #include <vcl/fixed.hxx>
13 : #include <vcl/edit.hxx>
14 : #include <vcl/lstbox.hxx>
15 :
16 : #include <map>
17 :
18 : class ScRangeName;
19 : class ScDocument;
20 : class ScDocShell;
21 : class ScViewData;
22 :
23 : class ScNameDefDlg : public ScAnyRefDlg
24 : {
25 : private:
26 : Edit* m_pEdName;
27 :
28 : formula::RefEdit* m_pEdRange;
29 : formula::RefButton* m_pRbRange;
30 :
31 : ListBox* m_pLbScope;
32 :
33 : CheckBox* m_pBtnRowHeader;
34 : CheckBox* m_pBtnColHeader;
35 : CheckBox* m_pBtnPrintArea;
36 : CheckBox* m_pBtnCriteria;
37 :
38 : PushButton* m_pBtnAdd;
39 : PushButton* m_pBtnCancel;
40 : FixedText* m_pFtInfo;
41 :
42 : bool mbUndo; //if true we need to add an undo action after creating a range name
43 : ScDocument* mpDoc;
44 : ScDocShell* mpDocShell;
45 :
46 : ScAddress maCursorPos;
47 : OUString maStrInfoDefault;
48 : const OUString maGlobalNameStr;
49 : const OUString maErrInvalidNameStr;
50 : const OUString maErrNameInUse;
51 :
52 : //hack to call this dialog from Manage Names
53 : OUString maName;
54 : OUString maScope;
55 :
56 : std::map<OUString, ScRangeName*> maRangeMap;
57 :
58 : void CancelPushed();
59 : void AddPushed();
60 :
61 : bool IsNameValid();
62 : bool IsFormulaValid();
63 :
64 : DECL_LINK( CancelBtnHdl, void * );
65 : DECL_LINK( AddBtnHdl, void* );
66 : DECL_LINK( NameModifyHdl, void* );
67 : DECL_LINK( AssignGetFocusHdl, void * );
68 :
69 : protected:
70 : virtual void RefInputDone( sal_Bool bForced = sal_False );
71 :
72 : public:
73 : ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
74 : ScViewData* pViewData, std::map<OUString, ScRangeName*> aRangeMap,
75 : const ScAddress& aCursorPos, const bool bUndo);
76 :
77 0 : virtual ~ScNameDefDlg() {};
78 :
79 : virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
80 : virtual sal_Bool IsRefInputMode() const;
81 :
82 : virtual void SetActive();
83 : virtual sal_Bool Close();
84 :
85 : void GetNewData( OUString& rName, OUString& rScope );
86 : };
87 :
88 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|