home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / libfont / src / wffpCat.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.6 KB  |  99 lines

  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* 
  19.  * wffpCat.h (FontDisplayerCatalogObject.h)
  20.  *
  21.  * This maintains the displayer catalog.
  22.  *
  23.  * dp Suresh <dp@netscape.com>
  24.  */
  25.  
  26.  
  27. #ifndef _wffpCat_H_
  28. #define _wffpCat_H_
  29.  
  30. #include "libfont.h"
  31. #include "nf.h"
  32.  
  33. #include "Mnfrc.h"
  34. #include "Mnffmi.h"
  35. #include "Mnffp.h"
  36. #include "Mnffbu.h"
  37.  
  38. #include "wfList.h"
  39.  
  40. class FontCatalogFile {
  41.     FILE *fp;
  42.     int indentLevel;
  43.     int writing;
  44. public:
  45.     FontCatalogFile(const char *filename, int write=0);
  46.     ~FontCatalogFile(void);
  47.  
  48.     // Anything less than 0 isn't good status.
  49.     int status(void);
  50.  
  51.     // Read values from a catalog file
  52.     char *readline(char *buf, int buflen);
  53.     int isEof();
  54.  
  55.     // Print values to the catalog file
  56.     int output(const char *name);
  57.     int output(const char *name, int value);
  58.     int output(const char *name, const char *str);
  59.  
  60.     int indentIn(void);
  61.     int indentOut(void);
  62. };
  63.  
  64. struct catalog_store {
  65.     jint rcMajorType;
  66.     jint rcMinorType;
  67.     struct nffmi **fmis;
  68.     int maxFmiCount;
  69.     int fmiCount;
  70. };
  71.  
  72. class FontDisplayerCatalogObject : public wfList {
  73. private:
  74.     int copyFmis(struct catalog_store *ele, struct nffmi **fmis);
  75.     int addFmi(struct catalog_store *ele, struct nffmi *fmi);
  76.  
  77. public:
  78.     FontDisplayerCatalogObject(const char *reconstructString = NULL);
  79.     ~FontDisplayerCatalogObject();
  80.     int finalize(void);
  81.  
  82.     // Query if a particular fmi is supported by the catalog
  83.     int supportsFmi(struct nfrc *rc, struct nffmi *fmi);
  84.  
  85.     // Update the catalog with a new list of fmi per rc
  86.     // Takes an internal copy of the fmi array.
  87.     int update(struct nfrc *rc, struct nffmi **fmi);
  88.     int addFmi(jint rcMajorType, jint rcMinorType, struct nffmi *fmi);
  89.  
  90.     // Query if this catalog has been initialized for the rc
  91.     int isInitialized(struct nfrc *rc);
  92.  
  93.     // For serailization
  94.     int describe(FontCatalogFile &fc);
  95.     int reconstruct(FontCatalogFile &fc);
  96. };
  97.  
  98. #endif /* _wffpCat_H_ */
  99.