1 /**********************************************************************
2  *
3  *   FreeDoko a Doppelkopf-Game
4  *
5  *   Copyright (C) 2001 – 2018 by Diether Knof and Borg Enders
6  *
7  *   This program is free software; you can redistribute it and/or
8  *   modify it under the terms of the GNU General Public License as
9  *   published by the Free Software Foundation; either version 2 of
10  *   the License, or (at your option) any later version.
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *   You can find this license in the file 'gpl.txt'.
17  *
18  *   You should have received a copy of the GNU General Public License
19  *   along with this program; if not, write to the Free Software
20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21  *   MA  02111-1307  USA
22  *
23  *  Contact:
24  *    Diether Knof dknof@posteo.de
25  *
26  **********************************************************************/
27 
28 #ifdef USE_UI_GTKMM
29 
30 #pragma once
31 
32 #include "base.h"
33 #include "../../basetypes.h"
34 #include "table_part.h"
35 
36 class Player;
37 class Game;
38 
39 #include <cairomm/context.h>
40 #include <gdkmm/pixbuf.h>
41 
42 namespace UI_GTKMM_NS {
43 class Table;
44 
45 class Hand;
46 class TrickPile;
47 class Icongroup;
48 class Name;
49 
50 /**
51  ** base class for 'Hand', 'TrickPile', 'Icongroup' and 'Name'
52  **/
53 class HTIN : public Table::Part {
54   public:
55     HTIN(Table& table, Position position);
56     ~HTIN() override;
57 
58     Position position() const;
59     Rotation rotation() const;
60     Rotation rotation(Position position) const;
61 
62     // the corresponding player
63     Player const& player() const;
64 
65     // the corresponding hand
66     Hand& hand();
67     Hand const& hand() const;
68     Hand& hand(Position position);
69     Hand const& hand(Position position) const;
70     // the corresponding trickpile
71     TrickPile& trickpile();
72     TrickPile const& trickpile() const;
73     TrickPile& trickpile(Position position);
74     TrickPile const& trickpile(Position position) const;
75     // the corresponding icongroup
76     Icongroup& icongroup();
77     Icongroup const& icongroup() const;
78     Icongroup& icongroup(Position position);
79     Icongroup const& icongroup(Position position) const;
80     // the corresponding name
81     Name& name();
82     Name const& name() const;
83     Name& name(Position position);
84     Name const& name(Position position) const;
85 
86   private:
87     Position position_;
88 
89   private:
90     HTIN() = delete;
91     HTIN(HTIN const&) = delete;
92     HTIN& operator=(HTIN const&) = delete;
93 }; // class HTIN : public Base
94 
95 } // namespace UI_GTKMM_NS
96 
97 #endif // #ifdef USE_UI_GTKMM
98