videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/inc/IptvTestUtilALR.h
branchRCL_3
changeset 47 826cea16efd9
parent 45 798ee5f1972c
child 48 13a33d82ad98
equal deleted inserted replaced
45:798ee5f1972c 47:826cea16efd9
     1 /*
       
     2 * Copyright (c) 2008 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 the License "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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef IptvTestUtilALR_H
       
    20 #define IptvTestUtilALR_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include "MTestUtilConnectionObserver.h"
       
    24 
       
    25 #include <cmmanagerext.h>
       
    26 #include <cmdestinationext.h>
       
    27 #include <cmconnectionmethodext.h>
       
    28 #include <cmconnectionmethoddef.h>
       
    29 #include <commdbconnpref.h>
       
    30 
       
    31 // FORWARD DECLARATIONS;
       
    32 class CIptvTestActiveWait;
       
    33 
       
    34 // CONSTANTS
       
    35 
       
    36 // Declared in CIptvUtil.h and vcxconnutilimpl.cpp
       
    37 const TUid VCXTEST_KIptvAlrCenRepUid = { 0x2000B438 };
       
    38 const TInt VCXTEST_KIptvCenRepUsedSnapIdKey   = 0x1;
       
    39 const TInt VCXTEST_KIptvCenRepDefaultIapIdKey   = 0x2;
       
    40 const TInt VCXTEST_KIptvCenRepAPModeAlwaysAsk = 0;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 /**
       
    45 * CIptvTestUtilALR  Controls the internet connection initiation and shutdown
       
    46 */
       
    47 class CIptvTestUtilALR : public CBase, public MTestUtilConnectionObserver
       
    48     {
       
    49 public:
       
    50 
       
    51     /*
       
    52      * NewL()
       
    53      */
       
    54     IMPORT_C static CIptvTestUtilALR* NewL();
       
    55 
       
    56     /*
       
    57      * NewL()
       
    58      */
       
    59     IMPORT_C static CIptvTestUtilALR* NewLC();
       
    60 
       
    61     /*
       
    62      * ~CIptvTestUtilALR()
       
    63      */
       
    64     IMPORT_C virtual ~CIptvTestUtilALR();
       
    65 
       
    66 public: // Functions from base classes
       
    67 
       
    68     void ConnectionCreated();
       
    69     void ConnectionClosed();
       
    70     void ConnectionFailed();
       
    71     void ConnectionAlreadyExists();
       
    72     void ConnectionTimeout();
       
    73 
       
    74 public: // New functions
       
    75 
       
    76     /**
       
    77     * Delete the used destination cenrep value.
       
    78     */
       
    79     IMPORT_C void RemoveUsedDestinationCenRepL();
       
    80 
       
    81     /**
       
    82     * Set the used destination cenrep value for Video Center & IPTV_Engine.
       
    83     */
       
    84     IMPORT_C void SetUsedDestinationL( TDesC& aDestinationName );
       
    85 
       
    86     /**
       
    87     * Create new destination (SNAP)
       
    88     */
       
    89     IMPORT_C void CreateDestinationL( TDesC& aDestinationName );
       
    90 
       
    91     /**
       
    92     * Delete a destination (SNAP)
       
    93     */
       
    94     IMPORT_C void DeleteDestinationL( TDesC& aDestinationName );
       
    95 
       
    96     /**
       
    97     * Copy existing connection method to defined SNAP.
       
    98     */
       
    99     IMPORT_C void CopyMethodL( TDesC& aMethodName, TDesC& aNewMethodName, TDesC& aNewDestinationName );
       
   100 
       
   101     /**
       
   102     * Delete a connection method.
       
   103     */
       
   104     IMPORT_C void DeleteMethodL( TDesC& aDestinationName, TDesC& aMethodName );
       
   105 
       
   106     /**
       
   107     * Set priority for a connection method.
       
   108     */
       
   109     IMPORT_C void SetMethodPriorityL( TDesC& aDestinationName, TDesC& aMethodName, TUint32 aPriority );
       
   110 
       
   111     /**
       
   112      * Sets specified string attribute for a method.
       
   113      */
       
   114     IMPORT_C void SetMethodStringAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TDesC& aAttributeValue );
       
   115 
       
   116     /**
       
   117      * Sets specified integer attribute for a method.
       
   118      */
       
   119     IMPORT_C void SetMethodIntAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TInt aAttributeValue );
       
   120 
       
   121     /**
       
   122      * Sets specified boolean attribute for a method.
       
   123      */
       
   124     IMPORT_C void SetMethodBoolAttributeL( TDesC& aDestinationName, TDesC& aMethodName, TInt aAttribute, TBool aAttributeValue );
       
   125 
       
   126     /**
       
   127     * Returns id of given destination.
       
   128     */
       
   129     IMPORT_C TInt GetDestinationIdL( TDesC& aDestinationName );
       
   130 
       
   131     /**
       
   132     * Terminates active connections for the destination's IAPs.
       
   133     */
       
   134     IMPORT_C void TerminateDestinationConnectionsL( TDesC& aDestinationName );
       
   135     
       
   136     /**
       
   137      * Gets the default access point from connection manager
       
   138      */
       
   139     IMPORT_C TUint32 GetDefaultIap( void );
       
   140     
       
   141     /**
       
   142      * Gets the default iap, saves it to cenrep
       
   143      */
       
   144     IMPORT_C TInt SetDefaultIapCenRep( void );
       
   145     
       
   146     /**
       
   147      * Gets the default iap id from cenrep
       
   148      */
       
   149     IMPORT_C TUint32 GetDefaultIapCenRep( void );
       
   150 
       
   151     
       
   152 private: // New functions
       
   153 
       
   154     /**
       
   155      * Prints destination's IAPs and their priorities to debug output.
       
   156      */
       
   157     void PrintDestinationL( RCmDestinationExt& aDestination );
       
   158 
       
   159     /**
       
   160      * Compares two connection method names. 
       
   161      * @param aSearchedName name for the method to search for. 
       
   162      * @param aCurrentName name to compare against.
       
   163      * @param aStrict If false then and aSearchedName is "Internet" there's few alternatives for 
       
   164      *        aCurrentName which will match too.
       
   165      * @return ETrue if match, otherwise EFalse.
       
   166      */
       
   167     TBool MethodMatchesL( const TDesC& aSearchedName, const TDesC& aCurrentName, TBool aStrict );
       
   168 
       
   169 private:
       
   170 
       
   171     /*
       
   172      * CIptvTestUtilALR()
       
   173      */
       
   174     CIptvTestUtilALR();
       
   175 
       
   176     /*
       
   177      * ConstructL()
       
   178      */
       
   179     void ConstructL();
       
   180 
       
   181 private: // Data
       
   182 
       
   183     RCmManagerExt iCmManager;
       
   184 
       
   185     // CIptvTestActiveWait
       
   186     CIptvTestActiveWait* iActiveWait;
       
   187 
       
   188     };
       
   189 
       
   190 
       
   191 #endif // IAPCONNECT_V20ENGINE_H