• Main Page
  • Classes
  • Files
  • File List

CEvent.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2012 Bolton Software Ltd.
00004  * Copyright (C) 2004 Chris Schoeneman
00005  * 
00006  * This package is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * found in the file COPYING that should have accompanied this file.
00009  * 
00010  * This package is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  */
00018 
00019 #ifndef CEVENT_H
00020 #define CEVENT_H
00021 
00022 #include "BasicTypes.h"
00023 #include "stdmap.h"
00024 
00025 class CEventData {
00026 public:
00027     CEventData() { }
00028     virtual ~CEventData() { }
00029 };
00030 
00032 
00035 class CEvent {
00036 public:
00037     typedef UInt32 Type;
00038     enum {
00039         kUnknown,   
00040         kQuit,      
00041         kSystem,    
00042         kTimer,     
00043         kLast       
00044     };
00045 
00046     typedef UInt32 Flags;
00047     enum {
00048         kNone               = 0x00, 
00049         kDeliverImmediately = 0x01, 
00050         kDontFreeData       = 0x02  
00051     };
00052 
00053     CEvent();
00054 
00056 
00065     CEvent(Type type, void* target = NULL, void* data = NULL,
00066                              Flags flags = kNone);
00067 
00069 
00070 
00072 
00075     static void         deleteData(const CEvent&);
00076     
00078 
00082     void                setDataObject(CEventData* dataObject);
00083 
00085 
00086 
00087 
00089 
00092     Type                getType() const;
00093 
00095 
00098     void*               getTarget() const;
00099 
00101 
00104     void*               getData() const;
00105 
00107 
00112     CEventData*         getDataObject() const;
00113 
00115 
00118     Flags               getFlags() const;
00119     
00121 
00122 private:
00123     Type                m_type;
00124     void*               m_target;
00125     void*               m_data;
00126     Flags               m_flags;
00127     CEventData*         m_dataObject;
00128 };
00129 
00130 #endif

Generated on Wed Jun 19 2013 00:00:05 for Synergy by  doxygen 1.7.1