Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

bookmarks.h

00001 /*
00002  *   EasySok --- A(nother) sokoban game for KDE.
00003  *
00004  *   Copyright (C) 2001 by Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
00005  *
00006  *   This program is free software; you can redistribute it and/or modify
00007  *   it under the terms of the GNU General Public License version 2 as
00008  *   published by the Free Software Foundation.
00009  *
00010  *   This program is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with this program; if not, write to the Free Software
00017  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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

Generated at Sun Jan 6 18:49:09 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001