{----------------------------------------------------------------------------- The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/MPL-1.1.html Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is: JvRichEditToHtml.PAS, released on 2001-02-28. The Initial Developer of the Original Code is Sébastien Buysse [sbuysse att buypin dott com] Portions created by Sébastien Buysse are Copyright (C) 2001 Sébastien Buysse. All Rights Reserved. Contributor(s): Michael Beck [mbeck att bigfoot dott com]. You may retrieve the latest version of this file at the Project JEDI's JVCL home page, located at http://jvcl.sourceforge.net Known Issues: -----------------------------------------------------------------------------} // $Id: JvRichEditToHtml.pas,v 1.15 2005/09/15 07:22:55 marquardt Exp $ unit JvRichEditToHtml; {$I jvcl.inc} {$I windowsonly.inc} interface uses {$IFDEF UNITVERSIONING} JclUnitVersioning, {$ENDIF UNITVERSIONING} SysUtils, Classes, Graphics, Forms, ComCtrls, JvRgbToHtml, JvStrToHtml, JvRichEdit, JvComponentBase; type TJvParaAttributesRec = record Alignment: TAlignment; Numbering: TNumberingStyle; end; TJvRichEditParaAttributesRec = record Alignment: TParaAlignment; Numbering: TJvNumbering; end; TJvRichEditToHtml = class(TJvComponent) private FCToH: TJvRgbToHtml; FCharToH: TJvStrToHtml; FEndSection: string; FEndPara: string; FTitle: string; FFooter: TStringList; FHeader: TStringList; function AttToHtml(Value: TFont): string; function ParaToHtml(Value: TJvParaAttributesRec): string;overload; function ParaToHtml(Value: TJvRichEditParaAttributesRec): string;overload; function GetFooter: TStrings; function GetHeader: TStrings; procedure SetFooter(const Value: TStrings); procedure SetHeader(const Value: TStrings); public constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure ConvertToHtml(Value: TRichEdit; const FileName: string);overload; procedure ConvertToHtml(Value: TJvRichEdit; const FileName: string);overload; procedure ConvertToHtmlStrings(Value: TRichEdit; Strings: TStrings);overload; procedure ConvertToHtmlStrings(Value: TJvRichEdit; Strings: TStrings);overload; published property Title: string read FTitle write FTitle; property Header: TStrings read GetHeader write SetHeader; property Footer: TStrings read GetFooter write SetFooter; end; {$IFDEF UNITVERSIONING} const UnitVersioning: TUnitVersionInfo = ( RCSfile: '$RCSfile: JvRichEditToHtml.pas,v $'; Revision: '$Revision: 1.15 $'; Date: '$Date: 2005/09/15 07:22:55 $'; LogPath: 'JVCL\run' ); {$ENDIF UNITVERSIONING} implementation const // (rom) needs renaming? // cHTMLHeadBegin = ''; // cHTMLBodyBegin = '
'; // cHTMLBodyEnd = ''; // cHTMLEnd = ''; // cHTMLTitleFmt = '