update dev300-m58
[ooovba.git] / sc / source / ui / inc / solvrdlg.hxx
blob6ed07b87c73f968f4728137b36c2d61e9632eca3
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: solvrdlg.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_SOLVRDLG_HXX
32 #define SC_SOLVRDLG_HXX
34 #include "global.hxx"
35 #include "address.hxx"
36 #include "anyrefdg.hxx"
39 #include <vcl/fixed.hxx>
40 #include <vcl/group.hxx>
42 //----------------------------------------------------------------------------
44 enum ScSolverErr
46 SOLVERR_NOFORMULA,
47 SOLVERR_INVALID_FORMULA,
48 SOLVERR_INVALID_VARIABLE,
49 SOLVERR_INVALID_TARGETVALUE
53 //============================================================================
55 class ScSolverDlg : public ScAnyRefDlg
57 public:
58 ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
59 ScDocument* pDocument,
60 ScAddress aCursorPos );
61 ~ScSolverDlg();
63 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc );
64 virtual BOOL IsRefInputMode() const;
65 virtual void SetActive();
66 virtual BOOL Close();
68 private:
69 FixedLine aFlVariables;
70 FixedText aFtFormulaCell;
71 formula::RefEdit aEdFormulaCell;
72 formula::RefButton aRBFormulaCell;
74 FixedText aFtTargetVal;
75 Edit aEdTargetVal;
77 FixedText aFtVariableCell;
78 formula::RefEdit aEdVariableCell;
79 formula::RefButton aRBVariableCell;
81 OKButton aBtnOk;
82 CancelButton aBtnCancel;
83 HelpButton aBtnHelp;
85 ScAddress theFormulaCell;
86 ScAddress theVariableCell;
87 String theTargetValStr;
89 ScDocument* pDoc;
90 const SCTAB nCurTab;
91 formula::RefEdit* pEdActive;
92 BOOL bDlgLostFocus;
93 const String errMsgInvalidVar;
94 const String errMsgInvalidForm;
95 const String errMsgNoFormula;
96 const String errMsgInvalidVal;
99 #ifdef _SOLVRDLG_CXX
100 void Init();
101 BOOL CheckTargetValue( String& rStrVal );
102 void RaiseError( ScSolverErr eError );
104 DECL_LINK( BtnHdl, PushButton* );
105 DECL_LINK( GetFocusHdl, Control* );
106 DECL_LINK( LoseFocusHdl, Control* );
107 #endif // _SOLVERDLG_CXX
110 #endif // SC_SOLVRDLG_HXX