mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +00:00
Add NSGridView methods declarations
This commit is contained in:
parent
d0f4552511
commit
7b91f16675
1 changed files with 132 additions and 0 deletions
|
@ -26,15 +26,147 @@
|
|||
#define _NSGridView_h_GNUSTEP_GUI_INCLUDE
|
||||
|
||||
#import <AppKit/NSView.h>
|
||||
#import <AppKit/NSLayoutAnchor.h>
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_12, GS_API_LATEST)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
NSGridCellPlacementInherited = 0,
|
||||
NSGridCellPlacementNone,
|
||||
NSGridCellPlacementLeading,
|
||||
NSGridCellPlacementTop = NSGridCellPlacementLeading,
|
||||
NSGridCellPlacementTrailing,
|
||||
NSGridCellPlacementBottom = NSGridCellPlacementTrailing,
|
||||
NSGridCellPlacementCenter,
|
||||
NSGridCellPlacementFill
|
||||
};
|
||||
typedef NSInteger NSGridCellPlacement;
|
||||
|
||||
enum {
|
||||
NSGridRowAlignmentInherited = 0,
|
||||
NSGridRowAlignmentNone,
|
||||
NSGridRowAlignmentFirstBaseline,
|
||||
NSGridRowAlignmentLastBaseline
|
||||
};
|
||||
typedef NSInteger NSGridRowAlignment;
|
||||
|
||||
APPKIT_EXPORT const CGFloat NSGridViewSizeForContent;
|
||||
|
||||
@class NSGridColumn, NSGridRow, NSGridCell;
|
||||
|
||||
@interface NSGridView : NSView
|
||||
|
||||
- (instancetype) initWithFrame: (NSRect)frameRect;
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder;
|
||||
|
||||
+ (instancetype) gridViewWithNumberOfColumns: (NSInteger)columnCount rows: (NSInteger)rowCount;
|
||||
+ (instancetype) gridViewWithViews: (NSArray *)rows; // an array containing an array of NSViews
|
||||
|
||||
- (NSInteger) numberOfRows;
|
||||
- (NSInteger) numberOfColumns;
|
||||
|
||||
- (NSGridRow *) rowAtIndex: (NSInteger)index;
|
||||
- (NSInteger) indexOfRow: (NSGridRow *)row;
|
||||
- (NSGridColumn *) columnAtIndex: (NSInteger)index;
|
||||
- (NSInteger) indexOfColumn: (NSGridColumn *)column;
|
||||
- (NSGridCell *) cellAtColumnIndex: (NSInteger)columnIndex rowIndex: (NSInteger)rowIndex;
|
||||
- (NSGridCell *) cellForView: (NSView*)view;
|
||||
|
||||
- (NSGridRow *) addRowWithViews: (NSArray *)views;
|
||||
- (NSGridRow *) insertRowAtIndex: (NSInteger)index withViews: (NSArray *)views;
|
||||
- (void) moveRowAtIndex: (NSInteger)fromIndex toIndex: (NSInteger)toIndex;
|
||||
- (void) removeRowAtIndex: (NSInteger)index;
|
||||
|
||||
- (NSGridColumn *) addColumnWithViews: (NSArray*)views;
|
||||
- (NSGridColumn *) insertColumnAtIndex: (NSInteger)index withViews: (NSArray *)views;
|
||||
- (void) moveColumnAtIndex: (NSInteger)fromIndex toIndex: (NSInteger)toIndex;
|
||||
- (void) removeColumnAtIndex: (NSInteger)index;
|
||||
|
||||
- (NSGridCellPlacement) xPlacement;
|
||||
- (void) setXPlacement: (NSGridCellPlacement)x;
|
||||
- (NSGridCellPlacement) yPlacement;
|
||||
- (void) setYPlacement: (NSGridCellPlacement)y;
|
||||
- (NSGridRowAlignment) rowAlignment;
|
||||
- (void) setRowAlignment: (NSGridRowAlignment)a;
|
||||
|
||||
- (CGFloat) rowSpacing;
|
||||
- (void) setRowSpacing: (CGFloat)f;
|
||||
- (CGFloat) columnSpacing;
|
||||
- (void) setColumnSpacing: (CGFloat)f;
|
||||
|
||||
- (void) mergeCellsInHorizontalRange: (NSRange)hRange verticalRange: (NSRange)vRange;
|
||||
|
||||
@end
|
||||
|
||||
/// Cell
|
||||
@interface NSGridCell : NSObject <NSCoding>
|
||||
|
||||
- (NSView *) contentView;
|
||||
- (void) setContentView: (NSView *)v;
|
||||
|
||||
+ (NSView *) emptyContentView;
|
||||
|
||||
// Weak references to row/column
|
||||
- (NSGridRow *) row;
|
||||
- (NSGridColumn *) column;
|
||||
|
||||
// Placement
|
||||
- (NSGridCellPlacement) xPlacement;
|
||||
- (void) setXPlacement: (NSGridCellPlacement)x;
|
||||
- (NSGridCellPlacement) yPlacement;
|
||||
- (void) setYPlacement: (NSGridCellPlacement)y;
|
||||
- (NSGridRowAlignment) rowAlignment;
|
||||
- (void) setRowAlignment: (NSGridRowAlignment)a;
|
||||
|
||||
// Constraints
|
||||
- (NSArray *) customPlacementConstraints;
|
||||
|
||||
@end
|
||||
|
||||
/// Column
|
||||
@interface NSGridColumn : NSObject <NSCoding>
|
||||
|
||||
- (NSGridView *) gridView;
|
||||
- (NSInteger) numberOfCells;
|
||||
- (NSGridCell *) cellAtIndex:(NSInteger)index;
|
||||
|
||||
- (NSGridCellPlacement) xPlacement;
|
||||
- (void) setXPlacement: (NSGridCellPlacement)x;
|
||||
- (CGFloat) width;
|
||||
- (void) setWidth: (CGFloat)f;
|
||||
- (CGFloat) leadingPadding;
|
||||
- (void) setLeadingPadding: (CGFloat)f;
|
||||
- (CGFloat) trailingPadding;
|
||||
- (void) setTrailingPadding: (CGFloat)f;
|
||||
|
||||
- (BOOL) isHidden;
|
||||
- (void) mergeCellsInRange: (NSRange)range;
|
||||
|
||||
@end
|
||||
|
||||
/// Row
|
||||
@interface NSGridRow : NSObject <NSCoding>
|
||||
|
||||
- (NSGridView *) gridView;
|
||||
- (NSInteger) numberOfCells;
|
||||
- (NSGridCell *)cellAtIndex:(NSInteger)index;
|
||||
|
||||
- (NSGridCellPlacement) yPlacement;
|
||||
- (void) setYPlacement: (NSGridCellPlacement)y;
|
||||
- (CGFloat) height;
|
||||
- (void) setHeight: (CGFloat)f;
|
||||
- (CGFloat) topPadding;
|
||||
- (void) setTopPadding: (CGFloat)f;
|
||||
- (CGFloat) bottomPadding;
|
||||
- (void) setBottomPadding: (CGFloat)f;
|
||||
|
||||
- (BOOL) isHidden;
|
||||
- (void) mergeCellsInRange: (NSRange)range;
|
||||
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
|
Loading…
Reference in a new issue