michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsITreeColumns; michael@0: interface nsIDOMElement; michael@0: interface nsIAtom; michael@0: michael@0: [scriptable, uuid(ae835ecf-6b32-4660-9b43-8a270df56e02)] michael@0: interface nsITreeColumn : nsISupports michael@0: { michael@0: readonly attribute nsIDOMElement element; michael@0: michael@0: readonly attribute nsITreeColumns columns; michael@0: michael@0: readonly attribute long x; michael@0: readonly attribute long width; michael@0: michael@0: readonly attribute AString id; michael@0: [noscript] void getIdConst([shared] out wstring idConst); michael@0: [noscript] readonly attribute nsIAtom atom; michael@0: michael@0: readonly attribute long index; michael@0: michael@0: readonly attribute boolean primary; michael@0: readonly attribute boolean cycler; michael@0: readonly attribute boolean editable; michael@0: readonly attribute boolean selectable; michael@0: michael@0: const short TYPE_TEXT = 1; michael@0: const short TYPE_CHECKBOX = 2; michael@0: const short TYPE_PROGRESSMETER = 3; michael@0: readonly attribute short type; michael@0: michael@0: nsITreeColumn getNext(); michael@0: nsITreeColumn getPrevious(); michael@0: michael@0: void invalidate(); michael@0: }; michael@0: michael@0: interface nsITreeBoxObject; michael@0: michael@0: [scriptable, uuid(f8a8d6b4-6788-438d-9009-7142798767ab)] michael@0: interface nsITreeColumns : nsISupports michael@0: { michael@0: /** michael@0: * The tree widget for these columns. michael@0: */ michael@0: readonly attribute nsITreeBoxObject tree; michael@0: michael@0: /** michael@0: * The number of columns. michael@0: */ michael@0: readonly attribute long count; michael@0: michael@0: /** michael@0: * An alias for count (for the benefit of scripts which treat this as an michael@0: * array). michael@0: */ michael@0: readonly attribute long length; michael@0: michael@0: /** michael@0: * Get the first/last column. michael@0: */ michael@0: nsITreeColumn getFirstColumn(); michael@0: nsITreeColumn getLastColumn(); michael@0: michael@0: /** michael@0: * Attribute based column getters. michael@0: */ michael@0: nsITreeColumn getPrimaryColumn(); michael@0: nsITreeColumn getSortedColumn(); michael@0: nsITreeColumn getKeyColumn(); michael@0: michael@0: /** michael@0: * Get the column for the given element. michael@0: */ michael@0: nsITreeColumn getColumnFor(in nsIDOMElement element); michael@0: michael@0: /** michael@0: * Parametric column getters. michael@0: */ michael@0: nsITreeColumn getNamedColumn(in AString id); michael@0: nsITreeColumn getColumnAt(in long index); michael@0: michael@0: /** michael@0: * This method is called whenever a treecol is added or removed and michael@0: * the column cache needs to be rebuilt. michael@0: */ michael@0: void invalidateColumns(); michael@0: michael@0: void restoreNaturalOrder(); michael@0: };