home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 October
/
Chip_2002-10_cd1.bin
/
zkuste
/
delphi
/
kolekce
/
d56
/
FLEXCEL.ZIP
/
FlexCel
/
UExcelAdapter.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2002-07-02
|
5KB
|
115 lines
unit UExcelAdapter;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
{$IFDEF ConditionalExpressions}{$if CompilerVersion >= 14} variants,{$IFEND}{$ENDIF} //Delphi 6 or above
UFlxMessages;
type
TExcelFile=class
protected
function GetCellValue(aRow, aCol: integer): Variant; virtual; abstract;
procedure SetCellValue(aRow, aCol: integer; const Value: Variant); virtual; abstract;
function GetCommentsCount(Row: integer): integer; virtual; abstract;
function GetCommentText(Row, aPos: integer): Widestring; virtual; abstract;
function GetPictureName(Row, aPos: integer): Widestring; virtual; abstract;
function GetPicturesCount(Row: integer): integer; virtual; abstract;
function GetExcelNameCount: integer; virtual; abstract;
function GetRangeName(index: integer): Widestring; virtual; abstract;
function GetRangeR1(index: integer): integer; virtual; abstract;
function GetRangeR2(index: integer): integer; virtual; abstract;
function GetRangeC1(index: integer): integer; virtual; abstract;
function GetRangeC2(index: integer): integer; virtual; abstract;
function GetRangeSheet(index: integer): integer; virtual; abstract;
function GetActiveSheet: byte; virtual; abstract;
procedure SetActiveSheet(const Value: byte); virtual; abstract;
function GetActiveSheetName: WideString; virtual; abstract;
procedure SetActiveSheetName(const Value: WideString); virtual; abstract;
public
procedure Connect;virtual;abstract;
procedure Disconnect;virtual;abstract;
procedure OpenFile(const FileName: TFileName);virtual;abstract;
procedure CloseFile; virtual; abstract;
property ActiveSheet: byte read GetActiveSheet write SetActiveSheet;
procedure InsertAndCopySheets (const CopyFrom, InsertBefore, SheetCount: byte);virtual;abstract;
function SheetCount: byte;virtual;abstract;
property ActiveSheetName: WideString read GetActiveSheetName write SetActiveSheetName;
procedure SelectSheet(const SheetNo:integer); virtual; abstract;
procedure DeleteMarkedRows(const Mark: Widestring);virtual;abstract;
procedure RefreshPivotTables;virtual;abstract;
procedure Save(const AutoClose: boolean; const FileName: string; const OnGetFileName: TOnGetFileNameEvent);virtual;abstract;
procedure InsertAndCopyRows(const FirstRow, LastRow, DestRow, aCount: integer; const OnlyFormulas: boolean);virtual;abstract;
procedure DeleteRows(const aRow, aCount: word);virtual;abstract;
procedure BeginSheet; virtual; abstract;
procedure EndSheet(const RowOffset: integer); virtual; abstract;
function CanOptimizeRead: boolean; virtual;abstract;
property RangeCount: integer read GetExcelNameCount;
property RangeName[index: integer]: Widestring read GetRangeName;
property RangeR1[index: integer]: integer read GetRangeR1;
property RangeR2[index: integer]: integer read GetRangeR2;
property RangeC1[index: integer]: integer read GetRangeC1;
property RangeC2[index: integer]: integer read GetRangeC2;
property RangeSheet[index: integer]: integer read GetRangeSheet;
property PicturesCount[Row: integer]: integer read GetPicturesCount;
property PictureName[Row: integer; aPos: integer]: Widestring read GetPictureName;
procedure AssignPicture(const Row, aPos: integer; const Pic: string; const PicType: TXlsImgTypes); virtual;abstract;
property CommentsCount[Row: integer]: integer read GetCommentsCount;
property CommentText[Row: integer; aPos: integer]: Widestring read GetCommentText;
procedure AssignComment(const Row, aPos: integer; const Comment: Widestring); virtual;abstract;
function CellCount(const aRow: integer): integer;virtual;abstract;
function GetCellData(const aRow, aColOffset: integer): variant;virtual;abstract;
function GetCellDataX(const aRow, aColOffset: integer): TXlsCellValue;virtual;abstract;
procedure AssignCellData(const aRow, aColOffset: integer; const Value: variant);virtual;abstract;
procedure AssignCellDataX(const aRow, aColOffset: integer; const Value: TXlsCellValue);virtual;abstract;
function MaxRow: integer; virtual;abstract;
function IsEmptyRow(const aRow: integer): boolean; virtual; abstract;
property CellValue[aRow, aCol: integer]: Variant read GetCellValue write SetCellValue; //this is for ole handling
procedure SetBounds(const aRangePos: integer);virtual;abstract;
procedure PrepareBlockData(const R1,C1,R2,C2: integer);virtual;abstract;
procedure AssignBlockData(const Row,Col: integer; const v: variant);virtual;abstract;
procedure PasteBlockData;virtual;abstract;
end;
TExcelAdapter = class(TComponent)
private
{ Private declarations }
protected
{ Protected declarations }
public
function GetWorkbook: TExcelFile;virtual;abstract;
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
//No Register...
end;
end.