class JournalEntryListItemData extends IScriptable
{
	var m_entry : weak< JournalEntry >;
	var m_extraData : IScriptable;
}

class JournalEntryListItemController extends ListItemController
{

	protected event OnDataChanged( value : IScriptable )
	{
		var data : JournalEntryListItemData;
		data = ( ( JournalEntryListItemData )( value ) );
		if( data )
		{
			OnJournalEntryUpdated( data.m_entry, data.m_extraData );
		}
	}

	protected virtual function OnJournalEntryUpdated( entry : weak< JournalEntry >, extraData : IScriptable ) {}
}

class JournalEntriesListController extends ListController
{

	public function PushEntries( const data : ref< array< weak< JournalEntry > > > )
	{
		var count : Int32;
		var i : Int32;
		var scriptableObj : JournalEntryListItemData;
		var scriptableList : array< IScriptable >;
		count = data.Size();
		for( i = 0; i < count; i += 1 )
		{
			scriptableObj = new JournalEntryListItemData;
			scriptableObj.m_entry = data[ i ];
			scriptableList.PushBack( scriptableObj );
		}
		PushDataList( scriptableList, true );
	}

	public function PushEntriesEx( const data : ref< array< weak< JournalEntry > > >, const extraData : ref< array< IScriptable > > )
	{
		var count : Int32;
		var i : Int32;
		var scriptableObj : JournalEntryListItemData;
		var scriptableList : array< IScriptable >;
		count = data.Size();
		for( i = 0; i < count; i += 1 )
		{
			scriptableObj = new JournalEntryListItemData;
			scriptableObj.m_entry = data[ i ];
			scriptableObj.m_extraData = extraData[ i ];
			scriptableList.PushBack( scriptableObj );
		}
		PushDataList( scriptableList, true );
	}

}

