📄 mysqlthread.hpp
字号:
// Borland C++ Builder
// Copyright (c) 1995, 2002 by Borland Software Corporation
// All rights reserved
// (DO NOT EDIT: machine generated header) 'MySQLThread.pas' rev: 6.00
#ifndef MySQLThreadHPP
#define MySQLThreadHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <MySQLDataset.hpp> // Pascal unit
#include <MySQLServer.hpp> // Pascal unit
#include <Variants.hpp> // Pascal unit
#include <Controls.hpp> // Pascal unit
#include <Windows.hpp> // Pascal unit
#include <SysUtils.hpp> // Pascal unit
#include <SyncObjs.hpp> // Pascal unit
#include <Messages.hpp> // Pascal unit
#include <Classes.hpp> // Pascal unit
#include <DB.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Mysqlthread
{
//-- type declarations -------------------------------------------------------
typedef void __fastcall (__closure *TMySQLThreadNotifyEvent)(System::TObject* Sender, const int ID, const AnsiString Value, bool &Continue);
typedef void __fastcall (__closure *TMySQLThreadStatusEvent)(System::TObject* Sender, const int ID, const int Status, const AnsiString Value, bool &Continue);
typedef void __fastcall (__closure *TMySQLThreadProgressEvent)(System::TObject* Sender, const int ID, const int Total, const int Current, const float Speed, bool &Continue);
class DELPHICLASS TMySQLThread;
class PASCALIMPLEMENTATION TMySQLThread : public Classes::TThread
{
typedef Classes::TThread inherited;
private:
Syncobjs::TSimpleEvent* FNotifier;
Syncobjs::TCriticalSection* FSync;
AnsiString FProps;
Sysutils::Exception* FLastException;
Byte FLastStatus;
Byte FStatus;
bool FLastContinue;
int FTimeOut;
HWND FWndHandle;
Classes::TNotifyEvent FOnFin;
protected:
void __fastcall NotifyException(Sysutils::Exception* E);
void __fastcall NotifyClient(const AnsiString Value);
void __fastcall SetStatus(Byte NewStatus = (Byte)(0x0));
Byte __fastcall GetStatus(void);
void __fastcall Progress(System::TObject* Sender, const int Total, const int Current, const float Speed);
void __fastcall SetNotifyTask(void);
void __fastcall DoFin(System::TObject* Sender);
virtual void __fastcall Execute(void);
virtual void __fastcall Idle(void);
virtual bool __fastcall GetEvent(void);
virtual void __fastcall HandleEvent(void);
__property HWND WndHandle = {read=FWndHandle, write=FWndHandle, nodefault};
__property AnsiString Props = {read=FProps, write=FProps};
__property Syncobjs::TCriticalSection* Sync = {read=FSync, write=FSync};
__property int TimeOut = {read=FTimeOut, write=FTimeOut, nodefault};
__property bool Continue = {read=FLastContinue, write=FLastContinue, nodefault};
public:
__fastcall TMySQLThread(AnsiString Props, HWND AWndHandle, bool FOT);
__fastcall virtual ~TMySQLThread(void);
virtual bool __fastcall ThreadExecute(void);
__property Byte Status = {read=GetStatus, write=SetStatus, nodefault};
__property Syncobjs::TSimpleEvent* Notifier = {read=FNotifier};
__property Classes::TNotifyEvent OnFin = {read=FOnFin, write=FOnFin};
};
class DELPHICLASS TMySQLThreadedSQL;
class PASCALIMPLEMENTATION TMySQLThreadedSQL : public TMySQLThread
{
typedef TMySQLThread inherited;
private:
AnsiString FSQL;
Mysqlserver::TMySQLServer* FServer;
Mysqldataset::TMySQLDataset* FDataset;
unsigned FMsgType;
unsigned FRef;
protected:
virtual bool __fastcall GetEvent(void);
virtual void __fastcall HandleEvent(void);
public:
HIDESBASE bool __fastcall ThreadExecute(Mysqlserver::TMySQLServer* AServer, const AnsiString SQL, bool AWaitFor = true);
public:
#pragma option push -w-inl
/* TMySQLThread.Create */ inline __fastcall TMySQLThreadedSQL(AnsiString Props, HWND AWndHandle, bool FOT) : TMySQLThread(Props, AWndHandle, FOT) { }
#pragma option pop
#pragma option push -w-inl
/* TMySQLThread.Destroy */ inline __fastcall virtual ~TMySQLThreadedSQL(void) { }
#pragma option pop
};
class DELPHICLASS TMySQLThreadedOpen;
class PASCALIMPLEMENTATION TMySQLThreadedOpen : public TMySQLThread
{
typedef TMySQLThread inherited;
private:
Mysqldataset::TMySQLDatasetBase* FDataset;
protected:
virtual bool __fastcall GetEvent(void);
virtual void __fastcall HandleEvent(void);
public:
HIDESBASE bool __fastcall ThreadExecute(Mysqldataset::TMySQLDatasetBase* ADataset, bool AWaitFor = true);
public:
#pragma option push -w-inl
/* TMySQLThread.Create */ inline __fastcall TMySQLThreadedOpen(AnsiString Props, HWND AWndHandle, bool FOT) : TMySQLThread(Props, AWndHandle, FOT) { }
#pragma option pop
#pragma option push -w-inl
/* TMySQLThread.Destroy */ inline __fastcall virtual ~TMySQLThreadedOpen(void) { }
#pragma option pop
};
class DELPHICLASS EMySQLThreadException;
class PASCALIMPLEMENTATION EMySQLThreadException : public Sysutils::Exception
{
typedef Sysutils::Exception inherited;
public:
#pragma option push -w-inl
/* Exception.Create */ inline __fastcall EMySQLThreadException(const AnsiString Msg) : Sysutils::Exception(Msg) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmt */ inline __fastcall EMySQLThreadException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateRes */ inline __fastcall EMySQLThreadException(int Ident)/* overload */ : Sysutils::Exception(Ident) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmt */ inline __fastcall EMySQLThreadException(int Ident, const System::TVarRec * Args, const int Args_Size)/* overload */ : Sysutils::Exception(Ident, Args, Args_Size) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateHelp */ inline __fastcall EMySQLThreadException(const AnsiString Msg, int AHelpContext) : Sysutils::Exception(Msg, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateFmtHelp */ inline __fastcall EMySQLThreadException(const AnsiString Msg, const System::TVarRec * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResHelp */ inline __fastcall EMySQLThreadException(int Ident, int AHelpContext)/* overload */ : Sysutils::Exception(Ident, AHelpContext) { }
#pragma option pop
#pragma option push -w-inl
/* Exception.CreateResFmtHelp */ inline __fastcall EMySQLThreadException(System::PResStringRec ResStringRec, const System::TVarRec * Args, const int Args_Size, int AHelpContext)/* overload */ : Sysutils::Exception(ResStringRec, Args, Args_Size, AHelpContext) { }
#pragma option pop
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~EMySQLThreadException(void) { }
#pragma option pop
};
class DELPHICLASS TMySQLThreaded;
class PASCALIMPLEMENTATION TMySQLThreaded : public Classes::TComponent
{
typedef Classes::TComponent inherited;
private:
HWND FOwnHandle;
Word FIntervals;
int FTimeOut;
bool FLastContinue;
int FLastTotal;
int FLastCurrent;
float FLastSpeed;
TMySQLThreadNotifyEvent FOnNotify;
TMySQLThreadStatusEvent FOnStatus;
TMySQLThreadProgressEvent FOnProgress;
TMySQLThreadStatusEvent FOnError;
TMySQLThreadStatusEvent FOnTask;
TMySQLThreadStatusEvent FOnTimeOut;
TMySQLThreadStatusEvent FOnIdle;
void __fastcall SetIntervals(Word Value);
protected:
virtual void __fastcall OwnProc(Messages::TMessage &M);
public:
__fastcall virtual TMySQLThreaded(Classes::TComponent* AOwner);
__fastcall virtual ~TMySQLThreaded(void);
void __fastcall ExecSQL(Mysqlserver::TMySQLServer* AServer, const AnsiString ASQL = "");
__published:
__property int TimeOut = {read=FTimeOut, write=FTimeOut, nodefault};
__property Word Intervals = {read=FIntervals, write=SetIntervals, nodefault};
__property TMySQLThreadNotifyEvent OnNotify = {read=FOnNotify, write=FOnNotify};
__property TMySQLThreadProgressEvent OnProgress = {read=FOnProgress, write=FOnProgress};
__property TMySQLThreadStatusEvent OnError = {read=FOnError, write=FOnError};
__property TMySQLThreadStatusEvent OnStatus = {read=FOnStatus, write=FOnStatus};
__property TMySQLThreadStatusEvent OnTask = {read=FOnTask, write=FOnTask};
__property TMySQLThreadStatusEvent OnTimeOut = {read=FOnTimeOut, write=FOnTimeOut};
__property TMySQLThreadStatusEvent OnIdle = {read=FOnIdle, write=FOnIdle};
};
//-- var, const, procedure ---------------------------------------------------
static const Word MYSQL_START = 0x4bb;
static const Word MYSQL_NOTIFY_START = 0x4bb;
static const Word MYSQL_NOTIFY_EXCEPT = 0x4bb;
static const Word MYSQL_NOTIFY_MSG = 0x4bc;
static const Word MYSQL_NOTIFY_STATUS = 0x4bd;
static const Word MYSQL_NOTIFY_TASK = 0x4be;
static const Word MYSQL_PROGRESS = 0x4bf;
static const Word MYSQL_PROGRESS_POS = 0x4c0;
static const Word MYSQL_PROGRESS_SPEED = 0x4c1;
static const Shortint stNone = 0x0;
static const Shortint stIdle = 0x1;
static const Shortint stError = 0x2;
static const Shortint stConnected = 0x10;
static const Shortint stDisconnected = 0x11;
static const Shortint stSQL = 0x20;
extern PACKAGE bool __fastcall ThreadWaitSQLFree(Mysqlserver::TMySQLServer* AServer, const AnsiString ASQL, HWND AHandle = (HWND)(0x0));
extern PACKAGE unsigned __fastcall ThreadSQLFree(Mysqlserver::TMySQLServer* AServer, const AnsiString ASQL, Classes::TNotifyEvent ANotify = 0x0, HWND AHandle = (HWND)(0x0));
extern PACKAGE void __fastcall ThreadSQLAnswer(Mysqlserver::TMySQLServer* AServer, const AnsiString ASQL, HWND AHandle = (HWND)(0x0), int AMsgType = 0x0, int ARef = 0x0);
extern PACKAGE void __fastcall ThreadDatasetOpen(Mysqldataset::TMySQLDatasetBase* ADataset, Classes::TNotifyEvent ANotify = 0x0, bool AWaitFor = false);
} /* namespace Mysqlthread */
using namespace Mysqlthread;
#pragma option pop // -w-
#pragma option pop // -Vx
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // MySQLThread
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -