Nokia N97 SDK
Example Applications Guide

RichTextEditorContainer.h

00001 /*
00002 * ============================================================================
00003 *  Name     : CRTEContainer from RichTextEditorContainer.h
00004 *  Part of  : RichTextEditor
00005 *  Created  : 05/08/2006 by Forum Nokia
00006 *  Version  : 2.0
00007 *
00008 *  Copyright (c) 2006 - 2007 Nokia Corporation.
00009 *  This material, including documentation and any related
00010 *  computer programs, is protected by copyright controlled by
00011 *  Nokia Corporation.
00012 * ============================================================================
00013 */
00014 
00015 #ifndef RTECONTAINER_H
00016 #define RTECONTAINER_H
00017 
00018 // INCLUDES
00019 #include <coecntrl.h>
00020 #include <eikrted.h>
00021 
00022 #include "eiklabel.h"  //CEikLabel
00023 
00024 #include "mypicture.h"
00025 // FORWARD DECLARATIONS
00026 
00027 // CLASS DECLARATION
00028 
00029 /**
00030 *  CRTEContainer  container control class.
00031 */
00032 class CRTEContainer : public CCoeControl
00033     {
00034     public: // Constructors and destructor
00035 
00036         /**
00037         * EPOC default constructor.
00038         * @param aRect Frame rectangle for container.
00039         */
00040         void ConstructL(const TRect& aRect);
00041 
00042         /**
00043         * Destructor.
00044         */
00045         ~CRTEContainer();
00046 
00047        /**
00048         * Toggle -left-center-right- alignment within the actual paragraph
00049         */
00050         void SetAlignment(CParaFormat::TAlignment );
00051                 //! Select an area of text
00052         void SetSelectionL(TInt,TInt);
00053                 //! Swicht on/off the Bold/Italic/Underline attributes
00054         void SetCharacterBIUAttribL(CEikGlobalTextEditor::TFontStyleFlags );
00055 
00056         #ifdef __SERIES60_3X__
00057        /**
00058                 * Change the text's font from 3rd Edition onwards
00059                 */
00060                 void SetFont(TInt aFontId);
00061         #else
00062                 //! Change the text's font
00063                 void SetFont(const CFont* );
00064         #endif
00065        /**
00066         * Toggle between strikethrough or not strikethrough text
00067         */
00068         void Strike();
00069        /**
00070                 * Change the text's color
00071                 */
00072         void SetColor(TRgb );
00073                 //! Demonstrate the how program use some Richtext feature
00074         void IntroL();
00075 
00076        /**
00077         * Create Demo Content
00078         */
00079                 void DemoL();
00080 
00081 
00082     public: // Functions from base classes
00083 
00084     private:
00085         // New functions
00086 
00087                 //! Prepare the Richtext Editor, set the Editor flags
00088                 void Prepare();
00089 
00090                 //! Apply the final settings after the Editor is activated
00091                 void SetupL();
00092 
00093                 //! Append Bitmap to iBitmap Array
00094                 void PrepareBitmapL();
00095                 //! Call Richtext's InsertL() with the CPicture
00096                 void InsertMyPictureL(TInt aPos);
00097 
00098                 //! Echo the last engine operation to the status line
00099         void Echo(TInt );
00100 
00101 
00102                 // Functions from base classes
00103 
00104        /**
00105         * From CoeControl,SizeChanged.
00106         */
00107         void SizeChanged();
00108 
00109 
00110        /**
00111         * From CoeControl,CountComponentControls.
00112         */
00113         TInt CountComponentControls() const;
00114 
00115        /**
00116         * From CCoeControl,ComponentControl.
00117         */
00118         CCoeControl* ComponentControl(TInt aIndex) const;
00119 
00120        /**
00121         * From CCoeControl,Draw.
00122         */
00123         void Draw(const TRect& aRect) const;
00124 
00125                 /**
00126         * From CCoeControl,OfferKeyEventL.
00127         */
00128                 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
00129 
00130     private: //data
00131 
00132                 CEikRichTextEditor* iRtEd; // Rich Text Editor
00133                 CArrayFixFlat<CFbsBitmap*>* iBitmap; // Reference Array for Images
00134                 CEikLabel* iStatusLine; // Status line Label
00135                 TBool iStrike;// Strikethrough Switch
00136     };
00137 
00138 #endif
00139 
00140 // End of File

© Nokia 2009

Back to top