1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
|
/* * This file is part of Maliit framework *
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1 as published by the Free Software Foundation
* and appearing in the file LICENSE.LGPL included in the packaging
* of this file.
*/
#ifndef MALIIT_NAMESPACE_H
#define MALIIT_NAMESPACE_H
#include <QMetaType>
#include <QSharedPointer>
//! \ingroup common
namespace Maliit {
/*!
* \brief Position of the window on the screen.
*/
enum Position {
PositionOverlay,
PositionCenterBottom,
PositionLeftBottom,
PositionRightBottom,
};
/*!
* \brief Content type for text entries.
*
* Content type of the text in the text edit widget, which can be used by
* input method plugins to offer more specific input methods, such as a
* numeric keypad for a number content type. Plugins may also adjust their
* word prediction and error correction accordingly.
*/
enum TextContentType {
//! all characters allowed
FreeTextContentType,
//! only integer numbers allowed
NumberContentType,
//! allows numbers and certain other characters used in phone numbers
PhoneNumberContentType,
//! allows only characters permitted in email address
EmailContentType,
//! allows only character permitted in URL address
UrlContentType,
//! allows content with user defined format
CustomContentType
};
/*!
* \brief State of Copy/Paste button.
*/
enum CopyPasteState {
//! Copy/Paste button is hidden
InputMethodNoCopyPaste,
//! Copy button is accessible
InputMethodCopy,
//! Paste button is accessible
InputMethodPaste
};
/*!
* \brief Direction of plugin switching
*/
enum SwitchDirection {
SwitchUndefined, //!< Special value for uninitialized variables
SwitchForward, //!< Activate next plugin
SwitchBackward //!< Activate previous plugin
};
enum PreeditFace {
PreeditDefault,
PreeditNoCandidates,
PreeditKeyPress, //!< Used for displaying the hwkbd key just pressed
PreeditUnconvertible, //!< Inactive preedit region, not clickable
PreeditActive //!< Preedit region with active suggestions
};
enum HandlerState {
OnScreen,
Hardware,
Accessory
};
//! \brief Key event request type for \a MInputContext::keyEvent().
enum EventRequestType {
EventRequestBoth, //!< Both a Qt::KeyEvent and a signal
EventRequestSignalOnly, //!< Only a signal
EventRequestEventOnly //!< Only a Qt::KeyEvent
};
/*!
* \brief The text format for part of the preedit string, specified by
* start and length.
*
* \sa PreeditFace.
*/
struct PreeditTextFormat {
int start;
int length;
PreeditFace preeditFace;
PreeditTextFormat()
: start(0), length(0), preeditFace(PreeditDefault)
{};
PreeditTextFormat(int s, int l, const PreeditFace &face)
: start(s), length(l), preeditFace(face)
{};
};
namespace InputMethodQuery
{
//! Name of property which tells whether correction is enabled.
//! \sa Maliit::ImCorrectionEnabledQuery.
const char* const correctionEnabledQuery = "maliit-correction-enabled";
//! Name of property which holds ID of attribute extension.
//! \sa Maliit::InputMethodAttributeExtensionIdQuery.
const char* const attributeExtensionId = "maliit-attribute-extension-id";
//! Name of property which holds attribute extension.
//! \sa Maliit::InputMethodAttributeExtensionQuery.
const char* const attributeExtension = "maliit-attribute-extension";
//! Name of the property which overrides localized numeric input with western numeric input.
//! \sa Maliit::WesternNumericInputEnforcedQuery.
const char* const westernNumericInputEnforced = "maliit-western-numeric-input-enforced";
//! Name of the property which controls translucent VKB mode.
const char* const translucentInputMethod = "maliit-translucent-input-method";
//! Name of the property which can suppress VKB even if focused.
//! \sa Maliit::VisualizationPriorityQuery
const char* const suppressInputMethod = "maliit-suppress-input-method";
}
enum SettingEntryType
{
StringType = 1,
IntType = 2,
BoolType = 3,
StringListType = 4,
IntListType = 5
};
namespace SettingEntryAttributes
{
//! Name of setting entry attribute which holds the list of values that can be assigned to the entry.
//! \sa Maliit::SettingsEntry
const char* const valueDomain = "valueDomain";
//! Name of setting entry attribute which holds the descriptions for the values in valueDomain.
//! \sa Maliit::SettingsEntry
const char* const valueDomainDescriptions = "valueDomainDescriptions";
//! Name of setting entry attribute which holds the minimum valid value (inclusive) for an integer property.
//! \sa Maliit::SettingsEntry
const char* const valueRangeMin = "valueRangeMin";
//! Name of setting entry attribute which holds the maximum valid value (inclusive) for an integer property.
//! \sa Maliit::SettingsEntry
const char* const valueRangeMax = "valueRangeMax";
//! Name of setting entry attribute which holds the default value for a setting entry.
//! \sa Maliit::SettingsEntry
const char* const defaultValue = "defaultValue";
}
}
Q_DECLARE_METATYPE(Maliit::TextContentType)
Q_DECLARE_METATYPE(Maliit::PreeditTextFormat)
Q_DECLARE_METATYPE(QList<Maliit::PreeditTextFormat>)
#endif
|