Garmin Fleet Management Controller  2.19.0
CCustomFormsDlg.h
Go to the documentation of this file.
1 /*********************************************************************
2 *
3 * HEADER NAME:
4 * CCustomFormsDlg.h
5 *
6 * Copyright 2013 by Garmin Ltd. or its subsidiaries.
7 *---------------------------------------------------------------------
8 * $NoKeywords$
9 *********************************************************************/
10 #pragma once
11 
12 #include "CWebBrowser2.h"
13 #include "XMLTransformer.h"
14 #include "FmiApplicationLayer.h"
15 #include "CWndEventListener.h"
16 
17 #if( FMI_SUPPORT_A612 )
18 
19 // CCustomFormsDlg dialog
20 
21 //----------------------------------------------------------------------
27 //----------------------------------------------------------------------
28 class CCustomFormsDlg : public CDialog, public CWndEventListener
29 {
30  DECLARE_DYNAMIC(CCustomFormsDlg)
31 
32 public:
34  CWnd* pParent,
35  FmiApplicationLayer & aCom
36  );
37  virtual ~CCustomFormsDlg();
38 
39 // Dialog Data
40  enum { IDD = IDD_CUSTOM_FORMS };
41 
42 protected:
43  virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
44 
45  DECLARE_MESSAGE_MAP()
46 
47  BOOL OnInitDialog();
48  afx_msg void OnSize
49  (
50  UINT aType,
51  int aClientWidth,
52  int aClientHeight
53  );
54 
55  afx_msg LRESULT CCustomFormsDlg::OnFormDeleted( WPARAM, LPARAM );
56  afx_msg LRESULT CCustomFormsDlg::OnFormPositionChanged( WPARAM, LPARAM );
57  afx_msg LRESULT CCustomFormsDlg::OnFormSubmitReceived( WPARAM, LPARAM );
58 #if( FMI_SUPPORT_A621 )
59  afx_msg LRESULT CCustomFormsDlg::OnFormShowFail( WPARAM, LPARAM );
60  afx_msg LRESULT CCustomFormsDlg::OnFormShowSuccess( WPARAM, LPARAM );
61 #endif
62  bool buildCatalog(LPCTSTR filename);
63  void refreshCatalog();
64 
65  void transform(LPCTSTR src, XMLTransformer * transformer, CMapStringToString & params);
66 
67  BOOL importForm();
68  BOOL sendToDevice(LPCTSTR filename);
69  BOOL deleteFromDevice(int formId);
70  BOOL moveOnDevice(int formId, uint8 newPosition);
71  BOOL requestPosition(int formId);
72 #if( FMI_SUPPORT_A621 )
73  BOOL showForm(int formId);
74 #endif
75 
77 
82 
85 
86 public:
87  DECLARE_EVENTSINK_MAP()
89  void OnBeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL, VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData, VARIANT* Headers, BOOL* Cancel);
90  };
91 
92 #endif
BOOL deleteFromDevice(int formId)
afx_msg LRESULT OnFormShowSuccess(WPARAM, LPARAM)
This function handles form show success event from device.
afx_msg void OnSize(UINT aType, int aClientWidth, int aClientHeight)
Called after the dialog is resized; repositions the contents of the display.
XMLTransformer * m_submittedTransform
cache the submitted form transformer for re-use
void refreshCatalog()
This function reconstructs catalog file and redisplays it.
FmiApplicationLayer & mCom
Reference to the FMI communication controller.
Browser-based container for listing the Custom Forms library.
BOOL showForm(int formId)
afx_msg LRESULT OnFormDeleted(WPARAM, LPARAM)
This function handles form delete ACK event from device.
CWebBrowser2 m_browser
BOOL sendToDevice(LPCTSTR filename)
void transform(LPCTSTR src, XMLTransformer *transformer, CMapStringToString &params)
Transform specified XML document and display in web view.
CCustomFormsDlg(CWnd *pParent, FmiApplicationLayer &aCom)
Constructor.
Serial communication controller for Garmin and FMI packets.
afx_msg LRESULT OnFormShowFail(WPARAM, LPARAM)
This function handles form show failure event from device.
EventListener that dispatches a Windows message.
virtual void DoDataExchange(CDataExchange *pDX)
Perform dialog data exchange and validation.
Utility class for simplifying XSL transformations.
XMLTransformer * m_templateTransform
cache the form template transformer for re-use
Web Browser ActiveX wrapper, generated by Visual Studio.
Definition: CWebBrowser2.h:24
unsigned char uint8
8-bit unsigned integer
Definition: garmin_types.h:62
bool buildCatalog(LPCTSTR filename)
Construct a catalog document based on the library structure.
virtual ~CCustomFormsDlg()
Destructor.
afx_msg LRESULT OnFormPositionChanged(WPARAM, LPARAM)
This function handles form position report event from device.
BOOL requestPosition(int formId)
#define IDD_CUSTOM_FORMS
Definition: resource.h:53
void OnBeforeNavigate2(LPDISPATCH pDisp, VARIANT *URL, VARIANT *Flags, VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers, BOOL *Cancel)
This catches navigation attempts for the purpose of handling application-specific navigation...
BOOL moveOnDevice(int formId, uint8 newPosition)
afx_msg LRESULT OnFormSubmitReceived(WPARAM, LPARAM)
This function handles completed form submit event from device.
BOOL OnInitDialog()
This function is called when the window is created.