xref: /aoo41x/main/sc/source/ui/inc/consdlg.hxx (revision cdf0e10c)
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_CONSDLG_HXX
29 #define SC_CONSDLG_HXX
30 
31 #ifndef _FIXED_HXX //autogen
32 #include <vcl/fixed.hxx>
33 #endif
34 #ifndef _LSTBOX_HXX //autogen
35 #include <vcl/lstbox.hxx>
36 #endif
37 #ifndef _GROUP_HXX //autogen
38 #include <vcl/group.hxx>
39 #endif
40 #ifndef _MOREBTN_HXX //autogen
41 #include <vcl/morebtn.hxx>
42 #endif
43 #include "global.hxx"
44 #include "anyrefdg.hxx"
45 
46 class ScViewData;
47 class ScDocument;
48 class ScRangeUtil;
49 class ScAreaData;
50 
51 
52 //============================================================================
53 
54 class ScConsolidateDlg : public ScAnyRefDlg
55 {
56 public:
57 					ScConsolidateDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
58 									  const SfxItemSet&	rArgSet );
59 					~ScConsolidateDlg();
60 
61 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
62 
63 	virtual sal_Bool	IsRefInputMode() const { return sal_True; }
64 	virtual void	SetActive();
65 
66 	virtual sal_Bool	Close();
67 
68 protected:
69 	virtual void	Deactivate();
70 
71 private:
72 	FixedText		aFtFunc;
73 	ListBox			aLbFunc;
74 
75 	FixedText		aFtConsAreas;
76 	MultiListBox	aLbConsAreas;
77 
78 	ListBox			aLbDataArea;
79 	FixedText		aFtDataArea;
80 	formula::RefEdit		aEdDataArea;
81 	formula::RefButton		aRbDataArea;
82 
83 	ListBox			aLbDestArea;
84 	FixedText		aFtDestArea;
85 	formula::RefEdit		aEdDestArea;
86 	formula::RefButton		aRbDestArea;
87 
88     FixedLine       aFlConsBy;
89 	CheckBox		aBtnByRow;
90 	CheckBox		aBtnByCol;
91 
92     FixedLine       aFlSep;
93     FixedLine       aFlOptions;
94 	CheckBox		aBtnRefs;
95 
96 	OKButton		aBtnOk;
97 	CancelButton	aBtnCancel;
98 	HelpButton		aBtnHelp;
99 	PushButton		aBtnAdd;
100 	PushButton		aBtnRemove;
101 	MoreButton		aBtnMore;
102 
103 	String			aStrUndefined;
104 
105 	ScConsolidateParam	theConsData;
106 	ScViewData*			pViewData;
107 	ScDocument*			pDoc;
108 	ScRangeUtil*		pRangeUtil;
109 	ScAreaData*			pAreaData;
110 	sal_uInt16				nAreaDataCount;
111 	sal_uInt16				nWhichCons;
112 
113 	formula::RefEdit*			pRefInputEdit;
114 	sal_Bool				bDlgLostFocus;
115 
116 #ifdef _CONSDLG_CXX
117 private:
118 	void Init				();
119 	void FillAreaLists		();
120 	sal_Bool VerifyEdit			( formula::RefEdit* pEd );
121 
122 	DECL_LINK( OkHdl,		 void* );
123 	DECL_LINK( ClickHdl,	 PushButton* );
124 	DECL_LINK( GetFocusHdl, Control* );
125 	DECL_LINK( ModifyHdl,	 formula::RefEdit* );
126 	DECL_LINK( SelectHdl,	 ListBox* );
127 
128 	ScSubTotalFunc	LbPosToFunc( sal_uInt16 nPos );
129 	sal_uInt16 			FuncToLbPos( ScSubTotalFunc eFunc );
130 #endif // _CONSDLG_CXX
131 };
132 
133 
134 
135 #endif // SC_CONSDLG_HXX
136 
137