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 de
.mobilcom
.debitel
.cloud
.android
.ui
.fragment
; 
  20 import android
.support
.v4
.app
.Fragment
; 
  22 import com
.actionbarsherlock
.app
.SherlockFragment
; 
  24 import de
.mobilcom
.debitel
.cloud
.android
.datamodel
.OCFile
; 
  25 import de
.mobilcom
.debitel
.cloud
.android
.files
.FileHandler
; 
  26 import de
.mobilcom
.debitel
.cloud
.android
.ui
.activity
.TransferServiceGetter
; 
  29  * Common methods for {@link Fragment}s containing {@link OCFile}s 
  31  * @author David A. Velasco 
  34 public class FileFragment 
extends SherlockFragment 
{ 
  40      * Creates an empty fragment. 
  42      * It's necessary to keep a public constructor without parameters; the system uses it when tries to reinstantiate a fragment automatically.  
  44     public FileFragment() { 
  49      * Creates an instance for a given {@OCFile}. 
  53     public FileFragment(OCFile file
) { 
  58      * Getter for the hold {@link OCFile} 
  60      * @return The {@link OCFile} hold 
  62     public OCFile 
getFile() { 
  67     protected void setFile(OCFile file
) { 
  72      * Interface to implement by any Activity that includes some instance of FileFragment 
  74      * @author David A. Velasco 
  76     public interface ContainerActivity 
extends TransferServiceGetter
, FileHandler 
{ 
  79          * Callback method invoked when the detail fragment wants to notice its container  
  80          * activity about a relevant state the file shown by the fragment. 
  82          * Added to notify to FileDisplayActivity about the need of refresh the files list.  
  84          * Currently called when: 
  85          *  - a download is started; 
  86          *  - a rename is completed; 
  87          *  - a deletion is completed; 
  88          *  - the 'inSync' flag is changed; 
  90         public void onFileStateChanged(); 
  93          * Request the parent activity to show the details of an {@link OCFile}. 
  95          * @param file      File to show details 
  97         public void showDetails(OCFile file
);