Sign in Join
FPDoc Onlineexperiment

Classes unit

Basic classes for RTL.

This documentation describes the FPC classes unit. The Classes unit contains basic classes for the Free Component Library (FCL):

Furthermore it introduces methods for object persistence, and classes that understand an owner-owned relationship, with automatic memory management.

Classes and records

ComponentPlatformsAttributeclass
EBitsErrorclassException raised when an error occurs in a method of .
EClassNotFoundclassException raised when an unknown class is referenced in a streamed component.
EComponentErrorclassException raised when an error occurs in the component registration routines.
EFCreateErrorclassException raised when an error occurred during creation of a stream.
EFilerErrorclassException raised by the component streaming system if an error occurs.
EFOpenErrorclassException raised when an error occurred during creation of a .
EInvalidImageclassException raised when the resource header needed for streaming of a component is invalid.
EInvalidOperationclassException raised when an invalid operation is performed. Obsolete.
EMethodNotFoundclassThis exception is no longer used.
EObserverclassError raised when an observer error occurs.
EObserverExceptionclass
EOutOfResourcesclassException raised when the system is out of resources.
EParserErrorclassException raised when an error occurs during the parsing of streams.
EReadErrorclassException raised if an error occurs while reading from a stream.
EResNotFoundclassException raised when a resource, needed to initialize a component, is not found.
EStreamErrorclassException raised when an error occurs during read or write operations on a stream.
EStringListErrorclassException raised when an error occurs in a method of .
EThreadclassThread error exception.
EThreadDestroyCalledclassException raised when a thread is destroyed illegally.
EThreadExternalExceptionclassException raised when an invalid operation is attempted on an external thread.
EWriteErrorclassException raised when an error occurs during writing to a stream.
IControlValueObserverinterface
IDesignerNotifyinterfaceDesigner notification interface.
IEditFormatLinkinterface
IEditGridLinkObserverinterface
IEditLinkObserverinterface
IFPObservedinterfaceInterface implemented by an object that can be observed.
IFPObserverinterfaceInterface for an object to observe other objects.
IInterfaceComponentReferenceinterfaceInterface for checking component references.
IInterfaceListinterfaceInterface for maintaining a list of interfaces.
IInterfaceListExinterface
IIteratorLinkObserverinterface
IMultiCastObserverinterface
IObserverinterface
IObserverTrackinterface
IPositionLinkObserverinterface
IPositionLinkObserver170interface
ISingleCastObserverinterface
IStreamPersistinterfacePersistence streaming interface.
IStringsAdapterinterfaceIStringsAdapter Interface declaration.
IVCLComObjectinterfaceCom automation Object interface.
ObservableMemberAttributeclass
TAbstractObjectReaderclassAbstract driver class to read stored component data.
TAbstractObjectWriterclassAbstract driver class for writing component data.
TBasicActionclassAbstract base class for all Actions.
TBasicActionLinkclassLink between actions and action clients (e.g. controls).
TBinaryObjectReaderclassDriver class descendant which reads component data stored in binary format.
TBinaryObjectWriterclassDriver class which stores component data in binary form.
TBitsclassClass to store collections of bits (binary values that can be 0 or 1).
TBytesStreamclassStream of bytes.
TCollectionclassBase class to manage collections of named objects.
TCollectionEnumeratorclassImplements IEnumerator for the TCollection class.
TCollectionItemclassBasic object that is managed by a class.
TComponentclassBase class for all components that need owner-owned functionality.
TComponentEnumeratorclassImplements IEnumerator for the TComponent class.
TCustomMemoryStreamclassAbstract stream that stores its data in memory.
TDataModuleclassContainer for non-visual components.
TFilerclassClass responsible for streaming of components.
TFileStreamclassStream that stores its data in a named file on disk.
TFPListclassClass to manage collections of pointers.
TFPListEnumeratorclassImplements IEnumerator for the TFPList class.
THandleStreamclassBase class for streams that are identified by an OS handle.
TIdentMapEntryrecordRecord used when associating names with integer values.
TInterfacedPersistentclassTPersistent descendant which implements the IInterface interface.
TInterfaceListclassStandard implementation of the IInterfaceList interface.
TInterfaceListEnumeratorclassImplements IEnumerator for the TInterfaceList class.
TLinkObserversclass
TListclassClass to manage collections of pointers.
TListEnumeratorclassImplements IEnumerator for the TList class.
TMemoryStreamclassStandard implementation of a stream that stores its data in memory.
TObserverMappingclass
TObserversclass
TOwnedCollectionclassTCollection descendant which maintains owner information.
TOwnerStreamclassStream which uses a second stream as a source.
TParserclassClass to parse the contents of a stream containing text data.
TPersistentclassBase class for streaming system and persistent properties.
TProxyAggregateStreamclass
TProxyStreamclassProxy stream for the IStream interface.
TRawByteStringStreamclassTBytesStream descendent with some single-byte string methods.
TReaderclassGeneric reader object which reads component data from any given source.
TRecallclassHelper class for storing published properties.
TResourceStreamclassStream that reads its data from a resource object.
TStreamclassBase class for streams.
TStreamAdapterclassImplements IStream for TStream descendants.
TStringItemrecordThe TStringItem is used to store the string and object items in a string list instance. It should never be used directly.
TStringListclassStandard implementation of the class.
TStringsclassClass to manage arrays or collections of strings.
TStringsEnumeratorclassImplements IEnumerator for the TStrings class.
TStringStreamclassStream that stores its data in a string.
TTextObjectWriterclassDriver class which stores component data in text format.
TThreadclassAbstract Thread class.
TThreadListclassThread-safe list object.
TWriterclassObject to write component data to an arbitrary format.

Procedures and functions

ActivateClassGroupfunctionActivates a class group.
BeginGlobalLoadingprocedureNot yet implemented.
BinToHexprocedureConvert a binary buffer to a hexadecimal string.
BoundsfunctionReturns a TRect structure with the bounding rect of the given location and size.
CheckSynchronizefunctionCheck whether there are any synchronize calls in the synchronize queue.
ClassGroupOffunctionReturns the class group to which an instance or class belongs.
CollectionsEqualfunctionReturns True if two collections are equal.
EndGlobalLoadingprocedureNot yet implemented.
ExtractStringsfunctionSplit a string in different words.
FindClassfunctionReturns the class pointer of a class with given name.
FindGlobalComponentfunctionCallback used when a component must be found.
FindIdentToIntfunctionReturn the string to integer converter for an integer type.
FindIntToIdentfunctionReturn the integer to string converter for an integer type.
FindNestedComponentfunctionFinds the component with name path starting at the indicated root component.
GetClassfunctionReturns the class pointer of a class with given name.
GetFixupInstanceNamesprocedureReturns the names of elements that need to be resolved for the root component, whose reference contains ReferenceRootName.
GetFixupReferenceNamesprocedureReturns the names of elements that need to be resolved for the root component.
GlobalFixupReferencesprocedureCalled to resolve unresolved references after forms are loaded.
GroupDescendentsWithprocedureProvided for Delphi compatibility.
HexToBinfunctionConvert a hexadecimal string to a binary buffer.
IdentToIntfunctionLooks up an integer value in a integer-to-identifier map list.
IfThenfunction
InitComponentResfunctionProvided for Delphi compatibility only.
InitInheritedComponentfunctionInitializes a component descending from RootAncestor.
IntToIdentfunctionLooks up an identifier for an integer value in a identifier-to-integer map list.
InvalidPointfunctionCheck whether a point is invalid.
IsUniqueGlobalComponentNamefunction
LineStartfunctionFinds the start of a line in Buffer before BufPos.
NotifyGlobalLoadingprocedureNot yet implemented.
ObjectBinaryToTextprocedureConverts an object stream from a binary to a text format.
ObjectResourceToTextprocedureConverts an object stream from a (windows) resource to a text format.
ObjectTextToBinaryprocedureConverts an object stream from a text to a binary format.
ObjectTextToResourceprocedureConverts an object stream from a text to a (windows) resource format.
PointfunctionReturns a TPoint record with the given coordinates.
PointsEqualfunctionCheck whether two TPoint variables are equal.
ReadComponentDeltaResfunction
ReadComponentResfunctionRead component properties from a resource in the current module.
ReadComponentResExfunctionRead component properties from a resource in the specified module.
ReadComponentResFilefunctionRead component properties from a specified resource file.
RectfunctionReturns a TRect record with the given coordinates.
RedirectFixupReferencesprocedureRedirects references under the root object from OldRootName to NewRootName.
RegisterClassprocedureRegisters a class with the streaming system.
RegisterClassAliasprocedureRegisters a class alias with the streaming system.
RegisterClassesprocedureRegisters multiple classes with the streaming system.
RegisterComponentsprocedureRegisters components for the component palette.
RegisterFindGlobalComponentProcprocedureRegister a component searching handler.
RegisterInitComponentHandlerprocedureRegister a component initialization handler.
RegisterIntegerConstsprocedureRegisters some integer-to-identifier mappings.
RegisterNoIconprocedureRegisters components that have no icon on the component palette.
RegisterNonActiveXprocedureRegister non-activex component.
RemoveFixupReferencesprocedureRemoves references to rootname from the fixup list.
RemoveFixupsprocedureRemoves Instance from the fixup list.
SmallPointfunctionReturns a TSmallPoint record with the given coordinates.
StartClassGroupprocedureStart new class group.
TestStreamFormatfunction
UnRegisterClassprocedureUnregisters a class from the streaming system.
UnRegisterClassesprocedureUnregisters multiple classes from the streaming system.
UnregisterFindGlobalComponentProcprocedureRemove a previously registered component searching handler.
UnRegisterModuleClassesprocedureUnregisters classes registered by module.
WriteComponentResFileprocedureWrite component properties to a specified resource file.

