0
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
1
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
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 |
*
|
1
|
14 |
* Description:
|
0
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#ifndef RTECONTAINER_H
|
|
20 |
#define RTECONTAINER_H
|
|
21 |
|
|
22 |
// INCLUDES
|
|
23 |
#include <coecntrl.h>
|
|
24 |
#include <eikrted.h>
|
|
25 |
|
|
26 |
#include "eiklabel.h" //CEikLabel
|
|
27 |
|
|
28 |
#include "mypicture.h"
|
|
29 |
// FORWARD DECLARATIONS
|
|
30 |
|
|
31 |
// CLASS DECLARATION
|
|
32 |
|
|
33 |
/**
|
|
34 |
* CRTEContainer container control class.
|
|
35 |
*/
|
|
36 |
class CRTEContainer : public CCoeControl
|
|
37 |
{
|
|
38 |
public: // Constructors and destructor
|
|
39 |
|
|
40 |
/**
|
|
41 |
* EPOC default constructor.
|
|
42 |
* @param aRect Frame rectangle for container.
|
|
43 |
*/
|
|
44 |
void ConstructL(const TRect& aRect);
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Destructor.
|
|
48 |
*/
|
|
49 |
~CRTEContainer();
|
|
50 |
|
|
51 |
/**
|
|
52 |
* Toggle -left-center-right- alignment within the actual paragraph
|
|
53 |
*/
|
|
54 |
void SetAlignment(CParaFormat::TAlignment );
|
|
55 |
//! Select an area of text
|
|
56 |
void SetSelectionL(TInt,TInt);
|
|
57 |
//! Swicht on/off the Bold/Italic/Underline attributes
|
|
58 |
void SetCharacterBIUAttribL(CEikGlobalTextEditor::TFontStyleFlags );
|
|
59 |
|
1
|
60 |
|
0
|
61 |
/**
|
|
62 |
* Change the text's font from 3rd Edition onwards
|
|
63 |
*/
|
|
64 |
void SetFont(TInt aFontId);
|
1
|
65 |
|
0
|
66 |
/**
|
|
67 |
* Toggle between strikethrough or not strikethrough text
|
|
68 |
*/
|
|
69 |
void Strike();
|
|
70 |
/**
|
|
71 |
* Change the text's color
|
|
72 |
*/
|
|
73 |
void SetColor(TRgb );
|
|
74 |
//! Demonstrate the how program use some Richtext feature
|
|
75 |
void IntroL();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Create Demo Content
|
|
79 |
*/
|
|
80 |
void DemoL();
|
|
81 |
|
|
82 |
|
|
83 |
public: // Functions from base classes
|
|
84 |
|
|
85 |
private:
|
|
86 |
// New functions
|
|
87 |
|
|
88 |
//! Prepare the Richtext Editor, set the Editor flags
|
|
89 |
void Prepare();
|
|
90 |
|
|
91 |
//! Apply the final settings after the Editor is activated
|
|
92 |
void SetupL();
|
|
93 |
|
|
94 |
//! Append Bitmap to iBitmap Array
|
|
95 |
void PrepareBitmapL();
|
|
96 |
//! Call Richtext's InsertL() with the CPicture
|
|
97 |
void InsertMyPictureL(TInt aPos);
|
|
98 |
|
|
99 |
//! Echo the last engine operation to the status line
|
|
100 |
void Echo(TInt );
|
|
101 |
|
|
102 |
|
|
103 |
// Functions from base classes
|
|
104 |
|
|
105 |
/**
|
|
106 |
* From CoeControl,SizeChanged.
|
|
107 |
*/
|
|
108 |
void SizeChanged();
|
|
109 |
|
|
110 |
|
|
111 |
/**
|
|
112 |
* From CoeControl,CountComponentControls.
|
|
113 |
*/
|
|
114 |
TInt CountComponentControls() const;
|
|
115 |
|
|
116 |
/**
|
|
117 |
* From CCoeControl,ComponentControl.
|
|
118 |
*/
|
|
119 |
CCoeControl* ComponentControl(TInt aIndex) const;
|
|
120 |
|
|
121 |
/**
|
|
122 |
* From CCoeControl,Draw.
|
|
123 |
*/
|
|
124 |
void Draw(const TRect& aRect) const;
|
|
125 |
|
|
126 |
/**
|
|
127 |
* From CCoeControl,OfferKeyEventL.
|
|
128 |
*/
|
|
129 |
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
|
|
130 |
|
|
131 |
private: //data
|
|
132 |
|
|
133 |
CEikRichTextEditor* iRtEd; // Rich Text Editor
|
|
134 |
CArrayFixFlat<CFbsBitmap*>* iBitmap; // Reference Array for Images
|
|
135 |
CEikLabel* iStatusLine; // Status line Label
|
|
136 |
TBool iStrike;// Strikethrough Switch
|
|
137 |
};
|
|
138 |
|
|
139 |
#endif
|
|
140 |
|
|
141 |
// End of File
|