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