omadrm/drmengine/notifier/inc/DRMNotifierClient.h
changeset 23 493788a4a8a4
parent 0 95b198f216e5
equal deleted inserted replaced
5:79d62d1d7957 23:493788a4a8a4
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:  This class handles communications between a notifier client & 
    14 * Description:  This class handles communications between a notifier client &
    15 *                DRM server in DRM notifier.
    15 *                DRM server in DRM notifier.
    16 *
    16 *
    17 */
    17 */
    18 
    18 
    19 
    19 
    20 
    20 
    21 #ifndef RDRMNOTIFIERCLIENT_H
    21 #ifndef RDRMNOTIFIERCLIENT_H
    22 #define RDRMNOTIFIERCLIENT_H
    22 #define RDRMNOTIFIERCLIENT_H
    23 
    23 
    24 //  INCLUDES
    24 //  INCLUDES
    25 #include <E32STD.H>
    25 #include <e32std.h>
    26 #include <DRMEvent.h>
    26 #include <DRMEvent.h>
    27 
    27 
    28 // CONSTANTS
    28 // CONSTANTS
    29 const TInt KMaxMessageSlots = 2;
    29 const TInt KMaxMessageSlots = 2;
    30 
    30 
    34 // FORWARD DECLARATIONS
    34 // FORWARD DECLARATIONS
    35 // CLASS DECLARATION
    35 // CLASS DECLARATION
    36 
    36 
    37 /**
    37 /**
    38 *  This class handles all client/server communications.
    38 *  This class handles all client/server communications.
    39 *  
    39 *
    40 *  @lib DRMCommon.dll
    40 *  @lib DRMCommon.dll
    41 *  @since S60Rel2.6
    41 *  @since S60Rel2.6
    42 */
    42 */
    43 class RDRMNotifierClient : public RSessionBase
    43 class RDRMNotifierClient : public RSessionBase
    44     {
    44     {
    45     public:  // Constructors and destructor
    45     public:  // Constructors and destructor
    46        /**
    46        /**
    47         * C++ default constructor.
    47         * C++ default constructor.
    48         */
    48         */
    49        RDRMNotifierClient(TDRMEventType* aEventType, TDRMEventType* aEventTypeWait, 
    49        RDRMNotifierClient(TDRMEventType* aEventType, TDRMEventType* aEventTypeWait,
    50                           TPtr8* aPtr, TPtr8* aWaitPtr);
    50                           TPtr8* aPtr, TPtr8* aWaitPtr);
    51        
    51 
    52        /**
    52        /**
    53         * Destructor.
    53         * Destructor.
    54         */
    54         */
    55        virtual ~RDRMNotifierClient();
    55        virtual ~RDRMNotifierClient();
    56        
    56 
    57     public: // New functions
    57     public: // New functions
    58         
    58 
    59        /**
    59        /**
    60        * This method opens a connection to the server.
    60        * This method opens a connection to the server.
    61        * @since S60Rel2.6
    61        * @since S60Rel2.6
    62        * Return Symbian OS / DRM Engine specific error code.
    62        * Return Symbian OS / DRM Engine specific error code.
    63        */
    63        */
    70        * has been received.
    70        * has been received.
    71        *
    71        *
    72        * @since S60Rel2.6
    72        * @since S60Rel2.6
    73        * @param aStatus  the status will be updated when the a notification
    73        * @param aStatus  the status will be updated when the a notification
    74        *                 has been received
    74        *                 has been received
    75        * @return none 
    75        * @return none
    76        */
    76        */
    77        void WaitForCompletion( TRequestStatus& aStatus );
    77        void WaitForCompletion( TRequestStatus& aStatus );
    78 
    78 
    79 
    79 
    80        /**
    80        /**
    84        * when all the notifications have been forwarded
    84        * when all the notifications have been forwarded
    85        *
    85        *
    86        * @since S60Rel2.6
    86        * @since S60Rel2.6
    87        * @param aStatus  the status will be updated when all notifications have
    87        * @param aStatus  the status will be updated when all notifications have
    88        *                 been forwarded
    88        *                 been forwarded
    89        * @return none 
    89        * @return none
    90        */
    90        */
    91        void SendEvent( TRequestStatus& aStatus );
    91        void SendEvent( TRequestStatus& aStatus );
    92 
    92 
    93        /**
    93        /**
    94        * RegisterForType
    94        * RegisterForType
    98        * URI will get notified
    98        * URI will get notified
    99        *
    99        *
   100        * @since S60Rel2.6
   100        * @since S60Rel2.6
   101        * @param aEventType  the event type to listen to
   101        * @param aEventType  the event type to listen to
   102        * @param aURI  optional URI to limit the C/S communication
   102        * @param aURI  optional URI to limit the C/S communication
   103        * @return none 
   103        * @return none
   104        */
   104        */
   105        void RegisterForType( TDRMEventType aEventType, HBufC8* aURI = 0 );
   105        void RegisterForType( TDRMEventType aEventType, HBufC8* aURI = 0 );
   106 
   106 
   107 
   107 
   108        /**
   108        /**
   109        * UnRegisterFromType
   109        * UnRegisterFromType
   110        *
   110        *
   111        * Unregister from the server from listening to specific event types, 
   111        * Unregister from the server from listening to specific event types,
   112        * if a URI is provided notifications of the type that have that URI 
   112        * if a URI is provided notifications of the type that have that URI
   113        * as affected URI will get unregistered
   113        * as affected URI will get unregistered
   114        *
   114        *
   115        * @since S60Rel2.6
   115        * @since S60Rel2.6
   116        * @param aEventType  the event type to listen to
   116        * @param aEventType  the event type to listen to
   117        * @param aURI  optional URI to limit the C/S communication
   117        * @param aURI  optional URI to limit the C/S communication
   118        * @return none 
   118        * @return none
   119        */
   119        */
   120        void UnRegisterFromType( TDRMEventType aEventType, HBufC8* aURI = 0 );
   120        void UnRegisterFromType( TDRMEventType aEventType, HBufC8* aURI = 0 );
   121 
   121 
   122        /**
   122        /**
   123        * CancelRequest()
   123        * CancelRequest()
   129        * @since S60Rel2.6
   129        * @since S60Rel2.6
   130        * @return none
   130        * @return none
   131        */
   131        */
   132        void CancelRequest();
   132        void CancelRequest();
   133 
   133 
   134        
   134 
   135     public: // Functions from base classes
   135     public: // Functions from base classes
   136         void Close();      
   136         void Close();
   137     protected:  // New functions
   137     protected:  // New functions
   138         
   138 
   139     protected:  // Functions from base classes
   139     protected:  // Functions from base classes
   140         
   140 
   141     private:
   141     private:
   142 
   142 
   143         // Prohibit copy constructor
   143         // Prohibit copy constructor
   144         RDRMNotifierClient( const RDRMNotifierClient& );
   144         RDRMNotifierClient( const RDRMNotifierClient& );
   145         // Prohibit assigment operator
   145         // Prohibit assigment operator
   151         TDRMEventType* iEventType;
   151         TDRMEventType* iEventType;
   152         TDRMEventType* iEventTypeWait;
   152         TDRMEventType* iEventTypeWait;
   153         TPtr8* iData;
   153         TPtr8* iData;
   154         TPtr8* iWaitData;
   154         TPtr8* iWaitData;
   155         TPckg<TInt> numdata;
   155         TPckg<TInt> numdata;
   156         
   156 
   157     public:     // Friend classes
   157     public:     // Friend classes
   158     protected:  // Friend classes
   158     protected:  // Friend classes
   159     private:    // Friend classes
   159     private:    // Friend classes
   160     };
   160     };
   161 
   161 
   162 #endif      // RDRMNOTIFIERCLIENT_H
   162 #endif      // RDRMNOTIFIERCLIENT_H
   163             
   163 
   164 // End of File
   164 // End of File