1 #ifndef __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
2 #define __DALI_TIZEN_PLATFORM_ABSTRACTION_H__
5 * Copyright (c) 2014 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::GetTimeMicroseconds()
63 virtual void GetTimeMicroseconds(unsigned int &seconds, unsigned int µSeconds);
66 * @copydoc PlatformAbstraction::Suspend()
68 virtual void Suspend();
71 * @copydoc PlatformAbstraction::Resume()
73 virtual void Resume();
76 * @copydoc PlatformAbstraction::GetClosestImageSize()
78 virtual ImageDimensions GetClosestImageSize( const std::string& filename,
80 FittingMode::Type fittingMode,
81 SamplingMode::Type samplingMode,
82 bool orientationCorrection );
85 * @copydoc PlatformAbstraction::GetClosestImageSize()
87 virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
89 FittingMode::Type fittingMode,
90 SamplingMode::Type samplingMode,
91 bool orientationCorrection );
94 * @copydoc PlatformAbstraction::LoadResource()
96 virtual void LoadResource(const Integration::ResourceRequest& request);
99 * @copydoc PlatformAbstraction::LoadResourceSynchronously()
101 virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
104 * @copydoc PlatformAbstraction::SaveResource()
106 virtual void SaveResource(const Integration::ResourceRequest& request);
109 * @copydoc PlatformAbstraction::CancelLoad()
111 virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
114 * @copydoc PlatformAbstraction::GetResources()
116 virtual void GetResources(Integration::ResourceCache& cache);
119 * @copydoc PlatformAbstraction::IsLoading()
121 virtual bool IsLoading();
124 * @copydoc PlatformAbstraction::JoinLoaderThreads()
126 virtual void JoinLoaderThreads();
129 * @copydoc PlatformAbstraction::GetDefaultFontDescription()
131 virtual void GetDefaultFontDescription( std::string& family, std::string& style ) const;
134 * @copydoc PlatformAbstraction::GetDefaultFontSize()
136 virtual int GetDefaultFontSize() const;
139 * @copydoc PlatformAbstraction::SetDpi()
141 virtual void SetDpi (unsigned int DpiHorizontal, unsigned int DpiVertical);
144 * @copydoc PlatformAbstraction::LoadFile()
146 virtual bool LoadFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
149 * @copydoc PlatformAbstraction::LoadFile()
151 virtual std::string LoadFile( const std::string& filename );
154 * @copydoc PlatformAbstraction::SaveFile()
156 virtual bool SaveFile(const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
159 * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
161 virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
164 * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
166 virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
169 * Sets path for data/resource storage.
170 * @param[in] path data/resource storage path
172 void SetDataStoragePath( const std::string& path );
175 ResourceLoader* mResourceLoader;
176 std::string mDataStoragePath;
179 } // namespace TizenPlatform
182 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__