2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
11 #ifndef ICSCONNECTION_H
12 #define ICSCONNECTION_H
15 #include <boost/shared_ptr.hpp>
17 #include <QStringList>
18 #include "connection.h"
19 #include "icsgamedata.h"
27 class ICSConnection
: public Connection
{
37 static QRegExp pressReturn
;
38 static QRegExp creating
;
41 static QRegExp password
;
44 static QRegExp unexamine
, unobserve
;
45 static QRegExp move_list_start
, move_list_players
, move_list_game
,
46 move_list_ignore1
, move_list_ignore2
, move_list_terminator
;
47 static QRegExp observed_game
;
48 static QRegExp goForward
, goBack
;
50 GameInfo
* incomingGameInfo
;
51 int m_processed_offset
;
52 std::map
<int, ICSGameData
> m_games
;
54 int m_move_list_game_num
;
55 QStringList m_move_list_players
;
56 GameInfo
*m_move_list_game_info
;
57 PositionInfo
*m_move_list_position_info
;
58 PoolInfo
*m_move_list_pool_info
;
61 bool test(const QRegExp
& pattern
, const QString
& str
);
65 void setListener(int gameNumber
, const boost::weak_ptr
<ICSListener
>& listener
);
68 void process(QString str
);
69 void processPartialLine(QString str
);
72 void moves(const PGN
&);
75 void passwordPrompt();
77 void registeredNickname();
78 void creatingGame(const GameInfo
*, const PositionInfo
&);
79 void creatingExaminedGame(const GameInfo
*, const PositionInfo
&);
80 void creatingObservedGame(const GameInfo
*, const PositionInfo
&);
81 void endingGame(const QString
&, const QString
&);
82 void endingExaminedGame(int);
83 void endingObservedGame(int);
86 #endif // ICSCONNECTION_H