unit Aurelius.Plugin.Options;

interface

uses
  Generics.Collections;

type
  ITableConfig = interface;

  IASPluginOptions = interface
    ['{B443996F-57C2-4B4B-ACDC-E0EAAB8CFE8A}']
    function GetAssociationNameCamelCase: boolean;
    function GetAssociationNameFormat: WideString;
    function GetAssociationNameRemoveUnderline: boolean;
    function GetAssociationNameSource: integer;
    function GetCheckSequencesMode: integer;
    function GetDefaultAncestorClass: WideString;
    function GetDefaultAssociationCascadeDefinition: integer;
    function GetDefaultAssociationFetchMode: integer;
    function GetDefaultDynPropContainer: WideString;
    function GetDefaultManyValuedFetchMode: integer;
    function GetDefaultOneToOneMapping: integer;
    function GetDictionaryName: WideString;
    function GetFieldNameCamelCase: boolean;
    function GetFieldNameFormat: WideString;
    function GetFieldNameRemoveUnderline: boolean;
    function GetManyValuedNameCamelCase: boolean;
    function GetManyValuedNameFormat: WideString;
    function GetManyValuedNameRemoveUnderline: boolean;
    function GetManyValuedNameSingularize: boolean;
    function GetManyValuedNameSource: integer;
    function GetNoNullable: boolean;
    function GetOmitDictionary: boolean;
    function GetRegisterEntities: boolean;
    function GetTableNameCamelCase: boolean;
    function GetTableNameFormat: WideString;
    function GetTableNameRemoveUnderline: boolean;
    function GetTableNameSingularize: boolean;
    procedure SetAssociationNameCamelCase(const Value: boolean);
    procedure SetAssociationNameFormat(const Value: WideString);
    procedure SetAssociationNameRemoveUnderline(const Value: boolean);
    procedure SetAssociationNameSource(const Value: integer);
    procedure SetCheckSequencesMode(const Value: integer);
    procedure SetDefaultAncestorClass(const Value: WideString);
    procedure SetDefaultAssociationCascadeDefinition(const Value: integer);
    procedure SetDefaultAssociationFetchMode(const Value: integer);
    procedure SetDefaultDynPropContainer(const Value: WideString);
    procedure SetDefaultManyValuedFetchMode(const Value: integer);
    procedure SetDefaultOneToOneMapping(const Value: integer);
    procedure SetDictionaryName(const Value: WideString);
    procedure SetFieldNameCamelCase(const Value: boolean);
    procedure SetFieldNameFormat(const Value: WideString);
    procedure SetFieldNameRemoveUnderline(const Value: boolean);
    procedure SetManyValuedNameCamelCase(const Value: boolean);
    procedure SetManyValuedNameFormat(const Value: WideString);
    procedure SetManyValuedNameRemoveUnderline(const Value: boolean);
    procedure SetManyValuedNameSingularize(const Value: boolean);
    procedure SetManyValuedNameSource(const Value: integer);
    procedure SetNoNullable(const Value: boolean);
    procedure SetOmitDictionary(const Value: boolean);
    procedure SetRegisterEntities(const Value: boolean);
    procedure SetTableNameCamelCase(const Value: boolean);
    procedure SetTableNameFormat(const Value: WideString);
    procedure SetTableNameRemoveUnderline(const Value: boolean);
    procedure SetTableNameSingularize(const Value: boolean);

    function AddTableConfig(AName: WideString): ITableConfig;
    function FindTableConfigByName(AName: WideString): ITableConfig;
    function GetTableConfigByIndex(Index: Integer): ITableConfig;
    function TableConfigCount: integer;
    procedure ClearTableConfig;
    procedure CheckAllTableConfig(AValue: Boolean);

    property TableNameFormat: WideString read GetTableNameFormat write SetTableNameFormat;
    property TableNameSingularize: boolean read GetTableNameSingularize write SetTableNameSingularize;
    property TableNameCamelCase: boolean read GetTableNameCamelCase write SetTableNameCamelCase;
    property TableNameRemoveUnderline: boolean read GetTableNameRemoveUnderline write SetTableNameRemoveUnderline;
    property FieldNameFormat: WideString read GetFieldNameFormat write SetFieldNameFormat;
    property FieldNameCamelCase: boolean read GetFieldNameCamelCase write SetFieldNameCamelCase;
    property FieldNameRemoveUnderline: boolean read GetFieldNameRemoveUnderline write SetFieldNameRemoveUnderline;
    property AssociationNameSource: integer read GetAssociationNameSource write SetAssociationNameSource;
    property AssociationNameFormat: WideString read GetAssociationNameFormat write SetAssociationNameFormat;
    property AssociationNameCamelCase: boolean read GetAssociationNameCamelCase write SetAssociationNameCamelCase;
    property AssociationNameRemoveUnderline: boolean read GetAssociationNameRemoveUnderline write SetAssociationNameRemoveUnderline;
    property ManyValuedNameSource: integer read GetManyValuedNameSource write SetManyValuedNameSource;
    property ManyValuedNameFormat: WideString read GetManyValuedNameFormat write SetManyValuedNameFormat;
    property ManyValuedNameSingularize: boolean read GetManyValuedNameSingularize write SetManyValuedNameSingularize;
    property ManyValuedNameCamelCase: boolean read GetManyValuedNameCamelCase write SetManyValuedNameCamelCase;
    property ManyValuedNameRemoveUnderline: boolean read GetManyValuedNameRemoveUnderline write SetManyValuedNameRemoveUnderline;
    property OmitDictionary: boolean read GetOmitDictionary write SetOmitDictionary;
    property DictionaryName: WideString read GetDictionaryName write SetDictionaryName;
    property RegisterEntities: boolean read GetRegisterEntities write SetRegisterEntities;
    property NoNullable: boolean read GetNoNullable write SetNoNullable;
    property DefaultAssociationFetchMode: integer read GetDefaultAssociationFetchMode write SetDefaultAssociationFetchMode;
    property DefaultManyValuedFetchMode: integer read GetDefaultManyValuedFetchMode write SetDefaultManyValuedFetchMode;
    property DefaultAssociationCascadeDefinition: integer read GetDefaultAssociationCascadeDefinition write SetDefaultAssociationCascadeDefinition;
    property DefaultOneToOneMapping: integer read GetDefaultOneToOneMapping write SetDefaultOneToOneMapping;
    property DefaultAncestorClass: WideString read GetDefaultAncestorClass write SetDefaultAncestorClass;
    property DefaultDynPropContainer: WideString read GetDefaultDynPropContainer write SetDefaultDynPropContainer;
    property CheckSequencesMode: integer read GetCheckSequencesMode write SetCheckSequencesMode;
  end;

  TASPluginOptions = class( TInterfacedObject, IASPluginOptions )
  private
    FAssociationNameSource: integer;
    FCheckSequencesMode: integer;
    FFieldNameFormat: WideString;
    FRegisterEntities: boolean;
    FTableNameRemoveUnderline: boolean;
    FTableNameCamelCase: boolean;
    FDefaultAncestorClass: WideString;
    FDefaultAssociationFetchMode: integer;
    FManyValuedNameRemoveUnderline: boolean;
    FManyValuedNameCamelCase: boolean;
    FAssociationNameFormat: WideString;
    FDefaultOneToOneMapping: integer;
    FTableNameSingularize: boolean;
    FManyValuedNameSource: integer;
    FDictionaryName: WideString;
    FFieldNameRemoveUnderline: boolean;
    FFieldNameCamelCase: boolean;
    FDefaultAssociationCascadeDefinition: integer;
    FManyValuedNameSingularize: boolean;
    FTableNameFormat: WideString;
    FNoNullable: boolean;
    FOmitDictionary: boolean;
    FDefaultManyValuedFetchMode: integer;
    FManyValuedNameFormat: WideString;
    FAssociationNameRemoveUnderline: boolean;
    FAssociationNameCamelCase: boolean;
    FDefaultDynPropContainer: WideString;
    FTables: TDictionary<string, ITableConfig>;
    function GetAssociationNameCamelCase: boolean;
    function GetAssociationNameFormat: WideString;
    function GetAssociationNameRemoveUnderline: boolean;
    function GetAssociationNameSource: integer;
    function GetCheckSequencesMode: integer;
    function GetDefaultAncestorClass: WideString;
    function GetDefaultAssociationCascadeDefinition: integer;
    function GetDefaultAssociationFetchMode: integer;
    function GetDefaultDynPropContainer: WideString;
    function GetDefaultManyValuedFetchMode: integer;
    function GetDefaultOneToOneMapping: integer;
    function GetDictionaryName: WideString;
    function GetFieldNameCamelCase: boolean;
    function GetFieldNameFormat: WideString;
    function GetFieldNameRemoveUnderline: boolean;
    function GetManyValuedNameCamelCase: boolean;
    function GetManyValuedNameFormat: WideString;
    function GetManyValuedNameRemoveUnderline: boolean;
    function GetManyValuedNameSingularize: boolean;
    function GetManyValuedNameSource: integer;
    function GetNoNullable: boolean;
    function GetOmitDictionary: boolean;
    function GetRegisterEntities: boolean;
    function GetTableNameCamelCase: boolean;
    function GetTableNameFormat: WideString;
    function GetTableNameRemoveUnderline: boolean;
    function GetTableNameSingularize: boolean;
    procedure SetAssociationNameCamelCase(const Value: boolean);
    procedure SetAssociationNameFormat(const Value: WideString);
    procedure SetAssociationNameRemoveUnderline(const Value: boolean);
    procedure SetAssociationNameSource(const Value: integer);
    procedure SetCheckSequencesMode(const Value: integer);
    procedure SetDefaultAncestorClass(const Value: WideString);
    procedure SetDefaultAssociationCascadeDefinition(const Value: integer);
    procedure SetDefaultAssociationFetchMode(const Value: integer);
    procedure SetDefaultDynPropContainer(const Value: WideString);
    procedure SetDefaultManyValuedFetchMode(const Value: integer);
    procedure SetDefaultOneToOneMapping(const Value: integer);
    procedure SetDictionaryName(const Value: WideString);
    procedure SetFieldNameCamelCase(const Value: boolean);
    procedure SetFieldNameFormat(const Value: WideString);
    procedure SetFieldNameRemoveUnderline(const Value: boolean);
    procedure SetManyValuedNameCamelCase(const Value: boolean);
    procedure SetManyValuedNameFormat(const Value: WideString);
    procedure SetManyValuedNameRemoveUnderline(const Value: boolean);
    procedure SetManyValuedNameSingularize(const Value: boolean);
    procedure SetManyValuedNameSource(const Value: integer);
    procedure SetNoNullable(const Value: boolean);
    procedure SetOmitDictionary(const Value: boolean);
    procedure SetRegisterEntities(const Value: boolean);
    procedure SetTableNameCamelCase(const Value: boolean);
    procedure SetTableNameFormat(const Value: WideString);
    procedure SetTableNameRemoveUnderline(const Value: boolean);
    procedure SetTableNameSingularize(const Value: boolean);
  public
    class procedure SetDefaultValues(Options: IASPluginOptions);
    constructor Create;
    destructor Destroy; override;

    property TableNameFormat: WideString read GetTableNameFormat write SetTableNameFormat;
    property TableNameSingularize: boolean read GetTableNameSingularize write SetTableNameSingularize;
    property TableNameCamelCase: boolean read GetTableNameCamelCase write SetTableNameCamelCase;
    property TableNameRemoveUnderline: boolean read GetTableNameRemoveUnderline write SetTableNameRemoveUnderline;

    property FieldNameFormat: WideString read GetFieldNameFormat write SetFieldNameFormat;
    property FieldNameCamelCase: boolean read GetFieldNameCamelCase write SetFieldNameCamelCase;
    property FieldNameRemoveUnderline: boolean read GetFieldNameRemoveUnderline write SetFieldNameRemoveUnderline;

    property AssociationNameSource: integer read GetAssociationNameSource write SetAssociationNameSource;
    property AssociationNameFormat: WideString read GetAssociationNameFormat write SetAssociationNameFormat;
    property AssociationNameCamelCase: boolean read GetAssociationNameCamelCase write SetAssociationNameCamelCase;
    property AssociationNameRemoveUnderline: boolean read GetAssociationNameRemoveUnderline write SetAssociationNameRemoveUnderline;

    property ManyValuedNameSource: integer read GetManyValuedNameSource write SetManyValuedNameSource;
    property ManyValuedNameFormat: WideString read GetManyValuedNameFormat write SetManyValuedNameFormat;
    property ManyValuedNameSingularize: boolean read GetManyValuedNameSingularize write SetManyValuedNameSingularize;
    property ManyValuedNameCamelCase: boolean read GetManyValuedNameCamelCase write SetManyValuedNameCamelCase;
    property ManyValuedNameRemoveUnderline: boolean read GetManyValuedNameRemoveUnderline write SetManyValuedNameRemoveUnderline;

    property OmitDictionary: boolean read GetOmitDictionary write SetOmitDictionary;
    property DictionaryName: WideString read GetDictionaryName write SetDictionaryName;
    property RegisterEntities: boolean read GetRegisterEntities write SetRegisterEntities;
    property NoNullable: boolean read GetNoNullable write SetNoNullable;

    property DefaultAssociationFetchMode: integer read GetDefaultAssociationFetchMode write SetDefaultAssociationFetchMode;
    property DefaultManyValuedFetchMode: integer read GetDefaultManyValuedFetchMode write SetDefaultManyValuedFetchMode;
    property DefaultAssociationCascadeDefinition: integer read GetDefaultAssociationCascadeDefinition write SetDefaultAssociationCascadeDefinition;
    property DefaultOneToOneMapping: integer read GetDefaultOneToOneMapping write SetDefaultOneToOneMapping;
    property DefaultAncestorClass: WideString read GetDefaultAncestorClass write SetDefaultAncestorClass;
    property DefaultDynPropContainer: WideString read GetDefaultDynPropContainer write SetDefaultDynPropContainer;
    property CheckSequencesMode: integer read GetCheckSequencesMode write SetCheckSequencesMode;

    function AddTableConfig(AName: WideString): ITableConfig;
    function FindTableConfigByName(AName: WideString): ITableConfig;
    function GetTableConfigByIndex(Index: Integer): ITableConfig;
    function TableConfigCount: integer;
    procedure ClearTableConfig;
    procedure CheckAllTableConfig(AValue: Boolean);
  end;

  ITableConfig = interface
    ['{992363CC-E88B-4262-B8E4-30927DEBAD21}']
    function GetChecked: Boolean;
    function GetName: WideString;
    procedure SetChecked(const Value: Boolean);
    property Checked: boolean read GetChecked write SetChecked;
    property Name: WideString read GetName;
  end;

  TTableConfig = class(TInterfacedObject, ITableConfig)
  strict private
    FChecked: Boolean;
    FName: WideString;
    function GetChecked: Boolean;
    function GetName: WideString;
    procedure SetChecked(const Value: Boolean);
  public
    constructor Create(AName: WideString);
  end;

