1 #ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
2 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
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>
31 * Construct a platform abstraction and return it.
33 Integration::PlatformAbstraction* CreatePlatformAbstraction();
35 namespace TizenPlatform
41 * Concrete implementation of the platform abstraction class.
43 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
46 public: // Construction & Destruction
51 TizenPlatformAbstraction();
56 virtual ~TizenPlatformAbstraction();
58 public: // PlatformAbstraction overrides
61 * @copydoc PlatformAbstraction::Suspend()
63 virtual void Suspend();
66 * @copydoc PlatformAbstraction::Resume()
68 virtual void Resume();
71 * @copydoc PlatformAbstraction::GetClosestImageSize()
73 virtual ImageDimensions GetClosestImageSize( const std::string& filename,
75 FittingMode::Type fittingMode,
76 SamplingMode::Type samplingMode,
77 bool orientationCorrection );
80 * @copydoc PlatformAbstraction::GetClosestImageSize()
82 virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
84 FittingMode::Type fittingMode,
85 SamplingMode::Type samplingMode,
86 bool orientationCorrection );
89 * @copydoc PlatformAbstraction::LoadResource()
91 virtual void LoadResource(const Integration::ResourceRequest& request);
94 * @copydoc PlatformAbstraction::LoadResourceSynchronously()
96 virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
99 * @copydoc PlatformAbstraction::DecodeBuffer()
101 virtual Integration::BitmapPtr DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
104 * @copydoc PlatformAbstraction::CancelLoad()
106 virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
109 * @copydoc PlatformAbstraction::GetResources()
111 virtual void GetResources(Integration::ResourceCache& cache);
114 * @copydoc PlatformAbstraction::JoinLoaderThreads()
116 virtual void JoinLoaderThreads();
119 * @copydoc PlatformAbstraction::GetDefaultFontSize()
121 virtual int GetDefaultFontSize() const;
124 * @copydoc PlatformAbstraction::LoadFile()
126 virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
129 * @copydoc PlatformAbstraction::LoadFile()
131 virtual std::string LoadFile( const std::string& filename );
134 * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
136 virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
139 * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
141 virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
144 * Sets path for data/resource storage.
145 * @param[in] path data/resource storage path
147 void SetDataStoragePath( const std::string& path );
151 TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
152 TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
154 ResourceLoader* mResourceLoader;
155 std::string mDataStoragePath;
158 } // namespace TizenPlatform
161 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__