• 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
blogilocomposerwidget.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 "blogilocomposerwidget.h"
22 #include "blogilocomposereditor.h"
23 #include "blogilocomposerview.h"
24 #include "pimcommon/translator/translatorwidget.h"
25 
26 #include <QVBoxLayout>
27 
28 BlogiloComposerWidget::BlogiloComposerWidget(BlogiloComposerView *view, QWidget *parent)
29  : QWidget(parent)
30 {
31  QVBoxLayout *lay = new QVBoxLayout;
32  lay->setMargin(0);
33  mEditor = new BlogiloComposerEditor(view, this);
34 
35  lay->addWidget(mEditor);
36  mCustomToolsWidget = new PimCommon::CustomToolsWidget;
37  connect(mCustomToolsWidget, SIGNAL(toolSwitched(PimCommon::CustomToolsWidget::ToolType)), this, SLOT(slotToolSwitched(PimCommon::CustomToolsWidget::ToolType)));
38  connect(mCustomToolsWidget, SIGNAL(insertShortUrl(QString)), this, SLOT(slotInsertShortUrl(QString)));
39  lay->addWidget(mCustomToolsWidget);
40  setLayout(lay);
41  view->setCustomTools(mCustomToolsWidget);
42 }
43 
44 BlogiloComposerWidget::~BlogiloComposerWidget()
45 {
46 
47 }
48 
49 BlogiloComposerEditor *BlogiloComposerWidget::editor() const
50 {
51  return mEditor;
52 }
53 
54 void BlogiloComposerWidget::slotToolSwitched(PimCommon::CustomToolsWidget::ToolType type)
55 {
56  if (type == PimCommon::CustomToolsWidget::TranslatorTool) {
57  const QString text = mEditor->view()->selectedText();
58  if(!text.isEmpty())
59  mCustomToolsWidget->translatorWidget()->setTextToTranslate(text);
60  }
61 }
62 
63 void BlogiloComposerWidget::slotInsertShortUrl(const QString &shortUrl)
64 {
65  mEditor->insertShortUrl(shortUrl);
66 }
QWidget
BlogiloComposerEditor
Definition: blogilocomposereditor.h:29
BlogiloComposerWidget::BlogiloComposerWidget
BlogiloComposerWidget(BlogiloComposerView *view, QWidget *parent=0)
Definition: blogilocomposerwidget.cpp:28
blogilocomposerwidget.h
BlogiloComposerEditor::insertShortUrl
void insertShortUrl(const QString &url)
Definition: blogilocomposereditor.cpp:177
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QWidget::setLayout
void setLayout(QLayout *layout)
blogilocomposereditor.h
QString::isEmpty
bool isEmpty() const
BlogiloComposerWidget::editor
BlogiloComposerEditor * editor() const
Definition: blogilocomposerwidget.cpp:49
BlogiloComposerView::setCustomTools
void setCustomTools(PimCommon::CustomToolsWidget *customTool)
Definition: blogilocomposerview.cpp:43
QVBoxLayout
BlogiloComposerView
Definition: blogilocomposerview.h:28
QString
QLayout::setMargin
void setMargin(int margin)
BlogiloComposerWidget::~BlogiloComposerWidget
~BlogiloComposerWidget()
Definition: blogilocomposerwidget.cpp:44
blogilocomposerview.h
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
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