implementation

uses
  Aurelius.Plugin.Types;

{ TASPluginOptions }

function TASPluginOptions.AddTableConfig(AName: WideString): ITableConfig;
begin
  if FTables.ContainsKey(AName) then
    raise EAureliusPluginException.CreateFmt('Already exists table config. Name: %s', [AName]);
  FTables.Add(AName, TTableConfig.Create(AName));
  Result := FTables[AName];
end;

procedure TASPluginOptions.CheckAllTableConfig(AValue: Boolean);
var
  I: integer;
begin
  for I := 0 to FTables.Count - 1 do
    FTables.ToArray[I].Value.Checked := AValue;
end;

procedure TASPluginOptions.ClearTableConfig;
begin
  FTables.Clear;
end;

constructor TASPluginOptions.Create;
begin
  FTables := TDictionary<string, ITableConfig>.Create;
  SetDefaultValues(Self);
end;

destructor TASPluginOptions.Destroy;
begin
  FTables.Free;
  inherited;
end;

function TASPluginOptions.GetAssociationNameCamelCase: boolean;
begin
  Result := FAssociationNameCamelCase;
end;

function TASPluginOptions.GetAssociationNameFormat: WideString;
begin
  Result := FAssociationNameFormat;
end;

function TASPluginOptions.GetAssociationNameRemoveUnderline: boolean;
begin
  Result := FAssociationNameRemoveUnderline;
