InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ISmartReflowService Class Referenceabstract

#include <ISmartReflowService.h>

Inheritance diagram for ISmartReflowService:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISMARTREFLOWSERVICE }
 

Public Member Functions

virtual bool IsSmartReflowFeatureSupported (void)=0
 
virtual bool GetAllowOversetStoryToReflow (const IFrameList *inFrameList)=0
 
virtual bool GetAllowPageDeletesForUndersetStory (const IFrameList *inFrameList)=0
 
virtual bool AddingPages (const IFrameList *inFrameList, const UIDRef &inInsertSpread, uint32 inPageInsertLocation, uint32 inNumPages)=0
 
virtual bool CanDeletePageItemForReflow (UIDRef &pageItem)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

This is an Interface plugins can implement if they'd like to be called during text overset

and underset handling.  In order to get your implementation of this interface called at 

during "Smart Text Reflow" processing, you must create a new boss.  like so:

resource ClassDescription (13) { kMySmartReflowServiceBoss, kInvalidClass, { kSmartTextReflowServiceProviderImpl is a CServiceProvider that registers the boss as a kSmartReflowServiceID. You can replace this implementation with your own, but it must return kSmartReflowServiceID from its GetServiceID() method in order to get your implementation of IID_ISMARTREFLOWSERVICE to be called.

    IID_IK2SERVICEPROVIDER, kSmartTextReflowServiceProviderImpl,

Replace kMySmartReflowServiceImpl with your own implementation of ISmartReflowService. IID_ISMARTREFLOWSERVICE, kMySmartReflowServiceImpl, } };

Member Enumeration Documentation

anonymous enum

Default interface ID for the ISmartReflowService allowing for declarations such as the following: InterfacePtr<ISmartReflowService> iSmartReflowService(provider, UseDefaultIID());

Member Function Documentation

virtual bool ISmartReflowService::AddingPages (const IFrameListinFrameList,
const UIDRefinInsertSpread,
uint32 inPageInsertLocation,
uint32 inNumPages 
)
pure virtual

InDesign is incrementally adding pages to handle the overset text. If the last frame in the inFrameList at the time the text went into overset (i.e. when GetAllowOversetStoryToReflow was called) is an overridden master text frame, then the master page that was applied to the page containing the overset text will be applied to the new pages and the corresponding master text frames will be overridden and threaded at the end of the inFrameList.

Parameters
inFrameList[IN]: The frame list that is in overset.
inInsertSpread[IN]: The spread that 'inPageInsertLocation' is relative to.
inPageInsertLocation[IN]: zero-based index within the given spread to insert new pages.
inNumPages[IN]: The number of pages that will be inserted.
Returns
. Return true to continue smart reflow. Return false to stop processing. Returning false does not remove any pages added thus far.
virtual bool ISmartReflowService::CanDeletePageItemForReflow (UIDRefpageItem)
pure virtual

Is if okay for InDesign to delete this particular page item and thus okay to delete the page that contains it if all other page deletion conditions are met?

This method is useful if you have created a custom page item that you wish to allow to be deleted under certain conditions. For example, if you have a custome page item that contains a text frame, you may want to allow your page item to be deleted if the text frame becomes empty.

Returns
true if it is OK for the page item to be deleted as part of smart reflow.
virtual bool ISmartReflowService::GetAllowOversetStoryToReflow (const IFrameListinFrameList)
pure virtual

Is it okay for InDesign to create new pages and flow the overset text onto those pages?

Parameters
inFrameList[IN]: The frame list that is in overset.
Returns
. Return true to allow the adding of pages for the given story. Return false to disallow.
virtual bool ISmartReflowService::GetAllowPageDeletesForUndersetStory (const IFrameListinFrameList)
pure virtual

Is it okay for InDesign to delete pages containing empty text frames from the given frameList?

Parameters
inFrameList[IN]: The frame list that is in underset.
Returns
. Return true to allow the deleting of pages for the given story. Return false to disallow.
virtual bool ISmartReflowService::IsSmartReflowFeatureSupported (void )
pure virtual

Is the smart reflow feature supported. This method will only be called once per session. Its purpose is to allow the enabling or disabling of the Smart Text Reflow feature. For example, InCopy ships with this feature disabled. However, you could write an ISmartReflowService in an InCopy plug-in that returns 'true' to enable this feature. Keep in mind that InCopy does not save changes to the InDesign binary document (indd). Therefore, enabling this feature for InCopy would only allow users to see what should happen in InDesign when InCopy story changes are updated in the document from within InDesign.

If your plug-in could be used for both InDesign and InCopy and you do not want the feature enabled in InCopy, then return 'false' if the result of LocaleSetting::GetLocale().IsProductFS(kInCopyProductFS) is false.

Returns
true to allow the Smart Text Reflow feature, false otherwise.