33 mRows(0), mSelIndex (0), mStripLen (0), mCurrentPos(0), |
33 mRows(0), mSelIndex (0), mStripLen (0), mCurrentPos(0), |
34 mItemSize (QSize(0,0)), mModel ( NULL), mMoveDir(NO_MOVE), rotAngle(0) |
34 mItemSize (QSize(0,0)), mModel ( NULL), mMoveDir(NO_MOVE), rotAngle(0) |
35 { |
35 { |
36 //TO:DO through exception |
36 //TO:DO through exception |
37 qDebug("GlxCoverFlow::GlxCoverFlow"); |
37 qDebug("GlxCoverFlow::GlxCoverFlow"); |
|
38 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate0.fxml"), QString( "RotateImage0" )); |
|
39 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate90.fxml"), QString( "RotateImage90" )); |
|
40 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate180.fxml"), QString( "RotateImage180" )); |
|
41 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate270.fxml"), QString( "RotateImage270" )); |
|
42 connect( this, SIGNAL( autoLeftMoveSignal() ), this, SLOT( autoLeftMove() ), Qt::QueuedConnection ); |
|
43 connect( this, SIGNAL( autoRightMoveSignal() ), this, SLOT( autoRightMove() ), Qt::QueuedConnection ); |
38 } |
44 } |
39 |
45 |
40 void GlxCoverFlow::setCoverFlow() |
46 void GlxCoverFlow::setCoverFlow() |
41 { |
47 { |
42 |
|
43 qDebug("GlxCoverFlow::setCoverFlow"); |
48 qDebug("GlxCoverFlow::setCoverFlow"); |
44 for ( qint8 i = 0; i < NBR_ICON_ITEM ; i++ ) { |
49 for ( qint8 i = 0; i < NBR_ICON_ITEM ; i++ ) { |
45 mIconItem[i] = new HbIconItem(this); |
50 mIconItem[i] = new HbIconItem(this); |
46 mIconItem[i]->setBrush(QBrush(Qt::black)); |
51 mIconItem[i]->setBrush(QBrush(Qt::black)); |
47 mIconItem[i]->setSize(QSize(0,0)); |
52 mIconItem[i]->setSize(QSize(0,0)); |
48 } |
53 } |
49 mUiOn = FALSE; |
54 mUiOn = FALSE; |
50 mBounceBackDeltaX = 10; |
55 mBounceBackDeltaX = 10; |
51 connect( this, SIGNAL( autoLeftMoveSignal() ), this, SLOT( autoLeftMove() ), Qt::QueuedConnection ); |
|
52 connect( this, SIGNAL( autoRightMoveSignal() ), this, SLOT( autoRightMove() ), Qt::QueuedConnection ); |
|
53 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate0.fxml"), QString( "RotateImage0" )); |
|
54 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate90.fxml"), QString( "RotateImage90" )); |
|
55 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate180.fxml"), QString( "RotateImage180" )); |
|
56 HbEffect::add( QString("HbIconItem"), QString(":/data/transitionrotate270.fxml"), QString( "RotateImage270" )); |
|
57 } |
56 } |
58 |
57 |
59 void GlxCoverFlow::setItemSize(QSize &size) |
58 void GlxCoverFlow::setItemSize(QSize &size) |
60 { |
59 { |
61 qDebug("GlxCoverFlow::setSize width = %d",size.width() ); |
60 qDebug("GlxCoverFlow::setSize width = %d",size.width() ); |
83 { |
82 { |
84 qDebug("GlxCoverFlow::indexChanged index = %d mSelIndex = %d ",index, mSelIndex ); |
83 qDebug("GlxCoverFlow::indexChanged index = %d mSelIndex = %d ",index, mSelIndex ); |
85 if ( index != mSelIndex && mModel) { |
84 if ( index != mSelIndex && mModel) { |
86 loadIconItems(); |
85 loadIconItems(); |
87 if(rotAngle) { |
86 if(rotAngle) { |
88 rotAngle = 0; |
87 rotAngle = 0; |
89 //HbEffect::start(mIconItem[mSelItemIndex], QString("HbIconItem"), QString("RotateImage270"), this, "rotationEffectFinished" ); |
88 //HbEffect::start(mIconItem[mSelItemIndex], QString("HbIconItem"), QString("RotateImage270"), this, "rotationEffectFinished" ); |
90 mIconItem[mSelItemIndex]->resetTransform(); |
89 mIconItem[mSelItemIndex]->resetTransform(); |
91 mIconItem[mSelItemIndex]->resize(mItemSize); |
90 mIconItem[mSelItemIndex]->resize(mItemSize); |
92 } |
91 } |
93 } |
92 } |
94 } |
93 } |
95 |
94 |
96 void GlxCoverFlow::rotateImage () |
95 void GlxCoverFlow::rotateImage () |
97 { |
96 { |
109 HbEffect::start(mIconItem[mSelItemIndex], QString("HbIconItem"), QString("RotateImage180"), this, "rotationEffectFinished" ); |
108 HbEffect::start(mIconItem[mSelItemIndex], QString("HbIconItem"), QString("RotateImage180"), this, "rotationEffectFinished" ); |
110 } |
109 } |
111 if(rotAngle == 270) |
110 if(rotAngle == 270) |
112 { |
111 { |
113 HbEffect::start(mIconItem[mSelItemIndex], QString("HbIconItem"), QString("RotateImage270"), this, "rotationEffectFinished" ); |
112 HbEffect::start(mIconItem[mSelItemIndex], QString("HbIconItem"), QString("RotateImage270"), this, "rotationEffectFinished" ); |
114 } |
113 } |
115 |
|
116 rotAngle += 90; |
114 rotAngle += 90; |
117 rotAngle %= 360; |
115 rotAngle %= 360; |
118 |
|
119 } |
116 } |
120 |
117 |
121 void GlxCoverFlow::rotationEffectFinished (const HbEffect::EffectStatus &status) |
118 void GlxCoverFlow::rotationEffectFinished (const HbEffect::EffectStatus &status) |
122 { |
119 { |
123 Q_UNUSED(status) |
120 Q_UNUSED(status) |
549 } |
545 } |
550 |
546 |
551 GlxCoverFlow::~GlxCoverFlow() |
547 GlxCoverFlow::~GlxCoverFlow() |
552 { |
548 { |
553 qDebug("GlxCoverFlow::~GlxCoverFlow model " ); |
549 qDebug("GlxCoverFlow::~GlxCoverFlow model " ); |
554 } |
|
555 |
|
556 |
|
557 void GlxCoverFlow::ClearCoverFlow() |
|
558 { |
|
559 qDebug("GlxCoverFlow::ClearCoverFlow " ); |
|
560 disconnect( this, SIGNAL( autoLeftMoveSignal() ), this, SLOT( autoLeftMove() ) ); |
550 disconnect( this, SIGNAL( autoLeftMoveSignal() ), this, SLOT( autoLeftMove() ) ); |
561 disconnect( this, SIGNAL( autoRightMoveSignal() ), this, SLOT( autoRightMove() ) ); |
551 disconnect( this, SIGNAL( autoRightMoveSignal() ), this, SLOT( autoRightMove() ) ); |
|
552 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate0.fxml"), QString( "RotateImage0" )); |
|
553 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate90.fxml"), QString( "RotateImage90" )); |
|
554 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate180.fxml"), QString( "RotateImage180" )); |
|
555 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate270.fxml"), QString( "RotateImage270" )); |
|
556 } |
|
557 |
|
558 |
|
559 void GlxCoverFlow::ClearCoverFlow() |
|
560 { |
|
561 qDebug("GlxCoverFlow::ClearCoverFlow " ); |
562 clearCurrentModel(); |
562 clearCurrentModel(); |
563 for ( qint8 i = 0; i < NBR_ICON_ITEM ; i++ ) { |
563 for ( qint8 i = 0; i < NBR_ICON_ITEM ; i++ ) { |
564 if(mIconItem[i] != NULL ) |
564 if(mIconItem[i] != NULL ) { |
565 delete mIconItem[i] ; |
565 delete mIconItem[i] ; |
|
566 mIconItem[i] = NULL; |
|
567 } |
566 } |
568 } |
567 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate0.fxml"), QString( "RotateImage0" )); |
569 } |
568 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate90.fxml"), QString( "RotateImage90" )); |
|
569 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate180.fxml"), QString( "RotateImage180" )); |
|
570 HbEffect::remove( QString("HbIconItem"), QString(":/data/transitionrotate270.fxml"), QString( "RotateImage270" )); |
|
571 } |
|