OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
richedpr.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of classes supporting Printing/PrintPreview for TRichEdit
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_RICHEDPR_H)
10#define OWL_RICHEDPR_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/printer.h>
18#include <owl/preview.h>
19#include <owl/prevwin.h>
20#include <owl/layoutwi.h>
21#include <owl/richedit.h>
22#include <owl/contain.h>
23#include <owl/template.h>
24
25
26namespace owl {
27
28#include <owl/preclass.h>
29
30/// \addtogroup print
31/// @{
32/// \class TRichEditPreviewFrame
33// ~~~~~ ~~~~~~~~~~~~~~~~~~~~~
34/// TRichEditPreviewFrame is a window object which contains preview pages displaying
35/// data from a rich edit control. It contains a simple preview toolbar and one or
36/// two preview pages.
37//
39 public:
40 TRichEditPreviewFrame(TWindow* parentWindow, /* Parent object */
41 TPrinter& printer, /* Printer object */
42 TPrintout& printout, /* Printout object*/
43 TRichEdit& richEdit, /* RichEdit ctrl. */
44 LPCTSTR title, /* Title of window*/
45 TLayoutWindow* client); /* Client window */
46
50 TPrintout& printout,
52 const tstring& title,
54
55 protected:
56 TPreviewPage* GetNewPreviewPage(TWindow* parent,
57 TPrintout& printout,
60 int pagenum = 1);
61};
62
63//
64/// \class TRichEditPagePreview
65// ~~~~~ ~~~~~~~~~~~~~~~~~~~~
66/// TRichEditPagePreview is a window which displays rich edit data formatted for a
67/// particular printer DC.
68//
70 public:
71 TRichEditPagePreview(TWindow* parent, TPrintout& printout,
73 int pagenum = 1);
74 protected:
75 void Paint(TDC& dc, bool, TRect& clip);
76};
77
78//
79/// \class TRichEditPrintout
80// ~~~~~ ~~~~~~~~~~~~~~~~~
81/// TRichEditPrintout encapsulates the information to print/preview data from a rich
82/// edit control. For example, it holds the offset of pages, the range of data to be
83/// printer/previewed, etc.
84//
86 public:
90
92
94
95 // Overriden virtual methods of TPrintout
96 //
97 void GetDialogInfo (int& minPage, int& maxPage,
98 int& selFromPage, int& selToPage);
99 void SetPrintParams(TPrintDC* dc, TSize pageSize);
100 bool HasPage(int pageNumber);
101 void BeginPrinting();
102 void PrintPage(int page, TRect& rect, uint flags);
103 void EndPrinting();
104
105
106/// This is an overriden virtual method of TPrintout.
107/// \todo There is no such method in TPrintout and there is no implementation of this method anywhere, so it should be removed
109
110 // Helper methods
111 //
112 int PageOfOffset(int offset);
113
114 protected:
115
116// !BB TDC* PreviewDC;
117// !BB int MapMode;
118// !BB bool Scale;
119// !BB int PrevMode;
120// !BB NS_CLASSLIB::TSize OldVExt, OldWExt;
121// !BB NS_CLASSLIB::TRect OrgR;
122// !BB NS_CLASSLIB::TSize PrinterPageSizeInch;
123
124 // !BB May be able to rely in TPrinter::GetPageSize() ??
125 TPrinter& Printer; ///< Ref. to associated printer
126 TRichEdit& RichEdit; ///< Ref. to associated control
127 TSize SizePhysPage; ///< Physical size of printer (pels)
128 TSize SizePhysInch; ///< Size of printer in inches
129 TSize Margins; ///< Size of margins
130 TFormatRange FmtRange; ///< Range of text to format
131 bool FlushCache; ///< Have cached formatted data
132 int TextLen; ///< Length of text formatted
133 int PageCount; ///< Number of pages formatted
134 TIntArray PageIndices; ///< Index of page offsets
135};
136
137/// @}
138
139#include <owl/posclass.h>
140
141
142} // OWL namespace
143
144
145#endif // OWL_REDITPRI_H
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
TFormatRange encapsulates the FORMATRANGE structure, which contains information that a rich edit cont...
Definition richedit.h:156
Derived from TWindow, TLayoutWindow provides functionality for defining the layout metrics for a wind...
Definition layoutwi.h:122
TPreviewPage encapsulates a window which displays print-preview data.
Definition preview.h:44
TPreviewWin encapsulates a simple preview window frame.
Definition prevwin.h:36
A DC class that provides access to a printer.
Definition dc.h:874
TPrinter is an encapsulation around the Windows printer device interface, and represents the physical...
Definition printer.h:164
TPrintout represents the physical printed document that is to sent to a printer to be printed.
Definition printer.h:76
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
TRichEdit encapsulates a rich edit control, a window in which a user can enter, edit and format text.
Definition richedit.h:261
TRichEditPagePreview is a window which displays rich edit data formatted for a particular printer DC.
Definition richedpr.h:69
TRichEditPreviewFrame is a window object which contains preview pages displaying data from a rich edi...
Definition richedpr.h:38
TRichEditPrintout encapsulates the information to print/preview data from a rich edit control.
Definition richedpr.h:85
int TextLen
Length of text formatted.
Definition richedpr.h:132
TIntArray PageIndices
Index of page offsets.
Definition richedpr.h:134
TRichEdit & RichEdit
Ref. to associated control.
Definition richedpr.h:126
int PageCount
Number of pages formatted.
Definition richedpr.h:133
TFormatRange FmtRange
Range of text to format.
Definition richedpr.h:130
bool FlushCache
Have cached formatted data.
Definition richedpr.h:131
TSize SizePhysInch
Size of printer in inches.
Definition richedpr.h:128
TSize SizePhysPage
Physical size of printer (pels)
Definition richedpr.h:127
void CleanupPrintParams()
This is an overriden virtual method of TPrintout.
TSize Margins
Size of margins.
Definition richedpr.h:129
TPrinter & Printer
Ref. to associated printer.
Definition richedpr.h:125
The tagSIZE struct is defined as.
Definition geometry.h:234
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Definition of container classes used and made available by OWL.
Definition of classes TLayoutMetrics & TLayoutWindow.
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338
Definition of print preview classes.
Definition of TPreviewWin, the Preview Window class.
Definition of class TRichEdit.
Definition of container classes used and made available by OWL.