message_sender.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ASH_COMPONENTS_PHONEHUB_MESSAGE_SENDER_H_
  5. #define ASH_COMPONENTS_PHONEHUB_MESSAGE_SENDER_H_
  6. #include <stdint.h>
  7. #include <string>
  8. #include "ash/components/phonehub/proto/phonehub_api.pb.h"
  9. namespace ash {
  10. namespace phonehub {
  11. // Provides interface to send messages from the local device (this Chrome OS
  12. // device) to the remote device (user phone).
  13. class MessageSender {
  14. public:
  15. MessageSender(const MessageSender&) = delete;
  16. MessageSender& operator=(const MessageSender&) = delete;
  17. virtual ~MessageSender() = default;
  18. // Sends whether the notification setting is enabled in the Chrome OS device.
  19. virtual void SendCrosState(bool notification_setting_enabled,
  20. bool camera_roll_setting_enabled) = 0;
  21. // Requests that the phone enables or disables Do Not Disturb mode.
  22. virtual void SendUpdateNotificationModeRequest(
  23. bool do_not_disturb_enabled) = 0;
  24. // Requests that the phone enables or disables battery power saver mode.
  25. virtual void SendUpdateBatteryModeRequest(
  26. bool battery_saver_mode_enabled) = 0;
  27. // Requests that the phone should dismiss a notification based by the
  28. // |notification_id|.
  29. virtual void SendDismissNotificationRequest(int64_t notification_id) = 0;
  30. // Requests that the phone should send |reply_text| to a notification of
  31. // |notification_id|.
  32. virtual void SendNotificationInlineReplyRequest(
  33. int64_t notification_id,
  34. const std::u16string& reply_text) = 0;
  35. // Requests that the phone should show the notification access set up.
  36. virtual void SendShowNotificationAccessSetupRequest() = 0;
  37. // Requests that the phone should show the feature access set up.
  38. virtual void SendFeatureSetupRequest(bool camera_roll,
  39. bool notifications) = 0;
  40. // Requests that the phone enables or disables ringing.
  41. virtual void SendRingDeviceRequest(bool device_ringing_enabled) = 0;
  42. // Sends a request to fetch the latest set of camera roll items from the
  43. // connected Android phone.
  44. virtual void SendFetchCameraRollItemsRequest(
  45. const proto::FetchCameraRollItemsRequest& request) = 0;
  46. // Sends a request to let the connected Android phone prepare for a
  47. // full-quality file transfer of a photo or video item from camera roll.
  48. virtual void SendFetchCameraRollItemDataRequest(
  49. const proto::FetchCameraRollItemDataRequest& request) = 0;
  50. // Sends a request to let the connected Android phone start the file transfer
  51. // of the requested camera roll item.
  52. virtual void SendInitiateCameraRollItemTransferRequest(
  53. const proto::InitiateCameraRollItemTransferRequest& request) = 0;
  54. protected:
  55. MessageSender() = default;
  56. };
  57. } // namespace phonehub
  58. } // namespace ash
  59. #endif // ASH_COMPONENTS_PHONEHUB_MESSAGE_SENDER_H_