Linux multi-monitor fullscreen support
[ryzomcore.git] / studio / src / plugins / tile_editor / tile_bank.h
blob9d765b8aefbc3de461baf5eddf5c7c9138f8e96f
1 // Ryzom Core Studio - Tile Editor plugin
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef TILE_BANK_H
19 #define TILE_BANK_H
21 #include <QString>
22 #include <QStringList>
23 #include <QVariant>
24 #include <QList>
26 #include "tile_constants.h"
27 #include "tile_images.h"
29 namespace NLMISC
31 class IStream;
34 class TileBankPvt;
36 class TileBank
38 public:
39 TileBank();
40 ~TileBank();
42 void addTileSet( const QString &name );
43 void removeTileSet( int idx );
44 void renameTileSet( int idx, const QString &newName );
45 void getTileSets( QStringList &l );
47 void addLand( const QString &name );
48 void removeLand( int idx );
49 void getLands( QStringList &l );
50 void setLandSets( int idx, const QStringList &l );
51 void getLandSets( int idx, QStringList &l );
53 bool addTile( int setIdx, const QString &name, const QVariant &pixmap, TileConstants::TTileChannel channel, TileConstants::TNodeTileType type );
54 void removeTile( int ts, int type, int tile );
55 bool setTile( int tileset, int tile, const QString &name, const QVariant &pixmap, TileConstants::TTileChannel channel, TileConstants::TNodeTileType type );
56 void replaceImage( int ts, int type, int tile, TileConstants::TTileChannel channel, const QString &name, const QVariant &pixmap );
57 void clearImage( int ts, int type, int tile, TileConstants::TTileChannel channel );
60 int getTileCount( int tileSet, TileConstants::TNodeTileType type );
61 int getRealTileId( int tileSet, TileConstants::TNodeTileType type, int tileIdInSet );
62 void getTileImages( int tileSet, TileConstants::TNodeTileType type, int tileId, TileImages &images );
63 void getTileImages( int tileSet, TileConstants::TNodeTileType type, QList< TileImages > &l );
65 void setVegetation( int tileSet, const QString &vegetation );
66 QString getVegetation( int tileSet ) const;
68 void setOriented( int tileSet, bool b );
69 bool getOriented( int tileSet ) const;
71 void setSurfaceData( int tileSet, unsigned long data );
72 unsigned long getSurfaceData( int tileSet ) const;
74 void setTexturePath( const QString &path );
75 QString getTexturePath() const;
77 void setRotation( int rotation );
79 void serial( NLMISC::IStream &f );
81 bool hasError() const{ return m_hasError; }
82 QString getLastError() const{ return m_lastError; }
83 void resetError(){
84 m_hasError = false;
85 m_lastError = "";
88 void setError( const QString &msg )
90 m_hasError = true;
91 m_lastError = msg;
94 private:
95 TileBankPvt *m_pvt;
96 QString m_lastError;
97 bool m_hasError;
98 int m_rotation;
101 #endif