1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 /**
39 * @status UNDER_REVIEW
40 */
41
42 /**
43 * This is the prompt interface which can be used without knowlege of a
44 * parent window. The parentage is hidden by the GetInterface though
45 * which it is gotten. This interface is identical to nsIPromptService
46 * but without the parent nsIDOMWindow parameter. See nsIPromptService
47 * for all documentation.
48 *
49 * Accesskeys can be attached to buttons and checkboxes by inserting
50 * an & before the accesskey character. For a real &, use && instead.
51 */
52
53 #include "nsISupports.idl"
54
55 [scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)]
56 interface nsIPrompt : nsISupports
57 {
58 void alert(in wstring dialogTitle,
59 in wstring text);
60
61 void alertCheck(in wstring dialogTitle,
62 in wstring text,
63 in wstring checkMsg,
64 inout boolean checkValue);
65
66 boolean confirm(in wstring dialogTitle,
67 in wstring text);
68
69 boolean confirmCheck(in wstring dialogTitle,
70 in wstring text,
71 in wstring checkMsg,
72 inout boolean checkValue);
73
74 const unsigned long BUTTON_POS_0 = 1;
75 const unsigned long BUTTON_POS_1 = 1 << 8;
76 const unsigned long BUTTON_POS_2 = 1 << 16;
77
78 const unsigned long BUTTON_TITLE_OK = 1;
79 const unsigned long BUTTON_TITLE_CANCEL = 2;
80 const unsigned long BUTTON_TITLE_YES = 3;
81 const unsigned long BUTTON_TITLE_NO = 4;
82 const unsigned long BUTTON_TITLE_SAVE = 5;
83 const unsigned long BUTTON_TITLE_DONT_SAVE = 6;
84 const unsigned long BUTTON_TITLE_REVERT = 7;
85
86 const unsigned long BUTTON_TITLE_IS_STRING = 127;
87
88 const unsigned long BUTTON_POS_0_DEFAULT = 0 << 24;
89 const unsigned long BUTTON_POS_1_DEFAULT = 1 << 24;
90 const unsigned long BUTTON_POS_2_DEFAULT = 2 << 24;
91
92 /* used for security dialogs, buttons are initially disabled */
93 const unsigned long BUTTON_DELAY_ENABLE = 1 << 26;
94
95 const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) +
96 (BUTTON_TITLE_CANCEL * BUTTON_POS_1);
97 const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) +
98 (BUTTON_TITLE_NO * BUTTON_POS_1);
99
100 PRInt32 confirmEx(in wstring dialogTitle,
101 in wstring text,
102 in unsigned long buttonFlags,
103 in wstring button0Title,
104 in wstring button1Title,
105 in wstring button2Title,
106 in wstring checkMsg,
107 inout boolean checkValue);
108
109 boolean prompt(in wstring dialogTitle,
110 in wstring text,
111 inout wstring value,
112 in wstring checkMsg,
113 inout boolean checkValue);
114
115 boolean promptPassword(in wstring dialogTitle,
116 in wstring text,
117 inout wstring password,
118 in wstring checkMsg,
119 inout boolean checkValue);
120
121 boolean promptUsernameAndPassword(in wstring dialogTitle,
122 in wstring text,
123 inout wstring username,
124 inout wstring password,
125 in wstring checkMsg,
126 inout boolean checkValue);
127
128 boolean select(in wstring dialogTitle,
129 in wstring text,
130 in PRUint32 count,
131 [array, size_is(count)] in wstring selectList,
132 out long outSelection);
133 };