Types

EListErrortypeException raised when an error occurs in lists handling.
HMODULEtypeSpecial type for handling modules.
HRSRCtypeType to manage resources.
PBitsBasetype
PPointerListtypePointer to an array of pointers.
PStringItemtypePointer to a record.
PStringItemListtypePointer to a .
TActionEventprocedure type
TActiveXRegTypeenumerationUsed when registering ActveX component types.
TAlignmentenumerationType to specify text alignment in controls that display text.
TAncestorNotFoundEventprocedure typeThis event occurs when an ancestor component cannot be found.
TBasicActionClasstypeclass reference.
TBasicActionLinkClasstypeclass reference.
TBiDiModeenumerationBIDI description.
TBitsBasetype
TBitsBaseSignedtype
TBitsOpCallbackprocedure type
TBitsOpTruthtype
TCollectionItemClasstypeClass reference for .
TCollectionNotificationenumerationCollection change notification enumeration.
TCollectionSortCompareprocedure typeCallback to sort collection items.
TCollectionSortCompare_Contextprocedure type
TComponentClasstypeClass of TComponent.
TComponentNametypeSpecial type for component names.
TComponentStatesetIndicates the state of the component during the streaming process.
TComponentStylesetDescribes the style of the component.
TCreateComponentEventprocedure typeEvent handler type, occurs when a component instance must be created when a component is read from a stream.
TDataModuleClasstypeClass pointer for TDataModule.
TDuplicatestypeType to describe what to do with duplicate values in a .
TExceptionClasstypeClass of Exception.
TFilerFlagenumerationFlags used by the class.
TFilerFlagssetSet of .
TFindAncestorEventprocedure typeEvent that occurs w.
TFindComponentClassEventprocedure typeEvent handler type, occurs when a component class pointer must be found when reading a component from a stream.
TFindComponentClassExEventprocedure type
TFindGlobalComponentprocedure typeCallback type to search for a component.
TFindMethodEventprocedure typeOccurs when the streaming process needs to locate a method.
TFPObservedOperationenumerationOperation which is reported to an observer.
TGetChildProcprocedure typeCallback used when obtaining child components.
TGetDeltaStreamsEventprocedure type
TGetStreamProcprocedure type
TGetStrProcprocedure typeEvent for retrieving string values.
THandletypeType to manage streams.
THelpContexttypeRange type to specify help contexts.
THelpEventprocedure typeSpecial event for display of online help.
THelpTypeenumerationEnumeration type specifying the kind of help requested.
THintEventprocedure type
TIdentToIntprocedure typeCallback for converting identifiers to integers.
TIInterfaceArraytype
TInitComponentHandlerprocedure typeCallback type for RegisterInitComponentHandler.
TIntToIdentprocedure typeCallback for converting integers to identifiers.
TIsUniqueGlobalComponentNameprocedure type
TLeftRighttypeSubrange type based on TAlignment.
TListAssignOpenumerationList assign operation.
TListCallbacktypeMethod callback type for TFPList.ForEachCall.
TListNotificationenumerationKind of list notification event.
TListSortCompareprocedure typeCallback type for the list sort algorithm.
TListStaticCallbacktypeStatic method callback type for TFPList.ForEachCall.
TMissingNameValueSeparatorActionenumerationWhat to to with Name=value pairs if the separator is missing.
TMissingNameValueSeparatorActionssetSet of TMissingNameValueSeparatorAction.
TNotifyCallBackprocedure typeThread termination callback handler.
TNotifyEventprocedure typeStandard event handler type.
TObjectTextEncodingenumerationEncoding of the object text file.
TObserverGetCurrentEventprocedure type
TObserverToggleEventprocedure type
TOperationenumerationOperation of which a component is notified.
TPersistentClasstypeClass reference type for .
TPlatformIdstype
TPointtypeSpecial type to handle a fake position.
TPointerListtypeType for an Array of pointers.
TPropertyNotFoundEventprocedure typeCallback for the event.
TReadComponentsProcprocedure typeCallback type when reading a component from a stream.
TReaderErrorprocedure typeEvent handler type, called when an error occurs during the streaming.
TReaderProcprocedure typeReader procedure used by DefineProperties.
TReadWriteStringPropertyEventprocedure typeCallback for the event handler.
TRecttypeDescribes a rectangle.
TReferenceNameEventprocedure typeOccurs when a named object needs to be looked up.
TSeekOriginenumerationSpecifies the origin of the method.
TSetMethodPropertyEventprocedure typeCallback for the event.
TSetNameEventprocedure typeOccurs when the reader needs to set a component's name.
TShiftStatesetIndicates what special keys were pressed in combination with a normal key.
TShiftStateEnumenumerationKeyboard/Mouse shift state enumerator.
TShortCuttypeEnumeration type to identify shortcut key combinations.
TSmallPointtypeType to describe point in a small plane.
TStreamOriginalFormatenumeration
TStreamOwnershipenumerationDetermines the ownership of a TStreamAdapter.
TStreamProcprocedure typeProcedure type used in streaming.
TStringItemListtypeArray of records.
TStringListSortCompareprocedure typeCallback type used in stringlist compares.
TStringsClasstypeClass of TStrings.
TStringsFilterMethodprocedure typeCallback signature for TStrings.Filter.
TStringsForEachMethodprocedure typeCallback signature for TStrings.Foreach.
TStringsForEachMethodExprocedure typeCallback signature for TStrings.Foreach.
TStringsForEachMethodExObjprocedure typeCallback signature for TStrings.Foreach.
TStringsMapMethodprocedure typeReduce algorithm for TStrings.Map.
TStringsOptionenumerationEnumeration of options used in TStrings.
TStringsOptionssetSet of TStringsOption.
TStringsReduceMethodprocedure typeReduce algorithm for TStrings.Reduce.
TStringsSortStyleenumerationDetermines how the strings are sorted.
TStringsSortStylessetSet of TStringsSortStyle.
TSynchronizeProcVarprocedure typeSynchronize callback type.
TThreadExecuteCallBackprocedure typeSignature of procedure to execute in a thread, without status reporting.
TThreadExecuteHandlertypeSignature of method to execute in a thread, without status reporting.
TThreadExecuteStatusCallBackprocedure typeSignature of procedure to execute in a thread, with status reporting.
TThreadExecuteStatusHandlerprocedure typeSignature of method to execute in a thread, with status reporting.
TThreadMethodprocedure typeProcedure variable used when synchronizing threads.
TThreadPriorityenumerationEnumeration specifying the priority at which a thread runs.
TThreadReportStatusprocedure typeThread status report callback prototype.
TThreadStatusNotifyCallBackprocedure typeSignature of thread status report callback.
TThreadStatusNotifyEventprocedure typeSignature of thread status report event handler.
TTopBottomtypeRange of alignments.
TValueTypeenumerationEnumerated type used to identify the kind of streamed property.
TVerticalAlignmentenumerationVertical alignment type.
TWriteMethodPropertyEventprocedure typeCallback for the event.
TWriterProcprocedure typeWriter procedure used by DefineProperties.

