messagingappbase/smartmessaging/wmlbc/inc/WmlBMUtils30.h
changeset 0 72b543305e3a
child 2 0bf1d54f37d9
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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:  
       
    15 *     Class offers static utility functions for CWmlBMSubItem.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef WMLBMUTILS_H
       
    23 #define WMLBMUTILS_H
       
    24 
       
    25 // INCLUDES
       
    26 #include <FavouritesDb.h>
       
    27 
       
    28 // DATA TYPES
       
    29 
       
    30 enum TWmlBookmarkFieldIndex
       
    31     {
       
    32     EBookmarkNameFieldIndex = 0,
       
    33     EBookmarkAddressFieldIndex
       
    34     };
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 
       
    38 class CFavouritesItem;
       
    39 class CFavouritesItemList;
       
    40 
       
    41 class CWmlBMSubItem;
       
    42 
       
    43 
       
    44 // CLASS DECLARATION
       
    45 
       
    46 /**
       
    47 * Class offers utility functions for CWmlBMSubItem-class.
       
    48 * Contains only static methods, which are declared private.
       
    49 * CWmlBMSubItem-class is declared as a friend class so it
       
    50 * may access the private methods.
       
    51 */
       
    52 NONSHARABLE_CLASS( WmlBMUtils )
       
    53     {
       
    54 
       
    55     private: // constructor
       
    56 
       
    57         /**
       
    58         * Constructor.
       
    59         */
       
    60         WmlBMUtils(){};
       
    61 
       
    62     private: // Methods available only to the friend classes.
       
    63 
       
    64         /**
       
    65         * Actually store the item to the favourites db.
       
    66         * Uniqueness of the name must be quaranteed before
       
    67         * calling this method.
       
    68         * @param aDb reference to the bookmark db object.
       
    69         * @param aItem reference to the favourites item.
       
    70         * @return commsdb error code.
       
    71         */
       
    72         static TInt DoStoreL(RFavouritesDb& aDb, CFavouritesItem& aItem);
       
    73 
       
    74         /**
       
    75         * Check if the given name already exists.
       
    76         * @aName name descriptor.
       
    77         * @aItemList list of items among the search is done.
       
    78         * @return index of the found item in the list or
       
    79         * KErrNone if the item was not found.
       
    80         */
       
    81         static TInt Exists( const TDesC& aName,
       
    82             const CFavouritesItemList& aItemList );
       
    83 
       
    84         /**
       
    85         * Removes the item from the database.
       
    86         * @param aDb reference to the favourites database.
       
    87         * @param aUid uid of the item, which is to be removed.
       
    88         */
       
    89         //static void RemoveL( RFavouritesDb& aDb, const TUint32 aUid );
       
    90 
       
    91         /**
       
    92         * Create the item list qualifying the supplied name criteria.
       
    93         * @param aDb bookmark db where the item are searched.
       
    94         * @return reference to the favourites item list object, which is
       
    95         * pushed to the cleanupstack.
       
    96         */
       
    97         static CFavouritesItemList* CreateItemListLC( RFavouritesDb& aDb);
       
    98 
       
    99     private: // friend class declaration.
       
   100 
       
   101         friend class CWmlBMSubItem;
       
   102     };
       
   103 
       
   104 #endif // WMLBMUTILS_H
       
   105 
       
   106 //  End of File