1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: swinterf.c,v $
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 ************************************************************************/
36 static char pEmpty
[] = "";
38 extern void *pSvClient
;
41 short SwInsertDocument (void *pHandle
,
42 const char *pFileName
,
48 /**************************************************************************/
51 short SwDeleteTableColumns (void *pHandle
)
53 if (SvIPCIsConnected())
54 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_COL
| 0x10000,
60 short SwDeleteTableRows (void *pHandle
)
62 if (SvIPCIsConnected())
63 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_ROW
| 0x10000,
69 short SwGotoStartOfTable (void *pHandle
)
71 if (SvIPCIsConnected())
72 return pIPCCallShortFunction(SvIPCGetClient(),FN_START_TABLE
| 0x10000,
78 short SwGotoEndOfTable (void *pHandle
)
80 if (SvIPCIsConnected())
81 return pIPCCallShortFunction(SvIPCGetClient(),FN_END_TABLE
| 0x10000,
87 short SwGotoNextTable (void *pHandle
)
93 short SwGotoPrevTable (void *pHandle
)
99 short SwSelectTableRow (void *pHandle
)
101 if (SvIPCIsConnected())
102 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ROW
| 0x10000,
108 short SwSelectTableColumn (void *pHandle
)
110 if (SvIPCIsConnected())
111 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_COL
| 0x10000,
117 short SwTableSelect (void *pHandle
)
119 if (SvIPCIsConnected())
120 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ALL
| 0x10000,
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
);
136 /**************************************************************************/
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
);
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
);
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
);
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
);
174 /**************************************************************************/
177 const char *SwGetSelectedText(void *pHandle
)
179 if (SvIPCIsConnected())
180 return pIPCCallStringFunction(SvIPCGetClient(),FN_GET_SELECTED_TEXT
,
186 short SwInsertString(void *pHandle
,const char *pString
)
188 if (SvIPCIsConnected())
189 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_STRING
| 0x10000,
190 pHandle
,0,"s",pString
);
195 extern short SwInsertLineBreak(void *pHandle
)
197 if (SvIPCIsConnected())
198 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_LINEBREAK
| 0x10000,
203 /**************************************************************************/
206 short SwDelLeft (void *pHandle
)
208 if (SvIPCIsConnected())
209 return pIPCCallShortFunction(SvIPCGetClient(),FN_BACKSPACE
| 0x10000,
215 short SwDelRight (void *pHandle
)
217 if (SvIPCIsConnected())
218 return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE
| 0x10000,
224 short SwDelLine (void *pHandle
)
226 if (SvIPCIsConnected())
227 return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE_WHOLE_LINE
| 0x10000,
232 /**************************************************************************/
235 short SwCharDlg(void *pHandle
)
237 if (SvIPCIsConnected())
238 return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_CHAR_DLG
| 0x10000,
244 short SwParagrDlg(void *pHandle
)
246 if (SvIPCIsConnected())
247 return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_PARA_DLG
| 0x10000,