merge the formfield patch from ooo-build
[ooovba.git] / extensions / source / plugin / inc / plugin / plcom.hxx
bloba3395d1f93d37a3d2f11ef8c630f78d8f3dcf85d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: plcom.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __PLUGIN_INC_PLCOM_HXX
31 #define __PLUGIN_INC_PLCOM_HXX
33 #include <tools/string.hxx>
34 #include <list>
36 class XPlugin_Impl;
38 class PluginComm
40 protected:
41 int m_nRefCount;
42 ::rtl::OString m_aLibName;
43 std::list< String > m_aFilesToDelete;
44 public:
45 PluginComm( const ::rtl::OString& rLibName, bool bReusable = true );
46 virtual ~PluginComm();
48 int getRefCount() { return m_nRefCount; }
49 void addRef() { m_nRefCount++; }
50 void decRef() { m_nRefCount--; if( ! m_nRefCount ) delete this; }
52 const ::rtl::OString& getLibName() { return m_aLibName; }
53 void setLibName( const ::rtl::OString& rName ) { m_aLibName = rName; }
55 void addFileToDelete( const String& filename )
56 { m_aFilesToDelete.push_back( filename ); }
58 virtual NPError NPP_Destroy( NPP instance, NPSavedData** save ) = 0;
59 virtual NPError NPP_DestroyStream( NPP instance, NPStream* stream,
60 NPError reason ) = 0;
61 virtual void* NPP_GetJavaClass() = 0;
62 virtual NPError NPP_Initialize() = 0;
63 virtual NPError NPP_New( NPMIMEType pluginType, NPP instance,
64 uint16 mode, int16 argc,
65 char* argn[], char* argv[],
66 NPSavedData *saved ) = 0;
67 virtual NPError NPP_NewStream( NPP instance, NPMIMEType type,
68 NPStream* stream,
69 NPBool seekable, uint16* stype ) = 0;
70 virtual void NPP_Print( NPP instance, NPPrint* platformPrint ) = 0;
71 virtual NPError NPP_SetWindow( NPP instance, NPWindow* window ) = 0;
72 virtual void NPP_Shutdown() = 0;
73 virtual void NPP_StreamAsFile( NPP instance, NPStream* stream,
74 const char* fname ) = 0;
75 virtual void NPP_URLNotify( NPP instance, const char* url,
76 NPReason reason, void* notifyData ) = 0;
77 virtual int32 NPP_Write( NPP instance, NPStream* stream, int32 offset,
78 int32 len, void* buffer ) = 0;
79 virtual int32 NPP_WriteReady( NPP instance, NPStream* stream ) = 0;
80 virtual NPError NPP_GetValue( NPP instance, NPPVariable variable, void* value ) = 0;
81 virtual NPError NPP_SetValue( NPP instance, NPNVariable variable,
82 void *value) = 0;
84 virtual NPError NPP_SetWindow( XPlugin_Impl* );
85 virtual NPError NPP_Destroy( XPlugin_Impl*, NPSavedData** save );
88 #endif