idlehomescreen/inc/xntext.h
changeset 0 f72a12da539e
equal deleted inserted replaced
-1:000000000000 0:f72a12da539e
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Wrapper class for CEikLabel.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef _XNTEXT_H
       
    21 #define _XNTEXT_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include "xncomponent.h"
       
    25 #include <e32base.h>
       
    26 #include "xnnode.h"
       
    27 #include "mxncomponentinterface.h"
       
    28 
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 namespace XnTextInterface
       
    33 {
       
    34 _LIT8(KType, "text");
       
    35 class MXnTextInterface : public XnComponentInterface::MXnComponentInterface
       
    36    {
       
    37 
       
    38 public:
       
    39 		
       
    40     static inline const TDesC8& Type()
       
    41         {
       
    42         return KType;
       
    43         }
       
    44 		
       
    45 public: // New functions
       
    46 
       
    47     /**
       
    48      * Sets the new content to the underlying CEikLabel
       
    49      * @param aText The new content
       
    50      */
       
    51 	virtual void SetTextL(const TDesC& aText) = 0;
       
    52 	
       
    53 	/**
       
    54 	 * Returns the text contained in the underlying CEikLabel
       
    55 	 * @return TDesC* The text
       
    56 	 */
       
    57 	virtual const TDesC* Text() = 0;
       
    58     
       
    59 
       
    60 private:
       
    61 
       
    62    };
       
    63  }   
       
    64 
       
    65 /**
       
    66 *  @ingroup group_xntextfactory
       
    67 *  @lib xn3textfactory.lib
       
    68 *  @since Series 60 3.1
       
    69 */
       
    70 class CXnText : public CXnComponent, public XnTextInterface::MXnTextInterface
       
    71    {
       
    72 
       
    73 public:
       
    74 
       
    75 
       
    76 	/**
       
    77 	 * 2 phase construction.
       
    78 	 */
       
    79 	static CXnText* NewL();
       
    80 
       
    81 
       
    82 	/**
       
    83 	 * Destructor.
       
    84 	 */
       
    85 	virtual ~CXnText();
       
    86 
       
    87 public: // New functions
       
    88 
       
    89     /**
       
    90      * Sets the new content to the underlying CEikLabel
       
    91      * @param aText The new content
       
    92      */
       
    93 	void SetTextL(const TDesC& aText);
       
    94 	
       
    95 	/**
       
    96 	 * Returns the text contained in the underlying CEikLabel
       
    97 	 * @return TDesC* The text
       
    98 	 */
       
    99 	const TDesC* Text();
       
   100     
       
   101 
       
   102 public: // from CCoeControl
       
   103 
       
   104    	/**
       
   105       * Create a component interface according to the given type.
       
   106       * @param aType Type of the interface to create
       
   107       * @return Created interface or NULL if the provided type is not supported.
       
   108       */ 
       
   109     virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType);        
       
   110     
       
   111 
       
   112         
       
   113 private:
       
   114 
       
   115 	CXnText();
       
   116 	void ConstructL();
       
   117 
       
   118    };
       
   119 
       
   120 
       
   121 #endif      // _XNTEXT_H
       
   122             
       
   123 // End of File