xref: /trunk/main/sc/source/ui/inc/simpref.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SC_SIMPREF_HXX
29 #define SC_SIMPREF_HXX
30 
31 #ifndef _GROUP_HXX //autogen
32 #include <vcl/group.hxx>
33 #endif
34 
35 #ifndef _COMBOBOX_HXX //autogen
36 #include <vcl/combobox.hxx>
37 #endif
38 
39 #ifndef _FIXED_HXX //autogen
40 #include <vcl/fixed.hxx>
41 #endif
42 
43 #ifndef _MOREBTN_HXX //autogen
44 #include <vcl/morebtn.hxx>
45 #endif
46 #include "anyrefdg.hxx"
47 #include "dbcolect.hxx"
48 #include "expftext.hxx"
49 
50 class ScViewData;
51 class ScDocument;
52 
53 
54 //============================================================================
55 
56 class ScSimpleRefDlg: public ScAnyRefDlg
57 {
58 private:
59     Link            aCloseHdl;
60     Link            aDoneHdl;
61     Link            aAbortedHdl;
62     Link            aChangeHdl;
63 
64     FixedText       aFtAssign;
65     formula::RefEdit        aEdAssign;
66     formula::RefButton      aRbAssign;
67 
68     OKButton        aBtnOk;
69     CancelButton    aBtnCancel;
70     HelpButton      aBtnHelp;
71 
72     ScViewData*     pViewData;
73     ScDocument*     pDoc;
74     sal_Bool            bRefInputMode;
75 
76     ScRange         theCurArea;
77     sal_Bool            bCloseFlag;
78     sal_Bool            bAutoReOpen;
79     sal_Bool            bCloseOnButtonUp;
80     sal_Bool            bSingleCell;
81     sal_Bool            bMultiSelection;
82 
83     void            Init();
84 
85     DECL_LINK( CancelBtnHdl, void * );
86     DECL_LINK( OkBtnHdl, void * );
87 
88 
89 protected:
90 
91     virtual void    RefInputDone( sal_Bool bForced = sal_False );
92 
93 public:
94                     ScSimpleRefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
95                                  ScViewData*    ptrViewData );
96                     ~ScSimpleRefDlg();
97 
98     virtual void    SetReference( const ScRange& rRef, ScDocument* pDoc );
99 
100     virtual sal_Bool    IsRefInputMode() const;
101     virtual void    SetActive();
102     virtual sal_Bool    Close();
103 
104     void            StartRefInput();
105 
106     virtual String  GetRefString() const;
107     virtual void    SetRefString(const String &rStr);
108     virtual void    FillInfo(SfxChildWinInfo&) const;
109 
110     void            SetCloseHdl( const Link& rLink );
111     void            SetUnoLinks( const Link& rDone, const Link& rAbort,
112                                 const Link& rChange );
113 
114     void            SetFlags( sal_Bool bSetCloseOnButtonUp, sal_Bool bSetSingleCell, sal_Bool bSetMultiSelection );
115 
116     void            SetAutoReOpen(sal_Bool bFlag) {bAutoReOpen=bFlag;}
117 };
118 
119 
120 
121 #endif // SC_DBNAMDLG_HXX
122 
123