+ owner_->getLyXFunc()->setErrorMessage(N_("Unknow function!"));
+ break;
+
+ default:
+ return false;
+ } // end of switch
+
+ return true;
+}
+
+
+void BufferView::Pimpl::newline()
+{
+ if (available()) {
+ LyXText * lt = bv_->getLyXText();
+ hideCursor();
+ update(lt,
+ BufferView::SELECT
+ | BufferView::FITCUR);
+ lt->InsertChar(bv_, LyXParagraph::META_NEWLINE);
+ update(lt,
+ BufferView::SELECT
+ | BufferView::FITCUR
+ | BufferView::CHANGE);
+ }
+}
+
+
+void BufferView::Pimpl::hfill()
+{
+ if (available()) {
+ LyXText * lt = bv_->getLyXText();
+ hideCursor();
+ update(lt,
+ BufferView::SELECT
+ | BufferView::FITCUR);
+ lt->InsertChar(bv_, LyXParagraph::META_HFILL);
+ update(lt,
+ BufferView::SELECT
+ | BufferView::FITCUR
+ | BufferView::CHANGE);
+ }
+}
+
+
+void BufferView::Pimpl::protectedBlank(LyXText * lt)
+{
+ if (available()) {
+ hideCursor();
+ update(lt, BufferView::SELECT|BufferView::FITCUR);
+ InsetSpecialChar * new_inset =
+ new InsetSpecialChar(InsetSpecialChar::PROTECTED_SEPARATOR);
+ if (!insertInset(new_inset))
+ delete new_inset;
+ else
+ updateInset(new_inset, true);
+ }
+}
+
+
+void BufferView::Pimpl::menuSeparator()
+{
+ if (available()) {
+ LyXText * lt = bv_->getLyXText();
+
+ hideCursor();
+ update(lt, BufferView::SELECT|BufferView::FITCUR);
+ InsetSpecialChar * new_inset =
+ new InsetSpecialChar(InsetSpecialChar::MENU_SEPARATOR);
+ insertInset(new_inset);
+ }
+}
+
+
+void BufferView::Pimpl::endOfSentenceDot()
+{
+ if (available()) {
+ hideCursor();
+ update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
+ InsetSpecialChar * new_inset =
+ new InsetSpecialChar(InsetSpecialChar::END_OF_SENTENCE);
+ insertInset(new_inset);
+ }
+}
+
+
+void BufferView::Pimpl::ldots()
+{
+ if (available()) {
+ hideCursor();
+ update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
+ InsetSpecialChar * new_inset =
+ new InsetSpecialChar(InsetSpecialChar::LDOTS);
+ insertInset(new_inset);
+ }
+}
+
+
+void BufferView::Pimpl::hyphenationPoint()
+{
+ if (available()) {
+ hideCursor();
+ update(bv_->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
+ InsetSpecialChar * new_inset =
+ new InsetSpecialChar(InsetSpecialChar::HYPHENATION);
+ insertInset(new_inset);
+ }
+}
+
+
+void BufferView::Pimpl::insertNote()
+{
+ InsetInfo * new_inset = new InsetInfo();
+ insertInset(new_inset);
+ new_inset->Edit(bv_, 0, 0, 0);
+}
+
+
+// Open and lock an updatable inset
+bool BufferView::Pimpl::open_new_inset(UpdatableInset * new_inset, bool behind)
+{
+ LyXText * lt = bv_->getLyXText();
+
+ beforeChange(lt);
+ lt->FinishUndo();
+ if (!insertInset(new_inset)) {
+ delete new_inset;
+ return false;
+ }
+ if (behind) {
+ LyXFont & font = lt->real_current_font;
+ new_inset->Edit(bv_, new_inset->width(bv_, font), 0, 0);
+ } else
+ new_inset->Edit(bv_, 0, 0, 0);
+ return true;
+}
+
+
+bool BufferView::Pimpl::insertInset(Inset * inset, string const & lout)
+{
+ // if we are in a locking inset we should try to insert the
+ // inset there otherwise this is a illegal function now
+ if (bv_->theLockingInset()) {
+ if (bv_->theLockingInset()->InsertInsetAllowed(inset))
+ return bv_->theLockingInset()->InsertInset(bv_, inset);
+ return false;
+ }
+
+ // not quite sure if we want this...
+ bv_->text->SetCursorParUndo(buffer_);
+ bv_->text->FreezeUndo();
+
+ beforeChange(bv_->text);
+ if (!lout.empty()) {
+ update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
+ bv_->text->BreakParagraph(bv_);
+ update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
+
+ if (bv_->text->cursor.par()->size()) {
+ bv_->text->CursorLeft(bv_);
+
+ bv_->text->BreakParagraph(bv_);
+ update(bv_->text, BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);