70 */ |
74 */ |
71 |
75 |
72 void CCreatorNotepadWrapper::ConstructL() |
76 void CCreatorNotepadWrapper::ConstructL() |
73 { |
77 { |
74 iAgendaUtil = new AgendaUtil(); |
78 iAgendaUtil = new AgendaUtil(); |
75 // iNotepadApi = new NotesEditor(iAgendaUtil); |
79 |
|
80 // iNotepadApi = new NotesEditor(iAgendaUtil); |
|
81 |
|
82 // Load notes editor plugin. |
|
83 // Launch the notes editor using notes editor plugin api |
|
84 QDir dir(NOTES_EDITOR_PLUGIN_PATH); |
|
85 QString pluginName = dir.absoluteFilePath(NOTES_EDITOR_PLUGIN_NAME); |
|
86 |
|
87 QT_TRYCATCH_LEAVING( |
|
88 // Create NotesEditor plugin loader object. |
|
89 iNotesEditorPluginLoader = new QPluginLoader(pluginName); |
|
90 |
|
91 // Load the plugin |
|
92 bool notesPluginLoaded = iNotesEditorPluginLoader->load(); |
|
93 QObject *plugin = qobject_cast<QObject*> ( iNotesEditorPluginLoader->instance()); |
|
94 |
|
95 iNotepadApi = qobject_cast<NotesEditorInterface*>(plugin); |
|
96 ); |
|
97 |
76 } |
98 } |
77 |
99 |
78 TInt CCreatorNotepadWrapper::CreateNoteL( const TDesC& aText ) |
100 TInt CCreatorNotepadWrapper::CreateNoteL( const TDesC& aText ) |
79 { |
101 { |
80 TInt err = KErrNone; |
102 User::LeaveIfNull(iNotepadApi); |
81 QString textNote = QString::fromUtf16( aText.Ptr(),aText.Length()); |
103 |
|
104 QString textNote = QString::fromUtf16( aText.Ptr(),aText.Length()); |
82 iNotepadApi->edit(textNote,iAgendaUtil); |
105 iNotepadApi->edit(textNote,iAgendaUtil); |
83 iNotepadApi->close(NotesEditorInterface::CloseWithSave, iAgendaUtil); |
106 iNotepadApi->close(NotesEditorInterface::CloseWithSave, iAgendaUtil); |
84 return err; |
107 |
|
108 return KErrNone; |
85 } |
109 } |
86 void CCreatorNotepadWrapper::DeleteAllL() |
110 void CCreatorNotepadWrapper::DeleteAllL() |
87 { |
111 { |
88 |
112 |
89 QList<AgendaEntry> ael; |
113 QList<AgendaEntry> ael; |