#include <pagesize.h>
Inheritance diagram for PageSize:
Public Member Functions | |
PageSize () | |
Constructor. | |
virtual BOOL | Init (PageId NewId, String_32 *Name, double PageWidth, double PageHeight, UnitType Units) |
Initialiser. | |
PageId | GetPageId () |
Returns page id. | |
String_32 * | GetPageName () |
Way of finding the name for this page. | |
INT32 | GetPageWidth () |
Way of of finding out the current page width. | |
INT32 | GetPageHeight () |
Way of of finding out the current page height. | |
Protected Attributes | |
PageId | Id |
String_32 | PageName |
INT32 | PageWidth |
INT32 | PageHeight |
double | PageWidthInMM |
double | PageHeightInMM |
Private Member Functions | |
CC_DECLARE_DYNAMIC (PageSize) |
Definition at line 132 of file pagesize.h.
|
Constructor.
Definition at line 177 of file pagesize.cpp.
|
|
|
|
Way of of finding out the current page height.
Definition at line 298 of file pagesize.cpp. 00299 { 00300 return PageHeight; 00301 }
|
|
Returns page id.
Definition at line 249 of file pagesize.cpp. 00250 { 00251 return Id; 00252 }
|
|
Way of finding the name for this page.
Definition at line 265 of file pagesize.cpp. 00266 { 00267 return &PageName; 00268 }
|
|
Way of of finding out the current page width.
Definition at line 282 of file pagesize.cpp. 00283 { 00284 return PageWidth; 00285 }
|
|
Initialiser.
Definition at line 200 of file pagesize.cpp. 00202 { 00203 // Guard against floating point exceptions by checking the input values 00204 // 0.1" or 0.1mm should be a good enough minimim 00205 ERROR2IF(Width < 0.1 || Width > (double)INT32_MAX, FALSE, "PageSize::Init bad width"); 00206 ERROR2IF(Height < 0.1 || Height > (double)INT32_MAX, FALSE, "PageSize::Init bad width"); 00207 00208 Id = NewId; // Copy the page id across 00209 PageName = *Name; // Copy the page name across 00210 PageWidthInMM = Width; // Copy the width across 00211 PageHeightInMM = Height; // Copy the height across 00212 00213 // Now work out the equivalent millipoint values 00214 // Cannot use the ConvertToNewUnits functions as these require a current doc 00215 // and we have not got one yet! Do it the hard way but use the conversion values 00216 // specified in units.h 00217 switch (Units) 00218 { 00219 case MILLIMETRES: 00220 PageWidth = (INT32)(Width * MM_MP_VAL); 00221 PageHeight = (INT32)(Height * MM_MP_VAL); 00222 break; 00223 case INCHES: 00224 PageWidth = (INT32)(Width * IN_MP_VAL); 00225 PageHeight = (INT32)(Height * IN_MP_VAL); 00226 break; 00227 default: 00228 ERROR2(FALSE,"Bad units used in PageSize::Init"); 00229 break; 00230 } 00231 //PageWidth = ConvertToNewUnits(Width, MILLIMETRES, MILLIPOINTS); 00232 //PageHeight = ConvertToNewUnits(Height, MILLIMETRES, MILLIPOINTS); 00233 00234 return TRUE; 00235 }
|
|
Definition at line 149 of file pagesize.h. |
|
Definition at line 152 of file pagesize.h. |
|
Definition at line 154 of file pagesize.h. |
|
Definition at line 150 of file pagesize.h. |
|
Definition at line 151 of file pagesize.h. |
|
Definition at line 153 of file pagesize.h. |