homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsoperatorhandler.cpp
changeset 71 1db7cc813a4e
parent 46 23b5d6a29cce
equal deleted inserted replaced
69:87476091b3f5 71:1db7cc813a4e
    14  * Description: hsoperatorhandler.cpp
    14  * Description: hsoperatorhandler.cpp
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #include "hsoperatorhandler.h"
    18 #include "hsoperatorhandler.h"
    19 #ifndef NO_QT_EXTENSIONS
    19 
    20 #include "hsoperatorhandler_p.h"
    20 #include <HbAction>
       
    21 
       
    22 #ifdef QT_EXTENSIONS
       
    23     #include "hsoperatorhandler_p.h"
    21 #else
    24 #else
    22 #include <HbIcon>
    25     #include <HbIcon>
    23 #endif
    26 #endif
       
    27 
       
    28 
       
    29 
    24 
    30 
    25 /*!
    31 /*!
    26     \class HsOperatorHandler
    32     \class HsOperatorHandler
    27     \ingroup group_hsmenustateplugin
    33     \ingroup group_hsmenustateplugin
    28 
    34 
    35  Constructor
    41  Constructor
    36  \param parent parent object
    42  \param parent parent object
    37  */
    43  */
    38 HsOperatorHandler::HsOperatorHandler(QObject *parent):
    44 HsOperatorHandler::HsOperatorHandler(QObject *parent):
    39     QObject(parent),
    45     QObject(parent),
    40 #ifndef NO_QT_EXTENSIONS
    46 #ifdef QT_EXTENSIONS
    41     m_q(new HsOperatorHandlerPrivate(this))
    47     m_q(new HsOperatorHandlerPrivate(this))
    42 #else
    48 #else
    43     m_q(0)
    49     m_q(0)
    44 #endif
    50 #endif
    45 {
    51 {
    56  Returns Operators icon
    62  Returns Operators icon
    57  \retval icon
    63  \retval icon
    58  */
    64  */
    59 HbIcon HsOperatorHandler::icon()
    65 HbIcon HsOperatorHandler::icon()
    60 {
    66 {
    61 #ifndef NO_QT_EXTENSIONS
    67 #ifdef QT_EXTENSIONS
    62     return m_q->icon();
    68     return m_q->icon();
    63 #else
    69 #else
    64     return HbIcon();
    70     return HbIcon();
    65 #endif
    71 #endif
    66 }
    72 }
    69  Returns Operators text
    75  Returns Operators text
    70  \retval icon
    76  \retval icon
    71  */
    77  */
    72 QString HsOperatorHandler::text()
    78 QString HsOperatorHandler::text()
    73 {
    79 {
    74 #ifndef NO_QT_EXTENSIONS
    80 #ifdef QT_EXTENSIONS
    75     return m_q->text();
    81     return m_q->text();
    76 #else
    82 #else
    77     return QString();
    83     return QString();
    78 #endif
    84 #endif
    79 }
    85 }
    80 
    86 
    81 
    87 
    82 /*!
    88 /*!
    83  Open Operator application or related url
    89  Open Operator application or related url action
    84  */
    90  */
    85 void HsOperatorHandler::action()
    91 void HsOperatorHandler::action()
    86 {
    92 {
    87 #ifndef NO_QT_EXTENSIONS
    93 #ifdef QT_EXTENSIONS
    88     m_q->action();
    94     m_q->action();
    89 #endif
    95 #endif
    90 }
    96 }
    91 
    97 
       
    98 /*!
       
    99  Returns Operator Store presence value predefined in Central Repositoryicon
       
   100  \retval true if Operator Store should be present in toolbar
       
   101  */
       
   102 bool HsOperatorHandler::operatorStorePresent()
       
   103 {
       
   104 #ifdef QT_EXTENSIONS
       
   105     return m_q->operatorStorePresent();
       
   106 #else
       
   107     return false;
       
   108 #endif
       
   109 }
    92 
   110 
       
   111 /*!
       
   112  Returns Ovi Store presence value predefined in Central Repositoryicon
       
   113  \retval true if Ovi Store should be present in toolbar
       
   114  */
       
   115 bool HsOperatorHandler::oviStorePresent()
       
   116 {
       
   117 #ifdef QT_EXTENSIONS
       
   118     return m_q->oviStorePresent();
       
   119 #else
       
   120     return false;
       
   121 #endif
       
   122 }
       
   123 
       
   124 /*!
       
   125  Returns if Operator Store should first in toolbar
       
   126  \retval true if Operator Store should first in toolbar
       
   127  */
       
   128 bool HsOperatorHandler::operatorStoreFirst()
       
   129 {
       
   130 #ifdef QT_EXTENSIONS
       
   131     return m_q->operatorStoreFirst();
       
   132 #else
       
   133     return false;
       
   134 #endif
       
   135 }
       
   136 
       
   137 /*!
       
   138  Prepares HbAction for Operator Store
       
   139  \param HbAction to prepare
       
   140  \retval HbAction prepared action
       
   141  */
       
   142 HbAction *HsOperatorHandler::prepareOperatorStoreAction(
       
   143         HbAction *const operatorAction)
       
   144 {
       
   145     operatorAction->setIcon(icon());
       
   146     connect(operatorAction, SIGNAL(triggered()), this, SLOT(action()));
       
   147     return operatorAction;
       
   148 }
       
   149