std::string RemoteControl::CreateNote() { try { Note::Ptr note = m_manager.create (); return note->uri(); } catch(...) { } return ""; }
std::string RemoteControl::CreateNamedNote(const std::string& linked_title) { Note::Ptr note; note = m_manager.find (linked_title); if (note) return ""; try { note = m_manager.create (linked_title); return note->uri(); } catch (const std::exception & e) { ERR_OUT("create throw: %s", e.what()); } return ""; }
void RemoteControl::on_note_saved(const Note::Ptr & note) { if(note) { NoteSaved(note->uri()); } }
void RemoteControl::on_note_deleted(const Note::Ptr & note) { if(note) { NoteDeleted(note->uri(), note->get_title()); } }
void RemoteControl::on_note_added(const Note::Ptr & note) { if(note) { NoteAdded(note->uri()); } }
std::string RemoteControl::FindStartHereNote() { Note::Ptr note = m_manager.find_by_uri (m_manager.start_note_uri()); return (!note) ? "" : note->uri(); }
std::string RemoteControl::FindNote(const std::string& linked_title) { Note::Ptr note = m_manager.find (linked_title); return (!note) ? "" : note->uri(); }