dom/interfaces/base/nsICompositionStringSynthesizer.idl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 /**
michael@0 9 * Stores composition clauses information and caret information for synthesizing
michael@0 10 * composition string.
michael@0 11 */
michael@0 12
michael@0 13 [scriptable, uuid(9a7d7851-8c0a-4061-9edc-60d6693f86c9)]
michael@0 14 interface nsICompositionStringSynthesizer : nsISupports
michael@0 15 {
michael@0 16 /**
michael@0 17 * Set composition string or committed string.
michael@0 18 */
michael@0 19 void setString(in AString aString);
michael@0 20
michael@0 21 // NOTE: These values must be same to NS_TEXTRANGE_* in TextEvents.h
michael@0 22 const unsigned long ATTR_RAWINPUT = 0x02;
michael@0 23 const unsigned long ATTR_SELECTEDRAWTEXT = 0x03;
michael@0 24 const unsigned long ATTR_CONVERTEDTEXT = 0x04;
michael@0 25 const unsigned long ATTR_SELECTEDCONVERTEDTEXT = 0x05;
michael@0 26
michael@0 27 /**
michael@0 28 * Append a clause.
michael@0 29 *
michael@0 30 * TODO: Should be able to specify custom clause style.
michael@0 31 */
michael@0 32 void appendClause(in unsigned long aLength,
michael@0 33 in unsigned long aAttribute);
michael@0 34
michael@0 35 /**
michael@0 36 * Set caret information.
michael@0 37 */
michael@0 38 void setCaret(in unsigned long aOffset,
michael@0 39 in unsigned long aLength);
michael@0 40
michael@0 41 /**
michael@0 42 * Synthesize composition string with given information by dispatching
michael@0 43 * a proper event.
michael@0 44 *
michael@0 45 * If clauses have never been set, this dispatches a commit event.
michael@0 46 * If clauses are not filled all over the composition string, this throw an
michael@0 47 * error.
michael@0 48 *
michael@0 49 * After dispatching event, this clears all the information about the
michael@0 50 * composition string. So, you can reuse this instance.
michael@0 51 */
michael@0 52 bool dispatchEvent();
michael@0 53 };

mercurial