Fixed SVACE error in ASTC Loader
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / tizen-platform-abstraction.h
1 #ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
2 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_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/integration-api/platform-abstraction.h>
22 #include <dali/integration-api/resource-cache.h>
23 #include <dali/public-api/common/dali-common.h>
24
25 #include <string>
26
27 namespace Dali
28 {
29
30 /**
31  * Construct a platform abstraction and return it.
32  */
33 Integration::PlatformAbstraction* CreatePlatformAbstraction();
34
35 namespace TizenPlatform
36 {
37
38 class ResourceLoader;
39
40 /**
41  * Concrete implementation of the platform abstraction class.
42  */
43 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
44 {
45
46 public: // Construction & Destruction
47
48   /**
49    * Constructor
50    */
51   TizenPlatformAbstraction();
52
53   /**
54    * Destructor
55    */
56   virtual ~TizenPlatformAbstraction();
57
58 public: // PlatformAbstraction overrides
59
60   /**
61    * @copydoc PlatformAbstraction::Suspend()
62    */
63   virtual void Suspend();
64
65   /**
66    * @copydoc PlatformAbstraction::Resume()
67    */
68   virtual void Resume();
69
70   /**
71    * @copydoc PlatformAbstraction::GetClosestImageSize()
72    */
73   virtual ImageDimensions GetClosestImageSize( const std::string& filename,
74                                                ImageDimensions size,
75                                                FittingMode::Type fittingMode,
76                                                SamplingMode::Type samplingMode,
77                                                bool orientationCorrection );
78
79   /**
80    * @copydoc PlatformAbstraction::GetClosestImageSize()
81    */
82   virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
83                                                ImageDimensions size,
84                                                FittingMode::Type fittingMode,
85                                                SamplingMode::Type samplingMode,
86                                                bool orientationCorrection );
87
88   /**
89    * @copydoc PlatformAbstraction::LoadResource()
90    */
91   virtual void LoadResource(const Integration::ResourceRequest& request);
92
93   /**
94    * @copydoc PlatformAbstraction::LoadResourceSynchronously()
95    */
96   virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
97
98   /**
99    * @copydoc PlatformAbstraction::DecodeBuffer()
100    */
101   virtual Integration::BitmapPtr DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
102
103   /**
104    * @copydoc PlatformAbstraction::CancelLoad()
105    */
106   virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
107
108   /**
109    * @copydoc PlatformAbstraction::GetResources()
110    */
111   virtual void GetResources(Integration::ResourceCache& cache);
112
113   /**
114    * @copydoc PlatformAbstraction::JoinLoaderThreads()
115    */
116   virtual void JoinLoaderThreads();
117
118   /**
119    * @copydoc PlatformAbstraction::GetDefaultFontSize()
120    */
121   virtual int GetDefaultFontSize() const;
122
123   /**
124    * @copydoc PlatformAbstraction::LoadFile()
125    */
126   virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
127
128   /**
129    * @copydoc PlatformAbstraction::LoadFile()
130    */
131   virtual std::string LoadFile( const std::string& filename );
132
133   /**
134    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
135    */
136   virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
137
138   /**
139    * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
140    */
141   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
142
143   /**
144    * Sets path for data/resource storage.
145    * @param[in] path data/resource storage path
146    */
147   void SetDataStoragePath( const std::string& path );
148
149 private:
150
151   TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
152   TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
153
154   ResourceLoader* mResourceLoader;
155   std::string mDataStoragePath;
156 };
157
158 }  // namespace TizenPlatform
159 }  // namespace Dali
160
161 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__