epoc32/include/sipprofileregistrybase.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:
williamr@2
    15
* Name        : sipprofileregistrybase.h
williamr@2
    16
* Part of     : SIP Profile Client
williamr@2
    17
* Interface   : SDK API, SIP Profile API
williamr@2
    18
* The class for retrieving SIP profiles from permanent storage.
williamr@2
    19
* Version     : 1.0
williamr@2
    20
*
williamr@2
    21
*/
williamr@2
    22
williamr@2
    23
williamr@2
    24
williamr@2
    25
#ifndef CSIPPROFILEREGISTRYBASE_H
williamr@2
    26
#define CSIPPROFILEREGISTRYBASE_H
williamr@2
    27
williamr@2
    28
//  INCLUDES
williamr@2
    29
#include <e32base.h>
williamr@2
    30
#include <badesca.h>
williamr@2
    31
#include "sipconcreteprofileobserver.h"
williamr@2
    32
williamr@2
    33
// FORWARD DECLARATIONS
williamr@2
    34
class CSIPProfile;
williamr@2
    35
class CSIPConcreteProfile;
williamr@2
    36
class TSIPProfileTypeInfo;
williamr@2
    37
class CSIPProfileCleanupItem;
williamr@2
    38
class CSIPProfileItem;
williamr@2
    39
class CSIPProfileITCReceiver;
williamr@2
    40
class CSIPProfileITC;
williamr@2
    41
class CSIPProfilePlugins;
williamr@2
    42
class MSIPProfileRegistryObserver;
williamr@2
    43
class RSIPProfile;
williamr@2
    44
class CSIPConcreteProfileHolder;
williamr@2
    45
williamr@2
    46
// CLASS DECLARATION
williamr@2
    47
/**
williamr@2
    48
* @publishedAll
williamr@2
    49
* @released
williamr@2
    50
*
williamr@2
    51
* The class functions for retrieving SIP profiles from permanent storage.
williamr@2
    52
* It enables retrieval of single or more profiles from permanent
williamr@2
    53
* storage located in profile server.
williamr@2
    54
*  
williamr@2
    55
* The class enables also the query of supported profile types.
williamr@2
    56
*
williamr@2
    57
* This class is an abstract class and cannot be instantiated.
williamr@2
    58
*
williamr@2
    59
* @lib sipprofilecli.lib
williamr@2
    60
*/
williamr@2
    61
class CSIPProfileRegistryBase: public CBase, public MSIPConcreteProfileObserver
williamr@2
    62
    {
williamr@2
    63
    public:  // Constructors and destructor
williamr@2
    64
williamr@2
    65
        IMPORT_C ~CSIPProfileRegistryBase();
williamr@2
    66
williamr@2
    67
    public: //new functions
williamr@2
    68
        /**
williamr@2
    69
        * Gets all SIP profiles
williamr@2
    70
        * @pre aProfiles.Count() == 0
williamr@2
    71
        * @param aProfiles a reference to a client-owned array, which
williamr@2
    72
        *        on return is filled with all existing SIP profiles
williamr@2
    73
        * @leave KErrNoMemory if out of memory
williamr@2
    74
        * @capability ReadUserData
williamr@2
    75
        */
williamr@2
    76
        IMPORT_C void ProfilesL(RPointerArray<CSIPProfile>& aProfiles);
williamr@2
    77
williamr@2
    78
        /**
williamr@2
    79
        * Gets all SIP profiles of particular type
williamr@2
    80
        * The owneship of profiles are transferred.
williamr@2
    81
        * @pre aProfiles.Count() == 0
williamr@2
    82
        * @param aType a SIP profile type that is used for a query
williamr@2
    83
        * @param aProfiles a reference to a client-owned array, which
williamr@2
    84
        *        on return is filled with profiles of the given type.
williamr@2
    85
        * @leave KErrNoMemory if out of memory
williamr@2
    86
        * @capability ReadUserData
williamr@2
    87
        */        
williamr@2
    88
        IMPORT_C void ProfilesL(
williamr@2
    89
                     const TSIPProfileTypeInfo& aType,
williamr@2
    90
                     RPointerArray<CSIPProfile>& aProfiles);
williamr@2
    91
williamr@2
    92
        /**
williamr@2
    93
        * Gets SIP profile for a particular SIP AOR
williamr@2
    94
        * The owneship of profiles are transferred.
williamr@2
    95
        * @pre aProfiles.Count() == 0
williamr@2
    96
        * @param aAOR a SIP AOR e.g. user@domain.com
williamr@2
    97
        * @param aProfiles a reference to a client-owned array, which
williamr@2
    98
        *        on return is filled with profiles of the given type.
williamr@2
    99
        * @leave KErrNoMemory if out memory
williamr@2
   100
        * @capability ReadUserData
williamr@2
   101
        */
williamr@2
   102
        IMPORT_C void ProfilesL(
williamr@2
   103
                     const TDesC8& aAOR,
williamr@2
   104
                     RPointerArray<CSIPProfile>& aProfiles);
williamr@2
   105
williamr@2
   106
        /**
williamr@2
   107
        * Gets SIP profile identified by the Id
williamr@2
   108
        * The owneship of profile is transferred.
williamr@2
   109
        * @param aId a SIP profile Id
williamr@2
   110
        * @return SIP profile 
williamr@2
   111
        * @leave KErrNotFound if profile is not found
williamr@2
   112
        * @capability ReadUserData
williamr@2
   113
        */
williamr@2
   114
        IMPORT_C CSIPProfile* ProfileL(TUint32 aId);
williamr@2
   115
williamr@2
   116
        /**
williamr@2
   117
        * Gets the default profile
williamr@2
   118
        * @return default profile; the owneship is transfered
williamr@2
   119
        * @leave KErrNotFound if profile not found
williamr@2
   120
        * @leave KErrNoMemory if out of memory
williamr@2
   121
        * @capability ReadUserData
williamr@2
   122
        */
williamr@2
   123
        IMPORT_C CSIPProfile* DefaultProfileL();
williamr@2
   124
williamr@2
   125
        /**
williamr@2
   126
        * Gets supported profile types
williamr@2
   127
        * The owneship of returned objects are transferred.
williamr@2
   128
        * @pre aSupportedProfileTypes.Count() == 0
williamr@2
   129
        * @param aSupportedProfileTypes a reference to  client-owned array,
williamr@2
   130
        *        which on return is filled with supported profile types.
williamr@2
   131
        *         Any existing data in the array is destroyed.
williamr@2
   132
        * @leave KErrNoMemory if out of memory
williamr@2
   133
        */
williamr@2
   134
        IMPORT_C void SupportedProfileTypesL(
williamr@2
   135
                    RArray<TSIPProfileTypeInfo>& aSupportedProfileTypes);
williamr@2
   136
williamr@2
   137
        /**
williamr@2
   138
        * Gets the last occurred error during registration
williamr@2
   139
        * @param aProfile 
williamr@2
   140
        * @return last occurred registration error, KErrNone if no error
williamr@2
   141
        */
williamr@2
   142
        IMPORT_C TInt LastRegistrationError(const CSIPProfile& aProfile) const;
williamr@2
   143
williamr@2
   144
    public:
williamr@2
   145
williamr@2
   146
        /**
williamr@2
   147
        * Enable profile
williamr@2
   148
        * @param aProfile to be enabled
williamr@2
   149
        * @internalComponent        
williamr@2
   150
        */
williamr@2
   151
        void EnableProfileL(CSIPProfile& aProfile);
williamr@2
   152
        
williamr@2
   153
        /**
williamr@2
   154
        * Gets count of clients that have a profile enabled
williamr@2
   155
        * @param aProfile profile to be checked
williamr@2
   156
        * @return number of clients that have the profile enabled
williamr@2
   157
        * @internalComponent
williamr@2
   158
        */
williamr@2
   159
        TInt UsageL(const CSIPProfile& aProfile) const;
williamr@2
   160
williamr@2
   161
        /**
williamr@2
   162
        * Disable profile
williamr@2
   163
        * @param aProfile to be disabled
williamr@2
   164
        * @internalComponent
williamr@2
   165
        */
williamr@2
   166
        void DisableProfileL(CSIPProfile& aProfile);
williamr@2
   167
        
williamr@2
   168
        /**
williamr@2
   169
        * Force disable profile
williamr@2
   170
    	* All Profile related activities will be stopped ungracefully
williamr@2
   171
        * @param aProfile to be disabled
williamr@2
   172
        * @internalComponent
williamr@2
   173
        */
williamr@2
   174
        void ForceDisableProfileL(CSIPProfile& aProfile);
williamr@2
   175
williamr@2
   176
        /**
williamr@2
   177
        * Add profile
williamr@2
   178
        * @param aProfile to be added
williamr@2
   179
        * @internalComponent
williamr@2
   180
        */
williamr@2
   181
        void AddProfileL(CSIPProfile& aProfile);
williamr@2
   182
williamr@2
   183
        /**
williamr@2
   184
        * Update profile
williamr@2
   185
        * @param aProfile to be updated
williamr@2
   186
        * @internalComponent
williamr@2
   187
        */
williamr@2
   188
        void UpdateProfileL(CSIPProfile& aProfile);
williamr@2
   189
williamr@2
   190
        /**
williamr@2
   191
        * Remove profile
williamr@2
   192
        * @pre UsageL(aProfile) == 0
williamr@2
   193
        * @param aProfile to be removed
williamr@2
   194
        * @internalComponent
williamr@2
   195
        */
williamr@2
   196
        void RemoveProfileL(CSIPProfile& aProfile);
williamr@2
   197
williamr@2
   198
        /**
williamr@2
   199
        * Informs destruction of local profile object instance
williamr@2
   200
        * @param aProfile instance of deleted profile
williamr@2
   201
        * @internalComponent
williamr@2
   202
        */
williamr@2
   203
        void ProfileDeleted(CSIPProfile& aProfile);
williamr@2
   204
williamr@2
   205
        /**
williamr@2
   206
        * Checks whether profile is default or not
williamr@2
   207
        * @param aProfile checked profile
williamr@2
   208
        * @return ETrue if is default, otherwise EFalse
williamr@2
   209
        * @internalComponent
williamr@2
   210
        */
williamr@2
   211
        TBool IsDefaultProfileL(const CSIPProfile& aProfile);
williamr@2
   212
williamr@2
   213
        /**
williamr@2
   214
        * Updates SIP profile value for negotiated security mechanism; leaves on failure
williamr@2
   215
        * @param aProfile a SIP profile
williamr@2
   216
        * @internalComponent
williamr@2
   217
        */
williamr@2
   218
        void NegotiatedSecurityMechanismL(CSIPConcreteProfile& aProfile);
williamr@2
   219
williamr@2
   220
        /**
williamr@2
   221
        * Updates SIP profile value for registered AORs; leaves on failure
williamr@2
   222
        * @param aProfile a SIP profile
williamr@2
   223
        * @internalComponent
williamr@2
   224
        */
williamr@2
   225
        void RegisteredAORsL(CSIPConcreteProfile& aProfile);
williamr@2
   226
williamr@2
   227
        /**
williamr@2
   228
        * Gets new instance of either type CSIPProfile or CSIPManagedProfile
williamr@2
   229
        * @return new instance
williamr@2
   230
        * @internalComponent
williamr@2
   231
        */        
williamr@2
   232
        virtual CSIPProfile* NewInstanceL() = 0;
williamr@2
   233
williamr@2
   234
        /**
williamr@2
   235
        * Roll back in case of failure
williamr@2
   236
        * @param aItem object to be cleaned
williamr@2
   237
        * @internalComponent
williamr@2
   238
        */
williamr@2
   239
        static void CrashRevert (TAny* aItem);
williamr@2
   240
williamr@2
   241
        /**
williamr@2
   242
        * Roll back in case of failure
williamr@2
   243
        * @param aItem object to be cleaned
williamr@2
   244
        * @internalComponent
williamr@2
   245
        */
williamr@2
   246
        static void LocalCrashRevert (TAny* aItem);
williamr@2
   247
        
williamr@2
   248
        /**
williamr@2
   249
        * Gets the ITC member variable.
williamr@2
   250
        * The owneship of ITC is not transferred.
williamr@2
   251
        * @return Reference to ITC member variable.
williamr@2
   252
        * @internalComponent 
williamr@2
   253
        */
williamr@2
   254
        CSIPProfileITC& Itc(); 
williamr@2
   255
        
williamr@2
   256
        /**
williamr@2
   257
        * Gets the ITC receiver member variable.
williamr@2
   258
        * The owneship of ITC receiver is not transferred.
williamr@2
   259
        * @return Reference to ITC receiver member variable.
williamr@2
   260
        * @internalComponent 
williamr@2
   261
        */
williamr@2
   262
        CSIPProfileITCReceiver& ItcReceiver(); 
williamr@2
   263
williamr@2
   264
williamr@2
   265
    public: // From MSIPConcreteProfileObserver
williamr@2
   266
williamr@2
   267
        /**
williamr@2
   268
        * SIP profile registration status changed event
williamr@2
   269
        * @param aProfileId id of profile which registration 
williamr@2
   270
        *        status has been changed.
williamr@2
   271
        * @param aStatus new status of the profile
williamr@2
   272
        * @param aStatusId id related to registration
williamr@2
   273
        * @internalComponent
williamr@2
   274
        */
williamr@2
   275
        void RegistrationStatusChangedL(TUint32 aProfileId, 
williamr@2
   276
                                       TInt aStatus,
williamr@2
   277
                                       TUint32 aStatusId);
williamr@2
   278
williamr@2
   279
        /** 
williamr@2
   280
        * SIP profile creation event.
williamr@2
   281
        * @param aProfileId id of new SIP Profile
williamr@2
   282
        * @internalComponent
williamr@2
   283
        */
williamr@2
   284
        void AddedL(TUint32 aProfileId);
williamr@2
   285
williamr@2
   286
        /**
williamr@2
   287
        * SIP profile destruction event.
williamr@2
   288
        * @param aProfileId id of profile which was destroyed
williamr@2
   289
        * @internalComponent
williamr@2
   290
        */    
williamr@2
   291
        void RemovedL(TUint32 aProfileId);
williamr@2
   292
williamr@2
   293
        /** 
williamr@2
   294
        * SIP profile information update event
williamr@2
   295
        * @param aProfileId id of updated SIP Profile
williamr@2
   296
        * @param aSize size of updated SIP Profile
williamr@2
   297
        * @internalComponent
williamr@2
   298
        */
williamr@2
   299
        void UpdatedL(TUint32 aProfileId, TUint aSize);
williamr@2
   300
williamr@2
   301
        /**
williamr@2
   302
        * An asynchronous error has occurred related to SIP profile
williamr@2
   303
        * @param aProfileId the id of failed profile 
williamr@2
   304
        * @param aStatus
williamr@2
   305
        * @param aError a error code
williamr@2
   306
        * @internalComponent
williamr@2
   307
        */
williamr@2
   308
        void ErrorOccurredL(TUint32 aProfileId,
williamr@2
   309
                            TInt aStatus,
williamr@2
   310
                            TInt aError);
williamr@2
   311
williamr@2
   312
    protected: 
williamr@2
   313
                                            
williamr@2
   314
        /**
williamr@2
   315
        * Constructor
williamr@2
   316
        * @param aObserver observer to send events to
williamr@2
   317
        * @internalComponent 
williamr@2
   318
        */
williamr@2
   319
        CSIPProfileRegistryBase(MSIPProfileRegistryObserver& aObserver); 
williamr@2
   320
williamr@2
   321
        /**
williamr@2
   322
        * Symbian 2nd phase base class constructor
williamr@2
   323
        * @internalComponent
williamr@2
   324
        */
williamr@2
   325
        void BaseConstructL();
williamr@2
   326
williamr@2
   327
        /**
williamr@2
   328
        * Store profile into client cache
williamr@2
   329
        * @param aItem a cleanup item for roll back in case of failure
williamr@2
   330
        * @internalComponent
williamr@2
   331
        */
williamr@2
   332
        void StoreProfileL(CSIPProfileCleanupItem* aItem);
williamr@2
   333
williamr@2
   334
        /**
williamr@2
   335
        * Store array of profiles into client cache
williamr@2
   336
        * @param aProfiles a array containing the profiles
williamr@2
   337
        * @param aRetProfiles returned array containing profiles
williamr@2
   338
        * @internalComponent
williamr@2
   339
        */
williamr@2
   340
        void StoreArrayL(
williamr@2
   341
            RPointerArray<CSIPConcreteProfile>& aProfiles,
williamr@2
   342
            RPointerArray<CSIPProfile>& aRetProfiles);
williamr@2
   343
williamr@2
   344
        /**
williamr@2
   345
        * Gets profile cache item
williamr@2
   346
        * @param aProfileId a profile id to be found
williamr@2
   347
        * @return local cache item of the profile
williamr@2
   348
        * @internalComponent
williamr@2
   349
        */        
williamr@2
   350
        CSIPProfileItem* ProfileItemL(TUint aProfileId);
williamr@2
   351
williamr@2
   352
        /**
williamr@2
   353
        * Gets profile cache item index
williamr@2
   354
        * @param aProfileId a profile id to be found
williamr@2
   355
        * @return local cache item index of the profile
williamr@2
   356
        * @internalComponent
williamr@2
   357
        */        
williamr@2
   358
        TInt ProfileIndex (TUint aProfileId);
williamr@2
   359
williamr@2
   360
        /**
williamr@2
   361
        * Gets profile cache item by index
williamr@2
   362
        * @param aIndex a index of the profile to be found
williamr@2
   363
        * @return local cache item of the profile
williamr@2
   364
        * @internalComponent
williamr@2
   365
        */        
williamr@2
   366
        CSIPProfileItem* ProfileItemByIndex(TUint aIndex);
williamr@2
   367
williamr@2
   368
        /**
williamr@2
   369
        * Gets SIP profile identified by the Id; leaves on failure
williamr@2
   370
        * The owneship of profile is transferred.
williamr@2
   371
        * @param aId a SIP profile Id
williamr@2
   372
        * @param aSize of profile if known
williamr@2
   373
        * @return SIP profile or 0 pointer if there's no such SIP profile
williamr@2
   374
        * @internalComponent
williamr@2
   375
        */
williamr@2
   376
        CSIPProfile* SIPProfileL(TUint32 aId, TInt aSize = 0);
williamr@2
   377
        
williamr@2
   378
    protected: // Data
williamr@2
   379
williamr@2
   380
        /**
williamr@2
   381
        * @internalComponent
williamr@2
   382
        */
williamr@2
   383
        RSIPProfile* iSipClient;
williamr@2
   384
        
williamr@2
   385
        /**
williamr@2
   386
        * @internalComponent
williamr@2
   387
        */        
williamr@2
   388
        CSIPProfileITCReceiver* iITCReceiver;
williamr@2
   389
        
williamr@2
   390
        /**
williamr@2
   391
        * @internalComponent
williamr@2
   392
        */        
williamr@2
   393
        CSIPProfileITC* iITC;
williamr@2
   394
        
williamr@2
   395
        /**
williamr@2
   396
        * @internalComponent
williamr@2
   397
        */        
williamr@2
   398
        MSIPProfileRegistryObserver& iObserver;
williamr@2
   399
        
williamr@2
   400
        /**
williamr@2
   401
        * @internalComponent
williamr@2
   402
        */        
williamr@2
   403
        RPointerArray<CSIPProfileItem> iProfiles;
williamr@2
   404
        
williamr@2
   405
        /**
williamr@2
   406
        * @internalComponent
williamr@2
   407
        */        
williamr@2
   408
        CSIPProfilePlugins* iProfilePlugins;
williamr@2
   409
        
williamr@2
   410
        /**
williamr@2
   411
        * @internalComponent
williamr@2
   412
        */        
williamr@2
   413
        CSIPProfileItem* iFindEntry;
williamr@2
   414
        
williamr@2
   415
    private:
williamr@2
   416
        
williamr@2
   417
        void ProfilesCommonL(RPointerArray<CSIPProfile>& aProfiles, 
williamr@2
   418
                             CSIPConcreteProfileHolder* aHolder);
williamr@2
   419
williamr@2
   420
    };
williamr@2
   421
williamr@2
   422
#endif // CSIPPROFILEREGISTRYBASE_H