1
/* * This file is part of Maliit framework *
3
* Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies).
6
* Contact: maliit-discuss@lists.maliit.org
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License version 2.1 as published by the Free Software Foundation
11
* and appearing in the file LICENSE.LGPL included in the packaging
15
// Based on mpreeditinjectionevent.h from libmeegotouch
17
#ifndef MALIIT_PREEDITINJECTIONEVENT_H
18
#define MALIIT_PREEDITINJECTIONEVENT_H
24
class PreeditInjectionEventPrivate;
28
* \brief Extension for preedit text inside text edits.
30
* MPreeditInjectionEvent should be sent from text edit to input context and offer the word as preedit.
32
class PreeditInjectionEvent : public QEvent
36
* \brief Default constructor.
37
* \param preedit The word offered as preedit.
39
PreeditInjectionEvent(const QString &preedit);
43
* \param preedit The word offered as preedit.
44
* \param eventCursorPosition The expected cursor position inside preedit. The valid value is from
45
* 0 (at the beginning of the preedit) to the length of preedit (at the end of preedit).
47
PreeditInjectionEvent(const QString &preedit, int eventCursorPosition);
52
virtual ~PreeditInjectionEvent();
55
* \brief Returns the offered preedit text.
57
QString preedit() const;
60
* \brief Returns the expected cursor position inside preedit.
62
* Note the eventCursorPosition is not the real cursor position, while it is the cursor position inside
63
* preedit which this event expects. The input context will decide whether and where to display cursor.
64
* The valid value is from 0 (at the beginning of the preedit) to the length of preedit (at the end
65
* of preedit). Other values indicate the cursor position unknown.
67
int eventCursorPosition() const;
70
* \brief sets replacement information that should be used for QInputMethodEvent.
72
void setReplacement(int replacementStart, int replacementLength);
75
* \brief replacement start info as in QInputMethodEvent
77
int replacementStart() const;
80
\brief replacement length info as in QInputMethodEvent
82
int replacementLength() const;
84
static QEvent::Type eventNumber();
87
PreeditInjectionEventPrivate *const d_ptr;
90
Q_DECLARE_PRIVATE(PreeditInjectionEvent)
91
Q_DISABLE_COPY(PreeditInjectionEvent)