xref: /AOO41X/main/sc/source/ui/inc/simpref.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_SIMPREF_HXX
25 #define SC_SIMPREF_HXX
26 
27 #ifndef _GROUP_HXX //autogen
28 #include <vcl/group.hxx>
29 #endif
30 
31 #ifndef _COMBOBOX_HXX //autogen
32 #include <vcl/combobox.hxx>
33 #endif
34 
35 #ifndef _FIXED_HXX //autogen
36 #include <vcl/fixed.hxx>
37 #endif
38 
39 #ifndef _MOREBTN_HXX //autogen
40 #include <vcl/morebtn.hxx>
41 #endif
42 #include "anyrefdg.hxx"
43 #include "dbcolect.hxx"
44 #include "expftext.hxx"
45 
46 class ScViewData;
47 class ScDocument;
48 
49 
50 //============================================================================
51 
52 class ScSimpleRefDlg: public ScAnyRefDlg
53 {
54 private:
55     Link            aCloseHdl;
56     Link            aDoneHdl;
57     Link            aAbortedHdl;
58     Link            aChangeHdl;
59 
60     FixedText       aFtAssign;
61     formula::RefEdit        aEdAssign;
62     formula::RefButton      aRbAssign;
63 
64     OKButton        aBtnOk;
65     CancelButton    aBtnCancel;
66     HelpButton      aBtnHelp;
67 
68     ScViewData*     pViewData;
69     ScDocument*     pDoc;
70     sal_Bool            bRefInputMode;
71 
72     ScRange         theCurArea;
73     sal_Bool            bCloseFlag;
74     sal_Bool            bAutoReOpen;
75     sal_Bool            bCloseOnButtonUp;
76     sal_Bool            bSingleCell;
77     sal_Bool            bMultiSelection;
78 
79     void            Init();
80 
81     DECL_LINK( CancelBtnHdl, void * );
82     DECL_LINK( OkBtnHdl, void * );
83 
84 
85 protected:
86 
87     virtual void    RefInputDone( sal_Bool bForced = sal_False );
88 
89 public:
90                     ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
91                                  ScViewData*    ptrViewData );
92                     ~ScSimpleRefDlg();
93 
94     virtual void    SetReference( const ScRange& rRef, ScDocument* pDoc );
95 
96     virtual sal_Bool    IsRefInputMode() const;
97     virtual void    SetActive();
98     virtual sal_Bool    Close();
99 
100     void            StartRefInput();
101 
102     virtual String  GetRefString() const;
103     virtual void    SetRefString(const String &rStr);
104     virtual void    FillInfo(SfxChildWinInfo&) const;
105 
106     void            SetCloseHdl( const Link& rLink );
107     void            SetUnoLinks( const Link& rDone, const Link& rAbort,
108                                 const Link& rChange );
109 
110     void            SetFlags( sal_Bool bSetCloseOnButtonUp, sal_Bool bSetSingleCell, sal_Bool bSetMultiSelection );
111 
SetAutoReOpen(sal_Bool bFlag)112     void            SetAutoReOpen(sal_Bool bFlag) {bAutoReOpen=bFlag;}
113 };
114 
115 
116 
117 #endif // SC_DBNAMDLG_HXX
118 
119