Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

swdisprtf.h

00001 /******************************************************************************
00002  *  swdisprtf.h   - definition of Class SWDispRTF-- an SWDisplay used to display
00003  *                              a verse in Rich Text Format.
00004  *
00005  * $Id: swdisprtf_8h-source.html,v 1.7 2002/06/20 20:23:10 mgruner Exp $
00006  *
00007  * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
00008  *      CrossWire Bible Society
00009  *      P. O. Box 2528
00010  *      Tempe, AZ  85280-2528
00011  *
00012  * This program is free software; you can redistribute it and/or modify it
00013  * under the terms of the GNU General Public License as published by the
00014  * Free Software Foundation version 2.
00015  *
00016  * This program is distributed in the hope that it will be useful, but
00017  * WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  * General Public License for more details.
00020  *
00021  */
00022 
00023 //---------------------------------------------------------------------------
00024 #ifndef SWDispRTFH
00025 #define SWDispRTFH
00026 //---------------------------------------------------------------------------
00027 #include <vcl\SysUtils.hpp>
00028 #include <vcl\Controls.hpp>
00029 #include <vcl\Classes.hpp>
00030 #include <vcl\Forms.hpp>
00031 #include <vcl\ComCtrls.hpp>
00032 #include <vcl\StdCtrls.hpp>
00033 #include <swtext.h>
00034 #ifndef USEOLDRTF
00035 #include <RxRichEdit.hpp>
00036 #endif
00037 //---------------------------------------------------------------------------
00038 
00039 #define defRTFHeader          "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;} "
00040 #define defRTFHeadMargin          "{\\fs8\\cf1\\par\\pard} "
00041 #define defRTFTrailer         "{\\fs%d \\par }}"        // 24
00042 
00043 #define defRTFChapterMarkPre  "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b Chapter "    // 30
00044 #define defRTFChapterMarkPost "\\par\\fs%d\\par}"       // 10
00045 
00046 #define defRTFVerseMarkPre    "{\\fs%d\\cf1\\super "    //20
00047 #define defRTFVerseMarkPost   "}"
00048 
00049 #define defRTFVersePre        "{\\fs%d" // 24
00050 #define defRTFVersePost       " }"
00051 
00052 #ifndef USEOLDRTF
00053 class SWDispRTF:public TRxRichEdit
00054 #else
00055 class SWDispRTF:public TRichEdit
00056 #endif
00057 {
00058 protected:
00059 
00060   System::AnsiString FRTFHeader;
00061   System::AnsiString FRTFHeadMargin;
00062   System::AnsiString FRTFTrailer;
00063   System::AnsiString FRTFChapterMarkPre;
00064   System::AnsiString FRTFChapterMarkPost;
00065   System::AnsiString FRTFVerseMarkPre;
00066   System::AnsiString FRTFVerseMarkPost;
00067   System::AnsiString FRTFVersePre;
00068   System::AnsiString FRTFVersePost;
00069   bool FExpandNewLine;
00070   CHARRANGE FCharRange;
00071   int fontSize;
00072 
00073   int __fastcall GetMySelStart ();
00074   void __fastcall SetMySelStart (int iselstart);
00075   int __fastcall getFontSize ();
00076   void __fastcall setFontSize (int iFontSize);
00077   void recalcHeaders ();
00078 protected:
00079     TMemoryStream * RTFStream;
00080 
00081   virtual void __fastcall Loaded (void);
00082 public:
00083     __fastcall SWDispRTF (TComponent * Owner);
00084     __fastcall ~ SWDispRTF ();
00085 
00086   virtual char Display (SWModule & imodule);
00087 __published:
00088   __property System::AnsiString RTFHeader = { read = FRTFHeader, write = FRTFHeader};
00089   __property System::AnsiString RTFHeadMargin = { read = FRTFHeadMargin, write = FRTFHeadMargin };
00090   __property System::AnsiString RTFChapterMarkPre = { read = FRTFChapterMarkPre, write = FRTFChapterMarkPre };
00091   __property System::AnsiString RTFChapterMarkPost = { read = FRTFChapterMarkPost, write = FRTFChapterMarkPost };
00092   __property System::AnsiString RTFVerseMarkPre = { read = FRTFVerseMarkPre, write = FRTFVerseMarkPre };
00093   __property System::AnsiString RTFVerseMarkPost = { read = FRTFVerseMarkPost, write = FRTFVerseMarkPost };
00094   __property System::AnsiString RTFVersePre = { read = FRTFVersePre, write = FRTFVersePre };
00095   __property System::AnsiString RTFVersePost = { read = FRTFVersePost, write = FRTFVersePost };
00096   __property System::AnsiString RTFTrailer = { read = FRTFTrailer, write = FRTFTrailer };
00097   __property bool ExpandNewLine = { read = FExpandNewLine, write = FExpandNewLine };
00098   __property int FontSize = { read = getFontSize, write = setFontSize };
00099 };
00100 
00101 //---------------------------------------------------------------------------
00102 #endif

Generated on Thu Jun 20 22:13:00 2002 for The Sword Project by doxygen1.2.15