end;

function TASPluginOptions.GetAssociationNameSource: integer;
begin
  Result := FAssociationNameSource;
end;

function TASPluginOptions.GetCheckSequencesMode: integer;
begin
  Result := FCheckSequencesMode;
end;

function TASPluginOptions.GetDefaultAncestorClass: WideString;
begin
  Result := FDefaultAncestorClass;
end;

function TASPluginOptions.GetDefaultAssociationCascadeDefinition: integer;
begin
  Result := FDefaultAssociationCascadeDefinition;
end;

function TASPluginOptions.GetDefaultAssociationFetchMode: integer;
begin
  Result := FDefaultAssociationFetchMode;
end;

function TASPluginOptions.GetDefaultDynPropContainer: WideString;
begin
  Result := FDefaultDynPropContainer;
end;

function TASPluginOptions.GetDefaultManyValuedFetchMode: integer;
begin
  Result := FDefaultManyValuedFetchMode;
end;

function TASPluginOptions.GetDefaultOneToOneMapping: integer;
begin
  Result := FDefaultOneToOneMapping;
end;

function TASPluginOptions.GetDictionaryName: WideString;
begin
  Result := FDictionaryName;
end;

function TASPluginOptions.GetFieldNameCamelCase: boolean;
begin
  Result := FFieldNameCamelCase;
