Created
February 17, 2012 22:40
-
-
Save anujb/1855900 to your computer and use it in GitHub Desktop.
btouch uitableviewdatasource inlined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using MonoTouch.Foundation; | |
using MonoTouch.CoreFoundation; | |
using MonoTouch.UIKit; | |
using MonoTouch.ObjCRuntime; | |
using MonoTouch.CoreGraphics; | |
using MonoTouch.MapKit; | |
using MonoTouch.CoreLocation; | |
using MonoTouch.CoreAnimation; | |
namespace Kal | |
{ | |
[BaseType(typeof(NSObject))] | |
[Model] | |
interface KalDataSourceCallbacks { | |
[Export("loadedDataSource:")] | |
void LoadedDataSource(KalDataSource dataSource); | |
} | |
[BaseType (typeof (UITableViewDataSource))] | |
[Model] | |
interface KalDataSource { | |
[Export("presentingDatesFrom:to:delegate:")] | |
void PresentingDates(NSDate from, NSDate to, KalDataSourceCallbacks callback); | |
[Export("markedDatesFrom:to:")] | |
void MarkedDates(NSDate from, NSDate to); | |
[Export("loadItemsFromDate:toDate:")] | |
void LoadItems(NSDate from, NSDate to); | |
[Export("removeAllItems")] | |
void RemoveAllItems(); | |
[Export("tableView:numberOfRowsInSection:")] | |
[New] | |
int RowsInSection(UITableView tableView, int section); | |
[Export("tableView:cellForRowAtIndexPath:")] | |
[New] | |
UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath); | |
} | |
[BaseType(typeof(NSObject))] | |
interface KalDate { | |
[Static, Export("dateForDay:month:year:")] | |
KalDate GetDate(uint day, uint month, uint year); | |
[Static, Export("dateFromNSDate:")] | |
KalDate GetDate(DateTime date); | |
[Export("initForDay:month:year:")] | |
IntPtr Constructor(uint day, uint month, uint year); | |
[Export("day")] | |
uint GetDay(); | |
[Export("month")] | |
uint GetMonth(); | |
[Export("year")] | |
uint GetYear(); | |
[Export("NSDate")] | |
NSDate GetDate(); | |
[Export("compare:")] | |
NSComparisonResult Compare(KalDate otherDate); | |
[Export("isToday")] | |
bool IsToday(); | |
} | |
[BaseType(typeof(NSObject))] | |
[Model] | |
interface KalViewDelegate { | |
[Export("showPreviousMonth")] | |
void ShowPreviousMonth(); | |
[Export("showFollowingMonth")] | |
void ShowFollowingMonth(); | |
[Export("didSelectDate:")] | |
void DidSelectDate(KalDate date); | |
} | |
[BaseType(typeof(UIView))] | |
interface KalView { | |
[Export("delegate", ArgumentSemantic.Assign)] | |
NSObject WeakDelegate { get; set; } | |
[Wrap("WeakDelegate")] | |
KalViewDelegate Delegate { get; set; } | |
[Export("tableView")] | |
UITableView TableView { get; set; } | |
//[Export("shadowView")] | |
//UIImageView ShadowView { get; set; } | |
[Export("selectedDate")] | |
KalDate SelectedDate { get; } | |
//[Export("gridView")] | |
//KalGridView GridView { get; } | |
[Export("initWithFrame:delegate:logic:")] | |
IntPtr Constructor(RectangleF frame, KalViewDelegate del, KalLogic logic); | |
[Export("isSliding")] | |
bool IsSliding(); | |
[Export("selectDate:")] | |
void SelectDate(KalDate date); | |
[Export("markTilesForDates:")] | |
void MarkTiles(NSArray dates); | |
[Export("redrawEntireMonth")] | |
void RedrawMonth(); | |
[Export("slideDown")] | |
void SlideDown(); | |
[Export("slideUp")] | |
void SlideUp(); | |
[Export("jumpToSelectedMonth")] | |
void JumpToSelectedMonth(); | |
} | |
[BaseType(typeof(UIView))] | |
interface KalTileView { | |
[Export("date")] | |
KalDate Date { get; set; } | |
[Export("highlighted")] | |
bool IsHighlighted { [Bind("isHighlighted")] get; set; } | |
[Export("selected")] | |
bool IsSelected { [Bind("isSelected")] get; set; } | |
[Export("isMarked")] | |
bool IsMarked { [Bind("isMarked")] get; set; } | |
[Export("type")] | |
KalTileType TileType { get; set; } | |
[Export("resetState")] | |
void ResetState(); | |
[Export("isToday")] | |
bool IsToday(); | |
[Export("belongsToAdjacentMonth")] | |
bool BelongsToAdjacentMonth(); | |
} | |
[BaseType(typeof(UIView))] | |
interface KalMonthView { | |
[Export("numWeeks")] | |
uint NumberOfWeeks { get; set; } | |
[Export("initWithFrame:")] | |
IntPtr Constructor(RectangleF frame); | |
[Export("showDates:leadingAdjacentDates:trailingAdjacentDates")] | |
void ShowDates(NSArray main, NSArray leading, NSArray trailing); | |
[Export("firstTileOfMonth")] | |
KalTileView GetFirstTileOfMonth(); | |
[Export("tileForDate:")] | |
KalTileView GetTile(KalDate date); | |
[Export("markTilesForDates:")] | |
void MarkTiles(NSArray dates); | |
} | |
[BaseType(typeof(UIView))] | |
interface KalGridView { | |
[Static, Export("tileSize")] | |
SizeF GetTileSize(); | |
[Static, Export("setGridViewTileSize:")] | |
void SetTileSize(SizeF size); | |
} | |
[BaseType(typeof(UIViewController))] | |
interface KalViewController { | |
[Export("delegate", ArgumentSemantic.Assign)] | |
NSObject WeakDelegate { get; set; } | |
[Wrap("WeakDelegate")] | |
UITableViewDelegate Delegate { get; set; } | |
[Export("dataSource")] | |
KalDataSource DataSource { get; set; } | |
//[Export("calendarView", ArgumentSemantic.Assign)] | |
//KalView CalendarView { get; set; } | |
[Export("initWithSelectedDate:")] | |
IntPtr Constructor(NSDate selectedDate); | |
[Export("reloadData")] | |
void ReloadData(); | |
[Export("showAndSelectDate")] | |
void ShowAndSelectDate(NSDate Date); | |
[Export("selectedDate")] | |
NSDate SelectedDate(); | |
} | |
[BaseType(typeof(NSObject))] | |
interface KalLogic { | |
[Export("baseDate")] | |
NSDate BaseDate { get; set; } | |
[Export("fromDate")] | |
NSDate FromDate { get; } | |
[Export("daysInSelectedMonth")] | |
NSArray DaysInSelectedMonth { get; } | |
[Export("daysInFinalWeekOfPreviousMonth")] | |
NSArray DaysInFinalWeekOfPreviousMonth { get; } | |
[Export("daysInFirstWeekOfFollowingMonth")] | |
NSArray DaysInFirstWeekOfFollowingMonth { get; } | |
[Export("selectedMonthNameAndYear")] | |
string SelectedMonthNameAndYear { get; } | |
[Export("initForDate:")] | |
IntPtr Constructor(NSDate date); | |
[Export("retreatToPreviousMonth")] | |
void RetreatToPreviousMonth(); | |
[Export("advanceToFollowingMonth")] | |
void AdvanceToFollowingMonth(); | |
[Export("moveToMonthForDate:")] | |
void MoveToMonthForDate(NSDate date); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment