charconvfw/inlinetext/inc/InlineTextNoMatchesIndicatorSource.h
changeset 0 1fb32624e06b
child 12 5390220f13c1
child 16 56cd22a7a1cb
equal deleted inserted replaced
-1:000000000000 0:1fb32624e06b
       
     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 INLINETEXTNOMATCHESINDICATORSOURCE_H
       
    21 #define INLINETEXTNOMATCHESINDICATORSOURCE_H
       
    22 
       
    23 // INCLUDES
       
    24 
       
    25 #include "inlinetextbase.h"
       
    26 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    27 #include <tagma.h>
       
    28 #else
       
    29 #include <tagma.h>
       
    30 #include <tagmaLayoutAndSource.h>
       
    31 #endif
       
    32 
       
    33 // CONSTANTS
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 * Concrete implementation of MTmInlineTextSource for marking text has no predictive
       
    39 * text entry matches.
       
    40 * 
       
    41 *  @lib InlineText
       
    42 *  @since 3.2
       
    43 */
       
    44 NONSHARABLE_CLASS(CInlineTextNoMatchesIndicatorSource) : public CInlineTextSource
       
    45     {
       
    46     public:
       
    47     // 2 stage constructor
       
    48     IMPORT_C static CInlineTextNoMatchesIndicatorSource* NewL( const MTmSource& aTextSource );
       
    49     // destructor
       
    50     ~CInlineTextNoMatchesIndicatorSource();
       
    51 
       
    52     public: // From CInlineTextSource
       
    53     /**
       
    54     * Implementation of framework method. Documented in header
       
    55     */
       
    56     virtual void CheckFormattingL(const TTmDocPos& aFrom, const TTmDocPos& aTo );
       
    57 
       
    58     private:
       
    59     /**
       
    60     * C++ constructor. 
       
    61     */
       
    62     CInlineTextNoMatchesIndicatorSource( const MTmSource& aTextSource );
       
    63 
       
    64     /**
       
    65     * non-virtual implementation method for CheckFormattingL
       
    66     */
       
    67     void DoFormatL( const TTmDocPos& aFrom, const TTmDocPos& aTo );
       
    68 
       
    69     /**
       
    70     * Framework method implemented to store the inline text at the position and leading-ness
       
    71     *
       
    72     * @param aPos           Position of gap ( 0 = before charaacter 0; 1 = after character 0/before char 1 ...)
       
    73     * @param aLeadingEdge   use ETrue if the inline text is associated with the next character
       
    74     * @param aTextSample    text upon which to base decision as to what No Matches text
       
    75     *                       to use
       
    76     */
       
    77     void StoreNoMatchesIndicatorInlineTextL( 
       
    78         TInt aPos,
       
    79         TBool aLeadingEdge,
       
    80         const TDesC& aTextSample );
       
    81 
       
    82     /**
       
    83     * This returns a text sensitive no matches indication
       
    84     *
       
    85     * @param aRightToLeft   ETrue if chunk is right to left directional text.
       
    86     * @param aBuffer        const TDesC& buffer containing text to determine language dependent, 
       
    87     * @returns a TPtr to the No Matches indication text to use for this buffer
       
    88     */
       
    89     TPtrC TextForUnknownPredictiveTextIndication( const TDesC& aTextSample ) const;
       
    90 
       
    91     /**
       
    92     * Returns a value that is the base value of a unicode code page. The significant content of
       
    93     * the buffer ( indices [1,aBufferLength]) and is examined from low to high index.  
       
    94     * Code page is the here defined as the unicode value excluding its lowest byte - Masked 
       
    95     * by 0xFF00 
       
    96     *
       
    97     * If a character with non-zero code page is found, that value is returned.  Otherwise, 0x0000
       
    98     * is returned
       
    99     * 
       
   100     * To totally dependable, this routine depends upon the chunk being of uniform codepage, 
       
   101     * or mixed codepage 0 + one other codepage.  For no-matches indicator text, this is the case
       
   102     *
       
   103     * @param aTextSample    buffer containing text, 
       
   104     * @returns              Codepage of first
       
   105     */
       
   106 
       
   107     TUint CodeBaseOfText( const TDesC& aTextSample ) const;
       
   108 
       
   109     /**
       
   110     * Utility method to test whether the next character (in the next chunk) is also in the 
       
   111     * No matches indicator markup.
       
   112     *
       
   113     * @param aNexPos        position in the text source of the next character (if there is one)
       
   114     * @returns              ETrue only if there is another character and that is has the
       
   115     *                       no matches indicator markup.
       
   116     */
       
   117     TBool FormatOfNextCharacterIsUnknownInlineFepTextStyle( TInt aNextPos) const;
       
   118 
       
   119     private:
       
   120     const MTmSource& iTextSource;
       
   121     };
       
   122 
       
   123 #endif
       
   124 
       
   125 // End of File