DirectPrint/DirectPrintApp/src/directprintappdocument.cpp
branchRCL_3
changeset 12 613a5ff70823
child 15 2275db202402
equal deleted inserted replaced
8:3f1fec088555 12:613a5ff70823
       
     1 /*
       
     2 * Copyright (c) 2010 Kanrikogaku Kenkyusho, Ltd.
       
     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 * Kanrikogaku Kenkyusho, Ltd. - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "clog.h"
       
    20 #include "directprintappappui.h"
       
    21 #include "directprintappdocument.h"
       
    22 #include "directprintmodel.h"
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CDirectPrintAppDocument::NewL()
       
    28 // Two-phased constructor.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CDirectPrintAppDocument* CDirectPrintAppDocument::NewL(CEikApplication& aApp)
       
    32 	{
       
    33 	CDirectPrintAppDocument* self = NewLC(aApp);
       
    34 	CleanupStack::Pop(self);
       
    35 	return self;
       
    36 	}
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CDirectPrintAppDocument::NewLC()
       
    40 // Two-phased constructor.
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 CDirectPrintAppDocument* CDirectPrintAppDocument::NewLC(CEikApplication& aApp)
       
    44 	{
       
    45 	CDirectPrintAppDocument* self = new (ELeave) CDirectPrintAppDocument(aApp);
       
    46 
       
    47 	CleanupStack::PushL(self);
       
    48 	self->ConstructL();
       
    49 	return self;
       
    50 	}
       
    51 
       
    52 // -----------------------------------------------------------------------------
       
    53 // CDirectPrintAppDocument::ConstructL()
       
    54 // Symbian 2nd phase constructor can leave.
       
    55 // -----------------------------------------------------------------------------
       
    56 //
       
    57 void CDirectPrintAppDocument::ConstructL()
       
    58 	{
       
    59 	LOG("CDirectPrintAppDocument::ConstructL BEGIN");
       
    60 	// create the model object
       
    61 	iModel = CDirectPrintModel::NewL();
       
    62 	LOG("CDirectPrintAppDocument::ConstructL END");
       
    63 	}
       
    64 
       
    65 // -----------------------------------------------------------------------------
       
    66 // CDirectPrintAppDocument::CDirectPrintAppDocument()
       
    67 // C++ default constructor can NOT contain any code, that might leave.
       
    68 // -----------------------------------------------------------------------------
       
    69 //
       
    70 CDirectPrintAppDocument::CDirectPrintAppDocument(CEikApplication& aApp) :
       
    71 	CAknDocument(aApp)
       
    72 	{
       
    73 	// No implementation required
       
    74 	}
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // CDirectPrintAppDocument::~CDirectPrintAppDocument()
       
    78 // Destructor.
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 CDirectPrintAppDocument::~CDirectPrintAppDocument()
       
    82 	{
       
    83 	delete iModel;
       
    84 	}
       
    85 
       
    86 // ---------------------------------------------------------------------------
       
    87 // CDirectPrintAppDocument::CreateAppUiL()
       
    88 // Constructs CreateAppUi.
       
    89 // ---------------------------------------------------------------------------
       
    90 //
       
    91 CEikAppUi* CDirectPrintAppDocument::CreateAppUiL()
       
    92 	{
       
    93 	// Create the application user interface, and return a pointer to it;
       
    94 	// the framework takes ownership of this object
       
    95 	return new (ELeave) CDirectPrintAppAppUi;
       
    96 	}
       
    97 
       
    98 CDirectPrintModel& CDirectPrintAppDocument::Model()
       
    99 	{
       
   100 	return *iModel;
       
   101 	}
       
   102 
       
   103 // End of File