unit model.base;
{$mode ObjFPC}{$H+}{$J+} /// <--- here?!?
{$ModeSwitch advancedrecords}
interface
uses classes,sysutils,obs_prosu;
const
{ (p)rovider (r)easons for observer action/reaction }
prStatus = prUser + 1; { carries an optional object in aNotifyClass and usually a pchar in UserData }
prDataStrNeeded = prUser + 2; { carries an 'ItrxSectionFetch' obj in UserData }
prSectionFetched = prUser + 3; { carries an 'IStrings' object in UserData }
prStaticTextsFetched = prUser + 4; { carries an 'IStrings' object in UserData }
prUnitFetched = prUser + 5; { carries an 'IStrings' object in UserData }
type
{$interfaces corba}
{ this is the ancester }
IbcCorba = interface['{3563A63E-8C1A-40E1-9574-3E4171BB3ACF}']
function Obj: TObject;
end;
TcsuTransaction = class; // forward
{ ImemTransaction is our container vessel for changes }
IcsuTransaction = interface['{AFE2A986-7D3C-46AB-A4BF-2A0BDA1DECDF}']
function get_DataPtr: pointer;
function get_Id: ptrint;
function get_ModReason: word;
function get_Sender: TObject;
function get_StrProp(anIndex: integer): shortstring;
function Obj: TcsuTransaction;
procedure set_DataPtr(aValue: pointer);
procedure set_Id(aValue: ptrint);
procedure set_ModReason(aValue: word);
procedure set_Sender(aValue: TObject);
procedure set_StrProp(anIndex: integer;aValue: shortstring);
// function AssignFrom(anItem: ImemItem): boolean;
property DataPtr: pointer read get_DataPtr write set_DataPtr;
property ID: ptrint read get_Id write set_Id;
Property ModReason: word read get_ModReason write set_ModReason;
Property Sender: TObject read get_Sender write set_Sender;
property Title: shortstring index 0 read get_StrProp write set_StrProp;
end;
{$interfaces com}
{ TcsuTransaction is our container vessel for changes }
TcsuTransaction = class(TObject,IcsuTransaction)
protected
fDataPtr: pointer;
fID: ptrint;
fModReason: word;
fSender: TObject;
fTitle: shortstring;
function get_DataPtr: pointer; virtual;
function get_Id: ptrint; virtual;
function get_ModReason: word; virtual;
function get_Sender: TObject; virtual;
function get_StrProp(anIndex: integer): shortstring; virtual;
function Obj: TcsuTransaction; virtual;
procedure set_DataPtr(aValue: pointer); virtual;
procedure set_Id(aValue: ptrint); virtual;
procedure set_ModReason(aValue: word); virtual;
procedure set_Sender(aValue: TObject); virtual;
procedure set_StrProp(anIndex: integer;aValue: shortstring); virtual;
public
constructor Create(aModReason: word); virtual;
destructor Destroy; override;
// function AssignFrom(anItem: ImemItem): boolean;
property DataPtr: pointer read get_DataPtr write set_DataPtr;
property ID: ptrint read get_Id write set_Id;
Property ModReason: word read get_ModReason write set_ModReason;
Property Sender: TObject read get_Sender write set_Sender;
property Title: shortstring index 0 read get_StrProp write set_StrProp;
end; { TcsuTransaction }
{ P/TLogDirsCreated }
PLogDirsCreated = ^TLogDirsCreated;
TLogDirsCreated = record
const ldcDirs: TStringArray = ('common','models','presenters','views');
var
ldcAbreviation: string;
ldcLogText: string;
ldcProjectname: string;
ldcResult: boolean;
ldcRoot: string;
end;
implementation