home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.3 Development Libraries / SGI IRIX 6.3 Development Libraries.iso / dist6.3 / ViewKit_dev.idb / usr / share / src / ViewKit / Applications / PhoneBook / Preferences.h.z / Preferences.h
Encoding:
C/C++ Source or Header  |  1996-09-20  |  2.4 KB  |  63 lines

  1. ////////////////////////////////////////////////////////////////////////////////
  2. ///////   Copyright 1992, Silicon Graphics, Inc.  All Rights Reserved.   ///////
  3. //                                                                            //
  4. // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;     //
  5. // the contents of this file may not be disclosed to third parties, copied    //
  6. // or duplicated in any form, in whole or in part, without the prior written  //
  7. // permission of Silicon Graphics, Inc.                                       //
  8. //                                                                            //
  9. // RESTRICTED RIGHTS LEGEND:                                                  //
  10. // Use,duplication or disclosure by the Government is subject to restrictions //
  11. // as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data     //
  12. // and Computer Software clause at DFARS 252.227-7013, and/or in similar or   //
  13. // successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -    //
  14. // rights reserved under the Copyright Laws of the United States.             //
  15. //                                                                            //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. #ifndef _PREFERENCES_
  18. #define _PREFERENCES_
  19.  
  20. #include <X11/Intrinsic.h>
  21.  
  22. #define DEFAULT_FILENAME "~/.phone"
  23.  
  24. class Preferences;
  25.  
  26. extern Preferences *thePreferences;
  27.  
  28. class Preferences {
  29.   public:
  30.     Preferences(Widget w);
  31.     ~Preferences();
  32.     
  33.     Boolean isDirty() { return dirty; }
  34.     
  35.     char *filename() { return _filename; }
  36.     Boolean showAddr() { return _showAddr; }
  37.     Boolean showComment() { return _showComment; }
  38.     int itemSpacing() { return _itemSpacing; }
  39.     int printWidth() { return _printWidth; }
  40.     
  41.     void setFilename(const char *v);
  42.     void setShowAddr(Boolean v) { _showAddr = v; dirty = True; }
  43.     void setShowComment(Boolean v) { _showComment = v; dirty = True; }
  44.     void setItemSpacing(int v) { _itemSpacing = v; dirty = True; }
  45.     void setPrintWidth(int v) { _printWidth = v; dirty = True; }
  46.     
  47.     void loadPreferences();
  48.     void savePreferences();
  49.     
  50.   protected:
  51.     int readStr(FILE *fd, char *str_return);
  52.     int readInt(FILE *fd, int *num);
  53.     
  54.     Boolean dirty;
  55.     char *_filename;
  56.     Boolean _showAddr;
  57.     Boolean _showComment;
  58.     int _itemSpacing;
  59.     int _printWidth;
  60. };
  61.  
  62. #endif
  63.