nsIXULSortService.idl 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* -*- Mode: C++; tab-width: 4; 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. #include "nsISupports.idl"
  6. interface nsIDOMNode;
  7. /**
  8. * A service used to sort the contents of a XUL widget.
  9. */
  10. [scriptable, uuid(F29270C8-3BE5-4046-9B57-945A84DFF132)]
  11. interface nsIXULSortService : nsISupports
  12. {
  13. const unsigned long SORT_COMPARECASE = 0x0001;
  14. const unsigned long SORT_INTEGER = 0x0100;
  15. /**
  16. * Sort the contents of the widget containing <code>aNode</code>
  17. * using <code>aSortKey</code> as the comparison key, and
  18. * <code>aSortDirection</code> as the direction.
  19. *
  20. * @param aNode A node in the XUL widget whose children are to be sorted.
  21. * @param aSortKey The value to be used as the comparison key.
  22. * @param aSortHints One or more hints as to how to sort:
  23. *
  24. * ascending: to sort the contents in ascending order
  25. * descending: to sort the contents in descending order
  26. * comparecase: perform case sensitive comparisons
  27. * integer: treat values as integers, non-integers are compared as strings
  28. * twostate: don't allow the natural (unordered state)
  29. */
  30. void sort(in nsIDOMNode aNode,
  31. in AString aSortKey,
  32. in AString aSortHints);
  33. };
  34. %{C++
  35. nsresult
  36. NS_NewXULSortService(nsIXULSortService **result);
  37. %}