Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / inc / solvrdlg.hxx
blob58d5cce476e047adbd2d65cb4d0e782c2593e195
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX
21 #define INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX
23 #include "global.hxx"
24 #include "address.hxx"
25 #include "anyrefdg.hxx"
27 #include <vcl/fixed.hxx>
28 #include <vcl/group.hxx>
30 enum ScSolverErr
32 SOLVERR_NOFORMULA,
33 SOLVERR_INVALID_FORMULA,
34 SOLVERR_INVALID_VARIABLE,
35 SOLVERR_INVALID_TARGETVALUE
38 class ScSolverDlg : public ScAnyRefDlg
40 public:
41 ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, vcl::Window* pParent,
42 ScDocument* pDocument,
43 ScAddress aCursorPos );
44 virtual ~ScSolverDlg();
45 virtual void dispose() override;
47 virtual void SetReference( const ScRange& rRef, ScDocument* pDoc ) override;
48 virtual bool IsRefInputMode() const override;
49 virtual void SetActive() override;
50 virtual bool Close() override;
52 private:
53 VclPtr<FixedText> m_pFtFormulaCell;
54 VclPtr<formula::RefEdit> m_pEdFormulaCell;
55 VclPtr<formula::RefButton> m_pRBFormulaCell;
57 VclPtr<Edit> m_pEdTargetVal;
59 VclPtr<FixedText> m_pFtVariableCell;
60 VclPtr<formula::RefEdit> m_pEdVariableCell;
61 VclPtr<formula::RefButton> m_pRBVariableCell;
63 VclPtr<OKButton> m_pBtnOk;
64 VclPtr<CancelButton> m_pBtnCancel;
66 ScAddress theFormulaCell;
67 ScAddress theVariableCell;
68 OUString theTargetValStr;
70 ScDocument* pDoc;
71 const SCTAB nCurTab;
72 VclPtr<formula::RefEdit> pEdActive;
73 bool bDlgLostFocus;
74 const OUString errMsgInvalidVar;
75 const OUString errMsgInvalidForm;
76 const OUString errMsgNoFormula;
77 const OUString errMsgInvalidVal;
79 void Init();
80 bool CheckTargetValue( const OUString& rStrVal );
81 void RaiseError( ScSolverErr eError );
83 DECL_LINK_TYPED( BtnHdl, Button*, void );
84 DECL_LINK_TYPED( GetFocusHdl, Control&, void );
85 DECL_LINK_TYPED( LoseFocusHdl, Control&, void );
88 #endif // INCLUDED_SC_SOURCE_UI_INC_SOLVRDLG_HXX
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */