18e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project/*
28e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *  Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
38e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
48e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * Redistribution and use in source and binary forms, with or without
58e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * modification, are permitted provided that the following conditions
68e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * are met:
78e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
88e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer.
98e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
108e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    notice, this list of conditions and the following disclaimer in the
118e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *    documentation and/or other materials provided with the distribution.
128e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project *
138e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
148e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
158e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
168e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
178e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
188e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
198e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
208e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
218e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
228e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
238e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
248e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project */
258e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
268e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#ifndef _WEB_SCRIPT_OBJECT_PRIVATE_H_
278e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#define _WEB_SCRIPT_OBJECT_PRIVATE_H_
288e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
298e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#import "WebScriptObject.h"
308e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#import <runtime/JSValue.h>
318e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#import <wtf/PassRefPtr.h>
328e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
338e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectnamespace JSC {
348e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
358e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    class JSObject;
368e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
378e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    namespace Bindings {
388e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project        class RootObject;
398e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    }
408e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project}
418e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Projectnamespace WebCore {
428e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    NSObject* getJSWrapper(JSC::JSObject*);
438e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    void addJSWrapper(NSObject* wrapper, JSC::JSObject*);
448e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    void removeJSWrapper(JSC::JSObject*);
458e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    id createJSWrapper(JSC::JSObject*, PassRefPtr<JSC::Bindings::RootObject> origin, PassRefPtr<JSC::Bindings::RootObject> root);
468e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project}
478e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
488e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@interface WebScriptObject (Private)
495f1ab04193ad0130ca8204aadaceae083aca9881Feng Qian+ (id)_convertValueToObjcValue:(JSC::JSValue)value originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
508e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project+ (id)scriptObjectForJSObject:(JSObjectRef)jsObject originRootObject:(JSC::Bindings::RootObject*)originRootObject rootObject:(JSC::Bindings::RootObject*)rootObject;
518e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (id)_init;
528e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (id)_initWithJSObject:(JSC::JSObject*)imp originRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
538e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)_setImp:(JSC::JSObject*)imp originRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject rootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
548e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)_setOriginRootObject:(PassRefPtr<JSC::Bindings::RootObject>)originRootObject andRootObject:(PassRefPtr<JSC::Bindings::RootObject>)rootObject;
558e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (void)_initializeScriptDOMNodeImp;
568e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (JSC::JSObject *)_imp;
578e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (BOOL)_hasImp;
588e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (JSC::Bindings::RootObject*)_rootObject;
598e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project- (JSC::Bindings::RootObject*)_originRootObject;
608e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@end
618e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
62967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch@interface WebScriptObject (StagedForPublic)
63967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch/*!
64967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch @method hasWebScriptKey:
65967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch @param name The name of the property to check for.
66967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch @discussion Checks for the existence of the property on the object in the script environment.
67967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch @result Returns YES if the property exists, NO otherwise.
68967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch */
69967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch- (BOOL)hasWebScriptKey:(NSString *)name;
70967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch@end
71967717af5423377c967781471ee106e2bb4e11c8Ben Murdoch
728e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@interface WebScriptObjectPrivate : NSObject
738e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project{
748e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@public
758e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSC::JSObject *imp;
768e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSC::Bindings::RootObject* rootObject;
778e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    JSC::Bindings::RootObject* originRootObject;
788e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project    BOOL isCreatedByDOMWrapper;
798e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project}
808e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project@end
818e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
828e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project
838e35f3cfc7fba1d1c829dc557ebad6409cbe16a2The Android Open Source Project#endif
84