<commit_before>//
// Copyright 2011-2014 NimbusKit
// Copyright 2012 <NAME> (vertical layouts)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "NimbusCore.h"

/**
 * numberOfPages will be this value until reloadData is called.
 */
extern const NSInteger NIPagingScrollViewUnknownNumberOfPages;

/**
 * The default number of pixels on the side of each page.
 *
 * Value: 10
 */
extern const CGFloat NIPagingScrollViewDefaultPageMargin;

typedef enum {
  NIPagingScrollViewHorizontal = 0,
  NIPagingScrollViewVertical,
} NIPagingScrollViewType;

@protocol NIPagingScrollViewDataSource;
@protocol NIPagingScrollViewDelegate;
@protocol NIPagingScrollViewPage;
@class NIViewRecycler;

/**
 * The NIPagingScrollView class provides a UITableView-like interface for loading pages via a data
 * source.
 *
 * @ingroup NimbusPagingScrollView
 */
@interface NIPagingScrollView : UIView <UIScrollViewDelegate>

#pragma mark Data Source

- (void)reloadData;
@property (nonatomic, weak) id<NIPagingScrollViewDataSource> dataSource;
@property (nonatomic, weak) id<NIPagingScrollViewDelegate> delegate;

// It is highly recommended that you use this method to manage view recycling.
- (UIView<NIPagingScrollViewPage> *)dequeueReusablePageWithIdentifier:(NSString *)identifier;

#pragma mark State

- (UIView<NIPagingScrollViewPage> *)centerPageView;
@property (nonatomic) NSInteger centerPageIndex; // Use moveToPageAtIndex:animated: to animate to a given page.

@property (nonatomic, readonly) NSInteger numberOfPages;

#pragma mark Configuring Presentation

// Controls the border between images.
@property (nonatomic) CGFloat pageMargin;
// Used to make the view smaller than full screen, thus showing neighboring images
// in the view.
@property (nonatomic) CGFloat pageInset;
@property (nonatomic) NIPagingScrollViewType type; // Default: NIPagingScrollViewHorizontal

#pragma mark Visible Pages

- (BOOL)hasNext;
- (BOOL)hasPrevious;
- (void)moveToNextAnimated:(BOOL)animated;
- (void)moveToPreviousAnimated:(BOOL)animated;
- (BOOL)moveToPageAtIndex:(NSInteger)pageIndex animated:(BOOL)animated updateVisiblePagesWhileScrolling:(BOOL)updateVisiblePagesWhileScrolling;

// Short form for moveToPageAtIndex:pageIndex animated:animated updateVisiblePagesWhileScrolling:NO
- (BOOL)moveToPageAtIndex:(NSInteger)pageIndex animated:(BOOL)animated;

#pragma mark Rotating the Scroll View<commit_msg>added comment on horizontal mode only.<commit_after>//
// Copyright 2011-2014 NimbusKit
// Copyright 2012 <NAME> (vertical layouts)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#import "NimbusCore.h"

/**
 * numberOfPages will be this value until reloadData is called.
 */
extern const NSInteger NIPagingScrollViewUnknownNumberOfPages;

/**
 * The default number of pixels on the side of each page.
 *
 * Value: 10
 */
extern const CGFloat NIPagingScrollViewDefaultPageMargin;

typedef enum {
  NIPagingScrollViewHorizontal = 0,
  NIPagingScrollViewVertical,
} NIPagingScrollViewType;

@protocol NIPagingScrollViewDataSource;
@protocol NIPagingScrollViewDelegate;
@protocol NIPagingScrollViewPage;
@class NIViewRecycler;

/**
 * The NIPagingScrollView class provides a UITableView-like interface for loading pages via a data
 * source.
 *
 * @ingroup NimbusPagingScrollView
 */
@interface NIPagingScrollView : UIView <UIScrollViewDelegate>

#pragma mark Data Source

- (void)reloadData;
@property (nonatomic, weak) id<NIPagingScrollViewDataSource> dataSource;
@property (nonatomic, weak) id<NIPagingScrollViewDelegate> delegate;

// It is highly recommended that you use this method to manage view recycling.
- (UIView<NIPagingScrollViewPage> *)dequeueReusablePageWithIdentifier:(NSString *)identifier;

#pragma mark State

- (UIView<NIPagingScrollViewPage> *)centerPageView;
@property (nonatomic) NSInteger centerPageIndex; // Use moveToPageAtIndex:animated: to animate to a given page.

@property (nonatomic, readonly) NSInteger numberOfPages;

#pragma mark Configuring Presentation

// Controls the border between images.
@property (nonatomic) CGFloat pageMargin;
// Used to make the view smaller than full screen, thus showing neighboring images, horizontally
// in the view.
@property (nonatomic) CGFloat pageInset;
@property (nonatomic) NIPagingScrollViewType type; // Default: NIPagingScrollViewHorizontal

#pragma mark Visible Pages

- (BOOL)hasNext;
- (BOOL)hasPrevious;
- (void)moveToNextAnimated:(BOOL)animated;
- (void)moveToPreviousAnimated:(BOOL)animated;
- (BOOL)moveToPageAtIndex:(NSInteger)pageIndex animated:(BOOL)animated updateVisiblePagesWhileScrolling:(BOOL)updateVisiblePagesWhileScrolling;

// Short form for moveToPageAtIndex:pageIndex animated:animated updateVisiblePagesWhileScrolling:NO
- (BOOL)moveToPageAtIndex:(NSInteger)pageIndex animated:(BOOL)animated;

#pragma mark Rotating the Scroll View
{'fraction_non_alphanumeric': 0.08723368562321758, 'fraction_numerical': 0.006374769334004362, 'mean_word_length': 5.624444444444444, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3739801', 'n_tokens_mistral': 1748, 'n_tokens_neox': 1645, 'n_words': 553}