1.Set as Contact fix 2.File size limit set to 255
[apps/osp/ImageViewer.git] / inc / IvImageProvider.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
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                IvImageProvider.h
19  * @brief               This is the header file for ImageProvider class.
20  */
21
22 #ifndef _IV_IMAGE_PROVIDER_H_
23 #define _IV_IMAGE_PROVIDER_H_
24
25 class ImageEvent;
26
27 class ImageProvider
28         : public Tizen::Base::Runtime::EventDrivenThread
29 {
30 public:
31         void RequestImage(const Tizen::Base::String& filePath, const ImageEvent* pRequestEvent);
32         Tizen::Graphics::Bitmap* GetImage(const Tizen::Base::String& filePath);
33         void ClearImageRequests(bool isAppTerminating = false);
34
35         virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList * pArgs);
36         virtual bool OnStart(void);
37         virtual void OnStop(void);
38
39         static ImageProvider* GetInstance(void);
40         static void Release(void);
41
42 private:
43         ImageProvider(void);
44         ImageProvider(ImageProvider& value);
45         ImageProvider& operator=(ImageProvider&);
46         virtual ~ImageProvider(void);
47
48         result Construct(void);
49         Tizen::Graphics::Bitmap* GetImageByDecodeN(const Tizen::Base::String& filePath) const;
50
51         static void CreateInstance(void);
52         static void DestroyInstance(void);
53
54 private:
55         static ImageProvider* __pImageProviderInstance;
56         static Tizen::Base::Collection::ArrayList* __pImageEventListener;
57
58         Tizen::Base::Runtime::Mutex* __pMutexCmd;
59         Tizen::Base::Collection::ArrayList* __pCmdQueue;
60         unsigned long __requestId;
61         bool __isAppTerminating;
62 };
63
64 #endif /* _IV_IMAGE_PROVIDER_H_ */