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

// (DO NOT EDIT: machine generated header) 'Smi2cell.pas' rev: 21.00

#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 <Classes.hpp>	// Pascal unit
#include <Db.hpp>	// Pascal unit
#include <Smibase.hpp>	// Pascal unit
#include <Smcells.hpp>	// Pascal unit
#include <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;
	Classes::TFileStream* fStream;
	Smcells::TSpreadSheetRow* row;
	void __fastcall FCCellValue(System::TObject* Sender, int ASheetNo, int ARow, int AColumn, int FormatIndex, const System::Variant &Value, 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(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(Classes::TStrings* lstSpec);
	virtual void __fastcall SaveSpecificationToStream(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, 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, Classes::TStrings* lstSheets, bool IsASCII, Classes::TStrings* lstFields, Smibase::TPreviewCallback CallBack, Smcells::TProgressPreviewCallback ProgressCallback);

}	/* namespace Smi2cell */
using namespace Smi2cell;
#pragma pack(pop)
#pragma option pop

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