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
18package com.android.mail.ui;
19
20import com.android.mail.browse.ConversationListFooterView;
21import com.android.mail.providers.Folder;
22
23/**
24 * A controllable activity is an Activity that has a Controller attached. This activity must be
25 * able to attach the various view fragments and delegate the method calls between them.
26 */
27public interface ControllableActivity extends HelpCallback, RestrictedActivity,
28        FeedbackEnabledActivity, FolderItemView.DropHandler, UndoListener,
29        AnimatedAdapter.Listener, ConversationListFooterView.FooterViewClickListener {
30    /**
31     * Returns the ViewMode the activity is updating.
32     * @see com.android.mail.ui.ViewMode
33     * @return ViewMode.
34     */
35    ViewMode getViewMode();
36
37    /**
38     * Returns the object that handles {@link ConversationListCallbacks} that is associated with
39     * this activity.
40     * @return
41     */
42    ConversationListCallbacks getListHandler();
43
44    /**
45     * Return the folder change listener for this activity
46     * @return
47     */
48    FolderChangeListener getFolderChangeListener();
49
50    /**
51     * Get the set of currently selected conversations. This method returns a non-null value.
52     * In case no conversation is currently selected, it returns an empty selection set.
53     * @return
54     */
55    ConversationSelectionSet getSelectedSet();
56
57    /**
58     * Returns the listener for folder list selection changes in the folder list
59     * fragment so that activity controllers can track the last folder list
60     * pushed for hierarchical folders.
61     */
62    FolderSelector getFolderSelector();
63
64    /**
65     * Get the folder currently being accessed by the activity.
66     */
67    Folder getHierarchyFolder();
68
69    /**
70     * Returns an object that can update conversation state. Holding a reference to the
71     * ConversationUpdater is safe since the ConversationUpdater is guaranteed to persist across
72     * changes to the conversation cursor.
73     * @return
74     */
75    ConversationUpdater getConversationUpdater();
76
77    ErrorListener getErrorListener();
78
79    /**
80     * Returns the {@link FolderController} object associated with this activity, if any.
81     * @return
82     */
83    FolderController getFolderController();
84
85    /**
86     * Returns the {@link AccountController} object associated with this activity, if any.
87     * @return
88     */
89    AccountController getAccountController();
90
91    /**
92     * Returns the {@link RecentFolderController} object associated with this activity, if any.
93     * @return
94     */
95    RecentFolderController getRecentFolderController();
96
97    UpOrBackController getUpOrBackController();
98
99    void startDragMode();
100
101    void stopDragMode();
102
103    boolean isAccessibilityEnabled();
104
105    /**
106     * Gets a helper to provide addition features in the conversation list. This may be null.
107     */
108    ConversationListHelper getConversationListHelper();
109
110    /**
111     * Returns the {@link FragmentLauncher} object associated with this activity, if any.
112     */
113    FragmentLauncher getFragmentLauncher();
114}
115