//
// C++ Interface: net_hattrickconnector
//
// Description:
//
//
// Author: Matthias Feistel <hitman_47@users.sourceforge.net>, (C) 2007
//
// Copyright: See COPYING file that comes with this distribution
//
//

#ifndef NET_HATTRICKCONNECTOR_H_
#define NET_HATTRICKCONNECTOR_H_



class cHattrickConnector
{
private:
    std::string username, securitycode;
    int GetHttp( std::string &document, std::string url );
    int HattrickDateToTimestamp( time_t &timestamp, std::string timestring );
    int XML_to_TeamContainer(std::string document);
public:
    int Login( std::string username, std::string securitycode );
    int Logout( );
    int GetData( );
    int GetMatches( std::string &document, long TeamID );
    int GetNextMatch( long TeamID, long &MatchID,
                      time_t &Time_NextMatch,
                      std::string &HomeTeamName, long &HomeTeamID,
                      std::string &AwayTeamName, long &AwayTeamID );
    // live retrieves all the data for all the matches in TeamContainer and sets the settings
    int Live_addMatch( long MatchID );
    int Live( );  // Laedt nur neue Ereignisse; deshalb gibt es auch eine Funktion namens LoadHattrickData()
    int SearchTeam(long &teamid, std::string teamname);
    int LoadHattrickData(); // Laedt alle Teams zum ersten Mal mit allen Events ab
};




#endif /*NET_HATTRICKCONNECTOR_H_*/
