convergedconnectionhandler/cchserver/inc/cchpluginhandler.h
changeset 0 a4daefaec16c
equal deleted inserted replaced
-1:000000000000 0:a4daefaec16c
       
     1 /*
       
     2 * Copyright (c) 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:  CCCHPluginHandler declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_CCHPLUGINHANDLER_H
       
    20 #define C_CCHPLUGINHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32std.h>
       
    24 #include <e32base.h>
       
    25 #include <ecom/implementationinformation.h>
       
    26 
       
    27 #include "cchclientserver.h"
       
    28 
       
    29 // CONSTANTS
       
    30 // None
       
    31 
       
    32 // MACROS
       
    33 // None
       
    34 
       
    35 // DATA TYPES
       
    36 // None
       
    37 
       
    38 // FUNCTION PROTOTYPES
       
    39 // None
       
    40 
       
    41 // FORWARD DECLARATIONS
       
    42 class CCCHServerBase;
       
    43 class CCCHPlugin; 
       
    44 class REComSession;
       
    45 class MCCHServiceNotifier;
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 /**
       
    50  *  CCCHPluginHandler declaration
       
    51  *  Class handles plug-in's for CCH server
       
    52  *  @lib cchserver.exe
       
    53  *  @since S60 3.2
       
    54  */
       
    55 NONSHARABLE_CLASS( CCCHPluginHandler ) : public CBase
       
    56     {
       
    57 
       
    58 public: // Constructors and destructor
       
    59 
       
    60     /**
       
    61     * Two-phased constructor.
       
    62     */
       
    63     static CCCHPluginHandler* NewL( CCCHServerBase& aServer );
       
    64 
       
    65     /**
       
    66      * Destructor.
       
    67      */
       
    68     virtual ~CCCHPluginHandler();
       
    69     
       
    70 public: // New functions
       
    71     
       
    72     /**
       
    73      * Load all available plug-ins
       
    74      * @since S60 3.2
       
    75      */
       
    76     void LoadPluginsL();
       
    77 
       
    78     /**
       
    79      * Load a certain Plug-in
       
    80      * @since S60 3.2
       
    81      * @param aUid Plug-ins Uid
       
    82      */
       
    83     void LoadPluginsL( const TUid& aUid );
       
    84     
       
    85     /**
       
    86      * Unloads a certain Plug-in
       
    87      * @since S60 3.2
       
    88      * @param aUid Plug-ins Uid
       
    89      */
       
    90     void UnloadPlugin( const TUid& aUid );
       
    91 
       
    92     /**
       
    93      * Enable a certain Service
       
    94      * @since S60 3.2
       
    95      * @param aServiceId Service to enable
       
    96      * @param aUids Uids-array contains Connectivity Plug-ins Uids
       
    97      * @param aType Subservice's type to enable
       
    98      * @param aObserver Pointer to observer.
       
    99      * @param aIapId Used IAP Id
       
   100      * @param aConnectivityCheck Is value is True Connectivity Plug-in will
       
   101      * make test call to check is the connection truly working.
       
   102      */
       
   103     void EnableServiceL( const TUint32 aServiceId,
       
   104                          const RArray<TUid>& aUids,
       
   105                          const TCCHSubserviceType aType,
       
   106                          MCCHServiceNotifier* aNotifier,
       
   107                          const TUint32 aIapId = 0,
       
   108                          const TBool aConnectivityCheck = EFalse );
       
   109 
       
   110     /**
       
   111      * Disable a certain Service
       
   112      * @since S60 3.2
       
   113      * @param aServiceId Service to disable
       
   114      * @param aUids Uids-array contains Connectivity Plug-ins Uids
       
   115      * @param aType Subservice's type to disable
       
   116      */
       
   117     void DisableServiceL( const TUint32 aServiceId,
       
   118                           const RArray<TUid>& aUids,
       
   119                           const TCCHSubserviceType aType ) const;
       
   120 
       
   121     /**
       
   122      * Get a certain Service's state
       
   123      * @since S60 3.2
       
   124      * @param aServiceId Used Service Id
       
   125      * @param aUid Service's Uid 
       
   126      * @param aType Subservice's type
       
   127      * @param aState On completion contains Service's state
       
   128      * @param aError Returns the current error
       
   129      */
       
   130     void GetServiceState( const TUint32 aServiceId,
       
   131                           const TUid aUid,
       
   132                           const TCCHSubserviceType aType,
       
   133                           TCCHSubserviceState& aState,
       
   134                           TInt& aError );
       
   135 
       
   136     /**
       
   137      * Get a certain Service's network(SNAP/IAP) information
       
   138      * @since S60 3.2
       
   139      * @param aServiceId Used Service Id
       
   140      * @param aUid Service's Uid 
       
   141      * @param aType Subservice's type
       
   142      * @param aSnapId On completion contains Service's SNAP Id
       
   143      * @param aIapId On completion contains Service's IAP Id
       
   144      * @param aSNAPLocked On completion contains ETrue if Service's SNAP Id cannot be edited
       
   145      * @return General symbian error code.
       
   146      */
       
   147     TInt GetServiceNetworkInfo( const TUint32 aServiceId,
       
   148                                 const TUid aUid,
       
   149                                 const TCCHSubserviceType aType,
       
   150                                 TUint32& aSnapId,
       
   151                                 TUint32& aIapId,
       
   152                                 TBool& aSNAPLocked,
       
   153                                 TBool& aPasswordSet);
       
   154 
       
   155     /**
       
   156      * Set Service to use given SNAP Id
       
   157      * @since S60 3.2
       
   158      * @param aServiceId Used Service Id
       
   159      * @param aUids Uids-array contains Connectivity Plug-ins Uids
       
   160      * @param aType Subservice's type
       
   161      * @param aSnapId Set Service to use this SNAP Id
       
   162      */
       
   163     void SetSnapIdL( const TUint32 aServiceId,
       
   164                      const RArray<TUid>& aUids,
       
   165                      const TCCHSubserviceType aType,
       
   166                      const TUint32 aSnapId );
       
   167 
       
   168     /**
       
   169      * Set Service to use given IAP Id
       
   170      * @since S60 3.2
       
   171      * @param aServiceId Used Service Id
       
   172      * @param aUids Uids-array contains Connectivity Plug-ins Uids
       
   173      * @param aType Subservice's type
       
   174      * @param aIapId Set Service to use this IAP Id
       
   175      * @leave Symbian error code
       
   176      */
       
   177     void SetIapIdL( const TUint32 aServiceId,
       
   178                     const RArray<TUid>& aUids,
       
   179                     const TCCHSubserviceType aType,
       
   180                     const TUint32 aIapId );
       
   181 
       
   182     /**
       
   183      * Set Service to use given username
       
   184      * @since S60 3.2
       
   185      * @param aServiceId Used Service Id
       
   186      * @param aUids Uids-array contains Connectivity Plug-ins Uids
       
   187      * @param aType Subservice's type
       
   188      * @param aUsername Set Service to use this username
       
   189      * @return In case of an error leaves. 
       
   190      *         KErrNotFound or symbian error code.
       
   191      *         KErrArgument if passed argument(s) is/are incorrect
       
   192      */
       
   193     void SetUsernameL( const TUint32 aServiceId,
       
   194                        const RArray<TUid>& aUids,
       
   195                        const TCCHSubserviceType aType,
       
   196                        const TDesC& aUsername );
       
   197 
       
   198     /**
       
   199      * Returns the connection parameters
       
   200      * @since S60 3.2.3
       
   201      * Uid Plug-in uid.
       
   202      * @param aServiceSelection Selected service, ID and type
       
   203      * @param aValue Value of the parameter
       
   204      * @return Symbian error code
       
   205      */
       
   206     TInt GetConnectionParameter( const TUid aUid,
       
   207                                  const TServiceSelection& aServiceSelection, 
       
   208                                  RBuf& aValue );
       
   209 
       
   210     
       
   211     /**
       
   212      * Set Service to use given password
       
   213      * @since S60 3.2
       
   214      * @param aServiceId Used Service Id
       
   215      * @param aUids Uids-array contains Connectivity Plug-ins Uids
       
   216      * @param aType Subservice's type
       
   217      * @param aUsername Set Service to use this password
       
   218      * @return In case of an error leaves. 
       
   219      *         KErrNotFound or symbian error code.
       
   220      *         KErrArgument if passed argument(s) is/are incorrect
       
   221      */
       
   222     void SetPasswordL( const TUint32 aServiceId,
       
   223                        const RArray<TUid>& aUids,
       
   224                        const TCCHSubserviceType aType,
       
   225                        const TDesC& aPassword );
       
   226     
       
   227     /**
       
   228      * Get Service's protocol information
       
   229      * @since S60 3.2
       
   230      * @param aServiceId Used Service Id
       
   231      * @param aUid Service's Uid 
       
   232      * @param aType Subservice's type
       
   233      * @param aBuffer On completion contains Service's information
       
   234      * @return General symbian error code.
       
   235      */
       
   236     TInt GetServiceInfo( const TUint32 aServiceId,
       
   237                          const TUid aUid,
       
   238                          const TCCHSubserviceType aType,
       
   239                          TDes& aBuffer );
       
   240 
       
   241     /**
       
   242      * Reserve service for exclusive use
       
   243      * @since S60 3.2
       
   244      * @param aServiceId Used Service Id
       
   245      * @param aUid Service's Uid 
       
   246      * @param aType Subservice's type
       
   247      * @return General symbian error code.
       
   248      */
       
   249     TInt ReserveService( const TUint32 aServiceId,
       
   250                          const TUid aUid,
       
   251                          const TCCHSubserviceType aType );
       
   252 
       
   253     
       
   254     /**
       
   255      * Free exlusive service reservation
       
   256      * @since S60 3.2
       
   257      * @param aServiceId Used Service Id
       
   258      * @param aUid Service's Uid 
       
   259      * @param aType Subservice's type
       
   260      * @return General symbian error code.
       
   261      */
       
   262     TInt FreeService( const TUint32 aServiceId,
       
   263                          const TUid aUid,
       
   264                          const TCCHSubserviceType aType );
       
   265     
       
   266     /**
       
   267      * Returns the service's reservation status
       
   268      * @since S60 3.2
       
   269      * @param aServiceId Used Service Id
       
   270      * @param aUid Service's Uid 
       
   271      * @param aType Subservice's type
       
   272      * @return Reservation status.
       
   273      */
       
   274     TBool IsReserved( const TUint32 aServiceId,
       
   275                          const TUid aUid,
       
   276                          const TCCHSubserviceType aType ) const;
       
   277                          
       
   278     /**
       
   279      * Is Service available via these IAPs
       
   280      * @since S60 3.2
       
   281      * @param aServiceId Used Service Id
       
   282      * @param aUid Service's Uid 
       
   283      * @param aType Subservice's type
       
   284      * @param aIapIdArray Id array of the currently available IAPs.
       
   285      * @return ETrue if service is available.
       
   286      */
       
   287     TBool IsAvailableL( const TUint aServiceId,
       
   288                         const TUid aUid,
       
   289                         const TCCHSubserviceType aType,
       
   290                         RArray<TUint32>& aIapIds ) const;
       
   291                                                  
       
   292     /**
       
   293      * Adds a observer for Plug-in events.
       
   294      * @since S60 3.2
       
   295      * @param aObserver Pointer to observer.
       
   296      */
       
   297     void SetServiceNotifier( MCCHServiceNotifier* aObserver );
       
   298 
       
   299     /**
       
   300      * Removes a observer for Plug-in events.
       
   301      * @since S60 3.2
       
   302      * @param aObserver Pointer to observer.
       
   303      */
       
   304     void RemoveServiceNotifier( MCCHServiceNotifier* aObserver );
       
   305         
       
   306 private:
       
   307 
       
   308     /**
       
   309      * Find Plug-in's index number
       
   310      * @since S60 3.2
       
   311      * @param aUid Plug-in's Uid
       
   312      * @param TInt Plug-in's index number or KErrNotFound
       
   313      */
       
   314     TInt Find( const TUid& aUid ) const;
       
   315     
       
   316     /**
       
   317      * Cleanup RImplInfoPtrArray
       
   318      * @since S60 3.2
       
   319      * @param aArray Which to be destroyed
       
   320      */
       
   321     static void ResetAndDestroy( TAny* aArray );
       
   322 
       
   323 private:
       
   324 
       
   325     /**
       
   326      * C++ default constructor.
       
   327      */
       
   328     CCCHPluginHandler( CCCHServerBase& aServer );
       
   329     
       
   330 private: // data
       
   331 
       
   332     /**
       
   333      * Server handle
       
   334      */
       
   335     CCCHServerBase&                 iServer;
       
   336     
       
   337     /**
       
   338      * Array of loaded Plug-ins
       
   339      */
       
   340     RPointerArray<CCCHPlugin>       iPlugins;
       
   341 
       
   342     };
       
   343 
       
   344 #endif // C_CCHPLUGINHANDLER_H
       
   345 
       
   346 // End of file