merge the formfield patch from ooo-build
[ooovba.git] / sw / sdi / swinterf.c
blob00bad878206ce38116be9ad92f8155f99713fb2e
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: swinterf.c,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 ************************************************************************/
31 #include <stdio.h>
33 #include <svinterf.h>
34 #include <cmdid.h>
36 static char pEmpty[] = "";
38 extern void *pSvClient;
40 /* WRITER */
41 short SwInsertDocument (void *pHandle,
42 const char *pFileName,
43 const char *pFilter)
45 return 0;
48 /**************************************************************************/
50 /* WRITER */
51 short SwDeleteTableColumns (void *pHandle)
53 if (SvIPCIsConnected())
54 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_COL | 0x10000,
55 pHandle,0,pEmpty);
56 return 0;
59 /* WRITER */
60 short SwDeleteTableRows (void *pHandle)
62 if (SvIPCIsConnected())
63 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_ROW | 0x10000,
64 pHandle,0,pEmpty);
65 return 0;
68 /* WRITER */
69 short SwGotoStartOfTable (void *pHandle)
71 if (SvIPCIsConnected())
72 return pIPCCallShortFunction(SvIPCGetClient(),FN_START_TABLE | 0x10000,
73 pHandle,0,pEmpty);
74 return 0;
77 /* WRITER */
78 short SwGotoEndOfTable (void *pHandle)
80 if (SvIPCIsConnected())
81 return pIPCCallShortFunction(SvIPCGetClient(),FN_END_TABLE | 0x10000,
82 pHandle,0,pEmpty);
83 return 0;
86 /* WRITER */
87 short SwGotoNextTable (void *pHandle)
89 return 0;
92 /* WRITER */
93 short SwGotoPrevTable (void *pHandle)
95 return 0;
98 /* WRITER */
99 short SwSelectTableRow (void *pHandle)
101 if (SvIPCIsConnected())
102 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ROW | 0x10000,
103 pHandle,0,pEmpty);
104 return 0;
107 /* WRITER */
108 short SwSelectTableColumn (void *pHandle)
110 if (SvIPCIsConnected())
111 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_COL | 0x10000,
112 pHandle,0,pEmpty);
113 return 0;
116 /* WRITER */
117 short SwTableSelect (void *pHandle)
119 if (SvIPCIsConnected())
120 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ALL | 0x10000,
121 pHandle,0,pEmpty);
122 return 0;
125 /* WRITER */
126 short SwInsertTable (void *pHandle, const char *pName,
127 unsigned short nRow, unsigned short nColumn)
129 if (SvIPCIsConnected())
130 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_TABLE | 0x10000,
131 pHandle,0,"hh",nRow,nColumn);
132 return 0;
136 /**************************************************************************/
138 /* WRITER */
139 short SwCharLeft(void *pHandle, unsigned short nCount, unsigned short bSelect)
141 if (SvIPCIsConnected())
142 return pIPCCallShortFunction(SvIPCGetClient(),FN_CHAR_LEFT | 0x10000,
143 pHandle,0,"hb",nCount,bSelect);
144 return 0;
147 /* WRITER */
148 short SwCharRight(void *pHandle, unsigned short nCount, unsigned short bSelect)
150 if (SvIPCIsConnected())
151 return pIPCCallShortFunction(SvIPCGetClient(),FN_CHAR_RIGHT | 0x10000,
152 pHandle,0,"hb",nCount,bSelect);
153 return 0;
156 /* WRITER */
157 short SwLineUp(void *pHandle, unsigned short nCount, unsigned short bSelect)
159 if (SvIPCIsConnected())
160 return pIPCCallShortFunction(SvIPCGetClient(),FN_LINE_UP | 0x10000,
161 pHandle,0,"hb",nCount,bSelect);
162 return 0;
165 /* WRITER */
166 short SwLineDown(void *pHandle, unsigned short nCount, unsigned short bSelect)
168 if (SvIPCIsConnected())
169 return pIPCCallShortFunction(SvIPCGetClient(),FN_LINE_DOWN | 0x10000,
170 pHandle,0,"hb",nCount,bSelect);
171 return 0;
174 /**************************************************************************/
176 /* WRITER */
177 const char *SwGetSelectedText(void *pHandle)
179 if (SvIPCIsConnected())
180 return pIPCCallStringFunction(SvIPCGetClient(),FN_GET_SELECTED_TEXT,
181 pHandle,0,pEmpty);
182 return NULL;
185 /* WRITER */
186 short SwInsertString(void *pHandle,const char *pString)
188 if (SvIPCIsConnected())
189 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_STRING | 0x10000,
190 pHandle,0,"s",pString);
191 return 0;
194 /* WRITER */
195 extern short SwInsertLineBreak(void *pHandle)
197 if (SvIPCIsConnected())
198 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_LINEBREAK | 0x10000,
199 pHandle,0,pEmpty);
200 return 0;
203 /**************************************************************************/
205 /* WRITER */
206 short SwDelLeft (void *pHandle)
208 if (SvIPCIsConnected())
209 return pIPCCallShortFunction(SvIPCGetClient(),FN_BACKSPACE | 0x10000,
210 pHandle,0,pEmpty);
211 return 0;
214 /* WRITER */
215 short SwDelRight (void *pHandle)
217 if (SvIPCIsConnected())
218 return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE | 0x10000,
219 pHandle,0,pEmpty);
220 return 0;
223 /* WRITER */
224 short SwDelLine (void *pHandle)
226 if (SvIPCIsConnected())
227 return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE_WHOLE_LINE | 0x10000,
228 pHandle,0,pEmpty);
229 return 0;
232 /**************************************************************************/
234 /* WRITER */
235 short SwCharDlg(void *pHandle)
237 if (SvIPCIsConnected())
238 return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_CHAR_DLG | 0x10000,
239 pHandle,0,pEmpty);
240 return 0;
243 /* WRITER */
244 short SwParagrDlg(void *pHandle)
246 if (SvIPCIsConnected())
247 return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_PARA_DLG | 0x10000,
248 pHandle,0,pEmpty);
249 return 0;