| // Copyright 2015 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| [DartPackage="mojo_services"] |
| module contacts; |
| |
| // A user contact. |
| struct Contact { |
| int64 id; |
| string name; |
| }; |
| |
| // Interface to query current user contacts. |
| [ServiceName="contacts::ContactsService"] |
| interface ContactsService { |
| // Returns the number of contacts that match the given |filter|. |filter| |
| // will be matched against the contact name without considering the case. A |
| // contact will match as soon as a part of the name match the filter. |
| GetCount(string? filter) => (uint64 count); |
| |
| // Returns an extract of the list of contacts matching |filter|. |filter| |
| // will be matched against the contact name without considering the case. A |
| // contact will match as soon as a part of the name match the filter. |
| // Contacts are ordered by |name|. The |offset| first contacts are skipped |
| // and at most |limit| contacts are returned. |
| Get(string? filter, uint32 offset, uint32 limit) => (array<Contact> contacts); |
| |
| // Returns the emails associated with the contact with the given |id|. |
| GetEmails(int64 id) => (array<string> emails); |
| |
| // Returns an url of the photo for the contact with the given |id|. If |
| // |high_resolution| is true, a high resolution photo is returned, otherwise |
| // a thumbnail is returned. |
| GetPhoto(int64 id, bool high_resolution) => (string? photo_url); |
| }; |