Updated test cases for increased coverage
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / toolkit-bitmap-loader.h
1 #ifndef __DALI_TOOLKIT_BITMAP_LOADER_H__
2 #define __DALI_TOOLKIT_BITMAP_LOADER_H__
3 /*
4  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #define __DALI_BITMAP_LOADER_H__
20
21 #include <string>
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/images/pixel.h>
24 #include <dali/public-api/images/image-operations.h>
25 #include <dali/public-api/object/base-handle.h>
26 #include <dali/devel-api/images/pixel-data.h>
27
28 namespace Dali
29 {
30 namespace Internal
31 {
32 class BitmapLoader;
33 }
34
35 class DALI_IMPORT_API BitmapLoader : public BaseHandle
36 {
37 public:
38
39   static BitmapLoader New( const std::string& url,
40                            ImageDimensions size = ImageDimensions( 0, 0 ),
41                            FittingMode::Type fittingMode = FittingMode::DEFAULT,
42                            SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
43                            bool orientationCorrection = true);
44   BitmapLoader();
45   ~BitmapLoader();
46   BitmapLoader(const BitmapLoader& handle);
47   BitmapLoader& operator=(const BitmapLoader& rhs);
48
49 public:
50   void Load();
51   bool IsLoaded();
52   std::string GetUrl() const;
53   PixelData GetPixelData() const;
54
55   void WaitForLoading();
56   static BitmapLoader GetLatestCreated(); // return the latest created BitmapLoader
57   static void ResetLatestCreated();
58
59 public: // Not intended for application developers
60
61   explicit DALI_INTERNAL BitmapLoader(Internal::BitmapLoader*);
62 };
63
64 } // Dali
65
66 #endif /* __DALI_TOOLKIT_BITMAP_LOADER_H__ */