Jason Glasgow | 74f5ef2 | 2012-03-29 16:15:04 -0400 | [diff] [blame] | 1 | // Copyright (c) 2012 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 SHILL_MM1_SIM_PROXY_INTERFACE_ |
| 6 | #define SHILL_MM1_SIM_PROXY_INTERFACE_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include <base/basictypes.h> |
| 11 | |
| 12 | #include "shill/callbacks.h" |
| 13 | |
| 14 | namespace shill { |
| 15 | |
| 16 | class Error; |
| 17 | |
| 18 | namespace mm1 { |
| 19 | |
| 20 | // These are the methods that a org.freedesktop.ModemManager1.Sim |
| 21 | // proxy must support. The interface is provided so that it can be |
| 22 | // mocked in tests. All calls are made asynchronously. Call completion |
| 23 | // is signalled via the callbacks passed to the methods. |
| 24 | class SimProxyInterface { |
| 25 | public: |
| 26 | virtual ~SimProxyInterface() {} |
| 27 | |
| 28 | virtual void SendPin(const std::string &pin, |
| 29 | Error *error, |
| 30 | const ResultCallback &callback, |
| 31 | int timeout) = 0; |
| 32 | virtual void SendPuk(const std::string &puk, |
| 33 | const std::string &pin, |
| 34 | Error *error, |
| 35 | const ResultCallback &callback, |
| 36 | int timeout) = 0; |
| 37 | virtual void EnablePin(const std::string &pin, |
| 38 | const bool enabled, |
| 39 | Error *error, |
| 40 | const ResultCallback &callback, |
| 41 | int timeout) = 0; |
| 42 | virtual void ChangePin(const std::string &old_pin, |
| 43 | const std::string &new_pin, |
| 44 | Error *error, |
| 45 | const ResultCallback &callback, |
| 46 | int timeout) = 0; |
| 47 | |
| 48 | // Properties. |
| 49 | virtual const std::string SimIdentifier() = 0; |
| 50 | virtual const std::string Imsi() = 0; |
| 51 | virtual const std::string OperatorIdentifier() = 0; |
| 52 | virtual const std::string OperatorName() = 0; |
| 53 | }; |
| 54 | |
| 55 | } // namespace mm1 |
| 56 | } // namespace shill |
| 57 | |
| 58 | #endif // SHILL_MM1_SIM_PROXY_INTERFACE_ |