// CodeGear C++Builder
// Copyright (c) 1995, 2014 by Embarcadero Technologies, Inc.
// All rights reserved

// (DO NOT EDIT: machine generated header) 'XBookInplaceEdit2.pas' rev: 28.00 (Windows)

#ifndef Xbookinplaceedit2HPP
#define Xbookinplaceedit2HPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member 
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.Classes.hpp>	// Pascal unit
#include <System.SysUtils.hpp>	// Pascal unit
#include <Vcl.Controls.hpp>	// Pascal unit
#include <Winapi.Windows.hpp>	// Pascal unit
#include <Winapi.Messages.hpp>	// Pascal unit
#include <Vcl.Graphics.hpp>	// Pascal unit
#include <System.Math.hpp>	// Pascal unit
#include <Xc12Utils5.hpp>	// Pascal unit
#include <Xc12DataStyleSheet5.hpp>	// Pascal unit
#include <Xc12DataSST5.hpp>	// Pascal unit
#include <Xc12Manager5.hpp>	// Pascal unit
#include <Xc12Common5.hpp>	// Pascal unit
#include <XLSUtils5.hpp>	// Pascal unit
#include <XLSMMU5.hpp>	// Pascal unit
#include <XLSCellMMU5.hpp>	// Pascal unit
#include <XLSTools5.hpp>	// Pascal unit
#include <XLSFormulaTypes5.hpp>	// Pascal unit
#include <XLSEncodeFmla5.hpp>	// Pascal unit
#include <XLSDecodeFmla5.hpp>	// Pascal unit
#include <XBookUtils2.hpp>	// Pascal unit
#include <XBook_System_2.hpp>	// Pascal unit
#include <XBookSkin2.hpp>	// Pascal unit
#include <XBookWindows2.hpp>	// Pascal unit
#include <XSSIEDefs.hpp>	// Pascal unit
#include <XSSIEUtils.hpp>	// Pascal unit
#include <XSSIEDocProps.hpp>	// Pascal unit
#include <XSSIELogParas.hpp>	// Pascal unit
#include <XSSIEEditor.hpp>	// Pascal unit
#include <XSSIEKeys.hpp>	// Pascal unit
#include <XSSIECharRun.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Xbookinplaceedit2
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TXBookEditorCloseEvent)(System::TObject* ASender, System::Word AKey);

class DELPHICLASS TXBookIECellAreaHelper;
#pragma pack(push,4)
class PASCALIMPLEMENTATION TXBookIECellAreaHelper : public System::TObject
{
	typedef System::TObject inherited;
	
protected:
	Xssieutils::TAXWEditorArea* FEditorArea;
	int FDispCol;
	int FDispRow;
	Xlsutils5::TDynIntegerArray FDispCols;
	Xlsutils5::TDynIntegerArray FDispRows;
	Xssiedocprops::TAXWPapTextAlign FAlignment;
	int FOrigLeft;
	int FOrigTop;
	
public:
	__fastcall TXBookIECellAreaHelper(Xssieutils::TAXWEditorArea* AEditorArea);
	void __fastcall CalcExpand(const int ATextWidth, const int ATextHeight);
	__property Xssiedocprops::TAXWPapTextAlign Alignment = {read=FAlignment, write=FAlignment, nodefault};
	__property int OrigLeft = {read=FOrigLeft, write=FOrigLeft, nodefault};
	__property int OrigTop = {read=FOrigTop, write=FOrigTop, nodefault};
public:
	/* TObject.Destroy */ inline __fastcall virtual ~TXBookIECellAreaHelper(void) { }
	
};

#pragma pack(pop)

