imstutils/imconversationview/imcvuiapp/src/cimcvappsmileyinformation.cpp
branchRCL_3
changeset 22 3104fc151679
parent 21 2b7283837edb
child 23 9a48e301e94b
equal deleted inserted replaced
21:2b7283837edb 22:3104fc151679
     1 /*
       
     2 * Copyright (c) 2006 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:  Storage to save smiley information
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDES
       
    20 #include "cimcvappsmileyinformation.h"
       
    21 #include "imcvlogger.h"
       
    22 
       
    23 // ======== MEMBER FUNCTIONS ========
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // CIMCVAppSmileyInformation::CIMCVAppSmileyInformation()
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CIMCVAppSmileyInformation::CIMCVAppSmileyInformation()
       
    30     {
       
    31     }
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // CIMCVAppSmileyInformation::NewL()
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 CIMCVAppSmileyInformation* CIMCVAppSmileyInformation::NewL()
       
    38     {
       
    39     IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::NewL() start") );
       
    40     CIMCVAppSmileyInformation* self = new (ELeave) CIMCVAppSmileyInformation;
       
    41 	IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::NewL() end") );
       
    42     return self;
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // CIMCVAppSmileyInformation::~CIMCVAppSmileyInformation()
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 CIMCVAppSmileyInformation::~CIMCVAppSmileyInformation()
       
    50     {
       
    51     if(iSmileyString)
       
    52 	    {
       
    53 	    delete iSmileyString;
       
    54 	    iSmileyString = NULL;
       
    55 	    }
       
    56     }
       
    57 
       
    58 // ---------------------------------------------------------------------------
       
    59 // CIMCVAppSmileyInformation::Position()
       
    60 // ---------------------------------------------------------------------------
       
    61 //
       
    62 TInt CIMCVAppSmileyInformation::Position() const
       
    63     {
       
    64     return iPosition;
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // CIMCVAppSmileyInformation::SetPosition()
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 void CIMCVAppSmileyInformation::SetPosition( TInt aPosition )
       
    72     {
       
    73     iPosition = aPosition;
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CIMCVAppSmileyInformation::Index()
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 TInt CIMCVAppSmileyInformation::Index() const
       
    81     {
       
    82     return iIndex;
       
    83     }
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CIMCVAppSmileyInformation::SetIndex()
       
    87 // ---------------------------------------------------------------------------
       
    88 //
       
    89 void CIMCVAppSmileyInformation::SetIndex( TInt aIndex )
       
    90     {
       
    91     iIndex = aIndex;
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // CIMCVAppSmileyInformation::SmileyString()
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 const TDesC& CIMCVAppSmileyInformation::SmileyString() const
       
    99     {
       
   100     return *iSmileyString;
       
   101     }
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // CIMCVAppSmileyInformation::SetSmileyStringL()
       
   105 // ---------------------------------------------------------------------------
       
   106 //
       
   107 void CIMCVAppSmileyInformation::SetSmileyStringL( const TDesC& aSmiley )
       
   108     {
       
   109     IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::SetSmileyStringL() start") );
       
   110     HBufC* smile = aSmiley.AllocL();
       
   111     delete iSmileyString;
       
   112     iSmileyString = smile;
       
   113     IM_CV_LOGS(TXT("CIMCVAppSmileyInformation::SetSmileyStringL() end") );
       
   114     }
       
   115 
       
   116 // ---------------------------------------------------------------------------
       
   117 // CIMCVAppSmileyInformation::IsIcon()
       
   118 // ---------------------------------------------------------------------------
       
   119 //
       
   120 TBool CIMCVAppSmileyInformation::IsIcon() const
       
   121     {
       
   122     return iIsIcon;
       
   123     }
       
   124 
       
   125 // ---------------------------------------------------------------------------
       
   126 // CIMCVAppSmileyInformation::SetIcon()
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 void CIMCVAppSmileyInformation::SetIcon( TBool aIsIcon )
       
   130     {
       
   131     iIsIcon = aIsIcon;
       
   132     }