iOS: change logic for when to scroll screen

The current implementation will stop scrolling the screen to reveal
the cursor if the input item changes transformation. This to not
interfere with flicking etc. This strategy turns out to be too
strict, as some qml apps/games can easily have small animations
applied (e.g qtquick cork board example) that moves or scales
the text areas (or their parents) upon focus.

So instead of relying on input item transformation, we now
scroll whenever the cursor changes position inside the input
item (in addition to orientation changes etc). We also
refactor scrollRootView into two functions, since we in
many cases know if the keyboard should scroll up or down
already when the call is made.

Change-Id: If5bf349139eed69823cfc8986bb4b32c93bdf91b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: move QUIView interface decl into separate header file

Change-Id: Idc90d85859229d49b1deecc2472b330f0adb1ef8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: move key/text input into separate category

Change-Id: I62c588226b307d51f7f88b1cc0c1e00c0d0f14c6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: implement support for input methods

This change will add support for input methods, word
completion, spell checking and related functionality.

Change-Id: I41d4de1cab521c679d414cfc7c1a2d0f9c1fcaaf
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: add spell checking support

We don't have a separate enum just for spell checking in Qt, but
Qt::ImhNoPredicitiveText should cover it. So use it
to enable/disable both spell checking and auto completion.

Change-Id: I7ad661cb7d720988f13bc1ed940573006c0ce229
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: send IM events instead of fake key events

Sending faked key events is not such a good idea, since:
1. We don't get key events on iOS, but text events
2. We cannot determine correct key code or modifiers, nor
    do we want to fake modifer press/release etc.
3. Android uses IM for all text input

So it seems that the correct solution is to avoid sending
key events in the first place. This will also bring the iOS
port on par with the Android port.

Change-Id: Ibac1d335184e62eb4185cfd4218a0ec73dffb2c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: send backspace events directly

For legacy reasons, we send IM events to the focus
object directly instead of through QPA. To be consistent,
and to ensure that IM and key events end up at the same
object in the same order, we need to send key events
directly to the focus object as well.
We should consider fixing up QPA to support IM events
better, but this will do for now.

Change-Id: I8a18a1f7b7295e5c64a109fb98eee928fae06a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: return styling hints for text correction pop-ups

By returning the font used at the cursor position, the
correction pop-up will be resized to match the
point size, and the text marking will get correct
height.

Change-Id: I362579b793794835323bb9ceb5ddb4655526f392
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: be more specific about IM callbacks to iOS

No need to call textWillChange all the time if the text is
really not changing. And report that selectionWillChange
when Qt reports that it has changed.

Change-Id: I7bd9f540cd9302c37888926a6152b803cc871ccb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
iOS: return correct uiview for IM rectangles

UITextView has a property for specifying which UIView the CGRects
you return should be aligned with. This makes a difference for
widgets when not using alien, since then the view that draws the
text will usually not be the same as the view that backs
the top level QWindow.

Change-Id: I240d63c98544c39308cd91465ee84351e7d7d1f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>