SketchUp SDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Functions
options_provider.h File Reference
#include <slapi/slapi.h>
#include <slapi/unicodestring.h>
#include <slapi/model/defs.h>

Go to the source code of this file.

Functions

SU_RESULT SUOptionsProviderGetNumKeys (SUOptionsProviderRef options_provider, size_t *count)
 Gets the number of available option keys. More...
 
SU_RESULT SUOptionsProviderGetKeys (SUOptionsProviderRef options_provider, size_t len, SUStringRef keys[], size_t *count)
 Retrieves options providers associated with the options manager. More...
 
SU_RESULT SUOptionsProviderGetValue (SUOptionsProviderRef options_provider, const char *key, SUTypedValueRef *value)
 Gets the value of the given option. More...
 
SU_RESULT SUOptionsProviderSetValue (SUOptionsProviderRef options_provider, const char *key, SUTypedValueRef value)
 Sets the value of the given option. More...
 

Function Documentation

SU_RESULT SUOptionsProviderGetKeys ( SUOptionsProviderRef  options_provider,
size_t  len,
SUStringRef  keys[],
size_t *  count 
)

Retrieves options providers associated with the options manager.

Parameters
[in]options_providerThe options provider object.
[in]lenThe number of keys to retrieve.
[out]keysThe keys retrieved.
[out]countThe number of keys retrieved.
Returns
SU_RESULT SUOptionsProviderGetNumKeys ( SUOptionsProviderRef  options_provider,
size_t *  count 
)

Gets the number of available option keys.

Parameters
[in]options_providerThe options provider object.
[out]countThe number of keys available.
Returns
SU_RESULT SUOptionsProviderGetValue ( SUOptionsProviderRef  options_provider,
const char *  key,
SUTypedValueRef value 
)

Gets the value of the given option.

Parameters
[in]options_providerThe options provider object.
[in]keyThe key that indicates which option to get.
[out]valueThe value to get the current option setting.
Returns

The breakdown of options and value types for each options provider is shown in the table below.

Options Provider Option Value Type Meaning
NamedOptions     Provides ability to save arbitrary named option values. There are no default options for this provider.
PageOptions     Options for the Scene
  ShowTransition SUTypedValueType_Bool Show scene transitions
  TransitionTime SUTypedValueType_Double Number of seconds between each scene transition
SlideshowOptions     Options for the slideshow
  LoopSlideshow SUTypedValueType_Bool Causes the slideshow to loop
  SlideTime SUTypedValueType_Double Number of seconds that each slide is shown
UnitsOptions     Options for units display in the model
  LengthPrecision SUTypedValueType_Int32 Number of decimal places of precision shown for length
  LengthFormat SUTypedValueType_Int32 Default units format for the model
  LengthUnit SUTypedValueType_Int32 Units format for the model
  LengthSnapEnabled SUTypedValueType_Bool Indicates whether length snapping is enabled
  LengthSnapLength SUTypedValueType_Double Controls the snapping length size increment
  AnglePrecision SUTypedValueType_Int32 Number of decimal places of precision shown for angles
  AngleSnapEnabled SUTypedValueType_Bool Indicates whether angle snapping is enabled
  SnapAngle SUTypedValueType_Double Controls the angle snapping size increment
  SuppressUnitsDisplay SUTypedValueType_Bool Display the units format if LengthFormat is Decimal or Fractional
  ForceInchDisplay SUTypedValueType_Bool Force displaying 0" if LengthFormat is Architectural

Some of the options map to enumerated values, as shown in the table below.

Option Value Meaning
LengthFormat 0: Decimal
  1: Architectural
  2: Engineering
  3: Fractional
LengthUnit 0: Inches
  1: Feet
  2: Millimeter
  3: Centimeter
  4: Meter

Note that LengthUnit will be overridden by LengthFormat if LengthFormat is not set to Decimal. Architectural defaults to inches, Engineering defaults to feet, and Fractional defaults to inches.

SU_RESULT SUOptionsProviderSetValue ( SUOptionsProviderRef  options_provider,
const char *  key,
SUTypedValueRef  value 
)

Sets the value of the given option.

Parameters
[in]options_providerThe options provider object.
[in]keyThe key that indicates which option to set.
[in]valueThe value to set the option to.
Returns