uiservicetab/vimpstdetailsviewplugin/inc/cvimpstdetailsviewbrandhandler.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * Copyright (c) 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:  Implementation of detailsview contact brand data
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CVIMPSTDETAILSVIEWBRANDHANDLER_H
       
    21 #define CVIMPSTDETAILSVIEWBRANDHANDLER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include    <e32base.h>
       
    25 #include    <AknIconArray.h>
       
    26 #include    <gulicon.h>
       
    27 #include 	"spdefinitions.h"
       
    28 //Forward Declarations
       
    29 class CBSFactory;
       
    30 class MBSAccess; 
       
    31 class CSPSettings;
       
    32 // CLASS DECLARATION
       
    33 		
       
    34 /**
       
    35  *  Brand handler implemenation class
       
    36  *
       
    37  *  @lib vimpstdetailsviewplugin.dll
       
    38  *  @since 5.0
       
    39  */
       
    40 class CVIMPSTDetailsViewBrandHandler : public CBase
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43 		
       
    44 	
       
    45         /**
       
    46          * Two-phased constructor.
       
    47 		 * @param aServiceId , service Id
       
    48 		 * @return a pointer to this class
       
    49 		 * @since s60 v5.0
       
    50 		 **/
       
    51         static CVIMPSTDetailsViewBrandHandler* NewL(TInt aServiceId);
       
    52            
       
    53 
       
    54         /**
       
    55          * Destructor.
       
    56          * @since s60 v5.0
       
    57          **/
       
    58         virtual ~CVIMPSTDetailsViewBrandHandler();
       
    59 	public: // New Functions
       
    60 
       
    61    		/**
       
    62          * Loads necessary icons for this decorator
       
    63          * @return Icon array. Ownership is transferred.
       
    64          * @since s60 v5.0
       
    65          **/
       
    66 	     CAknIconArray* LoadIconsLC( );
       
    67 	     
       
    68 	     /**
       
    69          * Loads necessary icons for this decorator
       
    70          * @param aBitmap ,bitmap
       
    71          * @param aMask , mask
       
    72          * @param aBitmapId  bitmap Id
       
    73          * @param aMaskId : mask Id
       
    74          * @since s60 v5.0
       
    75          **/
       
    76 	   	 void LoadBitMapLC(CFbsBitmap*& aBitmap,
       
    77 			             CFbsBitmap*& aMask,
       
    78 			             TInt aBitmapId,
       
    79 			             TInt aMaskId  );
       
    80 		
       
    81 		/**
       
    82 		* read the service name from settings
       
    83 		* @param aServiceName , reference to service name
       
    84 		* @since s60 v5.0
       
    85 		**/	             
       
    86 		void GetServiceNameL( TDes& aServiceName );	
       
    87 			
       
    88 		/**
       
    89 		* read the service store name from settings
       
    90 		* @return aServiceStoreUri , reference to service store uri with cnt path
       
    91 		* @since s60 v5.0
       
    92 		**/	  
       
    93 		const TDesC& ServiceStoreUriL();	
       
    94 	
       
    95 		/**
       
    96         * read if service supported from cch 
       
    97         * @return ETrue if service supported
       
    98         * @since s60 v5.0
       
    99         **/   
       
   100 		TBool ServiceSupportedL( );
       
   101 		
       
   102 		/**
       
   103 		 * constructs branded icons for this decorator
       
   104 		 * @param aId id of the bitmap to be fetchec from the Branding server.
       
   105 		 * @return Icon. 
       
   106 		 * @since s60 v5.0
       
   107 		 **/
       
   108 		CGulIcon* LoadBrandBitmapL( const TDesC8& aId );
       
   109 		
       
   110 	private:
       
   111 	
       
   112 	
       
   113 		/**
       
   114          * Loads brand icons for this decorator
       
   115          * @return Icon array. Ownership is transferred.
       
   116          * @since s60 v5.0
       
   117          **/
       
   118 	     CAknIconArray* LoadBrandIconsLC( );
       
   119 	
       
   120 
       
   121 		/**
       
   122          * Loads default icons for this decorator
       
   123          * @param aMbmFile Bitmap file
       
   124          * @return Icon array. Ownership is transferred.
       
   125          * @since s60 v5.0
       
   126          **/
       
   127 	     CAknIconArray* LoadDefaultIconsLC(const TDesC& aMbmFile );
       
   128 	     
       
   129 	     
       
   130 	  
       
   131 		/**
       
   132          * constructs necessary icons for this decorator
       
   133          * @param aBitmapId bitmapId
       
   134          * @param aMaskId maskId
       
   135          * @param aFullPath Bitmap path
       
   136          * @return Icon. 
       
   137          * @since s60 v5.0
       
   138          **/
       
   139 		 CGulIcon* LoadDefaultBitmapL( TInt aBitmapId,
       
   140 		 							 TInt aMaskId, 
       
   141                                       const TDesC& aFullPath );	 
       
   142 
       
   143 	
       
   144         /**
       
   145          * C++ default constructor.
       
   146 		 * @param aContacts Pointer to contacts-API
       
   147 		 * @since s60 v5.0
       
   148          */
       
   149         CVIMPSTDetailsViewBrandHandler(TInt aServiceId);
       
   150 
       
   151         /**
       
   152          * By default Symbian OS constructor is private.
       
   153          * @since s60 v5.0
       
   154          */
       
   155         void ConstructL();
       
   156         
       
   157         /**
       
   158          * Prepares branding access
       
   159          * @return KErrNone if sucessfull, else the Error.
       
   160          * @since S60 5.0
       
   161          */   
       
   162         TInt PrepareBrandingAccess();
       
   163         
       
   164         /**
       
   165          * get the brand info from settings
       
   166          * @return KErrNone if sucessfull, else the Error.
       
   167          * @since S60 5.0
       
   168          */  
       
   169         TInt GetBrandInfoL(TLanguage& aBrandLanguage, 
       
   170 				TInt &aBrandVersion, TDes8& aBrandId);
       
   171 		/**
       
   172          * get the brand version from settings
       
   173          * @param aServiceId service id 
       
   174          * @param aBrand , Brand to get 
       
   175          * @param aPropertyName , property name
       
   176          * @return KErrNone if sucessfull, else the Error.
       
   177          * @since S60 5.0
       
   178          */  		
       
   179 		void PropertyReadBrandL( TUint32 aServiceId ,TInt &aBrand, 
       
   180 							TServicePropertyName aPropertyName );
       
   181     
       
   182     private:    // Data
       
   183         
       
   184         // Not own. Settings id of the service..
       
   185 		const TDesC8& iAppId;
       
   186 		
       
   187 		// Not own. Settings id of the service..
       
   188 		HBufC8* iBrandId;
       
   189 
       
   190 		// Not own. Settings id of the service..
       
   191 		TLanguage iLanguageId; 
       
   192         
       
   193         //Owns, handle to brnadingfactory.
       
   194 	    CBSFactory* iBrandingFactory; 
       
   195 	    
       
   196 	    //Owns, handle to brandaccessor
       
   197 	    MBSAccess* iBrandingAccess;
       
   198 	    
       
   199 	    //stores the default MBM path
       
   200 	    TFileName iDefaultMbmPath;
       
   201 	    
       
   202 	    // owns : service id 
       
   203 	    TInt iServiceId;
       
   204 	    
       
   205 	    // owns : settings 
       
   206 	    CSPSettings* iSettings ;
       
   207 	    
       
   208 	     // owns : service store uri 
       
   209 	    HBufC* iServiceStoreUri;
       
   210 	  
       
   211 	                  
       
   212 	};
       
   213 
       
   214 #endif      // CVIMPSTDETAILSVIEWBRANDHANDLER_H
       
   215 
       
   216 // End of File