1 /* |
1 /* |
2 * Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2006 - 2007 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
8 * |
8 * |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 // INCLUDE FILES |
19 // INCLUDE FILES |
20 #include "RichTextEditorAppUi.h" |
20 #include "RichTextEditorAppUi.h" |
21 #include "RichTextEditorContainer.h" |
21 #include "RichTextEditorContainer.h" |
22 #include <RichTextEditor.rsg> |
22 #include <RichTextEditor.rsg> |
23 #ifdef __SERIES60_3X__ |
23 |
24 #include <avkon.hrh> //Font ids |
24 #include <avkon.hrh> //Font ids |
25 #else |
25 |
26 #include <AknUtils.h> //Defined font name |
|
27 #endif |
|
28 #include "RichTextEditor.hrh" |
26 #include "RichTextEditor.hrh" |
29 |
27 |
30 #define KEnableSkinFlag 0x1000 |
28 #define KEnableSkinFlag 0x1000 |
31 #define KLayoutAwareApp 0x08 |
29 #define KLayoutAwareApp 0x08 |
32 |
30 |
37 // |
35 // |
38 // ---------------------------------------------------------- |
36 // ---------------------------------------------------------- |
39 // |
37 // |
40 void CRTEAppUi::ConstructL() |
38 void CRTEAppUi::ConstructL() |
41 { |
39 { |
42 #ifdef __SERIES60_3X__ |
40 |
43 BaseConstructL(EAknEnableSkin); |
41 BaseConstructL(EAknEnableSkin); |
44 #else |
42 |
45 BaseConstructL(KEnableSkinFlag | KLayoutAwareApp); |
|
46 #endif |
|
47 iAppContainer = new (ELeave) CRTEContainer; |
43 iAppContainer = new (ELeave) CRTEContainer; |
48 iAppContainer->SetMopParent(this); |
44 iAppContainer->SetMopParent(this); |
49 iAppContainer->ConstructL( ClientRect() ); |
45 iAppContainer->ConstructL( ClientRect() ); |
50 AddToStackL( iAppContainer ); |
46 AddToStackL( iAppContainer ); |
51 } |
47 } |
90 iAppContainer->SetCharacterBIUAttribL(CEikGlobalTextEditor::EUnderline); |
86 iAppContainer->SetCharacterBIUAttribL(CEikGlobalTextEditor::EUnderline); |
91 break; |
87 break; |
92 // Font names defined at AknUtils.h in 1st and 2nd editions. |
88 // Font names defined at AknUtils.h in 1st and 2nd editions. |
93 // Font ids at avkon.hrh from 3rd Edition onwards. |
89 // Font ids at avkon.hrh from 3rd Edition onwards. |
94 case ERichTextCmdAppFont1: |
90 case ERichTextCmdAppFont1: |
95 #ifdef __SERIES60_3X__ |
|
96 iAppContainer->SetFont(EAknLogicalFontPrimaryFont); |
91 iAppContainer->SetFont(EAknLogicalFontPrimaryFont); |
97 #else |
|
98 iAppContainer->SetFont(LatinPlain12()); |
|
99 #endif |
|
100 break; |
92 break; |
101 case ERichTextCmdAppFont2: |
93 case ERichTextCmdAppFont2: |
102 #ifdef __SERIES60_3X__ |
|
103 iAppContainer->SetFont(EAknLogicalFontSecondaryFont); |
94 iAppContainer->SetFont(EAknLogicalFontSecondaryFont); |
104 #else |
|
105 // default font at Typo application startup in 1st and 2nd edition. |
|
106 iAppContainer->SetFont(LatinBold12()); |
|
107 #endif |
|
108 break; |
95 break; |
109 case ERichTextCmdAppFont3: |
96 case ERichTextCmdAppFont3: |
110 #ifdef __SERIES60_3X__ |
|
111 iAppContainer->SetFont(EAknLogicalFontPrimarySmallFont); |
97 iAppContainer->SetFont(EAknLogicalFontPrimarySmallFont); |
112 #else |
|
113 iAppContainer->SetFont(LatinBold19()); |
|
114 #endif |
|
115 break; |
98 break; |
116 case ERichTextCmdAppSetStrikethrough: |
99 case ERichTextCmdAppSetStrikethrough: |
117 iAppContainer->Strike(); |
100 iAppContainer->Strike(); |
118 break; |
101 break; |
119 case ERichTextCmdAppLeft: |
102 case ERichTextCmdAppLeft: |