• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ap_Dialog_PageSetup.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef AP_Dialog_PageSetup_H
00021 #define AP_Dialog_PageSetup_H
00022 
00023 #include "ut_types.h"
00024 #include "ut_units.h"
00025 #include "xap_Frame.h"
00026 #include "xap_Dialog.h"
00027 #include "fp_PageSize.h"
00028 
00029 class ABI_EXPORT AP_Dialog_PageSetup : public XAP_Dialog_NonPersistent
00030 {
00031 public:
00032     AP_Dialog_PageSetup(XAP_DialogFactory *pDlgFactory, XAP_Dialog_Id id);
00033     virtual ~AP_Dialog_PageSetup() = 0;
00034 
00035     virtual void runModal(XAP_Frame *pFrame) = 0;
00036 
00037     typedef enum { a_OK, a_CANCEL } tAnswer;
00038     typedef enum { PORTRAIT, LANDSCAPE } Orientation;
00039 
00040     // declare JavaBean-like accessors for our properties
00041 #define SET_GATHER(a, u)  inline u get##a(void) const {return m_##a;} \
00042               inline void set##a(u p##a) {m_##a = p##a;}
00043     SET_GATHER(PageSize,        fp_PageSize);
00044     SET_GATHER(PageUnits,       UT_Dimension);
00045     SET_GATHER(PageOrientation, Orientation);
00046     SET_GATHER(PageScale,       int);
00047     SET_GATHER(MarginUnits,     UT_Dimension);
00048     SET_GATHER(MarginTop,       float);
00049     SET_GATHER(MarginBottom,    float);
00050     SET_GATHER(MarginLeft,      float);
00051     SET_GATHER(MarginRight,     float);
00052     SET_GATHER(MarginHeader,    float);
00053     SET_GATHER(MarginFooter,    float);
00054 #undef SET_GATHER
00055 
00056     virtual inline tAnswer getAnswer (void) const {return m_answer;}
00057 
00058  protected:
00059     // this should only get used by decendant classes
00060     inline void setAnswer (tAnswer answer) {m_answer = answer;}
00061     XAP_Frame *         m_pFrame;
00062     AP_Dialog_PageSetup::tAnswer m_answer;
00063 
00064     bool validatePageSettings(void) const;
00065 
00066  private:
00067     fp_PageSize             m_PageSize;
00068     UT_Dimension            m_PageUnits;
00069     Orientation             m_PageOrientation;
00070     int                     m_PageScale;
00071     UT_Dimension            m_MarginUnits;
00072     float                   m_MarginTop;
00073     float                   m_MarginBottom;
00074     float                   m_MarginLeft;
00075     float                   m_MarginRight;
00076     float                   m_MarginHeader;
00077     float                   m_MarginFooter;
00078 };
00079 
00080 #endif // AP_Dialog_PageSetup_H

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1