wordpad.h
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:4k
- // wordpad.h : main header file for the WORDPAD application
- //
- // This file is a part of the XTREME TOOLKIT PRO MFC class library.
- // (c)1998-2008 Codejock Software, All Rights Reserved.
- //
- // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
- // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
- // CONSENT OF CODEJOCK SOFTWARE.
- //
- // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
- // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
- // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
- // SINGLE COMPUTER.
- //
- // CONTACT INFORMATION:
- // support@codejock.com
- // http://www.codejock.com
- //
- /////////////////////////////////////////////////////////////////////////////
- #ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
- #endif
- #include "resource.h" // main symbols
- #include "splash.h"
- #include "options.h"
- #include "afxtempl.h"
- #define WPM_BARSTATE WM_USER
- /////////////////////////////////////////////////////////////////////////////
- // CWordPadApp:
- // See wordpad.cpp for the implementation of this class
- //
- class CWordPadCommandLineInfo : public CCommandLineInfo
- {
- public:
- CWordPadCommandLineInfo() {m_bForceTextMode = FALSE;}
- BOOL m_bForceTextMode;
- virtual void ParseParam(const char* pszParam,BOOL bFlag,BOOL bLast);
- };
- class CWordPadApp : public CWinApp
- {
- public:
- CWordPadApp();
- ~CWordPadApp();
- //Attributes
- CWordPadCommandLineInfo cmdInfo;
- CDC m_dcScreen;
- LOGFONT m_lf;
- int m_nDefFont;
- static int m_nOpenMsg;
- static int m_nPrinterChangedMsg;
- CRect m_rectPageMargin;
- CRect m_rectInitialFrame;
- BOOL m_bMaximized;
- BOOL m_bPromptForType;
- BOOL m_bWin4;
- #ifndef _UNICODE
- BOOL m_bWin31;
- #endif
- BOOL m_bLargeIcons;
- BOOL m_bForceTextMode;
- BOOL m_bWordSel;
- BOOL m_bForceOEM;
- int m_nFilterIndex;
- int m_nNewDocType;
- CDocOptions m_optionsText;
- CDocOptions m_optionsRTF;
- CDocOptions m_optionsWord; //wrap to ruler
- CDocOptions m_optionsWrite; //wrap to ruler
- CDocOptions m_optionsIP; //wrap to ruler
- CDocOptions m_optionsNull;
- CList<HWND, HWND> m_listPrinterNotify;
- BOOL IsDocOpen(LPCTSTR lpszFileName);
- // Get
- int GetUnits() {return m_nUnits;}
- int GetTPU() { return GetTPU(m_nUnits);}
- int GetTPU(int n) { return m_units[n].m_nTPU;}
- LPCTSTR GetAbbrev() { return m_units[m_nUnits].m_strAbbrev;}
- LPCTSTR GetAbbrev(int n) { return m_units[n].m_strAbbrev;}
- const CUnit& GetUnit() {return m_units[m_nUnits];}
- CDockState& GetDockState(int nDocType, BOOL bPrimary = TRUE);
- CDocOptions& GetDocOptions(int nDocType);
- // Set
- void SetUnits(int n)
- { ASSERT(n>=0 && n <m_nPrimaryNumUnits); m_nUnits = n; }
- // Operations
- void RegisterFormats();
- static BOOL CALLBACK StaticEnumProc(HWND hWnd, LPARAM lParam);
- void UpdateRegistry();
- void NotifyPrinterChanged(BOOL bUpdatePrinterSelection = FALSE);
- BOOL PromptForFileName(CString& fileName, UINT nIDSTitle, DWORD dwFlags,
- BOOL bOpenFileDialog, int* pType = NULL);
- BOOL ParseMeasurement(TCHAR* buf, int& lVal);
- void PrintTwips(TCHAR* buf, int nValue, int nDecimal);
- void SaveOptions();
- void LoadOptions();
- void LoadAbbrevStrings();
- HGLOBAL CreateDevNames();
- // Overrides
- BOOL IsIdleMessage(MSG* pMsg);
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CWordPadApp)
- public:
- virtual BOOL InitInstance();
- virtual int ExitInstance();
- virtual BOOL OnDDECommand(LPTSTR lpszCommand);
- virtual void WinHelp(DWORD dwData, UINT nCmd = HELP_CONTEXT);
- virtual BOOL PreTranslateMessage(MSG* pMsg);
- //}}AFX_VIRTUAL
- // Implementation
- COleTemplateServer m_server;
- // Server object for document creation
- //{{AFX_MSG(CWordPadApp)
- afx_msg void OnAppAbout();
- afx_msg void OnFileNew();
- afx_msg void OnFileOpen();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- private:
- int m_nUnits;
- static const int m_nPrimaryNumUnits;
- static const int m_nNumUnits;
- static CUnit m_units[7];
- };
- /////////////////////////////////////////////////////////////////////////////
- extern CWordPadApp theApp;
- //inline CWordPadApp* GetWordPadApp() {return (CWordPadApp*)AfxGetApp();}