iaupdate/IAD/firmwareupdate/inc/iaupdatefwsyncutil.h
changeset 77 d1838696558c
parent 0 ba25891c3a9e
equal deleted inserted replaced
75:2d2d25361590 77:d1838696558c
     1 /*
     1 /*
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    68         * String append tool
    68         * String append tool
    69         * @param aTarget.
    69         * @param aTarget.
    70         * @param aSource.
    70         * @param aSource.
    71         * @return None
    71         * @return None
    72         */      		
    72         */      		
    73 		static void StrAppend( TDes& aTarget, const TDesC& aSource );
    73 
    74         
       
    75         /**
       
    76         * String insert tool
       
    77         * @param aTarget.
       
    78         * @param aSource.
       
    79         * @return None
       
    80         */      		
       
    81 		 static void StrInsert( TDes& aTarget, const TDesC& aSource );
       
    82         
       
    83         /**
       
    84         * Convert string to int
       
    85         * @param aText.
       
    86         * @param aNum.
       
    87         * @return None
       
    88         */		
       
    89 		static TInt StrToInt( const TDesC& aText, TInt& aNum );
    74 		static TInt StrToInt( const TDesC& aText, TInt& aNum );
    90         
    75         
    91         /**
    76         /**
    92         * Check whether textline is empty
    77         * Check whether textline is empty
    93         * @param aText.
    78         * @param aText.
    94         * @return ETrue if empty
    79         * @return ETrue if empty
    95         */				
    80         */				
    96 		static TBool IsEmpty( const TDesC& aText );
       
    97         
       
    98         /**
       
    99         * URI Parser
       
   100         * @param aURI
       
   101         * @param aAddress
       
   102         * @param aPort
       
   103         * @param aDocName
       
   104         * @return None
       
   105         */						
       
   106         static void ParseURIL( const TDesC& aURI, 
       
   107                                TDes& aAddress, 
       
   108                                TDes& aPort, 
       
   109                                TDes& aDocName );
       
   110       
       
   111         /**
       
   112         * Returns formatted sync time
       
   113         * @param aLastSync
       
   114         * @return Sync time
       
   115         */
       
   116         static HBufC* SyncTimeLC( TTime aLastSync );
       
   117         
       
   118         /**
       
   119         * Get data as text
       
   120         * @param 
       
   121         * @return 
       
   122         */        
       
   123         static void GetDateTextL( TDes& aText, TTime aDateTime );
       
   124         
       
   125         /**
       
   126         * Get time as text 
       
   127         * @param 
       
   128         * @return 
       
   129         */        
       
   130 		static void GetTimeTextL( TDes& aText, TTime aDateTime );
       
   131         
       
   132         /**
       
   133         * Get data and time as text
       
   134         * @param 
       
   135         * @return 
       
   136         */        
       
   137 		static void GetDateTimeTextL( TDes& aText, TTime aDateTime );
       
   138         
       
   139         /**
       
   140         * Check if SettingEnforcement is set
       
   141         * @param 
       
   142         * @return Boolean
       
   143         */        
       
   144 		static TBool SettingEnforcementStateL();
       
   145 
       
   146         /**
       
   147         * Check if SettingEnforcement is set (non-leaving)
       
   148         * @param 
       
   149         * @return Boolean
       
   150         */        
       
   151 		static TBool SettingEnforcementState();
       
   152 
       
   153     private:
       
   154     
       
   155         /**
       
   156         * Check if sync has happened today
       
   157         * @param atime
       
   158         * @return Boolean
       
   159         */    
       
   160         static TBool IsToday( TTime aTime );
       
   161         
       
   162         /**
       
   163         * Convert time to hometime
       
   164         * @param aUniversalTime
       
   165         * @return TTIme
       
   166         */            
       
   167         static TTime ConvertUniversalToHomeTime( const TTime& aUniversalTime );
       
   168 
    81 
   169 	};
    82 	};
   170 
    83 
   171 /**
       
   172 *  TStr contains descriptor operations with range checking.
       
   173 */
       
   174 NONSHARABLE_CLASS (TStr)
       
   175     {
       
   176     public:
       
   177         /**
       
   178         * C++ default constructor.
       
   179         */
       
   180         TStr(const TDesC& aStr);
       
   181        
       
   182     public:
       
   183         /**
       
   184         * String manipulating tools
       
   185         * @param aPos
       
   186         * @param aLen
       
   187         * @return TPtrC
       
   188         */        
       
   189         TPtrC Mid( TInt aPos, TInt aLen );
       
   190         
       
   191         /**
       
   192         * String manipulating tools
       
   193         * @param aPos
       
   194         * @return TPtrC
       
   195         */                
       
   196         TPtrC Mid( TInt aPos );
       
   197 
    84 
   198         /**
       
   199         * String manipulating tools
       
   200         * @param aPos
       
   201         * @return TPtrC
       
   202         */                
       
   203         TPtrC Left( TInt aPos );
       
   204         
       
   205         /**
       
   206         * String manipulating tools
       
   207         * @param aPos
       
   208         * @return TPtrC
       
   209         */               
       
   210         TPtrC Right( TInt aPos );
       
   211         
       
   212         /**
       
   213         * String manipulating tools
       
   214         * @param aStartPos
       
   215         * @param aEndPos
       
   216         * @return TPtrC
       
   217         */               
       
   218         TPtrC SubStr( TInt aStartPos, TInt aEndPos );
       
   219 
       
   220         /**
       
   221         * String manipulating tools
       
   222         * @param aStartPos
       
   223         * @param aEndPos
       
   224         * @return TPtrC
       
   225         */           
       
   226         TPtrC SubStrEx( TInt aStartPos, TInt aEndPos );
       
   227 
       
   228         /**
       
   229         * String manipulating tools
       
   230         * @return TInt
       
   231         */           
       
   232         TInt LastPos();
       
   233 
       
   234         /**
       
   235         * String manipulating tools
       
   236         * @return TInt
       
   237         */           
       
   238         TInt Len();
       
   239 
       
   240         /**
       
   241         * String manipulating tools
       
   242         * @param aPos
       
   243         * @param aChar
       
   244         * @return TBool
       
   245         */           
       
   246         TBool Compare( TInt aPos, TChar aChar );
       
   247 
       
   248         /**
       
   249         * String manipulating tools
       
   250         * @param aStartPos
       
   251         * @param aChar
       
   252         * @return TInt
       
   253         */
       
   254         TInt Find( TInt aPos, TChar aChar );
       
   255         
       
   256     private:
       
   257         // reference to descriptor
       
   258 		const TDesC& iStr;
       
   259     };
       
   260 
       
   261 /**
       
   262 *  TURIParser is used for parsing URI.
       
   263 */
       
   264 NONSHARABLE_CLASS (TURIParser)
       
   265     {
       
   266     public:
       
   267         /**
       
   268         * C++ default constructor.
       
   269         */
       
   270         TURIParser( const TDesC& aStr );
       
   271        
       
   272     public:
       
   273         /**
       
   274         * URI manipulating tools
       
   275         * @param aText
       
   276         * @return None
       
   277         */    
       
   278         void GetUriWithoutPort( TDes& aText );
       
   279 
       
   280         /**
       
   281         * URI manipulating tools
       
   282         * @param aText
       
   283         * @param aPort
       
   284         * @return None
       
   285         */            
       
   286         void GetUri( TDes& aText, const TInt aPort );
       
   287 
       
   288         /**
       
   289         * URI manipulating tools
       
   290         * @return TInt
       
   291         */            
       
   292         TInt Port();
       
   293 
       
   294         /**
       
   295         * URI manipulating tools
       
   296         * @return TInt
       
   297         */            
       
   298         TInt DefaultPort();
       
   299 
       
   300     private:
       
   301         /**
       
   302         * URI manipulating tools
       
   303         * @return TPtrC
       
   304         */          
       
   305         TPtrC ParseHttp();
       
   306 
       
   307         /**
       
   308         * URI manipulating tools
       
   309         * @return TPtrC
       
   310         */              
       
   311         TPtrC ParseAddress();
       
   312 
       
   313         /**
       
   314         * URI manipulating tools
       
   315         * @return TPtrC
       
   316         */              
       
   317         TPtrC ParseDocument();
       
   318 
       
   319         /**
       
   320         * URI manipulating tools
       
   321         * @param aPortNumber
       
   322         * @return TInt
       
   323         */              
       
   324         TInt ParsePort(TInt& aPortNumber);
       
   325 
       
   326         /**
       
   327         * URI manipulating tools
       
   328         * @return TPtrC
       
   329         */              
       
   330         TPtrC ParsePort();
       
   331         
       
   332      private:
       
   333 
       
   334         /**
       
   335         * URI manipulating tools
       
   336         * @param aStartPos
       
   337         * @param aEndPos
       
   338         * @return None
       
   339         */          
       
   340         void GetHttpPos(TInt& aStartPos, TInt& aEndPos);
       
   341 
       
   342         /**
       
   343         * URI manipulating tools
       
   344         * @return NOne
       
   345         */             
       
   346         void SkipHttp();
       
   347   
       
   348     private:
       
   349         // reference to original URI text
       
   350 		const TDesC& iOriginalStr;
       
   351 		
       
   352 		// pointer to original URI text
       
   353 		TPtrC iPtr;
       
   354 		
       
   355 		//reference to Boolean variable which tells about Slash in URI
       
   356 		TBool iSlash;
       
   357     };
       
   358 
    85 
   359 /**
    86 /**
   360 * MIAUpdateFWActiveCallerObserver
    87 * MIAUpdateFWActiveCallerObserver
   361 *
    88 *
   362 * MIAUpdateFWActiveCallerObserver is for observing CIAUpdateFWActiveCaller.
    89 * MIAUpdateFWActiveCallerObserver is for observing CIAUpdateFWActiveCaller.
   443 
   170 
   444 		// observer that gets called
   171 		// observer that gets called
   445 		MIAUpdateFWActiveCallerObserver* iObserver;
   172 		MIAUpdateFWActiveCallerObserver* iObserver;
   446     };
   173     };
   447 
   174 
   448 #endif  // NSMLDMSYNCUTIL_H
   175 #endif  // IAUPDATEFWSYNCUTIL_H
   449 
   176 
   450 // End of File
   177 // End of File