Skip to main content
November 8, 2016
Answered

How to use a boss class?

  • November 8, 2016
  • 1 reply
  • 1274 views

Hi everyone,

Please explain me how to use a boss class?

for example: kSetPageSetupPrefsCmdBoss, kWorkspaceBoss, kDocStyleBoss..

This topic has been closed for replies.
Correct answer vinothr

How to use boss class depends on what you would like to implement.

SDK documentation is the only resource to learn plug-in development in InDesign.

Few things you should understand:

-> InDesign uses its own object model.

This object model is constructed at runtime.

As you know, C++ has an object model, but InDesign although developed in C++ but has its own object model.

InDesign uses an abstraction called boss class.

A boss is a class in the InDesign object model.

-> Objects in InDesign are boss class objects.

This means that a document, page, spread, page item are not C++ objects but boss class objects.

document -> kDocBoss

spread -> kSpreadBoss

etc.

These boss classes have hierachical structure.

Boss class is a kind of InDesign class and not a C++ class.

Plug-ins in InDesign talk to each other via the boss classes.

-> You should have a basic understanding of interface-based programming.

Read basics of Component Object Model (COM).

Programming in InDesign in similar to COM where functionality is accessed via interfaces.

-> Your plug-in will create boss classes, or add features to existing boss classes.

The fr (resource) file is where you define the boss class.

-> You should be familiar with design patterns.

InDesign heavily uses design patterns like observer, command, responder, factory, etc.

-> You have lots of sample code in the SDK which you can refer to.

-> Believe me, InDesign API is very-well documented.

API documentation in products like Photoshop, Illustrator really sucks.

Example:

Suppose I would like to add some custom data to be stored inside each document.

I would add a persistent interface-impl to the kDocBoss.

Here, you add functionality to existing boss.

This would mean that I will create a new interface and impl IDs in the pluginID.h file.

Create a file with the corresponding C++ class.

Register the interface-impl and bind them.

Of course, will add the interface-impl to kDocBoss in the fr file.

1 reply

Inspiring
November 9, 2016

Hi duraid68151886,

in the documentation of the SDK you can find "Getting Started with InDesign Development". There you can start working. After that you can study the SDK samples, the "Solution Guide" and the "Plug-In Programming Guide I and II".

You will need about half a year to be a good InDesign Plug-In developer.

Good luck!

Markus

vinothr
vinothrCorrect answer
Inspiring
November 10, 2016

How to use boss class depends on what you would like to implement.

SDK documentation is the only resource to learn plug-in development in InDesign.

Few things you should understand:

-> InDesign uses its own object model.

This object model is constructed at runtime.

As you know, C++ has an object model, but InDesign although developed in C++ but has its own object model.

InDesign uses an abstraction called boss class.

A boss is a class in the InDesign object model.

-> Objects in InDesign are boss class objects.

This means that a document, page, spread, page item are not C++ objects but boss class objects.

document -> kDocBoss

spread -> kSpreadBoss

etc.

These boss classes have hierachical structure.

Boss class is a kind of InDesign class and not a C++ class.

Plug-ins in InDesign talk to each other via the boss classes.

-> You should have a basic understanding of interface-based programming.

Read basics of Component Object Model (COM).

Programming in InDesign in similar to COM where functionality is accessed via interfaces.

-> Your plug-in will create boss classes, or add features to existing boss classes.

The fr (resource) file is where you define the boss class.

-> You should be familiar with design patterns.

InDesign heavily uses design patterns like observer, command, responder, factory, etc.

-> You have lots of sample code in the SDK which you can refer to.

-> Believe me, InDesign API is very-well documented.

API documentation in products like Photoshop, Illustrator really sucks.

Example:

Suppose I would like to add some custom data to be stored inside each document.

I would add a persistent interface-impl to the kDocBoss.

Here, you add functionality to existing boss.

This would mean that I will create a new interface and impl IDs in the pluginID.h file.

Create a file with the corresponding C++ class.

Register the interface-impl and bind them.

Of course, will add the interface-impl to kDocBoss in the fr file.

November 10, 2016

Thank you vinoth for your detailed explanation.