Deprecate all Image classes
[platform/core/uifw/dali-core.git] / dali / public-api / images / image.h
1 #ifndef __DALI_IMAGE_H__
2 #define __DALI_IMAGE_H__
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/object/base-handle.h>
26 #include <dali/public-api/signals/dali-signal.h>
27
28 namespace Dali
29 {
30 /**
31  * @addtogroup dali_core_images
32  * @{
33  */
34
35 namespace Internal DALI_INTERNAL
36 {
37 class Image;
38 }
39
40 /**
41  * @DEPRECATED_1_2.41
42  *
43  * @brief An Image object represents an image resource that can be used for rendering.
44  *
45  * Image objects can be shared between Actors. This is practical if you have a visual element on screen
46  * which is repeatedly used.
47  *
48  * The image resource is released as soon as the last Image handle is released.
49  * @SINCE_1_0.0
50  * @note If a resource was shared between Image objects it exists until its last reference is gone.
51  *
52  * Image objects are responsible for the underlying resource's lifetime.
53  *
54  * Signals
55  * | %Signal Name           | Method                       |
56  * |------------------------|------------------------------|
57  * | uploaded               | @ref UploadedSignal()        |
58  * @SINCE_1_0.0
59  */
60 class DALI_IMPORT_API Image : public BaseHandle
61 {
62 public:
63
64   /**
65    * @DEPRECATED_1_2.41
66    *
67    * @brief Type of signal for Image Uploaded.
68    * @SINCE_1_0.0
69    */
70   typedef Signal< void (Image) > ImageSignalType;
71
72 public:
73
74   /**
75    * @DEPRECATED_1_2.41
76    *
77    * @brief Constructor which creates an empty Image handle.
78    *
79    * This class has no New method.
80    * Use the appropriate New method of its subclasses to create an initialized handle.
81    * (Dali::BufferImage::New(), Dali::EncodedBufferImage::New(), Dali::FrameBufferImage::New(),
82    * Dali::NativeImage::New(), Dali::ResourceImage::New()).
83    * @SINCE_1_0.0
84    */
85   Image() DALI_DEPRECATED_API;
86
87   /**
88    * @DEPRECATED_1_2.41
89    *
90    * @brief Destructor.
91    *
92    * This is non-virtual since derived Handle types must not contain data or virtual methods.
93    * @SINCE_1_0.0
94    */
95   ~Image() DALI_DEPRECATED_API;
96
97   /**
98    * @DEPRECATED_1_2.41
99    *
100    * @brief This copy constructor is required for (smart) pointer semantics.
101    *
102    * @SINCE_1_0.0
103    * @param[in] handle A reference to the copied handle
104    */
105   Image(const Image& handle) DALI_DEPRECATED_API;
106
107   /**
108    * @DEPRECATED_1_2.41
109    *
110    * @brief This assignment operator is required for (smart) pointer semantics.
111    *
112    * @SINCE_1_0.0
113    * @param[in] rhs A reference to the copied handle
114    * @return A reference to this
115    */
116   Image& operator=(const Image& rhs) DALI_DEPRECATED_API;
117
118   /**
119    * @DEPRECATED_1_2.41
120    *
121    * @brief Downcasts a handle to Image handle.
122    *
123    * If handle points to a Image object, the
124    * downcast produces valid handle. If not, the returned handle is left uninitialized.
125    * @SINCE_1_0.0
126    * @param[in] handle Handle to an object
127    * @return Handle to a Image object or an uninitialized handle
128    */
129   static Image DownCast( BaseHandle handle ) DALI_DEPRECATED_API;
130
131   /**
132    * @DEPRECATED_1_2.41
133    *
134    * @brief Returns the width of the image.
135    *
136    * Returns either the requested width or the actual loaded width if no specific size was requested.
137    *
138    * @SINCE_1_0.0
139    * @return Width of the image in pixels
140    */
141   unsigned int GetWidth() const DALI_DEPRECATED_API;
142
143   /**
144    * @DEPRECATED_1_2.41
145    *
146    * @brief Returns the height of the image.
147    *
148    * Returns either the requested height or the actual loaded height if no specific size was requested.
149    *
150    * @SINCE_1_0.0
151    * @return Height of the image in pixels
152    */
153   unsigned int GetHeight() const DALI_DEPRECATED_API;
154
155 public: // Signals
156
157   /**
158    * @DEPRECATED_1_2.41
159    *
160    * @brief This signal is emitted when the image data gets uploaded to GL.
161    *
162    * It Will be sent after an actor using the image is added to
163    * the stage, when such a staged image is reloaded, or when a staged
164    * BufferImage calls Update().
165    * @SINCE_1_0.0
166    * @return A signal object to Connect() with
167    */
168   ImageSignalType& UploadedSignal() DALI_DEPRECATED_API;
169
170 public: // Not intended for application developers
171
172   explicit DALI_INTERNAL Image(Internal::Image*);
173 };
174
175 /**
176  * @}
177  */
178 } // namespace Dali
179
180 #endif // __DALI_IMAGE_H__