Link associated with an image
I want to get, into my (C++)plugin the link associated with a selected image in an indd document
I tried following to achieve:
- I tried to attach an observer with the associated kImageItem so that when the image is clicked the observer is called and I can get the image link from the subject associated. However the observer::update is never called when I select or click on the image. The code for attaching the observer:
- I tried to extend (AddIn) by adding IID_IEVENTHANDLER interface and wrote its implementer, however when I click on the image, the event handler is never called. The event handler code:
extension of kImageItem
------------------------------
AddIn
{
kImageItem,
kInvalidClass,
{
IID_IEVENTHANDLER, kImageItemEventHandlerImpl,
}
},
Event Handletr Implementation
-----------------------------------------
- I tried using IImageObjectSuite selection suite to get the graphics item associated with it but it doesn't give me the function GetGraphicItem (UIDRef &itemUIDRef) returns Failure (ErrorCode = 1), The code is as below:
ISelectionManager* sm = Utils<ISelectionUtils>()->GetActiveSelection();
InterfacePtr<IImageObjectSuite> ios(sm, UseDefaultIID());
UIDRef gi;
ErrorCode ec = ios->GetGraphicItem(gi);
My goal is to get the link associated with the image when I click on it or select it.
Kindly help.
