InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FileTypeInfo.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Richard Rodseth
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __FileTypeInfo__
25 #define __FileTypeInfo__
26 
27 #include "PMTypes.h"
28 #include "PMString.h"
29 
30 
31 #ifdef PUBLIC_BUILD
32 #endif
33 
34 //========================================================================================
35 // CLASS FileTypeInfo
39 //========================================================================================
40 
42 {
43 public:
44  typedef object_type data_type;
45 
46 public:
48  FileTypeInfo();
50  FileTypeInfo(const SysOSType& fileType, const SysOSType& fileCreator, const PMString& fileExtension, const PMString& mimeType, const FileTypeInfoID& fileTypeID);
52  FileTypeInfo(const FileTypeInfo& other)
53  {Copy(other);}
54 
55  ~FileTypeInfo();
56 
58  SysOSType GetFileType();
60  SysOSType GetFileCreator();
62  const PMString& GetFileExtension();
64  const PMString& GetFileMimeType();
67 
69  void SetFileType(const SysOSType& fileType);
71  void SetCreator(const SysOSType& creator);
73  void SetFileExtension(const PMString& extension);
75  void SetFileMimeType(const PMString& mimeType);
77  void SetFileTypeID(const FileTypeInfoID& id);
78 
80  bool operator==(const FileTypeInfo &other) const;
83  {Copy(other); return *this;}
84 
85 private:
86  void Copy(const FileTypeInfo &other);
87 
88 private:
89  SysOSType fFileType;
90  SysOSType fFileCreator;
91  PMString fFileExtension;
92  PMString fFileMimeType;
93  FileTypeInfoID fFileTypeID;
94 };
95 
96 
97 //--------------------------------------------------------------------------------------
98 // FileTypeInfo::GetFileType
99 //--------------------------------------------------------------------------------------
100 
101 inline SysOSType FileTypeInfo::GetFileType()
102 {
103  return fFileType;
104 }
105 
106 //--------------------------------------------------------------------------------------
107 // FileTypeInfo::GetCreator
108 //--------------------------------------------------------------------------------------
109 
111 {
112  return fFileCreator;
113 }
114 
115 //--------------------------------------------------------------------------------------
116 // FileTypeInfo::GetFileExtension
117 // (always lowercase)
118 //--------------------------------------------------------------------------------------
119 
121 {
122  return fFileExtension;
123 }
124 
125 //--------------------------------------------------------------------------------------
126 // FileTypeInfo::GetFileMimeType
127 // (always lowercase)
128 //--------------------------------------------------------------------------------------
129 
131 {
132  return fFileMimeType;
133 }
134 
135 //--------------------------------------------------------------------------------------
136 // FileTypeInfo::GetFileTypeInfoID
137 //--------------------------------------------------------------------------------------
138 
140 {
141  return fFileTypeID;
142 }
143 //--------------------------------------------------------------------------------------
144 // FileTypeInfo::SetFileType
145 //--------------------------------------------------------------------------------------
146 
147 inline void FileTypeInfo::SetFileType(const SysOSType& fileType)
148 {
149  fFileType = fileType;
150 }
151 
152 //--------------------------------------------------------------------------------------
153 // FileTypeInfo::SetCreator
154 //--------------------------------------------------------------------------------------
155 
156 inline void FileTypeInfo::SetCreator(const SysOSType& creator)
157 {
158  fFileCreator = creator;
159 }
160 
161 //--------------------------------------------------------------------------------------
162 // FileTypeInfo::SetFileExtension
163 // (always mapped to lowercase)
164 //--------------------------------------------------------------------------------------
165 
166 inline void FileTypeInfo::SetFileExtension(const PMString& extension)
167 {
168  fFileExtension = extension;
169  fFileExtension.ToLower();
170 }
171 
172 //--------------------------------------------------------------------------------------
173 // FileTypeInfo::SetFileMimeType
174 // (always mapped to lowercase)
175 //--------------------------------------------------------------------------------------
176 
177 inline void FileTypeInfo::SetFileMimeType(const PMString& mimeType)
178 {
179  fFileMimeType = mimeType;
180  fFileMimeType.ToLower();
181 }
182 
183 //--------------------------------------------------------------------------------------
184 // FileTypeInfo::SetFileTypeID
185 //--------------------------------------------------------------------------------------
187 {
188  fFileTypeID = id;
189 }
190 
191 
192 #ifdef PUBLIC_BUILD
193 #endif
194 
195 #endif // __FileTypeInfo__