|
|
Sample Programs from NeXSTEP 3.3
/* QBE.h:
* You may freely copy, distribute, and reuse the code in this example.
* NeXT disclaims any warranty of any kind, expressed or implied, as to its
* fitness for any particular use.
*
* Written by Craig Federighi
*
*
* Example of a Query By Example object: Connects to an EOController for an
* easy contruction of qualifiers from data entered into fields of an
* existing user interface.
*/
#import <appkit/appkit.h>
#import <eointerface/eointerface.h>
#import <apps/InterfaceBuilder.h>
@interface QBE:Object
{
EOController *controller;
EODatabaseDataSource *realsource;
NSMutableArray *removedAssociations;
EOController *nextController;
id controllersDelegate;
NSMutableArray *wereUneditableAssoc;
NSMutableArray *wereEditableAssoc;
EOQualifier *originalQualifier;
}
- enterQueryMode:sender;
// switches controller from displaying database
// data to displaying a blank row in which query info can be entered.
// Sending this message when already in Query mode will add a new row to
// the controller to allow entry of another disjoined qualifier.
- toggleQueryFetch:sender;
// if not in query mode, enters query mode. If in query mode, does
// applyQualifier (and exits query mode)
- applyQualifier:sender;
// constructs a qualifier with ANDing within columns and ORing rows
// Sets the qualifier in the datasource and issues a fetch on the
// controller.
- applyDisjointQualifier:sender;
// like applyQualifier, but ORs within columns
- exitQueryMode:sender;
// reverts to original qualifier and fetches.
- addQuery:sender;
// add a line to the query controller and select it
@end
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.