/* ============================================================
 *
 * 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 */
