2001-09-25 01:32:19 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
1999-01-12 08:45:23 +00:00
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* The contents of this file are subject to the Netscape Public License
|
|
|
|
* Version 1.1 (the "License"); you may not use this file except in
|
|
|
|
* compliance with the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/NPL/
|
1999-01-12 08:45:23 +00:00
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
1999-01-12 08:45:23 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Mozilla Communicator client code.
|
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
1999-11-06 03:40:37 +00:00
|
|
|
*
|
2001-09-25 01:32:19 +00:00
|
|
|
* Contributor(s):
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the NPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the NPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
1999-01-12 08:45:23 +00:00
|
|
|
#ifndef nsDOMAttribute_h___
|
|
|
|
#define nsDOMAttribute_h___
|
|
|
|
|
2003-01-22 03:25:51 +00:00
|
|
|
#include "nsIAttribute.h"
|
1999-01-12 08:45:23 +00:00
|
|
|
#include "nsIDOMAttr.h"
|
|
|
|
#include "nsIDOMText.h"
|
|
|
|
#include "nsIDOMNodeList.h"
|
1999-01-19 16:58:45 +00:00
|
|
|
#include "nsGenericDOMNodeList.h"
|
1999-01-12 08:45:23 +00:00
|
|
|
#include "nsString.h"
|
2000-06-23 00:21:32 +00:00
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsINodeInfo.h"
|
2003-06-16 11:17:18 +00:00
|
|
|
#include "nsIDOM3Node.h"
|
1999-01-12 08:45:23 +00:00
|
|
|
|
|
|
|
class nsIContent;
|
|
|
|
class nsDOMAttribute;
|
|
|
|
|
|
|
|
// bogus child list for an attribute
|
1999-01-19 16:58:45 +00:00
|
|
|
class nsAttributeChildList : public nsGenericDOMNodeList
|
1999-01-12 08:45:23 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsAttributeChildList(nsDOMAttribute* aAttribute);
|
1999-02-12 17:45:58 +00:00
|
|
|
virtual ~nsAttributeChildList();
|
1999-01-12 08:45:23 +00:00
|
|
|
|
|
|
|
// interface nsIDOMNodeList
|
|
|
|
NS_IMETHOD GetLength(PRUint32* aLength);
|
|
|
|
NS_IMETHOD Item(PRUint32 aIndex, nsIDOMNode** aReturn);
|
|
|
|
|
|
|
|
void DropReference();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsDOMAttribute* mAttribute;
|
|
|
|
};
|
|
|
|
|
|
|
|
// Attribute helper class used to wrap up an attribute with a dom
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
// object that implements nsIDOMAttr and nsIDOMNode
|
|
|
|
class nsDOMAttribute : public nsIDOMAttr,
|
|
|
|
public nsIDOM3Node,
|
2003-01-22 03:25:51 +00:00
|
|
|
public nsIAttribute
|
1999-01-12 08:45:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2000-06-23 00:21:32 +00:00
|
|
|
nsDOMAttribute(nsIContent* aContent, nsINodeInfo *aNodeInfo,
|
2002-03-23 23:54:46 +00:00
|
|
|
const nsAString& aValue);
|
1999-02-12 17:45:58 +00:00
|
|
|
virtual ~nsDOMAttribute();
|
1999-01-12 08:45:23 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
// nsIDOMNode interface
|
|
|
|
NS_DECL_NSIDOMNODE
|
|
|
|
|
|
|
|
// nsIDOM3Node interface
|
|
|
|
NS_DECL_NSIDOM3NODE
|
1999-01-12 08:45:23 +00:00
|
|
|
|
|
|
|
// nsIDOMAttr interface
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 16:46:42 +00:00
|
|
|
NS_DECL_NSIDOMATTR
|
2004-01-24 00:46:17 +00:00
|
|
|
|
2003-01-22 03:25:51 +00:00
|
|
|
// nsIAttribute interface
|
2004-01-24 00:46:17 +00:00
|
|
|
// No methods, all inline.
|
1999-01-12 08:45:23 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsString mValue;
|
|
|
|
// XXX For now, there's only a single child - a text
|
|
|
|
// element representing the value
|
|
|
|
nsIDOMText* mChild;
|
|
|
|
nsAttributeChildList* mChildList;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* nsDOMAttribute_h___ */
|