📄 rfclientproj1_tlb.~pas
字号:
TrfClient = class(TOleControl)
private
FOnActivate: TNotifyEvent;
FOnClick: TNotifyEvent;
FOnCreate: TNotifyEvent;
FOnDblClick: TNotifyEvent;
FOnDestroy: TNotifyEvent;
FOnDeactivate: TNotifyEvent;
FOnKeyPress: TrfClientOnKeyPress;
FOnPaint: TNotifyEvent;
FOnMSG: TrfClientOnMSG;
FOnError: TrfClientOnError;
FOnLog: TrfClientOnLog;
FIntf: IrfClient;
function GetControlInterface: IrfClient;
protected
procedure CreateControl;
procedure InitControlData; override;
public
procedure AboutBox;
procedure InitChannel(AChannelID: Integer; AParentHandle: Integer; AScale: Single;
AVisiBle: WordBool);
function Chat(AUserID: LongWord; const AMsg: WideString; ASilent: WordBool): Integer;
procedure Command(AmngCommand: Integer; ATargertUserID: LongWord; Param1: Integer;
Param2: Integer);
procedure CreateRoom(const ARoomName: WideString; const ARoomMemo: WideString;
const ARoomPassWord: WideString; const AMngPassWord: WideString);
procedure GetRoomList(AIndex: Integer);
function GetVoiceVolume(AChannelID: Integer): Integer;
procedure Init;
procedure Login(ARoomID: Integer; AUserID: LongWord; const ANickName: WideString;
const ASex: WideString; const APassWord: WideString;
const ARoomPassWord: WideString; const AMngPassWord: WideString;
const AUserData: WideString);
procedure LogOut;
procedure MicCancel;
function MicReq: Integer;
procedure ModifyRoom(ARoomID: Integer; const AMngPassWord: WideString; const AData: WideString);
procedure SetChannelState(AChannelID: Integer; AEnable: WordBool);
procedure ShowLocalVideo;
procedure ShowScaleForm(AChannelID: Integer; AShow: WordBool);
function MakeChatStr(AUserID: LongWord; ATargetUserID: LongWord; const AContent: WideString;
ASilent: WordBool): WideString;
procedure TransPack(ATagertUserID: LongWord; const AMsg: WideString);
function GetUserInfo(AUserID: LongWord; var ANickName: WideString): WideString;
procedure SendPlugMsg(APlugID: LongWord; const AMsg: WideString);
function GetChannelByUserID(AUserID: LongWord): Integer;
function GetUserIDByChannel(AChannelID: Integer): LongWord;
procedure SetPlayAudioEnable(AChannelID: Integer; AEnable: WordBool);
procedure SetPlayVideoEnable(AChannelID: Integer; AEnable: WordBool);
function GetPlayAudioEnable(AChannelID: Integer): WordBool;
function GetPlayVideoEnable(AChannelID: Integer): WordBool;
procedure DeleteRoom(ARoomID: Integer; const AMngPassWord: WideString);
property ControlInterface: IrfClient read GetControlInterface;
property DefaultInterface: IrfClient read GetControlInterface;
property Visible: WordBool index 201 read GetWordBoolProp write SetWordBoolProp;
property Active: WordBool index 209 read GetWordBoolProp;
property AlignDisabled: WordBool index 215 read GetWordBoolProp;
property VisibleDockClientCount: Integer index 216 read GetIntegerProp;
property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp;
published
property Anchors;
property ParentColor;
property ParentFont;
property Align;
property DragCursor;
property DragMode;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
property AxBorderStyle: TOleEnum index 204 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
property ServerIP: WideString index 221 read GetWideStringProp write SetWideStringProp stored False;
property ServerPort: Integer index 222 read GetIntegerProp write SetIntegerProp stored False;
property HtmlChatHeader: WideString index 224 read GetWideStringProp write SetWideStringProp stored False;
property HtmlChatSilent: WideString index 225 read GetWideStringProp write SetWideStringProp stored False;
property RecMode: TOleEnum index 227 read GetTOleEnumProp write SetTOleEnumProp stored False;
property SendVideoEnable: WordBool index 230 read GetWordBoolProp write SetWordBoolProp stored False;
property SendAudioEnable: WordBool index 231 read GetWordBoolProp write SetWordBoolProp stored False;
property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnCreate: TNotifyEvent read FOnCreate write FOnCreate;
property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
property OnDestroy: TNotifyEvent read FOnDestroy write FOnDestroy;
property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
property OnKeyPress: TrfClientOnKeyPress read FOnKeyPress write FOnKeyPress;
property OnPaint: TNotifyEvent read FOnPaint write FOnPaint;
property OnMSG: TrfClientOnMSG read FOnMSG write FOnMSG;
property OnError: TrfClientOnError read FOnError write FOnError;
property OnLog: TrfClientOnLog read FOnLog write FOnLog;
end;
procedure Register;
resourcestring
dtlServerPage = 'Servers';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
procedure TrfClient.InitControlData;
const
CEventDispIDs: array [0..10] of DWORD = (
$000000C9, $000000CA, $000000CB, $000000CC, $000000CD, $000000CE,
$000000CF, $000000D0, $000000D1, $000000D2, $000000D3);
CTFontIDs: array [0..0] of DWORD = (
$FFFFFE00);
CControlData: TControlData2 = (
ClassID: '{7F7B111E-BC44-47A4-BDC0-BA86E4106296}';
EventIID: '{2A172E40-673C-4D84-ADC9-13E1EA4BB72A}';
EventCount: 11;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil (*HR:$00000000*);
Flags: $0000000D;
Version: 401;
FontCount: 1;
FontIDs: @CTFontIDs);
begin
ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnActivate) - Cardinal(Self);
end;
procedure TrfClient.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as IrfClient;
end;
begin
if FIntf = nil then DoCreate;
end;
function TrfClient.GetControlInterface: IrfClient;
begin
CreateControl;
Result := FIntf;
end;
procedure TrfClient.AboutBox;
begin
DefaultInterface.AboutBox;
end;
procedure TrfClient.InitChannel(AChannelID: Integer; AParentHandle: Integer; AScale: Single;
AVisiBle: WordBool);
begin
DefaultInterface.InitChannel(AChannelID, AParentHandle, AScale, AVisiBle);
end;
function TrfClient.Chat(AUserID: LongWord; const AMsg: WideString; ASilent: WordBool): Integer;
begin
Result := DefaultInterface.Chat(AUserID, AMsg, ASilent);
end;
procedure TrfClient.Command(AmngCommand: Integer; ATargertUserID: LongWord; Param1: Integer;
Param2: Integer);
begin
DefaultInterface.Command(AmngCommand, ATargertUserID, Param1, Param2);
end;
procedure TrfClient.CreateRoom(const ARoomName: WideString; const ARoomMemo: WideString;
const ARoomPassWord: WideString; const AMngPassWord: WideString);
begin
DefaultInterface.CreateRoom(ARoomName, ARoomMemo, ARoomPassWord, AMngPassWord);
end;
procedure TrfClient.GetRoomList(AIndex: Integer);
begin
DefaultInterface.GetRoomList(AIndex);
end;
function TrfClient.GetVoiceVolume(AChannelID: Integer): Integer;
begin
Result := DefaultInterface.GetVoiceVolume(AChannelID);
end;
procedure TrfClient.Init;
begin
DefaultInterface.Init;
end;
procedure TrfClient.Login(ARoomID: Integer; AUserID: LongWord; const ANickName: WideString;
const ASex: WideString; const APassWord: WideString;
const ARoomPassWord: WideString; const AMngPassWord: WideString;
const AUserData: WideString);
begin
DefaultInterface.Login(ARoomID, AUserID, ANickName, ASex, APassWord, ARoomPassWord, AMngPassWord,
AUserData);
end;
procedure TrfClient.LogOut;
begin
DefaultInterface.LogOut;
end;
procedure TrfClient.MicCancel;
begin
DefaultInterface.MicCancel;
end;
function TrfClient.MicReq: Integer;
begin
Result := DefaultInterface.MicReq;
end;
procedure TrfClient.ModifyRoom(ARoomID: Integer; const AMngPassWord: WideString;
const AData: WideString);
begin
DefaultInterface.ModifyRoom(ARoomID, AMngPassWord, AData);
end;
procedure TrfClient.SetChannelState(AChannelID: Integer; AEnable: WordBool);
begin
DefaultInterface.SetChannelState(AChannelID, AEnable);
end;
procedure TrfClient.ShowLocalVideo;
begin
DefaultInterface.ShowLocalVideo;
end;
procedure TrfClient.ShowScaleForm(AChannelID: Integer; AShow: WordBool);
begin
DefaultInterface.ShowScaleForm(AChannelID, AShow);
end;
function TrfClient.MakeChatStr(AUserID: LongWord; ATargetUserID: LongWord;
const AContent: WideString; ASilent: WordBool): WideString;
begin
Result := DefaultInterface.MakeChatStr(AUserID, ATargetUserID, AContent, ASilent);
end;
procedure TrfClient.TransPack(ATagertUserID: LongWord; const AMsg: WideString);
begin
DefaultInterface.TransPack(ATagertUserID, AMsg);
end;
function TrfClient.GetUserInfo(AUserID: LongWord; var ANickName: WideString): WideString;
begin
Result := DefaultInterface.GetUserInfo(AUserID, ANickName);
end;
procedure TrfClient.SendPlugMsg(APlugID: LongWord; const AMsg: WideString);
begin
DefaultInterface.SendPlugMsg(APlugID, AMsg);
end;
function TrfClient.GetChannelByUserID(AUserID: LongWord): Integer;
begin
Result := DefaultInterface.GetChannelByUserID(AUserID);
end;
function TrfClient.GetUserIDByChannel(AChannelID: Integer): LongWord;
begin
Result := DefaultInterface.GetUserIDByChannel(AChannelID);
end;
procedure TrfClient.SetPlayAudioEnable(AChannelID: Integer; AEnable: WordBool);
begin
DefaultInterface.SetPlayAudioEnable(AChannelID, AEnable);
end;
procedure TrfClient.SetPlayVideoEnable(AChannelID: Integer; AEnable: WordBool);
begin
DefaultInterface.SetPlayVideoEnable(AChannelID, AEnable);
end;
function TrfClient.GetPlayAudioEnable(AChannelID: Integer): WordBool;
begin
Result := DefaultInterface.GetPlayAudioEnable(AChannelID);
end;
function TrfClient.GetPlayVideoEnable(AChannelID: Integer): WordBool;
begin
Result := DefaultInterface.GetPlayVideoEnable(AChannelID);
end;
procedure TrfClient.DeleteRoom(ARoomID: Integer; const AMngPassWord: WideString);
begin
DefaultInterface.DeleteRoom(ARoomID, AMngPassWord);
end;
procedure Register;
begin
RegisterComponents(dtlOcxPage, [TrfClient]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -