这是系统的接口定义
unit rzinterfaceu;
interface
uses
Classes,DB,Graphics,Midas;
type
TGetRecordOption = (grMetaData, grReset, grXML, grXMLUTF8);
TGetRecordOptions = set of TGetRecordOption;
TReportExeOpt=(reDesign,rePrint,rePreview);
TComHeader=Packed Record
Cmd:byte;
FUid:string[8];
TUid:string[8];
SndTme:double;
end;
TUsrReg=Packed Record
Uid:string[8];
UAddr:string[15];
UPort:integer;
OnLine:boolean;
end;
TCmd=packed Record
Cmd:byte;
//命令字
str:string[40];
//菜单名称
isSrvCmd:boolean;
//服务器命令(所有消息交服务器处理)
LinkToModule:boolean;//连接到活动模块
FailtoServer:boolean;//不成功则交服务器处理
Icon:TIcon;
//命令图标
MustOnLine:boolean;
//必须在线才能使用
end;
TCmdList=Array of TCmd;
TVisibleButton=(vbInsert,vbEdit,vbDelete,
vbSave,vbCancel,vbrevert,vbRefresh,vbrefreshrec,
vbFirst,vbPP,vbPrior,vbNext,
vbNP,vbLast,vbFilter,vbSearch,
vbSort,vbGetBook,vbGotoBook,
vbExport,vbImport,vbReport,
vbSavetoFile,vbLoadFromFile,
vbShenhe,vbFuhe,vbHezhun);
TVisibleButtons=set of TVisibleButton;
TVarArray=Array of pvariant;
TReportParamName=Record
Gate:String;
Names:Tstrings;
Values:TVarArray;
end;
TUser=packed record
Uid:string[8];
UName:string[30];
UAddr:String[15];
UPort:integer;
FaceIdx:integer;
end;
TMsg=Packed Record
FUid:string[8];
SndTme:double;
Msg:string;
end;
PMsg=^TMsg;
TMsgs=Array of PMsg;
TListUser=Packed Record
User:TUser;
Online:boolean;
Msgs:TMsgs;
end;
PUser=^TListUser;
TUserList=Array of PUser;
PReportParamName=^TReportParamName;
TReportParamNames=array of PReportParamName;
TPlugType=(ptData,ptForm,ptUser,ptSystem);
IRzCtrl=interface;
IRzDataSet=Interface;
//Compress and UnCompress Interface
//压缩接口
ICompress=interface
['{D01F5565-62DA-4784-894C-0F9ECB0EA502}']
function CompressData(const spPacket:String;var Key:String):string;
function DeCompressData(const spPacket:string;Const Key:String):string;
end;
//Params routine interface
//参数处理接口
IParamsPack=interface
['{47A453EA-538A-4F77-B252-866EF84DB541}']
function ParamsToString(InParams:TParams):string;
procedure StringToParams(const ParamsString:String;
OutParams:TParams);
end;
//Computer Information Information
//机器硬件接口
IComputerInfo=interface
['{348356E7-EE64-4F2E-9D65-CA53158351A8}']
function GetHDSerial:string;
function GetNetworkAdpMac:string;
function GetIP:string;
function GetMachName:string;
end;
//System Resource Routinue
//系统资源处理
ISysResource=interface
['{A3C67A92-9FB4-42A0-9D31-474C77764428}']
procedure LoadFormRes(AFormInstance:integer);
function LoadResStr(IniFile,Key:string):string;
function msgbox(ini,key,key1:string;utype:longword;Args: array of const):integer;
procedure UpdateSysRes;
procedure UpdateUserRes(Role,Uid:string);
function GetLocal:string;
procedure SetCtrl(ACtrl:iRzCtrl);
property Local:string Read GetLocal;
property Ctrl:IRzCtrl write SetCtrl;
end;
//MainForm Interface
//主程序接口
IRzMainForm=interface
['{EE3D1F75-ED02-4D7D-A19F-953FDD43A22C}']
function GetContainer:integer;
function getActions:integer;
function GetFocusCtl:integer;
procedure SetModuleName(AModuleName:String);
procedure SetUserName(AUserName:string);
procedure SetRDBName(ARDBName:string);
procedure SetRegistered(ARegistered:boolean);
procedure SetCompanyName(ACompanyName:string);
procedure SetConnectType(AConnectType:String);
procedure SetCtrl(ACtrl:iRzCtrl);
property ModuleName:String write SetModuleName;
property UserName:string write setUserName;
property RDBName:string write setRDBName;
property Registered:boolean write setRegistered;
property CompanyName:string write setCompanyName;
property ConnectType:string write SetConnectType;
property FocusCtl:integer read GetFocusCtl;
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzContainer
//容器接口
IRzContainer=interface
['{2984B636-6B78-4A24-A9FA-6E451A0B6564}']
function GetWorkContainer:integer;
function GetMenuConTainer:integer;
function GetPlugContainer:integer;
function GetOICQContainer:integer;
function GetHomeContainer:integer;
function getSupportMenuContainer:boolean;
function GetSupportPlugContainer:boolean;
function GetSupportOICQContainer:boolean;
procedure BuildMainMenu(data:Tdataset);
procedure BuildMenu(Data:integer);
procedure SetCtrl(ACtrl:iRzCtrl);
procedure SetModuleName(AModuleName:String);
property WorkContainer:integer read GetWorkContainer;
property MenuContainer:integer read GetMenuContainer;
property PlugContainer:integer read GetPlugContainer;
property OICQContainer:integer read GetOICQContainer;
property Ctrl:IRzCtrl write SetCtrl;
property ModuleName:String write SetModuleName;
property HomeContainer:integer Read GetHomeContainer;
property SupportMenuContainer:boolean read getSupportMenuContainer;
property SupportPlugContainer:boolean Read GetSupportPlugContainer;
property SupportOICQContainer:boolean read GetSupportOICQContainer;
end;
//IRzMenu
//菜单显示接口
IRzMenuDisp=interface
['{2A946805-1D63-4102-BF88-09A386F0B587}']
function GetDisplayName:string;
function GetSampleBMP:integer;
procedure SetCtrl(ACtrl:iRzCtrl);
procedure ShowMenu;
procedure BuildMenu(Data:integer);
procedure EnumApplication(Data:integer);
property DisplayName:string read GetDisplayName;
property SampleBMP:integer read GetSampleBMP;
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzPlugDisp
//插件显示接口
IRzPlugDisp=interface
['{E1769525-3A02-44C1-9655-A1C25E1FA09D}']
procedure AddPlug(PlugName:String;PlugId:integer;Icon:TIcon);
procedure SetPlugEnable(PlugId:integer;AEnable:boolean);
procedure DeleteAllPlug;
procedure SetCtrl(ACtrl:iRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzICQDisp
//ICQ显示接口
IRzICQDisp=interface
['{6BC4683F-8AB5-4D6E-97F7-70744C232A16}']
procedure SetMsgCount(MsgCount:integer);
procedure SetSysMsgCount(MsgCount:integer);
procedure ShowICQForm;
procedure HideICQForm;
procedure ReceiveMsg(Uid:String);
procedure SetCtrl(ACtrl:iRzCtrl);
procedure UserChange;
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzPlug
IRzPlug=interface
['{DFD8539D-E880-469F-B6CE-8DA98189000F}']
function GetPlugType:TPlugType;
function GetPlugId:integer;
procedure SetPlugId(const PlugId:integer);
procedure SetCtrl(ACtrl:iRzCtrl);
function Execute:variant;
function GetDisplayName:String;
function GetIcon:TIcon;
function GetCopyRight:string;
property Ctrl:IRzCtrl write SetCtrl;
property PlugType:TPlugType read GetPlugType;
property PlugId:integer Read GetPlugId write SetPlugId;
property DisplayName:string Read GetDisplayName;
property Icon:TIcon read GetIcon;
property Copyright:string Read GetCopyRight;
end;
//IRzPlugs
//插件,管理系统插件
IRzPlugs=interface
['{83BF122C-E89A-455E-AEBB-F533A1815E87}']
procedure SetPlugEnable(Logined:Boolean;HasActiveModule:boolean);
procedure EnumPlugs;
procedure ExecutePlug(PlugId:integer);
procedure SetCtrl(ACtrl:iRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzReport
//报表接口
IRzReport=interface
['{987F31F8-3761-492E-9215-06BD9EBBD974}']
function GetDisplayName:String;
function GetCopyRight:string;
procedure SetCtrl(ACtrl:iRzCtrl);
function GetRepId:integer;
procedure SetRepId(RepId:integer);
procedure Execute(Temp:TMemoryStream;AForm:integer;Print:TReportExeOpt);
property Ctrl:IRzCtrl write SetCtrl;
property Copyright:string Read GetCopyRight;
property DisplayName:string Read GetDisplayName;
property RepId:integer read GetRepId write SetRepId;
end;
//IRzReportParam
//报表基本参数
IRzReportParam=interface
['{74228536-0705-46CE-8C68-F93B3A61912C}']
function GetParams:TReportParamNames;
procedure AddParam(gate,paramName:string;paramvalue:variant);
procedure AddParams(gate:String;ParamNames,paramvalues:TVarArray);
procedure AddDataSet(gate,SQL:String;DisplayLabels:variant);overload;
procedure AddDataSet(Gate:String;DataSet:TDataSet);overload;
procedure DeleteParam(gate,paramName:String);overload;
procedure DeleteParam(gate:String);overload;
procedure RenParam(gate,paramname:String;NewValue:variant);
procedure RenParams(gate:String;ParamNames,Paramvalues:variant);
procedure GetValue(ParName:String;var ParValue:variant);
procedure SetCtrl(ACtrl:iRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzReports
//系统报表插件管理
IRzReports=interface
['{2C019DC1-F0DB-4BD0-9694-DEEB7CCFB8FD}']
function GetReportList:TStrings;
procedure EnumReports;
procedure ExecuteReport(RepId:integer;Temp:TMemoryStream;AForm:integer;Print:TReportExeOpt);
procedure SetCtrl(ACtrl:iRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzWrokForm
//系统工作窗口接口
IRzWorkForm=interface
['{C1FEFA81-EE6E-46AB-A648-FB058E002CD1}']
function GetActiveData:IRzDataSet;
functiondo
Help(SQL:String;GridCaps,Returns:Variant;
var return:variant):boolean;overload;
functiondo
Help(SQL:Integer;GridCaps,Returns:Variant;
var return:variant):boolean;overload;
functiondo
Help(SQL:String;GridCaps,Returns:Variant;
var return:variant;var Params:variant):boolean;overload;
functiondo
Help(SQL:Integer;GridCaps,Returns:Variant;
var return:variant;var Params:variant):boolean;overload;
functiondo
Help(DataSet:TDataSet;Returns:Variant;
var return:variant):boolean;overload;
functiondo
Help(DataSet:TDataSet;ShowFields,
Returns:Variant;var return:variant):boolean;overload;
function ExecuteSql(SQL:String;Params,OwnerParam:variant;
var return:variant):boolean;overload;
function ExecuteSql(SQLID:integer;Params,OwnerParam:variant;
var return:variant):boolean;overload;
function ExecuteSql(SQLID:Array of const;Params,OwnerParam:variant;
var return:variant):boolean;overload;
function GetLookUpData(SQL:String;Params:Variant;
var return:variant):boolean;
procedure SetRights(ARights:integer);
property Rights:integer write SetRights;
end;
//IRzConnect
//系统连接
IRzConnect=interface
['{A4A544C1-0DBB-4F4F-A951-141EAEAC9141}']
function GetServerName:string;
function GetServerProp:string;
function GetRDBName:string;
function GetDBTables(IncludeSystem:boolean):string;
function FetchDatas(SQl:string;var Params:string;
Local: string;
Count,
OwnerData: integer;Options:integer;var RecsOut:integer): string;
function saveData(SQL,Delta,Local:string;MaxError:integer;
var ErrorCount:integer):string;
function ExecuteSQL(SQL,Params,Local:string):string;
function FetchParams(SQL,Local:string):string;
function GetConnectInt:IInterface;
procedure SetCtrl(ACtrl:iRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
property ConnectInt:IInterface Read GetConnectInt;
end;
//IRzDataSet
//RZ数据集接口
IRzDataSet=interface
['{3B49A56B-A0AE-4712-8386-1A4B59E606B7}']
proceduredo
Command(ComId:integer);
function GetButtons(GetEnable:Boolean):TVisibleButtons;
Function GetBookMarkCount:integer;
procedure SaveBookmarks;
procedure SetCtrl(ACtrl:iRzCtrl);
procedure SetRights(ARights:integer);
property Rights:integer write SetRights;
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzApplication
IRzApplication=interface
['{C94EC98E-D10D-4DAB-AE34-68956F135917}']
procedure EnumApplication(Uid,RoleId:string;super:boolean);
function GetAppId(P
ointer):string;
procedure SetCtrl(ACtrl:iRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzModules
IRzModules=interface
['{267A3A2B-14B9-40A6-AAFD-9F972B0B18AF}']
procedure OpenModule;
procedure CloseModule;
procedure CloseAll;
procedure EnumModules(Uid,RoleId,AppId:string;super:boolean);
procedure SetCtrl(ACtrl:iRzCtrl);
function GetActiveModuleName:string;
function GetOpenedModules:TStrings;
function GetActiveData:IRzDataSet;
function GetActiveDataObj:integer;
function GetActiveFormObj:integer;
function GetActiveAppid:string;
procedure Next;
procedure Prior;
function GetIsFirst:boolean;
function GetIsLast:boolean;
property IsFirst:boolean read GetIsFirst;
property IsLast:boolean read GetIsLast;
property Ctrl:IRzCtrl write SetCtrl;
property ActiveModuleName:string read GetActiveModuleName;
property OpenedModules:Tstrings Read GetOpenedModules;
property ActiveData:IRzDataSet read GetActiveData;
property ActiveDataObj:integer Read GetActiveDataObj;
property ActiveFormObj:integer Read GetActiveFormObj;
end;
//IRzWizard
//系统向导接口
IRzWizard=interface
['{31092CBA-8CCE-4B64-B07C-276D9CEFD2E7}']
end;
//IRzCtrl
//控制器
IRzCtrl=interface
['{E5E72FFF-119F-4072-9EA6-1A844FCA03E7}']
procedure EnumApp(data:TdataSet);
procedure EnumModule(Bk
ointer);
procedure EnumModules(Data:TdataSet);
function QuerySpecInterface(IntName:String):IInterface;
proceduredo
Command(ComId:integer;GroupId:integer);
function GetUid:string;
function GetUname:String;
property Uid:string Read GetUid;
property UName:string Read GetUName;
end;
//Reize Soap Server interface
IRzSoapServer=interface(IInvokable)
['{78CF4C39-6620-70A4-2581-A47E35BBFED8}']
function GetServerName:string;safecall;
function GetServerProp:string;safecall;
function GetRDBName:string;safecall;
function GetDBTables(IncludeSystem:boolean):string;safecall;
function FetchDatas(SQl:string;var Params:string;Local:string;Count,OwnerData:integer;
var Key:String;Compress:boolean;Options:integer;var RecsOut:Integer):string;safecall;
function saveData(SQL,Delta,Local:string;MaxError:integer;
var ErrorCount:integer;var Key:String;
Compress:boolean):string;safecall;
function ExecuteSQL(SQL,Params,Local:string;
var Key:String;Compress:boolean):string;safecall;
function FetchParams(SQL,Local:string;var Key:String;
Compress:boolean):string;safecall;
end;
//Reize Corba Server(for Corba 4.5)
IRzCorbaData = interface
['{6C90BC2A-344E-BAD8-7C98-10E3FD162B5C}']
function GetServerName : AnsiString;
function GetServerProp : AnsiString;
function GetRDBName : AnsiString;
function GetDBTables (const IncludeSysTable : Boolean): AnsiString;
function FetchDatas (const SQL : AnsiString;
const Params : AnsiString;
const Local : AnsiString;
const Count : Integer;
const OwnerData : Integer;
var Key : AnsiString;
const Compress : Boolean): AnsiString;
function saveData (const SQL : AnsiString;
const Delta : AnsiString;
const Local : AnsiString;
const MaxError : Integer;
out ErrorCount : Integer;
var key : AnsiString;
const Compress : Boolean): AnsiString;
function ExecuteSQL (const SQL : AnsiString;
const Params : AnsiString;
const Local : AnsiString;
var key : AnsiString;
const compress : Boolean): AnsiString;
function FetchParams (const SQL : AnsiString;
const Local : AnsiString;
var Key:AnsiString;
const Compress : Boolean): AnsiString;
end;
{$IFDEF WIN32}
//Reize COM+ Server
Irzcomplusserver = interface(IAppServer)
['{1DB957CE-542F-45C9-8175-A7EF7531A4A1}']
function GetServerName: WideString;
safecall;
function GetServerProp: WideString;
safecall;
function GetRDBName: WideString;
safecall;
function GetDBTables(IncludeSystem: WordBool): WideString;
safecall;
function FetchDatas(const SQL: WideString;
const Params: WideString;
const Local: WideString;
Count: Integer;
OwnerData: Integer;
var Key: WideString;
Compress: WordBool): WideString;
safecall;
function saveData(const SQL: WideString;
const Delta: WideString;
const Local: WideString;
MaxError: Integer;
var ErrorCount: Integer;
var Key: WideString;
Compress: WordBool): WideString;
safecall;
function ExecuteSQL(const SQL: WideString;
const Params: WideString;
const Local: WideString;
var Key: WideString;
Compress: WordBool): WideString;
safecall;
function FetchParams(const SQL: WideString;
const Local: WideString;
var Key: WideString;
Compress: WordBool): WideString;
safecall;
function GetInterface: Irzcomplusserver;
safecall;
end;
{$ENDIF}
//IRzPublicOper
IRzPublicOper=interface
['{58F51295-D868-4309-8850-F1C99542D30E}']
functiondo
Login:variant;
functiondo
ModiPass(Uid,UPass:string):variant;
functiondo
Setting:variant;
functiondo
Filter(DataSet:TDataSet):variant;
functiondo
Search(DataSet:TDataSet):Variant;
functiondo
Sort(DataSet:TDataSet):variant;
functiondo
GotoBook(DataSet:TDataSet):variant;
functiondo
Export(DataSet:TDataSet):variant;
functiondo
Import(DataSet:TDataSet):variant;
functiondo
SaveOffline(DataSet:TDataSet):variant;
functiondo
LoadOffline(DataSet:TDataSet):variant;
functiondo
Report(AppId:String;Form:TComponent):variant;
procedure SetCtrl(const ACtrl:IRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzJihua
IRzJihua=interface
['{0397EA08-6DDF-4B3E-874B-D7663F6C6DDA}']
procedure ShowJihua;
procedure SetCtrl(const ACtrl:IRzCtrl);
property Ctrl:IRzCtrl write SetCtrl;
end;
//IRzIcq
IRzIcq=interface
['{D892F53B-0A78-41F0-9931-A4629E7D5FFF}']
function GetUserList:TUserList;
function GetOnLineList:TUserList;
function GetCmdList:TCmdList;
procedure SetCtrl(const ACtrl:IRzCtrl);
procedure SetUid(AUid:string);
proceduredo
Cmd(Cmd:byte;ToUid:string);
property Ctrl:IRzCtrl write SetCtrl;
property Uid:string write SetUid;
property CmdList:TCmdList Read GetCmdList;
property UserList:TUserList Read GetUserList;
property OnLineList:TUserList Read GetOnLineList;
end;
//IRzIcqPlug
IRzIcqPlug=interface
['{B243EB6D-F386-40B8-B271-693F28C7C820}']
function GetCmdList:TCmdList;
procedure SetCtrl(ACtrl:IRzCtrl);
procedure SetIcq(AIcq:IRzIcq);
proceduredo
Cmd(Cmd:byte;ToUid:string);
property Ctrl:IRzCtrl write SetCtrl;
property CmdList:TCmdList Read GetCmdList;
property Icq:IRzIcq write SetIcq;
end;
implementation
end.