~timo-jyrinki/ubuntu/trusty/maliit-framework/fix_qt52

« back to all changes in this revision

Viewing changes to maliit/preeditinjectionevent.h

  • Committer: Package Import Robot
  • Author(s): Ricardo Salveti de Araujo, Sergio Schvezov, Ricardo Salveti de Araujo
  • Date: 2013-07-23 19:47:04 UTC
  • mfrom: (1.1.2) (1.2.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130723194704-1lsy1kmlda069cea
Tags: 0.99.0+git20130615+97e8335-0ubuntu1
[ Sergio Schvezov ]
* New build from HEAD 97e8335.
* Packaging import from lp:phablet-extras/maliit-framework.

[ Ricardo Salveti de Araujo ]
* debian/control: adding vcs and fixing dependencies
* General package cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* * This file is part of Maliit framework *
2
 
 *
3
 
 * Copyright (C) 2010, 2011 Nokia Corporation and/or its subsidiary(-ies).
4
 
 * All rights reserved.
5
 
 *
6
 
 * Contact: maliit-discuss@lists.maliit.org
7
 
 *
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
12
 
 * of this file.
13
 
 */
14
 
 
15
 
// Based on mpreeditinjectionevent.h from libmeegotouch
16
 
 
17
 
#ifndef MALIIT_PREEDITINJECTIONEVENT_H
18
 
#define MALIIT_PREEDITINJECTIONEVENT_H
19
 
 
20
 
#include <QEvent>
21
 
 
22
 
namespace Maliit {
23
 
 
24
 
class PreeditInjectionEventPrivate;
25
 
 
26
 
/*!
27
 
 * \ingroup libmaliit
28
 
 * \brief Extension for preedit text inside text edits.
29
 
 *
30
 
 * MPreeditInjectionEvent should be sent from text edit to input context and offer the word as preedit.
31
 
 */
32
 
class PreeditInjectionEvent : public QEvent
33
 
{
34
 
public:
35
 
    /*!
36
 
     * \brief Default constructor.
37
 
     * \param preedit The word offered as preedit.
38
 
     */
39
 
    PreeditInjectionEvent(const QString &preedit);
40
 
 
41
 
    /*!
42
 
     * \brief Constructor.
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).
46
 
     */
47
 
    PreeditInjectionEvent(const QString &preedit, int eventCursorPosition);
48
 
 
49
 
    /*!
50
 
     *\brief Destructor
51
 
     */
52
 
    virtual ~PreeditInjectionEvent();
53
 
 
54
 
    /*!
55
 
     * \brief Returns the offered preedit text.
56
 
     */
57
 
    QString preedit() const;
58
 
 
59
 
    /*!
60
 
     * \brief Returns the expected cursor position inside preedit.
61
 
     *
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.
66
 
     */
67
 
    int eventCursorPosition() const;
68
 
 
69
 
    /*!
70
 
     * \brief sets replacement information that should be used for QInputMethodEvent.
71
 
     */
72
 
    void setReplacement(int replacementStart, int replacementLength);
73
 
 
74
 
    /*!
75
 
     * \brief replacement start info as in QInputMethodEvent
76
 
     */
77
 
    int replacementStart() const;
78
 
 
79
 
    /*!
80
 
      \brief replacement length info as in QInputMethodEvent
81
 
    */
82
 
    int replacementLength() const;
83
 
 
84
 
    static QEvent::Type eventNumber();
85
 
 
86
 
protected:
87
 
    PreeditInjectionEventPrivate *const d_ptr;
88
 
 
89
 
private:
90
 
    Q_DECLARE_PRIVATE(PreeditInjectionEvent)
91
 
    Q_DISABLE_COPY(PreeditInjectionEvent)
92
 
};
93
 
 
94
 
}
95
 
 
96
 
#endif