source: filezilla/trunk/fuentes/src/interface/asyncrequestqueue.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 1.4 KB
Line 
1#ifndef __ASYNCREQUESTQUEUE_H__
2#define __ASYNCREQUESTQUEUE_H__
3
4#include <wx/timer.h>
5
6class CMainFrame;
7class CQueueView;
8class CVerifyCertDialog;
9
10class CAsyncRequestQueue : public wxEvtHandler
11{
12public:
13        CAsyncRequestQueue(CMainFrame *pMainFrame);
14        ~CAsyncRequestQueue();
15
16        bool AddRequest(CFileZillaEngine *pEngine, std::unique_ptr<CAsyncRequestNotification> && pNotification);
17        void ClearPending(const CFileZillaEngine* pEngine);
18        void RecheckDefaults();
19
20        void SetQueue(CQueueView *pQueue);
21
22        void TriggerProcessing();
23
24protected:
25
26        // Returns falls if main window doesn't have focus or is minimized.
27        // Request attention if needed
28        bool CheckWindowState();
29
30        CMainFrame *m_pMainFrame;
31        CQueueView *m_pQueueView;
32        CVerifyCertDialog *m_pVerifyCertDlg;
33
34        bool ProcessNextRequest();
35        bool ProcessDefaults(CFileZillaEngine *pEngine, std::unique_ptr<CAsyncRequestNotification> & pNotification);
36
37        struct t_queueEntry
38        {
39                t_queueEntry(CFileZillaEngine *e, std::unique_ptr<CAsyncRequestNotification>&& n)
40                        : pEngine(e)
41                        , pNotification(std::move(n))
42                {
43                }
44
45                CFileZillaEngine *pEngine;
46                std::unique_ptr<CAsyncRequestNotification> pNotification;
47        };
48        std::list<t_queueEntry> m_requestList;
49
50        bool ProcessFileExistsNotification(t_queueEntry &entry);
51
52        DECLARE_EVENT_TABLE()
53        void OnProcessQueue(wxCommandEvent &event);
54        void OnTimer(wxTimerEvent& event);
55
56        // Reentrancy guard
57        bool m_inside_request;
58
59        wxTimer m_timer;
60};
61
62#endif //__ASYNCREQUESTQUEUE_H__
Note: See TracBrowser for help on using the repository browser.