OSDN Git Service

2011/10/31 22:55:29
[nlite/nlite.git] / nlib / nlib.h
1 #pragma once
2
3 #include <qwerty\qwerty_common.h>
4 #include <winhttp.h>
5
6 #ifdef NLIB_EXPORTS
7
8
9 #define NLIB_DECLSPEC  __declspec(dllexport)
10
11 #else  //NLIB_EXPORTS
12
13 #ifdef NLIB_DYNAMIC
14 #define NLIB_DECLSPEC  __declspec(dllimport)
15 #else //NLIB_STATIC
16
17 #define NLIB_DECLSPEC extern
18
19 #endif
20
21
22
23 #endif //NLIB_EXPORTS
24
25 //\8c^\92è\8b`
26 //////////////////////////////////////////////////////////////////////////////////////////////////////
27
28 ///
29 ///nlib\82Ì\96ß\82è\92l\82Ì\8c^
30 ///
31 typedef UINT_PTR NLIB_RESULT;
32
33
34
35 ///
36 ///NicoLiveStream\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83C\83x\83\93\83g\83^\83C\83v\8c^
37 ///
38 typedef UINT_PTR                NICOLIVE_EVENT;
39
40 ///
41 ///NicoLiveStream\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83p\83\89\83\81\81[\83^\83^\83C\83v
42 ///
43 typedef UINT_PTR                NICOLIVE_PARAM;
44
45
46 ///
47 ///NicoMyList\82Ì\83R\81[\83\8b\83o\83b\83N\8aÖ\90\94\82Ì\83C\83x\83\93\83g\83^\83C\83v\8c^
48 ///
49 typedef UINT_PTR                NICOMYLIST_EVENT;
50
51
52
53
54 ///
55 ///\83j\83R\83j\83R\90\95ú\91\97\83I\83u\83W\83F\83N\83g\83|\83C\83\93\83^
56 ///
57 typedef struct nicolivestream_t *NicoLiveStream_P;
58
59 ///
60 ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\83I\83u\83W\83F\83N\83g
61 ///
62 typedef struct nicovideoauth_t *NicoVideoAuth_P;
63
64
65
66
67 typedef struct {
68         WCHAR deleted[LENGTH_2048];
69         time_t first_retrieve;
70         WCHAR group_type[LENGTH_2048];
71         WCHAR last_res_body[LENGTH_2048];
72         WCHAR length_seconds[LENGTH_2048];
73         WCHAR mylist_counter[LENGTH_2048];
74         WCHAR num_res[LENGTH_2048];
75         WCHAR thumbnail_url[LENGTH_2048];
76         WCHAR title[LENGTH_2048];
77         time_t update_time;
78         WCHAR video_id[LENGTH_2048];
79         WCHAR view_counter[LENGTH_2048];
80         WCHAR watch_id[LENGTH_2048];
81 }NicoItemData,*NicoItemData_P;
82
83 ///
84 ///\83j\83R\83j\83R\93®\89æ\82¨\8bC\82É\93ü\82è\93®\89æ
85 ///
86 typedef struct {
87         time_t create_time;
88         WCHAR description[LENGTH_2048];
89         NicoItemData itemData;
90         WCHAR item_id[LENGTH_2048];
91         WCHAR item_type[LENGTH_2048];
92         time_t update_time;
93         UINT_PTR watch;
94
95
96 }NicoMyListItem,*NicoMyListItem_P;
97
98
99 ///
100 ///\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g
101 ///
102 typedef struct {
103         time_t create_time;
104         WCHAR default_sort[LENGTH_256];
105         WCHAR description[LENGTH_2048];
106         WCHAR icon_id[LENGTH_256];
107         WCHAR id[LENGTH_256];
108         WCHAR name[LENGTH_2048];
109         WCHAR publicType[LENGTH_256];
110         WCHAR sort_order[LENGTH_256];
111         time_t update_time;
112         WCHAR user_id[LENGTH_256];
113
114 }NicoMyList,*NicoMyList_P;
115
116 ///
117 ///\83j\83R\83j\83R\90\95ú\91\97\83C\83x\83\93\83g\83n\83\93\83h\83\89
118 ///
119 typedef NLIB_RESULT (*NicoRecvCallBack)(NICOLIVE_EVENT eventType,NicoLiveStream_P pNicoLiveStream,LPVOID option,NICOLIVE_PARAM param1,NICOLIVE_PARAM param2);
120
121 ///
122 ///\83j\83R\83j\83R\83}\83C\83\8a\83X\83g\83C\83x\83\93\83g\83n\83\93\83h\83\89
123 ///
124 typedef NLIB_RESULT (*NicoMyListCallBack)(LPVOID option,NicoMyListItem_P pVideo);
125
126 ///
127 ///\83j\83R\83j\83R\83}\83C\83\8a\83X\83g\88ê\97\97\83C\83x\83\93\83g\83n\83\93\83h\83\89
128 ///
129 typedef NLIB_RESULT (*NicoMyListGroupCallBack)(LPVOID option,NicoMyList_P pMyList);
130
131
132
133
134 typedef UCHAR NICOLIVE_PREMIUM;
135 typedef UCHAR NICOLIVE_ANONYMITY;
136
137
138 ///
139 ///\83j\83R\83j\83R\90\95ú\91\97\83`\83\83\83b\83g\83R\83\81\83\93\83g\8d\\91¢\91Ì
140 ///
141 typedef struct{
142         LPCWSTR premium;
143         LPCWSTR anonymity;
144         LPCWSTR thread;
145         LPCWSTR no;
146         LPCWSTR vpos;
147         LPCWSTR date;
148         LPCWSTR locale;
149         LPCWSTR user_id;
150         LPCWSTR name;
151         LPCWSTR chatBuf;
152         LPCWSTR* mail;
153         UINT_PTR mailCount;
154 }NicoLiveChat,*NicoLiveChat_P;
155
156
157
158
159 ///
160 ///\83j\83R\83j\83R\90\95ú\91\97\83X\83\8c\83b\83h\83R\83\81\83\93\83g\8d\\91¢\91Ì
161 ///
162 typedef struct{
163         LPCWSTR thread;
164         LPCWSTR ticket;
165         LPCWSTR last_res;
166         LPCWSTR server_time;
167 }NicoLiveThreadComment,*NicoLiveThreadComment_P;
168
169
170 ///
171 ///\83j\83R\83j\83R\90\95ú\91\97\91\97\90M\8c\8b\89Ê\83R\83\81\83\93\83g\8d\\91¢\91Ì
172 ///
173 typedef struct{
174         LPCWSTR status;
175         LPCWSTR no;
176         LPCWSTR thread;
177 }NicoLiveSendResultComment,*NicoLiveSendResultComment_P;
178
179
180 ///
181 ///\83j\83R\90\83n\81[\83g\83r\81[\83g\8d\\91¢\91Ì
182 ///
183 typedef struct{
184
185         NLIB_RESULT status;
186
187         time_t time;
188
189         UINT_PTR watchCount;
190
191         UINT_PTR commentCount;
192
193         LPCWSTR is_restrict;
194
195         LPCWSTR ticket;
196
197
198 }NicoLiveHeartBeat,*NicoLiveHeartBeat_P;
199
200
201
202
203
204 #ifdef __cplusplus
205 extern "C" {
206 #endif
207
208         
209         ///
210         ///nlib\8f\89\8aú\89»\8aÖ\90\94
211         ///
212         NLIB_DECLSPEC NLIB_RESULT InitializeNLIB(HINTERNET hInternet);
213
214         ///
215         ///nlib\8cã\8en\96\96\8aÖ\90\94
216         ///
217         NLIB_DECLSPEC VOID FinalizeNLIB();
218
219         //
220         //\83j\83R\83j\83R\90\95ú\91\97\8aÖ\98A\8aÖ\90\94
221         /////////////////////////////////////////////////////////////////////////////////////////////////////
222
223         ///
224         ///\83j\83R\83j\83R\90\95ú\91\97\83I\83u\83W\83F\83N\83g\93®\93I\90\90¬
225         ///
226         NLIB_DECLSPEC NicoLiveStream_P NicoLiveStream_new();
227
228         ///
229         ///\93®\93I\82É\90\90¬\82µ\82½\83j\83R\83j\83R\90\95ú\91\97\83I\83u\83W\83F\83N\83g\82ð\94j\8aü
230         ///
231         NLIB_DECLSPEC VOID NicoLiveStream_delete(NicoLiveStream_P* self);
232
233         ///
234         ///\8ew\92è\82µ\82½URL\82Ì\95ú\91\97\82É\90Ú\91±
235         ///
236         NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_connect(NicoLiveStream_P self,NicoVideoAuth_P nicoVideoAuth,LPCWSTR url,NicoRecvCallBack callback,LPVOID option);
237         
238
239         ///
240         ///\95ú\91\97\82Æ\82Ì\90Ú\91±\82ð\90Ø\92f\82·\82é
241         ///
242         NLIB_DECLSPEC VOID NicoLiveStream_disConnect(NicoLiveStream_P self);
243
244         ///
245         ///\90Ú\91±\8e\9e\82Ì\8eó\90M\82·\82é\83R\83\81\83\93\83g\90\94\82ð\90Ý\92è
246         ///
247         NLIB_DECLSPEC VOID NicoLiveStrream_setResFrom(NicoLiveStream_P self,INT_PTR res);
248
249
250         ///
251         ///\90Ú\91±\8e\9e\82Ì\8eó\90M\82·\82é\83R\83\81\83\93\83g\90\94\82ð\8eæ\93¾
252         ///
253         NLIB_DECLSPEC INT_PTR NicoLiveStream_getResFrom(NicoLiveStream_P self);
254
255         ///
256         ///\83n\81[\83g\83r\81[\83g\82Ì\8aÔ\8au\82ð\90Ý\92è\81i\83~\83\8a\95b)
257         ///
258         NLIB_DECLSPEC VOID NicoLiveStream_setHeartBeatMsec(NicoLiveStream_P self,DWORD msec);
259
260
261         ///
262         ///\83n\81[\83g\83r\81[\83g\82Ì\8aÔ\8au\82ð\8eæ\93¾(\83~\83\8a\95b)
263         ///
264         NLIB_DECLSPEC DWORD NicoLiveStream_getHeartBeatMsec(NicoLiveStream_P self);
265
266         ///
267         ///\83n\81[\83g\83r\81[\83g\97L\8cø\81E\96³\8cø\90Ý\92è
268         ///
269         NLIB_DECLSPEC VOID NicoLiveStream_setHeartBeatFlag(NicoLiveStream_P self,BOOL flag);
270
271
272         ///
273         ///\83n\81[\83g\83r\81[\83g\97L\8cø\83t\83\89\83O\8eæ\93¾
274         ///
275         NLIB_DECLSPEC BOOL NicoLiveStream_getHeartBeatFlag(NicoLiveStream_P self);
276
277         ///
278         ///\83L\81[\83v\83A\83\89\83C\83u\82Ì\8aÔ\8au\82ð\90Ý\92è(\83~\83\8a\95b)
279         ///
280         NLIB_DECLSPEC VOID NicoLiveStream_setKeapALiveMsec(NicoLiveStream_P self,DWORD msec);
281
282         ///
283         ///\83L\81[\83v\83A\83\89\83C\83u\82Ì\8aÔ\8au\82ð\8eæ\93¾(\83~\83\8a\95b)
284         ///
285         NLIB_DECLSPEC DWORD NicoLiveStream_getKeapALiveMsec(NicoLiveStream_P self);
286
287
288         ///
289         ///\83L\81[\83v\83A\83\89\83C\83u\97L\8cø\81E\96³\8cø\90Ý\92è
290         ///
291         NLIB_DECLSPEC VOID NicoLiveStream_setKeapALiveFlag(NicoLiveStream_P self,BOOL flag);
292
293
294         ///
295         ///\83L\81[\83v\83A\83\89\83C\83u\83t\83\89\83O\8eæ\93¾
296         ///
297         NLIB_DECLSPEC BOOL NicoLiveStream_getKeapALiveFlag(NicoLiveStream_P self);
298
299
300         ///
301         ///\83R\83\81\83\93\83g\91\97\90M
302         ///
303         NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCWSTR chatbuf,LPCWSTR *mail,LPCWSTR *extends);
304
305         ///
306         ///\83n\81[\83g\83r\81[\83g\91\97\90M
307         ///
308         NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendHeartBeat(NicoLiveStream_P self);
309
310
311         //
312         //\83j\83R\83j\83R\93®\89æ\94F\8fØ\8aÖ\98A\8aÖ\90\94
313         /////////////////////////////////////////////////////////////////////////////////////////////////
314         
315         ///
316         ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\83I\83u\83W\83F\83N\83g\90\90¬
317         ///
318         NLIB_DECLSPEC NicoVideoAuth_P NicoVideoAuth_new();
319
320         ///
321         ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\83I\83u\83W\83F\83N\83g\94j\8aü
322         ///
323         NLIB_DECLSPEC VOID NicoVideoAuth_delete(NicoVideoAuth_P *self);
324
325
326         ///
327         ///\83j\83R\83j\83R\93®\89æ\94F\8fØ\8fî\95ñ\8eæ\93¾
328         ///
329         NLIB_DECLSPEC NLIB_RESULT NicoVideoAuth_getNicoVideoAuth(NicoVideoAuth_P self,BROWSERTYPE browserType);
330
331
332         //
333         //\83j\83R\83j\83R\93®\89æ\83}\83C\83\8a\83X\83g\8aÖ\98A\8aÖ\90\94
334         ////////////////////////////////////////////////////////////////////////////////////////////////////
335
336         ///
337         ///\82Æ\82è\82 \82¦\82¸\83}\83C\83\8a\83X\83g\88ê\97\97\8eæ\93¾
338         ///
339         NLIB_DECLSPEC NLIB_RESULT NicoMyList_getDefList(NicoVideoAuth_P pAuth,NicoMyListCallBack callback,LPVOID option);
340
341         ///
342         ///\83}\83C\83\8a\83X\83g\8eæ\93¾
343         ///
344         NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyList(NicoVideoAuth_P pAuth,LPCWSTR id,NicoMyListCallBack callback,LPVOID option);
345
346         ///
347         ///\83}\83C\83\8a\83X\83g\83O\83\8b\81[\83v\8eæ\93¾
348         ///
349         NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyListGroup(NicoVideoAuth_P pAuth,NicoMyListGroupCallBack callback,LPVOID option);
350
351
352
353
354
355
356
357
358
359 #ifdef __cplusplus
360 }
361 #endif