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


Public Types

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

Public Member Functions

 ContextStyle ()
 ~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 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

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


Constructor & Destructor Documentation

KFORMULA_NAMESPACE_BEGIN ContextStyle::ContextStyle (  ) 

Build a default context style.

Definition at line 36 of file contextstyle.cc.


Member Function Documentation

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

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

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

luPt ContextStyle::getAdjustedSize ( TextStyle  tstyle  )  const

Calculates the font size corresponding to the given TextStyle.

Definition at line 269 of file contextstyle.cc.

luPixel ContextStyle::getLineWidth (  )  const

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

Definition at line 332 of file contextstyle.cc.

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

TeX like spacings.

Definition at line 274 of file contextstyle.cc.

void ContextStyle::init ( bool  init = true  ) 

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

Definition at line 72 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 107 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 177 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 172 of file contextstyle.cc.

const SymbolTable & ContextStyle::symbolTable (  )  const

Returns:
our symbol table.

Definition at line 101 of file contextstyle.cc.


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