nsIPrompt.idl 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /**
  6. * This is the prompt interface which can be used without knowlege of a
  7. * parent window. The parentage is hidden by the GetInterface though
  8. * which it is gotten. This interface is identical to nsIPromptService
  9. * but without the parent nsIDOMWindow parameter. See nsIPromptService
  10. * for all documentation.
  11. *
  12. * Accesskeys can be attached to buttons and checkboxes by inserting
  13. * an & before the accesskey character. For a real &, use && instead.
  14. */
  15. #include "nsISupports.idl"
  16. [scriptable, uuid(a63f70c0-148b-11d3-9333-00104ba0fd40)]
  17. interface nsIPrompt : nsISupports
  18. {
  19. void alert(in wstring dialogTitle,
  20. in wstring text);
  21. void alertCheck(in wstring dialogTitle,
  22. in wstring text,
  23. in wstring checkMsg,
  24. inout boolean checkValue);
  25. boolean confirm(in wstring dialogTitle,
  26. in wstring text);
  27. boolean confirmCheck(in wstring dialogTitle,
  28. in wstring text,
  29. in wstring checkMsg,
  30. inout boolean checkValue);
  31. const unsigned long BUTTON_POS_0 = 1;
  32. const unsigned long BUTTON_POS_1 = 1 << 8;
  33. const unsigned long BUTTON_POS_2 = 1 << 16;
  34. const unsigned long BUTTON_TITLE_OK = 1;
  35. const unsigned long BUTTON_TITLE_CANCEL = 2;
  36. const unsigned long BUTTON_TITLE_YES = 3;
  37. const unsigned long BUTTON_TITLE_NO = 4;
  38. const unsigned long BUTTON_TITLE_SAVE = 5;
  39. const unsigned long BUTTON_TITLE_DONT_SAVE = 6;
  40. const unsigned long BUTTON_TITLE_REVERT = 7;
  41. const unsigned long BUTTON_TITLE_IS_STRING = 127;
  42. const unsigned long BUTTON_POS_0_DEFAULT = 0 << 24;
  43. const unsigned long BUTTON_POS_1_DEFAULT = 1 << 24;
  44. const unsigned long BUTTON_POS_2_DEFAULT = 2 << 24;
  45. /* used for security dialogs, buttons are initially disabled */
  46. const unsigned long BUTTON_DELAY_ENABLE = 1 << 26;
  47. const unsigned long STD_OK_CANCEL_BUTTONS = (BUTTON_TITLE_OK * BUTTON_POS_0) +
  48. (BUTTON_TITLE_CANCEL * BUTTON_POS_1);
  49. const unsigned long STD_YES_NO_BUTTONS = (BUTTON_TITLE_YES * BUTTON_POS_0) +
  50. (BUTTON_TITLE_NO * BUTTON_POS_1);
  51. int32_t confirmEx(in wstring dialogTitle,
  52. in wstring text,
  53. in unsigned long buttonFlags,
  54. in wstring button0Title,
  55. in wstring button1Title,
  56. in wstring button2Title,
  57. in wstring checkMsg,
  58. inout boolean checkValue);
  59. boolean prompt(in wstring dialogTitle,
  60. in wstring text,
  61. inout wstring value,
  62. in wstring checkMsg,
  63. inout boolean checkValue);
  64. boolean promptPassword(in wstring dialogTitle,
  65. in wstring text,
  66. inout wstring password,
  67. in wstring checkMsg,
  68. inout boolean checkValue);
  69. boolean promptUsernameAndPassword(in wstring dialogTitle,
  70. in wstring text,
  71. inout wstring username,
  72. inout wstring password,
  73. in wstring checkMsg,
  74. inout boolean checkValue);
  75. boolean select(in wstring dialogTitle,
  76. in wstring text,
  77. in uint32_t count,
  78. [array, size_is(count)] in wstring selectList,
  79. out long outSelection);
  80. };