|
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 NotesAppController class. |
|
15 * |
|
16 */ |
|
17 |
|
18 // System includes |
|
19 #include <QDebug> |
|
20 |
|
21 // User includes |
|
22 #include "notesappcontroller.h" |
|
23 #include "notesappcontrollerifimpl.h" |
|
24 #include "notesviewmanager.h" |
|
25 #include "notesmodelhandler.h" |
|
26 |
|
27 /*! |
|
28 \class NotesAppController |
|
29 |
|
30 This is the heart of notes application. It constructs and owns the |
|
31 NotesViewManager and NotesModelHandler objects. |
|
32 */ |
|
33 |
|
34 /*! |
|
35 Default constructor. |
|
36 */ |
|
37 NotesAppController::NotesAppController(QObject *parent) |
|
38 :QObject(parent), |
|
39 mViewManager(0), |
|
40 mNotesModelHandler(0), |
|
41 mIfImpl(0) |
|
42 { |
|
43 qDebug() << "notes: NotesAppController::NoteAppController -->"; |
|
44 |
|
45 // Construct the interface implementation. |
|
46 mIfImpl = new NotesAppControllerIfImpl(this, this); |
|
47 |
|
48 // Construct the model handler. |
|
49 mNotesModelHandler = new NotesModelHandler(this); |
|
50 Q_ASSERT_X( |
|
51 mNotesModelHandler, "notesappcontroller.cpp", |
|
52 "NotesModelHandler is 0"); |
|
53 |
|
54 // Construct the view manager. |
|
55 mViewManager = new NotesViewManager(*mIfImpl, this); |
|
56 Q_ASSERT_X( |
|
57 mViewManager, "notesappcontroller.cpp", |
|
58 "NotesViewManager is 0"); |
|
59 |
|
60 qDebug() << "notes: NotesAppController::NoteAppController <--"; |
|
61 } |
|
62 |
|
63 /*! |
|
64 Destructor. |
|
65 */ |
|
66 NotesAppController::~NotesAppController() |
|
67 { |
|
68 qDebug() << "notes: NotesAppController::~NoteAppController -->"; |
|
69 |
|
70 if (mViewManager) { |
|
71 delete mViewManager; |
|
72 mViewManager = 0; |
|
73 } |
|
74 if (mNotesModelHandler) { |
|
75 delete mNotesModelHandler; |
|
76 mNotesModelHandler = 0; |
|
77 } |
|
78 if (mIfImpl) { |
|
79 delete mIfImpl; |
|
80 mIfImpl = 0; |
|
81 } |
|
82 |
|
83 qDebug() << "notes: NotesAppController::~NoteAppController <--"; |
|
84 } |
|
85 |
|
86 // End of file --Don't remove this. |