libkmahjongg
kmahjonggtileset.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _KMAHJONGGTILESET_H_
00021 #define _KMAHJONGGTILESET_H_
00022
00023 #include <QtCore/QString>
00024 #include <QtGui/QPixmap>
00025
00026 #include <libkmahjongg_export.h>
00027
00028 class KMahjonggTilesetPrivate;
00029
00030 class KMAHJONGGLIB_EXPORT KMahjonggTileset {
00031 public:
00032 KMahjonggTileset();
00033 ~KMahjonggTileset();
00034
00035 bool loadDefault();
00036 bool loadTileset(const QString & tilesetPath);
00037 bool loadGraphics();
00038 bool reloadTileset(const QSize & newTilesize);
00039 QSize preferredTileSize(const QSize & boardsize, int horizontalCells, int verticalCells);
00040 QString authorProperty(const QString &key) const;
00041
00042 short width() const;
00043 short height() const;
00044 short levelOffsetX() const;
00045 short levelOffsetY() const;
00046 short qWidth() const;
00047 short qHeight() const;
00048 QString path() const;
00049
00050 QPixmap selectedTile(int num);
00051 QPixmap unselectedTile(int num);
00052 QPixmap tileface(int num);
00053
00054 protected:
00055
00056 void updateScaleInfo(short tilew, short tileh);
00057 void buildElementIdTable(void);
00058 QString pixmapCacheNameFromElementId(const QString & elementid);
00059 QPixmap renderElement(short width, short height, const QString & elementid);
00060
00061
00062 private:
00063 friend class KMahjonggTilesetPrivate;
00064 KMahjonggTilesetPrivate *const d;
00065
00066 Q_DISABLE_COPY(KMahjonggTileset)
00067 };
00068
00069 #endif