imstutils/imconversationview/imcvuiapp/inc/cimcvappsmilestring.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 22:41:11 +0200
branchRCL_3
changeset 4 f5911524345e
parent 0 5e5d6b214f4f
permissions -rw-r--r--
Revision: 201003 Kit: 201007

/*
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  Class for storing one smiley with index to icon array.
*
*/


#ifndef CIMCVAPPSMILESTRING_H
#define CIMCVAPPSMILESTRING_H

// INCLUDES
#include <e32base.h>

// CLASS DECLARATION

/**
* CIMCVAppSmileString
*
* Class for storing smile string and it's index of icon array.
*/
class CIMCVAppSmileString : public CBase
    {
    public:  // Constructors and destructor
        
        /**
        * Two-phased constructor.
        */
        static CIMCVAppSmileString* NewL();

        /**
        * Destructor.
        */
        virtual ~CIMCVAppSmileString();

	public:

        /**
        * Smile icon index.
		* @return (TInt) Smile icon index
        */
        TInt SmileIconIndex() const;
        
        /**
        * Smile string corresponding a icon.
		* @return (TDesC&) Reference to smile string
        */
		const TDesC& SmileString() const;

		/**
        * Set smiley string and it's index to icon.
        * Takes ownership of the smiley string.
		* @param aSmileyString String of smiley
		* @param aIndex index of icon.
        */
		void Set( const HBufC* aSmileyString, TInt aIndex );

        /**
         * Sets shortest smiley string for this smileys.
         * @since S60 3.0
         * @param aSmileyString String for smiley
         */
        void SetShortestSmileStringL( const TDesC& aSmileyString );
        
        /**
         * Check if this smiley has shortest string set or not.
         * @since S60 3.0
         * @return ETrue if shortest string set, EFalse otherwise
         */
        TBool HasShortestString() const;
        
        /**
         * Returns shortest smiley string of this smiley.
         * @since S60 3.0
         * @return Reference to shortest smiley string
         */
        const TDesC& ShortestSmileString() const;
        
    private:  // Constructors and destructor

        /**
        * C++ constructor.
        */
        CIMCVAppSmileString();

    private: // Data

		// Owns; Smiley string
		const HBufC* iSmiley;
		
		// Icon index of smiley
		TInt iIndex;
		
		// Owns; Shortest string of this smiley
		HBufC* iShortestSmileyString;
    };

#endif  // CIMCVAPPSMILESTRING_H