/*
 * Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


package net.micode.notes.data;

import android.net.Uri;

public class Notes {
    public static final String AUTHORITY = "micode_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; // 笔记类型标识：系统文件夹

    /**
     * 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 String INTENT_EXTRA_ALERT_DATE = "net.micode.notes.alert_date"; // 传递提醒日期的Intent Extra键名
    public static final String INTENT_EXTRA_BACKGROUND_ID = "net.micode.notes.background_color_id"; // 传递背景颜色ID的Intent Extra键名
    public static final String INTENT_EXTRA_WIDGET_ID = "net.micode.notes.widget_id"; // 传递小部件ID的Intent Extra键名
    public static final String INTENT_EXTRA_WIDGET_TYPE = "net.micode.notes.widget_type"; // 传递小部件类型的Intent Extra键名
    public static final String INTENT_EXTRA_FOLDER_ID = "net.micode.notes.folder_id"; // 传递文件夹ID的Intent Extra键名
    public static final String INTENT_EXTRA_CALL_DATE = "net.micode.notes.call_date"; // 传递通话日期的Intent Extra键名

    public static final int TYPE_WIDGET_INVALIDE = -1; // 无效的小部件类型标识
    public static final int TYPE_WIDGET_2X = 0; // 2x2尺寸的小部件类型标识
    public static final int TYPE_WIDGET_4X = 1; // 4x4尺寸的小部件类型标识

    public static class DataConstants {
        public static final String NOTE = TextNote.CONTENT_ITEM_TYPE; // 文本笔记数据类型
        public static final String CALL_NOTE = CallNote.CONTENT_ITEM_TYPE; // 通话笔记数据类型
    }

    public static final Uri CONTENT_NOTE_URI = Uri.parse("content://" + AUTHORITY + "/note");
    //CONTENT_NOTE_URI：表示用于访问联系人的URI，包括联系人的基本信息，例如姓名、电话号码等。

    public static final Uri CONTENT_DATA_URI = Uri.parse("content://" + AUTHORITY + "/data");
    //CONTENT_DATA_URI：表示用于访问联系人数据的URI，包括联系人的更多详细信息，例如邮箱、地址等。
    
    public interface NoteColumns {//接口


        public static final String ID = "_id"; // 联系人ID列名
        public static final String PARENT_ID = "parent_id"; // 父文件夹ID列名
        public static final String CREATED_DATE = "created_date"; // 创建日期列名
        public static final String MODIFIED_DATE = "modified_date"; // 修改日期列名
        public static final String ALERTED_DATE = "alert_date"; // 提醒日期列名
        public static final String SNIPPET = "snippet"; // 摘要列名
        public static final String WIDGET_ID = "widget_id"; // 小部件ID列名
        public static final String WIDGET_TYPE = "widget_type"; // 小部件类型列名
        public static final String BG_COLOR_ID = "bg_color_id"; // 背景颜色ID列名
        public static final String HAS_ATTACHMENT = "has_attachment"; // 是否有附件列名
        public static final String NOTES_COUNT = "notes_count"; // 笔记数量列名
        public static final String TYPE = "type"; // 笔记类型列名
        public static final String SYNC_ID = "sync_id"; // 同步ID列名
        public static final String LOCAL_MODIFIED = "local_modified"; // 本地修改标志列名
        public static final String ORIGIN_PARENT_ID = "origin_parent_id"; // 源父文件夹ID列名
        public static final String GTASK_ID = "gtask_id"; // Google任务ID列名
        public static final String VERSION = "version"; // 版本号列名
    }

    
    public interface DataColumns {//接口
        public static final String ID = "_id"; // 联系人数据ID列名
        public static final String MIME_TYPE = "mime_type"; // MIME类型列名
        public static final String NOTE_ID = "note_id"; // 笔记ID列名
        public static final String CREATED_DATE = "created_date"; // 创建日期列名
        public static final String MODIFIED_DATE = "modified_date"; // 修改日期列名
        public static final String CONTENT = "content"; // 内容列名
        public static final String DATA1 = "data1"; // 数据1列名
        public static final String DATA2 = "data2"; // 数据2列名
        public static final String DATA3 = "data3"; // 数据3列名
        public static final String DATA4 = "data4"; // 数据4列名
        public static final String DATA5 = "data5"; // 数据5列名
    }


    //这段代码定义了两个静态内部类TextNote和CallNote，
    //分别表示联系人数据库中的文本笔记和电话笔记
    public static final class TextNote implements DataColumns {
        public static final String MODE = DATA1; // 模式列名，表示文本笔记的模式
        public static final int MODE_CHECK_LIST = 1; // 检查清单模式的模式值
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/text_note"; // 内容类型，表示文本笔记的数据集类型
        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"); // 数据集的URI，用于访问文本笔记数据集
    }

    public static final class CallNote implements DataColumns {
        public static final String CALL_DATE = DATA1; // 电话日期列名，表示电话笔记的日期
        public static final String PHONE_NUMBER = DATA3; // 电话号码列名
        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/call_note"; // 内容类型，表示电话笔记的数据集类型
        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"); // 数据集的URI，用于访问电话笔记数据集
    }
}