iaupdate/IAD/firmwareupdate/inc/iaupdatefwsyncprofile.h
changeset 77 d1838696558c
parent 0 ba25891c3a9e
equal deleted inserted replaced
75:2d2d25361590 77:d1838696558c
     1 /*
     1 /*
     2 * Copyright (c) 2008 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".
    43     public:
    43     public:
    44         /**
    44         /**
    45         * Two-phased constructor.
    45         * Two-phased constructor.
    46         * @param aParam
    46         * @param aParam
    47         */
    47         */
    48         static CIAUpdateFWSyncProfile* NewLC( const TInt aApplicationId,
    48         static CIAUpdateFWSyncProfile* NewLC( RSyncMLSession* aSyncSession);
    49                                           RSyncMLSession* aSyncSession);
       
    50 
    49 
    51         /**
    50         /**
    52         * Two-phased constructor.
    51         * Two-phased constructor.
    53         * @param aParam
    52         * @param aParam
    54         */
    53         */
    55          static CIAUpdateFWSyncProfile* NewL( const TInt aApplicationId,
    54          static CIAUpdateFWSyncProfile* NewL( RSyncMLSession* aSyncSession );
    56                                          RSyncMLSession* aSyncSession );
       
    57 
    55 
    58 	    /**
    56 	    /**
    59         * Destructor.
    57         * Destructor.
    60         */
    58         */
    61         virtual ~CIAUpdateFWSyncProfile();
    59         virtual ~CIAUpdateFWSyncProfile();
    63     private:
    61     private:
    64         /**
    62         /**
    65         * C++ default constructor.
    63         * C++ default constructor.
    66         * @param aParam
    64         * @param aParam
    67         */
    65         */
    68 	    CIAUpdateFWSyncProfile( const TInt aApplicationId,
    66 	    CIAUpdateFWSyncProfile( RSyncMLSession* aSyncSession );
    69 	                        RSyncMLSession* aSyncSession );
       
    70 
    67 
    71         /**
    68         /**
    72         * By default Symbian 2nd phase constructor is private.
    69         * By default Symbian 2nd phase constructor is private.
    73         */
    70         */
    74 	    void ConstructL();
    71 	    void ConstructL();
    80         * @param aOpenMode Opening mode
    77         * @param aOpenMode Opening mode
    81 		* @return None
    78 		* @return None
    82         */
    79         */
    83          void OpenL( TInt aProfileId, TInt aOpenMode );
    80          void OpenL( TInt aProfileId, TInt aOpenMode );
    84         
    81         
    85         /**
       
    86 		* Create profile
       
    87         * @param None.
       
    88 		* @return Profile ID.
       
    89         */
       
    90          TInt CreateL();
       
    91         
       
    92         /**
       
    93 		* Create copy profile
       
    94         * @param aProfileId Profile that is used for copying
       
    95 		* @return None
       
    96         */
       
    97          void CreateCopyL( TInt aProfileId );
       
    98         
    82         
    99         /**
    83         /**
   100 		* Save profile
    84 		* Save profile
   101         * @param None
    85         * @param None
   102 		* @return None
    86 		* @return None
   103         */
    87         */
   104          void SaveL();
    88          void SaveL();
   105         
    89         
   106 	public:
    90 	public:
   107         
    91         
   108         /**
       
   109 		* Set name for profile
       
   110         * @param aText name for profile
       
   111 		* @return None
       
   112         */
       
   113          void SetNameL(const TDesC& aText);
       
   114         
    92         
   115         /**
    93         /**
   116 		* Get profile name
    94 		* Get profile name
   117         * @param aText name for profile
    95         * @param aText name for profile
   118 		* @return None
    96 		* @return None
   119         */
    97         */
   120          void GetName( TDes& aText );
    98          void GetName( TDes& aText );
   121         
    99 
   122         /**
       
   123 		* Set creator id for the profile
       
   124         * @param aCreatorId creator id
       
   125 		* @return None
       
   126         */
       
   127          void SetCreatorId(TInt aCraetorId);
       
   128         
       
   129         /**
       
   130 		* Get creator id
       
   131         * @param None
       
   132 		* @return creator id
       
   133         */
       
   134          TInt CreatorId();
       
   135         
       
   136         /**
   100         /**
   137 		* Get profile id
   101 		* Get profile id
   138         * @param None
   102         * @param None
   139 		* @return Currently open profile id
   103 		* @return Currently open profile id
   140         */
   104         */
   141          TInt ProfileId();
   105          TInt ProfileId();
   142         
   106         
   143         /**
   107     
   144 		* Check if delete is allowed
   108  
   145         * @param None
       
   146 		* @return ETrue if allowed
       
   147         */
       
   148          TBool DeleteAllowed();
       
   149         
       
   150         /**
       
   151 		* Has profile been synced
       
   152         * @param None
       
   153 		* @return ETrue if synced
       
   154         */
       
   155 		 TBool IsSynced();
       
   156         
       
   157         /**
       
   158 		* Last sync time
       
   159         * @param None
       
   160 		* @return Time of sync
       
   161         */
       
   162 		 TTime LastSync();
       
   163 		
       
   164 		/**
       
   165 		* Last Success sync time
       
   166         * @param None
       
   167 		* @return Time of sync
       
   168         */
       
   169 		 TTime LastSuccessSync();
       
   170 
       
   171     // settings that connection dialog displays
   109     // settings that connection dialog displays
   172     public:
   110     public:
   173         /**
   111          
   174 		* Set server id
       
   175         * @param aText server id
       
   176 		* @return None
       
   177         */
       
   178          void SetServerIdL(const TDesC& aText);
       
   179         
       
   180         /**
       
   181 		* Get server id
       
   182         * @param aText server id
       
   183 		* @return NOne
       
   184         */
       
   185          void GetServerId(TDes& aText);
       
   186         
       
   187         /**
       
   188 		* Get server password
       
   189         * @param aText server password
       
   190 		* @return None
       
   191         */
       
   192          void GetServerPassword( TDes& aText );
       
   193         
       
   194         /**
       
   195 		* Set server password
       
   196         * @param aText server password
       
   197 		* @return None
       
   198         */
       
   199          void SetServerPasswordL( const TDesC& aText );
       
   200         
       
   201         /**
       
   202 		* Get protocol version
       
   203         * @param None
       
   204 		* @return Version
       
   205         */
       
   206          TInt ProtocolVersion();
       
   207         
       
   208         /**
       
   209 		* Set Protocol version
       
   210         * @param aProtocolVersion protocol version
       
   211 		* @return None
       
   212         */
       
   213          void SetProtocolVersionL( TInt aProtocolVersion );
       
   214         
       
   215         /**
   112         /**
   216 		* Get bearer type
   113 		* Get bearer type
   217         * @param None
   114         * @param None
   218 		* @return bearer type
   115 		* @return bearer type
   219         */
   116         */
   220          TInt BearerType();
   117          TInt BearerType();
   221         
   118          
   222         /**
       
   223 		* Set bearer type
       
   224         * @param aId bearer type
       
   225 		* @return None
       
   226         */
       
   227          void SetBearerTypeL( TInt aId );
       
   228         
       
   229         /**
   119         /**
   230 		* Get accesspoint
   120 		* Get accesspoint
   231         * @param None
   121         * @param None
   232 		* @return accespoint
   122 		* @return accespoint
   233         */
   123         */
   237 		* Set accesspoint
   127 		* Set accesspoint
   238         * @param aId accespoint id
   128         * @param aId accespoint id
   239 		* @return None
   129 		* @return None
   240         */
   130         */
   241          void SetAccessPointL(const TInt aId);
   131          void SetAccessPointL(const TInt aId);
   242         
   132 
   243         /**
       
   244 		* Get host address
       
   245         * @param aText host address
       
   246         * @param aPort host port
       
   247 		* @return None
       
   248         */
       
   249          void GetHostAddress( TDes& aText, TInt& aPort );
       
   250         
       
   251         /**
       
   252 		* set host address
       
   253         * @param aText host address
       
   254         * @param aPort host 
       
   255 		* @return None
       
   256         */
       
   257          void SetHostAddressL( const TDesC& aText, const TInt aPort );
       
   258         
       
   259         /**
       
   260 		* Get port number 
       
   261         * @param None
       
   262 		* @return port number
       
   263         */
       
   264          TInt PortNumber();
       
   265         
       
   266         /**
       
   267 		* Set port number
       
   268         * @param aPortNumber port number
       
   269 		* @return None
       
   270         */
       
   271          void SetPortNumber( TInt aPortNumber );
       
   272         
       
   273         /**
       
   274 		* Get user name
       
   275         * @param aText user name
       
   276 		* @return None
       
   277         */
       
   278          void GetUserName( TDes& aText );
       
   279         
       
   280         /**
       
   281 		* Set user name
       
   282         * @param aText user name
       
   283 		* @return None
       
   284         */
       
   285          void SetUserNameL( const TDesC& aText );
       
   286         
       
   287         /**
       
   288 		* Get user password
       
   289         * @param aText user password
       
   290 		* @return None
       
   291         */
       
   292          void GetPassword( TDes& aText );
       
   293         
       
   294         /**
       
   295 		* Set user password
       
   296         * @param aText user password
       
   297 		* @return None
       
   298         */
       
   299          void SetPasswordL( const TDesC& aText );
       
   300         
   133         
   301         /**
   134         /**
   302 		* Set server alert state
   135 		* Set server alert state
   303         * @param aState server alert state
   136         * @param aState server alert state
   304 		* @return None
   137 		* @return None
   309 		* Get Server alert state
   142 		* Get Server alert state
   310         * @param None
   143         * @param None
   311 		* @return server alert state
   144 		* @return server alert state
   312         */
   145         */
   313          TInt SASyncState();
   146          TInt SASyncState();
   314         
   147  
   315         /**
   148          
   316 		* Set http used state
       
   317         * @param aEnable ETrue if http authentication needs to be used
       
   318 		* @return None
       
   319         */
       
   320          void SetHttpUsedL( TBool aEnable );
       
   321         
       
   322         /**
       
   323 		* Check whether http authentication is used
       
   324         * @param None
       
   325 		* @return ETrue if http authentication is used
       
   326         */
       
   327          TBool HttpUsedL();
       
   328         
       
   329         /**
       
   330 		* Get http user name
       
   331         * @param aText user name
       
   332 		* @return None
       
   333         */        
       
   334          void GetHttpUserNameL( TDes& aText );
       
   335         
       
   336         /**
       
   337 		* Set http user name
       
   338         * @param aText user name
       
   339 		* @return None
       
   340         */
       
   341          void SetHttpUserNameL( const TDesC& aText );
       
   342         
       
   343         /**
       
   344 		* Get http password
       
   345         * @param aText password
       
   346 		* @return None
       
   347         */
       
   348          void GetHttpPasswordL( TDes& aText );
       
   349         
       
   350         /**
       
   351 		* Set http password
       
   352         * @param aText password
       
   353 		* @return None
       
   354         */
       
   355          void SetHttpPasswordL( const TDesC& aText );
       
   356  
   149  
   357                
   150                
   358     public:
   151     public:
   359        
   152        
   360         /**
   153         /**
   361 		* Return latest history job
       
   362         * @param None
       
   363 		* @return CSyncMLHistoryJob*
       
   364         */        
       
   365          const CSyncMLHistoryJob* LatestHistoryJob();
       
   366         
       
   367         /**
       
   368 		* Open connection
   154 		* Open connection
   369         * @param None
   155         * @param None
   370 		* @return None
   156 		* @return None
   371         */
   157         */
   372          void OpenConnection();
   158          void OpenConnection();
   373         
   159         
   374         /**
   160  
   375 		* Open history log
       
   376         * @param None
       
   377 		* @return None
       
   378         */
       
   379          void OpenHistoryLog();
       
   380 
       
   381         /**
       
   382 		* Close history log
       
   383         * @param None
       
   384 		* @return None
       
   385         */        
       
   386          void CloseHistoryLog();
       
   387 
       
   388         /**
   161         /**
   389 		* Return DevMan profile
   162 		* Return DevMan profile
   390         * @param None
   163         * @param None
   391 		* @return RSyncMLDevManProfile&
   164 		* @return RSyncMLDevManProfile&
   392         */
   165         */
   406         * @param aPropertyPos position at the array
   179         * @param aPropertyPos position at the array
   407 		* @return None
   180 		* @return None
   408         */
   181         */
   409          void GetConnectionPropertyNameL( TDes8& aText, TInt aPropertyPos );
   182          void GetConnectionPropertyNameL( TDes8& aText, TInt aPropertyPos );
   410         
   183         
   411     private:
       
   412     
       
   413         /**
       
   414 		* Copy values from one profile to another
       
   415         * @param aSource source profile
       
   416 		* @return None
       
   417         */    
       
   418         void CopyValuesL( CIAUpdateFWSyncProfile* aSource );
       
   419 
       
   420 	private:
   184 	private:
   421 	    // profile id
   185 	    // profile id
   422         TInt                    iProfileId;
   186         TInt                    iProfileId;
   423         // Log open
   187         // Log open
   424         TBool                   iHistoryLogOpen;
   188         //TBool                   iHistoryLogOpen;
   425         // Connection open
   189         // Connection open
   426         TBool                   iConnectionOpen;
   190         TBool                   iConnectionOpen;
   427         // Port number
       
   428         TInt                    iPortNumber;
       
   429    		// needed for setting creator id
   191    		// needed for setting creator id
   430 		TInt                    iApplicationId;
   192 		TInt                    iApplicationId;
   431 		// long buffer for string handling 
   193 		// long buffer for string handling 
   432 		TBuf<KBufSize255>       iBuf;
   194 		TBuf<KBufSize255>       iBuf;
   433 		// long buffer for string handling 
   195 		// long buffer for string handling 
   434 		TBuf8<KBufSize255>      iBuf8;
   196 		TBuf8<KBufSize255>      iBuf8;
   435    		// sync session
   197    		// sync session
   436 		RSyncMLSession*         iSyncSession;
   198 		RSyncMLSession*         iSyncSession;
   437 		// sync profile
   199 		// sync profile
   438 		RSyncMLDevManProfile    iProfile;
   200 		RSyncMLDevManProfile    iProfile;
   439 		// history log
       
   440 		RSyncMLHistoryLog       iHistoryLog;
       
   441 		// sync connection
   201 		// sync connection
   442 		RSyncMLConnection       iConnection;
   202 		RSyncMLConnection       iConnection;
   443     };
   203     };
   444 
   204 
   445 #endif  // CIAUpdateFWSYNCPROFILE_H
   205 #endif  // CIAUpdateFWSYNCPROFILE_H