summaryrefslogtreecommitdiffstats
path: root/digikam/digikam/albumhistory.h
blob: 585dad84d2f8454670e9a801aa6fd0e38d28ec17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* ============================================================
 *
 * This file is a part of digiKam project
 * http://www.digikam.org
 *
 * Date        : 2004-11-17
 * Description : Albums history manager. 
 * 
 * Copyright (C) 2004 by Joern Ahrens <joern.ahrens@kdemail.net>
 *
 * This program is free software; you can redistribute it
 * and/or modify it under the terms of the GNU General
 * Public License as published by the Free Software Foundation;
 * either version 2, or (at your option)
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * ============================================================ */

#ifndef ALBUMHISTORY_H
#define ALBUMHISTORY_H

/** @file albumhistory.h */

// TQt includes.

#include <tqobject.h>
#include <tqvaluelist.h>
#include <tqstringlist.h>

namespace Digikam
{

class Album;
class HistoryItem;

/**
 * Manages the history of the last visited albums.
 *
 * The user is able to navigate through the albums, he has
 * opened during a session.
 */
class AlbumHistory : public TQObject
{
    TQ_OBJECT

public:

    AlbumHistory();
    ~AlbumHistory();

    void            addAlbum(Album *album, TQWidget *widget = 0);
    void            deleteAlbum(Album *album);
    void            clearHistory();
    void            back(Album **album, TQWidget **widget, unsigned int steps=1);
    void            forward(Album **album, TQWidget **widget, unsigned int steps=1);
    void            getCurrentAlbum(Album **album, TQWidget **widget) const;
    
    void            getBackwardHistory(TQStringList &list) const;
    void            getForwardHistory(TQStringList &list) const;

    bool            isForwardEmpty() const;
    bool            isBackwardEmpty() const;
    
private:
    
    HistoryItem*    getCurrentAlbum() const;
    void            forward(unsigned int steps=1);
    
    typedef TQValueList<HistoryItem*> AlbumStack;
    
    AlbumStack      *m_backwardStack;
    AlbumStack      *m_forwardStack;
    bool             m_moving;
};

}  // namespace Digikam

#endif /* ALBUMHISTORY_H */