logsui/AppSrc/CCtControlContainer.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Logs "AoC & CT list" view container class implementation
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef     __LOGS_APP_CCTCONTROLCONTAINER_H__
       
    21 #define     __LOGS_APP_CCTCONTROLCONTAINER_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include "CLogsBaseControlContainer.h"
       
    25 #include "MSimInfoObserver.h"
       
    26 #include "MLineStatusObserver.h"
       
    27 
       
    28 #include "LogsAlsEnum.hrh"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CLogsBaseView;
       
    32 class CAknDoubleLargeStyleListBox;
       
    33 class MLogsAocUtil;
       
    34 class MLogsCallStatus;
       
    35 class MLogsSimInfo;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40  * Logs "CT list" view container class implementation.
       
    41  * CT = Call Timers
       
    42  */
       
    43 class CCtControlContainer
       
    44 	: public CLogsBaseControlContainer
       
    45 	, public MSimInfoObserver
       
    46 	, public MLineStatusObserver
       
    47     {
       
    48 	public:  // interface
       
    49 		/**
       
    50 		 *  Standard creation function.
       
    51 		 *
       
    52 		 *  @param  aAppView    this control's application view.
       
    53 		 *  @param  aRect       rect size
       
    54 		 *  @return             new object of this class
       
    55 		 */
       
    56 		static CCtControlContainer* NewL
       
    57 										(	CLogsBaseView* aAppView
       
    58 										,	const TRect& aRect
       
    59 										);
       
    60 
       
    61 		/**
       
    62 		 *  Destructor. Deletes child controls.
       
    63 		 */
       
    64 		~CCtControlContainer();
       
    65 
       
    66 	private:
       
    67 		/**
       
    68 		 *  Constructor, second phase.
       
    69 		 *
       
    70 		 *  @param aRect rect size
       
    71 		 */
       
    72 		void ConstructL( const TRect& aRect);
       
    73 
       
    74 		/**
       
    75 		 * C++ default constructor
       
    76 		 * @param aAppView, pointer to view
       
    77 		 */
       
    78 		CCtControlContainer( CLogsBaseView* aAppView );
       
    79 
       
    80 	public: 
       
    81 		/**
       
    82 		 *  Returns the iListBox.
       
    83 		 *
       
    84 		 *  @return listbox control
       
    85 		 */
       
    86 		CAknDoubleLargeStyleListBox* ListBox();
       
    87 
       
    88 		/**
       
    89 		 *  Returns Aoc util API
       
    90 		 *
       
    91 		 *  @return MLogsAocUtil reference
       
    92 		 */
       
    93 		MLogsAocUtil& AocUtil() const;
       
    94 
       
    95 		/**
       
    96 		 *  Returns call status API
       
    97 		 *
       
    98 		 *  @return MLogsCallStatus reference
       
    99 		 */
       
   100 		MLogsCallStatus& CallStatus() const;
       
   101 
       
   102 		/**
       
   103 		 *  Updates the the listbox
       
   104 		 */
       
   105 		void UpdateListBoxContentL();
       
   106 
       
   107 		/**
       
   108 		 * Als setting query
       
   109 		 * @param aAlsSetting current value
       
   110 		 * @return ETrue if changed, else EFalse
       
   111 		 */
       
   112 		TBool AlsSettingQueryL( TAlsEnum & aAlsSetting );
       
   113 
       
   114 		/**
       
   115 		 * Shows call duration details
       
   116 		 */
       
   117         void ShowDurationDetailsL( TInt aCommandId );		
       
   118         void DurationDetailLineL( CDesCArrayFlat& aItems, 
       
   119                                   TInt aResource, 
       
   120                                   TAlsEnum aLine, 
       
   121                                   TVoipEnum aVoip );
       
   122 
       
   123 	protected:  // from CCoeControl
       
   124 		/**
       
   125 		 *  Returns the child controls at aIndex.
       
   126 		 *
       
   127 		 *  @param  aIndex  Index of the control.
       
   128 		 *
       
   129 		 *  @return Sub control from the aIndex.
       
   130 		 */
       
   131 		CCoeControl* ComponentControl( TInt aIndex ) const;
       
   132 
       
   133 		/**
       
   134 		 *  Called when control's size changed.
       
   135 		 */
       
   136 		void SizeChanged();
       
   137 
       
   138 		void GetHelpContext( TCoeHelpContext& aContext ) const;
       
   139 
       
   140 	protected:  // CLogsBaseControlContainer
       
   141 		/**
       
   142 		 *  Called from HandleResourceChange. Calls AddIconL funtion
       
   143 		 *  for each icon in the list box.
       
   144 		 *
       
   145 		 */
       
   146 		void AddControlContainerIconsL();
       
   147 
       
   148 	private: // MLineStatusObserver
       
   149 		void LineStatusChangedL();
       
   150 
       
   151 	private: // MSimInfoObserver
       
   152 		void SimInfoNotificationL();
       
   153 
       
   154 	private:  // operations
       
   155 		/**
       
   156 		 *  Timer handler function. Sets new timer if call is active for 
       
   157 		 *  new update, calls UpdateListBoxContentL() to do actual 
       
   158 		 *  listbox updating
       
   159 		 *  @param aContainer, this pointer, allows deletion of timer.
       
   160 		 *  @return always 0
       
   161 		 */
       
   162 		static TInt TimerLaunchedL( TAny* aContainer );
       
   163 
       
   164 		/**
       
   165 		 * Add line to array
       
   166 		 * @param aItems array
       
   167 		 * @param resource text
       
   168 		 */
       
   169 		void MakeOneLineL( CDesCArrayFlat& aItems, TInt aResourceText );
       
   170 		
       
   171         /**
       
   172          *  Handles focus change events. This will hand over focus changes to list so that 
       
   173          *  focus animations are displayed on the list.
       
   174          */
       
   175         void FocusChanged(TDrawNow aDrawNow);
       
   176 
       
   177 	private:  // data
       
   178 		/// Ref: The application view whose control container this class is.
       
   179 		CLogsBaseView*					iAppView;
       
   180 
       
   181 		/// Own: ListBox style
       
   182 		CAknDoubleLargeStyleListBox*	iListBox;
       
   183 
       
   184 		/// Own: CPeriodic for updating view when call is active.
       
   185 		CPeriodic* iPeriodic;        
       
   186 
       
   187 		/// Own: Aoc Utility class
       
   188 		MLogsAocUtil*					iAocUtil;
       
   189 
       
   190 		/// Own: call status
       
   191 		MLogsCallStatus*				iCallStatus;
       
   192 		
       
   193 		//Own: Pop-listbox for duration details info
       
   194 		CAknSingleHeadingPopupMenuStyleListBox* iDurationDetailsPopupListBox;
       
   195 	};
       
   196 
       
   197 #endif  // __Logs_App_CCtControlContainer_H__
       
   198 
       
   199 // End of File