1 /* 2 * Copyright (C) 2009 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.email.mail.exchange; 18 19 import com.android.email.mail.FetchProfile; 20 import com.android.email.mail.Flag; 21 import com.android.email.mail.Folder; 22 import com.android.email.mail.Message; 23 import com.android.email.mail.MessageRetrievalListener; 24 import com.android.email.mail.MessagingException; 25 26 /** 27 * Sample code for implementing a new server folder. See also ExchangeStoreExample, 28 * ExchangeSenderExample, and ExchangeTransportExample. 29 */ 30 public class ExchangeFolderExample extends Folder { 31 32 private final ExchangeTransportExample mTransport; 33 private final ExchangeStoreExample mStore; 34 private final String mName; 35 36 private PersistentDataCallbacks mPersistenceCallbacks; 37 ExchangeFolderExample(ExchangeStoreExample store, String name)38 public ExchangeFolderExample(ExchangeStoreExample store, String name) 39 throws MessagingException { 40 mStore = store; 41 mTransport = store.getTransport(); 42 mName = name; 43 if (!mTransport.isFolderAvailable(name)) { 44 throw new MessagingException("folder not supported: " + name); 45 } 46 } 47 48 @Override appendMessages(Message[] messages)49 public void appendMessages(Message[] messages) throws MessagingException { 50 // TODO Implement this function 51 } 52 53 @Override close(boolean expunge)54 public void close(boolean expunge) throws MessagingException { 55 mPersistenceCallbacks = null; 56 // TODO Implement this function 57 } 58 59 @Override copyMessages(Message[] msgs, Folder folder, MessageUpdateCallbacks callbacks)60 public void copyMessages(Message[] msgs, Folder folder, MessageUpdateCallbacks callbacks) 61 throws MessagingException { 62 // TODO Implement this function 63 } 64 65 @Override create(FolderType type)66 public boolean create(FolderType type) throws MessagingException { 67 // TODO Implement this function 68 return false; 69 } 70 71 @Override delete(boolean recurse)72 public void delete(boolean recurse) throws MessagingException { 73 // TODO Implement this function 74 } 75 76 @Override exists()77 public boolean exists() throws MessagingException { 78 // TODO Implement this function 79 return false; 80 } 81 82 @Override expunge()83 public Message[] expunge() throws MessagingException { 84 // TODO Implement this function 85 return null; 86 } 87 88 @Override fetch(Message[] messages, FetchProfile fp, MessageRetrievalListener listener)89 public void fetch(Message[] messages, FetchProfile fp, MessageRetrievalListener listener) 90 throws MessagingException { 91 // TODO Implement this function 92 } 93 94 @Override getMessage(String uid)95 public Message getMessage(String uid) throws MessagingException { 96 // TODO Implement this function 97 return null; 98 } 99 100 @Override getMessageCount()101 public int getMessageCount() throws MessagingException { 102 // TODO Implement this function 103 return 0; 104 } 105 106 @Override getMessages(int start, int end, MessageRetrievalListener listener)107 public Message[] getMessages(int start, int end, MessageRetrievalListener listener) 108 throws MessagingException { 109 // TODO Implement this function 110 return null; 111 } 112 113 @Override getMessages(MessageRetrievalListener listener)114 public Message[] getMessages(MessageRetrievalListener listener) throws MessagingException { 115 // TODO Implement this function 116 return null; 117 } 118 119 @Override getMessages(String[] uids, MessageRetrievalListener listener)120 public Message[] getMessages(String[] uids, MessageRetrievalListener listener) 121 throws MessagingException { 122 // TODO Implement this function 123 return null; 124 } 125 126 @Override getMode()127 public OpenMode getMode() throws MessagingException { 128 // TODO Implement this function 129 return null; 130 } 131 132 @Override getName()133 public String getName() { 134 // TODO Implement this function 135 return null; 136 } 137 138 @Override getPermanentFlags()139 public Flag[] getPermanentFlags() throws MessagingException { 140 // TODO Implement this function 141 return null; 142 } 143 144 @Override getUnreadMessageCount()145 public int getUnreadMessageCount() throws MessagingException { 146 // TODO Implement this function 147 return 0; 148 } 149 150 @Override isOpen()151 public boolean isOpen() { 152 // TODO Implement this function 153 return false; 154 } 155 156 @Override open(OpenMode mode, PersistentDataCallbacks callbacks)157 public void open(OpenMode mode, PersistentDataCallbacks callbacks) throws MessagingException { 158 mPersistenceCallbacks = callbacks; 159 // TODO Implement this function 160 } 161 162 @Override setFlags(Message[] messages, Flag[] flags, boolean value)163 public void setFlags(Message[] messages, Flag[] flags, boolean value) throws MessagingException { 164 // TODO Implement this function 165 } 166 167 168 } 169