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"
|
|
|
|
|
2013-03-17 00:55:15 -07:00
|
|
|
class nsIObjectInputStream;
|
|
|
|
class nsIObjectOutputStream;
|
2013-08-09 09:25:13 -07:00
|
|
|
class nsIScriptContext;
|
2007-09-28 06:45:01 -07:00
|
|
|
class nsIURI;
|
|
|
|
|
|
|
|
class nsXBLProtoImplField
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2014-01-04 07:02:17 -08:00
|
|
|
nsXBLProtoImplField(const char16_t* aName, const char16_t* 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; }
|
|
|
|
|
2014-03-19 05:09:33 -07:00
|
|
|
nsresult InstallField(JS::Handle<JSObject*> aBoundNode,
|
2007-10-02 07:38:35 -07:00
|
|
|
nsIURI* aBindingDocURI,
|
2011-09-28 23:19:26 -07:00
|
|
|
bool* aDidInstall) const;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2013-02-08 06:24:21 -08:00
|
|
|
nsresult InstallAccessors(JSContext* aCx,
|
2013-04-05 06:21:02 -07:00
|
|
|
JS::Handle<JSObject*> aTargetClassObject);
|
2013-02-08 06:24:21 -08:00
|
|
|
|
2013-08-09 09:25:13 -07:00
|
|
|
nsresult Read(nsIObjectInputStream* aStream);
|
|
|
|
nsresult Write(nsIObjectOutputStream* aStream);
|
2011-11-03 13:39:08 -07:00
|
|
|
|
2014-01-04 07:02:17 -08:00
|
|
|
const char16_t* 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 |
|
2013-02-13 10:16:19 -08:00
|
|
|
(mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
|
2012-05-29 12:01:30 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2014-01-04 07:02:17 -08:00
|
|
|
char16_t* mName;
|
|
|
|
char16_t* 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__
|