rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
List of all members | Public Member Functions | Protected Member Functions
IlvPrintableFormattedText Class Reference

This class encapsulates a text with various attributes so that it can be printed with this library. More...

#include <ilviews/printing/printables.h>

Inheritance diagram for IlvPrintableFormattedText:
IlvPrintableText IlvPrintable

Public Member Functions

 IlvPrintableFormattedText (IlvPalette *palette, IlString const &text, IlvPosition alignment=IlvCenter)
 The constructor. More...
 
virtual IlvRect getBBox (IlvPrintableJob const &job) const
 Gets the bounding box of the area to print. More...
 
- Public Member Functions inherited from IlvPrintableText
 IlvPrintableText (IlvPalette *palette, IlString const &text, IlvPosition alignment=IlvCenter)
 The constructor. More...
 
 ~IlvPrintableText ()
 The destructor. More...
 
IlvPosition getAlignment () const
 Gets the alignment of the text to be printed. More...
 
IlvPalettegetPalette () const
 Gets the palette used to print the text. More...
 
IlString getText () const
 Gets the text to be printed. More...
 
void setAlignment (IlvPosition alignment)
 Sets the alignment of the text to be printed. More...
 
void setPalette (IlvPalette *palette)
 Sets the palette used to print the text. More...
 
void setText (IlString const &text)
 Sets the text to be printed. More...
 
- Public Member Functions inherited from IlvPrintable
 IlvPrintable ()
 The default constructor.
 
 IlvPrintable (IlvPrintable const &other)
 The copy constructor. More...
 
virtual ~IlvPrintable ()
 The destructor. More...
 
void lock ()
 Locks the current instance. More...
 
IlvPrintableoperator= (IlvPrintable const &other)
 The assignment operator. More...
 
IlBoolean print (IlvPrintableJob const &job) const
 Prints the contents of the object. More...
 
void unlock ()
 Unlocks the current instance. More...
 

Protected Member Functions

virtual IlBoolean internalPrint (IlvPrintableJob const &job) const
 This function actually prints the document. More...
 
- Protected Member Functions inherited from IlvPrintableText
void modifyText (IlString const &newText) const
 This function modifies the text to be printed. More...
 

Detailed Description

This class encapsulates a text with various attributes so that it can be printed with this library.

Library: ilvprint

The index of the page will be printed by replacing the occurrences of p found in the text.

The total number of pages will be printed by replacing the occurrences of P found in the text.

The document name will be printed by replacing the occurrences of N found in the text.

The year will be printed by replacing the occurrences of y found in the text.

The month will be printed by replacing the occurrences of M found in the text.

The day of the month will be printed by replacing the occurrences of d found in the text.

The hour of the day (0-24) will be printed by replacing the occurrences of h found in the text.

The hour will be printed by replacing the occurrences of H found in the text.

The minute will be printed by replacing the occurrences of m found in the text.

The second will be printed by replacing the occurrences of s found in the text.

The AM or PM indicator will be printed by replacing the occurrences of AM for capitals and am for lowercase found in the text.

You still may print a p or a P, by replacing them by %\p or %\P. You may also print %\p or %\P by doubling the "<tt>\\</tt>" and so on. Note that the "<tt>\\</tt>" must be doubled in a C string.

See Also
IlvPrintableDocument::append

Constructor & Destructor Documentation

IlvPrintableFormattedText::IlvPrintableFormattedText ( IlvPalette palette,
IlString const &  text,
IlvPosition  alignment = IlvCenter 
)

The constructor.

It locks the palette.

Parameters
paletteThe palette used to print the frame.
textThe text to print.
alignmentThe position of the text.

Member Function Documentation

virtual IlvRect IlvPrintableFormattedText::getBBox ( IlvPrintableJob const &  job) const
virtual

Gets the bounding box of the area to print.

Returns
The bounding box.

Reimplemented from IlvPrintableText.

virtual IlBoolean IlvPrintableFormattedText::internalPrint ( IlvPrintableJob const &  job) const
protectedvirtual

This function actually prints the document.

Parameters
jobThe settings of the current print job.
Returns
IlFalse if an error occurred during the printing, IlTrue otherwise.

Reimplemented from IlvPrintableText.


© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.