2024-01-10 18:54:00 +01:00
|
|
|
/* Copyright (C) 2015-2024 Andreas Shimokawa, Arjan Schrijver, Carsten
|
|
|
|
Pfeiffer, José Rebelo, Julien Pivotto, Kasha, Sebastian Kranz, Steffen
|
2019-04-21 18:50:56 +02:00
|
|
|
Liebergeld, Uwe Hermann
|
2017-03-10 14:53:19 +01:00
|
|
|
|
|
|
|
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
|
2024-01-10 18:54:00 +01:00
|
|
|
along with this program. If not, see <https://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
|
|
|
|
2022-06-04 22:20:28 +02:00
|
|
|
import android.location.Location;
|
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;
|
|
|
|
|
2023-07-04 00:19:19 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.capabilities.loyaltycards.LoyaltyCard;
|
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;
|
2023-05-18 00:43:29 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.Contact;
|
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;
|
2021-10-20 22:37:23 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.NavigationInfoSpec;
|
2015-09-24 14:45:21 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
2021-12-04 16:55:09 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
|
2016-12-31 15:56:05 +01:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
2022-05-09 20:47:08 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
|
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
|
|
|
|
2021-12-04 16:55:09 +01:00
|
|
|
void onSetReminders(ArrayList<? extends Reminder> reminders);
|
|
|
|
|
2023-07-04 00:19:19 +02:00
|
|
|
void onSetLoyaltyCards(ArrayList<LoyaltyCard> cards);
|
|
|
|
|
2022-05-09 20:47:08 +02:00
|
|
|
void onSetWorldClocks(ArrayList<? extends WorldClock> clocks);
|
|
|
|
|
2023-05-18 00:43:29 +02:00
|
|
|
void onSetContacts(ArrayList<? extends Contact> contacts);
|
|
|
|
|
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
|
|
|
|
2022-05-05 15:14:15 +02:00
|
|
|
/**
|
|
|
|
* Sets the current phone media volume.
|
|
|
|
*
|
|
|
|
* @param volume the volume percentage (0 to 100).
|
|
|
|
*/
|
|
|
|
void onSetPhoneVolume(final float volume);
|
|
|
|
|
2023-12-11 11:50:31 +01:00
|
|
|
void onChangePhoneSilentMode(int ringerMode);
|
|
|
|
|
2021-10-20 22:37:23 +02:00
|
|
|
void onSetNavigationInfo(NavigationInfoSpec navigationInfoSpec);
|
|
|
|
|
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
|
|
|
|
2023-01-04 22:40:38 +01:00
|
|
|
void onAppDownload(UUID uuid);
|
|
|
|
|
2015-05-18 20:56:19 +02:00
|
|
|
void onAppDelete(UUID uuid);
|
2015-04-14 01:24:03 +02:00
|
|
|
|
2017-08-01 00:03:28 +02:00
|
|
|
void onAppConfiguration(UUID appUuid, String config, Integer id);
|
2016-03-03 14:23:17 +01:00
|
|
|
|
2016-06-12 01:20:12 +02:00
|
|
|
void onAppReorder(UUID uuids[]);
|
|
|
|
|
2018-03-31 16:21:25 +02:00
|
|
|
void onFetchRecordedData(int dataTypes);
|
2015-06-06 00:40:16 +02:00
|
|
|
|
2018-12-16 16:05:13 +01:00
|
|
|
void onReset(int flags);
|
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
|
|
|
|
2022-10-22 21:53:45 +02:00
|
|
|
void onFindPhone(boolean start);
|
2022-08-18 23:03:28 +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
|
|
|
|
2017-11-11 00:04:51 +01:00
|
|
|
void onSetHeartRateMeasurementInterval(int seconds);
|
|
|
|
|
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);
|
|
|
|
|
2019-02-20 14:09:21 +01:00
|
|
|
/**
|
|
|
|
* Gets the given option from the device, sets the values in the preferences.
|
|
|
|
* The config name is device specific.
|
|
|
|
* @param config the device specific option to get from the device
|
|
|
|
*/
|
|
|
|
void onReadConfiguration(String config);
|
|
|
|
|
2016-10-11 23:06:59 +02:00
|
|
|
void onTestNewFunction();
|
2016-12-31 15:56:05 +01:00
|
|
|
|
|
|
|
void onSendWeather(WeatherSpec weatherSpec);
|
2018-07-28 17:23:58 +02:00
|
|
|
|
|
|
|
void onSetFmFrequency(float frequency);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the device's led color.
|
|
|
|
* @param color the new color, in ARGB, with alpha = 255
|
|
|
|
*/
|
|
|
|
void onSetLedColor(int color);
|
2021-12-24 15:20:57 +01:00
|
|
|
|
|
|
|
void onPowerOff();
|
2022-06-04 22:20:28 +02:00
|
|
|
|
|
|
|
void onSetGpsLocation(Location location);
|
2015-04-14 01:24:03 +02:00
|
|
|
}
|