InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AssignmentMgrLazyNotificationData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Cindy Chen
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 __AssignmentMgrLazyNotificationData__
25 #define __AssignmentMgrLazyNotificationData__
26 
27 #include "UIDRef.h"
28 #include "Utils.h"
29 
30 #include "TreeLazyNotificationData.h"
31 #include "IAssignmentUtils.h"
32 
38 {
39 public:
44  {
45  }
46 
50  {
51  }
52 
53 private:
54  virtual TreeLazyNotificationData<UID> *CreateNewCookie() const
55  { return new AssignmentMgrLazyNotificationData(fDB); }
56 
57  virtual bool16 GetParent(const UID &node, UID &parent) const
58  {
59  bool16 bFoundParent(kFalse);
60 
61  if (node != kInvalidUID)
62  {
63  UIDRef nodeRef(fDB, node);
64  UIDRef parentRef(Utils<IAssignmentUtils>()->GetParent(nodeRef));
65  if (parentRef != UIDRef::gNull)
66  {
67  parent = parentRef.GetUID();
68  bFoundParent = kTrue;
69  }
70  }
71  else
72  {
73  parent = node;
74  ASSERT_FAIL("Why am I getting passed an invalid reference? This will probably hang in release.");
75  }
76 
77  return bFoundParent;
78  }
79 
80  IDataBase * fDB;
81 };
82 
83 #endif