| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ | 7 #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ |
| 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ | 8 #define FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ |
| 9 | 9 |
| 10 #include "JS_Define.h" | 10 #include "JS_Define.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 class CJS_TimerObj : public CJS_Object { | 31 class CJS_TimerObj : public CJS_Object { |
| 32 public: | 32 public: |
| 33 CJS_TimerObj(JSFXObject pObject) : CJS_Object(pObject) {} | 33 CJS_TimerObj(JSFXObject pObject) : CJS_Object(pObject) {} |
| 34 virtual ~CJS_TimerObj() {} | 34 virtual ~CJS_TimerObj() {} |
| 35 | 35 |
| 36 DECLARE_JS_CLASS(CJS_TimerObj); | 36 DECLARE_JS_CLASS(CJS_TimerObj); |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // struct APP_MENUITEM_ARRAY; | |
| 40 // | |
| 41 // struct APP_MENUITEM | |
| 42 // { | |
| 43 // APP_MENUITEM() : oSubMenu(NULL), cName(L""), cReturn(L""), | |
| 44 // bMarked(false), bEnabled(true) | |
| 45 // { | |
| 46 // } | |
| 47 // CFX_WideString cName; | |
| 48 // CFX_WideString cReturn; | |
| 49 // APP_MENUITEM_ARRAY* oSubMenu; | |
| 50 // bool bMarked; | |
| 51 // bool bEnabled; | |
| 52 // }; | |
| 53 | |
| 54 // struct APP_MENUITEM_ARRAY | |
| 55 // { | |
| 56 // APP_MENUITEM_ARRAY() : m_hMenu(NULL), pContents(NULL), nSize(0) | |
| 57 // { | |
| 58 // | |
| 59 // } | |
| 60 // APP_MENUITEM * pContents; | |
| 61 // HMENU m_hMenu; | |
| 62 // int nSize; | |
| 63 // }; | |
| 64 | |
| 65 // struct APP_MENU; | |
| 66 // struct APP_MENU_ARRAY | |
| 67 // { | |
| 68 // APP_MENU_ARRAY(): | |
| 69 // pContent(NULL) | |
| 70 // { | |
| 71 // } | |
| 72 // | |
| 73 // APP_MENU* pContent; | |
| 74 // }; | |
| 75 | |
| 76 // struct APP_MENU | |
| 77 // { | |
| 78 // APP_MENU():bSubMenu(false), | |
| 79 // SubMenuItems(NULL), | |
| 80 // cwMenuItemName(L""), | |
| 81 // hMenu(NULL), | |
| 82 // iSize(0) | |
| 83 // { | |
| 84 // | |
| 85 // } | |
| 86 // | |
| 87 // APP_MENU(CFX_WideString &cwName): | |
| 88 // cwMenuItemName(cwName), | |
| 89 // bSubMenu(false), | |
| 90 // SubMenuItems(NULL), | |
| 91 // hMenu(NULL), | |
| 92 // iSize(0) | |
| 93 // { | |
| 94 // | |
| 95 // } | |
| 96 // | |
| 97 // CFX_WideString cwMenuItemName; | |
| 98 // bool bSubMenu; | |
| 99 // APP_MENU_ARRAY* SubMenuItems; | |
| 100 // int iSize; | |
| 101 // HMENU hMenu; | |
| 102 // }; | |
| 103 | |
| 104 class app : public CJS_EmbedObj { | 39 class app : public CJS_EmbedObj { |
| 105 public: | 40 public: |
| 106 app(CJS_Object* pJSObject); | 41 app(CJS_Object* pJSObject); |
| 107 virtual ~app(); | 42 virtual ~app(); |
| 108 | 43 |
| 109 public: | 44 public: |
| 110 FX_BOOL activeDocs(IFXJS_Context* cc, | 45 FX_BOOL activeDocs(IFXJS_Context* cc, |
| 111 CJS_PropValue& vp, | 46 CJS_PropValue& vp, |
| 112 CFX_WideString& sError); | 47 CFX_WideString& sError); |
| 113 FX_BOOL calculate(IFXJS_Context* cc, | 48 FX_BOOL calculate(IFXJS_Context* cc, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 FX_BOOL setInterval(IFXJS_Context* cc, | 154 FX_BOOL setInterval(IFXJS_Context* cc, |
| 220 const CJS_Parameters& params, | 155 const CJS_Parameters& params, |
| 221 CJS_Value& vRet, | 156 CJS_Value& vRet, |
| 222 CFX_WideString& sError); | 157 CFX_WideString& sError); |
| 223 FX_BOOL setTimeOut(IFXJS_Context* cc, | 158 FX_BOOL setTimeOut(IFXJS_Context* cc, |
| 224 const CJS_Parameters& params, | 159 const CJS_Parameters& params, |
| 225 CJS_Value& vRet, | 160 CJS_Value& vRet, |
| 226 CFX_WideString& sError); | 161 CFX_WideString& sError); |
| 227 | 162 |
| 228 private: | 163 private: |
| 229 // FX_DWORD AppGetTickCount(); | |
| 230 void TimerProc(CJS_Timer* pTimer); | 164 void TimerProc(CJS_Timer* pTimer); |
| 231 void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript); | 165 void RunJsScript(CJS_Runtime* pRuntime, const CFX_WideString& wsScript); |
| 232 // void ParsePopupMenuObj(APP_ME
NUITEM * | |
| 233 //ppMenuItem,JSObject * pObj); | |
| 234 // void DeleteMenuItems(APP_MENU
ITEM_ARRAY * | |
| 235 //pMenuItems); | |
| 236 // void AddMenuItem(APP_MENUITEM
_ARRAY * pMenuItems, HMENU | |
| 237 // hMenu, MENUITEMINFO MenuItemInfo); | |
| 238 // void InitMenuItemInfo(MENUITE
MINFO& | |
| 239 // MenuItemInfo); | |
| 240 // void DestroyPopUpMenu(); | |
| 241 | |
| 242 // void ParserMenuItem(APP_MENU*
pHead, const | |
| 243 // CJS_Parameters¶ms); | |
| 244 // void AddItemToMenu(APP_MENU*
pHead, HMENU hMenu, | |
| 245 // MENUITEMINFO MenuItemInfo); | |
| 246 // void DestroyMenuItems(APP_MEN
U* | |
| 247 // pHead); | |
| 248 | 166 |
| 249 public: | 167 public: |
| 250 static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath); | 168 static CFX_WideString SysPathToPDFPath(const CFX_WideString& sOldPath); |
| 251 | 169 |
| 252 private: | 170 private: |
| 253 bool m_bCalculate; | 171 bool m_bCalculate; |
| 254 bool m_bRuntimeHighLight; | 172 bool m_bRuntimeHighLight; |
| 255 | 173 |
| 256 CFX_ArrayTemplate<CJS_Timer*> m_aTimer; | 174 CFX_ArrayTemplate<CJS_Timer*> m_aTimer; |
| 257 // APP_MENU* m_pMenuHead; | |
| 258 | |
| 259 public: | |
| 260 // static CReader_App* s_App; | |
| 261 }; | 175 }; |
| 262 | 176 |
| 263 class CJS_App : public CJS_Object { | 177 class CJS_App : public CJS_Object { |
| 264 public: | 178 public: |
| 265 CJS_App(JSFXObject pObject) : CJS_Object(pObject){}; | 179 CJS_App(JSFXObject pObject) : CJS_Object(pObject){}; |
| 266 virtual ~CJS_App(void){}; | 180 virtual ~CJS_App(void){}; |
| 267 | 181 |
| 268 DECLARE_JS_CLASS(CJS_App); | 182 DECLARE_JS_CLASS(CJS_App); |
| 269 | 183 |
| 270 JS_STATIC_PROP(activeDocs, app); | 184 JS_STATIC_PROP(activeDocs, app); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 297 JS_STATIC_METHOD(openDoc, app); | 211 JS_STATIC_METHOD(openDoc, app); |
| 298 JS_STATIC_METHOD(openFDF, app); | 212 JS_STATIC_METHOD(openFDF, app); |
| 299 JS_STATIC_METHOD(popUpMenuEx, app); | 213 JS_STATIC_METHOD(popUpMenuEx, app); |
| 300 JS_STATIC_METHOD(popUpMenu, app); | 214 JS_STATIC_METHOD(popUpMenu, app); |
| 301 JS_STATIC_METHOD(response, app); | 215 JS_STATIC_METHOD(response, app); |
| 302 JS_STATIC_METHOD(setInterval, app); | 216 JS_STATIC_METHOD(setInterval, app); |
| 303 JS_STATIC_METHOD(setTimeOut, app); | 217 JS_STATIC_METHOD(setTimeOut, app); |
| 304 }; | 218 }; |
| 305 | 219 |
| 306 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ | 220 #endif // FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ |
| OLD | NEW |