ui/views/detailsview/inc/glxdetailsview.h
changeset 62 36d93b4dc635
parent 52 a3a4c0de738e
--- a/ui/views/detailsview/inc/glxdetailsview.h	Mon Aug 23 18:06:16 2010 +0530
+++ b/ui/views/detailsview/inc/glxdetailsview.h	Sat Sep 04 11:36:24 2010 +0530
@@ -1,47 +1,57 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:   ?Description
-*
-*/
- 
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:   ?Description
+ *
+ */
+
 #ifndef GLXDETAILSVIEW_H
 #define GLXDETAILSVIEW_H
 
+//Includes
 #include <glxview.h>
-
+#include <QAbstractItemModel>
 
-class GlxMediaModel;
-class QAbstractItemModel;
-class HbIconItem;
-
-class GlxFavMediaModel;
-class HbDocumentLoader;
+//Orbit/Qt forward declartion
+class HbIcon;
 class HbLabel;
+class HbIconItem;
+class HbListView;
 class HbPushButton;
+
+//User Defined forward declartion
+class GlxDetailsIcon;
+class GlxFavMediaModel;
 class GlxDetailsTextEdit;
-class GlxDetailsIcon;
-
 class GlxDetailsViewDocLoader;
+class GlxDetailsViewModelWrapper;
 
