home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / xcontact / include / PrefFile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  3.5 KB  |  110 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. /////////////////////////////////////////////////////////////////
  18. // PrefFile.h --
  19. /////////////////////////////////////////////////////////////////
  20. #ifndef PREFFILE_H
  21. #define PREFFILE_H
  22.  
  23. #include "OkFileItem.h"
  24. #include "OkFile.h"
  25. #include "OkStr.h"
  26. #include "OkStrArray.h"
  27.  
  28. #include <Xm/Xm.h>
  29.  
  30. class PrefFile : public OkFileItem {
  31.  
  32.  private:
  33.  
  34.   Boolean     _notFound;
  35.   Boolean    _notWritable;
  36.   
  37.   // Saved Preferences:
  38.   OkStr        _lastRolodex;
  39.   OkStr        _dataFilePath;
  40.  
  41.   Boolean     _showFaceImg;
  42.   OkStr        _faceImgLoc;
  43.   OkStrArray    _faceImgLocList;
  44.   OkStr        _sortOrder;
  45.  
  46.   Boolean    _alwaysUseIntrDialog;
  47.  
  48.   Dimension    _listViewWidth;
  49.   Dimension    _listViewHeight;
  50.   Dimension    _activeCardViewWidth;
  51.   Dimension    _activeCardViewHeight;
  52.  
  53.   ///////////////////////////////////////////////////////
  54.   OkStr        _fileName;
  55.   OkFile*    _file;
  56.   void read( fstream& /* infile */ );
  57.   void write( fstream& /* outfile */ );
  58.  
  59.   void putline( fstream&, const char*, const char* );
  60.   void putline( fstream& f, const char* s, OkStr v ) 
  61.                     { putline(f,s,(const char *) v); }
  62.   void putline( fstream&, const char*, int );
  63.   void putline( fstream& f, const char* s, Boolean b ) { putline(f,s,int(b)); }
  64.  
  65.  public:
  66.   PrefFile();
  67.   ~PrefFile();
  68.  
  69.   void setFactoryDefault();
  70.  
  71.   Boolean notFound() const        { return _notFound; }
  72.   Boolean noLastRolodex() const        { return ( _lastRolodex == "" ); }
  73.   Boolean save();
  74.  
  75.   const char* fileName() const        { return _fileName; }
  76.  
  77.   const char* lastRolodex() const     { return _lastRolodex; }
  78.   const char* dataFilePath() const     { return _dataFilePath; }
  79.   Boolean showFaceImg() const        { return _showFaceImg; }
  80.   const char* faceImgLoc( int i );
  81.   const char* faceImgLoc() const    { return _faceImgLoc; }
  82.   const char* sortOrder() const     { return _sortOrder; }
  83.  
  84.   Boolean alwaysUseIntrDialog() const    { return _alwaysUseIntrDialog; }
  85.  
  86.   Dimension listViewWidth() const    { return _listViewWidth; }
  87.   Dimension listViewHeight() const    { return _listViewHeight; }
  88.   Dimension activeCardViewWidth() const { return _activeCardViewWidth; }
  89.   Dimension activeCardViewHeight() const{ return _activeCardViewHeight; }
  90.  
  91.  
  92.   void setShowFaceImg( Boolean b )    { _showFaceImg = b; }
  93.   void setFaceImgLoc( const char* path );
  94.   void setDataFilePath( const char* path ) { _dataFilePath = path; }
  95.   void setLastRolodex( const char* rol ) { _lastRolodex = rol; }
  96.   void setAscendingSortOrder()        { _sortOrder = "ASCENDING"; }
  97.   void setDescendingSortOrder()        { _sortOrder = "DESCENDING"; }
  98.  
  99.   void setAlwaysUseIntrDialog( Boolean b ) { _alwaysUseIntrDialog = b; }
  100.  
  101.   void setListViewWidth( Dimension w )        { _listViewWidth = w; }
  102.   void setListViewHeight( Dimension h )        { _listViewHeight = h; }
  103.   void setActiveCardViewWidth( Dimension w )    { _activeCardViewWidth = w; }
  104.   void setActiveCardViewHeight( Dimension h )    { _activeCardViewHeight = h; }
  105. };
  106.  
  107. extern PrefFile* thePrefFile;
  108.  
  109. #endif
  110.