1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/public/nsIAccessibleHyperText.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 +#include "nsIAccessibleHyperLink.idl" 1.12 + 1.13 +/** 1.14 + * A cross-platform interface that deals with text which contains hyperlinks. 1.15 + * Each link is an embedded object representing exactly 1 character within 1.16 + * the hypertext. 1.17 + * 1.18 + * Current implementation assumes every embedded object is a link. 1.19 + */ 1.20 + 1.21 +[scriptable, uuid(b33684e2-090c-4e1d-a3d9-f4b46f4237b9)] 1.22 +interface nsIAccessibleHyperText : nsISupports 1.23 +{ 1.24 + /** 1.25 + * Return the number of links contained within this hypertext object. 1.26 + */ 1.27 + readonly attribute long linkCount; 1.28 + 1.29 + /** 1.30 + * Return link accessible at the given index. 1.31 + * 1.32 + * @param index [in] 0-based index of the link that is to be retrieved 1.33 + * 1.34 + * @return link accessible or null if there is no link at that index 1.35 + */ 1.36 + nsIAccessibleHyperLink getLinkAt(in long index); 1.37 + 1.38 + /** 1.39 + * Return index of the given link. 1.40 + * 1.41 + * @param link [in] link accessible the index is requested for 1.42 + * 1.43 + * @return index of the given link or null if there's no link within 1.44 + * hypertext accessible 1.45 + */ 1.46 + long getLinkIndex(in nsIAccessibleHyperLink link); 1.47 + 1.48 + /* 1.49 + * Return link index at the given offset within hypertext accessible. 1.50 + * 1.51 + * @param offset [in] the 0-based character index 1.52 + * 1.53 + * @return 0-based link's index or -1 if no link is present at that 1.54 + * offset 1.55 + */ 1.56 + long getLinkIndexAtOffset(in long offset); 1.57 +};