#ifndef AEEMPNET_H
#define AEEMPNET_H

/*============================================================================
FILE: AEEMpNet.h

SERVICES:  BREW Interactive Multimedia Player Services

DESCRIPTION:
   This file defines an abstract interface for BREW Interactive Multimedia Player.

PUBLIC CLASSES:  Not Applicable

INITIALIZATION AND SEQUENCING REQUIREMENTS:  Not Applicable

============================================================================*/
/*===============================================================================
    INCLUDES AND VARIABLE DEFINITIONS
===============================================================================*/
/*-------------------------------------------------------------------
      Include Files
-------------------------------------------------------------------*/
#include "AEE.h"

/*-------------------------------------------------------------------
      Defines
-------------------------------------------------------------------*/

/*-------------------------------------------------------------------
      Type Declarations
-------------------------------------------------------------------*/
// Define interface pointers
typedef struct _IMPNet    IMPNet;

//===============================================================================
// FUNCTION DECLARATIONS and INLINE FUNCTION DEFINITIONS
//===============================================================================
// IMPNET Initialization.
extern void IMPNET_Init(IShell * ps);
// Constructor and destructor
extern int IMPNET_New(IShell * ps, AEECLSID cls, void ** ppif);

typedef boolean (*PFNMPNETSTARTNOTIFY)( uint32       lwHandle,
                                        uint32       lwUserHandle,
                                        void *       pvUser, 
                                        uint16       wStatus,
                                        const char * kpczUrl,
                                        const char * kpczHeaders );

typedef boolean (*PFNMPNETBODYNOTIFY)( uint32        lwHandle,
                                       uint32        lwUserHandle,
                                       void *        pvUser, 
                                       const uint8 * kpbData,
                                       int32         liDataSize );

typedef void     (*PFNMPNETENDNOTIFY)( uint32  lwHandle,
                                       uint32  lwUserHandle,
                                       void *  pvUser, 
                                       boolean oComplete );

//-------------------------------------------------------------------
// Interface Definitions - C Style
//-------------------------------------------------------------------
/*===========================================================================

                      IEXTDISPCTL INTERFACE

===========================================================================*/
#define INHERIT_IMPNet(iname) \
   INHERIT_IBase(iname);\
   \
   void              (*RegisterCallbacks)(iname * po, PFNMPNETSTARTNOTIFY pfnStartNotify, \
                                                      PFNMPNETBODYNOTIFY  pfnBodyNotify, \
                                                      PFNMPNETENDNOTIFY   pfnEndNotify );\
   \
   uint32            (*RequestStart)(iname * po, \
                                     const char *  kpczMethod, \
                                     const char *  kpczUrl, \
                                     const char *  kpczHeaders, \
                                     const uint8 * kpbEntity, \
                                     int32         liEntitySize, \
                                     uint32        lwUserHandle, \
                                     void *        pvUser);\
   \
   void              (*RequestCancel)(iname * po, uint32 lwHandle);\
   \
   void              (*RequestCancelUser)(iname * po, uint32 lwUserHandle)

QINTERFACE(IMPNet)
{
   INHERIT_IMPNet(IMPNet);
};

#define IMPNET_AddRef(p)                          GET_PVTBL(p, IMPNet)->AddRef(p)
#define IMPNET_Release(p)                         GET_PVTBL(p, IMPNet)->Release(p)

#define IMPNET_RegisterCallbacks(p, f1, f2, f3)   GET_PVTBL(p, IMPNet)->RegisterCallbacks(p, f1, f2, f3)

#define IMPNET_RequestStart(p, a, b, c, d, e, f, g) \
                                                  GET_PVTBL(p, IMPNet)->RequestStart(p, a, b, c, d, e, f, g)
#define IMPNET_RequestCancel(p, d)                GET_PVTBL(p, IMPNet)->RequestCancel(p, d)
#define IMPNET_RequestCancelUser(p, d)            GET_PVTBL(p, IMPNet)->RequestCancelUser(p, d)

#endif // AEEMPNET_H
