The new Android client, featuring:
[zxing.git] / android / src / com / google / zxing / client / android / Contents.java
1 /*
2  * Copyright (C) 2008 ZXing authors
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  */
16
17 package com.google.zxing.client.android;
18
19
20 public final class Contents {
21
22   /**
23    * All the formats we know about.
24    */
25   public static final class Format {
26     public static final String UPC_A = "UPC_A";
27     public static final String UPC_E = "UPC_E";
28     public static final String EAN_8 = "EAN_8";
29     public static final String EAN_13 = "EAN_13";
30     public static final String CODE_39 = "CODE_39";
31     public static final String CODE_128 = "CODE_128";
32     public static final String QR_CODE = "QR_CODE";
33   }
34
35   public static final class Type {
36     /**
37      * Plain text. Use Intent.putExtra(DATA, string). This can be used for URLs too, but string
38      * must include "http://" or "https://".
39      */
40     public static final String TEXT = "TEXT_TYPE";
41
42     /**
43      * An email type. Use Intent.putExtra(DATA, string) where string is the email address.
44      */
45     public static final String EMAIL = "EMAIL_TYPE";
46
47     /**
48      * Use Intent.putExtra(DATA, string) where string is the phone number to call.
49      */
50     public static final String PHONE = "PHONE_TYPE";
51
52     /**
53      * An SMS type. Use Intent.putExtra(DATA, string) where string is the number to SMS.
54      */
55     public static final String SMS = "SMS_TYPE";
56
57     /**
58      * A contact. Send a request to encode it as follows:
59      * <p/>
60      * import android.provider.Contacts;
61      * <p/>
62      * Intent intent = new Intent(Intents.Encode.ACTION);
63      * intent.putExtra(Intents.Encode.TYPE, CONTACT);
64      * Bundle bundle = new Bundle();
65      * bundle.putString(Contacts.Intents.Insert.NAME, "Jenny");
66      * bundle.putString(Contacts.Intents.Insert.PHONE, "8675309");
67      * bundle.putString(Contacts.Intents.Insert.EMAIL, "jenny@the80s.com");
68      * intent.putExtra(Intents.Encode.DATA, bundle);
69      */
70     public static final String CONTACT = "CONTACT_TYPE";
71
72     /**
73      * A geographic location. Use as follows:
74      * Bundle bundle = new Bundle();
75      * bundle.putFloat("LAT", latitude);
76      * bundle.putFloat("LONG", longitude);
77      * intent.putExtra(Intents.Encode.DATA, bundle);
78      */
79     public static final String LOCATION = "LOCATION_TYPE";
80   }
81
82 }