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