DgnLinkManager.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 
12 
13 DGNPLATFORM_TYPEDEFS(DgnLinkStringUserData)
14 DGNPLATFORM_TYPEDEFS(DgnLinkManager)
15 DGNPLATFORM_TYPEDEFS(DgnLinkNodeChangeEvent)
16 DGNPLATFORM_TYPEDEFS(DgnLinkTreeChangeEvent)
17 DGNPLATFORM_TYPEDEFS(DgnLinkActiveLinkTreeChangeEvent)
18 DGNPLATFORM_TYPEDEFS(NodeChangeEventArray)
19 DGNPLATFORM_TYPEDEFS(DgnLinkNodeChangeHandler)
20 DGNPLATFORM_TYPEDEFS(DgnLinkTreeChangeHandler)
21 DGNPLATFORM_TYPEDEFS(DgnLinkActiveLinkTreeChangeHandler)
22 DGNPLATFORM_TYPEDEFS(DgnLinkFollowEvent)
23 DGNPLATFORM_TYPEDEFS(DgnLinkFollowHandler)
24 DGNPLATFORM_TYPEDEFS(IDgnLinkTraverser)
25 
27 
29 
30 #define DGNLINK_TYPEKEY_File L"FileLink"
31 #define DGNLINK_TYPEKEY_Model L"ModelLink"
32 #define DGNLINK_TYPEKEY_Bookmark L"BookmarkLink"
33 #define DGNLINK_TYPEKEY_Region L"RegionLink"
34 #define DGNLINK_TYPEKEY_Drawing L"Drawing"
35 #define DGNLINK_TYPEKEY_WordFile L"WordFile"
36 #define DGNLINK_TYPEKEY_WordRegion L"WordRegion"
37 #define DGNLINK_TYPEKEY_WordHeading L"WordHeading"
38 #define DGNLINK_TYPEKEY_ExcelFile L"ExcelFile"
39 #define DGNLINK_TYPEKEY_ExcelSheet L"ExcelSheet"
40 #define DGNLINK_TYPEKEY_PrintSetFile L"PrintSetFile"
41 #define DGNLINK_TYPEKEY_PrintDefinition L"PrintDefinition"
42 #define DGNLINK_TYPEKEY_PlotSetFile L"PlotSetFile"
43 #define DGNLINK_TYPEKEY_PlotFile L"PlotFile"
44 #define DGNLINK_TYPEKEY_PlotModel L"PlotModel"
45 #define DGNLINK_TYPEKEY_PDFFile L"PDFFile"
46 #define DGNLINK_TYPEKEY_PDFRegion L"PDFRegion"
47 #define DGNLINK_TYPEKEY_URLLink L"URLLink"
48 #define DGNLINK_TYPEKEY_Folder L"FolderLink"
49 #define DGNLINK_TYPEKEY_Link L"Link"
50 #define DGNLINK_TYPEKEY_LinkLinkSet L"LinkLinkSet"
51 #define DGNLINK_TYPEKEY_ConfigurationVariable L"ConfigurationVariable"
52 #define DGNLINKSET_TYPEKEY_Folder L"LinkFolder"
53 #define DGNLINKSET_TYPEKEY_PrintFolder L"LinkPrintFolder"
54 
55 #define DGNLINK_REGIONTYPE_View L"View"
56 #define DGNLINK_REGIONTYPE_Fence L"Fence"
57 #define DGNLINK_REGIONTYPE_Reference L"Refernce"
58 #define DGNLINK_REGIONTYPE_Drawing L"Drawing"
59 
60 #define DGNLINK_TARGETKEY_Address L"Address"
61 #define DGNLINK_TARGETKEY_File L"File"
62 #define DGNLINK_TARGETKEY_Model L"Model"
63 #define DGNLINK_TARGETKEY_Region L"Region"
64 #define DGNLINK_TARGETKEY_Folder L"Folder"
65 #define DGNLINK_TARGETKEY_RootFolder L"RootFolder"
66 #define DGNLINK_TARGETKEY_Link L"Link"
67 #define DGNLINK_TARGETKEY_System L"System"
68 
69 #define DGNLINK_ECCLASS_LinkTreeLeaf L"LinkTreeLeaf"
70 #define DGNLINK_ECCLASS_LinkTreeBranch L"LinkTreeBranch"
71 
72 #define DGNLINK_XMLTAG_LinkTreeName L"LinkTreeName"
73 #define DGNLINK_XMLTAG_LinkTreeFullPath L"LinkTreeFullPath"
74 
75 // --------------------------------------------------------------------------
76 // These strings can appear in a ConfigurationVariableLink filter expression.
77 // *** Do not translate. Do not change ***
78 #define DGNLINK_FILTERTYPE_File L"File"
79 #define DGNLINK_FILTERTYPE_Model L"Model"
80 #define DGNLINK_FILTERTYPE_Region_View L"View"
81 #define DGNLINK_FILTERTYPE_Region_Reference L"Refernce"
82 #define DGNLINK_FILTERTYPE_Region_Fence L"Fence"
83 #define DGNLINK_FILTERTYPE_Region_Drawing L"Drawing"
84 
85 #define DGNLINK_FILTERTYPE_Model_Sheet L"Sheet"
86 #define DGNLINK_FILTERTYPE_Model_Design L"Design"
87 #define DGNLINK_FILTERTYPE_Model_Drawing L"Drawing"
88 #define DGNLINK_FILTERTYPE_Model_Markup L"Markup"
89 
90 #define DGNLINK_FILTERTYPE_File_DGN L"DGN"
91 #define DGNLINK_FILTERTYPE_File_DWG L"DWG"
92 #define DGNLINK_FILTERTYPE_File_DOC L"DOC"
93 #define DGNLINK_FILTERTYPE_File_XLS L"XLS"
94 #define DGNLINK_FILTERTYPE_File_PDF L"PDF"
95 #define DGNLINK_FILTERTYPE_File_PSET L"PSET"
96 #define DGNLINK_FILTERTYPE_File_Other L"OTHER"
97 
98 #define DGNLINK_FILTERTYPE_View_Basic L"Basic"
99 
100 /*==============================================**/
105  {
110  };
111 /*==============================================**/
115  {
119  };
120 /*==============================================**/
125  {
130  };
131 /*==============================================**/
135  {
139  };
140 
141 /*==============================================**/
145  {
149  };
150 /*==============================================**/
154  {
156  };
157 /*==============================================**/
161  {
163  };
164 /*==============================================**/
168  {
169  Found = 0,
171  NoMatchingLink = 2
172  };
173 /*=================================================================================**/
179  {
180 public:
182  DGNPLATFORM_EXPORT DgnLinkValidationCenter (bool doValidation, bool updateValidation, bool recurse);
183 
186  DGNPLATFORM_EXPORT bool GetDoValidationFlag () const;
189  DGNPLATFORM_EXPORT bool GetUpdateInvalidationFlag () const;
192  DGNPLATFORM_EXPORT bool GetRecurseFlag () const;
196  DGNPLATFORM_EXPORT void LogValidationProblem (DgnLinkR link, WCharCP logString);
197 
200  DGNPLATFORM_EXPORT int GetTestedLinkCount () const;
203  DGNPLATFORM_EXPORT int GetInvalidLinkCount () const;
204  };
205 
206 
207 /*=================================================================================**/
214  {
215 private:
216  virtual void MakeClassAbstract() = 0;
217 public:
218 public:
223  DGNPLATFORM_EXPORT static DgnLinkTreePtr ReadLinkTree (DgnLinkTreeSpecCR treeSpec, bool createIfDoesNotExists);
224 
231  DGNPLATFORM_EXPORT static DgnLinkTreePtr ReadLinkTreeFromElement (EditElementHandleR elemHandle, bool createIfDoesNotExist);
232 
236  DGNPLATFORM_EXPORT static StatusInt WriteLinkTree (DgnLinkTreeR linkTree);
241  DGNPLATFORM_EXPORT static StatusInt WriteLinkTree (DgnLinkTreeR linkTree, EditElementHandleR elemHandle);
245  DGNPLATFORM_EXPORT static StatusInt DeleteProjectTree (DgnLinkTreeSpecCR treeSpec);
246 
251  DGNPLATFORM_EXPORT static StatusInt Serialize (WStringR xmlString, DgnLinkTreeR linkTree);
255  DGNPLATFORM_EXPORT static DgnLinkTreePtr Deserialize (WStringCR xmlString);
261  DGNPLATFORM_EXPORT static void ListProjectTrees (DgnLinkTreeSpecList& treeSpecList, DgnDocumentR document, DgnLinkTreeKey key);
265  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr FindProjectTree (WCharCP treeName, DgnDocumentR document);
271  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr CreateTreeSpec (WCharCP treeName, DgnDocumentMonikerR moniker, DgnLinkTreeKey key);
277  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr CreateTreeSpec (ElementId elemId, WCharCP modelName, DgnDocumentMonikerR moniker);
284  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr CreateTreeSpec (ElementRefP elemRefP);
288  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr CreateTreeSpec (ElementHandleCR elemHandle);
292  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr CreateTreeSpec (EditElementHandleR elemHandle);
296  DGNPLATFORM_EXPORT static DgnLinkTreeSpecPtr CreateTreeSpec (DgnLinkTreeSpecCR srcTreeSpec);
297 
301  DGNPLATFORM_EXPORT static TempDgnLinkTreeBranchOwner CreateLinkSet (StatusInt &, WCharCP key);
312  DGNPLATFORM_EXPORT static WString BuildSuggestedName (DgnLinkCR link, DgnLinkTreeBranchP contextParent, bool fullContext);
316  DGNPLATFORM_EXPORT static DgnLinkStringUserDataPtr CreateStringUserData (UInt32 subID, WCharCP stringData);
321  DGNPLATFORM_EXPORT static bool ValidateLinkTarget (DgnLinkCR link, DgnLinkValidationCenterP logger);
326  DGNPLATFORM_EXPORT static bool HasSameTarget (DgnLinkCR firstLink, DgnLinkCR secondLink);
327 
329  DGNPLATFORM_EXPORT static bool ValidateUniqueLinkNames (DgnLinkList&, bool fixNonUniqueNames, DgnLinkValidationCenterR);
330 
331  /*---------------------------------------------------------------------------------**/
338  DGNPLATFORM_EXPORT static WString GetTreePropertyString (DgnLinkTreeCR linkTree, DgnLinkTreePropertyID propertyID);
339 
340  /*---------------------------------------------------------------------------------**/
344  DGNPLATFORM_EXPORT static void SetTreePropertyString (DgnLinkTreeR linkTree, DgnLinkTreePropertyID , WCharCP);
345 
346  /*---------------------------------------------------------------------------------**/
353  DGNPLATFORM_EXPORT static WString GetLeafPropertyString (DgnLinkTreeLeafCR leaf, DgnLinkLeafPropertyID propertyID);
354 
355  /*---------------------------------------------------------------------------------**/
359  DGNPLATFORM_EXPORT static void SetLeafPropertyString (DgnLinkTreeLeafR leaf, DgnLinkLeafPropertyID, WCharCP);
360 
361 
362  /*---------------------------------------------------------------------------------**/
368  DGNPLATFORM_EXPORT static StatusInt AddLinkHandler (DgnLinkHandlerR linkHandlerIn);
369 
370  /*---------------------------------------------------------------------------------**/
376  DGNPLATFORM_EXPORT static StatusInt AddLinkSetHandler (DgnLinkSetHandlerR linkHandlerIn);
377 
378  /*---------------------------------------------------------------------------------**/
384  DGNPLATFORM_EXPORT static StatusInt RemoveLinkHandler (DgnLinkHandlerR linkHandlerIn);
385 
386  /*---------------------------------------------------------------------------------**/
392  DGNPLATFORM_EXPORT static StatusInt RemoveLinkSetHandler (DgnLinkSetHandlerR linkSetHandlerIn);
393  /*---------------------------------------------------------------------------------**/
399  DGNPLATFORM_EXPORT static StatusInt AddUserDataHandler (DgnLinkUserDataHandlerR userDataHandler);
400  /*---------------------------------------------------------------------------------**/
406  DGNPLATFORM_EXPORT static StatusInt RemoveUserDataHandler (DgnLinkUserDataHandlerR userDataHandler);
407 
408  /*---------------------------------------------------------------------------------**/
413  DGNPLATFORM_EXPORT static DgnLinkManagerR GetManager ();
414 
415  /*---------------------------------------------------------------------------------**/
423  DGNPLATFORM_EXPORT static MatchingLinkState FindMatchingLink (DgnLinkTreePtr& linkTreeOut, ElementHandleCR elemHandle, IDgnLinkTraverserR linkTrav);
424  }; // DgnLinkManager
425 
427  {
428  };
429 
431 
Definition: DgnLinkManager.h:109
Definition: DgnLinkManager.h:108
DgnLinkLeafPropertyID
Link tree leaf property ID option
Definition: DgnLinkManager.h:160
This class can be used to represents the user string data.
Definition: DgnLinks.h:894
DgnLinkFollowState
Possible options to define a follow link.
Definition: DgnLinkManager.h:144
DgnLinkActiveLinkTreeChangeType
This will define the active link tree and active sheet index change type options
Definition: DgnLinkManager.h:134
Definition: DgnLinkHandler.h:96
Definition: DgnLinkManager.h:126
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
A DgnDocument represents a file.
Definition: DgnDocumentManager.h:385
struct Bentley::WString const & WStringCR
Definition: Bentley.h:239
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
The Drawing Set interface allows programs to manipulate drawing sets and drawing links stored in dgn ...
Definition: DgnLinkManager.h:213
Definition: DgnLinkManager.h:116
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
wchar_t const * WCharCP
Definition: Bentley.h:224
DgnLinkActionProgress
Possible options to define link action progeress.
Definition: DgnLinkManager.h:114
uint32_t UInt32
Definition: Bentley.r.h:128
struct DgnPlatform::DgnLink const & DgnLinkCR
Definition: DgnLinks.h:21
MatchingLinkState
Matching link on a filed status
Definition: DgnLinkManager.h:167
Definition: DgnLinkManager.h:426
DgnLinkActionType
Possible options to define link action type.
Definition: DgnLinkManager.h:104
A DgnDocumentMoniker identifies a file.
Definition: DgnDocumentManager.h:181
IManager * GetManager()
Return a pointer to the one and only relationship manager.
#define DGNPLATFORM_TYPEDEFS(_name_)
Definition: DgnPlatform.h:73
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
DgnLinkChangeType
Possible options to define link action change type, like whether links is getting added or deleted et...
Definition: DgnLinkManager.h:124
Definition: DgnLinkManager.h:129
DgnLinkTreePropertyID
Link tree property ID option
Definition: DgnLinkManager.h:153
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
A smart pointer to an object of type T, where the pointee is an object which under ordinary circumsta...
Definition: DgnLinkTree.h:83
int StatusInt
Definition: Bentley.h:222
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
Definition: DgnLinkManager.h:127
bvector< DgnLinkP > DgnLinkList
Definition: DgnLinks.h:59
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
Definition: DgnLinkManager.h:107
DgnLinkTreeKey
The DgnLinkTreeKey defines the location at which a link tree can be stored.
Definition: DgnLinkTree.h:416
bvector< DgnLinkTreeSpecPtr > DgnLinkTreeSpecList
Definition: DgnLinks.h:58
Definition: DgnLinkManager.h:128
Definition: DgnLinkManager.h:117
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Vistor that logs the results of ValidateLinkTarget.
Definition: DgnLinkManager.h:178
Definition: DgnLinkManager.h:106

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.