imstutils/imconversationview/imcvuiapp/inc/cimcvappstatuspanehandler.h
branchRCL_3
changeset 29 9a48e301e94b
parent 0 5e5d6b214f4f
equal deleted inserted replaced
28:3104fc151679 29:9a48e301e94b
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Handles statuspane, context pane
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CIMCVAPPSTATUSPANEHANDLER_H
       
    19 #define CIMCVAPPSTATUSPANEHANDLER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <akntitle.h> // CAknTitlePane
       
    24 #include <akncontext.h> // CAknContextPane
       
    25 #include <AknIndicatorContainer.h> //CFbsBitmap
       
    26 #include <akntabgrp.h>
       
    27 #include <aknnavide.h> 
       
    28 #include <AknTabObserver.h>
       
    29 #include <aknnavi.h> 
       
    30 
       
    31 #include "mimcvengineopenchats.h"
       
    32 #include "cimcvnewmsgfadecontrol.h"
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 class MIMCVTabObserver;
       
    37 class MIMCVEngineFactory;
       
    38 /**
       
    39  *  This class handles status, title and contextpane operations
       
    40  *
       
    41  *  @lib imcvuiapp.exe
       
    42  *  @since 5.0
       
    43  */
       
    44 class CIMCVAppStatusPaneHandler : public CBase,
       
    45 								public MAknTabObserver,
       
    46 								public MIMCVEngineOpenChatsObserver
       
    47 								
       
    48     {
       
    49     public:  // Constructors and destructor
       
    50 
       
    51         /**
       
    52          * C++ default constructor.
       
    53          */
       
    54         CIMCVAppStatusPaneHandler(MIMCVEngineFactory& aEngineFactory );
       
    55 
       
    56         /**
       
    57          * Two-phased constructor.
       
    58          */
       
    59         static CIMCVAppStatusPaneHandler* NewL(MIMCVEngineFactory& aEngineFactory );
       
    60 
       
    61         /**
       
    62          * Destructor.
       
    63          */
       
    64         virtual ~CIMCVAppStatusPaneHandler();
       
    65 
       
    66     public: // New functions
       
    67 
       
    68         /**
       
    69          * Functione to insert titlepane
       
    70          */
       
    71 
       
    72 		void ClearTitlePaneL( );
       
    73         
       
    74         /**
       
    75          * Hides navi-pane decorators.
       
    76          * @param aAllowDuplicates If this is true, duplicate default navi pane
       
    77          * contents are allowed. Duplicates need to be removed with PopNaviPane
       
    78          * when not needed anymore.         
       
    79          */		
       
    80         void ClearNaviPaneL( TBool aAllowDuplicates = EFalse );
       
    81         
       
    82         /**
       
    83          * SetPicture decorators
       
    84          * @since 5.0
       
    85          * @param aPicture Bitmap file
       
    86          * @param aMask Bitmap mask file
       
    87          */		
       
    88         void SetPicture( const CFbsBitmap* aPicture, const CFbsBitmap* aMask );
       
    89 
       
    90 	
       
    91         /**
       
    92          * Sets title-pane text.
       
    93          * @since 5.0
       
    94          * @param aTitle Title text
       
    95          */		
       
    96         void SetTitleL( const TDesC& aTitle );
       
    97 		
       
    98 		/**
       
    99          * Shows navi-pane's tabgroup-decorator according to aResourceId 
       
   100          * and activates a tab which has aType.                  
       
   101          * @param aId - user id
       
   102          * @param noCreate - ETrue - a New decorator is created else EFalse
       
   103          */
       
   104         TInt ShowTabGroupL( const TDesC& aId,
       
   105         					const TBool noCreate = EFalse ); 
       
   106         
       
   107 		
       
   108         /**
       
   109          * RefreshTab, refreshes the title pane and tab text 
       
   110          * if the user has edited.      
       
   111          * @param aUserId - user id of the edited contact     
       
   112          */ 
       
   113         void RefreshTabL(const TDesC& aUserId,const TDesC& aDisplayName);
       
   114     
       
   115     public:
       
   116 		
       
   117 		/** 
       
   118          * API used to regiter for MIMCVTabObserver Events
       
   119          */
       
   120 		void AddObserver(MIMCVTabObserver* aObserver) ;
       
   121 		
       
   122 		/** 
       
   123          * API used to unregiter from MIMCVTabObserver events
       
   124          */
       
   125 		void RemoveObserver(MIMCVTabObserver* aObserver );	
       
   126 		
       
   127 		
       
   128 		/** 
       
   129          * SetActiveTabByIndexL - Sets the Tab Active indicated by Index
       
   130          * @param aIndex - Index of the Conversation Item in Tab
       
   131          */
       
   132 		void SetActiveTabByIndexL( const TInt aIndex );				
       
   133 		
       
   134 									
       
   135 		/**
       
   136          * Refresh title pane text, needed in skin change events.        
       
   137          */
       
   138         void RefreshTitlePaneTextL();
       
   139         
       
   140         
       
   141         /**
       
   142          * Returns the pointer to CAknTabGroup.        
       
   143          */
       
   144         CAknTabGroup* TabGroup() const;
       
   145         
       
   146         void PopNaviPane();
       
   147    
       
   148 	public:
       
   149 		
       
   150 		
       
   151 		/**
       
   152 		 * Returns IMessage indicator
       
   153 		 * @return handle to imessage indicator
       
   154 		 */
       
   155 		CIMCVNewMsgFadeControl* IMessageIndicator() const;
       
   156 		
       
   157 		/**
       
   158 		 * Initialises instant messaging navipane indicator. 
       
   159 		 */
       
   160 		void InitMessageIndicatorL();
       
   161 		
       
   162 		/**
       
   163 		 * Hides fade text
       
   164 		 */
       
   165 		void HideFadeText();
       
   166 		
       
   167 		/**
       
   168 		 * Destroys instant messaging indicators. This method is called when
       
   169 		 * view is deactivated.
       
   170 		 */
       
   171 		void DestroyMessageIndicator();
       
   172 		
       
   173 		/**
       
   174 		 * Pushes fade text control to navistack
       
   175 		 */
       
   176 		void PushFadeTextL();
       
   177 		
       
   178 		/**
       
   179 		 * Shows fade text
       
   180 		 * @param aTextToFade Descriptor that contains message to fade
       
   181 		 */
       
   182 		void ShowFadeText( TDesC& aTextToFade );
       
   183 		
       
   184 		/**
       
   185 		 * Shows navipane indicators
       
   186 		 */
       
   187 		void ShowNavipaneIndicators();
       
   188 		
       
   189 		/**
       
   190 		 * Hides navi pane message info
       
   191 		 */
       
   192 		void HideNavipaneIndicators();
       
   193 
       
   194 		/**
       
   195 		 * Setting previous title that was present before clear
       
   196 		 */
       
   197 		
       
   198 		void SetPreviousTitleL();		
       
   199 		/**
       
   200 		 * Sending the Conversation View into BackGround
       
   201 		 */
       
   202 		void SendBackGroundL();
       
   203 
       
   204 		/**
       
   205 		 * Bringing the Conversation View into Fore Ground
       
   206 		 */
       
   207 		void BringToForegroundL();
       
   208 
       
   209 	protected:  // New functions
       
   210 		
       
   211 		/**
       
   212 		 * creates new message navipane indicator
       
   213 		 * @return CAknNavigationDecorator
       
   214 		 */
       
   215 		CAknNavigationDecorator* CreateIMessageIndicatorL();
       
   216 		
       
   217 		/**
       
   218 		 * Starts fade operation
       
   219 		 */
       
   220 		void RunFadeText();		
       
   221 		
       
   222 		/**
       
   223 		 * Resets the text to fade
       
   224 		 */
       
   225 		void ResetFadeText();		
       
   226 		
       
   227 	
       
   228 	private:
       
   229 		
       
   230 		/** 
       
   231          * @see MIMCVEngineOpenChatsObserver
       
   232          */
       
   233 		void HandleChangeL(TInt aServiceId, TInt aIndex, TOpenChatsEventType aChangeType) ;
       
   234 		
       
   235 	    /**
       
   236          * @see MIMCVEngineOpenChatsObserver
       
   237          */
       
   238  	    void SetStatusMsgL(TInt aServiceId, TInt aIndex,const TDesC & aMsg);
       
   239  	    
       
   240  	    /*
       
   241  	     * play message tone, when receiving a new message.
       
   242  	     */
       
   243  	    void PlayMsgBeepL();
       
   244 
       
   245 	
       
   246 	public:	
       
   247 		/** 
       
   248          * API to show the tabs
       
   249          */
       
   250 		void ShowTabL();
       
   251 		
       
   252 		/** 
       
   253          * API to hide the tabs
       
   254          */
       
   255 		void HideTab();
       
   256 	
       
   257     private:
       
   258 
       
   259         /**
       
   260          * Creates tabs based on the Open Conversation List         
       
   261          */
       
   262         void CreateTabsL(const TBool noCreate); 
       
   263     
       
   264     
       
   265     private:     
       
   266 		/** 
       
   267          * @see MAknTabObserver
       
   268          */        
       
   269         void TabChangedL(TInt aIndex);
       
   270     	
       
   271     private:
       
   272 
       
   273         /**
       
   274          * By default Symbian OS constructor is private.
       
   275          */
       
   276         void ConstructL();
       
   277 
       
   278     private:    // Data
       
   279 
       
   280         // Doesn't own. Handle to title-pane
       
   281         CAknTitlePane*					iTitlePane;
       
   282 
       
   283           // Doesn't own. Handle to context-pane
       
   284         CAknContextPane*	            iContextPane;
       
   285         
       
   286         //not Owns the factory for OpenChats 
       
   287         MIMCVEngineFactory& 	iEngineFactory;
       
   288         
       
   289 		//Doesn't own
       
   290     	RPointerArray< MIMCVTabObserver > iObserverList; 
       
   291     	
       
   292     	//previous tabID
       
   293     	TInt iPrevTabId;
       
   294     	
       
   295     	//Current TabID
       
   296         TInt iCurrentTabId;
       
   297         
       
   298         //owns the new message icon
       
   299         HBufC* iNewMsgIcon;        
       
   300         
       
   301         //Stores the OpenConversations Tab Count
       
   302         TInt iOpenChatArrayCount;   
       
   303         
       
   304 		//Owns. New decorated tab-group
       
   305         CAknNavigationDecorator*		iNewDecoratedTabGroup;
       
   306         
       
   307         // Doesn't own. Handle to navi-pane
       
   308         CAknNavigationControlContainer*	iNaviPane;
       
   309         
       
   310         //Owns.
       
   311 		CAknNavigationDecorator* iDecoratedFadeText;	
       
   312 		
       
   313 		HBufC* iLastTitle;
       
   314 		
       
   315 		//iStatusPaneText is used to show truncated received msg (when user is conversation with one user,
       
   316 		//and receive msg from some other user.)
       
   317 		HBufC* iStatusPaneText;
       
   318     
       
   319        //service id
       
   320        TInt iServiceId;
       
   321 
       
   322 
       
   323     };
       
   324 
       
   325 #endif      // CIMCVAPPSTATUSPANEHANDLER_H
       
   326 
       
   327 // End of File