Device Class set in ecore wayland
[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 /**
30  * Construct a platform abstraction and return it.
31  */
32 Integration::PlatformAbstraction* CreatePlatformAbstraction();
33
34 namespace TizenPlatform
35 {
36
37 class ResourceLoader;
38
39 /**
40  * Concrete implementation of the platform abstraction class.
41  */
42 class TizenPlatformAbstraction : public Integration::PlatformAbstraction
43 {
44
45 public: // Construction & Destruction
46
47   /**
48    * Constructor
49    */
50   TizenPlatformAbstraction();
51
52   /**
53    * Destructor
54    */
55   virtual ~TizenPlatformAbstraction();
56
57 public: // PlatformAbstraction overrides
58
59   /**
60    * @copydoc PlatformAbstraction::GetClosestImageSize()
61    */
62   virtual ImageDimensions GetClosestImageSize( const std::string& filename,
63                                                ImageDimensions size,
64                                                FittingMode::Type fittingMode,
65                                                SamplingMode::Type samplingMode,
66                                                bool orientationCorrection );
67
68   /**
69    * @copydoc PlatformAbstraction::GetClosestImageSize()
70    */
71   virtual ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
72                                                ImageDimensions size,
73                                                FittingMode::Type fittingMode,
74                                                SamplingMode::Type samplingMode,
75                                                bool orientationCorrection );
76
77   /**
78    * @copydoc PlatformAbstraction::LoadResourceSynchronously()
79    */
80   virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
81
82   /**
83    * @copydoc PlatformAbstraction::DecodeBuffer()
84    */
85   virtual Integration::BitmapPtr DecodeBuffer( const Integration::ResourceType& resourceType, uint8_t * buffer, size_t size );
86
87   /**
88    * @copydoc PlatformAbstraction::GetDefaultFontSize()
89    */
90   virtual int GetDefaultFontSize() const;
91
92   /**
93    * @copydoc PlatformAbstraction::LoadShaderBinaryFile()
94    */
95   virtual bool LoadShaderBinaryFile( const std::string& filename, Dali::Vector< unsigned char >& buffer ) const;
96
97   /**
98    * @copydoc PlatformAbstraction::SaveShaderBinaryFile()
99    */
100   virtual bool SaveShaderBinaryFile( const std::string& filename, const unsigned char * buffer, unsigned int numBytes ) const;
101
102   /**
103    * Sets path for data/resource storage.
104    * @param[in] path data/resource storage path
105    */
106   void SetDataStoragePath( const std::string& path );
107
108 private:
109
110   TizenPlatformAbstraction( const TizenPlatformAbstraction& ); ///< Undefined
111   TizenPlatformAbstraction& operator=( const TizenPlatformAbstraction& ); ///< Undefined
112
113   ResourceLoader* mResourceLoader;
114   std::string mDataStoragePath;
115 };
116
117 }  // namespace TizenPlatform
118 }  // namespace Dali
119
120 #endif // __DALI_TIZEN_PLATFORM_ABSTRACTION_H__