michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * Stores composition clauses information and caret information for synthesizing michael@0: * composition string. michael@0: */ michael@0: michael@0: [scriptable, uuid(9a7d7851-8c0a-4061-9edc-60d6693f86c9)] michael@0: interface nsICompositionStringSynthesizer : nsISupports michael@0: { michael@0: /** michael@0: * Set composition string or committed string. michael@0: */ michael@0: void setString(in AString aString); michael@0: michael@0: // NOTE: These values must be same to NS_TEXTRANGE_* in TextEvents.h michael@0: const unsigned long ATTR_RAWINPUT = 0x02; michael@0: const unsigned long ATTR_SELECTEDRAWTEXT = 0x03; michael@0: const unsigned long ATTR_CONVERTEDTEXT = 0x04; michael@0: const unsigned long ATTR_SELECTEDCONVERTEDTEXT = 0x05; michael@0: michael@0: /** michael@0: * Append a clause. michael@0: * michael@0: * TODO: Should be able to specify custom clause style. michael@0: */ michael@0: void appendClause(in unsigned long aLength, michael@0: in unsigned long aAttribute); michael@0: michael@0: /** michael@0: * Set caret information. michael@0: */ michael@0: void setCaret(in unsigned long aOffset, michael@0: in unsigned long aLength); michael@0: michael@0: /** michael@0: * Synthesize composition string with given information by dispatching michael@0: * a proper event. michael@0: * michael@0: * If clauses have never been set, this dispatches a commit event. michael@0: * If clauses are not filled all over the composition string, this throw an michael@0: * error. michael@0: * michael@0: * After dispatching event, this clears all the information about the michael@0: * composition string. So, you can reuse this instance. michael@0: */ michael@0: bool dispatchEvent(); michael@0: };