Initial removal of Text features
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / slp / slp-platform-abstraction.h
1 #ifndef __DALI_SLP_PLATFORM_ABSTRACTION_H__
2 #define __DALI_SLP_PLATFORM_ABSTRACTION_H__
3
4 /*
5  * Copyright (c) 2014 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 <ft2build.h>
26 #include FT_FREETYPE_H
27 #include <string>
28
29 namespace Dali
30 {
31
32 /**
33  * Construct a platform abstraction and return it.
34  */
35 Integration::PlatformAbstraction* CreatePlatformAbstraction();
36
37 namespace SlpPlatform
38 {
39
40 class DynamicsFactory;
41 class ResourceLoader;
42
43 /**
44  * Concrete implementation of the platform abstraction class.
45  */
46 class SlpPlatformAbstraction : public Integration::PlatformAbstraction
47 {
48
49 public: // Construction & Destruction
50
51   /**
52    * Constructor
53    */
54   SlpPlatformAbstraction();
55
56   /**
57    * Destructor
58    */
59   virtual ~SlpPlatformAbstraction();
60
61 public: // PlatformAbstraction overrides
62
63   /**
64    * @copydoc PlatformAbstraction::GetTimeMicroseconds()
65    */
66   virtual void GetTimeMicroseconds(unsigned int &seconds, unsigned int &microSeconds);
67
68   /**
69    * @copydoc PlatformAbstraction::Suspend()
70    */
71   virtual void Suspend();
72
73   /**
74    * @copydoc PlatformAbstraction::Resume()
75    */
76   virtual void Resume();
77
78   /**
79    * @copydoc PlatformAbstraction::GetClosestImageSize()
80    */
81   virtual void GetClosestImageSize( const std::string& filename,
82                                     const ImageAttributes& attributes,
83                                     Vector2& closestSize );
84
85   /**
86    * @copydoc PlatformAbstraction::GetClosestImageSize()
87    */
88   virtual void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
89                                     const ImageAttributes& attributes,
90                                     Vector2& closestSize );
91
92   /**
93    * @copydoc PlatformAbstraction::LoadResource()
94    */
95   virtual void LoadResource(const Integration::ResourceRequest& request);
96
97   /**
98    * @copydoc PlatformAbstraction::LoadResourceSynchronously()
99    */
100   virtual Integration::ResourcePointer LoadResourceSynchronously(const Integration::ResourceType& resourceType, const std::string& resourcePath);
101
102   /**
103    * @copydoc PlatformAbstraction::SaveResource()
104    */
105   virtual void SaveResource(const Integration::ResourceRequest& request);
106
107   /**
108    * @copydoc PlatformAbstraction::CancelLoad()
109    */
110   virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
111
112   /**
113    * @copydoc PlatformAbstraction::GetResources()
114    */
115   virtual void GetResources(Integration::ResourceCache& cache);
116
117   /**
118    * @copydoc PlatformAbstraction::IsLoading()
119    */
120   virtual bool IsLoading();
121
122   /**
123    * @copydoc PlatformAbstraction::JoinLoaderThreads()
124    */
125   virtual void JoinLoaderThreads();
126
127   /**
128    * @copydoc PlatformAbstraction::SetDpi()
129    */
130   virtual void SetDpi (unsigned int DpiHorizontal, unsigned int DpiVertical);
131
132   /**
133    * @copydoc PlatformAbstraction::LoadFile()
134    */
135   virtual bool LoadFile( const std::string& filename, std::vector< unsigned char >& buffer ) const;
136
137   /**
138    * @copydoc PlatformAbstraction::LoadFile()
139    */
140   virtual std::string LoadFile( const std::string& filename );
141
142   /**
143    * @copydoc PlatformAbstraction::SaveFile()
144    */
145   virtual bool SaveFile(const std::string& filename, std::vector< unsigned char >& buffer) const;
146
147   /**
148    * @copydoc PlatformAbstraction::GetDynamicsFactory();
149    */
150   virtual Integration::DynamicsFactory* GetDynamicsFactory();
151
152 private:
153   ResourceLoader* mResourceLoader;
154   DynamicsFactory* mDynamicsFactory;
155 };
156
157 }  // namespace SlpPlatform
158 }  // namespace Dali
159
160 #endif // __DALI_SLP_PLATFORM_ABSTRACTION_H__