2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsXBLProtoImplField_h__
|
|
|
|
#define nsXBLProtoImplField_h__
|
|
|
|
|
|
|
|
#include "nsIAtom.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsXBLProtoImplMember.h"
|
|
|
|
|
2007-09-28 06:45:01 -07:00
|
|
|
class nsIURI;
|
|
|
|
|
|
|
|
class nsXBLProtoImplField
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsXBLProtoImplField(const PRUnichar* aName, const PRUnichar* aReadOnly);
|
2011-11-03 13:39:08 -07:00
|
|
|
nsXBLProtoImplField(const bool aIsReadOnly);
|
2007-09-28 06:45:01 -07:00
|
|
|
~nsXBLProtoImplField();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
void AppendFieldText(const nsAString& aText);
|
2012-08-22 08:56:38 -07:00
|
|
|
void SetLineNumber(uint32_t aLineNumber) {
|
2007-03-22 10:30:00 -07:00
|
|
|
mLineNumber = aLineNumber;
|
|
|
|
}
|
|
|
|
|
2007-09-28 06:45:01 -07:00
|
|
|
nsXBLProtoImplField* GetNext() const { return mNext; }
|
|
|
|
void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
|
|
|
|
|
|
|
|
nsresult InstallField(nsIScriptContext* aContext,
|
2007-10-02 07:38:35 -07:00
|
|
|
JSObject* aBoundNode,
|
|
|
|
nsIURI* aBindingDocURI,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool* aDidInstall) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-11-03 13:39:08 -07:00
|
|
|
nsresult Read(nsIScriptContext* aContext, nsIObjectInputStream* aStream);
|
|
|
|
nsresult Write(nsIScriptContext* aContext, nsIObjectOutputStream* aStream);
|
|
|
|
|
2007-09-28 06:45:01 -07:00
|
|
|
const PRUnichar* GetName() const { return mName; }
|
2007-05-24 07:10:02 -07:00
|
|
|
|
2012-05-29 12:01:30 -07:00
|
|
|
unsigned AccessorAttributes() const {
|
|
|
|
return JSPROP_SHARED | JSPROP_GETTER | JSPROP_SETTER |
|
|
|
|
(mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsEmpty() const { return mFieldTextLength == 0; }
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
protected:
|
2007-09-28 06:45:01 -07:00
|
|
|
nsXBLProtoImplField* mNext;
|
|
|
|
PRUnichar* mName;
|
2007-03-22 10:30:00 -07:00
|
|
|
PRUnichar* mFieldText;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mFieldTextLength;
|
|
|
|
uint32_t mLineNumber;
|
2012-02-28 15:11:11 -08:00
|
|
|
unsigned mJSAttributes;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsXBLProtoImplField_h__
|