00001 /* 00002 * ============================================================================== 00003 * Name : sipsubscribedialogassoc.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 #ifndef CSIPSUBSCRIBEDIALOGASSOC_H 00022 #define CSIPSUBSCRIBEDIALOGASSOC_H 00023 00024 // INCLUDES 00025 #include "sipdialogassocbase.h" 00026 00027 // CONSTANTS 00028 00029 // FORWARD DECLARATIONS 00030 class CUri8; 00031 class CSIPToHeader; 00032 class CSIPFromHeader; 00033 class CSIPContactHeader; 00034 class CSIPEventHeader; 00035 class CSIPMessageElements; 00036 class MSIPRegistrationContext; 00037 class CSIPConnection; 00038 00039 // CLASS DECLARATION 00040 00054 class CSIPSubscribeDialogAssoc : public CSIPDialogAssocBase 00055 { 00056 public: // Constructors and destructor 00069 IMPORT_C static CSIPSubscribeDialogAssoc* 00070 NewL(CSIPDialog& aDialog, 00071 CSIPEventHeader* aEvent); 00072 00084 IMPORT_C static CSIPSubscribeDialogAssoc* 00085 NewLC(CSIPDialog& aDialog, 00086 CSIPEventHeader* aEvent); 00087 00112 IMPORT_C static CSIPSubscribeDialogAssoc* 00113 NewL(CSIPConnection& aConnection, 00114 CSIPFromHeader* aFrom, 00115 CUri8* aRemoteUri, 00116 CSIPEventHeader* aEvent, 00117 CSIPToHeader* aTo=0, 00118 CSIPContactHeader* aContact=0); 00119 00144 IMPORT_C static CSIPSubscribeDialogAssoc* 00145 NewLC(CSIPConnection& aConnection, 00146 CSIPFromHeader* aFrom, 00147 CUri8* aRemoteUri, 00148 CSIPEventHeader* aEvent, 00149 CSIPToHeader* aTo =0, 00150 CSIPContactHeader* aContact=0); 00151 00182 IMPORT_C static CSIPSubscribeDialogAssoc* 00183 NewL(CSIPConnection& aConnection, 00184 CUri8* aRemoteUri, 00185 const MSIPRegistrationContext& aContext, 00186 CSIPEventHeader* aEvent, 00187 CSIPFromHeader* aFrom = 0, 00188 CSIPToHeader* aTo = 0, 00189 CSIPContactHeader* aContact = 0); 00190 00221 IMPORT_C static CSIPSubscribeDialogAssoc* 00222 NewLC(CSIPConnection& aConnection, 00223 CUri8* aRemoteUri, 00224 const MSIPRegistrationContext& aContext, 00225 CSIPEventHeader* aEvent, 00226 CSIPFromHeader* aFrom = 0, 00227 CSIPToHeader* aTo = 0, 00228 CSIPContactHeader* aContact = 0); 00229 00233 IMPORT_C ~CSIPSubscribeDialogAssoc(); 00234 00235 public: //New functions 00254 IMPORT_C CSIPClientTransaction* 00255 SendSubscribeL(CSIPMessageElements* aElements=0, 00256 CSIPRefresh* aRefresh=0); 00257 00273 IMPORT_C CSIPClientTransaction* UpdateL(CSIPMessageElements* aElements); 00274 00287 IMPORT_C CSIPClientTransaction* 00288 SendUnsubscribeL(CSIPMessageElements* aElements=0); 00289 00298 IMPORT_C const CSIPRefresh* SIPRefresh() const; 00299 00304 IMPORT_C const CSIPEventHeader& Event() const; 00305 00306 public: // New functions, for internal use 00307 CSIPRefresh* FindRefresh(TUint32 aRefreshId); 00308 00309 static CSIPSubscribeDialogAssoc* NewLC(CSIPConnection& aConnection, 00310 CUri8* aRemoteUri, 00311 CSIPEventHeader* aEvent, 00312 CSIPFromHeader* aFrom, 00313 CSIPToHeader* aTo, 00314 CSIPContactHeader* aContact, 00315 const MSIPRegistrationContext* aContext); 00316 00317 void ConnectionLost(); 00318 00319 CSIPClientTransaction* 00320 DoSendSubscribeL(CSIPMessageElements* aElements, 00321 CSIPRefresh* aRefresh, 00322 TBool aWithinDialog); 00323 00324 CSIPClientTransaction* 00325 DoSendUnsubscribeL(CSIPMessageElements* aElements); 00326 00327 void DeletingRefresh(CSIPRefresh& aRefresh, TUint32 aRefreshId); 00328 00329 private: // Constructors 00330 CSIPSubscribeDialogAssoc(); 00331 00332 private: // Data 00333 //If the subscription is refreshed, this is the used CSIPRefresh 00334 //instance, otherwise this is NULL. CSIPSubscribeDialogAssoc owns this. 00335 CSIPRefresh* iRefresh; 00336 00337 CSIPEventHeader* iEvent; 00338 00339 private: // For testing purposes 00340 UNIT_TEST(CSIP_Test) 00341 UNIT_TEST(CSIPSubscribeDialogAssoc_Test) 00342 }; 00343 00344 #endif