1 /* ownCloud Android client application
2 * Copyright (C) 2012-2013 ownCloud Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2,
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 package com
.owncloud
.android
.ui
.fragment
;
20 import android
.support
.v4
.app
.Fragment
;
22 import com
.actionbarsherlock
.app
.SherlockFragment
;
23 import com
.owncloud
.android
.datamodel
.OCFile
;
24 import com
.owncloud
.android
.ui
.activity
.TransferServiceGetter
;
28 * Common methods for {@link Fragment}s containing {@link OCFile}s
30 * @author David A. Velasco
33 public class FileFragment
extends SherlockFragment
{
39 * Creates an empty fragment.
41 * It's necessary to keep a public constructor without parameters; the system uses it when tries to reinstantiate a fragment automatically.
43 public FileFragment() {
48 * Creates an instance for a given {@OCFile}.
52 public FileFragment(OCFile file
) {
57 * Getter for the hold {@link OCFile}
59 * @return The {@link OCFile} hold
61 public OCFile
getFile() {
66 protected void setFile(OCFile file
) {
71 * Interface to implement by any Activity that includes some instance of FileFragment
73 * @author David A. Velasco
75 public interface ContainerActivity
extends TransferServiceGetter
{
78 * Callback method invoked when the detail fragment wants to notice its container
79 * activity about a relevant state the file shown by the fragment.
81 * Added to notify to FileDisplayActivity about the need of refresh the files list.
83 * Currently called when:
84 * - a download is started;
85 * - a rename is completed;
86 * - a deletion is completed;
87 * - the 'inSync' flag is changed;
89 public void onFileStateChanged();
92 * Request the parent activity to show the details of an {@link OCFile}.
94 * @param file File to show details
96 public void showDetails(OCFile file
);