1 //  ----------------------------------------------------------------------------
2 //  MODULE    : FlashPixFormat
3 //  LANGUAGE  : C++
4 //  CREATOR   : Philippe BOSSUT
5 //  CREAT. DATE : Thursday, February 15, 1996
6 //  DESCRIPTION :
7 //  COMMENTS  :
8 //  SCCSID      : @(#)fpxformt.h  1.2 14:43:35 06 Jan 1997
9 //  ----------------------------------------------------------------------------
10 //  Copyright (c) 1999 Digital Imaging Group, Inc.
11 //  For conditions of distribution and use, see copyright notice
12 //  in Flashpix.h
13 //  ----------------------------------------------------------------------------
14   #ifndef FlashPixFormat_h
15   #define FlashPixFormat_h
16   #ifndef Commun_h
17     #include  "common.h"
18   #endif
19 //  ----------------------------------------------------------------------------
20 
21 //  Includes
22 //  --------
23 
24 #ifndef PImageFile_h
25   #include  "pimgfile.h"
26 #endif
27 #ifndef Fichier_h
28   #include  "a_file.h"  // just for Mode
29 #endif
30 #ifndef OLECommun_h
31   #include "olecomm.h"
32 #endif
33 #ifndef FPXBaselineIO_h
34   #include  "fpxlibio.h"
35 #endif
36 
37   class OLEFile;        // to not include OLEFiles.h
38   class OLEStorage;     // to not include OLEStorages.h
39   class OLEStream;      // to not include OLEStreams.h
40   class OLEPropertySet;   // to not include OLEPropertySet.h
41   class OLEPropertySection; // to not include OLEPropertySet.h
42   class OLEProperty;      // to not include OLEProperties.h
43 
44 //  Constants
45 //  ---------
46 
47 //  Types Declarations
48 //  ------------------
49 
50 //  Types Definitions
51 //  -----------------
52 
53 //  Classes Declarations
54 //  --------------------
55 
56   class PFlashPixFile;
57 
58 //  Classes Definitions
59 //  -------------------
60 
61   // File handle
62 
63   class PFlashPixFile : public PImageFile  {
64 
65     public:
66                  PFlashPixFile (ref_FicNom fName, const char* theStorageName, mode_Ouverture mode);
67                  PFlashPixFile (OLEStorage* theOwningStorage, const char* theStorageName, mode_Ouverture mode);
68                 ~PFlashPixFile ();
69 
70         void      Init ();
71 
72         Boolean     OpenStorage  (CLSID& classID, const char * name, OLEStorage ** res);
73         Boolean     CreateStorage(CLSID& classID, const char * name, OLEStorage ** res);
74 
75         virtual unsigned long GetFileSize();
76         FPXStatus   Erreur() const;       // Result of last action on the file
77 
78         // Access the ICC profile in root storage by its index
79         Boolean     SetICCProfile(WORD index, char *pICCProfileStr);
80         Boolean     GetICCProfile(WORD index, char **ppICCProfileStr);
81 
82         // Create CompObj in root storage
83         Boolean     CreateCompObj();
84 
85         // Read and write CompObj in root storage
86         Boolean     ReadCompObj(char **ppUserType, char **ppClipFormat);
87         Boolean     WriteCompObj(char *pUserType, char *pClipFormat);
88 
89         Boolean     Commit();
90         Boolean     GetSummaryInfoProperty (DWORD pID, OLEProperty ** res);
91         Boolean     SetSummaryInfoProperty (DWORD pID, DWORD propType, OLEProperty ** res);
92         Boolean     GetImageContentProperty (DWORD pID, OLEProperty ** res);
93         Boolean     SetImageContentProperty (DWORD pID, DWORD propType, OLEProperty ** res);
94         Boolean     GetImageInfoProperty (DWORD pID, OLEProperty ** res);
95         Boolean     SetImageInfoProperty (DWORD pID, DWORD propType, OLEProperty ** res);
96         Boolean     InitSummaryInfoPropertySet();
97         Boolean     GetSummaryInfoPropertySet();
98         Boolean     InitImageInfoPropertySet();
99 
100       protected:
101 
102     virtual FPXStatus     GetError();
103 
104     private :
105         DWORD       mode;           // Open Access Mode to the OLE file
106 
107         OLEFile*      oleFile;          // the OLE file handle...
108         OLEStorage *    parentStorage;        // ... or the parent storage handle
109         OLEStorage *    rootStorage;        // the OLE root storage handle
110 
111         OLEPropertySet*   imageContentsPropertySet; // Image Contents property set handle
112 
113         OLEPropertySet*   imageInfoPropertySet;   // Image Info property set handle
114 
115         OLEPropertySet*   summaryInfoPropertySet;   // Summary Info property set handle
116   };
117 
118 //  'inline' Functions
119 //  ------------------
120 
121 //  'extern' Functions
122 //  ------------------
123 
124 //  'extern' Variables
125 //  ------------------
126 
127 //  ----------------------------------------------------------------------------
128   #endif // FlashPixFormat_h
129 //  ----------------------------------------------------------------------------
130