1 /*
2  * Copyright (C) 2013 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * 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, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */
16 
17 package com.android.inputmethod.dictionarypack;
18 
19 /**
20  * A class to group constants for dictionary pack usage.
21  *
22  * This class only defines constants. It should not make any references to outside code as far as
23  * possible, as it's used to separate cleanly the keyboard code from the dictionary pack code; this
24  * is needed in particular to cleanly compile regression tests.
25  */
26 public class DictionaryPackConstants {
27     /**
28      * The root domain for the dictionary pack, upon which authorities and actions will append
29      * their own distinctive strings.
30      */
31     private static final String DICTIONARY_DOMAIN = "com.android.inputmethod.dictionarypack.aosp";
32 
33     /**
34      * Authority for the ContentProvider protocol.
35      */
36     // TODO: find some way to factorize this string with the one in the resources
37     public static final String AUTHORITY = DICTIONARY_DOMAIN;
38 
39     /**
40      * The action of the intent for publishing that new dictionary data is available.
41      */
42     // TODO: make this different across different packages. A suggested course of action is
43     // to use the package name inside this string.
44     // NOTE: The appended string should be uppercase like all other actions, but it's not for
45     // historical reasons.
46     public static final String NEW_DICTIONARY_INTENT_ACTION = DICTIONARY_DOMAIN + ".newdict";
47 
48     /**
49      * The action of the intent sent by the dictionary pack to ask for a client to make
50      * itself known. This is used when the settings activity is brought up for a client the
51      * dictionary pack does not know about.
52      */
53     public static final String UNKNOWN_DICTIONARY_PROVIDER_CLIENT = DICTIONARY_DOMAIN
54             + ".UNKNOWN_CLIENT";
55 
56     // In the above intents, the name of the string extra that contains the name of the client
57     // we want information about.
58     public static final String DICTIONARY_PROVIDER_CLIENT_EXTRA = "client";
59 
60     /**
61      * The action of the intent to tell the dictionary provider to update now.
62      */
63     public static final String UPDATE_NOW_INTENT_ACTION = DICTIONARY_DOMAIN
64             + ".UPDATE_NOW";
65 }
66