update dev300-m58
[ooovba.git] / sc / source / ui / inc / crnrdlg.hxx
blob825e90d90ce51a05a0459d3534c34aeedceb6a7d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: crnrdlg.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_CRNRDLG_HXX
32 #define SC_CRNRDLG_HXX
34 #include "anyrefdg.hxx"
35 #include "rangelst.hxx"
36 #include <vcl/fixed.hxx>
37 #include <vcl/lstbox.hxx>
39 #include <hash_map>
41 class ScViewData;
42 class ScDocument;
45 //============================================================================
47 class ScColRowNameRangesDlg : public ScAnyRefDlg
49 public:
50 ScColRowNameRangesDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
51 ScViewData* ptrViewData );
52 ~ScColRowNameRangesDlg();
54 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
56 virtual BOOL IsRefInputMode() const;
57 virtual void SetActive();
58 virtual BOOL Close();
60 private:
61 FixedLine aFlAssign;
62 ListBox aLbRange;
64 formula::RefEdit aEdAssign;
65 formula::RefButton aRbAssign;
66 RadioButton aBtnColHead;
67 RadioButton aBtnRowHead;
68 FixedText aFtAssign2;
69 formula::RefEdit aEdAssign2;
70 formula::RefButton aRbAssign2;
72 OKButton aBtnOk;
73 CancelButton aBtnCancel;
74 HelpButton aBtnHelp;
75 PushButton aBtnAdd;
76 PushButton aBtnRemove;
78 ScRange theCurArea;
79 ScRange theCurData;
81 ScRangePairListRef xColNameRanges;
82 ScRangePairListRef xRowNameRanges;
84 typedef ::std::hash_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap;
85 NameRangeMap aRangeMap;
86 ScViewData* pViewData;
87 ScDocument* pDoc;
88 formula::RefEdit* pEdActive;
89 BOOL bDlgLostFocus;
91 #ifdef _CRNRDLG_CXX
92 private:
93 void Init ();
94 void UpdateNames ();
95 void UpdateRangeData ( const ScRange& rRange, BOOL bColName );
96 void SetColRowData( const ScRange& rLabelRange,BOOL bRef=FALSE);
97 void AdjustColRowData( const ScRange& rDataRange,BOOL bRef=FALSE);
98 DECL_LINK( CancelBtnHdl, void * );
99 DECL_LINK( OkBtnHdl, void * );
100 DECL_LINK( AddBtnHdl, void * );
101 DECL_LINK( RemoveBtnHdl, void * );
102 DECL_LINK( Range1SelectHdl, void * );
103 DECL_LINK( Range1DataModifyHdl, void * );
104 DECL_LINK( ColClickHdl, void * );
105 DECL_LINK( RowClickHdl, void * );
106 DECL_LINK( Range2DataModifyHdl, void * );
107 DECL_LINK( GetFocusHdl, Control* );
108 DECL_LINK( LoseFocusHdl, Control* );
109 #endif
114 #endif // SC_CRNRDLG_HXX