unit QExport4Reg;

{$I QExport4VerCtrl.inc}

interface

uses
  {$IFDEF VCL16}
    System.Classes,
  {$ELSE}
    Classes,
  {$ENDIF}
  QExport4,
  QExport4ASCII,
  QExport4HTML,
  QExport4RTF,
  QExport4XLS,
  QExport4LaTeX,
  QExport4XML,
  QExport4SQL,
  {$IFNDEF NOGUI}
    QExport4Clipboard,
  {$ENDIF}
  QExport4DBF,
  QExport4PDF,
  QExport4CustomSource,
  QExport4ODT,
  QExport4ODS,
  QExport4Xlsx,
  QExport4Docx,
  ADO_QExport4Access,
  ADO_QExport4Database
  {$IFNDEF NOGUI}
    , QExport4Dialog,
    QExport4Dsgn
  {$ENDIF}
  {$IFDEF VCL6}
    {$IFNDEF NOGUI}
      , DesignIntf,
      VCLEditors
    {$ENDIF}
  {$ELSE}
    {$IFNDEF NOGUI}
      , DsgnIntf
    {$ENDIF}
  {$ENDIF};

procedure Register;

implementation

uses
{$IFDEF SPLASH}
  ToolsAPI,
  {$IFDEF VCL16}
    Vcl.Graphics,
    System.SysUtils,
    Winapi.Windows,
  {$ELSE}
    Graphics,
    SysUtils,
    Windows,
  {$ENDIF}
{$ENDIF}
  QExport4Common;

{$IFDEF VCL10}
{$R QExport4RegD10.dcr}
{$ELSE}
{$R QExport4Reg.dcr}
{$ENDIF}

{$IFDEF SPLASH}
{$R RegisterSplashScreen.res}

procedure RegisterWithSplashScreen;
var
  AboutSvcs: IOTAAboutBoxServices;
  S: string;
  ProductImage: HBITMAP;
begin
  ProductImage := LoadBitmap(FindResourceHInstance(HInstance), 'SPLASH');
  S := Format(S_FULL_PRODUCT_NAME, ['']);
  SplashScreenServices.AddPluginBitmap(S,
    ProductImage,
  {$IFDEF ADVANCED_DATA_EXPORT_TRIAL_VERSION}
    True,
  {$ELSE}
    False,
  {$ENDIF}
    S_VERSION + ' ' + S_VERSION_NUMBER);
  AboutSvcs := (BorlandIDEServices AS IOTAAboutBoxServices);
  if Assigned(AboutSvcs) then
  begin
    ProductImage := LoadBitmap(FindResourceHInstance(HInstance), 'SPLASH');
    AboutSvcs.AddPluginInfo(S,
    'The Set of Native Delphi Components to export data to most popular formats.',
      ProductImage,
    {$IFDEF ADVANCED_DATA_EXPORT_TRIAL_VERSION}
      True,
    {$ELSE}
      False,
    {$ENDIF}
      S_VERSION + ' ' + S_VERSION_NUMBER);
  end;
end;
{$ENDIF}

procedure Register;
begin
  RegisterComponents(S_COMPONENT_PAGE,
    [{$IFNDEF NOGUI}TQExport4Dialog,{$ENDIF}
     TqeCustomSource4,
     TQExport4XLS,
     TQExport4RTF,
     TQExport4HTML,
     TQExport4XML,
     TQExport4DBF,
     TQExport4PDF,
     TQExport4ASCII,
     TQExport4SQL,
     TQExport4LaTeX,
     TQExport4ODS,
     TQExport4ODT,
     TQExport4Xlsx,
     TQExport4Docx
     {$IFNDEF NOGUI},TQExport4Clipboard{$ENDIF}
     {$IFDEF ADO},TADO_QExport4Access{$ENDIF}]);

  {$IFNDEF NOGUI}
  RegisterPropertyEditor(TypeInfo(THTMLTemplate), TQExport4HTML, 'HTMLTemplate',
     TQHTMLTemplateProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExportFormats, 'DateTimeFormat',
    TQDateTimeFormatProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExportFormats, 'DateFormat',
    TQDateFormatProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExportFormats, 'TimeFormat',
    TQTimeFormatProperty);

  RegisterPropertyEditor(TypeInfo(string), TQExport4XLS, 'FileName',
    TQExcelFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4RTF, 'FileName',
    TQRTFFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4HTML, 'FileName',
    TQHTMLFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), THTMLOptions, 'BackgroundFileName',
    TQHTMLBkgFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TTableOptions, 'BackgroundFileName',
    TQHTMLBkgFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4HTML, 'CSSFileName',
    TQCSSFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4LaTeX, 'FileName',
    TQLaTeXFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4ASCII, 'FileName',
    TQASCIIFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4SQL, 'FileName',
    TQSQLFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4Clipboard, 'ClipboardViewer',
    TQAppFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4XML, 'FileName',
    TQXMLFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4DBF, 'FileName',
    TQDBFFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4ODS, 'FileName',
    TQODSFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4ODT, 'FileName',
    TQODTFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4Xlsx, 'FileName',
    TQXlsxFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4Docx, 'FileName',
    TQDocxFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4Dialog, 'OptionsFileName',
    TQCFGFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4PDF, 'FileName',
    TQPDFFileNameProperty);
  RegisterPropertyEditor(TypeInfo(string), TxlsGraphic, 'FileName',
    TQPictureFileNameProperty);

  RegisterPropertyEditor(TypeInfo(string), TQExport4, 'About',
    TQExportAboutProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4, '_Version',
    TQExportVersionProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4Dialog, 'About',
    TQExportAboutProperty);
  RegisterPropertyEditor(TypeInfo(string), TQExport4Dialog, '_Version',
    TQExportVersionProperty);

  RegisterPropertyEditor(TypeInfo(string), TxlsFieldFormat, 'FieldName',
    TQExcelFieldNameProperty);

  RegisterPropertyEditor(TypeInfo(string), TxlsImage, 'PictureName',
    TQExcelPictureNameProperty);

  RegisterPropertyEditor(TypeInfo(WideString), TxlsFont, 'Name',
    TFontNameProperty);

  RegisterPropertyEditor(TypeInfo(TxlsColor), TPersistent, '', TxlsColorProperty);

  {$IFDEF ADO}
  RegisterPropertyEditor(TypeInfo(string), TADO_QExport4Access, 'DatabaseName',
    TQDatabaseNameProperty);
  {$ENDIF}

  RegisterComponentEditor(TQExport4, TQExportEditor);
  RegisterComponentEditor(TQExport4Dialog, TQExportEditor);
  RegisterComponentEditor(TQExport4HTML, TQExportHTMLEditor);
  RegisterComponentEditor(TQExport4XLS, TQExportXLSEditor);
  RegisterComponentEditor(TQExport4ODS, TQExportODSEditor);
  RegisterComponentEditor(TQExport4ODT, TQExportODTEditor);
  RegisterComponentEditor(TQExport4Xlsx, TQExportXlsxEditor);
  RegisterComponentEditor(TQExport4Docx, TQExportDocxEditor);
  {$ENDIF}
{$IFDEF SPLASH}
  RegisterWithSplashScreen;
{$ENDIF}
end;
end.
