InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
idocumentlog.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: rbriggs
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 __IDocumentLog__
25 #define __IDocumentLog__
26 
27 #include "IEnvironment.h"
28 #include "IPMUnknown.h"
29 #include "ISession.h"
30 #include "ShuksanID.h"
31 #include "FormatID.h"
32 #include "LocaleSetting.h"
33 
34 
46 class IDocumentLog : public IPMUnknown
47 {
48 public:
49  enum { kDefaultIID = IID_IDOCUMENTLOG };
50 
52  {
53  kMacintosh = 0,
54  kWindows = 1,
57  kWasm = 4,
58  };
59 
60  enum EventType
61  {
77  kSaveAs = 6,
79  kCreated = 7,
87  kBookSync = 11,
107  //kExportedSWF = 21,
114 
120  };
121 
123  {
128  };
129 
130 public:
133  class DocEvent
134  {
135  public:
139  {
140  fWhat = IDocumentLog::kNoEvent;
141  #if defined(MACINTOSH)
142  fPlatform = kMacintosh;
143  #else
144  #if defined(_M_AMD64)
145  fPlatform = kWindowsX64;
146  #else
147  fPlatform = kWindows;
148  #endif
149  #endif
150  fBuild = 0;
151  fSystemMajor = 0;
152  fSystemMinor = 0;
153  fTimePosted.CurrentTime();
154  fAppFS = LocaleSetting::GetLocale().GetFeatureSetId();
155  }
156  DocEvent(EventType what);
157  DocEvent(const DocEvent &other)
158  {Copy(other);}
159 
164  {return fWhat;}
165 
170  {return fPlatform;}
171 
176  {return FormatID(fSystemMajor, fSystemMinor);}
177 
182  {return fHighestVersionStr;}
183 
187  int16 GetFeatureSet() const
188  {return fAppFS;}
189 
193  int16 GetBuildNumber() const
194  {return fBuild;}
195 
200  {return fTimePosted;}
201 
204  DocEvent &operator =(const DocEvent &other)
205  {Copy(other); return *this;}
206 
210  void ReadWrite(IPMStream *s);
211 
212  private:
213  void Copy(const DocEvent &other);
214 
215  private:
216  EventType fWhat;
217  PlatformType fPlatform;
218  int16 fSystemMajor;
219  int16 fSystemMinor;
220  int16 fAppFS;
221  int16 fBuild;
222  GlobalTime fTimePosted;
223  PMString fHighestVersionStr;
224  };
225 
226 public:
230  virtual void SetMaxEntries(int32 maximumNumberOfEvents) = 0;
231 
235  virtual bool16 InfoIsAvailable() const = 0;
236 
240  virtual void AddEvent(EventType what) = 0;
241 
245  virtual int32 EventCount() const = 0;
246 
251  virtual int32 EventCountOfType(EventType what) const = 0;
252 
257  virtual bool16 GetEventInfo(int32 i, DocEvent &event) const = 0;
258 
264  virtual bool16 GetEventInfoOfType(EventType what, int32 i, DocEvent &event) const = 0;
265 
271  virtual bool16 HasHadEvent(EventType what) const = 0;
272 
277  virtual void SerializeAsEventLog(IPMStream *s, IDocumentLog::LineBreaking lineBreaks) const = 0;
278 
281  virtual const char* GetEventDescription(EventType what) const = 0;
282 };
283 
284 #endif // __IDocumentLog__