|
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: This is the Definition file for ClockAppController class. |
|
15 * |
|
16 */ |
|
17 |
|
18 // System includes |
|
19 #include <QDebug> |
|
20 |
|
21 // User includes |
|
22 #include "clockappcontroller.h" |
|
23 #include "clockappcontrollerifimpl.h" |
|
24 #include "clockviewmanager.h" |
|
25 |
|
26 /*! |
|
27 \class ClockAppController |
|
28 |
|
29 This is the heart of clock application. It constructs and owns the |
|
30 ClockViewManager objects. |
|
31 */ |
|
32 |
|
33 /*! |
|
34 Default constructor. |
|
35 */ |
|
36 ClockAppController::ClockAppController(QObject *parent) |
|
37 :QObject(parent), |
|
38 mViewManager(0), |
|
39 mIfImpl(0) |
|
40 { |
|
41 qDebug() << "clock: ClockAppController::ClockAppController -->"; |
|
42 |
|
43 // Construct the interface implementation. |
|
44 mIfImpl = new ClockAppControllerIfImpl(this, this); |
|
45 |
|
46 // Construct the view manager. |
|
47 mViewManager = new ClockViewManager(*mIfImpl, this); |
|
48 Q_ASSERT_X( |
|
49 mViewManager, "clockappcontroller.cpp", |
|
50 "ClockViewManager is 0"); |
|
51 |
|
52 qDebug() << "clock: ClockAppController::ClockAppController <--"; |
|
53 } |
|
54 |
|
55 /*! |
|
56 Destructor. |
|
57 */ |
|
58 ClockAppController::~ClockAppController() |
|
59 { |
|
60 qDebug() << "clock: ClockAppController::~ClockAppController -->"; |
|
61 |
|
62 if (mViewManager) { |
|
63 delete mViewManager; |
|
64 mViewManager = 0; |
|
65 } |
|
66 if (mIfImpl) { |
|
67 delete mIfImpl; |
|
68 mIfImpl = 0; |
|
69 } |
|
70 |
|
71 qDebug() << "clock: ClockAppController::~ClockAppController <--"; |
|
72 } |
|
73 |
|
74 // End of file --Don't remove this. |