00001 /* 00002 * ============================================================================== 00003 * Name : siprefresh.h 00004 * Part of : SIP Client 00005 * Interface : SDK API, SIP Client API 00006 * Description : 00007 * Version : 1.0 00008 * 00009 * Copyright (c) 2005 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================== 00019 */ 00020 00021 00022 #ifndef CSIPREFRESH_H 00023 #define CSIPREFRESH_H 00024 00025 // INCLUDES 00026 #include <e32base.h> 00027 #include <stringpool.h> 00028 #include "_sipcodecdefs.h" 00029 00030 // FORWARD DECLARATIONS 00031 class CSIPClientTransaction; 00032 class CSIPMessageElements; 00033 class MSIPRefreshAssociation; 00034 00035 // CLASS DECLARATION 00036 00052 class CSIPRefresh: public CBase 00053 { 00054 public: 00055 00057 enum TState 00058 { 00060 EInactive, 00062 EActive, 00064 ETerminated, 00066 EConstructing 00067 }; 00068 00069 public: // Constructors and destructor 00070 00075 IMPORT_C static CSIPRefresh* NewL(); 00076 00081 IMPORT_C static CSIPRefresh* NewLC(); 00082 00086 IMPORT_C ~CSIPRefresh(); 00087 00088 public: // New functions 00089 00094 IMPORT_C CSIPRefresh::TState State() const; 00095 00100 IMPORT_C TBool IsStandAlone() const; 00101 00108 IMPORT_C const CSIPClientTransaction* SIPTransaction() const; 00109 00128 IMPORT_C CSIPClientTransaction* 00129 TerminateL(CSIPMessageElements* aElements=0); 00130 00149 IMPORT_C CSIPClientTransaction* 00150 UpdateL(CSIPMessageElements* aElements=0); 00151 00157 IMPORT_C TBool operator==(const CSIPRefresh& aRefresh) const; 00158 00167 IMPORT_C TUint IntervalL() const; 00168 00182 IMPORT_C void SetIntervalL(TUint aInterval); 00183 00184 public: // New functions, for internal use 00185 00186 TBool DoesMatch(TUint32 aRefreshId) const; 00187 00193 void SetRefreshOwner(MSIPRefreshAssociation& aAssoc); 00194 00195 void RemoveRefreshOwner(const MSIPRefreshAssociation& aAssoc); 00196 00197 void ChangeState(CSIPRefresh::TState aNextState); 00198 00199 void UpdateRefreshState(TUint aStatusCode); 00200 00201 TUint32 RefreshId() const; 00202 00203 void SetRefreshIdIfEmpty(TUint32 aRefreshId); 00204 00205 RStringF RequestType() const; 00206 00207 void SetRequestType(RStringF aType); 00208 00209 void AddTransaction(CSIPClientTransaction& aTransaction); 00210 00211 void RemoveTransaction(); 00212 00213 CSIPClientTransaction* Transaction(); 00214 00215 private: // Constructors 00216 00217 CSIPRefresh(); 00218 00219 void ConstructL(); 00220 00221 private: 00222 00223 void CheckStateL() const; 00224 00225 private: // Data 00226 00227 MSIPRefreshAssociation* iOwner; 00228 00229 //Client transaction which is refreshed, not owned by CSIPRefresh. 00230 CSIPClientTransaction* iClientTransaction; 00231 00232 //Current state of the refresh 00233 TState iState; 00234 00235 //RefreshId received from SIP client 00236 TUint32 iRefreshId; 00237 00238 //Identifies the request method which is being refreshed 00239 RStringF iRequestType; 00240 00241 private: // For testing purposes 00242 00243 UNIT_TEST(CSIP_Test) 00244 UNIT_TEST(CSIPConnection_Test) 00245 }; 00246 00247 #endif