OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
MWGui::BookTypesetter Struct Referenceabstract

A factory class for creating a typeset book instance. More...

#include <bookpage.hpp>

Inheritance diagram for MWGui::BookTypesetter:
Collaboration diagram for MWGui::BookTypesetter:

Classes

struct  Style
 

Public Types

enum  Alignment { AlignLeft = -1, AlignCenter = 0, AlignRight = +1 }
 
typedef boost::shared_ptr
< BookTypesetter
Ptr
 
typedef TypesetBook::InteractiveId InteractiveId
 
typedef MyGUI::Colour Colour
 
typedef uint8_t const * Utf8Point
 
typedef std::pair< Utf8Point,
Utf8Point
Utf8Span
 

Public Member Functions

virtual StylecreateStyle (char const *Font, Colour Colour)=0
 Create a simple text style consisting of a font and a text color. More...
 
virtual StylecreateHotStyle (Style *BaseStyle, Colour NormalColour, Colour HoverColour, Colour ActiveColour, InteractiveId Id, bool Unique=true)=0
 
virtual void lineBreak (float margin=0)=0
 
virtual void sectionBreak (int margin=0)=0
 
virtual void setSectionAlignment (Alignment sectionAlignment)=0
 Changes the alignment for the current section of text. More...
 
virtual void write (Style *Style, Utf8Span Text)=0
 
virtual intptr_t addContent (Utf8Span Text, bool Select=true)=0
 
virtual void selectContent (intptr_t contentHandle)=0
 Select a previously created content block for future writes. More...
 
virtual void write (Style *Style, size_t Begin, size_t End)=0
 
virtual TypesetBook::Ptr complete ()=0
 Finalize the document layout, and return a pointer to it. More...
 

Static Public Member Functions

static Ptr create (int pageWidth, int pageHeight)
 A factory function for creating the default implementation of a book typesetter. More...
 

Detailed Description

A factory class for creating a typeset book instance.

Member Typedef Documentation

typedef MyGUI::Colour MWGui::BookTypesetter::Colour
typedef boost::shared_ptr<BookTypesetter> MWGui::BookTypesetter::Ptr
typedef uint8_t const* MWGui::BookTypesetter::Utf8Point

Member Enumeration Documentation

Enumerator
AlignLeft 
AlignCenter 
AlignRight 

Member Function Documentation

virtual intptr_t MWGui::BookTypesetter::addContent ( Utf8Span  Text,
bool  Select = true 
)
pure virtual

Adds a content block to the document without laying it out. An identifier is returned that can be used to refer to it. If select is true, the block is activated to be references by future writes.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual TypesetBook::Ptr MWGui::BookTypesetter::complete ( )
pure virtual

Finalize the document layout, and return a pointer to it.

Implemented in MWGui::TypesetBookImpl::Typesetter.

BookTypesetter::Ptr MWGui::BookTypesetter::create ( int  pageWidth,
int  pageHeight 
)
static

A factory function for creating the default implementation of a book typesetter.

Here is the caller graph for this function:

virtual Style* MWGui::BookTypesetter::createHotStyle ( Style BaseStyle,
Colour  NormalColour,
Colour  HoverColour,
Colour  ActiveColour,
InteractiveId  Id,
bool  Unique = true 
)
pure virtual

Create a hyper-link style with a user-defined identifier based on an existing style. The unique flag forces a new instance of this style to be created even if an existing instance is present.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual Style* MWGui::BookTypesetter::createStyle ( char const *  Font,
Colour  Colour 
)
pure virtual

Create a simple text style consisting of a font and a text color.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual void MWGui::BookTypesetter::lineBreak ( float  margin = 0)
pure virtual

Insert a line break into the document. Newline characters in the input text have the same affect. The margin parameter adds additional space before the next line of text.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual void MWGui::BookTypesetter::sectionBreak ( int  margin = 0)
pure virtual

Insert a section break into the document. This causes a new section to begin when additional text is inserted. Pagination attempts to keep sections together on a single page. The margin parameter adds additional space before the next line of text.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual void MWGui::BookTypesetter::selectContent ( intptr_t  contentHandle)
pure virtual

Select a previously created content block for future writes.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual void MWGui::BookTypesetter::setSectionAlignment ( Alignment  sectionAlignment)
pure virtual

Changes the alignment for the current section of text.

Implemented in MWGui::TypesetBookImpl::Typesetter.

virtual void MWGui::BookTypesetter::write ( Style Style,
Utf8Span  Text 
)
pure virtual
virtual void MWGui::BookTypesetter::write ( Style Style,
size_t  Begin,
size_t  End 
)
pure virtual

Layout a span of the selected content block into the document using the specified style.

Implemented in MWGui::TypesetBookImpl::Typesetter.


The documentation for this struct was generated from the following files: