home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /////////////////////////////////////////////////////////////////
- // PrefFile.h --
- /////////////////////////////////////////////////////////////////
- #ifndef PREFFILE_H
- #define PREFFILE_H
-
- #include "OkFileItem.h"
- #include "OkFile.h"
- #include "OkStr.h"
- #include "OkStrArray.h"
-
- #include <Xm/Xm.h>
-
- class PrefFile : public OkFileItem {
-
- private:
-
- Boolean _notFound;
- Boolean _notWritable;
-
- // Saved Preferences:
- OkStr _lastRolodex;
- OkStr _dataFilePath;
-
- Boolean _showFaceImg;
- OkStr _faceImgLoc;
- OkStrArray _faceImgLocList;
- OkStr _sortOrder;
-
- Boolean _alwaysUseIntrDialog;
-
- Dimension _listViewWidth;
- Dimension _listViewHeight;
- Dimension _activeCardViewWidth;
- Dimension _activeCardViewHeight;
-
- ///////////////////////////////////////////////////////
- OkStr _fileName;
- OkFile* _file;
- void read( fstream& /* infile */ );
- void write( fstream& /* outfile */ );
-
- void putline( fstream&, const char*, const char* );
- void putline( fstream& f, const char* s, OkStr v )
- { putline(f,s,(const char *) v); }
- void putline( fstream&, const char*, int );
- void putline( fstream& f, const char* s, Boolean b ) { putline(f,s,int(b)); }
-
- public:
- PrefFile();
- ~PrefFile();
-
- void setFactoryDefault();
-
- Boolean notFound() const { return _notFound; }
- Boolean noLastRolodex() const { return ( _lastRolodex == "" ); }
- Boolean save();
-
- const char* fileName() const { return _fileName; }
-
- const char* lastRolodex() const { return _lastRolodex; }
- const char* dataFilePath() const { return _dataFilePath; }
- Boolean showFaceImg() const { return _showFaceImg; }
- const char* faceImgLoc( int i );
- const char* faceImgLoc() const { return _faceImgLoc; }
- const char* sortOrder() const { return _sortOrder; }
-
- Boolean alwaysUseIntrDialog() const { return _alwaysUseIntrDialog; }
-
- Dimension listViewWidth() const { return _listViewWidth; }
- Dimension listViewHeight() const { return _listViewHeight; }
- Dimension activeCardViewWidth() const { return _activeCardViewWidth; }
- Dimension activeCardViewHeight() const{ return _activeCardViewHeight; }
-
-
- void setShowFaceImg( Boolean b ) { _showFaceImg = b; }
- void setFaceImgLoc( const char* path );
- void setDataFilePath( const char* path ) { _dataFilePath = path; }
- void setLastRolodex( const char* rol ) { _lastRolodex = rol; }
- void setAscendingSortOrder() { _sortOrder = "ASCENDING"; }
- void setDescendingSortOrder() { _sortOrder = "DESCENDING"; }
-
- void setAlwaysUseIntrDialog( Boolean b ) { _alwaysUseIntrDialog = b; }
-
- void setListViewWidth( Dimension w ) { _listViewWidth = w; }
- void setListViewHeight( Dimension h ) { _listViewHeight = h; }
- void setActiveCardViewWidth( Dimension w ) { _activeCardViewWidth = w; }
- void setActiveCardViewHeight( Dimension h ) { _activeCardViewHeight = h; }
- };
-
- extern PrefFile* thePrefFile;
-
- #endif
-