|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.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 * |
|
14 * Description: Declaration of customized editor control. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NPDEDWIN_H |
|
20 #define NPDEDWIN_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <eikedwin.h> //CEikEdwin |
|
24 #include "NpdEdwinExposer.h" |
|
25 #include "NpdEdwinBase.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CNotepadEdwinLines; |
|
29 |
|
30 class CTextLayout; |
|
31 class CTextView; |
|
32 // CLASS DECLARATION |
|
33 /** |
|
34 * Customized editable window control. |
|
35 * CNotepadEdwin is an editable window control class customized to implement |
|
36 * the LAF of Notepad. |
|
37 * |
|
38 * @lib NpdLib.lib |
|
39 * @see CNotepadEditorDialog |
|
40 */ |
|
41 class CNotepadEdwin : public CEikEdwin, |
|
42 public MNotepadEdwinExposer |
|
43 { |
|
44 public: // New function |
|
45 |
|
46 /** |
|
47 * Sets the layout of the edwin and the scrollbar. |
|
48 * |
|
49 */ |
|
50 void DoEditorLayoutL(); |
|
51 |
|
52 /** |
|
53 * Initialize the editor. |
|
54 * This function should be called from dialog's PostLayoutDynInitL. |
|
55 * |
|
56 */ |
|
57 void InitNotepadEditorL( |
|
58 CEikDialog* aParent, |
|
59 CNotepadEdwinLines* aEdwinLines = NULL); |
|
60 |
|
61 /** |
|
62 * Construct CNotepadEdwinBase. |
|
63 * This function should be called after construction |
|
64 * |
|
65 */ |
|
66 void ConstructBaseL(); |
|
67 /** |
|
68 * Restrict format area of the editor to visible lines only. |
|
69 * This function calls iTextLayout->SetAmountToFormat(). |
|
70 * |
|
71 */ |
|
72 inline void SetAmountToFormat(TInt aDocumentSizeInCharacters); |
|
73 |
|
74 /** |
|
75 * Gets an object whose type is encapsulated by |
|
76 * the specified TTypeUid object. |
|
77 * |
|
78 */ |
|
79 TTypeUid::Ptr MopSupplyObject(TTypeUid aId); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 * |
|
84 */ |
|
85 ~CNotepadEdwin(); |
|
86 |
|
87 public: |
|
88 /** |
|
89 * Set background color specified by LAF. |
|
90 */ |
|
91 void SetBackgroundColorL(); |
|
92 |
|
93 // Functions from base classes |
|
94 |
|
95 /** |
|
96 * From CCoeControl. |
|
97 * Call when a certain resource has changed. |
|
98 * We only handle KEikColorResourceChange. |
|
99 * |
|
100 * @param aType type of event. |
|
101 */ |
|
102 void HandleResourceChange(TInt aType); |
|
103 private: |
|
104 /** |
|
105 * From CCoeControl. |
|
106 * Call when a certain resource has changed. |
|
107 * We only handle KEikColorResourceChange. |
|
108 * |
|
109 * @param aType type of event. |
|
110 */ |
|
111 void Draw(const TRect& aRect) const; |
|
112 |
|
113 /** |
|
114 * From MEdwinExposer |
|
115 * Called by iEdwinBase to get iLayout |
|
116 */ |
|
117 CTextLayout& GetLayout(); |
|
118 |
|
119 /** |
|
120 * From MEdwinExposer |
|
121 * Called by iEdwinBase to get iTextView |
|
122 */ |
|
123 CTextView& GetTextView(); |
|
124 |
|
125 /** |
|
126 * From MEdwinExposer |
|
127 * Called by iEdwinBase to call SetCanDrawOutsideRect() |
|
128 */ |
|
129 void CallSetCanDrawOutsideRect(); |
|
130 |
|
131 /** |
|
132 * From MEdwinExposer |
|
133 * Called by iEdwinBase to get iCoeEnv |
|
134 */ |
|
135 CCoeEnv& GetCoeEnv(); |
|
136 |
|
137 private: // Data |
|
138 CNotepadEdwinBase* iEdwinBase; |
|
139 }; |
|
140 |
|
141 #include "NpdEdwin.inl" |
|
142 #endif // NPDEDWIN_H |
|
143 |
|
144 // End of File |