Subversion Repository Public Repository

litesoft

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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/*
 * Copyright 2010 Daniel Kurka
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.googlecode.gwtphonegap.client;

import com.google.gwt.event.shared.HandlerRegistration;
import com.googlecode.gwtphonegap.client.accelerometer.Accelerometer;
import com.googlecode.gwtphonegap.client.camera.Camera;
import com.googlecode.gwtphonegap.client.capture.Capture;
import com.googlecode.gwtphonegap.client.compass.Compass;
import com.googlecode.gwtphonegap.client.connection.Connection;
import com.googlecode.gwtphonegap.client.contacts.Contacts;
import com.googlecode.gwtphonegap.client.device.Device;
import com.googlecode.gwtphonegap.client.event.Event;
import com.googlecode.gwtphonegap.client.file.File;
import com.googlecode.gwtphonegap.client.geolocation.Geolocation;
import com.googlecode.gwtphonegap.client.media.MediaModule;
import com.googlecode.gwtphonegap.client.notification.Notification;
import com.googlecode.gwtphonegap.client.plugins.PhoneGapPlugin;

/**
 * This class is a wrapper class for phonegap.js
 * 
 * The implementation is based on {@link http://docs.phonegap.com/}
 * 
 * Available modules are:
 * <ul>
 * <li>Accelerometer</li>
 * <li>Camera</li>
 * <li>Capture</li>
 * <li>Compass</li>
 * <li>Conntection</li>
 * <li>Contacts</li>
 * <li>Device</li>
 * <li>Events</li>
 * <li>File</li>
 * <li>Geolocation</li>
 * <li>Media</li>
 * <li>Log</li>
 * <li>Notification</li>
 * </ul>
 * 
 * 
 * 
 * @author Daniel Kurka
 * 
 */
public interface PhoneGap {

	/**
	 * Determine if phonegap is initialized
	 * 
	 * @return true if phonegap is initialized
	 */
	public boolean isPhoneGapInitialized();

	/**
	 * Initializes Phonegap with a default timeout see:
	 * {@link PhoneGapStandardImpl#initializePhoneGap(int)}
	 */
	public void initializePhoneGap();

	/**
	 * initialize Phonegap
	 * 
	 * If Phonegap is initialized successfully within timeout a
	 * {@link PhoneGapAvaibleEvent} is fired, else a
	 * {@link PhoneGapTimeoutEvent} is fired
	 * 
	 * @param timeoutInMs the timeout in milliseconds
	 */
	public void initializePhoneGap(final int timeoutInMs);

	/**
	 * Add a handler for {@link PhoneGapAvaibleEvent}
	 * 
	 * @param handler the handler to add
	 * @return the handler registration
	 */
	public HandlerRegistration addHandler(PhoneGapAvailableHandler handler);

	/**
	 * Add a handler for {@link PhoneGapTimeoutEvent}
	 * 
	 * @param handler the handler to add
	 * @return the handler registration
	 */
	public HandlerRegistration addHandler(PhoneGapTimeoutHandler handler);

	/**
	 * get the phonegap device object
	 * 
	 * @return the device object containing device specific information
	 */
	public Device getDevice();

	/**
	 * get the phonegap accelerometer object
	 * 
	 * @return
	 */
	public Accelerometer getAccelerometer();

	/**
	 * get the phonegap camera object
	 * 
	 * @return
	 */
	public Camera getCamera();

	/**
	 * get the phonegap geolocation object
	 * 
	 * @return
	 */
	public Geolocation getGeolocation();

	public Connection getConnection();

	/**
	 * get the phonegap notification object
	 * 
	 * @return
	 */
	public Notification getNotification();

	public Contacts getContacts();

	public PhoneGapPlugin getPluginById(String name);

	public void loadPlugin(String id, PhoneGapPlugin instance);

	public File getFile();

	public Event getEvent();

	// testing for android....
	public boolean exitApp();

	public MediaModule getMedia();

	public Compass getCompass();

	public Capture getCapture();

	public boolean isDevMode();

	public boolean isPhoneGapDevice();

}

Commits for litesoft/trunk/GWT_Sandbox/SampleHello/src/com/googlecode/gwtphonegap/client/PhoneGap.java

Diff revisions: vs.
Revision Author Commited Message
666 GeorgeS picture GeorgeS Sun 13 May, 2012 18:11:48 +0000