| 37 |      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: Message services manages all messaging Qt highway services. 
 | 
|  |     15 |  *
 | 
|  |     16 |  */
 | 
|  |     17 | 
 | 
|  |     18 | #include "msgservicewindow.h"
 | 
|  |     19 | 
 | 
|  |     20 | #include "msgviewinterface.h"
 | 
|  |     21 | #include "msgsendinterface.h"
 | 
|  |     22 | #include "msgshareuiinterface.h"
 | 
|  |     23 | 
 | 
|  |     24 | #include "msgstorehandler.h"
 | 
|  |     25 | #include "msgserviceviewmanager.h"
 | 
|  |     26 | 
 | 
|  |     27 | // LOCALIZATION
 | 
|  |     28 | #define LOC_BUTTON_DELETE hbTrId("txt_common_button_delete")
 | 
|  |     29 | #define LOC_BUTTON_CANCEL hbTrId("txt_common_button_cancel")
 | 
|  |     30 | #define LOC_DELETE_MESSAGE hbTrId("txt_messaging_dialog_delete_message")
 | 
|  |     31 | 
 | 
|  |     32 | 
 | 
|  |     33 | // ----------------------------------------------------------------------------
 | 
|  |     34 | // MsgServiceWindow::MsgServiceWindow
 | 
|  |     35 | // @see header
 | 
|  |     36 | // ----------------------------------------------------------------------------
 | 
|  |     37 | MsgServiceWindow::MsgServiceWindow():HbMainWindow(),mSendInterface(NULL),
 | 
|  |     38 | mViewInterface(NULL),
 | 
|  |     39 | mShareUiInterface(NULL),
 | 
|  |     40 | mStoreHandler(NULL),
 | 
|  |     41 | mViewManager(NULL)
 | 
|  |     42 |     {
 | 
|  |     43 |     // create stote handler
 | 
| 48 |     44 |     QT_TRAP_THROWING( mStoreHandler = new MsgStoreHandler());
 | 
| 37 |     45 |     
 | 
|  |     46 |     // create view manager
 | 
|  |     47 |     mViewManager = new MsgServiceViewManager(mStoreHandler,this);
 | 
|  |     48 |     
 | 
|  |     49 |     // create interfaces 
 | 
|  |     50 |     mSendInterface = new MsgSendInterface(mViewManager);
 | 
|  |     51 |     mViewInterface = new MsgViewInterface(mViewManager);
 | 
|  |     52 |     mShareUiInterface = new MsgShareUiInterface(mViewManager);
 | 
|  |     53 |     }
 | 
|  |     54 | 
 | 
|  |     55 | // ----------------------------------------------------------------------------
 | 
|  |     56 | // MsgServiceWindow::~MsgServiceWindow
 | 
|  |     57 | // @see header
 | 
|  |     58 | // ----------------------------------------------------------------------------
 | 
|  |     59 | MsgServiceWindow::~MsgServiceWindow()
 | 
|  |     60 |     {
 | 
|  |     61 |     if(mShareUiInterface)
 | 
|  |     62 |         {
 | 
|  |     63 |         delete mShareUiInterface;
 | 
|  |     64 |         }
 | 
|  |     65 |     if(mViewInterface)
 | 
|  |     66 |         {
 | 
|  |     67 |         delete mViewInterface;
 | 
|  |     68 |         }
 | 
|  |     69 |     if(mSendInterface)
 | 
|  |     70 |         {
 | 
|  |     71 |         delete mSendInterface;
 | 
|  |     72 |         }
 | 
|  |     73 |     if(mViewManager)
 | 
|  |     74 |         {
 | 
|  |     75 |         delete mViewManager;
 | 
|  |     76 |         }
 | 
|  |     77 | 
 | 
|  |     78 |     if(mStoreHandler)
 | 
|  |     79 |         {
 | 
|  |     80 |         delete mStoreHandler;
 | 
|  |     81 |         }
 | 
|  |     82 |     }
 | 
|  |     83 | 
 | 
|  |     84 | 
 | 
|  |     85 | 
 | 
|  |     86 |     
 | 
|  |     87 | 
 | 
|  |     88 | 
 |