//========================================================================================
//
//  ADOBE CONFIDENTIAL
//
//  Copyright © 2015 Adobe Systems Incorporated
//  All Rights Reserved.
//
//  NOTICE:  All information contained herein is, and remains
//  the property of Adobe Systems Incorporated and its suppliers,
//  if any.  The intellectual and technical concepts contained
//  herein are proprietary to Adobe Systems Incorporated and its
//  suppliers and are protected by all applicable intellectual property
//  laws, including trade secret and copyright laws.
//
//  Dissemination of this information or reproduction of this material
//  is strictly forbidden unless prior written permission is obtained
//  from Adobe Systems Incorporated.
//
// @author: mortimer
//========================================================================================

var HelloProductInterface_IDSN = function ()
{
    /**
     * Debugging object name shortcut
     */
    this.oname = "HelloInDesign";

    /**
     * Point product configuration info - will get merged into the AdobeHello object
     */
    this.configuration =
    {
        /**
         * Content URL's for the point product.
         */
        url : {
            online  : "https://helpx.adobe.com/indesign/hello/v1_6/index.html"
        },

        /**
         * Object configuration settings.
         */
        options : {
            jsonHtmlEncodeDisplayString     : true,     // HTML encoding required on recent file or document type display name
            jsonURIEncodeOpenPath           : false,    // URI encoding required on recent file path
            middleEllipsisFilenames         : false,    // middle ellipsize recent file names & template names
            createPanelUseOptionalColumn    : true      // use the optional 3rd column of the create panel template
        },

        /**
         * UI element definitions.
         */
        ui : {
            create  :   {
                initialImage    : "images/IdCreateInitialExp.jpg",
                backgroundColor : "#000000",
                dividerColor    : "#fd4891"
            },
            footer  :   {
                helpURL         : "https://www.adobe.com/go/hello_id_help",
                helpLabel       : "footer_help_label_IDSN",
                forumsURL       : "https://www.adobe.com/go/hello_id_forums",
                forumsLabel     : "footer_forums_label",
                inspireURL      : "https://www.adobe.com/go/hello_id_inspire",
                inspireLabel    : "footer_inspire_label",
                blogURL         : "https://www.adobe.com/go/hello_id_addons",
                blogLabel       : "footer_addons_label"
            }
        },

        /**
         * All the point products seem to have implemented a different event types, so we need this
         * definition here until we can standardize them.
         */
        events : {
        }
    }


    /**
     * Sets the "Don't Show Again" preference in the host application.
     *
     * @param dontShowAgain     boolean value indicating true if "dont show again" was
     *                          requested, false otherwise
     */
    HelloProductInterface_IDSN.prototype.setDontShowAgainPreference = function( dontShowAgain )
    {
        try
        {
            var trueOrFalse = dontShowAgain ? "0" : "1"; // reverse it
            var script      = "app.generalPreferences.showWhatsNewOnStartup = "+trueOrFalse;
            
            window.__adobe_hello.evalScript( script, function(result) { } );
        }
        catch( e )
        {
            HelloLog.exception( e );
        }
    }
};
