web_plat/webutils_api/inc/CUserAgent.h
changeset 0 dd21522fd290
child 13 10e98eab6f85
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2005 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 the License "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:  Declaration of the CUserAgent class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef  __CUSERAGENT_H
       
    20 #define  __CUSERAGENT_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <centralrepository.h>
       
    24 #include <sysversioninfo.h>
       
    25 #include <versioninfo.h>
       
    26 
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  CUserAgent class.
       
    32 *
       
    33 *  @lib webutils.lib
       
    34 *  @since 3.0
       
    35 */
       
    36 
       
    37 enum TUserAgentStringKeys
       
    38     {
       
    39 		ESymbianOSVersion,
       
    40 		ES60Version,
       
    41 		EHardwareType,
       
    42 		EMIDP_CLDCVersion,
       
    43 		EDefaultUserAgentString,
       
    44 		EDefaultMMSUserAgentString,
       
    45 		EDummy1,
       
    46 		EDummy2,
       
    47 		EURLUAProfile,
       
    48 		EURL3GUAProfile
       
    49     };
       
    50 		
       
    51 
       
    52 class CUserAgent : public CBase
       
    53     {
       
    54     public:     // functions 
       
    55 
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59         ~CUserAgent();
       
    60    
       
    61         /**
       
    62         * NewL
       
    63         */
       
    64         IMPORT_C static class CUserAgent* NewL();
       
    65         
       
    66         /**
       
    67         * Returns complete constructed user agent string.
       
    68         */
       
    69         IMPORT_C HBufC8* UserAgentL();
       
    70         
       
    71         /**
       
    72         * Returns fully contructed user agent string for MMS
       
    73         */
       
    74         IMPORT_C HBufC8* MMSUserAgentL();
       
    75         
       
    76         /**
       
    77         * Fetches the URL to user agent profile (2G and 3G)
       
    78         * @return void
       
    79         */
       
    80          IMPORT_C TInt URLToUserAgentProfileL(TDes8 &aUAProfURL, TDes8 &aUAProfURL3G);
       
    81 
       
    82         /**
       
    83         * Returns the Browser version 
       
    84         */
       
    85 		IMPORT_C HBufC* BrowserVersionL();
       
    86 
       
    87         /**
       
    88         * Returns the Browser name and version
       
    89         */
       
    90         IMPORT_C HBufC* BrowserNameAndVersionL();
       
    91         
       
    92     private:    // functions
       
    93      
       
    94         /**
       
    95         * Symbian default constructor.
       
    96         */
       
    97 		void ConstructL();
       
    98 
       
    99         /**
       
   100         * Default C++ constructor
       
   101         */
       
   102 		CUserAgent();
       
   103 		
       
   104 	   /**
       
   105         * Reads useragent strings from shareddata / central repository
       
   106         */
       
   107 		void ReadUserAgentStringL();
       
   108 		void ReadMMSUserAgentStringL();
       
   109 		void ReadURLUserAgentProfileL();
       
   110 		
       
   111 		bool IsUAStringEmpty(const TPtr &aUAString);
       
   112 		TInt GetCenRepFragment(TUserAgentStringKeys aFragmentType, TDes& fragmentValue);
       
   113 		void GetFragmentsL();
       
   114 		void ReadAndCreateUAStringL(TPtr &aUAStringPtr);
       
   115 		
       
   116 		
       
   117 #ifdef BRDO_BROWSER_50_FF
       
   118 		void GetFragmentsFromOSExtL();
       
   119 		TInt GetOSExtFragment(TUserAgentStringKeys aFragmentType, TDes& fragmentValue, RFs& fs);
       
   120 		/**
       
   121         * Gets the Version Values from osext layer / central repository
       
   122         */
       
   123 		TInt GetOSVersion(TDes& aValue, RFs& aFs);
       
   124 		TInt GetS60Version(TDes& aValue, RFs& aFs);
       
   125 		TInt GetVersion(const SysVersionInfo::TVersionInfoType aType, TDes& aValue);
       
   126 		TInt GetHardwareVersion(TDes& aHardwareType, RFs& aFs);
       
   127 #endif //#ifdef BRDO_BROWSER_50_FF		
       
   128 
       
   129 		void GetBrowserVersionL();
       
   130 		void GetBrowserNameAndVersionL();
       
   131 		
       
   132 	private:		//data
       
   133 
       
   134 	 	CRepository* iRepository;
       
   135 
       
   136 	 	TBool	iUAStrQueried;
       
   137 	 	TBool	iMMSUAStrQueried;
       
   138 	 	TBool	iURLUAProfQueried;
       
   139 
       
   140 		HBufC*	iBrowserCenrepStr;
       
   141 		HBufC*	iMMSCenrepStr;
       
   142 		HBufC*	iUAProfURL;
       
   143 		HBufC*	iUAProfURL3G;
       
   144 		
       
   145 		TBuf<64> iSymbianVersion;
       
   146 		TBuf<64> iS60Version;
       
   147 		TBuf<64> iMIDPCLDCVersion;
       
   148 		TBuf<64> iHardwareType;
       
   149 
       
   150 		HBufC*	iBrowserVersionStr;
       
   151 		HBufC*	iBrowserNameAndVersionStr;
       
   152 
       
   153    };
       
   154 
       
   155 
       
   156 #endif // __CUSERAGENT_H
       
   157 
       
   158 // End of File