Skip to content
This repository has been archived by the owner on May 8, 2020. It is now read-only.

Commit

Permalink
Move protocol declaration to top to fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danielctull committed Mar 7, 2011
1 parent cdcebdf commit 6d128a5
Showing 1 changed file with 41 additions and 40 deletions.
81 changes: 41 additions & 40 deletions DTGridView.h
Expand Up @@ -61,9 +61,48 @@ struct DTOutset {
CGFloat right; CGFloat right;
}; };


@protocol DTGridViewDelegate; @class DTGridView;
@protocol DTGridViewDataSource;


@protocol DTGridViewDelegate <UIScrollViewDelegate>

@optional
/*!
Called when the grid view loads.
*/
- (void)gridViewDidLoad:(DTGridView *)gridView;
- (void)gridView:(DTGridView *)gridView selectionMadeAtRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
- (void)gridView:(DTGridView *)gridView scrolledToEdge:(DTGridViewEdge)edge;
- (void)pagedGridView:(DTGridView *)gridView didScrollToRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
- (void)gridView:(DTGridView *)gridView didProgrammaticallyScrollToRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
@end

#pragma mark -

@protocol DTGridViewDataSource
/*!
Asks the data source to return the number of rows in the grid view.
The grid view object requesting this information.
@return The number of rows in the grid view.
*/
- (NSInteger)numberOfRowsInGridView:(DTGridView *)gridView;
/*!
@abstract Asks the data source to return the number of columns for the given row in the grid view.
@para The grid view object requesting this information.
@para The index of the given row.
@return The number of colums in the row of the grid view.
*/
- (NSInteger)numberOfColumnsInGridView:(DTGridView *)gridView forRowWithIndex:(NSInteger)index;
- (CGFloat)gridView:(DTGridView *)gridView heightForRow:(NSInteger)rowIndex;
- (CGFloat)gridView:(DTGridView *)gridView widthForCellAtRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
- (DTGridViewCell *)gridView:(DTGridView *)gridView viewForRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;

@optional
- (NSInteger)spacingBetweenRowsInGridView:(DTGridView *)gridView;
- (NSInteger)spacingBetweenColumnsInGridView:(DTGridView *)gridView;

@end

#pragma mark -


/*! /*!
@class DTGridView @class DTGridView
Expand Down Expand Up @@ -184,41 +223,3 @@ struct DTOutset {
- (void)reloadData; - (void)reloadData;


@end @end
#pragma mark -
@protocol DTGridViewDelegate <UIScrollViewDelegate>

@optional
/*!
Called when the grid view loads.
*/
- (void)gridViewDidLoad:(DTGridView *)gridView;
- (void)gridView:(DTGridView *)gridView selectionMadeAtRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
- (void)gridView:(DTGridView *)gridView scrolledToEdge:(DTGridViewEdge)edge;
- (void)pagedGridView:(DTGridView *)gridView didScrollToRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
- (void)gridView:(DTGridView *)gridView didProgrammaticallyScrollToRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
@end

#pragma mark -
@protocol DTGridViewDataSource
/*!
Asks the data source to return the number of rows in the grid view.
The grid view object requesting this information.
@return The number of rows in the grid view.
*/
- (NSInteger)numberOfRowsInGridView:(DTGridView *)gridView;
/*!
@abstract Asks the data source to return the number of columns for the given row in the grid view.
@para The grid view object requesting this information.
@para The index of the given row.
@return The number of colums in the row of the grid view.
*/
- (NSInteger)numberOfColumnsInGridView:(DTGridView *)gridView forRowWithIndex:(NSInteger)index;
- (CGFloat)gridView:(DTGridView *)gridView heightForRow:(NSInteger)rowIndex;
- (CGFloat)gridView:(DTGridView *)gridView widthForCellAtRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;
- (DTGridViewCell *)gridView:(DTGridView *)gridView viewForRow:(NSInteger)rowIndex column:(NSInteger)columnIndex;

@optional
- (NSInteger)spacingBetweenRowsInGridView:(DTGridView *)gridView;
- (NSInteger)spacingBetweenColumnsInGridView:(DTGridView *)gridView;

@end

0 comments on commit 6d128a5

Please sign in to comment.