Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
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
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