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.provider.HostAuth;
21import com.android.emailcommon.service.IEmailServiceCallback;
22import com.android.emailcommon.service.SearchParams;
23import android.os.Bundle;
24
25interface IEmailService {
26    Bundle validate(in HostAuth hostauth);
27
28    oneway void startSync(long mailboxId, boolean userRequest);
29    oneway void stopSync(long mailboxId);
30
31    oneway void loadMore(long messageId);
32    oneway void loadAttachment(long attachmentId, boolean background);
33
34    oneway void updateFolderList(long accountId);
35
36    boolean createFolder(long accountId, String name);
37    boolean deleteFolder(long accountId, String name);
38    boolean renameFolder(long accountId, String oldName, String newName);
39
40    // Must not be oneway; unless an exception is thrown, the caller is guaranteed that the callback
41    // has been registered
42    void setCallback(IEmailServiceCallback cb);
43
44    oneway void setLogging(int on);
45
46    oneway void hostChanged(long accountId);
47
48    Bundle autoDiscover(String userName, String password);
49
50    oneway void sendMeetingResponse(long messageId, int response);
51
52    // Must not be oneway; unless an exception is thrown, the caller is guaranteed that the action
53    // has been completed
54    void deleteAccountPIMData(long accountId);
55
56    int getApiLevel();
57
58    // API level 2
59    int searchMessages(long accountId, in SearchParams params, long destMailboxId);
60}
61