sync master with lastest vba changes
[ooovba.git] / goodies / inc / agsdkdll.hxx
blobeb1b5bf536d125d6018889a32c72680746a37c90
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: agsdkdll.hxx,v $
10 * $Revision: 1.4 $
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 ************************************************************************/
31 #ifndef _AGSDKDLL_HXX
32 #define _AGSDKDLL_HXX
34 #ifndef _SV_CALL
35 #if defined(WIN) || defined(WNT) || ( defined(OS2) && !defined( ICC ))
36 #define _SV_CALL _cdecl
37 #elif defined( ICC ) && defined( OS2 )
38 #define _SV_CALL __cdecl
39 #else
40 #define _SV_CALL
41 #endif
42 #endif
44 #define AGSDKDLL_VERSION 2
46 typedef void* AgentInst;
48 ////////////////////////////////////////////////////////////////////////////////
49 // Channel API Functions
52 enum AgentStreamType {
53 AS_LOCAL_FILE = 1,
54 AS_MEMORY = 2
57 typedef void (_SV_CALL *FncChShutDownAgent)(AgentInst pAg);
59 typedef void (_SV_CALL *FncChSetLastSuccUpd)(AgentInst pAg);
61 typedef void (_SV_CALL *FncChGetChannelObj)(AgentInst pAg, const char* pURL,
62 AgentStreamType eStreamType, const char* pFileName);
64 typedef void (_SV_CALL *FncChAddChannelItem)(AgentInst pAg, const char* pName,
65 const char* pTransmitter, const char* pChannel, unsigned short nUpdPeriode,
66 const char* pAgentName );
68 typedef void (_SV_CALL *FncChDelChannelItem)(AgentInst pAg, const char* pChName);
70 typedef void (_SV_CALL *FncChSetTransmitter)(AgentInst pAg, const char* pChName,
71 const char* pURL);
73 typedef void (_SV_CALL *FncChSetChannel)(AgentInst pAg, const char* pChName,
74 const char* pRelURL);
76 typedef void (_SV_CALL *FncChSetChannelName)(AgentInst pAg, const char* pChName,
77 const char* pNewChName);
79 typedef void (_SV_CALL *FncChSetUpdPeriode)(AgentInst pAg, const char* pChName,
80 unsigned short nUpdPeriode);
82 typedef void (_SV_CALL *FncChSetChannelAgentName)(AgentInst pAg, const char* pChName,
83 const char* pAgName);
85 typedef void (_SV_CALL *FncChSetUpdateTransmitter)(AgentInst pAg,
86 const char* pTransmitter);
88 typedef const char* (_SV_CALL *FncChGetAgentSourceURL)(AgentInst pAg);
90 struct ChannelApiFncs
92 unsigned short nVersion;
93 FncChShutDownAgent fncShutDownAgent;
94 FncChSetLastSuccUpd fncSetLastSuccUpd;
95 FncChGetChannelObj fncGetChannelObj;
96 FncChAddChannelItem fncAddChannelItem;
97 FncChDelChannelItem fncDelChannelItem;
98 FncChSetTransmitter fncSetTransmitter;
99 FncChSetChannel fncSetChannel;
100 FncChSetChannelName fncSetChannelName;
101 FncChSetUpdPeriode fncSetUpdPeriode;
102 FncChSetChannelAgentName fncSetChannelAgentName;
103 FncChSetUpdateTransmitter fncSetUpdateTransmitter;
104 FncChGetAgentSourceURL fncGetAgentSourceURL;
107 ////////////////////////////////////////////////////////////////////////////////
108 // Agent API Functions
111 #if defined(WIN) || defined(WNT) || defined(OS2) || defined(UNX)
112 extern "C" {
113 #endif
115 typedef void (_SV_CALL *FncInitAgent)(AgentInst, ChannelApiFncs*);
116 void _SV_CALL InitAgent(AgentInst, ChannelApiFncs*);
118 typedef void (_SV_CALL *FncShutDownAgent)();
119 void _SV_CALL ShutDownAgent();
121 // NewDataPermission
122 // ChannelName
123 typedef unsigned char (_SV_CALL *FncNewDataPermission)(const char*);
124 unsigned char _SV_CALL NewDataPermission(const char*);
126 // NewData
127 // ChannelName, URL
128 typedef void (_SV_CALL *FncNewData)(const char*, const char*);
129 void _SV_CALL NewData(const char*, const char*);
131 // NotifyChannelObjFile
132 // URL, abs. Filename
133 typedef void (_SV_CALL *FncNotifyChannelObjFile)(const char*, const char*);
134 void _SV_CALL NotifyChannelObjFile(const char*, const char*);
136 // NotifyChannelObjData
137 // URL, Buffer, Offset, Len, TotalLen
138 typedef void (_SV_CALL *FncNotifyChannelObjData)(const char*, void*, long, long, long);
139 void _SV_CALL NotifyChannelObjData(const char*, void*, long, long, long);
141 typedef void (_SV_CALL *FncRegisterChannels)(AgentInst, ChannelApiFncs*);
142 void _SV_CALL RegisterChannels(AgentInst, ChannelApiFncs*);
144 typedef void (_SV_CALL *FncRegisterUpdateTransmitter)(AgentInst, ChannelApiFncs*);
145 void _SV_CALL RegisterUpdateTransmitter(AgentInst, ChannelApiFncs*);
147 #if defined(WIN) || defined(WNT) || defined(OS2) || defined(UNX)
149 #endif
151 #endif //_AGSDKDLL_HXX