sl@0: /* sl@0: * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Classes used for holding inline text for the Form MTmInlineTextSource interface. sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef INLINETEXTNOMATCHESINDICATORSOURCE_H sl@0: #define INLINETEXTNOMATCHESINDICATORSOURCE_H sl@0: sl@0: // INCLUDES sl@0: sl@0: #include "InlineTextBase.h" sl@0: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #else sl@0: #include sl@0: #include sl@0: #endif sl@0: sl@0: // CONSTANTS sl@0: sl@0: // CLASS DECLARATION sl@0: sl@0: /** sl@0: * Concrete implementation of MTmInlineTextSource for marking text has no predictive sl@0: * text entry matches. sl@0: * sl@0: * @lib InlineText sl@0: * @since 3.2 sl@0: */ sl@0: NONSHARABLE_CLASS(CInlineTextNoMatchesIndicatorSource) : public CInlineTextSource sl@0: { sl@0: public: sl@0: // 2 stage constructor sl@0: IMPORT_C static CInlineTextNoMatchesIndicatorSource* NewL( const MTmSource& aTextSource ); sl@0: // destructor sl@0: ~CInlineTextNoMatchesIndicatorSource(); sl@0: sl@0: public: // From CInlineTextSource sl@0: /** sl@0: * Implementation of framework method. Documented in header sl@0: */ sl@0: virtual void CheckFormattingL(const TTmDocPos& aFrom, const TTmDocPos& aTo ); sl@0: sl@0: private: sl@0: /** sl@0: * C++ constructor. sl@0: */ sl@0: CInlineTextNoMatchesIndicatorSource( const MTmSource& aTextSource ); sl@0: sl@0: /** sl@0: * non-virtual implementation method for CheckFormattingL sl@0: */ sl@0: void DoFormatL( const TTmDocPos& aFrom, const TTmDocPos& aTo ); sl@0: sl@0: /** sl@0: * Framework method implemented to store the inline text at the position and leading-ness sl@0: * sl@0: * @param aPos Position of gap ( 0 = before charaacter 0; 1 = after character 0/before char 1 ...) sl@0: * @param aLeadingEdge use ETrue if the inline text is associated with the next character sl@0: * @param aTextSample text upon which to base decision as to what No Matches text sl@0: * to use sl@0: */ sl@0: void StoreNoMatchesIndicatorInlineTextL( sl@0: TInt aPos, sl@0: TBool aLeadingEdge, sl@0: const TDesC& aTextSample ); sl@0: sl@0: /** sl@0: * This returns a text sensitive no matches indication sl@0: * sl@0: * @param aRightToLeft ETrue if chunk is right to left directional text. sl@0: * @param aBuffer const TDesC& buffer containing text to determine language dependent, sl@0: * @returns a TPtr to the No Matches indication text to use for this buffer sl@0: */ sl@0: TPtrC TextForUnknownPredictiveTextIndication( const TDesC& aTextSample ) const; sl@0: sl@0: /** sl@0: * Returns a value that is the base value of a unicode code page. The significant content of sl@0: * the buffer ( indices [1,aBufferLength]) and is examined from low to high index. sl@0: * Code page is the here defined as the unicode value excluding its lowest byte - Masked sl@0: * by 0xFF00 sl@0: * sl@0: * If a character with non-zero code page is found, that value is returned. Otherwise, 0x0000 sl@0: * is returned sl@0: * sl@0: * To totally dependable, this routine depends upon the chunk being of uniform codepage, sl@0: * or mixed codepage 0 + one other codepage. For no-matches indicator text, this is the case sl@0: * sl@0: * @param aTextSample buffer containing text, sl@0: * @returns Codepage of first sl@0: */ sl@0: sl@0: TUint CodeBaseOfText( const TDesC& aTextSample ) const; sl@0: sl@0: /** sl@0: * Utility method to test whether the next character (in the next chunk) is also in the sl@0: * No matches indicator markup. sl@0: * sl@0: * @param aNexPos position in the text source of the next character (if there is one) sl@0: * @returns ETrue only if there is another character and that is has the sl@0: * no matches indicator markup. sl@0: */ sl@0: TBool FormatOfNextCharacterIsUnknownInlineFepTextStyle( TInt aNextPos) const; sl@0: sl@0: private: sl@0: const MTmSource& iTextSource; sl@0: }; sl@0: sl@0: #endif sl@0: sl@0: // End of File