Garmin Fleet Management Controller  2.19.0
CCustomFormsDlg Class Reference

Browser-based container for listing the Custom Forms library. More...

#include <CCustomFormsDlg.h>

+ Inheritance diagram for CCustomFormsDlg:

Public Types

enum  { IDD = IDD_CUSTOM_FORMS }
 

Public Member Functions

 CCustomFormsDlg (CWnd *pParent, FmiApplicationLayer &aCom)
 Constructor. More...
 
virtual ~CCustomFormsDlg ()
 Destructor. More...
 
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. More...
 
void onEvent (EventId aEventId, uint32 aEventData, void *aEventDataPtr, BOOL handleNow)
 Handles event callbacks by translating an EventId into a windows message. More...
 

Protected Member Functions

bool buildCatalog (LPCTSTR filename)
 Construct a catalog document based on the library structure. More...
 
BOOL deleteFromDevice (int formId)
 
virtual void DoDataExchange (CDataExchange *pDX)
 Perform dialog data exchange and validation. More...
 
BOOL importForm ()
 
BOOL moveOnDevice (int formId, uint8 newPosition)
 
afx_msg LRESULT OnFormDeleted (WPARAM, LPARAM)
 This function handles form delete ACK event from device. More...
 
afx_msg LRESULT OnFormPositionChanged (WPARAM, LPARAM)
 This function handles form position report event from device. More...
 
afx_msg LRESULT OnFormShowFail (WPARAM, LPARAM)
 This function handles form show failure event from device. More...
 
afx_msg LRESULT OnFormShowSuccess (WPARAM, LPARAM)
 This function handles form show success event from device. More...
 
afx_msg LRESULT OnFormSubmitReceived (WPARAM, LPARAM)
 This function handles completed form submit event from device. More...
 
BOOL OnInitDialog ()
 This function is called when the window is created. More...
 
afx_msg void OnSize (UINT aType, int aClientWidth, int aClientHeight)
 Called after the dialog is resized; repositions the contents of the display. More...
 
void refreshCatalog ()
 This function reconstructs catalog file and redisplays it. More...
 
BOOL requestPosition (int formId)
 
BOOL sendToDevice (LPCTSTR filename)
 
BOOL showForm (int formId)
 
void transform (LPCTSTR src, XMLTransformer *transformer, CMapStringToString &params)
 Transform specified XML document and display in web view. More...
 

Protected Attributes

CWebBrowser2 m_browser
 
XMLTransformerm_submittedTransform
 cache the submitted form transformer for re-use More...
 
XMLTransformerm_templateTransform
 cache the form template transformer for re-use More...
 
FmiApplicationLayermCom
 Reference to the FMI communication controller. More...
 

Detailed Description

Browser-based container for listing the Custom Forms library.

When first loaded this dialog lists all the forms imported into its file-based repository. Each list item has a link to a preview of the template, as well as links to a preview of any forms submitted against that template.

Definition at line 28 of file CCustomFormsDlg.h.

Member Enumeration Documentation

anonymous enum
Enumerator
IDD 

Definition at line 40 of file CCustomFormsDlg.h.

Constructor & Destructor Documentation

CCustomFormsDlg::CCustomFormsDlg ( CWnd *  pParent,
FmiApplicationLayer aCom 
)

Constructor.

Definition at line 46 of file CCustomFormsDlg.cpp.

CCustomFormsDlg::~CCustomFormsDlg ( )
virtual

Destructor.

Definition at line 57 of file CCustomFormsDlg.cpp.

Member Function Documentation

bool CCustomFormsDlg::buildCatalog ( LPCTSTR  filename)
protected

Construct a catalog document based on the library structure.

Definition at line 544 of file CCustomFormsDlg.cpp.

BOOL CCustomFormsDlg::deleteFromDevice ( int  formId)
protected

Definition at line 1098 of file CCustomFormsDlg.cpp.

References FMI_CUSTOM_FORM_DEL_REQUEST, and TRUE.

void CCustomFormsDlg::DoDataExchange ( CDataExchange *  pDX)
protectedvirtual

Perform dialog data exchange and validation.

Parameters
aDataExchangeThe DDX context

Definition at line 69 of file CCustomFormsDlg.cpp.

References IDC_EMBEDDED_BROWSER.

BOOL CCustomFormsDlg::importForm ( )
protected

Definition at line 894 of file CCustomFormsDlg.cpp.

References FALSE, and TRUE.

BOOL CCustomFormsDlg::moveOnDevice ( int  formId,
uint8  newPosition 
)
protected
void CCustomFormsDlg::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.

Handle application-specific navigation URLs.

Definition at line 772 of file CCustomFormsDlg.cpp.

References cleanupParentFolder(), TRUE, and CWebBrowser2::URLDecode().

Referenced by transform().

void CWndEventListener::onEvent ( EventId  aEventId,
uint32  aEventData,
void *  aEventDataPtr,
BOOL  handleNow 
)
virtualinherited

