Maliit Plugins  0.92.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Private Attributes
MaliitKeyboard::StyleAttributes Class Reference

#include <styleattributes.h>

List of all members.

Public Member Functions

 StyleAttributes (const QSettings *store)
virtual void setStyleName (const QString &name)
 Sets the active style name.
QByteArray wordRibbonBackground () const
 Looks up the background image name for word ribbons.
QByteArray keyAreaBackground () const
 Looks up the background image name for key areas.
QByteArray magnifierKeyBackground () const
 Looks up the background image name for the key magnifier.
QByteArray keyBackground (KeyDescription::Style style, KeyDescription::State state) const
 Looks up the background image name for keys, depending on style and state.
QMargins wordRibbonBackgroundBorders () const
 Looks up the borders for 9-tiling word ribbon background.
QMargins keyAreaBackgroundBorders () const
 Looks up the borders for 9-tiling key area background.
QMargins magnifierKeyBackgroundBorders () const
 Looks up the borders for 9-tiling magnifier key background.
QMargins keyBackgroundBorders () const
 Looks up the borders for 9-tiling key background.
QByteArray icon (KeyDescription::Icon icon, KeyDescription::State state) const
 Looks up the icon name for keys with icons instead of labels.
QByteArray fontName (Layout::Orientation orientation) const
 Looks up the font name used for key labels.
QByteArray fontColor (Layout::Orientation orientation) const
 Looks up the font color used for key labels.
qreal fontSize (Layout::Orientation orientation) const
 Looks up the font size used for key labels.
qreal smallFontSize (Layout::Orientation orientation) const
 Looks up the small font size used for key labels.
qreal candidateFontSize (Layout::Orientation orientation) const
 Looks up the font size used for word candidates.
qreal magnifierFontSize (Layout::Orientation orientation) const
 Looks up the font size used for the key magnifier.
qreal candidateFontStretch (Layout::Orientation orientation) const
 Looks up the font stretch used for word candidates.
qreal wordRibbonHeight (Layout::Orientation orientation) const
 Looks up the word ribbon height.
qreal magnifierKeyHeight (Layout::Orientation orientation) const
 Looks up the magnifier key height.
qreal keyHeight (Layout::Orientation orientation) const
 Looks up the key height.
qreal magnifierKeyWidth (Layout::Orientation orientation) const
 Looks up the magnifier key width.
qreal keyWidth (Layout::Orientation orientation, KeyDescription::Width width) const
 Looks up the key width.
qreal keyAreaWidth (Layout::Orientation orientation) const
 Looks up the key area width.
qreal keyMargin (Layout::Orientation orientation) const
 Looks up the key margins.
qreal keyAreaPadding (Layout::Orientation orienation) const
 Looks up the key area paddings.
qreal verticalOffset (Layout::Orientation orientation) const
 Looks up the vertical offset.
qreal magnifierKeyLabelVerticalOffset (Layout::Orientation orientation) const
 Looks up the vertical offset to position label inside magnifier key.
qreal safetyMargin (Layout::Orientation orientation) const
 Looks up the safety margin.
QByteArray keyPressSound () const
 Looks up the sound file name that is played when a key was pressed.
QByteArray keyReleaseSound () const
 Looks up the sound file name that is played when a key was released.
QByteArray layoutChangeSound () const
 Looks up the sound file name that is played when the layout changed.
QByteArray keyboardHideSound () const
 Looks up the sound file name that is played when keyboard is hidden.

Private Attributes

const QScopedPointer< const
QSettings > 
m_store
QString m_style_name

Constructor & Destructor Documentation

StyleAttributes::StyleAttributes ( const QSettings *  store)
explicit
Parameters:
storeThe settings store which is used to look up all attributes. Must not be null. StyleAttribute instance takes ownership.

Member Function Documentation

qreal StyleAttributes::candidateFontSize ( Layout::Orientation  orientation) const

Looks up the font size used for word candidates.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\candidates-font-size".
qreal StyleAttributes::candidateFontStretch ( Layout::Orientation  orientation) const

Looks up the font stretch used for word candidates.

Non-stretched fonts have a value of 100. Smaller values lead to condensed fonts, higher values stretch the fonts. Smaller values allow to show longer (or more) word candidates that would otherwise have to be cut off.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\candidate-font-stretch".
QByteArray StyleAttributes::fontColor ( Layout::Orientation  orientation) const

Looks up the font color used for key labels.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\font-color".
QByteArray StyleAttributes::fontName ( Layout::Orientation  orientation) const

Looks up the font name used for key labels.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value currently hard-coded (FIXME).
qreal StyleAttributes::fontSize ( Layout::Orientation  orientation) const

Looks up the font size used for key labels.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\font-size".
QByteArray StyleAttributes::icon ( KeyDescription::Icon  icon,
KeyDescription::State  state 
) const

Looks up the icon name for keys with icons instead of labels.

Parameters:
iconThe key icon (return, backspace, shift, ...).
stateThe key state (normal, pressed, disabled, highlighted).
Returns:
Value of "icon\${icon}[-${state}]".
QByteArray StyleAttributes::keyAreaBackground ( ) const

Looks up the background image name for key areas.

Returns:
Value of "background\key-area".
QMargins StyleAttributes::keyAreaBackgroundBorders ( ) const

Looks up the borders for 9-tiling key area background.

Returns:
Value of "background\key-area-borders".
qreal StyleAttributes::keyAreaPadding ( Layout::Orientation  orientation) const

Looks up the key area paddings.

The left-most key will have its left key margin be overriden by the padding, meaning that the padding defines the spacing between left key area border and first left key (unless a spacer element is involved). The same rules apply to the right-most key and the right key area border.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\key-area-paddings".
qreal StyleAttributes::keyAreaWidth ( Layout::Orientation  orientation) const

Looks up the key area width.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\key-area-width".
QByteArray StyleAttributes::keyBackground ( KeyDescription::Style  style,
KeyDescription::State  state 
) const

Looks up the background image name for keys, depending on style and state.

Parameters:
styleThe key style (normal, special, deadkey).
stateThe key state (normal, pressed, disabled, highlighted).
Returns:
Value of "background\${style}[-${state}]"
QMargins StyleAttributes::keyBackgroundBorders ( ) const

Looks up the borders for 9-tiling key background.

Returns:
Value of "background\key-borders".
QByteArray StyleAttributes::keyboardHideSound ( ) const

Looks up the sound file name that is played when keyboard is hidden.

Returns:
Value of "sound/keyboard-hide".
qreal StyleAttributes::keyHeight ( Layout::Orientation  orientation) const

Looks up the key height.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\key-height".
qreal StyleAttributes::keyMargin ( Layout::Orientation  orientation) const

Looks up the key margins.

The right margin of key A together with the left margin of key B defines the spacing between the two keys. However, the margins count as reactive areas for the keys.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\key-margins".
QByteArray StyleAttributes::keyPressSound ( ) const

Looks up the sound file name that is played when a key was pressed.

Returns:
Value of "sound/key-press".
QByteArray StyleAttributes::keyReleaseSound ( ) const

Looks up the sound file name that is played when a key was released.

Returns:
Value of "sound/key-release".
qreal StyleAttributes::keyWidth ( Layout::Orientation  orientation,
KeyDescription::Width  width 
) const

Looks up the key width.

Parameters:
orientationThe layout orientation (landscape or portrait).
widthThe key width type.
Returns:
Value of "${style}\${orientation}\key-width-${width}".
QByteArray StyleAttributes::layoutChangeSound ( ) const

Looks up the sound file name that is played when the layout changed.

Returns:
Value of "sound/layout-change".
qreal StyleAttributes::magnifierFontSize ( Layout::Orientation  orientation) const

Looks up the font size used for the key magnifier.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\magnifier-font-size".
QByteArray StyleAttributes::magnifierKeyBackground ( ) const

Looks up the background image name for the key magnifier.

Returns:
Value of "background\magnifier-key"
QMargins StyleAttributes::magnifierKeyBackgroundBorders ( ) const

Looks up the borders for 9-tiling magnifier key background.

Returns:
Value of "background\magnifier-key-borders".
qreal StyleAttributes::magnifierKeyHeight ( Layout::Orientation  orientation) const

Looks up the magnifier key height.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\magnifier-key-height".
qreal StyleAttributes::magnifierKeyLabelVerticalOffset ( Layout::Orientation  orientation) const

Looks up the vertical offset to position label inside magnifier key.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\magnifier-key-label-vertical-offset".
qreal StyleAttributes::magnifierKeyWidth ( Layout::Orientation  orientation) const

Looks up the magnifier key width.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\magnifier-key-width".
qreal StyleAttributes::safetyMargin ( Layout::Orientation  orientation) const

Looks up the safety margin.

Try to never put magnifier or extended key area within safety margin, which are aded (substracted) from the left and right key area borders.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\safety-margin".
void StyleAttributes::setStyleName ( const QString &  name)
virtual

Sets the active style name.

Consider HTML and CSS, where HTML provides the input and CSS specifies the style for the input. In our case, XML layout files provide the data and this Style class specifies the style for the input. This function works similar to <div class="some_class_name"/>, with a some_class_name {} section within the CSS file. The class names, in our case, are the style attributes from a section element within a XML layout file.

Parameters:
nameThe style name. Works similar to HTML/CSS class and maps it to a section within the INI file. There is no check whether such a section exists!
qreal StyleAttributes::smallFontSize ( Layout::Orientation  orientation) const

Looks up the small font size used for key labels.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\small-font-size".
qreal StyleAttributes::verticalOffset ( Layout::Orientation  orientation) const

Looks up the vertical offset.

Used to position magnifier and extended key area, relative to the pressed key.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\vertical-offset".
QByteArray StyleAttributes::wordRibbonBackground ( ) const

Looks up the background image name for word ribbons.

Returns:
Value of "background\word-ribbon".
QMargins StyleAttributes::wordRibbonBackgroundBorders ( ) const

Looks up the borders for 9-tiling word ribbon background.

Returns:
Value of "background\word-ribbon-borders".
qreal StyleAttributes::wordRibbonHeight ( Layout::Orientation  orientation) const

Looks up the word ribbon height.

Parameters:
orientationThe layout orientation (landscape or portrait).
Returns:
Value of "${style}\${orientation}\word-ribbon-height".

Member Data Documentation

const QScopedPointer<const QSettings> MaliitKeyboard::StyleAttributes::m_store
private
QString MaliitKeyboard::StyleAttributes::m_style_name
private

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