mediasettings/mediasettingsapp/src/MPSettingsDocument.cpp
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2009 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 the License "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:   Document class required by AVKON application framework.*
       
    15 */
       
    16 
       
    17 
       
    18 // Version : %version: 4 %
       
    19 
       
    20 
       
    21 
       
    22 // INCLUDE FILES
       
    23 #include    <ecom.h>
       
    24 
       
    25 #include    "MPSettingsDocument.h"
       
    26 #include    "MPSettingsAppUi.h"
       
    27 #include    "mpsettingsmodel.h"
       
    28 #include    "MPSettEngPluginImplementationUIDs.hrh"
       
    29 #include	"mpxlog.h"
       
    30 
       
    31 // ================= MEMBER FUNCTIONS =======================
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // CMPSettingsDocument::CMPSettingsDocument
       
    35 // C++ default constructor can NOT contain any code, that
       
    36 // might leave.
       
    37 // -----------------------------------------------------------------------------
       
    38 //
       
    39 CMPSettingsDocument::CMPSettingsDocument(CEikApplication& aApp)
       
    40 : CAknDocument(aApp)    
       
    41     {
       
    42     MPX_DEBUG1(_L("#MS# CMPSettingsDocument::CMPSettingsDocument()"));
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CMPSettingsDocument::ConstructL
       
    47 // Symbian 2nd phase constructor can leave.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 void CMPSettingsDocument::ConstructL()
       
    51     {
       
    52     MPX_DEBUG1(_L("#MS# CMPSettingsDocument::ConstructL()"));
       
    53     const TUid KSettingsModelForROPUid = {KMPSettEngImplUidROP};
       
    54     iRopSettingsModel = CMPSettingsModel::NewL(KSettingsModelForROPUid);
       
    55     }
       
    56 
       
    57 // -----------------------------------------------------------------------------
       
    58 // CMPSettingsDocument::NewL
       
    59 // Two-phased constructor.
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CMPSettingsDocument* CMPSettingsDocument::NewL(
       
    63         CEikApplication& aApp)     // CMPSettingsApp reference
       
    64     {
       
    65     MPX_DEBUG1(_L("#MS# CMPSettingsDocument::NewL()"));
       
    66     CMPSettingsDocument* self = new(ELeave) CMPSettingsDocument(aApp);
       
    67     CleanupStack::PushL(self);
       
    68     self->ConstructL();
       
    69     CleanupStack::Pop();
       
    70 
       
    71     return self;
       
    72     }
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CMPSettingsDocument::~CMPSettingsDocument
       
    76 // Destructor.
       
    77 // -----------------------------------------------------------------------------
       
    78 //
       
    79 CMPSettingsDocument::~CMPSettingsDocument()
       
    80     {
       
    81     MPX_DEBUG1(_L("#MS# CMPSettingsDocument::~CMPSettingsDocument()"));
       
    82 	if (iRopSettingsModel) 
       
    83 		{
       
    84 		delete iRopSettingsModel;
       
    85 		}
       
    86 
       
    87     REComSession::FinalClose();
       
    88     }
       
    89     
       
    90 // ----------------------------------------------------
       
    91 // CMPSettingsDocument::SettingsModel
       
    92 // ----------------------------------------------------
       
    93 //
       
    94 CMPSettingsModel* CMPSettingsDocument::SettingsModel()
       
    95     {
       
    96     MPX_DEBUG1(_L("#MS# CMPSettingsDocument::SettingsModel()"));
       
    97     return iRopSettingsModel;
       
    98     }
       
    99 
       
   100 // ----------------------------------------------------
       
   101 // CMPSettingsDocument::CreateAppUiL()
       
   102 // constructs CMPSettingsAppUi
       
   103 // ----------------------------------------------------
       
   104 //
       
   105 CEikAppUi* CMPSettingsDocument::CreateAppUiL()
       
   106     {
       
   107     MPX_DEBUG1(_L("#MS# CMPSettingsDocument::CreateAppUiL()"));
       
   108     return new(ELeave) CMPSettingsAppUi;
       
   109     }
       
   110 
       
   111 // End of File