(*****************************************************************************)
(* MODULE: BSEBAPI^                                                          *)
(* RIGHTS: Reggatta Systems - COPYRIGHT 1995 - 1998                          *)
(* DESCR.: This module contains the base class for all other classes         *)
(*                                                                           *)
(*                                                                           *)
(* NOTES :                                                                   *)
(*                                                                           *)
(* TBapiListItem:      This is the base class for all Bapi Classes.  This    *)
(*                     class provides status handling and construction and   *)
(*                     destruction of any object that may go in a collection.*)
(*                                                                           *)
(*****************************************************************************)
Unit BseBapi;
{$I BSE.INC}
{$I BAPI.INC}
Interface
Uses
  Classes,
  Windows,
  BDE,

  BseErrs,
  BseColl,
  BseTypes;

Type
  TPropertyRec =
  Record
    Prop  : Word;
    Group : Word;
  end;

  TBapiListItem =
  Class( TObject )
    Protected
      FParent        : TObject;
      FContainer     : TTitanCollection;

      Function  GetIdentifier : Integer;

    Public
      Property Container : TTitanCollection
        Read  FContainer
        Write FContainer;
      Property Identifier : Integer
        Read  GetIdentifier;
      Property Parent : TObject
        Read  FParent
        Write FParent;

      Constructor Create( P : TObject; Container : TTitanCollection );
      Constructor CreateAsSes( P : TObject; Container : TTitanCollection; PName, PNetDir : PChar );
        Virtual;

      Destructor  Destroy; Override;

      Procedure   GetProp (                                 { Get property }
                    iProp         : Longint;                { Property to retrieve }
                    PropValue     : Pointer;                { == NULL, validate iProp for getting }
                    iMaxLen       : Word;                   { Length of buffer pPropValue }
                    var   iLen    : Word                    { Returns required length }
                  ); Virtual;

      Procedure   SetProp (                                 { Get property }
                    iProp         : Longint;                { Property to retrieve }
                    PropValue     : Longint                 { == NULL, validate iProp for getting }
                  ); Virtual;

      Procedure   ValidateProp (                            { Validate a property }
                    iProp         : Longint;                { property to validate }
                    bSetting      : Bool                    { TRUE:setting, FALSE:getting }
                  ); Virtual;

  end;


Implementation
Uses
  SysUtils,

  BseConst;


Constructor TBapiListItem.Create( P : TObject; Container : TTitanCollection );
begin
  Inherited Create;
  FParent    := P;
  FContainer := Container;
  If ( FContainer <> NIL ) then
    FContainer.Insert( Self );
end;


Constructor TBapiListItem.CreateAsSes( P : TObject; Container : TTitanCollection; PName, PNetDir : PChar );
begin
  Create( P, Container );
end;


Destructor TBapiListItem.Destroy;
begin
  If ( FContainer <> NIL ) then
    FContainer.Delete( Self );
  Inherited Destroy;
end;


Function TBapiListItem.GetIdentifier : Integer;
begin
  If ( FContainer <> NIL ) then
    Result := FContainer.IndexOf( Self )
  else
    Result := 0;
end;


Procedure TBapiListItem.GetProp (                           { Get property }
           iProp         : Longint;                         { Property to retrieve }
           PropValue     : Pointer;                         { == NULL, validate iProp for getting }
           iMaxLen       : Word;                            { Length of buffer pPropValue }
           var   iLen    : Word                             { Returns required length }
         );
begin
  Not_Supported( fnGETPROP );
end;


Procedure TBapiListItem.SetProp (                           { Set property }
            iProp         : Longint;                        { Property to retrieve }
            PropValue     : Longint                         { == NULL, validate iProp for getting }
         );
begin
end;


Procedure TBapiListItem.ValidateProp (                      { Validate a property }
            iProp         : Longint;                        { property to validate }
            bSetting      : Bool                            { TRUE:setting, FALSE:getting }
          );
begin
end;


end.
