Update contrib.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef BIDICOMPACT_H_
17 #define BIDICOMPACT_H_
24 Stores information about a run and how to re-order it.
29 /** Describes text to be re-ordered.
30 @internalTechnology */
31 class TReorderingContext
34 /** Where the logical-order text starts. */
36 /** The start of the line. */
38 /** One past the end of the line. */
41 * Truncation character, if there is to be one on this line. Otherwise,
45 /** ETrue if the line must join at its beginning. */
47 /** ETrue if the line must join at its end. */
51 /** How to re-order the run.
52 @internalTechnology */
55 /** Reverse the run, but not surrogate pairs or combining characters. */
56 EFRightToLeft = 0x80000000,
57 /** Simply reverse the run, do not check for surrogates or combiners. */
58 EFNoPairsNoCombiners = 0x40000000,
59 /** No mirrored characters are present. */
60 EFNoMirroredCharacters = 0x20000000
63 /** Sets up an empty run.
64 @internalTechnology */
65 TRunInfoCompact() : iStart(0), iLengthAndType(0) {}
66 TRunInfoCompact(TInt aStart, TInt aLength, TBool aReverse,
68 TRunInfoCompact(TInt aStart, TInt aLength, TBool aReverse);
69 TBool AddRun(const TRunInfoCompact& aToBeAdded);
70 TText* Reorder(TText* aDestination, const TReorderingContext& aContext) const;
72 /** @return The start of this run.
73 @internalTechnology */
74 TInt Start() const { return iStart; }
76 /**@return The length of this run.
77 @internalTechnology */
78 TInt Length() const { return static_cast<TInt>(iLengthAndType & 0x0FFFFFFF); }
80 /** @return The flags associated with this run.
81 @internalTechnology */
82 TInt TypeFlags() const { return iLengthAndType & 0xF0000000; }
84 static TInt Convert(TRunInfoCompact* aBuffer, const TDesC& aText,
85 const TBidirectionalState::TRunInfo* aRunArray, TInt aArraySize);
86 static TBool JoinBefore(const TText* aText, TInt aIndex);