internetradio2.0/uiinc/ircostwarningcontainer.h
changeset 0 09774dfdd46b
equal deleted inserted replaced
-1:000000000000 0:09774dfdd46b
       
     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:  Header for CIRCostWarningContainer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIRCOSTWARNINGCONTAINER_H
       
    21 #define CIRCOSTWARNINGCONTAINER_H
       
    22 
       
    23 #include <aknlists.h>
       
    24 #include <eikrted.h>
       
    25 
       
    26 class CIRCostWarningView;
       
    27 
       
    28 /**
       
    29  * Container for cost warning View.
       
    30  */
       
    31 class CIRCostWarningContainer :public CCoeControl 
       
    32         
       
    33     {
       
    34     
       
    35 public:  // Methods
       
    36 
       
    37     enum TIRTermsTextType
       
    38         {
       
    39         EIRTermsTextInvalid,
       
    40         EIRTermsTextHeading,
       
    41         EIRTermsTextNormal
       
    42         };
       
    43 	/**
       
    44 	* NewL.
       
    45 	* Two-phased constructor.
       
    46 	* Create a CIRPlsContainer object, which will draw itself to aRect.
       
    47 	* @param aRect The rectangle this view will be drawn to.
       
    48     * @param aView which is a plsview's reference
       
    49     * @return a pointer to the created instance of CIRPlsContainer.
       
    50 	*/
       
    51 	static CIRCostWarningContainer* NewL(const TRect& aRect ,CIRCostWarningView &aView );
       
    52 
       
    53 	/**
       
    54 	* NewLC.
       
    55 	* Two-phased constructor.
       
    56 	* Create a CIRPlsContainer object, which will draw itself
       
    57 	* to aRect.
       
    58 	* @param aRect Rectangle this view will be drawn to.
       
    59 	* @param aView which is a plsview's reference
       
    60 	* @return A pointer to the created instance of CIRPlsContainer.
       
    61 	*/
       
    62 	static CIRCostWarningContainer* NewLC(const TRect& aRect,CIRCostWarningView &aView);
       
    63 	
       
    64     /**
       
    65      * 2nd phase constructor.
       
    66      *
       
    67      */
       
    68     void ConstructL( const TRect& aRect );
       
    69     /**
       
    70      * C++ default constructor.
       
    71      *
       
    72 	 * @param aView View of this container.
       
    73      */
       
    74     CIRCostWarningContainer(CIRCostWarningView &View);
       
    75     
       
    76     /**
       
    77      * Destructor.
       
    78      */
       
    79     ~CIRCostWarningContainer();
       
    80 
       
    81 		
       
    82 	// from base class CCoeControl
       
    83 
       
    84 	TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
    85      /**
       
    86 	 * TandCAcceptL().
       
    87 	 * For setting the terms and conditions flag
       
    88 	 */
       
    89     void TandCAcceptL() const;
       
    90     
       
    91     /**
       
    92 	 * CostWarningContinueL().
       
    93 	 * For displaying the soft keys
       
    94 	 */
       
    95     void CostWarningContinueL();
       
    96      
       
    97     /**
       
    98 	 * UpdateTermsL().
       
    99 	 * To update the required data whenever called
       
   100 	 */
       
   101 	void UpdateTermsL();
       
   102 	
       
   103 	/**
       
   104 	 * CreateEditorL().
       
   105 	 * @no param .
       
   106 	 * Creates the CEikRichTextEditor object
       
   107 	 */
       
   108 	CEikRichTextEditor* CreateEditorL() const;
       
   109 	
       
   110     
       
   111     /**
       
   112 	 * SetReadOnly().
       
   113 	 * @aReaOnly param as ETrue or EFalse .
       
   114 	 * Making the editor as ReadOnly
       
   115 	 */
       
   116     void SetReadOnly( TBool aReadOnly );
       
   117     
       
   118     /**
       
   119 	 * SetDataContentL().
       
   120 	 * @aText param is RichText object .
       
   121 	 * Setting the RichText into the Editor
       
   122 	 */
       
   123     void SetDataContentL( CRichText& aText );
       
   124     
       
   125     /**
       
   126 	 * CreateRichTextDataL().
       
   127 	 * @no param .
       
   128 	 * Creating the CRichText object
       
   129 	 */
       
   130     void CreateRichTextDataL();
       
   131     
       
   132     /**
       
   133 	 * GetEditor().
       
   134 	 * @no param .
       
   135 	 * Getting the contents of RichText to the Editor
       
   136 	 */
       
   137     CRichText* GetEditor() const;
       
   138     
       
   139     /**
       
   140 	 * HandlePointerEventL().
       
   141 	 * Handles pointer events.
       
   142 	 */
       
   143     void HandlePointerEventL( const TPointerEvent& aPointerEvent );
       
   144     
       
   145 
       
   146 
       
   147 private: //Methods
       
   148     
       
   149     /**
       
   150 	 * ReadTermsFromFileL.
       
   151 	 * @no param .
       
   152 	 * Reads the text from a HTML file
       
   153 	 */
       
   154     void ReadTermsFromFileL();
       
   155      
       
   156     /**
       
   157 	 * LayoutTermsL
       
   158 	 * @no param
       
   159 	 * Inserts the text into the RichText object (Heading of Terms & Conditions). 
       
   160 	 */
       
   161      void LayoutTermsL();
       
   162      
       
   163     /**
       
   164 	 * GetNextTermsL
       
   165 	 * @param aCounter,aTermsText,aTermsType
       
   166 	 */
       
   167      TBool GetNextTermsL(TInt& aCounter, TPtrC& aTermsText, TIRTermsTextType& aTermsType);
       
   168      
       
   169     // from base class CCoeControl
       
   170 	/**
       
   171      * From CCoeControl
       
   172      *
       
   173      * @see CCoeControl::Draw( const TRect& aRect ) const
       
   174 	 */
       
   175 	void Draw( const TRect& aRect ) const;
       
   176 	
       
   177 	/**
       
   178 	 * CountComponentControls()
       
   179 	 * @no param .
       
   180 	 */
       
   181 	TInt CountComponentControls() const;
       
   182 	
       
   183 	/**
       
   184 	 * SizeChanged().
       
   185 	 * @no param .
       
   186 	 */
       
   187 	void SizeChanged();
       
   188 	
       
   189 	/**
       
   190 	 * ComponentControl().
       
   191 	 * @aIndex as  param .
       
   192 	 */
       
   193 	CCoeControl* ComponentControl(TInt aIndex) const;
       
   194 	
       
   195 	/**
       
   196 	 * HandleResourceChange().
       
   197 	 * Handles Changes in the Resources
       
   198 	 */
       
   199 	void HandleResourceChange(TInt aType);
       
   200 	
       
   201     
       
   202 
       
   203 
       
   204 private:    // Data
       
   205 
       
   206     /**
       
   207 	 * iTermsData.
       
   208 	 * Data extracted from the HTML file.
       
   209 	 */
       
   210 	HBufC* iTermsData;
       
   211 	
       
   212     /**
       
   213 	 * iBackGroundControlContext.
       
   214 	 * 
       
   215 	 */
       
   216 	CAknsBasicBackgroundControlContext* iBackGroundControlContext;
       
   217 	
       
   218 	// Array of fonts of terms data.
       
   219 	CArrayFix<TAknLogicalFontId>* iTermsFonts;
       
   220 
       
   221 	// Array of lines of terms data.
       
   222 	CArrayFix<TPtrC>* iTermsLines;
       
   223 	
       
   224     /**
       
   225 	 * iTotalTextHeight.
       
   226 	 * 
       
   227 	 */
       
   228 	TInt iTotalTextHeight;
       
   229 	
       
   230     /**
       
   231 	 * iMsgView.
       
   232 	 * A reference to CIRCostWarningView view .
       
   233 	 */
       
   234 	CIRCostWarningView	&iMsgView;
       
   235 	
       
   236     /**
       
   237 	 * iEditor.
       
   238 	 * CEikRichTextEditor object .
       
   239 	 */
       
   240 	CEikRichTextEditor* iEditor; 
       
   241     /**
       
   242 	 * iRichText.
       
   243 	 * RichText object
       
   244 	 */
       
   245 	CRichText* iRichText;
       
   246 	
       
   247 	
       
   248     };
       
   249 
       
   250 #endif      // CIRCOSTWARNINGCONTAINER_H