Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.




Protocols





DBContainers


Adopted By: DBRecordList


Mandatory Methods

addObject:anObject Adds anObject to aBinder's container
forBinder:(DBBinder *)aBinder
(unsigned int)count The number of objects in the container
empty Removes (but doesn't free) objects in the container
freeObjects Frees space formerly allocated to objects in the container
objectAt:(unsigned)index Returns the index'th object in aBinder's container
forBinder:(DBBinder *)aBinder
(unsigned int)prepareForBinder:(DBBinder *)aBinder
Readies the container to move data; returns count


Optional Methods

binder:(DBBinder *)aBinder Notification when anObject successfully stored in aBinder
didAcceptObject:anObject
binder:(DBBinder *)aBinder Notification when anObject could not be stored in aBinder
didRejectObject:anObject




DBCursorPositioning


Adopted By: DBBinder
DBRecordList


Setting the Position

setFirst Sets cursor to container's first record; returns the record
setLast Sets cursor to container's last record; returns the record
setNext Sets cursor to container's next record; returns the record
setPrevious Sets cursor to container's previous record; returns the record
setTo:(long)index Sets cursor to index; returns the index'th record


Querying the Position

(long)currentPosition Returns the current index (of objects in the container)




DBCustomAssociation
(informal protocol)


Category Of: Object


Access to the Associated Value

association:association Sets value into the associated data source
setValue:(DBValue *)value
association:association Puts the value of the associated data source into value
getValue:(DBValue *)value;


Notifications to the Associated Display

associationContentsDidChange:association Notification that the data source has changed
associationSelectionDidChange:association Notification of a change in selection in the display
associationCurrentRecordDidDelete:association
Notification that current record has been deleted from the data source




DBEntities


Adopted By: none
Incorporates: DBTypes


Querying the Object

(const char *)name Returns the name of the entity
(DBDatabase *)database The DBDatabase object that created the entity
getProperties:(List *)aList Puts the entity's properties into aList
propertyNamed:(const char *)aName Returns the DBProperty named aName


Comparing the Object

(BOOL)matchesEntity:(id <DBEntities>)anEntity YES if receiver is equivalent to anEntity




DBExpressionValues


Adopted By: DBExpression
DBQualifier
DBValue


Methods

(const char *)expressionValue Returns the receiver's query-language expression
(BOOL)isDeferredExpression YES if evaluation of this expression can be deferred




DBFormatConversion
(informal protocol)


Category Of: Object


writeBuffer:(void*)buffer If implemented, invoked automatically when custom object
ofLength:(unsigned)length is written to the database
withFormat:(const char*)aFormatString




DBFormatInitialization
(informal protocol)


Category Of: Object


initFromBuffer:(void*)buffer If implemented, invoked automatically when custom object
ofLength:(unsigned)length is written to the database
withFormat:(const char*)aFormatString




DBFormatterValidation
(informal protocol)


Category Of: Object


Notification Using the Changed Cell's Identifiers

formatterDidChangeValueFor:rowIdentifier Notification when a formatter has changed a value
:columnIdentifer in one of the fields of a display; returns self
sender:sender
(BOOL)formatterWillChangeValueFor:rowIdentifier
:columnIdentifer Notification when a formatter will change a value
sender:sender
(BOOL)formatterWillChangeValueFor:rowIdentifier
:columnIdentifer Notification when a formatter will change a value,
to:aValue with the proposed new value
sender:sender


Notification Using the Changed Cell's Position

formatterDidChangeValueFor:identifier Notification when a formatter has changed a value
at:(unsigned int)position in one of the fields of a display; returns self
sender:sender
(BOOL)formatterWillChangeValueFor:identifier
at:(unsigned int)position Notification when a formatter will change a value
sender:sender
(BOOL)formatterWillChangeValueFor:identifier
at:(unsigned int)position Notification when a formatter will change a value,
to:aValue with the proposed new value
sender:sender




DBFormatterViewEditing


Category Of: Object


Accepting changes

(BOOL)formatterEndedEditing:sender Invoked by editor when user ends editing;
endChar:(unsigned short)whyEnd returns YES unless editing in progress




DBProperties


Adopted By: DBExpression


Identifying a Property

(const char*)name Name of the property
(BOOL)setName:(const char *)aName Set the name of a custom property; YES if successful
(id <DBEntities>)entity The entity to which the property belongs
(BOOL)matchesProperty:(id <DBProperties>)aProperty
YES if receiver identifies same thing as aProperty


Querying a Property

(id <DBTypes>) propertyType The type, as an object that responds to DBTypes protocol
(BOOL)isSingular YES if receive is an attribute or a one-to-one relationship
(BOOL)isReadOnly YES if the property's data is read only
(BOOL)isKey YES if the property is a key property in the entity
(BOOL)matchesProperty:(id <DBProperties>)aProperty
YES if receiver has same name in same entity as aProperty




DBTableDataSources
(informal protocol)


Category Of: Object


Reporting Table Size

(unsigned int)rowCount Number of rows in the data source table
(unsigned int)columnCount Number of columns in the data source table


Getting/Setting Data

getValueFor:rowIdentifier Puts source value identified by properties rowIdentifier and
:columnIdentifier columnIdentifier into aValue
into:aValue
getValueFor:identifier Puts value for property identifier at record aPosition
at:(unsigned int) aPosition into aValue
into:aValue
setValueFor:rowIdentifier Sets source value identified by properties rowIdentifier and
:columnIdentifier columnIdentifier to aValue
from:aValue
setValueFor:identifier Sets value for property identifier at record aPosition
at:(unsigned int) aPosition to aValue
from:aValue




DBTableValues
(informal protocol)


Category Of: Object


Getting a Value from the Table

objectValue The item's value as an object
(int)intValue The item's value as an int
(double)doubleValue The item's value as an double
(float)floatValue The item's value as an float
(const char *)stringValue The item's value as an string


Setting a Value in the Table

setObjectValue:(int)anObj Sets the item's value to anObj
setIntValue:(int)anInt Sets the item's value to anInt
setDoubleValue:(double)aDouble Sets the item's value to aDouble
setFloatValue:(float)aFloat Sets the item's value to aFloat
setStringValue:(const char *) aString Sets the item's value to aStringt




DBTableVectors


Category Of: Object


Controlling/Reporting Formatter

formatter The formatter responsible for formatting the vector
setFormatter:newFormatter Makes newFormatter the vector's formatter


Controlling/Reporting Data Link

identifier The identifier for the property that the vector displays
setIdentifier:aDataAttribute Makes aDataAttribute the vector's identifier


Controlling/Reporting Editing

(BOOL)isEditable YES if the vector's display is editable
setEditable:(BOOL)flag Permit/prohibit editing of the vector's display


Controlling/reporting Size

(BOOL)isResizable YES if the vector's display can be resized
setResizable:(BOOL)flag Permit/prohibit resizing the vector's display
(BOOL)isAutosizable YES if automatically resized when the view is resized
setAutosizable:(BOOL)flag Permit/prohibit automatic resizing
(NXCoord)size Width and height of an item in the vector's display
(NXCoord)sizeTo:(NXCoord)newSize Sets width and height of an item in the vector's display
(NXCoord)minSize The minimum limit on resizing
setMinSize:(NXCoord) newMinSize Sets minimum limit on resizing
(NXCoord)maxSize The maximum limit on resizing
setMaxSize:(NXCoord) newMaxSize Sets maximum limit on resizing


Controlling/Reporting Title

(const char *)title The title (if row or column headings are shown)
setTitle:(const char *) title Makes title the vector's title
titleFont The font for displaying the title
setTitleFont:fontObj Makes fontObj the font for displaying the title
(int)titleAlignment A constant: NX_LEFT/CENTERED/RIGHTALIGNED
setTitleAlignment:(int)align Sets the title alignment to align


Controlling/Reporting Content Alignment

(int)contentAlignment A constant: NX_LEFT/CENTERED/RIGHTALIGNED
setContentAlignment:(int) align Sets the content alignment to align




DBTransactions


Adopted By: DBBasicAdaptor : Object


Basic Transaction Commands

(BOOL)beginTransaction Begins a transaction; YES if successful
(BOOL)commitTransaction Commits a transaction; YES if successful
(BOOL)rollbackTransaction Rolls back a transaction; YES if successful




DBTypes


Adopted By: none


Querying for Type

(const char *)objcType "id" /"char *" /"int" /"float" /"double" as appropriate
(const char *)databaseType What the adaptor returns for the data's type, for example
"@" (for id) /"*" (for char *) /"i" /"f" /"d"
(const char *)objcClassName Name of the stored data's class (if any)


Comparing Types

(BOOL)isEntity YES if the object conforms to DBEntities protocol
(BOOL)matchesType:(id <DBTypes>)anObject YES if anObject has the same data type as the receiver