messagingapp/msgui/msgapp/src/msgmainwindow.cpp
changeset 31 ebfee66fde93
child 34 84197e66a4bd
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     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 "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  * Main window of the messaging application. Activates the default view.
       
    16  *
       
    17  */
       
    18 
       
    19 #include "msgmainwindow.h"
       
    20 
       
    21 #include "msgviewmanager.h"
       
    22 #include "msgserviceinterface.h"
       
    23 #include "msgsendserviceinterface.h"
       
    24 #include "conversationsengine.h"
       
    25 
       
    26 
       
    27 //---------------------------------------------------------------
       
    28 // MsgMainWindow::MsgMainWindow
       
    29 // Constructor
       
    30 //---------------------------------------------------------------
       
    31 MsgMainWindow::MsgMainWindow(bool serviceRequest, QWidget *parent) :
       
    32 HbMainWindow(parent), mMsgSI(0), mMsgSendSI(0)
       
    33 {
       
    34     MsgViewManager* viewManager = new MsgViewManager(serviceRequest,this,this);
       
    35     mMsgSI = new MsgServiceInterface(NULL,viewManager);
       
    36     mMsgSendSI = new MsgSendServiceInterface(NULL,viewManager);
       
    37         
       
    38     //Model creation
       
    39     ConversationsEngine::instance();
       
    40     
       
    41 }
       
    42 
       
    43 //---------------------------------------------------------------
       
    44 // MsgMainWindow::~MsgMainWindow
       
    45 // Constructor
       
    46 //---------------------------------------------------------------
       
    47 MsgMainWindow::~MsgMainWindow()
       
    48 {   
       
    49     if (mMsgSI)
       
    50     {
       
    51         delete mMsgSI;
       
    52         mMsgSI = NULL;
       
    53     }
       
    54     if (mMsgSendSI)
       
    55     {
       
    56         delete mMsgSendSI;
       
    57         mMsgSendSI = NULL;
       
    58     }
       
    59     
       
    60     delete ConversationsEngine::instance();
       
    61 }
       
    62 
       
    63 // End of file