5 Star 4 Fork 4

zhjun5337 / kopete-qq

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qq_types.h 4.29 KB
一键复制 编辑 原始数据 按行查看 历史
zhjun5337 提交于 2014-06-24 12:31 . rm js
#ifndef QQ_TYPES_H_H
#define QQ_TYPES_H_H
//#include <connection.h>
extern "C"
{
#include "lwqq.h"
#include "lwdb.h"
#include "lwjs.h"
#include "utility.h"
#include <unistd.h>
}
#include "config.h"
#ifdef ENABLE_NLS
#define _(s) s
#else
#define _(s) s
#endif
#define QQ_MAGIC 0x4153
#define QQ_USE_FAST_INDEX 0
#define SUCCESS 0
#define FAILED -1
#define BUFLEN 15000
#ifdef UNUSED
#elif defined(__GNUC__)
# define UNUSED(x) UNUSED_ ## x __attribute__((unused))
#else
# define UNUSED(x) x
#endif
#ifdef USE_LIBEV
//the ev dispatch macro
//ld:long dispatch,d:lc->dispatch,sd:short dispatch
#define _EV_(ld,d,sd) ld,d,vp_func_##sd
#else
#define _EV_(ld,d,sd) sd
#endif
#define DISPLAY_VERSION "0.1"
#define DBGID "webqq"
#define QQ_DEFAULT_CATE _("Friend")
#define QQ_PASSERBY_CATE _("Passerby")
#define QQ_GROUP_DEFAULT_CATE _("Chat")
//this is qqnumber of a group
#define QQ_ROOM_KEY_QUN_ID "account"
#define QQ_ROOM_KEY_GID "gid"
#define QQ_ROOM_TYPE "type"
#define QQ_ROOM_TYPE_QUN "qun"
#define QQ_ROOM_TYPE_DISCU "discu"
const int WEBQQ_GEN_DEBUG = 14210;
typedef struct {
enum {NODE_IS_BUDDY,NODE_IS_GROUP} type;
const void* node;
}index_node;
typedef struct {
char *send_id;
time_t when;
char *what;
}group_msg;
typedef enum
{
DISCONNECT,
CONNECTED,
LOAD_COMPLETED
}connect_state;
typedef enum {
QQ_USE_QQNUM = 1<<0,
IGNORE_FONT_FACE = 1<<1,
IGNORE_FONT_SIZE = 1<<2,
DARK_THEME_ADAPT = 1<<3,
DEBUG_FILE_SEND = 1<<4,
REMOVE_DUPLICATED_MSG = 1<<5,
QQ_DONT_EXPECT_100_CONTINUE = 1<<6,
NOT_DOWNLOAD_GROUP_PIC = 1<<7,
SEND_VISUALBILITY = 1<<8,
CACHE_TALKGROUP = 1<<9,
}lwflags;
//add friend and group info
typedef struct add_info {
char* qq;
char* name;
char* uin;
}add_info;
enum ConType { Contact_Chat, Contact_Group, Contact_Discu, Contact_Session};
typedef struct qq_account {
LwqqClient* qq;
LwdbUserDB* db;
lwqq_js_t* js;
int disable_send_server;///< this ensure not send buddy category change etc event to server
connect_state state;
int msg_poll_handle;
int relink_timer;
char* recent_group_name;
struct {
char* family;
int size;
LwqqFontStyle style;
}font;
lwflags flag;
int magic;//0x4153
} qq_account;
typedef struct system_msg {
int msg_type;
char* who;
qq_account* ac;
char* msg;
int type;
time_t t;
}system_msg;
struct qq_extra_async_opt {
void (*login_complete)(LwqqClient* lc,LwqqErrorCode err);
void (*need_verify)(LwqqClient* lc,LwqqErrorCode err);
};
void qq_dispatch(LwqqCommand cmd);
LwqqErrorCode qq_download(const char* url,const char* file,const char* dir);
#define try_get(val,fail) (val?val:fail)
qq_account* qq_account_new(char *username, char *password);
void qq_account_free(qq_account* ac);
#define qq_account_valid(ac) (ac->magic == QQ_MAGIC)
void qq_account_insert_index_node(qq_account* ac,const LwqqBuddy* b,const LwqqGroup* g);
void qq_account_remove_index_node(qq_account* ac,const LwqqBuddy* b,const LwqqGroup* g);
int open_new_chat(qq_account* ac,LwqqGroup* group);
#define opend_chat_search(ac,group) open_new_chat(ac,group)
#define opend_chat_index(ac,id) g_ptr_array_index(ac->opend_chat,id)
void qq_sys_msg_write(qq_account* ac,LwqqMsgType m_t,const char* serv_id,const char* msg,time_t t);
//----------------------------ft.h-----------------------------
void file_message(LwqqClient* lc,LwqqMsgFileMessage* file);
//=============================================================
LwqqBuddy* find_buddy_by_qqnumber(LwqqClient* lc,const char* qqnum);
LwqqGroup* find_group_by_qqnumber(LwqqClient* lc,const char* qqnum);
LwqqBuddy* find_buddy_by_uin(LwqqClient* lc,const char* uin);
LwqqGroup* find_group_by_gid(LwqqClient* lc,const char* gid);
struct qq_extra_info* get_extra_info(LwqqClient* lc,const char* uin);
const char* qq_gender_to_str(LwqqGender gender);
const char* qq_constel_to_str(LwqqConstel constel);
const char* qq_blood_to_str(LwqqBloodType bt);
const char* qq_shengxiao_to_str(LwqqShengxiao shengxiao);
const char* qq_client_to_str(LwqqClientType client);
const char* qq_level_to_str(int level);
const char* qq_status_to_str(LwqqStatus status);
LwqqStatus qq_status_from_str(const char* str);
void vp_func_4pl(CALLBACK_FUNC func,vp_list* vp,void* p);
#endif
C++
1
https://gitee.com/zhjun5337/kopete-qq.git
git@gitee.com:zhjun5337/kopete-qq.git
zhjun5337
kopete-qq
kopete-qq
master

搜索帮助