cfd881b53d58fbbe31a38ea748409d68c756c58d
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / slp / resource-loader / resource-text-requester.h
1 #ifndef __DALI_SLP_PLATFORM_RESOURCE_TEXT_REQUESTER_H__
2 #define __DALI_SLP_PLATFORM_RESOURCE_TEXT_REQUESTER_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 <platform-abstractions/slp/resource-loader/resource-requester-base.h>
22 #include "resource-thread-text.h"
23
24 namespace Dali
25 {
26 namespace Integration
27 {
28 class ResourceRequest;
29 }
30
31 namespace SlpPlatform
32 {
33
34 class ResourceTextRequester : public ResourceRequesterBase
35 {
36 public:
37   /**
38    * Constructor
39    * @param[in] resourceLoader The resource loader with which to communicate results
40    */
41   ResourceTextRequester( ResourceLoader& resourceLoader );
42
43   /**
44    * Destructor
45    */
46   virtual ~ResourceTextRequester();
47
48   /**
49    * @copydoc ResourceRequester::Pause()
50    */
51   virtual void Pause();
52
53   /**
54    * @copydoc ResourceRequester::Resume()
55    */
56   virtual void Resume();
57
58   /**
59    * @copydoc ResourceRequester::LoadResource()
60    */
61   virtual void LoadResource( Integration::ResourceRequest& request );
62
63   /**
64    * @copydoc ResourceRequester::LoadResourceSynchronously()
65    */
66   virtual Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& type, const std::string& path );
67
68   /**
69    * @copydoc ResourceRequester::LoadFurtherResources()
70    */
71   virtual Integration::LoadStatus LoadFurtherResources( Integration::ResourceRequest& request, LoadedResource partialResource );
72
73   /**
74    * @copydoc ResourceRequester::SaveResource()
75    */
76   virtual void SaveResource(const Integration::ResourceRequest& request );
77
78   /**
79    * @copydoc ResourceRequester::CancelLoad()
80    */
81   virtual void CancelLoad(Integration::ResourceId id, Integration::ResourceTypeId typeId);
82
83 private:
84
85   /**
86    * Create thread if it doesn't exist
87    */
88   void CreateThread();
89
90 protected:
91   ResourceThreadText* mThreadText; ///< Loader thread
92 };
93
94 } // SlpPlatform
95 } // Dali
96
97 #endif // __DALI_SLP_PLATFORM_RESOURCE_TEXT_REQUESTER_H__