2017-03-10 14:53:19 +01:00
|
|
|
/* Copyright (C) 2015-2017 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
|
|
|
Gobbetti, Julien Pivotto, Kasha, Steffen Liebergeld, Uwe Hermann
|
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2015-08-03 23:09:49 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.devices;
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2015-06-06 23:24:00 +02:00
|
|
|
import android.net.Uri;
|
|
|
|
|
2015-06-25 14:34:21 +02:00
|
|
|
import java.util.ArrayList;
|
2015-05-18 20:56:19 +02:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2015-08-03 23:09:49 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
|
2016-05-16 17:30:11 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
|
2016-04-04 20:08:34 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
2016-06-24 10:25:08 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
|
2016-04-04 20:08:34 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
|
2016-06-08 20:27:25 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
|
2015-09-24 14:45:21 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
2016-12-31 15:56:05 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
2015-08-03 23:09:49 +02:00
|
|
|
|
2015-08-02 00:12:21 +02:00
|
|
|
/**
|
2016-12-01 17:28:51 +01:00
|
|
|
* Specifies all events that Gadgetbridge intends to send to the gadget device.
|
2015-08-02 00:12:21 +02:00
|
|
|
* Implementations can decide to ignore events that they do not support.
|
|
|
|
* Implementations need to send/encode event to the connected device.
|
|
|
|
*/
|
2015-04-14 01:24:03 +02:00
|
|
|
public interface EventHandler {
|
2015-09-24 14:45:21 +02:00
|
|
|
void onNotification(NotificationSpec notificationSpec);
|
2015-05-13 21:55:22 +02:00
|
|
|
|
2017-01-09 16:33:00 +01:00
|
|
|
void onDeleteNotification(int id);
|
|
|
|
|
2015-08-21 00:58:18 +02:00
|
|
|
void onSetTime();
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2015-08-21 00:58:18 +02:00
|
|
|
void onSetAlarms(ArrayList<? extends Alarm> alarms);
|
2015-06-24 20:14:08 +02:00
|
|
|
|
2016-04-04 20:08:34 +02:00
|
|
|
void onSetCallState(CallSpec callSpec);
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2016-06-24 10:25:08 +02:00
|
|
|
void onSetCannedMessages(CannedMessagesSpec cannedMessagesSpec);
|
|
|
|
|
2016-06-08 20:27:25 +02:00
|
|
|
void onSetMusicState(MusicStateSpec stateSpec);
|
|
|
|
|
2016-04-04 20:08:34 +02:00
|
|
|
void onSetMusicInfo(MusicSpec musicSpec);
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2015-09-02 08:00:26 +02:00
|
|
|
void onEnableRealtimeSteps(boolean enable);
|
|
|
|
|
2015-06-06 23:24:00 +02:00
|
|
|
void onInstallApp(Uri uri);
|
|
|
|
|
2015-05-12 20:09:35 +02:00
|
|
|
void onAppInfoReq();
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2015-09-13 21:44:26 +02:00
|
|
|
void onAppStart(UUID uuid, boolean start);
|
2015-05-18 22:20:01 +02:00
|
|
|
|
2015-05-18 20:56:19 +02:00
|
|
|
void onAppDelete(UUID uuid);
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2016-03-03 14:23:17 +01:00
|
|
|
void onAppConfiguration(UUID appUuid, String config);
|
|
|
|
|
2016-06-12 01:20:12 +02:00
|
|
|
void onAppReorder(UUID uuids[]);
|
|
|
|
|
2015-06-06 19:39:04 +02:00
|
|
|
void onFetchActivityData();
|
2015-06-06 00:40:16 +02:00
|
|
|
|
2015-05-17 21:58:08 +02:00
|
|
|
void onReboot();
|
2015-06-21 00:34:05 +02:00
|
|
|
|
2016-02-29 22:05:29 +01:00
|
|
|
void onHeartRateTest();
|
2015-12-28 14:38:56 +01:00
|
|
|
|
2016-04-12 23:12:15 +02:00
|
|
|
void onEnableRealtimeHeartRateMeasurement(boolean enable);
|
|
|
|
|
2015-06-21 00:34:05 +02:00
|
|
|
void onFindDevice(boolean start);
|
2015-06-24 00:23:38 +02:00
|
|
|
|
2016-09-20 20:28:52 +02:00
|
|
|
void onSetConstantVibration(int integer);
|
|
|
|
|
2015-06-24 00:23:38 +02:00
|
|
|
void onScreenshotReq();
|
2016-03-03 14:23:17 +01:00
|
|
|
|
2016-04-03 22:38:06 +02:00
|
|
|
void onEnableHeartRateSleepSupport(boolean enable);
|
2016-05-16 17:30:11 +02:00
|
|
|
|
|
|
|
void onAddCalendarEvent(CalendarEventSpec calendarEventSpec);
|
2016-05-16 23:37:40 +02:00
|
|
|
|
2016-05-24 13:11:57 +02:00
|
|
|
void onDeleteCalendarEvent(byte type, long id);
|
2016-10-11 23:06:59 +02:00
|
|
|
|
2016-11-13 20:47:24 +01:00
|
|
|
/**
|
|
|
|
* Sets the given option in the device, typically with values from the preferences.
|
|
|
|
* The config name is device specific.
|
|
|
|
* @param config the device specific option to set on the device
|
|
|
|
*/
|
|
|
|
void onSendConfiguration(String config);
|
|
|
|
|
2016-10-11 23:06:59 +02:00
|
|
|
void onTestNewFunction();
|
2016-12-31 15:56:05 +01:00
|
|
|
|
|
|
|
void onSendWeather(WeatherSpec weatherSpec);
|
2015-04-14 01:24:03 +02:00
|
|
|
}
|