Starting to make things work again: dragging
[tagua.git] / src / graphicalapi.h
blob7b6d69f79166b46b26c968a9daf7da0d242ed38c
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 GRAPHICALAPI_H
12 #define GRAPHICALAPI_H
14 #include <boost/shared_ptr.hpp>
15 #include "kboard.h"
16 #include "pointconverter.h"
17 #include "sprite.h"
19 typedef boost::shared_ptr<class Sprite> SpritePtr;
21 /**
22 * This class defines the interface that will be used by the animator to modify
23 * kboard graphics.
25 class GraphicalAPI {
26 public:
27 virtual ~GraphicalAPI(){}
29 /**
30 * \return the current abstract position.
32 virtual const PointConverter* converter() const = 0;
34 /**
35 * \return the current abstract position.
37 virtual AbstractPosition::Ptr position() const = 0;
39 /**
40 * \return a sprite at the position \a index in the graphical pool.
42 virtual SpritePtr getSprite(const Point& p) = 0;
44 /**
45 * Removes a sprite at the position \a index in the graphical pool.
46 * \return the newly created sprite.
48 virtual SpritePtr takeSprite(const Point& p) = 0;
50 /**
51 * Sets the sprite at the position \a index in the graphical pool.
52 * \return the newly created sprite.
54 virtual SpritePtr setSprite(const Point& p, const AbstractPiece* piece, bool use_drop, bool show) = 0;
56 /**
57 * \return how many sprites are contained in the pool
59 virtual int poolSize(int pool) = 0;
61 /**
62 * \return the sprite at the position \a index in the graphical pool.
64 virtual SpritePtr getPoolSprite(int pool, int index) = 0;
66 /**
67 * Removes the sprite at the position \a index in the graphical pool.
68 * \return the removed sprite.
70 virtual SpritePtr takePoolSprite(int pool, int index) = 0;
72 /**
73 * Inserts a sprite at the position \a index in the graphical pool.
74 * \return the newly created sprite.
76 virtual SpritePtr insertPoolSprite(int pool, int index, const AbstractPiece* piece) = 0;
79 #endif //GRAPHICALAPI_H