instantmessagesalert/tsrc/testinstantmsgalert/src/stubs/s_cch.h
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     1 /*
       
     2 * s_cch.h :Copyright (c) 2009 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: s_cch.h
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MyCchServiceH
       
    19 #define MyCchServiceH
       
    20 
       
    21 //  EXTERNAL INCLUDES
       
    22 #include <CEUnitTestSuiteClass.h>
       
    23 #include <cch.h>
       
    24 
       
    25 _LIT(KTestUserName, "hi123");
       
    26 _LIT(KOwnUserNameMatch,"gizmo:Sharath"); // dont change this value 
       
    27 _LIT(KTestPassword, "password");
       
    28 _LIT(KTestDescription, "error");
       
    29     
       
    30 class MyCchService : public CCchService
       
    31 	{
       
    32     TInt Enable( TCCHSubserviceType aType );
       
    33     
       
    34     /**
       
    35      * Launches service disable. See MCchServiceObserver for status changes.
       
    36      *
       
    37      * @param aType Type of service
       
    38      * @return Symbian error
       
    39      */
       
    40     TInt Disable( TCCHSubserviceType aType );
       
    41     
       
    42     /**
       
    43      * Returns the current service state
       
    44      *
       
    45      * @param aType Type of service
       
    46      * @param aStatus Status of the service, return value
       
    47      * @return Symbian error code
       
    48      */
       
    49     TInt GetStatus( TCCHSubserviceType aType, 
       
    50     						TCchServiceStatus& aStatus ) const ;
       
    51     
       
    52     /**
       
    53      * Returns the connection parameters
       
    54      *
       
    55      * @param aType Type of service
       
    56      * @param aParameter Connection parameter of the service
       
    57      * @param aValue Value of the parameter
       
    58      * @return Symbian error code
       
    59      */
       
    60     TInt GetConnectionParameter( TCCHSubserviceType aType,
       
    61     					TCchConnectionParameter aParameter, TInt& aValue ) const;
       
    62     
       
    63     /**
       
    64      * Returns the connection parameters
       
    65      *
       
    66      * @param aType Type of service
       
    67      * @param aParameter Connection parameter of the service
       
    68      * @param aValue Value of the parameter
       
    69      * @return Symbian error code
       
    70      */
       
    71     TInt GetConnectionParameter( TCCHSubserviceType aType, 
       
    72     					TCchConnectionParameter aParameter, RBuf& aValue ) const;
       
    73     
       
    74     /**
       
    75      * Sets the connection parameters
       
    76      *
       
    77      * @param aType The type of service
       
    78      * @param aParameter Connection parameter of the service
       
    79      * @param aValue Value of the parameter
       
    80      * @return Symbian error code
       
    81      */
       
    82     TInt SetConnectionParameter( TCCHSubserviceType aType, 
       
    83     					TCchConnectionParameter aParameter, TInt aValue );
       
    84     
       
    85     /**
       
    86      * Sets the connection parameters
       
    87      *
       
    88      * @param aType The type of service
       
    89      * @param aParameter Connection parameter of the service
       
    90      * @param aValue Value of the parameter
       
    91      * @return Symbian error code
       
    92      */
       
    93     TInt SetConnectionParameter( TCCHSubserviceType aType, 
       
    94     					TCchConnectionParameter aParameter, const TDesC& aValue );
       
    95     
       
    96     /**
       
    97      * Reserves the service for exclusive usage
       
    98      *
       
    99      * @param aType Type of service
       
   100      * @return Symbian error code
       
   101      */
       
   102     TInt Reserve( TCCHSubserviceType aType );
       
   103     
       
   104     /**
       
   105      * Frees the service of exclusive usage
       
   106      *
       
   107      * @param aType Type of service
       
   108      * @return Symbian error code
       
   109      */
       
   110     TInt Free( TCCHSubserviceType aType );
       
   111     
       
   112     /**
       
   113      * Is the service reserved
       
   114      *
       
   115      * @param aType Type of service
       
   116      * @param aReserved True if the service is reserved
       
   117      * @return Symbian error code
       
   118      */
       
   119     TInt IsReserved( TCCHSubserviceType aType, TBool& aReserved ) const;
       
   120     
       
   121     /**
       
   122      * Returns the service id
       
   123      *
       
   124      * @return The id of the service
       
   125      */
       
   126     TInt ServiceId() const;
       
   127     
       
   128     /**
       
   129      * @deprecated Do not use this anymore, change to AddObserver!
       
   130      *
       
   131      * Adds observer for listening service events
       
   132      *
       
   133      * @param aObserver Event observing class
       
   134      */
       
   135     void SetObserver( MCchServiceStatusObserver& aObserver );
       
   136     
       
   137     /**
       
   138      * @deprecated Do not use this anymore, change to 
       
   139      * RemoveObserver method with paramater
       
   140      * 
       
   141      * Removes the observer of service events
       
   142      */
       
   143     void RemoveObserver( );
       
   144 
       
   145     /**
       
   146      * Adds observer for listening service events
       
   147      *
       
   148      * @param aObserver Event observing class
       
   149      * @return KErrAlreadyExist Observer already added
       
   150      *         KErrNone Observer was added
       
   151      */
       
   152     TInt AddObserver( MCchServiceStatusObserver& aObserver );
       
   153     
       
   154     /**
       
   155      * Removes the observer of service events
       
   156      *
       
   157      * @param aObserver Event observing class
       
   158      * @return KErrNotFound Observer was not found
       
   159      *         KErrNone Observer was removed
       
   160      */
       
   161     TInt RemoveObserver( MCchServiceStatusObserver& aObserver );
       
   162     
       
   163     /**
       
   164      * Checks if the type is supported
       
   165      *
       
   166      * @param aType Type of service
       
   167      * @param aSupported True if the service type is supported
       
   168      * @return Symbian error code
       
   169      */
       
   170     TInt IsSupported( TCCHSubserviceType aType, TBool& aSupported ) const;
       
   171     
       
   172     private:    
       
   173     	MCchServiceStatusObserver* iObserver;
       
   174     	
       
   175 	};    
       
   176 	
       
   177 	
       
   178 #endif //MyCchService
       
   179 
       
   180 
       
   181 	
       
   182