mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/inc/mpxdbcategory.h
branchRCL_3
changeset 27 2cbbefa9af78
parent 26 3de6c4cf6b67
equal deleted inserted replaced
26:3de6c4cf6b67 27:2cbbefa9af78
    51     public:
    51     public:
    52 
    52 
    53         /**
    53         /**
    54         * Add a category item. If the record already exists, its counter will
    54         * Add a category item. If the record already exists, its counter will
    55         * be incremented.
    55         * be incremented.
    56         * @param aName: This is the name to be entered into the row
    56         * @param aCategory category type
       
    57         * @param aMedia: This is the media object to be entered into the row
    57         * @param aDriveId: The Drive Id the name (category) belongs
    58         * @param aDriveId: The Drive Id the name (category) belongs
    58         * @param aNewRecord: indicates to the caller if a new record is created.
    59         * @param aNewRecord: indicates to the caller if a new record is created.
    59         *        ETrue if a new row is created in the table; otherwise EFalse.
    60         *        ETrue if a new row is created in the table; otherwise EFalse.
    60         * @param aCaseSensitive indicates whether case sensitivity should be taken
    61         * @param aCaseSensitive indicates whether case sensitivity should be taken
    61         *        into consideration when generating the unique row id
    62         *        into consideration when generating the unique row id
    62         * @return The unique id of the row added.
    63         * @return The unique id of the row added.
    63         */
    64         */
    64 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
    65         virtual TUint32 AddItemL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia, TInt aDriveId, TBool& aNewRecord,
    65         virtual TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord,
       
    66             TBool aCaseSensitive = ETrue);
    66             TBool aCaseSensitive = ETrue);
    67 #else 
    67 		
    68         TUint32 AddItemL(const TDesC& aName, TInt aDriveId, TBool& aNewRecord,
       
    69             TBool aCaseSensitive = ETrue);
       
    70 #endif // ABSTRACTAUDIOALBUM_INCLUDED
       
    71 
       
    72         /**
    68         /**
    73         * Get the name field for a given ID.
    69         * Get the name field for a given ID.
    74         * @param aId identifies the category item
    70         * @param aId identifies the category item
    75         * @return name that matches aId. Ownership is abandoned.
    71         * @return name that matches aId. Ownership is abandoned.
    76         */
    72         */
    88         * @param aAttrs, attributes for the matching record(s)
    84         * @param aAttrs, attributes for the matching record(s)
    89         * @param aMediaArray returns the matching record(s)
    85         * @param aMediaArray returns the matching record(s)
    90         */
    86         */
    91         void FindAllL(const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs,
    87         void FindAllL(const CMPXMedia& aCriteria, const TArray<TMPXAttribute>& aAttrs,
    92             CMPXMediaArray& aMediaArray);
    88             CMPXMediaArray& aMediaArray);
    93 
    89         
    94         /**
    90         /**
    95         * Decrement the number of songs for the item. If the count gets to 0, remove
    91         * Decrement the number of songs for the item. If the count gets to 0, remove
    96         * the item.
    92         * the item.
    97         * @param aId: The ID of the category to delete.
    93         * @param aId: The ID of the category to delete.
    98         * @param aDriveId: The drive Id the name (category) belongs to. Songs on different
    94         * @param aDriveId: The drive Id the name (category) belongs to. Songs on different
   107         */
   103         */
   108 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   104 #ifdef ABSTRACTAUDIOALBUM_INCLUDED
   109         virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
   105         virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
   110             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse);
   106             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist, TBool aMtpInUse = EFalse);
   111 #else
   107 #else
   112         void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
   108         virtual void DecrementSongsForCategoryL(TUint32 aId, TInt aDriveId,
   113             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
   109             CMPXMessageArray* aItemChangedMessages, TBool& aItemExist);
   114 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   110 #endif // ABSTRACTAUDIOALBUM_INCLUDED
   115         /**
   111         /**
   116         * Deletes a category.
   112         * Deletes a category.
   117         * @param aId identifies the category
   113         * @param aId identifies the category
   181         * @param aId: The ID of the category to update
   177         * @param aId: The ID of the category to update
   182         * @param aMedia: The media data
   178         * @param aMedia: The media data
   183         * @param aDriveId: The Drive Id the name (category) belongs
   179         * @param aDriveId: The Drive Id the name (category) belongs
   184         * @param aItemChangedMessages: if valid on return contains a updated message if the
   180         * @param aItemChangedMessages: if valid on return contains a updated message if the
   185         * category was updated
   181         * category was updated
   186         */
   182         */       
   187         void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
   183         virtual void UpdateItemL(TUint32 aId, const CMPXMedia& aMedia, TInt aDriveId, CMPXMessageArray* aItemChangedMessages);
   188 
   184 
   189     protected:
   185     protected:
   190 
   186 
   191         /**
   187         /**
   192         * Updates the media with information from the table
   188         * Updates the media with information from the table
   220         * @param aMediaArray returns the media instances
   216         * @param aMediaArray returns the media instances
   221         */
   217         */
   222         void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs,
   218         void ProcessRecordsetL(const TArray<TMPXAttribute>& aAttrs,
   223             RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray);
   219             RSqlStatement& aRecordset, CMPXMediaArray& aMediaArray);
   224 
   220 
       
   221     private:
       
   222         /**
       
   223         * Retrieve name from media object based on category
       
   224         * @param aCategory the category to retrieve name
       
   225         * @param aMedia media object
       
   226         * @return name
       
   227         */
       
   228         TPtrC ItemNameL(TMPXGeneralCategory aCategory, const CMPXMedia& aMedia);
       
   229         
   225     private:    // from MMPXTable
   230     private:    // from MMPXTable
   226 
   231 
   227         /**
   232         /**
   228         * @see MMPXTable
   233         * @see MMPXTable
   229         */
   234         */