InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HyphenExceptions.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: hhorton
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 // ADOBE CONFIDENTIAL
24 //
25 //========================================================================================
26 
27 #ifndef __HyphenExceptions__
28 #define __HyphenExceptions__
29 
30 #include "K2Vector.h"
31 #include "UserDictWordList.h"
32 
33 class ILanguage;
34 
36 {
37 public:
38  typedef object_type data_type;
40  HyphenExceptions(const HyphenExceptions& other);
41  HyphenExceptions(const ILanguage *language);
43 
44  void operator= (const HyphenExceptions& copy);
52  bool16 operator== (const HyphenExceptions& other) const
53  { return (fLanguageName == other.fLanguageName &&
54  fStrings == other.fStrings &&
55  fNotStrings == other.fNotStrings); }
64  bool16 operator> (const HyphenExceptions& other) const
65  { return fLanguageName > other.fLanguageName; }
74  bool16 operator< (const HyphenExceptions& other) const
75  { return fLanguageName < other.fLanguageName; }
76 
82  bool16 empty() const;
83 
91  bool16 SameLanguage(const HyphenExceptions& other) const;
92 
100  bool16 SameLanguage(const ILanguage *language) const;
101 
107  void SetLanguage(const ILanguage *language);
108 
114  ILanguage *QueryLanguage() const;
115 
121  void SetLanguageName(const PMString &languageName);
122 
128  void ReadWrite(IPMStream* s);
129 
130 private:
131  PMString fLanguageName;
132 public:
133  UserDictWordList fStrings;
134  UserDictWordList fNotStrings;
135 };
136 
137 
138 class HyphenExceptionsList //sorted
139 {
140  public:
142  {}
144  { *this = copy; }
146 
150  void clear();
154  void Clear()
155  { clear(); }
156 
162  int32 size() const
163  { return (int32)fList.size(); }
169  int32 Length() const
170  { return size(); }
171 
177  void Insert(const HyphenExceptions& xx);
178 
186  const HyphenExceptions& operator[](int32 i) const
187  { ASSERT(fList[i] != nil); return *(fList[i]); }
196  { ASSERT(fList[i] != nil); return *(fList[i]); }
197 
198  HyphenExceptionsList& operator=(const HyphenExceptionsList& copy);
199 
208  bool16 operator==(const HyphenExceptionsList& other) const;
217  bool16 operator!=(const HyphenExceptionsList& other) const
218  { return !(*this == other); }
219 
225  void ReadWrite(IPMStream* s);
226 
227  private:
229 };
230 
231 
232 #endif