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 IvImageViewerPresentationModel.h
19 * @brief This is the header file for ImageViewerPresentationModel class.
22 #ifndef _IV_VIEWER_PRESENTATION_MODEL_H_
23 #define _IV_VIEWER_PRESENTATION_MODEL_H_
26 #include "IvImageProviderEventListener.h"
32 class IImageViewerEventListener;
33 class SettingPresentationModel;
34 class IFileUpdateEventListener;
36 class ImageViewerPresentationModel
37 : public IImageProviderEventListener
38 , public Tizen::Content::IContentUpdateEventListener
41 static ImageViewerPresentationModel* GetInstance();
44 result AddListener(IImageViewerEventListener* pListener);
45 result RemoveListener(IImageViewerEventListener& listner);
47 result AddFileUpdateListener(IFileUpdateEventListener* pListener);
48 result RemoveFileUpdateListener(IFileUpdateEventListener& listner);
50 void ClearImageRequests(bool isAppTerminating = false);
51 void DeleteFilePathAt(const int index);
52 void UpdateFilePathAt(const int index, const Tizen::Base::String& filePath);
53 Tizen::Base::String GetFilePathAt(const int index) const;
54 Tizen::Base::Collection::ArrayList* GetImageCache(void) const;
55 ImageInfo* GetImageCacheAt(const int index) const;
56 void AddImageCache(const Tizen::Base::String& filePath);
58 int GetFileCount(void) const;
59 Tizen::Base::String GetType(void) const;
60 int GetStartIndex(void) const;
62 Tizen::Base::String GetFileName(const Tizen::Base::String& filePath, bool isCheckExe = false) const;
63 void RequestImage(const Tizen::Base::String& filePath);
64 Tizen::Graphics::Bitmap* GetImage(const Tizen::Base::String& filePath);
65 Tizen::Content::ContentId GetFileContentId(const Tizen::Base::String& filePath) const;
67 int GetDurationOfSlideShow(void) const;
68 SlideShowTransitionEffect GetTransitionEffectOfSlideShow(void) const;
70 result StartAppControl(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId,
71 const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
72 const Tizen::Base::Collection::HashMap* pDataList, Tizen::App::IAppControlResponseListener* pListener);
74 virtual void OnImageReceivedN(Tizen::Base::Runtime::IEventArg& eventArg);
76 virtual void OnContentFileCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
77 virtual void OnContentFileUpdated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
78 virtual void OnContentFileDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
79 virtual void OnContentDirectoryScanCompleted(const Tizen::Base::String& directoryPath, result r);
82 ImageViewerPresentationModel(void);
83 ImageViewerPresentationModel(const ImageViewerPresentationModel&);
84 virtual ~ImageViewerPresentationModel(void);
85 ImageViewerPresentationModel& operator=(const ImageViewerPresentationModel&);
87 result Construct(void);
88 static void CreateInstance(void);
89 static void DestroyInstance(void);
91 void LoadSettingValue(void);
92 int GetImageCacheIndex(const Tizen::Base::String& );
95 static ImageViewerPresentationModel* __pPresentationModelInstance;
96 static ImageProvider* __pImageProvider;
97 static ImageEvent* __pImageEvent;
98 static Tizen::Base::Collection::ArrayList* __pImageViewerListener;
99 Tizen::Base::Collection::ArrayList* __pFileUpdateListener;
100 Tizen::Base::Collection::ArrayList* __pImageCaches;
101 long long __contactId;
103 Tizen::Base::String __type;
104 int __durationOfSlideShow;
105 SlideShowTransitionEffect __transitionEffectOfSlideShow;
106 Tizen::Content::ContentManager* __pCntMgr;
107 SettingPresentationModel* __pSettingPresentationModel;
108 bool __isIvTriggeredEvent;
109 short __contentFileEventType;
110 Tizen::Content::ContentId __contentId;
111 bool __isIvTriggeredDeleteEvent;
114 #endif /* _IV_VIEWER_PRESENTATION_MODEL_H_ */