calendarwidgetplugin/src/contentlayouthandler.cpp
changeset 1 f8e7eccf5f96
parent 0 db1bf15cefff
child 2 a4a7966c042b
--- a/calendarwidgetplugin/src/contentlayouthandler.cpp	Tue Jul 06 11:55:49 2010 +0300
+++ b/calendarwidgetplugin/src/contentlayouthandler.cpp	Wed Aug 18 09:37:48 2010 +0300
@@ -139,6 +139,7 @@
         KCalPubSubCategory.iUid, key);
     mCalendarKeyManager->stopMonitoring(calendarKey);
     delete mCalendarKeyManager;
+    delete mDateObserver;
 }
 
 /*
@@ -266,6 +267,9 @@
     setTimerForNextUpdate();
     //From DateIconLayoutHandler
     setCalendarIconContent();
+    
+    //test signal
+    emit calendarChanged();
 }
 
 /*
@@ -290,6 +294,9 @@
     }
     
     setLabelsColor();
+    //test results
+    mTestID = 1;
+    emit themeChanged();
 }
 
 /*
@@ -407,6 +414,8 @@
     LOGS("ContentLayoutHandler::eventTimerExpired");
     decorateContent();
     setTimerForNextUpdate();
+    //test signal
+    emit timerExpired();
 }
 
 /*
@@ -933,30 +942,17 @@
     }
 }
 
-void ContentLayoutHandler::handleOk(const QVariant& var)
-{
-    Q_UNUSED(var);
-
-    LOGS("ContentLayoutHandler::handleOk");
-    mTestResult = 0;
-    emit requestComplete();
-}
-
-void ContentLayoutHandler::handleError(int err, const QString& str)
-{
-    Q_UNUSED(str);
-
-    LOGS("ContentLayoutHandler::handleError");
-    mTestResult = err;
-    emit requestError();
-}
-
 void ContentLayoutHandler::highlightOn(QPointF &point)
 {
+    LOGS("ContentLayoutHandler::highlightOn");
     // --- Content layout ---
     
     if (mContainer) {
-        if (mContainer->sceneBoundingRect().contains(point)) {
+        //traslate the container rect to right position according to the scene
+        QRectF layoutRect( QPointF( mContainer->rect().topLeft().x() + mContainer->pos().x(), mContainer->rect().topLeft().y() + mContainer->pos().y() ), 
+                           QPointF( mContainer->rect().bottomRight().x() + mContainer->pos().x(), mContainer->rect().bottomRight().y() + mContainer->pos().y() ));
+        
+        if ( layoutRect.contains(point) ) {
             LOGS("[[[Highlight signal in Content area]]]");
             if (!mContentHighlightActive) {
                 HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME,
@@ -975,7 +971,11 @@
     // TODO Don't highlight if already highlighted
    
     if (mIconContainer) {
-        if (mIconContainer->sceneBoundingRect().contains(point)) {
+        //traslate the container rect to right position according to the scene        
+        QRectF layoutRect( QPointF( mIconContainer->rect().topLeft().x() + mIconContainer->pos().x(), mIconContainer->rect().topLeft().y() + mIconContainer->pos().y() ), 
+                           QPointF( mIconContainer->rect().bottomRight().x() + mIconContainer->pos().x(), mIconContainer->rect().bottomRight().y() + mIconContainer->pos().y() ));
+        
+        if ( layoutRect.contains(point) ) {
             LOGS("[[[Highlight signal in dateicon area]]]");
             if (!mDateHighlightActive) {
                 HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME,
@@ -996,8 +996,8 @@
 
 void ContentLayoutHandler::highlightOff()
 {
+    LOGS("ContentLayoutHandler::highlightOff");
     // --- Content layout ---
-    
     if (mContentHighlightActive) {
         QGraphicsItem* background1 = mContainer->backgroundItem();
         if (background1) {
@@ -1040,22 +1040,6 @@
 }
 
 /*
- * ContentLayoutHandler::testResult()
- */
-int ContentLayoutHandler::testResult()
-{
-    return mTestResult;
-}
-
-/*
- * ContentLayoutHandler::setTestResult
- */
-void ContentLayoutHandler::setTestResult(int testResult)
-{
-    mTestResult = testResult;
-}
-
-/*
  * ContentLayoutHandler::setTimerForNextUpdate()
  */
 void ContentLayoutHandler::setTimerForNextUpdate()