2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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
{
29 typedef std::map
<int, ICSGameData
> GameList
;
38 static QRegExp pressReturn
;
39 static QRegExp creating
;
42 static QRegExp password
;
45 static QRegExp unexamine
, unobserve
;
46 static QRegExp move_list_start
, move_list_players
, move_list_game
,
47 move_list_ignore1
, move_list_ignore2
, move_list_terminator
;
48 static QRegExp observed_game
;
49 static QRegExp goForward
, goBack
;
51 GameInfo
* incomingGameInfo
;
52 int m_processed_offset
;
55 int m_move_list_game_num
;
56 QStringList m_move_list_players
;
57 GameInfo
*m_move_list_game_info
;
58 PositionInfo
*m_move_list_position_info
;
59 PoolInfo
*m_move_list_pool_info
;
62 bool test(const QRegExp
& pattern
, const QString
& str
);
66 void setListener(int gameNumber
, const boost::weak_ptr
<ICSListener
>& listener
);
69 void process(QString str
);
70 void processPartialLine(QString str
);
73 void moves(const PGN
&);
76 void passwordPrompt();
78 void registeredNickname();
79 void creatingGame(const GameInfo
*, const PositionInfo
&);
80 void creatingExaminedGame(const GameInfo
*, const PositionInfo
&);
81 void creatingObservedGame(const GameInfo
*, const PositionInfo
&);
82 void endingGame(const QString
&, const QString
&);
83 void endingExaminedGame(int);
84 void endingObservedGame(int);
87 #endif // ICSCONNECTION_H