StackViewController.h 2.2 KB
Newer Older
Thomas Boquet's avatar
Thomas Boquet committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*****************************************************************************
 * StackViewController.h
 *****************************************************************************
 * Copyright (C) 2008-2009 the VLMC team
 *
 * Authors: Thomas Boquet <thomas.boquet@gmail.com>
 *
 * 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
 * of the License, 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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

Thomas Boquet's avatar
Thomas Boquet committed
23 24 25 26 27 28 29 30 31 32 33 34 35
#ifndef STACKVIEWCONTROLLER_H
#define STACKVIEWCONTROLLER_H

#include <QWidget>
#include <QPushButton>
#include <QHBoxLayout>
#include <QLabel>
#include <QDebug>
#include <QStack>

#include "StackViewNavController.h"
#include "ViewController.h"

36 37
class ImportController;

Thomas Boquet's avatar
Thomas Boquet committed
38 39 40 41 42
class StackViewController : public QWidget
{
    Q_OBJECT

public:
43
    StackViewController( QWidget* parent = 0, bool enableImport = true );
Thomas Boquet's avatar
Thomas Boquet committed
44 45
    ~StackViewController();

46 47 48 49
    void                    pushViewController( ViewController* viewController,
                                                bool animated = false );
    void                    popViewController( bool animated = false );
    const ViewController*   getCurrentViewController() const;
Thomas Boquet's avatar
Thomas Boquet committed
50 51 52

private:
    StackViewNavController*     m_nav;
53
    QPushButton*                m_importButton;
Thomas Boquet's avatar
Thomas Boquet committed
54 55 56 57 58 59 60
    QVBoxLayout*                m_layout;
    ViewController*             m_current;
    QStack<ViewController*>*    m_controllerStack;

public slots:
    void                        previous();

61 62
signals:
    void                        importRequired();
63
    void                        previousButtonPushed();
64

Thomas Boquet's avatar
Thomas Boquet committed
65 66 67
};

#endif // STACKVIEWCONTROLLER_H