1563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark/*
2563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
3563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark *
4563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * Redistribution and use in source and binary forms, with or without
5563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * modification, are permitted provided that the following conditions
6563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * are met:
7563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 1. Redistributions of source code must retain the above copyright
8563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark *    notice, this list of conditions and the following disclaimer.
9563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * 2. Redistributions in binary form must reproduce the above copyright
10563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark *    notice, this list of conditions and the following disclaimer in the
11563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark *    documentation and/or other materials provided with the distribution.
12563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark *
13563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark */
25563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark
26563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#include <WebKit/npfunctions.h>
27563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark
28563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkextern NPNetscapeFuncs *browser;
29563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark
30563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarktypedef struct {
31563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPObject header;
32563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark
33563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPP npp;
34563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPBool eventLogging;
35563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPBool logSetWindow;
36563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPBool logDestroy;
37563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPBool returnErrorFromNewStream;
38cac0f67c402d107cdb10971b95719e2ff9c7c76bSteve Block    NPBool cachedPrivateBrowsingMode;
39563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPObject* testObject;
40563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPStream* stream;
41643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    NPBool testDocumentOpenInDestroyStream;
42643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    NPBool testWindowOpen;
43563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* onStreamLoad;
44563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* onStreamDestroy;
45643ca7872b450ea4efacab6188849e5aac2ba161Steve Block    char* onDestroy;
46563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* onURLNotify;
47563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* firstUrl;
48563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* firstHeaders;
49563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* lastUrl;
50563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    char* lastHeaders;
51563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#ifdef XP_MACOSX
52563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark    NPEventModel eventModel;
53563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark#endif
54563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark} PluginObject;
55563af33bc48281d19dce701398dbb88cb54fd7ecCary Clark
56563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkextern NPClass *getPluginClass(void);
57563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkextern void handleCallback(PluginObject* object, const char *url, NPReason reason, void *notifyData);
58563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkextern void notifyStream(PluginObject* object, const char *url, const char *headers);
59563af33bc48281d19dce701398dbb88cb54fd7ecCary Clarkextern void testNPRuntime(NPP npp);
600bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5Ben Murdochextern void pluginLog(NPP instance, const char* format, ...);
61643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockextern bool testDocumentOpen(NPP npp);
62643ca7872b450ea4efacab6188849e5aac2ba161Steve Blockextern bool testWindowOpen(NPP npp);
63