1ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov// Copyright 2014 PDFium Authors. All rights reserved.
2ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov// Use of this source code is governed by a BSD-style license that can be
3ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov// found in the LICENSE file.
4ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
5ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
7ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov#ifndef _JS_MODULE_H_
8ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov#define _JS_MODULE_H_
9ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
10ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovclass CJS_GlobalData;
11ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovclass CJS_ConsoleDlg;
12ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
13ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovclass CJS_Module : public IReader_Module
14ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov{
15ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovpublic:
16ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	CJS_Module(HMODULE hModule, CReader_App* pApp);
17ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	virtual ~CJS_Module();
18ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
19ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	virtual void					Destroy(){delete this;}
20ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	virtual CFX_ByteString			GetModuleName();
21ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
22ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovpublic:
23ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	static CJS_Module*				GetModule(CReader_App* pApp);
24ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
25ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	IFXJS_Runtime*					NewJSRuntime();
26ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	CJS_GlobalData*					NewGlobalData();
27ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	void							ReleaseGlobalData();
28ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
29ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovpublic:
30ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	//console
31ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	void							ShowConsole();
32ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	void							HideConsole();
33ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	void							ClearConsole();
34ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	void							PrintLineConsole(FX_LPCWSTR string);
35ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
36ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganovprivate:
37ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	HMODULE							m_hModule;
38ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	CReader_App*					m_pApp;
39ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
40ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	FX_BOOL							m_bInitial;
41ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	CJS_GlobalData*					m_pGlobalData;
42ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	FX_INT32						m_nGlobalDataCount;
43ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
44ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov	CJS_ConsoleDlg*					m_pConsole;
45ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov};
46ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov
47ee451cb395940862dad63c85adfe8f2fd55e864cSvet Ganov#endif //_JS_MODULE_H_