[!if RIBBON_TOOLBAR] // This MFC Samples source code demonstrates using MFC Microsoft Office Fluent User Interface // (the "Fluent UI") and is provided only as referential material to supplement the // Microsoft Foundation Classes Reference and related electronic documentation // included with the MFC C++ library software. // License terms to copy, use or distribute the Fluent UI are available separately. // To learn more about our Fluent UI licensing program, please visit // https://go.microsoft.com/fwlink/?LinkId=238214. // // Copyright (C) Microsoft Corporation // All rights reserved. [!endif] // $viewheader$ : interface of the $viewclass$ class // #pragma once [!if CONTAINER || CONTAINER_SERVER] class $containeritemclass$; [!endif] [!if OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW] class $rowsetclass$; [!endif] class $viewclass$ : public $viewbaseclass$ { protected: // create from serialization only $viewclass$() noexcept; DECLARE_DYNCREATE($viewclass$) [!if OLEDB_RECORD_VIEW || FORM_VIEW || ODBC_RECORD_VIEW] public: #ifdef AFX_DESIGN_TIME enum{ IDD = IDD_$uppercasesafeprojectidentifiername$_FORM }; #endif [!if OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW] $rowsetclass$* m_pSet; [!endif] [!endif] // Attributes public: $docclass$* GetDocument() const; [!if CONTAINER || CONTAINER_SERVER] [!if !RICH_EDIT_VIEW] // m_pSelection holds the selection to the current $containeritemclass$. // For many applications, such a member variable isn't adequate to // represent a selection, such as a multiple selection or a selection // of objects that are not $containeritemclass$ objects. This selection // mechanism is provided just to help you get started // TODO: replace this selection mechanism with one appropriate to your app $containeritemclass$* m_pSelection; [!endif] [!endif] // Operations public: // Overrides public: [!if OLEDB_RECORD_VIEW] virtual CRowset<>* OnGetRowset(); [!endif] [!if ODBC_RECORD_VIEW] virtual CRecordset* OnGetRecordset(); [!endif] [!if !TREE_VIEW && !LIST_VIEW && !HTML_VIEW && !HTML_EDITVIEW && !RICH_EDIT_VIEW && !EDIT_VIEW && !FORM_VIEW && !OLEDB_RECORD_VIEW && !ODBC_RECORD_VIEW] virtual void OnDraw(CDC* pDC); // overridden to draw this view [!endif] [!if PRINTING] [!if TREE_VIEW || LIST_VIEW] virtual void OnDraw(CDC* pDC); // overridden to draw this view [!endif] [!endif] virtual BOOL PreCreateWindow(CREATESTRUCT& cs); protected: [!if FORM_VIEW || OLEDB_RECORD_VIEW || ODBC_RECORD_VIEW] virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support [!endif] [!if SCROLL_VIEW || CONTAINER || CONTAINER_SERVER || OLEDB_RECORD_VIEW || TREE_VIEW || LIST_VIEW || FORM_VIEW || HTML_VIEW || ODBC_RECORD_VIEW] virtual void OnInitialUpdate(); // called first time after construct [!endif] [!if PRINTING] [!if !HTML_VIEW && !HTML_EDITVIEW] virtual BOOL OnPreparePrinting(CPrintInfo* pInfo); [!endif] [!if !RICH_EDIT_VIEW && !HTML_VIEW && !HTML_EDITVIEW] virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo); virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo); [!endif] [!if FORM_VIEW || ACTIVE_DOC_CONTAINER] virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo); [!endif] [!endif] [!if CONTAINER || CONTAINER_SERVER] [!if !RICH_EDIT_VIEW] virtual BOOL IsSelected(const CObject* pDocItem) const;// Container support [!endif] [!endif] // Implementation public: virtual ~$viewclass$(); #ifdef _DEBUG virtual void AssertValid() const; virtual void Dump(CDumpContext& dc) const; #endif protected: // Generated message map functions protected: [!if CONTAINER || CONTAINER_SERVER] afx_msg void OnDestroy(); [!if !RICH_EDIT_VIEW] afx_msg void OnSetFocus(CWnd* pOldWnd); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnInsertObject(); afx_msg void OnCancelEditCntr(); afx_msg void OnFilePrint(); [!endif] [!endif] [!if MINI_SERVER || FULL_SERVER || CONTAINER_SERVER] afx_msg void OnCancelEditSrvr(); [!endif] [!if PROJECT_STYLE_EXPLORER] [!if LIST_VIEW] afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct); [!endif] [!endif] [!if ACTIVE_DOC_CONTAINER || MENUBAR_TOOLBAR || RIBBON_TOOLBAR] afx_msg void OnFilePrintPreview(); [!if ACTIVE_DOC_CONTAINER && !RICH_EDIT_VIEW] afx_msg void OnFilePrintPreviewUIUpdate(CCmdUI* pCmdUI); [!endif] [!endif] [!if MENUBAR_TOOLBAR || RIBBON_TOOLBAR] afx_msg void OnRButtonUp(UINT nFlags, CPoint point); afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); [!endif] [!if HTML_EDITVIEW] DECLARE_DHTMLEDITING_CMDMAP($viewclass$) [!endif] DECLARE_MESSAGE_MAP() }; #ifndef _DEBUG // debug version in $viewimpl$ inline $docclass$* $viewclass$::GetDocument() const { return reinterpret_cast<$docclass$*>(m_pDocument); } #endif