xref: /aoo41x/main/sc/source/ui/inc/solvrdlg.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef SC_SOLVRDLG_HXX
25cdf0e10cSrcweir #define SC_SOLVRDLG_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "global.hxx"
28cdf0e10cSrcweir #include "address.hxx"
29cdf0e10cSrcweir #include "anyrefdg.hxx"
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <vcl/fixed.hxx>
33cdf0e10cSrcweir #include <vcl/group.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir //----------------------------------------------------------------------------
36cdf0e10cSrcweir 
37cdf0e10cSrcweir enum ScSolverErr
38cdf0e10cSrcweir 	{
39cdf0e10cSrcweir 		SOLVERR_NOFORMULA,
40cdf0e10cSrcweir 		SOLVERR_INVALID_FORMULA,
41cdf0e10cSrcweir 		SOLVERR_INVALID_VARIABLE,
42cdf0e10cSrcweir 		SOLVERR_INVALID_TARGETVALUE
43cdf0e10cSrcweir 	};
44cdf0e10cSrcweir 
45cdf0e10cSrcweir 
46cdf0e10cSrcweir //============================================================================
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class ScSolverDlg : public ScAnyRefDlg
49cdf0e10cSrcweir {
50cdf0e10cSrcweir public:
51cdf0e10cSrcweir 					ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
52cdf0e10cSrcweir 								 ScDocument* pDocument,
53cdf0e10cSrcweir 								 ScAddress aCursorPos );
54cdf0e10cSrcweir 					~ScSolverDlg();
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 	virtual void	SetReference( const ScRange& rRef, ScDocument* pDoc );
57cdf0e10cSrcweir     virtual sal_Bool    IsRefInputMode() const;
58cdf0e10cSrcweir 	virtual void	SetActive();
59cdf0e10cSrcweir 	virtual sal_Bool	Close();
60cdf0e10cSrcweir 
61cdf0e10cSrcweir private:
62cdf0e10cSrcweir     FixedLine       aFlVariables;
63cdf0e10cSrcweir 	FixedText		aFtFormulaCell;
64cdf0e10cSrcweir     formula::RefEdit		aEdFormulaCell;
65cdf0e10cSrcweir 	formula::RefButton		aRBFormulaCell;
66cdf0e10cSrcweir 
67cdf0e10cSrcweir 	FixedText		aFtTargetVal;
68cdf0e10cSrcweir 	Edit			aEdTargetVal;
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	FixedText		aFtVariableCell;
71cdf0e10cSrcweir 	formula::RefEdit		aEdVariableCell;
72cdf0e10cSrcweir 	formula::RefButton		aRBVariableCell;
73cdf0e10cSrcweir 
74cdf0e10cSrcweir 	OKButton		aBtnOk;
75cdf0e10cSrcweir 	CancelButton	aBtnCancel;
76cdf0e10cSrcweir 	HelpButton		aBtnHelp;
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 	ScAddress		theFormulaCell;
79cdf0e10cSrcweir 	ScAddress		theVariableCell;
80cdf0e10cSrcweir 	String			theTargetValStr;
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 	ScDocument*		pDoc;
83cdf0e10cSrcweir 	const SCTAB	    nCurTab;
84cdf0e10cSrcweir     formula::RefEdit*		pEdActive;
85cdf0e10cSrcweir 	sal_Bool			bDlgLostFocus;
86cdf0e10cSrcweir 	const String	errMsgInvalidVar;
87cdf0e10cSrcweir 	const String	errMsgInvalidForm;
88cdf0e10cSrcweir 	const String	errMsgNoFormula;
89cdf0e10cSrcweir 	const String	errMsgInvalidVal;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir 
92cdf0e10cSrcweir #ifdef _SOLVRDLG_CXX
93cdf0e10cSrcweir 	void	Init();
94cdf0e10cSrcweir 	sal_Bool	CheckTargetValue( String& rStrVal );
95cdf0e10cSrcweir 	void	RaiseError( ScSolverErr eError );
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	DECL_LINK( BtnHdl, PushButton* );
98cdf0e10cSrcweir     DECL_LINK( GetFocusHdl, Control* );
99cdf0e10cSrcweir     DECL_LINK( LoseFocusHdl, Control* );
100cdf0e10cSrcweir #endif	// _SOLVERDLG_CXX
101cdf0e10cSrcweir };
102cdf0e10cSrcweir 
103cdf0e10cSrcweir #endif // SC_SOLVRDLG_HXX
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 
106