InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ITextCommandPreProcess.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: ekenning
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 __ITextCommandPreProcess__
25 #define __ITextCommandPreProcess__
26 
27 #include "IPMUnknown.h"
28 #include "TextID.h"
29 #include "PMTextUtils.h"
30 
31 class ITextModel;
32 class WideString;
33 class AttributeBossList;
34 class PasteData;
35 class ILanguage;
36 class ICommand;
37 
42 {
43  public:
44  enum { kDefaultIID = IID_ITEXTEDITPREPROCESS };
45 
46  // allows service to preprocess text commands -- return kTrue if you modified anything
47  virtual bool16 DeletePreProcess(ITextModel* model, TextIndex& position, int32& length) = 0;
48  virtual bool16 ApplyStylePreProcess(ITextModel* model, TextIndex& position, int32& length, UID& styleRef, ClassID& whichStrand) = 0;
49 
50  // return nil if you didn't change anything. return a new pointer if you want to apply other attributes.
51  // return the same pointer if you changed something besides the data pointed to
52  virtual WideString* InsertPreProcess(ITextModel* model, TextIndex& position, const WideString* data, const ILanguage *language = nil ) = 0;
53 
54  virtual WideString* ReplacePreProcess(ITextModel* model, TextIndex& position, int32& length, const WideString* data, const ILanguage *language = nil) = 0;
55 
56  virtual AttributeBossList* ApplyOverridesPreProcess(ITextModel* model, TextIndex& position, int32& length, const AttributeBossList *attributes, ClassID& whichStrand) = 0;
57  virtual AttributeBossList* ClearOverridesPreProcess(ITextModel* model, TextIndex& position, int32& length, const AttributeBossList *attributes, ClassID& whichStrand) = 0;
58 
59  virtual PasteData* PastePreProcess(ITextModel* model, TextIndex& position, const PasteData *data, int32 subrange) = 0;
60  virtual void GetSubRangePreProcess(ITextModel* model, TextIndex& start, int32& length, const Text::StoryRangeList& contextList, int32 contextListIndex) = 0;
61 
62  // Begin/EndProcessCommand are called by UserApplyAttrCmd and UserTypeTextCmd to temporarily enable CJKTextPreProcessor and ScriptTextProcessor.
63  virtual void BeginProcessCommand( ICommand *cmd ) = 0;
64  virtual void EndProcessCommand( ICommand *cmd ) = 0;
65 };
66 
67 
68 #endif
69  // __ITextCommandPreProcess__