Main Page   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.h-source.html,v 1.10 2001/05/25 10:44:22 jansorg 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 //---------------------------------------------------------------------------
00035 
00036 #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;} "
00037 #define defRTFHeadMargin          "{\\fs8\\cf1\\par\\pard} "
00038 #define defRTFTrailer         "{\\fs%d \\par }}"        // 24
00039 
00040 #define defRTFChapterMarkPre  "\\pard \\qc\\nowidctlpar{\\f1\\fs%d\\b Chapter " // 30
00041 #define defRTFChapterMarkPost "\\par\\fs%d\\par}"       // 10
00042 
00043 #define defRTFVerseMarkPre    "{\\fs%d\\cf1\\super "    //20
00044 #define defRTFVerseMarkPost   "}"
00045 
00046 #define defRTFVersePre        "{\\fs%d" // 24
00047 #define defRTFVersePost       " }"
00048 
00049 
00050 class SWDispRTF:public TRichEdit
00051 {
00052 protected:
00053 
00054   System::AnsiString FRTFHeader;
00055   System::AnsiString FRTFHeadMargin;
00056   System::AnsiString FRTFTrailer;
00057   System::AnsiString FRTFChapterMarkPre;
00058   System::AnsiString FRTFChapterMarkPost;
00059   System::AnsiString FRTFVerseMarkPre;
00060   System::AnsiString FRTFVerseMarkPost;
00061   System::AnsiString FRTFVersePre;
00062   System::AnsiString FRTFVersePost;
00063   bool FExpandNewLine;
00064   CHARRANGE FCharRange;
00065   int fontSize;
00066 
00067   int __fastcall GetMySelStart ();
00068   void __fastcall SetMySelStart (int iselstart);
00069   int __fastcall getFontSize ();
00070   void __fastcall setFontSize (int iFontSize);
00071   void recalcHeaders ();
00072 protected:
00073     TMemoryStream * RTFStream;
00074 
00075   virtual void __fastcall Loaded (void);
00076 public:
00077     __fastcall SWDispRTF (TComponent * Owner);
00078     __fastcall ~ SWDispRTF ();
00079 
00080   virtual char Display (SWModule & imodule);
00081     __published:__property System::AnsiString RTFHeader =
00082   {
00083   read = FRTFHeader, write = FRTFHeader};
00084   __property System::AnsiString RTFHeadMargin = { read =
00085       FRTFHeadMargin, write = FRTFHeadMargin };
00086   __property System::AnsiString RTFChapterMarkPre = { read =
00087       FRTFChapterMarkPre, write = FRTFChapterMarkPre };
00088   __property System::AnsiString RTFChapterMarkPost = { read =
00089       FRTFChapterMarkPost, write = FRTFChapterMarkPost };
00090   __property System::AnsiString RTFVerseMarkPre = { read =
00091       FRTFVerseMarkPre, write = FRTFVerseMarkPre };
00092   __property System::AnsiString RTFVerseMarkPost = { read =
00093       FRTFVerseMarkPost, write = FRTFVerseMarkPost };
00094   __property System::AnsiString RTFVersePre = { read = FRTFVersePre, write =
00095       FRTFVersePre };
00096   __property System::AnsiString RTFVersePost = { read = FRTFVersePost, write =
00097       FRTFVersePost };
00098   __property System::AnsiString RTFTrailer = { read = FRTFTrailer, write =
00099       FRTFTrailer };
00100   __property bool ExpandNewLine = { read = FExpandNewLine, write =
00101       FExpandNewLine };
00102   __property int FontSize = { read = getFontSize, write = setFontSize };
00103 };
00104 
00105 //---------------------------------------------------------------------------
00106 #endif

Generated at Thu May 24 19:50:26 2001 for The Sword Project by doxygen1.1.5 written by Dimitri van Heesch, © 1997-2000