#ifndef StatistikChat_H
#define StatistikChat_H

#include <Fenster.h>
#include <Knopf.h>
#include <KSGNetwork.h>
#include <BilderV.h>
#include <Rahmen.h>

using namespace Framework;

class ChatListeSpieler
{
private:
	void( *addChatF )( void *, int );
	void( *addFreundF )( void *, int );
	void( *accountAnsehenF )( void *, int );
	void *nachrichtParam;
	int accountId;
	AlphaFeld *bg;
	TextFeld *name;
	Knopf *accountAnsehen;
	Knopf *nachrichtSenden;
	Knopf *freundesanfrageSenden;
	Punkt pos;
	Punkt gr;
	bool online;
	int minKnopfX;
	int knopfX;
	bool mausIn;
	double tickVal;
	bool rend;
	int ref;

public:
	// Konstruktor
	ChatListeSpieler( int accountId, int eigeneId, Schrift *zSchrift, BilderV *bilder, KSGClient::InformationServerClient *zInfoc,
											  bool istFreund, void( *addChatF )( void*, int ), void( *addFreundF )( void*, int ),
											  void( *accountAnsehenF )( void *, int ), void *param );
	// Destruktor
	~ChatListeSpieler();
	// nicht constant
	void setOffline();
	void setPosition( int y );
	void doMausEreignis( MausEreignis &me );
	bool tick( double tickVal );
	void render( Bild &zRObj );
	// constant
	int getAccountId() const;
	// Reference Counting
	ChatListeSpieler *getThis();
	ChatListeSpieler *release();
};

class ChatListe
{
private:
	void( *addChat )( void *, int );
	void( *addFreund )( void *, int );
	void( *accountAnsehen )( void *, int );
	void *nachrichtParam;
	int eigeneId;
	RCArray< ChatListeSpieler > *spieler;
	VScrollBar *vScroll;
	Punkt pos;
	Punkt gr;
    KSGClient::InformationServerClient *infoc;
	Schrift *schrift;
	BilderV *bilder;
	LRahmen *ram;
	bool rend;
	int ref;

public:
	// Konstruktor
	ChatListe( int eigeneId, KSGClient::InformationServerClient *infoc, Schrift *schrift, BilderV *bilder,
									   void( *addChat )( void*, int ), void( *addFreund )( void*, int ),
									   void( *accountAnsehen )( void *, int ), void *param );
	// Destruktor
	~ChatListe();
	// nicht constant
	void addSpieler( int accountId, bool istFreund );
	void setOffline( int accountId );
	void doMausEreignis( MausEreignis &me );
	bool tick( double tickVal );
	void render( Bild &zRObj );
	// constant

	// Reference Counting
	ChatListe *getThis();
	ChatListe *release();
};

class StatistikChat
{
private:
	void( *addNachricht )( void *, Text *, Text *, Text *, Text * );
	void *nachrichtParam;
    KSGClient::SpielServerClient *spielc;
    KSGClient::InformationServerClient *infoc;
	TextFeld *verlauf;
	TextFeld *nachricht;
	Knopf *senden;
	Knopf *verlassen;
	ChatListe *spielerListe;
	bool beenden;
	int ref;

public:
	// Konstruktor
	StatistikChat( int eigeneId, KSGClient::SpielServerClient *spielc, KSGClient::InformationServerClient *infoc, Schrift *schrift, BilderV *bilder,
										   void( *addNachricht )( void *, Text *, Text *, Text *, Text * ),
										   void( *addChat )( void*, int ), void( *addFreund )( void*, int ),
										   void( *accountAnsehen )( void *, int ), void *param );
	// Destruktor
	~StatistikChat();
	// nicht constant
	void addSpieler( int accountId, bool istFreund );
	void spielerOffline( int accountId );
	void addChatNachricht( int vonAccount, char *nachricht );
	void doMausEreignis( MausEreignis &me );
	void doTastaturEreignis( TastaturEreignis &te );
	bool tick( double tickVal );
	void render( Bild &zRObj );
	// constant
	bool hatVerlassen();
	// Reference Counting
	StatistikChat *getThis();
	StatistikChat *release();
};

#endif