lib

ContextStyle Class Reference

#include <contextstyle.h>

Inheritance diagram for ContextStyle:

KoTextZoomHandler KoZoomHandler

List of all members.


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.


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 (bool init=true)
void readConfig (KConfig *config, bool init=true)
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, bool init=true)
QFont getMathFont () const
QFont getBracketFont () const
QFont getDefaultFont () const
QFont getNameFont () const
QFont getNumberFont () const
QFont getOperatorFont () const
QFont getSymbolFont () const
void setMathFont (QFont f)
void setBracketFont (QFont f)
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, double factor) const
luPixel getThinSpace (TextStyle tstyle, double factor) const
luPixel getMediumSpace (TextStyle tstyle, double factor) const
luPixel getThickSpace (TextStyle tstyle, double factor) const
luPixel getQuadSpace (TextStyle tstyle, double factor) const
luPixel axisHeight (TextStyle tstyle, double factor) const
luPt getAdjustedSize (TextStyle tstyle, double factor) const
luPixel getLineWidth (double factor) const
luPixel getEmptyRectWidth (double factor) const
luPixel getEmptyRectHeight (double factor) 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

Member Enumeration Documentation

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.


Constructor & Destructor Documentation

KFORMULA_NAMESPACE_BEGIN ContextStyle::ContextStyle (  ) 

Build a default context style.

Definition at line 35 of file contextstyle.cc.


Member Function Documentation

void ContextStyle::init ( bool  init = true  ) 

Parameters:
init if true fonts may be installed if needed.

Definition at line 70 of file contextstyle.cc.

void ContextStyle::readConfig ( KConfig *  config,
bool  init = true 
)

Parameters:
init true if initialization may take place. This may cause font installation. Mark as false when this is not intended (i. e. creating configuration dialog from another component)

Definition at line 92 of file contextstyle.cc.

const SymbolTable & ContextStyle::symbolTable (  )  const

Returns:
our symbol table.

Definition at line 86 of file contextstyle.cc.

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 125 of file contextstyle.cc.

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 130 of file contextstyle.cc.

luPixel ContextStyle::getSpace ( TextStyle  tstyle,
SpaceWidth  space,
double  factor 
) const

TeX like spacings.

Definition at line 231 of file contextstyle.cc.

luPt ContextStyle::getAdjustedSize ( TextStyle  tstyle,
double  factor 
) const

Calculates the font size corresponding to the given TextStyle.

Definition at line 222 of file contextstyle.cc.

luPixel ContextStyle::getLineWidth ( double  factor  )  const

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

Definition at line 304 of file contextstyle.cc.

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 320 of file contextstyle.cc.

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 340 of file contextstyle.cc.

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 224 of file contextstyle.h.

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 237 of file contextstyle.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys