You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.6 KiB
Kotlin
49 lines
1.6 KiB
Kotlin
3 years ago
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||
|
|
||
3 years ago
|
package org.mozilla.fenix.home.pocket
|
||
3 years ago
|
|
||
3 years ago
|
import mozilla.components.service.pocket.PocketRecommendedStory
|
||
|
|
||
3 years ago
|
/**
|
||
|
* Contract for all possible user interactions with the Pocket recommended stories feature.
|
||
|
*/
|
||
|
interface PocketStoriesInteractor {
|
||
|
/**
|
||
3 years ago
|
* Callback for then new stories are shown to the user.
|
||
3 years ago
|
*
|
||
3 years ago
|
* @param storiesShown The new list of [PocketRecommendedStory]es shown to the user.
|
||
3 years ago
|
*/
|
||
3 years ago
|
fun onStoriesShown(storiesShown: List<PocketRecommendedStory>)
|
||
3 years ago
|
|
||
|
/**
|
||
3 years ago
|
* Callback for when the user clicks a specific category.
|
||
3 years ago
|
*
|
||
3 years ago
|
* @param categoryClicked The just clicked [PocketRecommendedStoriesCategory].
|
||
3 years ago
|
*/
|
||
3 years ago
|
fun onCategoryClicked(categoryClicked: PocketRecommendedStoriesCategory)
|
||
|
|
||
|
/**
|
||
|
* Callback for when the user clicks on a specific story.
|
||
|
*
|
||
|
* @param storyClicked The just clicked [PocketRecommendedStory] URL.
|
||
|
* @param storyPosition `row x column` matrix representing the grid position of the clicked story.
|
||
|
*/
|
||
|
fun onStoryClicked(storyClicked: PocketRecommendedStory, storyPosition: Pair<Int, Int>)
|
||
|
|
||
|
/**
|
||
|
* Callback for when the user clicks the "Learn more" link.
|
||
|
*
|
||
|
* @param link URL clicked.
|
||
|
*/
|
||
|
fun onLearnMoreClicked(link: String)
|
||
3 years ago
|
|
||
|
/**
|
||
3 years ago
|
* Callback for when the user clicks the "Discover more" link.
|
||
3 years ago
|
*
|
||
|
* @param link URL clicked.
|
||
|
*/
|
||
3 years ago
|
fun onDiscoverMoreClicked(link: String)
|
||
3 years ago
|
}
|