Back to index

lightning-sunbird  0.9+nobinonly
CFormatOptionTab.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: Mozilla-sample-code 1.0
00004  *
00005  * Copyright (c) 2002 Netscape Communications Corporation and
00006  * other contributors
00007  *
00008  * Permission is hereby granted, free of charge, to any person obtaining a
00009  * copy of this Mozilla sample software and associated documentation files
00010  * (the "Software"), to deal in the Software without restriction, including
00011  * without limitation the rights to use, copy, modify, merge, publish,
00012  * distribute, sublicense, and/or sell copies of the Software, and to permit
00013  * persons to whom the Software is furnished to do so, subject to the
00014  * following conditions:
00015  *
00016  * The above copyright notice and this permission notice shall be included
00017  * in all copies or substantial portions of the Software.
00018  *
00019  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00020  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00021  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00022  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00023  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00024  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00025  * DEALINGS IN THE SOFTWARE.
00026  *
00027  * Contributor(s):
00028  *   Rod Spears <rods@netscape.com>
00029  *
00030  * ***** END LICENSE BLOCK ***** */
00031 
00032 #if !defined(AFX_CFORMATOPTIONTAB_H__F7BDB355_9202_440A_8478_165AD3FC2F41__INCLUDED_)
00033 #define AFX_CFORMATOPTIONTAB_H__F7BDB355_9202_440A_8478_165AD3FC2F41__INCLUDED_
00034 
00035 #if _MSC_VER > 1000
00036 #pragma once
00037 #endif // _MSC_VER > 1000
00038 // CFormatOptionTab.h : header file
00039 //
00040 
00041 #include "nsIPrintSettings.h"
00042 
00044 // CFormatOptionTab dialog
00045 
00046 class CFormatOptionTab : public CPropertyPage
00047 {
00048        DECLARE_DYNCREATE(CFormatOptionTab)
00049 
00050 // Construction
00051 public:
00052        CFormatOptionTab();
00053        ~CFormatOptionTab();
00054   void GetPaperSizeInfo(short& aType, double& aWidth, double& aHeight);
00055 
00056 // Dialog Data
00057        //{{AFX_DATA(CFormatOptionTab)
00058        enum { IDD = IDD_FORMAT_OPTIONS_TAB };
00059        int           m_PaperSize;
00060        BOOL   m_BGColors;
00061        int           m_Scaling;
00062        CString       m_ScalingText;
00063        int           m_DoInches;
00064        BOOL   m_BGImages;
00065        double m_PaperHeight;
00066        double m_PaperWidth;
00067        BOOL   m_IsLandScape;
00068        //}}AFX_DATA
00069 
00070   nsCOMPtr<nsIPrintSettings> m_PrintSettings;
00071   int                        m_PaperSizeInx;
00072 
00073 // Overrides
00074        // ClassWizard generate virtual function overrides
00075        //{{AFX_VIRTUAL(CFormatOptionTab)
00076        protected:
00077        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
00078        //}}AFX_VIRTUAL
00079 
00080 // Implementation
00081 protected:
00082   void EnableUserDefineControls(BOOL aEnable);
00083   int  GetPaperSizeIndexFromData(short aType, double aW, double aH);
00084   int  GetPaperSizeIndex(const CString& aStr);
00085 
00086        // Generated message map functions
00087        //{{AFX_MSG(CFormatOptionTab)
00088        virtual BOOL OnInitDialog();
00089        afx_msg void OnCustomdrawScale(NMHDR* pNMHDR, LRESULT* pResult);
00090        afx_msg void OnKillfocusScaleTxt();
00091        afx_msg void OnSelchangePaperSizeCbx();
00092        //}}AFX_MSG
00093        DECLARE_MESSAGE_MAP()
00094 
00095 };
00096 
00097 //{{AFX_INSERT_LOCATION}}
00098 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00099 
00100 #endif // !defined(AFX_CFORMATOPTIONTAB_H__F7BDB355_9202_440A_8478_165AD3FC2F41__INCLUDED_)