{ ------------------------------------------------------------- }
{ Purpose : Next Common 6                                       }
{ By      : Bojan Nikolic                                       }
{ For     : BergSoft                                            }
{ ------------------------------------------------------------- }
{ Copyright (C) BergSoft.net 2011. All Rights Reserved.         }
{ ------------------------------------------------------------- }
unit NxIntf6;

interface

uses
  { Standard }
  Classes, Types, Messages, Windows, Graphics,
  { Controls }
  Controls, StdCtrls,
  { Next Standard 6 }
  NxTypes6, NxUtils6;

type
  { INxDestroyable }
   
  INxDestroyable = interface
    ['{5D50A8CD-95CE-47D1-87F2-F5B29188DFD0}']
    procedure Free;
  end;

  { INxObject }

  INxObject = interface
    ['{EF85FAF0-1FB3-4D5C-AE00-6C8170842EF2}']
    function ToObject: TObject;
  end;

  { INxRanged }

  INxRanged = interface
    ['{D18A4090-AFC1-48A1-9E6B-1BDD8A26D716}']
    function GetMax: Double;
    function GetMin: Double;
    { Properties }
    property Max: Double read GetMax;
    property Min: Double read GetMin;
  end;

  { INxBase }

  INxBase = interface(INxObject)
    ['{FB662DD3-D7F4-4009-B189-7E297519D524}']
    { Property Accessors }
    function GetAsBoolean: Boolean;
    function GetAsDateTime: TDateTime;
    function GetAsFloat: Double;
    function GetAsInteger: Integer;
    function GetAsString: WideString;
    function GetAsUTF8String: UTF8String;
    function GetIsNull: Boolean;
    procedure SetAsBoolean(const Value: Boolean);
    procedure SetAsDateTime(const Value: TDateTime);
    procedure SetAsFloat(const Value: Double);
    procedure SetAsInteger(const Value: Integer);
    procedure SetAsString(const Value: WideString);
    procedure SetAsUTF8String(const Value: UTF8String);
    { Methods }
    procedure AssignValue(Source: INxBase);
    { Properties }
    property AsBoolean: Boolean read GetAsBoolean write SetAsBoolean;
    property AsDateTime: TDateTime read GetAsDateTime write SetAsDateTime;
    property AsFloat: Double read GetAsFloat write SetAsFloat;
    property AsInteger: Integer read GetAsInteger write SetAsInteger;
    property AsString: WideString read GetAsString write SetAsString;
    property AsUTF8String: UTF8String read GetAsUTF8String write SetAsUTF8String;
    property IsNull: Boolean read GetIsNull;
  end;

  { INxControl }

  INxDesignerSelectable = interface
    ['{0E394E0D-4093-430D-BF68-7FF9B79472C7}']
    procedure SelectComponent(Instance: TPersistent);
  end;

  INxDesignNotificationRecipient = interface
    ['{0D15E86E-21E5-4E02-AF11-35CDE1BFD9F5}']
    { Methods }
    procedure DesignNotification(Sender: INxDesignNotificationRecipient;
      Operation: TNxDesignOperation);
  end;

  INxPersistentDesignResponder = interface(INxDesignNotificationRecipient)
    ['{4CF050C9-E112-4701-B579-6262A80F4668}']
    function GetInstance: TPersistent;
    { Properties }
    property Instance: TPersistent read GetInstance;
  end;

  INxEntityDesignRespoder = interface(INxDesignNotificationRecipient)
    ['{5C256C28-4101-4C61-BC91-ECF15E845133}']
    function GetIndex: Integer;
    procedure SetIndex(const Value: Integer);
    property Index: Integer read GetIndex write SetIndex;
  end;

  { TNxEntityDesignResponder }

  TNxEntityDesignResponder = class(TInterfacedObject, INxEntityDesignRespoder)
  private
    FIndex: Integer;
    function GetIndex: Integer;
    procedure SetIndex(const Value: Integer);
  protected
    { Methods }
    procedure DesignNotification(AResponder: INxDesignNotificationRecipient; Operation: TNxDesignOperation);
  public
    { Properties }
    property Index: Integer read GetIndex write SetIndex;
  end;

  INxDesignControl = interface(INxDesignNotificationRecipient)
    ['{C35F2D8B-4CCC-45AF-A022-5F4F4BF494C8}']
    { Methods }
    function GetResponderAtPos(Location: TPoint): INxDesignNotificationRecipient;
    procedure SelectComponent(Instance: TPersistent);

    procedure SetDesignerDelegate(const Value: INxDesignNotificationRecipient);
    { Properties }
    property DesignerDelegate: INxDesignNotificationRecipient write SetDesignerDelegate;
  end;

  { INxBaseCell }

  INxBaseCell = interface(INxBase)
    ['{6ACBAC90-55DC-4C7F-BCA2-21ABEFAF5AA9}']
    { Property Accessors }
    function GetColor: TColor;
    function GetDisplayText: WideString;
    function GetEmpty: Boolean;
    function GetEnabled: Boolean;
    function GetLocked: Boolean;
    function GetParentColor: Boolean;
    function GetVisible: Boolean;
    procedure SetColor(const Value: TColor);
    procedure SetEmpty(const Value: Boolean);
    procedure SetEnabled(const Value: Boolean);
    procedure SetLocked(const Value: Boolean);
    procedure SetParentColor(const Value: Boolean);
    procedure SetVisible(const Value: Boolean);
    { Methods }
    function IsSet: Boolean;
    procedure Revert;
    { Properties }
    property Color: TColor read GetColor write SetColor;
    property DisplayText: WideString read GetDisplayText;
    property Enabled: Boolean read GetEnabled write SetEnabled;
    property Empty: Boolean read GetEmpty write SetEmpty;
    property Locked: Boolean read GetLocked write SetLocked;
    property ParentColor: Boolean read GetParentColor write SetParentColor;
    property Text: WideString read GetAsString write SetAsString;
    property Visible: Boolean read GetVisible write SetVisible;
  end;

  INxDropDown = interface
    ['{5840F233-921B-4DDA-9EEB-830D910459E3}']
    { Property Accessors }
    function GetAutoClose: Boolean;
    function GetDroppedDown: Boolean;
    procedure SetDroppedDown(const Value: Boolean);
    procedure DoCloseUp;
    procedure DoSelect;
    { Properties }
    property AutoClose: Boolean read GetAutoClose;
    property DroppedDown: Boolean read GetDroppedDown write SetDroppedDown;
  end;

  INxStyledDropDown = interface
    ['{E5421D49-ADE6-482B-81A0-F739EDDD3FE2}']
    procedure SetStyle(const Value: TNxDropDownStyle);
  end;

  INxOwnerDrawn = interface
    ['{3C7387EA-640C-4DF6-8F9F-1D3EACF033FA}']
    function GetDrawingOptions: TNxDrawingOptions;
    property DrawingOptions: TNxDrawingOptions read GetDrawingOptions;
  end;

  INxStringsControl = interface
    ['{FBB198D8-A097-4AD5-9BDB-CA725C77226B}']
    function GetAutoComplete: Boolean;
    function GetDropDownCount: Integer;
    function GetItemHeight: Integer;
    function GetItemIndex: Integer;
    function GetItems: TStrings;
    function GetItemsAlignment: TAlignment;
    function GetListWidth: Integer;
    procedure SetAutoComplete(const Value: Boolean);
    procedure SetDropDownCount(const Value: Integer);
    procedure SetItemHeight(const Value: Integer);
    procedure SetItemIndex(const Value: Integer);
    procedure SetItems(const Value: TStrings);
    procedure SetItemsAlignment(const Value: TAlignment);
    { Methods }
    function PaintCell(const Index: Integer; CellRect: TRect;
      State: TOwnerDrawState): Boolean;
    procedure TryItemIndex(const Index: Integer; Select: Boolean);
    { Properties }
    property AutoComplete: Boolean read GetAutoComplete write SetAutoComplete;
    property DropDownCount: Integer read GetDropDownCount write SetDropDownCount;
    property ItemHeight: Integer read GetItemHeight write SetItemHeight;
    property ItemIndex: Integer read GetItemIndex write SetItemIndex;
    property Items: TStrings read GetItems write SetItems;
    property ItemsAlignment: TAlignment read GetItemsAlignment write SetItemsAlignment;
    property ListWidth: Integer read GetListWidth;
  end;

  INxControlStyle = interface
    ['{1118D414-1987-4D75-AA41-2B177B0402B3}']
    { Property Accessors }
    function GetAppearanceOptions: TNxAppearanceOptions;
    function GetCanvas: TCanvas;
    function GetColor: TColor;
    function GetControl: TWinControl;
    function GetFont: TFont;
    procedure SetAppearanceOptions(const Value: TNxAppearanceOptions);
    procedure SetCanvas(const Value: TCanvas);
    procedure SetColor(const Value: TColor);
    procedure SetControl(const Value: TWinControl);
    procedure SetFont(const Value: TFont);
    {  }
    procedure DrawFrame(FrameRect: TRect);
    { Paint }
    procedure PaintCheckBox(CheckBoxRect: TRect; CheckBoxState: TCheckBoxState; ButtonState: TNxButtonState);
    procedure PaintDropDownButton(ButtonRect: TRect; State: TNxButtonState);
    procedure PaintProgressBar(BarRect: TRect);
    procedure PaintProgressChunk(ChunkRect: TRect);
    procedure PaintPushButton(ButtonRect: TRect; State: TNxButtonState);
    procedure PaintToolButton(ButtonRect: TRect; State: TNxButtonState);
    procedure PaintTrack(TrackRect: TRect);
    procedure PaintTrackThumb(ThumbRect: TRect; State: TNxButtonState);
    { Properties }
    property AppearanceOptions: TNxAppearanceOptions read GetAppearanceOptions write SetAppearanceOptions;
    property Canvas: TCanvas read GetCanvas write SetCanvas;
    property Color: TColor read GetColor write SetColor;
    property Control: TWinControl read GetControl write SetControl;
    property Font: TFont read GetFont write SetFont;
  end;

  INxView = interface(INxObject)
    ['{D6A8F78E-BBF5-4D8D-A58C-84B6C705F666}']
    { Property Getters }
    function GetCanvas: TCanvas;
    function GetClientRect: TRect;
    { Property Setters }
    procedure SetCanvas(const Value: TCanvas);
    procedure SetClientRect(const Value: TRect);
    { Methods }
    procedure Paint;
    { Properties }
    property Canvas: TCanvas read GetCanvas write SetCanvas;
    property ClientRect: TRect read GetClientRect write SetClientRect;
  end;

  { INxViewOwner }

  INxViewOwner = interface
    ['{1FBB192B-8F43-468D-B949-4AD97FB2BD4C}']
    function GetCanvas: TCanvas;
    function GetHandle: THandle;
    procedure InvalidateRect(const Source: TRect);
    property Canvas: TCanvas read GetCanvas;
    property Handle: THandle read GetHandle;
  end;

  INxViewControl = interface(INxObject)
    ['{85016FD2-28B0-421D-9F36-DA671FC1A0C2}']
    { Property Accessors }
    function GetCanvas: TCanvas;
    function GetClientRect: TRect;
    { Methods }
    procedure FreeNotification(AComponent: TComponent);
    { Properties }
    property Canvas: TCanvas read GetCanvas;
    property ClientRect: TRect read GetClientRect;
  end;

  INxViewComponent = interface
    ['{2BCFE81C-201D-4651-ACBE-7C69993F47B3}']
  end;

  INxRowsViewControl = interface
    ['{1BD1E2D0-F1B5-4E40-A810-ADD6B357E959}']
    function GetFirstVisibleRow: Integer;
    property FirstVisibleRow: Integer read GetFirstVisibleRow;
  end;

  INxInteract = interface
    ['{3029E774-D807-40B1-BAED-52C88FC5E328}']
    { Methods }
    procedure KeyDown(var Key: Word; Shift: TShiftState);
    procedure KeyUp; overload;
    procedure KeyUp(var Key: Word; Shift: TShiftState); overload;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    procedure MouseLeave;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer);
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  end;

  INxObjectView = interface(INxView)
    ['{A9D2227E-1140-4F32-8783-F5A333A094BD}']
    { Property Accessors }
    function GetAsString: WideString;
    function GetControl: TWinControl;
    function GetFont: TFont;
    function GetStyle: INxControlStyle;
    procedure SetAsString(const Value: WideString);
    procedure SetControl(const Value: TWinControl);
    procedure SetFont(const Value: TFont);
    procedure SetStyle(const Value: INxControlStyle);
    { Methods }
    procedure Assign(Source: TObject);
    function CanDispatchKey(var Key: Word): Boolean;
    procedure KeyDown(var Key: Word; Shift: TShiftState);
    procedure KeyUp; overload;
    procedure KeyUp(var Key: Word; Shift: TShiftState); overload;
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    procedure MouseLeave;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer);
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); overload;
    procedure MouseUp; overload;
    { Properties }
    property AsString: WideString read GetAsString write SetAsString;
    property Control: TWinControl read GetControl write SetControl;
    property Font: TFont read GetFont write SetFont;
    property Style: INxControlStyle read GetStyle write SetStyle;
  end;

  { INxCustomDrawable }

  INxCustomDrawable = interface(INxObject)
    ['{4B5AAB8A-FF98-4960-96F3-4C4DE0FF301F}']
    { Property Accessors }
    function GetDrawingOptions: TNxDrawingOptions;
    procedure SetDrawingOptions(const Value: TNxDrawingOptions);
    { Properties }
    property DrawingOptions: TNxDrawingOptions read GetDrawingOptions write SetDrawingOptions;
  end;

  { INxPreviewDrawable }

  TNxPreviewDrawEvent = procedure (Sender: TObject; PreviewRect: TRect) of object;

  INxPreviewDrawable = interface
    ['{7F413D49-FD91-4423-A698-9814C1E78C94}']
    { Property Accessors }
    function GetOnPreviewDraw: TNxPreviewDrawEvent;
    procedure SetOnPreviewDraw(const Value: TNxPreviewDrawEvent);
    { Properties }
    property OnPreviewDraw: TNxPreviewDrawEvent read GetOnPreviewDraw write SetOnPreviewDraw;
  end;

  { INxComponent }

  INxComponent = interface(INxView)
    ['{C2C1766C-A0AE-472D-9C13-03C49FB634E0}']
    { Methods }
    procedure FreeNotification(AComponent: TComponent);
  end;

  { INxProgressBar }

  INxProgressBar = interface
    ['{13D7CB8F-64E6-4C67-9D79-5F3FE2D96A46}']
    { Property Getters }
    function GetAsInteger: Integer;
    function GetBorderColor: TColor;
    function GetMax: Double;
    function GetMin: Double;
    function GetOuterMargin: Integer;
    function GetProgressColor: TColor;
    function GetProgressHeight: Integer;
    function GetProgressMargin: Integer;
    function GetProgressStyle: TNxProgressBarStyle;
    function GetRoundCorners: Boolean;
    function GetTransparent: Boolean;
    { Properties }
    property AsInteger: Integer read GetAsInteger;
    property BorderColor: TColor read GetBorderColor;
    property Max: Double read GetMax;
    property Min: Double read GetMin;
    property OuterMargin: Integer read GetOuterMargin;
    property ProgressColor: TColor read GetProgressColor;
    property ProgressHeight: Integer read GetProgressHeight;
    property ProgressMargin: Integer read GetProgressMargin;
    property ProgressStyle: TNxProgressBarStyle read GetProgressStyle;
    property RoundCorners: Boolean read GetRoundCorners;
    property Transparent: Boolean read GetTransparent;
  end;

  { INxVersionControl }

  INxVersionControl = interface
    ['{6652A2C5-4A70-484B-BFA1-D33555068C4F}']
    function GetControlName: string;
    function GetVersion: string;
    { Properties }
    property ControlName: string read GetControlName;
    property Version: string read GetVersion;
  end;

  { TNxObjectView }

  TNxObjectView = class(TInterfacedObject, INxObjectView)
  private
    { Fields }
    FCanvas: TCanvas;
    FClientRect: TRect;
    FControl: TWinControl;
    FFont: TFont;
    FStyle: INxControlStyle;
  protected
    { Property Getters }
    function GetCanvas: TCanvas;
    function GetClientRect: TRect;
    function GetControl: TWinControl;
    function GetFont: TFont;
    function GetStyle: INxControlStyle;
    { Property Setters }
    procedure SetCanvas(const Value: TCanvas);
    procedure SetClientRect(const Value: TRect);
    procedure SetControl(const Value: TWinControl);
    procedure SetFont(const Value: TFont);
    procedure SetStyle(const Value: INxControlStyle);
  protected
    function ToObject: TObject;
    { Virtual Methods }
    function GetAsString: WideString; virtual;
    procedure InvalidateRect(InvalidationRect: TRect);
    procedure SetAsString(const Value: WideString); virtual;
  public
    procedure Assign(Source: TObject); virtual;
    function CanDispatchKey(var Key: Word): Boolean; virtual;
    destructor Destroy; override;
    { Keyboard Methods }
    procedure KeyDown(var Key: Word; Shift: TShiftState); virtual;
    procedure KeyUp; overload; virtual;
    procedure KeyUp(var Key: Word; Shift: TShiftState); overload; virtual;
    { Mouse Methods }
    procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); virtual;
    procedure MouseLeave; virtual;
    procedure MouseMove(Shift: TShiftState; X, Y: Integer); virtual;
    procedure MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); overload; virtual;
    procedure MouseUp; overload; virtual;
    { Painting Methods }
    procedure Paint; virtual;
    { Properties }
    property Canvas: TCanvas read GetCanvas write SetCanvas;
    property ClientRect: TRect read GetClientRect write SetClientRect;
    property Control: TWinControl read GetControl write SetControl;
    property Font: TFont read GetFont write SetFont;
//    property Owner: INxViewComponent read GetOwner write SetOwner;
    property Style: INxControlStyle read GetStyle write SetStyle;
  end;

  { INxNode }

  INxNodeList = interface;

  INxNode = interface(INxBase)
    ['{554EB801-51D1-47DA-9D90-953F21F07386}']
    { Property Accessors }
    function GetAbsoluteIndex: Integer;
    function GetChildCount: Integer;
    function GetChildNode(Index: Integer): INxNode;
    function GetChildNodes: INxNodeList;
    function GetCount: Integer;
    function GetHasChildren: Boolean;
    function GetHidden: Boolean;
    function GetIndex: Integer;
    function GetLevel: Integer;
    function GetParentNode: INxNode;
    procedure SetIndex(const Value: Integer);
    procedure SetParentNode(const Value: INxNode);
    { Event Handlers }
    procedure DoChildAdd(const Node: INxNode);
    { Methods }
    procedure ClearChildren;
    function IndexOf(const Node: INxNode): Integer;
    function IsTopLevel: Boolean;
    function NextSibling: INxNode;
    procedure Remove;
    procedure RemoveChild;
    { Properties }
    property AbsoluteIndex: Integer read GetAbsoluteIndex;
    property ChildCount: Integer read GetChildCount;
    property ChildNode[Index: Integer]: INxNode read GetChildNode;
    property ChildNodes: INxNodeList read GetChildNodes;
    property Count: Integer read GetCount;
    property HasChildren: Boolean read GetHasChildren;
    property Index: Integer read GetIndex write SetIndex;
    property Level: Integer read GetLevel;
    property ParentNode: INxNode read GetParentNode write SetParentNode;
  end;

  { INxNodeList }

  INxNodeOwnerDepr = interface
    ['{03D8CC24-6134-407E-B63B-5482CBD50CDA}']
  end;

  INxNodeOwner = interface
    ['{F0B90A78-C908-4A18-BD51-A7156E735852}']
    procedure DeleteNode(ANode: INxNode);
    procedure IncNodeCount(Delta: Integer);
    procedure InsertNode(ANode: INxNode; Position: Integer);
  end;

  INxNodeList = interface
    ['{F48EF0D6-2F30-4630-A3F3-94DDCC35E044}']
    { Property Accessors }
    function GetCount: Integer;
    function GetNode(const IndexOrName: Variant): INxNode;
    function GetOwnerNode: INxNode;
    { Methods }
    function Add(const Node: INxNode): Integer;
    procedure Clear;
    function HasChild: Boolean;
    function IndexOf(const Node: INxNode): Integer;
    function Remove(const Node: INxNode): Integer;
    { Properties }
    property Count: Integer read GetCount;
    property Node[const IndexOrName: Variant]: INxNode read GetNode; default;
    property OwnerNode: INxNode read GetOwnerNode;
  end;

  { INxWrapable }

  INxWrapable = interface
    ['{62C62839-D8D1-4FE0-9970-398A914D2068}']
    function GetWrapKind: TNxWrapKind;
    property WrapKind: TNxWrapKind read GetWrapKind;
  end;

  { INxTextContent }

  INxTextContent = interface
    ['{6D1F6228-C3C9-4165-B82B-393E989C4068}']
    function GetShowTextFitHint: Boolean;
    procedure SetShowTextFitHint(const Value: Boolean);
    property ShowTextFitHint: Boolean read GetShowTextFitHint write SetShowTextFitHint;
  end;

  INxColorControl = interface
    ['{1DFDAFF9-A471-432D-BCA5-E38D5FAD9E59}']
    function GetColorKind: TNxColorKind;
    property ColorKind: TNxColorKind read GetColorKind;
  end;

  { IWeakReference }

  IWeakReference = interface
    ['{56771FAE-BF89-4BCB-8283-8C617B2EE119}']
    function Disconnected: Boolean; stdcall;
    function GetIntf: IInterface; stdcall;
    procedure Disconnect; stdcall;
  end;

  IWeakly = interface
    ['{FD215302-7F30-4BC2-A399-C6EF6B99E96D}']
    function WeakReference: IWeakReference; stdcall;
  end;

  TWeakReference = class(TInterfacedObject, IWeakReference)
  private
    FOwner: TInterfacedObject;
    function Disconnected: Boolean; stdcall;
    function GetIntf: IInterface; stdcall;
  public
    procedure Disconnect; stdcall;
    constructor Create(AOwner: TInterfacedObject);
  end;

  { INxPropertyChangeListener }

  INxPropertyListener = interface
    ['{468E64B4-ABA5-4842-B3D0-E3DCAB8E7D91}']
    procedure PropertyChanged(Sender: TObject);
  end;

  INxXMLSeriable = interface
    ['{7541E393-3DED-40CE-A5ED-BEC042E46288}']
    procedure ReadFromXLM(Control: TPersistent);
    procedure WriteToXLM(Control: TPersistent);
  end;

  INxTogglable = interface
    ['{6F614ACC-85DA-4D0E-94D2-1981BAFA8343}']
    function GetClientRectToogle: Boolean;
    function GetToggleButtonStyle: TNxToggleButtonStyle;
    procedure SetToggleButtonStyle(const Value: TNxToggleButtonStyle);
    property ClientRectToggle: Boolean read GetClientRectToogle;
    property ToggleButtonStyle: TNxToggleButtonStyle read GetToggleButtonStyle write SetToggleButtonStyle;
  end;

  { INxTreeProperties }

  INxTreeProperties = interface(INxTogglable)
    ['{A694F8F0-F5E1-401F-9E1D-9F42D5E5D955}']
    function GetImages: TImageList;
    function GetLinesColor: TColor;
    function GetShowLines: Boolean;
    procedure SetImages(const Value: TImageList);
    procedure SetLinesColor(const Value: TColor);
    procedure SetShowLines(const Value: Boolean);
    property Images: TImageList read GetImages write SetImages;
    property ShowLines: Boolean read GetShowLines write SetShowLines;
    property LinesColor: TColor read GetLinesColor write SetLinesColor;
  end;

  { INxTreeNodeView }

  INxTreeNodeView = interface
    ['{D04F3563-4A45-491A-A1AD-4C27F0462016}']
    function GetIsFirst: Boolean;
    function GetIsLast: Boolean;
    procedure SetIsFirst(const Value: Boolean);
    procedure SetIsLast(const Value: Boolean);
    property IsFirst: Boolean read GetIsFirst write SetIsFirst;
    property IsLast: Boolean read GetIsLast write SetIsLast;
  end;

  { INxValidatable }

  INxValidatable = interface
    ['{9664A6C9-5351-4F01-9B33-F5FFC2F2F506}']
  end;

  { INxValidator }

  INxValidator = interface
    ['{E8280A04-1A31-4721-83E9-0502DAFB3FB5}']
    function Validate(const Validatable: INxValidatable): TNxValidationResult;
    function GetErrorCount: Integer;
    property ErrorCount: Integer read GetErrorCount;
  end;

implementation

uses
  { Standard }
  SysUtils;

{ TNxObjectView }

procedure TNxObjectView.Assign(Source: TObject);
begin
  inherited;
  if Source is TNxObjectView then
  begin
    Canvas := TNxObjectView(Source).Canvas;
    ClientRect := TNxObjectView(Source).ClientRect;
    Control := TNxObjectView(Source).Control;
    Style := TNxObjectView(Source).Style;
  end;
end;

function TNxObjectView.CanDispatchKey(var Key: Word): Boolean;
begin
  Result := True;
end;

destructor TNxObjectView.Destroy;
begin
  FStyle := nil;
  FreeAndNil(FFont);
  inherited;
end;

function TNxObjectView.GetAsString: WideString;
begin

end;

function TNxObjectView.GetCanvas: TCanvas;
begin
  Result := FCanvas;
end;

function TNxObjectView.GetClientRect: TRect;
begin
  Result := FClientRect;
end;

function TNxObjectView.GetControl: TWinControl;
begin
  Result := FControl;
end;

function TNxObjectView.GetFont: TFont;
begin
  Result := FFont;
end;

function TNxObjectView.GetStyle: INxControlStyle;
begin
  Result := FStyle;
end;

procedure TNxObjectView.InvalidateRect(InvalidationRect: TRect);
begin
{$IFDEF UNSAFE}
  Windows.InvalidateRect(Control.Handle, InvalidationRect, False);
{$ELSE}
  Windows.InvalidateRect(Control.Handle, @InvalidationRect, False);
{$ENDIF}
end;

