Add new apis 45/298245/4
authorChanggyu Choi <changyu.choi@samsung.com>
Mon, 4 Sep 2023 07:49:19 +0000 (16:49 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 5 Sep 2023 05:37:16 +0000 (14:37 +0900)
Adds:
 - frame_component_time_zone_changed_cb
 - service_component_time_zone_changed_cb

Change-Id: If95cedd1fcd75aac4d7be5c5899e52087725ce55
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
27 files changed:
component_based/base/api/base_component.h
component_based/base/api/base_frame_component.h
component_based/base/api/base_service_component.h
component_based/base/component.cc
component_based/base/component.h
component_based/base/stub.cc
component_based/base/system_event_interface.h
component_based/base/system_event_internal.h
component_based/efl_base/api/frame_component.h
component_based/efl_base/api/service_component.h
component_based/efl_base/stub.cc
component_based/efl_widget_base/api/widget_component.h
component_based/efl_widget_base/stub.cc
component_based/widget_base/api/base_widget_component.h
component_based/widget_base/stub.cc
test/unit_tests/base/test_component_based_application_base.cc
test/unit_tests/efl_base/test_component_based_app.cc
test/unit_tests/mock/base_component_callback_mock.cc
test/unit_tests/mock/base_component_callback_mock.h
test/unit_tests/mock/base_frame_component_callback_mock.cc
test/unit_tests/mock/base_frame_component_callback_mock.h
test/unit_tests/mock/base_service_component_callback_mock.cc
test/unit_tests/mock/base_service_component_callback_mock.h
test/unit_tests/mock/frame_component_callback_mock.cc
test/unit_tests/mock/frame_component_callback_mock.h
test/unit_tests/mock/service_component_callback_mock.cc
test/unit_tests/mock/service_component_callback_mock.h

index d1e8ae8d7a80400a0d241c0509c448cd86b16a81..a557e3e25094995f43f380335bfd7234620f2d5f 100644 (file)
@@ -66,6 +66,12 @@ typedef void (*base_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+typedef void (*base_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 typedef struct {
        base_component_restore_content_cb restore_content;
        base_component_save_content_cb save_content;
@@ -75,6 +81,7 @@ typedef struct {
        base_component_low_battery_cb low_battery;
        base_component_low_memory_cb low_memory;
        base_component_suspended_state_changed_cb suspended_state_changed;
+       base_component_time_zone_changed_cb time_zone_changed;
 } base_component_lifecycle_callback_s;
 
 #ifdef __cplusplus
index 767b61e429c1cc74c4dac8c1b247d9aa7a3fe1b9..762a9321b068727cb55bb7b1034274419385f314 100644 (file)
@@ -107,6 +107,12 @@ typedef void (*base_frame_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+typedef void (*base_frame_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 typedef struct {
        base_frame_component_create_cb create;
        base_frame_component_start_cb start;
@@ -123,6 +129,7 @@ typedef struct {
        base_frame_component_low_battery_cb low_battery;
        base_frame_component_low_memory_cb low_memory;
        base_frame_component_suspended_state_changed_cb suspended_state_changed;
+       base_frame_component_time_zone_changed_cb time_zone_changed;
 } base_frame_component_lifecycle_callback_s;
 
 #ifdef __cplusplus
index c9cbd9c7b3055c16ea9e0c8fa4a27d1e0b8b69a3..13ce71e3f8125e245a8e9e35e47ad5bf3e60d14c 100644 (file)
@@ -86,6 +86,12 @@ typedef void (*base_service_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+typedef void (*base_service_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 typedef struct {
        base_service_component_create_cb create;
        base_service_component_start_command_cb start_command;
@@ -99,6 +105,7 @@ typedef struct {
        base_service_component_low_battery_cb low_battery;
        base_service_component_low_memory_cb low_memory;
        base_service_component_suspended_state_changed_cb suspended_state_changed;
+       base_service_component_time_zone_changed_cb time_zone_changed;
 } base_service_component_lifecycle_callback_s;
 
 #ifdef __cplusplus
index 2d4c16717873792266929149091fcb9c30e1b278..cb522d7d19acf33c05c45000240891fca8c32341 100644 (file)
@@ -259,6 +259,10 @@ void Component::OnLowMemory(LowMemory::Status status) {
 void Component::OnSuspendedStateChanged(SuspendedState::State state) {
 }
 
+void Component::OnTimeZoneChanged(const std::string& time_zone,
+    const std::string& time_zone_id) {
+}
+
 Component::State Component::GetState() {
   return impl_->state_;
 }
index 8ec0f633657137009d2c622e96d9f5f89d5ae962..d7fc34edba60970f6ce851ee61bcdbbe47a6ee18 100644 (file)
@@ -82,6 +82,8 @@ class EXPORT_API Component : public tizen_cpp::AppCoreMultiWindowBase::Context,
   void OnLowBattery(LowBattery::Status status) override;
   void OnLowMemory(LowMemory::Status status) override;
   void OnSuspendedStateChanged(SuspendedState::State state) override;
+  void OnTimeZoneChanged(const std::string& time_zone,
+      const std::string& time_zone_id) override;
   void Finish();
   void RegisterAction(std::string app_control_name);
   bool DeregisterAction(std::string app_control_name);
index 3ecf3644764f5cbec309828b023be548942f9964..3a333007b2deddfed7a66112f36e50e96e4794d0 100644 (file)
@@ -250,6 +250,16 @@ class StubBaseComponent : public Component {
     }
   }
 
+  void OnTimeZoneChanged(const std::string& time_zone,
+      const std::string& time_zone_id) override {
+    Component::OnTimeZoneChanged(time_zone, time_zone_id);
+
+    if (cb_.time_zone_changed) {
+      cb_.time_zone_changed(this, time_zone.c_str(),
+          time_zone_id.c_str(), user_data_);
+    }
+  }
+
  private:
   base_component_lifecycle_callback_s cb_;
   void* user_data_;
index 145ad8491b033fc98ddc31df0456a279b6805750..6a3c250a6307bcb54a00c0bb980e6d9f48db0c07 100644 (file)
@@ -39,6 +39,8 @@ class ISystemEvent {
       DeviceOrientation::Orientation orientation) = 0;
   virtual void OnRegionFormatChanged(std::string region) = 0;
   virtual void OnSuspendedStateChanged(SuspendedState::State state) = 0;
+  virtual void OnTimeZoneChanged(const std::string& time_zone,
+      const std::string& time_zone_id) = 0;
 };
 
 }  // namespace component_based
index 235bdc5b14a027187e27257d0f1a658c7ff0162d..7036167d8cabb4c93b1475ddd79de94bb9504179 100644 (file)
@@ -190,6 +190,27 @@ class SuspendedStateChangeEvent : public tizen_cpp::AppCoreBase::EventBase {
   ISystemEvent* ev_;
 };
 
+class TimeZoneChangedEvent : public tizen_cpp::AppCoreBase::EventBase {
+ public:
+  TimeZoneChangedEvent(ISystemEvent* ev)
+      : tizen_cpp::AppCoreBase::EventBase(
+            tizen_cpp::AppCoreBase::IEvent::Type::TIME_ZONE_CHANGED), ev_(ev) {
+  }
+
+  void OnEvent(const std::string& val) override {
+    size_t split_pos = val.find('|');
+    std::string time_zone = val.substr(0, split_pos);
+    std::string time_zone_id = val.substr(split_pos + 1);
+    ev_->OnTimeZoneChanged(time_zone, time_zone_id);
+  }
+
+  void OnEvent(int val) override {
+  }
+
+ private:
+  ISystemEvent* ev_;
+};
+
 class SystemEvent {
  public:
   explicit SystemEvent(ISystemEvent* ev, tizen_cpp::AppCoreBase* app) {
@@ -199,6 +220,7 @@ class SystemEvent {
     app->AddEvent(std::make_shared<DeviceOrientationChangedEvent>(ev));
     app->AddEvent(std::make_shared<RegionChangeEvent>(ev));
     app->AddEvent(std::make_shared<SuspendedStateChangeEvent>(ev));
+    app->AddEvent(std::make_shared<TimeZoneChangedEvent>(ev));
   }
 };
 
index 1e8577da5ff5ac43f9ca2f1876430453ecda94fb..e9c9f02e959819714746f2c1841afc5cfcdca7d7 100644 (file)
@@ -255,6 +255,24 @@ typedef void (*frame_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+/**
+ * @brief Called when the time zone of the frame component is changed.
+ * @details An application can obtain a changed time zone (e.g., "+9:00") and a time zone id (e.g., "Asia/Seoul").
+ * @since_tizen 8.0
+ * @remarks The @a context should not be released. The @a context can be used only in the callback.
+ * @remarks @a time_zone and @a time_zone_id must not be deallocated by the component. @a time_zone and @a time_zone_id can be used only in the callback.
+ *
+ * @param[in]   context         The context of the frame component instance
+ * @param[in]   time_zone       The time zone
+ * @param[in]   time_zone_id    The time zone id
+ * @param[in]   user_data       The user data passed from component_based_app_add_frame_component() function
+ */
+typedef void (*frame_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 /**
  * @brief The structure type containing the set of callback functions for lifecycle of a frame component instance.
  * @since_tizen 5.5
@@ -275,6 +293,7 @@ typedef struct {
        frame_component_low_battery_cb low_battery; /**< The callback function called when the battery status is changed. */
        frame_component_low_memory_cb low_memory; /**< The callback function called when the memory status is changed */
        frame_component_suspended_state_changed_cb suspended_state_changed; /**< The callback function called when the suspended state of the frame component is changed */
+       frame_component_time_zone_changed_cb time_zone_changed; /**< The callback function called when the time zone of the frame component is changed (Since 8.0) */
 } frame_component_lifecycle_callback_s;
 
 /**
index 06d60a6d8d70b0e10965d656e90b22c5bbba963b..95a2f9b2d90a698a959da74869a1527c1c65f214 100644 (file)
@@ -218,6 +218,24 @@ typedef void (*service_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+/**
+ * @brief Called when the time zone of the service component is changed.
+ * @details An application can obtain a changed time zone (e.g., "+9:00") and a time zone id (e.g., "Asia/Seoul").
+ * @since_tizen 8.0
+ * @remarks The @a context should not be released. The @a context can be used only in the callback.
+ * @remarks @a time_zone and @a time_zone_id must not be deallocated by the component. @a time_zone and @a time_zone_id can be used only in the callback.
+ *
+ * @param[in]   context         The context of the service component instance
+ * @param[in]   time_zone       The time zone
+ * @param[in]   time_zone_id    The time zone id
+ * @param[in]   user_data       The user data passed from component_based_app_add_service_component() function
+ */
+typedef void (*service_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 /**
  * @brief The structure type containing the set of callback functions for lifecycle of a service component instance.
  * @since_tizen 5.5
@@ -235,6 +253,7 @@ typedef struct {
        service_component_low_battery_cb low_battery; /**< The callback function called when the battery status is changed. */
        service_component_low_memory_cb low_memory; /**< The callback function called when the memory status is changed */
        service_component_suspended_state_changed_cb suspended_state_changed; /**< The callback function called when the suspended state of the service component is changed */
+       service_component_time_zone_changed_cb time_zone_changed; /**< The callback function called when the time zone of the service component is changed (Since 8.0) */
 } service_component_lifecycle_callback_s;
 
 
index 07b20677b2b58b098ae84c27f0e30195dfb19824..e1691cfb7d108e0de536d3cdceb567dcd7832f15 100644 (file)
@@ -284,6 +284,16 @@ class StubFrameComponent : public FrameComponent {
     }
   }
 
+  void OnTimeZoneChanged(const std::string& time_zone, const std::string& time_zone_id) override {
+    FrameComponent::OnTimeZoneChanged(time_zone, time_zone_id);
+    if (cb_.time_zone_changed) {
+      cb_.time_zone_changed(this,
+          time_zone.c_str(),
+          time_zone_id.c_str(),
+          user_data_);
+    }
+  }
+
  private:
   frame_component_lifecycle_callback_s cb_;
   void* user_data_;
index ac69ff0c84361d2dc78ee6268a862c637e4f8fe4..dbb443e0cfa0c56e6cb38f2e6c01d56f5f6c7e1b 100644 (file)
@@ -232,6 +232,24 @@ typedef void (*widget_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+/**
+ * @brief Called when the time zone of the widget component is changed.
+ * @details An application can obtain a changed time zone (e.g., "+9:00") and a time zone id (e.g., "Asia/Seoul").
+ * @since_tizen 8.0
+ * @remarks The @a context should not be released. The @a context can be used only in the callback.
+ * @remarks @a time_zone and @a time_zone_id must not be deallocated by the component. @a time_zone and @a time_zone_id can be used only in the callback.
+ *
+ * @param[in]   context         The context of the frame component instance
+ * @param[in]   time_zone       The time zone
+ * @param[in]   time_zone_id    The time zone id
+ * @param[in]   user_data       The user data passed from component_based_app_add_widget_component() function
+ */
+typedef void (*widget_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 /**
  * @brief The structure type containing the set of callback functions for lifecycle of a widget component instance.
  * @since_tizen 6.5
@@ -251,6 +269,7 @@ typedef struct {
        widget_component_low_battery_cb low_battery;
        widget_component_low_memory_cb low_memory;
        widget_component_suspended_state_changed_cb suspended_state_changed;
+       widget_component_time_zone_changed_cb time_zone_changed;
 } widget_component_lifecycle_callback_s;
 
 /**
index 746ecd072ae0cb716c54b12b280d721f58d50da0..9c5bb3fd5415a3c13ffb0ede6f732f73c4469d33 100644 (file)
@@ -195,6 +195,14 @@ class StubWidgetComponent : public WidgetComponent {
     }
   }
 
+  void OnTimeZoneChanged(const std::string& time_zone,
+      const std::string& time_zone_id) override {
+    if (cb_.time_zone_changed) {
+      cb_.time_zone_changed(this, time_zone.c_str(),
+          time_zone_id.c_str(), user_data_);
+    }
+  }
+
  private:
   widget_component_lifecycle_callback_s cb_;
   void* user_data_;
index cd012fc6e1eff486948c168ce0735a9e0cc251e8..e139153b24489f23840951cc99e8ab4a15715005 100644 (file)
@@ -100,6 +100,12 @@ typedef void (*base_widget_component_suspended_state_changed_cb)(
                component_suspended_state_e state,
                void *user_data);
 
+typedef void (*base_widget_component_time_zone_changed_cb)(
+               component_h context,
+               const char *time_zone,
+               const char *time_zone_id,
+               void *user_data);
+
 typedef struct {
        base_widget_component_create_cb create;
        base_widget_component_start_cb start;
@@ -115,6 +121,7 @@ typedef struct {
        base_widget_component_low_battery_cb low_battery;
        base_widget_component_low_memory_cb low_memory;
        base_widget_component_suspended_state_changed_cb suspended_state_changed;
+       base_widget_component_time_zone_changed_cb time_zone_changed;
 } base_widget_component_lifecycle_callback_s;
 
 #ifdef __cplusplus
index 63cd5d152f446295bb220cb1cb62fbf79f95704e..ef2335b876fc46f93044785ddba633397f91b50f 100644 (file)
@@ -216,6 +216,17 @@ class StubWidgetComponent : public WidgetComponent {
     }
   }
 
+  void OnTimeZoneChanged(const std::string& time_zone,
+      const std::string& time_zone_id) override {
+    WidgetComponent::OnTimeZoneChanged(time_zone, time_zone_id);
+    if (cb_.time_zone_changed) {
+      cb_.time_zone_changed(this,
+          time_zone.c_str(),
+          time_zone_id.c_str(),
+          user_data_);
+    }
+  }
+
  private:
   base_widget_component_lifecycle_callback_s cb_;
   void* user_data_;
index 9b1acc3623ecc066abf69dbd701e233bc91388ee..9ff5c773a5c803331059ff2366b68c42e4fb3bca 100644 (file)
@@ -156,6 +156,7 @@ ACTION_P2(SendEvents, mock, id) {
   com->OnLowBattery(LowBattery::Status::CriticalLow);
   com->OnLowMemory(LowMemory::Status::SoftWarning);
   com->OnSuspendedStateChanged(SuspendedState::State::Will_Enter);
+  com->OnTimeZoneChanged("+9:00", "Asia/Seoul");
 }
 
 ACTION_P(RegisterAction, id) {
index e4ee6ab1141ce148d26c5f8d1dfdfb86733654dd..cd7ebdc7b48612c67ec13bab07fad9c6dac2b4fd 100644 (file)
@@ -159,6 +159,7 @@ ACTION_P2(SendEvents, mock, id) {
   com->OnLowBattery(LowBattery::Status::CriticalLow);
   com->OnLowMemory(LowMemory::Status::SoftWarning);
   com->OnSuspendedStateChanged(SuspendedState::State::Will_Enter);
+  com->OnTimeZoneChanged("+9:00", "Asia/Seoul");
 }
 
 }  // namespace
index 5f8f4072554153571c25b566d2a67dc81c96fbf3..466ba1797aa7aca480b98064a46c4e68ab0b95d2 100644 (file)
@@ -72,6 +72,13 @@ void __base_component_suspended_state_changed_cb(component_h context,
       base_component_suspended_state_changed_cb, context, state, user_data);
 }
 
+void __base_component_time_zone_changed_cb(component_h context,
+    const char* time_zone, const char* time_zone_id, void* user_data) {
+  MOCK_HOOK_P4(BaseComponentCallbackMock,
+      base_component_time_zone_changed_cb,
+          context, time_zone, time_zone_id, user_data);
+}
+
 }  // namespace
 
 base_component_lifecycle_callback_s BaseComponentCallbackMock::GetCallbacks() {
@@ -92,6 +99,8 @@ base_component_lifecycle_callback_s BaseComponentCallbackMock::GetCallbacks() {
     __base_component_low_memory_cb;
   callback.suspended_state_changed =
     __base_component_suspended_state_changed_cb;
+  callback.time_zone_changed =
+    __base_component_time_zone_changed_cb;
 
   return callback;
 }
index 9f7bbcda6272459cb8637524f951f365bf5a7b49..8921044e392766051e55f9b9da6f9c34654700fb 100644 (file)
@@ -49,6 +49,8 @@ class BaseComponentCallbackMock : public virtual ModuleMock {
       void (component_h, component_low_memory_status_e, void*));
   MOCK_METHOD3(base_component_suspended_state_changed_cb,
       void (component_h, component_suspended_state_e, void*));
+  MOCK_METHOD4(base_component_time_zone_changed_cb,
+      void (component_h, const char*, const char*, void*));
 };
 
 #endif  // MOCK_BASE_COMPONENT_CALLBACK_MOCK_H_
index 4ee1f7ff438f57318f8b10e33bb79e24fc9cd345..f481ec6201749770091febe961c0cf7930dc57fc 100644 (file)
@@ -116,6 +116,13 @@ void __base_frame_component_suspended_state_changed_cb(component_h context,
       user_data);
 }
 
+void __base_frame_component_time_zone_changed_cb(component_h context,
+    const char* time_zone, const char* time_zone_id, void* user_data) {
+  MOCK_HOOK_P4(BaseFrameComponentCallbackMock,
+      base_frame_component_time_zone_changed_cb,
+      context, time_zone, time_zone_id, user_data);
+}
+
 }  // namespace
 
 base_frame_component_lifecycle_callback_s
@@ -151,6 +158,8 @@ BaseFrameComponentCallbackMock::GetCallbacks() {
       __base_frame_component_low_memory_cb;
   callback.suspended_state_changed =
       __base_frame_component_suspended_state_changed_cb;
+  callback.time_zone_changed =
+     __base_frame_component_time_zone_changed_cb;
 
   return callback;
 }
index df9008d16f70b7485a0394204cc43d4dc11e37b3..30aae800295a8869c39d7b91155ff6d4249d5630 100644 (file)
@@ -62,6 +62,8 @@ class BaseFrameComponentCallbackMock : public virtual ModuleMock {
       void (component_h, component_low_memory_status_e, void*));
   MOCK_METHOD3(base_frame_component_suspended_state_changed_cb,
       void (component_h, component_suspended_state_e, void*));
+  MOCK_METHOD4(base_frame_component_time_zone_changed_cb,
+      void (component_h, const char*, const char*, void*));
 };
 
 #endif  // MOCK_BASE_FRAME_COMPONENT_CALLBACK_MOCK_H_
index be7b52d51818720777256587eb8b1d776c1d1d30..e3b1a8beeed4a10c3038c03977956c4833000739 100644 (file)
@@ -99,6 +99,13 @@ void __base_service_component_suspended_state_changed_cb(component_h context,
       base_service_component_suspended_state_changed_cb, context, state, user_data);
 }
 
+void __base_service_component_time_zone_changed_cb(component_h context,
+    const char* time_zone, const char* time_zone_id, void* user_data) {
+  MOCK_HOOK_P4(BaseServiceComponentCallbackMock,
+      base_service_component_time_zone_changed_cb,
+      context, time_zone, time_zone_id, user_data);
+}
+
 }  // namespace
 
 base_service_component_lifecycle_callback_s
@@ -128,6 +135,8 @@ BaseServiceComponentCallbackMock::GetCallbacks() {
     __base_service_component_low_memory_cb;
   callback.suspended_state_changed =
     __base_service_component_suspended_state_changed_cb;
+  callback.time_zone_changed =
+    __base_service_component_time_zone_changed_cb;
 
   return callback;
 }
index 9c93844d29554837a9bd4650e88652a8924fcd01..b593f8e15bcdb7f25592875f200b830a853cc979 100644 (file)
@@ -58,6 +58,8 @@ class BaseServiceComponentCallbackMock : public virtual ModuleMock {
       void (component_h, component_low_memory_status_e, void*));
   MOCK_METHOD3(base_service_component_suspended_state_changed_cb,
       void (component_h, component_suspended_state_e, void*));
+  MOCK_METHOD4(base_service_component_time_zone_changed_cb,
+      void (component_h, const char*, const char*, void*));
 };
 
 #endif  // MOCK_BASE_SERVICE_COMPONENT_CALLBACK_MOCK_H_
index 78790eb0127c9c82182f927f87242993a8910571..c696219107e0c3640f0da3a15f027b32329b6dc8 100644 (file)
@@ -113,6 +113,12 @@ void __frame_component_suspended_state_changed_cb(component_h context,
     context, state, user_data);
 }
 
+void __frame_component_time_zone_changed_cb(component_h context,
+    const char* time_zone, const char* time_zone_id, void* user_data) {
+  MOCK_HOOK_P4(FrameComponentCallbackMock, frame_component_time_zone_changed_cb,
+    context, time_zone, time_zone_id, user_data);
+}
+
 }  // namespace
 
 frame_component_lifecycle_callback_s FrameComponentCallbackMock::GetCallbacks() {
@@ -147,6 +153,8 @@ frame_component_lifecycle_callback_s FrameComponentCallbackMock::GetCallbacks()
       __frame_component_low_memory_cb;
   callback.suspended_state_changed =
       __frame_component_suspended_state_changed_cb;
+  callback.time_zone_changed =
+      __frame_component_time_zone_changed_cb;
 
   return callback;
 }
index 3142b284ad50f938be4e413f7352befb1232f98e..f2d8e7f09e745fd97e39104e28792c5ffffdce84 100644 (file)
@@ -63,6 +63,8 @@ class FrameComponentCallbackMock : public virtual ModuleMock {
       void (component_h, component_low_memory_status_e, void*));
   MOCK_METHOD3(frame_component_suspended_state_changed_cb,
       void (component_h, component_suspended_state_e, void*));
+  MOCK_METHOD4(frame_component_time_zone_changed_cb,
+      void (component_h, const char*, const char*, void*));
 };
 
 #endif  // MOCK_FRAME_COMPONENT_CALLBACK_MOCK_H_
index 9cfb8ef3ebee37c34b0f7cf1e14e3b2cb0ba1aa3..047d60cd15caf355c05380c7d7b2d654d78ca388 100644 (file)
@@ -95,6 +95,12 @@ void __service_component_suspended_state_changed_cb(component_h context,
     context, state, user_data);
 }
 
+void __service_component_time_zone_changed_cb(component_h context,
+    const char* time_zone, const char* time_zone_id, void* user_data) {
+  MOCK_HOOK_P4(ServiceComponentCallbackMock, service_component_time_zone_changed_cb,
+    context, time_zone, time_zone_id, user_data);
+}
+
 }  // namespace
 
 service_component_lifecycle_callback_s ServiceComponentCallbackMock::GetCallbacks() {
@@ -123,6 +129,8 @@ service_component_lifecycle_callback_s ServiceComponentCallbackMock::GetCallback
     __service_component_low_memory_cb;
   callback.suspended_state_changed =
     __service_component_suspended_state_changed_cb;
+  callback.time_zone_changed =
+    __service_component_time_zone_changed_cb;
 
   return callback;
 }
index 1e9fd21b6d48ed0f2c5894cefcb694276dae2786..229ac038de5540b0c97e74743c70ac59aa8273db 100644 (file)
@@ -56,6 +56,8 @@ class ServiceComponentCallbackMock : public virtual ModuleMock {
       void (component_h, component_low_memory_status_e, void*));
   MOCK_METHOD3(service_component_suspended_state_changed_cb,
       void (component_h, component_suspended_state_e, void*));
+  MOCK_METHOD4(service_component_time_zone_changed_cb,
+      void (component_h, const char*, const char*, void*));
 };
 
 #endif  // MOCK_SERVICE_COMPONENT_CALLBACK_MOCK_H_