videoplayback/hbvideoplaybackview/tsrc/testmpxvideoplaybackbuttonbar/stub/src/hbpushbutton.cpp
changeset 15 cf5481c2bc0b
child 17 69946d1824c4
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
       
     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:  Implementation of HbPushButton
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version:  1 %
       
    19 
       
    20 #include <qgraphicswidget>
       
    21 
       
    22 #include "mpxvideo_debug.h"
       
    23 #include "hbpushbutton.h"
       
    24 
       
    25 // -------------------------------------------------------------------------------------------------
       
    26 // HbPushButton::HbPushButton
       
    27 // -------------------------------------------------------------------------------------------------
       
    28 //
       
    29 HbPushButton::HbPushButton()
       
    30 {
       
    31     MPX_ENTER_EXIT(_L("HbPushButton::HbPushButton()"));
       
    32 
       
    33     mBackground = new QGraphicsWidget();
       
    34 }
       
    35 
       
    36 // -------------------------------------------------------------------------------------------------
       
    37 // HbPushButton::~HbPushButton
       
    38 // -------------------------------------------------------------------------------------------------
       
    39 //
       
    40 HbPushButton::~HbPushButton()
       
    41 {
       
    42     MPX_DEBUG(_L("HbPushButton::HbPushButton") );
       
    43 
       
    44     if ( mBackground )
       
    45     {
       
    46         delete mBackground;
       
    47         mBackground = NULL;
       
    48     }
       
    49 }
       
    50 
       
    51 // -------------------------------------------------------------------------------------------------
       
    52 // HbPushButton::setEnabled
       
    53 // -------------------------------------------------------------------------------------------------
       
    54 //
       
    55 void HbPushButton::setEnabled( bool enabled )
       
    56 {
       
    57     MPX_DEBUG(_L("HbPushButton::setEnabled %d"), enabled );
       
    58 
       
    59     mEnabled = enabled;
       
    60 }
       
    61 
       
    62 // -------------------------------------------------------------------------------------------------
       
    63 // HbPushButton::isEnabled
       
    64 // -------------------------------------------------------------------------------------------------
       
    65 //
       
    66 bool HbPushButton::isEnabled()
       
    67 {
       
    68     MPX_DEBUG(_L("HbPushButton::isEnabled %d"), mEnabled );
       
    69 
       
    70     return mEnabled;
       
    71 }
       
    72 
       
    73 // -------------------------------------------------------------------------------------------------
       
    74 // HbPushButton::setVisible
       
    75 // -------------------------------------------------------------------------------------------------
       
    76 //
       
    77 void HbPushButton::setVisible( bool visible )
       
    78 {
       
    79     MPX_DEBUG(_L("HbPushButton::setVisible %d"), visible );
       
    80 
       
    81     mVisible = visible;
       
    82 }
       
    83 
       
    84 // -------------------------------------------------------------------------------------------------
       
    85 // HbPushButton::isVisible
       
    86 // -------------------------------------------------------------------------------------------------
       
    87 //
       
    88 bool HbPushButton::isVisible()
       
    89 {
       
    90     MPX_DEBUG(_L("HbPushButton::isVisible %d"), mVisible );
       
    91 
       
    92     return mVisible;
       
    93 }
       
    94 
       
    95 // -------------------------------------------------------------------------------------------------
       
    96 // HbPushButton::setSelected
       
    97 // -------------------------------------------------------------------------------------------------
       
    98 //
       
    99 void HbPushButton::setSelected( bool selected )
       
   100 {
       
   101     MPX_DEBUG(_L("HbPushButton::setSelected %d"), selected );
       
   102 
       
   103     mSelected = selected;
       
   104 }
       
   105 
       
   106 // -------------------------------------------------------------------------------------------------
       
   107 // HbPushButton::isSelected
       
   108 // -------------------------------------------------------------------------------------------------
       
   109 //
       
   110 bool HbPushButton::isSelected()
       
   111 {
       
   112     MPX_DEBUG(_L("HbPushButton::isSelected %d"), mSelected );
       
   113 
       
   114     return mSelected;
       
   115 }
       
   116 
       
   117 // -------------------------------------------------------------------------------------------------
       
   118 // HbPushButton::primitive
       
   119 // -------------------------------------------------------------------------------------------------
       
   120 //
       
   121 QGraphicsItem* HbPushButton::primitive( HbStyle::Primitive primitive ) const
       
   122 {
       
   123     MPX_DEBUG(_L("HbPushButton::primitive") );
       
   124 
       
   125     return mBackground;
       
   126 }
       
   127 
       
   128 // -------------------------------------------------------------------------------------------------
       
   129 // HbPushButton::press
       
   130 // -------------------------------------------------------------------------------------------------
       
   131 //
       
   132 void HbPushButton::press()
       
   133 {
       
   134     MPX_DEBUG(_L("HbPushButton::press") );
       
   135 
       
   136     emit pressed();
       
   137 }
       
   138 
       
   139 // -------------------------------------------------------------------------------------------------
       
   140 // HbPushButton::release
       
   141 // -------------------------------------------------------------------------------------------------
       
   142 //
       
   143 void HbPushButton::release()
       
   144 {
       
   145     MPX_DEBUG(_L("HbPushButton::release") );
       
   146 
       
   147     emit released();
       
   148 }
       
   149 
       
   150 // End of file