1/*
2 * Copyright (C) 2008-2010 Marc Blank
3 * Licensed to The Android Open Source Project.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18package com.android.emailcommon.service;
19
20import com.android.emailcommon.service.HostAuthCompat;
21import com.android.emailcommon.service.IEmailServiceCallback;
22import com.android.emailcommon.service.SearchParams;
23
24import android.os.Bundle;
25
26interface IEmailService {
27    // Core email operations.
28    // Many of these functions return status codes. The valid status codes are defined in
29    // EmailServiceStatus.java
30    oneway void loadAttachment(IEmailServiceCallback cb, long accountId, long attachmentId,
31            boolean background);
32
33    void updateFolderList(long accountId);
34
35    // TODO: For Eas, sync() will also sync the outbox. We should make IMAP and POP work the same
36    // way and get rid of sendMail().
37    void sendMail(long accountId);
38
39    int sync(long accountId, inout Bundle syncExtras);
40
41    // Push-related functionality.
42
43    // Notify the service that the push configuration has changed for an account.
44    void pushModify(long accountId);
45
46    // Other email operations.
47    Bundle validate(in HostAuthCompat hostauth);
48
49    int searchMessages(long accountId, in SearchParams params, long destMailboxId);
50
51    // PIM functionality (not strictly EAS specific).
52    oneway void sendMeetingResponse(long messageId, int response);
53
54    // Specific to EAS protocol.
55    // TODO: this passes a HostAuth back in the bundle. We should be using a HostAuthCom for that.
56    Bundle autoDiscover(String userName, String password);
57
58    // Service control operations (i.e. does not generate a client-server message).
59    // TODO: We should store the logging flags in the contentProvider, and this call should just
60    // trigger the service to reload the flags.
61    oneway void setLogging(int flags);
62
63    void deleteExternalAccountPIMData(String emailAddress);
64
65    int getApiVersion();
66}
67