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