InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunInStyleList.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Eric_Menninga
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 __RunInStyleList__
25 #define __RunInStyleList__
26 
27 #include "WideString.h"
28 #include "K2Vector.h"
29 
30 class IPMStream;
31 
32 
45 {
46  public:
47  typedef object_type data_type;
48 
49  RunInStyleRule() : fCharacterStyle(kInvalidUID), fTriggerRegExp()
50  {}
51 
52  RunInStyleRule(UID charstyle, const WideString& trigger)
53  : fCharacterStyle(charstyle), fTriggerRegExp(trigger)
54  {}
55 
56  bool operator==(const RunInStyleRule&) const
57  { ASSERT_FAIL("appease K2Vector.Location"); return false; }
58 
70  { fTriggerRegExp = s; }
71 
76  bool16 IsLoopbackStyleRule(int32 *pNextRuleIndex = nil) const;
77 
81  void SetCharacterStyle(const UID& cs)
82  { fCharacterStyle = cs; }
83 
86  { return fCharacterStyle; }
87 
91  { return fTriggerRegExp; }
92 
94  void ReadWrite(IPMStream *stream);
95 
97  typedef enum { kRI_NoError = 0, kRI_Empty, kRI_UnmatchedBraces, kRI_NoTrigger} RunInErrorType;
98 
102  static RunInErrorType VerifyExpression(const WideString& test);
103 
104  private:
105  WideString fTriggerRegExp;
106  UID fCharacterStyle;
107 };
108 
109 
110 
111 
114 class RunInStyleList : public K2Vector<RunInStyleRule>
115 {
116 };
117 
118 #endif
119  //__RunInStyleList__