00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef EASYSOK_BOOKMARKS_INC_GUARD_H
00022 #define EASYSOK_BOOKMARKS_INC_GUARD_H
00023
00024
00025 #include <map>
00026 #include <vector>
00027
00028 #include <qdatetime.h>
00029 #include <qstring.h>
00030 #include <qstringlist.h>
00031
00032 #include "compressed_map.h"
00033 #include "movements.h"
00034
00035
00036
00037
00045 class Bookmarks
00046 {
00047
00048 public:
00049
00056 static void load();
00057
00058
00063 static void save();
00064
00065
00072 static bool hasBookmark(int index);
00073
00074
00081 static QString collectionName(int index);
00082
00083
00090 static int level(int index);
00091
00092
00099 static CompressedMap map(int index);
00100
00101
00108 static Movements moves(int index);
00109
00110
00117 static QDateTime date(int index);
00118
00119
00126 static QString annotation(int index);
00127
00128
00140 static void replaceBookmark(int index, QString const & annotation, QString const & collection_name,
00141 int level, CompressedMap const & map, Movements const & moves);
00142
00143
00150 static bool hasKSokobanBookmark(int ksokoban_index);
00151
00152
00161 static QString kSokobanBookmarkCollectionAndLevel(int ksokoban_index, int & level);
00162
00163
00172 static bool importKSokobanBookmark(int ksokoban_index, int index);
00173
00174
00175 private:
00176
00184 static int indexToIndex(int index);
00185
00186
00195 static QString collectionFileForKSokobanCollection(int collection_index);
00196
00197
00202 static bool s_is_initialized;
00203
00204
00209 static bool s_modified;
00210
00211
00216 static int s_number_of_bookmarks;
00217
00218
00223 static std::map<int, int> s_index_to_index_map;
00224
00225
00230 static QStringList s_annotations;
00231
00232
00237 static QStringList s_collection_names;
00238
00239
00244 static std::vector<int> s_levels;
00245
00246
00251 static std::vector<CompressedMap> s_maps;
00252
00253
00258 static std::vector<Movements> s_moves;
00259
00260
00265 static std::vector<QDateTime> s_dates;
00266 };
00267
00268
00269 #endif