ReaderThumbsView.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. //
  2. // ReaderThumbsView.h
  3. // Reader v2.8.6
  4. //
  5. // Created by Julius Oklamcak on 2011-09-01.
  6. // Copyright © 2011-2015 Julius Oklamcak. All rights reserved.
  7. //
  8. // Permission is hereby granted, free of charge, to any person obtaining a copy
  9. // of this software and associated documentation files (the "Software"), to deal
  10. // in the Software without restriction, including without limitation the rights to
  11. // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
  12. // of the Software, and to permit persons to whom the Software is furnished to
  13. // do so, subject to the following conditions:
  14. //
  15. // The above copyright notice and this permission notice shall be included in all
  16. // copies or substantial portions of the Software.
  17. //
  18. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  19. // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  22. // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  23. // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. //
  25. #import <UIKit/UIKit.h>
  26. #import "ReaderThumbView.h"
  27. @class ReaderThumbsView;
  28. @protocol ReaderThumbsViewDelegate <NSObject, UIScrollViewDelegate>
  29. @required // Delegate protocols
  30. - (NSUInteger)numberOfThumbsInThumbsView:(ReaderThumbsView *)thumbsView;
  31. - (id)thumbsView:(ReaderThumbsView *)thumbsView thumbCellWithFrame:(CGRect)frame;
  32. - (void)thumbsView:(ReaderThumbsView *)thumbsView updateThumbCell:(id)thumbCell forIndex:(NSInteger)index;
  33. - (void)thumbsView:(ReaderThumbsView *)thumbsView didSelectThumbWithIndex:(NSInteger)index;
  34. @optional // Delegate protocols
  35. - (void)thumbsView:(ReaderThumbsView *)thumbsView refreshThumbCell:(id)thumbCell forIndex:(NSInteger)index;
  36. - (void)thumbsView:(ReaderThumbsView *)thumbsView didPressThumbWithIndex:(NSInteger)index;
  37. @end
  38. @interface ReaderThumbsView : UIScrollView
  39. @property (nonatomic, weak, readwrite) id <ReaderThumbsViewDelegate> delegate;
  40. - (void)setThumbSize:(CGSize)thumbSize;
  41. - (void)reloadThumbsCenterOnIndex:(NSInteger)index;
  42. - (void)reloadThumbsContentOffset:(CGPoint)newContentOffset;
  43. - (void)refreshThumbWithIndex:(NSInteger)index;
  44. - (void)refreshVisibleThumbs;
  45. - (CGPoint)insetContentOffset;
  46. @end