1 /* 2 * Copyright (C) 2012 Google Inc. 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 18 package com.android.mail.ui; 19 20 import android.database.DataSetObserver; 21 22 import com.android.mail.providers.RecentFolderObserver; 23 24 /** 25 * Controller that can provide recent folders and notify on changes to recent folders. 26 */ 27 public interface RecentFolderController { 28 /** 29 * Registers to receive changes to the recent folders, and obtains the current recent folders. 30 */ registerRecentFolderObserver(DataSetObserver observer)31 void registerRecentFolderObserver(DataSetObserver observer); 32 33 /** 34 * Removes a listener from receiving recent folder changes. 35 */ unregisterRecentFolderObserver(DataSetObserver observer)36 void unregisterRecentFolderObserver(DataSetObserver observer); 37 38 /** 39 * Returns the current recent folders. Instead of calling this method, 40 * consider registering for account changes using 41 * {@link RecentFolderObserver#initialize(RecentFolderController)}, which not only provides the 42 * current account, but also updates to the account, in case of settings changes. 43 */ getRecentFolders()44 RecentFolderList getRecentFolders(); 45 46 } 47