/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * The contents of this file are subject to the Netscape Public
 * License Version 1.1 (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.mozilla.org/NPL/
 *
 * Software distributed under the License is distributed on an "AS
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * rights and limitations under the License.
 *
 * The Original Code is mozilla.org code.
 *
 * The Initial Developer of the Original Code is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation. All
 * Rights Reserved.
 *
 * Contributor(s): 
 */

/**
 * @status UNDER_REVIEW
 */
 
/**
 * This is the prompt interface which can be used without knowlege of a
 * parent window. The parentage is hidden by the GetInterface though
 * which it is gotten. This interface is identical to nsIPromptService
 * but without the parent nsIDOMWindow parameter. See nsIPromptService
 * for all documentation.
 */  

#include "nsISupports.idl"

[scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)]
interface nsIPrompt : nsISupports
{
    void alert(in wstring dialogTitle,
               in wstring text);

    void alertCheck(in wstring dialogTitle,
                    in wstring text,
                    in wstring checkMsg,
                    out boolean checkValue);

    boolean confirm(in wstring dialogTitle,
                    in wstring text);

    boolean confirmCheck(in wstring dialogTitle,
                         in wstring text,
                         in wstring checkMsg,
                         out boolean checkValue);
                         
    const unsigned long BUTTON_POS_0              = 1;
    const unsigned long BUTTON_POS_1              = 1 << 8;

    const unsigned long BUTTON_TITLE_OK            = 1;
    const unsigned long BUTTON_TITLE_CANCEL        = 2;
    const unsigned long BUTTON_TITLE_YES           = 3;
    const unsigned long BUTTON_TITLE_NO            = 4;
    const unsigned long BUTTON_TITLE_SAVE          = 5;
    const unsigned long BUTTON_TITLE_REVERT        = 6;

    const unsigned long STD_OK_CANCEL_BUTTONS      = (BUTTON_TITLE_OK * BUTTON_POS_0) +
                                                    (BUTTON_TITLE_CANCEL * BUTTON_POS_1);
                       
     void confirmEx(in wstring dialogTitle,
                    in wstring text,
                    in unsigned long button0And1Flags,
                    in wstring button2Title,
                    in wstring checkMsg,
                    inout boolean checkValue,
                    out PRInt32 buttonPressed);

     boolean prompt(in wstring dialogTitle,
                    in wstring text,
                    inout wstring value, 
                    in wstring checkMsg,
                    inout boolean checkValue);

     boolean promptPassword(in wstring dialogTitle,
                            in wstring text,
                            inout wstring password,
                            in wstring checkMsg,
                            inout boolean checkValue);
 
     boolean promptUsernameAndPassword(in wstring dialogTitle,
                                       in wstring text,
                                       inout wstring username,
                                       inout wstring password,
                                       in wstring checkMsg,
                                       inout boolean checkValue);
    
    boolean select(in wstring dialogTitle,
                   in wstring text,
                   in  PRUint32 count,
                   [array, size_is(count)] in wstring selectList,
                   out long outSelection);
};
