controlpanelui/src/cpapplication/src/cpmainwindow.cpp
branchRCL_3
changeset 13 90fe62538f66
equal deleted inserted replaced
12:3fec62e6e7fc 13:90fe62538f66
       
     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 *
       
    16 */
       
    17 
       
    18 #include "cpmainwindow.h"
       
    19 #include "cpmainview.h"
       
    20 #include <cpplugininterface.h>
       
    21 #include <cpcategorysettingformitemdata.h>
       
    22 #include <hbapplication.h>
       
    23 #include <cpevent.h>
       
    24 
       
    25 //CpMainWindow implementation
       
    26 CpMainWindow::CpMainWindow(QWidget *parent /*= 0*/, Hb::WindowFlags windowFlags /*= Hb::WindowFlagNone*/)
       
    27 : HbMainWindow(parent,windowFlags)
       
    28 {
       
    29 }
       
    30 
       
    31 CpMainWindow::~CpMainWindow()
       
    32 {
       
    33     CpMainView *mainView = qobject_cast<CpMainView *>(views().first());
       
    34     if(mainView)
       
    35         {
       
    36         mainView->saveActivity();
       
    37         }
       
    38 }
       
    39 
       
    40 bool CpMainWindow::event(QEvent *e)
       
    41 {
       
    42     if (e->type() == (QEvent::Type)(CpCreatePluginItemDataEvent::CreatePluginItemData)) {
       
    43         CpCreatePluginItemDataEvent *event = static_cast<CpCreatePluginItemDataEvent*>(e);
       
    44         ::createCpPluginItemData(event);
       
    45         e->accept();
       
    46     }
       
    47     return HbMainWindow::event(e);
       
    48 }
       
    49 
       
    50 //End of File
       
    51 
       
    52