merge commits of 2.2.1 to public
[platform/framework/native/image.git] / src / FMedia_ImageUriDataEventArg.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file   FMedia_ImageUriDataEventArg.h
20  * @brief  This file contains the declaration of _ImageUriDataEventArg class,
21  *               required internally by Image::DecodeUrl.
22  */
23
24 #ifndef FMEDIA_INTERNAL_IMAGEURIDATAEVENTARG_H_
25 #define FMEDIA_INTERNAL_IMAGEURIDATAEVENTARG_H_
26
27 //Include
28 #include <unique_ptr.h>
29 #include <FBase.h>
30 #include <FGraphics.h>
31 #include <FBaseRtIEventArg.h>
32 #include <FMediaImageTypes.h>
33
34 namespace Tizen{ namespace Media{
35 //
36 // @enum _ImageUriDataEventType
37 // @brief This represents ImageUriData event type.
38 //
39 enum _ImageUriDataEventType
40 {
41         IMAGE_URI_DATA_EVENT_NONE,        // Event_None
42         IMAGE_URI_DATA_EVENT_SUCCESS,   // Success Event
43         IMAGE_URI_DATA_EVENT_CANCEL,    // Cancel Event
44         IMAGE_URI_DATA_EVENT_ERROR,      // Error event
45         IMAGE_URI_DATA_EVENT_DESTROY,   // Destroy event
46 };
47
48
49 /**
50  * @class       _ImageUriDataEventTypeArg
51  * @brief       This class contains the base information about the ImageUriData event.
52  *
53  */
54 class _ImageUriDataEventTypeArg
55         : public Tizen::Base::Runtime::IEventArg
56         , public Tizen::Base::Object
57 {
58 public:
59
60         _ImageUriDataEventTypeArg(void);
61
62         virtual ~_ImageUriDataEventTypeArg(void);
63
64         _ImageUriDataEventType GetEventType(void) const;
65
66         void SetEventType(_ImageUriDataEventType eType);
67
68         RequestId GetRequestId(void) const;
69
70         void SetRequestId(RequestId reqId);
71
72 private:
73         _ImageUriDataEventTypeArg(const _ImageUriDataEventTypeArg& rhs);
74         _ImageUriDataEventTypeArg& operator =(const _ImageUriDataEventTypeArg& rhs);
75
76         _ImageUriDataEventType __ImageUriDataEventType;
77         RequestId       __reqId;
78 };
79
80 /**
81  * @class       _ImageUriDataEventArg
82  * @brief       This class contains the information about the ImageUriData event.
83  *
84  * @see   ImageUriData
85  *
86  */
87 class _ImageUriDataEventArg
88         : public _ImageUriDataEventTypeArg
89 {
90
91 public:
92         _ImageUriDataEventArg(void);
93
94         virtual ~_ImageUriDataEventArg(void);
95
96         Tizen::Base::ByteBuffer* GetData(void) const;
97
98         Tizen::Graphics::Dimension GetDestDimension(void) const;
99
100         ImageFormat GetImageFormat(void) const;
101
102         Tizen::Graphics::BitmapPixelFormat GetColorFormat(void) const;
103
104         result GetResult(void) const;
105
106         void SetData(Tizen::Base::ByteBuffer* data);
107
108         void SetDestDimension(Tizen::Graphics::Dimension dimension);
109
110         void SetImageFormat(ImageFormat imageFormat);
111
112         void SetColorFormat(Tizen::Graphics::BitmapPixelFormat colorFormat);
113
114         void SetResult(result r);
115
116 private:
117         std::unique_ptr<Tizen::Base::ByteBuffer> __pImageData;
118         Tizen::Graphics::Dimension __dimension;
119         ImageFormat __imageFormat;
120         Tizen::Graphics::BitmapPixelFormat __colorFormat;
121         result __res;
122 };
123
124 /**
125   * @class      _ImageUriDataErrorArg
126   * @brief      This class contains the error about the ImageUriData.
127   *
128   * @see          ImageUriData
129   *
130   */
131 class _ImageUriDataErrorArg
132         : public _ImageUriDataEventTypeArg
133 {
134 public:
135         _ImageUriDataErrorArg(void);
136
137         virtual ~_ImageUriDataErrorArg(void);
138
139         result GetError(void) const;
140
141         Tizen::Base::String GetErrorCode(void) const;
142
143         Tizen::Base::String GetErrorMessage(void) const;
144
145         void SetError(result r);
146
147         void SetErrorCode(const Tizen::Base::String& errorCode);
148
149         void SetErrorMessage(const Tizen::Base::String& errorMessage);
150
151 private:
152         result __error;
153         Tizen::Base::String __errorCode;
154         Tizen::Base::String __errorMessage;
155 };
156
157
158 /**
159  * @class       _ImageUriDataDestroyArg
160  * @brief       This class if for life-cycle of ImageUriData.
161  *
162  *      @see    ImageUriData
163  *
164  */
165 class _ImageUriDataDestroyArg
166         : public _ImageUriDataEventTypeArg
167 {
168 public:
169         _ImageUriDataDestroyArg(void);
170
171         virtual ~_ImageUriDataDestroyArg(void);
172 };
173
174 }} // Tizen::Media
175
176 #endif // FMEDIA_INTERNAL_IMAGEURIDATAEVENTARG_H_