/*
 * Copyright (c) 2010 Nokia Corporation.
 */

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui>
#include <QDeclarativeView>
#include <QDeclarativeContext>

class ImageLoader;
class ImageWidget;
class KeyEventListener;
class MyQtEngine;
class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void openCurrentItem();
    void deleteCurrentItem();

    void showImage(QVariant);
    void doShowImage();

    void keyboardEnabled();
    void keyboardDisabled();

private:
    void openNewWindow(QString);
    void openNewWindowWin32(QString);
    void touchEnabled(bool);

    void printObjectTree(QObject* parent);

signals:
    void itemRemoved(QVariant);

private:
    QDeclarativeView* m_qmlView;
    MyQtEngine*     m_myQtEngine;

    QMdiArea*       m_mdiArea;
    QMdiSubWindow*  m_mainMdi;
    ImageLoader*    m_imageLoader;
    QMessageBox*    m_messageBox;

    QAction*        m_openAction;
    QAction*        m_deleteAction;

    QString         m_selectedImage;

    KeyEventListener* m_keyEventListener;

    // Application internal state
    enum InternalState
    {
        ENoState = 0,
        EKeyboardEnabled, // Keyboar in use
        ETouchEnabled // Touch screen in use
    };
    InternalState   m_internalState;

    QObject*        m_qml_gridView;

};

#endif // MAINWINDOW_H
