HFUIKit / Classes / HFMultiIndexedTableView / HFMultiIndexedTableView.h

//
//  HFMultiIndexedTableView.h
//  GroceryList
//
//  Created by Keith Alperin on 9/24/09.
//  Copyright 2009 Helium Foot Software. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HFMultiIndexView.h"

@protocol HFMultiIndexedTableViewDatasource;

@interface HFMultiIndexedTableView : UITableView <HFMultiIndexDatasource, HFMultiIndexDelegate>{
	HFMultiIndexView *__multiIndexView;
	id<HFMultiIndexedTableViewDatasource> __multiIndexDataSource;
}
@property(nonatomic,retain)HFMultiIndexView *multiIndexView;
@property(nonatomic,assign)IBOutlet id<HFMultiIndexedTableViewDatasource> multiIndexDataSource;

-(void)hideIndex;

@end


// This category provides convenience methods to make it easier to use an NSIndexPath to represent entries in a multi index
@interface NSIndexPath (HFMultiIndex)

+ (NSIndexPath *)indexPathForPrimaryIndex:(NSUInteger)primaryIndex secondaryIndex:(NSUInteger)secondaryIndex;

@property(nonatomic,readonly) NSUInteger primaryIndex;
@property(nonatomic,readonly) NSUInteger secondaryIndex;

@end

//provides data to a multi index view
//keith wonders if we need to send the tableView along with these messages since it would be crazy to have more than one multiindex in a given view
@protocol HFMultiIndexedTableViewDatasource <NSObject>
/*
 *returns a list of primary index entries
 */
- (NSArray *)primarySectionIndexTitlesForTableView:(HFMultiIndexedTableView *)tableView;
/*
 *returns a list of secondary index entries for the given primaryIndexTitle
 */
- (NSArray *)secondarySectionIndexTitlesForTableView:(HFMultiIndexedTableView *)tableView primaryIndexTitle:(NSString *)primaryIndexTitle;

/*
 *returns the index path for the table row for a given primary and secondary indeces
 */
- (NSIndexPath *)tableIndexPathForIndexIndexPath:(NSIndexPath *)indexIndexPath;

@end

//Keith says:  this may not be needed since the action of selecting an item in the index is only used to scroll to a point in the table
//we could fire this (and will and didselect) message(s) if we want this to be more extensible.
//@protocol HFMultiIndexedTableViewDelgate<UITableViewDelegate>
//- (void)tableView:(HFMultiIndexedTableView *)tableView didSelectIndexAtIndexPath:(NSIndexPath *)indexIndexPath
//
//@end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.