equal
deleted
inserted
replaced
19 #ifdef RD_TACTILE_FEEDBACK |
19 #ifdef RD_TACTILE_FEEDBACK |
20 |
20 |
21 #include "CMIDTactileFeedbackExtension.h" |
21 #include "CMIDTactileFeedbackExtension.h" |
22 #include "CMIDCanvas.h" |
22 #include "CMIDCanvas.h" |
23 #include "CMIDCustomItem.h" |
23 #include "CMIDCustomItem.h" |
24 |
|
25 #include <j2me/jdebug.h> |
|
26 |
24 |
27 CMIDTactileFeedbackExtension::CMIDTactileFeedbackExtension(MMIDTactileFeedbackComponent* aParent, TInt aParentType): TypeCanvas(1), TypeCustomItem(2) |
25 CMIDTactileFeedbackExtension::CMIDTactileFeedbackExtension(MMIDTactileFeedbackComponent* aParent, TInt aParentType): TypeCanvas(1), TypeCustomItem(2) |
28 |
26 |
29 { |
27 { |
30 iParent = aParent; |
28 iParent = aParent; |
74 } |
72 } |
75 |
73 |
76 void CMIDTactileFeedbackExtension::RegisterFeedbackArea(TInt aId, TRect aRect, TInt aStyle) |
74 void CMIDTactileFeedbackExtension::RegisterFeedbackArea(TInt aId, TRect aRect, TInt aStyle) |
77 { |
75 { |
78 FeedbackArea* area = GetAreaByID(aId, NULL); |
76 FeedbackArea* area = GetAreaByID(aId, NULL); |
79 TInt err = KErrNone; |
|
80 if (area) |
77 if (area) |
81 { |
78 { |
82 area->rect = aRect; |
79 area->rect = aRect; |
83 area->style = (TTouchLogicalFeedback)aStyle; |
80 area->style = (TTouchLogicalFeedback)aStyle; |
84 } |
81 } |
86 { |
83 { |
87 FeedbackArea newArea; |
84 FeedbackArea newArea; |
88 newArea.id = aId; |
85 newArea.id = aId; |
89 newArea.rect = aRect; |
86 newArea.rect = aRect; |
90 newArea.style = (TTouchLogicalFeedback)aStyle; |
87 newArea.style = (TTouchLogicalFeedback)aStyle; |
91 err = iFeedbackAreasArray.Append(newArea); |
88 iFeedbackAreasArray.Append(newArea); |
92 } |
89 } |
93 |
90 |
94 if (KErrNone == err ) |
91 iParent->UpdateTactileFeedback(); |
95 { |
|
96 iParent->UpdateTactileFeedback(); |
|
97 } |
|
98 else |
|
99 { |
|
100 DEBUG_INT("CMIDTactileFeedbackExtension::RegisterFeedbackArea - RArray append error %d", err); |
|
101 } |
|
102 } |
92 } |
103 |
93 |
104 void CMIDTactileFeedbackExtension::SetFeedbackArea(TInt aId, TRect aRect, TInt aStyle) |
94 void CMIDTactileFeedbackExtension::SetFeedbackArea(TInt aId, TRect aRect, TInt aStyle) |
105 { |
95 { |
106 if (iFeedbackInstance) |
96 if (iFeedbackInstance) |