class DELPHICLASS TXBookInplaceEditor;
class PASCALIMPLEMENTATION TXBookInplaceEditor : public Xssieeditor::TAXWWinEditor
{
	typedef Xssieeditor::TAXWWinEditor inherited;
	
private:
	Xlscellmmu5::PXLSCellItem __fastcall GetCell(void);
	Xssieeditor::TAXWTextChangedEvent __fastcall GetTextChangedEvent(void);
	void __fastcall SetTextChangedEvent(const Xssieeditor::TAXWTextChangedEvent Value);
	System::Classes::TNotifyEvent __fastcall GetOnCharFmtChanged(void);
	void __fastcall SetOnCharFmtChanged(const System::Classes::TNotifyEvent Value);
	Xssiedocprops::TAXWCHP* __fastcall GetCHP(void);
	Xssiedocprops::TAXWPAP* __fastcall GetPAP(void);
	
protected:
	bool FIsVisible;
	Xc12manager5::TXc12Manager* FManager;
	TXBookEditorCloseEvent FCloseEvent;
	int FSheetIndex;
	int FCol;
	int FRow;
	Xlscellmmu5::TXLSCellItem FEditCell;
	bool FCRLFMode;
	Xssieutils::TAXWEditorArea* FEditorArea;
	TXBookIECellAreaHelper* FAreaHelper;
	virtual System::UnicodeString __fastcall GetText(void);
	void __fastcall CalcEditorArea(const int AX, const int AY, const bool AWrapText);
	void __fastcall Xc12FontToCHPX(Xc12datastylesheet5::TXc12Font* AFont, Xssiedocprops::TAXWCHPX* ACHPX);
	void __fastcall CHPToXc12Font(Xssiedocprops::TAXWCHP* ACHP, Xc12datastylesheet5::TXc12Font* AFont);
	void __fastcall CHPXToXc12Font(Xssiedocprops::TAXWCHPX* ACHPX, Xc12datastylesheet5::TXc12Font* AFont);
	void __fastcall AddFormatted(const int ASSTIndex, Xc12datastylesheet5::TXc12Font* ADefaultFont);
	void __fastcall DoShow(void);
	void __fastcall EditorBeforePaint(System::TObject* ASender);
	void __fastcall EditorAfterPaint(System::TObject* ASender);
	System::UnicodeString __fastcall PrepareTextBefore(const System::UnicodeString AText);
	System::UnicodeString __fastcall PrepareTextAfter(const System::UnicodeString AText);
	
public:
	__fastcall TXBookInplaceEditor(Xbookwindows2::TXSSWindow* AParent, Xc12manager5::TXc12Manager* AManager);
	__fastcall virtual ~TXBookInplaceEditor(void);
	void __fastcall SetColsRows(const Xlsutils5::TDynIntegerArray ADispCols, const Xlsutils5::TDynIntegerArray ADispRows, const int ADispCol, const int ADispColCount, const int ADispRow, const int ADispRowCount);
	void __fastcall SetCellPos(const int ASheetIndex, const int ACol, const int ARow);
	void __fastcall BeginAddRefs(void);
	void __fastcall AddRefText(const System::UnicodeString AText)/* overload */;
	int __fastcall AddRefText(const System::UnicodeString AText, const unsigned AColor)/* overload */;
	void __fastcall EndAddRefs(void);
	void __fastcall UpdateRefText(const int AIndex, const System::UnicodeString AText);
	bool __fastcall LastCharIsOperator(void);
	bool __fastcall IsFormatted(void);
	void __fastcall GetFormatted(Xc12datastylesheet5::TXc12DynFontRunArray &AFontRuns);
	void __fastcall BeginUpdate(void);
	void __fastcall EndUpdate(void);
	void __fastcall Command(Xssiekeys::TAXWCommand ACmd);
	void __fastcall ClearCharFormatting(void);
	System::UnicodeString __fastcall Show(const int AX, const int AY, const int AWidth, const int AHeight, bool AssignCellValue);
	void __fastcall Hide(void);
	bool __fastcall IsFormula(void);
	__property Xlscellmmu5::PXLSCellItem Cell = {read=GetCell};
	__property int SheetIndex = {read=FSheetIndex, nodefault};
	__property int Col = {read=FCol, nodefault};
	__property int Row = {read=FRow, nodefault};
	__property Xssiedocprops::TAXWPAP* PAP = {read=GetPAP};
	__property Xssiedocprops::TAXWCHP* CHP = {read=GetCHP};
	__property TXBookEditorCloseEvent OnClose = {read=FCloseEvent, write=FCloseEvent};
	__property Xssieeditor::TAXWTextChangedEvent OnTextChanged = {read=GetTextChangedEvent, write=SetTextChangedEvent};
	__property System::Classes::TNotifyEvent OnCharFmtChanged = {read=GetOnCharFmtChanged, write=SetOnCharFmtChanged};
};


//-- var, const, procedure ---------------------------------------------------
#define EDITREF_TAG_START L"<!"
#define EDITREF_TAG_END L"!>"
}	/* namespace Xbookinplaceedit2 */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_XBOOKINPLACEEDIT2)
using namespace Xbookinplaceedit2;
#endif
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Xbookinplaceedit2HPP
