OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium 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 CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_SOURCE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_SOURCE_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 namespace contacts { |
| 14 |
| 15 struct Contact; |
| 16 typedef std::vector<const Contact*> ContactPointers; |
| 17 class ContactSourceObserver; |
| 18 |
| 19 // Interface for classes that provide contacts. |
| 20 class ContactSource { |
| 21 public: |
| 22 ContactSource() {} |
| 23 virtual ~ContactSource() {} |
| 24 |
| 25 // Appends the source's contacts to |contacts_out|. |
| 26 virtual void AppendContacts(ContactPointers* contacts_out) = 0; |
| 27 |
| 28 // Returns the contact identified by |provider_id|. |
| 29 // NULL is returned if the contact doesn't exist. |
| 30 virtual const Contact* GetContactByProviderId( |
| 31 const std::string& provider_id) = 0; |
| 32 |
| 33 // Adds or removes an observer. |
| 34 virtual void AddObserver(ContactSourceObserver* observer) = 0; |
| 35 virtual void RemoveObserver(ContactSourceObserver* observer) = 0; |
| 36 |
| 37 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(ContactSource); |
| 39 }; |
| 40 |
| 41 } // namespace contacts |
| 42 |
| 43 #endif // CHROME_BROWSER_CHROMEOS_CONTACTS_CONTACT_SOURCE_H_ |
OLD | NEW |