Removed all old variants.
[tagua/yd.git] / src / ui.h
blob960938999ec86061df97320dafcb56d5288d818d
1 /*
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.
9 */
11 #ifndef UI_H
12 #define UI_H
14 #include <boost/shared_ptr.hpp>
15 #include <qobject.h>
16 #include "common.h"
17 #include "controllers/entitytoken.h"
18 #include "tagua.h"
19 #include <map>
21 class Controller;
22 class Engine;
24 class UI : public QObject {
25 Q_OBJECT
26 typedef std::map<QWidget*, boost::shared_ptr<Controller> > ControllerMap;
27 ControllerMap m_controller;
28 QWidget* m_current_tab;
29 boost::shared_ptr<Controller>& controller();
30 const boost::shared_ptr<Controller>& controller() const;
31 public:
32 UI();
33 void addController(QWidget* w, const boost::shared_ptr<Controller>&);
34 void setController(const boost::shared_ptr<Controller>&);
35 void removeController(QWidget* w);
36 public Q_SLOTS:
37 void setCurrentTab(QWidget* w);
39 bool undo();
40 bool redo();
41 bool truncate();
42 bool promoteVariation();
43 bool back();
44 bool forward();
45 void gotoFirst();
46 void gotoLast();
47 void setTurn(int);
48 void createCtrlAction();
49 void destroyCtrlAction();
51 void pgnCopy();
52 void pgnPaste();
53 void pgnPaste(const QString&);
55 // promotion type
56 int promotionType() const;
58 // do promotion
59 void setDoPromotion(bool);
60 bool doPromotion() const;
62 // editing
63 void clearBoard();
64 void setStartingPosition();
65 void copyPosition();
66 void pastePosition();
67 AbstractPosition::Ptr position() const;
69 EntityToken addPlayingEngine(int side, const boost::shared_ptr<Engine>& engine);
70 // EntityToken addAnalysingEngine(const boost::shared_ptr<Engine>& engine);
71 void removeEntity(const EntityToken& token);
73 void end();
74 void detach();
76 QString currentVariant() const;
79 #endif