Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

msghook.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                msghook.h  -  Action executed on specific message
00003                              -------------------
00004     begin                : Tue Dec 17 2002
00005     copyright            : (C) 2002 by Mattias Jansson
00006     email                : mattias@realityrift.com
00007  ***************************************************************************
00008  
00009  The contents of this file are subject to the Mozilla Public License Version
00010  1.1 (the "License"); you may not use this file except in compliance with
00011  the License. You may obtain a copy of the License at 
00012  http://www.mozilla.org/MPL/
00013 
00014  Software distributed under the License is distributed on an "AS IS" basis,
00015  WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00016  for the specific language governing rights and limitations under the
00017  License.
00018 
00019  The Original Code is the NeoEngine, NeoWTK, msghook.h
00020 
00021  The Initial Developer of the Original Code is Mattias Jansson.
00022  Portions created by Mattias Jansson are Copyright (C) 2002
00023  Reality Rift Studios. All Rights Reserved.
00024 
00025  ***************************************************************************/
00026 
00027 #ifndef __NEOWTKMSGHOOK_H
00028 #define __NEOWTKMSGHOOK_H
00029 
00030 
00031 #include "base.h"
00032 #include "msg.h"
00033 
00034 #ifdef HAVE_NEOCHUNKIO
00035 #  include <neochunkio/complex.h>
00036 #  include "chunktype.h"
00037 #endif
00038 
00039 
00046 namespace NeoWTK
00047 {
00048 
00049 
00050 // Forward declarations
00051 class MsgHook;
00052 
00053 
00058 class NEOWTK_API MsgHookMethod
00059 {
00060     public:
00061 
00067         virtual void                                  ProcessHook( MsgHook *pkHook, Msg *pkMsg ) = 0;
00068 };
00069 
00070 
00075 class NEOWTK_API MsgHook
00076 {
00077     public:
00078 
00080         Msg::MSGID                                    m_eID;
00081 
00083         Object                                       *m_pkSender;
00084 
00086         Object                                       *m_pkReceiver;
00087 
00089         MsgHookMethod                                *m_pkProcessor;
00090 
00092         bool                                          m_bDeleteProcessor;
00093 
00094 
00097                                                       MsgHook();
00098 
00106                                                       MsgHook( Msg::MSGID eID, Object *pkSender, Object *pkReceiver, MsgHookMethod *pkProcessor, bool bDeleteProcessor = false );
00107 
00110         virtual                                      ~MsgHook();
00111 
00116         virtual bool                                  IsHook( Msg *pkMsg );
00117 };
00118 
00119 
00120 #ifdef HAVE_NEOCHUNKIO
00121 
00122 
00127 class NEOWTK_API MsgHookChunk : public NeoChunkIO::ComplexChunk
00128 {
00129     public:
00130 
00131 
00133         MsgHook                                      *m_pkHook;
00134 
00135 
00142                                                       MsgHookChunk( unsigned short usType, const NeoEngine::HashString &rstrType, const NeoEngine::HashString &rstrID = "" ) : NeoChunkIO::ComplexChunk( usType, rstrType, rstrID ), m_pkHook( 0 ) { m_usFindType = NeoWTK::ChunkType::MSGHOOK; }
00143         
00147         virtual                                      ~MsgHookChunk();
00148 
00155         virtual int                                   ParseData( unsigned int uiFlags, NeoEngine::FileManager *pkFileManager );
00156 };
00157 
00158 
00159 #endif
00160 
00161 
00162 };
00163 
00164 
00165 #endif

Generated on Wed Jan 21 14:21:20 2004 for NeoWTK by doxygen 1.3.5