xref: /AOO41X/main/sc/source/ui/inc/crnrdlg.hxx (revision 38d50f7b14e1cf975d8c6468d9633894cd59b523)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SC_CRNRDLG_HXX
25 #define SC_CRNRDLG_HXX
26 
27 #include "anyrefdg.hxx"
28 #include "rangelst.hxx"
29 #include <vcl/fixed.hxx>
30 #include <vcl/lstbox.hxx>
31 
32 #include <hash_map>
33 
34 class ScViewData;
35 class ScDocument;
36 
37 
38 //============================================================================
39 
40 class ScColRowNameRangesDlg : public ScAnyRefDlg
41 {
42 public:
43                     ScColRowNameRangesDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
44                                  ScViewData*    ptrViewData );
45                     ~ScColRowNameRangesDlg();
46 
47     virtual void    SetReference( const ScRange& rRef, ScDocument* pDoc );
48 
49     virtual sal_Bool    IsRefInputMode() const;
50     virtual void    SetActive();
51     virtual sal_Bool    Close();
52 
53 private:
54     FixedLine       aFlAssign;
55     ListBox         aLbRange;
56 
57     formula::RefEdit        aEdAssign;
58     formula::RefButton      aRbAssign;
59     RadioButton     aBtnColHead;
60     RadioButton     aBtnRowHead;
61     FixedText       aFtAssign2;
62     formula::RefEdit        aEdAssign2;
63     formula::RefButton      aRbAssign2;
64 
65     OKButton        aBtnOk;
66     CancelButton    aBtnCancel;
67     HelpButton      aBtnHelp;
68     PushButton      aBtnAdd;
69     PushButton      aBtnRemove;
70 
71     ScRange         theCurArea;
72     ScRange         theCurData;
73 
74     ScRangePairListRef  xColNameRanges;
75     ScRangePairListRef  xRowNameRanges;
76 
77     typedef ::std::hash_map< String, ScRange, ScStringHashCode, ::std::equal_to<String> > NameRangeMap;
78     NameRangeMap    aRangeMap;
79     ScViewData*     pViewData;
80     ScDocument*     pDoc;
81     formula::RefEdit*       pEdActive;
82     sal_Bool            bDlgLostFocus;
83 
84 #ifdef _CRNRDLG_CXX
85 private:
86     void Init               ();
87     void UpdateNames        ();
88     void UpdateRangeData    ( const ScRange& rRange, sal_Bool bColName );
89     void SetColRowData( const ScRange& rLabelRange,sal_Bool bRef=sal_False);
90     void AdjustColRowData( const ScRange& rDataRange,sal_Bool bRef=sal_False);
91     DECL_LINK( CancelBtnHdl, void * );
92     DECL_LINK( OkBtnHdl, void * );
93     DECL_LINK( AddBtnHdl, void * );
94     DECL_LINK( RemoveBtnHdl, void * );
95     DECL_LINK( Range1SelectHdl, void * );
96     DECL_LINK( Range1DataModifyHdl, void * );
97     DECL_LINK( ColClickHdl, void * );
98     DECL_LINK( RowClickHdl, void * );
99     DECL_LINK( Range2DataModifyHdl, void * );
100     DECL_LINK( GetFocusHdl, Control* );
101     DECL_LINK( LoseFocusHdl, Control* );
102 #endif
103 };
104 
105 
106 
107 #endif // SC_CRNRDLG_HXX
108 
109