1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/xul/templates/public/nsIXULSortService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,42 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIDOMNode; 1.12 + 1.13 +/** 1.14 + * A service used to sort the contents of a XUL widget. 1.15 + */ 1.16 +[scriptable, uuid(F29270C8-3BE5-4046-9B57-945A84DFF132)] 1.17 +interface nsIXULSortService : nsISupports 1.18 +{ 1.19 + const unsigned long SORT_COMPARECASE = 0x0001; 1.20 + const unsigned long SORT_INTEGER = 0x0100; 1.21 + 1.22 + /** 1.23 + * Sort the contents of the widget containing <code>aNode</code> 1.24 + * using <code>aSortKey</code> as the comparison key, and 1.25 + * <code>aSortDirection</code> as the direction. 1.26 + * 1.27 + * @param aNode A node in the XUL widget whose children are to be sorted. 1.28 + * @param aSortKey The value to be used as the comparison key. 1.29 + * @param aSortHints One or more hints as to how to sort: 1.30 + * 1.31 + * ascending: to sort the contents in ascending order 1.32 + * descending: to sort the contents in descending order 1.33 + * comparecase: perform case sensitive comparisons 1.34 + * integer: treat values as integers, non-integers are compared as strings 1.35 + * twostate: don't allow the natural (unordered state) 1.36 + */ 1.37 + void sort(in nsIDOMNode aNode, 1.38 + in AString aSortKey, 1.39 + in AString aSortHints); 1.40 +}; 1.41 + 1.42 +%{C++ 1.43 +nsresult 1.44 +NS_NewXULSortService(nsIXULSortService **result); 1.45 +%}