lib Library API Documentation

ContextStyle Class Reference

Contains all the style information for the formela. More...

#include <contextstyle.h>

Inheritance diagram for ContextStyle:

KoZoomHandler KoTextZoomHandler List of all members.

Public Types

enum  Alignment { left, center, right }
enum  TextStyle { displayStyle = 0, textStyle = 1, scriptStyle = 2, scriptScriptStyle = 3 }
enum  IndexStyle { normal, cramped }

Public Member Functions

 ContextStyle ()
void init ()
void readConfig (KConfig *config)
bool edit () const
void setEdit (bool e)
const SymbolTablesymbolTable () const
const FontStylefontStyle () const
void setZoomAndResolution (int zoom, int dpiX, int dpiY)
bool setZoomAndResolution (int zoom, double zoomX, double zoomY, bool updateViews, bool forPrint)
bool syntaxHighlighting () const
void setSyntaxHighlighting (bool highlight)
QColor getDefaultColor () const
QColor getNumberColorPlain () const
QColor getOperatorColorPlain () const
QColor getErrorColorPlain () const
QColor getEmptyColorPlain () const
QColor getHelpColorPlain () const
QColor getNumberColor () const
QColor getOperatorColor () const
QColor getErrorColor () const
QColor getEmptyColor () const
QColor getHelpColor () const
void setDefaultColor (const QColor &)
void setNumberColor (const QColor &)
void setOperatorColor (const QColor &)
void setErrorColor (const QColor &)
void setEmptyColor (const QColor &)
void setHelpColor (const QColor &)
QString getFontStyle () const
void setFontStyle (const QString &fontStyle)
QFont getDefaultFont () const
QFont getNameFont () const
QFont getNumberFont () const
QFont getOperatorFont () const
QFont getSymbolFont () const
void setDefaultFont (QFont f)
void setNameFont (QFont f)
void setNumberFont (QFont f)
void setOperatorFont (QFont f)
double getReductionFactor (TextStyle tstyle) const
luPt getBaseSize () const
int baseSize () const
void setBaseSize (int pointSize)
void setSizeFactor (double factor)
TextStyle getBaseTextStyle () const
bool isScript (TextStyle tstyle) const
luPixel getSpace (TextStyle tstyle, SpaceWidth space) const
luPixel getThinSpace (TextStyle tstyle) const
luPixel getMediumSpace (TextStyle tstyle) const
luPixel getThickSpace (TextStyle tstyle) const
luPixel getQuadSpace (TextStyle tstyle) const
luPixel axisHeight (TextStyle tstyle) const
luPt getAdjustedSize (TextStyle tstyle) const
luPixel getLineWidth () const
luPixel getEmptyRectWidth () const
luPixel getEmptyRectHeight () const
Alignment getMatrixAlignment () const
bool getCenterSymbol () const
TextStyle convertTextStyleFraction (TextStyle tstyle) const
TextStyle convertTextStyleIndex (TextStyle tstyle) const
IndexStyle convertIndexStyleUpper (IndexStyle istyle) const
IndexStyle convertIndexStyleLower (IndexStyle) const

Detailed Description

Contains all the style information for the formela.

The idea is to change the values here (user configurable) and have the elements paint themselves with this information.

All distances are stored in point. Most methods return pixel values.

Definition at line 53 of file contextstyle.h.


Member Enumeration Documentation

enum ContextStyle::TextStyle
 

Textstyles like in TeX.

In the remaining documentation, the styles are abbreviated like this:

displayStyle: D

textStyle: T

scriptStyle: S

scriptScriptStyle: SS

Definition at line 71 of file contextstyle.h.

Referenced by convertTextStyleFraction(), and convertTextStyleIndex().


Constructor & Destructor Documentation

KFORMULA_NAMESPACE_BEGIN ContextStyle::ContextStyle  ) 
 

Build a default context style.

Definition at line 36 of file contextstyle.cc.


Member Function Documentation

const SymbolTable & ContextStyle::symbolTable  )  const
 

Returns:
our symbol table.

Definition at line 101 of file contextstyle.cc.

References FontStyle::symbolTable().

Referenced by TextElement::getFont(), and Document::getSymbolTable().

void ContextStyle::setZoomAndResolution int  zoom,
int  dpiX,
int  dpiY
[virtual]
 

Change the zoom factor to z (e.g.

150 for 150%) and/or change the resolution, given in DPI. This is done on startup, when zooming, and when printing. The same call combines both so that all the updating done behind the scenes is done only once, even if both zoom and DPI must be changed.

Reimplemented from KoZoomHandler.

Definition at line 163 of file contextstyle.cc.

References setZoomAndResolution().

Referenced by Container::drawImage(), Document::setZoomAndResolution(), and setZoomAndResolution().

bool ContextStyle::setZoomAndResolution int  zoom,
double  zoomX,
double  zoomY,
bool  updateViews,
bool  forPrint
 

Sets the zoom by hand.

This is to be used in paintContent.

Returns:
whether there was any change.

Definition at line 168 of file contextstyle.cc.

References setZoomAndResolution().

luPixel ContextStyle::getSpace TextStyle  tstyle,
SpaceWidth  space
const
 

TeX like spacings.

Definition at line 265 of file contextstyle.cc.

References getSpace().

Referenced by getSpace().

luPt ContextStyle::getAdjustedSize TextStyle  tstyle  )  const
 

Calculates the font size corresponding to the given TextStyle.

Definition at line 260 of file contextstyle.cc.

References getAdjustedSize().

Referenced by EmptyElement::calcSizes(), TextElement::calcSizes(), MultilineElement::calcSizes(), TextElement::draw(), and getAdjustedSize().

luPixel ContextStyle::getLineWidth  )  const
 

All simple lines like the one that makes up a fraction.

Definition at line 323 of file contextstyle.cc.

Referenced by TextElement::draw(), NameSequence::drawCursor(), and SequenceElement::drawCursor().

ContextStyle::TextStyle ContextStyle::convertTextStyleFraction TextStyle  tstyle  )  const
 

Font-conversions a la TeX.

For fractions (and also matrices), we have the following conversions: D->T, T->S, S,SS->SS

Definition at line 339 of file contextstyle.cc.

References convertTextStyleFraction(), and TextStyle.

Referenced by convertTextStyleFraction().

ContextStyle::TextStyle ContextStyle::convertTextStyleIndex TextStyle  tstyle  )  const
 

Font-conversions a la TeX.

For indices, we have the following conversions: D->S, T->S, S,SS->SS

Definition at line 359 of file contextstyle.cc.

References convertTextStyleIndex(), and TextStyle.

Referenced by convertTextStyleIndex().

IndexStyle ContextStyle::convertIndexStyleUpper IndexStyle  istyle  )  const [inline]
 

Index-style-conversions a la TeX.

The function convertIndexStyleUpper is responsible for everything that ends 'up', like nominators of fractions, or upper indices.

We have the following rule: normal->normal, cramped->cramped

Definition at line 211 of file contextstyle.h.

References convertIndexStyleUpper().

Referenced by convertIndexStyleUpper().

IndexStyle ContextStyle::convertIndexStyleLower IndexStyle   )  const [inline]
 

Index-style-conversions a la TeX.

The function convertIndexStyleLower is responsible for everything that ends 'down', like nominators of fractions, or upper indices.

We have the following rule: normal->cramped, cramped->cramped

Definition at line 224 of file contextstyle.h.

References convertIndexStyleLower().

Referenced by convertIndexStyleLower().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Sep 28 04:04:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003