All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
iOSPlatformAbstractionModule.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Helpers.h"
7 #include "Web.h"
8 #include "Tasks.h"
9 #include "Concurrency.h"
10 #include "Rendering.h"
11 #include "IPlatformAbstractionModule.h"
12 #include "iOSUrlEncoder.h"
13 #include "iOSFileIO.h"
14 #include "iOSTextureFileLoader.h"
15 #include "iOSGlTaskContextFactory.h"
16 #include "iOSConnectivityService.h"
17 #include "MessageQueue.h"
18 #include "ITaskPoolMessage.h"
19 #include "DefaultWorkPool.h"
20 #include "SceneBuilderModuleFactory.h"
21 #include "NativeTextureFactory.h"
22 #include "IThreadService.h"
23 
24 namespace Eegeo
25 {
26  namespace iOS
27  {
28  class iOSPNGDecoder;
29 
31  {
32  public:
33 
34  static iOSPlatformAbstractionModule* Create(
35  const std::string& apiKey,
36  const std::vector<std::string>& fileIOBundleIds,
37  const std::string& fileIOAssetPathPrefix,
38  Helpers::Jpeg::IJpegLoader& jpegLoader,
39  const Unity::UnityCallbacks* pUnityCallbacks);
40 
41 
44  const std::string& apiKey,
45  const std::string& assetPathPrefix = "",
46  const Unity::UnityCallbacks* pUnityCallbacks = nullptr);
47 
49 
50  Helpers::ITextureFileLoader& GetTextureFileLoader() const;
51  Web::IWebLoadRequestFactory& GetWebLoadRequestFactory() const;
52  Web::IWebLoadRequestFactory& GetPlatformWebLoadRequestFactory() const;
53  Helpers::IHttpCache& GetHttpCache() const;
54  Helpers::IFileIO& GetFileIO() const;
55  Helpers::UrlHelpers::IUrlEncoder& GetUrlEncoder() const;
56  Concurrency::Tasks::IGlTaskContextFactory& GetGlTaskContextFactory() const;
57 
58  iOS::iOSTextureFileLoader& GetiOSTextureFileLoader() const;
59  Web::IWebLoadRequestFactory& GetiOSWebLoadRequestFactory() const;
60  Web::WebRequestService& GetiOSWebRequestService() const;
61  Web::IWebProxySettings& GetProxySettings() const;
62  Web::ISSLSettings& GetSSLSettings() const;
63  Eegeo::Helpers::IHttpCache& GetiOSHttpCache() const;
64  iOS::iOSFileIO& GetiOSFileIO() const;
65  iOSUrlEncoder& GetiOSUrlEncoder() const;
66  iOS::iOSGlTaskContextFactory& GetiOSGlTaskContextFactory() const;
67  Eegeo::Web::IConnectivityService& GetConnectivityService() const;
68  Eegeo::Concurrency::Tasks::IWorkPool& GetWorkPool() const;
69  Modules::ISceneBuilderModuleFactory& GetSceneBuilderModuleFactory();
70  Rendering::AsyncTexturing::ITextureFactory& GetTextureFactory() const;
71 
72  void SetWebIOWorkPool(Concurrency::Tasks::IWorkPool* pWorkPool);
73 
74  void OnPause();
75  void OnResume();
76  void Update();
77 
78  private:
80  iOSUrlEncoder* piOSUrlEncoder,
81  iOS::iOSFileIO* piOSFileIO,
82  Helpers::IHttpCache* piOSHttpCache,
83  iOS::iOSPNGDecoder* pPNGDecoder,
84  Helpers::ITextureFileLoader * piOSTextureFileLoader,
85  Web::WebModule* pWebModule,
86  Web::IWebLoadRequestFactory* pPlatformWebLoadRequestFactory,
87  iOS::iOSGlTaskContextFactory* piOSGlTaskContextFactory,
88  iOS::iOSConnectivityService* piOSConnectivityService,
89  Concurrency::IThreadService* pThreadFactory,
94  Concurrency::Tasks::TaskWorkPool* pGeneralWorkPool,
95  Modules::ISceneBuilderModuleFactory* pSceneBuilderModuleFactory,
97  );
98 
99  void HandleNetworkActivityChanged(const bool& hasNetworkActivity);
100 
101  iOSUrlEncoder* m_piOSUrlEncoder;
102  iOS::iOSFileIO* m_piOSFileIO;
103  Helpers::IHttpCache* m_piOSHttpCache;
104  iOS::iOSPNGDecoder* m_pPNGDecoder;
105  Helpers::ITextureFileLoader * m_piOSTextureFileLoader;
106  Web::WebModule* m_pWebModule;
107  Web::IWebLoadRequestFactory* m_pPlatformWebLoadRequestFactory;
108  iOS::iOSGlTaskContextFactory* m_piOSGlTaskContextFactory;
109  iOS::iOSConnectivityService* m_piOSConnectivityService;
112  Concurrency::IThreadService* m_pThreadService;
113 
116  Concurrency::Tasks::TaskWorkPool* m_pGeneralWorkPool;
117  Modules::ISceneBuilderModuleFactory* m_pSceneBuilderModuleFactory;
119 
121  };
122  }
123 }