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