diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-14 13:35:25 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2012-10-14 13:35:25 +0000 |
commit | 50feaa0ffc1b2e120eb6b22b2970f5bc2f7dc7a4 (patch) | |
tree | 369eb024d7b0b851f0d34482c93a994fec80d728 /plugins/TabSRMM/include/sendlater.h | |
parent | ab290eb57836929b5b87a796ac4dfa06292515c8 (diff) |
TabSRMM: folders restructurization
git-svn-id: http://svn.miranda-ng.org/main/trunk@1923 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/include/sendlater.h')
-rw-r--r-- | plugins/TabSRMM/include/sendlater.h | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/plugins/TabSRMM/include/sendlater.h b/plugins/TabSRMM/include/sendlater.h deleted file mode 100644 index a81c08f4ae..0000000000 --- a/plugins/TabSRMM/include/sendlater.h +++ /dev/null @@ -1,155 +0,0 @@ -/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
- * Miranda NG: the free IM client for Microsoft* Windows*
- *
- * Copyright 2000-2009 Miranda ICQ/IM project,
- * all portions of this codebase are copyrighted to the people
- * listed in contributors.txt.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * you should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * part of tabSRMM messaging plugin for Miranda.
- *
- * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
- *
- * $Id: sendlater.h 11707 2010-05-05 13:53:11Z silvercircle $
- *
- * the sendlater class
- */
-
-#ifndef __SENDLATER_H
-#define __SENDLATER_H
-
-#define TIMERID_SENDLATER 12000
-#define TIMERID_SENDLATER_TICK 13000
-
-#define TIMEOUT_SENDLATER 10000
-#define TIMEOUT_SENDLATER_TICK 200
-
-class CSendLaterJob {
-
-public:
- /*
- * job status/error codes
- */
- enum {
- INVALID_CONTACT = 'I',
- JOB_DEFERRED = 'D',
- JOB_AGE = 'O',
- JOB_MYSTATUS = 'M',
- JOB_STATUS = 'S',
- JOB_WAITACK = 'A',
- JOB_REMOVABLE = 'R',
- JOB_HOLD = 'H',
- };
- /*
- * internal flags
- */
- enum {
- SLF_SUSPEND = 1,
- SLF_INVALID = 2
- };
- void readFlags();
- void writeFlags();
- void cleanDB();
- bool isPersistentJob();
- bool mustDelete();
- CSendLaterJob();
- ~CSendLaterJob();
- char szId[20]; // database key name (time stamp of original send)
- HANDLE hContact; // original contact where the message has been assigned
- HANDLE hTargetContact; // *real* contact (can be different for metacontacts, e.g).
- HANDLE hProcess; // returned from the protocols sending service. needed to find it in the ACK handler
- time_t created; // job was created at this time (important to kill jobs, that are too old)
- time_t lastSent; // time at which the delivery was initiated. used to handle timeouts
- char *sendBuffer; // utf-8 send buffer
- PBYTE pBuf; // conventional send buffer (for non-utf8 protocols)
- DWORD dwFlags;
- int iSendCount; // # of times we tried to send it...
- bool fSuccess, fFailed;
- BYTE bCode; // error/progress code (for the UI)
-};
-
-typedef std::vector<CSendLaterJob *>::iterator SendLaterJobIterator;
-
-class CSendLater {
-
-public:
- enum {
- SENDLATER_AGE_THRESHOLD = (86400 * 3), // 3 days, older messages will be removed from the db.
- SENDLATER_RESEND_THRESHOLD = 180, // timeouted messages should be resent after that many seconds
- SENDLATER_PROCESS_INTERVAL = 50 // process the list of waiting job every this many seconds
- };
-
- CSendLater();
- ~CSendLater();
- bool isAvail() const { return(m_fAvail); }
- bool isInteractive() const { return(m_fIsInteractive); }
- bool isJobListEmpty() const { return(m_sendLaterJobList.empty() ? true : false); }
- bool haveErrorPopups() const { return(m_fErrorPopups); }
- bool haveSuccessPopups() const { return(m_fSuccessPopups); }
- void startJobListProcess();
- time_t lastProcessed() const { return(m_last_sendlater_processed); }
- void setLastProcessed(const time_t _t) { m_last_sendlater_processed = _t; }
- void flushQueue() { m_last_sendlater_processed = 0; }
- bool haveJobs() const
- {
- if (m_sendLaterJobList.empty() || m_jobIterator == m_sendLaterJobList.end())
- return(false);
- else
- return(true);
- }
- bool processCurrentJob();
- void processContacts();
- int addJob(const char *szSetting, LPARAM lParam);
- void addContact(const HANDLE hContact);
- static int _cdecl addStub(const char *szSetting, LPARAM lParam);
- HANDLE processAck(const ACKDATA *ack);
-
- void invokeQueueMgrDlg();
- void qMgrUpdate(bool fReEnable = false);
- static INT_PTR svcQMgr(WPARAM wParam, LPARAM lParam);
-
-private:
- void processSingleContact(const HANDLE hContact);
- int sendIt(CSendLaterJob *job);
-
- INT_PTR CALLBACK DlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- static INT_PTR CALLBACK DlgProcStub(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- void qMgrFillList(bool fClear = true);
- void qMgrSetupColumns();
- void qMgrSaveColumns();
- LRESULT qMgrAddFilter(const HANDLE hContact, const TCHAR* tszNick);
-
- std::vector<HANDLE> m_sendLaterContactList;
- std::vector<CSendLaterJob *> m_sendLaterJobList;
- bool m_fAvail;
- bool m_fIsInteractive;
- bool m_fErrorPopups;
- bool m_fSuccessPopups;
- time_t m_last_sendlater_processed;
- SendLaterJobIterator m_jobIterator;
-
- HWND m_hwndDlg;
- HWND m_hwndList, m_hwndFilter;
- HANDLE m_hFilter; // contact handle to filter the qmgr list (0 = no filter, show all)
- LRESULT m_sel; // index of the combo box entry corresponding to the contact filter;
-};
-
-extern CSendLater* sendLater;
-
-#endif /* __SENDLATER_H */
|