1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #include <stdio.h> 25 26 #include <svinterf.h> 27 #include <cmdid.h> 28 29 static char pEmpty[] = ""; 30 31 extern void *pSvClient; 32 33 /* WRITER */ 34 short SwInsertDocument (void *pHandle, 35 const char *pFileName, 36 const char *pFilter) 37 { 38 return 0; 39 } 40 41 /**************************************************************************/ 42 43 /* WRITER */ 44 short SwDeleteTableColumns (void *pHandle) 45 { 46 if (SvIPCIsConnected()) 47 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_COL | 0x10000, 48 pHandle,0,pEmpty); 49 return 0; 50 } 51 52 /* WRITER */ 53 short SwDeleteTableRows (void *pHandle) 54 { 55 if (SvIPCIsConnected()) 56 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_DELETE_ROW | 0x10000, 57 pHandle,0,pEmpty); 58 return 0; 59 } 60 61 /* WRITER */ 62 short SwGotoStartOfTable (void *pHandle) 63 { 64 if (SvIPCIsConnected()) 65 return pIPCCallShortFunction(SvIPCGetClient(),FN_START_TABLE | 0x10000, 66 pHandle,0,pEmpty); 67 return 0; 68 } 69 70 /* WRITER */ 71 short SwGotoEndOfTable (void *pHandle) 72 { 73 if (SvIPCIsConnected()) 74 return pIPCCallShortFunction(SvIPCGetClient(),FN_END_TABLE | 0x10000, 75 pHandle,0,pEmpty); 76 return 0; 77 } 78 79 /* WRITER */ 80 short SwGotoNextTable (void *pHandle) 81 { 82 return 0; 83 } 84 85 /* WRITER */ 86 short SwGotoPrevTable (void *pHandle) 87 { 88 return 0; 89 } 90 91 /* WRITER */ 92 short SwSelectTableRow (void *pHandle) 93 { 94 if (SvIPCIsConnected()) 95 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ROW | 0x10000, 96 pHandle,0,pEmpty); 97 return 0; 98 } 99 100 /* WRITER */ 101 short SwSelectTableColumn (void *pHandle) 102 { 103 if (SvIPCIsConnected()) 104 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_COL | 0x10000, 105 pHandle,0,pEmpty); 106 return 0; 107 } 108 109 /* WRITER */ 110 short SwTableSelect (void *pHandle) 111 { 112 if (SvIPCIsConnected()) 113 return pIPCCallShortFunction(SvIPCGetClient(),FN_TABLE_SELECT_ALL | 0x10000, 114 pHandle,0,pEmpty); 115 return 0; 116 } 117 118 /* WRITER */ 119 short SwInsertTable (void *pHandle, const char *pName, 120 unsigned short nRow, unsigned short nColumn) 121 { 122 if (SvIPCIsConnected()) 123 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_TABLE | 0x10000, 124 pHandle,0,"hh",nRow,nColumn); 125 return 0; 126 127 } 128 129 /**************************************************************************/ 130 131 /* WRITER */ 132 short SwCharLeft(void *pHandle, unsigned short nCount, unsigned short bSelect) 133 { 134 if (SvIPCIsConnected()) 135 return pIPCCallShortFunction(SvIPCGetClient(),FN_CHAR_LEFT | 0x10000, 136 pHandle,0,"hb",nCount,bSelect); 137 return 0; 138 } 139 140 /* WRITER */ 141 short SwCharRight(void *pHandle, unsigned short nCount, unsigned short bSelect) 142 { 143 if (SvIPCIsConnected()) 144 return pIPCCallShortFunction(SvIPCGetClient(),FN_CHAR_RIGHT | 0x10000, 145 pHandle,0,"hb",nCount,bSelect); 146 return 0; 147 } 148 149 /* WRITER */ 150 short SwLineUp(void *pHandle, unsigned short nCount, unsigned short bSelect) 151 { 152 if (SvIPCIsConnected()) 153 return pIPCCallShortFunction(SvIPCGetClient(),FN_LINE_UP | 0x10000, 154 pHandle,0,"hb",nCount,bSelect); 155 return 0; 156 } 157 158 /* WRITER */ 159 short SwLineDown(void *pHandle, unsigned short nCount, unsigned short bSelect) 160 { 161 if (SvIPCIsConnected()) 162 return pIPCCallShortFunction(SvIPCGetClient(),FN_LINE_DOWN | 0x10000, 163 pHandle,0,"hb",nCount,bSelect); 164 return 0; 165 } 166 167 /**************************************************************************/ 168 169 /* WRITER */ 170 const char *SwGetSelectedText(void *pHandle) 171 { 172 if (SvIPCIsConnected()) 173 return pIPCCallStringFunction(SvIPCGetClient(),FN_GET_SELECTED_TEXT, 174 pHandle,0,pEmpty); 175 return NULL; 176 } 177 178 /* WRITER */ 179 short SwInsertString(void *pHandle,const char *pString) 180 { 181 if (SvIPCIsConnected()) 182 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_STRING | 0x10000, 183 pHandle,0,"s",pString); 184 return 0; 185 } 186 187 /* WRITER */ 188 extern short SwInsertLineBreak(void *pHandle) 189 { 190 if (SvIPCIsConnected()) 191 return pIPCCallShortFunction(SvIPCGetClient(),FN_INSERT_LINEBREAK | 0x10000, 192 pHandle,0,pEmpty); 193 return 0; 194 } 195 196 /**************************************************************************/ 197 198 /* WRITER */ 199 short SwDelLeft (void *pHandle) 200 { 201 if (SvIPCIsConnected()) 202 return pIPCCallShortFunction(SvIPCGetClient(),FN_BACKSPACE | 0x10000, 203 pHandle,0,pEmpty); 204 return 0; 205 } 206 207 /* WRITER */ 208 short SwDelRight (void *pHandle) 209 { 210 if (SvIPCIsConnected()) 211 return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE | 0x10000, 212 pHandle,0,pEmpty); 213 return 0; 214 } 215 216 /* WRITER */ 217 short SwDelLine (void *pHandle) 218 { 219 if (SvIPCIsConnected()) 220 return pIPCCallShortFunction(SvIPCGetClient(),FN_DELETE_WHOLE_LINE | 0x10000, 221 pHandle,0,pEmpty); 222 return 0; 223 } 224 225 /**************************************************************************/ 226 227 /* WRITER */ 228 short SwCharDlg(void *pHandle) 229 { 230 if (SvIPCIsConnected()) 231 return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_CHAR_DLG | 0x10000, 232 pHandle,0,pEmpty); 233 return 0; 234 } 235 236 /* WRITER */ 237 short SwParagrDlg(void *pHandle) 238 { 239 if (SvIPCIsConnected()) 240 return pIPCCallShortFunction(SvIPCGetClient(),FN_FORMAT_PARA_DLG | 0x10000, 241 pHandle,0,pEmpty); 242 return 0; 243 } 244 245 246