OSDN Git Service

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