87 // if animations is on, then Set the image to HDMI here |
83 // if animations is on, then Set the image to HDMI here |
88 if (!mTvOutWrapper){ |
84 if (!mTvOutWrapper){ |
89 mTvOutWrapper = new GlxTvOutWrapper(); |
85 mTvOutWrapper = new GlxTvOutWrapper(); |
90 } |
86 } |
91 setHdmiModel(model); |
87 setHdmiModel(model); |
92 |
|
93 //Load/Retrieve the Widgets |
|
94 loadWidgets(); |
88 loadWidgets(); |
95 |
89 |
96 //Initialize the coverflow and partially creates the coverflow with one image |
90 // Initialize the coverflow and partially creates the coverflow with one image |
97 // to make the widget light weight in order to make |
91 // to make the widget light weight in order to make transition smooth |
98 // transition smooth |
92 mCoverFlow->partiallyCreate( model, screenSize() ); |
99 mCoverFlow->partiallyCreate( model, screenSize()); |
|
100 |
93 |
101 OstTraceFunctionExit0( GLXFULLSCREENVIEW_INITIALIZEVIEW_EXIT ); |
94 OstTraceFunctionExit0( GLXFULLSCREENVIEW_INITIALIZEVIEW_EXIT ); |
102 } |
95 } |
103 |
96 |
104 void GlxFullScreenView::loadWidgets() |
97 void GlxFullScreenView::loadWidgets() |
105 { |
98 { |
106 OstTraceFunctionEntry0( GLXFULLSCREENVIEW_LOADWIDGETS_ENTRY ); |
99 OstTraceFunctionEntry0( GLXFULLSCREENVIEW_LOADWIDGETS_ENTRY ); |
107 |
100 |
108 //Load the Coverflow and image strip widget |
|
109 mCoverFlow = qobject_cast<GlxCoverFlow*> (mDocLoader->findWidget(GLXFULLSCREEN_COVERFLOW)); |
101 mCoverFlow = qobject_cast<GlxCoverFlow*> (mDocLoader->findWidget(GLXFULLSCREEN_COVERFLOW)); |
110 |
102 |
111 mZoomWidget = qobject_cast<GlxZoomWidget*> (mDocLoader->findWidget(GLXFULLSCREENZOOMWIDGET)); |
103 mZoomWidget = qobject_cast<GlxZoomWidget*> (mDocLoader->findWidget(GLXFULLSCREENZOOMWIDGET)); |
112 mZoomWidget->connectDecodeRequestToPinchEvent(); |
104 mZoomWidget->connectDecodeRequestToPinchEvent(); |
113 mCoverFlow->setMultitouchFilter(mZoomWidget); |
105 mCoverFlow->setMultitouchFilter(mZoomWidget); |
|
106 |
114 //initialise the cover flow for basic connections and the rest |
107 //initialise the cover flow for basic connections and the rest |
115 mCoverFlow->setCoverFlow(); |
108 mCoverFlow->setCoverFlow(); |
116 |
109 mImageStrip = qobject_cast<HbGridView*> (mDocLoader->findWidget(GLXFULLSCREEN_FILMSTRIP)); |
117 //Load the IMAGE STRIP & FULLSCREEN TOOLBAR[PUSH BUTTON] |
|
118 mImageStrip = qobject_cast<HbGridView*> (mDocLoader->findWidget(GLXFULLSCREEN_FILMSTRIP)); |
|
119 |
110 |
120 //When the widget is loaded/retreived the widgets are shown by default. |
111 //When the widget is loaded/retreived the widgets are shown by default. |
121 //@to do : hide the widgets by default in docml |
112 //@to do : hide the widgets by default in docml |
122 mImageStrip->hide(); |
113 mImageStrip->hide(); |
123 mImageStrip->setLayoutName( QString( "ImageStrip" ) ); |
114 mImageStrip->setLayoutName( QString( "ImageStrip" ) ); // To distinguish in CSS file |
124 mImageStrip->setEnabledAnimations(HbAbstractItemView::None); |
115 mImageStrip->setEnabledAnimations( HbAbstractItemView::None ); |
125 |
116 |
126 OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADWIDGETS_EXIT ); |
117 OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADWIDGETS_EXIT ); |
127 } |
118 } |
128 |
119 |
129 void GlxFullScreenView::loadFullScreenToolBar() |
120 void GlxFullScreenView::loadFullScreenToolBar() |
136 mDocLoader->load(GLXFULLSCREENDOCMLPATH,&loaded); |
127 mDocLoader->load(GLXFULLSCREENDOCMLPATH,&loaded); |
137 loadViewSection(); |
128 loadViewSection(); |
138 |
129 |
139 mFullScreenToolBar = qobject_cast<HbToolBar *> (mDocLoader->findObject(QString("toolBar"))); |
130 mFullScreenToolBar = qobject_cast<HbToolBar *> (mDocLoader->findObject(QString("toolBar"))); |
140 mFullScreenToolBar->clearActions(); |
131 mFullScreenToolBar->clearActions(); |
141 |
132 |
142 //create Flip tool bar button action |
133 addToolBarAction( EGlxCmdDetailsOpen, GLXICON_FLIP, "Flip Action" ); //create Flip tool bar button action |
143 mFlipAction = new HbAction(this); |
134 addToolBarAction( EGlxCmdSend, GLXICON_SEND, "Send Action" ); //create Send tool bar button action |
144 mFlipAction->setData(EGlxCmdDetailsOpen); |
135 if( getSubState() != IMAGEVIEWER_S ) { |
145 mFlipAction->setIcon(HbIcon(GLXICON_FLIP)); |
136 addToolBarAction( EGlxCmdDelete, GLXICON_DELETE, "Delete Action" ); //create Delete tool bar button action |
146 mFullScreenToolBar->addAction( mFlipAction); |
137 } |
147 |
138 else { |
148 //create Send tool bar button action |
139 addToolBarAction( EGlxCmdHandled, GLXICON_USEIMAGE, "Use Action" ); //create Use Image tool bar button action |
149 mSendAction = new HbAction(this); |
140 } |
150 mSendAction->setData(EGlxCmdSend); |
141 |
151 mSendAction->setIcon(HbIcon(GLXICON_SEND)); |
|
152 mFullScreenToolBar->addAction( mSendAction); |
|
153 |
|
154 //create Delete tool bar button action |
|
155 mDeleteAction = new HbAction(this); |
|
156 mDeleteAction->setData(EGlxCmdDelete); |
|
157 mDeleteAction->setIcon(HbIcon(GLXICON_DELETE)); |
|
158 |
|
159 //create Use Image tool bar button action |
|
160 mUseImageAction = new HbAction(this); |
|
161 //mUseImageAction->setData(EGlxCmdDelete); |
|
162 mUseImageAction->setIcon(HbIcon(GLXICON_USEIMAGE)); |
|
163 if(getSubState() != IMAGEVIEWER_S){ |
|
164 mFullScreenToolBar->addAction( mDeleteAction); |
|
165 }else{ |
|
166 mFullScreenToolBar->addAction( mUseImageAction); |
|
167 } |
|
168 |
|
169 |
|
170 connect(mFlipAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
171 connect(mSendAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
172 connect(mDeleteAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
173 connect(mUseImageAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
174 |
|
175 OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADFULLSCREENTOOLBAR_EXIT ); |
142 OstTraceFunctionExit0( GLXFULLSCREENVIEW_LOADFULLSCREENTOOLBAR_EXIT ); |
176 } |
143 } |
177 |
144 |
|
145 void GlxFullScreenView::addToolBarAction( int commandId, const QString &iconName, const QString &name ) |
|
146 { |
|
147 HbAction *action = new HbAction( this ); |
|
148 action->setData( commandId ); |
|
149 action->setIcon( HbIcon( iconName ) ); |
|
150 action->setObjectName( name ); |
|
151 mFullScreenToolBar->addAction( action); |
|
152 connect(action, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
153 } |
|
154 |
178 void GlxFullScreenView::activate() |
155 void GlxFullScreenView::activate() |
179 { |
156 { |
180 OstTraceFunctionEntry0( GLXFULLSCREENVIEW_ACTIVATE_ENTRY ); |
157 OstTraceFunctionEntry0( GLXFULLSCREENVIEW_ACTIVATE_ENTRY ); |
181 |
|
182 setStatusBarVisible(FALSE); |
|
183 setTitleBarVisible(FALSE); |
|
184 //To:Do remove it later, currently it is solving the problem of status bar is not |
|
185 //visible when tap on the screen first time |
|
186 setStatusBarVisible(FALSE); |
|
187 setTitleBarVisible(FALSE); |
|
188 |
|
189 //for zoom might not be required after wk15 release |
158 //for zoom might not be required after wk15 release |
190 mWindow->viewport()->setAttribute(Qt::WA_AcceptTouchEvents,true); |
159 mWindow->viewport()->setAttribute(Qt::WA_AcceptTouchEvents,true); |
191 mWindow->viewport()->grabGesture(Qt::PinchGesture); |
160 mWindow->viewport()->grabGesture(Qt::PinchGesture); |
192 |
161 |
193 QCoreApplication::instance()->installEventFilter(this); |
162 QCoreApplication::instance()->installEventFilter(this); |
194 |
163 |
195 if(!mCoverFlow){ |
164 if( !mCoverFlow ) { |
196 loadWidgets(); //retrives the widgets |
165 loadWidgets(); //retrives the widgets |
197 } |
166 } |
198 |
|
199 //Loads the widgets corresponding to the orientation. |
167 //Loads the widgets corresponding to the orientation. |
200 loadViewSection(); |
168 loadViewSection(); |
|
169 |
|
170 setStatusBarVisible(FALSE); |
|
171 setTitleBarVisible(FALSE); |
201 |
172 |
202 mUiOffTimer = new QTimer(); |
173 mUiOffTimer = new QTimer(); |
203 mUiOff = true; |
174 mUiOff = true; |
204 mUiOffTimer->stop(); |
175 mUiOffTimer->stop(); |
205 mCoverFlow->setUiOn(FALSE); |
176 mCoverFlow->setUiOn(FALSE); |
670 if ( mUiOffTimer ) { |
645 if ( mUiOffTimer ) { |
671 GLX_LOG_INFO("GlxFullScreenView::removeConnection() mUiOffTimer " ); |
646 GLX_LOG_INFO("GlxFullScreenView::removeConnection() mUiOffTimer " ); |
672 disconnect(mUiOffTimer, SIGNAL(timeout()), this, SLOT(hideUi())); |
647 disconnect(mUiOffTimer, SIGNAL(timeout()), this, SLOT(hideUi())); |
673 } |
648 } |
674 |
649 |
675 if(mFlipAction) { |
650 if( mCoverFlow && mZoomWidget ) { |
676 disconnect(mFlipAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
677 } |
|
678 |
|
679 if(mSendAction) { |
|
680 disconnect(mSendAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
681 } |
|
682 |
|
683 if(mDeleteAction) { |
|
684 disconnect(mDeleteAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
685 } |
|
686 |
|
687 if(mUseImageAction) { |
|
688 disconnect(mUseImageAction, SIGNAL(triggered( )), this, SLOT(handleToolBarAction( )) ); |
|
689 } |
|
690 if(mCoverFlow && mZoomWidget) { |
|
691 disconnect(mZoomWidget,SIGNAL( pinchGestureReceived(int) ), mCoverFlow, SLOT( zoomStarted(int) ) ); |
651 disconnect(mZoomWidget,SIGNAL( pinchGestureReceived(int) ), mCoverFlow, SLOT( zoomStarted(int) ) ); |
692 disconnect(mZoomWidget,SIGNAL( zoomWidgetMovedBackground(int) ), mCoverFlow, SLOT( zoomFinished(int) ) ); |
652 disconnect(mZoomWidget,SIGNAL( zoomWidgetMovedBackground(int) ), mCoverFlow, SLOT( zoomFinished(int) ) ); |
693 } |
653 } |
694 |
654 |
695 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); |
655 disconnect(mWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); |