1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-04 09:17:29 +01:00
Gadgetbridge/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/EventHandler.java

152 lines
4.8 KiB
Java
Raw Normal View History

/* 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
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices;
import android.location.Location;
import android.net.Uri;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.capabilities.loyaltycards.LoyaltyCard;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.model.CalendarEventSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
import nodomain.freeyourgadget.gadgetbridge.model.CannedMessagesSpec;
2023-05-18 00:43:29 +02:00
import nodomain.freeyourgadget.gadgetbridge.model.Contact;
import nodomain.freeyourgadget.gadgetbridge.model.MusicSpec;
import nodomain.freeyourgadget.gadgetbridge.model.MusicStateSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NavigationInfoSpec;
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
2021-12-04 16:55:09 +01:00
import nodomain.freeyourgadget.gadgetbridge.model.Reminder;
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
import nodomain.freeyourgadget.gadgetbridge.model.WorldClock;
2015-08-02 00:12:21 +02: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.
*/
public interface EventHandler {
void onNotification(NotificationSpec notificationSpec);
void onDeleteNotification(int id);
void onSetTime();
void onSetAlarms(ArrayList<? extends Alarm> alarms);
2021-12-04 16:55:09 +01:00
void onSetReminders(ArrayList<? extends Reminder> reminders);
void onSetLoyaltyCards(ArrayList<LoyaltyCard> cards);
void onSetWorldClocks(ArrayList<? extends WorldClock> clocks);
2023-05-18 00:43:29 +02:00
void onSetContacts(ArrayList<? extends Contact> contacts);
void onSetCallState(CallSpec callSpec);
void onSetCannedMessages(CannedMessagesSpec cannedMessagesSpec);
void onSetMusicState(MusicStateSpec stateSpec);
void onSetMusicInfo(MusicSpec musicSpec);
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);
void onChangePhoneSilentMode(int ringerMode);
void onSetNavigationInfo(NavigationInfoSpec navigationInfoSpec);
void onEnableRealtimeSteps(boolean enable);
void onInstallApp(Uri uri);
void onAppInfoReq();
void onAppStart(UUID uuid, boolean start);
void onAppDownload(UUID uuid);
void onAppDelete(UUID uuid);
void onAppConfiguration(UUID appUuid, String config, Integer id);
void onAppReorder(UUID uuids[]);
void onFetchRecordedData(int dataTypes);
void onReset(int flags);
2016-02-29 22:05:29 +01:00
void onHeartRateTest();
void onEnableRealtimeHeartRateMeasurement(boolean enable);
void onFindDevice(boolean start);
2022-10-22 21:53:45 +02:00
void onFindPhone(boolean start);
2022-08-18 23:03:28 +02:00
void onSetConstantVibration(int integer);
void onScreenshotReq();
void onEnableHeartRateSleepSupport(boolean enable);
void onSetHeartRateMeasurementInterval(int seconds);
void onAddCalendarEvent(CalendarEventSpec calendarEventSpec);
void onDeleteCalendarEvent(byte type, long id);
/**
* 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);
/**
* 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);
void onTestNewFunction();
void onSendWeather(WeatherSpec weatherSpec);
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();
void onSetGpsLocation(Location location);
}