InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AppInfo.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Paul Sorrick
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 // Purpose: Defines classes for launching applications (Edit With functionality).
24 //
25 //========================================================================================
26 
27 #ifndef __APPINFO__
28 #define __APPINFO__
29 
30 #include "PMString.h"
31 #include "K2Vector.h"
32 
33 //----------------------------------------------------------------------------------------
34 // Forward declarations
35 //----------------------------------------------------------------------------------------
36 class AppInfo;
37 
40 
41 #ifdef PUBLIC_BUILD
42 #endif
43 
57 class AppInfo
58 {
59  public:
60  typedef object_type data_type;
61 
62  AppInfo() {}
63 
64  AppInfo
65  (
66  const PMString& path, // Path to .exe
67  const PMString& displayName, // Display name, used for our menus
68  const PMString& version, // Version of .exe file
69  const bool16 defaultApp = kFalse, // Is the default app
70  const bool16 adobeApp = kFalse // Is an Adobe app
71  ) :
72  fPath(path),
73  fDisplayName(displayName),
74  fVersion(version),
75  fIsDefaultApp(defaultApp),
76  fIsAdobeApp(adobeApp)
77  { fPath.SetTranslatable(kFalse), fDisplayName.SetTranslatable(kFalse), fVersion.SetTranslatable(kFalse); }
78 
81  AppInfo(const AppInfo& info) :
82  fPath(info.fPath),
83  fDisplayName(info.fDisplayName),
84  fVersion(info.fVersion),
85  fIsDefaultApp(info.fIsDefaultApp),
86  fIsAdobeApp(info.fIsAdobeApp)
87  {}
88 
95  PMString GetPath() const { return fPath; }
96 
101  PMString GetDisplayName() const { return fDisplayName; }
102 
107  PMString GetVersion() const { return fVersion; }
108 
113  bool16 GetIsDefault() const { return fIsDefaultApp; }
114 
119  bool16 GetIsAdobeApp() const { return fIsAdobeApp; }
120 
123  bool16 operator==(const AppInfo& other) const
124  {
125  return ((fPath == other.fPath) &&
126  (fDisplayName == other.fDisplayName) &&
127  (fVersion == other.fVersion) );
128  }
129 
135  bool16 operator<(const AppInfo& other) const
136  {
137  if (fIsAdobeApp)
138  {
139  if (other.fIsAdobeApp)
140  return (fDisplayName == other.fDisplayName ? fVersion < other.fVersion : fDisplayName < other.fDisplayName);
141  else
142  return kTrue;
143  }
144  else if (other.fIsAdobeApp)
145  {
146  return kFalse;
147  }
148 
149  return (fDisplayName == other.fDisplayName ? fVersion < other.fVersion : fDisplayName < other.fDisplayName);
150  }
151 
152  private:
153  PMString fPath; // Path to .exe
154  PMString fDisplayName; // Display name, used for our menus
155  PMString fVersion; // Version of .exe file
156 
157  bool16 fIsDefaultApp; // kTrue if default editor, kFalse otherwise
158  bool16 fIsAdobeApp; // kTrue if app is an "Adobe" app, kFalse otherwise
159 };
160 
163 extern const AppInfo kNullAppInfo;
164 
165 
166 #endif // __APPINFO__
167