InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IScriptMutationData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Jonathan W. Brown
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 __IScriptMutationData__
25 #define __IScriptMutationData__
26 
27 #include "IScriptEvent.h"
28 #include "IScriptEventTarget.h"
29 
30 #include "ScriptReturnData.h"
31 
32 using namespace ScriptInfo ;
33 
38 {
39 public:
40  enum { kDefaultIID = IID_ISCRIPTMUTATIONDATA };
41 
44  virtual void SetAttribute( ScriptID propID ) = 0 ;
45 
48  virtual ScriptID GetAttribute() const = 0 ;
49 
52  virtual PMString GetAttributeName( IScript* target, const EngineContext& context ) const = 0 ;
53 
56  virtual ScriptReturnData GetAttributeValue( IScript* target, const EngineContext& context ) const = 0 ;
57 
67  static void InitMutationEventCallback( IScriptEvent* e, IScriptEventTarget::InitCallbackType t, void* privateData )
68  {
69  const ScriptID* propID = (ScriptID*) privateData ;
70  ASSERT( propID ) ;
72  ASSERT( mutationData ) ;
73  if ( t == IScriptEventTarget::kPreDispatch )
74  {
75  mutationData->SetAttribute( *propID ) ;
76  }
77  else if ( t == IScriptEventTarget::kPostDispatch )
78  {
79  }
80  }
81 
82 };
83 
84 #endif