emailservices/emailframework/inc/CFSMailBrandManagerImpl.h
changeset 0 8466d47a6819
child 8 e1b6206813b4
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     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:  ES Protocol Framework branding manager interface definition
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFSMAILBRANDMANAGER_H
       
    20 #define CFSMAILBRANDMANAGER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <barsc.h>
       
    25 
       
    26 #include "MFSMailBrandManager.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class TResourceReader;
       
    30 class CFSMailClient;
       
    31 class CFSMailBox;
       
    32 class CFSMailBrand;
       
    33 
       
    34 /**
       
    35  *  Branding manager implementation header.
       
    36  *
       
    37  *  @lib FSFWCommonLib
       
    38  *  @since S60 v3.1
       
    39  */
       
    40 class CFSMailBrandManagerImpl : public CBase, public MFSMailBrandManager
       
    41 	{
       
    42 		public:
       
    43 			
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      *
       
    47      */
       
    48      static CFSMailBrandManagerImpl* NewL( CFSMailClient& aMailClient );
       
    49      
       
    50     /**
       
    51      * Two-phased constructor.
       
    52      *
       
    53      */
       
    54      static CFSMailBrandManagerImpl* NewLC( CFSMailClient& aMailClient );
       
    55 			
       
    56     /**
       
    57      * Destructor.
       
    58      */
       
    59      virtual ~CFSMailBrandManagerImpl();
       
    60 			
       
    61 private:	// From MFSMailBrandManager
       
    62 
       
    63 	/**
       
    64 	 * @see MFSMailBrandManager::GetGraphicL
       
    65 	 */
       
    66 	CGulIcon* GetGraphicL( TFSBrandElement aElement,
       
    67 	                       const TFSMailMsgId& aMailboxId );
       
    68 
       
    69 	/**
       
    70 	 * @see MFSMailBrandManager::GetGraphicL, overloaded with brandid
       
    71 	 */
       
    72 	CGulIcon* GetGraphicL( TFSBrandElement aElement, const TDesC& aBrandId );
       
    73 	
       
    74 	
       
    75 	/**
       
    76 	 * @see MFSMailBrandManager::GetTextL
       
    77 	 */
       
    78 	TPtrC GetTextL( TFSBrandElement aElement,
       
    79 	                const TFSMailMsgId& aMailboxId );
       
    80 
       
    81 	/**
       
    82 	 * @see MFSMailBrandManager::GetTextL
       
    83 	 */
       
    84 	TPtrC GetTextL( TFSBrandElement aElement,
       
    85 			        const TDesC& aBrandId );
       
    86 
       
    87 
       
    88 	/**
       
    89 	 * @see MFSMailBrandManager::GetColorL
       
    90 	 */
       
    91 	TInt GetColorL( TFSBrandElement aElement,
       
    92 	                const TFSMailMsgId& aMailboxId,
       
    93 	                TRgb& aColor );
       
    94 
       
    95 	/**
       
    96 	 * @see MFSMailBrandManager::UpdateMailboxNamesL
       
    97 	 */
       
    98 	void UpdateMailboxNamesL(  const TFSMailMsgId aMailboxId );
       
    99 
       
   100 	/**
       
   101 	 * @see MFSMailBrandManager::GetGraphicIdsL
       
   102 	 */
       
   103 	TInt GetGraphicIdsL( TFSBrandElement aElement,
       
   104 	                     const TFSMailMsgId& aMailboxId,
       
   105                          TDes& aIconIds  );
       
   106 
       
   107 private:
       
   108 
       
   109     /**
       
   110      * costructor
       
   111      */
       
   112 	 CFSMailBrandManagerImpl( CFSMailClient& aMailClient );
       
   113 	
       
   114     /**
       
   115      * Two-phased constructor.
       
   116      */
       
   117 	void ConstructL();
       
   118 
       
   119     /**
       
   120 	 * Function which constructs brands used by this class from given
       
   121 	 * resource file.
       
   122 	 *
       
   123 	 * @param aReader Resource reader that can be used to read branding data.
       
   124 	 */
       
   125 	void ConstructFromResourceL( TResourceReader& aReader );
       
   126 	
       
   127 	/**
       
   128 	 * Function which maps brand id received from a mailbox to a brand
       
   129 	 * object.
       
   130 	 *
       
   131 	 * @param aBrandId Id to identify the brand object.
       
   132 	 */
       
   133 	CFSMailBrand* FindMatchingBrandL( const TDesC& aBrandId );
       
   134 	
       
   135 	/**
       
   136 	 * Function which goes through the mail boxes and finds the one whose
       
   137 	 * brand matches the given brand id.
       
   138 	 *
       
   139 	 * @param aBrandId Id identifying the brand.
       
   140 	 */
       
   141 	CFSMailBox* MailboxMatchingBrandIdL( const TDesC& aBrandId ) const;
       
   142 	
       
   143 // <gmail_brand_issue>
       
   144     void GetMCCValueL( TDes& aMcc ) const;    
       
   145 
       
   146     void GetMCCValueFromSIML( TDes& aMcc ) const;    
       
   147 
       
   148     TUint8 GetCurrentCountryL() const;
       
   149 
       
   150     void VerifyMailAccountName( TPtrC& aBrandedName ) const;
       
   151 // </gmail_brand_issue>
       
   152 
       
   153 private: // data
       
   154 
       
   155     /**
       
   156      * Mail client reference.
       
   157      */
       
   158     CFSMailClient& iMailClient;
       
   159 
       
   160     /**
       
   161      * Array containing all brands.
       
   162      * Own.
       
   163      */
       
   164 	CArrayPtrSeg< CFSMailBrand >* iBrands;
       
   165 	
       
   166 	/**
       
   167      * File server session used for example for reading brand resource file.
       
   168      */
       
   169 	RFs iFsSession;
       
   170 	
       
   171 	/**
       
   172      * RResourceFile used to read a resource file into buffer. Used
       
   173      * for example to read the resource file containing the branding data.
       
   174      */
       
   175 	RResourceFile iResourceFile;
       
   176 		
       
   177 	};
       
   178 	
       
   179 	
       
   180 #endif CFSMAILBRANDMANAGER_H