|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Classes used for holding inline text for the Form MTmInlineTextSource interface. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef AKNNOMATCHESINDICATORINLINETEXTSOURCE_H |
|
21 #define AKNNOMATCHESINDICATORINLINETEXTSOURCE_H |
|
22 |
|
23 // INCLUDES |
|
24 |
|
25 #include "AknInlineText.h" |
|
26 #include <frmtlay.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 NONSHARABLE_CLASS(CAknNoMatchesIndicatorInlineTextSource) : public CAknInlineTextSource |
|
33 { |
|
34 public: |
|
35 // 2 stage constructor |
|
36 static CAknNoMatchesIndicatorInlineTextSource* NewL( const CTextLayout& aTextLayout ); |
|
37 // destructor |
|
38 ~CAknNoMatchesIndicatorInlineTextSource(); |
|
39 |
|
40 public: // From CAknInlineTextSource |
|
41 /** |
|
42 * Implementation of framework method. Documented in header |
|
43 */ |
|
44 virtual void CheckFormattingL(const TTmDocPos& aFrom, const TTmDocPos& aTo ); |
|
45 |
|
46 private: |
|
47 /** |
|
48 * C++ constructor. |
|
49 */ |
|
50 CAknNoMatchesIndicatorInlineTextSource( const CTextLayout& aTextLayout ); |
|
51 |
|
52 /** |
|
53 * non-virtual implementation method for CheckFormattingL |
|
54 */ |
|
55 void DoFormatL( const TTmDocPos& aFrom, const TTmDocPos& aTo ); |
|
56 |
|
57 /** |
|
58 * Framework method implemented to store the inline text at the position and leading-ness |
|
59 * |
|
60 * @param aPos Position of gap ( 0 = before charaacter 0; 1 = after character 0/before char 1 ...) |
|
61 * @param aLeadingEdge use ETrue if the inline text is associated with the next character |
|
62 * @param aTextSample text upon which to base decision as to what No Matches text |
|
63 * to use |
|
64 */ |
|
65 void StoreNoMatchesIndicatorInlineTextL( |
|
66 TInt aPos, |
|
67 TBool aLeadingEdge, |
|
68 const TDesC& aTextSample ); |
|
69 |
|
70 /** |
|
71 * This returns a text sensitive no matches indication |
|
72 * |
|
73 * @param aRightToLeft ETrue if chunk is right to left directional text. |
|
74 * @param aBuffer const TDesC& buffer containing text to determine language dependent, |
|
75 * @returns a TPtr to the No Matches indication text to use for this buffer |
|
76 */ |
|
77 TPtrC TextForUnknownPredictiveTextIndication( const TDesC& aTextSample ) const; |
|
78 |
|
79 /** |
|
80 * Returns a value that is the base value of a unicode code page. The significant content of |
|
81 * the buffer ( indices [1,aBufferLength]) and is examined from low to high index. |
|
82 * Code page is the here defined as the unicode value excluding its lowest byte - Masked |
|
83 * by 0xFF00 |
|
84 * |
|
85 * If a character with non-zero code page is found, that value is returned. Otherwise, 0x0000 |
|
86 * is returned |
|
87 * |
|
88 * To totally dependable, this routine depends upon the chunk being of uniform codepage, |
|
89 * or mixed codepage 0 + one other codepage. For no-matches indicator text, this is the case |
|
90 * |
|
91 * @param aTextSample buffer containing text, |
|
92 * @returns Codepage of first |
|
93 */ |
|
94 |
|
95 TUint CodeBaseOfText( const TDesC& aTextSample ) const; |
|
96 |
|
97 /** |
|
98 * Utility method to test whether the next character (in the next chunk) is also in the |
|
99 * No matches indicator markup. |
|
100 * |
|
101 * @param aNexPos position in the text source of the next character (if there is one) |
|
102 * @returns ETrue only if there is another character and that is has the |
|
103 * no matches indicator markup. |
|
104 */ |
|
105 TBool FormatOfNextCharacterIsUnknownInlineFepTextStyle( TInt aNextPos) const; |
|
106 |
|
107 private: |
|
108 const CTextLayout& iTextLayout; |
|
109 }; |
|
110 |
|
111 #endif |
|
112 |
|
113 // End of File |