idlehomescreen/inc/xnnewsticker.h
branchRCL_3
changeset 83 5456b4e8b3a8
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Interface class for CXnNewsticker.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef _XNNEWSTICKER_H
       
    20 #define _XNNEWSTICKER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include "xncomponent.h"
       
    24 #include "mxncomponentinterface.h"
       
    25 
       
    26 class CGulIcon;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 /**
       
    30 *  Component UI factory interface for creating newsticker text element.
       
    31 *
       
    32 *  @lib xnnewstickerfactory.dll
       
    33 *  @since Series 60 3.2
       
    34 */
       
    35 namespace XnNewstickerInterface
       
    36 {
       
    37 _LIT8(KType, "newsticker");
       
    38 
       
    39 class MXnNewstickerInterface : public XnComponentInterface::MXnComponentInterface
       
    40     {
       
    41     public: // New functions
       
    42 
       
    43         static inline const TDesC8& Type()
       
    44             {
       
    45             return KType;
       
    46             }
       
    47 
       
    48         /**
       
    49          * Append new title to the end of the title list.
       
    50          * @param aTitle The new title to add.
       
    51          */
       
    52         virtual void AppendTitleL(const TDesC& aTitle) = 0;
       
    53 
       
    54         /**
       
    55          * Insert new title to the end of the title list.
       
    56          * @param aTitle The new title to add.
       
    57          * @param aIndex The place to add the title.
       
    58          */
       
    59         virtual void InsertTitleL(const TDesC& aTitle, TInt aIndex) = 0;
       
    60 
       
    61         /**
       
    62          * Update title text.
       
    63          * @param aTitle The new title to add.
       
    64          * @param aIndex The place to update the title.
       
    65          */
       
    66         virtual void UpdateTitleL(const TDesC& aTitle, TInt aIndex) = 0;
       
    67 
       
    68         /**
       
    69          * Delete the title.
       
    70          * @param aIndex The title index to delete.
       
    71          */
       
    72         virtual void DeleteTitle(TInt aIndex) = 0;
       
    73 
       
    74     	/**
       
    75     	 * Returns index of the currently selected title.
       
    76     	 * @return The index of the current title.
       
    77     	 */
       
    78         virtual TInt CurrentTitleIndex() = 0;
       
    79 
       
    80     	/**
       
    81     	 * Return the title of the given index.
       
    82     	 * @param aIndex The index to return the title.
       
    83     	 * @return The title of the given index.
       
    84     	 */
       
    85         virtual const TDesC& Title(TInt aIndex) = 0;
       
    86 
       
    87         /**
       
    88          * Delete all titles.
       
    89          */
       
    90         virtual void ClearTitles() = 0;
       
    91     };
       
    92 }
       
    93 
       
    94 /**
       
    95 * @ingroup group_xnnewstickerfactory
       
    96 * 
       
    97 *  Newsticker class implementation.
       
    98 *
       
    99 *  @lib xnnewstickerfactory.dll
       
   100 *  @since Series 60 3.2
       
   101 */
       
   102 class CXnNewsticker : public CXnComponent, public XnNewstickerInterface::MXnNewstickerInterface
       
   103     {
       
   104     public:
       
   105     	/**
       
   106     	 * 2 phase construction.
       
   107     	 */
       
   108     	static CXnNewsticker* NewL();
       
   109 
       
   110     	/**
       
   111     	 * Destructor.
       
   112     	 */
       
   113     	virtual ~CXnNewsticker();
       
   114 
       
   115     public:
       
   116          // Routed from MXnNewstickerInterface.
       
   117 
       
   118         /**
       
   119          * Append new title to the end of the title list.
       
   120          * @param aTitle The new title to add.
       
   121          */
       
   122         void AppendTitleL(const TDesC& aTitle);
       
   123 
       
   124         /**
       
   125          * Insert new title to the end of the title list.
       
   126          * @param aTitle The new title to add.
       
   127          * @param aIndex The place to add the title.
       
   128          */
       
   129         void InsertTitleL(const TDesC& aTitle, TInt aIndex);
       
   130 
       
   131         /**
       
   132          * Update title text.
       
   133          * @param aTitle The new title to add.
       
   134          * @param aIndex The place to update the title.
       
   135          */
       
   136         void UpdateTitleL(const TDesC& aTitle, TInt aIndex);
       
   137         
       
   138         /**
       
   139          * Delete the title.
       
   140          * @param aIndex The title index to delete.
       
   141          */
       
   142         void DeleteTitle(TInt aIndex);
       
   143 
       
   144     	/**
       
   145     	 * Returns index of the currently selected title.
       
   146     	 * @return The index of the current title.
       
   147     	 */
       
   148         TInt CurrentTitleIndex();
       
   149 
       
   150     	/**
       
   151     	 * Return the title of the given index.
       
   152     	 * @param aIndex The index to return the title.
       
   153     	 * @return The title of the given index.
       
   154     	 */
       
   155         const TDesC& Title(TInt aIndex);
       
   156 
       
   157         /**
       
   158          * Delete all titles.
       
   159          */
       
   160         void ClearTitles();
       
   161 
       
   162 	   	/**
       
   163         * Create a component interface according to the given type.
       
   164         * @param aType Type of the interface to create
       
   165         * @return Created interface or NULL if the provided type is not supported.
       
   166         */ 
       
   167         virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(
       
   168             const TDesC8& aType);        
       
   169     	      
       
   170     private:
       
   171 
       
   172     	CXnNewsticker();
       
   173 
       
   174     	void ConstructL();
       
   175     };
       
   176 
       
   177 
       
   178 #endif      // _XNNEWSTICKER_H
       
   179             
       
   180 // End of File