Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*************************************************************************
3 : *
4 : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : *
6 : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : *
8 : * OpenOffice.org - a multi-platform office productivity suite
9 : *
10 : * This file is part of OpenOffice.org.
11 : *
12 : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : * it under the terms of the GNU Lesser General Public License version 3
14 : * only, as published by the Free Software Foundation.
15 : *
16 : * OpenOffice.org is distributed in the hope that it will be useful,
17 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : * GNU Lesser General Public License version 3 for more details
20 : * (a copy is included in the LICENSE file that accompanied this code).
21 : *
22 : * You should have received a copy of the GNU Lesser General Public License
23 : * version 3 along with OpenOffice.org. If not, see
24 : * <http://www.openoffice.org/license.html>
25 : * for a copy of the LGPLv3 License.
26 : *
27 : ************************************************************************/
28 : #ifndef INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_PLCOM_HXX
29 : #define INCLUDED_EXTENSIONS_SOURCE_PLUGIN_INC_PLUGIN_PLCOM_HXX
30 :
31 : #include <list>
32 :
33 : class XPlugin_Impl;
34 :
35 : class PluginComm
36 : {
37 : protected:
38 : int m_nRefCount;
39 : OString m_aLibName;
40 : std::list< OUString > m_aFilesToDelete;
41 : public:
42 : PluginComm( const OString& rLibName, bool bReusable = true );
43 : virtual ~PluginComm();
44 :
45 : int getRefCount() { return m_nRefCount; }
46 0 : void addRef() { m_nRefCount++; }
47 0 : void decRef() { m_nRefCount--; if( ! m_nRefCount ) delete this; }
48 :
49 0 : const OString& getLibName() { return m_aLibName; }
50 : void setLibName( const OString& rName ) { m_aLibName = rName; }
51 :
52 0 : void addFileToDelete( const OUString& filename )
53 0 : { m_aFilesToDelete.push_back( filename ); }
54 :
55 : virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ) = 0;
56 : virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream,
57 : NPError reason ) = 0;
58 : virtual void* NPP_GetJavaClass() = 0;
59 : virtual NPError NPP_Initialize() = 0;
60 : virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
61 : uint16_t mode, int16_t argc,
62 : char* argn[], char* argv[],
63 : NPSavedData *saved ) = 0;
64 : virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
65 : NPStream* stream,
66 : NPBool seekable, uint16_t* stype ) = 0;
67 : virtual void NPP_Print( NPP instance, NPPrint* platformPrint ) = 0;
68 : virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ) = 0;
69 : virtual void NPP_Shutdown() = 0;
70 : virtual void NPP_StreamAsFile( NPP instance, NPStream* stream,
71 : const char* fname ) = 0;
72 : virtual void NPP_URLNotify( NPP instance, const char* url,
73 : NPReason reason, void* notifyData ) = 0;
74 : virtual int32_t NPP_Write( NPP instance, NPStream* stream, int32_t offset,
75 : int32_t len, void* buffer ) = 0;
76 : virtual int32_t NPP_WriteReady( NPP instance, NPStream* stream ) = 0;
77 : virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void* value ) = 0;
78 : virtual NPError NPP_SetValue( NPP instance, NPNVariable variable,
79 : void *value) = 0;
80 :
81 : NPError NPP_SetWindow( XPlugin_Impl* );
82 : NPError NPP_Destroy( XPlugin_Impl*, NPSavedData** save );
83 : };
84 :
85 : #endif
86 :
87 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|