end;

function TASPluginOptions.GetFieldNameFormat: WideString;
begin
  Result := FFieldNameFormat;
end;

function TASPluginOptions.GetFieldNameRemoveUnderline: boolean;
begin
  Result := FFieldNameRemoveUnderline;
end;

function TASPluginOptions.GetManyValuedNameCamelCase: boolean;
begin
  Result := FManyValuedNameCamelCase;
end;

function TASPluginOptions.GetManyValuedNameFormat: WideString;
begin
  Result := FManyValuedNameFormat;
end;

function TASPluginOptions.GetManyValuedNameRemoveUnderline: boolean;
begin
  Result := FManyValuedNameRemoveUnderline;
end;

function TASPluginOptions.GetManyValuedNameSingularize: boolean;
begin
  Result := FManyValuedNameSingularize;
end;

function TASPluginOptions.GetManyValuedNameSource: integer;
begin
  Result := FManyValuedNameSource;
end;

function TASPluginOptions.GetNoNullable: boolean;
begin
  Result := FNoNullable;
end;

function TASPluginOptions.GetOmitDictionary: boolean;
begin
  Result := FOmitDictionary;
end;

function TASPluginOptions.GetRegisterEntities: boolean;
begin
  Result := FRegisterEntities;
end;

function TASPluginOptions.FindTableConfigByName(
  AName: WideString): ITableConfig;
