com.todoroo.astrid.data
Class TaskApiDao

java.lang.Object
  extended by com.todoroo.andlib.data.ContentResolverDao<Task>
      extended by com.todoroo.astrid.data.TaskApiDao

public class TaskApiDao
extends ContentResolverDao<Task>

Data access object for accessing Astrid's Task table. If you are looking to store extended information about a Task, you probably want to use the MetadataApiDao object.

Author:
Tim Su

Nested Class Summary
static class TaskApiDao.TaskCriteria
          Generates SQL clauses
 
Constructor Summary
TaskApiDao(android.content.Context context)
           
 
Method Summary
static void afterSave(Task task, android.content.ContentValues values)
          Send broadcasts on task change (triggers things like task repeats)
static void afterTaskListChanged()
          Send broadcast when task list changes.
 int countTasks(Criterion criterion)
          Count tasks matching criterion
 int countTasks(java.lang.String queryTemplate)
          Count tasks matching query tepmlate
static boolean insignificantChange(android.content.ContentValues values)
           
 boolean save(Task model)
          Create new or save existing model
 
Methods inherited from class com.todoroo.andlib.data.ContentResolverDao
delete, deleteWhere, fetch, query
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskApiDao

public TaskApiDao(android.content.Context context)
Method Detail

countTasks

public int countTasks(Criterion criterion)
Count tasks matching criterion

Parameters:
criterion -
Returns:
# of tasks matching

countTasks

public int countTasks(java.lang.String queryTemplate)
Count tasks matching query tepmlate

Parameters:
queryTemplate -
Returns:
# of tasks matching

save

public boolean save(Task model)
Description copied from class: ContentResolverDao
Create new or save existing model

Overrides:
save in class ContentResolverDao<Task>
Returns:
true if data was written to the db, false otherwise

insignificantChange

public static boolean insignificantChange(android.content.ContentValues values)
Returns:
true if task change shouldn't be broadcast

afterSave

public static void afterSave(Task task,
                             android.content.ContentValues values)
Send broadcasts on task change (triggers things like task repeats)

Parameters:
task - task that was saved
values - values that were updated

afterTaskListChanged

public static void afterTaskListChanged()
Send broadcast when task list changes. Widgets should update.