/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_EDITENG_HANGULHANJA_HXX
#define INCLUDED_EDITENG_HANGULHANJA_HXX
#include terminology:
For instance, you could have two independent selections within your document, which are then
two text portions. A text unit would be single Hangul/Hanja words within a portion, or even
single Hangul syllabification when "replace by character" is enabled.
pseudo-abstract, needs to be overridden
@param _rNextPortion upon return, this must contain the next text portion @param _rLangOfPortion upon return, this must contain the language for the found text portion. (necessary for Chinese translation since there are 5 language variants too look for even if the 'source' language usually is only 'simplified' or 'traditional'.) */ virtual void GetNextPortion( OUString& /* [out] */ _rNextPortion, LanguageType& /* [out] */ _rLangOfPortion, bool /* [in] */ _bAllowImplicitChangesForNotConvertibleText ) = 0; /** announces a new "current unit"This will be called whenever it is necessary to interactively ask the user for
a conversion. In such a case, a range within the current portion (see
Note that the indexes are relative to the most recent replace action. See
pseudo-abstract, needs to be overridden
Note an important thing about the indices: They are always relative to the previous
call of ReplaceUnit. This means when you get a call to ReplaceUnit, and replace some text
in your document, then you have to remember the document position immediately behind
the changed text. In a next call to ReplaceUnit, an index of 0 will denote exactly
this position behind the previous replacement
The reason is that this class here does not know anything about your document structure,
so after a replacement took place, it's impossible to address anything in the range from the
beginning of the portion up to the replaced text.
In the very first call to ReplaceUnit, an index of 0 denotes the very first position of
the current portion.
If the language of the text to be replaced is different from the target language (as given by 'GetTargetLanguage') for example when converting simplified Chinese from/to traditional Chinese the language attribute of the new text has to be changed as well, **and** the font is to be set to the default (document) font for that language.
@param _nUnitStart the start index of the range to replace @param _nUnitEnd the end index (exclusively!) of the range to replace. E.g., an index pair (4,5) indicates a range of length 1. @param _rOrigText the original text to be replaced (as returned by GetNextPortion). Since in Chinese conversion the original text is needed as well in order to only do the minimal necessary text changes and to keep as much attributes as possible this is supplied here as well. @param _rReplaceWith The replacement text @param _rOffsets An sequence matching the indices (characters) of _rReplaceWith to the indices of the characters in the original text they are replacing. This is necessary since some portions of the text may get converted in portions of different length than the original. The sequence will be empty if all conversions in the text are of equal length. That is if always the character at index i in _rOffsets is replacing the character at index i in the original text for all valid index values of i. @param _eAction replacement action to take @param pNewUnitLanguage if the replacement unit is required to have a new language that is specified here. If the language is to be left unchanged this is the 0 pointer. */ virtual void ReplaceUnit( const sal_Int32 _nUnitStart, const sal_Int32 _nUnitEnd, const OUString& _rOrigText, const OUString& _rReplaceWith, const css::uno::Sequence< sal_Int32 > &_rOffsets, ReplacementAction _eAction, LanguageType *pNewUnitLanguage ) = 0; /** specifies if rubies are supported by the document implementing this class. @return