home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / Runimage / Delphi50 / Source / Internet / WEBCOMP.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1999-08-11  |  19.9 KB  |  616 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Borland Delphi Visual Component Library         }
  5. {                                                       }
  6. {       Copyright (c) 1999 Inprise Corporation          }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit WebComp;
  11.  
  12. interface
  13.  
  14. uses Classes, HTTPApp, Midas, Masks;
  15.  
  16. type
  17.  
  18.   IScriptManager = interface;
  19.   IScriptProducer = interface
  20.   ['{555DA472-F254-11D2-AA55-00A024C11562}']
  21.     function GetScriptManager: IScriptManager;
  22.     property ScriptManager: IScriptManager read GetScriptManager;
  23.   end;
  24.  
  25.   IXMLRowSet = interface;
  26.   IXMLDocuments = interface;
  27.   IXMLDocument = interface;
  28.   IXMLRowSets = interface;
  29.   IIncludeFiles = interface;
  30.   IFunctions = interface;
  31.   IVars = interface;
  32.   IScriptBlocks = interface;
  33.   IHTMLBlocks = interface;
  34.   TWebContentOptions = class;
  35.   IAddScriptElements = interface;
  36.   IScriptManager = interface
  37.   ['{94B8B14E-E6D6-11D2-AFA6-00C04FB16EC3}']
  38.     function GetXMLDocuments: IXMLDocuments;
  39.     function GetIncludeFiles: IIncludeFiles;
  40.     function GetFunctions: IFunctions;
  41.     function GetWarnings: TStrings;
  42.     function GetScriptBlocks: IScriptBlocks;
  43.     function GetVars: IVars;
  44.     function GetHTMLBlocks: IHTMLBlocks;
  45.     function GetOptions: TWebContentOptions;
  46.     function GetAddElementsIntf: IAddScriptElements;
  47.     procedure AddError(const Error: string);
  48.     property XMLDocuments: IXMLDocuments read GetXMLDocuments;
  49.     property IncludeFiles: IIncludeFiles read GetIncludeFiles;
  50.     property Warnings: TStrings read GetWarnings;
  51.     property Functions: IFunctions read GetFunctions;
  52.     property Vars: IVars read GetVars;
  53.     property ScriptBlocks: IScriptBlocks read GetScriptBlocks;
  54.     property HTMLBlocks: IHTMLBlocks read GetHTMLBlocks;
  55.     property Options: TWebContentOptions read GetOptions;
  56.     property AddElementsIntf: IAddScriptElements read GetAddElementsIntf;
  57.   end;
  58.  
  59.   IIncludeFile = interface;
  60.   IIncludeFiles = interface
  61.   ['{F735BC77-E7A4-11D2-AFA7-00C04FB16EC3}']
  62.     function GetCount: Integer;
  63.     function GetItem(I: Integer): IIncludeFile;
  64.     property Count: Integer read GetCount;
  65.     property Items[I: Integer]: IIncludeFile read GetItem;
  66.   end;
  67.  
  68.   IIncludeFile = interface
  69.   ['{F735BC78-E7A4-11D2-AFA7-00C04FB16EC3}']
  70.     function GetFileName: string;
  71.     property FileName: string read GetFileName;
  72.   end;
  73.  
  74.   IFunction = interface;
  75.   IFunctions = interface
  76.   ['{3AA43171-EC43-11D2-AFAE-00C04FB16EC3}']
  77.     function GetCount: Integer;
  78.     function GetItem(I: Integer): IFunction;
  79.     property Count: Integer read GetCount;
  80.     property Items[I: Integer]: IFunction read GetItem;
  81.   end;
  82.  
  83.   IFunction = interface
  84.   ['{3AA43172-EC43-11D2-AFAE-00C04FB16EC3}']
  85.     function GetFunctionName: string;
  86.     function GetBody: string;
  87.     property FunctionName: string read GetFunctionName;
  88.     property Body: string read GetBody;
  89.   end;
  90.  
  91.   IVar = interface;
  92.   IVars = interface
  93.   ['{8AFBBDE2-2A11-11D3-AAAB-00A024C11562}']
  94.     function GetCount: Integer;
  95.     function GetItem(I: Integer): IVar;
  96.     property Count: Integer read GetCount;
  97.     property Items[I: Integer]: IVar read GetItem;
  98.   end;
  99.  
  100.   IVar = interface
  101.   ['{8AFBBDE3-2A11-11D3-AAAB-00A024C11562}']
  102.     function GetVarName: string;
  103.     function GetScript: string;
  104.     property VarName: string read GetVarName;
  105.     property Script: string read GetScript;
  106.   end;
  107.  
  108.   IHTMLBlock = interface;
  109.   IHTMLBlocks = interface
  110.   ['{8AFBBDE4-2A11-11D3-AAAB-00A024C11562}']
  111.     function GetCount: Integer;
  112.     function GetItem(I: Integer): IHTMLBlock;
  113.     property Count: Integer read GetCount;
  114.     property Items[I: Integer]: IHTMLBlock read GetItem;
  115.   end;
  116.  
  117.   IHTMLBlock = interface
  118.   ['{8AFBBDE5-2A11-11D3-AAAB-00A024C11562}']
  119.     function GetBlockName: string;
  120.     function GetHTML: string;
  121.     property BlockName: string read GetBlockName;
  122.     property HTML: string read GetHTML;
  123.   end;
  124.  
  125.   IScriptBlock = interface;
  126.   IScriptBlocks = interface
  127.   ['{8AFBBDE6-2A11-11D3-AAAB-00A024C11562}']
  128.     function GetCount: Integer;
  129.     function GetItem(I: Integer): IScriptBlock;
  130.     property Count: Integer read GetCount;
  131.     property Items[I: Integer]: IScriptBlock read GetItem;
  132.   end;
  133.  
  134.   IScriptBlock = interface
  135.   ['{8AFBBDE7-2A11-11D3-AAAB-00A024C11562}']
  136.     function GetBlockName: string;
  137.     function GetScript: string;
  138.     property BlockName: string read GetBlockName;
  139.     property Script: string read GetScript;
  140.   end;
  141.  
  142.   IXMLDocuments = interface
  143.   ['{94B8B150-E6D6-11D2-AFA6-00C04FB16EC3}']
  144.     function GetCount: Integer;
  145.     function GetItem(I: Integer): IXMLDocument;
  146.     property Count: Integer read GetCount;
  147.     property Items[I: Integer]: IXMLDocument read GetItem;
  148.   end;
  149.  
  150.   IXMLDocument = interface
  151.   ['{94B8B151-E6D6-11D2-AFA6-00C04FB16EC3}']
  152.     function GetRowSets: IXMLRowSets;
  153.     function GetComponent: TComponent;
  154.     function GetDocumentVarName: string;
  155.     function GetXMLVarName: string;
  156.     property RowSets: IXMLRowSets read GetRowSets;
  157.     property Component: TComponent read GetComponent;
  158.     property DocumentVarName: string read GetDocumentVarName;
  159.     property XMLVarName: string read GetXMLVarName;
  160.   end;
  161.  
  162.   IXMLRowSets = interface
  163.   ['{94B8B152-E6D6-11D2-AFA6-00C04FB16EC3}']
  164.     function GetCount: Integer;
  165.     function GetItem(I: Integer): IXMLRowSet;
  166.     property Count: Integer read GetCount;
  167.     property Items[I: Integer]: IXMLRowSet read GetItem;
  168.   end;
  169.  
  170.   IXMLRowSet = interface
  171.   ['{94B8B14F-E6D6-11D2-AFA6-00C04FB16EC3}']
  172.     function GetPath: TStrings;
  173.     function GetRowSetVarName: string;
  174.     function GetMasterRowSetVarName: string;
  175.     function GetMasterDataSetFieldName: string;
  176.     property MasterRowSetVarName: string read GetMasterRowSetVarName;
  177.     property MasterDataSetFieldName: string read GetMasterDataSetFieldName;
  178.     property RowSetVarName: string read GetRowSetVarName;
  179.   end;
  180.  
  181.   TAddScriptElementsEvent = procedure(Data: Pointer; AddScriptElements: IAddScriptElements) of object;
  182.  
  183.   IAddScriptElements = interface
  184.   ['{2FF3A331-E790-11D2-AFA7-00C04FB16EC3}']
  185.     function GetScriptManager: IScriptManager;
  186.     function AddIncludeFile(FileName: string): Boolean;
  187.     function AddRowSet(XMLProducer: TComponent; Path: TStrings): Boolean;
  188.     function AddScriptBlock(Name: string; Script: string): Boolean;
  189.     function AddHTMLBlock(Name: string; HTML: string): Boolean;
  190.     function AddVar(Name: string; Script: string): Boolean;
  191.     function AddFunction(Name: string; Body: string): Boolean;
  192.     procedure AddError(Text: string);
  193.     procedure AddPass(Event: TAddScriptElementsEvent; Data: Pointer);
  194.     procedure AddScriptComponents(List: TObject);
  195.     property ScriptManager: IScriptManager read GetScriptManager;
  196.   end;
  197.  
  198.   IScriptComponent = interface
  199.   ['{1B9B0962-D28E-11D2-AF8A-00C04FB16EC3}']
  200.     procedure AddElements(AddIntf: IAddScriptElements);
  201.     function GetSubComponents: TObject; // Object implementing IWebComponentContainer
  202.     property SubComponents: TObject read GetSubComponents;
  203.   end;
  204.  
  205.   TWebComponentContainer = TObject;
  206.  
  207.   IWebComponentContainer = interface
  208.   ['{44957E12-E039-11D2-AA46-00A024C11562}']
  209.     function GetComponentCount: Integer;
  210.     function GetComponent(I: Integer): TComponent;
  211.     property ComponentCount: Integer read GetComponentCount;
  212.     property Components[I: Integer]: TComponent read GetComponent;
  213.   end;
  214.  
  215.   IWebComponentEditor = interface
  216.   ['{13F59F61-EF85-11D2-AFB1-00C04FB16EC3}']
  217.     function CanAddClass(AParent: TComponent; AClass: TClass): Boolean;
  218.   end;
  219.  
  220.   IWebComponentEditorHelper = interface
  221.   ['{13F59F61-EF85-11D2-AFB1-00C04FB16EC3}']
  222.     function CanAddClassHelper(AEditor: TComponent; AParent: TComponent; AClass: TClass): Boolean;
  223.   end;
  224.  
  225.   IWebComponentCommands = interface
  226.   ['{FCB67B0D-F357-11D2-AFB6-00C04FB16EC3}']
  227.     procedure ExecuteVerb(AComponent: TComponent; Index: Integer);
  228.     function GetVerb(AComponent: TComponent; Index: Integer): string;
  229.     function GetVerbCount(AComponent: TComponent): Integer;
  230.   end;
  231.  
  232.   IWebComponent = interface
  233.   ['{EB813782-EEAE-11D2-AFB0-00C04FB16EC3}']
  234.     function GetIndex: Integer;
  235.     procedure SetIndex(Value: Integer);
  236.     procedure SetContainer(Container: TWebComponentContainer);
  237.     function GetContainer: TWebComponentContainer;
  238.     procedure SetComponentList(List: TObject);
  239.     property Index: Integer read GetIndex write SetIndex;
  240.     property Container: TWebComponentContainer read GetContainer write SetContainer;
  241.     property ComponentList: TObject write SetComponentList;
  242.   end;
  243.  
  244.   IGetWebComponentList = interface
  245.   ['{5CDEB0F2-EEF9-11D2-AFB1-00C04FB16EC3}']
  246.     function GetComponentList: TObject;
  247.     function GetDefaultComponentList: TObject;
  248.   end;
  249.  
  250.   TWebContentFlag = (coNoScript, coLocalPaths);
  251.   TWebContentFlags = set of TWebContentFlag;
  252.   TWebContentOptions = class(TObject)
  253.   private
  254.     FFlags: TWebContentFlags;
  255.   public
  256.     constructor Create(AFlags: TWebContentFlags);
  257.     property Flags: TWebContentFlags read FFlags;
  258.   end;
  259.  
  260.   TLayout = TObject;
  261.  
  262.   IWebContent = interface
  263.   ['{1B3E1CD1-DF59-11D2-AA45-00A024C11562}']
  264.     function Content(Options: TWebContentOptions;
  265.       ParentLayout: TLayout): string;
  266.   end;
  267.  
  268.   TLabelPosition = (lposLeft, lposRight, lposAbove, lposBelow);
  269.   TLayoutAttributes = class(TObject)
  270.   public
  271.     LabelAttributes: string;
  272.     ControlAttributes: string;
  273.     LabelPosition: TLabelPosition;
  274.     constructor Create;
  275.   end;
  276.  
  277.   ILayoutWebContent = interface
  278.   ['{4E810ED1-F09B-11D2-AA53-00A024C11562}']
  279.     function LayoutButton(const HTMLButton: string; Attributes: TLayoutAttributes): string;
  280.     function LayoutField(const HTMLField: string; Attributes: TLayoutAttributes): string;
  281.     function LayoutLabelAndField(const HTMLLabel, HTMLField: string; Attributes: TLayoutAttributes): string;
  282.     function LayoutTable(const HTMLTable: string; Attributes: TLayoutAttributes): string;
  283.   end;
  284.  
  285.   TLayoutWebContent = class(TObject, ILayoutWebContent)
  286.   private
  287.     FParentLayout: TLayout;
  288.   protected
  289.     { IUnknown }
  290.     function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
  291.     function _AddRef: Integer; stdcall;
  292.     function _Release: Integer; stdcall;
  293.     { ILayoutWebContent }
  294.     function LayoutButton(const HTMLButton: string; Attributes: TLayoutAttributes): string;
  295.     function LayoutField(const HTMLField: string; Attributes: TLayoutAttributes): string;
  296.     function LayoutLabelAndField(const HTMLLabel, HTMLField: string; Attributes: TLayoutAttributes): string;
  297.     function LayoutTable(const HTMLTable: string; Attributes: TLayoutAttributes): string;
  298.  
  299.     function ImplLayoutButton(const HTMLButton: string; Attributes: TLayoutAttributes): string; virtual; abstract;
  300.     function ImplLayoutField(const HTMLField: string; Attributes: TLayoutAttributes): string; virtual; abstract;
  301.     function ImplLayoutLabelAndField(const HTMLLabel, HTMLField: string; Attributes: TLayoutAttributes): string; virtual; abstract;
  302.     function ImplLayoutTable(const HTMLTable: string; Attributes: TLayoutAttributes): string; virtual; abstract;
  303.   public
  304.     constructor Create(AParentLayout: TLayout);
  305.     property ParentLayout: TLayout read FParentLayout;
  306.   end;
  307.  
  308.   TWebComponentList = class(TObject, IWebComponentContainer)
  309.   private
  310.     FParentComponent: TComponent;
  311.     FList: TList;
  312.   protected
  313.     function GetCount: Integer;
  314.     function GetComponent(Index: Integer): TComponent;
  315.     function NewComponent(AOwner: TComponent): TComponent; virtual;
  316.     { IUnknown }
  317.     function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
  318.     function _AddRef: Integer; stdcall;
  319.     function _Release: Integer; stdcall;
  320.     { IWebComponentContainer }
  321.     function IWebComponentContainer.GetComponentCount = WebComponentContainer_GetComponentCount;
  322.     function IWebComponentContainer.GetComponent = WebComponentContainer_GetComponent;
  323.     function WebComponentContainer_GetComponentCount: Integer;
  324.     function WebComponentContainer_GetComponent(I: Integer): TComponent;
  325.   public
  326.     constructor Create(AParentComponent: TComponent);
  327.     destructor Destroy; override;
  328.     procedure Add(Component: TComponent);
  329.     procedure SetComponentIndex(Component: TComponent; Value: Integer);
  330.     procedure Clear;
  331.     function IndexOf(Component: TComponent): Integer;
  332.     procedure Remove(Component: TComponent);
  333.     property Count: Integer read GetCount;
  334.     property WebComponents[Index: Integer]: TComponent read GetComponent; default;
  335.     property ParentComponent: TComponent read FParentComponent;
  336.   end;
  337.  
  338.   TEnumWebComponentsProc = procedure (WebComponentClass: TComponentClass;
  339.     Editor: TObject; Info: Pointer) of object;
  340.  
  341.   TWebComponentsEditorHelper = class(TObject, IWebComponentEditorHelper)
  342.   protected
  343.     { IUnknown }
  344.     function QueryInterface(const IID: TGUID; out Obj): HResult; virtual; stdcall;
  345.     function _AddRef: Integer; stdcall;
  346.     function _Release: Integer; stdcall;
  347.     { IWebComponentEditorHelper }
  348.     function CanAddClassHelper(AEditor: TComponent; AParent: TComponent; AClass: TClass): Boolean;
  349.     function ImplCanAddClassHelper(AEditor: TComponent; AParent: TComponent; AClass: TClass): Boolean; virtual;
  350.   end;
  351.  
  352. const
  353.   RegisterWebComponentsProc: procedure (
  354.     const AClasses: array of TComponentClass; Editor: TObject) = nil;
  355.   UnRegisterWebComponentsProc: procedure (const AClasses: array of TComponentClass) = nil;
  356.   EnumRegisteredWebComponentsProc: procedure (Proc: TEnumWebComponentsProc; Info: Pointer) = nil;
  357.   FindWebComponentEditorHelperProc: function (AClass: TClass): TObject = nil;
  358.  
  359. procedure RegisterWebComponents(const AClasses: array of TComponentClass; Editor: TObject = nil);
  360. procedure UnRegisterWebComponents(const AClasses: array of TComponentClass);
  361. procedure EnumRegisteredWebComponents(Proc: TEnumWebComponentsProc; Info: Pointer);
  362. function FindWebComponentEditorHelper(AClass: TClass): TObject;
  363.  
  364. implementation
  365.  
  366. uses Windows, Messages, DbConsts, MidConst, ActiveX, ComObj, WebConst, sysutils, DbWeb, Forms,
  367.   WbmConst;
  368.  
  369. procedure RegisterWebComponents(
  370.   const AClasses: array of TComponentClass; Editor: TObject = nil);
  371. begin
  372.   if Assigned(RegisterWebComponentsProc) then
  373.     RegisterWebComponentsProc(AClasses, Editor) else
  374.     raise Exception.CreateRes(@SInvalidWebComponentsRegistration);
  375. end;
  376.  
  377. procedure UnRegisterWebComponents(const AClasses: array of TComponentClass);
  378. begin
  379.   if Assigned(UnRegisterWebComponentsProc) then
  380.     UnRegisterWebComponentsProc(AClasses);
  381. end;
  382.  
  383. procedure EnumRegisteredWebComponents(Proc: TEnumWebComponentsProc; Info: Pointer);
  384. begin
  385.   if Assigned(EnumRegisteredWebComponentsProc) then
  386.     EnumRegisteredWebComponentsProc(Proc, Info) else
  387.     raise Exception.CreateRes(@SInvalidWebComponentsEnumeration);
  388. end;
  389.  
  390. function FindWebComponentEditorHelper(AClass: TClass): TObject;
  391. begin
  392.   if Assigned(FindWebComponentEditorHelperProc) then
  393.     Result := FindWebComponentEditorHelperProc(AClass)
  394.   else
  395.     Result := nil;
  396. end;
  397.  
  398. { TWebComponentList }
  399.  
  400. function TWebComponentList._AddRef: Integer;
  401. begin
  402.   Result := -1;
  403. end;
  404.  
  405. function TWebComponentList._Release: Integer;
  406. begin
  407.   Result := -1;
  408. end;
  409.  
  410. procedure TWebComponentList.Add(Component: TComponent);
  411. var
  412.   WebComponentIntf: IWebComponent;
  413. begin
  414.   FList.Add(Component);
  415.   Component.GetInterface(IWebComponent, WebComponentIntf);
  416.   WebComponentIntf.ComponentList := Self;
  417. end;
  418.  
  419. procedure TWebComponentList.Clear;
  420. var
  421.   F: TComponent;
  422.   WebComponentIntf: IWebComponent;
  423. begin
  424.   while FList.Count > 0 do
  425.   begin
  426.     F := FList.Last;
  427.     F.GetInterface(IWebComponent, WebComponentIntf);
  428.     Assert(Assigned(WebComponentIntf), 'Interface not found');
  429.     WebComponentIntf.ComponentList := nil;
  430.     WebComponentIntf := nil;
  431.     F.Free;
  432.     FList.Delete(FList.Count-1);
  433.   end;
  434. end;
  435.  
  436. constructor TWebComponentList.Create(AParentComponent: TComponent);
  437. begin
  438.   inherited Create;
  439.   FList := TList.Create;
  440.   FParentComponent := AParentComponent;
  441. end;
  442.  
  443. destructor TWebComponentList.Destroy;
  444. begin
  445.   if FList <> nil then
  446.     Clear;
  447.   FList.Free;
  448.   inherited;
  449. end;
  450.  
  451. function TWebComponentList.GetComponent(Index: Integer): TComponent;
  452. begin
  453.   Result := FList[Index];
  454.  
  455. end;
  456.  
  457. function TWebComponentList.GetCount: Integer;
  458. begin
  459.   Result := FList.Count;
  460. end;
  461.  
  462. function TWebComponentList.IndexOf(Component: TComponent): Integer;
  463. begin
  464.   Result := FList.IndexOf(Component);
  465. end;
  466.  
  467. function TWebComponentList.QueryInterface(const IID: TGUID; out Obj): HResult;
  468. begin
  469.   if GetInterface(IID, Obj) then Result := S_OK
  470.   else Result := E_NOINTERFACE
  471.  
  472. end;
  473.  
  474. procedure TWebComponentList.Remove(Component: TComponent);
  475. var
  476.   WebComponentIntf: IWebComponent;
  477. begin
  478.   FList.Remove(Component);
  479.   Component.GetInterface(IWebComponent, WebComponentIntf);
  480.   WebComponentIntf.ComponentList := nil;
  481. end;
  482.  
  483. procedure TWebComponentList.SetComponentIndex(Component: TComponent;
  484.   Value: Integer);
  485. var
  486.   CurIndex, Count: Integer;
  487. begin
  488.   CurIndex := FList.IndexOf(Component);
  489.   if CurIndex >= 0 then
  490.   begin
  491.     Count := FList.Count;
  492.     if Value < 0 then Value := 0;
  493.     if Value >= Count then Value := Count - 1;
  494.     if Value <> CurIndex then
  495.     begin
  496.       FList.Delete(CurIndex);
  497.       FList.Insert(Value, Component);
  498.     end;
  499.   end;
  500. end;
  501.  
  502. function TWebComponentList.WebComponentContainer_GetComponent(
  503.   I: Integer): TComponent;
  504. begin
  505.   Result := WebComponents[I];
  506.  
  507. end;
  508.  
  509. function TWebComponentList.WebComponentContainer_GetComponentCount: Integer;
  510. begin
  511.   Result := Count;
  512.  
  513. end;
  514.  
  515. function TWebComponentList.NewComponent(AOwner: TComponent): TComponent;
  516. begin
  517.   Assert(False);
  518.   // Delegate to parent
  519.   Result := nil;
  520. end;
  521.  
  522. { TWebContentOptions }
  523.  
  524. constructor TWebContentOptions.Create(AFlags: TWebContentFlags);
  525. begin
  526.   inherited Create;
  527.   FFlags := AFlags;
  528. end;
  529.  
  530. { TLayoutWebContent }
  531.  
  532. function TLayoutWebContent.LayoutButton(const HTMLButton: string; Attributes: TLayoutAttributes): string;
  533. begin
  534.   Result := ImplLayoutButton(HTMLButton, Attributes);
  535. end;
  536.  
  537. function TLayoutWebContent.LayoutField(const HTMLField: string; Attributes: TLayoutAttributes): string;
  538. begin
  539.   Result := ImplLayoutField(HTMLField, Attributes);
  540. end;
  541.  
  542. function TLayoutWebContent.LayoutLabelAndField(const HTMLLabel,
  543.   HTMLField: string; Attributes: TLayoutAttributes): string;
  544. begin
  545.   Result := ImplLayoutLabelAndField(HTMLLabel, HTMLField, Attributes);
  546. end;
  547.  
  548. function TLayoutWebContent._AddRef: Integer;
  549. begin
  550.   Result := -1;
  551. end;
  552.  
  553. function TLayoutWebContent._Release: Integer;
  554. begin
  555.   Result := -1;
  556. end;
  557.  
  558. function TLayoutWebContent.QueryInterface(const IID: TGUID;
  559.   out Obj): HResult;
  560. begin
  561.   if GetInterface(IID, Obj) then Result := S_OK
  562.   else Result := E_NOINTERFACE
  563. end;
  564.  
  565. constructor TLayoutWebContent.Create(AParentLayout: TLayout);
  566. begin
  567.   inherited Create;
  568.   FParentLayout := AParentLayout;
  569. end;
  570.  
  571.  
  572. function TLayoutWebContent.LayoutTable(const HTMLTable: string; Attributes: TLayoutAttributes): string;
  573. begin
  574.   Result := ImplLayoutTable(HTMLTable, Attributes);
  575. end;
  576.  
  577. { TLayoutAttributes }
  578.  
  579. constructor TLayoutAttributes.Create;
  580. begin
  581.   LabelPosition := lposLeft;
  582. end;
  583.  
  584. { TWebComponentsEditor }
  585.  
  586. function TWebComponentsEditorHelper.CanAddClassHelper(AEditor: TComponent; AParent: TComponent;
  587.   AClass: TClass): Boolean;
  588. begin
  589.   Result := ImplCanAddClassHelper(AEditor, AParent, AClass);
  590. end;
  591.  
  592. function TWebComponentsEditorHelper.ImplCanAddClassHelper(AEditor: TComponent; AParent: TComponent;
  593.   AClass: TClass): Boolean;
  594. begin
  595.   Result := False;
  596. end;
  597.  
  598. function TWebComponentsEditorHelper._AddRef: Integer;
  599. begin
  600.   Result := -1;
  601. end;
  602.  
  603. function TWebComponentsEditorHelper._Release: Integer;
  604. begin
  605.   Result := -1;
  606. end;
  607.  
  608. function TWebComponentsEditorHelper.QueryInterface(const IID: TGUID;
  609.   out Obj): HResult;
  610. begin
  611.   if GetInterface(IID, Obj) then Result := S_OK
  612.   else Result := E_NOINTERFACE
  613. end;
  614.  
  615. end.
  616.