<commit_before>/*
 * Copyright 2010 Research In Motion Limited.
 *
 * 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.
 */

/**
 * @toc {BBM} BBM Platform
 * @featureID blackberry.bbm.platform
 * @namespace Provides access to the BBM Social Platform.
 * 
 * <h1>Required BBM Version</h1>
 * 
 * BBM Social Platform APIs come with BBM6 and later. BBM6 is supported on BlackBerry OS 5, 6, and 7.
 * 
 * <h1>Authorization</h1>
 * 
 * <p>
 * Applications must first obtain access to the platform by calling
 * {@link blackberry.bbm.platform.register}.
 * </p>
 * 
 * <ul>
 * <li><b>Accessing other namespaces under</b> {@link blackberry.bbm.platform} <b>may throw exceptions
 * if not authorized.</b></li>
 * <li><b>Authorization may be revoked by the user or server at any time.</b></li>
 * </ul>
 * @BB50+
 * @learns {Download BBM SDK Resources} http://us.blackberry.com/developers/blackberrymessenger/ Download the resources required to use the BBM SDK for WebWorks [BlackBerry].
 * @learns {Getting Started Guide} http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=BlackBerry+WebWorks+for+Smartphones Setup the BBM SDK for BlackBerry WebWorks [BlackBerry Developer Resource Center].
 * @learns {Sample Application Guide} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Getting-Started-BlackBerry-WebWorks-Development-for-Smartphones/ta-p/1185353 Get started with the sample application included with the BBM SDK for BlackBerry WebWorks [BlackBerry Developer Resource Center].
 */