Constants

dupAcceptconstantDuplicate values can be added to the list.
dupErrorconstantIf an attempt is made to add a duplicate value to the list, an exception is raised.
dupIgnoreconstantDuplicate values will not be added to the list, but no error will be triggered.
FilerSignatureconstantConstant that is found at the start of a binary stream containing a streamed component.
FilerSignature1constant
fmCreateconstantcreates a new file if needed.
fmOpenReadconstantopens a file with read-only access.
fmOpenReadWriteconstantopens a file with read-write access.
fmOpenWriteconstantopens a file with write-only access.
MaxBitFlagsconstantMaximum number of bits in TBits collection.
MaxListSizeconstantMaximum number of elements in list.
NilHandleconstant
pfidAndroidconstant
pfidiOSconstant
pfidLinuxconstant
pfidOSXconstant
pfidWindowsconstant
pidAllPlatformsconstant
pidAndroidArm32constant
pidAndroidArm64constant
pidiOSDevice32constant
pidiOSDevice64constant
pidiOSSimulator32constant
pidiOSSimulator64constant
pidiOSSimulatorArm64constant
pidLinux32constant
pidLinux64constant
pidLinuxArm32constant
pidLinuxArm64constant
pidOSX32constant
pidOSX64constant
pidOSXArm64constant
pidWin32constant
pidWin64constant
pidWinARM32constant
pidWinArm64constant
pidWinIoT32constant
pidWinNX32constant
scAltconstantIndicates ALT key in a keyboard shortcut.
scCommandconstant
scCtrlconstantindicates CTRL key in a keyboard shortcut.
scNoneconstantIndicates no special key is pressed in a keyboard shortcut.
scShiftconstantIndicates Shift key in a keyboard shortcut.
SGUIDObservedconstantObserved interface GUID as a string.
SGUIDObserverconstantObserver interface GUID as a string.
soFromBeginningconstantSeek starts relative to the stream origin.
soFromCurrentconstantSeek starts relative to the current position in the stream.
soFromEndconstantSeek starts relative to the stream end.
ssCommandconstant
toEOFconstantValue returned by when the end of the input stream was reached.
toFloatconstantValue returned by when a floating point value was found in the input stream.
toIntegerconstantValue returned by when an integer was found in the input stream.
toStringconstantValue returned by when a string was found in the input stream.
toSymbolconstantValue returned by when a symbol was found in the input stream.
toWStringconstantValue returned by when a widestring was found in the input stream.

Variables

AddDataModulevariableHandler called when a new TDataModule instance is created.
ApplicationHandleExceptionvariableHandler for exceptions when a TDataModule streaming error occurs.
ApplicationShowExceptionvariableUnused.
CreateVCLComObjectProcvariableCalled to create an instance of IVCLComObject.
DelphiCompatibleStreamsvariable
GlobalNameSpacevariableGlobal namespace.
IsUniqueGlobalComponentNameProcvariable
MainThreadIDvariableID of main thread. Unused at this point.
RegisterComponentsProcvariableCallback procedure used when handling component registration.
RegisterNoIconProcvariableCallback procedure used when handling icon-less component registration.
RemoveDataModulevariableHandler called when a TDataModule instance is freed.
WakeMainThreadvariableHandler which is called if a thread wants to synchronize with the main application thread.

Uses

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.