AlbumShaper  1.0a3
recentAlbums.h
Go to the documentation of this file.
1 //==============================================
2 // copyright: (C) 2003-2005 by Will Stokes
3 //==============================================
4 // This program is free software; you can redistribute it
5 // and/or modify it under the terms of the GNU General
6 // Public License as published by the Free Software
7 // Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //==============================================
10 
11 #ifndef BACKEND_RECENTALBUMS_H
12 #define BACKEND_RECENTALBUMS_H
13 
14 #include <qstringlist.h>
15 
16 //--------------------
17 //forward declarations
18 //--------------------
19 
20 //=====================================
24 //=====================================
25 
27 {
28 //------------------------------------------------------
29 public:
30  //constructs a recent albums object
31  RecentAlbums();
32 
33  //clears listing of recent albums
34  void clearList();
35 
36  //returns the number of entries in the listing
37  int numEntries();
38 
39  //retunrs the max number of entries the listing will support
40  int getMaxItems();
41 
42  //obtains entry from index
43  void getEntry ( int index, QString& name,
44  QString& location, QString& photoCount );
45 
46  //inserts an album to the list, removes prior refferences if they
47  //exists. if too many items are in list last item is removed.
48  void insertEntry ( QString name,
49  QString location,
50  QString photos = "-1",
51  bool insertAtBack = true );
52  //------------------------------------------------------
53 private:
55  QStringList albumNames;
56  QStringList albumLocations;
57  QStringList albumPhotoCounts;
58 
60  uint maxItems;
61 //------------------------------------------------------
62 };
63 
64 #endif //BACKEND_RECENTALBUMS_H
void insertEntry(QString name, QString location, QString photos="-1", bool insertAtBack=true)
This class maintains and handles saving and loading a list of recently viewed albums.
Definition: recentAlbums.h:26
void getEntry(int index, QString &name, QString &location, QString &photoCount)
QStringList albumPhotoCounts
Definition: recentAlbums.h:57
void clearList()
QStringList albumNames
lists of album names and locations
Definition: recentAlbums.h:55
QStringList albumLocations
Definition: recentAlbums.h:56
uint maxItems
max allowable items in list
Definition: recentAlbums.h:60