| 
sl@0
 | 
     1  | 
/*
  | 
| 
sl@0
 | 
     2  | 
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
  | 
| 
sl@0
 | 
     3  | 
* All rights reserved.
  | 
| 
sl@0
 | 
     4  | 
* This component and the accompanying materials are made available
  | 
| 
sl@0
 | 
     5  | 
* under the terms of "Eclipse Public License v1.0"
  | 
| 
sl@0
 | 
     6  | 
* which accompanies this distribution, and is available
  | 
| 
sl@0
 | 
     7  | 
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
  | 
| 
sl@0
 | 
     8  | 
*
  | 
| 
sl@0
 | 
     9  | 
* Initial Contributors:
  | 
| 
sl@0
 | 
    10  | 
* Nokia Corporation - initial contribution.
  | 
| 
sl@0
 | 
    11  | 
*
  | 
| 
sl@0
 | 
    12  | 
* Contributors:
  | 
| 
sl@0
 | 
    13  | 
*
  | 
| 
sl@0
 | 
    14  | 
* Description:
  | 
| 
sl@0
 | 
    15  | 
*
  | 
| 
sl@0
 | 
    16  | 
*/
  | 
| 
sl@0
 | 
    17  | 
  | 
| 
sl@0
 | 
    18  | 
  | 
| 
sl@0
 | 
    19  | 
  | 
| 
sl@0
 | 
    20  | 
#ifndef FEATMGRCLIENT_H
  | 
| 
sl@0
 | 
    21  | 
#define FEATMGRCLIENT_H
  | 
| 
sl@0
 | 
    22  | 
  | 
| 
sl@0
 | 
    23  | 
// INCLUDES
  | 
| 
sl@0
 | 
    24  | 
#include <e32std.h>
  | 
| 
sl@0
 | 
    25  | 
#include <babitflags.h>
  | 
| 
sl@0
 | 
    26  | 
#include <featmgr/featurecmn.h>
  | 
| 
sl@0
 | 
    27  | 
#include "featmgrclientserver.h"
  | 
| 
sl@0
 | 
    28  | 
#include "featureclient.h"
  | 
| 
sl@0
 | 
    29  | 
  | 
| 
sl@0
 | 
    30  | 
// CLASS DECLARATION
  | 
| 
sl@0
 | 
    31  | 
  | 
| 
sl@0
 | 
    32  | 
/**
  | 
| 
sl@0
 | 
    33  | 
  Base class of the client-side handle to a session with the Feature Manager Server.
  | 
| 
sl@0
 | 
    34  | 
  | 
| 
sl@0
 | 
    35  | 
*/
  | 
| 
sl@0
 | 
    36  | 
NONSHARABLE_CLASS(RFeatMgrClient) : public RSessionBase, public MFeatureClient
  | 
