2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (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 <FAppIAppControlEventListener.h>
28 #include <FBaseColArrayList.h>
30 #include <FGraphics.h>
33 #include "IvImageProviderEventListener.h"
39 class IImageViewerEventListener;
40 class SettingPresentationModel;
41 class IFileUpdateEventListener;
43 class ImageViewerPresentationModel
44 : public IImageProviderEventListener
45 , public Tizen::Io::IFileEventListener
48 static ImageViewerPresentationModel* GetInstance();
51 result AddListener(IImageViewerEventListener* listener);
52 result RemoveListener(IImageViewerEventListener& listner);
54 result AddFileUpdateListener(IFileUpdateEventListener* listener);
55 result RemoveFileUpdateListener(IFileUpdateEventListener& listner);
57 void ClearImageRequests(bool appTerminating = false);
58 void DeleteFilePathAt(const int index);
59 void UpdateFilePathAt(const int index, const Tizen::Base::String& filePath);
60 Tizen::Base::String GetFilePathAt(const int index) const;
61 Tizen::Base::Collection::ArrayList* GetImageCache() const;
62 ImageInfo* GetImageCacheAt(const int index) const;
63 void SetImageCacheAt(const int index, const Tizen::Base::String& filePath);
65 int GetFileCount(void) const;
66 Tizen::Base::String GetType(void) const;
67 int GetStartIndex(void) const;
69 Tizen::Base::String GetFileName(const Tizen::Base::String& filePath, bool checkExe = false) const;
70 void RequestImage(const Tizen::Base::String& filePath) const;
71 Tizen::Content::ContentId GetFileContentId(const Tizen::Base::String& filePath) const;
73 int GetSetterIndex(void) const;
74 void SetSetterIndex(const int index);
76 void SetImageRotateStatus(bool value);
78 int GetDurationOfSlideShow(void) const;
79 SlideShowTransitionEffect GetTransitionEffectOfSlideShow(void) const;
81 result StartAppControl(const Tizen::Base::String& providerId, const Tizen::Base::String& operationId,
82 const Tizen::Base::String* pUriData, const Tizen::Base::String* pMimeType,
83 const Tizen::Base::Collection::HashMap* pDataList, Tizen::App::IAppControlResponseListener* pListener);
85 virtual void OnImageReceivedN(Tizen::Base::Runtime::IEventArg& eventArg);
87 virtual void OnFileEventOccured (const unsigned long events, const Tizen::Base::String &path, const unsigned int eventId);
90 ImageViewerPresentationModel(void);
91 ImageViewerPresentationModel(const ImageViewerPresentationModel&);
92 virtual ~ImageViewerPresentationModel(void);
93 ImageViewerPresentationModel& operator=(const ImageViewerPresentationModel&);
95 result Construct(void);
96 static void CreateInstance(void);
97 static void DestroyInstance(void);
99 void LoadSettingValue();
100 int GetImageCacheIndex(const Tizen::Base::String &path);
101 bool GetImageRotateStatus(void) const;
104 static ImageViewerPresentationModel* __pPresentationModelInstance;
105 static ImageProvider* __pImageProvider;
106 static ImageEvent* __pImageEvent;
107 static Tizen::Base::Collection::ArrayList* __pImageViewerListener;
108 Tizen::Base::Collection::ArrayList* __pFileUpdateListener;
109 Tizen::Base::Collection::ArrayList* __pImageCaches;
110 long long __contactId;
113 Tizen::Base::String __type;
114 int __durationOfSlideShow;
115 SlideShowTransitionEffect __transitionEffectOfSlideShow;
116 Tizen::Io::FileEventManager* __pFileEventManager;
117 SettingPresentationModel* __pSettingPresentationModel;
118 bool __isImageRotated;
121 #endif /* _IV_VIEWER_PRESENTATION_MODEL_H_ */