utilities/mpnowplayingbanner/tsrc/unittest_mpnowplayingwidget/stub/src/hbcolorscheme.cpp
branchGCC_SURGE
changeset 44 eff9df3d9c98
parent 30 b95ddb5a0d10
parent 42 79c49924ae23
equal deleted inserted replaced
30:b95ddb5a0d10 44:eff9df3d9c98
     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: HbColorScheme stub for testing MpNowPlayingWidget
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "stub/inc/hbcolorscheme.h"
       
    20 
       
    21 /*!
       
    22  *  Stub function
       
    23  */
       
    24 HbColorTheme *HbColorTheme::global ()
       
    25 {
       
    26     static HbColorTheme instance;
       
    27     return &instance;
       
    28 }
       
    29 
       
    30 /*!
       
    31  *  Stub function
       
    32  */
       
    33 QColor HbColorTheme::color( const QString &colorRole )
       
    34 {
       
    35     if ( mTheme == 1 ) {
       
    36         if ( colorRole == QString("foreground") ) {
       
    37             return QColor(255,0,255);
       
    38         }
       
    39         else{
       
    40             return QColor(0,255,0);
       
    41         }
       
    42     }
       
    43     else {
       
    44         if ( colorRole == QString("foreground") ) {
       
    45             return QColor(255,255,0);
       
    46         }
       
    47         else{
       
    48             return QColor(0,255,255);
       
    49         }
       
    50     }
       
    51 }
       
    52 
       
    53 /*!
       
    54  *  Stub function
       
    55  */
       
    56 void HbColorTheme::setCurrentTheme ( int theme )
       
    57 {
       
    58     mTheme = theme;
       
    59     
       
    60 }
       
    61 
       
    62 /*!
       
    63  *  Stub function
       
    64  */
       
    65 HbColorTheme::HbColorTheme (): mTheme(0)
       
    66 {
       
    67     
       
    68 }
       
    69 /*!
       
    70  *  Stub function
       
    71  */
       
    72 HbColorTheme::~HbColorTheme ()
       
    73 {
       
    74   
       
    75 }
       
    76 
       
    77 /*!
       
    78  *  Stub function
       
    79  */
       
    80 QColor HbColorScheme::color( const QString &colorRole )
       
    81 {
       
    82     QColor normalColor(255,255,255);
       
    83     return HbColorTheme::global()->color(colorRole);
       
    84 }
       
    85