mysocials-core 1.0
|
00001 00023 #ifndef _MYSOCIALS_DRIVER_H_ 00024 #define _MYSOCIALS_DRIVER_H_ 00025 00026 #include <glib.h> 00027 00028 #include <libxml/tree.h> 00029 #include <libxml/parser.h> 00030 00031 #define CLASS_SETTINGS "settings" 00032 #define GET_SETTINGS "getSettings" 00033 #define SET_SETTINGS "setSettings" 00034 #define TEST_CONNECTION "testConnection" 00035 #define GET_LIST_METHODS "getListMethods" 00036 00037 #define CLASS_PROFILE "profile" 00038 #define GET_PROFILE "getProfile" 00039 #define GET__BASE_PROFILE "getBaseProfile" 00040 #define SET_PROFILE "setProfile" 00041 00042 #define CLASS_PHOTOS "photos" 00043 #define CREATE_ALBUM "createAlbum" 00044 #define GET_LIST_ALBUMS "getListAlbums" 00045 #define GET_LIST_PHOTOS "getListPhotos" 00046 #define GET_LIST_USER_PHOTOS "getListUserPhotos" 00047 #define GET_LIST_FAVORITE_PHOTOS "getListFavoritePhotos" 00048 #define GET_PHOTO "getPhoto" 00049 #define GET_LIST_PHOTO_TAGS "getListPhotoTags" 00050 #define GET_LIST_PHOTO_COMMENTS "getListPhotoComments" 00051 #define SEND_PHOTO_COMMENT "sendPhotoComment" 00052 #define UPLOAD_PHOTO "uploadPhoto" 00053 00054 #define CLASS_FRIENDS "friends" 00055 #define GET_LIST_FRIENDS "getListFriends" 00056 #define DELETE_FRIEND "deleteFriend" 00057 00058 #define CLASS_MESSAGES "messages" 00059 #define GET_LIST_INBOX_MESSAGES "getListInboxMessages" 00060 #define GET_LIST_OUTBOX_MESSAGES "getListOutboxMessages" 00061 #define GET_TOTAL_COUNT_INBOX "getTotalCountInbox" 00062 #define GET_TOTAL_COUNT_OUTBOX "getTotalCountOutbox" 00063 #define GET_COUNT_INBOX_BYTIME "getCountInboxByTime" 00064 #define GET_COUNT_OUTBOX_BYTIME "getCountOutboxByTime" 00065 00066 #define GET_NEW_MESSAGES "getNewInboxMessages" 00067 #define READ_MESSAGE "readMessage" 00068 #define SEND_MESSAGE "sendMessage" 00069 #define DELETE_MESSAGE "deleteMessage" 00070 #define GET_LIST_WALL_MESSAGES "getListWallMessages" 00071 #define SEND_WALL_MESSAGE "sendWallMessage" 00072 #define GET_TOTAL_COUNT_WALL "getTotalCountWall" 00073 #define DELETE_WALL_MESSAGE "deleteWallMessage" 00074 00075 #define CLASS_AUDIO "audio" 00076 #define GET_LIST_AUDIO "getListAudio" 00077 00078 #define CLASS_NEWS "news" 00079 #define GET_LIST_NEWS "getListNews" 00080 00081 #define CLASS_SYSTEM_MESSAGES "systemMessages" 00082 #define INFO_MESSAGE "infoMessage" 00083 #define ERROR_MESSAGE "errorMessage" 00084 00090 #define DRV_SETT_ERROR_CODE "101" 00091 00096 #define DRV_AUTH_ERROR_CODE "102" 00097 00101 #define DRV_AUTH_CANCEL_CODE "103" 00102 00108 #define DRV_UNKNOWN_METHOD_CALL "104" 00109 00110 /*common*/ 00111 #define DRV_REQ_ERROR_CODE "201" 00112 #define DRV_REQ_PARAM_CODE "202" 00113 #define DRV_MESS_EMPTY_CODE "203" 00114 #define DRV_SERVER_BUSY_CODE "204" 00115 #define DRV_CAPT_ERROR_CODE "205" 00116 #define DRV_ACCESS_ERROR_CODE "206" 00117 #define DRV_SERVER_ERROR_CODE "207" 00118 #define DRV_NETW_ERROR_CODE "208" 00119 #define DRV_RESP_ERROR_CODE "209" 00120 #define DRV_FILE_SAVE_ERROR_CODE "210" 00121 00123 #define DRV_SETT_ERROR "Unable to save settings" 00124 #define L10N_DRV_SETT_ERROR _("Unable to save settings") 00125 00126 #define DRV_AUTH_ERROR "Authorization problem" 00127 #define L10N_DRV_AUTH_ERROR _("Authorization problem") 00128 00129 #define DRV_AUTH_CANCEL "Authorization canceled" 00130 #define L10N_DRV_AUTH_CANCEL _("Authorization canceled") 00131 00132 #define DRV_REQ_ERROR "Unable to perform request" 00133 #define L10N_DRV_REQ_ERROR _("Unable to perform request") 00134 00135 #define DRV_SERVER_BUSY "Server busy" 00136 #define L10N_DRV_SERVER_BUSY _("Server busy") 00137 00138 #define DRV_REQ_PARAM "One of the parameters missing or invalid" 00139 #define L10N_DRV_REQ_PARAM _("One of the parameters missing or invalid") 00140 00141 #define DRV_CAPT_ERROR "Captcha" 00142 #define L10N_DRV_CAPT_ERROR _("Captcha") 00143 00144 #define DRV_RESP_ERROR "Bad response from server" 00145 #define L10N_DRV_RESP_ERROR _("Bad response from server") 00146 00147 #define DRV_NETW_ERROR "Network problem" 00148 #define L10N_DRV_NETW_ERROR _("Network problem") 00149 00150 #define DRV_MESS_LEN "Empty message" 00151 #define L10N_DRV_MESS_LEN _("Empty message") 00152 00153 #define DRV_ACCESS_ERROR "Operation prohibited by privacy" 00154 #define L10N_DRV_ACCESS_ERROR _("Operation prohibited by privacy") 00155 00156 #define DRV_SERVER_ERROR "Internal Server Error" 00157 #define L10N_DRV_SERVER_ERROR _("Internal Server Error") 00158 00159 #define DRV_FILE_SAVE_ERROR "Can't save file" 00160 #define L10N_DRV_FILE_SAVE_ERROR _("Can't save file") 00161 00162 /* Entity names */ 00163 #define FIRST_NAME "FirstName" 00164 #define L10N_FIRST_NAME _("FirstName") 00165 00166 #define LAST_NAME "LastName" 00167 #define L10N_LAST_NAME _("LastName") 00168 00169 #define ACTIVITY "Activity" 00170 #define L10N_ACTIVITY _("Activity") 00171 00172 #define CITY_NAME "CityName" 00173 #define L10N_CITY_NAME _("CityName") 00174 00175 #define COUNTRY_NAME "CountryName" 00176 #define L10N_COUNTRY_NAME _("CountryName") 00177 00178 #define BIRTHDAY_NAME "Birthday" 00179 #define L10N_BIRTHDAY_NAME _("Birthday") 00180 00181 #define GENDER_NAME "Gender" 00182 #define L10N_GENDER_NAME _("Gender") 00183 00184 #define FAMILY_STATE_NAME "FamilyState" 00185 #define L10N_FAMILY_STATE_NAME _("FamilyState") 00186 00187 #define POLITICAL_VIEW_NAME "PoliticalView" 00188 #define L10N_POLITICAL_VIEW_NAME _("PoliticalView") 00189 00190 /* Entity values */ 00191 #define MALE "male" 00192 #define L10N_MALE _("male") 00193 00194 #define FEMALE "female" 00195 #define L10N_FEMALE _("female") 00196 00197 #define NO_MALE "none" 00198 #define L10N_NO_MALE _("none") 00199 00200 00201 /* Error Code */ 00202 typedef enum { 00203 FAILURE = -1, 00204 SUCCESS = 0, 00205 ERROR_ALLOCATION_OF_MEMORY, 00206 ERROR_NO_FUNCTION, 00207 ERROR_INITIALIZATION_ALREADY_PASSED, 00208 ERROR_IS_BUSY, 00209 ERROR_SEND_DATA, 00210 ERROR_PARSE_DATA 00211 } error_type; 00212 00213 /* 00214 * Names of exported function 00215 */ 00216 #define MODULE_INIT "msa_module_init" 00217 #define MODULE_GET_INFO "msa_module_get_info" 00218 00228 struct msa_module { 00229 gchar* id; 00230 gchar* name; 00231 gchar* driverName; 00232 gchar* pic; 00233 gchar* proxy; 00234 gint port; 00235 00246 error_type (*send)(xmlDocPtr request, xmlDocPtr* response, const struct msa_module* info); 00247 00248 error_type (*shutdown)(const struct msa_module* info); 00249 00250 }; 00251 00252 00253 #endif