Maliit Plugins
0.92.5
|
#include <styleattributes.h>
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 |
|
explicit |
store | The settings store which is used to look up all attributes. Must not be null. StyleAttribute instance takes ownership. |
qreal StyleAttributes::candidateFontSize | ( | Layout::Orientation | orientation | ) | const |
Looks up the font size used for word candidates.
orientation | The layout orientation (landscape or portrait). |
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.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::fontColor | ( | Layout::Orientation | orientation | ) | const |
Looks up the font color used for key labels.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::fontName | ( | Layout::Orientation | orientation | ) | const |
Looks up the font name used for key labels.
orientation | The layout orientation (landscape or portrait). |
qreal StyleAttributes::fontSize | ( | Layout::Orientation | orientation | ) | const |
Looks up the font size used for key labels.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::icon | ( | KeyDescription::Icon | icon, |
KeyDescription::State | state | ||
) | const |
Looks up the icon name for keys with icons instead of labels.
icon | The key icon (return, backspace, shift, ...). |
state | The key state (normal, pressed, disabled, highlighted). |
QByteArray StyleAttributes::keyAreaBackground | ( | ) | const |
Looks up the background image name for key areas.
QMargins StyleAttributes::keyAreaBackgroundBorders | ( | ) | const |
Looks up the borders for 9-tiling key area background.
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.
orientation | The layout orientation (landscape or portrait). |
qreal StyleAttributes::keyAreaWidth | ( | Layout::Orientation | orientation | ) | const |
Looks up the key area width.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::keyBackground | ( | KeyDescription::Style | style, |
KeyDescription::State | state | ||
) | const |
Looks up the background image name for keys, depending on style and state.
style | The key style (normal, special, deadkey). |
state | The key state (normal, pressed, disabled, highlighted). |
QMargins StyleAttributes::keyBackgroundBorders | ( | ) | const |
Looks up the borders for 9-tiling key background.
QByteArray StyleAttributes::keyboardHideSound | ( | ) | const |
Looks up the sound file name that is played when keyboard is hidden.
qreal StyleAttributes::keyHeight | ( | Layout::Orientation | orientation | ) | const |
Looks up the key height.
orientation | The layout orientation (landscape or portrait). |
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.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::keyPressSound | ( | ) | const |
Looks up the sound file name that is played when a key was pressed.
QByteArray StyleAttributes::keyReleaseSound | ( | ) | const |
Looks up the sound file name that is played when a key was released.
qreal StyleAttributes::keyWidth | ( | Layout::Orientation | orientation, |
KeyDescription::Width | width | ||
) | const |
Looks up the key width.
orientation | The layout orientation (landscape or portrait). |
width | The key width type. |
QByteArray StyleAttributes::layoutChangeSound | ( | ) | const |
Looks up the sound file name that is played when the layout changed.
qreal StyleAttributes::magnifierFontSize | ( | Layout::Orientation | orientation | ) | const |
Looks up the font size used for the key magnifier.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::magnifierKeyBackground | ( | ) | const |
Looks up the background image name for the key magnifier.
QMargins StyleAttributes::magnifierKeyBackgroundBorders | ( | ) | const |
Looks up the borders for 9-tiling magnifier key background.
qreal StyleAttributes::magnifierKeyHeight | ( | Layout::Orientation | orientation | ) | const |
Looks up the magnifier key height.
orientation | The layout orientation (landscape or portrait). |
qreal StyleAttributes::magnifierKeyLabelVerticalOffset | ( | Layout::Orientation | orientation | ) | const |
Looks up the vertical offset to position label inside magnifier key.
orientation | The layout orientation (landscape or portrait). |
qreal StyleAttributes::magnifierKeyWidth | ( | Layout::Orientation | orientation | ) | const |
Looks up the magnifier key width.
orientation | The layout orientation (landscape or portrait). |
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.
orientation | The layout orientation (landscape or portrait). |
|
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.
name | The 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.
orientation | The layout orientation (landscape or portrait). |
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.
orientation | The layout orientation (landscape or portrait). |
QByteArray StyleAttributes::wordRibbonBackground | ( | ) | const |
Looks up the background image name for word ribbons.
QMargins StyleAttributes::wordRibbonBackgroundBorders | ( | ) | const |
Looks up the borders for 9-tiling word ribbon background.
qreal StyleAttributes::wordRibbonHeight | ( | Layout::Orientation | orientation | ) | const |
Looks up the word ribbon height.
orientation | The layout orientation (landscape or portrait). |
|
private |
|
private |