1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 SC_FORMULA_HXX
21 #define SC_FORMULA_HXX
23 #include "anyrefdg.hxx"
25 #include <svtools/stdctrl.hxx>
26 #include <vcl/lstbox.hxx>
27 #include <vcl/group.hxx>
28 #include <svtools/svmedit.hxx>
29 #include <vcl/tabpage.hxx>
31 #include "compiler.hxx"
33 #include "formula/formula.hxx"
34 #include "IAnyRefDialog.hxx"
43 //============================================================================
44 typedef ScTabViewShell
* PtrTabViewShell
;
45 //============================================================================
47 class ScFormulaDlg
: public formula::FormulaDlg
,
50 ScFormulaReferenceHelper m_aHelper
;
51 ::com::sun::star::uno::Reference
< ::com::sun::star::sheet::XFormulaParser
> m_xParser
;
52 ::com::sun::star::uno::Reference
< ::com::sun::star::sheet::XFormulaOpCodeMapper
> m_xOpCodeMapper
;
54 static ScDocument
* pDoc
;
55 static ScAddress aCursorPos
;
57 ScFormulaDlg( SfxBindings
* pB
, SfxChildWindow
* pCW
,
58 Window
* pParent
, ScViewData
* pViewData
,formula::IFunctionManager
* _pFunctionMgr
);
61 // IFormulaEditorHelper
62 virtual void notifyChange();
64 virtual bool calculateValue(const OUString
& _sExpression
, OUString
& _rResult
);
65 virtual void doClose(sal_Bool _bOk
);
66 virtual void insertEntryToLRUList(const formula::IFunctionDescription
* pDesc
);
67 virtual void showReference(const OUString
& _sFormula
);
68 virtual void dispatch(sal_Bool _bOK
,sal_Bool _bMartixChecked
);
69 virtual void setDispatcherLock( sal_Bool bLock
);
70 virtual void setReferenceInput(const formula::FormEditData
* _pData
);
71 virtual void deleteFormData();
73 virtual void switchBack();
74 virtual formula::FormEditData
* getFormEditData() const;
75 virtual void setCurrentFormula(const OUString
& _sReplacement
);
76 virtual void setSelection(xub_StrLen _nStart
,xub_StrLen _nEnd
);
77 virtual void getSelection(xub_StrLen
& _nStart
,xub_StrLen
& _nEnd
) const;
78 virtual OUString
getCurrentFormula() const;
80 virtual formula::IFunctionManager
* getFunctionManager();
81 virtual ::std::auto_ptr
<formula::FormulaTokenArray
> convertToTokenArray(const ::com::sun::star::uno::Sequence
< ::com::sun::star::sheet::FormulaToken
>& _aTokenList
);
82 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sheet::XFormulaParser
> getFormulaParser() const;
83 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sheet::XFormulaOpCodeMapper
> getFormulaOpCodeMapper() const;
84 virtual ::com::sun::star::table::CellAddress
getReferencePosition() const;
86 virtual sal_Bool
Close();
89 virtual void ShowReference(const OUString
& _sRef
);
90 virtual void HideReference( sal_Bool bDoneRefMode
= sal_True
);
91 virtual void SetReference( const ScRange
& rRef
, ScDocument
* pD
);
93 virtual void ReleaseFocus( formula::RefEdit
* pEdit
, formula::RefButton
* pButton
= NULL
);
94 virtual void ToggleCollapsed( formula::RefEdit
* pEdit
, formula::RefButton
* pButton
= NULL
);
95 virtual void RefInputDone( sal_Bool bForced
= false );
96 virtual sal_Bool
IsTableLocked() const;
97 virtual sal_Bool
IsRefInputMode() const;
99 virtual sal_Bool
IsDocAllowed( SfxObjectShell
* pDocSh
) const;
100 virtual void AddRefEntry();
101 virtual void SetActive();
102 virtual void ViewShellChanged();
105 virtual void RefInputStart( formula::RefEdit
* pEdit
, formula::RefButton
* pButton
= NULL
);
106 void SaveLRUEntry(const ScFuncDesc
* pFuncDesc
);
108 sal_Bool
IsInputHdl(ScInputHandler
* pHdl
);
109 ScInputHandler
* GetNextInputHandler(ScDocShell
* pDocShell
,PtrTabViewShell
* ppViewSh
);
114 #endif // SC_CRNRDLG_HXX
116 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */