12c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank/*
264dcd7700e134d112c3bd7460539fc1c97a13eb2Marc Blank * Copyright (C) 2008-2010 Marc Blank
32c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * Licensed to The Android Open Source Project.
42c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank *
52c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * Licensed under the Apache License, Version 2.0 (the "License");
62c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * you may not use this file except in compliance with the License.
72c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * You may obtain a copy of the License at
82c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank *
92c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank *      http://www.apache.org/licenses/LICENSE-2.0
102c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank *
112c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * Unless required by applicable law or agreed to in writing, software
122c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * distributed under the License is distributed on an "AS IS" BASIS,
132c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
142c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * See the License for the specific language governing permissions and
152c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank * limitations under the License.
162c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank */
172c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank
180d4fc55861ed4393aa82f124f2865695ef564641Marc Blankpackage com.android.emailcommon.service;
190d4fc55861ed4393aa82f124f2865695ef564641Marc Blank
201d8fd9c05449863ac6a151a6db87c267c4f55ac2Martin Hibdonimport com.android.emailcommon.service.HostAuthCompat;
210d4fc55861ed4393aa82f124f2865695ef564641Marc Blankimport com.android.emailcommon.service.IEmailServiceCallback;
2275a754660e33c5e18cacffff193983ba22a7b9b0Marc Blankimport com.android.emailcommon.service.SearchParams;
238103f960d0c0469d67652afd616e9924687aa139Yu Ping Hu
2417da1767e396b873723d53b2aef93da8aca2c00eMarc Blankimport android.os.Bundle;
252c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank
2617250429db16553b59d5df5e358f71406dd2b322Andrew Stadlerinterface IEmailService {
27f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    // Core email operations.
28fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    // Many of these functions return status codes. The valid status codes are defined in
29fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    // EmailServiceStatus.java
3070cb2878d72ce1c1775ac0426ff82698a5e59377Anthony Lee    oneway void loadAttachment(IEmailServiceCallback cb, long accountId, long attachmentId,
3170cb2878d72ce1c1775ac0426ff82698a5e59377Anthony Lee            boolean background);
322c67f1f8b869454ed24c0ac3c813aca26d2f3978Marc Blank
33fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    void updateFolderList(long accountId);
34fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon
35fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    // TODO: For Eas, sync() will also sync the outbox. We should make IMAP and POP work the same
36fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    // way and get rid of sendMail().
37fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    void sendMail(long accountId);
38163323294e20f620931ae531cc927ae3932cb368Martin Hibdon
39fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    int sync(long accountId, inout Bundle syncExtras);
408103f960d0c0469d67652afd616e9924687aa139Yu Ping Hu
41701134953e4591bf2cca020838558a97eab570a1Yu Ping Hu    // Push-related functionality.
42701134953e4591bf2cca020838558a97eab570a1Yu Ping Hu
43701134953e4591bf2cca020838558a97eab570a1Yu Ping Hu    // Notify the service that the push configuration has changed for an account.
44701134953e4591bf2cca020838558a97eab570a1Yu Ping Hu    void pushModify(long accountId);
45701134953e4591bf2cca020838558a97eab570a1Yu Ping Hu
46f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    // Other email operations.
471d8fd9c05449863ac6a151a6db87c267c4f55ac2Martin Hibdon    Bundle validate(in HostAuthCompat hostauth);
48163323294e20f620931ae531cc927ae3932cb368Martin Hibdon
49f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    int searchMessages(long accountId, in SearchParams params, long destMailboxId);
50832e4a02a670b565a377938b3138e73421d59388Marc Blank
51f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    // PIM functionality (not strictly EAS specific).
52f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    oneway void sendMeetingResponse(long messageId, int response);
5317da1767e396b873723d53b2aef93da8aca2c00eMarc Blank
54f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    // Specific to EAS protocol.
551d8fd9c05449863ac6a151a6db87c267c4f55ac2Martin Hibdon    // TODO: this passes a HostAuth back in the bundle. We should be using a HostAuthCom for that.
5617da1767e396b873723d53b2aef93da8aca2c00eMarc Blank    Bundle autoDiscover(String userName, String password);
575de54008e58ff63d388e4d448b50a47950990e22Marc Blank
58f679cd08d179645b5131d2cfdaa70fa42bb778c0Yu Ping Hu    // Service control operations (i.e. does not generate a client-server message).
59fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    // TODO: We should store the logging flags in the contentProvider, and this call should just
60fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    // trigger the service to reload the flags.
61fb2a3a2f77f954265beaa92b87774006e2d7c185Martin Hibdon    oneway void setLogging(int flags);
62c5f5a14ae9095f76d8e8c411cfd8f8e0e8970aa2Martin Hibdon
637afbeee47e1a82680c815f2fb8cfdba32d6b0b84Martin Hibdon    void deleteExternalAccountPIMData(String emailAddress);
647afbeee47e1a82680c815f2fb8cfdba32d6b0b84Martin Hibdon
657afbeee47e1a82680c815f2fb8cfdba32d6b0b84Martin Hibdon    int getApiVersion();
6622409fcffae4c6e551fb3e6ead4cdc92e33fded1Ben Komalo}
67