public abstract class

ContactsSource

extends Object
java.lang.Object
   ↳ com.android.contacts.model.ContactsSource
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Internal structure that represents constraints and styles for a specific data source, such as the various data types they support, including details on how those types should be rendered and edited.

In the future this may be inflated from XML defined by a data source.

Summary

Nested Classes
class ContactsSource.DataKind Description of a specific data type, usually marked by a unique MIMETYPE
class ContactsSource.EditField Description of a user-editable field on a ContactsSource.DataKind row, such as NUMBER
class ContactsSource.EditType Description of a specific "type" or "label" of a ContactsSource.DataKind row, such as TYPE_WORK
interface ContactsSource.StringInflater Generic method of inflating a given Cursor into a user-readable CharSequence. 
Constants
int LEVEL_CONSTRAINTS
int LEVEL_MIMETYPES
int LEVEL_NONE
int LEVEL_SUMMARY
Fields
public String accountType The ACCOUNT_TYPE these constraints apply to.
public int iconRes
public boolean readOnly
public String resPackageName Package that resources should be loaded from, either defined through an Account or for matching against Data#RES_PACKAGE.
public String summaryResPackageName
public int titleRes
Public Constructors
ContactsSource()
Public Methods
ContactsSource.DataKind addKind(ContactsSource.DataKind kind)
Add given ContactsSource.DataKind to list of those provided by this source.
synchronized void ensureInflated(Context context, int inflateLevel)
Ensure that this ContactsSource has been inflated to the requested level.
Drawable getDisplayIcon(Context context)
CharSequence getDisplayLabel(Context context)
abstract int getHeaderColor(Context context)
ContactsSource.DataKind getKindForMimetype(String mimeType)
Find the ContactsSource.DataKind for a specific MIME-type, if it's handled by this data source.
abstract int getSideBarColor(Context context)
ArrayList<ContactsSource.DataKind> getSortedDataKinds()
Return list of ContactsSource.DataKind supported, sorted by weight.
synchronized void invalidateCache()
Invalidate any cache for this ContactsSource, removing all inflated data.
synchronized boolean isInflated(int inflateLevel)
Protected Methods
abstract void inflate(Context context, int inflateLevel)
Perform the actual inflation to the requested level.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int LEVEL_CONSTRAINTS

Constant Value: 3 (0x00000003)

public static final int LEVEL_MIMETYPES

Constant Value: 2 (0x00000002)

public static final int LEVEL_NONE

Constant Value: 0 (0x00000000)

public static final int LEVEL_SUMMARY

Constant Value: 1 (0x00000001)

Fields

public String accountType

The ACCOUNT_TYPE these constraints apply to.

public int iconRes

public boolean readOnly

public String resPackageName

Package that resources should be loaded from, either defined through an Account or for matching against Data#RES_PACKAGE.

public String summaryResPackageName

public int titleRes

Public Constructors

public ContactsSource ()

Public Methods

public ContactsSource.DataKind addKind (ContactsSource.DataKind kind)

Add given ContactsSource.DataKind to list of those provided by this source.

public synchronized void ensureInflated (Context context, int inflateLevel)

Ensure that this ContactsSource has been inflated to the requested level.

public Drawable getDisplayIcon (Context context)

public CharSequence getDisplayLabel (Context context)

public abstract int getHeaderColor (Context context)

public ContactsSource.DataKind getKindForMimetype (String mimeType)

Find the ContactsSource.DataKind for a specific MIME-type, if it's handled by this data source. If you may need a fallback ContactsSource.DataKind, use getKindOrFallback(String, String, Context, int).

public abstract int getSideBarColor (Context context)

public ArrayList<ContactsSource.DataKind> getSortedDataKinds ()

Return list of ContactsSource.DataKind supported, sorted by weight.

public synchronized void invalidateCache ()

Invalidate any cache for this ContactsSource, removing all inflated data. Calling ensureInflated(Context, int) will populate again from scratch.

public synchronized boolean isInflated (int inflateLevel)

Protected Methods

protected abstract void inflate (Context context, int inflateLevel)

Perform the actual inflation to the requested level. Called by ensureInflated(Context, int) when inflation is needed.