omacpadapters/WAPAdapter/Inc/CWPWAPBrowserItem.h
changeset 42 aa33c2cb9a50
equal deleted inserted replaced
41:c742e1129640 42:aa33c2cb9a50
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Setting item for browser settings.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CWPWAPBROWSERITEM_H
       
    20 #define CWPWAPBROWSERITEM_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MWPVisitor.h>
       
    25 #include <favouritesdb.h>
       
    26 #include "CWPWAPItemBAse.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class MWPWAPItemBase;
       
    30 class CBookmarkDb;
       
    31 class RCmManagerExt;
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35  * CWPWAPBrowserItem handles one browser setting.
       
    36  *
       
    37  * @lib WPWAPAdapter
       
    38  * @since 2.0
       
    39  */ 
       
    40 
       
    41 
       
    42 class CWPWAPBrowserItem : public CWPWAPItemBase
       
    43     {
       
    44     public:  // Constructors and destructor
       
    45 
       
    46         /**
       
    47         * Two-phased constructor.
       
    48         * @param aFirst ETrue if this browser item is first
       
    49         * @param aTitle Title for browser items
       
    50         * @param aBookmarkTitle Title for bookmark items
       
    51         * @param aDefaultName Default name for browser items
       
    52         * @param aDefaultBookmarkName Default name for bookmarks.
       
    53         * @param aCharacteristic The APPLICATION characteristic
       
    54         * @param aCommsDb The CommsDB to use. Created if NULL.
       
    55         * @param aAPHandler The APEngine data handler to use. Created if NULL.
       
    56         * @param aBookmarkDb The bookmark database to use. Created if NULL.
       
    57         * @return CWPWAPBrowserItem instance
       
    58         */
       
    59         static CWPWAPBrowserItem* NewL( TBool aFirst,
       
    60             const TDesC& aTitle, 
       
    61             const TDesC& aBookmarkTitle,
       
    62             const TDesC& aDefaultName, 
       
    63             const TDesC& aDefaultBookmarkName,
       
    64             CWPCharacteristic& aCharacteristic, 
       
    65             CCommsDatabase*& aCommsDb, 
       
    66             RCmManagerExt*& aCmManager           
       
    67             );
       
    68 
       
    69         /**
       
    70         * Destructor.
       
    71         */
       
    72         ~CWPWAPBrowserItem();
       
    73 
       
    74     public:   // From CWPMMSItemBase
       
    75 
       
    76         TBool CanSetAsDefault() const;
       
    77         void SaveL();
       
    78         void SetAsDefaultL();
       
    79         TBool ValidateL();
       
    80         void ResourceL( CWPCharacteristic& aResource );
       
    81         void AddL( RPointerArray<MWPWAPItemBase>& aShownItems, 
       
    82             RPointerArray<MWPWAPItemBase>& aHiddenItems );
       
    83 
       
    84     private:  // New functions
       
    85         /**
       
    86         * C++ default constructor.
       
    87         * @see CWPWAPBrowserItem::NewL() for description of parameters.
       
    88         */
       
    89         CWPWAPBrowserItem( TBool aFirst,
       
    90             const TDesC& aTitle, 
       
    91             const TDesC& aBookmarkTitle,
       
    92             const TDesC& aDefaultName, 
       
    93             const TDesC& aDefaultBookmarkName,
       
    94             CWPCharacteristic& aCharacteristic, 
       
    95             CCommsDatabase*& aCommsDb, 
       
    96             RCmManagerExt*& aCmManager,            
       
    97             );
       
    98 
       
    99         /**
       
   100         * By default Symbian 2nd phase constructor is private.
       
   101         */
       
   102         void ConstructL();
       
   103 
       
   104     private:
       
   105         // The bookmarks. Owns.
       
   106         RPointerArray<MWPWAPItemBase> iBookmarks;
       
   107 
       
   108         // The default name for bookmarks.
       
   109         const TDesC& iDefaultBookmarkName;
       
   110 
       
   111         // The title for bookmarks
       
   112         const TDesC& iBookmarkTitle;
       
   113         
       
   114         //RFavouritesDb iDb;
       
   115 
       
   116         // ETrue if this browser item is first in list.
       
   117         TBool iFirst;
       
   118     };
       
   119 
       
   120 #endif  // CWPWAPBROWSERITEM_H
       
   121             
       
   122 // End of File