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

blogilo

  • sources
  • kde-4.14
  • kdepim
  • blogilo
  • src
  • composer
blogilocomposerview.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2013-2015 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 #include "pimcommon/widgets/customtoolswidget.h"
23 
24 #include <KToggleAction>
25 
26 #include <QApplication>
27 #include <QTimer>
28 #include <QMouseEvent>
29 #include <QMenu>
30 
31 BlogiloComposerView::BlogiloComposerView(QWidget * parent)
32  : ComposerEditorNG::ComposerView(parent),
33  mCustomTools(0)
34 {
35  settings()->setFontSize ( QWebSettings::DefaultFontSize, 14 );
36 }
37 
38 BlogiloComposerView::~BlogiloComposerView()
39 {
40 
41 }
42 
43 void BlogiloComposerView::setCustomTools(PimCommon::CustomToolsWidget *customTool)
44 {
45  mCustomTools = customTool;
46 }
47 
48 void BlogiloComposerView::startEditing()
49 {
50  //NOTE: it needs a mouse click!
51  //any better way to make the cursor visible?
52  this -> setFocus();
53  QMouseEvent mouseEventPress ( QEvent::MouseButtonPress, QPoint ( 10,10 ), Qt::LeftButton, Qt::NoButton, Qt::NoModifier );
54  QApplication::sendEvent ( this, &mouseEventPress );
55  QTimer::singleShot ( 50, this, SLOT(slotSendMouseReleaseEvent()) );
56 }
57 
58 void BlogiloComposerView::slotSendMouseReleaseEvent()
59 {
60  QMouseEvent mouseEventRelease ( QEvent::MouseButtonRelease, QPoint ( 10,10 ), Qt::LeftButton, Qt::NoButton, Qt::NoModifier );
61  QApplication::sendEvent ( this, &mouseEventRelease );
62  pageAction( QWebPage::MoveToEndOfDocument )->trigger();
63 }
64 
65 void BlogiloComposerView::addExtraAction(QMenu *menu)
66 {
67  if (mCustomTools) {
68  menu->addSeparator();
69  menu->addAction(mCustomTools->action(PimCommon::CustomToolsWidget::TranslatorTool));
70  menu->addAction(mCustomTools->action(PimCommon::CustomToolsWidget::ShortUrlTool));
71  }
72 }
73 
QWidget
QMenu::addAction
void addAction(QAction *action)
QPoint
QMouseEvent
BlogiloComposerView::~BlogiloComposerView
~BlogiloComposerView()
Definition: blogilocomposerview.cpp:38
BlogiloComposerView::BlogiloComposerView
BlogiloComposerView(QWidget *parent=0)
Definition: blogilocomposerview.cpp:31
QCoreApplication::sendEvent
bool sendEvent(QObject *receiver, QEvent *event)
BlogiloComposerView::setCustomTools
void setCustomTools(PimCommon::CustomToolsWidget *customTool)
Definition: blogilocomposerview.cpp:43
BlogiloComposerView::startEditing
void startEditing()
Definition: blogilocomposerview.cpp:48
QMenu::addSeparator
QAction * addSeparator()
QMenu
blogilocomposerview.h
BlogiloComposerView::addExtraAction
virtual void addExtraAction(QMenu *menu)
Definition: blogilocomposerview.cpp:65
QTimer::singleShot
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:16 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
  • pimprint

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