Merge "Set proper locale to harfbuzz" into devel/master
[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/public-api/common/dali-common.h>
23
24 #include <string>
25
26 namespace Dali
27 {
28
29 namespace TizenPlatform
30 {
31
32 class ResourceLoader;
33
34 /**
35  * Concrete implementation of the platform abstraction class.
36  */
37 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
38 {
39
40 public: // Construction & Destruction
41
42   /**
43    * Constructor
44    */
45   TizenPlatformAbstraction();
46
47   /**
48    * Destructor
49    */
50   virtual ~TizenPlatformAbstraction();
51
52 public: // PlatformAbstraction overrides
53
54   /**
55    * @copydoc PlatformAbstraction::GetClosestImageSize()
56    */
57   virtual ImageDimensions GetClosestImageSize( const std::string& filename,
58                                                ImageDimensions size,
59                                                FittingMode::Type fittingMode,
60                                                SamplingMode::Type samplingMode,
61                                                bool orientationCorrection );
62
63   /**
64    * @copydoc PlatformAbstraction::GetClosestImageSize()
65    */
66   virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
67                                                ImageDimensions size,
68                                                FittingMode::Type fittingMode,
69                                                SamplingMode::Type samplingMode,
70                                                bool orientationCorrection );
71
72   /**
73    * @copydoc PlatformAbstraction::LoadImageSynchronously()
74    */
75   virtual Integration::ResourcePointer LoadImageSynchronously(const Integration::BitmapResourceType& resource, const std::string& resourcePath);
76
77   /**
78    * @copydoc PlatformAbstraction::DecodeBuffer()
79    */
80   virtual Integration::BitmapPtr DecodeBuffer( const Integration::BitmapResourceType& resource, uint8_t * buffer, size_t size );
81
82   /**
83    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
84    */
85   virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
86
87   /**
88    * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
89    */
90   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
91
92   /**
93    * Sets path for data/resource storage.
94    * @param[in] path data/resource storage path
95    */
96   void SetDataStoragePath( const std::string& path );
97
98 private:
99
100   TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
101   TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
102
103   std::string mDataStoragePath;
104
105 };
106
107 /**
108  * Construct a platform abstraction and return it.
109  * @return TizenPlatformAbstraction instance
110  */
111 TizenPlatformAbstraction* CreatePlatformAbstraction();
112
113 /**
114  * Save a file to disk
115  * @param filename to create
116  * @param buffer to store
117  * @param numBytes to store
118  * @return true if successful, false otherwise
119  */
120 bool SaveFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes );
121
122 }  // namespace TizenPlatform
123
124 }  // namespace Dali
125
126 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__