homescreensrv_plat/hs_widget_publisher_api/src/hswidgetitem.cpp
branchRCL_3
changeset 30 a5a39a295112
child 31 8baec10861af
equal deleted inserted replaced
29:0efa10d348c0 30:a5a39a295112
       
     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), 
       
    29 	mIsString(true),mTrigger(false)
       
    30 	
       
    31 	{
       
    32 	}
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 // 
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 HsWidgetItem::HsWidgetItem( std::string& aItemName, int aValue ):
       
    39 	mItemName(aItemName), mItemString(), mItemInt(aValue), mIsString(false)
       
    40 	{
       
    41 	}
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // 
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 HsWidgetItem::~HsWidgetItem()
       
    48 	{
       
    49 	}
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // 
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 void HsWidgetItem::setValue( int aValue )
       
    56 	{
       
    57 	mItemInt = aValue;
       
    58 	mIsString = false;
       
    59 	}
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // 
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 void HsWidgetItem::setValue( std::string& aValue )
       
    66 	{
       
    67 	mItemString = aValue;
       
    68 	mIsString = true;
       
    69 	}
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 // 
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 const std::string& HsWidgetItem::getItemName()
       
    76 	{
       
    77 	return mItemName;
       
    78 	}
       
    79 
       
    80 // ---------------------------------------------------------------------------
       
    81 // 
       
    82 // ---------------------------------------------------------------------------
       
    83 //
       
    84 const std::string& HsWidgetItem::getItemValue()
       
    85 	{
       
    86 	return mItemString;
       
    87 	}
       
    88 
       
    89 // ---------------------------------------------------------------------------
       
    90 // 
       
    91 // ---------------------------------------------------------------------------
       
    92 //
       
    93 int HsWidgetItem::getItemValueInt()
       
    94 	{
       
    95 	return mItemInt;
       
    96 	}
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // 
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 bool HsWidgetItem::isStringValue()
       
   103 	{
       
   104 	return mIsString;
       
   105 	}
       
   106 
       
   107 // ---------------------------------------------------------------------------
       
   108 // 
       
   109 // ---------------------------------------------------------------------------
       
   110 //
       
   111 void HsWidgetItem::triggerAdded()
       
   112     {
       
   113     mTrigger = true;
       
   114     }
       
   115 
       
   116 // ---------------------------------------------------------------------------
       
   117 // 
       
   118 // ---------------------------------------------------------------------------
       
   119 //
       
   120 bool HsWidgetItem::isTriggerAdded()
       
   121     {
       
   122     return mTrigger;
       
   123     }