From 3634576b3903f8316b1dcdc396a70f40fa43f5f5 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Wed, 18 Jul 2012 06:59:36 +0000 Subject: ExtraIcon, Favcontacts, FileAsMessage, FingerPrintModPlus: changed folder structure git-svn-id: http://svn.miranda-ng.org/main/trunk@1006 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FileAsMessage/src/dialog.h | 120 +++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 plugins/FileAsMessage/src/dialog.h (limited to 'plugins/FileAsMessage/src/dialog.h') diff --git a/plugins/FileAsMessage/src/dialog.h b/plugins/FileAsMessage/src/dialog.h new file mode 100644 index 0000000000..679742c2f6 --- /dev/null +++ b/plugins/FileAsMessage/src/dialog.h @@ -0,0 +1,120 @@ +#include +#include +#include +extern HINSTANCE hInst; + +int getMsgId(char *msg); + +INT_PTR CALLBACK DialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); + +#ifdef _DEBUG + #define CHECKPOINT +#else + #define CHECKPOINT error +#endif + +#define TIMER_SEND 100 + +typedef unsigned int uint; +typedef unsigned char uchar; +typedef unsigned long ulong; +enum +{ + CMD_REQ, + CMD_ACCEPT, + CMD_CANCEL, + + CMD_NEXT, + + CMD_DATA, + CMD_DACK, + CMD_END, + + CMD_COUNT +}; + +extern char cFECmd[CMD_COUNT]; + +#define STATE_IDLE 0x100 // idle, no operation +#define STATE_REQSENT 0x02 // request sent, awaiting of response +#define STATE_PRERECV 0x04 // incoming request, awaiting of user +#define STATE_OPERATE 0x08 // operating mode +#define STATE_ACKREQ 0x10 // ACK-request scheduled +#define STATE_CANCELLED 0x20 // operation aborted +#define STATE_FINISHED 0x40 // ... finished successfully +#define STATE_PAUSED 0x80 // ... paused + +#define CHUNK_UNSENT 0x00 +#define CHUNK_SENT 0x01 +#define CHUNK_ACK 0x02 + +#define ICON_PLAY 0 +#define ICON_PAUSE 1 +#define ICON_REFRESH 2 +#define ICON_STOP 3 +#define ICON_MAIN 4 + +struct FILEECHO +{ +public: + HANDLE hContact; + HWND hDlg; + + bool inSend; + int iState; + int contactStatus; + + HANDLE hFile, hMapping; + uchar *lpData; + + char *filename; + uint chunkIndx; // next chunk to send + uint chunkCount; // count of chunks + uint chunkSent; + uint chunkCountx; + uint *chunkPos; // offsets of chunks in file + uchar *chunkAck; // acknowledge of incoming chunks + + uchar codeSymb; // symb for replace NUL-symb. + + uint fileSize; + uint chunkMaxLen; // limit for outgoing chunk + + DWORD lastTimestamp; + DWORD lastDelay; + bool asBinary; + + // settings + uint dwSendInterval; + //uint dwChunkSize; + + COLORREF rgbSent, rgbRecv, rgbUnSent, rgbToSend; +#ifdef DEBUG + uint overhead; +#endif + + FILEECHO(HANDLE Contact); + + void setState(DWORD state); + void updateProgress(); + void updateTitle(); + + void perform(char *str); + void cmdACCEPT(); + void cmdDACK(char *data); + void sendReq(); + int sendCmd(int id, int cmd, char *szParam, char *szPrefix = NULL); + + void cmdDATA(char *data); + void cmdEND(); + + int createTransfer(); + void destroyTransfer(); + + void onSendTimer(); + void onRecvTimer(); + void incomeRequest(char *data); + +}; + +void InitCRC32(); -- cgit v1.2.3