Andrew de los Reyes | 4e9b9f4 | 2010-04-26 15:06:43 -0700 | [diff] [blame^] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ |
| 6 | #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ |
| 7 | |
| 8 | #include <inttypes.h> |
| 9 | #include <dbus/dbus-glib.h> |
| 10 | #include <dbus/dbus-glib-bindings.h> |
| 11 | #include <dbus/dbus-glib-lowlevel.h> |
| 12 | #include <glib-object.h> |
| 13 | |
| 14 | #include "update_engine/update_attempter.h" |
| 15 | |
| 16 | // Type macros: |
| 17 | #define UPDATE_ENGINE_TYPE_SERVICE (update_engine_service_get_type()) |
| 18 | #define UPDATE_ENGINE_SERVICE(obj) \ |
| 19 | (G_TYPE_CHECK_INSTANCE_CAST((obj), UPDATE_ENGINE_TYPE_SERVICE, \ |
| 20 | UpdateEngineService)) |
| 21 | #define UPDATE_ENGINE_IS_SERVICE(obj) \ |
| 22 | (G_TYPE_CHECK_INSTANCE_TYPE((obj), UPDATE_ENGINE_TYPE_SERVICE)) |
| 23 | #define UPDATE_ENGINE_SERVICE_CLASS(klass) \ |
| 24 | (G_TYPE_CHECK_CLASS_CAST((klass), UPDATE_ENGINE_TYPE_SERVICE, \ |
| 25 | UpdateEngineService)) |
| 26 | #define UPDATE_ENGINE_IS_SERVICE_CLASS(klass) \ |
| 27 | (G_TYPE_CHECK_CLASS_TYPE((klass), UPDATE_ENGINE_TYPE_SERVICE)) |
| 28 | #define UPDATE_ENGINE_SERVICE_GET_CLASS(obj) \ |
| 29 | (G_TYPE_INSTANCE_GET_CLASS((obj), UPDATE_ENGINE_TYPE_SERVICE, \ |
| 30 | UpdateEngineService)) |
| 31 | |
| 32 | G_BEGIN_DECLS |
| 33 | |
| 34 | struct UpdateEngineService { |
| 35 | GObject parent_instance; |
| 36 | |
| 37 | chromeos_update_engine::UpdateAttempter* update_attempter_; |
| 38 | }; |
| 39 | |
| 40 | struct UpdateEngineServiceClass { |
| 41 | GObjectClass parent_class; |
| 42 | }; |
| 43 | |
| 44 | UpdateEngineService* update_engine_service_new(void); |
| 45 | GType update_engine_service_get_type(void); |
| 46 | |
| 47 | // Methods |
| 48 | |
| 49 | gboolean update_engine_service_get_status(UpdateEngineService* self, |
| 50 | int64_t* last_checked_time, |
| 51 | double* progress, |
| 52 | gchar** current_operation, |
| 53 | gchar** new_version, |
| 54 | int64_t* new_size, |
| 55 | GError **error); |
| 56 | |
| 57 | G_END_DECLS |
| 58 | |
| 59 | #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DBUS_SERVICE_H__ |