calendarui/application/src/calenapplication.cpp
changeset 55 2c54b51f39c4
child 57 bb2d3e476f29
equal deleted inserted replaced
51:0b38fc5b94c6 55:2c54b51f39c4
       
     1 /*
       
     2 * Copyright (c) 2010 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: Definition file for class CalenApplication.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "calencontroller.h"
       
    19 #include "calenserviceprovider.h"
       
    20 #include "calenapplication.h"
       
    21 
       
    22 /*!
       
    23 	CalenApplication
       
    24 	Responsible for creating the CalenController object.
       
    25  */
       
    26 
       
    27 /*!
       
    28 	constructor.
       
    29  */
       
    30 CalenApplication::CalenApplication(int &argc, char *argv[]):
       
    31  HbApplication(argc, argv)
       
    32 {
       
    33 	
       
    34 }
       
    35 
       
    36 /*!
       
    37 	Destructor.
       
    38  */
       
    39 CalenApplication::~CalenApplication()
       
    40 {
       
    41 	if (mController) {
       
    42 		delete mController;
       
    43 		mController = 0;
       
    44 	}
       
    45 }
       
    46 
       
    47 /*!
       
    48 	Creates the calencontroller object.
       
    49  */
       
    50 void CalenApplication::createController()
       
    51 {
       
    52 	mController = new CCalenController();
       
    53 	if (mController) {
       
    54 		mController->constructController();
       
    55 		connect(mController, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    56 		// Create the Calendar service provider
       
    57 		CalenServiceProvider service(mController);
       
    58 	}
       
    59 }
       
    60 
       
    61 /*!
       
    62 	Start the event loop for the application.
       
    63  */
       
    64 bool CalenApplication::execution()
       
    65 {
       
    66 	int ret = 0;
       
    67 	ret = exec();
       
    68 	return ret;
       
    69 }
       
    70 
       
    71 /*!
       
    72 	Deletes the controller.
       
    73  */
       
    74 void CalenApplication::releaseController()
       
    75 {
       
    76 	// delete the controller
       
    77 	mController->ReleaseCustomisations();
       
    78 	mController->Release();
       
    79 	
       
    80 }
       
    81 
       
    82 /*
       
    83 	Emits the applicationReady signal.
       
    84  */
       
    85 void CalenApplication::handleAppReady()
       
    86 {
       
    87 	emit applicationReady();
       
    88 	disconnect(mController, SIGNAL(appReady()), this, SLOT(handleAppReady()));
       
    89 }
       
    90 
       
    91 // End of file	--Don't remove this.