00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef AKN_BIDI_TEXT_UTILS_H
00028 #define AKN_BIDI_TEXT_UTILS_H
00029
00030
00031 #include <e32base.h>
00032 #include <uikon.hrh>
00033 #include <gdi.h>
00034
00035
00036
00037 const TInt KAknBidiExtraSpacePerLine = 4;
00038
00039
00040
00041
00042
00043
00056 class AknBidiTextUtils
00057 {
00058 public:
00059
00063 enum TParagraphDirectionality
00064 {
00065 EImplicit = 0,
00066 ELeftToRight = 1,
00067 ERightToLeft = 2
00068 };
00069
00070 public:
00071
00098 IMPORT_C static TBool ConvertToVisualAndClipL(
00099 TDes& aLogicalText,
00100 const CFont& aFont,
00101 TInt aMaxWidthInPixels,
00102 TInt aMaxClippedWidthInPixels,
00103 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit,
00104 TChar aClipChar = KEllipsis );
00105
00137 IMPORT_C static TBool ConvertToVisualAndClip(
00138 const TDesC& aLogicalText,
00139 TDes& aVisualText,
00140 const CFont& aFont,
00141 TInt aMaxWidthInPixels,
00142 TInt aMaxClippedWidthInPixels,
00143 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit,
00144 TChar aClipChar = KEllipsis );
00145
00165 IMPORT_C static TInt PrepareRunInfoArray( const TDesC& aLogicalText );
00166
00197 IMPORT_C static void ConvertToVisualAndWrapToArrayL(
00198 TDes& aLogicalText,
00199 const CArrayFix<TInt>& aLineWidthArray,
00200 const CFont& aFont,
00201 CArrayFix<TPtrC>& aWrappedArray,
00202 TBool aInsertTruncationChar,
00203 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit );
00204
00231 IMPORT_C static HBufC* ConvertToVisualAndWrapToArrayL(
00232 const TDesC& aLogicalText,
00233 TInt aLineWidth,
00234 const CFont& aFont,
00235 CArrayFix<TPtrC>& aWrappedArray,
00236 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit );
00237
00267 IMPORT_C static void ConvertToVisualAndChopToArrayL(
00268 TDes& aLogicalText,
00269 const CArrayFix<TInt>& aLineWidthArray,
00270 const CFont& aFont,
00271 CArrayFix<TPtrC>& aChoppedArray,
00272 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit );
00273
00304 IMPORT_C static HBufC* ConvertToVisualAndChopToArrayL(
00305 const TDesC& aLogicalText,
00306 TInt aLineWidth,
00307 const CFont& aFont,
00308 CArrayFix<TPtrC>& aChoppedArray,
00309 TParagraphDirectionality aDirectionality = EImplicit );
00310
00342 IMPORT_C static void ConvertToVisualAndWrapToStringL(
00343 const TDesC& aLogicalText,
00344 const CArrayFix<TInt>& aLineWidthArray,
00345 const CFont& aFont,
00346 TDes& aWrappedString,
00347 TBool aInsertTruncationChar,
00348 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit );
00349
00350
00351
00352
00353
00385 IMPORT_C static HBufC* ConvertToVisualAndWrapToArrayWholeTextL(
00386 const TDesC& aLogicalText,
00387 const CArrayFix<TInt>& aLineWidthArray,
00388 const CFont& aFont,
00389 CArrayFix<TPtrC>& aWrappedArray,
00390 AknBidiTextUtils::TParagraphDirectionality aDirectionality = EImplicit );
00391
00427 IMPORT_C static TInt AknBidiTextUtils::MeasureTextBoundsWidth(
00428 const CFont& aFont,
00429 const TDesC& aText,
00430 CFont::TMeasureTextInput::TFlags aOrder);
00431
00432 private:
00433
00434 static TBool DoConvertToVisualAndClip(
00435 const TDesC& aLogicalText,
00436 TDes& aVisualText,
00437 const CFont& aFont,
00438 TInt aMaxWidthInPixels,
00439 TInt aMaxClippedWidthInPixels,
00440 AknBidiTextUtils::TParagraphDirectionality aDirectionality,
00441 TChar aClipChar );
00442
00446 AknBidiTextUtils();
00447 };
00448
00449
00450 #endif
00451
00452