michael@0: /* vim:set expandtab ts=4 sw=4 sts=4 cin: */ 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: * An interface that allows writing unicode data. michael@0: */ michael@0: [scriptable, uuid(2d00b1bb-8b21-4a63-bcc6-7213f513ac2e)] michael@0: interface nsIUnicharOutputStream : nsISupports michael@0: { michael@0: /** michael@0: * Write a single character to the stream. When writing many characters, michael@0: * prefer the string-taking write method. michael@0: * michael@0: * @retval true The character was written successfully michael@0: * @retval false Not all bytes of the character could be written. michael@0: */ michael@0: boolean write(in unsigned long aCount, michael@0: [const, array, size_is(aCount)] in char16_t c); michael@0: michael@0: /** michael@0: * Write a string to the stream. michael@0: * michael@0: * @retval true The string was written successfully michael@0: * @retval false Not all bytes of the string could be written. michael@0: */ michael@0: boolean writeString(in AString str); michael@0: michael@0: /** michael@0: * Flush the stream. This finishes the conversion and writes any bytes that michael@0: * finish the current byte sequence. michael@0: * michael@0: * It does NOT flush the underlying stream. michael@0: * michael@0: * @see nsIUnicodeEncoder::Finish michael@0: */ michael@0: void flush(); michael@0: michael@0: /** michael@0: * Close the stream and free associated resources. This also closes the michael@0: * underlying stream. michael@0: */ michael@0: void close(); michael@0: };