• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef XFA_FXFA_PARSER_CSCRIPT_LAYOUTPSEUDOMODEL_H_
8 #define XFA_FXFA_PARSER_CSCRIPT_LAYOUTPSEUDOMODEL_H_
9 
10 #include "fxjs/cfxjse_arguments.h"
11 #include "xfa/fxfa/parser/xfa_object.h"
12 
13 enum XFA_LAYOUTMODEL_HWXY {
14   XFA_LAYOUTMODEL_H,
15   XFA_LAYOUTMODEL_W,
16   XFA_LAYOUTMODEL_X,
17   XFA_LAYOUTMODEL_Y
18 };
19 
20 class CXFA_LayoutProcessor;
21 
22 class CScript_LayoutPseudoModel : public CXFA_Object {
23  public:
24   explicit CScript_LayoutPseudoModel(CXFA_Document* pDocument);
25   ~CScript_LayoutPseudoModel() override;
26 
27   void Ready(CFXJSE_Value* pValue, bool bSetting, XFA_ATTRIBUTE eAttribute);
28 
29   void HWXY(CFXJSE_Arguments* pArguments, XFA_LAYOUTMODEL_HWXY layoutModel);
30   void H(CFXJSE_Arguments* pArguments);
31   void W(CFXJSE_Arguments* pArguments);
32   void X(CFXJSE_Arguments* pArguments);
33   void Y(CFXJSE_Arguments* pArguments);
34   void NumberedPageCount(CFXJSE_Arguments* pArguments, bool bNumbered);
35   void PageCount(CFXJSE_Arguments* pArguments);
36   void PageSpan(CFXJSE_Arguments* pArguments);
37   void Page(CFXJSE_Arguments* pArguments);
38   void PageContent(CFXJSE_Arguments* pArguments);
39   void AbsPageCount(CFXJSE_Arguments* pArguments);
40   void AbsPageCountInBatch(CFXJSE_Arguments* pArguments);
41   void SheetCountInBatch(CFXJSE_Arguments* pArguments);
42   void Relayout(CFXJSE_Arguments* pArguments);
43   void AbsPageSpan(CFXJSE_Arguments* pArguments);
44   void AbsPageInBatch(CFXJSE_Arguments* pArguments);
45   void SheetInBatch(CFXJSE_Arguments* pArguments);
46   void Sheet(CFXJSE_Arguments* pArguments);
47   void RelayoutPageArea(CFXJSE_Arguments* pArguments);
48   void SheetCount(CFXJSE_Arguments* pArguments);
49   void AbsPage(CFXJSE_Arguments* pArguments);
50 
51  protected:
52   void GetObjArray(CXFA_LayoutProcessor* pDocLayout,
53                    int32_t iPageNo,
54                    const CFX_WideString& wsType,
55                    bool bOnPageArea,
56                    CXFA_NodeArray& retArray);
57   void PageImp(CFXJSE_Arguments* pArguments, bool bAbsPage);
58 
59  private:
60   void ThrowSetReadyException() const;
61 };
62 
63 #endif  // XFA_FXFA_PARSER_CSCRIPT_LAYOUTPSEUDOMODEL_H_
64