OSDN Git Service

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