
// @(#) 1.8 com/src/odscript/idl/oddsconn.idl, odscript, od96nt, odnt9712d 10/31/96 12:44:12 [3/21/97 17:22:30]
//
//
//     Contains:       Class definition for Direct Scripting Connection
#ifndef _ODDSCONN_
#define _ODDSCONN_

#include <somobj.idl>
typedef void * ODGUID;
typedef somToken LPODDSEVENTMGRLIST;
typedef somToken LPODDSOLECONNECTION;

interface ODDSEventMgr;
interface ODDSEventMgrEnum;
interface ODDSSink;
interface ODDSConnection : SOMObject
{
  exception ODDS_ERROR {long ErrorCode; char Reason[80];};
  long AddEventMgr(in ODDSEventMgr eventmgr) raises(ODDS_ERROR);
                       // AddEventMgr:
                       // Adds given event manager to the list. This makes
                       // the event interface available to all environments:
                       // OLE, Lotus, etc,
  long DeleteEventMgr(in ODGUID *eventmgrID) raises(ODDS_ERROR);
                       // DeleteEventMgr:
                       // Remove thes event manager from the list and
                       // delete it.
                       // The sink list of the event manager is deleted
                       // as a result of the event manager destruction
  long GetEventMgr(in ODGUID *eventmgrID, out ODDSEventMgr eventmgr) raises(ODDS_ERROR);
                       // GetEventMgr:
                       // Returns the event manager with the given ODGUID.
                       // Returns eventmgr = NULL if not found.
  long CreateEventMgrEnum(out ODDSEventMgrEnum eventMgrs) raises(ODDS_ERROR);
                       // GetEventMgrEnum:
                       // Returns an enumeration object which can be used
                       // to iterate through the list of event managers.
  long AddSink(in ODDSSink sink, out ODDSEventMgr eventmgr) raises(ODDS_ERROR);
                       // AddSink:
                       // Gives the given sink to the an event manager
                       // with the same ODGUID as the sink's ODGUID
                       // for addition the event manager's sink list.
                       // Returns the event manager for later sink deletion.
                       // Returns eventmgr = NULL if not found.
                       // The same operation can be done by issuing an
                       // addSink directly to the event manager.
  long InitOLEConnectionPointContainer(in void * olewrapper,
                                          in void * pUnkOuter,
                                          out void * pMyUnk) raises(ODDS_ERROR);
                       // InitOLEConnectionPointContainer:
                       // Adds OLE Connection point support to this connection object.
                       // Returns this object's IUnknown interface

#ifdef __SOMIDL__

  implementation
  {
     functionprefix = ODDSConnection;
     MajorVersion = 1;
     MinorVersion = 0;
     dllname = "oddsevnt.dll";
     somDefaultInit: override, init;
     somDestruct: override;

     releaseorder:
             AddEventMgr,
             DeleteEventMgr,
             GetEventMgr,
             CreateEventMgrEnum,
             AddSink,
             InitOLEConnectionPointContainer;

      passthru C_xh_before = " #include \"oddsconn.h\" ";
      passthru C_xih_before = " #include \"oddsconn.h\" ";

  };
#endif
};
//************************************************************************
// Class: ODDSEventMgrEnum
//     Contains a sequence of ODGUID which represent the EventManagers
//     managed by an instance of ODDSConnection and a Cursor that
//     moves through the sequence.
//************************************************************************
interface ODDSEventMgrEnum : SOMObject
{

  exception ODDS_ERROR {long ErrorCode; char Reason[80];};
  readonly attribute long count;       // Number of eventMgrs

  long First(out ODDSEventMgr eventMgr);
               // First:
               // Returns first EventMgr in the sequence and positions
               // cursor to 2nd in the list
  long Next(out ODDSEventMgr eventMgr);
               // Next:
               // Returns the next eventMgr. Positions cursor to
               // the next one.
  void Create(inout somInitCtrl ctrl, in ODDSConnection conn, in sequence<ODGUID> eventMgrs );
               // Copies input sequence and sets cursor to first GUID in
               // the sequence

#ifdef __SOMIDL__

 implementation
 {
    functionprefix = ODDSEventMgrEnum;
    MajorVersion = 1;
    MinorVersion = 0;

    Create: init;
    somDefaultInit: override, init;
    somDestruct: override;
    releaseorder:
           Create,
           First,
           Next,
           _get_count;

};
#endif
};
#endif // _ODDSCONN_

