mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/inc/mpxdbutil.h
changeset 0 ff3acec5bc43
equal deleted inserted replaced
-1:000000000000 0:ff3acec5bc43
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  The class MPXDbUtil which contains utilities functions
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MPXDBUTIL_H
       
    20 #define MPXDBUTIL_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <mpxpodcastdefs.h> // Podcast specific
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CMPXMedia;
       
    27 class CMPXMediaArray;
       
    28 class RSqlStatement;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 * This static class contains utilities functions used by Podcast Collection
       
    34 *
       
    35 * @lib mpxpodcastdbplugin.lib
       
    36 */
       
    37 class MPXDbUtil
       
    38     {
       
    39     public:
       
    40         /**
       
    41         * Create a media object with title, podcast type, podcast category
       
    42         * and ID then append it to the media array
       
    43         * @param aArray media array
       
    44         * @param aTitle title
       
    45         * @param aType attribute type
       
    46         * @param aCat attribute category
       
    47         * @param aPodcastType attribute podcast type
       
    48         * @param aPodcastCat attribute podcast category
       
    49         * @param aId unique ID
       
    50         * @param aNonPermissibleActions bitmask specifying the non-permissible
       
    51         *       actions for the entry
       
    52         */
       
    53         static void AppendMediaL(CMPXMediaArray& aArray, const TDesC& aTitle,
       
    54             TMPXGeneralType aType, TMPXGeneralCategory aCat,
       
    55             TMPXPodcastType aPodcastType, TMPXPodcastCategory aPodcastCat,
       
    56             TMPXItemId aId = 0, TInt aNonPermissibleActions = 0);
       
    57 
       
    58         /**
       
    59         * Returns the Podcast field name for a specified category
       
    60         * @param aCategory identifies the category
       
    61         * @return corresponding field name
       
    62         */
       
    63         static TPtrC PodcastFieldNameForCategoryL(TMPXGeneralCategory aCategory);
       
    64 
       
    65         /**
       
    66         * Returns today's date (no hour, minutes, seconds)
       
    67         * @return date value
       
    68         */
       
    69         static TTime Today();
       
    70 
       
    71         /**
       
    72         * Returns this month' start date (no hour, minutes, seconds)
       
    73         * @return date value
       
    74         */
       
    75         static TTime MonthStart();
       
    76 
       
    77         /**
       
    78         * Returns the index of the current day in week (0-6)
       
    79         * @return index value
       
    80         */
       
    81         static TInt DayNoInWeek();
       
    82 
       
    83         /**
       
    84         * Returns the table name for a specified category
       
    85         * @param aCategory identifies the category
       
    86         * @return corresponding table name
       
    87         */
       
    88         static TPtrC TableNameForCategoryL(TMPXGeneralCategory aCategory);
       
    89     };
       
    90 
       
    91 #endif // MPXDBUTIL_H
       
    92 
       
    93 // End of File
       
    94