os/textandloc/textandlocutils/inlinetext/inc/InlineTextNoMatchesIndicatorSource.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/textandlocutils/inlinetext/inc/InlineTextNoMatchesIndicatorSource.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,125 @@
1.4 +/*
1.5 +* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Classes used for holding inline text for the Form MTmInlineTextSource interface.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef INLINETEXTNOMATCHESINDICATORSOURCE_H
1.24 +#define INLINETEXTNOMATCHESINDICATORSOURCE_H
1.25 +
1.26 +// INCLUDES
1.27 +
1.28 +#include "InlineTextBase.h"
1.29 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.30 +#include <tagma.h>
1.31 +#else
1.32 +#include <tagma.h>
1.33 +#include <tagmalayoutandsource.h>
1.34 +#endif
1.35 +
1.36 +// CONSTANTS
1.37 +
1.38 +// CLASS DECLARATION
1.39 +
1.40 +/**
1.41 +* Concrete implementation of MTmInlineTextSource for marking text has no predictive
1.42 +* text entry matches.
1.43 +*
1.44 +* @lib InlineText
1.45 +* @since 3.2
1.46 +*/
1.47 +NONSHARABLE_CLASS(CInlineTextNoMatchesIndicatorSource) : public CInlineTextSource
1.48 + {
1.49 + public:
1.50 + // 2 stage constructor
1.51 + IMPORT_C static CInlineTextNoMatchesIndicatorSource* NewL( const MTmSource& aTextSource );
1.52 + // destructor
1.53 + ~CInlineTextNoMatchesIndicatorSource();
1.54 +
1.55 + public: // From CInlineTextSource
1.56 + /**
1.57 + * Implementation of framework method. Documented in header
1.58 + */
1.59 + virtual void CheckFormattingL(const TTmDocPos& aFrom, const TTmDocPos& aTo );
1.60 +
1.61 + private:
1.62 + /**
1.63 + * C++ constructor.
1.64 + */
1.65 + CInlineTextNoMatchesIndicatorSource( const MTmSource& aTextSource );
1.66 +
1.67 + /**
1.68 + * non-virtual implementation method for CheckFormattingL
1.69 + */
1.70 + void DoFormatL( const TTmDocPos& aFrom, const TTmDocPos& aTo );
1.71 +
1.72 + /**
1.73 + * Framework method implemented to store the inline text at the position and leading-ness
1.74 + *
1.75 + * @param aPos Position of gap ( 0 = before charaacter 0; 1 = after character 0/before char 1 ...)
1.76 + * @param aLeadingEdge use ETrue if the inline text is associated with the next character
1.77 + * @param aTextSample text upon which to base decision as to what No Matches text
1.78 + * to use
1.79 + */
1.80 + void StoreNoMatchesIndicatorInlineTextL(
1.81 + TInt aPos,
1.82 + TBool aLeadingEdge,
1.83 + const TDesC& aTextSample );
1.84 +
1.85 + /**
1.86 + * This returns a text sensitive no matches indication
1.87 + *
1.88 + * @param aRightToLeft ETrue if chunk is right to left directional text.
1.89 + * @param aBuffer const TDesC& buffer containing text to determine language dependent,
1.90 + * @returns a TPtr to the No Matches indication text to use for this buffer
1.91 + */
1.92 + TPtrC TextForUnknownPredictiveTextIndication( const TDesC& aTextSample ) const;
1.93 +
1.94 + /**
1.95 + * Returns a value that is the base value of a unicode code page. The significant content of
1.96 + * the buffer ( indices [1,aBufferLength]) and is examined from low to high index.
1.97 + * Code page is the here defined as the unicode value excluding its lowest byte - Masked
1.98 + * by 0xFF00
1.99 + *
1.100 + * If a character with non-zero code page is found, that value is returned. Otherwise, 0x0000
1.101 + * is returned
1.102 + *
1.103 + * To totally dependable, this routine depends upon the chunk being of uniform codepage,
1.104 + * or mixed codepage 0 + one other codepage. For no-matches indicator text, this is the case
1.105 + *
1.106 + * @param aTextSample buffer containing text,
1.107 + * @returns Codepage of first
1.108 + */
1.109 +
1.110 + TUint CodeBaseOfText( const TDesC& aTextSample ) const;
1.111 +
1.112 + /**
1.113 + * Utility method to test whether the next character (in the next chunk) is also in the
1.114 + * No matches indicator markup.
1.115 + *
1.116 + * @param aNexPos position in the text source of the next character (if there is one)
1.117 + * @returns ETrue only if there is another character and that is has the
1.118 + * no matches indicator markup.
1.119 + */
1.120 + TBool FormatOfNextCharacterIsUnknownInlineFepTextStyle( TInt aNextPos) const;
1.121 +
1.122 + private:
1.123 + const MTmSource& iTextSource;
1.124 + };
1.125 +
1.126 +#endif
1.127 +
1.128 +// End of File