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

Bookmarks Class Reference

Used to store and retrieve bookmarks. More...

#include <bookmarks.h>

List of all members.

Static Public Methods

void load ()
void save ()
bool hasBookmark (int index)
QString collectionName (int index)
int level (int index)
CompressedMap map (int index)
Movements moves (int index)
QDateTime date (int index)
QString annotation (int index)
void replaceBookmark (int index, QString const &annotation, QString const &collection_name, int level, CompressedMap const &map, Movements const &moves)
bool hasKSokobanBookmark (int ksokoban_index)
QString kSokobanBookmarkCollectionAndLevel (int ksokoban_index, int &level)
bool importKSokobanBookmark (int ksokoban_index, int index)

Static Private Methods

int indexToIndex (int index)
QString collectionFileForKSokobanCollection (int collection_index)

Static Private Attributes

bool s_is_initialized
bool s_modified
int s_number_of_bookmarks
std::map< int, int > s_index_to_index_map
QStringList s_annotations
QStringList s_collection_names
std::vector< int > s_levels
std::vector< CompressedMaps_maps
std::vector< Movementss_moves
std::vector< QDateTime > s_dates


Detailed Description

Used to store and retrieve bookmarks.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1


Member Function Documentation

QString Bookmarks::annotation int index [static]
 

Returns the annotation of the bookmark.

Parameters:
index   The index of the bookmark.

QString Bookmarks::collectionFileForKSokobanCollection int collection_index [static, private]
 

Returns the filename of the collection for a ksokoban collection index.

Parameters:
collection_index   The index from the ksokoban bookmark.
Returns:
The filename of the collection or an empty string if the collection could not be found.

QString Bookmarks::collectionName int index [static]
 

Returns the collection name of the bookmark.

Parameters:
index   The index of the bookmark.

QDateTime Bookmarks::date int index [static]
 

Returns the date, when the bookmark was created.

Parameters:
index   The index of the bookmark.

bool Bookmarks::hasBookmark int index [static]
 

Returns true, if a bookmark with the given index exists.

Parameters:
index   The index of the bookmark.

bool Bookmarks::hasKSokobanBookmark int ksokoban_index [static]
 

Returns true, if a ksokoban bookmark with the given index exists.

Parameters:
ksokoban_index   The index of the KSokoban bookmar (1 - 10).

bool Bookmarks::importKSokobanBookmark int ksokoban_index,
int index
[static]
 

Tries to import a ksokoban bookmark.

Parameters:
ksokoban_index   The index of the KSokoban bookmark (1 - 10).
index   The index in which to store the ksokoban bookmark.
Returns:
True, if the import operation was successful.

int Bookmarks::indexToIndex int index [static, private]
 

Returns the internal index for the given bookmark index (or -1 if we don't have the bookmark).

Parameters:
index   The index of the bookmark.

QString Bookmarks::kSokobanBookmarkCollectionAndLevel int ksokoban_index,
int & level
[static]
 

Returns the collection name of the KSokoban bookmark with the given index and stores the level.

Parameters:
ksokoban_index   The index of the KSokoban bookmar (1 - 10).
lebel   Here we store the level.

int Bookmarks::level int index [static]
 

The index of the level in the collection.

Parameters:
index   The index of the bookmark.

void Bookmarks::load [static]
 

Loads the bookmarks from disk.

This should be the first function called (and called only once).

CompressedMap Bookmarks::map int index [static]
 

Returns the start map of the bookmark.

Parameters:
index   The index of the bookmark.

Movements Bookmarks::moves int index [static]
 

Returns the moves of the bookmark.

Parameters:
index   The index of the bookmark.

void Bookmarks::replaceBookmark int index,
QString const & annotation,
QString const & collection_name,
int level,
CompressedMap const & map,
Movements const & moves
[static]
 

Replaces or adds the given bookmark.

Parameters:
index   The index of the bookmark.
annotation   The annotation of the bookmark.
collection_name   The name of the collection.
level   The level in the collection.
map   The start map of the level.
moves   The moves made.

void Bookmarks::save [static]
 

Writes the bookmarks to disk.


Member Data Documentation

QStringList Bookmarks::s_annotations [static, private]
 

Here we store the annotations.

QStringList Bookmarks::s_collection_names [static, private]
 

Here we store the collection names.

std::vector<QDateTime> Bookmarks::s_dates [static, private]
 

Here we store the dates.

std::map<int, int> Bookmarks::s_index_to_index_map [static, private]
 

Maps bookmark indices to internal indices.

bool Bookmarks::s_is_initialized [static, private]
 

If true, we have called init already.

std::vector<int> Bookmarks::s_levels [static, private]
 

Here we store the level numbers.

std::vector<CompressedMap> Bookmarks::s_maps [static, private]
 

Here we store the compressed maps.

bool Bookmarks::s_modified [static, private]
 

If true, the bookmarks were modified.

std::vector<Movements> Bookmarks::s_moves [static, private]
 

Here we store the moves.

int Bookmarks::s_number_of_bookmarks [static, private]
 

The number of bookmarks stored.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:10 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001