![]() |
ComponentDescription |
Header: Components.h |
struct ComponentDescription { OSType componentType; OSType componentSubType; OSType componentManufacturer; UInt32 componentFlags; UInt32 componentFlagsMask; };
A four-character code that identifies the type of component. All components of a particular type must support a common set of interface functions. For example, drawing components all have a component type of 'draw'.
If you are developing an application which uses components, you can use this field to search for components of a given type by specifying the component type in this field of the component description structure you supply to the FindNextComponent function or the CountComponents function. A value of 0 operates as a wildcard.
If you are developing a component, it must support all of the standard functions for the component type specified by this field. Type codes with all lowercase characters are reserved for definition by Apple. You can define your own component type code as long as you register it with Apples Component Registry Group.
A four-character code that identifies the subtype of the component. Different subtypes of a component type may support additional features or provide interfaces that extend beyond the standard functions for a given component type. For example, the subtype of drawing components indicates the type of object the component draws. Drawing components that draw ovals have a subtype of 'oval'.
If you are developing an application which uses components, you can use the componentSubType field to perform a more specific lookup operation than is possible using only the componentType field. By specifying particular values for both fields in the component description structure that you supply to the FindNextComponent or CountComponents function, your application retrieves information about only those components that meet both of these search criteria. A value of 0 operates as a wildcard.
If you are developing a component, you may use this field to indicate more specific information about the capabilities of the component. There are no restrictions on the content you assign to this field. If no additional information is appropriate for your component type, you may set the componentSubType field to 0.
A four-character code that identifies the manufacturer of the component. This field allows for further differentiation between individual components. For example, components made by a specific manufacturer may support an extended feature set. Components provided by Apple use a manufacturer value of 'appl'.
If you are developing an application which uses components, you can use this field to find components from a certain manufacturer. Specify the appropriate manufacturer code in this field of the component description structure you supply to the FindNextComponent or CountComponents function. A value of 0 operates as a wildcard.
If you are developing a component, you obtain your manufacturer code, which can be the same as your application signature, from Apples Component Registry Group.
A 32-bit field that provides additional information about a particular component.
The high-order 8 bits are reserved for definition by the Component Manager. If you are developing an application, you should usually set these bits to 0. See
The low-order 24 bits are specific to each component type. These flags can be used to indicate the presence of features or capabilities in a given component.
If you are developing an application which uses components, you can use these flags to further narrow the search criteria applied by the FindNextComponent or CountComponents function. If you use the componentFlags field in a component search, you use the componentFlagsMask field to indicate which flags are to be considered in the search.
If you are developing a component, you can use these flags to indicate any special capabilities or features of your component. You may use all 24 bits, as appropriate to its component type. You must set all unused bits to 0.
A 32-bit field that indicates which flags in the componentFlags field are relevant to a particular component search operation.
If you are developing an application which uses components, your application should set each bit which corresponds to a flag in the componentFlags field that is to be considered as a search criterion by the FindNextComponent or CountComponents function to 1. The Component Manager considers only these flags during the search. You specify the desired flag value (either 0 or 1) in the componentFlags field.
For example, to look for a component with a specific control flag that is set to 0, set the appropriate bit in the ComponentFlags field to 0 and the same bit in the ComponentFlagsMask field to 1. To look for a component with a specific control flag that is set to 1, set the bit in the ComponentFlags field to 1 and the same bit in the ComponentFlagsMask field to 1. To ignore a flag, set the bit in the ComponentFlagsMask field to 0.
If you are developing a component, your component must set the componentFlagsMask field in its component description structure to 0.
The ComponentDescription structure identifies the characteristics of a component, including the type of services offered by the component and its manufacturer.
Applications and components use component description structures in different ways. An application that uses components specifies the selection criteria for a component in a component description structure. The functions FindNextComponent, CountComponents, and GetComponentInfo all use the component description structure to specify the criteria for their search.
A component uses the component description structure to specify its registration information and capabilities and identify itself to the Component Manager. If your component is stored in a component resource, the information in the component description structure must be part of that resource. See the description of the component ‘thng resource. If you have developed an application that registers your component, that application must supply a component description structure to the RegisterComponent function. See Registering Components for information about registering components.
The ComponentDescription data type defines the component description structure. Note that the valid values of fields in the component description structure are determined by the component type specification. For example, all image compressor components must use the componentSubType field to specify the compression algorithm used by the compressor.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)