|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Component for tooltips and other popups |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _XNPOPUP_H |
|
21 #define _XNPOPUP_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "xncomponent.h" |
|
25 #include "xnnode.h" |
|
26 #include <e32base.h> |
|
27 #include "mxncomponentinterface.h" |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 namespace XnPopupInterface |
|
32 { |
|
33 _LIT8(KType, "tooltip"); |
|
34 |
|
35 |
|
36 class MXnPopupInterface : public XnComponentInterface::MXnComponentInterface |
|
37 { |
|
38 |
|
39 public: |
|
40 static inline const TDesC8& Type() |
|
41 { |
|
42 return KType; |
|
43 } |
|
44 |
|
45 public: // New functions |
|
46 |
|
47 /** |
|
48 * Shows the popup |
|
49 * @param aContainerRect Rectangle containing the control that has a popup. |
|
50 * The popup will not overlap with this rect. |
|
51 */ |
|
52 virtual void ShowPopupL(const TRect& aContainerRect) = 0; |
|
53 virtual void ShowPopupL(const TRect& aContainerRect, |
|
54 TTimeIntervalMicroSeconds32 aShowDelay, |
|
55 TTimeIntervalMicroSeconds32 aDisplayTime) = 0; |
|
56 |
|
57 /** |
|
58 * Hides the popup |
|
59 */ |
|
60 virtual void HidePopupL() = 0; |
|
61 |
|
62 |
|
63 private: |
|
64 |
|
65 }; |
|
66 } |
|
67 |
|
68 /** |
|
69 * @ingroup group_xnpopupfactory |
|
70 * @lib NONE |
|
71 * @since Series 60 3.1 |
|
72 */ |
|
73 class CXnPopup : public CXnComponent, public XnPopupInterface::MXnPopupInterface |
|
74 { |
|
75 public: |
|
76 /** |
|
77 * 2 phase construction. |
|
78 */ |
|
79 static CXnPopup* NewL(); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 virtual ~CXnPopup(); |
|
85 |
|
86 public: // functions from base classes |
|
87 |
|
88 /** |
|
89 * From MXnPopupInterface Shows the popup |
|
90 * @param aContainerRect Rectangle containing the control that has a popup. |
|
91 * The popup will not overlap with this rect. |
|
92 * @param aPopupRect Rectangle of the control that has a popup. |
|
93 * The popup will not overlap with this rect and the popup will be drawn adjacent to this rect. |
|
94 */ |
|
95 virtual void ShowPopupL(const TRect& aContainerRect); |
|
96 virtual void ShowPopupL(const TRect& aContainerRect, |
|
97 TTimeIntervalMicroSeconds32 aShowDelay, |
|
98 TTimeIntervalMicroSeconds32 aDisplayTime); |
|
99 /** |
|
100 * From MXnPopupInterface Hides the popup |
|
101 */ |
|
102 virtual void HidePopupL(); |
|
103 /** |
|
104 * Create a component interface according to the given type. |
|
105 * @param aType Type of the interface to create |
|
106 * @return Created interface or NULL if the provided type is not supported. |
|
107 */ |
|
108 virtual XnComponentInterface::MXnComponentInterface* MakeInterfaceL(const TDesC8& aType); |
|
109 |
|
110 private: |
|
111 |
|
112 CXnPopup(); |
|
113 void ConstructL(); |
|
114 |
|
115 private: |
|
116 |
|
117 }; |
|
118 |
|
119 |
|
120 #endif // _XNPOPUP_H |
|
121 |
|
122 // End of File |