messagingapp/msgui/msgapp/src/msgmainwindow.cpp
branchRCL_3
changeset 57 ebe688cedc25
equal deleted inserted replaced
54:fa1df4b99609 57:ebe688cedc25
       
     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,int activityMsgId,QWidget *parent) :
       
    32 HbMainWindow(parent), mMsgSI(0), mMsgSendSI(0)
       
    33 {
       
    34     mViewManager = new MsgViewManager(serviceRequest,this,this,activityMsgId);
       
    35     mMsgSI = new MsgServiceInterface(NULL,mViewManager);
       
    36     mMsgSendSI = new MsgSendServiceInterface(NULL,mViewManager);
       
    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 //---------------------------------------------------------------
       
    64 // MsgMainWindow::viewManager
       
    65 // Constructor
       
    66 //---------------------------------------------------------------
       
    67 MsgViewManager* MsgMainWindow::viewManager()
       
    68 {   
       
    69      return mViewManager; 
       
    70 }
       
    71 // End of file