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 /**
21  * Interface for classes that want to respond to changes in conversation sets.  A conversation set
22  * is a list of conversations selected by the user to perform an action on. The user could select
23  * five conversations and delete them. The five conversations form a set. Constructing such a set
24  * involves many user actions: tapping on multiple checkboxes. This interface allows the class to
25  * listen to such user actions.
26  */
27 public interface ConversationSetObserver {
28     // TODO(viki): Consider passing a mutable instance of ConversationCheckedSet. In the current
29     // implementation, the observers can wreck the selection set unknowingly!!
30 
31     /**
32      * Called when the selection set becomes empty.
33      */
onSetEmpty()34     void onSetEmpty();
35 
36     /**
37      * Handle when the selection set is populated with some items. The observer should not make any
38      * modifications to the set while handling this event.
39      */
onSetPopulated(ConversationCheckedSet set)40     void onSetPopulated(ConversationCheckedSet set);
41 
42     /**
43      * Handle when the selection set gets an element added or removed. The observer should not
44      * make any modifications to the set while handling this event.
45      */
onSetChanged(ConversationCheckedSet set)46     void onSetChanged(ConversationCheckedSet set);
47 }
48