javauis/lcdui_akn/lcdui/src/CMIDTactileFeedbackExtension.cpp
branchRCL_3
changeset 60 6c158198356e
parent 19 04becd199f91
equal deleted inserted replaced
59:e5618cc85d74 60:6c158198356e
    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>
    24 
    26 
    25 CMIDTactileFeedbackExtension::CMIDTactileFeedbackExtension(MMIDTactileFeedbackComponent* aParent, TInt aParentType): TypeCanvas(1), TypeCustomItem(2)
    27 CMIDTactileFeedbackExtension::CMIDTactileFeedbackExtension(MMIDTactileFeedbackComponent* aParent, TInt aParentType): TypeCanvas(1), TypeCustomItem(2)
    26 
    28 
    27 {
    29 {
    28     iParent = aParent;
    30     iParent = aParent;
    72 }
    74 }
    73 
    75 
    74 void CMIDTactileFeedbackExtension::RegisterFeedbackArea(TInt aId, TRect aRect, TInt aStyle)
    76 void CMIDTactileFeedbackExtension::RegisterFeedbackArea(TInt aId, TRect aRect, TInt aStyle)
    75 {
    77 {
    76     FeedbackArea* area = GetAreaByID(aId, NULL);
    78     FeedbackArea* area = GetAreaByID(aId, NULL);
       
    79     TInt err = KErrNone;
    77     if (area)
    80     if (area)
    78     {
    81     {
    79         area->rect = aRect;
    82         area->rect = aRect;
    80         area->style = (TTouchLogicalFeedback)aStyle;
    83         area->style = (TTouchLogicalFeedback)aStyle;
    81     }
    84     }
    83     {
    86     {
    84         FeedbackArea newArea;
    87         FeedbackArea newArea;
    85         newArea.id  = aId;
    88         newArea.id  = aId;
    86         newArea.rect = aRect;
    89         newArea.rect = aRect;
    87         newArea.style = (TTouchLogicalFeedback)aStyle;
    90         newArea.style = (TTouchLogicalFeedback)aStyle;
    88         iFeedbackAreasArray.Append(newArea);
    91         err = iFeedbackAreasArray.Append(newArea);
    89     }
    92     }
    90 
    93 
    91     iParent->UpdateTactileFeedback();
    94     if (KErrNone == err )
       
    95     {
       
    96         iParent->UpdateTactileFeedback();
       
    97     }
       
    98     else
       
    99     {
       
   100         DEBUG_INT("CMIDTactileFeedbackExtension::RegisterFeedbackArea - RArray append error %d", err);
       
   101     }
    92 }
   102 }
    93 
   103 
    94 void CMIDTactileFeedbackExtension::SetFeedbackArea(TInt aId, TRect aRect, TInt aStyle)
   104 void CMIDTactileFeedbackExtension::SetFeedbackArea(TInt aId, TRect aRect, TInt aStyle)
    95 {
   105 {
    96     if (iFeedbackInstance)
   106     if (iFeedbackInstance)