williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 1997-1999 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined(__EIKEDWOB_H__)
|
williamr@2
|
20 |
#define __EIKEDWOB_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
class CEikEdwin;
|
williamr@2
|
23 |
|
williamr@2
|
24 |
/**
|
williamr@2
|
25 |
* Interface class describing the functionality expected of an observer
|
williamr@2
|
26 |
* for CEikEdwins.
|
williamr@2
|
27 |
*
|
williamr@2
|
28 |
* Edwin observers are informed by the edwin whenever its content is
|
williamr@2
|
29 |
* changed, or whenever the user changes the cursor position.
|
williamr@2
|
30 |
*
|
williamr@2
|
31 |
* This class should be derived from by all observers of edwins.
|
williamr@2
|
32 |
*/
|
williamr@2
|
33 |
class MEikEdwinObserver
|
williamr@2
|
34 |
{
|
williamr@2
|
35 |
public:
|
williamr@2
|
36 |
/**
|
williamr@2
|
37 |
* Events from a value editor.
|
williamr@2
|
38 |
*/
|
williamr@2
|
39 |
enum TEdwinEvent
|
williamr@2
|
40 |
{
|
williamr@2
|
41 |
/** Sent whenever the content of the edwin changes. */
|
williamr@2
|
42 |
EEventFormatChanged,
|
williamr@2
|
43 |
/** Sent on receipt of a navigation command. */
|
williamr@2
|
44 |
EEventNavigation,
|
williamr@2
|
45 |
/**
|
williamr@2
|
46 |
* Sent whenever the text of the edwin changes. To observe
|
williamr@2
|
47 |
* actual changes in the contents of the editor this should
|
williamr@2
|
48 |
* be preferred to EEventFormatChanged.
|
williamr@2
|
49 |
*/
|
williamr@2
|
50 |
EEventTextUpdate,
|
williamr@2
|
51 |
/** Sent on receipt of a scroll event. */
|
williamr@2
|
52 |
EEventScroll,
|
williamr@2
|
53 |
/** Sent if you explicitly call edwin's SetTextL() */
|
williamr@4
|
54 |
EEventTextUpdateAPI,
|
williamr@4
|
55 |
EEventChinesePopupOpen,
|
williamr@4
|
56 |
EEventChinesePopupClose,
|
williamr@4
|
57 |
EEventPartialScreenEnable,
|
williamr@4
|
58 |
EEventPartialScreenDisable
|
williamr@2
|
59 |
};
|
williamr@2
|
60 |
public:
|
williamr@2
|
61 |
/**
|
williamr@2
|
62 |
* This pure virtual function is invoked by CEikEdwin to report an event
|
williamr@2
|
63 |
* to its observer. The observer may respond appropriately.
|
williamr@2
|
64 |
*
|
williamr@2
|
65 |
* @param aEdwin The originating edwin.
|
williamr@2
|
66 |
* @param aEventType The event being reported.
|
williamr@2
|
67 |
*/
|
williamr@2
|
68 |
virtual void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType)=0;
|
williamr@2
|
69 |
};
|
williamr@2
|
70 |
|
williamr@2
|
71 |
/**
|
williamr@2
|
72 |
* Interface to handle changes to an edwin's size.
|
williamr@2
|
73 |
*/
|
williamr@2
|
74 |
class MEikEdwinSizeObserver
|
williamr@2
|
75 |
{
|
williamr@2
|
76 |
public:
|
williamr@2
|
77 |
/**
|
williamr@2
|
78 |
* Specifies the type of event reported to the edwin observer.
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
enum TEdwinSizeEvent
|
williamr@2
|
81 |
{
|
williamr@2
|
82 |
/**
|
williamr@2
|
83 |
* Specifies a change in edwin size. When the edwin observer
|
williamr@2
|
84 |
* receives an event of this type, it handles it by making
|
williamr@2
|
85 |
* its view bigger or smaller according to the new edwin size.
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
EEventSizeChanging
|
williamr@2
|
88 |
};
|
williamr@2
|
89 |
public:
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
* Handles a change in the edwin's size. If you implement this function,
|
williamr@2
|
92 |
* ensure it returns ETrue if you wish to redraw the edwin.
|
williamr@2
|
93 |
*
|
williamr@2
|
94 |
* @param aEdwin The edwin for which the size event is being handled.
|
williamr@2
|
95 |
* @param aEventType The event type.
|
williamr@2
|
96 |
* @param aDesirableEdwinSize The desired size for the edwin identified
|
williamr@2
|
97 |
* by aEdwin.
|
williamr@2
|
98 |
* @return The return value depends on your implementation. Return
|
williamr@2
|
99 |
* ETrue if you wish to redraw the edwin. EFalse otherwise.
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
virtual TBool HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize)=0;
|
williamr@2
|
102 |
};
|
williamr@2
|
103 |
|
williamr@2
|
104 |
#endif
|