nsTreeUtils.h (1306B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 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 7 #ifndef nsTreeUtils_h__ 8 #define nsTreeUtils_h__ 9 10 #include "mozilla/AtomArray.h" 11 #include "nsError.h" 12 #include "nsString.h" 13 #include "nsTreeStyleCache.h" 14 15 class nsAtom; 16 class nsIContent; 17 namespace mozilla { 18 namespace dom { 19 class Element; 20 } 21 } // namespace mozilla 22 23 class nsTreeUtils { 24 public: 25 /** 26 * Parse a whitespace separated list of properties into an array 27 * of atoms. 28 */ 29 static nsresult TokenizeProperties(const nsAString& aProperties, 30 mozilla::AtomArray& aPropertiesArray); 31 32 static nsIContent* GetImmediateChild(nsIContent* aContainer, nsAtom* aTag); 33 34 static nsIContent* GetDescendantChild(nsIContent* aContainer, nsAtom* aTag); 35 36 static nsresult UpdateSortIndicators(mozilla::dom::Element* aColumn, 37 const nsAString& aDirection); 38 39 static nsresult GetColumnIndex(mozilla::dom::Element* aColumn, 40 int32_t* aResult); 41 }; 42 43 #endif // nsTreeUtils_h__