2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file IvImageViewerForm.h
19 * @brief This is the header file for ImageViewerForm class.
22 #ifndef _IV_IMAGE_VIEWER_FORM_H_
23 #define _IV_IMAGE_VIEWER_FORM_H_
30 #include "IvBaseForm.h"
31 #include "IvFileUpdateEventListener.h"
32 #include "IvImageViewerEventListener.h"
33 #include "IvSlideSettingListener.h"
37 class ImageViewerForm;
38 class ImageViewerPresentationModel;
39 class SettingPresentationModel;
44 , public IImageViewerEventListener
45 , public IFileUpdateEventListener
46 , public ISlideSettingListener
47 , public Tizen::App::IAppControlResponseListener
48 , public Tizen::Base::Runtime::ITimerEventListener
49 , public Tizen::Content::IContentTransferListener
50 , public Tizen::Media::IImageDecodeUrlEventListener
51 , public Tizen::Ui::Controls::IFormBackEventListener
52 , public Tizen::Ui::Controls::IGalleryEventListener
53 , public Tizen::Ui::Controls::IGalleryItemProvider
54 , public Tizen::Ui::IActionEventListener
55 , public Tizen::Ui::IOrientationEventListener
56 , public Tizen::Ui::IScrollPanelEventListener
57 , public Tizen::Ui::Scenes::ISceneEventListener
60 ImageViewerForm(void);
61 virtual ~ImageViewerForm(void);
63 result Initialize(void);
65 virtual result OnInitializing(void);
66 virtual result OnInitialized(void);
67 virtual result OnTerminating(void);
68 virtual void OnUpdateContentList(void);
70 virtual void OnAppControlCompleteResponseReceived(const Tizen::App::AppId& appId,
71 const Tizen::Base::String& operationId, Tizen::App::AppCtrlResult appControlResult,
72 const Tizen::Base::Collection::IMap* pExtraData);
74 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer &timer);
76 virtual void OnContentTransferInProgress(RequestId requestID, int totalReceivedSize);
77 virtual void OnContentUploadCompleted(RequestId requestID, result res,
78 const Tizen::Base::String& errorCode,
79 const Tizen::Base::String& errorMessage);
80 virtual void OnContentDownloadCompleted(RequestId requestID, Tizen::Content::ContentId contentID, result res,
81 const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMessage);
82 virtual void OnContentDownloadToBufferCompleted(RequestId reqId, Tizen::Base::ByteBuffer* pBuffer, result r,
83 const Tizen::Base::String& errorCode, const Tizen::Base::String& errorMessage);
84 virtual void OnContentTransferCanceled(RequestId reqId, result res, const Tizen::Base::String& errorCode,
85 const Tizen::Base::String& errorMessage);
87 virtual void OnImageDecodeUrlReceived (RequestId reqId, Tizen::Graphics::Bitmap *pBitmap,
88 result r, const Tizen::Base::String errorCode, const Tizen::Base::String errorMessage);
90 virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId);
92 virtual void OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus);
94 virtual void OnOverlayControlCreated(const Tizen::Ui::Control& source);
95 virtual void OnOverlayControlOpened(const Tizen::Ui::Control& source);
96 virtual void OnOverlayControlClosed(const Tizen::Ui::Control& source);
97 virtual void OnOtherControlSelected(const Tizen::Ui::Control& source);
99 virtual void OnFormBackRequested(Tizen::Ui::Controls::Form& source);
101 virtual void OnGalleryCurrentItemChanged (Tizen::Ui::Controls::Gallery &view, int index);
102 virtual void OnGalleryItemClicked(Tizen::Ui::Controls::Gallery& listView, int index);
103 virtual void OnGallerySlideShowStarted(Tizen::Ui::Controls::Gallery& gallery);
104 virtual void OnGallerySlideShowStopped(Tizen::Ui::Controls::Gallery& gallery);
106 virtual Tizen::Ui::Controls::GalleryItem* CreateItem(int index);
107 virtual bool DeleteItem(int index, Tizen::Ui::Controls::GalleryItem* pItem);
108 virtual int GetItemCount(void);
110 virtual void OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousSceneId,
111 const Tizen::Ui::Scenes::SceneId& currentSceneId, Tizen::Base::Collection::IList* pArgs);
112 virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
113 const Tizen::Ui::Scenes::SceneId& nextSceneId);
115 virtual void OnImageDecodedN(const int index);
117 virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId);
119 virtual void OnSlideSettingPopUpItemSelected(int index);
124 APPCONTROL_MODE_NORMAL = 0
125 , APPCONTROL_MODE_WEB_LINK
126 , APPCONTROL_MODE_CROP
127 , APPCONTROL_MODE_MESSAGE
128 , APPCONTROL_MODE_EMAIL
133 ROTATE_MODE_RIGHT = 0
137 void InitializeDisplay(AppControlMode status);
138 void InitShowGallery(void);
139 void CreateGallery(void);
140 result InitializePanelDetail(void);
141 result SetDetailInfo(void);
142 result InitializePopup(void);
144 result InitializeContextMenuMore(void);
145 result InitializeContextMenuCopy(void);
146 result InitializeContextMenuSetAs(void);
147 result InitializeContextMenuShare(void);
149 result InitializeSliderPanel(void);
150 result ShowPanelDetail(bool isShowStatus);
151 result ChangeFooterItem(bool isChanged, Tizen::Ui::Controls::Footer* pFooter, int position);
152 long long GetFileSize(Tizen::Base::String filePath) const;
153 void GetLabelText(int index, Tizen::Base::String& page);
154 void DownloadFile(void);
155 void RotateImage(Tizen::Base::String& filePath, RotateMode rotateMode);
156 void CallVideoPlayer(void);
157 result DeleteImageFile(void);
158 void RequestDecodeUrl(void);
159 void OnRequestEmailAction(void);
160 void OnRequestMessagesAction(void);
162 void SetFooterItemState(bool isEnable);
163 Tizen::Graphics::Bitmap* GetQuickThumbnailN(Tizen::Base::String& fileName) const;
165 void CreateShuffledList(int count);
166 void SlideShowStopped(int index);
169 int __shuffelStartIndex;
170 AppControlMode __initializeDisplayModeCurrent;
171 Tizen::Ui::Controls::Label* __pLabel;
172 Tizen::Ui::Controls::Footer* __pFooter;
173 Tizen::Ui::Controls::ScrollPanel* __pScrollPanel;
174 Tizen::Ui::Controls::Label* __pDetail_Label;
175 Tizen::Ui::Controls::Label* __pDetail_FileInfo_Label[9];
176 Tizen::Ui::Controls::Label* __pDetail_FileInfo_Value_Label[9];
177 Tizen::Ui::Controls::Label *__pLabelMessage;
178 Tizen::Ui::Controls::Button* __pPlayButton;
179 Tizen::Ui::Controls::Button* __pRenameButton;
180 Tizen::Ui::Controls::FooterItem* __pDetailFooterItem;
181 Tizen::Ui::Controls::Gallery* __pGallery;
182 Tizen::Base::Runtime::Timer* __pTimer;
183 Tizen::Base::Runtime::Timer* __pShuffelTimer;
184 Tizen::Ui::Controls::ContextMenu* __pContextMenuMore;
185 Tizen::Ui::Controls::ContextMenu* __pContextMenuCopy;
186 Tizen::Ui::Controls::ContextMenu* __pContextMenuSetAs;
187 Tizen::Ui::Controls::ContextMenu* __pContextMenuShare;
188 Tizen::Ui::Controls::Popup* __pDeletePopup;
193 Tizen::Base::String __downloadFileName;
194 RequestId __requestId;
195 Tizen::Content::ContentTransfer __contentTransfer;
196 SlideShowPopUp* __pPopUp;
197 int* __pShuffledList;
198 ImageViewerPresentationModel* __pPresentationModel;
199 SettingPresentationModel* __pSettingPresentationModel;
203 #endif /* _IV_IMAGE_VIEWER_FORM_H_ */