Clean up CPDF_AnnotList.
[pdfium.git] / fpdfsdk / src / javascript / JS_EventHandler.cpp
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #include "JS_EventHandler.h"
8
9 #include "../../include/javascript/IJavaScript.h"
10 #include "Document.h"
11 #include "Field.h"
12 #include "JS_Context.h"
13 #include "JS_Define.h"
14 #include "JS_Object.h"
15 #include "JS_Runtime.h"
16 #include "JS_Value.h"
17
18 /* ---------------------------- CJS_EventHandler ---------------------------- */
19
20 CJS_EventHandler::CJS_EventHandler(CJS_Context* pContext)
21     : m_pJSContext(pContext),
22       m_eEventType(JET_UNKNOWN),
23       m_bValid(FALSE),
24       m_pWideStrChange(NULL),
25       m_nCommitKey(-1),
26       m_bKeyDown(FALSE),
27       m_bModifier(FALSE),
28       m_bShift(FALSE),
29       m_pISelEnd(NULL),
30       m_nSelEndDu(0),
31       m_pISelStart(NULL),
32       m_nSelStartDu(0),
33       m_bWillCommit(FALSE),
34       m_pValue(NULL),
35       m_bFieldFull(FALSE),
36       m_pbRc(NULL),
37       m_bRcDu(FALSE),
38       m_pSourceDoc(NULL),
39       m_pTargetBookMark(NULL),
40       m_pTargetDoc(NULL),
41       m_pTargetAnnot(NULL) {}
42
43 CJS_EventHandler::~CJS_EventHandler() {}
44
45 void CJS_EventHandler::OnApp_Init() {
46   Initial(JET_APP_INIT);
47 }
48
49 void CJS_EventHandler::OnDoc_Open(CPDFSDK_Document* pDoc,
50                                   const CFX_WideString& strTargetName) {
51   Initial(JET_DOC_OPEN);
52
53   m_pTargetDoc = pDoc;
54   m_strTargetName = strTargetName;
55 }
56
57 void CJS_EventHandler::OnDoc_WillPrint(CPDFSDK_Document* pDoc) {
58   Initial(JET_DOC_WILLPRINT);
59
60   m_pTargetDoc = pDoc;
61 }
62
63 void CJS_EventHandler::OnDoc_DidPrint(CPDFSDK_Document* pDoc) {
64   Initial(JET_DOC_DIDPRINT);
65
66   m_pTargetDoc = pDoc;
67 }
68
69 void CJS_EventHandler::OnDoc_WillSave(CPDFSDK_Document* pDoc) {
70   Initial(JET_DOC_WILLSAVE);
71   m_pTargetDoc = pDoc;
72 }
73
74 void CJS_EventHandler::OnDoc_DidSave(CPDFSDK_Document* pDoc) {
75   Initial(JET_DOC_DIDSAVE);
76
77   m_pTargetDoc = pDoc;
78 }
79
80 void CJS_EventHandler::OnDoc_WillClose(CPDFSDK_Document* pDoc) {
81   Initial(JET_DOC_WILLCLOSE);
82
83   m_pTargetDoc = pDoc;
84 }
85
86 void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc) {
87   Initial(JET_PAGE_OPEN);
88
89   m_pTargetDoc = pDoc;
90 }
91
92 void CJS_EventHandler::OnPage_Close(CPDFSDK_Document* pDoc) {
93   Initial(JET_PAGE_CLOSE);
94
95   m_pTargetDoc = pDoc;
96 }
97
98 void CJS_EventHandler::OnPage_InView(CPDFSDK_Document* pDoc) {
99   Initial(JET_PAGE_INVIEW);
100
101   m_pTargetDoc = pDoc;
102 }
103
104 void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc) {
105   Initial(JET_PAGE_OUTVIEW);
106
107   m_pTargetDoc = pDoc;
108 }
109
110 void CJS_EventHandler::OnField_MouseEnter(FX_BOOL bModifier,
111                                           FX_BOOL bShift,
112                                           CPDF_FormField* pTarget) {
113   Initial(JET_FIELD_MOUSEENTER);
114
115   m_bModifier = bModifier;
116   m_bShift = bShift;
117
118   ASSERT(pTarget != NULL);
119   m_strTargetName = pTarget->GetFullName();
120 }
121
122 void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier,
123                                          FX_BOOL bShift,
124                                          CPDF_FormField* pTarget) {
125   Initial(JET_FIELD_MOUSEEXIT);
126
127   m_bModifier = bModifier;
128   m_bShift = bShift;
129   ASSERT(pTarget != NULL);
130   m_strTargetName = pTarget->GetFullName();
131 }
132
133 void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier,
134                                          FX_BOOL bShift,
135                                          CPDF_FormField* pTarget) {
136   Initial(JET_FIELD_MOUSEDOWN);
137   m_eEventType = JET_FIELD_MOUSEDOWN;
138
139   m_bModifier = bModifier;
140   m_bShift = bShift;
141   ASSERT(pTarget != NULL);
142   m_strTargetName = pTarget->GetFullName();
143 }
144
145 void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier,
146                                        FX_BOOL bShift,
147                                        CPDF_FormField* pTarget) {
148   Initial(JET_FIELD_MOUSEUP);
149
150   m_bModifier = bModifier;
151   m_bShift = bShift;
152   ASSERT(pTarget != NULL);
153   m_strTargetName = pTarget->GetFullName();
154 }
155
156 void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier,
157                                      FX_BOOL bShift,
158                                      CPDF_FormField* pTarget,
159                                      const CFX_WideString& Value) {
160   Initial(JET_FIELD_FOCUS);
161
162   m_bModifier = bModifier;
163   m_bShift = bShift;
164   ASSERT(pTarget != NULL);
165   m_strTargetName = pTarget->GetFullName();
166   m_pValue = (CFX_WideString*)&Value;
167 }
168
169 void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier,
170                                     FX_BOOL bShift,
171                                     CPDF_FormField* pTarget,
172                                     const CFX_WideString& Value) {
173   Initial(JET_FIELD_BLUR);
174
175   m_bModifier = bModifier;
176   m_bShift = bShift;
177   ASSERT(pTarget != NULL);
178   m_strTargetName = pTarget->GetFullName();
179   m_pValue = (CFX_WideString*)&Value;
180 }
181
182 void CJS_EventHandler::OnField_Keystroke(CFX_WideString& strChange,
183                                          const CFX_WideString& strChangeEx,
184                                          FX_BOOL KeyDown,
185                                          FX_BOOL bModifier,
186                                          int& nSelEnd,
187                                          int& nSelStart,
188                                          FX_BOOL bShift,
189                                          CPDF_FormField* pTarget,
190                                          CFX_WideString& Value,
191                                          FX_BOOL bWillCommit,
192                                          FX_BOOL bFieldFull,
193                                          FX_BOOL& bRc) {
194   Initial(JET_FIELD_KEYSTROKE);
195
196   m_nCommitKey = 0;
197   m_pWideStrChange = &strChange;
198   m_WideStrChangeEx = strChangeEx;
199   m_bKeyDown = KeyDown;
200   m_bModifier = bModifier;
201   m_pISelEnd = &nSelEnd;
202   m_pISelStart = &nSelStart;
203   m_bShift = bShift;
204   ASSERT(pTarget != NULL);
205   m_strTargetName = pTarget->GetFullName();
206   m_pValue = &Value;
207   m_bWillCommit = bWillCommit;
208   m_pbRc = &bRc;
209   m_bFieldFull = bFieldFull;
210 }
211
212 void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange,
213                                         const CFX_WideString& strChangeEx,
214                                         FX_BOOL bKeyDown,
215                                         FX_BOOL bModifier,
216                                         FX_BOOL bShift,
217                                         CPDF_FormField* pTarget,
218                                         CFX_WideString& Value,
219                                         FX_BOOL& bRc) {
220   Initial(JET_FIELD_VALIDATE);
221
222   m_pWideStrChange = &strChange;
223   m_WideStrChangeEx = strChangeEx;
224   m_bKeyDown = bKeyDown;
225   m_bModifier = bModifier;
226   m_bShift = bShift;
227   ASSERT(pTarget != NULL);
228   m_strTargetName = pTarget->GetFullName();
229   m_pValue = &Value;
230   m_pbRc = &bRc;
231 }
232
233 void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource,
234                                          CPDF_FormField* pTarget,
235                                          CFX_WideString& Value,
236                                          FX_BOOL& bRc) {
237   Initial(JET_FIELD_CALCULATE);
238
239   if (pSource)
240     m_strSourceName = pSource->GetFullName();
241   ASSERT(pTarget != NULL);
242   m_strTargetName = pTarget->GetFullName();
243   m_pValue = &Value;
244   m_pbRc = &bRc;
245 }
246
247 void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
248                                       CFX_WideString& Value,
249                                       FX_BOOL bWillCommit) {
250   Initial(JET_FIELD_FORMAT);
251
252   m_nCommitKey = 0;
253   ASSERT(pTarget != NULL);
254   m_strTargetName = pTarget->GetFullName();
255   m_pValue = &Value;
256   m_bWillCommit = bWillCommit;
257 }
258
259 void CJS_EventHandler::OnScreen_Focus(FX_BOOL bModifier,
260                                       FX_BOOL bShift,
261                                       CPDFSDK_Annot* pScreen) {
262   Initial(JET_SCREEN_FOCUS);
263
264   m_bModifier = bModifier;
265   m_bShift = bShift;
266   m_pTargetAnnot = pScreen;
267 }
268
269 void CJS_EventHandler::OnScreen_Blur(FX_BOOL bModifier,
270                                      FX_BOOL bShift,
271                                      CPDFSDK_Annot* pScreen) {
272   Initial(JET_SCREEN_BLUR);
273
274   m_bModifier = bModifier;
275   m_bShift = bShift;
276   m_pTargetAnnot = pScreen;
277 }
278
279 void CJS_EventHandler::OnScreen_Open(FX_BOOL bModifier,
280                                      FX_BOOL bShift,
281                                      CPDFSDK_Annot* pScreen) {
282   Initial(JET_SCREEN_OPEN);
283
284   m_bModifier = bModifier;
285   m_bShift = bShift;
286   m_pTargetAnnot = pScreen;
287 }
288
289 void CJS_EventHandler::OnScreen_Close(FX_BOOL bModifier,
290                                       FX_BOOL bShift,
291                                       CPDFSDK_Annot* pScreen) {
292   Initial(JET_SCREEN_CLOSE);
293
294   m_bModifier = bModifier;
295   m_bShift = bShift;
296   m_pTargetAnnot = pScreen;
297 }
298
299 void CJS_EventHandler::OnScreen_MouseDown(FX_BOOL bModifier,
300                                           FX_BOOL bShift,
301                                           CPDFSDK_Annot* pScreen) {
302   Initial(JET_SCREEN_MOUSEDOWN);
303
304   m_bModifier = bModifier;
305   m_bShift = bShift;
306   m_pTargetAnnot = pScreen;
307 }
308
309 void CJS_EventHandler::OnScreen_MouseUp(FX_BOOL bModifier,
310                                         FX_BOOL bShift,
311                                         CPDFSDK_Annot* pScreen) {
312   Initial(JET_SCREEN_MOUSEUP);
313
314   m_bModifier = bModifier;
315   m_bShift = bShift;
316   m_pTargetAnnot = pScreen;
317 }
318
319 void CJS_EventHandler::OnScreen_MouseEnter(FX_BOOL bModifier,
320                                            FX_BOOL bShift,
321                                            CPDFSDK_Annot* pScreen) {
322   Initial(JET_SCREEN_MOUSEENTER);
323
324   m_bModifier = bModifier;
325   m_bShift = bShift;
326   m_pTargetAnnot = pScreen;
327 }
328
329 void CJS_EventHandler::OnScreen_MouseExit(FX_BOOL bModifier,
330                                           FX_BOOL bShift,
331                                           CPDFSDK_Annot* pScreen) {
332   Initial(JET_SCREEN_MOUSEEXIT);
333
334   m_bModifier = bModifier;
335   m_bShift = bShift;
336   m_pTargetAnnot = pScreen;
337 }
338
339 void CJS_EventHandler::OnScreen_InView(FX_BOOL bModifier,
340                                        FX_BOOL bShift,
341                                        CPDFSDK_Annot* pScreen) {
342   Initial(JET_SCREEN_INVIEW);
343
344   m_bModifier = bModifier;
345   m_bShift = bShift;
346   m_pTargetAnnot = pScreen;
347 }
348
349 void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier,
350                                         FX_BOOL bShift,
351                                         CPDFSDK_Annot* pScreen) {
352   Initial(JET_SCREEN_OUTVIEW);
353
354   m_bModifier = bModifier;
355   m_bShift = bShift;
356   m_pTargetAnnot = pScreen;
357 }
358
359 void CJS_EventHandler::OnLink_MouseUp(CPDFSDK_Document* pTarget) {
360   Initial(JET_LINK_MOUSEUP);
361
362   m_pTargetDoc = pTarget;
363 }
364
365 void CJS_EventHandler::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) {
366   Initial(JET_BOOKMARK_MOUSEUP);
367
368   m_pTargetBookMark = pBookMark;
369 }
370
371 void CJS_EventHandler::OnMenu_Exec(CPDFSDK_Document* pTarget,
372                                    const CFX_WideString& strTargetName) {
373   Initial(JET_MENU_EXEC);
374
375   m_pTargetDoc = pTarget;
376   m_strTargetName = strTargetName;
377 }
378
379 void CJS_EventHandler::OnExternal_Exec() {
380   Initial(JET_EXTERNAL_EXEC);
381 }
382
383 void CJS_EventHandler::OnBatchExec(CPDFSDK_Document* pTarget) {
384   Initial(JET_BATCH_EXEC);
385
386   m_pTargetDoc = pTarget;
387 }
388
389 void CJS_EventHandler::OnConsole_Exec() {
390   Initial(JET_CONSOLE_EXEC);
391 }
392
393 void CJS_EventHandler::Initial(JS_EVENT_T type) {
394   m_eEventType = type;
395
396   m_strTargetName = L"";
397   m_strSourceName = L"";
398   m_pWideStrChange = NULL;
399   m_WideStrChangeDu = L"";
400   m_WideStrChangeEx = L"";
401   m_nCommitKey = -1;
402   m_bKeyDown = FALSE;
403   m_bModifier = FALSE;
404   m_bShift = FALSE;
405   m_pISelEnd = NULL;
406   m_nSelEndDu = 0;
407   m_pISelStart = NULL;
408   m_nSelStartDu = 0;
409   m_bWillCommit = FALSE;
410   m_pValue = NULL;
411   m_bFieldFull = FALSE;
412   m_pbRc = NULL;
413   m_bRcDu = FALSE;
414
415   m_pSourceDoc = NULL;
416   m_pTargetBookMark = NULL;
417   m_pTargetDoc = NULL;
418   m_pTargetAnnot = NULL;
419
420   m_bValid = TRUE;
421 }
422
423 void CJS_EventHandler::Destroy() {
424   m_bValid = FALSE;
425 }
426
427 FX_BOOL CJS_EventHandler::IsValid() {
428   return m_bValid;
429 }
430
431 CFX_WideString& CJS_EventHandler::Change() {
432   if (m_pWideStrChange) {
433     return *m_pWideStrChange;
434   }
435   return m_WideStrChangeDu;
436 }
437
438 CFX_WideString CJS_EventHandler::ChangeEx() {
439   return m_WideStrChangeEx;
440 }
441
442 int CJS_EventHandler::CommitKey() {
443   return m_nCommitKey;
444 }
445
446 FX_BOOL CJS_EventHandler::FieldFull() {
447   return m_bFieldFull;
448 }
449
450 FX_BOOL CJS_EventHandler::KeyDown() {
451   return m_bKeyDown;
452 }
453
454 FX_BOOL CJS_EventHandler::Modifier() {
455   return m_bModifier;
456 }
457
458 const FX_WCHAR* CJS_EventHandler::Name() {
459   switch (m_eEventType) {
460     case JET_APP_INIT:
461       return L"Init";
462     case JET_BATCH_EXEC:
463       return L"Exec";
464     case JET_BOOKMARK_MOUSEUP:
465       return L"Mouse Up";
466     case JET_CONSOLE_EXEC:
467       return L"Exec";
468     case JET_DOC_DIDPRINT:
469       return L"DidPrint";
470     case JET_DOC_DIDSAVE:
471       return L"DidSave";
472     case JET_DOC_OPEN:
473       return L"Open";
474     case JET_DOC_WILLCLOSE:
475       return L"WillClose";
476     case JET_DOC_WILLPRINT:
477       return L"WillPrint";
478     case JET_DOC_WILLSAVE:
479       return L"WillSave";
480     case JET_EXTERNAL_EXEC:
481       return L"Exec";
482     case JET_FIELD_FOCUS:
483     case JET_SCREEN_FOCUS:
484       return L"Focus";
485     case JET_FIELD_BLUR:
486     case JET_SCREEN_BLUR:
487       return L"Blur";
488     case JET_FIELD_MOUSEDOWN:
489     case JET_SCREEN_MOUSEDOWN:
490       return L"Mouse Down";
491     case JET_FIELD_MOUSEUP:
492     case JET_SCREEN_MOUSEUP:
493       return L"Mouse Up";
494     case JET_FIELD_MOUSEENTER:
495     case JET_SCREEN_MOUSEENTER:
496       return L"Mouse Enter";
497     case JET_FIELD_MOUSEEXIT:
498     case JET_SCREEN_MOUSEEXIT:
499       return L"Mouse Exit";
500     case JET_FIELD_CALCULATE:
501       return L"Calculate";
502     case JET_FIELD_FORMAT:
503       return L"Format";
504     case JET_FIELD_KEYSTROKE:
505       return L"Keystroke";
506     case JET_FIELD_VALIDATE:
507       return L"Validate";
508     case JET_LINK_MOUSEUP:
509       return L"Mouse Up";
510     case JET_MENU_EXEC:
511       return L"Exec";
512     case JET_PAGE_OPEN:
513     case JET_SCREEN_OPEN:
514       return L"Open";
515     case JET_PAGE_CLOSE:
516     case JET_SCREEN_CLOSE:
517       return L"Close";
518     case JET_SCREEN_INVIEW:
519     case JET_PAGE_INVIEW:
520       return L"InView";
521     case JET_PAGE_OUTVIEW:
522     case JET_SCREEN_OUTVIEW:
523       return L"OutView";
524     default:
525       return L"";
526   }
527
528   return L"";
529 }
530
531 const FX_WCHAR* CJS_EventHandler::Type() {
532   switch (m_eEventType) {
533     case JET_APP_INIT:
534       return L"App";
535     case JET_BATCH_EXEC:
536       return L"Batch";
537     case JET_BOOKMARK_MOUSEUP:
538       return L"BookMark";
539     case JET_CONSOLE_EXEC:
540       return L"Console";
541     case JET_DOC_DIDPRINT:
542     case JET_DOC_DIDSAVE:
543     case JET_DOC_OPEN:
544     case JET_DOC_WILLCLOSE:
545     case JET_DOC_WILLPRINT:
546     case JET_DOC_WILLSAVE:
547       return L"Doc";
548     case JET_EXTERNAL_EXEC:
549       return L"External";
550     case JET_FIELD_BLUR:
551     case JET_FIELD_FOCUS:
552     case JET_FIELD_MOUSEDOWN:
553     case JET_FIELD_MOUSEENTER:
554     case JET_FIELD_MOUSEEXIT:
555     case JET_FIELD_MOUSEUP:
556     case JET_FIELD_CALCULATE:
557     case JET_FIELD_FORMAT:
558     case JET_FIELD_KEYSTROKE:
559     case JET_FIELD_VALIDATE:
560       return L"Field";
561     case JET_SCREEN_FOCUS:
562     case JET_SCREEN_BLUR:
563     case JET_SCREEN_OPEN:
564     case JET_SCREEN_CLOSE:
565     case JET_SCREEN_MOUSEDOWN:
566     case JET_SCREEN_MOUSEUP:
567     case JET_SCREEN_MOUSEENTER:
568     case JET_SCREEN_MOUSEEXIT:
569     case JET_SCREEN_INVIEW:
570     case JET_SCREEN_OUTVIEW:
571       return L"Screen";
572     case JET_LINK_MOUSEUP:
573       return L"Link";
574     case JET_MENU_EXEC:
575       return L"Menu";
576     case JET_PAGE_OPEN:
577     case JET_PAGE_CLOSE:
578     case JET_PAGE_INVIEW:
579     case JET_PAGE_OUTVIEW:
580       return L"Page";
581     default:
582       return L"";
583   }
584
585   return L"";
586 }
587
588 FX_BOOL& CJS_EventHandler::Rc() {
589   if (m_pbRc) {
590     return *m_pbRc;
591   }
592   return m_bRcDu;
593 }
594
595 int& CJS_EventHandler::SelEnd() {
596   if (m_pISelEnd) {
597     return *m_pISelEnd;
598   }
599   return m_nSelEndDu;
600 }
601
602 int& CJS_EventHandler::SelStart() {
603   if (m_pISelStart) {
604     return *m_pISelStart;
605   }
606   return m_nSelStartDu;
607 }
608
609 FX_BOOL CJS_EventHandler::Shift() {
610   return m_bShift;
611 }
612
613 Field* CJS_EventHandler::Source() {
614   CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
615   v8::Local<v8::Object> pDocObj = FXJS_NewFxDynamicObj(
616       pRuntime->GetIsolate(), pRuntime, CJS_Document::g_nObjDefnID);
617   ASSERT(!pDocObj.IsEmpty());
618
619   v8::Local<v8::Object> pFieldObj = FXJS_NewFxDynamicObj(
620       pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID);
621   ASSERT(!pFieldObj.IsEmpty());
622
623   CJS_Document* pJSDocument =
624       (CJS_Document*)FXJS_GetPrivate(pRuntime->GetIsolate(), pDocObj);
625   Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
626   pDocument->AttachDoc(m_pTargetDoc ? m_pTargetDoc
627                                     : m_pJSContext->GetReaderDocument());
628
629   CJS_Field* pJSField =
630       (CJS_Field*)FXJS_GetPrivate(pRuntime->GetIsolate(), pFieldObj);
631   Field* pField = (Field*)pJSField->GetEmbedObject();
632   pField->AttachField(pDocument, m_strSourceName);
633   return pField;
634 }
635
636 Field* CJS_EventHandler::Target_Field() {
637   CJS_Runtime* pRuntime = m_pJSContext->GetJSRuntime();
638   v8::Local<v8::Object> pDocObj = FXJS_NewFxDynamicObj(
639       pRuntime->GetIsolate(), pRuntime, CJS_Document::g_nObjDefnID);
640   ASSERT(!pDocObj.IsEmpty());
641
642   v8::Local<v8::Object> pFieldObj = FXJS_NewFxDynamicObj(
643       pRuntime->GetIsolate(), pRuntime, CJS_Field::g_nObjDefnID);
644   ASSERT(!pFieldObj.IsEmpty());
645
646   CJS_Document* pJSDocument =
647       (CJS_Document*)FXJS_GetPrivate(pRuntime->GetIsolate(), pDocObj);
648   Document* pDocument = (Document*)pJSDocument->GetEmbedObject();
649   pDocument->AttachDoc(m_pTargetDoc ? m_pTargetDoc
650                                     : m_pJSContext->GetReaderDocument());
651
652   CJS_Field* pJSField =
653       (CJS_Field*)FXJS_GetPrivate(pRuntime->GetIsolate(), pFieldObj);
654   Field* pField = (Field*)pJSField->GetEmbedObject();
655   pField->AttachField(pDocument, m_strTargetName);
656   return pField;
657 }
658
659 CFX_WideString& CJS_EventHandler::Value() {
660   return *m_pValue;
661 }
662
663 FX_BOOL CJS_EventHandler::WillCommit() {
664   return m_bWillCommit;
665 }
666
667 CFX_WideString CJS_EventHandler::TargetName() {
668   return m_strTargetName;
669 }