summaryrefslogtreecommitdiffstats
path: root/mobile/android/base/java/org/mozilla/gecko/overlays/OverlayConstants.java
blob: 16f5560d3dd6abb69c45f8de4b1f8f01540991c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.gecko.overlays;

/**
 * Constants used by the share handler service (and clients).
 * The intent API used by the service is defined herein.
 */
public class OverlayConstants {
    /*
     * OverlayIntentHandler service intent actions.
     */

    /*
     * Causes the service to broadcast an intent containing state necessary for proper display of
     * a UI to select a target share method.
     *
     * Intent parameters:
     *
     * None.
     */
    public static final String ACTION_PREPARE_SHARE = "org.mozilla.gecko.overlays.ACTION_PREPARE_SHARE";

    /*
     * Action for sharing a page.
     *
     * Intent parameters:
     *
     * $EXTRA_URL: URL of page to share.    (required)
     * $EXTRA_SHARE_METHOD: Method(s) via which to share this url/title combination. Can be either a
     *                ShareType or a ShareType[]
     * $EXTRA_TITLE: Title of page to share (optional)
     * $EXTRA_PARAMETERS: Parcelable of extra data to pass to the ShareMethod (optional)
     */
    public static final String ACTION_SHARE = "org.mozilla.gecko.overlays.ACTION_SHARE";

    /*
     * OverlayIntentHandler service intent extra field keys.
     */

    // The URL/title of the page being shared
    public static final String EXTRA_URL = "URL";
    public static final String EXTRA_TITLE = "TITLE";

    // The optional extra Parcelable parameters for a ShareMethod.
    public static final String EXTRA_PARAMETERS = "EXTRA";

    // The extra field key used for holding the ShareMethod.Type we wish to use for an operation.
    public static final String EXTRA_SHARE_METHOD = "SHARE_METHOD";

    /*
     * ShareMethod UI event intent constants. Broadcast by ShareMethods using LocalBroadcastManager
     * when state has changed that requires an update of any currently-displayed share UI.
     */

    /*
     * Action for a ShareMethod UI event.
     *
     * Intent parameters:
     *
     * $EXTRA_SHARE_METHOD: The ShareType to which this event relates.
     * ... ShareType-specific parameters as desired... (optional)
     */
    public static final String SHARE_METHOD_UI_EVENT = "org.mozilla.gecko.overlays.ACTION_SHARE_METHOD_UI_EVENT";
}