Formatting API
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / image-loader / atlas-upload-observer.h
1 #ifndef DALI_TOOLKIT_ATLAS_UPLOAD_OBSERVER_H
2 #define DALI_TOOLKIT_ATLAS_UPLOAD_OBSERVER_H
3
4 /*
5  * Copyright (c) 2020 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 #include <dali-toolkit/public-api/dali-toolkit-common.h>
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/public-api/signals/callback.h>
24
25 namespace Dali
26 {
27 namespace Toolkit
28 {
29 namespace Internal
30 {
31 class ImageAtlas;
32 }
33
34 /**
35  * @brief Base class used to observe the upload status of the ImageAtlas when requesting an image atlasing.
36  *
37  * Derived class should implement the UploadCompleted method which would get executed once the texture is ready.
38  */
39 class DALI_TOOLKIT_API AtlasUploadObserver
40 {
41 public:
42   /**
43    * @brief Constructor.
44    */
45   AtlasUploadObserver();
46
47   /**
48    * @brief Virtual destructor.
49    */
50   virtual ~AtlasUploadObserver();
51
52   /**
53    * The action to be taken once the upload is completed.
54    */
55   virtual void UploadCompleted() = 0;
56
57 public: // not intended for developer, called by ImageAtlas internally to get notified when this observer dies
58   /**
59    * @brief Register an ImageAtlas which be notified when the observer is destructing.
60    * @param[in] imageAtlas The ImageAtlas object to get notification about the destruction of the observer.
61    */
62   void Register(Internal::ImageAtlas& imageAtlas);
63
64   /**
65    * @brief Unregister an ImageAtlas which be notified when the observer is destructing.
66    * @param[in] imageAtlas The ImageAtlas object to get notification about the destruction of the observer.
67    */
68   void Unregister(Internal::ImageAtlas& imageAtlas);
69
70 private:
71   Vector<Internal::ImageAtlas*> mAtlasList; ///< The list of the registered ImageAtlas object
72 };
73
74 } // namespace Toolkit
75
76 } // namespace Dali
77
78 #endif /* DALI_TOOLKIT_ATLAS_UPLOAD_OBSERVER_H */