calendarui/views/src/calenpluginlabel.cpp
changeset 51 0b38fc5b94c6
parent 45 b6db4fd4947b
equal deleted inserted replaced
46:ecd7b9840282 51:0b38fc5b94c6
    19 #include <hbtapgesture.h>
    19 #include <hbtapgesture.h>
    20 
    20 
    21 // User includes
    21 // User includes
    22 #include "calenservices.h"
    22 #include "calenservices.h"
    23 #include "calenpluginlabel.h"
    23 #include "calenpluginlabel.h"
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "calenpluginlabelTraces.h"
       
    27 #endif
       
    28 
    24 /*!
    29 /*!
    25  \class CalenPluginLabel
    30  \class CalenPluginLabel
    26 
    31 
    27  Class to show plugin information on Label
    32  Class to show plugin information on Label
    28  */
    33  */
    29 
    34 
    30 /*!
    35 /*!
    31  constructor
    36  constructor
    32  */
    37  */
    33 Q_DECL_EXPORT CalenPluginLabel::CalenPluginLabel(MCalenServices& services, 
    38 CalenPluginLabel::CalenPluginLabel(MCalenServices& services, 
    34                                    QGraphicsItem* parent) :
    39                                    QGraphicsItem* parent) :
    35 	HbLabel(parent),mServices(services)
    40 	HbLabel(parent),mServices(services)
    36 {
    41 {
       
    42     OstTraceFunctionEntry0( CALENPLUGINLABEL_CALENPLUGINLABEL_ENTRY );
       
    43     
    37 	setAlignment(Qt::AlignCenter);
    44 	setAlignment(Qt::AlignCenter);
    38 	grabGesture(Qt::TapGesture);
    45 	grabGesture(Qt::TapGesture);
       
    46 	
       
    47 	OstTraceFunctionExit0( CALENPLUGINLABEL_CALENPLUGINLABEL_EXIT );
    39 }
    48 }
    40 
    49 
    41 /*!
    50 /*!
    42  Destructor
    51  Destructor
    43  */
    52  */
    44 Q_DECL_EXPORT CalenPluginLabel::~CalenPluginLabel()
    53 CalenPluginLabel::~CalenPluginLabel()
    45 {
    54 {
       
    55     OstTraceFunctionEntry0( DUP1_CALENPLUGINLABEL_CALENPLUGINLABEL_ENTRY );
       
    56     
       
    57     OstTraceFunctionExit0( DUP1_CALENPLUGINLABEL_CALENPLUGINLABEL_EXIT );
    46 }
    58 }
    47 
    59 
    48 
    60 
    49 /*!
    61 /*!
    50 	Functo listen for all gestures
    62 	Functo listen for all gestures
    51 */
    63 */
    52 void CalenPluginLabel::gestureEvent(QGestureEvent *event)
    64 void CalenPluginLabel::gestureEvent(QGestureEvent *event)
    53 {
    65 {
       
    66     OstTraceFunctionEntry0( CALENPLUGINLABEL_GESTUREEVENT_ENTRY );
       
    67     
    54     if(HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {
    68     if(HbTapGesture *gesture = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {
    55         if (gesture->state() == Qt::GestureFinished) {
    69         if (gesture->state() == Qt::GestureFinished) {
    56             if (gesture->tapStyleHint() == HbTapGesture::Tap) {
    70             if (gesture->tapStyleHint() == HbTapGesture::Tap) {
    57                 // Regional label is tapped
    71                 // Regional label is tapped
    58                 mServices.IssueCommandL(ECalenRegionalPluginTapEvent);
    72                 mServices.IssueCommandL(ECalenRegionalPluginTapEvent);
    59                 event->accept(Qt::TapGesture);
    73                 event->accept(Qt::TapGesture);
    60             }
    74             }
    61         }
    75         }
    62     }
    76     }
       
    77     
       
    78     OstTraceFunctionExit0( CALENPLUGINLABEL_GESTUREEVENT_EXIT );
    63 }
    79 }
    64 
    80 
    65 
    81 
    66 // End of file  --Don't remove this.
    82 // End of file  --Don't remove this.