blackberry.bbm.platform = {

    /**
     * @description Registers for access to BBM Platform.
     * <p>The application must assign a callback to {@link blackberry.bbm.platform.event:onaccesschanged}
     * before registering. During registration, a dialog will be shown to guide the user through the registration process.
     * The application should wait until {@link blackberry.bbm.platform.event:onaccesschanged} is invoked before continuing.</p>
     * <h4>Application in Test Environment</h4>
     * Applications must provide a UUID used to identify the application in the test
     * environment. If the application is in App World then the UUID will not be used. The same
     * UUID should be used for future releases of the same application; otherwise communication
     * between them will not be possible. The UUID must be a randomly generated 36-character UUID.
     * Any UUID generator can be used.
     * @param {Object} options Options.
     * @param {String} options.uuid ID used to identify the application in the test environment.
     * @throws {IllegalStateException} If <code>blackberry.bbm.platform.onaccesschanged</code> is not assigned.
     * @throws {IllegalArgumentException} If <code>UUID</code> is not a valid 36-character UUID.
     * @example
     * &lt;script type="text/javascript"&gt;
     * 
     * // Create callback invoked when access changes
     * blackberry.bbm.platform.onaccesschanged = function(accessible, status) {
     *     if (status == "allowed") {
     *         // Access allowed
     *     } else if (status == "user") {
     *         // Access blocked by user
     *     } else if (status == "rim") {
     *         // Access blocked by RIM
     *     }
     *     // Listen for other status...
     * };
     * 
     * // Register with the platform
     * blackberry.bbm.platform.register({
     *     uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID
     * });
     * 
     * &lt;/script&gt;
     * @BB50+
     */
    register : function(options) {
    },
    
    /**
     * @description Shows a dialog prompting the user to connect this application to BBM. This will
     * only work if the application is blocked by the user (i.e. access status is <code>"user"</code>).
     * <p>If the user decides to connect then the application should call {@link blackberry.bbm.platform.register}
     * to complete connecting this application to BBM.
     * @param {Function} onComplete Called when the user has finished connecting this application to BBM.
     * @param {Boolean} connected <code>true</code> if the user connected the application to BBM;
     * <code>false</code> otherwise.
     * @example
     * &lt;script type="text/javascript"&gt;
     * 
     * // Prompt the user to connect to BBM, and call register() if they do
     * blackberry.bbm.platform.requestUserPermission(function(allowed) {
     *     if(allowed) {
     *         // Register with the platform
     *         blackberry.bbm.platform.register({
     *             uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID
     *         });
     *     }
     * });
     * 
     * &lt;/script&gt;
     * @deprecated Use {@link blackberry.bbm.platform.showBBMAppOptions}
     * @BB50+
     */
    requestUserPermission : function(onComplete) {
        
    },
    
    /**
     * @description Brings the BBM options screen for this application to the foreground. This
     * method may only be called if access status is <code>"allowed"</code> or blocked by
     * <code>"user"</code>. Otherwise this method does nothing.
     * @param {Function} onComplete Called when the user exited the BBM options screen.
     * @example
     * &lt;script type="text/javascript"&gt;
     * 
     * blackberry.bbm.platform.requestAppSettings(function() {
     *     // User exited the BBM options screen
     * });
     * 
     * &lt;/script&gt;
     * 
     * @BB50+<commit_msg>Fixed code example for platform.showBBMAppOptions()<commit_after>/*
 * Copyright 2010 Research In Motion Limited.
 *
 * 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.
 */

/**
 * @toc {BBM} BBM Platform
 * @featureID blackberry.bbm.platform
 * @namespace Provides access to the BBM Social Platform.
 * 
 * <h1>Required BBM Version</h1>
 * 
 * BBM Social Platform APIs come with BBM6 and later. BBM6 is supported on BlackBerry OS 5, 6, and 7.
 * 
 * <h1>Authorization</h1>
 * 
 * <p>
 * Applications must first obtain access to the platform by calling
 * {@link blackberry.bbm.platform.register}.
 * </p>
 * 
 * <ul>
 * <li><b>Accessing other namespaces under</b> {@link blackberry.bbm.platform} <b>may throw exceptions
 * if not authorized.</b></li>
 * <li><b>Authorization may be revoked by the user or server at any time.</b></li>
 * </ul>
 * @BB50+
 * @learns {Download BBM SDK Resources} http://us.blackberry.com/developers/blackberrymessenger/ Download the resources required to use the BBM SDK for WebWorks [BlackBerry].
 * @learns {Getting Started Guide} http://docs.blackberry.com/en/developers/subcategories/?userType=21&category=BlackBerry+WebWorks+for+Smartphones Setup the BBM SDK for BlackBerry WebWorks [BlackBerry Developer Resource Center].
 * @learns {Sample Application Guide} http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/Getting-Started-BlackBerry-WebWorks-Development-for-Smartphones/ta-p/1185353 Get started with the sample application included with the BBM SDK for BlackBerry WebWorks [BlackBerry Developer Resource Center].
 */
blackberry.bbm.platform = {

    /**
     * @description Registers for access to BBM Platform.
     * <p>The application must assign a callback to {@link blackberry.bbm.platform.event:onaccesschanged}
     * before registering. During registration, a dialog will be shown to guide the user through the registration process.
     * The application should wait until {@link blackberry.bbm.platform.event:onaccesschanged} is invoked before continuing.</p>
     * <h4>Application in Test Environment</h4>
     * Applications must provide a UUID used to identify the application in the test
     * environment. If the application is in App World then the UUID will not be used. The same
     * UUID should be used for future releases of the same application; otherwise communication
     * between them will not be possible. The UUID must be a randomly generated 36-character UUID.
     * Any UUID generator can be used.
     * @param {Object} options Options.
     * @param {String} options.uuid ID used to identify the application in the test environment.
     * @throws {IllegalStateException} If <code>blackberry.bbm.platform.onaccesschanged</code> is not assigned.
     * @throws {IllegalArgumentException} If <code>UUID</code> is not a valid 36-character UUID.
     * @example
     * &lt;script type="text/javascript"&gt;
     * 
     * // Create callback invoked when access changes
     * blackberry.bbm.platform.onaccesschanged = function(accessible, status) {
     *     if (status == "allowed") {
     *         // Access allowed
     *     } else if (status == "user") {
     *         // Access blocked by user
     *     } else if (status == "rim") {
     *         // Access blocked by RIM
     *     }
     *     // Listen for other status...
     * };
     * 
     * // Register with the platform
     * blackberry.bbm.platform.register({
     *     uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID
     * });
     * 
     * &lt;/script&gt;
     * @BB50+
     */
    register : function(options) {
    },
    
    /**
     * @description Shows a dialog prompting the user to connect this application to BBM. This will
     * only work if the application is blocked by the user (i.e. access status is <code>"user"</code>).
     * <p>If the user decides to connect then the application should call {@link blackberry.bbm.platform.register}
     * to complete connecting this application to BBM.
     * @param {Function} onComplete Called when the user has finished connecting this application to BBM.
     * @param {Boolean} connected <code>true</code> if the user connected the application to BBM;
     * <code>false</code> otherwise.
     * @example
     * &lt;script type="text/javascript"&gt;
     * 
     * // Prompt the user to connect to BBM, and call register() if they do
     * blackberry.bbm.platform.requestUserPermission(function(allowed) {
     *     if(allowed) {
     *         // Register with the platform
     *         blackberry.bbm.platform.register({
     *             uuid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Randomly generated UUID
     *         });
     *     }
     * });
     * 
     * &lt;/script&gt;
     * @deprecated Use {@link blackberry.bbm.platform.showBBMAppOptions}
     * @BB50+
     */
    requestUserPermission : function(onComplete) {
        
    },
    
    /**
     * @description Brings the BBM options screen for this application to the foreground. This
     * method may only be called if access status is <code>"allowed"</code> or blocked by
     * <code>"user"</code>. Otherwise this method does nothing.
     * @param {Function} onComplete Called when the user exited the BBM options screen.
     * @example
     * &lt;script type="text/javascript"&gt;
     * 
     * blackberry.bbm.platform.showBBMAppOptions(function() {
     *     // User exited the BBM options screen
     * });
     * 
     * &lt;/script&gt;
     * 
     * @BB50+
{'fraction_non_alphanumeric': 0.10154617634768073, 'fraction_numerical': 0.006853322189720017, 'mean_word_length': 2.991327551701134, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3284622', 'n_tokens_mistral': 3468, 'n_tokens_neox': 3251, 'n_words': 1179}