VR-Forces 4.0.4 Class Documentation
include/tmqt/eventHandlerFactory.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: eventHandlerFactory.h,v $ $Revision: 1.4 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef EVENTHANDLERFACTORY_H
00013 #define EVENTHANDLERFACTORY_H
00014 
00015 #include "tmqt/tmqtDefines.h"
00016 #include <QtCore/QHash>
00017 
00018 class DtEventHandler;
00019 class DtEventController;
00020 
00021 typedef DtEventHandler* (*DtHandlerCreate)(DtEventController* controller, void* use);
00022 class DT_DLL_tmqt DtHandlerCreateInfo
00023 {
00024 public:
00025    DtHandlerCreateInfo() {};
00026    DtHandlerCreateInfo(DtHandlerCreate fcn, void *usr, bool appLevel = false);
00027    DtHandlerCreateInfo(const DtHandlerCreateInfo& orig) :
00028       myCallback(orig.myCallback), myUserData(orig.myUserData), myAppLevel(orig.myAppLevel) {};
00029 
00030    virtual ~DtHandlerCreateInfo();
00031    
00032    virtual DtHandlerCreate callback();
00033    virtual void* usertoLatin1();
00034    virtual bool appLevel();
00035 
00036 protected:
00037    DtHandlerCreate myCallback;
00038    void* myUserData;
00039 
00041    bool myAppLevel;
00042 };
00043 
00046 class DT_DLL_tmqt DtEventHandlerFactory
00047 {
00048 public:
00049    DtEventHandlerFactory(DtEventController* controller);
00050    virtual ~DtEventHandlerFactory();
00051 
00052 public:
00055    virtual void addHandlerCreate(int type, DtHandlerCreate fcn, void* usr = NULL);
00056    virtual void removeHandlerCreate(int type);
00057 
00059    virtual DtEventHandler* createHandler(int type);
00060 
00062    virtual DtEventController* eventController() const;
00063 
00064 protected:
00065    QHash<int, DtHandlerCreateInfo> myHandlers;
00066    DtEventController* myEventController;
00067 };
00068 
00069 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)