OSDN Git Service

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