| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ |
| 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ |
| 7 | 7 |
| 8 #include <inttypes.h> | 8 #include <inttypes.h> |
| 9 #include <dbus/dbus-glib.h> | 9 #include <dbus/dbus-glib.h> |
| 10 #include <dbus/dbus-glib-bindings.h> | 10 #include <dbus/dbus-glib-bindings.h> |
| 11 #include <dbus/dbus-glib-lowlevel.h> | 11 #include <dbus/dbus-glib-lowlevel.h> |
| 12 #include <glib-object.h> | 12 #include <glib-object.h> |
| 13 | 13 |
| 14 #include "update_engine/update_attempter.h" | 14 #include "update_engine/update_attempter.h" |
| 15 | 15 |
| 16 // Type macros: | 16 // Type macros: |
| 17 #define UPDATE_ENGINE_TYPE_SERVICE (update_engine_service_get_type()) | 17 #define UPDATE_ENGINE_TYPE_SERVICE (update_engine_service_get_type()) |
| 18 #define UPDATE_ENGINE_SERVICE(obj) \ | 18 #define UPDATE_ENGINE_SERVICE(obj) \ |
| 19 (G_TYPE_CHECK_INSTANCE_CAST((obj), UPDATE_ENGINE_TYPE_SERVICE, \ | 19 (G_TYPE_CHECK_INSTANCE_CAST((obj), UPDATE_ENGINE_TYPE_SERVICE, \ |
| 20 UpdateEngineService)) | 20 UpdateEngineService)) |
| 21 #define UPDATE_ENGINE_IS_SERVICE(obj) \ | 21 #define UPDATE_ENGINE_IS_SERVICE(obj) \ |
| 22 (G_TYPE_CHECK_INSTANCE_TYPE((obj), UPDATE_ENGINE_TYPE_SERVICE)) | 22 (G_TYPE_CHECK_INSTANCE_TYPE((obj), UPDATE_ENGINE_TYPE_SERVICE)) |
| 23 #define UPDATE_ENGINE_SERVICE_CLASS(klass) \ | 23 #define UPDATE_ENGINE_SERVICE_CLASS(klass) \ |
| 24 (G_TYPE_CHECK_CLASS_CAST((klass), UPDATE_ENGINE_TYPE_SERVICE, \ | 24 (G_TYPE_CHECK_CLASS_CAST((klass), UPDATE_ENGINE_TYPE_SERVICE, \ |
| 25 UpdateEngineService)) | 25 UpdateEngineService)) |
| 26 #define UPDATE_ENGINE_IS_SERVICE_CLASS(klass) \ | 26 #define UPDATE_ENGINE_IS_SERVICE_CLASS(klass) \ |
| 27 (G_TYPE_CHECK_CLASS_TYPE((klass), UPDATE_ENGINE_TYPE_SERVICE)) | 27 (G_TYPE_CHECK_CLASS_TYPE((klass), UPDATE_ENGINE_TYPE_SERVICE)) |
| 28 #define UPDATE_ENGINE_SERVICE_GET_CLASS(obj) \ | 28 #define UPDATE_ENGINE_SERVICE_GET_CLASS(obj) \ |
| 29 (G_TYPE_INSTANCE_GET_CLASS((obj), UPDATE_ENGINE_TYPE_SERVICE, \ | 29 (G_TYPE_INSTANCE_GET_CLASS((obj), UPDATE_ENGINE_TYPE_SERVICE, \ |
| 30 UpdateEngineService)) | 30 UpdateEngineService)) |
| 31 | 31 |
| 32 G_BEGIN_DECLS | 32 G_BEGIN_DECLS |
| 33 | 33 |
| 34 struct UpdateEngineService { | 34 struct UpdateEngineService { |
| 35 GObject parent_instance; | 35 GObject parent_instance; |
| 36 | 36 |
| 37 chromeos_update_engine::UpdateAttempter* update_attempter_; | 37 chromeos_update_engine::UpdateAttempter* update_attempter_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 struct UpdateEngineServiceClass { | 40 struct UpdateEngineServiceClass { |
| 41 GObjectClass parent_class; | 41 GObjectClass parent_class; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 UpdateEngineService* update_engine_service_new(void); | 44 UpdateEngineService* update_engine_service_new(void); |
| 45 GType update_engine_service_get_type(void); | 45 GType update_engine_service_get_type(void); |
| 46 | 46 |
| 47 // Methods | 47 // Methods |
| 48 | 48 |
| 49 gboolean update_engine_service_get_status(UpdateEngineService* self, | 49 gboolean update_engine_service_get_status(UpdateEngineService* self, |
| 50 int64_t* last_checked_time, | 50 int64_t* last_checked_time, |
| 51 double* progress, | 51 double* progress, |
| 52 gchar** current_operation, | 52 gchar** current_operation, |
| 53 gchar** new_version, | 53 gchar** new_version, |
| 54 int64_t* new_size, | 54 int64_t* new_size, |
| 55 GError **error); | 55 GError **error); |
| 56 |
| 57 gboolean update_engine_service_check_for_update(UpdateEngineService* self, |
| 58 GError **error); |
| 59 |
| 60 gboolean update_engine_service_emit_status_update( |
| 61 UpdateEngineService* self, |
| 62 gint64 last_checked_time, |
| 63 gdouble progress, |
| 64 const gchar* current_operation, |
| 65 const gchar* new_version, |
| 66 gint64 new_size); |
| 56 | 67 |
| 57 G_END_DECLS | 68 G_END_DECLS |
| 58 | 69 |
| 59 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ | 70 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ |
| OLD | NEW |