Removed setter form
[apps/osp/ImageViewer.git] / inc / IvImageViewerPresentationModel.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://floralicense.org/license/
9 //
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.
15 //
16
17 /**
18  * @file                IvImageViewerPresentationModel.h
19  * @brief               This is the header file for ImageViewerPresentationModel class.
20  */
21
22 #ifndef _IV_VIEWER_PRESENTATION_MODEL_H_
23 #define _IV_VIEWER_PRESENTATION_MODEL_H_
24
25 #include <FApp.h>
26 #include <FAppIAppControlEventListener.h>
27 #include <FBase.h>
28 #include <FBaseColArrayList.h>
29 #include <FContent.h>
30 #include <FGraphics.h>
31 #include <FIo.h>
32 #include <FUi.h>
33 #include "IvImageProviderEventListener.h"
34 #include "IvTypes.h"
35
36 class ImageEvent;
37 class ImageInfo;
38 class ImageProvider;
39 class IImageViewerEventListener;
40 class SettingPresentationModel;
41 class IFileUpdateEventListener;
42
43 class ImageViewerPresentationModel
44         : public IImageProviderEventListener
45         , public Tizen::Content::IContentUpdateEventListener
46 {
47 public:
48         static ImageViewerPresentationModel* GetInstance();
49
50 public:
51         result AddListener(IImageViewerEventListener* listener);
52         result RemoveListener(IImageViewerEventListener& listner);
53
54         result AddFileUpdateListener(IFileUpdateEventListener* listener);
55         result RemoveFileUpdateListener(IFileUpdateEventListener& listner);
56
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 AddImageCache(const Tizen::Base::String& filePath);
64
65         int GetFileCount(void) const;
66         Tizen::Base::String GetType(void) const;
67         int GetStartIndex(void) const;
68
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;
72
73         int GetSetterIndex(void) const;
74         void SetSetterIndex(const int index);
75
76         void SetImageRotateStatus(bool value);
77
78         int GetDurationOfSlideShow(void) const;
79         SlideShowTransitionEffect GetTransitionEffectOfSlideShow(void) const;
80
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);
84
85         virtual void OnImageReceivedN(Tizen::Base::Runtime::IEventArg& eventArg);
86
87         //From IContentUpdateEventListener
88         virtual void OnContentFileCreated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
89         virtual void OnContentFileUpdated(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
90         virtual void OnContentFileDeleted(Tizen::Content::ContentId contentId, Tizen::Content::ContentType contentType, result r);
91         virtual void OnContentDirectoryScanCompleted(const Tizen::Base::String& directoryPath, result r);
92
93
94 private:
95         ImageViewerPresentationModel(void);
96         ImageViewerPresentationModel(const ImageViewerPresentationModel&);
97         virtual ~ImageViewerPresentationModel(void);
98         ImageViewerPresentationModel& operator=(const ImageViewerPresentationModel&);
99
100         result Construct(void);
101         static void CreateInstance(void);
102         static void DestroyInstance(void);
103
104         void LoadSettingValue();
105         int GetImageCacheIndex(const Tizen::Base::String& );
106         bool GetImageRotateStatus(void) const;
107
108 private:
109         static ImageViewerPresentationModel* __pPresentationModelInstance;
110         static ImageProvider* __pImageProvider;
111         static ImageEvent* __pImageEvent;
112         static Tizen::Base::Collection::ArrayList* __pImageViewerListener;
113         Tizen::Base::Collection::ArrayList* __pFileUpdateListener;
114         Tizen::Base::Collection::ArrayList* __pImageCaches;
115         long long __contactId;
116         int __startIndex;
117         int __setterIndex;
118         Tizen::Base::String __type;
119         int __durationOfSlideShow;
120         SlideShowTransitionEffect __transitionEffectOfSlideShow;
121         Tizen::Content::ContentManager* __pCntMgr;
122         SettingPresentationModel* __pSettingPresentationModel;
123         bool __isImageRotated;
124         bool __ivTriggeredEvent;
125         short __contentFileEventType;
126         Tizen::Content::ContentId __contentId;
127         bool __ivTriggeredDeleteEvent;
128 };
129
130 #endif /* _IV_VIEWER_PRESENTATION_MODEL_H_ */