homescreenapp/examples/minibrowserwidgetplugin/inc/minibrowserwidget.h
changeset 63 52b0f64eeb51
equal deleted inserted replaced
62:341166945d65 63:52b0f64eeb51
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Example of home screen widget
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MINIBROWSERWIDGET_H
       
    19 #define MINIBROWSERWIDGET_H
       
    20 
       
    21 #include <HbWidget>
       
    22 class HbLineEdit;
       
    23 class QGraphicsWebView;
       
    24 class HbIconItem;
       
    25 class HbPushButton;
       
    26 
       
    27 class MiniBrowserWidget : public HbWidget
       
    28 {
       
    29     Q_OBJECT
       
    30 // Start of snippet 1
       
    31     Q_PROPERTY(bool isOnline READ isOnline WRITE setOnline)
       
    32 // End of snippet 1
       
    33 // Start of snippet 2
       
    34     Q_PROPERTY(QString url READ url WRITE setUrl)
       
    35 // End of snippet 2
       
    36     
       
    37 public:
       
    38     MiniBrowserWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
       
    39     ~MiniBrowserWidget();
       
    40     
       
    41 public:
       
    42     bool isOnline();
       
    43     void setOnline(bool online);
       
    44     QString url() const;
       
    45     void setUrl(const QString& url);
       
    46     
       
    47 public slots:
       
    48     void onInitialize();
       
    49     void onShow();
       
    50     void onHide();
       
    51 
       
    52 public slots:
       
    53     void pressGoButton();
       
    54     void pressStopButton();
       
    55     void loadFinished(bool ok);
       
    56     void loadProgress(int progress);
       
    57     void loadStarted();
       
    58 
       
    59 // Start of snippet 3
       
    60 signals:
       
    61     void setPreferences(const QStringList &names);
       
    62 // End of snippet 3
       
    63 
       
    64 private:
       
    65     Q_DISABLE_COPY(MiniBrowserWidget)
       
    66     
       
    67     HbPushButton *mGoButton;
       
    68     HbPushButton *mStopButton;
       
    69     HbLineEdit *mEditor;
       
    70     QGraphicsWebView *mWeb;
       
    71     HbIconItem *mSpinnerAnimationWidget;
       
    72     bool mOnline;    
       
    73     QString mUrl;
       
    74     
       
    75 };
       
    76 
       
    77 #endif // MINIBROWSERWIDGET_H