Home | History | Annotate | Download | only in shill
      1 //
      2 // Copyright (C) 2012 The Android Open Source Project
      3 //
      4 // Licensed under the Apache License, Version 2.0 (the "License");
      5 // you may not use this file except in compliance with the License.
      6 // You may obtain a copy of the License at
      7 //
      8 //      http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unless required by applicable law or agreed to in writing, software
     11 // distributed under the License is distributed on an "AS IS" BASIS,
     12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13 // See the License for the specific language governing permissions and
     14 // limitations under the License.
     15 //
     16 
     17 #ifndef SHILL_CALLBACKS_H_
     18 #define SHILL_CALLBACKS_H_
     19 
     20 #include <string>
     21 #include <vector>
     22 
     23 #include <base/callback.h>
     24 
     25 #include "shill/accessor_interface.h"
     26 #include "shill/key_value_store.h"
     27 
     28 namespace shill {
     29 
     30 class Error;
     31 // Convenient typedefs for some commonly used callbacks.
     32 typedef base::Callback<void(const Error&)> ResultCallback;
     33 typedef base::Callback<void(const Error&, bool)> ResultBoolCallback;
     34 typedef base::Callback<void(const Error&,
     35                             const std::string&)> ResultStringCallback;
     36 typedef base::Callback<void(const Error&)> EnabledStateChangedCallback;
     37 typedef base::Callback<void(const KeyValueStore&,
     38                             const Error&)> KeyValueStoreCallback;
     39 typedef base::Callback<void(const std::vector<KeyValueStore>&,
     40                             const Error&)> KeyValueStoresCallback;
     41 typedef base::Callback<void(const std::string&,
     42                             const Error&)> RpcIdentifierCallback;
     43 typedef base::Callback<void(const std::string&, const Error&)> StringCallback;
     44 typedef base::Callback<void(uint32_t, uint32_t, const KeyValueStore&)>
     45     ActivationStateSignalCallback;
     46 typedef base::Callback<void(const Stringmaps&,
     47                             const Error&)> ResultStringmapsCallback;
     48 
     49 }  // namespace shill
     50 
     51 #endif  // SHILL_CALLBACKS_H_
     52