summaryrefslogtreecommitdiffstats
path: root/mobile/android/base/java/org/mozilla/gecko/db/TabsAccessor.java
blob: 1be004ca7ff2e3de9a945148456eef0b5e19c55c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* 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/. */

package org.mozilla.gecko.db;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;

import org.mozilla.gecko.Tab;

import java.util.List;

public interface TabsAccessor {
    public interface OnQueryTabsCompleteListener {
        public void onQueryTabsComplete(List<RemoteClient> clients);
    }

    public Cursor getRemoteClientsByRecencyCursor(Context context);
    public Cursor getRemoteTabsCursor(Context context);
    public Cursor getRemoteTabsCursor(Context context, int limit);
    public List<RemoteClient> getClientsWithoutTabsByRecencyFromCursor(final Cursor cursor);
    public List<RemoteClient> getClientsFromCursor(final Cursor cursor);
    public void getTabs(final Context context, final OnQueryTabsCompleteListener listener);
    public void getTabs(final Context context, final int limit, final OnQueryTabsCompleteListener listener);
    public void persistLocalTabs(final ContentResolver cr, final Iterable<Tab> tabs);
}