// ---------------------------------------------------------
// CMsgBodyControlEditor::InsertCharacterL
//
// Inserts a character to the editor.
// ---------------------------------------------------------
//
void CMsgBodyControlEditor::InsertCharacterL( const TChar& aCharacter )
    {
    	
    // 107-24185 : Emoticon support for SMS and MMS
    
    TBuf<1> text;
    text.Append( aCharacter );
    InsertTextL( text );

    //UpdateScrollBarsL();
    }
Example #2
0
/*
Given a specification for a document and a view, this function will run the
single-edit tests for that document/view.

The document is represented by a descriptor array in which each descriptor is a paragraph.

The view is represented simply by the TInt aTopOfBand argument, which tells us how
many paragraphs to lose from the top of the band. So if it is zero, then we just initialise
the doc and don't scroll at all; if it is 1 we scroll down until 1 paragraph is removed from
the top of the band, and so on. Currently it's basically only ever set to 1 or 0, and is thus
used as a boolean "top_of_doc!=top_of_band"

So, given the document/view. the function will retrieve the list of useful positions to test,
and then test:
- increasing font size
- deleting
- inserting text
- inserting various other things
...making use of various helper functions to do so
*/
void RunSingleEditTestsOnDocumentL(CRichText& aRichText, CBandMaintainer& aMaintainer,
	CBandValidator& aValidator, const MDesCArray& aTextContents, TInt aTopOfBand)
	{
	TDocumentSpec docSpec(aTextContents, aTopOfBand);
	docSpec.SetupDocumentL(aRichText, aMaintainer);


	RArray<TInt> positions;
	CleanupClosePushL(positions);

	RArray<TTmLineInfo> lines;
	CleanupClosePushL(lines);

	if(KSelectEditPointsFromWholeBand)
		{
		GetLinesInBandL(aMaintainer.TmLayoutUnderTest(), lines);
		}
	else
		{
		GetVisibleLinesL(aMaintainer.LayoutUnderTest(), lines);
		}

	PositionsToTestL(lines, positions);

	output->WriteDocumentAttributesL(aMaintainer.ViewUnderTest());
	output->WriteDocumentPositionsL(positions);

	test.Start(_L("Reformatting: change font"));
	TReformatText changeFont(aMaintainer, aRichText, aValidator, EChangeFont, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, changeFont, docSpec, positions);

	test.Next(_L("Reformatting: decrease font"));
	TReformatText decreaseFont(aMaintainer, aRichText, aValidator, EDecreaseFontSize, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, decreaseFont, docSpec, positions);

	test.Next(_L("Reformatting: make bold"));
	TReformatText makeBold(aMaintainer, aRichText, aValidator, EMakeBold, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, makeBold, docSpec, positions);

	test.Next(_L("Reformatting: increase font"));
	TReformatText increaseFont(aMaintainer, aRichText, aValidator, EIncreaseFontSize, testEnv->Device());
	ExecuteTestL(aRichText, aMaintainer, increaseFont, docSpec, positions);

	test.Next(_L("Deleting"));
	TDeleteText deleteText(aMaintainer, aRichText, aValidator);
	ExecuteTestL(aRichText, aMaintainer, deleteText, docSpec, positions);

	test.Next(_L("Inserting a space"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KSpace, positions);

	test.Next(_L("Inserting several spaces"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KSpaces, positions);

	test.Next(_L("Inserting less than a line of text"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KEnglishLessThanALine_1, positions);

	test.Next(_L("Inserting multi-line text"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KEnglishMoreThanALine_1, positions);

	test.Next(_L("Inserting RLO marker"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KRLO, positions);

	test.Next(_L("Inserting paragraph delimiter"));
	InsertTextL(aRichText, aMaintainer, aValidator, docSpec, KParagraphDelimiter, positions);

	test.End();

	CleanupStack::PopAndDestroy(2);
	}