UBMainWindow.h 2.2 KB
Newer Older
Claudio Valerio's avatar
Claudio Valerio committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * 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 3 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, see <http://www.gnu.org/licenses/>.
 */
Claudio Valerio's avatar
Claudio Valerio committed
15 16 17 18 19 20 21


#ifndef UBMAINWINDOW_H_
#define UBMAINWINDOW_H_

#include <QMainWindow>
#include <QWidget>
22
#include <QWebView>
23
#include <QMessageBox>
24
#include "UBDownloadWidget.h"
Claudio Valerio's avatar
Claudio Valerio committed
25 26 27 28 29 30 31

class QStackedLayout;

#include "ui_mainWindow.h"

class UBMainWindow : public QMainWindow, public Ui::MainWindow
{
shibakaneki's avatar
shibakaneki committed
32
    Q_OBJECT
Claudio Valerio's avatar
Claudio Valerio committed
33 34 35 36 37 38 39 40 41 42 43 44 45
    public:

        UBMainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
        virtual ~UBMainWindow();

        void addBoardWidget(QWidget *pWidget);
        void switchToBoardWidget();

        void addWebWidget(QWidget *pWidget);
        void switchToWebWidget();

        void addDocumentsWidget(QWidget *pWidget);
        void switchToDocumentsWidget();
46

47
        bool yesNoQuestion(QString windowTitle, QString text);
48 49
        void warning(QString windowTitle, QString text);
        void information(QString windowTitle, QString text);
Claudio Valerio's avatar
Claudio Valerio committed
50

51 52 53
        void showDownloadWidget();
        void hideDownloadWidget();

54
    signals:
55 56
        void closeEvent_Signal( QCloseEvent *event );

shibakaneki's avatar
shibakaneki committed
57 58 59
    public slots:
        void onExportDone();

Claudio Valerio's avatar
Claudio Valerio committed
60
    protected:
61
        void oneButtonMessageBox(QString windowTitle, QString text, QMessageBox::Icon type);
Claudio Valerio's avatar
Claudio Valerio committed
62 63

        virtual void keyPressEvent(QKeyEvent *event);
64
        virtual void closeEvent (QCloseEvent *event);
Claudio Valerio's avatar
Claudio Valerio committed
65 66 67 68 69 70 71 72 73 74 75 76

        virtual QMenu* createPopupMenu ()
        {
            // no pop up on toolbar
            return 0;
        }

        QStackedLayout* mStackedLayout;

        QWidget *mBoardWidget;
        QWidget *mWebWidget;
        QWidget *mDocumentsWidget;
77 78 79

private:
        UBDownloadWidget* mpDownloadWidget;
Claudio Valerio's avatar
Claudio Valerio committed
80 81 82
};

#endif /* UBMAINWINDOW_H_ */