imageeditor/imageeditorApp/src/ImageEditorDocument.cpp
changeset 1 edfc90759b9f
equal deleted inserted replaced
0:57d4cdd99204 1:edfc90759b9f
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "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 * Ixonos Plc
       
    14 *
       
    15 * Description: 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include "ImageEditorDocument.h"
       
    23 #include "ImageEditorAppUi.h"
       
    24 
       
    25 
       
    26 //=============================================================================
       
    27 CImageEditorDocument::CImageEditorDocument (CEikApplication & aApp) :
       
    28 CAknDocument (aApp)    
       
    29 {
       
    30 
       
    31 }
       
    32 
       
    33 //=============================================================================
       
    34 CImageEditorDocument::~CImageEditorDocument()
       
    35 {
       
    36     LOG(KImageEditorLogFile, "CImageEditorDocument::~CImageEditorDocument()");
       
    37 }
       
    38 
       
    39 //=============================================================================
       
    40 void CImageEditorDocument::ConstructL()
       
    41 {
       
    42 	LOG(KImageEditorLogFile, "CImageEditorDocument: Document created");
       
    43 }
       
    44 
       
    45 //=============================================================================
       
    46 CImageEditorDocument * CImageEditorDocument::NewL (CEikApplication & aApp)
       
    47 {
       
    48     CImageEditorDocument * self = new (ELeave) CImageEditorDocument (aApp);
       
    49     CleanupStack::PushL (self);
       
    50     self->ConstructL();
       
    51     CleanupStack::Pop();
       
    52     return self;
       
    53 }
       
    54     
       
    55 //=============================================================================
       
    56 CEikAppUi * CImageEditorDocument::CreateAppUiL()
       
    57 {
       
    58 	return new (ELeave) CImageEditorAppUi;
       
    59 }
       
    60 
       
    61 
       
    62 //=============================================================================
       
    63 void CImageEditorDocument::OpenFileL(CFileStore*& /*aFileStore*/, RFile& aFile)
       
    64 {
       
    65     LOG(KImageEditorLogFile, "CImageEditorDocument::OpenFileL()");
       
    66 
       
    67 	CleanupClosePushL(aFile);
       
    68 
       
    69     // File handle must be closed. Open File Service won't do it. 
       
    70     // Using cleanup stack, because iAppUi->OpenFileL() may leave.
       
    71 	((CImageEditorAppUi*)iAppUi)->OpenFileL(aFile);
       
    72 
       
    73 	CleanupStack::PopAndDestroy();    
       
    74 }