d2c0e4696d5400f7d523714dbaf228091bede7f5
[pub/Android/ownCloud.git] / src / com / owncloud / android / ui / fragment / FileFragment.java
1 /* ownCloud Android client application
2 * Copyright (C) 2012-2013 ownCloud Inc.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 */
18
19 package com.owncloud.android.ui.fragment;
20
21 import android.support.v4.app.Fragment;
22
23 import com.owncloud.android.datamodel.OCFile;
24 import com.owncloud.android.ui.activity.TransferServiceGetter;
25
26 /**
27 * Common methods for {@link Fragment}s containing {@link OCFile}s
28 *
29 * @author David A. Velasco
30 *
31 */
32 public interface FileFragment {
33
34 /**
35 * Getter for the hold {@link OCFile}
36 *
37 * @return The {@link OCFile} hold
38 */
39 public OCFile getFile();
40
41
42 /**
43 * Interface to implement by any Activity that includes some instance of FileFragment
44 *
45 * @author David A. Velasco
46 */
47 public interface ContainerActivity extends TransferServiceGetter {
48
49 /**
50 * Callback method invoked when the detail fragment wants to notice its container
51 * activity about a relevant state the file shown by the fragment.
52 *
53 * Added to notify to FileDisplayActivity about the need of refresh the files list.
54 *
55 * Currently called when:
56 * - a download is started;
57 * - a rename is completed;
58 * - a deletion is completed;
59 * - the 'inSync' flag is changed;
60 */
61 public void onFileStateChanged();
62
63 /**
64 * Request the parent activity to show the details of an {@link OCFile}.
65 *
66 * @param file File to show details
67 */
68 public void showFragmentWithDetails(OCFile file);
69
70
71 public void notifySuccessfulDownload(OCFile file);
72
73 }
74
75 }