|
1 /* |
|
2 * Copyright (c) 2007 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: Utility used for activation events |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef M_ITEMFINDEROBSERVER_H |
|
22 #define M_ITEMFINDEROBSERVER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <ItemFinder.h> // for CItemFinder::CFindItemExt |
|
26 |
|
27 /** |
|
28 * Item activation observer. |
|
29 * |
|
30 * Notifies observer when user activates highlightable items in |
|
31 * CEikRichTextEditor. Observer class should implement this interface and |
|
32 * register itself to @c CItemFinder to receive item activation events. |
|
33 * |
|
34 * The sent event includes information about the activated item, |
|
35 * method of activation and additional information about the activation. |
|
36 * |
|
37 * Code example of listening to activation events: |
|
38 * @code |
|
39 * void CItemFinderObserver::HandleFindItemEventL( |
|
40 * CItemFinder::CFindItemExt& aItem, |
|
41 * MAknItemFinderObserver::TEventFlag aEvent, |
|
42 * TUint aFlags ) |
|
43 * { |
|
44 * if ( aEvent == MAknItemFinderObserver::EPointerEvent |
|
45 * && aItem.iItemType == CItemFinder::EPhoneNumber ) |
|
46 * { |
|
47 * HandleCallL( aItem.iItemDescriptor->Des() ); |
|
48 * } |
|
49 * } |
|
50 * @endcode |
|
51 * |
|
52 * @lib commonui.lib |
|
53 * @since S60 v5.2 |
|
54 */ |
|
55 class MAknItemFinderObserver |
|
56 { |
|
57 public: |
|
58 /** |
|
59 * Enum for activation event flags. |
|
60 */ |
|
61 enum TEventFlag |
|
62 { |
|
63 /** |
|
64 * Item was activated by a pointer event. |
|
65 */ |
|
66 EPointerEvent = 0x00000001, |
|
67 /** |
|
68 * Item was activated by a key event. |
|
69 */ |
|
70 EKeyEvent = 0x00000002 |
|
71 }; |
|
72 /** |
|
73 * Handles the activation event. |
|
74 * |
|
75 * @param aItem Activated item. |
|
76 * @param aEvent Activation method. |
|
77 * @param aFlags Additional information about the event. |
|
78 */ |
|
79 virtual void HandleFindItemEventL( |
|
80 const CItemFinder::CFindItemExt& aItem, |
|
81 MAknItemFinderObserver::TEventFlag aEvent, |
|
82 TUint aFlags = 0 ) = 0; |
|
83 }; |
|
84 |
|
85 #endif // M_ITEMFINDEROBSERVER_H |