1 /* 
  2  * Created on Nov 26, 2004 
  3  * 
  4  */ 
  5 package ubc.midp.mobilephoto.core.ui.datamodel; 
  6  
  7 /** 
  8  * @author trevor 
  9  * 
 10  * This class holds meta data associated with a photo or image. There is a one-to-one 
 11  * relationship between images and image metadata. (ie. Every photo in MobilePhoto will 
 12  * have a corresonding ImageData object).  
 13  * It stores the recordId of the image record in RMS, the recordID of the metadata record 
 14  * the name of the photo album(s) it belongs to, the text label, associated phone numbers 
 15  * etc. 
 16  *  
 17  */ 
 18 public class ImageData { 
 19    
 20   private int recordId; //imageData recordId  
 21   private int foreignRecordId; //image recordId 
 22   private String parentAlbumName; //Should we allow single image to be part of multiple albums? 
 23   private String imageLabel; 
 24    
 25   // #ifdef includeCountViews 
 26   private int numberOfViews = 0; 
 27   // #endif 
 28    
 29   // #ifdef includeFavourites 
 30   private boolean favorite = false; 
 31   // #endif 
 32  
 33   /** 
 34    * @param foreignRecordId 
 35    * @param parentAlbumName 
 36    * @param imageLabel 
 37    */ 
 38   public ImageData(int foreignRecordId, String parentAlbumName,String imageLabel) { 
 39     super(); 
 40     this.foreignRecordId = foreignRecordId; 
 41     this.parentAlbumName = parentAlbumName; 
 42     this.imageLabel = imageLabel; 
 43      
 44   } 
 45    
 46   /** 
 47    * @return Returns the recordId. 
 48    */ 
 49   public int getRecordId() { 
 50     return recordId; 
 51   } 
 52    
 53   /** 
 54    * @param recordId The recordId to set. 
 55    */ 
 56   public void setRecordId(int recordId) { 
 57     this.recordId = recordId; 
 58   } 
 59    
 60   /** 
 61    * @return Returns the foreignRecordId. 
 62    */ 
 63   public int getForeignRecordId() { 
 64     return foreignRecordId; 
 65   } 
 66    
 67   /** 
 68    * @param foreignRecordId The foreignRecordId to set. 
 69    */ 
 70   public void setForeignRecordId(int foreignRecordId) { 
 71     this.foreignRecordId = foreignRecordId; 
 72   } 
 73    
 74   /** 
 75    * @return Returns the imageLabel. 
 76    */ 
 77   public String getImageLabel() { 
 78     return imageLabel; 
 79   } 
 80    
 81   /** 
 82    * @param imageLabel The imageLabel to set. 
 83    */ 
 84   public void setImageLabel(String imageLabel) { 
 85     this.imageLabel = imageLabel; 
 86   } 
 87    
 88   /** 
 89    * @return Returns the parentAlbumName. 
 90    */ 
 91   public String getParentAlbumName() { 
 92     return parentAlbumName; 
 93   } 
 94    
 95   /** 
 96    * @param parentAlbumName The parentAlbumName to set. 
 97    */ 
 98   public void setParentAlbumName(String parentAlbumName) { 
 99     this.parentAlbumName = parentAlbumName; 
100   } 
101  
102   // #ifdef includeFavourites 
103   public void toggleFavorite() { 
104     this.favorite = ! favorite; 
105   } 
106    
107   /** 
108    * @param favorite 
109    */ 
110   public void setFavorite(boolean favorite) { 
111     this.favorite = favorite; 
112   } 
113  
114   /** 
115    * @return the favorite 
116    */ 
117   public boolean isFavorite() { 
118     return favorite; 
119   } 
120   // #endif   
121  
122   // #ifdef includeCountViews 
123   public void increaseNumberOfViews() { 
124      
125   } 
126  
127   /** 
128    * @return the numberOfViews 
129    */ 
130   public int getNumberOfViews() { 
131     return numberOfViews; 
132   } 
133    
134   /** 
135    * @param views 
136    */ 
137   public void setNumberOfViews(int views) { 
138     this.numberOfViews = views; 
139   } 
140   // #endif   
141 }    
    |