nsITaskbarProgress.idl 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #include "nsISupports.idl"
  7. #include "nsIBaseWindow.idl"
  8. typedef long nsTaskbarProgressState;
  9. /**
  10. * Starting in Windows 7, applications can display a progress notification in
  11. * the taskbar. This class wraps around the native functionality to do this.
  12. */
  13. [scriptable, uuid(23ac257d-ef3c-4033-b424-be7fef91a86c)]
  14. interface nsITaskbarProgress : nsISupports
  15. {
  16. /**
  17. * Stop displaying progress on the taskbar button. This should be used when
  18. * the operation is complete or cancelled.
  19. */
  20. const nsTaskbarProgressState STATE_NO_PROGRESS = 0;
  21. /**
  22. * Display a cycling, indeterminate progress bar.
  23. */
  24. const nsTaskbarProgressState STATE_INDETERMINATE = 1;
  25. /**
  26. * Display a determinate, normal progress bar.
  27. */
  28. const nsTaskbarProgressState STATE_NORMAL = 2;
  29. /**
  30. * Display a determinate, error progress bar.
  31. */
  32. const nsTaskbarProgressState STATE_ERROR = 3;
  33. /**
  34. * Display a determinate progress bar indicating that the operation has
  35. * paused.
  36. */
  37. const nsTaskbarProgressState STATE_PAUSED = 4;
  38. /**
  39. * Sets the taskbar progress state and value for this window. The currentValue
  40. * and maxValue parameters are optional and should be supplied when |state|
  41. * is one of STATE_NORMAL, STATE_ERROR or STATE_PAUSED.
  42. *
  43. * @throws NS_ERROR_INVALID_ARG if state is STATE_NO_PROGRESS or
  44. * STATE_INDETERMINATE, and either currentValue or maxValue is not 0.
  45. * @throws NS_ERROR_ILLEGAL_VALUE if currentValue is greater than maxValue.
  46. */
  47. void setProgressState(in nsTaskbarProgressState state,
  48. [optional] in unsigned long long currentValue,
  49. [optional] in unsigned long long maxValue);
  50. };