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

#include <IComboBoxCalculatedValue.h>

Inheritance diagram for IComboBoxCalculatedValue:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICOMBOBOXCALCULATEDVALUE }
 

Public Member Functions

virtual void UserChoseItem (const PMString &string)=0
 
virtual bool16 IsMixedState () const =0
 
virtual PMReal GetCalculatedValue () const =0
 
virtual PMString GetCalculatedString () const =0
 
virtual bool16 IsLegalCalculatedString (const PMString &stringToCheck) const =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 interface exists to deal with combobox entries which support calculated values(i.e. 'Auto'). The methods allow us to figure out what we should display in the editbox. Typically it is either the name of the calculation system, such as 'Auto', or a value generated by the calculation system, like 14.4, which we will display as '(14.4)' so the user knows it is calculated. However, the calculated string could be anything, and there could be multiple calculation systems in a single combobox. The core UI code for comboboxes will call into this interface to gain information about calculated values. Implementors of new calculation systems would need to implement this interface and add it to their combobox boss.

Member Function Documentation

virtual PMString IComboBoxCalculatedValue::GetCalculatedString () const
pure virtual

Get the name of the calculation system(often 'Auto')

Returns
the string for the calculation system
virtual PMReal IComboBoxCalculatedValue::GetCalculatedValue () const
pure virtual

Get the current calculated value to display in the editbox(i.e. 14.4). Value is in points if this is some sort of measurement combobox.

Returns
the calculated value
virtual bool16 IComboBoxCalculatedValue::IsLegalCalculatedString (const PMStringstringToCheck) const
pure virtual

Is the string passed in a legal calculated string? This is often a string the user has typed in.

Parameters
stringToCheckthe string to be verified
Returns
kTrue if the string describes a legal calculation system
virtual bool16 IComboBoxCalculatedValue::IsMixedState () const
pure virtual

This method should return whether or not this is a mixed state(if it is a mixed state, we put the calculated string returned by GetCalculatedString() in the editbox. Otherwise we ask for a value from GetCalculatedValue()). An example would be if text of 2 different point sizes was selected, but all the text used 'Auto' leading. IsMixedState() would return kTrue in this case.

Returns
kTrue if the combobox is in a mixed calculated state
virtual void IComboBoxCalculatedValue::UserChoseItem (const PMStringstring)
pure virtual

Called to notify this interface that the user has chosen something, either by typing it in the editbox, or choosing an item from the drop down. Most implementations ignore this, but if your impl supports multiple calculation systems, this can be useful for keeping track of which is selected.

Parameters
stringThe string for the new text in the editbox. This might come from an entry in the dropdown.