Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

161 lines
5.6 KiB

  1. // wordpvw.h : interface of the CWordPadView class
  2. //
  3. //
  4. // This is a part of the Microsoft Foundation Classes C++ library.
  5. // Copyright (C) 1992-1995 Microsoft Corporation
  6. // All rights reserved.
  7. //
  8. // This source code is only intended as a supplement to the
  9. // Microsoft Foundation Classes Reference and related
  10. // electronic documentation provided with the library.
  11. // See these sources for detailed information regarding the
  12. // Microsoft Foundation Classes product.
  13. class CWordPadView : public CRichEdit2View
  14. {
  15. protected: // create from serialization only
  16. CWordPadView();
  17. DECLARE_DYNCREATE(CWordPadView)
  18. // Attributes
  19. public:
  20. static BOOL m_bIsMirrored;
  21. UINT_PTR m_uTimerID;
  22. BOOL m_bDelayUpdateItems;
  23. BOOL m_bInPrint;
  24. CParaFormat m_defParaFormat;
  25. CWordPadDoc* GetDocument();
  26. BOOL IsFormatText();
  27. virtual HMENU GetContextMenu(WORD seltype, LPOLEOBJECT lpoleobj,
  28. CHARRANGE* lpchrg);
  29. // Operations
  30. public:
  31. BOOL PasteNative(LPDATAOBJECT lpdataobj);
  32. void SetDefaultFont(BOOL bText);
  33. void SetUpdateTimer();
  34. void GetDefaultFont(CCharFormat& cf, BOOL bText);
  35. void DrawMargins(CDC* pDC);
  36. BOOL SelectPalette();
  37. HRESULT PasteHDROPFormat(HDROP hDrop) ;
  38. BOOL PaginateTo(CDC* pDC, CPrintInfo* pInfo) ;
  39. static void MirrorTheContainer(BOOL bMirror);
  40. // Overrides
  41. // ClassWizard generated virtual function overrides
  42. //{{AFX_VIRTUAL(CWordPadView)
  43. protected:
  44. virtual void CalcWindowRect(LPRECT lpClientRect, UINT nAdjustType = adjustBorder);
  45. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  46. virtual void OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* printInfo);
  47. virtual void CWordPadView::OnEndPrinting(CDC*dc, CPrintInfo*pInfo);
  48. virtual void OnPrint(CDC* pDC, CPrintInfo* pInfo);
  49. virtual void OnPrepareDC(CDC* pDC, CPrintInfo* pInfo);
  50. //}}AFX_VIRTUAL
  51. BOOL OnPreparePrinting(CPrintInfo* pInfo);
  52. virtual HRESULT GetClipboardData(CHARRANGE* lpchrg, DWORD reco,
  53. LPDATAOBJECT lpRichDataObj, LPDATAOBJECT* lplpdataobj);
  54. virtual HRESULT QueryAcceptData(LPDATAOBJECT, CLIPFORMAT*, DWORD,
  55. BOOL, HGLOBAL);
  56. public:
  57. virtual void WrapChanged();
  58. // Implementation
  59. public:
  60. #ifdef _DEBUG
  61. virtual void AssertValid() const;
  62. virtual void Dump(CDumpContext& dc) const;
  63. #endif
  64. //
  65. // Wrapper for the richedit callback interface so we can
  66. // get around some MFC defaults
  67. //
  68. public:
  69. BEGIN_INTERFACE_PART(WordPadRichEditOleCallback, IRichEditOleCallback)
  70. INIT_INTERFACE_PART(CWordPadView, WordPadRichEditOleCallback)
  71. STDMETHOD(GetNewStorage) (LPSTORAGE*);
  72. STDMETHOD(GetInPlaceContext) (LPOLEINPLACEFRAME*,
  73. LPOLEINPLACEUIWINDOW*,
  74. LPOLEINPLACEFRAMEINFO);
  75. STDMETHOD(ShowContainerUI) (BOOL);
  76. STDMETHOD(QueryInsertObject) (LPCLSID, LPSTORAGE, LONG);
  77. STDMETHOD(DeleteObject) (LPOLEOBJECT);
  78. STDMETHOD(QueryAcceptData) (LPDATAOBJECT, CLIPFORMAT*, DWORD,BOOL, HGLOBAL);
  79. STDMETHOD(ContextSensitiveHelp) (BOOL);
  80. STDMETHOD(GetClipboardData) (CHARRANGE*, DWORD, LPDATAOBJECT*);
  81. STDMETHOD(GetDragDropEffect) (BOOL, DWORD, LPDWORD);
  82. STDMETHOD(GetContextMenu) (WORD, LPOLEOBJECT, CHARRANGE*, HMENU*);
  83. END_INTERFACE_PART(WordPadRichEditOleCallback)
  84. DECLARE_INTERFACE_MAP()
  85. protected:
  86. BOOL m_bOnBar;
  87. CPrintDialog *m_oldprintdlg;
  88. // OLE Container support
  89. virtual void DeleteContents();
  90. virtual void OnTextNotFound(LPCTSTR);
  91. // Generated message map functions
  92. protected:
  93. afx_msg void OnCancelEditSrvr();
  94. //{{AFX_MSG(CWordPadView)
  95. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  96. afx_msg void OnPageSetup();
  97. afx_msg void OnInsertDateTime();
  98. afx_msg void OnInsertObject();
  99. afx_msg void OnFormatParagraph();
  100. afx_msg void OnFormatFont();
  101. afx_msg void OnFormatTabs();
  102. afx_msg void OnEditPasteSpecial();
  103. afx_msg void OnEditProperties();
  104. afx_msg void OnEditFind();
  105. afx_msg void OnEditReplace();
  106. afx_msg void OnTimer(UINT_PTR nIDEvent);
  107. afx_msg void OnDestroy();
  108. afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  109. afx_msg void OnPenBackspace();
  110. afx_msg void OnPenNewline();
  111. afx_msg void OnPenPeriod();
  112. afx_msg void OnPenSpace();
  113. afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
  114. afx_msg void OnFilePrint();
  115. afx_msg void OnFilePrintPreview();
  116. afx_msg void OnPenLens();
  117. afx_msg void OnPenTab();
  118. afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
  119. afx_msg BOOL OnQueryNewPalette();
  120. afx_msg void OnWinIniChange(LPCTSTR lpszSection);
  121. afx_msg void OnSize(UINT nType, int cx, int cy);
  122. afx_msg void OnDelayedInvalidate() ;
  123. //}}AFX_MSG
  124. afx_msg void OnEditChange();
  125. afx_msg void OnColorPick(UINT nID);
  126. afx_msg int OnMouseActivate(CWnd* pWnd, UINT nHitTest, UINT message);
  127. afx_msg LONG OnPrinterChangedMsg(UINT, LONG);
  128. afx_msg void OnGetCharFormat(NMHDR* pNMHDR, LRESULT* pRes);
  129. afx_msg void OnSetCharFormat(NMHDR* pNMHDR, LRESULT* pRes);
  130. afx_msg void OnBarSetFocus(NMHDR*, LRESULT*);
  131. afx_msg void OnBarKillFocus(NMHDR*, LRESULT*);
  132. afx_msg void OnBarReturn(NMHDR*, LRESULT* );
  133. DECLARE_MESSAGE_MAP()
  134. };
  135. #ifndef _DEBUG // debug version in wordpvw.cpp
  136. inline CWordPadDoc* CWordPadView::GetDocument()
  137. { return (CWordPadDoc*)m_pDocument; }
  138. #endif
  139. /////////////////////////////////////////////////////////////////////////////