mmsharing/mmshavailability/inc/musavacontactavailability.h
changeset 22 496ad160a278
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     1 /*
       
     2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Provide interface for the client requestin network availability.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __MUSAVACONTACTAVAILABILITY_H__
       
    20 #define __MUSAVACONTACTAVAILABILITY_H__
       
    21 
       
    22 #include "musavaavailability.h"
       
    23 #include "musunittesting.h"
       
    24 #include "mussettingskeys.h"
       
    25 
       
    26 #include <badesca.h>
       
    27 
       
    28 class MMusAvaAvailabilityObserver;
       
    29 class MMusAvaObserver;
       
    30 class CMusAvaSharedObject;
       
    31 class CContactIdArray;
       
    32 class CContactItem;
       
    33 class CMusAvaSettingsImp;
       
    34 
       
    35 
       
    36 /**
       
    37  *  Implemets register vailability.
       
    38  *
       
    39  *  Provide interface for the client to availability class.
       
    40  *
       
    41  *  @lib musavailabilityplugin.lib
       
    42  */
       
    43 class CMusAvaContactAvailability : public CMusAvaAvailability
       
    44 	{
       
    45 
       
    46 public:
       
    47 
       
    48 	/**
       
    49      * Two-phased constructor.
       
    50      *
       
    51      * @param aObserver Pointer to observer interface.
       
    52      * @param aSettings Reference to settings object.
       
    53      * @return Returns pointer to CMusAvaInterface object.
       
    54      */
       
    55 	static CMusAvaContactAvailability* NewL(
       
    56 	                                MMusAvaAvailabilityObserver& aObserver,
       
    57                                     CMusAvaSettingsImp& aConcreteSettings );
       
    58 
       
    59 	/**
       
    60      * Two-phased constructor.
       
    61      *
       
    62      * @param aObserver Pointer to observer interface.
       
    63      * @param aSettings Reference to settings object.
       
    64      * @return Returns pointer to CMusAvaInterface object.
       
    65      */
       
    66 	static CMusAvaContactAvailability* NewLC(
       
    67 	                                MMusAvaAvailabilityObserver& aObserver,
       
    68                                     CMusAvaSettingsImp& aConcreteSettings );
       
    69 
       
    70 	/**
       
    71      * Destructor
       
    72      */
       
    73 	~CMusAvaContactAvailability();
       
    74 
       
    75 
       
    76 protected:
       
    77 
       
    78 	CMusAvaContactAvailability( MMusAvaAvailabilityObserver& aObserver,
       
    79                                 CMusAvaSettingsImp& aConcreteSettings );
       
    80 
       
    81 	void ConstructL();
       
    82 
       
    83 
       
    84 public: // from base class CMusAvaAvailability
       
    85 
       
    86     /**
       
    87      * Executes for the availability.
       
    88      */
       
    89     virtual void DoExecuteL();
       
    90 
       
    91     /**
       
    92      * From CMusAvaAvailability.
       
    93      * Returns availability name.
       
    94      *
       
    95      * @return Name of *this* availability.
       
    96      */
       
    97     virtual MMusAvaObserver::TAvailabilityName Name();
       
    98 
       
    99 private:
       
   100 
       
   101      /**
       
   102      *
       
   103      */
       
   104     TBool ActiveCallL( CDesCArrayFlat*& aContactsArray );
       
   105 
       
   106 
       
   107      /**
       
   108      *
       
   109      */
       
   110     TBool ResolveAddressesL( const TDesC& aContactId,
       
   111                              CDesCArrayFlat*& aContactsArray );
       
   112 
       
   113     
       
   114 private:
       
   115 
       
   116      /**
       
   117      * resolved contact name
       
   118      */
       
   119      HBufC* iContactName;
       
   120 
       
   121 	 /**
       
   122      * Pointer to CMusAvaSharedObject object
       
   123      */
       
   124 	 CMusAvaSharedObject* iSharedObj;
       
   125 
       
   126 	 CMusAvaSettingsImp& iSettings;
       
   127 	 
       
   128 	 /**
       
   129 	  * Flag indicating if the contact name should begin 
       
   130 	  * with first name or last name
       
   131 	  */
       
   132 	 TBool iBeginWithFirstName;
       
   133 	 
       
   134 	 MusSettingsKeys::TOperatorVariant iOperatorVariant;
       
   135 
       
   136 	 MUS_UNITTEST( UT_CMusAvaContactAvailability )
       
   137     };
       
   138 
       
   139 
       
   140 #endif // __MUSAVACONTACTAVAILABILITY_H__