procedure TNxObjectView.KeyDown(var Key: Word; Shift: TShiftState);
begin

end;

procedure TNxObjectView.KeyUp;
begin

end;

procedure TNxObjectView.KeyUp(var Key: Word; Shift: TShiftState);
begin

end;

procedure TNxObjectView.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
  Y: Integer);
begin

end;

procedure TNxObjectView.MouseLeave;
begin

end;

procedure TNxObjectView.MouseMove(Shift: TShiftState; X, Y: Integer);
begin

end;

procedure TNxObjectView.MouseUp;
begin

end;

procedure TNxObjectView.MouseUp(Button: TMouseButton; Shift: TShiftState; X,
  Y: Integer);
begin

end;

procedure TNxObjectView.Paint;
begin

end;

procedure TNxObjectView.SetAsString(const Value: WideString);
begin

end;

procedure TNxObjectView.SetCanvas(const Value: TCanvas);
begin
  FCanvas := Value;
end;

procedure TNxObjectView.SetClientRect(const Value: TRect);
begin
  FClientRect := Value;
end;

procedure TNxObjectView.SetControl(const Value: TWinControl);
begin
  FControl := Value;
end;

procedure TNxObjectView.SetFont(const Value: TFont);
begin
  if FFont = nil then FFont := TFont.Create;
  FFont.Assign(Value);
end;

procedure TNxObjectView.SetStyle(const Value: INxControlStyle);
begin
  FStyle := Value;
end;

function TNxObjectView.ToObject: TObject;
begin
  Result := Self;
end;

{ TNxEntityDesignResponder }

procedure TNxEntityDesignResponder.DesignNotification(
  AResponder: INxDesignNotificationRecipient; Operation: TNxDesignOperation);
begin

end;

function TNxEntityDesignResponder.GetIndex: Integer;
begin
  Result := FIndex;
end;

procedure TNxEntityDesignResponder.SetIndex(const Value: Integer);
begin
  FIndex := Value;
end;

{ TWeakReference }

constructor TWeakReference.Create(AOwner: TInterfacedObject);
begin
  FOwner := AOwner;
  inherited Create;
end;

procedure TWeakReference.Disconnect;
begin
  FOwner := nil;
end;

function TWeakReference.Disconnected: Boolean;
begin
  Result := not Assigned(FOwner);
end;

function TWeakReference.GetIntf: IInterface;
begin
  Result := FOwner;
end;

end.
