michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /** michael@0: * This is the prompt interface which can be used without knowlege of a michael@0: * parent window. The parentage is hidden by the GetInterface though michael@0: * which it is gotten. This interface is identical to nsIPromptService michael@0: * but without the parent nsIDOMWindow parameter. See nsIPromptService michael@0: * for all documentation. michael@0: * michael@0: * Accesskeys can be attached to buttons and checkboxes by inserting michael@0: * an & before the accesskey character. For a real &, use && instead. michael@0: */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)] michael@0: interface nsIPrompt : nsISupports michael@0: { michael@0: void alert(in wstring dialogTitle, michael@0: in wstring text); michael@0: michael@0: void alertCheck(in wstring dialogTitle, michael@0: in wstring text, michael@0: in wstring checkMsg, michael@0: inout boolean checkValue); michael@0: michael@0: boolean confirm(in wstring dialogTitle, michael@0: in wstring text); michael@0: michael@0: boolean confirmCheck(in wstring dialogTitle, michael@0: in wstring text, michael@0: in wstring checkMsg, michael@0: inout boolean checkValue); michael@0: michael@0: const unsigned long BUTTON_POS_0 = 1; michael@0: const unsigned long BUTTON_POS_1 = 1 << 8; michael@0: const unsigned long BUTTON_POS_2 = 1 << 16; michael@0: michael@0: const unsigned long BUTTON_TITLE_OK = 1; michael@0: const unsigned long BUTTON_TITLE_CANCEL = 2; michael@0: const unsigned long BUTTON_TITLE_YES = 3; michael@0: const unsigned long BUTTON_TITLE_NO = 4; michael@0: const unsigned long BUTTON_TITLE_SAVE = 5; michael@0: const unsigned long BUTTON_TITLE_DONT_SAVE = 6; michael@0: const unsigned long BUTTON_TITLE_REVERT = 7; michael@0: michael@0: const unsigned long BUTTON_TITLE_IS_STRING = 127; michael@0: michael@0: const unsigned long BUTTON_POS_0_DEFAULT = 0 << 24; michael@0: const unsigned long BUTTON_POS_1_DEFAULT = 1 << 24; michael@0: const unsigned long BUTTON_POS_2_DEFAULT = 2 << 24; michael@0: michael@0: /* used for security dialogs, buttons are initially disabled */ michael@0: const unsigned long BUTTON_DELAY_ENABLE = 1 << 26; michael@0: michael@0: const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) + michael@0: (BUTTON_TITLE_CANCEL * BUTTON_POS_1); michael@0: const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) + michael@0: (BUTTON_TITLE_NO * BUTTON_POS_1); michael@0: michael@0: int32_t confirmEx(in wstring dialogTitle, michael@0: in wstring text, michael@0: in unsigned long buttonFlags, michael@0: in wstring button0Title, michael@0: in wstring button1Title, michael@0: in wstring button2Title, michael@0: in wstring checkMsg, michael@0: inout boolean checkValue); michael@0: michael@0: boolean prompt(in wstring dialogTitle, michael@0: in wstring text, michael@0: inout wstring value, michael@0: in wstring checkMsg, michael@0: inout boolean checkValue); michael@0: michael@0: boolean promptPassword(in wstring dialogTitle, michael@0: in wstring text, michael@0: inout wstring password, michael@0: in wstring checkMsg, michael@0: inout boolean checkValue); michael@0: michael@0: boolean promptUsernameAndPassword(in wstring dialogTitle, michael@0: in wstring text, michael@0: inout wstring username, michael@0: inout wstring password, michael@0: in wstring checkMsg, michael@0: inout boolean checkValue); michael@0: michael@0: boolean select(in wstring dialogTitle, michael@0: in wstring text, michael@0: in uint32_t count, michael@0: [array, size_is(count)] in wstring selectList, michael@0: out long outSelection); michael@0: };