2001-11-13 07:09:56 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2001-08-28 02:15:45 +04:00
|
|
|
|
2001-11-13 07:09:56 +03:00
|
|
|
#ifndef nsXBLProtoImplField_h__
|
|
|
|
#define nsXBLProtoImplField_h__
|
2001-08-28 02:15:45 +04:00
|
|
|
|
2001-11-13 07:09:56 +03:00
|
|
|
#include "nsIAtom.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "jsapi.h"
|
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsXBLProtoImplMember.h"
|
2001-08-28 02:15:45 +04:00
|
|
|
|
2013-03-17 11:55:15 +04:00
|
|
|
class nsIObjectInputStream;
|
|
|
|
class nsIObjectOutputStream;
|
2013-08-09 20:25:13 +04:00
|
|
|
class nsIScriptContext;
|
2007-09-28 17:45:01 +04:00
|
|
|
class nsIURI;
|
|
|
|
|
|
|
|
class nsXBLProtoImplField
|
2001-08-28 02:15:45 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-01-04 19:02:17 +04:00
|
|
|
nsXBLProtoImplField(const char16_t* aName, const char16_t* aReadOnly);
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit nsXBLProtoImplField(const bool aIsReadOnly);
|
2007-09-28 17:45:01 +04:00
|
|
|
~nsXBLProtoImplField();
|
2001-08-28 02:15:45 +04:00
|
|
|
|
2002-03-24 01:46:13 +03:00
|
|
|
void AppendFieldText(const nsAString& aText);
|
2012-08-22 19:56:38 +04:00
|
|
|
void SetLineNumber(uint32_t aLineNumber) {
|
2003-07-12 02:54:36 +04:00
|
|
|
mLineNumber = aLineNumber;
|
2003-06-24 05:20:40 +04:00
|
|
|
}
|
2001-11-13 07:09:56 +03:00
|
|
|
|
2007-09-28 17:45:01 +04:00
|
|
|
nsXBLProtoImplField* GetNext() const { return mNext; }
|
|
|
|
void SetNext(nsXBLProtoImplField* aNext) { mNext = aNext; }
|
|
|
|
|
2014-03-19 16:09:33 +04:00
|
|
|
nsresult InstallField(JS::Handle<JSObject*> aBoundNode,
|
2007-10-02 18:38:35 +04:00
|
|
|
nsIURI* aBindingDocURI,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool* aDidInstall) const;
|
2001-08-28 02:15:45 +04:00
|
|
|
|
2013-02-08 18:24:21 +04:00
|
|
|
nsresult InstallAccessors(JSContext* aCx,
|
2013-04-05 17:21:02 +04:00
|
|
|
JS::Handle<JSObject*> aTargetClassObject);
|
2013-02-08 18:24:21 +04:00
|
|
|
|
2013-08-09 20:25:13 +04:00
|
|
|
nsresult Read(nsIObjectInputStream* aStream);
|
|
|
|
nsresult Write(nsIObjectOutputStream* aStream);
|
2011-11-04 00:39:08 +04:00
|
|
|
|
2014-01-04 19:02:17 +04:00
|
|
|
const char16_t* GetName() const { return mName; }
|
2007-05-24 18:10:02 +04:00
|
|
|
|
2012-05-29 23:01:30 +04:00
|
|
|
unsigned AccessorAttributes() const {
|
|
|
|
return JSPROP_SHARED | JSPROP_GETTER | JSPROP_SETTER |
|
2013-02-13 22:16:19 +04:00
|
|
|
(mJSAttributes & (JSPROP_ENUMERATE | JSPROP_PERMANENT));
|
2012-05-29 23:01:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
bool IsEmpty() const { return mFieldTextLength == 0; }
|
|
|
|
|
2001-11-13 07:09:56 +03:00
|
|
|
protected:
|
2007-09-28 17:45:01 +04:00
|
|
|
nsXBLProtoImplField* mNext;
|
2014-01-04 19:02:17 +04:00
|
|
|
char16_t* mName;
|
|
|
|
char16_t* mFieldText;
|
2012-08-22 19:56:38 +04:00
|
|
|
uint32_t mFieldTextLength;
|
|
|
|
uint32_t mLineNumber;
|
2012-02-29 03:11:11 +04:00
|
|
|
unsigned mJSAttributes;
|
2001-08-28 02:15:45 +04:00
|
|
|
};
|
|
|
|
|
2001-11-13 07:09:56 +03:00
|
|
|
#endif // nsXBLProtoImplField_h__
|