4748060de06c915fdf842c46ba40e6c945158045
[platform/framework/native/image.git] / inc / FMediaIImageEventListener.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                        FMediaIImageEventListener.h
20  * @brief                       This is the header file for the %IImageDecodeUrlEventListener interface.
21  *
22  * This header file contains the declarations of the %IImageDecodeUrlEventListener interface.
23  */
24
25 #ifndef _FMEDIA_IIMAGE_EVENT_LISTENER_H_
26 #define _FMEDIA_IIMAGE_EVENT_LISTENER_H_
27
28 #include <FBase.h>
29 #include <FGraphics.h>
30 #include <FMediaImageTypes.h>
31
32 namespace Tizen { namespace Media
33 {
34
35 /**
36  * @interface   IImageDecodeUrlEventListener
37  * @brief               This interface provides a listener that receives events associated with the Image::DecodeUrl() method.
38  *
39  * @since               2.0
40  *
41  * The %IImageDecodeUrlEventListener interface provides a listener that receives events associated with the Image::DecodeUrl() method, including specifying the methods used to get the decoded bitmap data from the remote URL.
42  * The %Image::DecodeUrl() method works asynchronously. Therefore, it is important to implement this listener to ensure that the decoding flows correctly.
43  * When an operation of each method is completed, an event is generated and a method of this interface is called.
44  *
45  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/media/viewing_processing_still_images.htm">Viewing and Processing Still Images</a>.
46  */
47 class _OSP_EXPORT_ IImageDecodeUrlEventListener
48         : virtual public Tizen::Base::Runtime::IEventListener
49 {
50
51 public:
52         /**
53         * This is the destructor for this class.
54         *
55         * @since                2.0
56         */
57         virtual ~IImageDecodeUrlEventListener(void) {}
58
59         /**
60         * Called when a Image::DecodeUrl() operation is completed.
61         *
62         * @since                2.0
63         *
64         * @param[in]    reqId             The requested ID
65         * @param[in]    pBitmap           The downloaded bitmap data
66         * @param[in]    r                         The result of the upload
67         * @param[in]    errorCode         The error code
68         * @param[in]    errorMessage  The error message
69         * @remarks      
70         *                         - The Image object must not be deleted in this event listener.
71         *                         - This method passes an auto-scaled bitmap, @n
72         *                           so the dimension can be different from the requested dimension if the passed bitmap is locked.
73         * @see          Image::DecodeUrl()
74         */
75         virtual void OnImageDecodeUrlReceived(RequestId reqId, Tizen::Graphics::Bitmap* pBitmap, result r, const Tizen::Base::String errorCode, const Tizen::Base::String errorMessage) = 0;
76
77 protected:
78         //
79         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
80         //
81         // This method is reserved and may change its name at any time without prior notice.
82         //
83         // @since 2.0
84         //
85         virtual void IImageDecodeUrlEventListener_Reserved1(void){}
86
87         //
88         // This method is for internal use only. Using this method can cause behavioral, security-related, and consistency-related issues in the application.
89         //
90         // This method is reserved and may change its name at any time without prior notice.
91         //
92         // @since 2.0
93         //
94         virtual void IImageDecodeUrlEventListener_Reserved2(void){}
95
96 }; // class IImageDecodeUrlEventListener
97
98 };
99 };   // Tizen::Media
100
101 #endif