-class GlxDetailsView : public GlxView  
-{
+/**
+ * Class Description
+ * This is Details view class .The functionality of details view is to show the detail of the image like
+ * Name of the image ,Date the image was created , time the image was modified , size of the image
+ * and show the description of the image.here in this view , the name of the image and description can be changed. 
+ */
+class GlxDetailsView : public GlxView
+    {
 
-    Q_OBJECT
+Q_OBJECT
 
 public:
+
     /*
      * class constructor.
+     * @param - HbMainWindow object
      */
     GlxDetailsView(HbMainWindow *window);
     /*
@@ -50,143 +60,193 @@
     ~GlxDetailsView();
 
     /*
+     * From GlxView
+     * This is called from the view manager before the view is going to Activated.
+     */
+    void initializeView(QAbstractItemModel *model, GlxView *preView);
+
+    /**
+     * From GlxView
      * This is called from the view manager when the view is going to be activated.
      */
-    void activate() ;
+    void activate();
 
     /*
-     * This is called from the view manager when the view is going to be de-activated.
-     */
-    void deActivate();
-
-    /*
-     * This is called from the view manager before the view is going to Activated.
-     */
-    void initializeView( QAbstractItemModel *model, GlxView *preView );
-
-    /*
+     * From GlxView
      * This is called from the view manager before the view is going to de-activated.
      */
     void resetView();
 
     /*
-     * Sets the model corresponding to this view.
+     * From GlxView 
+     * This is called from the view manager when the view is going to be de-activated.
      */
-    void setModel (QAbstractItemModel *model);
+    void deActivate();
+
     /*
+     * From GlxView
+     * Sets the model corresponding to this view.
+     * This is called from the view manager before the view is going to Activated.
+     * @Param - model is of type GlxMediaModel
+     */
+    void setModel(QAbstractItemModel *model);
+
+    /*
+     * //From GlxView
+     * This is called from the view manager before the view is going to Activated.
      * return the view item for animation
-     */    
+     */
     QGraphicsItem * getAnimationItem(GlxEffect transtionEffect);
 
-
-public slots:
-    void updateLayout(Qt::Orientation);
-    void rowsRemoved(const QModelIndex &parent, int start, int end);
-    void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
-    void modelDestroyed();
-    void updateFavourites();
-    void UpdateDescription();
-    void FillDetails();
-    
 private:
 
     /*
-     * Retrieves the image from the model and shows the image
+     * cleanUp()
+     * cleans up the resources used.
+     */
+    void cleanUp();
+
+    /*
+     * showImage()
+     * Retrieves the image from the model and displays the image
      */
     void showImage();
 
     /*
-     * Sets the Date to the label recieved from MDS
+     * setFavModel
+     * This Function creates the favourite model, to determine if the image is added to favourite.
      */
-    void setImageName();
-    
-    void setDesc();
+    void setFavModel();
 
     /*
-     * Sets the Date to the label received from MDS
-     */
-    void setDate();
-    
-    /*
-     * Sets the time to the label received from MDS
-     */
-    void setTime();
-    
-    /*
-     * Sets the size to the label received from MDS
-     */
-    void setSize();    
-    
-    /*
-     * create the favourite model
-     */
-    void setFavModel();
-    
-    /*
-     * Add all the model releted connection and data
+     * initializeNewModel()
+     * Add all the model related connection and data
      */
     void initializeNewModel();
+
     /*
+     * clearCurrentModel()
      * clear all the model releted connection and data
      */
     void clearCurrentModel();
-    
-    /*
-     * cleans up the resources used.
-     */
-    void cleanUp();
-    
-    QString sizeinStrings(int size);
 
     /*
+     * setConnections()
      * connects the items to slot to respective signals
      */
     void setConnections();
 
     /*
+     * clearConnections()
      * clear the connections
      */
     void clearConnections();
-    
+
+    /**
+     * getSubState()
+     * This Function retrieves the state of the details view, whether it launched from the Photos app
+     * or whether it was launched from other app like File Manager, MMS , Camera ...
+     */
     int getSubState();
+
+private slots:
+
+    /**
+     * updateLayout()
+     * This Loads the View/Section corresponding to the  Orientation.
+     * @Param - Orientation , specifies the current Orientation.
+     */
+    void updateLayout(Qt::Orientation);
+
+    /**
+     * rowsRemoved()
+     * This Slot is called when the item is removed from the model.
+     * @Param - parent is of type QModelIndex.
+     * @Param - start, this specifies the starting index of the item being removed. 
+     * @Param - end ,this specifies the ending  index of the item being removed.
+     */
+    void rowsRemoved(const QModelIndex &parent, int start, int end);
+
+    /**
+     * modelDestroyed()
+     * This Slot is called whenever the model is deleted.
+     */
+    void modelDestroyed();
+
+    /**
+     * dataChanged()
+     * This Slot is called whenever the data in an existing item changes.
+     * @Param - startIndex, this specifies the starting index of the  affected items.  
+     * @Param - endIndex ,this specifies the ending  index of the  affected items .
+     */
+    void dataChanged(QModelIndex startIndex, QModelIndex endIndex);
+
+    /**
+     * refreshDetailsview()
+     * This Slot is called  when the data shown in details view has to be refreshed.
+     */
+    void refreshDetailsview();
+
+    /**
+     * triggerTheCommand()
+     * This Slot is called when the file details has to be changed like file name and description
+     * @param - row, The Row specifies the row index of the widget in the list widget of details view.
+     */
+    void triggerTheCommand(int row);
+
+    /**
+     * updateFavourites()
+     * This Slot is called whenever the image is added to Favourites
+     */
+    void updateFavourites();
+
+    /**
+     * launchShareDialog()
+     * This Slot is called  when the image has to be sent via services like MMS, Bluetooth,Email...
+     */
+    void launchShareDialog();
+
 private:
-    
+
+    //Contains the thumbnail shown in teh details view.
+    HbLabel *mImageBackGround;
+
     //Contains the thumbnail shown in teh details view.
     HbLabel *mDetailsIcon;
+
+    //contains the view instance 
+    HbView *mView;
     
     //Contains the favourite icon which adds or removes the image to favourite folder
     GlxDetailsIcon *mFavIcon;
-   
+
     //The media Model to acess the attributes; not owned,dont delete.
-    QAbstractItemModel *mModel; 
-    
+    QAbstractItemModel *mModel;
+
     //The media Model to acess the attributes whether image is in favourite folder or not;owned by this view
-    GlxFavMediaModel *mFavModel;    
- 
+    GlxFavMediaModel *mFavModel;
+
     //The reference to the Main Window
     HbMainWindow *mWindow;
-     
+
     int mSelIndex;
-    
-   //Document Loader  
+
+    //custom Document Loader to load the details view  
     GlxDetailsViewDocLoader *mDocLoader;
-  
-    //Shows the Images
-    GlxDetailsTextEdit *mImageName;
-	
-	//Shows the descriptions
-    GlxDetailsTextEdit *mDescriptions;
-	
-	//Shows the Date 
-    HbLabel *mDateLabel;
-	
-	//Shows the size of the image
-    HbLabel *mSizeLabel;
-	
-	//Shows the time 
-    HbLabel *mTimeLabel;    
-    
+
+    //Contains the disabled favourite icon 
     HbIcon mFavIconEnabled;
+
+    //Contains the enabled favourite icon 
     HbIcon mFavIconDisabled;
-};
+
+    //Contains the List view
+    HbListView *mListView;
+
+    //Contains the List model
+    GlxDetailsViewModelWrapper *mListModel;
+
+    //holds the share button
+    HbPushButton *mShareButton;
+    };
 #endif //GLXDETAILSVIEW_H