diff options
Diffstat (limited to 'protocols/YAMN/src/account.h')
-rw-r--r-- | protocols/YAMN/src/account.h | 167 |
1 files changed, 81 insertions, 86 deletions
diff --git a/protocols/YAMN/src/account.h b/protocols/YAMN/src/account.h index cadd83a1ec..afe325fcef 100644 --- a/protocols/YAMN/src/account.h +++ b/protocols/YAMN/src/account.h @@ -12,49 +12,49 @@ #include <windows.h> #include <tchar.h> - // - //================================== OTHER DEFINITIONS ======================================== - // +// +// ================================== OTHER DEFINITIONS ======================================== +// +// Error codes returned from functions (services) working with account book files enum { - // Error codes returned from functions (services) working with account book files - EACC_SYSTEM = 1, //use GetLastError() to retrieve detailed information about error - EACC_ALLOC, //problem with memory allocation - EACC_FILECOMPATIBILITY, //file is corrupted - EACC_ENDOFFILE, //unexpected end of file occured - EACC_FILEVERSION, //file should be YAMN book format, but newer version that expected - EACC_FILESIZE, //file has wrong size + EACC_SYSTEM = 1, // use GetLastError() to retrieve detailed information about error + EACC_ALLOC, // problem with memory allocation + EACC_FILECOMPATIBILITY, // file is corrupted + EACC_ENDOFFILE, // unexpected end of file occured + EACC_FILEVERSION, // file should be YAMN book format, but newer version that expected + EACC_FILESIZE, // file has wrong size }; +// Status of account +// used in messages WM_YAMN_CHANGESTATUS +// used also in function GetStatus and SetStatus enum { - // Status of account - // used in messages WM_YAMN_CHANGESTATUS - // used also in function GetStatus and SetStatus - ACC_IDLE = 0, //account is IDLE (no work is performed with account) - ACC_FINDING, //DNS lookup for account - ACC_CONNECTING, //connecting in progress - ACC_LOGGING, //logging in progress - ACC_WORKING, //working - ACC_DISCONNECTING, //disconnecting from server + ACC_IDLE = 0, // account is IDLE (no work is performed with account) + ACC_FINDING, // DNS lookup for account + ACC_CONNECTING, // connecting in progress + ACC_LOGGING, // logging in progress + ACC_WORKING, // working + ACC_DISCONNECTING, // disconnecting from server }; -#define YAMN_ACC_MSG 0x00000002 // Shows dialog -#define YAMN_ACC_ICO 0x00000004 // Shows system tray icon (1) -#define YAMN_ACC_ICOB 0x00000008 // not used now, enables tray icon flashing (1) -#define YAMN_ACC_APP 0x00000010 // Runs application (1) -#define YAMN_ACC_POP 0x00000020 // Shows popup -#define YAMN_ACC_POPC 0x00000040 // Use custom colors in popup -#define YAMN_ACC_MSGP 0x00000080 // Persistant messgage. This means, when an situation occurs (e.g. new mail) and message is displayed, it is not destroyed when YAMN_ACC_MSG is not set -#define YAMN_ACC_KBN 0x00000100 // Use Keyboard notify -#define YAMN_ACC_CONT 0x00000200 // Use Contact notify -#define YAMN_ACC_CONTNICK 0x00000400 // Use Contact Nick replacement -#define YAMN_ACC_CONTNOEVENT 0x00000800 // Suppress event for this contact +#define YAMN_ACC_MSG 0x00000002 // Shows dialog +#define YAMN_ACC_ICO 0x00000004 // Shows system tray icon (1) +#define YAMN_ACC_ICOB 0x00000008 // not used now, enables tray icon flashing (1) +#define YAMN_ACC_APP 0x00000010 // Runs application (1) +#define YAMN_ACC_POP 0x00000020 // Shows popup +#define YAMN_ACC_POPC 0x00000040 // Use custom colors in popup +#define YAMN_ACC_MSGP 0x00000080 // Persistant messgage. This means, when an situation occurs (e.g. new mail) and message is displayed, it is not destroyed when YAMN_ACC_MSG is not set +#define YAMN_ACC_KBN 0x00000100 // Use Keyboard notify +#define YAMN_ACC_CONT 0x00000200 // Use Contact notify +#define YAMN_ACC_CONTNICK 0x00000400 // Use Contact Nick replacement +#define YAMN_ACC_CONTNOEVENT 0x00000800 // Suppress event for this contact struct YAMN_NOTIFICATION { - //(1) - usable only in newmail notification + // (1) - usable only in newmail notification DWORD Flags = 0; COLORREF PopupB = 0; @@ -82,9 +82,9 @@ struct CServer char *Passwd = nullptr; }; -// -//================================== ACCOUNT DEFINITION ================================== -// +// +// ================================== ACCOUNT DEFINITION ================================== +// #define WAIT_FINISH WAIT_OBJECT_0+1 @@ -232,69 +232,64 @@ struct SWriteGuard ///////////////////////////////////////////////////////////////////////////////////////// // CAccount - basic email account class +// YAMN account flags (set by user) +#define YAMN_ACC_ENA 0x00000001 // Enables account. If account is disabled, no countdown is performed +#define YAMN_ACC_POPN 0x00000002 // Shows one popup per one new mail or for N mails +#define YAMN_ACC_APOP 0x00000004 // Use APOP authentication +#define YAMN_ACC_SSL23 0x00000008 // Use SSLv2,3 +#define YAMN_ACC_NOTLS 0x00000010 // Don't try StartTLS (STLS) even available +#define YAMN_ACC_BODY 0x00000020 // Always retrieve body of the message + +// YAMN ability flags (set by plugin) +#define YAMN_ACC_BROWSE 0x00000001 // Can browse mails. On this account we can run mailbrowser window +#define YAMN_ACC_POPUP 0x00000002 // Popups of new mail belonging to this account can be showed + +// YAMN account status flags +#define YAMN_ACC_ST0 0x00000001 // Check (countdown) when Offline +#define YAMN_ACC_ST1 0x00000002 // Check (countdown) when Online +#define YAMN_ACC_ST2 0x00000004 // Check (countdown) when Away +#define YAMN_ACC_ST3 0x00000008 // Check (countdown) when Not available +#define YAMN_ACC_ST4 0x00000010 // Check (countdown) when Occupied +#define YAMN_ACC_ST5 0x00000020 // Check (countdown) when DND +#define YAMN_ACC_ST6 0x00000040 // Check (countdown) when Free for chat +#define YAMN_ACC_ST7 0x00000080 // Check (countdown) when Invisible + +#define YAMN_ACC_STARTA 0x00010000 // Check on start anyway +#define YAMN_ACC_STARTS 0x00020000 // Check on start regarding to status setting +#define YAMN_ACC_FORCE 0x00040000 // Check when "check new mail" item pressed (it is called forced checking) + struct CAccount : public MZeroedObject { - #define YAMN_ACCOUNTFILEVERSION 2 //version of standard file format (YAMN book file format) - // If changes are made in this structure, version is changed. // So then YAMN does not initialzie your structure, if version does not matches. + #define YAMN_ACCOUNTFILEVERSION 2 // version of standard file format (YAMN book file format) - BOOL AbleToWork; // This is set to TRUE by default. When it is needed to stop working on this account, YAMN sets this to zero. - - struct YAMN_PROTOPLUGIN *Plugin; // free access, because this member should not be changed. The same as YAMN_PLUGIN structure - - char *Name; // access only through AccountAccessSO - - CServer *Server; //access only through AccountAccessSO - - WORD Interval; //access only through AccountAccessSO - - // YAMN account flags (set by user) - #define YAMN_ACC_ENA 0x00000001 //Enables account. If account is disabled, no countdown is performed - #define YAMN_ACC_POPN 0x00000002 //Shows one popup per one new mail or for N mails - #define YAMN_ACC_APOP 0x00000004 //Use APOP authentication - #define YAMN_ACC_SSL23 0x00000008 //Use SSLv2,3 - #define YAMN_ACC_NOTLS 0x00000010 //Don't try StartTLS (STLS) even available - #define YAMN_ACC_BODY 0x00000020 //Always retrieve body of the message - DWORD Flags; //access only through AccountAccessSO - - // YAMN account flags (set by plugin) - #define YAMN_ACC_BROWSE 0x00000001 //Can browse mails. On this account we can run mailbrowser window - #define YAMN_ACC_POPUP 0x00000002 //Popups of new mail belonging to this account can be showed - DWORD AbilityFlags; - - // YAMN account status flags - #define YAMN_ACC_ST0 0x00000001 // Check (countdown) when Offline - #define YAMN_ACC_ST1 0x00000002 // Check (countdown) when Online - #define YAMN_ACC_ST2 0x00000004 // Check (countdown) when Away - #define YAMN_ACC_ST3 0x00000008 // Check (countdown) when Not available - #define YAMN_ACC_ST4 0x00000010 // Check (countdown) when Occupied - #define YAMN_ACC_ST5 0x00000020 // Check (countdown) when DND - #define YAMN_ACC_ST6 0x00000040 // Check (countdown) when Free for chat - #define YAMN_ACC_ST7 0x00000080 // Check (countdown) when Invisible + // This is set to TRUE by default. When it is needed to stop working on this account, YAMN sets this to zero. + BOOL AbleToWork; - #define YAMN_ACC_STARTA 0x00010000 // Check on start anyway - #define YAMN_ACC_STARTS 0x00020000 // Check on start regarding to status setting - #define YAMN_ACC_FORCE 0x00040000 // Check when "check new mail" item pressed (it is called forced checking) - DWORD StatusFlags; // access only through AccountAccessSO + struct YAMN_PROTOPLUGIN *Plugin; // free access, because this member should not be changed. The same as YAMN_PLUGIN structure - // Plugin flags. Use this DWORD if you want YAMN to store it to YAMN book file. You can set here any value - DWORD PluginFlags; + char *Name; // access only through AccountAccessSO + CServer *Server; // access only through AccountAccessSO + WORD Interval; // access only through AccountAccessSO + DWORD Flags; // access only through AccountAccessSO + DWORD AbilityFlags; // access only through AccountAccessSO + DWORD StatusFlags; // access only through AccountAccessSO - YAMN_NOTIFICATION NewMailN; //access only through AccountAccessSO - YAMN_NOTIFICATION NoNewMailN; //access only through AccountAccessSO - YAMN_NOTIFICATION BadConnectN; //access only through AccountAccessSO + YAMN_NOTIFICATION NewMailN; // access only through AccountAccessSO + YAMN_NOTIFICATION NoNewMailN; // access only through AccountAccessSO + YAMN_NOTIFICATION BadConnectN; // access only through AccountAccessSO - SYSTEMTIME LastChecked; //last check, access only through AccountAccessSO - SYSTEMTIME LastSChecked; //last check (successfull), access only through AccountAccessSO - SYSTEMTIME LastSynchronised; //last synchronisation (successfull), access only through AccountAccessSO - SYSTEMTIME LastMail; //last check when new mail detected, access only through AccountAccessSO + SYSTEMTIME LastChecked; // last check, access only through AccountAccessSO + SYSTEMTIME LastSChecked; // last check (successfull), access only through AccountAccessSO + SYSTEMTIME LastSynchronised; // last synchronisation (successfull), access only through AccountAccessSO + SYSTEMTIME LastMail; // last check when new mail detected, access only through AccountAccessSO - TCHAR Status[255]; //access only through GetStatusFcn() and SetStatusFcn() functions + TCHAR Status[255]; // access only through GetStatusFcn() and SetStatusFcn() functions - DWORD TimeLeft; //access only through AccountAccessSO + DWORD TimeLeft; // access only through AccountAccessSO - HANDLE Mails; //access only through MessagesAccessSO + HANDLE Mails; // access only through MessagesAccessSO // Account members are mostly the same, but there can be protocol (POP3,IMAP...) special features. // To use them, only inherit this class and add your own features. @@ -322,7 +317,7 @@ struct CAccount : public MZeroedObject // Use MsgsWaitToRead(),MsgsReadDone(),MsgsWaitToWrite(),MsgsWriteDone() synchronization functions SWMRG MessagesAccessSO; - //For clist contact notification + // For clist contact notification MCONTACT hContact; BOOL isCounting; |