File: ns4xPluginInstance.h

package info (click to toggle)
mozilla 19981008-0.1
  • links: PTS
  • area: main
  • in suites: slink
  • size: 110,368 kB
  • ctags: 148,791
  • sloc: ansic: 674,811; cpp: 548,132; makefile: 20,384; java: 13,005; sh: 3,638; perl: 2,433; yacc: 1,136; asm: 657; lisp: 148; objc: 51; pascal: 41; awk: 20; sed: 18; xml: 13; csh: 11
file content (145 lines) | stat: -rw-r--r-- 3,686 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * The contents of this file are subject to the Netscape Public License
 * Version 1.0 (the "NPL"); you may not use this file except in
 * compliance with the NPL.  You may obtain a copy of the NPL at
 * http://www.mozilla.org/NPL/
 *
 * Software distributed under the NPL is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
 * for the specific language governing rights and limitations under the
 * NPL.
 *
 * The Initial Developer of this code under the NPL is Netscape
 * Communications Corporation.  Portions created by Netscape are
 * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
 * Reserved.
 */

#ifndef ns4xPluginInstance_h__
#define ns4xPluginInstance_h__

#define _UINT32
#define _INT32

#include "nsplugin.h"
#include "npupp.h"
#include "jri.h"

////////////////////////////////////////////////////////////////////////

class ns4xPluginInstance : public nsIPluginInstance
{
public:

    /**
     * Construct a new 4.x plugin instance with the specified peer
     * and callbacks.
     */
    ns4xPluginInstance(NPPluginFuncs* callbacks);

    // Use Release() to destroy this
    ~ns4xPluginInstance(void);

    NS_DECL_ISUPPORTS

    ////////////////////////////////////////////////////////////////////////
    // nsIPluginInstance methods

    /**
     * Actually initialize the plugin instance. This calls the 4.x <b>newp</b>
     * callback, and may return an error (which is why it is distinct from the
     * constructor.) If an error is returned, the caller should <i>not</i>
     * continue to use the <b>ns4xPluginInstance</b> object.
     */
    NS_METHOD
    Initialize(nsIPluginInstancePeer* peer);

    NS_IMETHOD
    GetPeer(nsIPluginInstancePeer* *resultingPeer);

    NS_IMETHOD
    Start(void);

    NS_IMETHOD
    Stop(void);

    NS_IMETHOD
    Destroy(void);

    NS_IMETHOD
    SetWindow(nsPluginWindow* window);

    NS_IMETHOD
    NewStream(nsIPluginStreamPeer* peer, nsIPluginStream* *result);

    NS_IMETHOD
    Print(nsPluginPrint* platformPrint);

    NS_IMETHOD
    HandleEvent(nsPluginEvent* event, PRBool* handled);

    NS_IMETHOD
    URLNotify(const char* url, const char* target,
              nsPluginReason reason, void* notifyData);

    NS_IMETHOD
    GetValue(nsPluginInstanceVariable variable, void *value);

    ////////////////////////////////////////////////////////////////////////
    // ns4xPluginInstance-specific methods


    /**
     * Return the 4.x-style interface object.
     */
    NS_IMETHOD
    GetNPP(NPP * aNPP) {
        *aNPP = &fNPP;
        return NS_OK;
    };

    /**
     * Return the callbacks for the plugin instance.
     */
    NS_IMETHOD
    GetCallbacks(const NPPluginFuncs ** aCallbacks) {
        *aCallbacks = fCallbacks;
        return NS_OK;
    };

    NS_IMETHOD
    SetWindowless(PRBool aWindowless);

    NS_IMETHOD
    SetTransparent(PRBool aTransparent);

protected:

    /**
     * The plugin instance peer for this instance.
     */
    nsIPluginInstancePeer* fPeer;

    /**
     * A pointer to the plugin's callback functions. This information
     * is actually stored in the plugin class (<b>nsPluginClass</b>),
     * and is common for all plugins of the class.
     */
    NPPluginFuncs* fCallbacks;

    /**
     * The 4.x-style structure used to communicate between the plugin
     * instance and the browser.
     */
    NPP_t fNPP;

    //these are used to store the windowless properties
    //which the browser will later query

    PRBool  mWindowless;
    PRBool  mTransparent;
};


#endif // ns4xPluginInstance_h__