1package com.android.ex.photo;
2
3import android.database.Cursor;
4import android.support.v4.app.Fragment;
5
6import com.android.ex.photo.fragments.PhotoViewFragment;
7
8public interface PhotoViewCallbacks {
9    /**
10     * Listener to be invoked for screen events.
11     */
12    public static interface OnScreenListener {
13
14        /**
15         * The full screen state has changed.
16         */
17        public void onFullScreenChanged(boolean fullScreen);
18
19        /**
20         * A new view has been activated and the previous view de-activated.
21         */
22        public void onViewActivated();
23
24        /**
25         * Called when a right-to-left touch move intercept is about to occur.
26         *
27         * @param origX the raw x coordinate of the initial touch
28         * @param origY the raw y coordinate of the initial touch
29         * @return {@code true} if the touch should be intercepted.
30         */
31        public boolean onInterceptMoveLeft(float origX, float origY);
32
33        /**
34         * Called when a left-to-right touch move intercept is about to occur.
35         *
36         * @param origX the raw x coordinate of the initial touch
37         * @param origY the raw y coordinate of the initial touch
38         * @return {@code true} if the touch should be intercepted.
39         */
40        public boolean onInterceptMoveRight(float origX, float origY);
41    }
42
43    public static interface CursorChangedListener {
44        /**
45         * Called when the cursor that contains the photo list data
46         * is updated. Note that there is no guarantee that the cursor
47         * will be at the proper position.
48         * @param cursor the cursor containing the photo list data
49         */
50        public void onCursorChanged(Cursor cursor);
51    }
52
53    public void addScreenListener(OnScreenListener listener);
54
55    public void removeScreenListener(OnScreenListener listener);
56
57    public void addCursorListener(CursorChangedListener listener);
58
59    public void removeCursorListener(CursorChangedListener listener);
60
61    public void setViewActivated();
62
63    public void toggleFullScreen();
64
65    public boolean isFragmentActive(Fragment fragment);
66
67    public void onFragmentVisible(PhotoViewFragment fragment);
68
69    public boolean isFragmentFullScreen(Fragment fragment);
70}
71