| 
sl@0
 | 
    37  | 
    {
 | 
| 
sl@0
 | 
    38  | 
    public:  // Constructors and destructor
  | 
| 
sl@0
 | 
    39  | 
        
  | 
| 
sl@0
 | 
    40  | 
        /**
  | 
| 
sl@0
 | 
    41  | 
         C++ default constructor.
  | 
| 
sl@0
 | 
    42  | 
         */
  | 
| 
sl@0
 | 
    43  | 
        RFeatMgrClient();
  | 
| 
sl@0
 | 
    44  | 
  | 
| 
sl@0
 | 
    45  | 
    public: // New functions
  | 
| 
sl@0
 | 
    46  | 
  | 
| 
sl@0
 | 
    47  | 
        /**
  | 
| 
sl@0
 | 
    48  | 
         Connects to server
  | 
| 
sl@0
 | 
    49  | 
        
  | 
| 
sl@0
 | 
    50  | 
         @return KErrNone if connect succesfully, otherwise system wide error
  | 
| 
sl@0
 | 
    51  | 
        */
  | 
| 
sl@0
 | 
    52  | 
        TInt Connect();
  | 
| 
sl@0
 | 
    53  | 
        
  | 
| 
sl@0
 | 
    54  | 
		/**
  | 
| 
sl@0
 | 
    55  | 
         From MFeatureClient
  | 
| 
sl@0
 | 
    56  | 
        */
  | 
| 
sl@0
 | 
    57  | 
        TInt FeatureSupported( TFeatureEntry& aFeature ) const;
  | 
| 
sl@0
 | 
    58  | 
  | 
| 
sl@0
 | 
    59  | 
        TInt FeaturesSupported( RFeatureArray& aFeatures );
  | 
| 
sl@0
 | 
    60  | 
  | 
| 
sl@0
 | 
    61  | 
        TInt EnableFeature( TUid aFeature ) const;
  | 
| 
sl@0
 | 
    62  | 
  | 
| 
sl@0
 | 
    63  | 
        TInt DisableFeature( TUid aFeature ) const;
  | 
| 
sl@0
 | 
    64  | 
  | 
| 
sl@0
 | 
    65  | 
        TInt SetFeature( TUid aFeature, TBool aEnabled, TInt aData ) const;
  | 
| 
sl@0
 | 
    66  | 
  | 
| 
sl@0
 | 
    67  | 
        TInt SetFeature( TUid aFeature, TInt aData ) const;
  | 
| 
sl@0
 | 
    68  | 
  | 
| 
sl@0
 | 
    69  | 
        TInt AddFeature( TFeatureEntry aEntry ) const;
  | 
| 
sl@0
 | 
    70  | 
  | 
| 
sl@0
 | 
    71  | 
        TInt DeleteFeature( TUid aFeature ) const;
  | 
| 
sl@0
 | 
    72  | 
  | 
| 
sl@0
 | 
    73  | 
        void ListSupportedFeaturesL( RFeatureUidArray& aSupportedFeatures );
  | 
| 
sl@0
 | 
    74  | 
  | 
| 
sl@0
 | 
    75  | 
        TInt RequestNotification( RFeatureUidArray& aFeatures, TUid& aFeatUid, 
  | 
| 
sl@0
 | 
    76  | 
            TRequestStatus& aStatus );
  | 
| 
sl@0
 | 
    77  | 
  | 
| 
sl@0
 | 
    78  | 
        void ReRequestNotification( TUid& aFeatUid, TRequestStatus& aStatus );
  | 
| 
sl@0
 | 
    79  | 
        
  | 
| 
sl@0
 | 
    80  | 
        TInt RequestNotifyCancel( TUid aFeature ) const;
  | 
| 
sl@0
 | 
    81  | 
  | 
| 
sl@0
 | 
    82  | 
        TInt RequestNotifyCancelAll( ) const;
  | 
| 
sl@0
 | 
    83  | 
  | 
| 
sl@0
 | 
    84  | 
        TInt SWIStart() const;
  | 
| 
sl@0
 | 
    85  | 
        
  | 
| 
sl@0
 | 
    86  | 
        TInt SWIEnd() const; 
  | 
| 
sl@0
 | 
    87  | 
                
  | 
| 
sl@0
 | 
    88  | 
    private:
  | 
| 
sl@0
 | 
    89  | 
  | 
| 
sl@0
 | 
    90  | 
        /**
  | 
| 
sl@0
 | 
    91  | 
         Return version of server
  | 
| 
sl@0
 | 
    92  | 
         @param
  | 
| 
sl@0
 | 
    93  | 
         @return version of server
  | 
| 
sl@0
 | 
    94  | 
        */
  | 
| 
sl@0
 | 
    95  | 
         TVersion ServerVersion() const;
  | 
| 
sl@0
 | 
    96  | 
         
  | 
| 
sl@0
 | 
    97  | 
        /**
  | 
| 
sl@0
 | 
    98  | 
         Starts server
  | 
| 
sl@0
 | 
    99  | 
         @return KErrNone if started succesfully, otherwise system wide error
  | 
| 
sl@0
 | 
   100  | 
        */
  | 
| 
sl@0
 | 
   101  | 
        TInt StartServer();
  | 
| 
sl@0
 | 
   102  | 
        
  | 
| 
sl@0
 | 
   103  | 
        void SendUidArrayL(RFeatureUidArray& aFeatures, TInt &retval);
  | 
| 
sl@0
 | 
   104  | 
  | 
| 
sl@0
 | 
   105  | 
        void SendRcvFeatureArrayL(RFeatureArray& aFeatures, TInt &retval);
  | 
| 
sl@0
 | 
   106  | 
  | 
| 
sl@0
 | 
   107  | 
    private:
  | 
| 
sl@0
 | 
   108  | 
  | 
| 
sl@0
 | 
   109  | 
        TPtr8 iFeaturePckg;
  | 
| 
sl@0
 | 
   110  | 
  | 
| 
sl@0
 | 
   111  | 
  | 
| 
sl@0
 | 
   112  | 
		#ifdef EXTENDED_FEATURE_MANAGER_TEST
  | 
| 
sl@0
 | 
   113  | 
        // Public DEBUG API functions
  | 
| 
sl@0
 | 
   114  | 
    public:
  | 
| 
sl@0
 | 
   115  | 
        void ResourceMark();
  | 
| 
sl@0
 | 
   116  | 
        void ResourceCheck();
  | 
| 
sl@0
 | 
   117  | 
        TInt ResourceCount();
  | 
| 
sl@0
 | 
   118  | 
        void SetHeapFailure(TInt aAllocFailType, TInt aRate);
  | 
| 
sl@0
 | 
   119  | 
		TInt NumberOfNotifyFeatures( void ) const;
  | 
| 
sl@0
 | 
   120  | 
		TInt CountAllocCells( void ) const;
  | 
| 
sl@0
 | 
   121  | 
		#endif    
  | 
| 
sl@0
 | 
   122  | 
    
  | 
| 
sl@0
 | 
   123  | 
    };
  | 
| 
sl@0
 | 
   124  | 
  | 
| 
sl@0
 | 
   125  | 
#endif      // FEATMGRCLIENT_H   
  | 
| 
sl@0
 | 
   126  | 
            
  | 
| 
sl@0
 | 
   127  | 
// End of File
  |