browsercore/appfw/Api/Managers/LoadController.h
author hgs
Tue, 29 Jun 2010 00:46:29 -0400
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
child 12 afcd8e6d025b
permissions -rw-r--r--
201026

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, version 2.1 of the License.
* 
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, 
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
*
* Description:
*
*/

#ifndef LoadController_h
#define LoadController_h

#include <QWidget>
#include <QAction>
#include <QNetworkReply>
#include "BWFGlobal.h"


namespace WRT {

    class BWF_EXPORT LoadController : public QObject
    {
        Q_OBJECT
    public:
        enum GotoBrowserMode {
            GotoModeLoading, /**< Loading Mode (i.e. page is loading) */
            GotoModeEditing, /**< Editing Mode (i.e. user can or is editing the url) */
            GotoModeReloadable, /**< Reloadable Mode (i.e. the url has not changed, and can be reloaded) */
            GotoModeInvalid
        };

       /*!
        * LoadController Constructor
        * @param parent: parent QObject
        */
        LoadController();
        /*!
         * LoadController Destructor
         */
        ~LoadController();


    public:
        GotoBrowserMode mode();
        void setMode(GotoBrowserMode mode);
        

		
        bool loadCanceled() { return m_canceled ;}
        void setCanceled(bool val) {m_canceled = val;}
        
        void setUrlText(QString );
        QString urlText() {return m_textBoxValue; }
        
        int progressValue() {return m_progress; }
        bool inline isPageLoading(){ return m_isPageLoading;}


   public slots:
        void loadStarted();
        void loadProgress( const int progress );
        void loadFinished( const bool ok );
        void urlChanged(QUrl);
 

Q_SIGNALS:
        void pageLoadStarted();
        void pageLoadFailed(); 
        void pageLoadProgress(const int);
        void pageLoadFinished(const bool ok);
        void pageUrlChanged(QString);

    private:
        GotoBrowserMode m_gotoMode;
        bool m_isPageLoading;
        bool m_initialLayoutIsComplete;
        bool m_canceled;
        int  m_progress;
        QString m_textBoxValue;


    };
}
#endif // __LOADCONTROLLER_H__