homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsovistorehandler.cpp
changeset 35 f9ce957a272c
child 39 4e8ebe173323
equal deleted inserted replaced
5:c743ef5928ba 35:f9ce957a272c
       
     1 /*
       
     2  * Copyright (c) 2009 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: hsovistorehandler.cpp
       
    15  *
       
    16  */
       
    17 
       
    18 #include "hsovistorehandler.h"
       
    19 #ifndef NO_QT_EXTENSIONS
       
    20 #include "hsovistorehandler_p.h"
       
    21 #else
       
    22 #include <hbicon.h>
       
    23 #include <hbnotificationdialog.h>
       
    24 const QString DefaultOviStoreIcon("qtg_mono_ovistore");
       
    25 const QString DefaultOviStoreLink("https://store.ovi.com/applications");
       
    26 #endif
       
    27 
       
    28 
       
    29 /*!
       
    30  Constructor
       
    31  \param parent parent object
       
    32  */
       
    33 HsOviStoreHandler::HsOviStoreHandler(QObject *parent):
       
    34     QObject(parent),
       
    35 #ifndef NO_QT_EXTENSIONS
       
    36     m_q(new HsOviStoreHandlerPrivate(this))
       
    37 #else
       
    38     m_q(0)
       
    39 #endif
       
    40 {
       
    41 }
       
    42 
       
    43 /*!
       
    44  Destructor
       
    45  */
       
    46 HsOviStoreHandler::~HsOviStoreHandler()
       
    47 {
       
    48 }
       
    49 
       
    50 /*!
       
    51  Returns Ovi Store icon
       
    52  \retval icon
       
    53  */
       
    54 HbIcon HsOviStoreHandler::icon()
       
    55 {
       
    56 #ifndef NO_QT_EXTENSIONS
       
    57     return m_q->icon();
       
    58 #else
       
    59     return HbIcon(DefaultOviStoreIcon);
       
    60 #endif
       
    61 }
       
    62 
       
    63 /*!
       
    64  Open Ovi Store application or related url
       
    65  */
       
    66 void HsOviStoreHandler::action()
       
    67 {
       
    68 #ifndef NO_QT_EXTENSIONS
       
    69     m_q->action();
       
    70 #else
       
    71     HbNotificationDialog *notificationDialog = new HbNotificationDialog();
       
    72     notificationDialog->setParent(this);
       
    73     notificationDialog->setTitle(DefaultOviStoreLink);
       
    74     notificationDialog->show();
       
    75 #endif
       
    76 }
       
    77 
       
    78