3 #ifndef WIN32_LEAN_AND_MEAN
4 #define WIN32_LEAN_AND_MEAN
8 #include <qwerty\qwerty_common.h>
9 #include <shareCookie\browserType.h>
11 #include "nlib_define.h"
16 #define NLIB_DECLSPEC __declspec(dllexport)
21 #define NLIB_DECLSPEC __declspec(dllimport)
24 #define NLIB_DECLSPEC extern
33 //////////////////////////////////////////////////////////////////////////////////////////////////////
39 ///nlib
\82Ì
\96ß
\82è
\92l
\82Ì
\8c^
41 typedef UINT_PTR NLIB_RESULT;
45 ///
\83v
\83\8d\83o
\83C
\83_
\83^
\83C
\83v
47 typedef UINT_PTR PROVIDERTYPE;
51 ///NicoLiveStream
\82Ì
\83R
\81[
\83\8b\83o
\83b
\83N
\8aÖ
\90\94\82Ì
\83C
\83x
\83\93\83g
\83^
\83C
\83v
\8c^
53 typedef UINT_PTR NICOLIVE_EVENT;
56 ///NicoLiveStream
\82Ì
\83R
\81[
\83\8b\83o
\83b
\83N
\8aÖ
\90\94\82Ì
\83p
\83\89\83\81\81[
\83^
\83^
\83C
\83v
58 typedef UINT_PTR NICOLIVE_PARAM;
62 ///NicoMyList
\82Ì
\83R
\81[
\83\8b\83o
\83b
\83N
\8aÖ
\90\94\82Ì
\83C
\83x
\83\93\83g
\83^
\83C
\83v
\8c^
64 typedef UINT_PTR NICOMYLIST_EVENT;
70 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83I
\83u
\83W
\83F
\83N
\83g
\83|
\83C
\83\93\83^
72 typedef struct nicolivestream_t *NicoLiveStream_P;
75 ///
\83j
\83R
\83j
\83R
\93®
\89æ
\94F
\8fØ
\83I
\83u
\83W
\83F
\83N
\83g
77 typedef struct nicovideoauth_t *NicoVideoAuth_P;
82 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83X
\83e
\81[
\83^
\83X
84 //typedef struct streamstatus_t *StreamStatus_P;
88 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\8fî
\95ñ
\83I
\83u
\83W
\83F
\83N
\83g
90 //typedef struct streaminfo_t *StreamInfo_P;
96 ///
\83j
\83R
\83j
\83R
\93®
\89æ
\83}
\83C
\83\8a\83X
\83g
\83A
\83C
\83e
\83\80\83I
\83u
\83W
\83F
\83N
\83g
98 typedef struct nicomylistitem_t *NicoMyListItem_P;
101 ///
\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
103 typedef struct nicoitemdata_t *NicoItemData_P;
106 ///
\83j
\83R
\83j
\83R
\93®
\89æ
\82Ì
\83}
\83C
\83\8a\83X
\83g
\83I
\83u
\83W
\83F
\83N
\83g
108 typedef struct nicomylist_t *NicoMyList_P;
111 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89
113 typedef NLIB_RESULT (*NicoRecvCallBack)(NICOLIVE_EVENT eventType,NicoLiveStream_P pNicoLiveStream,LPVOID option,NICOLIVE_PARAM param1,NICOLIVE_PARAM param2);
116 ///
\83j
\83R
\83j
\83R
\83}
\83C
\83\8a\83X
\83g
\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89
118 typedef NLIB_RESULT (*NicoMyListCallBack)(LPVOID option,NicoMyListItem_P pVideo);
121 ///
\83j
\83R
\83j
\83R
\83}
\83C
\83\8a\83X
\83g
\88ê
\97\97\83C
\83x
\83\93\83g
\83n
\83\93\83h
\83\89
123 typedef NLIB_RESULT (*NicoMyListGroupCallBack)(LPVOID option,NicoMyList_P pMyList);
127 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83`
\83\83\83b
\83g
\83R
\83\81\83\93\83g
\8d\
\91¢
\91Ì
142 }NicoLiveChat,*NicoLiveChat_P;
148 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83X
\83\8c\83b
\83h
\83R
\83\81\83\93\83g
\8d\
\91¢
\91Ì
155 }NicoLiveThreadComment,*NicoLiveThreadComment_P;
159 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\91\97\90M
\8c\8b\89Ê
\83R
\83\81\83\93\83g
\8d\
\91¢
\91Ì
165 }NicoLiveSendResultComment,*NicoLiveSendResultComment_P;
169 ///
\83j
\83R
\90¶
\83n
\81[
\83g
\83r
\81[
\83g
\8d\
\91¢
\91Ì
179 UINT_PTR commentCount;
186 }NicoLiveHeartBeat,*NicoLiveHeartBeat_P;
192 ///nlib
\97á
\8aO
\8f\88\97\9d\83N
\83\89\83X
194 class Exception:public std::exception{
197 std::wstring wErrMessage;
199 std::wstring fileName;
200 std::wstring function;
205 ///
\83R
\83\93\83X
\83g
\83\89\83N
\83^
208 Exception(const char* const& errMessage);
209 Exception(const wchar_t * const & errMessage,UINT_PTR in_line,LPCTSTR in_fileName,LPCTSTR in_function);
213 ///
\83G
\83\89\81[
\95¶
\8c¾
\8eæ
\93¾
219 ///
\83G
\83\89\81[
\94
\90¶
\8ds
\8eæ
\93¾
221 UINT_PTR getLineNo();
224 ///
\83G
\83\89\81[
\94
\90¶
\83t
\83@
\83C
\83\8b\96¼
\8eæ
\93¾
226 LPCTSTR getFileName();
230 ///
\83G
\83\89\81[
\94
\90¶
\8aÖ
\90\94\96¼
\82ð
\8eæ
\93¾
232 LPCTSTR getFunctionName();
244 ///nlib
\8f\89\8aú
\89»
\8aÖ
\90\94
246 NLIB_DECLSPEC NLIB_RESULT InitializeNLIB(HINTERNET hInternet);
249 ///nlib
\8cã
\8en
\96\96\8aÖ
\90\94
251 NLIB_DECLSPEC VOID FinalizeNLIB();
255 ///
\83G
\83\89\81[
\83\81\83b
\83Z
\81[
\83W
\8eæ
\93¾
257 NLIB_DECLSPEC LPCTSTR NLIB_GetErrorMessage(NLIB_RESULT rsltCode);
265 //
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\8aÖ
\98A
\8aÖ
\90\94
266 ////////////////////////////////////////////////////////////////////////////////////////////////////
270 ///
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83I
\83u
\83W
\83F
\83N
\83g
\93®
\93I
\90¶
\90¬
272 NLIB_DECLSPEC NicoLiveStream_P NicoLiveStream_new();
275 ///
\93®
\93I
\82É
\90¶
\90¬
\82µ
\82½
\83j
\83R
\83j
\83R
\90¶
\95ú
\91\97\83I
\83u
\83W
\83F
\83N
\83g
\82ð
\94j
\8aü
277 NLIB_DECLSPEC VOID NicoLiveStream_delete(NicoLiveStream_P* self);
280 ///
\8ew
\92è
\82µ
\82½URL
\82Ì
\95ú
\91\97\82É
\90Ú
\91±
282 NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_connect(NicoLiveStream_P self,NicoVideoAuth_P nicoVideoAuth,LPCTSTR url,NicoRecvCallBack callback,LPVOID option);
286 ///
\95ú
\91\97\82Æ
\82Ì
\90Ú
\91±
\82ð
\90Ø
\92f
\82·
\82é
288 NLIB_DECLSPEC VOID NicoLiveStream_disConnect(NicoLiveStream_P self);
291 ///
\90Ú
\91±
\8e\9e\82Ì
\8eó
\90M
\82·
\82é
\83R
\83\81\83\93\83g
\90\94\82ð
\90Ý
\92è
293 NLIB_DECLSPEC VOID NicoLiveStrream_setResFrom(NicoLiveStream_P self,INT_PTR res);
297 ///
\90Ú
\91±
\8e\9e\82Ì
\8eó
\90M
\82·
\82é
\83R
\83\81\83\93\83g
\90\94\82ð
\8eæ
\93¾
299 NLIB_DECLSPEC INT_PTR NicoLiveStream_getResFrom(NicoLiveStream_P self);
302 ///
\83n
\81[
\83g
\83r
\81[
\83g
\82Ì
\8aÔ
\8au
\82ð
\90Ý
\92è
\81i
\83~
\83\8a\95b)
304 NLIB_DECLSPEC VOID NicoLiveStream_setHeartBeatMsec(NicoLiveStream_P self,DWORD msec);
308 ///
\83n
\81[
\83g
\83r
\81[
\83g
\82Ì
\8aÔ
\8au
\82ð
\8eæ
\93¾(
\83~
\83\8a\95b)
310 NLIB_DECLSPEC DWORD NicoLiveStream_getHeartBeatMsec(NicoLiveStream_P self);
313 ///
\83n
\81[
\83g
\83r
\81[
\83g
\97L
\8cø
\81E
\96³
\8cø
\90Ý
\92è
315 NLIB_DECLSPEC VOID NicoLiveStream_setHeartBeatFlag(NicoLiveStream_P self,BOOL flag);
319 ///
\83n
\81[
\83g
\83r
\81[
\83g
\97L
\8cø
\83t
\83\89\83O
\8eæ
\93¾
321 NLIB_DECLSPEC BOOL NicoLiveStream_getHeartBeatFlag(NicoLiveStream_P self);
324 ///
\83L
\81[
\83v
\83A
\83\89\83C
\83u
\82Ì
\8aÔ
\8au
\82ð
\90Ý
\92è(
\83~
\83\8a\95b)
326 NLIB_DECLSPEC VOID NicoLiveStream_setKeapALiveMsec(NicoLiveStream_P self,DWORD msec);
329 ///
\83L
\81[
\83v
\83A
\83\89\83C
\83u
\82Ì
\8aÔ
\8au
\82ð
\8eæ
\93¾(
\83~
\83\8a\95b)
331 NLIB_DECLSPEC DWORD NicoLiveStream_getKeapALiveMsec(NicoLiveStream_P self);
335 ///
\83L
\81[
\83v
\83A
\83\89\83C
\83u
\97L
\8cø
\81E
\96³
\8cø
\90Ý
\92è
337 NLIB_DECLSPEC VOID NicoLiveStream_setKeapALiveFlag(NicoLiveStream_P self,BOOL flag);
341 ///
\83L
\81[
\83v
\83A
\83\89\83C
\83u
\83t
\83\89\83O
\8eæ
\93¾
343 NLIB_DECLSPEC BOOL NicoLiveStream_getKeapALiveFlag(NicoLiveStream_P self);
347 ///
\90¶
\95ú
\91\97\83X
\83e
\81[
\83^
\83X
\8eæ
\93¾
349 // NLIB_DECLSPEC StreamStatus_P NicoLiveStream_getStreamStatus(NicoLiveStream_P self);
352 ///
\83R
\83\81\83\93\83g
\91\97\90M
354 NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendChat(NicoLiveStream_P self,LPCTSTR chatbuf,LPCTSTR *mail,LPCTSTR *extends);
357 ///
\83n
\81[
\83g
\83r
\81[
\83g
\91\97\90M
359 NLIB_DECLSPEC NLIB_RESULT NicoLiveStream_sendHeartBeat(NicoLiveStream_P self);
363 ///
\90Ú
\91±
\92\86\82Ì
\95ú
\91\97\8fî
\95ñ
\82ð
\96â
\82¢
\8d\87\82í
\82¹
\82é
365 // NLIB_DECLSPEC StreamInfo_P NicoLiveStream_queryStreamInfo(NicoLiveStream_P self);
369 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82ÌID
\82ð
\8eæ
\93¾
371 NLIB_DECLSPEC LPCTSTR NicoLiveStream_getId(NicoLiveStream_P self);
375 ///
\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¾
377 NLIB_DECLSPEC LPCTSTR NicoLiveStream_getDefaultCommunity(NicoLiveStream_P self);
381 ///
\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¾
383 NLIB_DECLSPEC PROVIDERTYPE NicoLiveStream_getProviderType(NicoLiveStream_P self);
387 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83I
\81[
\83i
\81[
\83t
\83\89\83O
\82ð
\8eæ
\93¾
389 NLIB_DECLSPEC BOOL NicoLiveStream_isOwner(NicoLiveStream_P self);
392 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\8aJ
\8en
\8e\9e\8d\8f\82ð
\8eæ
\93¾
394 NLIB_DECLSPEC time_t NicoLiveStream_getStartTime(NicoLiveStream_P self);
397 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\8fI
\97¹
\8e\9e\8d\8f\82ð
\8eæ
\93¾
399 NLIB_DECLSPEC time_t NicoLiveStream_getEndTime(NicoLiveStream_P self);
402 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\8aJ
\8fê
\8e\9e\8d\8f\82ð
\8eæ
\93¾
404 NLIB_DECLSPEC time_t NicoLiveStream_getOpenTime(NicoLiveStream_P self);
407 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83x
\81[
\83X
\8e\9e\8d\8f\82ð
\8eæ
\93¾
409 NLIB_DECLSPEC time_t NicoLiveStream_getBaseTime(NicoLiveStream_P self);
413 ///
\83X
\83g
\83\8a\81[
\83\80\83X
\83e
\81[
\83^
\83X
\82Ì
\83^
\83C
\83g
\83\8b\8eæ
\93¾
415 NLIB_DECLSPEC LPCTSTR NicoLiveStream_getTitle(NicoLiveStream_P self);
419 ///
\83v
\83\8c\83~
\83A
\83\80\83t
\83\89\83O
\82Ì
\8eæ
\93¾
421 NLIB_DECLSPEC BOOL NicoLiveStream_isPremium(NicoLiveStream_P self);
424 //
\83j
\83R
\83j
\83R
\93®
\89æ
\94F
\8fØ
\8aÖ
\98A
\8aÖ
\90\94
425 /////////////////////////////////////////////////////////////////////////////////////////////////
428 ///
\83j
\83R
\83j
\83R
\93®
\89æ
\94F
\8fØ
\83I
\83u
\83W
\83F
\83N
\83g
\90¶
\90¬
430 NLIB_DECLSPEC NicoVideoAuth_P NicoVideoAuth_new();
433 ///
\83j
\83R
\83j
\83R
\93®
\89æ
\94F
\8fØ
\83I
\83u
\83W
\83F
\83N
\83g
\94j
\8aü
435 NLIB_DECLSPEC VOID NicoVideoAuth_delete(NicoVideoAuth_P *self);
439 ///
\83\86\81[
\83U
\81[
\83Z
\83b
\83V
\83\87\83\93\8eæ
\93¾
441 NLIB_DECLSPEC LPCTSTR NicoVideoAuth_getUserSession(NicoVideoAuth_P self);
444 ///
\83j
\83R
\83j
\83R
\93®
\89æ
\94F
\8fØ
\8fî
\95ñ
\8eæ
\93¾
446 NLIB_DECLSPEC NLIB_RESULT NicoVideoAuth_getNicoVideoAuth(NicoVideoAuth_P self,BROWSERTYPE browserType);
450 //
\83j
\83R
\83j
\83R
\93®
\89æ
\83}
\83C
\83\8a\83X
\83g
\8aÖ
\98A
\8aÖ
\90\94
451 ////////////////////////////////////////////////////////////////////////////////////////////////////
454 ///
\82Æ
\82è
\82 \82¦
\82¸
\83}
\83C
\83\8a\83X
\83g
\88ê
\97\97\8eæ
\93¾
456 NLIB_DECLSPEC NLIB_RESULT NicoMyList_getDefList(NicoVideoAuth_P pAuth,NicoMyListCallBack callback,LPVOID option);
459 ///
\83}
\83C
\83\8a\83X
\83g
\8eæ
\93¾
461 NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyList(NicoVideoAuth_P pAuth,LPCTSTR id,NicoMyListCallBack callback,LPVOID option);
464 ///
\83}
\83C
\83\8a\83X
\83g
\83O
\83\8b\81[
\83v
\8eæ
\93¾
466 NLIB_DECLSPEC NLIB_RESULT NicoMyList_getMyListGroup(NicoVideoAuth_P pAuth,NicoMyListGroupCallBack callback,LPVOID option);
470 ///
\83}
\83C
\83\8a\83X
\83g
\93o
\98^
\8cÄ
\82Ñ
\8fo
\82µ
472 NLIB_DECLSPEC NLIB_RESULT NicoMyList_addItem(LPCTSTR video_id);
485 #pragma comment(lib,"Wininet.lib")
486 #pragma comment(lib,"WinHttp.lib")
487 #pragma comment(lib,"Iepmapi.lib")
488 #pragma comment(lib,"ws2_32.lib")
489 #pragma comment(lib, "shell32.lib" )
490 #pragma comment(lib,"expat.lib")
491 #pragma comment(lib,"sqlite3.lib")
492 #pragma comment(lib,"sqliteManager.lib")
493 #pragma comment(lib,"shareCookie.lib")
494 #pragma comment(lib,"winmm.lib")
495 #pragma comment(lib,"JSONParser.lib")