home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 Mobile / Chip_Mobile_2001.iso / palm / business / printcar / printcar.exe / src / PrintCardPreferences.cc < prev    next >
C/C++ Source or Header  |  2000-06-10  |  1KB  |  50 lines

  1. //
  2. //  $Id: PrintCardPreferences.cc,v 1.1 2000/06/10 00:19:46 sergey Exp $
  3. //
  4.  
  5. #include <Pilot.h>
  6. #include "PrintCardPreferences.h"
  7. #include "Util/DataOutputStream.h"
  8. #include "Util/DataInputStream.h"
  9.  
  10.  
  11. PrintCardPreferences::PrintCardPreferences()
  12. {
  13.     setDefaults();
  14. }
  15.  
  16.  
  17. // operations
  18.  
  19. void PrintCardPreferences::setDefaults()
  20. {
  21.     _frameHeight = 150;     // ~ 55 mm
  22.     _frameWidth  = 235;     // ~ 85 mm
  23.     _frameMargin = 10;      // ~ 3.5 mm
  24.     _scaleX      = 100;     // in %
  25.     _scaleY      = 100;     // in %
  26.     _oneCopy     = true;
  27. }
  28.  
  29. void PrintCardPreferences::serialize(Util::DataOutputStream& stream) const
  30. {
  31.     stream.write(_frameHeight);
  32.     stream.write(_frameWidth);
  33.     stream.write(_frameMargin);
  34.     stream.write(_scaleX);
  35.     stream.write(_scaleY);
  36.     stream.write(_oneCopy);
  37. }
  38.  
  39. void PrintCardPreferences::restore(const Util::DataInputStream& stream)
  40. {
  41.     _frameHeight = stream.readAs<int>();
  42.     _frameWidth = stream.readAs<int>();
  43.     _frameMargin = stream.readAs<int>();
  44.     _scaleX = stream.readAs<int>();
  45.     _scaleY = stream.readAs<int>();
  46.     _oneCopy = stream.readAs<bool>();
  47. }
  48.  
  49.  
  50.