Home | History | Annotate | Download | only in browse
      1 /**
      2  * Copyright (c) 2013, Google Inc.
      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.mail.browse;
     18 
     19 import android.content.Context;
     20 import android.util.AttributeSet;
     21 import android.widget.LinearLayout;
     22 
     23 import com.android.emailcommon.mail.Address;
     24 import com.android.mail.ContactInfoSource;
     25 import com.android.mail.browse.MessageHeaderView.MessageHeaderViewCallbacks;
     26 import com.android.mail.utils.VeiledAddressMatcher;
     27 
     28 import java.util.Map;
     29 
     30 /**
     31  * Abstract view class that must be overridden for any view that wishes to be a snap
     32  * header in the {@link com.android.mail.browse.ConversationContainer}.
     33  */
     34 public abstract class SnapHeader extends LinearLayout {
     35 
     36     public SnapHeader(Context context) {
     37         this(context, null);
     38     }
     39 
     40     public SnapHeader(Context context, AttributeSet attrs) {
     41         this(context, attrs, -1);
     42     }
     43 
     44     public SnapHeader(Context context, AttributeSet attrs, int defStyle) {
     45         super(context, attrs, defStyle);
     46     }
     47 
     48     public abstract void initialize(ConversationAccountController accountController,
     49             Map<String, Address> addressCache, MessageHeaderViewCallbacks callbacks,
     50             ContactInfoSource contactInfoSource, VeiledAddressMatcher veiledAddressMatcher);
     51 
     52 
     53     public abstract void setSnappy();
     54     public abstract boolean isBoundTo(ConversationOverlayItem item);
     55     public abstract void unbind();
     56     public abstract void refresh();
     57 }
     58