⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nmuser.h

📁 Linux下的多协议即时通讯程序源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
 * *	The response data sent to the callback will be an NMUserRecord which should be *  freed with nm_release_user_record * *  @param	user		The logged in User *	@param	name		Userid or DN of the user to look up *	@param	callback	Function to call when we get the response from the server *	@param	data		User defined data to be passed to the callback function * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_get_details(NMUser * user, const char *name,							nm_response_cb callback, gpointer data);/** *	Send a message. * *  The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	message		The message to send. *	@param	callback	Function to call when we get the response from the server * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_message(NMUser * user, NMMessage * message,						nm_response_cb callback);/** *	Sends a typing event to the server. * *  The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	conf		The conference that corresponds to the typing event *	@param	typing		TRUE if the user is typing *						FALSE if the user has stopped typing *	@param	callback	Function to call when we get the response from the server * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_typing(NMUser * user, NMConference * conf,					   gboolean typing, nm_response_cb callback);/** *	Send a create contact request to the server. * *  The given folder should already exist on the server. If not, *  the call will fail. * *  The response data sent to the callback will be a NMContact which should *  be released with nm_release_contact * *  @param	user		The logged in User *	@param	folder		The folder that the contact should be created in *	@param	contact		The contact to add *	@param	callback	Function to call when we get the response from the server *	@param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_create_contact(NMUser * user, NMFolder * folder,							   NMContact * contact, nm_response_cb callback,							   gpointer data);/** *	Send a remove contact request to the server. * *  The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	folder		The folder to remove contact from *	@param	contact		The contact to remove *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_remove_contact(NMUser * user, NMFolder * folder,							   NMContact * contact, nm_response_cb callback,							   gpointer data);/** *	Send a create folder request to the server. * *  The response data sent to the callback will be a NMFolder which should be *  released with nm_release_folder * *  @param	user		The logged in User *	@param	name		The name of the folder to create *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_create_folder(NMUser * user, const char *name,							  nm_response_cb callback, gpointer data);/** *	Send a delete folder request to the server. * *  The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	folder		The name of the folder to remove *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_remove_folder(NMUser * user, NMFolder * folder,							  nm_response_cb callback, gpointer data);/** *	Send a rename contact request to the server. * *	The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	contact		The contact to rename *  @param	new_name	The new display name for the contact *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_rename_contact(NMUser * user, NMContact * contact,							   const char *new_name, nm_response_cb callback,							   gpointer data);/** *	Send a rename folder request to the server. * *	The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	folder		The folder to rename *  @param	new_name	The new name of the folder *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_rename_folder(NMUser * user, NMFolder * folder,							  const char *new_name, nm_response_cb callback,							  gpointer data);/** *	Send a move contact request to the server. * *	The response data sent to the callback will be NULL. * *  @param	user		The logged in User *	@param	contact		The contact to move *  @param	folder	    The folder to move the contact to *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_move_contact(NMUser * user, NMContact * contact,							 NMFolder * folder, nm_response_cb callback,							 gpointer data);/** *	Send a get status request to the server. * * 	The response data sent to the callback will be a NMUserRecord. * *  @param	user		The logged in User *	@param	contact		The contact to move *  @param	folder	    The folder to move the contact to *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_T nm_send_get_status(NMUser * user, NMUserRecord * user_record,						   nm_response_cb callback, gpointer data);/** *	Send a request to add an item to the allow or deny list. * *  @param	user		The logged in User *	@param	who			The userid or DN of the user to add to list *  @param	allow_list	TRUE if adding to allow list, FALSE if adding to deny list *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_Tnm_send_create_privacy_item(NMUser *user, const char *who, gboolean is_allowed,							nm_response_cb callback, gpointer data);/** *	Send a request to remove an item from the allow or deny list. * *  @param	user		The logged in User *	@param	who			The userid or DN of the user to add to list *  @param	allow_list	TRUE if removing from allow list, FALSE if removing from deny list *	@param	callback	Function to call when we get the response from the server *  @param	data		User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_Tnm_send_remove_privacy_item(NMUser *user, const char *dn, gboolean allow_list,							nm_response_cb callback, gpointer data);/** *	Send a request to change the default privacy setting to deny all or allow all * *  @param	user			The logged in User *	@param	default_deny	TRUE if default should be changed to deny all *	@param	callback		Function to call when we get the response from the server *  @param	data			User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_Tnm_send_set_privacy_default(NMUser *user, gboolean default_deny,							nm_response_cb callback, gpointer data);/** *	Send a ping to the server * *  @param	user			The logged in User *	@param	callback		Function to call when we get the response from the server *  @param	data			User defined data * *	@return	NM_OK if successfully sent, error otherwise */NMERR_Tnm_send_keepalive(NMUser *user, nm_response_cb callback, gpointer data);/** *	Reads a response/event from the server and processes it. * *  @param	user	The logged in User */NMERR_T nm_process_new_data(NMUser * user);/** *	Return the root folder of the contact list * *  @param	user	The logged in User * *	@return	Root folder */NMFolder *nm_get_root_folder(NMUser * user);/** *	Create the contact list based on the login fields * *  @param	user	The logged in User * */NMERR_T nm_create_contact_list(NMUser * user);void nm_destroy_contact_list(NMUser * user);void nm_user_add_contact(NMUser * user, NMContact * contact);void nm_user_add_user_record(NMUser * user, NMUserRecord * user_record);NMContact *nm_find_contact(NMUser * user, const char *dn);GList *nm_find_contacts(NMUser * user, const char *dn);NMUserRecord *nm_find_user_record(NMUser * user, const char *dn);NMFolder *nm_find_folder(NMUser * user, const char *name);NMFolder *nm_find_folder_by_id(NMUser * user, int object_id);NMConference *nm_find_conversation(NMUser * user, const char *who);void nm_conference_list_add(NMUser * user, NMConference * conf);void nm_conference_list_remove(NMUser * user, NMConference * conf);void nm_conference_list_free(NMUser * user);NMConference *nm_conference_list_find(NMUser * user, const char *guid);const char *nm_lookup_dn(NMUser * user, const char *display_id);nm_event_cb nm_user_get_event_callback(NMUser * user);NMConn *nm_user_get_conn(NMUser * user);gboolean nm_user_is_privacy_locked(NMUser *user);/** Some utility functions **//** * Check to see if the conference GUIDs are equivalent. * * @param guid1	First guid to compare * @param guid2 Second guid to compare * * @return 		TRUE if conference GUIDs are equivalent, FALSE otherwise. * */gboolean nm_are_guids_equal(const char *guid1, const char *guid2);/** * Compare UTF8 strings for equality only (case insensitive) * * @param guid1	First string to compare * @param guid2 Second string to compare * * @return 		TRUE if strings are equal, FALSE otherwise * */gboolean nm_utf8_str_equal(gconstpointer str1, gconstpointer str2);/** * Convert a fully typed LDAP DN to dotted, untype notation * e.g. cn=mike,o=novell -> mike.novell * * @param typed	Fully typed dn * * @return 		Dotted equivalent of typed (must be freed). * */char *nm_typed_to_dotted(const char *typed);/** *      Return a string representation of the error code. * *      @param  error           NMERR_T to convert to string * *      @return String representation. */const char *nm_error_to_string (NMERR_T err);#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -