CEvent.h

00001 /*
00002  * synergy -- mouse and keyboard sharing utility
00003  * Copyright (C) 2004 Chris Schoeneman
00004  * 
00005  * This package is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * found in the file COPYING that should have accompanied this file.
00008  * 
00009  * This package is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  */
00014 
00015 #ifndef CEVENT_H
00016 #define CEVENT_H
00017 
00018 #include "BasicTypes.h"
00019 #include "stdmap.h"
00020 
00022 
00025 class CEvent {
00026 public:
00027     typedef UInt32 Type;
00028     enum {
00029         kUnknown,   
00030         kQuit,      
00031         kSystem,    
00032         kTimer,     
00033         kLast       
00034     };
00035 
00036     typedef UInt32 Flags;
00037     enum {
00038         kNone               = 0x00, 
00039         kDeliverImmediately = 0x01, 
00040         kDontFreeData       = 0x02  
00041     };
00042 
00043     CEvent();
00044 
00046 
00053     CEvent(Type type, void* target = NULL, void* data = NULL,
00054                              UInt32 flags = kNone);
00055 
00057 
00058 
00060 
00063     static Type         registerType(const char* name);
00064 
00066 
00071     static Type         registerTypeOnce(Type& type, const char* name);
00072 
00074 
00078     static const char*  getTypeName(Type type);
00079 
00081 
00084     static void         deleteData(const CEvent&);
00085 
00087 
00088 
00089 
00091 
00094     Type                getType() const;
00095 
00097 
00100     void*               getTarget() const;
00101 
00103 
00106     void*               getData() const;
00107 
00109 
00112     Flags               getFlags() const;
00113     
00115 
00116 private:
00117     Type                m_type;
00118     void*               m_target;
00119     void*               m_data;
00120     Flags               m_flags;
00121 };
00122 
00123 #endif

Generated on Fri Nov 6 00:18:44 2009 for synergy-plus by  doxygen 1.4.7