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

// (DO NOT EDIT: machine generated header) 'SMI2Cell.pas' rev: 23.00 (Win32)

#ifndef Smi2cellHPP
#define Smi2cellHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.Classes.hpp>	// Pascal unit
#include <Data.DB.hpp>	// Pascal unit
#include <SMIBase.hpp>	// Pascal unit
#include <SMCells.hpp>	// Pascal unit
#include <System.Variants.hpp>	// Pascal unit

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

namespace Smi2cell
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TSMImportFromCell;
class PASCALIMPLEMENTATION TSMImportFromCell : public Smibase::TSMImportBaseComponent
{
	typedef Smibase::TSMImportBaseComponent inherited;
	
private:
	int intCurRow;
	int FSheetIndex;
	System::UnicodeString FSheetName;
	Smcells::TSpreadSheetRow* FCurSheetRow;
	System::Classes::TFileStream* fStream;
	Smcells::TSpreadSheetRow* row;
	void __fastcall FCCellValue(System::TObject* Sender, int ASheetNo, int ARow, int AColumn, int FormatIndex, const System::Variant &Value, System::Classes::TAlignment Alignment, Smcells::TSMICellType CellType);
	void __fastcall SetSheetIndex(int Value);
	void __fastcall SetSheetName(System::UnicodeString Value);
	
protected:
	virtual Smcells::TSpreadSheetFile* __fastcall WorkBookCreation(void);
	virtual void __fastcall BeforeImport(void);
	virtual void __fastcall AfterImport(void);
	virtual bool __fastcall LoadRecord(void);
	virtual void __fastcall GoFirst(void);
	virtual void __fastcall GoNext(void);
	virtual bool __fastcall NeedMore(void);
	virtual int __fastcall GetTotalCount(void);
	virtual System::Variant __fastcall GetFieldValue(const System::Variant &v);
	virtual bool __fastcall NotDefined(System::UnicodeString &strProperty);
	
public:
	Smcells::TSpreadSheetFile* WorkBook;
	__fastcall virtual TSMImportFromCell(System::Classes::TComponent* AOwner);
	__fastcall virtual ~TSMImportFromCell(void);
	virtual void __fastcall DetectAutoMapping(void);
	virtual void __fastcall Columns2Mapping(void);
	virtual System::UnicodeString __fastcall GetColumnFieldName(int Index);
	virtual void __fastcall LoadSpecificationFromStrings(System::Classes::TStrings* lstSpec);
	virtual void __fastcall SaveSpecificationToStream(System::Classes::TStream* Stream, const System::UnicodeString SpecName);
	__property System::UnicodeString SheetName = {read=FSheetName, write=SetSheetName};
	
__published:
	__property int SheetIndex = {read=FSheetIndex, write=SetSheetIndex, default=0};
	__property SourceFileName;
	__property RowFirst = {default=1};
	__property RowLast = {default=2147483647};
	__property RowFieldNames = {default=1};
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE Smibase::TSMIDataType __fastcall SMICellType2SMIDataType(Smcells::TSMICellType ict);
extern PACKAGE void __fastcall FillArrayValue(int UsedColCount, Smcells::TSpreadSheetRow* Row, Smcells::TSMIColumnNameKind NameKind, System::Classes::TStrings* lstFields, System::Variant &Values);
extern PACKAGE void __fastcall LoadSpreadSheetPreview(Smibase::TTableTypeImport SpreadType, System::TObject* grid, const System::UnicodeString strFieldList, const System::UnicodeString strFileName, int ASheetIndex, int intRowFirst, int intRowLast, int intRowPreview, System::Classes::TStrings* lstSheets, bool IsASCII, System::Classes::TStrings* lstFields, Smibase::TPreviewCallback CallBack, Smcells::TProgressPreviewCallback ProgressCallback);

}	/* namespace Smi2cell */
#if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_SMI2CELL)
using namespace Smi2cell;
#endif
#pragma pack(pop)
#pragma option pop

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