first step to detect if the file is favorite
[pub/Android/ownCloud.git] / src / com / owncloud / android / datamodel / OCFile.java
index 78bdc84..32e118b 100644 (file)
@@ -1,6 +1,8 @@
-/* ownCloud Android client application
+/**
+ *   ownCloud Android client application
+ *
  *   Copyright (C) 2012  Bartek Przybylski
- *   Copyright (C) 2012-2013 ownCloud Inc.
+ *   Copyright (C) 2015 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License version 2,
@@ -65,6 +67,8 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
     private boolean mShareByLink;
     private String mPublicLink;
 
+    private boolean mFavorite;
+
     private String mPermissions;
     private String mRemoteId;
 
@@ -110,6 +114,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         mLastSyncDateForData = source.readLong();
         mEtag = source.readString();
         mShareByLink = source.readInt() == 1;
+        mFavorite = source.readInt() == 1;
         mPublicLink = source.readString();
         mPermissions = source.readString();
         mRemoteId = source.readString();
@@ -135,6 +140,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         dest.writeLong(mLastSyncDateForData);
         dest.writeString(mEtag);
         dest.writeInt(mShareByLink ? 1 : 0);
+        dest.writeInt(mFavorite ? 1 : 0);
         dest.writeString(mPublicLink);
         dest.writeString(mPermissions);
         dest.writeString(mRemoteId);
@@ -348,6 +354,7 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         mNeedsUpdating = false;
         mEtag = null;
         mShareByLink = false;
+        mFavorite = false;
         mPublicLink = null;
         mPermissions = null;
         mRemoteId = null;
@@ -503,6 +510,14 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         this.mShareByLink = shareByLink;
     }
 
+    public boolean isFavorite() {
+        return mFavorite;
+    }
+
+    public void setFavorite(boolean mFavorite) {
+        this.mFavorite = mFavorite;
+    }
+
     public String getPublicLink() {
         return mPublicLink;
     }