blob: a6371123ccaa47a618a0602710051242c0ae193b [file] [log] [blame]
// Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <map>
#include <string>
#include <base/basictypes.h>
#include "shill/adaptor_interfaces.h"
#include "shill/dbus_adaptor.h"
#include "shill/dbus_bindings/flimflam-service.h"
namespace shill {
class Service;
// Subclass of DBusAdaptor for Service objects
// There is a 1:1 mapping between Service and ServiceDBusAdaptor
// instances. Furthermore, the Service owns the ServiceDBusAdaptor
// and manages its lifetime, so we're OK with ServiceDBusAdaptor
// having a bare pointer to its owner service.
class ServiceDBusAdaptor : public org::chromium::flimflam::Service_adaptor,
public DBusAdaptor,
public ServiceAdaptorInterface {
static const char kInterfaceName[];
static const char kPath[];
ServiceDBusAdaptor(DBus::Connection* conn, Service *service);
virtual ~ServiceDBusAdaptor();
// Implementation of ServiceAdaptorInterface.
virtual const std::string &GetRpcIdentifier() { return path(); }
void UpdateConnected();
void EmitBoolChanged(const std::string& name, bool value);
void EmitUintChanged(const std::string& name, uint32 value);
void EmitIntChanged(const std::string& name, int value);
void EmitStringChanged(const std::string& name, const std::string& value);
// Implementation of Service_adaptor
std::map<std::string, ::DBus::Variant> GetProperties(::DBus::Error &error);
void SetProperty(const std::string& name,
const ::DBus::Variant& value,
::DBus::Error &error);
void ClearProperty(const std::string& , ::DBus::Error &error);
void Connect(::DBus::Error &error);
void Disconnect(::DBus::Error &error);
void Remove(::DBus::Error &error);
void MoveBefore(const ::DBus::Path& , ::DBus::Error &error);
void MoveAfter(const ::DBus::Path& , ::DBus::Error &error);
void ActivateCellularModem(const std::string& , ::DBus::Error &error);
Service *service_;
} // namespace shill