coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/FavouritesRFSPlugin.cpp
changeset 56 11a052f4b02e
parent 49 76883296a0d5
child 65 8a530a83576a
equal deleted inserted replaced
49:76883296a0d5 56:11a052f4b02e
     1 /*
       
     2 * Copyright (c) 2005 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 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <FavouritesDb.h>
       
    21 #include <FavouritesLimits.h>
       
    22 #include "FavouritesRFSPluginPrivateCRKeys.h"
       
    23 #include "FavouritesRFSPlugin.h"
       
    24 
       
    25 _LIT( KRfsDefaultBookmarkDbPath, "Z:\\private\\10008D38\\DBS_101FD685_BrowserBookmarks.db" );
       
    26 
       
    27 const TInt KHexLength = 8;
       
    28 // ================= MEMBER FUNCTIONS =======================
       
    29 
       
    30 // C++ default constructor can NOT contain any code, that
       
    31 // might leave.
       
    32 //
       
    33 CFavouritesRFSPlugin::CFavouritesRFSPlugin()
       
    34     {
       
    35     }
       
    36 
       
    37 CFavouritesRFSPlugin::CFavouritesRFSPlugin(TAny* /*aInitParams*/)
       
    38     {
       
    39     }
       
    40 
       
    41 // Destructor
       
    42 CFavouritesRFSPlugin::~CFavouritesRFSPlugin()
       
    43     {
       
    44     }
       
    45 
       
    46 // ---------------------------------------------------------
       
    47 // NewL
       
    48 // ---------------------------------------------------------
       
    49 //
       
    50 CFavouritesRFSPlugin* CFavouritesRFSPlugin::NewL(TAny* aInitParams)
       
    51     {
       
    52     #ifdef _DEBUG
       
    53         RDebug::Print(_L("CFavouritesRFSPlugin::NewL()"));
       
    54     #endif
       
    55     CFavouritesRFSPlugin* self = new (ELeave) CFavouritesRFSPlugin(aInitParams);
       
    56     CleanupStack::PushL(self);
       
    57     self->ConstructL();
       
    58     CleanupStack::Pop();
       
    59     return self;
       
    60     }
       
    61 
       
    62 
       
    63 // ---------------------------------------------------------
       
    64 // ConstructL
       
    65 // ---------------------------------------------------------
       
    66 //
       
    67 void CFavouritesRFSPlugin::ConstructL()
       
    68     {
       
    69     #ifdef _DEBUG
       
    70         RDebug::Print(_L("CFavouritesRFSPlugin::ConstructL()"));
       
    71     #endif
       
    72     }
       
    73 
       
    74 void CFavouritesRFSPlugin::RestoreFactorySettingsL( const TRfsReason aType )
       
    75     {
       
    76     #ifdef _DEBUG
       
    77         RDebug::Print(_L("CFavouritesRFSPlugin::RestoreFactorySettingsL(%d)"), aType);
       
    78     #endif
       
    79     if (aType == ENormalRfs)
       
    80         {    
       
    81     	RFavouritesDb::RestoreFactorySettingsL(KBrowserBookmarks, KRfsDefaultBookmarkDbPath, *this );
       
    82         }
       
    83     #ifdef _DEBUG
       
    84         RDebug::Print(_L("CFavouritesRFSPlugin::RestoreFactorySettingsL: End"));
       
    85     #endif
       
    86     }
       
    87 
       
    88 void CFavouritesRFSPlugin::GetScriptL( const TRfsReason aType, TDes& aPath )
       
    89     {
       
    90     if (aType == EInitRfs)
       
    91         {
       
    92         // Add CenRep UID and key
       
    93         TUid hexuid(KCRUidFavouritesRFSPlugin);
       
    94         TUint32 hexkey(KInitFavouritesRFSPlugin);
       
    95         HBufC* hbuf = HBufC::New( KMaxPath );
       
    96         TPtr buf = hbuf->Des();
       
    97         buf.Zero();
       
    98         buf.AppendNumFixedWidthUC( hexuid.iUid, EHex, KHexLength );
       
    99         buf.Append(_L(":"));
       
   100         buf.AppendNumFixedWidthUC( hexkey, EHex, KHexLength );
       
   101         buf.Append(_L(";"));
       
   102         RDebug::Print( buf );
       
   103         aPath.Copy( buf );    
       
   104         delete hbuf;
       
   105         }        
       
   106     }
       
   107 
       
   108 void CFavouritesRFSPlugin::ExecuteCustomCommandL( const TRfsReason /*aType*/,
       
   109                                         TDesC& aCommand )
       
   110     {
       
   111     #ifdef _DEBUG
       
   112         RDebug::Print(_L("CFavouritesRFSPlugin::ExecuteCustomCommandL"));
       
   113         RDebug::Print(_L("CFavouritesRFSPlugin::ExecuteCustomCommandL Command: %S"), &aCommand);
       
   114     #endif
       
   115     }
       
   116 
       
   117 TBool CFavouritesRFSPlugin::MapAccessPoint( TUint aOldUid, TUint& aNewUid )
       
   118     {
       
   119     aNewUid = aOldUid;
       
   120     return ETrue;
       
   121     }
       
   122 
       
   123 // End of file