videocollection/videocollectionwrapper/inc/videocollectionwrapper.h
changeset 36 8aed59de29f9
parent 34 bbb98528c666
child 40 13331705e488
--- a/videocollection/videocollectionwrapper/inc/videocollectionwrapper.h	Thu Apr 01 23:32:44 2010 +0300
+++ b/videocollection/videocollectionwrapper/inc/videocollectionwrapper.h	Fri Apr 16 18:13:14 2010 +0300
@@ -22,6 +22,7 @@
 // INCLUDES
 #include <QObject>
 #include <qabstractitemmodel.h>
+#include "videocollectioncommon.h"
 #include "videocollectionexport.h"
 
 // FORWARD DECLARATIONS
@@ -32,12 +33,11 @@
 /**
  * Class is used as an interface of the video collection QT wrapper.
  * 
- * Singleton instance is deleted when it's not used anymore by clients. At instantion time  
- * reference count is incremented. Client must call decreaseReferenceCount when it doesn't 
- * need the instance anymore. When reference count is 0 the instance is destroyed.
+ * Singleton instance is deleted when application ends
  * 
  * * Usage:
  *  @code
+ *  #include "videocollectioncommon.h"
  *  #include "videocollectionwrapper.h"
  *  #include "videosortfilterproxymodel.h"
  *  
@@ -45,25 +45,18 @@
  *  ////
  *  // Getting the instances
  *  ////
- *  VideoCollectionWrapper *wrapper = VideoCollectionWrapper::instance();
- * 
- *  VideoSortFilterProxyModel *model = wrapper->getModel();
+ *  VideoCollectionWrapper &wrapper = VideoCollectionWrapper::instance();
+ *  // getting all videos model
+ *  VideoSortFilterProxyModel *model = wrapper.getModel(VideoCollectionCommon::EModelTypeAllVideos);
  *  ...
  *  ////
  *  // Opening collection and start fetching video item data
  *  ////
  *  if(model)
  *  {
- *      mModel->open(VideoListWidget::ELevelVideos);
+ *      mModel.open(VideoCollectionCommon::ELevelVideos);
  *  }
  *  // see model documentation for the open funtionality
- *
- *  /////
- *  // Instance is not used anymore. 
- *  // Wrapper owns the model, so client should not deallocate it
- *  /////
- *  wrapper->decreaseReferenceCount();
- *  wrapper = 0; // Don't use before new instantion.
  * 
  *  @endcode
  * 
@@ -77,14 +70,6 @@
     
 public: // Constructor
     
-    enum TModelType
-    {
-        EAllVideos,
-        ECollections,
-        ECollectionContent,
-        EGeneric
-    };
-    
     /**
      * Returns singleton instance for this class.
      * 
@@ -101,7 +86,7 @@
      * 
      * @return address to model or NULL if fails.
      */    
-    VideoSortFilterProxyModel* getModel(int type);
+    VideoSortFilterProxyModel* getModel(VideoCollectionCommon::TModelType type);
 
     /**
      * Method can be used by client to emit status signal