|
1 /* |
|
2 * Copyright (c) 2009 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 * Defines an interface for LCDUI custom components |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MMIDCUSTOMCOMPONENT_H |
|
20 #define MMIDCUSTOMCOMPONENT_H |
|
21 |
|
22 // EXTERNAL INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CCoeControl; |
|
27 |
|
28 /** |
|
29 * Interface for LCDUI custom components. |
|
30 * |
|
31 * This interface can be used to interact as a custom UI component |
|
32 * in LCDUI components that implement a container for custom |
|
33 * components. |
|
34 * |
|
35 * The client can use this interface to access information about |
|
36 * UI controls that the implementing class provides. |
|
37 * |
|
38 * @lib lcdui |
|
39 * @since S60 5.0 |
|
40 */ |
|
41 class MMIDCustomComponent |
|
42 { |
|
43 public: // New methods |
|
44 |
|
45 /** |
|
46 * Returns the count of controls in this custom component. |
|
47 * |
|
48 * Note that the count must not change during the lifetime |
|
49 * of the object. The count of all components is updated |
|
50 * when it is added to the custom component container. |
|
51 * |
|
52 * This is done in order to improve the performance when counting |
|
53 * countrols. |
|
54 * |
|
55 * @return The count of controls in this custom component. |
|
56 * @since S60 5.0 |
|
57 */ |
|
58 virtual TInt CustomComponentControlCount() const = 0; |
|
59 |
|
60 /** |
|
61 * Returns an UI control of this custom component. |
|
62 * |
|
63 * The index specifies which component is requested. The method |
|
64 * works similar to CCoeControl::ComponentControl() method. The |
|
65 * ownership of the control is NOT transferred to the caller. |
|
66 * |
|
67 * @param aIndex The index of the control to be retrieved. |
|
68 * @return The UI control of this custom component. |
|
69 * @since S60 5.0 |
|
70 */ |
|
71 virtual CCoeControl* CustomComponentControl(TInt aIndex) = 0; |
|
72 |
|
73 /** |
|
74 * Indicates that the container is about to be disposed. |
|
75 * |
|
76 * The custom component does not have to remove itself |
|
77 * from the container since the container removes all components |
|
78 * when disposing. |
|
79 * |
|
80 * @since S60 5.0 |
|
81 */ |
|
82 virtual void CustomComponentContainerDisposing() = 0; |
|
83 |
|
84 /** |
|
85 * Indicates if traversal can be done. |
|
86 * |
|
87 * Used when changing focus by key down and up. |
|
88 * |
|
89 * @param aEvent Key Event. |
|
90 * @since S60 5.0 |
|
91 */ |
|
92 virtual void TraverseL(const TKeyEvent& aEvent) = 0; |
|
93 |
|
94 /** |
|
95 * Processes the received pointer event. |
|
96 * |
|
97 * @param aPointerEvent The pointer event. iPosition will be reset to the |
|
98 * parent window position. iParentPosition will be invalid for the |
|
99 * container. |
|
100 * @since S60 5.0 |
|
101 */ |
|
102 virtual void ProcessPointerEventL(const TPointerEvent& aPointerEvent) = 0; |
|
103 |
|
104 /** |
|
105 * Gets the current touch-enabled state |
|
106 * |
|
107 * @return true if the component is touch-enabled, false otherwise |
|
108 * @since S60 5.0 |
|
109 */ |
|
110 virtual TBool IsTouchEnabled() = 0; |
|
111 |
|
112 /** |
|
113 * Handles fullscreen state of parent Canvas. |
|
114 * |
|
115 * @since S60 5.0 |
|
116 */ |
|
117 virtual void HandleFullscreenModeChange() = 0; |
|
118 |
|
119 /** |
|
120 * Handles changes of screen orientation. |
|
121 * |
|
122 * @since S60 5.0 |
|
123 */ |
|
124 virtual void HandleResolutionChange() = 0; |
|
125 |
|
126 protected: // Destructor |
|
127 |
|
128 /** |
|
129 * Destructor. Disallows destruction through this interface |
|
130 */ |
|
131 virtual ~MMIDCustomComponent() {} |
|
132 }; |
|
133 |
|
134 #endif // MMIDCUSTOMCOMPONENT_H |
|
135 |
|
136 // End of file |