~ubuntu-branches/ubuntu/maverick/qgo/maverick

« back to all changes in this revision

Viewing changes to src/igsinterface.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2005-01-01 23:07:10 UTC
  • Revision ID: james.westby@ubuntu.com-20050101230710-fhng6yidm47xlb2i
Tags: upstream-1.0.0-r2
ImportĀ upstreamĀ versionĀ 1.0.0-r2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* IGSInterface.h
 
3
*/
 
4
 
 
5
#ifndef IGSINTERFACE_H
 
6
#define IGSINTERFACE_H
 
7
 
 
8
#include <qstring.h>
 
9
 
 
10
 
 
11
// maybe this should be elsewhere ...
 
12
typedef void (*callBackFP_t)(const char*, unsigned);
 
13
 
 
14
template <class T>  class callBackImpl 
 
15
{
 
16
public:
 
17
        callBackImpl()  
 
18
        { 
 
19
                callbackFP = NULL;
 
20
        }
 
21
        
 
22
        void registerCallback(T fp) 
 
23
        {
 
24
                if (fp != NULL) callbackFP = fp;
 
25
        };
 
26
        
 
27
protected:
 
28
        T callbackFP;
 
29
};
 
30
 
 
31
 
 
32
class IGSInterface : public callBackImpl<callBackFP_t>
 
33
{
 
34
public:
 
35
        IGSInterface() { }    
 
36
        virtual ~IGSInterface() { }
 
37
        
 
38
        virtual bool isConnected()=0;
 
39
        virtual bool openConnection(const char *host, unsigned port,
 
40
                const char *user=0, const char *pass=0)=0;
 
41
        virtual bool closeConnection()=0;
 
42
        virtual void sendTextToHost(const char *txt)=0;
 
43
        virtual const char* getUsername()=0;
 
44
};
 
45
#endif