InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BookmarkLazyNotificationData.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Ryan Gano
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 __BookmarkLazyNotificationData__
25 #define __BookmarkLazyNotificationData__
26 
27 #include "TreeLazyNotificationData.h"
28 #include "IBookMarkData.h"
29 
36 {
37 public:
42  {
43  }
44 
48  {
49  }
50 
51 private:
52  virtual TreeLazyNotificationData<UID> *CreateNewCookie() const
53  { return new BookmarkLazyNotificationData(fDB); }
54 
55  virtual bool16 GetParent(const UID &bookmarkUID, UID &parentBookmarkUID) const
56  {
57  bool16 bFoundParent(kFalse);
58 
59  if (bookmarkUID != kInvalidUID)
60  {
61  InterfacePtr<IBookMarkData> bookmark(fDB, bookmarkUID, UseDefaultIID());
62  if (bookmark)
63  {
64  parentBookmarkUID = bookmark->GetContainingBookMarkUID();
65 
66  if (parentBookmarkUID != kInvalidUID)
67  bFoundParent = kTrue;
68  }
69  }
70  else
71  {
72  parentBookmarkUID = kInvalidUID;
73  ASSERT_FAIL("Why am I getting passed an invalid UID? This will probably hang in release.");
74  }
75 
76  return bFoundParent;
77  }
78 
79 private:
80  IDataBase *fDB;
81 };
82 
83 #endif