nsTreeUtils.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  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. #ifndef nsTreeUtils_h__
  6. #define nsTreeUtils_h__
  7. #include "nsError.h"
  8. #include "nsString.h"
  9. #include "nsTreeStyleCache.h"
  10. class nsIAtom;
  11. class nsIContent;
  12. class nsTreeUtils
  13. {
  14. public:
  15. /**
  16. * Parse a whitespace separated list of properties into an array
  17. * of atoms.
  18. */
  19. static nsresult
  20. TokenizeProperties(const nsAString& aProperties, AtomArray & aPropertiesArray);
  21. static nsIContent*
  22. GetImmediateChild(nsIContent* aContainer, nsIAtom* aTag);
  23. static nsIContent*
  24. GetDescendantChild(nsIContent* aContainer, nsIAtom* aTag);
  25. static nsresult
  26. UpdateSortIndicators(nsIContent* aColumn, const nsAString& aDirection);
  27. static nsresult
  28. GetColumnIndex(nsIContent* aColumn, int32_t* aResult);
  29. };
  30. #endif // nsTreeUtils_h__