ConversationSpecialItemView.java revision 2102b2c87a6cb39bc63fb7eff13dda64da56b72e
17c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy/*
27c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * Copyright (C) 2013 Google Inc.
37c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * Licensed to The Android Open Source Project.
47c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy *
57c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * Licensed under the Apache License, Version 2.0 (the "License");
67c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * you may not use this file except in compliance with the License.
77c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * You may obtain a copy of the License at
87c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy *
97c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy *      http://www.apache.org/licenses/LICENSE-2.0
107c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy *
117c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * Unless required by applicable law or agreed to in writing, software
127c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * distributed under the License is distributed on an "AS IS" BASIS,
137c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
147c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * See the License for the specific language governing permissions and
157c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * limitations under the License.
167c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy */
177c8325de829ca029ce4547e4f0fa266124301367Scott Kennedypackage com.android.mail.ui;
187c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
197c8325de829ca029ce4547e4f0fa266124301367Scott Kennedyimport android.app.LoaderManager;
20fe8e081d6230f343dc74b45d69e5f4634a332b5aAlice Yangimport android.view.View;
217c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
227c8325de829ca029ce4547e4f0fa266124301367Scott Kennedyimport com.android.mail.browse.ConversationCursor;
237c8325de829ca029ce4547e4f0fa266124301367Scott Kennedyimport com.android.mail.providers.Folder;
247c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
257c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy/**
267c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * An interface for a view that can be inserted into an {@link AnimatedAdapter} at an arbitrary
277c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy * point. The methods described here control whether the view gets displayed, and what it displays.
287c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy */
297c8325de829ca029ce4547e4f0fa266124301367Scott Kennedypublic interface ConversationSpecialItemView {
307c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    /**
317c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy     * Called when there as an update to the information being displayed.
327c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy     *
337c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy     * @param cursor The {@link ConversationCursor}. May be <code>null</code>
347c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy     */
357c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    void onUpdate(String account, Folder folder, ConversationCursor cursor);
367c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
377c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    boolean getShouldDisplayInList();
387c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
397c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    int getPosition();
407c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
412102b2c87a6cb39bc63fb7eff13dda64da56b72eMark Wei    void setAdapter(AnimatedAdapter adapter);
427c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
437c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    void bindLoaderManager(LoaderManager loaderManager);
447c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy
457c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    /**
467c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy     * Called when the view is being destroyed.
477c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy     */
487c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy    void cleanup();
49fe8e081d6230f343dc74b45d69e5f4634a332b5aAlice Yang
50fe8e081d6230f343dc74b45d69e5f4634a332b5aAlice Yang    /**
51fe8e081d6230f343dc74b45d69e5f4634a332b5aAlice Yang     * Called when a regular conversation item was clicked.
52fe8e081d6230f343dc74b45d69e5f4634a332b5aAlice Yang     */
53fe8e081d6230f343dc74b45d69e5f4634a332b5aAlice Yang    void onConversationSelected();
547c8325de829ca029ce4547e4f0fa266124301367Scott Kennedy}
55