OSDN Git Service

規定のブラウザとのクッキー共有機能実装
[nlite/nlite.git] / nlite / nlite_commentWrite.h
1 #pragma once
2
3 namespace nlite{
4
5         template <typename T>
6         struct CommentInfo{
7                 LPCTSTR name;
8                 T userData;
9         };
10
11         typedef CommentInfo<COLORREF> CommentColorInfo;
12         typedef CommentInfo<LPCTSTR> CommentSizeInfo; 
13         typedef CommentInfo<LPCTSTR> CommentPosInfo;
14
15         class CNicoLiveStream;
16
17         ///
18         ///\88ê\94Ê\89ï\88õ\83R\83}\83\93\83h
19         ///
20         namespace generalUser{
21                 ///
22                 ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
23                 ///
24                 extern const  CommentColorInfo COMMENT_COLORLIST[];
25
26                 ///
27                 ///\88ê\94Ê\89ï\88õ\83T\83C\83Y\83R\83}\83\93\83h\83\8a\83X\83g
28                 ///
29                 extern const CommentSizeInfo COMMENT_SIZELIST[];
30
31                 ///
32                 ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\88Ê\92u\83\8a\83X\83g
33                 ///
34                 extern const CommentPosInfo COMMENT_POSLIST[];
35
36         }
37
38         ///
39         ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83}\83\93\83h
40         ///
41         namespace premiumUser{
42                 ///
43                 ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
44                 ///
45                 extern const CommentColorInfo COMMENT_COLORLIST[];
46
47
48                 ///
49                 ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83T\83C\83Y\83R\83}\83\93\83h\83\8a\83X\83g
50                 ///
51                 extern const CommentSizeInfo COMMENT_SIZELIST[];
52
53                 ///
54                 ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\88Ê\92u\83\8a\83X\83g
55                 ///
56                 extern const CommentPosInfo COMMENT_POSLIST[];
57
58         }
59
60
61         class CCommentWriteWindow;
62         class CSubChatEdit:public CWindowImpl<CSubChatEdit,CEdit>{
63                 friend CCommentWriteWindow;
64
65
66         private:
67                 CCommentWriteWindow &self;
68                 CComAutoCriticalSection cs;
69                 BOOL untilConnectingFlag;
70
71         public:
72                 CSubChatEdit(CCommentWriteWindow &in_commentWriteWindow):self(in_commentWriteWindow){}
73
74
75                 BEGIN_MSG_MAP_EX(CSubLiveNoComboBox)
76                         MSG_WM_KEYDOWN(OnKeyDown)
77                 END_MSG_MAP()
78
79                         void OnKeyDown(TCHAR wParam, UINT upLParam,UINT loLParam);
80
81
82                         VOID AgreeEnter();
83
84                         static VOID EnterChatBox(LPVOID userData);
85         };
86
87
88         const static LPCTSTR COMMENTWRITEWINDOW = TEXT("commentWriteWindow");
89
90
91         ///
92         ///\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\97p\83E\83B\83\93\83h\83E\83N\83\89\83X
93         ///
94         class CCommentWriteWindow:public CWindowImpl<CCommentWriteWindow>{
95
96                 friend CSubChatEdit;
97         private:
98                 CComboBox commentPosBox;                                                                //\83R\83\81\83\93\83g\88Ê\92u\91I\91ð\83R\83\93\83{\83{\83b\83N\83X
99                 CComAutoCriticalSection commentPosBoxCS;                                //\83R\83\81\83\93\83g\88Ê\92u\91I\91ð\83R\83\93\83{\83{\83b\83N\83X\83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93
100                 CComboBox commentSizeBox;                                                               //\83R\83\81\83\93\83g\82Ì\91å\82«\82³\91I\91ð\83R\83\93\83{\83{\83b\83N\83X
101                 CComAutoCriticalSection commentSizeBoxCS;                               //\83R\83\81\83\93\83g\82Ì\91å\82«\82³\91I\91ð\83R\83\93\83{\83{\83b\83N\83X\83N\83\8a\83e\83B\83J\83\8b\83Z\83N\83V\83\87\83\93
102                 CComboBox commentColorBox;                                                              //\83R\83\81\83\93\83g\90F\91I\91ð\83R\83\93\83{\83{\83b\83N\83X
103                 CButton anonymousButton;                                                                //184\91I\91ð\83{\83^\83\93
104                 CButton ownerModeButton;                                                                //\8eå\83R\83\81\91I\91ð\83{\83^\83\93
105                 CSubChatEdit commentSubEdit;                                                    //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\97p\83G\83f\83B\83b\83g\83T\83u\83N\83\89\83X
106                 CButton commentWriteButton;                                                             //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83{\83^\83\93
107                 UINT_PTR commentWriteMaxLength;                                                 //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\92·\8dÅ\91å\92l
108                 UINT_PTR commentWriteHeight;                                                    //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83R\83\93\83g\83\8d\81[\83\8b\94z\92u\97Ì\88æ\82Ì\8d\82\82³
109                 UINT_PTR infoDispHeight;                                                                //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\82É\8aÖ\82·\82é\82à\82Ì\88È\8aO\82Ì\8fî\95ñ\95\\8e¦\97Ì\88æ\82Ì\8d\82\82³
110                 UINT_PTR commentWriteInternalHeight;                                    //\83R\83\81\83\93\83g\8f\91\82«\8d\9e\82Ý\83R\83\93\83g\83\8d\81[\83\8b\94z\92u\97Ì\88æ\82Ì\8d\82\82³(\93à\95\94)
111                 CNicoLiveStream &nicoLiveStream;                                                //\95ú\91\97\83I\83u\83W\83F\83N\83g\82Ì\8eQ\8fÆ
112                 time_t streamTime;                                                                              //\95ú\91\97\8co\89ß\8e\9e\8aÔ
113                 CFont checkButtonFont;                                                                  //184\95\\8e¦\97p\83t\83H\83\93\83g
114                 CFont timeFont;                                                                                 //\8co\89ß\8e\9e\8aÔ\95\\8e¦\97p\83t\83H\83\93\83g
115                 COLORREF editBkColor;                                                                   //\83G\83f\83B\83b\83g\82Ì\94w\8ci\90F
116                 CBrush editBkBrush;                                                                             //\83G\83f\83B\83b\83g\82Ì\94w\8ci\83u\83\89\83V
117                 
118
119                 //\83R\83\93\83g\83\8d\81[\83\8bID
120                 enum CONTROLID{
121                         COMMENTPOS_BOX = 1,
122                         COMMENTSIZE_BOX = 2,
123                         COMMENTCOLOR_BOX = 3,
124                         ANONYMOUS_BUTTON = 4,
125                         COMMENT_EDIT = 5,
126                         COMMENTWRITE_BOTTON = 6,
127                         TIMER_ID = 7,
128                         OWNERMODE_BUTTON = 5
129                 };
130                 
131
132
133         public:
134
135                 DECLARE_WND_CLASS(COMMENTWRITEWINDOW)
136                 //\83\81\83b\83Z\81[\83W\83}\83b\83v
137                 BEGIN_MSG_MAP(CCommentWriteWindow)
138                         MSG_WM_CREATE(OnCreate)
139                         MSG_WM_DESTROY(OnDestroy)
140                         MSG_WM_PAINT(OnPaint)
141                         MSG_WM_SIZE(OnSize)
142                         MSG_WM_ERASEBKGND(OnEraseBkGnd)
143                         MSG_WM_CTLCOLOREDIT(OnCtlolorEdit)
144                         MSG_WM_DRAWITEM(OnDrawItem)
145                         MSG_WM_MEASUREITEM(OnMeasureItem)
146                         MSG_WM_TIMER(OnTimer)
147                         COMMAND_CODE_HANDLER_EX(BN_CLICKED,OnButton)
148                 END_MSG_MAP()
149
150
151
152
153                 public:
154
155                 ///
156                 ///\83R\83\93\83X\83g\83\89\83N\83^
157                 ///
158                 CCommentWriteWindow(CNicoLiveStream &nicoLiveStream);
159
160                 ///
161                 ///\8c»\8dÝ\8f\91\82«\8d\9e\82Ý\8f\88\97\9d\92\86\82©\82Ì\83t\83\89\83O\8am\94F
162                 ///
163                 BOOL IsWrighthing();
164
165
166                 ///
167                 ///\82±\82Ì\83E\83B\83\93\83h\83E\82Ì\8d\82\82³\82ð\8eæ\93¾
168                 ///
169                 UINT_PTR GetHeight();
170
171                 ///
172                 ///\83R\83\81\83\93\83g\91\97\90M
173                 ///
174                 BOOL SendChat();
175
176                 ///
177                 ///\83R\83\81\83\93\83g\91\97\90M\97\93\82É\95\8e\9a\97ñ\82ð\90Ý\92è
178                 ///
179                 BOOL SetText(LPCTSTR lpStr);
180
181                 ///
182                 ///\83R\83\81\83\93\83g\8eó\90M\8aJ\8en\8e\9e\82Ì\8f\88\97\9d
183                 ///
184                 VOID OnChatReceveStart(CNicoLiveStream &nicoLiveStream,NicoLiveThreadComment_P threadComment);
185
186                 ///
187                 ///\83R\83\81\83\93\83g\91\97\90M\8c\8b\89Ê\8eó\90M\8e\9e\82Ì\8f\88\97\9d
188                 ///
189                 VOID OnSendChatResult();
190
191                 ///
192                 ///\83n\81[\83g\83r\81[\83g\91\97\90M\8e\9e\82Ì\8f\88\97\9d
193                 ///
194                 VOID OnHeartBeat(NicoLiveHeartBeat_P heartBeat);
195
196                 ///
197                 ///\95ú\91\97\90Ø\92f\8e\9e\82Ì\8f\88\97\9d
198                 ///
199                 VOID OnDisConnect();
200
201                 //
202                 //\83\81\83b\83Z\81[\83W\83n\83\93\83h\83\89
203                 //
204         private:
205
206                 ///
207                 ///\83E\83B\83\93\83h\83E\8dì\90¬\8e\9e\82Ì\8f\88\97\9d
208                 ///
209                 LRESULT OnCreate(LPCREATESTRUCT lpReateStruct);
210
211
212                 ///
213                 ///\83E\83B\83\93\83h\83E\94j\8aü\8e\9e\82Ì\8f\88\97\9d
214                 ///
215                 VOID OnDestroy();
216
217                 ///
218                 ///\95`\89æ\8e\9e\82Ì\8f\88\97\9d
219                 ///
220                 VOID OnPaint(HDC hdc);
221
222
223                 ///
224                 ///\83T\83C\83Y\95Ï\8dX\8e\9e\82Ì\8f\88\97\9d
225                 ///
226                 LRESULT OnSize(UINT wParam,SIZE lParam);
227
228                 ///
229                 ///\83T\83C\83Y\95Ï\8dX\8f\88\97\9d
230                 ///
231                 VOID ChangeSize(SIZE &size);
232
233
234                 ///
235                 ///\83A\83C\83e\83\80\95`\89æ\8f\88\97\9d
236                 ///
237                 VOID OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lParam);
238
239                 ///
240                 ///\83A\83C\83e\83\80\82Ì\8d\82\82³\95Ï\8dX\8f\88\97\9d
241                 ///
242                 VOID OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam);
243
244                 ///
245                 ///\94w\8ci\82Ì\83`\83\89\83c\83L\82ð\97}\82¦\82é
246                 ///
247                 LRESULT OnEraseBkGnd(HDC wParam);
248
249                 ///
250                 ///\83{\83^\83\93\89\9f\89º\8e\9e\82Ì\8f\88\97\9d
251                 ///
252                 LRESULT OnButton(UINT hiWparam,INT_PTR loWparam,HWND lParam);
253
254
255                 ///
256                 ///\83G\83f\83B\83b\83g\83R\83\93\83g\83\8d\81[\83\8b\83J\83X\83^\83\80\83h\83\8d\81[
257                 ///
258                 LRESULT OnCtlolorEdit(HDC hdc,HWND hWnd);
259
260                 VOID OnTimer(UINT id);
261
262
263         };
264
265 }