/
Rtt_AndroidDevice.h
94 lines (75 loc) · 2.94 KB
/
Rtt_AndroidDevice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
//////////////////////////////////////////////////////////////////////////////
//
// This file is part of the Corona game engine.
// For overview and more information on licensing please refer to README.md
// Home page: https://github.com/coronalabs/corona
// Contact: support@coronalabs.com
//
//////////////////////////////////////////////////////////////////////////////
#ifndef _Rtt_AndroidDevice_H__
#define _Rtt_AndroidDevice_H__
#include "Rtt_MPlatformDevice.h"
#include "Rtt_DeviceOrientation.h"
#include "Rtt_AndroidInputDeviceManager.h"
class NativeToJavaBridge;
// ----------------------------------------------------------------------------
namespace Rtt
{
class AndroidPlatform;
class MCallback;
class String;
// ----------------------------------------------------------------------------
class AndroidDevice : public MPlatformDevice
{
public:
typedef MPlatformDevice Super;
public:
AndroidDevice( Rtt_Allocator& allocator, NativeToJavaBridge *ntjb );
~AndroidDevice();
public:
virtual const char* GetName() const;
virtual const char* GetManufacturer() const;
virtual const char* GetModel() const;
virtual const char* GetUniqueIdentifier( IdentifierType t ) const;
virtual EnvironmentType GetEnvironment() const;
virtual const char* GetPlatformName() const;
virtual const char* GetPlatform() const;
virtual const char* GetPlatformVersion() const;
virtual const char* GetProductName() const;
virtual const char* GetArchitectureInfo() const;
virtual PlatformInputDeviceManager& GetInputDeviceManager();
public:
virtual void Vibrate(const char * hapticType, const char* hapticStyle) const;
virtual void Vibrate() const { Vibrate(NULL, NULL); }
public:
virtual void BeginNotifications( EventType type ) const;
virtual void EndNotifications( EventType type ) const;
virtual bool DoesNotify( EventType type ) const;
virtual bool HasEventSource( EventType type ) const;
virtual void SetAccelerometerInterval( U32 frequency ) const;
virtual void SetGyroscopeInterval( U32 frequency ) const;
public:
virtual void SetLocationAccuracy( Real meters ) const;
virtual void SetLocationThreshold( Real meters ) const;
virtual void SetOrientation( DeviceOrientation::Type orientation );
public:
virtual DeviceOrientation::Type GetOrientation() const;
private:
Rtt_Allocator& fAllocator;
DeviceNotificationTracker fTracker;
AndroidInputDeviceManager fInputDeviceManager;
mutable String *fName;
mutable String *fManufacturer;
mutable String *fModel;
mutable String *fUniqueIdentifier;
mutable String *fHardwareIdentifier;
mutable String *fOSIdentifier;
mutable String *fPlatformVersion;
mutable String *fProduct;
DeviceOrientation::Type fOrientation;
NativeToJavaBridge *fNativeToJavaBridge;
};
// ----------------------------------------------------------------------------
} // namespace Rtt
// ----------------------------------------------------------------------------
#endif // _Rtt_AndroidDevice_H__