<commit_before>/*
 Copyright 2016 OpenMarket Ltd

 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 "MXEvent.h"
#import "MXJSONModels.h"
#import "MXRoomMember.h"
#import "MXEventListener.h"
#import "MXRoomState.h"
#import "MXHTTPOperation.h"

/**
 Prefix used to build fake invite event.
 */
FOUNDATION_EXPORT NSString *const kMXRoomInviteStateEventIdPrefix;

/**
 Block called when an event of the registered types has been handled in the timeline.
 This is a specialisation of the `MXOnEvent` block.

 @param event the new event.
 @param direction the origin of the event.
 @param roomState the room state right before the event.
 */
typedef void (^MXOnRoomEvent)(MXEvent *event, MXEventDirection direction, MXRoomState *roomState);

@class MXRoom;


/**
 A `MXEventTimeline` instance represents a contiguous sequence of events in a room.
 
 There are two kinds of timeline:

    - live timelines: they receive live events from the events stream. You can paginate
      backwards but not forwards. 
      All (live or backwards) events they receive are stored in the store of the current
      MXSession.

    - past timelines: they start in the past from an `initialEventId`. They are filled
      with events on calls of [MXEventTimeline paginate] in backwards or forwards direction.
      Events are stored in a in-memory store (MXMemoryStore). So, they are not permanent.
 */
@interface MXEventTimeline : NSObject

/**
 The initial event id used to initialise the timeline.
 Nil in case of live timeline.
 */
@property (nonatomic, readonly) NSString *initialEventId;

/**
 Indicate if this timeline is a live one.
 */
@property (nonatomic, readonly) BOOL isLiveTimeline;

/**
 The state of the room at the top most recent event of the timeline.
 */
@property (nonatomic, readonly) MXRoomState *state;

<commit_msg>Event timeline: MXEventTimeline: small comment update<commit_after>/*
 Copyright 2016 OpenMarket Ltd

 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 "MXEvent.h"
#import "MXJSONModels.h"
#import "MXRoomMember.h"
#import "MXEventListener.h"
#import "MXRoomState.h"
#import "MXHTTPOperation.h"

/**
 Prefix used to build fake invite event.
 */
FOUNDATION_EXPORT NSString *const kMXRoomInviteStateEventIdPrefix;

/**
 Block called when an event of the registered types has been handled in the timeline.
 This is a specialisation of the `MXOnEvent` block.

 @param event the new event.
 @param direction the origin of the event.
 @param roomState the room state right before the event.
 */
typedef void (^MXOnRoomEvent)(MXEvent *event, MXEventDirection direction, MXRoomState *roomState);

@class MXRoom;


/**
 A `MXEventTimeline` instance represents a contiguous sequence of events in a room.
 
 There are two kinds of timeline:

    - live timelines: they receive live events from the events stream. You can paginate
      backwards but not forwards. 
      All (live or backwards) events they receive are stored in the store of the current
      MXSession.

    - past timelines: they start in the past from an `initialEventId`. They are filled
      with events on calls of [MXEventTimeline paginate] in backwards or forwards direction.
      Events are stored in a in-memory store (MXMemoryStore) (@TODO: To be confirmed once they will be implemented). So, they are not permanent.
 */
@interface MXEventTimeline : NSObject

/**
 The initial event id used to initialise the timeline.
 Nil in case of live timeline.
 */
@property (nonatomic, readonly) NSString *initialEventId;

/**
 Indicate if this timeline is a live one.
 */
@property (nonatomic, readonly) BOOL isLiveTimeline;

/**
 The state of the room at the top most recent event of the timeline.
 */
@property (nonatomic, readonly) MXRoomState *state;


{'fraction_non_alphanumeric': 0.06932553769054083, 'fraction_numerical': 0.003340989768218835, 'mean_word_length': 4.079533404029693, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4646621', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1248, 'n_words': 626}