begin
  Result := nil;
  if FTables.ContainsKey(AName) then
    Result := FTables[AName];
end;

function TASPluginOptions.GetTableConfigByIndex(Index: Integer): ITableConfig;
begin
  Result := FTables.ToArray[Index].Value;
end;

function TASPluginOptions.GetTableNameCamelCase: boolean;
begin
  Result := FTableNameCamelCase;
end;

function TASPluginOptions.GetTableNameFormat: WideString;
begin
  Result := FTableNameFormat;
end;

function TASPluginOptions.GetTableNameRemoveUnderline: boolean;
begin
  Result := FTableNameRemoveUnderline;
end;

function TASPluginOptions.GetTableNameSingularize: boolean;
begin
  Result := FTableNameSingularize;
end;

procedure TASPluginOptions.SetAssociationNameCamelCase(const Value: boolean);
begin
  FAssociationNameCamelCase := Value;
end;

procedure TASPluginOptions.SetAssociationNameFormat(const Value: WideString);
begin
  FAssociationNameFormat := Value;
end;

procedure TASPluginOptions.SetAssociationNameRemoveUnderline(
  const Value: boolean);
begin
  FAssociationNameRemoveUnderline := Value;
end;

procedure TASPluginOptions.SetAssociationNameSource(const Value: integer);
begin
  FAssociationNameSource := Value;
end;

procedure TASPluginOptions.SetCheckSequencesMode(const Value: integer);
begin
  FCheckSequencesMode := Value;
end;

procedure TASPluginOptions.SetDefaultAncestorClass(const Value: WideString);
begin
  FDefaultAncestorClass := Value;
end;

procedure TASPluginOptions.SetDefaultAssociationCascadeDefinition(
  const Value: integer);
begin
  FDefaultAssociationCascadeDefinition := Value;
end;

procedure TASPluginOptions.SetDefaultAssociationFetchMode(const Value: integer);
begin
  FDefaultAssociationFetchMode := Value;
end;

class procedure TASPluginOptions.SetDefaultValues(
  Options: IASPluginOptions);
begin
  Options.TableNameFormat := 'T%s';
  Options.TableNameSingularize := False;
  Options.TableNameCamelCase := False;
  Options.TableNameRemoveUnderline := False;
  Options.FieldNameFormat := '%s';
  Options.FieldNameCamelCase := False;
  Options.FieldNameRemoveUnderline := False;
  Options.AssociationNameSource := 3; //asChildFieldName
  Options.AssociationNameFormat := '%s';
  Options.AssociationNameCamelCase := False;
  Options.AssociationNameRemoveUnderline := False;
  Options.ManyValuedNameSource := 1; //asChildTableName
  Options.ManyValuedNameFormat := '%sList';
  Options.ManyValuedNameSingularize := False;
  Options.ManyValuedNameCamelCase := False;
  Options.ManyValuedNameRemoveUnderline := False;
  Options.OmitDictionary := False;
  Options.DictionaryName := 'Dic';
  Options.RegisterEntities := True;
  Options.NoNullable := False;
  Options.DefaultAssociationFetchMode := 0; //fmLazy
  Options.DefaultManyValuedFetchMode := 0; //fmLazy
  Options.DefaultAssociationCascadeDefinition := 1; //cdAllButRemove
  Options.DefaultOneToOneMapping := 0; //omAssociation
  Options.DefaultAncestorClass := '';
  Options.DefaultDynPropContainer := '';
  Options.CheckSequencesMode := 0; //csAuto (If supported by database)
end;

procedure TASPluginOptions.SetDefaultDynPropContainer(const Value: WideString);
begin
  FDefaultDynPropContainer := Value;
end;

procedure TASPluginOptions.SetDefaultManyValuedFetchMode(const Value: integer);
begin
  FDefaultManyValuedFetchMode := Value;
end;

procedure TASPluginOptions.SetDefaultOneToOneMapping(const Value: integer);
begin
  FDefaultOneToOneMapping := Value;
end;

procedure TASPluginOptions.SetDictionaryName(const Value: WideString);
begin
  FDictionaryName := Value;
end;

procedure TASPluginOptions.SetFieldNameCamelCase(const Value: boolean);
begin
  FFieldNameCamelCase := Value;
end;

procedure TASPluginOptions.SetFieldNameFormat(const Value: WideString);
begin
  FFieldNameFormat := Value;
end;

procedure TASPluginOptions.SetFieldNameRemoveUnderline(const Value: boolean);
begin
  FFieldNameRemoveUnderline := Value;
end;

procedure TASPluginOptions.SetManyValuedNameCamelCase(const Value: boolean);
begin
  FManyValuedNameCamelCase := Value;
end;

procedure TASPluginOptions.SetManyValuedNameFormat(const Value: WideString);
begin
  FManyValuedNameFormat := Value;
end;

procedure TASPluginOptions.SetManyValuedNameRemoveUnderline(
  const Value: boolean);
begin
  FManyValuedNameRemoveUnderline := Value;
end;

procedure TASPluginOptions.SetManyValuedNameSingularize(const Value: boolean);
begin
  FManyValuedNameSingularize := Value;
end;

procedure TASPluginOptions.SetManyValuedNameSource(const Value: integer);
begin
  FManyValuedNameSource := Value;
end;

procedure TASPluginOptions.SetNoNullable(const Value: boolean);
begin
  FNoNullable := Value;
end;

procedure TASPluginOptions.SetOmitDictionary(const Value: boolean);
begin
  FOmitDictionary := Value;
end;

procedure TASPluginOptions.SetRegisterEntities(const Value: boolean);
begin
  FRegisterEntities := Value;
end;

procedure TASPluginOptions.SetTableNameCamelCase(const Value: boolean);
begin
  FTableNameCamelCase := Value;
end;

procedure TASPluginOptions.SetTableNameFormat(const Value: WideString);
begin
  FTableNameFormat := Value;
end;

procedure TASPluginOptions.SetTableNameRemoveUnderline(const Value: boolean);
begin
  FTableNameRemoveUnderline := Value;
end;

procedure TASPluginOptions.SetTableNameSingularize(const Value: boolean);
begin
  FTableNameSingularize := Value;
end;

function TASPluginOptions.TableConfigCount: integer;
begin
  Result := FTables.Count;
end;

{ TTableConfig }

constructor TTableConfig.Create(AName: WideString);
begin
  FChecked := True;
  FName := AName;
end;

function TTableConfig.GetChecked: Boolean;
begin
  Result := FChecked;
end;

function TTableConfig.GetName: WideString;
begin
  Result := FName;
end;

procedure TTableConfig.SetChecked(const Value: Boolean);
begin
  FChecked := Value;
end;

end.
