• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

blogilo

  • sources
  • kde-4.12
  • kdepim
  • blogilo
  • src
  • composer
blogilocomposerview.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2013 Montel Laurent <montel@kde.org>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 
21 #include "blogilocomposerview.h"
22 
23 #include <KLocale>
24 
25 #include <QApplication>
26 #include <QTimer>
27 #include <QMouseEvent>
28 #include <QAction>
29 #include <QMenu>
30 
31 BlogiloComposerView::BlogiloComposerView(QWidget * parent)
32  :ComposerEditorNG::ComposerView(parent)
33 {
34  settings()->setFontSize ( QWebSettings::DefaultFontSize, 14 );
35 }
36 
37 BlogiloComposerView::~BlogiloComposerView()
38 {
39 
40 }
41 
42 void BlogiloComposerView::startEditing()
43 {
44  //NOTE: it needs a mouse click!
45  //any better way to make the cursor visible?
46  this -> setFocus();
47  QMouseEvent mouseEventPress ( QEvent::MouseButtonPress, QPoint ( 10,10 ), Qt::LeftButton, Qt::NoButton, Qt::NoModifier );
48  QApplication::sendEvent ( this, &mouseEventPress );
49  QTimer::singleShot ( 50, this, SLOT(slotSendMouseReleaseEvent()) );
50 }
51 
52 void BlogiloComposerView::slotSendMouseReleaseEvent()
53 {
54  QMouseEvent mouseEventRelease ( QEvent::MouseButtonRelease, QPoint ( 10,10 ), Qt::LeftButton, Qt::NoButton, Qt::NoModifier );
55  QApplication::sendEvent ( this, &mouseEventRelease );
56  pageAction( QWebPage::MoveToEndOfDocument )->trigger();
57 }
58 
59 void BlogiloComposerView::addExtraAction(QMenu *menu)
60 {
61  menu->addSeparator();
62  QAction *translatorAction = menu->addAction(i18n("Translate..."));
63  connect( translatorAction, SIGNAL(triggered(bool)), this, SIGNAL(activateTranslator()) );
64 }
65 
66 #include "blogilocomposerview.moc"
QWidget
BlogiloComposerView::activateTranslator
void activateTranslator()
BlogiloComposerView::~BlogiloComposerView
~BlogiloComposerView()
Definition: blogilocomposerview.cpp:37
BlogiloComposerView::BlogiloComposerView
BlogiloComposerView(QWidget *parent=0)
Definition: blogilocomposerview.cpp:31
BlogiloComposerView::startEditing
void startEditing()
Definition: blogilocomposerview.cpp:42
blogilocomposerview.h
BlogiloComposerView::addExtraAction
virtual void addExtraAction(QMenu *menu)
Definition: blogilocomposerview.cpp:59
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:44 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

blogilo

Skip menu "blogilo"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal