Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE PIM Add-ons
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KDE PIM Add-ons
Commits
47bf5796
Commit
47bf5796
authored
Feb 10, 2016
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add zoomtext plugins
parent
3a17cf7b
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
390 additions
and
0 deletions
+390
-0
kmail/editorplugins/CMakeLists.txt
kmail/editorplugins/CMakeLists.txt
+1
-0
kmail/editorplugins/zoomtext/CMakeLists.txt
kmail/editorplugins/zoomtext/CMakeLists.txt
+17
-0
kmail/editorplugins/zoomtext/autotests/CMakeLists.txt
kmail/editorplugins/zoomtext/autotests/CMakeLists.txt
+13
-0
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditorinterfacetest.cpp
.../zoomtext/autotests/zoomtextplugineditorinterfacetest.cpp
+33
-0
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditorinterfacetest.h
...ns/zoomtext/autotests/zoomtextplugineditorinterfacetest.h
+31
-0
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditortest.cpp
...orplugins/zoomtext/autotests/zoomtextplugineditortest.cpp
+40
-0
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditortest.h
...itorplugins/zoomtext/autotests/zoomtextplugineditortest.h
+33
-0
kmail/editorplugins/zoomtext/kmail_zoomtexteditorplugin.json
kmail/editorplugins/zoomtext/kmail_zoomtexteditorplugin.json
+10
-0
kmail/editorplugins/zoomtext/zoomtextplugineditor.cpp
kmail/editorplugins/zoomtext/zoomtextplugineditor.cpp
+43
-0
kmail/editorplugins/zoomtext/zoomtextplugineditor.h
kmail/editorplugins/zoomtext/zoomtextplugineditor.h
+36
-0
kmail/editorplugins/zoomtext/zoomtextplugineditorinterface.cpp
.../editorplugins/zoomtext/zoomtextplugineditorinterface.cpp
+87
-0
kmail/editorplugins/zoomtext/zoomtextplugineditorinterface.h
kmail/editorplugins/zoomtext/zoomtextplugineditorinterface.h
+46
-0
No files found.
kmail/editorplugins/CMakeLists.txt
View file @
47bf5796
add_definitions
(
-DTRANSLATION_DOMAIN=\"kmail_editor_plugins\"
)
add_subdirectory
(
insertspecialcharacter
)
add_subdirectory
(
changecase
)
add_subdirectory
(
zoomtext
)
kmail/editorplugins/zoomtext/CMakeLists.txt
0 → 100644
View file @
47bf5796
set
(
kmail_zoomtexteditorplugin_SRCS
zoomtextplugineditor.cpp
zoomtextplugineditorinterface.cpp
)
add_library
(
kmail_zoomtexteditorplugin MODULE
${
kmail_zoomtexteditorplugin_SRCS
}
)
target_link_libraries
(
kmail_zoomtexteditorplugin
KF5::IconThemes KF5::MessageComposer KF5::XmlGui
)
install
(
TARGETS kmail_zoomtexteditorplugin DESTINATION
${
PLUGIN_INSTALL_DIR
}
/kmail
)
if
(
BUILD_TESTING
)
add_subdirectory
(
autotests
)
endif
()
kmail/editorplugins/zoomtext/autotests/CMakeLists.txt
0 → 100644
View file @
47bf5796
macro
(
add_kmail_editorplugin_unittest _source _additional
)
set
(
_test
${
_source
}
${
_additional
}
)
get_filename_component
(
_name
${
_source
}
NAME_WE
)
add_executable
(
${
_name
}
${
_test
}
)
add_test
(
${
_name
}
${
_name
}
)
ecm_mark_as_test
(
kmail_editorplugin-
${
_name
}
)
target_link_libraries
(
${
_name
}
Qt5::Test KF5::XmlGui KF5::IconThemes KF5::MessageComposer
)
endmacro
()
add_kmail_editorplugin_unittest
(
zoomtextplugineditortest.cpp
"../zoomtextplugineditor.cpp;../zoomtextplugineditorinterface.cpp"
)
add_kmail_editorplugin_unittest
(
zoomtextplugineditorinterfacetest.cpp
"../zoomtextplugineditorinterface.cpp"
)
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditorinterfacetest.cpp
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "zoomtextplugineditorinterfacetest.h"
#include "../zoomtextplugineditorinterface.h"
#include <QTest>
ZoomTextPluginEditorInterfaceTest
::
ZoomTextPluginEditorInterfaceTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
ZoomTextPluginEditorInterfaceTest
::~
ZoomTextPluginEditorInterfaceTest
()
{
}
QTEST_MAIN
(
ZoomTextPluginEditorInterfaceTest
)
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditorinterfacetest.h
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ZoomTextPLUGINEDITORINTERFACETEST_H
#define ZoomTextPLUGINEDITORINTERFACETEST_H
#include <QObject>
class
ZoomTextPluginEditorInterfaceTest
:
public
QObject
{
Q_OBJECT
public:
explicit
ZoomTextPluginEditorInterfaceTest
(
QObject
*
parent
=
Q_NULLPTR
);
~
ZoomTextPluginEditorInterfaceTest
();
};
#endif
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditortest.cpp
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "zoomtextplugineditortest.h"
#include "../zoomtextplugineditor.h"
#include <KActionCollection>
#include <QTest>
ZoomTextPluginEditorTest
::
ZoomTextPluginEditorTest
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
ZoomTextPluginEditorTest
::~
ZoomTextPluginEditorTest
()
{
}
void
ZoomTextPluginEditorTest
::
shouldHaveDefaultValue
()
{
ZoomTextPluginEditor
plugin
;
QVERIFY
(
plugin
.
createInterface
(
new
KActionCollection
(
this
)));
}
QTEST_MAIN
(
ZoomTextPluginEditorTest
)
kmail/editorplugins/zoomtext/autotests/zoomtextplugineditortest.h
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ZoomTextPLUGINEDITORTEST_H
#define ZoomTextPLUGINEDITORTEST_H
#include <QObject>
class
ZoomTextPluginEditorTest
:
public
QObject
{
Q_OBJECT
public:
explicit
ZoomTextPluginEditorTest
(
QObject
*
parent
=
Q_NULLPTR
);
~
ZoomTextPluginEditorTest
();
private
Q_SLOTS
:
void
shouldHaveDefaultValue
();
};
#endif
kmail/editorplugins/zoomtext/kmail_zoomtexteditorplugin.json
0 → 100644
View file @
47bf5796
{
"KPlugin"
:
{
"Name"
:
"Zoom Text"
,
"ServiceTypes"
:
[
"KMailEditor/Plugin"
],
"Version"
:
"1.0"
},
"X-KDE-KMailEditor-Order"
:
"2"
}
kmail/editorplugins/zoomtext/zoomtextplugineditor.cpp
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "zoomtextplugineditor.h"
#include "zoomtextplugineditorinterface.h"
#include <KLocalizedString>
#include <kpluginfactory.h>
K_PLUGIN_FACTORY_WITH_JSON
(
ZoomTextPluginEditorFactory
,
"kmail_zoomtexteditorplugin.json"
,
registerPlugin
<
ZoomTextPluginEditor
>
();)
ZoomTextPluginEditor
::
ZoomTextPluginEditor
(
QObject
*
parent
,
const
QList
<
QVariant
>
&
)
:
MessageComposer
::
PluginEditor
(
parent
)
{
}
ZoomTextPluginEditor
::~
ZoomTextPluginEditor
()
{
}
MessageComposer
::
PluginEditorInterface
*
ZoomTextPluginEditor
::
createInterface
(
KActionCollection
*
ac
,
QObject
*
parent
)
{
ZoomTextPluginEditorInterface
*
interface
=
new
ZoomTextPluginEditorInterface
(
parent
);
interface
->
createAction
(
ac
);
return
interface
;
}
#include "zoomtextplugineditor.moc"
kmail/editorplugins/zoomtext/zoomtextplugineditor.h
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ZOOMTEXTPLUGINEDITOR_H
#define ZOOMTEXTPLUGINEDITOR_H
#include <messagecomposer/plugineditor.h>
#include <messagecomposer/plugineditorinterface.h>
#include <QVariant>
class
ZoomTextPluginEditor
:
public
MessageComposer
::
PluginEditor
{
Q_OBJECT
public:
explicit
ZoomTextPluginEditor
(
QObject
*
parent
=
Q_NULLPTR
,
const
QList
<
QVariant
>
&
=
QList
<
QVariant
>
());
~
ZoomTextPluginEditor
();
MessageComposer
::
PluginEditorInterface
*
createInterface
(
KActionCollection
*
ac
,
QObject
*
parent
=
Q_NULLPTR
)
Q_DECL_OVERRIDE
;
};
#endif
kmail/editorplugins/zoomtext/zoomtextplugineditorinterface.cpp
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "zoomtextplugineditorinterface.h"
#include <KPIMTextEdit/RichTextEditor>
#include <KLocalizedString>
#include <KActionCollection>
#include <QAction>
#include <QDebug>
ZoomTextPluginEditorInterface
::
ZoomTextPluginEditorInterface
(
QObject
*
parent
)
:
MessageComposer
::
PluginEditorInterface
(
parent
),
mType
(
Unknown
)
{
}
ZoomTextPluginEditorInterface
::~
ZoomTextPluginEditorInterface
()
{
}
bool
ZoomTextPluginEditorInterface
::
hasPopupMenuSupport
()
const
{
return
false
;
}
void
ZoomTextPluginEditorInterface
::
createAction
(
KActionCollection
*
ac
)
{
#if 0
PimCommon::KActionMenuZoomText *ZoomTextMenu = new PimCommon::KActionMenuZoomText(this);
ZoomTextMenu->appendInActionCollection(ac);
ac->addAction(QStringLiteral("change_case_menu"), ZoomTextMenu);
connect(ZoomTextMenu, &PimCommon::KActionMenuZoomText::upperCase, this, &ZoomTextPluginEditorInterface::slotUpperCase);
connect(ZoomTextMenu, &PimCommon::KActionMenuZoomText::lowerCase, this, &ZoomTextPluginEditorInterface::slotLowerCase);
connect(ZoomTextMenu, &PimCommon::KActionMenuZoomText::sentenceCase, this, &ZoomTextPluginEditorInterface::slotSentenceCase);
connect(ZoomTextMenu, &PimCommon::KActionMenuZoomText::reverseCase, this, &ZoomTextPluginEditorInterface::slotReverseCase);
MessageComposer::ActionType type(ZoomTextMenu, MessageComposer::ActionType::Edit);
setActionType(type);
#endif
}
void
ZoomTextPluginEditorInterface
::
exec
()
{
#if 0
switch(mType) {
case Unknown:
qDebug() << " There is an error here. We can't call this plugin with unknown type";
break;
case UpperCase:
upperCase();
break;
case LowerCase:
lowerCase();
break;
case SentenseCase:
sentenceCase();
break;
case ReverseCase:
reverseCase();
break;
}
#endif
}
#if 0
void ZoomTextPluginEditorInterface::slotReverseCase()
{
mType = ReverseCase;
Q_EMIT emitPluginActivated(this);
}
#endif
kmail/editorplugins/zoomtext/zoomtextplugineditorinterface.h
0 → 100644
View file @
47bf5796
/*
Copyright (c) 2016 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ZOOMTEXTPLUGINEDITORINTERFACE_H
#define ZOOMTEXTPLUGINEDITORINTERFACE_H
#include <messagecomposer/plugineditorinterface.h>
#include <QPointer>
class
ZoomTextPluginEditorInterface
:
public
MessageComposer
::
PluginEditorInterface
{
Q_OBJECT
public:
explicit
ZoomTextPluginEditorInterface
(
QObject
*
parent
=
Q_NULLPTR
);
~
ZoomTextPluginEditorInterface
();
void
createAction
(
KActionCollection
*
ac
)
Q_DECL_OVERRIDE
;
void
exec
()
Q_DECL_OVERRIDE
;
bool
hasPopupMenuSupport
()
const
Q_DECL_OVERRIDE
;
private:
enum
ZoomTextType
{
Unknown
=
-
1
,
Reset
=
0
,
ZoomIn
,
ZoomOut
};
ZoomTextType
mType
;
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment