homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp
changeset 0 79c6a41cd166
child 23 ace62b58f4b2
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     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:
       
    15 *
       
    16 */
       
    17 #include "hswidgetitem.h"
       
    18 #include "hsexception.h"
       
    19 #include <e32err.h>
       
    20 
       
    21 
       
    22 using namespace Hs;
       
    23 // ---------------------------------------------------------------------------
       
    24 // 
       
    25 // ---------------------------------------------------------------------------
       
    26 //
       
    27 HsWidgetItem::HsWidgetItem(std::string& aItemName, std::string& aValue):
       
    28 	mItemName(aItemName), mItemString(aValue), mItemInt(0), mIsString(true)
       
    29 	{
       
    30 	}
       
    31 
       
    32 // ---------------------------------------------------------------------------
       
    33 // 
       
    34 // ---------------------------------------------------------------------------
       
    35 //
       
    36 HsWidgetItem::HsWidgetItem( std::string& aItemName, int aValue ):
       
    37 	mItemName(aItemName), mItemString(), mItemInt(aValue), mIsString(false)
       
    38 	{
       
    39 	}
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // 
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 HsWidgetItem::~HsWidgetItem()
       
    46 	{
       
    47 	}
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // 
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 void HsWidgetItem::setValue( int aValue )
       
    54 	{
       
    55 	mItemInt = aValue;
       
    56 	mIsString = false;
       
    57 	}
       
    58 
       
    59 // ---------------------------------------------------------------------------
       
    60 // 
       
    61 // ---------------------------------------------------------------------------
       
    62 //
       
    63 void HsWidgetItem::setValue( std::string& aValue )
       
    64 	{
       
    65 	mItemString = aValue;
       
    66 	mIsString = true;
       
    67 	}
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // 
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 const std::string& HsWidgetItem::getItemName()
       
    74 	{
       
    75 	return mItemName;
       
    76 	}
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // 
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 const std::string& HsWidgetItem::getItemValue()
       
    83 	{
       
    84 	return mItemString;
       
    85 	}
       
    86 
       
    87 // ---------------------------------------------------------------------------
       
    88 // 
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 int HsWidgetItem::getItemValueInt()
       
    92 	{
       
    93 	return mItemInt;
       
    94 	}
       
    95 
       
    96 // ---------------------------------------------------------------------------
       
    97 // 
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 bool HsWidgetItem::isStringValue()
       
   101 	{
       
   102 	return mIsString;
       
   103 	}
       
   104 
       
   105 
       
   106