137 unsigned long int key = (unsigned long int)ECalPubSubEventNotification; |
137 unsigned long int key = (unsigned long int)ECalPubSubEventNotification; |
138 XQSettingsKey calendarKey(XQSettingsKey::TargetPublishAndSubscribe, |
138 XQSettingsKey calendarKey(XQSettingsKey::TargetPublishAndSubscribe, |
139 KCalPubSubCategory.iUid, key); |
139 KCalPubSubCategory.iUid, key); |
140 mCalendarKeyManager->stopMonitoring(calendarKey); |
140 mCalendarKeyManager->stopMonitoring(calendarKey); |
141 delete mCalendarKeyManager; |
141 delete mCalendarKeyManager; |
|
142 delete mDateObserver; |
142 } |
143 } |
143 |
144 |
144 /* |
145 /* |
145 * ContentLayoutHandler::initializeLayout() |
146 * ContentLayoutHandler::initializeLayout() |
146 */ |
147 */ |
264 LOGS("ContentLayoutHandler::updateLayout"); |
265 LOGS("ContentLayoutHandler::updateLayout"); |
265 decorateContent(); |
266 decorateContent(); |
266 setTimerForNextUpdate(); |
267 setTimerForNextUpdate(); |
267 //From DateIconLayoutHandler |
268 //From DateIconLayoutHandler |
268 setCalendarIconContent(); |
269 setCalendarIconContent(); |
|
270 |
|
271 //test signal |
|
272 emit calendarChanged(); |
269 } |
273 } |
270 |
274 |
271 /* |
275 /* |
272 * ContentLayoutHandler::onThemeChange() |
276 * ContentLayoutHandler::onThemeChange() |
273 */ |
277 */ |
931 i++; |
940 i++; |
932 } |
941 } |
933 } |
942 } |
934 } |
943 } |
935 |
944 |
936 void ContentLayoutHandler::handleOk(const QVariant& var) |
|
937 { |
|
938 Q_UNUSED(var); |
|
939 |
|
940 LOGS("ContentLayoutHandler::handleOk"); |
|
941 mTestResult = 0; |
|
942 emit requestComplete(); |
|
943 } |
|
944 |
|
945 void ContentLayoutHandler::handleError(int err, const QString& str) |
|
946 { |
|
947 Q_UNUSED(str); |
|
948 |
|
949 LOGS("ContentLayoutHandler::handleError"); |
|
950 mTestResult = err; |
|
951 emit requestError(); |
|
952 } |
|
953 |
|
954 void ContentLayoutHandler::highlightOn(QPointF &point) |
945 void ContentLayoutHandler::highlightOn(QPointF &point) |
955 { |
946 { |
|
947 LOGS("ContentLayoutHandler::highlightOn"); |
956 // --- Content layout --- |
948 // --- Content layout --- |
957 |
949 |
958 if (mContainer) { |
950 if (mContainer) { |
959 if (mContainer->sceneBoundingRect().contains(point)) { |
951 //traslate the container rect to right position according to the scene |
|
952 QRectF layoutRect( QPointF( mContainer->rect().topLeft().x() + mContainer->pos().x(), mContainer->rect().topLeft().y() + mContainer->pos().y() ), |
|
953 QPointF( mContainer->rect().bottomRight().x() + mContainer->pos().x(), mContainer->rect().bottomRight().y() + mContainer->pos().y() )); |
|
954 |
|
955 if ( layoutRect.contains(point) ) { |
960 LOGS("[[[Highlight signal in Content area]]]"); |
956 LOGS("[[[Highlight signal in Content area]]]"); |
961 if (!mContentHighlightActive) { |
957 if (!mContentHighlightActive) { |
962 HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME, |
958 HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME, |
963 HbFrameDrawer::NinePieces); |
959 HbFrameDrawer::NinePieces); |
964 HbFrameItem* highlightItem = new HbFrameItem(highlightDrawer); |
960 HbFrameItem* highlightItem = new HbFrameItem(highlightDrawer); |
973 // --- Date layout --- |
969 // --- Date layout --- |
974 |
970 |
975 // TODO Don't highlight if already highlighted |
971 // TODO Don't highlight if already highlighted |
976 |
972 |
977 if (mIconContainer) { |
973 if (mIconContainer) { |
978 if (mIconContainer->sceneBoundingRect().contains(point)) { |
974 //traslate the container rect to right position according to the scene |
|
975 QRectF layoutRect( QPointF( mIconContainer->rect().topLeft().x() + mIconContainer->pos().x(), mIconContainer->rect().topLeft().y() + mIconContainer->pos().y() ), |
|
976 QPointF( mIconContainer->rect().bottomRight().x() + mIconContainer->pos().x(), mIconContainer->rect().bottomRight().y() + mIconContainer->pos().y() )); |
|
977 |
|
978 if ( layoutRect.contains(point) ) { |
979 LOGS("[[[Highlight signal in dateicon area]]]"); |
979 LOGS("[[[Highlight signal in dateicon area]]]"); |
980 if (!mDateHighlightActive) { |
980 if (!mDateHighlightActive) { |
981 HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME, |
981 HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME, |
982 HbFrameDrawer::NinePieces); |
982 HbFrameDrawer::NinePieces); |
983 HbFrameItem* highlightItem = new HbFrameItem(highlightDrawer); |
983 HbFrameItem* highlightItem = new HbFrameItem(highlightDrawer); |
994 } |
994 } |
995 } |
995 } |
996 |
996 |
997 void ContentLayoutHandler::highlightOff() |
997 void ContentLayoutHandler::highlightOff() |
998 { |
998 { |
|
999 LOGS("ContentLayoutHandler::highlightOff"); |
999 // --- Content layout --- |
1000 // --- Content layout --- |
1000 |
|
1001 if (mContentHighlightActive) { |
1001 if (mContentHighlightActive) { |
1002 QGraphicsItem* background1 = mContainer->backgroundItem(); |
1002 QGraphicsItem* background1 = mContainer->backgroundItem(); |
1003 if (background1) { |
1003 if (background1) { |
1004 background1->hide(); |
1004 background1->hide(); |
1005 } |
1005 } |
1035 * ContentLayoutHandler::setTestId() |
1035 * ContentLayoutHandler::setTestId() |
1036 */ |
1036 */ |
1037 void ContentLayoutHandler::setTestId(int testID) |
1037 void ContentLayoutHandler::setTestId(int testID) |
1038 { |
1038 { |
1039 mTestID = testID; |
1039 mTestID = testID; |
1040 } |
|
1041 |
|
1042 /* |
|
1043 * ContentLayoutHandler::testResult() |
|
1044 */ |
|
1045 int ContentLayoutHandler::testResult() |
|
1046 { |
|
1047 return mTestResult; |
|
1048 } |
|
1049 |
|
1050 /* |
|
1051 * ContentLayoutHandler::setTestResult |
|
1052 */ |
|
1053 void ContentLayoutHandler::setTestResult(int testResult) |
|
1054 { |
|
1055 mTestResult = testResult; |
|
1056 } |
1040 } |
1057 |
1041 |
1058 /* |
1042 /* |
1059 * ContentLayoutHandler::setTimerForNextUpdate() |
1043 * ContentLayoutHandler::setTimerForNextUpdate() |
1060 */ |
1044 */ |