Highlighted

How to identify constructor parameters

Community Beginner ,
Jun 16, 2020

Copy link to clipboard

Copied

Hi all,

I am developing InDesign plugin via C++ SDK. So I want to know the idea of constructor parameters of objects.

 

Sample 01:

If someone wants to create IActiveContext, Then I saw they used ISubject.

InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());

 So I want to know why they use ISubject for construct IActiveContext here?

 

Sample 02:

InterfacePtr<IStrokeAttributeSuite> strokeAttributeSuite(selectionManager, UseDefaultIID());

How to identify IStrokeAttributeSuite needs to be passed ISelectionManager for construct IStrokeAttributeSuite.

These two are only samples. but I have to implement alot of object types. So Is there any hierarchy of objects? or any document to refer about this?

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Read about boss classes, boss classes can be thought of as a collection of classes. So whenever you want to get an instance of an interface, you just need to get hold of some interface that lies in the same boss class as this wanted interface and then you can create an instance of your required interface using the syntax you used. Without getting into too much details lets discuss your example broadly

InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());

Now in this you need IActiveContext, so check which boss class aggregates this interface. Then see what other interfaces are present in this boss class, you can use any one of these interface instead of iSubj, provided you have an instance of that interface. Now mostly the code is written in classes that makes these patterns almost same, for ex if you are writing a controller implementation then you are inside a kDoc boss and have access to its interface so you can navigate the whole kdoc boss hierarchy using that

Read the programming guide shipped with the sdk present in the docs folder. That is only documentation present

 

-Manan.

TOPICS
SDK

Views

77

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How to identify constructor parameters

Community Beginner ,
Jun 16, 2020

Copy link to clipboard

Copied

Hi all,

I am developing InDesign plugin via C++ SDK. So I want to know the idea of constructor parameters of objects.

 

Sample 01:

If someone wants to create IActiveContext, Then I saw they used ISubject.

InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());

 So I want to know why they use ISubject for construct IActiveContext here?

 

Sample 02:

InterfacePtr<IStrokeAttributeSuite> strokeAttributeSuite(selectionManager, UseDefaultIID());

How to identify IStrokeAttributeSuite needs to be passed ISelectionManager for construct IStrokeAttributeSuite.

These two are only samples. but I have to implement alot of object types. So Is there any hierarchy of objects? or any document to refer about this?

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Read about boss classes, boss classes can be thought of as a collection of classes. So whenever you want to get an instance of an interface, you just need to get hold of some interface that lies in the same boss class as this wanted interface and then you can create an instance of your required interface using the syntax you used. Without getting into too much details lets discuss your example broadly

InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());

Now in this you need IActiveContext, so check which boss class aggregates this interface. Then see what other interfaces are present in this boss class, you can use any one of these interface instead of iSubj, provided you have an instance of that interface. Now mostly the code is written in classes that makes these patterns almost same, for ex if you are writing a controller implementation then you are inside a kDoc boss and have access to its interface so you can navigate the whole kdoc boss hierarchy using that

Read the programming guide shipped with the sdk present in the docs folder. That is only documentation present

 

-Manan.

TOPICS
SDK

Views

78

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 16, 2020 0
Adobe Community Professional ,
Jun 16, 2020

Copy link to clipboard

Copied

Read about boss classes, boss classes can be thought of as a collection of classes. So whenever you want to get an instance of an interface, you just need to get hold of some interface that lies in the same boss class as this wanted interface and then you can create an instance of your required interface using the syntax you used. Without getting into too much details lets discuss your example broadly

InterfacePtr<IActiveContext> context(iSubj, UseDefaultIID());

Now in this you need IActiveContext, so check which boss class aggregates this interface. Then see what other interfaces are present in this boss class, you can use any one of these interface instead of iSubj, provided you have an instance of that interface. Now mostly the code is written in classes that makes these patterns almost same, for ex if you are writing a controller implementation then you are inside a kDoc boss and have access to its interface so you can navigate the whole kdoc boss hierarchy using that

Read the programming guide shipped with the sdk present in the docs folder. That is only documentation present

 

-Manan.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 16, 2020 1
Community Beginner ,
Jun 16, 2020

Copy link to clipboard

Copied

Thanks Manan. Now sorted that.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 16, 2020 0