calendarui/views/src/calenmonthview.cpp
changeset 75 7ac58b2aae6f
parent 70 a5ed90760192
child 81 ce92091cbd61
equal deleted inserted replaced
72:27feeedec790 75:7ac58b2aae6f
  1567  */
  1567  */
  1568 void CalenMonthView::handlePreviewPaneGesture(bool rightGesture)
  1568 void CalenMonthView::handlePreviewPaneGesture(bool rightGesture)
  1569 {
  1569 {
  1570     OstTraceFunctionEntry0( CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_ENTRY );
  1570     OstTraceFunctionEntry0( CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_ENTRY );
  1571     
  1571     
  1572 	QGraphicsLinearLayout* viewLayout = static_cast<QGraphicsLinearLayout *>
  1572     // Check if we can swipe, if yes, then proceed, else, do nothing
  1573 												(widget()->layout());
  1573     if (checkIfWeCanSwipe(mDate, rightGesture)) {
  1574 	
  1574     
  1575 	// Set the effect in progress flags for next and previous panes
  1575         QGraphicsLinearLayout* viewLayout = static_cast<QGraphicsLinearLayout *>
  1576 	// For current pane, we would have set it in gestureEvent() function
  1576                                                     (widget()->layout());
  1577 	mPrevPreviewPane->effectStarted();
  1577         
  1578 	mNextPreviewPane->effectStarted();
  1578         // Set the effect in progress flags for next and previous panes
  1579 	
  1579         // For current pane, we would have set it in gestureEvent() function
  1580 	if(rightGesture) {
  1580         mPrevPreviewPane->effectStarted();
  1581 		// Need to bring up the previous day preview pane
  1581         mNextPreviewPane->effectStarted();
  1582 		// Create the effect on mCurrPreviewPane to slide to right side
  1582         
  1583 		mPrevPaneParent->setVisible(true);
  1583         if(rightGesture) {
  1584 		if (mOrientation == Qt::Vertical) {
  1584             // Need to bring up the previous day preview pane
  1585 			HbEffect::add(mCurrPaneLayoutWidget,
  1585             // Create the effect on mCurrPreviewPane to slide to right side
  1586 						  ":/fxml/portrait_preview_pane_hide_on_right_gesture",
  1586             mPrevPaneParent->setVisible(true);
  1587 						  "hide");
  1587             if (mOrientation == Qt::Vertical) {
  1588 			HbEffect::add(mPrevPaneLayoutWidget,
  1588                 HbEffect::add(mCurrPaneLayoutWidget,
  1589 						  ":/fxml/portrait_preview_pane_show_on_right_gesture",
  1589                               ":/fxml/portrait_preview_pane_hide_on_right_gesture",
  1590 						  "show");
  1590                               "hide");
  1591 		} else {
  1591                 HbEffect::add(mPrevPaneLayoutWidget,
  1592 			HbEffect::add(mCurrPaneLayoutWidget,
  1592                               ":/fxml/portrait_preview_pane_show_on_right_gesture",
  1593 						  ":/fxml/landscape_preview_pane_hide_on_right_gesture",
  1593                               "show");
  1594 						  "hide");
  1594             } else {
  1595 			HbEffect::add(mPrevPaneLayoutWidget,
  1595                 HbEffect::add(mCurrPaneLayoutWidget,
  1596 						  ":/fxml/landscape_preview_pane_show_on_right_gesture",
  1596                               ":/fxml/landscape_preview_pane_hide_on_right_gesture",
  1597 						  "show");
  1597                               "hide");
  1598 		}
  1598                 HbEffect::add(mPrevPaneLayoutWidget,
  1599 		// Start the effects
  1599                               ":/fxml/landscape_preview_pane_show_on_right_gesture",
  1600 		HbEffect::start(mCurrPaneLayoutWidget, "hide");
  1600                               "show");
  1601 		HbEffect::start(mPrevPaneLayoutWidget, "show", 
  1601             }
  1602 										this, "handleRightEffectCompleted");
  1602             // Start the effects
  1603 		
  1603             HbEffect::start(mCurrPaneLayoutWidget, "hide");
  1604 		//Remove the mCurrPreviewPane from the layout and add mPrevPreviewPane
  1604             HbEffect::start(mPrevPaneLayoutWidget, "show", 
  1605 		// to the layout
  1605                                             this, "handleRightEffectCompleted");
  1606 		viewLayout->removeAt(1);
  1606             
  1607 		viewLayout->addItem(mPrevPaneParent);
  1607             //Remove the mCurrPreviewPane from the layout and add mPrevPreviewPane
  1608 	} else {
  1608             // to the layout
  1609 		// Need to bring up the previous day preview pane
  1609             viewLayout->removeAt(1);
  1610 		// Create the effect on mCurrPreviewPane to slide to left side
  1610             viewLayout->addItem(mPrevPaneParent);
  1611 		mNextPaneParent->setVisible(true);
  1611         } else {
  1612 		if (mOrientation == Qt::Vertical) {
  1612             // Need to bring up the previous day preview pane
  1613 			HbEffect::add(mCurrPaneLayoutWidget,
  1613             // Create the effect on mCurrPreviewPane to slide to left side
  1614 						  ":/fxml/portrait_preview_pane_hide_on_left_gesture",
  1614             mNextPaneParent->setVisible(true);
  1615 						  "hide");
  1615             if (mOrientation == Qt::Vertical) {
  1616 			HbEffect::add(mNextPaneLayoutWidget,
  1616                 HbEffect::add(mCurrPaneLayoutWidget,
  1617 						  ":/fxml/portrait_preview_pane_show_on_left_gesture",
  1617                               ":/fxml/portrait_preview_pane_hide_on_left_gesture",
  1618 						  "show");
  1618                               "hide");
  1619 		} else {
  1619                 HbEffect::add(mNextPaneLayoutWidget,
  1620 			HbEffect::add(mCurrPaneLayoutWidget,
  1620                               ":/fxml/portrait_preview_pane_show_on_left_gesture",
  1621 						  ":/fxml/landscape_preview_pane_hide_on_left_gesture",
  1621                               "show");
  1622 						  "hide");
  1622             } else {
  1623 			HbEffect::add(mNextPaneLayoutWidget,
  1623                 HbEffect::add(mCurrPaneLayoutWidget,
  1624 						  ":/fxml/landscape_preview_pane_show_on_left_gesture",
  1624                               ":/fxml/landscape_preview_pane_hide_on_left_gesture",
  1625 						  "show");
  1625                               "hide");
  1626 		}
  1626                 HbEffect::add(mNextPaneLayoutWidget,
  1627 		
  1627                               ":/fxml/landscape_preview_pane_show_on_left_gesture",
  1628 		// Start the effects
  1628                               "show");
  1629 		HbEffect::start(mCurrPaneLayoutWidget, "hide");
  1629             }
  1630 		HbEffect::start(mNextPaneLayoutWidget, "show", 
  1630             
  1631 										this, "handleLeftEffectCompleted");
  1631             // Start the effects
  1632 		
  1632             HbEffect::start(mCurrPaneLayoutWidget, "hide");
  1633 		//Remove the mCurrPreviewPane from the layout and add mNextPreviewPane
  1633             HbEffect::start(mNextPaneLayoutWidget, "show", 
  1634 		// to the layout
  1634                                             this, "handleLeftEffectCompleted");
  1635 		viewLayout->removeAt(1);
  1635             
  1636 		viewLayout->addItem(mNextPaneParent);
  1636             //Remove the mCurrPreviewPane from the layout and add mNextPreviewPane
  1637 	}
  1637             // to the layout
       
  1638             viewLayout->removeAt(1);
       
  1639             viewLayout->addItem(mNextPaneParent);
       
  1640         }
       
  1641     }
  1638 	
  1642 	
  1639 	OstTraceFunctionExit0( CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_EXIT );
  1643 	OstTraceFunctionExit0( CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_EXIT );
  1640 }
  1644 }
  1641 
  1645 
  1642 /*!
  1646 /*!
  1793     labels.clear();
  1797     labels.clear();
  1794     weekDayArray.clear();
  1798     weekDayArray.clear();
  1795     
  1799     
  1796     OstTraceFunctionExit0( CALENMONTHVIEW_UPDATEDAYLABEL_EXIT );
  1800     OstTraceFunctionExit0( CALENMONTHVIEW_UPDATEDAYLABEL_EXIT );
  1797 }
  1801 }
       
  1802 
  1798 // End of file  --Don't remove this.
  1803 // End of file  --Don't remove this.