mpxplugins/viewplugins/plugins/albumarteditordialogplugin/src/mpxalbumarteditordialogplugin.cpp
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:  Implementation of albumart editor dialog plugin
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <mpxalbumarteditordialog.rsg>
       
    21 #include <mpxcustomcommandobserver.h>
       
    22 #include <mpxviewutilitycommanddef.h>
       
    23 
       
    24 #include "mpxalbumarteditordialog.h"
       
    25 #include "mpxalbumarteditordialogplugin.h"
       
    26 
       
    27 
       
    28 // ======== MEMBER FUNCTIONS ========
       
    29 
       
    30 // ---------------------------------------------------------------------------
       
    31 // C++ default constructor can NOT contain any code, that
       
    32 // might leave.
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 CMPXAlbumArtEditorDialogPlugin::CMPXAlbumArtEditorDialogPlugin()
       
    36     {
       
    37     // Do nothing
       
    38     }
       
    39 
       
    40 // ---------------------------------------------------------------------------
       
    41 // Symbian 2nd phase constructor can leave.
       
    42 // ---------------------------------------------------------------------------
       
    43 //
       
    44 void CMPXAlbumArtEditorDialogPlugin::ConstructL()
       
    45     {
       
    46     // Do nothing
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // Two-phased constructor.
       
    51 // ---------------------------------------------------------------------------
       
    52 //
       
    53 CMPXAlbumArtEditorDialogPlugin* CMPXAlbumArtEditorDialogPlugin::NewL()
       
    54     {
       
    55     CMPXAlbumArtEditorDialogPlugin* self = 
       
    56         new ( ELeave ) CMPXAlbumArtEditorDialogPlugin();
       
    57     CleanupStack::PushL( self );
       
    58     self->ConstructL();
       
    59     CleanupStack::Pop( self );
       
    60     return self;
       
    61     }
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // Destructor
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 CMPXAlbumArtEditorDialogPlugin::~CMPXAlbumArtEditorDialogPlugin()
       
    68     {
       
    69     // Do nothing
       
    70     }
       
    71     
       
    72 // ---------------------------------------------------------------------------
       
    73 // From CMPXViewPlugin
       
    74 // Interface method to activate view.
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 void CMPXAlbumArtEditorDialogPlugin::ActivateViewL( const TDesC* aParam )
       
    78     {
       
    79     if ( !iDialog )
       
    80         {
       
    81         CreateViewL();        
       
    82         }
       
    83     
       
    84     if ( aParam )
       
    85         {
       
    86         CMPXAlbumArtEditorDialog* pDialog = 
       
    87             static_cast<CMPXAlbumArtEditorDialog*>( iDialog );
       
    88         pDialog->SetParamL( aParam );
       
    89         }
       
    90     
       
    91     iDialog->ExecuteLD( ResourceId() );
       
    92     if ( iCommandObserver )
       
    93         {
       
    94         TPckgC<TInt> selfPtr( reinterpret_cast<TInt>( this ) );    
       
    95         iCommandObserver->HandleCustomCommand( 
       
    96             TUid::Uid( KMPXViewUtilityCustomCommand ), 
       
    97             EMPXViewUtilCmdViewDeActivated,
       
    98             selfPtr );
       
    99         }
       
   100     iDialog = NULL;
       
   101     }    
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 // From CMPXAknDialogPlugin
       
   105 // Construct Avkon dialog.
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 CAknDialog* CMPXAlbumArtEditorDialogPlugin::ConstructDialogL()
       
   109     {
       
   110     return CMPXAlbumArtEditorDialog::NewL();
       
   111     }
       
   112     
       
   113 // ---------------------------------------------------------------------------
       
   114 // From CMPXAknDialogPlugin
       
   115 // Resource ID.
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118 TInt CMPXAlbumArtEditorDialogPlugin::ResourceId()
       
   119     {
       
   120     return R_MPX_CUI_ALBUM_ART_DIALOG;
       
   121     }
       
   122 
       
   123 //  End of File