blob: d08d007f1b320868c572889c7e8cee6c15122c82 [file] [log] [blame]
Dmitri Plotnikove843f912010-09-16 15:21:48 -07001/*
2 * Copyright (C) 2010 The Android Open Source Project
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 */
Dmitri Plotnikov18ffaa22010-12-03 14:28:00 -080016package com.android.contacts;
Dmitri Plotnikove843f912010-09-16 15:21:48 -070017
18import android.content.Context;
19import android.content.CursorLoader;
20import android.provider.ContactsContract.Groups;
21
22/**
23 * Group meta-data loader. Loads all groups from the database.
24 */
25public final class GroupMetaDataLoader extends CursorLoader {
26
27 private final static String[] COLUMNS = new String[] {
28 Groups.ACCOUNT_NAME,
29 Groups.ACCOUNT_TYPE,
30 Groups._ID,
31 Groups.TITLE,
32 Groups.AUTO_ADD,
33 Groups.FAVORITES,
34 };
35
36 public final static int ACCOUNT_NAME = 0;
37 public final static int ACCOUNT_TYPE = 1;
38 public final static int GROUP_ID = 2;
39 public final static int TITLE = 3;
40 public final static int AUTO_ADD = 4;
41 public final static int FAVORITES = 5;
42
43 public GroupMetaDataLoader(Context context) {
Dmitri Plotnikov234e7842010-11-29 16:10:20 -080044 super(context, Groups.CONTENT_URI, COLUMNS, Groups.ACCOUNT_TYPE + " NOT NULL AND "
45 + Groups.ACCOUNT_NAME + " NOT NULL", null, null);
Dmitri Plotnikove843f912010-09-16 15:21:48 -070046 }
47}