Removed setter form
[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.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                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 #include <FBase.h>
26 #include <FGraphics.h>
27
28 class ImageEvent;
29
30 class ImageProvider
31         : public Tizen::Base::Runtime::EventDrivenThread
32 {
33 public:
34         static ImageProvider* GetInstance(void);
35
36 public:
37         static void Release(void);
38
39         void RequestImage(const Tizen::Base::String& filePath, const ImageEvent* event);
40         void ClearImageRequests(bool appTerminating = false);
41
42         virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList * pArgs);
43         virtual bool OnStart(void);
44         virtual void OnStop(void);
45
46 private:
47         ImageProvider(void);
48         virtual ~ImageProvider(void);
49         ImageProvider(ImageProvider& value);
50         ImageProvider& operator=(ImageProvider&);
51
52         result Construct(void);
53         static void CreateInstance(void);
54         static void DestroyInstance(void);
55
56         Tizen::Graphics::Bitmap* GetImageByDecodeN(const Tizen::Base::String& filePath) const;
57
58 private:
59         static ImageProvider* __pImageProviderInstance;
60         static Tizen::Base::Collection::ArrayList* __pImageEventListener;
61
62         Tizen::Base::Runtime::Mutex* __pMutexCmd;
63         Tizen::Base::Collection::ArrayList* __pCmdQueue;
64         unsigned long __requestId;
65         bool __appTerminating;
66 };
67
68 #endif /* _IV_IMAGE_PROVIDER_H_ */