text_cliframe.h 1.41 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
    This file is part of Kismet

    Kismet is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    Kismet is distributed in the hope that it will be useful,
      but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Kismet; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

19 20
#ifndef __TEXTCLIFRAME_H__
#define __TEXTCLIFRAME_H__
21 22 23

#include "config.h"

24
#include "clinetframework.h"
25

26 27
#define TEXTCLI_PARMS	string text, void *auxptr
typedef void (*textcli_cb)(TEXTCLI_PARMS);
28

29
class TextCliFrame : public ClientFramework {
30
public:
31 32 33
	TextCliFrame() { fprintf(stderr, "FATAL OOPS:  TextCliFrame()\n"); }
	TextCliFrame(GlobalRegistry *in_globalreg);
	virtual ~TextCliFrame();
34

35
	int ParseData();
36

37
    void RegisterNetworkClient(NetworkClient *in_netc);
38

39 40
	int RegisterCallback(textcli_cb in_cb, void *in_aux);
	void RemoveCallback(int in_id);
41

42 43 44 45 46
	struct textcli_cb_s {
		int id;
		textcli_cb cb;
		void *auxptr;
	};
47

48 49 50
protected:
	int next_id;
	vector<textcli_cb_s> callback_vec;
51 52 53
};

#endif
54