kpilot Library API Documentation

APIEmulation.h

00001 /* APIEmulation.h 00002 * 00003 * Copyright (C) 1999 by Judd Montgomery 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; version 2 of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 #ifndef __APIEMULATION_H__ 00019 #define __APIEMULATION_H__ 00020 00021 #include <stdio.h> 00022 #include <stdlib.h> 00023 00024 00025 00026 #undef jp_logf 00027 00028 #include "libplugin.h" 00029 00030 #define PREF_RCFILE 0 00031 #define PREF_TIME 1 00032 #define PREF_SHORTDATE 2 00033 #define PREF_LONGDATE 3 00034 #define PREF_FDOW 4 /*First Day Of the Week */ 00035 #define PREF_SHOW_DELETED 5 00036 #define PREF_SHOW_MODIFIED 6 00037 #define PREF_HIDE_COMPLETED 7 00038 #define PREF_HIGHLIGHT 8 00039 #define PREF_PORT 9 00040 #define PREF_RATE 10 00041 #define PREF_USER 11 00042 #define PREF_USER_ID 12 00043 #define PREF_PC_ID 13 00044 #define PREF_NUM_BACKUPS 14 00045 #define PREF_WINDOW_WIDTH 15 00046 #define PREF_WINDOW_HEIGHT 16 00047 #define PREF_DATEBOOK_PANE 17 00048 #define PREF_ADDRESS_PANE 18 00049 #define PREF_TODO_PANE 19 00050 #define PREF_MEMO_PANE 20 00051 #define PREF_USE_DB3 21 00052 #define PREF_LAST_APP 22 00053 #define PREF_PRINT_THIS_MANY 23 00054 #define PREF_PRINT_ONE_PER_PAGE 24 00055 #define PREF_NUM_BLANK_LINES 25 00056 #define PREF_PRINT_COMMAND 26 00057 #define PREF_CHAR_SET 27 00058 #define PREF_SYNC_DATEBOOK 28 00059 #define PREF_SYNC_ADDRESS 29 00060 #define PREF_SYNC_TODO 30 00061 #define PREF_SYNC_MEMO 31 00062 #define PREF_SYNC_MEMO32 32 00063 #define PREF_ADDRESS_NOTEBOOK_PAGE 33 00064 #define PREF_OUTPUT_HEIGHT 34 00065 #define PREF_OPEN_ALARM_WINDOWS 35 00066 #define PREF_DO_ALARM_COMMAND 36 00067 #define PREF_ALARM_COMMAND 37 00068 #define PREF_REMIND_IN 38 00069 #define PREF_REMIND_UNITS 39 00070 #define PREF_PASSWORD 40 00071 #define PREF_MEMO32_MODE 41 00072 #define PREF_PAPER_SIZE 42 00073 #define PREF_DATEBOOK_EXPORT_FILENAME 43 00074 #define PREF_DATEBOOK_IMPORT_PATH 44 00075 #define PREF_ADDRESS_EXPORT_FILENAME 45 00076 #define PREF_ADDRESS_IMPORT_PATH 46 00077 #define PREF_TODO_EXPORT_FILENAME 47 00078 #define PREF_TODO_IMPORT_PATH 48 00079 #define PREF_MEMO_EXPORT_FILENAME 49 00080 #define PREF_MEMO_IMPORT_PATH 50 00081 00082 #define NUM_PREFS 51 00083 00084 #define MAX_PREF_NUM_BACKUPS 99 00085 00086 #define PREF_MDY 0 00087 #define PREF_DMY 1 00088 #define PREF_YMD 2 00089 00090 #define CHAR_SET_ENGLISH 0 00091 #define CHAR_SET_JAPANESE 1 00092 #define CHAR_SET_1250 2 /* Czech */ 00093 #define CHAR_SET_1251 3 /* Russian; palm koi8-r, host win1251 */ 00094 #define CHAR_SET_1251_B 4 /* Russian; palm win1251, host koi8-r */ 00095 #define CHAR_SET_TRADITIONAL_CHINESE 5 /* Taiwan Chinese */ 00096 #define CHAR_SET_KOREAN 6 /* Korean Hangul */ 00097 #define NUM_CHAR_SETS 7 00098 00099 #define MAX_PREF_VALUE 80 00100 00101 #define INTTYPE 1 00102 #define CHARTYPE 2 00103 00104 typedef struct { 00105 char *name; 00106 int usertype; 00107 int filetype; 00108 long ivalue; 00109 char *svalue; 00110 int svalue_size; 00111 } prefType; 00112 00113 00114 int jpilot_logf(int level, char *format, ...); 00115 int jp_logf(int level, char *format, ...); 00116 /* FIXME: Need a policy. Should all symbols available to 00117 * plugins start with jp or jpilot? 00118 */ 00119 //#define jp_logf jpilot_logf 00120 00121 00122 // backup, mail, mal: 00123 int get_home_file_name(char *file, char *full_name, int max_size); 00124 // mail: 00125 FILE *jp_open_home_file(char *filename, char *mode); 00126 // backup, mal 00127 int jp_get_pref (prefType prefs[], int which, long *n, const char **ret); 00128 int jp_set_pref (prefType prefs[], int which, long n, const char *string); 00129 // mal 00130 void jp_pref_init(prefType prefs[], int count); 00131 char *pref_lstrncpy_realloc(char **dest, const char *src, int *size, int max_size); 00132 // backup, mal 00133 int jp_pref_read_rc_file(char *filename, prefType prefs[], int num_prefs); 00134 int jp_pref_write_rc_file(char *filename, prefType prefs[], int num_prefs); 00135 // keyring,expense 00136 /************************************* 00137 * convert char code 00138 *************************************/ 00139 #define charset_j2p(buf, max_len, char_set) {\ 00140 if (char_set == CHAR_SET_JAPANESE) Euc2Sjis(buf, max_len);\ 00141 if (char_set == CHAR_SET_1250) Lat2Win(buf,max_len);\ 00142 if (char_set == CHAR_SET_1251) koi8_to_win1251(buf, max_len);\ 00143 if (char_set == CHAR_SET_1251_B) win1251_to_koi8(buf, max_len);} 00144 #define charset_p2j(buf, max_len, char_set) {\ 00145 if (char_set == CHAR_SET_JAPANESE) Sjis2Euc(buf, max_len);\ 00146 if (char_set == CHAR_SET_1250) Win2Lat(buf,max_len);\ 00147 if (char_set == CHAR_SET_1251) win1251_to_koi8(buf, max_len);\ 00148 if (char_set == CHAR_SET_1251_B) koi8_to_win1251(buf, max_len);} 00149 00150 void jp_charset_p2j(unsigned char *buf, int max_len); 00151 void jp_charset_j2p(unsigned char *buf, int max_len); 00152 00153 00154 /* 00155 // backup: 00156 00157 // expense 00158 dialog_save_changed_record 00159 gdk_color_alloc 00160 00161 // keyring 00162 // needs -lcrypt 00163 des_ecb3_encrypt 00164 des_set_key 00165 dialog_save_changed_record 00166 gdk_color_alloc 00167 MD5 00168 00169 // mail 00170 gdk_color_alloc 00171 get_app_info_size 00172 get_next_unique_pc_id 00173 rename_file 00174 00175 // mal 00176 00177 00178 //libsynctime should work!!! 00179 00180 */ 00181 #endif
KDE Logo
This file is part of the documentation for kpilot Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:48 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003