|
|
|
@ -22,18 +22,18 @@ public class Notes {
|
|
|
|
|
public static final String TAG = "Notes";
|
|
|
|
|
public static final int TYPE_NOTE = 0;
|
|
|
|
|
public static final int TYPE_FOLDER = 1;
|
|
|
|
|
public static final int TYPE_SYSTEM = 2;
|
|
|
|
|
public static final int TYPE_SYSTEM = 2;//定义了常量,其中TYPE用于设置条件
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Following IDs are system folders' identifiers
|
|
|
|
|
* {@link Notes#ID_ROOT_FOLDER } is default folder
|
|
|
|
|
* {@link Notes#ID_TEMPARAY_FOLDER } is for notes belonging no folder
|
|
|
|
|
* {@link Notes#ID_CALL_RECORD_FOLDER} is to store call records
|
|
|
|
|
* Following IDs are system folders' identifiers 以下是系统文件的标识符
|
|
|
|
|
* {@link Notes#ID_ROOT_FOLDER } is default folder 是默认文件夹
|
|
|
|
|
* {@link Notes#ID_TEMPARAY_FOLDER } is for notes belonging no folder 不属于文件夹的记录
|
|
|
|
|
* {@link Notes#ID_CALL_RECORD_FOLDER} is to store call records 存储通话记录
|
|
|
|
|
*/
|
|
|
|
|
public static final int ID_ROOT_FOLDER = 0;
|
|
|
|
|
public static final int ID_TEMPARAY_FOLDER = -1;
|
|
|
|
|
public static final int ID_CALL_RECORD_FOLDER = -2;
|
|
|
|
|
public static final int ID_TRASH_FOLER = -3;
|
|
|
|
|
public static final int ID_TRASH_FOLER = -3;//定义了常量用于设置条件
|
|
|
|
|
|
|
|
|
|
public static final String INTENT_EXTRA_ALERT_DATE = "net.micode.notes.alert_date";
|
|
|
|
|
public static final String INTENT_EXTRA_BACKGROUND_ID = "net.micode.notes.background_color_id";
|
|
|
|
@ -44,7 +44,7 @@ public class Notes {
|
|
|
|
|
|
|
|
|
|
public static final int TYPE_WIDGET_INVALIDE = -1;
|
|
|
|
|
public static final int TYPE_WIDGET_2X = 0;
|
|
|
|
|
public static final int TYPE_WIDGET_4X = 1;
|
|
|
|
|
public static final int TYPE_WIDGET_4X = 1;//定义了常量用于设置条件
|
|
|
|
|
|
|
|
|
|
public static class DataConstants {
|
|
|
|
|
public static final String NOTE = TextNote.CONTENT_ITEM_TYPE;
|
|
|
|
@ -52,67 +52,69 @@ public class Notes {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Uri to query all notes and folders
|
|
|
|
|
* Uri to query all notes and folders 查询所有便签和文件
|
|
|
|
|
*/
|
|
|
|
|
public static final Uri CONTENT_NOTE_URI = Uri.parse("content://" + AUTHORITY + "/note");
|
|
|
|
|
//定义Uri查询的指针指向note
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Uri to query data
|
|
|
|
|
* Uri to query data 查询数据
|
|
|
|
|
*/
|
|
|
|
|
public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data");
|
|
|
|
|
//定义Uri查询的指针指向data
|
|
|
|
|
|
|
|
|
|
public interface NoteColumns {
|
|
|
|
|
/**
|
|
|
|
|
* The unique ID for a row
|
|
|
|
|
* The unique ID for a row 行唯一的ID
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String ID = "_id";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The parent's id for note or folder
|
|
|
|
|
* The parent's id for note or folder 对于便签或文件夹的父类ID
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String PARENT_ID = "parent_id";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created data for note or folder
|
|
|
|
|
* Created data for note or folder 创建数据给便签或文件夹
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String CREATED_DATE = "created_date";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Latest modified date
|
|
|
|
|
* Latest modified date 最近修改日期
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String MODIFIED_DATE = "modified_date";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Alert date
|
|
|
|
|
* Alert date 提醒的日期
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String ALERTED_DATE = "alert_date";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Folder's name or text content of note
|
|
|
|
|
* Folder's name or text content of note 文件夹的名称或备注的便签内容
|
|
|
|
|
* <P> Type: TEXT </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String SNIPPET = "snippet";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Note's widget id
|
|
|
|
|
* Note's widget id 便签的窗口ID
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String WIDGET_ID = "widget_id";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Note's widget type
|
|
|
|
|
* Note's widget type 便签的窗口类型
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String WIDGET_TYPE = "widget_type";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Note's background color's id
|
|
|
|
|
* Note's background color's id 便签的背景颜色
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String BG_COLOR_ID = "bg_color_id";
|
|
|
|
@ -125,31 +127,31 @@ public class Notes {
|
|
|
|
|
public static final String HAS_ATTACHMENT = "has_attachment";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Folder's count of notes
|
|
|
|
|
* Folder's count of notes 便签的文件计数
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String NOTES_COUNT = "notes_count";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The file type: folder or note
|
|
|
|
|
* The file type: folder or note 文件类型,文件或便签
|
|
|
|
|
* <P> Type: INTEGER </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String TYPE = "type";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The last sync id
|
|
|
|
|
* The last sync id 最后一个同步ID
|
|
|
|
|
* <P> Type: INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String SYNC_ID = "sync_id";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sign to indicate local modified or not
|
|
|
|
|
* Sign to indicate local modified or not 标记是否进行了本地修改
|
|
|
|
|
* <P> Type: INTEGER </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String LOCAL_MODIFIED = "local_modified";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Original parent id before moving into temporary folder
|
|
|
|
|
* Original parent id before moving into temporary folder 移动到临时文件夹之前的原始父id
|
|
|
|
|
* <P> Type : INTEGER </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String ORIGIN_PARENT_ID = "origin_parent_id";
|
|
|
|
@ -161,11 +163,11 @@ public class Notes {
|
|
|
|
|
public static final String GTASK_ID = "gtask_id";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The version code
|
|
|
|
|
* The version code 版本号
|
|
|
|
|
* <P> Type : INTEGER (long) </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String VERSION = "version";
|
|
|
|
|
}
|
|
|
|
|
}//定义一个存放便签各种属性的接口
|
|
|
|
|
|
|
|
|
|
public interface DataColumns {
|
|
|
|
|
/**
|
|
|
|
@ -239,7 +241,7 @@ public class Notes {
|
|
|
|
|
* <P> Type: TEXT </P>
|
|
|
|
|
*/
|
|
|
|
|
public static final String DATA5 = "data5";
|
|
|
|
|
}
|
|
|
|
|
}//定义便签的内容Data
|
|
|
|
|
|
|
|
|
|
public static final class TextNote implements DataColumns {
|
|
|
|
|
/**
|
|
|
|
@ -255,7 +257,7 @@ public class Notes {
|
|
|
|
|
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/text_note";
|
|
|
|
|
|
|
|
|
|
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/text_note");
|
|
|
|
|
}
|
|
|
|
|
}//文本记录
|
|
|
|
|
|
|
|
|
|
public static final class CallNote implements DataColumns {
|
|
|
|
|
/**
|
|
|
|
@ -275,5 +277,5 @@ public class Notes {
|
|
|
|
|
public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/call_note";
|
|
|
|
|
|
|
|
|
|
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/call_note");
|
|
|
|
|
}
|
|
|
|
|
}//电话记录
|
|
|
|
|
}
|
|
|
|
|