]> git.saurik.com Git - wxWidgets.git/blame - include/wx/private/fdiohandler.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / private / fdiohandler.h
CommitLineData
3327957c
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/private/fdiohandler.h
3// Purpose: declares wxFDIOHandler class
4// Author: Vadim Zeitlin
5// Created: 2009-08-17
3327957c
VZ
6// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7// Licence: wxWindows licence
8///////////////////////////////////////////////////////////////////////////////
9
10#ifndef _WX_PRIVATE_FDIOHANDLER_H_
11#define _WX_PRIVATE_FDIOHANDLER_H_
12
13// ----------------------------------------------------------------------------
14// wxFDIOHandler: interface used to process events on file descriptors
15// ----------------------------------------------------------------------------
16
17class wxFDIOHandler
18{
19public:
6bcc1145
VZ
20 wxFDIOHandler() { m_regmask = 0; }
21
3327957c
VZ
22 // called when descriptor is available for non-blocking read
23 virtual void OnReadWaiting() = 0;
24
25 // called when descriptor is available for non-blocking write
26 virtual void OnWriteWaiting() = 0;
27
28 // called when there is exception on descriptor
29 virtual void OnExceptionWaiting() = 0;
30
31 // called to check if the handler is still valid, only used by
32 // wxSocketImplUnix currently
33 virtual bool IsOk() const { return true; }
34
6bcc1145
VZ
35
36 // get/set the mask of events for which we're currently registered for:
37 // it's a combination of wxFDIO_{INPUT,OUTPUT,EXCEPTION}
38 int GetRegisteredEvents() const { return m_regmask; }
39 void SetRegisteredEvent(int flag) { m_regmask |= flag; }
40 void ClearRegisteredEvent(int flag) { m_regmask &= ~flag; }
41
42
3327957c
VZ
43 // virtual dtor for the base class
44 virtual ~wxFDIOHandler() { }
6bcc1145
VZ
45
46private:
47 int m_regmask;
48
49 wxDECLARE_NO_COPY_CLASS(wxFDIOHandler);
3327957c
VZ
50};
51
52#endif // _WX_PRIVATE_FDIOHANDLER_H_
53