aboutsummaryrefslogtreecommitdiffstats
path: root/include/swdisprtf.h
blob: f8b78e718ef21b08f6dfbe5ed1855307817585fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/******************************************************************************
 *  swdisprtf.h   - definition of Class SWDispRTF-- an SWDisplay used to display
 *				a verse in Rich Text Format.
 *
 * $Id: swdisprtf.h,v 1.10 2002/07/30 11:33:17 scribe Exp $
 *
 * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org)
 *	CrossWire Bible Society
 *	P. O. Box 2528
 *	Tempe, AZ  85280-2528
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation version 2.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 */

//---------------------------------------------------------------------------
#ifndef SWDispRTFH
#define SWDispRTFH
//---------------------------------------------------------------------------
#include <vcl\SysUtils.hpp>
#include <vcl\Controls.hpp>
#include <vcl\Classes.hpp>
#include <vcl\Forms.hpp>
#include <vcl\ComCtrls.hpp>
#include <vcl\StdCtrls.hpp>
#include <swtext.h>
#include "RxRichEditX.h"
//---------------------------------------------------------------------------

#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;} "
#define	defRTFHeadMargin	  "{\\fs8\\cf1\\par\\pard} "
#define	defRTFTrailer         "{\\fs%d \\par }}"	// 24

#define	defRTFChapterMarkPre  "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b Chapter "	// 30
#define	defRTFChapterMarkPost "\\par\\fs%d\\par}"	// 10

#define	defRTFVerseMarkPre    "{\\fs%d\\cf1\\super "	//20
#define	defRTFVerseMarkPost   "}"

#define	defRTFVersePre        "{\\fs%d"	// 24
#define	defRTFVersePost       " }"

class SWDispRTF : public TRxRichEditX {
protected:

  bool FExpandNewLine;
  CHARRANGE FCharRange;
  int fontSize;

  int __fastcall GetMySelStart ();
  void __fastcall SetMySelStart (int iselstart);
  int __fastcall getFontSize ();
  void __fastcall setFontSize (int iFontSize);
protected:
    TMemoryStream * RTFStream;

  virtual void __fastcall Loaded (void);
public:
    __fastcall SWDispRTF (TWinControl *Owner);
    __fastcall ~ SWDispRTF ();

  virtual char Display (SWModule & imodule);
  __property bool ExpandNewLine = { read = FExpandNewLine, write = FExpandNewLine };
};

//---------------------------------------------------------------------------
#endif