Handles event callbacks by translating an EventId into a windows message.

Casts this to a CWnd then posts a Windows message to it. The use of dynamic_cast is used as an alternative to the "dreaded diamond" caused by C++ multiple inheritance.

Parameters
aEventIdThe event ID
aEventDataThe event data
aEventDataPtrPointer to more event data
Note
Interested parties receive these events as Windows messages, i.e., ON_MESSAGE( aEventId, CallbackFunction ). aEventData is the WPARAM, and aEventDataPtr is the LPARAM.

Implements EventListener.

Definition at line 29 of file CWndEventListener.cpp.

References EVENT_ID_CNT, and WM_EVENT.

LRESULT CCustomFormsDlg::OnFormDeleted ( WPARAM  wParam,
LPARAM   
)
protected

This function handles form delete ACK event from device.

Definition at line 154 of file CCustomFormsDlg.cpp.

LRESULT CCustomFormsDlg::OnFormPositionChanged ( WPARAM  wParam,
LPARAM  lParam 
)
protected

This function handles form position report event from device.

Definition at line 166 of file CCustomFormsDlg.cpp.

LRESULT CCustomFormsDlg::OnFormShowFail ( WPARAM  wParam,
LPARAM  lParam 
)
protected

This function handles form show failure event from device.

Definition at line 179 of file CCustomFormsDlg.cpp.

LRESULT CCustomFormsDlg::OnFormShowSuccess ( WPARAM  wParam,
LPARAM  lParam 
)
protected

This function handles form show success event from device.

Definition at line 191 of file CCustomFormsDlg.cpp.

LRESULT CCustomFormsDlg::OnFormSubmitReceived ( WPARAM  ,
LPARAM   
)
protected

This function handles completed form submit event from device.

Definition at line 382 of file CCustomFormsDlg.cpp.

References extractMultiPart(), MULTIPART_CONTENT_HEADER, SAVE_RECEIVED_FORM_SUBMIT, and unzip().

BOOL CCustomFormsDlg::OnInitDialog ( )
protected

This function is called when the window is created.

Returns
TRUE, since this function does not set focus to a control

Definition at line 79 of file CCustomFormsDlg.cpp.

References OnSize(), and TRUE.

void CCustomFormsDlg::OnSize ( UINT  aType,
int  aClientWidth,
int  aClientHeight 
)
protected

Called after the dialog is resized; repositions the contents of the display.

Moves/sizes the contents as follows:

  • Moves the search box to the bottom-left corner, keeping its size
  • Moves the packet list to the top-left, expands vertically
  • Moves the packet detail to the right of the list, expands horizontally to fill the dialog and vertically to match the height of the packet list
  • Centers the buttons under the packet detail.
    Parameters
    aTypeThe type of resizing requested (maximized, etc.)
    aClientWidthThe new width of the client area
    aClientHeightThe new height of the client area

Definition at line 131 of file CCustomFormsDlg.cpp.

Referenced by OnInitDialog().

void CCustomFormsDlg::refreshCatalog ( )
protected

This function reconstructs catalog file and redisplays it.

Definition at line 513 of file CCustomFormsDlg.cpp.

References CWebBrowser2::URLDecode().

BOOL CCustomFormsDlg::requestPosition ( int  formId)
protected

Definition at line 1119 of file CCustomFormsDlg.cpp.

References FMI_CUSTOM_FORM_GET_POS_REQUEST, and TRUE.

BOOL CCustomFormsDlg::sendToDevice ( LPCTSTR  filename)
protected

Definition at line 1027 of file CCustomFormsDlg.cpp.

References FALSE, FMI_FILE_TYPE_CUSTOM_FORMS, minval, and TRUE.

BOOL CCustomFormsDlg::showForm ( int  formId)
protected

Definition at line 1129 of file CCustomFormsDlg.cpp.

References FMI_CUSTOM_FORM_SHOW_REQUEST, and TRUE.

void CCustomFormsDlg::transform ( LPCTSTR  src,
XMLTransformer transformer,
CMapStringToString &  params 
)
protected

Transform specified XML document and display in web view.

Definition at line 700 of file CCustomFormsDlg.cpp.

References IDC_EMBEDDED_BROWSER, OnBeforeNavigate2(), FileStream::OpenFile(), and XMLTransformer::transform().

Member Data Documentation

CWebBrowser2 CCustomFormsDlg::m_browser
protected

Definition at line 76 of file CCustomFormsDlg.h.

XMLTransformer* CCustomFormsDlg::m_submittedTransform
protected

cache the submitted form transformer for re-use

Definition at line 81 of file CCustomFormsDlg.h.

XMLTransformer* CCustomFormsDlg::m_templateTransform
protected

cache the form template transformer for re-use

Definition at line 79 of file CCustomFormsDlg.h.

FmiApplicationLayer& CCustomFormsDlg::mCom
protected

Reference to the FMI communication controller.

Definition at line 84 of file CCustomFormsDlg.h.


The documentation for this class was generated from the following files: