xref: /trunk/main/sw/sdi/swinterf.c (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include <stdio.h>
29 
30 #include <svinterf.h>
31 #include <cmdid.h>
32 
33 static char pEmpty[] = "";
34 
35 extern void *pSvClient;
36 
37 /* WRITER */
38 short SwInsertDocument (void *pHandle,
39                         const char *pFileName,
40                         const char *pFilter)
41 {
42     return 0;
43 }
44 
45 /**************************************************************************/
46 
47 /* WRITER */
48 short SwDeleteTableColumns (void *pHandle)
49 {
50     if (SvIPCIsConnected())
51         return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_COL | 0x10000,
52                                      pHandle,0,pEmpty);
53     return 0;
54 }
55 
56 /* WRITER */
57 short SwDeleteTableRows (void *pHandle)
58 {
59     if (SvIPCIsConnected())
60         return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_ROW | 0x10000,
61                                      pHandle,0,pEmpty);
62     return 0;
63 }
64 
65 /* WRITER */
66 short SwGotoStartOfTable (void *pHandle)
67 {
68     if (SvIPCIsConnected())
69         return pIPCCallShortFunction(SvIPCGetClient(),FN_START_TABLE | 0x10000,
70                                      pHandle,0,pEmpty);
71     return 0;
72 }
73 
74 /* WRITER */
75 short SwGotoEndOfTable   (void *pHandle)
76 {
77     if (SvIPCIsConnected())
78         return pIPCCallShortFunction(SvIPCGetClient(),FN_END_TABLE | 0x10000,
79                                      pHandle,0,pEmpty);
80     return 0;
81 }
82 
83 /* WRITER */
84 short SwGotoNextTable    (void *pHandle)
85 {
86     return 0;
87 }
88 
89 /* WRITER */
90 short SwGotoPrevTable   (void *pHandle)
91 {
92     return 0;
93 }
94 
95 /* WRITER */
96 short SwSelectTableRow    (void *pHandle)
97 {
98     if (SvIPCIsConnected())
99         return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ROW | 0x10000,
100                                      pHandle,0,pEmpty);
101     return 0;
102 }
103 
104 /* WRITER */
105 short SwSelectTableColumn (void *pHandle)
106 {
107     if (SvIPCIsConnected())
108         return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_COL | 0x10000,
109                                      pHandle,0,pEmpty);
110     return 0;
111 }
112 
113 /* WRITER */
114 short SwTableSelect       (void *pHandle)
115 {
116     if (SvIPCIsConnected())
117         return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ALL | 0x10000,
118                                      pHandle,0,pEmpty);
119     return 0;
120 }
121 
122 /* WRITER */
123 short SwInsertTable (void *pHandle, const char *pName,
124                      unsigned short nRow, unsigned short nColumn)
125 {
126     if (SvIPCIsConnected())
127         return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_TABLE | 0x10000,
128                                      pHandle,0,"hh",nRow,nColumn);
129     return 0;
130 
131 }
132 
133 /**************************************************************************/
134 
135 /* WRITER */
136 short SwCharLeft(void *pHandle, unsigned short nCount, unsigned short bSelect)
137 {
138     if (SvIPCIsConnected())
139         return pIPCCallShortFunction(SvIPCGetClient(),FN_CHAR_LEFT | 0x10000,
140                                      pHandle,0,"hb",nCount,bSelect);
141     return 0;
142 }
143 
144 /* WRITER */
145 short SwCharRight(void *pHandle, unsigned short nCount, unsigned short bSelect)
146 {
147     if (SvIPCIsConnected())
148         return pIPCCallShortFunction(SvIPCGetClient(),FN_CHAR_RIGHT | 0x10000,
149                                      pHandle,0,"hb",nCount,bSelect);
150     return 0;
151 }
152 
153 /* WRITER */
154 short SwLineUp(void *pHandle, unsigned short nCount, unsigned short bSelect)
155 {
156     if (SvIPCIsConnected())
157         return pIPCCallShortFunction(SvIPCGetClient(),FN_LINE_UP | 0x10000,
158                                      pHandle,0,"hb",nCount,bSelect);
159     return 0;
160 }
161 
162 /* WRITER */
163 short SwLineDown(void *pHandle, unsigned short nCount, unsigned short bSelect)
164 {
165     if (SvIPCIsConnected())
166         return pIPCCallShortFunction(SvIPCGetClient(),FN_LINE_DOWN | 0x10000,
167                                      pHandle,0,"hb",nCount,bSelect);
168     return 0;
169 }
170 
171 /**************************************************************************/
172 
173 /* WRITER */
174 const char *SwGetSelectedText(void *pHandle)
175 {
176     if (SvIPCIsConnected())
177         return pIPCCallStringFunction(SvIPCGetClient(),FN_GET_SELECTED_TEXT,
178                                       pHandle,0,pEmpty);
179     return NULL;
180 }
181 
182 /* WRITER */
183 short SwInsertString(void *pHandle,const char *pString)
184 {
185     if (SvIPCIsConnected())
186         return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_STRING | 0x10000,
187                                      pHandle,0,"s",pString);
188     return 0;
189 }
190 
191 /* WRITER */
192 extern short SwInsertLineBreak(void *pHandle)
193 {
194     if (SvIPCIsConnected())
195         return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_LINEBREAK | 0x10000,
196                                      pHandle,0,pEmpty);
197     return 0;
198 }
199 
200 /**************************************************************************/
201 
202 /* WRITER */
203 short SwDelLeft (void *pHandle)
204 {
205     if (SvIPCIsConnected())
206         return pIPCCallShortFunction(SvIPCGetClient(),FN_BACKSPACE | 0x10000,
207                                      pHandle,0,pEmpty);
208     return 0;
209 }
210 
211 /* WRITER */
212 short SwDelRight (void *pHandle)
213 {
214     if (SvIPCIsConnected())
215         return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE | 0x10000,
216                                      pHandle,0,pEmpty);
217     return 0;
218 }
219 
220 /* WRITER */
221 short SwDelLine (void *pHandle)
222 {
223     if (SvIPCIsConnected())
224         return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE_WHOLE_LINE | 0x10000,
225                                      pHandle,0,pEmpty);
226     return 0;
227 }
228 
229 /**************************************************************************/
230 
231 /* WRITER */
232 short SwCharDlg(void *pHandle)
233 {
234     if (SvIPCIsConnected())
235         return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_CHAR_DLG | 0x10000,
236                                      pHandle,0,pEmpty);
237     return 0;
238 }
239 
240 /* WRITER */
241 short SwParagrDlg(void *pHandle)
242 {
243     if (SvIPCIsConnected())
244         return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_PARA_DLG | 0x10000,
245                                      pHandle,0,pEmpty);
246     return 0;
247 }
248 
249 
250