jovie: remove it
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
|
@ -19,7 +19,6 @@ kde4_optional_add_subdirectory(about-distro)
|
|||
kde4_optional_add_subdirectory(ark)
|
||||
kde4_optional_add_subdirectory(filelight)
|
||||
kde4_optional_add_subdirectory(gwenview)
|
||||
kde4_optional_add_subdirectory(jovie)
|
||||
kde4_optional_add_subdirectory(kcalc)
|
||||
kde4_optional_add_subdirectory(kcolorchooser)
|
||||
kde4_optional_add_subdirectory(kcron)
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
José Pablo Ezequiel Fernández <pupeno@pupeno.com>
|
||||
Gary Cramblitt <garycramblitt@comcast.net>
|
||||
Gunnar Schmi Dt <gunnar@schmi-dt.de>
|
||||
Olaf Schmidt <ojschmidt@kde.org>
|
||||
Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
Jeremy Whiting <jpwhiting@kde.org>
|
|
@ -1,42 +0,0 @@
|
|||
project(kttsd)
|
||||
|
||||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
find_package(KDE4 4.22.0 REQUIRED)
|
||||
include(KDE4Defaults)
|
||||
include_directories(${KDE4_INCLUDES})
|
||||
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
|
||||
endif()
|
||||
|
||||
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
|
||||
|
||||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
find_package(Speechd)
|
||||
set_package_properties(Speechd PROPERTIES
|
||||
URL "http://www.freebsoft.org/speechd"
|
||||
DESCRIPTION "Speech Dispatcher provides a high-level device independent layer for speech synthesis"
|
||||
PURPOSE "Jovie requires speech dispatcher."
|
||||
TYPE REQUIRED
|
||||
)
|
||||
|
||||
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc)
|
||||
add_feature_info(xsltproc
|
||||
XSLTPROC_EXECUTABLE
|
||||
"SSML support in Jovie"
|
||||
)
|
||||
|
||||
if(NOT Q_WS_X11)
|
||||
message(FATAL_ERROR "Jovie requires a X11-based system.")
|
||||
endif()
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_CURRENT_BINARY_DIR}/libkttsd
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/libkttsd
|
||||
)
|
||||
|
||||
add_subdirectory(libkttsd)
|
||||
add_subdirectory(filters)
|
||||
add_subdirectory(jovie)
|
||||
add_subdirectory(kcmkttsmgr)
|
||||
add_subdirectory(icons)
|
346
jovie/COPYING
|
@ -1,346 +0,0 @@
|
|||
NOTE! The GPL below is copyrighted by the Free Software Foundation, but
|
||||
the instance of code that it refers to (the kde programs) are copyrighted
|
||||
by the authors who actually wrote it.
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
|
@ -1,397 +0,0 @@
|
|||
GNU Free Documentation License
|
||||
Version 1.2, November 2002
|
||||
|
||||
|
||||
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
|
||||
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
0. PREAMBLE
|
||||
|
||||
The purpose of this License is to make a manual, textbook, or other
|
||||
functional and useful document "free" in the sense of freedom: to
|
||||
assure everyone the effective freedom to copy and redistribute it,
|
||||
with or without modifying it, either commercially or noncommercially.
|
||||
Secondarily, this License preserves for the author and publisher a way
|
||||
to get credit for their work, while not being considered responsible
|
||||
for modifications made by others.
|
||||
|
||||
This License is a kind of "copyleft", which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft
|
||||
license designed for free software.
|
||||
|
||||
We have designed this License in order to use it for manuals for free
|
||||
software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals;
|
||||
it can be used for any textual work, regardless of subject matter or
|
||||
whether it is published as a printed book. We recommend this License
|
||||
principally for works whose purpose is instruction or reference.
|
||||
|
||||
|
||||
1. APPLICABILITY AND DEFINITIONS
|
||||
|
||||
This License applies to any manual or other work, in any medium, that
|
||||
contains a notice placed by the copyright holder saying it can be
|
||||
distributed under the terms of this License. Such a notice grants a
|
||||
world-wide, royalty-free license, unlimited in duration, to use that
|
||||
work under the conditions stated herein. The "Document", below,
|
||||
refers to any such manual or work. Any member of the public is a
|
||||
licensee, and is addressed as "you". You accept the license if you
|
||||
copy, modify or distribute the work in a way requiring permission
|
||||
under copyright law.
|
||||
|
||||
A "Modified Version" of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.
|
||||
|
||||
A "Secondary Section" is a named appendix or a front-matter section of
|
||||
the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall subject
|
||||
(or to related matters) and contains nothing that could fall directly
|
||||
within that overall subject. (Thus, if the Document is in part a
|
||||
textbook of mathematics, a Secondary Section may not explain any
|
||||
mathematics.) The relationship could be a matter of historical
|
||||
connection with the subject or with related matters, or of legal,
|
||||
commercial, philosophical, ethical or political position regarding
|
||||
them.
|
||||
|
||||
The "Invariant Sections" are certain Secondary Sections whose titles
|
||||
are designated, as being those of Invariant Sections, in the notice
|
||||
that says that the Document is released under this License. If a
|
||||
section does not fit the above definition of Secondary then it is not
|
||||
allowed to be designated as Invariant. The Document may contain zero
|
||||
Invariant Sections. If the Document does not identify any Invariant
|
||||
Sections then there are none.
|
||||
|
||||
The "Cover Texts" are certain short passages of text that are listed,
|
||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||
the Document is released under this License. A Front-Cover Text may
|
||||
be at most 5 words, and a Back-Cover Text may be at most 25 words.
|
||||
|
||||
A "Transparent" copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the
|
||||
general public, that is suitable for revising the document
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or
|
||||
for automatic translation to a variety of formats suitable for input
|
||||
to text formatters. A copy made in an otherwise Transparent file
|
||||
format whose markup, or absence of markup, has been arranged to thwart
|
||||
or discourage subsequent modification by readers is not Transparent.
|
||||
An image format is not Transparent if used for any substantial amount
|
||||
of text. A copy that is not "Transparent" is called "Opaque".
|
||||
|
||||
Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, LaTeX input format, SGML
|
||||
or XML using a publicly available DTD, and standard-conforming simple
|
||||
HTML, PostScript or PDF designed for human modification. Examples of
|
||||
transparent image formats include PNG, XCF and JPG. Opaque formats
|
||||
include proprietary formats that can be read and edited only by
|
||||
proprietary word processors, SGML or XML for which the DTD and/or
|
||||
processing tools are not generally available, and the
|
||||
machine-generated HTML, PostScript or PDF produced by some word
|
||||
processors for output purposes only.
|
||||
|
||||
The "Title Page" means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in
|
||||
formats which do not have any title page as such, "Title Page" means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
A section "Entitled XYZ" means a named subunit of the Document whose
|
||||
title either is precisely XYZ or contains XYZ in parentheses following
|
||||
text that translates XYZ in another language. (Here XYZ stands for a
|
||||
specific section name mentioned below, such as "Acknowledgements",
|
||||
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
|
||||
of such a section when you modify the Document means that it remains a
|
||||
section "Entitled XYZ" according to this definition.
|
||||
|
||||
The Document may include Warranty Disclaimers next to the notice which
|
||||
states that this License applies to the Document. These Warranty
|
||||
Disclaimers are considered to be included by reference in this
|
||||
License, but only as regards disclaiming warranties: any other
|
||||
implication that these Warranty Disclaimers may have is void and has
|
||||
no effect on the meaning of this License.
|
||||
|
||||
|
||||
2. VERBATIM COPYING
|
||||
|
||||
You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies
|
||||
to the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use
|
||||
technical measures to obstruct or control the reading or further
|
||||
copying of the copies you make or distribute. However, you may accept
|
||||
compensation in exchange for copies. If you distribute a large enough
|
||||
number of copies you must also follow the conditions in section 3.
|
||||
|
||||
You may also lend copies, under the same conditions stated above, and
|
||||
you may publicly display copies.
|
||||
|
||||
|
||||
3. COPYING IN QUANTITY
|
||||
|
||||
If you publish printed copies (or copies in media that commonly have
|
||||
printed covers) of the Document, numbering more than 100, and the
|
||||
Document's license notice requires Cover Texts, you must enclose the
|
||||
copies in covers that carry, clearly and legibly, all these Cover
|
||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||
the back cover. Both covers must also clearly and legibly identify
|
||||
you as the publisher of these copies. The front cover must present
|
||||
the full title with all words of the title equally prominent and
|
||||
visible. You may add other material on the covers in addition.
|
||||
Copying with changes limited to the covers, as long as they preserve
|
||||
the title of the Document and satisfy these conditions, can be treated
|
||||
as verbatim copying in other respects.
|
||||
|
||||
If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||
pages.
|
||||
|
||||
If you publish or distribute Opaque copies of the Document numbering
|
||||
more than 100, you must either include a machine-readable Transparent
|
||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||
a computer-network location from which the general network-using
|
||||
public has access to download using public-standard network protocols
|
||||
a complete Transparent copy of the Document, free of added material.
|
||||
If you use the latter option, you must take reasonably prudent steps,
|
||||
when you begin distribution of Opaque copies in quantity, to ensure
|
||||
that this Transparent copy will remain thus accessible at the stated
|
||||
location until at least one year after the last time you distribute an
|
||||
Opaque copy (directly or through your agents or retailers) of that
|
||||
edition to the public.
|
||||
|
||||
It is requested, but not required, that you contact the authors of the
|
||||
Document well before redistributing any large number of copies, to give
|
||||
them a chance to provide you with an updated version of the Document.
|
||||
|
||||
|
||||
4. MODIFICATIONS
|
||||
|
||||
You may copy and distribute a Modified Version of the Document under
|
||||
the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
|
||||
A. Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
of the Document). You may use the same title as a previous version
|
||||
if the original publisher of that version gives permission.
|
||||
B. List on the Title Page, as authors, one or more persons or entities
|
||||
responsible for authorship of the modifications in the Modified
|
||||
Version, together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has fewer than five),
|
||||
unless they release you from this requirement.
|
||||
C. State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.
|
||||
D. Preserve all the copyright notices of the Document.
|
||||
E. Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.
|
||||
F. Include, immediately after the copyright notices, a license notice
|
||||
giving the public permission to use the Modified Version under the
|
||||
terms of this License, in the form shown in the Addendum below.
|
||||
G. Preserve in that license notice the full lists of Invariant Sections
|
||||
and required Cover Texts given in the Document's license notice.
|
||||
H. Include an unaltered copy of this License.
|
||||
I. Preserve the section Entitled "History", Preserve its Title, and add
|
||||
to it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section Entitled "History" in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.
|
||||
J. Preserve the network location, if any, given in the Document for
|
||||
public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions
|
||||
it was based on. These may be placed in the "History" section.
|
||||
You may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.
|
||||
K. For any section Entitled "Acknowledgements" or "Dedications",
|
||||
Preserve the Title of the section, and preserve in the section all
|
||||
the substance and tone of each of the contributor acknowledgements
|
||||
and/or dedications given therein.
|
||||
L. Preserve all the Invariant Sections of the Document,
|
||||
unaltered in their text and in their titles. Section numbers
|
||||
or the equivalent are not considered part of the section titles.
|
||||
M. Delete any section Entitled "Endorsements". Such a section
|
||||
may not be included in the Modified Version.
|
||||
N. Do not retitle any existing section to be Entitled "Endorsements"
|
||||
or to conflict in title with any Invariant Section.
|
||||
O. Preserve any Warranty Disclaimers.
|
||||
|
||||
If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all
|
||||
of these sections as invariant. To do this, add their titles to the
|
||||
list of Invariant Sections in the Modified Version's license notice.
|
||||
These titles must be distinct from any other section titles.
|
||||
|
||||
You may add a section Entitled "Endorsements", provided it contains
|
||||
nothing but endorsements of your Modified Version by various
|
||||
parties--for example, statements of peer review or that the text has
|
||||
been approved by an organization as the authoritative definition of a
|
||||
standard.
|
||||
|
||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||
of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||
through arrangements made by) any one entity. If the Document already
|
||||
includes a cover text for the same cover, previously added by you or
|
||||
by arrangement made by the same entity you are acting on behalf of,
|
||||
you may not add another; but you may replace the old one, on explicit
|
||||
permission from the previous publisher that added the old one.
|
||||
|
||||
The author(s) and publisher(s) of the Document do not by this License
|
||||
give permission to use their names for publicity for or to assert or
|
||||
imply endorsement of any Modified Version.
|
||||
|
||||
|
||||
5. COMBINING DOCUMENTS
|
||||
|
||||
You may combine the Document with other documents released under this
|
||||
License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and
|
||||
list them all as Invariant Sections of your combined work in its
|
||||
license notice, and that you preserve all their Warranty Disclaimers.
|
||||
|
||||
The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single
|
||||
copy. If there are multiple Invariant Sections with the same name but
|
||||
different contents, make the title of each such section unique by
|
||||
adding at the end of it, in parentheses, the name of the original
|
||||
author or publisher of that section if known, or else a unique number.
|
||||
Make the same adjustment to the section titles in the list of
|
||||
Invariant Sections in the license notice of the combined work.
|
||||
|
||||
In the combination, you must combine any sections Entitled "History"
|
||||
in the various original documents, forming one section Entitled
|
||||
"History"; likewise combine any sections Entitled "Acknowledgements",
|
||||
and any sections Entitled "Dedications". You must delete all sections
|
||||
Entitled "Endorsements".
|
||||
|
||||
|
||||
6. COLLECTIONS OF DOCUMENTS
|
||||
|
||||
You may make a collection consisting of the Document and other documents
|
||||
released under this License, and replace the individual copies of this
|
||||
License in the various documents with a single copy that is included in
|
||||
the collection, provided that you follow the rules of this License for
|
||||
verbatim copying of each of the documents in all other respects.
|
||||
|
||||
You may extract a single document from such a collection, and distribute
|
||||
it individually under this License, provided you insert a copy of this
|
||||
License into the extracted document, and follow this License in all
|
||||
other respects regarding verbatim copying of that document.
|
||||
|
||||
|
||||
7. AGGREGATION WITH INDEPENDENT WORKS
|
||||
|
||||
A compilation of the Document or its derivatives with other separate
|
||||
and independent documents or works, in or on a volume of a storage or
|
||||
distribution medium, is called an "aggregate" if the copyright
|
||||
resulting from the compilation is not used to limit the legal rights
|
||||
of the compilation's users beyond what the individual works permit.
|
||||
When the Document is included in an aggregate, this License does not
|
||||
apply to the other works in the aggregate which are not themselves
|
||||
derivative works of the Document.
|
||||
|
||||
If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one half of
|
||||
the entire aggregate, the Document's Cover Texts may be placed on
|
||||
covers that bracket the Document within the aggregate, or the
|
||||
electronic equivalent of covers if the Document is in electronic form.
|
||||
Otherwise they must appear on printed covers that bracket the whole
|
||||
aggregate.
|
||||
|
||||
|
||||
8. TRANSLATION
|
||||
|
||||
Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include
|
||||
translations of some or all Invariant Sections in addition to the
|
||||
original versions of these Invariant Sections. You may include a
|
||||
translation of this License, and all the license notices in the
|
||||
Document, and any Warranty Disclaimers, provided that you also include
|
||||
the original English version of this License and the original versions
|
||||
of those notices and disclaimers. In case of a disagreement between
|
||||
the translation and the original version of this License or a notice
|
||||
or disclaimer, the original version will prevail.
|
||||
|
||||
If a section in the Document is Entitled "Acknowledgements",
|
||||
"Dedications", or "History", the requirement (section 4) to Preserve
|
||||
its Title (section 1) will typically require changing the actual
|
||||
title.
|
||||
|
||||
|
||||
9. TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document is void, and will
|
||||
automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
|
||||
10. FUTURE REVISIONS OF THIS LICENSE
|
||||
|
||||
The Free Software Foundation may publish new, revised versions
|
||||
of the GNU Free Documentation License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns. See
|
||||
http://www.gnu.org/copyleft/.
|
||||
|
||||
Each version of the License is given a distinguishing version number.
|
||||
If the Document specifies that a particular numbered version of this
|
||||
License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation.
|
||||
|
||||
|
||||
ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
license notices just after the title page:
|
||||
|
||||
Copyright (c) YEAR YOUR NAME.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.2
|
||||
or any later version published by the Free Software Foundation;
|
||||
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
|
||||
replace the "with...Texts." line with this:
|
||||
|
||||
with the Invariant Sections being LIST THEIR TITLES, with the
|
||||
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
|
||||
|
||||
If you have Invariant Sections without Cover Texts, or some other
|
||||
combination of the three, merge those two alternatives to suit the
|
||||
situation.
|
||||
|
||||
If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of
|
||||
free software license, such as the GNU General Public License,
|
||||
to permit their use in free software.
|
|
@ -1,11 +0,0 @@
|
|||
/** \file kdeaccessibility/jovie/Mainpage.dox
|
||||
\brief The main page of the doxygen generated API Documentation
|
||||
*/
|
||||
/** @mainpage Jovie
|
||||
|
||||
Jovie brings text-to-speech KDE.
|
||||
\section Introduction Introduction
|
||||
|
||||
Jovie -- The KDE Text-to-Speech Application -- is a subsystem within the KDE desktop for conversion of text to audible speech. Jovie is currently under development and aims to become the standard subsystem for all KDE applications to provide speech output.
|
||||
|
||||
*/
|
|
@ -1,6 +0,0 @@
|
|||
#! /usr/bin/env bash
|
||||
|
||||
$EXTRACTRC */*.rc */*/*.rc >> rc.cpp || exit 11
|
||||
$EXTRACTRC */*.ui */*/*.ui >> rc.cpp || exit 12
|
||||
$XGETTEXT rc.cpp */*.cpp */*.h */*/*.cpp */*/*.h -o $podir/jovie.pot
|
||||
rm -f rc.cpp
|
95
jovie/README
|
@ -1,95 +0,0 @@
|
|||
Jovie -- KDE Text-to-Speech -- is a subsystem within the KDE desktop
|
||||
for conversion of text to audible speech. Jovie is currently under
|
||||
development and aims to become the standard subsystem for all KDE
|
||||
applications to provide speech output. Currently, Jovie consists of
|
||||
the following components:
|
||||
|
||||
Jovie
|
||||
The KDE Text-to-Speech Deamon, a system tray application that runs in
|
||||
the background, providing TTS support to KDE applications. Applications
|
||||
initiate TTS by making D-Bus calls to Jovie.
|
||||
|
||||
kttsjobmgr
|
||||
A KPart for managing in-progress speech jobs.
|
||||
|
||||
kcmkttsd
|
||||
A KControl module for configuring the KTTS System. kcmkttsd runs in the
|
||||
KDE Control Center or start it with the command "kcmshell4 kcmkttsd".
|
||||
|
||||
ktexteditor_kttsd
|
||||
A plugin for the KDE Advanced Text Editor that permits you to speak an entire
|
||||
text file or any portion of a file.
|
||||
|
||||
khmtl-plugin
|
||||
A plugin for Konqueror that permits you to speak all or any portion of an
|
||||
HTML web page. (Note: this component is in kdebase/konqueror/kttsplugin)
|
||||
|
||||
Original Author: José Pablo Ezequiel "Pupeno" Fernández <pupeno@kde.org>
|
||||
Current Maintainer: Jeremy Whiting <jpwhiting@kde.org>
|
||||
Contributors:
|
||||
Olaf Schmidt <ojschmidt@kde.org>
|
||||
Gunnar Schmi Dt <gunnar@schmi-dt.de>
|
||||
Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
Jorge Luis Arzola <arzolacub@hotmail.com>
|
||||
David Powell <achiestdragon@gmail.com>
|
||||
|
||||
User features:
|
||||
* Speak contents of a text file.
|
||||
* Speak KDE notification events (KNotify).
|
||||
* Speak all or part of the text of a web page in Konqueror.
|
||||
* Speak all or part of the text in Kate text editor, including
|
||||
instances where Kate is embedded in another KDE application.
|
||||
* Filter plugins for converting chat emoticons to speakable words,
|
||||
fix mispronunciations, and convert xhtml to SSML.
|
||||
|
||||
Programmer features:
|
||||
* Priority system for screen reader outputs, warnings and messages,
|
||||
while still playing regular texts.
|
||||
* Plugin-based architecture for support of a wide variety of speech
|
||||
synthesis engines and drivers.
|
||||
* Permit generation of speech from the command line (or via shell scripts)
|
||||
using the KDE D-Bus utilities.
|
||||
* Provide a lightweight and easily usable interface for applications
|
||||
to generate speech output.
|
||||
* Applications need not be concerned about contention over the speech device.
|
||||
* FUTURE: Provide support for speech markup languages, such as VoiceXML, Sable,
|
||||
Java Speech Markup Language (JSML), and Speech Markup Meta-language (SMML).
|
||||
* FUTURE: Provide limited support for embedded speech markers.
|
||||
* Asynchronous to prevent system blocking.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
KDE 3.2 or greater and a speech synthesis engine, such as Festival. Festival
|
||||
can be obtained from http://www.cstr.ed.ac.uk/projects/festival/. Festival
|
||||
is distributed with most Linux distros. Check your distro CDs. Also works
|
||||
with Hadifix, Epos, Festival Lite (flite), FreeTTS, or any command that can
|
||||
speak text.
|
||||
|
||||
Optional Components
|
||||
-------------------
|
||||
* The xsltproc utility is needed for SSML support.
|
||||
|
||||
See the Jovie Handbook
|
||||
|
||||
(http://accessibility.kde.org/developer/kttsd/handbook/index.html)
|
||||
|
||||
for complete instructions on installing, compiling, configuring, and using
|
||||
Jovie.
|
||||
|
||||
Support
|
||||
-------
|
||||
The Jovie website is
|
||||
|
||||
http://accessibility.kde.org/developer/kttsd
|
||||
|
||||
In addition to the KDE Bugzilla database (bugs.kde.org), discussions for KTTSD
|
||||
currently take place in the kde-accessibility mailing list. Subscribe at
|
||||
https://mail.kde.org/mailman/listinfo/kde-accessibility. Developers
|
||||
also hang out in IRC (irc.kde.org channel #kde-accessibility).
|
||||
|
||||
Directories
|
||||
-----------
|
||||
libkttsd Library for KTTSD. Defines the interface for plugins for KTTSD. Must be built second.
|
||||
jovie Application for managing Speech jobs. Wrapper for kcmkttsmgr plus a system tray icon.
|
||||
icons Icon for kttsmgr and KTTSD.
|
||||
kcmkttsmgr A KControl module for managing KTTSD. Run using "kcmshell kcmkttsd".
|
|
@ -1,10 +0,0 @@
|
|||
Where is KTTSD?
|
||||
|
||||
KTTSD was moved on 20 Dec 2004.
|
||||
Most of it has moved to kdeaccessibility/kttsd.
|
||||
The following pieces were also moved.
|
||||
|
||||
kttsd/libktts -> kdelibs/interfaces/kspeech
|
||||
kttsd/app-plugins/khtml-plugin -> kdebase/konqueror/kttsplugin
|
||||
kttsd/app-plugins/kate-plugin -> kdebase/kate/plugins/ktts
|
||||
kttsd/app-plugins/katepart-plugin -> kdebase/kate/plugin/katepartktts
|
86
jovie/TODO
|
@ -1,86 +0,0 @@
|
|||
_ A GPLed French language synth is available at
|
||||
http://www.cam.org/~nico/cicero
|
||||
|
||||
_ Possible bug. "<" characters not being properly stored in the .xml file?
|
||||
|
||||
_ DBUS Interface
|
||||
_ Refactor so that each job is an object and emits signals from
|
||||
object path /org/kde/KSpeechJob_NN. Apps can receive these signals
|
||||
using
|
||||
|
||||
QDBus::sessionBus().connect("org.kde.kttsd", QString(),
|
||||
"org.kde.KSpeechJob", "signalname", this, SLOT(slotName()));
|
||||
|
||||
Thiago tells me that the QString() for object path name will
|
||||
filter on all objects with interface org.kde.KSpeechJob.
|
||||
This is because QtDBus receives all signals.
|
||||
|
||||
<thiago> right now, I gave it only two rules: "all signals"
|
||||
and "everything whose destination is me"
|
||||
|
||||
and then filters on what the connect specifies.
|
||||
Once in place, the only signals emitted by KSpeech will be
|
||||
kttsdStarted and kttsdExiting. Everything else will come
|
||||
from the jobs. In theory, this means that apps that aren't
|
||||
interesting in tracking jobs don't need to receive those events,
|
||||
but OTOH, if an app is receiving any events, then it
|
||||
chances are it is interested in most/all of the events.
|
||||
The only real advantage to this change is that apps that are
|
||||
interesting in tracking only a single job can receive those
|
||||
signals and don't have to check the appId (assuming they
|
||||
created the job in the first place). Is this advantage
|
||||
worth the pain of refactoring kttsd? Thoughts:
|
||||
_ I want to make everything (text, messages, warnings, and SR)
|
||||
jobs so that KttsJobMgr can track all speech.
|
||||
_ There's already an mlTextJob structure, so converting that
|
||||
to an object won't be that hard.
|
||||
|
||||
_ Add setFriendlyName(QString &name) to interface and
|
||||
QString getFriendlyName(QString &appId) so that friendly names
|
||||
can be displayed in KttsJobMgr.
|
||||
|
||||
<thiago> hint: connect to the nameOwnerChange signal from
|
||||
QDBus::sessionBus().busService() to find out when the application
|
||||
:1.120 goes away, so that you can release the resource
|
||||
|
||||
KDE4 above this line
|
||||
-------------------------------------------------------------------------
|
||||
_ Filters:
|
||||
_ XHTMLtoSSML stylesheet needs work to provide better mappings for most web pages.
|
||||
_ Add KNewStuff capability for folks to upload/download filter configs.
|
||||
_ There should be a default set of filters configured when user first runs KTTSMgr.
|
||||
If user presses Default button, it should ask user whether to replace all existing
|
||||
filters with the standard set. The standard set should probably include
|
||||
the Qt to Plain Text and Fix Festival Unspeakable Characters filters, but I'm not
|
||||
sure about the latter when desktop is not ISO 8859-1.
|
||||
|
||||
_ Handbook:
|
||||
_ Mention that "Root element is" and "DOCTYPE" are case sensitive. "html" is not
|
||||
the same as "HTML". It should stay this way, BTW. Proper xhtml requires lowercase
|
||||
tags.
|
||||
_ KTTSMgr:
|
||||
_ Speech is paused when showing tooltip when mouse cursor is placed over tray icon.
|
||||
_ Add ability to quickly pick default Talker in systray menu.
|
||||
_ Add drag N drop for the Talkers so it is easier to change the ordering.
|
||||
_ It is possible to configure multiple instances of Talkers with the exact same configuration.
|
||||
_ In kcmkttsmgr, use setHelp() to set help anchor based on current tab.
|
||||
_ Add playback controls to kttsmgr. Volume, pause. Maybe rewind?
|
||||
_ KTTSD:
|
||||
_ I am told that when kttsd crashes, it can take knotify down with it. See about
|
||||
"disconnecting" knotify from kttsd (using post to Qt event queue).
|
||||
_ While kttsd currently configures a Talker automatically, would be nice if it could
|
||||
autoconfigure talkers for each requested language, if one has not already been configured.
|
||||
_ Add support for speech markers.
|
||||
_ Implement error signal handling in KTTSD.
|
||||
_ Add support for JSML and other Speech Markup languages.
|
||||
_ Add method for apps to play a sound file, including in the middle of a job.
|
||||
Could be done with SSML or with special Talker Code = "sound".
|
||||
_ Other/General:
|
||||
_ Save buttons should confirm if user chooses an existing file. KFileDialog doesn't seem to
|
||||
offer this option, but shouldn't it?
|
||||
_ .desktop files must have a Type keyword, but what to use for kcmkttsd_testmessage.desktop?
|
||||
_ Convert to KConfig XT.
|
||||
_ Add a plugin for TuxTalk, http://tuxtalk.sourceforge.net/. Since it only supports
|
||||
English (at the moment) and is alpha, don't think it is worth it now.
|
||||
_ IBM ViaVoice speech-dispatcher plugin?
|
||||
_ Add KTTS plugin to aKregator.
|
|
@ -1,31 +0,0 @@
|
|||
The <a href="http://accessibility.kde.org/developer/kttsd/index.php">KDE Text-to-Speech System</a> currently supports the following languages via non-commercial TTS systems and voices on the Linux platform:
|
||||
|
||||
American English
|
||||
British
|
||||
Spanish
|
||||
German
|
||||
Finnish
|
||||
Czech
|
||||
Polish
|
||||
Russian
|
||||
Italian
|
||||
Kiswahili
|
||||
Zulu
|
||||
Ibibio
|
||||
|
||||
Notably absent from this list is French (French Canadian voices can be purchased from <a href="http://www.cepstral.com">Cepstral LLC</a>). This is a damn shame.
|
||||
|
||||
If you are French speaking, your mission, should you choose to accept it, is to develop a free and easy-to-install French language package for KTTS on the Linux platform. There are several possible ways this could be done:
|
||||
|
||||
1. MBROLA and txt2pho. This solution uses MBROLA to synthesize voice from phonemes. What's needed is a means to convert text into phonemes. There are French voices available for MBROLA at <a href="http://tcts.fpms.ac.be/synthesis/mbrola/mbrcopybin.html">http://tcts.fpms.ac.be/synthesis/mbrola/mbrcopybin.html</a>. There are txt2pho utilities and other TTS systems available at <a href="http://tcts.fpms.ac.be/synthesis/mbrola/mbrtts.html">http://tcts.fpms.ac.be/synthesis/mbrola/mbrtts.html</a>. I tried these without success. In some cases, the txt2pho programs fussed about "little endian", so this might require some perl programming. If you get a solution working this way, it would employ the Hadifix plugin in KTTS.
|
||||
|
||||
2. MBROLA and Festival. Like #1, this solution uses MBROLA to synthesize voice from phonemes, but uses Festival to do the text to phoneme conversion. More info at <a href="http://www.cstr.ed.ac.uk/projects/festival/mbrola.html">http://www.cstr.ed.ac.uk/projects/festival/mbrola.html</a>. A solution using this technique was developed for Festival 1.4.3 called FranFest. Google for "FranFest". Also, here's an article that explains how to install it: <a href="http://www.pollock-nageoire.net/festival/festival-english004.html">http://www.pollock-nageoire.net/festival/festival-english004.html</a>. The problem with this is 1) it requires patching and rebuilding Festival, and 2) it needs to be adapted to Festival 2.0 (1.95 beta). I would recommend approaching the Festival programmers about incorporating this patch into Festival permanently.
|
||||
|
||||
3. Native Festival. Develop a "native" voice for Festival so that Festival can do the full TTS conversion. This is much harder than #1 or #2, but would be much easier for KTTS users to install. From time to time, I have seen people mention on the festival-talk mailing list that they are working on this, so it may already be done or near done. More info at <a href="http://festvox.org/maillists.html">http://festvox.org/maillists.html</a>. Unfortunately, the festival-talk mailing list archive is not available. I can send you an mbox of what I have if you are interested.
|
||||
|
||||
Whatever solution you come up with, you'll need to document how French KTTS users install and configure it. If your solution uses Festival, it must list the voice code for the French voice in response to the following Scheme statement:
|
||||
|
||||
(print (mapcar (lambda (pair) (car pair)) voice-locations))
|
||||
|
||||
Contact me in irc.kde.org channel #kde-accessibility for more information.
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
add_subdirectory(stringreplacer)
|
||||
add_subdirectory(xmltransformer)
|
||||
add_subdirectory(talkerchooser)
|
||||
|
||||
########### next target ###############
|
||||
|
||||
if(ENABLE_TESTING)
|
||||
set(testfilter_SRCS main.cpp )
|
||||
|
||||
kde4_add_manual_test(testfilter main.cpp)
|
||||
|
||||
target_link_libraries(testfilter ${KDE4_KDEUI_LIBS} kttsd)
|
||||
endif()
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(
|
||||
FILES jovie_filterplugin.desktop
|
||||
DESTINATION ${KDE4_SERVICETYPES_INSTALL_DIR}
|
||||
)
|
|
@ -1,6 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=ServiceType
|
||||
X-KDE-ServiceType=Jovie/FilterPlugin
|
||||
|
||||
[PropertyDef::X-KDE-Languages]
|
||||
Type=QStringList
|
|
@ -1,129 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright 2011 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) version 3.
|
||||
|
||||
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 <QtCore/QTextStream>
|
||||
|
||||
#include <kapplication.h>
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kservicetypetrader.h>
|
||||
|
||||
#include "filterproc.h"
|
||||
#include "talkercode.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
KAboutData aboutdata(
|
||||
"testfilter", 0, ki18n("testfilter"),
|
||||
"0.1.0", ki18n("A utility for testing Jovie filter plugins."),
|
||||
KAboutData::License_GPL, ki18n("Copyright 2005, Gary Cramblitt <garycramblitt@comcast.net>"));
|
||||
aboutdata.addAuthor(ki18n("Gary Cramblitt"), ki18n("Maintainer"),"garycramblitt@comcast.net");
|
||||
|
||||
KCmdLineArgs::init( argc, argv, &aboutdata );
|
||||
// Tell which options are supported
|
||||
|
||||
KCmdLineOptions options;
|
||||
options.add("+pluginName", ki18n("Name of a Jovie filter plugin (required)"));
|
||||
options.add("t");
|
||||
options.add("talker <talker>", ki18n("Talker code passed to filter"), "en");
|
||||
options.add("a");
|
||||
options.add("appid <appID>", ki18n("D-Bus application ID passed to filter"), "testfilter");
|
||||
options.add("g");
|
||||
options.add("group <filterID>", ki18n("Config file group name passed to filter"), "testfilter");
|
||||
options.add("list", ki18n("Display list of available Filter PlugIns and exit"));
|
||||
options.add("b");
|
||||
options.add("break", ki18n("Display tabs as \\t, otherwise they are removed"));
|
||||
options.add("list", ki18n("Display list of available filter plugins and exit"));
|
||||
KCmdLineArgs::addCmdLineOptions( options );
|
||||
|
||||
KApplication app;
|
||||
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
|
||||
KService::List offers = KServiceTypeTrader::self()->query(QLatin1String("KTTSD/FilterPlugin"));
|
||||
|
||||
if (args->isSet("list"))
|
||||
{
|
||||
// Iterate thru the offers to list the plugins.
|
||||
foreach (const KService::Ptr service, offers)
|
||||
{
|
||||
kDebug() << service->name();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
QString filterName;
|
||||
if (args->count() > 0) filterName = args->arg(0);
|
||||
QString talker = args->getOption("talker");
|
||||
QString appId = args->getOption("appid");
|
||||
QString groupName = args->getOption("group");
|
||||
|
||||
if (filterName.isEmpty()) kError(1) << "No filter name given." << endl;
|
||||
|
||||
QVariantList list;
|
||||
foreach (const KService::Ptr service, offers)
|
||||
{
|
||||
if (service->name() == filterName)
|
||||
{
|
||||
// When the entry is found, load the plug in
|
||||
// First create a factory for the library
|
||||
KPluginLoader loader(service->library());
|
||||
KPluginFactory *factory = loader.factory();
|
||||
if (factory)
|
||||
{
|
||||
// If the factory is created successfully, instantiate the KttsFilterConf class for the
|
||||
// specific plug in to get the plug in configuration object.
|
||||
KttsFilterProc *plugIn = factory->create<KttsFilterProc>(NULL, list);
|
||||
//KLibLoader::createInstance<KttsFilterProc>(
|
||||
//service->library(), NULL, QStringList(service->library()),
|
||||
// &errorNo);
|
||||
if (plugIn)
|
||||
{
|
||||
KConfig* config = new KConfig(QLatin1String("kttsdrc"));
|
||||
plugIn->init( config, groupName);
|
||||
QTextStream inp ( stdin, QIODevice::ReadOnly );
|
||||
QString text;
|
||||
text = inp.readLine();
|
||||
TalkerCode* talkerCode = new TalkerCode( talker );
|
||||
text = plugIn->convert( text, talkerCode, appId );
|
||||
if ( args->isSet("break") )
|
||||
text.replace( QLatin1Char('\t'), QLatin1String("\\t") );
|
||||
else
|
||||
text.remove( QLatin1Char('\t'));
|
||||
kDebug() << text;
|
||||
delete config;
|
||||
delete plugIn;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
kError(2) << "Unable to create instance from library." << endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
kError(3) << "Unable to create factory." << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
kError(4) << "Unable to find a plugin named " << filterName << endl;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
########### next target ###############
|
||||
|
||||
set(jovie_stringreplacerplugin_PART_SRCS
|
||||
selectlanguagedlg.cpp
|
||||
stringreplacerconf.cpp
|
||||
stringreplacerproc.cpp
|
||||
stringreplacerplugin.cpp
|
||||
cdataescaper.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin(jovie_stringreplacerplugin ${jovie_stringreplacerplugin_PART_SRCS})
|
||||
|
||||
target_link_libraries(jovie_stringreplacerplugin ${KDE4_KIO_LIBS} ${QT_QTXML_LIBRARY} kttsd)
|
||||
|
||||
install(
|
||||
TARGETS jovie_stringreplacerplugin
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
########### test cdata escaper ##########
|
||||
|
||||
if(ENABLE_TESTING)
|
||||
set(test_cdataescaper_SRCS testcdataescaper.cpp cdataescaper.cpp)
|
||||
kde4_add_test(jovie-cdata_esecaper ${test_cdataescaper_SRCS})
|
||||
target_link_libraries(jovie-cdata_esecaper
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${QT_QTTEST_LIBRARY}
|
||||
${QT_QTCORE_LIBRARY}
|
||||
)
|
||||
endif()
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(
|
||||
FILES
|
||||
abbreviations.xml
|
||||
chat.xml
|
||||
chat-de.xml
|
||||
emoticons.xml
|
||||
polish_festival_fixes.xml
|
||||
polish_festival_unspeakables.xml
|
||||
kmail.xml
|
||||
festival_unspeakable_chars.xml
|
||||
qt2plaintext.xml
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/jovie/stringreplacer
|
||||
)
|
||||
|
||||
install(
|
||||
FILES jovie_stringreplacerplugin.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wordlist>
|
||||
<name>Abbreviations</name>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[TODO]]></match>
|
||||
<subst><![CDATA[To Do]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[CPU]]></match>
|
||||
<subst><![CDATA[C P U]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[DCOP]]></match>
|
||||
<subst><![CDATA[D Cop]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[IP]]></match>
|
||||
<subst><![CDATA[I P]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[KDE]]></match>
|
||||
<subst><![CDATA[K D E]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[KTTS]]></match>
|
||||
<subst><![CDATA[K T T S]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[kttsd]]></match>
|
||||
<subst><![CDATA[K T T S D]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[KTTSD]]></match>
|
||||
<subst><![CDATA[K T T S D]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[TTS]]></match>
|
||||
<subst><![CDATA[T T S]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,19 +0,0 @@
|
|||
#include "cdataescaper.h"
|
||||
#include <QString>
|
||||
|
||||
static const QLatin1String A0("&");
|
||||
static const QLatin1String B0("&");
|
||||
static const QLatin1String A1("]]>");
|
||||
static const QLatin1String B1("]]>");
|
||||
|
||||
void cdataEscape(QString* s)
|
||||
{
|
||||
s->replace(A0, B0);
|
||||
s->replace(A1, B1);
|
||||
}
|
||||
|
||||
void cdataUnescape(QString* s)
|
||||
{
|
||||
s->replace(B1, A1);
|
||||
s->replace(B0, A0);
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef CDATAESCAPER_H
|
||||
#define CDATAESCAPER_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
void cdataEscape(QString* s);
|
||||
void cdataUnescape(QString* s);
|
||||
|
||||
#endif // CDATAESCAPER_H
|
|
@ -1,616 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wordlist>
|
||||
<name>Internet Relay Chat and IM (Deutsch)</name>
|
||||
<language-code>de</language-code>
|
||||
<appid>knotify</appid>
|
||||
<appid>kopete</appid>
|
||||
<appid>kvirc</appid>
|
||||
<appid>ksirc</appid>
|
||||
<appid>konversation</appid>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<qt>]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<([^>]+)>]]></match>
|
||||
<subst><![CDATA[ \1 meint ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<br>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</qt>]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\;\)]]></match>
|
||||
<subst><![CDATA[ winkt]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\<]]></match>
|
||||
<subst><![CDATA[ traurig]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\/]]></match>
|
||||
<subst><![CDATA[stirnrunzeln]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\>]]></match>
|
||||
<subst><![CDATA[ grinst]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\|]]></match>
|
||||
<subst><![CDATA[ernsthaft]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\-\|]]></match>
|
||||
<subst><![CDATA[ernsthaft]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\-\)]]></match>
|
||||
<subst><![CDATA[ laechelt]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\'\(]]></match>
|
||||
<subst><![CDATA[weint]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\(]]></match>
|
||||
<subst><![CDATA[ traurig]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\)]]></match>
|
||||
<subst><![CDATA[ laechelt]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\@]]></match>
|
||||
<subst><![CDATA[ boese]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\$]]></match>
|
||||
<subst><![CDATA[ schaemt sich]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\@\)]]></match>
|
||||
<subst><![CDATA[ katzengesicht]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(6\)]]></match>
|
||||
<subst><![CDATA[ teufelsfratze]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(a\)]]></match>
|
||||
<subst><![CDATA[ engelsgesicht]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:D]]></match>
|
||||
<subst><![CDATA[ grins]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(h\)]]></match>
|
||||
<subst><![CDATA[ kuhl]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\so\_O]]></match>
|
||||
<subst><![CDATA[ winkt]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:p]]></match>
|
||||
<subst><![CDATA[ baeh]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(s\)]]></match>
|
||||
<subst><![CDATA[ gaehn]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ad]]></match>
|
||||
<subst><![CDATA[fuege hinzu]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[afaik]]></match>
|
||||
<subst><![CDATA[soviel ich weiss]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[afk]]></match>
|
||||
<subst><![CDATA[nicht an tastatur]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[asap]]></match>
|
||||
<subst><![CDATA[so schnell wie moeglich]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[atm]]></match>
|
||||
<subst><![CDATA[momentan]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ayt]]></match>
|
||||
<subst><![CDATA[bist du da]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[b4]]></match>
|
||||
<subst><![CDATA[vorher]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[b4n]]></match>
|
||||
<subst><![CDATA[tschuess]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[bak]]></match>
|
||||
<subst><![CDATA[zurueck]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[bbl]]></match>
|
||||
<subst><![CDATA[komme spaeter wieder]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[bf]]></match>
|
||||
<subst><![CDATA[freund]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[b/f]]></match>
|
||||
<subst><![CDATA[freund]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[brb]]></match>
|
||||
<subst><![CDATA[bin gleich wieder da]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[btw]]></match>
|
||||
<subst><![CDATA[nebenbei bemerkt]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cu]]></match>
|
||||
<subst><![CDATA[bis dann]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cul]]></match>
|
||||
<subst><![CDATA[bis spaeter]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cul8r]]></match>
|
||||
<subst><![CDATA[bis spaeter]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cya]]></match>
|
||||
<subst><![CDATA[bis spaeter]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[d/l]]></match>
|
||||
<subst><![CDATA[daunlohd]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[dvd]]></match>
|
||||
<subst><![CDATA[die wie die]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[f2f]]></match>
|
||||
<subst><![CDATA[von angesicht zu angesicht]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[fubar]]></match>
|
||||
<subst><![CDATA[leuft trotz reparatur nicht]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[fyi]]></match>
|
||||
<subst><![CDATA[zu deiner information]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[gf]]></match>
|
||||
<subst><![CDATA[freundin]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[g/f]]></match>
|
||||
<subst><![CDATA[freundin]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[gtg]]></match>
|
||||
<subst><![CDATA[ich muss weck]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[hmm]]></match>
|
||||
<subst><![CDATA[aehm]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[hth]]></match>
|
||||
<subst><![CDATA[hoffe es hilft]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ic]]></match>
|
||||
<subst><![CDATA[verstehe]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[iirc]]></match>
|
||||
<subst><![CDATA[wenn ich recht erinnere]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imao]]></match>
|
||||
<subst><![CDATA[meiner arroganten meinung nach]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imco]]></match>
|
||||
<subst><![CDATA[meiner wohlueberlegten meinung nach]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ime]]></match>
|
||||
<subst><![CDATA[meiner erfahrung nach]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imho]]></match>
|
||||
<subst><![CDATA[meiner bescheidenen meinung nach]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imnsho]]></match>
|
||||
<subst><![CDATA[meiner unbescheidenen meinung nach]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imo]]></match>
|
||||
<subst><![CDATA[meiner meinung nach]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ip]]></match>
|
||||
<subst><![CDATA[ei pie]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[isdn]]></match>
|
||||
<subst><![CDATA[i es de en]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[k]]></match>
|
||||
<subst><![CDATA[ho key]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[kde]]></match>
|
||||
<subst><![CDATA[ka de eh]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[kbd]]></match>
|
||||
<subst><![CDATA[tastatur]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[lshmba]]></match>
|
||||
<subst><![CDATA[halte mir den bauch vor lachen]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[lthtt]]></match>
|
||||
<subst><![CDATA[unbeschreibliches gelaechter]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ltns]]></match>
|
||||
<subst><![CDATA[lange nicht gesehen]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[lol]]></match>
|
||||
<subst><![CDATA[h h h]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[m8]]></match>
|
||||
<subst><![CDATA[kumpel]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[msg]]></match>
|
||||
<subst><![CDATA[nachricht]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[np]]></match>
|
||||
<subst><![CDATA[kein problem]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[oic]]></match>
|
||||
<subst><![CDATA[oh verstehe]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ok]]></match>
|
||||
<subst><![CDATA[ho key]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ott]]></match>
|
||||
<subst><![CDATA[übertreiben]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[pc]]></match>
|
||||
<subst><![CDATA[pie cie]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ppc]]></match>
|
||||
<subst><![CDATA[power pie cie]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ppl]]></match>
|
||||
<subst><![CDATA[leute]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[rotfl]]></match>
|
||||
<subst><![CDATA[kugelt sich vor lachen]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[rotflol]]></match>
|
||||
<subst><![CDATA[bruellt vor lachen]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[rsvp]]></match>
|
||||
<subst><![CDATA[antworte bitte]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[scsi]]></match>
|
||||
<subst><![CDATA[skasi]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[suse]]></match>
|
||||
<subst><![CDATA[suse]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[sec]]></match>
|
||||
<subst><![CDATA[sekunde]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[secs]]></match>
|
||||
<subst><![CDATA[sekunden]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[thx]]></match>
|
||||
<subst><![CDATA[danke]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[tnx]]></match>
|
||||
<subst><![CDATA[danke]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wo]]></match>
|
||||
<subst><![CDATA[ohne]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wb]]></match>
|
||||
<subst><![CDATA[willkommen urueck]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wtf]]></match>
|
||||
<subst><![CDATA[was zum teufel]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wth]]></match>
|
||||
<subst><![CDATA[was zum teufel]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wtg]]></match>
|
||||
<subst><![CDATA[gut gemacht]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wtgp]]></match>
|
||||
<subst><![CDATA[bitte um privatchett]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wth]]></match>
|
||||
<subst><![CDATA[was zum teufel]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wygiswypf]]></match>
|
||||
<subst><![CDATA[was du kriegst ist was du bezahlst]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[yw]]></match>
|
||||
<subst><![CDATA[gruess diche]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\_]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\|]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\\o\/]]></match>
|
||||
<subst><![CDATA[tschuess]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\/o\\]]></match>
|
||||
<subst><![CDATA[haelt sich die ohren zu]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\:\-\/]]></match>
|
||||
<subst><![CDATA[stirnrunzeln]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,641 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wordlist>
|
||||
<name>Internet Relay Chat and IM</name>
|
||||
<language-code>en</language-code>
|
||||
<appid>knotify</appid>
|
||||
<appid>kopete</appid>
|
||||
<appid>kvirc</appid>
|
||||
<appid>ksirc</appid>
|
||||
<appid>konversation</appid>
|
||||
<appid>kcmkttsmgr</appid>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<qt>]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<([^>]+)>]]></match>
|
||||
<subst><![CDATA[ \1 says ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<br>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</qt>]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\;\)]]></match>
|
||||
<subst><![CDATA[ winks]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\<]]></match>
|
||||
<subst><![CDATA[ sad face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\/]]></match>
|
||||
<subst><![CDATA[ frowns ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\>]]></match>
|
||||
<subst><![CDATA[ grins]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\|]]></match>
|
||||
<subst><![CDATA[ straight faced]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\-\|]]></match>
|
||||
<subst><![CDATA[ straight faced]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\-\)]]></match>
|
||||
<subst><![CDATA[ smiles]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\'\(]]></match>
|
||||
<subst><![CDATA[ cries]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\(]]></match>
|
||||
<subst><![CDATA[ sad face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\)]]></match>
|
||||
<subst><![CDATA[ smiles]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\@]]></match>
|
||||
<subst><![CDATA[ angry look]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\$]]></match>
|
||||
<subst><![CDATA[ blushes]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\@\)]]></match>
|
||||
<subst><![CDATA[ cat face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(6\)]]></match>
|
||||
<subst><![CDATA[ devil]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(a\)]]></match>
|
||||
<subst><![CDATA[ angel]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:D]]></match>
|
||||
<subst><![CDATA[ grins]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(h\)]]></match>
|
||||
<subst><![CDATA[ cool shades]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\so\_O]]></match>
|
||||
<subst><![CDATA[ winks]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:p]]></match>
|
||||
<subst><![CDATA[ sticks out tung]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(s\)]]></match>
|
||||
<subst><![CDATA[ sleepy]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ad]]></match>
|
||||
<subst><![CDATA[add]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[afaik]]></match>
|
||||
<subst><![CDATA[as far as I know]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[afk]]></match>
|
||||
<subst><![CDATA[away from keyboard]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[asap]]></match>
|
||||
<subst><![CDATA[as soon as possable]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[atm]]></match>
|
||||
<subst><![CDATA[at the moment]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ayt]]></match>
|
||||
<subst><![CDATA[are you there]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[b4]]></match>
|
||||
<subst><![CDATA[before]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[b4n]]></match>
|
||||
<subst><![CDATA[bye for now]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[bak]]></match>
|
||||
<subst><![CDATA[back]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[bbl]]></match>
|
||||
<subst><![CDATA[be back later]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[bf]]></match>
|
||||
<subst><![CDATA[boy friend]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[b/f]]></match>
|
||||
<subst><![CDATA[boy friend]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[brb]]></match>
|
||||
<subst><![CDATA[be right back]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[btw]]></match>
|
||||
<subst><![CDATA[by the way]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cu]]></match>
|
||||
<subst><![CDATA[see you]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cul]]></match>
|
||||
<subst><![CDATA[see you later]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cul8r]]></match>
|
||||
<subst><![CDATA[see you later]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[cya]]></match>
|
||||
<subst><![CDATA[see you later]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[d/l]]></match>
|
||||
<subst><![CDATA[down load]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[dvd]]></match>
|
||||
<subst><![CDATA[de vee de]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[f2f]]></match>
|
||||
<subst><![CDATA[face to face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[fubar]]></match>
|
||||
<subst><![CDATA[fecked up beyond all repair]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[fyi]]></match>
|
||||
<subst><![CDATA[for your information]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[gf]]></match>
|
||||
<subst><![CDATA[girl friend]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[g/f]]></match>
|
||||
<subst><![CDATA[girl friend]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[gtg]]></match>
|
||||
<subst><![CDATA[got to go]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\shm+]]></match>
|
||||
<subst><![CDATA[hurrmmm]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[hth]]></match>
|
||||
<subst><![CDATA[hope that helps]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ic]]></match>
|
||||
<subst><![CDATA[i see]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[iirc]]></match>
|
||||
<subst><![CDATA[if I recall correctly]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imao]]></match>
|
||||
<subst><![CDATA[in my arrogant opinion]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imco]]></match>
|
||||
<subst><![CDATA[in my considered opinion]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ime]]></match>
|
||||
<subst><![CDATA[in my experience]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imho]]></match>
|
||||
<subst><![CDATA[in my humble opinion]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imnsho]]></match>
|
||||
<subst><![CDATA[in my not so humble opinion]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[imo]]></match>
|
||||
<subst><![CDATA[in my opinion]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ip]]></match>
|
||||
<subst><![CDATA[i p]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[isdn]]></match>
|
||||
<subst><![CDATA[i s d n]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[k]]></match>
|
||||
<subst><![CDATA[ho kay]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[kde]]></match>
|
||||
<subst><![CDATA[k d e]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[kbd]]></match>
|
||||
<subst><![CDATA[keyboard]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[lshmba]]></match>
|
||||
<subst><![CDATA[laughing so hard my belly aches]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[lthtt]]></match>
|
||||
<subst><![CDATA[laughing too hard to type]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ltns]]></match>
|
||||
<subst><![CDATA[long time no see]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[lol]]></match>
|
||||
<subst><![CDATA[lafes out loud]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[m8]]></match>
|
||||
<subst><![CDATA[mate]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[msg]]></match>
|
||||
<subst><![CDATA[message]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[np]]></match>
|
||||
<subst><![CDATA[no problem]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[oic]]></match>
|
||||
<subst><![CDATA[oh i see]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ok]]></match>
|
||||
<subst><![CDATA[ho kay]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ott]]></match>
|
||||
<subst><![CDATA[over the top]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[pc]]></match>
|
||||
<subst><![CDATA[p c]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ppc]]></match>
|
||||
<subst><![CDATA[power p c]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[ppl]]></match>
|
||||
<subst><![CDATA[people]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[rotfl]]></match>
|
||||
<subst><![CDATA[rolling on the floor laughing]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[rotflol]]></match>
|
||||
<subst><![CDATA[rolling on the floor laughing out loud]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[rsvp]]></match>
|
||||
<subst><![CDATA[please reply]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[scsi]]></match>
|
||||
<subst><![CDATA[scuzy]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[suse]]></match>
|
||||
<subst><![CDATA[sue see]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[sec]]></match>
|
||||
<subst><![CDATA[second]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[secs]]></match>
|
||||
<subst><![CDATA[seconds]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[thx]]></match>
|
||||
<subst><![CDATA[thanks]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[tnx]]></match>
|
||||
<subst><![CDATA[thanks]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wo]]></match>
|
||||
<subst><![CDATA[without]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wb]]></match>
|
||||
<subst><![CDATA[welcome back]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wtf]]></match>
|
||||
<subst><![CDATA[what the heck]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wth]]></match>
|
||||
<subst><![CDATA[what the heck]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wtg]]></match>
|
||||
<subst><![CDATA[way to go]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wtgp]]></match>
|
||||
<subst><![CDATA[want to go private]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wth]]></match>
|
||||
<subst><![CDATA[what the heck]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[wygiswypf]]></match>
|
||||
<subst><![CDATA[what you get is what you pay for]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[yw]]></match>
|
||||
<subst><![CDATA[your welcome]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\_]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\|]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\\o\/]]></match>
|
||||
<subst><![CDATA[ cheers ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\/o\\]]></match>
|
||||
<subst><![CDATA[ covers ears ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\:\-\/]]></match>
|
||||
<subst><![CDATA[ frowns ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[,]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[`]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\sgr+]]></match>
|
||||
<subst><![CDATA[gurrr]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\]]></match>
|
||||
<subst><![CDATA[ slash ]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,157 +0,0 @@
|
|||
<ui version="4.0" >
|
||||
<author>Gary Cramblitt <garycramblitt@comcast.net></author>
|
||||
<class>EditReplacementWidget</class>
|
||||
<widget class="QWidget" name="EditReplacementWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>364</width>
|
||||
<height>163</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" colspan="2" >
|
||||
<widget class="QGroupBox" name="typeGroupBox" >
|
||||
<property name="title" >
|
||||
<string>&Type</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="wordRadioButton" >
|
||||
<property name="text" >
|
||||
<string>&Word</string>
|
||||
</property>
|
||||
<property name="checked" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="regexpRadioButton" >
|
||||
<property name="text" >
|
||||
<string>Regular &expression</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="matchLabel" >
|
||||
<property name="text" >
|
||||
<string>&Match:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>matchLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="substLabel" >
|
||||
<property name="text" >
|
||||
<string>&Replace with:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>substLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="matchLineEdit" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="matchButton" >
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="substLineEdit" />
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="2" >
|
||||
<widget class="QCheckBox" name="matchCaseCheckBox" >
|
||||
<property name="text" >
|
||||
<string>Match &case</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KPushButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kpushbutton.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>klineedit.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,304 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wordlist>
|
||||
<name>Emoticons (English)</name>
|
||||
<language-code>en</language-code>
|
||||
<appid>knotify</appid>
|
||||
<appid>kopete</appid>
|
||||
<appid>ksirc</appid>
|
||||
<appid>kvirc</appid>
|
||||
<appid>konversation</appid>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\)]]></match>
|
||||
<subst><![CDATA[. smiles]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\-\)]]></match>
|
||||
<subst><![CDATA[. smiles]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\p]]></match>
|
||||
<subst><![CDATA[. sticks out tung]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:D]]></match>
|
||||
<subst><![CDATA[. grins]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\>]]></match>
|
||||
<subst><![CDATA[.grins]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\;\)]]></match>
|
||||
<subst><![CDATA[. winks]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\o\_\0]]></match>
|
||||
<subst><![CDATA[. winks]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\(]]></match>
|
||||
<subst><![CDATA[. sad face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\<]]></match>
|
||||
<subst><![CDATA[. sad face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\\:\|]]></match>
|
||||
<subst><![CDATA[. straight faced]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\-\|]]></match>
|
||||
<subst><![CDATA[. straight faced]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\$]]></match>
|
||||
<subst><![CDATA[. blushes]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\\(h\)]]></match>
|
||||
<subst><![CDATA[. cool shades]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\@]]></match>
|
||||
<subst><![CDATA[. angry look]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\'\(]]></match>
|
||||
<subst><![CDATA[. cries]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(a\)]]></match>
|
||||
<subst><![CDATA[. angel]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(6\)]]></match>
|
||||
<subst><![CDATA[. devil]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\%\)]]></match>
|
||||
<subst><![CDATA[. hand cuffs]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\:\[\]]></match>
|
||||
<subst><![CDATA[. bat]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\@\)]]></match>
|
||||
<subst><![CDATA[. cat face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\&\)]]></match>
|
||||
<subst><![CDATA[. dog face]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\*\)]]></match>
|
||||
<subst><![CDATA[. star]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(s\)]]></match>
|
||||
<subst><![CDATA[. sleepy]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(Y\)]]></match>
|
||||
<subst><![CDATA[. thumbs up]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(n\)]]></match>
|
||||
<subst><![CDATA[. thumbs down]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\}\)]]></match>
|
||||
<subst><![CDATA[. girl huggs]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\{\)]]></match>
|
||||
<subst><![CDATA[. boy huggs]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(l\)]]></match>
|
||||
<subst><![CDATA[. love]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(U\)]]></match>
|
||||
<subst><![CDATA[. is hart brooken]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(k\)]]></match>
|
||||
<subst><![CDATA[. kisses]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\^\)]]></match>
|
||||
<subst><![CDATA[. birthday cake]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(g\)]]></match>
|
||||
<subst><![CDATA[. a gift]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(f\)]]></match>
|
||||
<subst><![CDATA[. flower]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(w\)]]></match>
|
||||
<subst><![CDATA[. willted flower]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(t\)]]></match>
|
||||
<subst><![CDATA[. telephone]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(e\)]]></match>
|
||||
<subst><![CDATA[. e mail]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(m\)]]></match>
|
||||
<subst><![CDATA[. messenger]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(o\)]]></match>
|
||||
<subst><![CDATA[. time]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(x\)]]></match>
|
||||
<subst><![CDATA[. girl]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(z\)]]></match>
|
||||
<subst><![CDATA[. boy]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(p\)]]></match>
|
||||
<subst><![CDATA[. picture]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\~\)]]></match>
|
||||
<subst><![CDATA[. film]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(b\)]]></match>
|
||||
<subst><![CDATA[. glass of beer]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(d\)]]></match>
|
||||
<subst><![CDATA[. glass of wine]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(\#\)]]></match>
|
||||
<subst><![CDATA[. sunny]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(r\)]]></match>
|
||||
<subst><![CDATA[. rainbow]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(8\)]]></match>
|
||||
<subst><![CDATA[. note]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(i\)]]></match>
|
||||
<subst><![CDATA[. idea]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\s\(c\)]]></match>
|
||||
<subst><![CDATA[. coffee cup]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,94 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wordlist>
|
||||
<name>Fix Festival Unspeakable Characters</name>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x80]]></match>
|
||||
<subst><![CDATA[ Euro ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x82]]></match>
|
||||
<subst><![CDATA[']]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x84]]></match>
|
||||
<subst><![CDATA["]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x85]]></match>
|
||||
<subst><![CDATA[...]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x89]]></match>
|
||||
<subst><![CDATA[ per Mille ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x8B]]></match>
|
||||
<subst><![CDATA[<]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[[\x91-\x92]]]></match>
|
||||
<subst><![CDATA[']]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[[\x93-\x94]]]></match>
|
||||
<subst><![CDATA["]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[[\x96-\x97]]]></match>
|
||||
<subst><![CDATA[-]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x98]]></match>
|
||||
<subst><![CDATA[~]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x99]]></match>
|
||||
<subst><![CDATA[ trademark ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\x9B]]></match>
|
||||
<subst><![CDATA[>]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[[\x80-\x9F]]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\{]]></match>
|
||||
<subst><![CDATA[ left curly brace ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\}]]></match>
|
||||
<subst><![CDATA[ right curly brace ]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,118 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=String Replacer
|
||||
Name[ar]=مستبدل النصوص
|
||||
Name[ast]=Trocador de cadenes
|
||||
Name[bg]=Замяна на низове
|
||||
Name[bs]=Zamjenjuje tekstove
|
||||
Name[ca]=Reemplaçador de cadenes
|
||||
Name[ca@valencia]=Reemplaçador de cadenes
|
||||
Name[cs]=Nahrazení řetězce
|
||||
Name[da]=Streng-erstatter
|
||||
Name[de]=Zeichenkettenersetzer
|
||||
Name[el]=Αντικαταστάτης συμβολοσειρών
|
||||
Name[en_GB]=String Replacer
|
||||
Name[es]=Reemplazador de cadenas
|
||||
Name[et]=Stringiasendaja
|
||||
Name[eu]=Kate ordezkatzailea
|
||||
Name[fa]=جایگزینکننده رشته
|
||||
Name[fi]=Merkkijononkorvaaja
|
||||
Name[fr]=Remplacement de chaînes
|
||||
Name[ga]=Ionadóir Teaghrán
|
||||
Name[gl]=Substitución de cadeas
|
||||
Name[he]=מחליף מחרוזות
|
||||
Name[hi]=वाक्यांश बदलने वाला
|
||||
Name[hne]=वाक्यांस बदले वाला
|
||||
Name[hr]=Zamjenik znakovnih nizova
|
||||
Name[hu]=Sztringcserélő
|
||||
Name[is]=Strengja útskiptir
|
||||
Name[it]=Sostitutore di stringhe
|
||||
Name[ja]=文字列置換
|
||||
Name[kk]=Мәтін ауыстығышы
|
||||
Name[km]=ឧបករណ៍ជំនួសខ្សែអក្សរ
|
||||
Name[ko]=문자열 대체
|
||||
Name[ku]=Cih Guherkerê Rêzikê
|
||||
Name[lt]=Eilučių pakeitiklis
|
||||
Name[lv]=Teksta aizvietotājs
|
||||
Name[mk]=Менувач на низи знаци
|
||||
Name[ml]=വാചകം മാറ്റിവയ്ക്കുന്നവന്
|
||||
Name[mr]=स्ट्रिंग बदलणारा
|
||||
Name[ms]=Pengganti Rentetan
|
||||
Name[nb]=Strengerstatter
|
||||
Name[nds]=Tekenkeed-Tuscher
|
||||
Name[ne]=स्ट्रिङ प्रतिस्थापक
|
||||
Name[nl]=Tekstvervanger
|
||||
Name[nn]=Teksterstattar
|
||||
Name[pa]=ਸਤਰ ਤਬਦੀਲੀਕਾਰ
|
||||
Name[pl]=Zastępowanie tekstu
|
||||
Name[pt]=Substituição de Textos
|
||||
Name[pt_BR]=Substituição de textos
|
||||
Name[ro]=Înlocuitor de șiruri
|
||||
Name[ru]=Автозамена
|
||||
Name[sk]=Náhrada teťazca
|
||||
Name[sl]=Zamenjevalnik nizov
|
||||
Name[sq]=Zëvendësues i Rreshtit
|
||||
Name[sr]=Замењивач ниски
|
||||
Name[sr@ijekavian]=Замјењивач ниски
|
||||
Name[sr@ijekavianlatin]=Zamjenjivač niski
|
||||
Name[sr@latin]=Zamenjivač niski
|
||||
Name[sv]=Strängersättning
|
||||
Name[ta]=சர இடமாற்றி
|
||||
Name[tg]=Ҷойивазкунии автоматӣ
|
||||
Name[tr]=Metin Değiştirici
|
||||
Name[ug]=تېكىست ئالماشتۇرغۇچ
|
||||
Name[uk]=Заміна рядків
|
||||
Name[vi]=Trình thay Chuỗi
|
||||
Name[x-test]=xxString Replacerxx
|
||||
Name[zh_CN]=字符串替换器
|
||||
Name[zh_TW]=字串置換器
|
||||
Comment=Generic String Replacement Filter Plugin for Jovie
|
||||
Comment[bg]=Приставка филтър за замяна на низове за Jovie
|
||||
Comment[bs]=Generički filterski priključak Jovie za zamjenu nizova znakova
|
||||
Comment[ca]=Connector del filtre reemplaçador genèric de cadenes pel Jovie
|
||||
Comment[ca@valencia]=Connector del filtre reemplaçador genèric de cadenes pel Jovie
|
||||
Comment[cs]=Modul filtru náhrady řetězce Jovie
|
||||
Comment[da]=Generisk strengerstatnings-filter-plugin til Jovie
|
||||
Comment[de]=Ein allgemeines Modul zur Zeichenkettenersetzung für Jovie
|
||||
Comment[el]=Γενικό πρόσθετο φίλτρου αντικατάστασης συμβολοσειρών για το Jovie
|
||||
Comment[en_GB]=Generic String Replacement Filter Plugin for Jovie
|
||||
Comment[es]=Complemento de filtro genérico de sustitución de cadenas para Jovie
|
||||
Comment[et]=Jovie üldine stringiasendusfiltri plugin
|
||||
Comment[eu]=Jovierentzako kateak ordezkatzeko iragazki plugin generikoa
|
||||
Comment[fi]=Jovien yleinen merkkijononkorvaussuodinliitännäinen
|
||||
Comment[fr]=Module externe de filtre générique pour le remplacement de chaînes pour Jovie
|
||||
Comment[ga]=Ionadóir Teaghrán i mBreiseán Ginearálta Jovie
|
||||
Comment[gl]=Complemento de filtro xenérico de substitución de cadeas para Jovie
|
||||
Comment[hr]=Generički priključak za Jovie za filtriranje zamjena znakovnih nizova
|
||||
Comment[hu]=Általános sztringcserélő modul a Jovie-hoz
|
||||
Comment[is]=Almennt strengjaútskiptinga-íforrit fyrir Jovie
|
||||
Comment[it]=Estensione generica per il filtro di sostituzione di stringhe per Jovie
|
||||
Comment[ja]=Jovie 用汎用文字列置換フィルタプラグイン
|
||||
Comment[kk]=Jovie-нің мәтін жолды ауыстыру жалпы сүзгі плагині
|
||||
Comment[ko]=Jovie 일반적 문자열 대체 필터 플러그인
|
||||
Comment[lt]=Bendro pobūdžio eilučių pakeitimo filtro priedas, skirtas Jovie
|
||||
Comment[lv]=Vienkāršs teksta aizvietotāja filtra spraudnis priekš Jovie
|
||||
Comment[nb]=Filter-programtillegg til Jovie for streng-erstatning
|
||||
Comment[nds]=Jovie-Filtermoduul för dat Utwesseln vun Tekenkeden
|
||||
Comment[nl]=Filter-plugin voor Jovie voor het vervangen van generieke teksten
|
||||
Comment[nn]=Generelt teksterstattingstillegg for Jovie
|
||||
Comment[pl]=Zwykła wtyczka filtra zastępowania ciągów znaków dla Jovie
|
||||
Comment[pt]='Plugin' Genérico de Substituição de Textos para o Jovie
|
||||
Comment[pt_BR]=Plugin genérico do filtro de substituição de textos para o Jovie
|
||||
Comment[ru]=Модуль автозамены для Jovie
|
||||
Comment[sk]=Všeobecný modul filtra náhrady reťazca pre Jovie
|
||||
Comment[sl]=Splošni filtrirni vstavek za zamenjavo nizov za Jovie
|
||||
Comment[sr]=Генерички филтерски прикључак Џови за замену ниски
|
||||
Comment[sr@ijekavian]=Генерички филтерски прикључак Џови за замјену ниски
|
||||
Comment[sr@ijekavianlatin]=Generički filterski priključak Džovi za zamjenu niski
|
||||
Comment[sr@latin]=Generički filterski priključak Džovi za zamenu niski
|
||||
Comment[sv]=Insticksprogram för Jovie med generellt strängersättningsfilter
|
||||
Comment[tr]=Jovie için Genel Metin Değiştirme Süzgeci Eklentisi
|
||||
Comment[ug]=Jovie نىڭ ئادەتتىكى تېكىست ئالماشتۇرغۇچ سۈزگۈچ قىستۇرمىسى
|
||||
Comment[uk]=Додаток загального фільтра заміни рядків для Jovie
|
||||
Comment[x-test]=xxGeneric String Replacement Filter Plugin for Joviexx
|
||||
Comment[zh_CN]=Jovie 的通用字符串替换过滤插件
|
||||
Comment[zh_TW]=Jovie 使用的一般字串置換外掛程式
|
||||
Type=Service
|
||||
ServiceTypes=Jovie/FilterPlugin
|
||||
X-KDE-Library=jovie_stringreplacerplugin
|
||||
X-KDE-Languages=en,en_US,en_GB,en_CA,es,es_mx,cy,de,fi,cs,pl
|
|
@ -1,31 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Filter by David Power achiestdragon@gmail.com -->
|
||||
<wordlist>
|
||||
<name>kmail notify</name>
|
||||
<appid>knotify</appid>
|
||||
<appid>kmail</appid>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<br>]]></match>
|
||||
<subst><![CDATA[,]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</b>]]></match>
|
||||
<subst><![CDATA[,]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[in /local/inbox]]></match>
|
||||
<subst><![CDATA[,]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<b>]]></match>
|
||||
<subst><![CDATA[,]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Author of filter: Mikolaj Machowski ( mikmach AT wp DOT pl ) -->
|
||||
<wordlist>
|
||||
<name>Filtr polski / Filter for Polish Festival voice</name>
|
||||
<language-code>pl</language-code>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[[^a-zA-Z0-9ęóąśłżźćńĘÓĄŚŁŻŹĆŃ\,\"\'\\@#$%^*+=`~]]]></match>
|
||||
<subst><![CDATA[ ]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,78 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Author of filter: Mikolaj Machowski ( mikmach AT wp DOT pl ) -->
|
||||
<wordlist>
|
||||
<name>Polskie niewymawialne / Polish Festival unspeakables</name>
|
||||
<language-code>pl</language-code>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\(]]></match>
|
||||
<subst><![CDATA[ otwieram nawias ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\)]]></match>
|
||||
<subst><![CDATA[ zamykam nawias ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\{]]></match>
|
||||
<subst><![CDATA[ otwieram nawias klamrowy ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\}]]></match>
|
||||
<subst><![CDATA[ zamykam nawias klamrowy ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\[]]></match>
|
||||
<subst><![CDATA[ otwieram nawias kwadratowy ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\]]]></match>
|
||||
<subst><![CDATA[ zamykam nawias kwadratowy ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\<]]></match>
|
||||
<subst><![CDATA[ otwieram nawias trójkątny ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\>]]></match>
|
||||
<subst><![CDATA[ zamykam nawias trójkątny ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\_]]></match>
|
||||
<subst><![CDATA[ znak podkreślenia ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\&]]></match>
|
||||
<subst><![CDATA[ i ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\/]]></match>
|
||||
<subst><![CDATA[ slesz ]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>Word</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[\\]]></match>
|
||||
<subst><![CDATA[ bekslesz ]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,359 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<wordlist>
|
||||
<name>Qt Rich Text to Plain Text</name>
|
||||
<appid>knotify</appid>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<qt>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</qt>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<h1>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<h2>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<h3>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</h1>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</h2>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</h3>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<p>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</p>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<center>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</center>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<blockquote>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</blockquote>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<ul>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</ul>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<ol>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</ol>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<li>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</li>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<a>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</a>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<em>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</em>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<strong>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</strong>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<bold>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</bold>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<b>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</b>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<u>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</u>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<big>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</big>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<small>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</small>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<hr/>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<br/>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<nobr>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</nobr>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<table>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</table>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<tr>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</tr>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<td>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</td>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<th>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</th>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<img src\=]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<a href\=]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[/>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<img>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[">]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<pre>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</pre>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<tt>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</tt>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[<code>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
<word>
|
||||
<type>RegExp</type>
|
||||
<case>No</case>
|
||||
<match><![CDATA[</code>]]></match>
|
||||
<subst><![CDATA[]]></subst>
|
||||
</word>
|
||||
</wordlist>
|
|
@ -1,134 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Description:
|
||||
A dialog for user to select one or more languages from the list
|
||||
of KDE global languages.
|
||||
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 "selectlanguagedlg.h"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QTableWidget>
|
||||
#include <QtGui/QHeaderView>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdialog.h>
|
||||
#include <kdebug.h>
|
||||
#include <kglobal.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "talkercode.h"
|
||||
#include "moc_selectlanguagedlg.cpp"
|
||||
|
||||
SelectLanguageDlg::SelectLanguageDlg(
|
||||
QWidget* parent,
|
||||
const QString& caption,
|
||||
const QStringList& languageCodes,
|
||||
bool selectMode,
|
||||
bool blankMode) :
|
||||
|
||||
KDialog(parent)
|
||||
{
|
||||
setCaption(caption);
|
||||
setButtons(KDialog::Help|KDialog::Ok|KDialog::Cancel);
|
||||
// Create a QTableWidget and fill with all known languages.
|
||||
m_langList = new QTableWidget( this );
|
||||
m_langList->setColumnCount(2);
|
||||
m_langList->verticalHeader()->hide();
|
||||
m_langList->setHorizontalHeaderItem(0, new QTableWidgetItem(i18n("Language")));
|
||||
m_langList->setHorizontalHeaderItem(1, new QTableWidgetItem(i18n("Code")));
|
||||
m_langList->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
m_langList->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
if (selectMode == MultipleSelect)
|
||||
m_langList->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
else
|
||||
m_langList->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
QStringList allLocales = KGlobal::locale()->allLanguagesList();
|
||||
QString locale;
|
||||
QString language;
|
||||
const int allLocalesCount = allLocales.count();
|
||||
for (int ndx=0; ndx < allLocalesCount; ++ndx)
|
||||
{
|
||||
locale = allLocales[ndx];
|
||||
language = locale;
|
||||
if (!language.isEmpty()) {
|
||||
int row = m_langList->rowCount();
|
||||
m_langList->setRowCount(row + 1);
|
||||
m_langList->setItem(row, 0, new QTableWidgetItem(language));
|
||||
m_langList->setItem(row, 1, new QTableWidgetItem(locale));
|
||||
if (languageCodes.contains(locale)) m_langList->selectRow(row);
|
||||
}
|
||||
}
|
||||
// Sort by language.
|
||||
m_langList->sortItems(0);
|
||||
// If blank is allowed, add to top of the list.
|
||||
if (blankMode == BlankAllowed) {
|
||||
m_langList->insertRow(0);
|
||||
m_langList->setItem(0, 0, new QTableWidgetItem(QLatin1String( "" )));
|
||||
m_langList->setItem(0, 1, new QTableWidgetItem(QLatin1String( "" )));
|
||||
}
|
||||
setMainWidget(m_langList);
|
||||
setHelp(QLatin1String( "select-language" ), QLatin1String( "jovie" ));
|
||||
QSize size = m_langList->minimumSize();
|
||||
size.setHeight(500);
|
||||
m_langList->setMinimumSize(size);
|
||||
}
|
||||
|
||||
QString SelectLanguageDlg::selectedLanguage()
|
||||
{
|
||||
return firstSelectedItem(0);
|
||||
}
|
||||
|
||||
QString SelectLanguageDlg::selectedLanguageCode()
|
||||
{
|
||||
return firstSelectedItem(1);
|
||||
}
|
||||
|
||||
QStringList SelectLanguageDlg::selectedLanguages()
|
||||
{
|
||||
return allSelectedItems(0);
|
||||
}
|
||||
|
||||
QStringList SelectLanguageDlg::selectedLanguageCodes()
|
||||
{
|
||||
return allSelectedItems(1);
|
||||
}
|
||||
|
||||
QString SelectLanguageDlg::firstSelectedItem(int col)
|
||||
{
|
||||
QString s;
|
||||
for (int row = 0; row < m_langList->rowCount(); ++row) {
|
||||
if (m_langList->isItemSelected(m_langList->item(row, col)))
|
||||
return m_langList->item(row, col)->text();
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
QStringList SelectLanguageDlg::allSelectedItems(int col)
|
||||
{
|
||||
QStringList sl;
|
||||
for (int row = 0; row < m_langList->rowCount(); ++row) {
|
||||
if (m_langList->isItemSelected(m_langList->item(row, col)))
|
||||
sl.append(m_langList->item(row, col)->text());
|
||||
}
|
||||
return sl;
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Description:
|
||||
A dialog for user to select one or more languages from the list
|
||||
of KDE global languages.
|
||||
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 SELECTLANGUAGEDLG_H
|
||||
#define SELECTLANGUAGEDLG_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdialog.h>
|
||||
#include <klocale.h>
|
||||
#include <kdemacros.h>
|
||||
|
||||
#include <QTableWidget>
|
||||
|
||||
class KDE_EXPORT SelectLanguageDlg : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum SelectMode {
|
||||
MultipleSelect = 0,
|
||||
SingleSelect = 1
|
||||
};
|
||||
enum BlankMode {
|
||||
BlankNotAllowed = 0,
|
||||
BlankAllowed = 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param parent The parent for this dialog.
|
||||
* @param caption Displayed title for this dialog.
|
||||
* @param languageCodes A list of language codes that should start
|
||||
* out selected when dialog is shown.
|
||||
* @param selectMode 0 if user may choose more than one
|
||||
* language in the list. 1 if only one
|
||||
* language may be chosen.
|
||||
* @param blankMode If 1, a blank row is displayed in the
|
||||
* list and user may choose it.
|
||||
*/
|
||||
explicit SelectLanguageDlg(
|
||||
QWidget* parent = 0,
|
||||
const QString& caption = i18n("Select Language"),
|
||||
const QStringList& languageCodes = QStringList(),
|
||||
bool selectMode = SingleSelect,
|
||||
bool blankMode = BlankAllowed);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~SelectLanguageDlg() { }
|
||||
|
||||
/**
|
||||
* In single select mode, returns the language user chose.
|
||||
*/
|
||||
QString selectedLanguage();
|
||||
|
||||
/**
|
||||
* In single select mode, returns the language code user chose.
|
||||
*/
|
||||
QString selectedLanguageCode();
|
||||
|
||||
/**
|
||||
* In multiple select mode, returns list of languages user chose.
|
||||
*/
|
||||
QStringList selectedLanguages();
|
||||
|
||||
/**
|
||||
* In multiple select mode, returns the list of language codes
|
||||
* user chose.
|
||||
*/
|
||||
QStringList selectedLanguageCodes();
|
||||
|
||||
private:
|
||||
QString firstSelectedItem(int col);
|
||||
QStringList allSelectedItems(int col);
|
||||
|
||||
QTableWidget* m_langList;
|
||||
};
|
||||
|
||||
#endif // SELECTLANGUAGEDLG_H
|
|
@ -1,692 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic String Replacement Filter Configuration class.
|
||||
-------------------
|
||||
Copyright 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
Copyright 2010 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// StringReplacer includes.
|
||||
#include "stringreplacerconf.h"
|
||||
#include "moc_stringreplacerconf.cpp"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtXml/qdom.h>
|
||||
#include <QtGui/QRadioButton>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtGui/QTableWidget>
|
||||
#include <QtGui/QHeaderView>
|
||||
|
||||
// KDE includes.
|
||||
#include <kglobal.h>
|
||||
#include <klocale.h>
|
||||
#include <klineedit.h>
|
||||
#include <kdialog.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <kconfig.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kregexpeditorinterface.h>
|
||||
#include <kfiledialog.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <khbox.h>
|
||||
#include <kservicetypetrader.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "selectlanguagedlg.h"
|
||||
#include "filterconf.h"
|
||||
#include "cdataescaper.h"
|
||||
|
||||
StringReplacerConf::StringReplacerConf( QWidget *parent, const QVariantList& args ) :
|
||||
KttsFilterConf(parent, args),
|
||||
m_editDlg(0),
|
||||
m_editWidget(0)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
// kDebug() << "StringReplacerConf::StringReplacerConf: Running";
|
||||
|
||||
// Create configuration widget.
|
||||
setupUi(this);
|
||||
|
||||
substLView->setSortingEnabled(false);
|
||||
substLView->verticalHeader()->hide();
|
||||
substLView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
|
||||
|
||||
connect(nameLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()));
|
||||
connect(languageBrowseButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotLanguageBrowseButton_clicked()));
|
||||
connect(addButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotAddButton_clicked()));
|
||||
connect(upButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotUpButton_clicked()));
|
||||
connect(downButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotDownButton_clicked()));
|
||||
connect(editButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotEditButton_clicked()));
|
||||
connect(removeButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotRemoveButton_clicked()));
|
||||
connect(loadButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotLoadButton_clicked()));
|
||||
connect(saveButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotSaveButton_clicked()));
|
||||
connect(clearButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotClearButton_clicked()));
|
||||
connect(substLView, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)),
|
||||
this, SLOT(enableDisableButtons()));
|
||||
connect(appIdLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()));
|
||||
|
||||
// Determine if kdeutils Regular Expression Editor is installed.
|
||||
m_reEditorInstalled = !KServiceTypeTrader::self()->query(QLatin1String( "KRegExpEditor/KRegExpEditor" )).isEmpty();
|
||||
|
||||
// Set up defaults.
|
||||
defaults();
|
||||
}
|
||||
|
||||
StringReplacerConf::~StringReplacerConf(){
|
||||
// kDebug() << "StringReplacerConf::~StringReplacerConf: Running";
|
||||
}
|
||||
|
||||
void StringReplacerConf::load(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "StringReplacerConf::load: Running";
|
||||
// See if this filter previously save its word list.
|
||||
KConfigGroup config( c, configGroup );
|
||||
QString wordsFilename = config.readEntry( "WordListFile" );
|
||||
if ( !wordsFilename.isEmpty() )
|
||||
{
|
||||
QString errMsg = loadFromFile( wordsFilename, true );
|
||||
if ( !errMsg.isEmpty() )
|
||||
kDebug() << "StringReplacerConf::load: " << errMsg;
|
||||
enableDisableButtons();
|
||||
}
|
||||
}
|
||||
|
||||
// Loads word list and settings from a file. Clearing configuration if clear is True.
|
||||
QString StringReplacerConf::loadFromFile( const QString& filename, bool clear)
|
||||
{
|
||||
// Open existing word list.
|
||||
QFile file( filename );
|
||||
if ( !file.open( QIODevice::ReadOnly ) )
|
||||
{
|
||||
return i18n("Unable to open file.") + filename;
|
||||
}
|
||||
// QDomDocument doc( "http://www.kde.org/share/apps/kttsd/stringreplacer/wordlist.dtd []" );
|
||||
QDomDocument doc( QLatin1String( "" ) );
|
||||
if ( !doc.setContent( &file ) ) {
|
||||
file.close();
|
||||
return i18n("File not in proper XML format.");
|
||||
}
|
||||
// kDebug() << "StringReplacerConf::load: document successfully parsed.";
|
||||
file.close();
|
||||
|
||||
// Clear list view.
|
||||
if ( clear ) substLView->setRowCount(0);
|
||||
|
||||
// Name setting.
|
||||
QDomNodeList nameList = doc.elementsByTagName( QLatin1String( "name" ) );
|
||||
QDomNode nameNode = nameList.item( 0 );
|
||||
nameLineEdit->setText( nameNode.toElement().text() );
|
||||
// kDebug() << "StringReplacerConf::load: name = " << nameNode.toElement().text();
|
||||
|
||||
// Language Codes setting. List may be single element of comma-separated values,
|
||||
// or multiple elements.
|
||||
QString languageCodes;
|
||||
QDomNodeList languageList = doc.elementsByTagName( QLatin1String( "language-code" ) );
|
||||
for ( int ndx=0; ndx < languageList.count(); ++ndx )
|
||||
{
|
||||
QDomNode languageNode = languageList.item( ndx );
|
||||
if (!languageCodes.isEmpty()) languageCodes += QLatin1Char( ',' );
|
||||
languageCodes += languageNode.toElement().text();
|
||||
}
|
||||
if ( clear )
|
||||
m_languageCodeList = languageCodes.split(QLatin1Char( ',' ), QString::SkipEmptyParts);
|
||||
else
|
||||
m_languageCodeList += languageCodes.split(QLatin1Char( ',' ), QString::SkipEmptyParts);
|
||||
QString language;
|
||||
m_languageCodeList.sort();
|
||||
// Eliminate dups.
|
||||
{
|
||||
int ndx = m_languageCodeList.count() - 2;
|
||||
while ( ndx >= 0 ) {
|
||||
if ( m_languageCodeList[ndx] == m_languageCodeList[ndx+1] )
|
||||
m_languageCodeList.removeAt(ndx+1);
|
||||
ndx--;
|
||||
}
|
||||
}
|
||||
for ( int ndx=0; ndx < m_languageCodeList.count(); ++ndx )
|
||||
{
|
||||
if (!language.isEmpty()) language += QLatin1Char( ',' );
|
||||
language += KGlobal::locale()->languageCodeToName(m_languageCodeList[ndx]);
|
||||
}
|
||||
languageLineEdit->setText(language);
|
||||
|
||||
// AppId. Apply this filter only if DCOP appId of application that queued
|
||||
// the text contains this string. List may be single element of comma-separated values,
|
||||
// or multiple elements.
|
||||
QDomNodeList appIdList = doc.elementsByTagName( QLatin1String( "appid" ) );
|
||||
QString appIds;
|
||||
for ( int ndx=0; ndx < appIdList.count(); ++ndx )
|
||||
{
|
||||
QDomNode appIdNode = appIdList.item( ndx );
|
||||
if (!appIds.isEmpty()) appIds += QLatin1Char( ',' );
|
||||
appIds += appIdNode.toElement().text();
|
||||
}
|
||||
if ( !clear ) appIds = appIdLineEdit->text() + appIds;
|
||||
appIdLineEdit->setText( appIds );
|
||||
|
||||
// Word list.
|
||||
QDomNodeList wordList = doc.elementsByTagName( QLatin1String( "word" ) );
|
||||
const int wordListCount = wordList.count();
|
||||
for ( int wordIndex = 0; wordIndex < wordListCount; ++wordIndex )
|
||||
{
|
||||
// kDebug() << "StringReplacerConf::load: start parsing of word " << wordIndex;
|
||||
QDomNode wordNode = wordList.item(wordIndex);
|
||||
QDomNodeList propList = wordNode.childNodes();
|
||||
QString wordType;
|
||||
QString matchCase = QLatin1String( "No" );
|
||||
QString match;
|
||||
QString subst;
|
||||
const int propListCount = propList.count();
|
||||
for ( int propIndex = 0; propIndex < propListCount; ++propIndex )
|
||||
{
|
||||
QDomNode propNode = propList.item(propIndex);
|
||||
QDomElement prop = propNode.toElement();
|
||||
if (prop.tagName() == QLatin1String( "type" )) wordType = prop.text();
|
||||
if (prop.tagName() == QLatin1String( "case" )) matchCase = prop.text();
|
||||
if (prop.tagName() == QLatin1String( "match" ))
|
||||
{
|
||||
match = prop.text();
|
||||
cdataUnescape( &match );
|
||||
}
|
||||
|
||||
if (prop.tagName() == QLatin1String( "subst" ))
|
||||
{
|
||||
subst = prop.text();
|
||||
cdataUnescape( &subst );
|
||||
}
|
||||
}
|
||||
QString wordTypeStr =
|
||||
(wordType==QLatin1String( "RegExp" )?i18nc("Abbreviation for 'Regular Expression'", "RegExp"):i18n("Word"));
|
||||
int tableRow = substLView->rowCount();
|
||||
QString matchCaseStr =
|
||||
(matchCase==QLatin1String( "Yes" )?i18nc("Yes or no", "Yes"):i18nc("Yes or no", "No"));
|
||||
substLView->setRowCount( tableRow + 1 );
|
||||
substLView->setItem( tableRow, 0, new QTableWidgetItem( wordTypeStr ) );
|
||||
substLView->setItem( tableRow, 1, new QTableWidgetItem( matchCaseStr ) );
|
||||
substLView->setItem( tableRow, 2, new QTableWidgetItem( match ) );
|
||||
substLView->setItem( tableRow, 3, new QTableWidgetItem( subst ) );
|
||||
}
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
void StringReplacerConf::save(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "StringReplacerConf::save: Running";
|
||||
QString wordsFilename =
|
||||
KGlobal::dirs()->saveLocation( "data" ,QLatin1String( "jovie/stringreplacer/" ), true );
|
||||
if ( wordsFilename.isEmpty() )
|
||||
{
|
||||
kDebug() << "StringReplacerConf::save: no save location";
|
||||
return;
|
||||
}
|
||||
wordsFilename += configGroup;
|
||||
QString errMsg = saveToFile( wordsFilename );
|
||||
if ( errMsg.isEmpty() )
|
||||
{
|
||||
KConfigGroup config( c, configGroup );
|
||||
config.writeEntry( "WordListFile", KStandardDirs::realFilePath(wordsFilename) );
|
||||
}
|
||||
else
|
||||
kDebug() << "StringReplacerConf::save: " << errMsg;
|
||||
}
|
||||
|
||||
// Saves word list and settings to a file.
|
||||
QString StringReplacerConf::saveToFile(const QString& filename)
|
||||
{
|
||||
// kDebug() << "StringReplacerConf::saveToFile: saving to file " << wordsFilename;
|
||||
|
||||
QFile file( filename );
|
||||
if ( !file.open( QIODevice::WriteOnly ) )
|
||||
return i18n("Unable to open file ") + filename;
|
||||
|
||||
// QDomDocument doc( "http://www.kde.org/share/apps/kttsd/stringreplacer/wordlist.dtd []" );
|
||||
QDomDocument doc( QLatin1String( "" ) );
|
||||
|
||||
QDomElement root = doc.createElement( QLatin1String( "wordlist" ) );
|
||||
doc.appendChild( root );
|
||||
|
||||
// Name.
|
||||
QDomElement name = doc.createElement( QLatin1String( "name" ) );
|
||||
root.appendChild( name );
|
||||
QDomText t = doc.createTextNode( nameLineEdit->text() );
|
||||
name.appendChild( t );
|
||||
|
||||
// Language code.
|
||||
for ( int ndx=0; ndx < m_languageCodeList.count(); ++ndx )
|
||||
{
|
||||
QDomElement languageCode = doc.createElement( QLatin1String( "language-code" ) );
|
||||
root.appendChild( languageCode );
|
||||
t = doc.createTextNode( m_languageCodeList[ndx] );
|
||||
languageCode.appendChild( t );
|
||||
}
|
||||
|
||||
// Application ID
|
||||
QString appId = appIdLineEdit->text().remove(QLatin1Char( ' ' ));
|
||||
if ( !appId.isEmpty() )
|
||||
{
|
||||
QStringList appIdList = appId.split( QLatin1Char( ',' ), QString::SkipEmptyParts );
|
||||
for ( int ndx=0; ndx < appIdList.count(); ++ndx )
|
||||
{
|
||||
QDomElement appIdElem = doc.createElement( QLatin1String( "appid" ) );
|
||||
root.appendChild( appIdElem );
|
||||
t = doc.createTextNode( appIdList[ndx] );
|
||||
appIdElem.appendChild( t );
|
||||
}
|
||||
}
|
||||
|
||||
// Words.
|
||||
for ( int row = 0; row < substLView->rowCount(); ++row )
|
||||
{
|
||||
QDomElement wordTag = doc.createElement( QLatin1String( "word" ) );
|
||||
root.appendChild( wordTag );
|
||||
QDomElement propTag = doc.createElement( QLatin1String( "type" ) );
|
||||
wordTag.appendChild( propTag);
|
||||
QDomText t = doc.createTextNode(
|
||||
substLView->item(row, 0)->text()==i18n("Word")?QLatin1String( "Word" ):QLatin1String( "RegExp" ) );
|
||||
propTag.appendChild( t );
|
||||
|
||||
propTag = doc.createElement( QLatin1String( "case" ) );
|
||||
wordTag.appendChild( propTag);
|
||||
t = doc.createTextNode(
|
||||
substLView->item(row, 1)->text()==i18nc("Yes or no", "Yes")?QLatin1String( "Yes" ):QLatin1String( "No" ) );
|
||||
propTag.appendChild( t );
|
||||
|
||||
propTag = doc.createElement( QLatin1String( "match" ) );
|
||||
wordTag.appendChild( propTag);
|
||||
QString s = substLView->item(row, 2)->text();
|
||||
cdataEscape( &s );
|
||||
t = doc.createCDATASection( s );
|
||||
propTag.appendChild( t );
|
||||
|
||||
propTag = doc.createElement( QLatin1String( "subst" ) );
|
||||
wordTag.appendChild( propTag);
|
||||
s = substLView->item(row, 3)->text();
|
||||
cdataEscape( &s );
|
||||
t = doc.createCDATASection( s );
|
||||
|
||||
propTag.appendChild( t );
|
||||
}
|
||||
|
||||
// Write it all out.
|
||||
QTextStream ts( &file );
|
||||
ts.setCodec( "UTF-8" );
|
||||
ts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
||||
ts << doc.toString();
|
||||
// kDebug() << "StringReplacerConf::saveToFile: writing out " << doc.toString();
|
||||
file.close();
|
||||
|
||||
return QString();
|
||||
}
|
||||
|
||||
void StringReplacerConf::defaults(){
|
||||
// kDebug() << "StringReplacerConf::defaults: Running";
|
||||
// Default language is none.
|
||||
m_languageCodeList.clear();
|
||||
languageLineEdit->setText( QLatin1String( "" ) );
|
||||
// Default name.
|
||||
nameLineEdit->setText( i18n("String Replacer") );
|
||||
substLView->setRowCount(0);
|
||||
// Default App ID is blank.
|
||||
appIdLineEdit->setText(QLatin1String( "" ) );
|
||||
enableDisableButtons();
|
||||
// kDebug() << "StringReplacerConf::defaults: Exiting";
|
||||
}
|
||||
|
||||
bool StringReplacerConf::supportsMultiInstance() { return true; }
|
||||
|
||||
QString StringReplacerConf::userPlugInName()
|
||||
{
|
||||
if ( substLView->rowCount() == 0 ) return QString();
|
||||
QString instName = nameLineEdit->text();
|
||||
if ( instName.isEmpty() )
|
||||
{
|
||||
QString language;
|
||||
if (m_languageCodeList.count() == 1)
|
||||
language = KGlobal::locale()->languageCodeToName(m_languageCodeList[0]);
|
||||
if (m_languageCodeList.count() > 1)
|
||||
language = i18n("Multiple Languages");
|
||||
if (!language.isEmpty())
|
||||
instName = i18n("String Replacer") + QLatin1String( " (" ) + language + QLatin1Char( ')' );
|
||||
}
|
||||
return instName;
|
||||
}
|
||||
|
||||
// Converts a Substitution Type to displayable string.
|
||||
QString StringReplacerConf::substitutionTypeToString(const int substitutionType)
|
||||
{
|
||||
switch (substitutionType)
|
||||
{
|
||||
case stWord: return i18n("Word");
|
||||
case stRegExp: return i18nc("Abbreviation for 'Regular Expresion'", "RegExp");
|
||||
}
|
||||
return i18n("Error");
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotLanguageBrowseButton_clicked()
|
||||
{
|
||||
QPointer<SelectLanguageDlg> dlg = new SelectLanguageDlg(
|
||||
this,
|
||||
i18n("Select Languages"),
|
||||
QStringList(m_languageCodeList),
|
||||
SelectLanguageDlg::MultipleSelect,
|
||||
SelectLanguageDlg::BlankAllowed);
|
||||
int dlgResult = dlg->exec();
|
||||
if (dlgResult == QDialog::Accepted)
|
||||
m_languageCodeList = dlg->selectedLanguageCodes();
|
||||
delete dlg;
|
||||
if (dlgResult != QDialog::Accepted) return;
|
||||
QString language;
|
||||
for ( int ndx=0; ndx < m_languageCodeList.count(); ++ndx)
|
||||
{
|
||||
if (!language.isEmpty()) language += QLatin1Char( ',' );
|
||||
language += KGlobal::locale()->languageCodeToName(m_languageCodeList[ndx]);
|
||||
}
|
||||
QString s1 = languageLineEdit->text();
|
||||
languageLineEdit->setText(language);
|
||||
// Replace language in the user's filter name.
|
||||
QString s2 = nameLineEdit->text();
|
||||
if (m_languageCodeList.count() > 1) language = i18n("Multiple Languages");
|
||||
if ( !s1.isEmpty() )
|
||||
{
|
||||
s2.replace( s1, language );
|
||||
s2.replace( i18n("Multiple Languages"), language );
|
||||
}
|
||||
s2.remove(QLatin1String( " ()" ));
|
||||
if ( !s2.contains(QLatin1Char('(' )) && !language.isEmpty() ) s2 += QLatin1String( " (" ) + language + QLatin1Char( ')' );
|
||||
nameLineEdit->setText(s2);
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void StringReplacerConf::enableDisableButtons()
|
||||
{
|
||||
int row = substLView->currentRow();
|
||||
bool enableBtn = (row >= 0 && row < substLView->rowCount());
|
||||
if (enableBtn)
|
||||
{
|
||||
upButton->setEnabled(row > 0);
|
||||
downButton->setEnabled(row < (substLView->rowCount() - 1));
|
||||
} else {
|
||||
upButton->setEnabled(false);
|
||||
downButton->setEnabled(false);
|
||||
}
|
||||
editButton->setEnabled(enableBtn);
|
||||
removeButton->setEnabled(enableBtn);
|
||||
clearButton->setEnabled(substLView->rowCount() > 0);
|
||||
saveButton->setEnabled(substLView->rowCount() > 0);
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotUpButton_clicked()
|
||||
{
|
||||
int row = substLView->currentRow();
|
||||
if (row < 1 || row >= substLView->rowCount()) return;
|
||||
|
||||
QTableWidgetItem *itemAbove = substLView->item(row - 1, 0);
|
||||
QTableWidgetItem *item = substLView->item(row, 0);
|
||||
QString t = itemAbove->text();
|
||||
itemAbove->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
itemAbove = substLView->item(row - 1, 1);
|
||||
item = substLView->item(row, 1);
|
||||
t = itemAbove->text();
|
||||
itemAbove->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
itemAbove = substLView->item(row - 1, 2);
|
||||
item = substLView->item(row, 2);
|
||||
t = itemAbove->text();
|
||||
itemAbove->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
itemAbove = substLView->item(row - 1, 3);
|
||||
item = substLView->item(row, 3);
|
||||
t = itemAbove->text();
|
||||
itemAbove->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
substLView->setCurrentItem(substLView->item(row - 1, substLView->currentColumn()));
|
||||
// TODO: Is this needed? substLView->scrollTo(substLView->indexFromItem(itemAbove));
|
||||
enableDisableButtons();
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotDownButton_clicked()
|
||||
{
|
||||
int row = substLView->currentRow();
|
||||
if (row < 0 || row >= substLView->rowCount() - 1) return;
|
||||
|
||||
QTableWidgetItem *itemBelow = substLView->item(row + 1, 0);
|
||||
QTableWidgetItem *item = substLView->item(row, 0);
|
||||
QString t = itemBelow->text();
|
||||
itemBelow->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
itemBelow = substLView->item(row + 1, 1);
|
||||
item = substLView->item(row, 1);
|
||||
t = itemBelow->text();
|
||||
itemBelow->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
itemBelow = substLView->item(row + 1, 2);
|
||||
item = substLView->item(row, 2);
|
||||
t = itemBelow->text();
|
||||
itemBelow->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
itemBelow = substLView->item(row + 1, 3);
|
||||
item = substLView->item(row, 3);
|
||||
t = itemBelow->text();
|
||||
itemBelow->setText(item->text());
|
||||
item->setText(t);
|
||||
|
||||
substLView->setCurrentItem(substLView->item(row + 1, substLView->currentColumn()));
|
||||
// TODO: Is this needed? substLView->scrollTo(substLView->indexFromItem(itemBelow));
|
||||
enableDisableButtons();
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotAddButton_clicked()
|
||||
{
|
||||
addOrEditSubstitution( true );
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotEditButton_clicked()
|
||||
{
|
||||
addOrEditSubstitution( false );
|
||||
}
|
||||
|
||||
// Displays the add/edit string replacement dialog.
|
||||
void StringReplacerConf::addOrEditSubstitution(bool isAdd)
|
||||
{
|
||||
int row;
|
||||
if (isAdd)
|
||||
row = substLView->rowCount() - 1;
|
||||
else
|
||||
row = substLView->currentRow();
|
||||
// Create widget.
|
||||
QWidget *w = new QWidget();
|
||||
m_editWidget = new Ui::EditReplacementWidget();
|
||||
m_editWidget->setupUi( w );
|
||||
// Set controls if editing existing.
|
||||
m_editWidget->matchButton->setEnabled( false );
|
||||
if (!isAdd)
|
||||
{
|
||||
if ( substLView->item(row, 0)->text() != i18n("Word") )
|
||||
{
|
||||
m_editWidget->regexpRadioButton->setChecked( true );
|
||||
m_editWidget->matchButton->setEnabled( m_reEditorInstalled );
|
||||
}
|
||||
if ( substLView->item(row, 1)->text() == i18nc("Yes or no", "Yes") )
|
||||
m_editWidget->matchCaseCheckBox->setChecked( true );
|
||||
m_editWidget->matchLineEdit->setText( substLView->item(row, 2)->text() );
|
||||
m_editWidget->substLineEdit->setText( substLView->item(row, 3)->text() );
|
||||
}
|
||||
// The match box may not be blank.
|
||||
connect( m_editWidget->matchLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(slotMatchLineEdit_textChanged(QString)) );
|
||||
connect( m_editWidget->regexpRadioButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotTypeButtonGroup_clicked()) );
|
||||
connect( m_editWidget->wordRadioButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotTypeButtonGroup_clicked()) );
|
||||
connect( m_editWidget->matchButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotMatchButton_clicked()) );
|
||||
// Display the box in a dialog.
|
||||
m_editDlg = new KDialog(this);
|
||||
m_editDlg->setCaption(i18n("Edit String Replacement"));
|
||||
m_editDlg->setButtons(KDialog::Help|KDialog::Ok|KDialog::Cancel);
|
||||
// TODO: KDialog bug workaround. Remove when no longer needed.
|
||||
m_editDlg->setDefaultButton(KDialog::Cancel);
|
||||
// Disable OK button if match field blank.
|
||||
m_editDlg->setMainWidget( w );
|
||||
m_editDlg->setHelp( QLatin1String( "" ), QLatin1String( "jovie" ) );
|
||||
m_editDlg->enableButton( KDialog::Ok, !m_editWidget->matchLineEdit->text().isEmpty() );
|
||||
int dlgResult = m_editDlg->exec();
|
||||
QString substType = i18n( "Word" );
|
||||
if ( m_editWidget->regexpRadioButton->isChecked() )
|
||||
substType = i18nc("Abbreviation for 'Regular Expression'", "RegExp");
|
||||
QString matchCase = m_editWidget->matchCaseCheckBox->isChecked()?i18nc("Yes or no", "Yes"):i18nc("Yes or no", "No");
|
||||
QString match = m_editWidget->matchLineEdit->text();
|
||||
QString subst = m_editWidget->substLineEdit->text();
|
||||
delete m_editDlg;
|
||||
delete m_editWidget;
|
||||
m_editDlg = 0;
|
||||
m_editWidget = 0;
|
||||
if (dlgResult != QDialog::Accepted) return;
|
||||
// TODO: Also delete QTableWidget and w?
|
||||
if ( match.isEmpty() ) return;
|
||||
if ( isAdd )
|
||||
{
|
||||
row = substLView->rowCount();
|
||||
substLView->setRowCount(row + 1);
|
||||
substLView->setCurrentItem(substLView->item(row, 0));
|
||||
for (int i = 0; i <= 4; ++i)
|
||||
substLView->setItem(row, i, new QTableWidgetItem(QLatin1String( "" )));
|
||||
}
|
||||
substLView->item(row, 0)->setText(substType);
|
||||
substLView->item(row, 1)->setText(matchCase);
|
||||
substLView->item(row, 2)->setText(match);
|
||||
substLView->item(row, 3)->setText(subst);
|
||||
// TODO: Is this needed? substLView->scrollTo(substLView->indexFromItem(substLView->item(row,0)));
|
||||
enableDisableButtons();
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotMatchLineEdit_textChanged(const QString& text)
|
||||
{
|
||||
// Disable OK button if match field blank.
|
||||
if ( !m_editDlg ) return;
|
||||
m_editDlg->enableButton( KDialog::Ok, !text.isEmpty() );
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotRemoveButton_clicked()
|
||||
{
|
||||
int row = substLView->currentRow();
|
||||
if (row <= 0 || row >= substLView->rowCount()) return;
|
||||
delete substLView->takeItem(row, 0);
|
||||
delete substLView->takeItem(row, 1);
|
||||
delete substLView->takeItem(row, 2);
|
||||
delete substLView->takeItem(row, 3);
|
||||
substLView->removeRow(row);
|
||||
enableDisableButtons();
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotTypeButtonGroup_clicked()
|
||||
{
|
||||
// Enable Regular Expression Editor button if editor is installed (requires kdeutils).
|
||||
if ( !m_editWidget ) return;
|
||||
m_editWidget->matchButton->setEnabled( m_editWidget->regexpRadioButton->isChecked() && m_reEditorInstalled );
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotMatchButton_clicked()
|
||||
{
|
||||
// Show Regular Expression Editor dialog if it is installed.
|
||||
if ( !m_editWidget ) return;
|
||||
if ( !m_editDlg ) return;
|
||||
if ( !m_reEditorInstalled ) return;
|
||||
KDialog *editorDialog =
|
||||
KServiceTypeTrader::createInstanceFromQuery<KDialog>( QLatin1String( "KRegExpEditor/KRegExpEditor" ) );
|
||||
if ( editorDialog )
|
||||
{
|
||||
// kdeutils was installed, so the dialog was found. Fetch the editor interface.
|
||||
|
||||
KRegExpEditorInterface *reEditor = qobject_cast<KRegExpEditorInterface*>( editorDialog );
|
||||
Q_ASSERT( reEditor ); // This should not fail!// now use the editor.
|
||||
reEditor->setRegExp( m_editWidget->matchLineEdit->text() );
|
||||
int dlgResult = editorDialog->exec();
|
||||
if ( dlgResult == QDialog::Accepted )
|
||||
{
|
||||
QString re = reEditor->regExp();
|
||||
m_editWidget->matchLineEdit->setText( re );
|
||||
m_editDlg->enableButton( KDialog::Ok, !re.isEmpty() );
|
||||
}
|
||||
delete editorDialog;
|
||||
} else return;
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotLoadButton_clicked()
|
||||
{
|
||||
QStringList dataDirs = KGlobal::dirs()->findAllResources("data", QLatin1String( "jovie/stringreplacer/" ));
|
||||
QString dataDir;
|
||||
if (!dataDirs.isEmpty()) dataDir = dataDirs.last();
|
||||
QString filename = KFileDialog::getOpenFileName(
|
||||
dataDir,
|
||||
QLatin1String( "*.xml|" ) + i18n( "String Replacer Word List (*.xml)" ),
|
||||
this,
|
||||
QLatin1String( "stringreplacer_loadfile" ));
|
||||
if ( filename.isEmpty() ) return;
|
||||
QString errMsg = loadFromFile( filename, false );
|
||||
enableDisableButtons();
|
||||
if ( !errMsg.isEmpty() )
|
||||
KMessageBox::sorry( this, errMsg, i18n("Error Opening File") );
|
||||
else
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotSaveButton_clicked()
|
||||
{
|
||||
QString filename = KFileDialog::getSaveFileName(
|
||||
KGlobal::dirs()->saveLocation( "data" ,QLatin1String( "kttsd/stringreplacer/" ), false ),
|
||||
QLatin1String( "*.xml|" ) + i18n( "String Replacer Word List (*.xml)" ),
|
||||
this,
|
||||
QLatin1String( "stringreplacer_savefile" ));
|
||||
if ( filename.isEmpty() ) return;
|
||||
QString errMsg = saveToFile( filename );
|
||||
enableDisableButtons();
|
||||
if ( !errMsg.isEmpty() )
|
||||
KMessageBox::sorry( this, errMsg, i18n("Error Opening File") );
|
||||
}
|
||||
|
||||
void StringReplacerConf::slotClearButton_clicked()
|
||||
{
|
||||
substLView->setRowCount(0);
|
||||
enableDisableButtons();
|
||||
}
|
||||
|
|
@ -1,159 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic String Replacement Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 STRINGREPLACERCONF_H
|
||||
#define STRINGREPLACERCONF_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
// KDE includes.
|
||||
#include <kconfig.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterconf.h"
|
||||
|
||||
// StringReplacer includes.
|
||||
#include "ui_stringreplacerconfwidget.h"
|
||||
#include "ui_editreplacementwidget.h"
|
||||
|
||||
class KDialog;
|
||||
|
||||
class StringReplacerConf : public KttsFilterConf, public Ui::StringReplacerConfWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
explicit StringReplacerConf( QWidget *parent, const QVariantList &args = QVariantList() );
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~StringReplacerConf();
|
||||
|
||||
enum SubstitutionType {
|
||||
stWord, // Word
|
||||
stRegExp // Regular Expression
|
||||
};
|
||||
|
||||
/**
|
||||
* This method is invoked whenever the module should read its
|
||||
* configuration (most of the times from a config file) and update the
|
||||
* user interface. This happens when the user clicks the "Reset" button in
|
||||
* the control center, to undo all of his changes and restore the currently
|
||||
* valid settings. Note that KTTSMGR calls this when the plugin is
|
||||
* loaded, so it not necessary to call it in your constructor.
|
||||
* The plugin should read its configuration from the specified group
|
||||
* in the specified config file.
|
||||
* @param c Pointer to a KConfig object.
|
||||
* @param configGroup Call config->setGroup with this argument before
|
||||
* loading your configuration.
|
||||
*
|
||||
* When a plugin is first added to KTTSMGR, @e load will be called with
|
||||
* a Null @e configGroup. In this case, the plugin will not have
|
||||
* any instance-specific parameters to load, but it may still wish
|
||||
* to load parameters that apply to all instances of the plugin.
|
||||
*/
|
||||
virtual void load(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* This function gets called when the user wants to save the settings in
|
||||
* the user interface, updating the config files or wherever the
|
||||
* configuration is stored. The method is called when the user clicks "Apply"
|
||||
* or "Ok". The plugin should save its configuration in the specified
|
||||
* group of the specified config file.
|
||||
* @param c Pointer to a KConfig object.
|
||||
* @param configGroup Call config->setGroup with this argument before
|
||||
* saving your configuration.
|
||||
*/
|
||||
virtual void save(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* This function is called to set the settings in the module to sensible
|
||||
* default values. It gets called when hitting the "Default" button. The
|
||||
* default values should probably be the same as the ones the application
|
||||
* uses when started without a config file. Note that defaults should
|
||||
* be applied to the on-screen widgets; not to the config file.
|
||||
*/
|
||||
virtual void defaults();
|
||||
|
||||
/**
|
||||
* Indicates whether the plugin supports multiple instances. Return
|
||||
* False if only one instance of the plugin can be configured.
|
||||
* @return True if multiple instances are possible.
|
||||
*/
|
||||
virtual bool supportsMultiInstance();
|
||||
|
||||
/**
|
||||
* Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
|
||||
* If there can be more than one instance of a filter, it should return
|
||||
* a unique name for each instance. The name should be translated for
|
||||
* the user if possible. If the plugin is not correctly configured,
|
||||
* return an empty string.
|
||||
* @return Filter instance name.
|
||||
*/
|
||||
virtual QString userPlugInName();
|
||||
|
||||
private slots:
|
||||
void slotLanguageBrowseButton_clicked();
|
||||
void slotAddButton_clicked();
|
||||
void slotUpButton_clicked();
|
||||
void slotDownButton_clicked();
|
||||
void slotEditButton_clicked();
|
||||
void slotRemoveButton_clicked();
|
||||
void slotMatchLineEdit_textChanged(const QString& text);
|
||||
void slotTypeButtonGroup_clicked();
|
||||
void slotMatchButton_clicked();
|
||||
void slotLoadButton_clicked();
|
||||
void slotSaveButton_clicked();
|
||||
void slotClearButton_clicked();
|
||||
|
||||
// EnablesDisables buttons depending upon current item in list view.
|
||||
void enableDisableButtons();
|
||||
|
||||
private:
|
||||
// Converts a Substitution Type to displayable string.
|
||||
QString substitutionTypeToString(const int substitutionType);
|
||||
// Displays the add/edit string replacement dialog.
|
||||
void addOrEditSubstitution(bool isAdd);
|
||||
// Loads word list and settings from a file. Clearing configuration if clear is True.
|
||||
QString loadFromFile( const QString& filename, bool clear);
|
||||
// Saves word list and settings to a file.
|
||||
QString saveToFile( const QString& filename );
|
||||
|
||||
|
||||
// Edit Dialog and widget.
|
||||
KDialog* m_editDlg;
|
||||
Ui::EditReplacementWidget* m_editWidget;
|
||||
// True if kdeutils Regular Expression Editor is installed.
|
||||
bool m_reEditorInstalled;
|
||||
// Language Codes.
|
||||
QStringList m_languageCodeList;
|
||||
};
|
||||
|
||||
#endif //STRINGREPLACERCONF_H
|
|
@ -1,427 +0,0 @@
|
|||
<ui version="4.0" >
|
||||
<author>Gary Cramblitt <garycramblitt@comcast.net></author>
|
||||
<comment>Widget for configuring String Replacer Filter for KTTSD.</comment>
|
||||
<class>StringReplacerConfWidget</class>
|
||||
<widget class="QWidget" name="StringReplacerConfWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>548</width>
|
||||
<height>421</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Configure String Replacer</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string comment="What's this text" >Enter any name you like for this filter.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Name:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>nameLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="nameLineEdit" >
|
||||
<property name="whatsThis" >
|
||||
<string>Enter any name you like for this filter.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<widget class="QGroupBox" name="applyGroupBox" >
|
||||
<property name="whatsThis" >
|
||||
<string>These settings determines when the filter is applied to text.</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="languageLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string comment="What's this text" >This filter is applied to text jobs of the specified language. You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list. If blank the filter applies to all text jobs of any language.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Lan&guage is:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>languageLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="appIdLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string>Enter a D-Bus Application ID. This filter will only apply to text jobs queued by that application. You may enter more than one ID separated by commas. If blank, this filter applies to text jobs queued by all applications. Tip: Use kdcop from the command line to get the Application IDs of running applications. Example: "konversation, kvirc,ksirc,kopete"</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Application &ID contains:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>appIdLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="languageLineEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>This filter is applied to text jobs of the specified language. You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list. If blank the filter applies to all text jobs of any language.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="languageBrowseButton" >
|
||||
<property name="whatsThis" >
|
||||
<string>Click to select one or more languages. This filter will be applied to text jobs of those languages.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="appIdLineEdit" >
|
||||
<property name="whatsThis" >
|
||||
<string><qt>Enter a D-Bus Application ID. This filter will only apply to text jobs queued by that application. You may enter more than one ID separated by commas. Use <b>knotify</b> to match all messages sent as KDE notifications. If blank, this filter applies to text jobs queued by all applications. Tip: Use kdcop from the command line to get the Application IDs of running applications. Example: "konversation, kvirc,ksirc,kopete"</qt></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KPushButton" name="loadButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to load a word list from a file.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string comment="Load a word list from a file">Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="saveButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to save word list to a file.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="clearButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to empty the word list.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string comment="Clear the word list">Clear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="1" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KPushButton" name="addButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to add another word or regular expression to the list.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="upButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to move selected word up in the list. Words higher in the list are applied first.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Up</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="downButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to move a word down in the list. Words lower in the list are applied last.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Do&wn</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="editButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to modify an existing word or regular expression in the list.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="removeButton" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to remove a word or regular expression from the list.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QTableWidget" name="substLView" >
|
||||
<property name="editTriggers" >
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="selectionMode" >
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior" >
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="columnCount" >
|
||||
<number>4</number>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Type</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Match Case</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Match</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text" >
|
||||
<string>Replace With</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KPushButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kpushbutton.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>klineedit.h</header>
|
||||
<container>0</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>nameLineEdit</tabstop>
|
||||
<tabstop>addButton</tabstop>
|
||||
<tabstop>upButton</tabstop>
|
||||
<tabstop>downButton</tabstop>
|
||||
<tabstop>editButton</tabstop>
|
||||
<tabstop>removeButton</tabstop>
|
||||
<tabstop>loadButton</tabstop>
|
||||
<tabstop>saveButton</tabstop>
|
||||
<tabstop>clearButton</tabstop>
|
||||
<tabstop>languageLineEdit</tabstop>
|
||||
<tabstop>languageBrowseButton</tabstop>
|
||||
<tabstop>appIdLineEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,36 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generating the factories so String Replacer Filter can be used as plug in.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// KDE includes.
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
|
||||
#include "stringreplacerconf.h"
|
||||
#include "stringreplacerproc.h"
|
||||
|
||||
K_PLUGIN_FACTORY(StringReplacePluginFactory, registerPlugin<StringReplacerProc>(); registerPlugin<StringReplacerConf>();)
|
||||
K_EXPORT_PLUGIN(StringReplacePluginFactory("jovie"))
|
||||
|
|
@ -1,235 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic String Replacement Filter Processing class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// StringReplacer includes.
|
||||
#include "stringreplacerproc.h"
|
||||
#include "moc_stringreplacerproc.cpp"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtXml/qdom.h>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kglobal.h>
|
||||
#include <kstandarddirs.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
#include "talkercode.h"
|
||||
#include "cdataescaper.h"
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
StringReplacerProc::StringReplacerProc( QObject *parent, QVariantList list) :
|
||||
KttsFilterProc(parent, list)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
/*virtual*/ StringReplacerProc::~StringReplacerProc()
|
||||
{
|
||||
m_matchList.clear();
|
||||
m_substList.clear();
|
||||
}
|
||||
|
||||
bool StringReplacerProc::init(KConfig* c, const QString& configGroup){
|
||||
//kDebug() << "StringReplacerProc::init: Running";
|
||||
QString wordsFilename =
|
||||
KGlobal::dirs()->saveLocation( "data" ,QLatin1String( "kttsd/stringreplacer/" ), false );
|
||||
if ( wordsFilename.isEmpty() ) return false;
|
||||
wordsFilename += configGroup;
|
||||
KConfigGroup config( c, configGroup );
|
||||
wordsFilename = config.readEntry( "WordListFile", wordsFilename );
|
||||
|
||||
// Open existing word list.
|
||||
QFile file( wordsFilename );
|
||||
if ( !file.open( QIODevice::ReadOnly ) )
|
||||
{
|
||||
//kDebug() << "StringReplacerProc::init: couldn't open file " << wordsFilename;
|
||||
return false;
|
||||
}
|
||||
QDomDocument doc( QLatin1String( "" ) );
|
||||
if ( !doc.setContent( &file ) ) {
|
||||
//kDebug() << "StringReplacerProc::init: couldn't get xml from file " << wordsFilename;
|
||||
file.close();
|
||||
return false;
|
||||
}
|
||||
file.close();
|
||||
|
||||
// Clear list.
|
||||
m_matchList.clear();
|
||||
m_substList.clear();
|
||||
|
||||
// Name setting.
|
||||
// QDomNodeList nameList = doc.elementsByTagName( "name" );
|
||||
// QDomNode nameNode = nameList.item( 0 );
|
||||
// m_widget->nameLineEdit->setText( nameNode.toElement().text() );
|
||||
|
||||
// Language Codes setting. List may be single element of comma-separated values,
|
||||
// or multiple elements.
|
||||
m_languageCodeList.clear();
|
||||
QDomNodeList languageList = doc.elementsByTagName( QLatin1String( "language-code" ) );
|
||||
for ( int ndx=0; ndx < languageList.count(); ++ndx )
|
||||
{
|
||||
QDomNode languageNode = languageList.item( ndx );
|
||||
m_languageCodeList += languageNode.toElement().text().split( QLatin1Char(','), QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
// AppId. Apply this filter only if DCOP appId of application that queued
|
||||
// the text contains this string. List may be single element of comma-separated values,
|
||||
// or multiple elements.
|
||||
m_appIdList.clear();
|
||||
QDomNodeList appIdList = doc.elementsByTagName( QLatin1String( "appid" ) );
|
||||
for ( int ndx=0; ndx < appIdList.count(); ++ndx )
|
||||
{
|
||||
QDomNode appIdNode = appIdList.item( ndx );
|
||||
m_appIdList += appIdNode.toElement().text().split( QLatin1Char( ',' ), QString::SkipEmptyParts);
|
||||
}
|
||||
|
||||
// Word list.
|
||||
QDomNodeList wordList = doc.elementsByTagName(QLatin1String( "word" ) );
|
||||
const int wordListCount = wordList.count();
|
||||
for (int wordIndex = 0; wordIndex < wordListCount; ++wordIndex)
|
||||
{
|
||||
QDomNode wordNode = wordList.item(wordIndex);
|
||||
QDomNodeList propList = wordNode.childNodes();
|
||||
QString wordType;
|
||||
QString matchCase = QLatin1String( "No" ); // Default for old (v<=3.5.3) config files with no <case/>.
|
||||
QString match;
|
||||
QString subst;
|
||||
const int propListCount = propList.count();
|
||||
for (int propIndex = 0; propIndex < propListCount; ++propIndex)
|
||||
{
|
||||
QDomNode propNode = propList.item(propIndex);
|
||||
QDomElement prop = propNode.toElement();
|
||||
if (prop.tagName() == QLatin1String( "type" )) wordType = prop.text();
|
||||
if (prop.tagName() == QLatin1String( "case" )) matchCase = prop.text();
|
||||
if (prop.tagName() == QLatin1String( "match" ))
|
||||
{
|
||||
match = prop.text();
|
||||
cdataUnescape( &match );
|
||||
}
|
||||
if (prop.tagName() == QLatin1String( "subst" ))
|
||||
{
|
||||
subst = prop.text();
|
||||
cdataUnescape( &subst );
|
||||
}
|
||||
}
|
||||
// Build Regular Expression for each word's match string.
|
||||
QRegExp rx;
|
||||
rx.setCaseSensitivity(matchCase == QLatin1String( "Yes" )?Qt::CaseInsensitive:Qt::CaseSensitive);
|
||||
if ( wordType == QLatin1String( "Word" ) )
|
||||
{
|
||||
// TODO: Does \b honor strange non-Latin1 encodings?
|
||||
rx.setPattern( QLatin1String( "\\b" ) + match + QLatin1String( "\\b" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
rx.setPattern( match );
|
||||
}
|
||||
// Add Regular Expression to list (if valid).
|
||||
if ( rx.isValid() )
|
||||
{
|
||||
m_matchList.append( rx );
|
||||
m_substList.append( subst );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert input, returning output.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
*/
|
||||
/*virtual*/ QString StringReplacerProc::convert(const QString& inputText, TalkerCode* talkerCode,
|
||||
const QString& appId)
|
||||
{
|
||||
Q_UNUSED(talkerCode);
|
||||
m_wasModified = false;
|
||||
// If language doesn't match, return input unmolested.
|
||||
//if ( !m_languageCodeList.isEmpty() )
|
||||
//{
|
||||
// QString languageCode = talkerCode->languageCode();
|
||||
// //kDebug() << "StringReplacerProc::convert: converting " << inputText <<
|
||||
// // " if language code " << languageCode << " matches " << m_languageCodeList << endl;
|
||||
// if ( !m_languageCodeList.contains( languageCode ) )
|
||||
// {
|
||||
// if ( !talkerCode->countryCode().isEmpty() )
|
||||
// {
|
||||
// languageCode += '_' + talkerCode->countryCode();
|
||||
// //kDebug() << "StringReplacerProc::convert: converting " << inputText <<
|
||||
// // " if language code " << languageCode << " matches " << m_languageCodeList << endl;
|
||||
// if ( !m_languageCodeList.contains( languageCode ) ) return inputText;
|
||||
// } else return inputText;
|
||||
// }
|
||||
//}
|
||||
// If appId doesn't match, return input unmolested.
|
||||
if ( !m_appIdList.isEmpty() )
|
||||
{
|
||||
//kDebug() << "StringReplacerProc::convert: converting " << inputText << " if appId "
|
||||
// << appId << " matches " << m_appIdList << endl;
|
||||
bool found = false;
|
||||
QString appIdStr = appId;
|
||||
for ( int ndx=0; ndx < m_appIdList.count(); ++ndx )
|
||||
{
|
||||
if ( appIdStr.contains(m_appIdList[ndx]) )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
//kDebug() << "StringReplacerProc::convert: appId not found";
|
||||
return inputText;
|
||||
}
|
||||
}
|
||||
QString newText = inputText;
|
||||
const int listCount = m_matchList.count();
|
||||
for ( int index = 0; index < listCount; ++index )
|
||||
{
|
||||
//kDebug() << "newtext = " << newText << " matching " << m_matchList[index].pattern() << " replacing with " << m_substList[index];
|
||||
newText.replace( m_matchList[index], m_substList[index] );
|
||||
}
|
||||
m_wasModified = true;
|
||||
return newText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Did this filter do anything? If the filter returns the input as output
|
||||
* unmolested, it should return False when this method is called.
|
||||
*/
|
||||
/*virtual*/ bool StringReplacerProc::wasModified() { return m_wasModified; }
|
||||
|
|
@ -1,94 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic String Replacement Filter Processing class.
|
||||
This is the interface definition for text filters.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 STRINGREPLACERPROC_H
|
||||
#define STRINGREPLACERPROC_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
|
||||
class StringReplacerProc : public KttsFilterProc
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
explicit StringReplacerProc( QObject *parent, QVariantList list = QVariantList() );
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~StringReplacerProc();
|
||||
|
||||
/**
|
||||
* Initialize the filter.
|
||||
* @param c Settings object.
|
||||
* @param configGroup Settings Group.
|
||||
* @return False if filter is not ready to filter.
|
||||
*
|
||||
* Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain
|
||||
* separate configuration files of their own.
|
||||
*/
|
||||
virtual bool init(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* Convert input, returning output.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
*/
|
||||
virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
|
||||
|
||||
/**
|
||||
* Did this filter do anything? If the filter returns the input as output
|
||||
* unmolested, it should return False when this method is called.
|
||||
*/
|
||||
virtual bool wasModified();
|
||||
|
||||
private:
|
||||
// Language codes supported by the filter.
|
||||
QStringList m_languageCodeList;
|
||||
// If not empty, apply filter only to apps containing one or more of these strings.
|
||||
QStringList m_appIdList;
|
||||
|
||||
// List of regular expressions to match.
|
||||
QList<QRegExp> m_matchList;
|
||||
// List of substitutions to replace matches.
|
||||
QList<QString> m_substList;
|
||||
// True if this filter did anything to the text.
|
||||
bool m_wasModified;
|
||||
};
|
||||
|
||||
#endif // STRINGREPLACERPROC_H
|
|
@ -1,35 +0,0 @@
|
|||
#include <QtTest>
|
||||
#include "testcdataescaper.h"
|
||||
#include "cdataescaper.h"
|
||||
|
||||
static const QString original(
|
||||
QString::fromAscii("foo & bar ]]> baz")
|
||||
);
|
||||
static const QString escaped(
|
||||
QString::fromAscii("foo & bar ]]> baz")
|
||||
);
|
||||
|
||||
void TestCDATAEscaper::escape()
|
||||
{
|
||||
QString s(original);
|
||||
cdataEscape(&s);
|
||||
QCOMPARE(s, escaped);
|
||||
}
|
||||
|
||||
void TestCDATAEscaper::unescape()
|
||||
{
|
||||
QString s(escaped);
|
||||
cdataUnescape(&s);
|
||||
QCOMPARE(s, original);
|
||||
}
|
||||
|
||||
void TestCDATAEscaper::roundtrip()
|
||||
{
|
||||
QString s(original);
|
||||
cdataEscape(&s);
|
||||
cdataUnescape(&s);
|
||||
QCOMPARE(s, original);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestCDATAEscaper)
|
||||
#include "moc_testcdataescaper.cpp"
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef TESTCDATAESCAPER_H
|
||||
#define TESTCDATAESCAPER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class TestCDATAEscaper : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private slots:
|
||||
void escape();
|
||||
void unescape();
|
||||
void roundtrip();
|
||||
};
|
||||
|
||||
#endif // TESTCDATAESCAPER_H
|
|
@ -1,29 +0,0 @@
|
|||
########### next target ###############
|
||||
|
||||
set(jovie_talkerchooserplugin_PART_SRCS
|
||||
selecttalkerdlg.cpp
|
||||
talkerchooserconf.cpp
|
||||
talkerchooserproc.cpp
|
||||
talkerchooserplugin.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin(jovie_talkerchooserplugin ${jovie_talkerchooserplugin_PART_SRCS})
|
||||
|
||||
target_link_libraries(jovie_talkerchooserplugin ${KDE4_KIO_LIBS} kttsd)
|
||||
|
||||
install(
|
||||
TARGETS jovie_talkerchooserplugin
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(
|
||||
FILES female_notifications_rc
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/jovie/talkerchooser
|
||||
)
|
||||
|
||||
install(
|
||||
FILES jovie_talkerchooserplugin.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
|
@ -1,10 +0,0 @@
|
|||
[Filter]
|
||||
AppIDs=knotify
|
||||
Gender=*female
|
||||
LanguageCode=
|
||||
MatchRegExp=
|
||||
Rate=
|
||||
SynthName=
|
||||
TalkerCode=<voice gender="*female" />
|
||||
UserFilterName=Obsolete. Use Notifications tab instead.
|
||||
Volume=
|
|
@ -1,117 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=Talker Chooser
|
||||
Name[ar]=منتقي المتكلم
|
||||
Name[ast]=Seleutor de lleutores
|
||||
Name[bg]=Избор на глас
|
||||
Name[bs]=Birač govornika
|
||||
Name[ca]=Selector de parla
|
||||
Name[ca@valencia]=Selector de parla
|
||||
Name[cs]=Výběr hlasu
|
||||
Name[da]=Vælger af oplæser
|
||||
Name[de]=Sprecherauswahl
|
||||
Name[el]=Επιλογή εκφωνητή
|
||||
Name[en_GB]=Talker Chooser
|
||||
Name[es]=Selector de lectores
|
||||
Name[et]=Kõneleja valimine
|
||||
Name[eu]=Talker Chooser
|
||||
Name[fa]=انتخابکننده گوینده
|
||||
Name[fi]=Puhujanvalitsin
|
||||
Name[fr]=Sélecteur de locuteur
|
||||
Name[ga]=Roghnóir Cainteora
|
||||
Name[gl]=Escolla de orador
|
||||
Name[hi]=वार्ताकार चयनिक
|
||||
Name[hne]=वार्ताकार चयनिक
|
||||
Name[hr]=Govornički izbornik
|
||||
Name[hu]=Hangválasztó
|
||||
Name[is]=Talveljari
|
||||
Name[it]=Selezione dell'oratore
|
||||
Name[ja]=話者選択
|
||||
Name[kk]=Дауыс таңдағышы
|
||||
Name[km]=ឧបករណ៍ជ្រើសអ្នកនិយាយ
|
||||
Name[ko]=화자 선택기
|
||||
Name[ku]=Bijarkerê Axivbêj
|
||||
Name[lt]=Kalbėtojo pasirinkimas
|
||||
Name[lv]=Runātāja izvēle
|
||||
Name[mk]=Избирач на говорникот
|
||||
Name[ml]=സംസാരിയെ തെരഞ്ഞെടുക്കുന്നവന്
|
||||
Name[mr]=बोलणारा निवडणारा
|
||||
Name[ms]=Pemilih Penutur
|
||||
Name[nb]=Snakkervelger
|
||||
Name[nds]=Snacker-Köör
|
||||
Name[ne]=वक्ता चयनकर्ता
|
||||
Name[nl]=Spreker kiezen
|
||||
Name[nn]=Val av talar
|
||||
Name[pa]=ਬੋਲਚਾਲ ਚੋਣਕਾਰ
|
||||
Name[pl]=Wybieranie Mówców
|
||||
Name[pt]=Escolha do Locutor
|
||||
Name[pt_BR]=Escolha do locutor
|
||||
Name[ro]=Selector de vorbitor
|
||||
Name[ru]=Диктор
|
||||
Name[sk]=Voľba hovorcu
|
||||
Name[sl]=Izbirnik govornika
|
||||
Name[sq]=Përzgjedhës i të Folurit
|
||||
Name[sr]=Бирач говорника
|
||||
Name[sr@ijekavian]=Бирач говорника
|
||||
Name[sr@ijekavianlatin]=Birač govornika
|
||||
Name[sr@latin]=Birač govornika
|
||||
Name[sv]=Urval av talare
|
||||
Name[ta]=டாக்கர் தேர்ந்தெடுப்பான்
|
||||
Name[tg]=Диктор
|
||||
Name[tr]=Konuşmacı Seçici
|
||||
Name[ug]=سۆزلىگۈچى تاللىغۇچ
|
||||
Name[uk]=Вибір диктора
|
||||
Name[vi]=Trình chọn Máy nói
|
||||
Name[x-test]=xxTalker Chooserxx
|
||||
Name[zh_CN]=朗读者选择器
|
||||
Name[zh_TW]=語音選擇器
|
||||
Comment=Generic Talker Chooser Filter Plugin for Jovie
|
||||
Comment[bg]=Приставка за избор на глас за Jovie
|
||||
Comment[bs]=Generički filterski priključak Jovie za biranje govornika
|
||||
Comment[ca]=Connector del filtre selector genèric de parla pel Jovie
|
||||
Comment[ca@valencia]=Connector del filtre selector genèric de parla pel Jovie
|
||||
Comment[cs]=Modul filtru výběru hlasu Jovie
|
||||
Comment[da]=Generisk vælger af oplæser til Jovie
|
||||
Comment[de]=Ein allgemeines Modul zur Sprecherauswahl für Jovie
|
||||
Comment[el]=Γενικό πρόσθετο φίλτρου επιλογής εκφωνητή για το Jovie
|
||||
Comment[en_GB]=Generic Talker Chooser Filter Plugin for Jovie
|
||||
Comment[es]=Complemento genérico de filtro de selección de locutor para Jovie
|
||||
Comment[et]=Jovie üldine kõneleja valimise filtri plugin
|
||||
Comment[eu]=Jovierentzako hizlariak hautatzeko iragazki plugin generikoa
|
||||
Comment[fi]=Jovien puhujanvalitsimen suodinliitännäinen
|
||||
Comment[fr]=Module externe de filtre générique pour la sélection de locuteur pour Jovie
|
||||
Comment[ga]=Roghnóir Cainteora i mBreiseán Ginearálta Jovie
|
||||
Comment[gl]=Complemento de filtro xenérico de selección de locutor para Jovie
|
||||
Comment[hr]=Generički priključak za Jovie za filtriranje govorničkog izbornika
|
||||
Comment[hu]=Általános hangkiválasztó modul a Jovie-hoz
|
||||
Comment[is]=Almennt talvalsíforrit fyrir Jovie
|
||||
Comment[it]=Estensione generica per il filtro di scelta dell'oratore per Jovie
|
||||
Comment[ja]=Jovie 用汎用話者選択フィルタプラグイン
|
||||
Comment[kk]=Jovie-нің дауысын таңдау жалпы сүзгі плагині
|
||||
Comment[ko]=Jovie 일반적 화자 선택기 플러그인
|
||||
Comment[lt]=Bendro pobūdžio kalbėtojo parinkimo filtro priedas, skirtas Jovie
|
||||
Comment[lv]=Vienkāršs runātāja izvēles spraudnis priekš Jovie
|
||||
Comment[nb]=Filter-programtillegg til Jovie for snakkervalg
|
||||
Comment[nds]=Jovie-Filtermoduul för dat Utsöken vun den Snacker
|
||||
Comment[nl]=Generieke filter-plugin voor Jovie om de spreker te kiezen
|
||||
Comment[nn]=Generelt tillegg for opplesarval i Jovie
|
||||
Comment[pl]=Zwykła wtyczka filtra wybierania mówcy dla Jovie
|
||||
Comment[pt]='Plugin' Genérico de Escolha do Locutor para o Jovie
|
||||
Comment[pt_BR]=Plugin genérico do filtro de escolha do locutor para o Jovie
|
||||
Comment[ru]=Модуль выбора диктора для Jovie
|
||||
Comment[sk]=Všeobecný modul filra pre voľbu hovorcu pre Jovie
|
||||
Comment[sl]=Splošni filtrirni vstavek za izbiro govornika za Jovie
|
||||
Comment[sr]=Генерички филтерски прикључак Џови за бирање говорника
|
||||
Comment[sr@ijekavian]=Генерички филтерски прикључак Џови за бирање говорника
|
||||
Comment[sr@ijekavianlatin]=Generički filterski priključak Džovi za biranje govornika
|
||||
Comment[sr@latin]=Generički filterski priključak Džovi za biranje govornika
|
||||
Comment[sv]=Insticksprogram för Jovie med generellt urvalsfilter för talare
|
||||
Comment[tr]=Jovie için Genel Konuşmacı Seçim Süzgeci Eklentisi
|
||||
Comment[ug]=Jovie نىڭ ئادەتتىكى سۆزلىگۈچى تاللىغۇچ سۈزگۈچ قىستۇرمىسى
|
||||
Comment[uk]=Загальний додаток фільтра вибору диктора для Jovie
|
||||
Comment[x-test]=xxGeneric Talker Chooser Filter Plugin for Joviexx
|
||||
Comment[zh_CN]=Jovie 通用朗读者选择过滤插件
|
||||
Comment[zh_TW]=Jovie 使用的一般語音選擇外掛程式
|
||||
Type=Service
|
||||
ServiceTypes=Jovie/FilterPlugin
|
||||
X-KDE-Library=jovie_talkerchooserplugin
|
||||
X-KDE-Languages=en,en_US,en_GB,en_CA,es,es_mx,cy,de,fi,cs,pl
|
|
@ -1,155 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Description:
|
||||
A dialog for user to select a Talker, either by specifying
|
||||
selected Talker attributes, or by specifying all attributes
|
||||
of an existing configured Talker.
|
||||
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 "selecttalkerdlg.h"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QRadioButton>
|
||||
#include <QtGui/QTableWidget>
|
||||
#include <QtGui/QHeaderView>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdialog.h>
|
||||
#include <kcombobox.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <klineedit.h>
|
||||
#include <kconfig.h>
|
||||
#include <kdebug.h>
|
||||
#include <kservicetypetrader.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "talkerlistmodel.h"
|
||||
#include "moc_selecttalkerdlg.cpp"
|
||||
|
||||
SelectTalkerDlg::SelectTalkerDlg(
|
||||
QWidget* parent,
|
||||
const char* name,
|
||||
const QString& caption,
|
||||
const QString& talkerCode,
|
||||
bool runningTalkers) :
|
||||
|
||||
KDialog(parent)
|
||||
{
|
||||
Q_UNUSED(name);
|
||||
setCaption(caption);
|
||||
setButtons(KDialog::Ok|KDialog::Cancel);
|
||||
m_widget = new Ui::SelectTalkerWidget();
|
||||
QWidget* w = new QWidget();
|
||||
m_widget->setupUi( w );
|
||||
m_talkerListModel = new TalkerListModel();
|
||||
m_widget->talkersView->setModel(m_talkerListModel);
|
||||
|
||||
setMainWidget( w );
|
||||
m_runningTalkers = runningTalkers;
|
||||
m_talkerCode = TalkerCode( talkerCode, false );
|
||||
|
||||
// Fill combo boxes.
|
||||
//KComboBox* cb;
|
||||
//= m_widget->genderComboBox;
|
||||
//cb->addItem( QString() );
|
||||
//cb->addItem( TalkerCode::translatedGender("male") );
|
||||
//cb->addItem( TalkerCode::translatedGender("female") );
|
||||
//cb->addItem( TalkerCode::translatedGender("neutral") );
|
||||
|
||||
//cb = m_widget->volumeComboBox;
|
||||
//cb->addItem( QString() );
|
||||
//cb->addItem( TalkerCode::translatedVolume("medium") );
|
||||
//cb->addItem( TalkerCode::translatedVolume("loud") );
|
||||
//cb->addItem( TalkerCode::translatedVolume("soft") );
|
||||
|
||||
//cb = m_widget->rateComboBox;
|
||||
//cb->addItem( QString() );
|
||||
//cb->addItem( TalkerCode::translatedRate("medium") );
|
||||
//cb->addItem( TalkerCode::translatedRate("fast") );
|
||||
//cb->addItem( TalkerCode::translatedRate("slow") );
|
||||
|
||||
//cb = m_widget->synthComboBox;
|
||||
//cb->addItem( QString() );
|
||||
//KService::List offers = KServiceTypeTrader::self()->query("KTTSD/SynthPlugin");
|
||||
//for(int i=0; i < offers.count() ; ++i)
|
||||
// cb->addItem(offers[i]->name());
|
||||
|
||||
// Fill List View with list of Talkers.
|
||||
KConfig config(QLatin1String( "kttsdrc" ));
|
||||
m_talkerListModel->loadTalkerCodesFromConfig(&config);
|
||||
|
||||
// Set initial radio button state.
|
||||
if ( talkerCode.isEmpty() )
|
||||
m_widget->useDefaultRadioButton->setChecked(true);
|
||||
else
|
||||
{
|
||||
m_widget->useSpecificTalkerRadioButton->setChecked(true);
|
||||
}
|
||||
|
||||
//applyTalkerCodeToControls();
|
||||
enableDisableControls();
|
||||
|
||||
connect(m_widget->useDefaultRadioButton, SIGNAL(clicked()),
|
||||
this, SLOT(configChanged()));
|
||||
connect(m_widget->useSpecificTalkerRadioButton, SIGNAL(clicked()),
|
||||
this, SLOT(configChanged()));
|
||||
|
||||
connect(m_widget->talkersView, SIGNAL(clicked(QModelIndex)),
|
||||
this, SLOT(slotTalkersView_clicked()));
|
||||
|
||||
m_widget->talkersView->setMinimumHeight( 120 );
|
||||
}
|
||||
|
||||
SelectTalkerDlg::~SelectTalkerDlg()
|
||||
{
|
||||
delete m_widget;
|
||||
}
|
||||
|
||||
QString SelectTalkerDlg::getSelectedTalkerCode()
|
||||
{
|
||||
return m_talkerCode.getTalkerCode();
|
||||
}
|
||||
|
||||
QString SelectTalkerDlg::getSelectedTranslatedDescription()
|
||||
{
|
||||
return m_talkerCode.getTranslatedDescription();
|
||||
}
|
||||
|
||||
void SelectTalkerDlg::slotTalkersView_clicked()
|
||||
{
|
||||
QModelIndex modelIndex = m_widget->talkersView->currentIndex();
|
||||
if (!modelIndex.isValid()) return;
|
||||
if (!m_widget->useSpecificTalkerRadioButton->isChecked()) return;
|
||||
m_talkerCode = m_talkerListModel->getRow(modelIndex.row());
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void SelectTalkerDlg::configChanged()
|
||||
{
|
||||
enableDisableControls();
|
||||
}
|
||||
|
||||
void SelectTalkerDlg::enableDisableControls()
|
||||
{
|
||||
bool enableSpecific = ( m_widget->useSpecificTalkerRadioButton->isChecked() );
|
||||
m_widget->talkersView->setEnabled( enableSpecific );
|
||||
}
|
|
@ -1,107 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Description:
|
||||
A dialog for user to select a Talker, either by specifying
|
||||
selected Talker attributes, or by specifying all attributes
|
||||
of an existing configured Talker.
|
||||
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 SELECTTALKERDLG_H
|
||||
#define SELECTTALKERDLG_H
|
||||
|
||||
// KDE includes.
|
||||
#include <kdialog.h>
|
||||
#include <klocale.h>
|
||||
#include <kdemacros.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "talkercode.h"
|
||||
#include "ui_selecttalkerwidget.h"
|
||||
|
||||
class TalkerListModel;
|
||||
|
||||
class KDE_EXPORT SelectTalkerDlg : public KDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
* @param parent The parent for this dialog.
|
||||
* @param name Name for this dialog.
|
||||
* @param caption Displayed title for this dialog.
|
||||
* @param talkerCode A suggested starting Talker Code.
|
||||
* @param runningTalkers If true, lists configured and Applied Talkers in the running
|
||||
* KTTSD. If false, lists Talkers in the KTTSMgr Talker tab
|
||||
* (which may not yet have been Applied).
|
||||
*/
|
||||
explicit SelectTalkerDlg(
|
||||
QWidget* parent = 0,
|
||||
const char* name = "selecttalkerdialog",
|
||||
const QString& caption = i18n("Select Talker"),
|
||||
const QString& talkerCode = QString(),
|
||||
bool runningTalkers = false);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~SelectTalkerDlg();
|
||||
|
||||
/**
|
||||
* Returns the Talker Code user chose. QString() if default Talker chosen.
|
||||
* Note that if user did not choose a specific Talker, this will be a partial Talker Code.
|
||||
*/
|
||||
QString getSelectedTalkerCode();
|
||||
/**
|
||||
* Returns the Talker user chose in a translated displayable format.
|
||||
*/
|
||||
QString getSelectedTranslatedDescription();
|
||||
|
||||
private slots:
|
||||
void slotTalkersView_clicked();
|
||||
void configChanged();
|
||||
|
||||
private:
|
||||
enum TalkerListViewColumn
|
||||
{
|
||||
tlvcLanguage,
|
||||
tlvcSynthName,
|
||||
tlvcVoice,
|
||||
tlvcGender,
|
||||
tlvcVolume,
|
||||
tlvcRate
|
||||
};
|
||||
|
||||
void applyTalkerCodeToControls();
|
||||
void applyControlsToTalkerCode();
|
||||
void enableDisableControls();
|
||||
|
||||
// Main dialog widget.
|
||||
Ui::SelectTalkerWidget* m_widget;
|
||||
// Model containing list of Talker Codes.
|
||||
TalkerListModel* m_talkerListModel;
|
||||
// True if list of Talkers should be taken from config file.
|
||||
bool m_runningTalkers;
|
||||
// Current Talker Code.
|
||||
TalkerCode m_talkerCode;
|
||||
};
|
||||
|
||||
#endif // SELECTTALKERDLG_H
|
|
@ -1,87 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<author>Gary Cramblitt <garycramblitt@comcast.net></author>
|
||||
<class>SelectTalkerWidget</class>
|
||||
<widget class="QWidget" name="SelectTalkerWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>584</width>
|
||||
<height>472</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Select Talker</string>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>8</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTreeView" name="talkersView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="useDefaultRadioButton">
|
||||
<property name="whatsThis">
|
||||
<string>When checked, will use the default Talker, which is the topmost Talker listed in the Talkers tab.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Use default Talker</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="useSpecificTalkerRadioButton">
|
||||
<property name="whatsThis">
|
||||
<string>When checked, will use the specific Talker (if it is still configured), otherwise the Talker most closely matching.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use specific &Talker</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>useDefaultRadioButton</tabstop>
|
||||
<tabstop>useSpecificTalkerRadioButton</tabstop>
|
||||
<tabstop>talkersView</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,243 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic Talker Chooser Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// TalkerChooser includes.
|
||||
#include "talkerchooserconf.h"
|
||||
#include "moc_talkerchooserconf.cpp"
|
||||
|
||||
// Qt includes.
|
||||
|
||||
|
||||
// KDE includes.
|
||||
#include <klocale.h>
|
||||
#include <klineedit.h>
|
||||
#include <kdialog.h>
|
||||
#include <kcombobox.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <kconfig.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kregexpeditorinterface.h>
|
||||
#include <kfiledialog.h>
|
||||
#include <kservicetypetrader.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "selecttalkerdlg.h"
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
TalkerChooserConf::TalkerChooserConf( QWidget *parent, const QVariantList & args) :
|
||||
KttsFilterConf(parent, args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
// kDebug() << "TalkerChooserConf::TalkerChooserConf: Running";
|
||||
|
||||
// Create configuration widget.
|
||||
setupUi(this);
|
||||
|
||||
// Determine if kdeutils Regular Expression Editor is installed.
|
||||
m_reEditorInstalled = !KServiceTypeTrader::self()->query(QLatin1String( "KRegExpEditor/KRegExpEditor" )).isEmpty();
|
||||
reEditorButton->setEnabled(m_reEditorInstalled);
|
||||
|
||||
connect(nameLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()));
|
||||
connect(reLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()));
|
||||
connect(reEditorButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotReEditorButton_clicked()));
|
||||
connect(appIdLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()));
|
||||
connect(talkerButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotTalkerButton_clicked()));
|
||||
|
||||
connect(loadButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotLoadButton_clicked()));
|
||||
connect(saveButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotSaveButton_clicked()));
|
||||
connect(clearButton, SIGNAL(clicked()),
|
||||
this, SLOT(slotClearButton_clicked()));
|
||||
|
||||
// Set up defaults.
|
||||
defaults();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
TalkerChooserConf::~TalkerChooserConf(){
|
||||
// kDebug() << "TalkerChooserConf::~TalkerChooserConf: Running";
|
||||
}
|
||||
|
||||
void TalkerChooserConf::load(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "TalkerChooserConf::load: Running";
|
||||
KConfigGroup config( c, configGroup );
|
||||
nameLineEdit->setText( config.readEntry( "UserFilterName", nameLineEdit->text() ) );
|
||||
reLineEdit->setText(
|
||||
config.readEntry("MatchRegExp", reLineEdit->text()) );
|
||||
appIdLineEdit->setText(
|
||||
config.readEntry("AppIDs", appIdLineEdit->text()) );
|
||||
|
||||
m_talkerCode = TalkerCode(config.readEntry("TalkerCode"), false);
|
||||
// Legacy settings.
|
||||
QString s = config.readEntry( "LanguageCode" );
|
||||
if (!s.isEmpty()) m_talkerCode.setLanguage(s);
|
||||
s = config.readEntry( "SynthInName" );
|
||||
//if (!s.isEmpty()) m_talkerCode.setPlugInName(s);
|
||||
s = config.readEntry( "Gender" );
|
||||
//if (!s.isEmpty()) m_talkerCode.setGender(s);
|
||||
s = config.readEntry( "Volume" );
|
||||
//if (!s.isEmpty()) m_talkerCode.setVolume(s);
|
||||
s = config.readEntry( "Rate" );
|
||||
//if (!s.isEmpty()) m_talkerCode.setRate(s);
|
||||
|
||||
talkerLineEdit->setText(m_talkerCode.getTranslatedDescription());
|
||||
}
|
||||
|
||||
void TalkerChooserConf::save(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "TalkerChooserConf::save: Running";
|
||||
KConfigGroup config( c, configGroup );
|
||||
config.writeEntry( "UserFilterName", nameLineEdit->text() );
|
||||
config.writeEntry( "MatchRegExp", reLineEdit->text() );
|
||||
config.writeEntry( "AppIDs", appIdLineEdit->text().remove(QLatin1Char( ' ' )) );
|
||||
config.writeEntry( "TalkerCode", m_talkerCode.getTalkerCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called to set the settings in the module to sensible
|
||||
* default values. It gets called when hitting the "Default" button. The
|
||||
* default values should probably be the same as the ones the application
|
||||
* uses when started without a config file. Note that defaults should
|
||||
* be applied to the on-screen widgets; not to the config file.
|
||||
*/
|
||||
void TalkerChooserConf::defaults(){
|
||||
// kDebug() << "TalkerChooserConf::defaults: Running";
|
||||
// Default name.
|
||||
nameLineEdit->setText( i18n("Talker Chooser") );
|
||||
// Default regular expression is blank.
|
||||
reLineEdit->clear( );
|
||||
// Default App ID is blank.
|
||||
appIdLineEdit->clear();
|
||||
// Default to using default Talker.
|
||||
m_talkerCode = TalkerCode( QString(), false );
|
||||
talkerLineEdit->setText( m_talkerCode.getTranslatedDescription() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the plugin supports multiple instances. Return
|
||||
* False if only one instance of the plugin can be configured.
|
||||
* @return True if multiple instances are possible.
|
||||
*/
|
||||
bool TalkerChooserConf::supportsMultiInstance() { return true; }
|
||||
|
||||
/**
|
||||
* Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
|
||||
* If there can be more than one instance of a filter, it should return
|
||||
* a unique name for each instance. The name should be TalkerCode::translated for
|
||||
* the user if possible. If the plugin is not correctly configured,
|
||||
* return an empty string.
|
||||
* @return Filter instance name.
|
||||
*/
|
||||
QString TalkerChooserConf::userPlugInName()
|
||||
{
|
||||
if (talkerLineEdit->text().isEmpty()) return QString();
|
||||
if (appIdLineEdit->text().isEmpty() &&
|
||||
reLineEdit->text().isEmpty()) return QString();
|
||||
QString instName = nameLineEdit->text();
|
||||
if (instName.isEmpty()) return QString();
|
||||
return instName;
|
||||
}
|
||||
|
||||
void TalkerChooserConf::slotReEditorButton_clicked()
|
||||
{
|
||||
// Show Regular Expression Editor dialog if it is installed.
|
||||
if ( !m_reEditorInstalled ) return;
|
||||
KDialog *editorDialog =
|
||||
KServiceTypeTrader::createInstanceFromQuery<KDialog>( QLatin1String( "KRegExpEditor/KRegExpEditor" ));
|
||||
if ( editorDialog )
|
||||
{
|
||||
// kdeutils was installed, so the dialog was found. Fetch the editor interface.
|
||||
KRegExpEditorInterface *reEditor =
|
||||
qobject_cast<KRegExpEditorInterface *>(editorDialog);
|
||||
Q_ASSERT( reEditor ); // This should not fail!// now use the editor.
|
||||
reEditor->setRegExp( reLineEdit->text() );
|
||||
int dlgResult = editorDialog->exec();
|
||||
if ( dlgResult == QDialog::Accepted )
|
||||
{
|
||||
QString re = reEditor->regExp();
|
||||
reLineEdit->setText( re );
|
||||
}
|
||||
delete editorDialog;
|
||||
} else return;
|
||||
}
|
||||
|
||||
void TalkerChooserConf::slotTalkerButton_clicked()
|
||||
{
|
||||
QString talkerCode = m_talkerCode.getTalkerCode();
|
||||
QPointer<SelectTalkerDlg> dlg = new SelectTalkerDlg(this, "selecttalkerdialog", i18n("Select Talker"), talkerCode, true);
|
||||
int dlgResult = dlg->exec();
|
||||
if ( dlgResult != KDialog::Accepted ) return;
|
||||
m_talkerCode = TalkerCode( dlg->getSelectedTalkerCode(), false );
|
||||
talkerLineEdit->setText( m_talkerCode.getTranslatedDescription() );
|
||||
configChanged();
|
||||
delete dlg;
|
||||
}
|
||||
|
||||
void TalkerChooserConf::slotLoadButton_clicked()
|
||||
{
|
||||
QStringList dataDirs = KGlobal::dirs()->findAllResources("data", QLatin1String( "kttsd/talkerchooser/" ));
|
||||
QString dataDir;
|
||||
if (!dataDirs.isEmpty()) dataDir = dataDirs.last();
|
||||
QString filename = KFileDialog::getOpenFileName(
|
||||
dataDir,
|
||||
QLatin1String( "*rc|" ) + i18n( "Talker Chooser Config (*rc)" ),
|
||||
this,
|
||||
QLatin1String( "talkerchooser_loadfile" ));
|
||||
if ( filename.isEmpty() ) return;
|
||||
KConfig* cfg = new KConfig( filename );
|
||||
load( cfg, QLatin1String( "Filter" ) );
|
||||
delete cfg;
|
||||
configChanged();
|
||||
}
|
||||
|
||||
void TalkerChooserConf::slotSaveButton_clicked()
|
||||
{
|
||||
QString filename = KFileDialog::getSaveFileName(
|
||||
KGlobal::dirs()->saveLocation( "data" ,QLatin1String( "kttsd/talkerchooser/" ), false ) ,
|
||||
QLatin1String( "*rc|" ) + i18n( "Talker Chooser Config (*rc)" ),
|
||||
this,
|
||||
QLatin1String( "talkerchooser_savefile" ));
|
||||
if ( filename.isEmpty() ) return;
|
||||
KConfig* cfg = new KConfig( filename );
|
||||
save( cfg, QLatin1String( "Filter" ) );
|
||||
delete cfg;
|
||||
}
|
||||
|
||||
void TalkerChooserConf::slotClearButton_clicked()
|
||||
{
|
||||
nameLineEdit->setText( QString() );
|
||||
reLineEdit->setText( QString() );
|
||||
appIdLineEdit->setText( QString() );
|
||||
m_talkerCode = TalkerCode( QString(), false );
|
||||
talkerLineEdit->setText( m_talkerCode.getTranslatedDescription() );
|
||||
configChanged();
|
||||
}
|
|
@ -1,130 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic Talker Chooser Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 TALKERCHOOSERCONF_H
|
||||
#define TALKERCHOOSERCONF_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QWidget>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
// KDE includes.
|
||||
#include <kconfig.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterconf.h"
|
||||
#include "talkercode.h"
|
||||
|
||||
// TalkerChooser includes.
|
||||
#include "ui_talkerchooserconfwidget.h"
|
||||
|
||||
|
||||
class TalkerChooserConf : public KttsFilterConf, public Ui::TalkerChooserConfWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
explicit TalkerChooserConf( QWidget *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~TalkerChooserConf();
|
||||
|
||||
/**
|
||||
* This method is invoked whenever the module should read its
|
||||
* configuration (most of the times from a config file) and update the
|
||||
* user interface. This happens when the user clicks the "Reset" button in
|
||||
* the control center, to undo all of his changes and restore the currently
|
||||
* valid settings. Note that KTTSMGR calls this when the plugin is
|
||||
* loaded, so it not necessary to call it in your constructor.
|
||||
* The plugin should read its configuration from the specified group
|
||||
* in the specified config file.
|
||||
* @param c Pointer to a KConfig object.
|
||||
* @param configGroup Call config->setGroup with this argument before
|
||||
* loading your configuration.
|
||||
*
|
||||
* When a plugin is first added to KTTSMGR, @e load will be called with
|
||||
* a Null @e configGroup. In this case, the plugin will not have
|
||||
* any instance-specific parameters to load, but it may still wish
|
||||
* to load parameters that apply to all instances of the plugin.
|
||||
*/
|
||||
virtual void load(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* This function gets called when the user wants to save the settings in
|
||||
* the user interface, updating the config files or wherever the
|
||||
* configuration is stored. The method is called when the user clicks "Apply"
|
||||
* or "Ok". The plugin should save its configuration in the specified
|
||||
* group of the specified config file.
|
||||
* @param c Pointer to a KConfig object.
|
||||
* @param configGroup Call config->setGroup with this argument before
|
||||
* saving your configuration.
|
||||
*/
|
||||
virtual void save(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* This function is called to set the settings in the module to sensible
|
||||
* default values. It gets called when hitting the "Default" button. The
|
||||
* default values should probably be the same as the ones the application
|
||||
* uses when started without a config file. Note that defaults should
|
||||
* be applied to the on-screen widgets; not to the config file.
|
||||
*/
|
||||
virtual void defaults();
|
||||
|
||||
/**
|
||||
* Indicates whether the plugin supports multiple instances. Return
|
||||
* False if only one instance of the plugin can be configured.
|
||||
* @return True if multiple instances are possible.
|
||||
*/
|
||||
virtual bool supportsMultiInstance();
|
||||
|
||||
/**
|
||||
* Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
|
||||
* If there can be more than one instance of a filter, it should return
|
||||
* a unique name for each instance. The name should be translated for
|
||||
* the user if possible. If the plugin is not correctly configured,
|
||||
* return an empty string.
|
||||
* @return Filter instance name.
|
||||
*/
|
||||
virtual QString userPlugInName();
|
||||
|
||||
private slots:
|
||||
void slotReEditorButton_clicked();
|
||||
void slotTalkerButton_clicked();
|
||||
void slotLoadButton_clicked();
|
||||
void slotSaveButton_clicked();
|
||||
void slotClearButton_clicked();
|
||||
|
||||
private:
|
||||
// True if kdeutils Regular Expression Editor is installed.
|
||||
bool m_reEditorInstalled;
|
||||
// User's chosen Talker Code.
|
||||
TalkerCode m_talkerCode;
|
||||
};
|
||||
|
||||
#endif //TALKERCHOOSERCONF_H
|
|
@ -1,302 +0,0 @@
|
|||
<ui version="4.0" >
|
||||
<author>Gary Cramblitt <garycramblitt@comcast.net></author>
|
||||
<comment>Widget for configuring Talker Chooser Filter for KTTSD.</comment>
|
||||
<class>TalkerChooserConfWidget</class>
|
||||
<widget class="QWidget" name="TalkerChooserConfWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>547</width>
|
||||
<height>240</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Configure Talker Chooser</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string comment="What's this text" >Enter any name you like for this filter.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Name:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>nameLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="nameLineEdit" >
|
||||
<property name="whatsThis" >
|
||||
<string>Enter any name you like for this filter.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QGroupBox" name="applyGroupBox" >
|
||||
<property name="whatsThis" >
|
||||
<string>These settings determines when the filter is applied to text.</string>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>&Apply This Filter When</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="reLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string comment="What's this text" >This filter is applied to text jobs of the specified language. You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list. If blank, the filter applies to all text jobs of any language.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Te&xt contains:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>reLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="appIdLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string>Enter a D-Bus Application ID. This filter will only apply to text jobs queued by that application. You may enter more than one ID separated by commas. If blank, this filter applies to text jobs queued by all applications. Tip: Use kdcop from the command line to get the Application IDs of running applications. Example: "konversation, kvirc,ksirc,kopete"</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Application &ID contains:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>appIdLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="reLineEdit" >
|
||||
<property name="whatsThis" >
|
||||
<string>This filter is applied to text jobs of the specified language. You may select more than one language by clicking the browse button and Ctrl-clicking on more than one in the list. If blank, the filter applies to all text jobs of any language.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="reEditorButton" >
|
||||
<property name="whatsThis" >
|
||||
<string>Click to select one or more languages. This filter will be applied to text jobs of those languages.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="appIdLineEdit" >
|
||||
<property name="whatsThis" >
|
||||
<string><qt>Enter a D-Bus Application ID. This filter will only apply to text jobs queued by that application. You may enter more than one ID separated by commas. Use <b>knotify</b> to match all messages sent as KDE notifications. If blank, this filter applies to text jobs queued by all applications. Tip: Use kdcop from the command line to get the Application IDs of running applications. Example: "konversation, kvirc,ksirc,kopete"</qt></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="talkerLabel" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>The new Talker that will be used when the conditions above are met. The default Talker is the topmost in the Talkers tab. Click the button to choose a Talker.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Talker:</string>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>talkerLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="talkerLineEdit" >
|
||||
<property name="enabled" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>The new Talker that will be used when the conditions above are met. The default Talker is the topmost in the Talkers tab. Click the button to choose a Talker.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="talkerButton" >
|
||||
<property name="whatsThis" >
|
||||
<string>Click to select a Talker.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0" >
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KPushButton" name="loadButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to load a Talker Chooser configuration from a file.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Load...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="saveButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to save this Talker Chooser to a file.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Save...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KPushButton" name="clearButton" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Click to clear everything.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>Cl&ear</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>klineedit.h</header>
|
||||
<container>1</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KPushButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kpushbutton.h</header>
|
||||
<container>1</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>nameLineEdit</tabstop>
|
||||
<tabstop>reLineEdit</tabstop>
|
||||
<tabstop>reEditorButton</tabstop>
|
||||
<tabstop>appIdLineEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,35 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generating the factories so Talker Chooser Filter can be used as plug in.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// KDE includes.
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
|
||||
#include "talkerchooserconf.h"
|
||||
#include "talkerchooserproc.h"
|
||||
|
||||
K_PLUGIN_FACTORY(TalkerChooserPluginFactory, registerPlugin<TalkerChooserProc>(); registerPlugin<TalkerChooserConf>();)
|
||||
K_EXPORT_PLUGIN(TalkerChooserPluginFactory("jovie"))
|
|
@ -1,106 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic Talker Chooser Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// Talker Chooser includes.
|
||||
#include "talkerchooserproc.h"
|
||||
#include "moc_talkerchooserproc.cpp"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QRegExp>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdebug.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "talkercode.h"
|
||||
|
||||
TalkerChooserProc::TalkerChooserProc( QObject *parent, const QVariantList& args ) :
|
||||
KttsFilterProc(parent, args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
// kDebug() << "TalkerChooserProc::TalkerChooserProc: Running";
|
||||
}
|
||||
|
||||
TalkerChooserProc::~TalkerChooserProc()
|
||||
{
|
||||
// kDebug() << "TalkerChooserProc::~TalkerChooserProc: Running";
|
||||
}
|
||||
|
||||
bool TalkerChooserProc::init(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "PlugInProc::init: Running";
|
||||
KConfigGroup config( c, configGroup );
|
||||
m_re = config.readEntry( "MatchRegExp" );
|
||||
m_appIdList = config.readEntry( "AppIDs", QStringList() );
|
||||
m_chosenTalkerCode = TalkerCode(config.readEntry("TalkerCode"), false);
|
||||
// Legacy settings.
|
||||
QString s = config.readEntry( "LanguageCode" );
|
||||
if (!s.isEmpty()) m_chosenTalkerCode.setLanguage(s);
|
||||
s = config.readEntry( "SynthInName" );
|
||||
//if (!s.isEmpty()) m_chosenTalkerCode.setPlugInName(s);
|
||||
s = config.readEntry( "Gender" );
|
||||
//if (!s.isEmpty()) m_chosenTalkerCode.setGender(s);
|
||||
s = config.readEntry( "Volume" );
|
||||
//if (!s.isEmpty()) m_chosenTalkerCode.setVolume(s);
|
||||
s = config.readEntry( "Rate" );
|
||||
//if (!s.isEmpty()) m_chosenTalkerCode.setRate(s);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*virtual*/ bool TalkerChooserProc::supportsAsync() { return false; }
|
||||
|
||||
/*virtual*/ QString TalkerChooserProc::convert(const QString& inputText, TalkerCode* talkerCode,
|
||||
const QString& appId)
|
||||
{
|
||||
if ( !m_re.isEmpty() )
|
||||
{
|
||||
int pos = inputText.indexOf( QRegExp(m_re) );
|
||||
if ( pos < 0 ) return inputText;
|
||||
}
|
||||
// If appId doesn't match, return input unmolested.
|
||||
if ( !m_appIdList.isEmpty() )
|
||||
{
|
||||
// kDebug() << "TalkerChooserProc::convert: converting " << inputText << " if appId "
|
||||
// << appId << " matches " << m_appIdList << endl;
|
||||
bool found = false;
|
||||
QString appIdStr = appId;
|
||||
for (int ndx=0; ndx < m_appIdList.count(); ++ndx )
|
||||
{
|
||||
if ( appIdStr.contains(m_appIdList[ndx]) )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
// kDebug() << "TalkerChooserProc::convert: appId not found";
|
||||
return inputText;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the talker.
|
||||
*talkerCode = m_chosenTalkerCode;
|
||||
return inputText;
|
||||
}
|
|
@ -1,91 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic Talker Chooser Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 TALKERCHOOSERPROC_H
|
||||
#define TALKERCHOOSERPROC_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
#include "talkercode.h"
|
||||
|
||||
class TalkerChooserProc : public KttsFilterProc
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
explicit TalkerChooserProc( QObject *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~TalkerChooserProc();
|
||||
|
||||
/**
|
||||
* Initialize the filter.
|
||||
* @param c Settings object.
|
||||
* @param configGroup Settings Group.
|
||||
* @return False if filter is not ready to filter.
|
||||
*
|
||||
* Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain
|
||||
* separate configuration files of their own.
|
||||
*/
|
||||
virtual bool init(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* Returns True if the plugin supports asynchronous processing,
|
||||
* i.e., supports asyncConvert method.
|
||||
* @return True if this plugin supports asynchronous processing.
|
||||
*
|
||||
* If the plugin returns True, it must also implement @ref getState .
|
||||
* It must also emit @ref filteringFinished when filtering is completed.
|
||||
* If the plugin returns True, it must also implement @ref stopFiltering .
|
||||
* It must also emit @ref filteringStopped when filtering has been stopped.
|
||||
*/
|
||||
virtual bool supportsAsync();
|
||||
|
||||
/**
|
||||
* Convert input, returning output. Runs synchronously.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
*/
|
||||
virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
|
||||
|
||||
private:
|
||||
|
||||
QString m_re;
|
||||
QStringList m_appIdList;
|
||||
TalkerCode m_chosenTalkerCode;
|
||||
};
|
||||
|
||||
#endif // TALKERCHOOSERPROC_H
|
|
@ -1,262 +0,0 @@
|
|||
# Doxyfile 1.3.7-KDevelop
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = xhtml2ssml.kdevelop
|
||||
PROJECT_NUMBER = $VERSION$
|
||||
OUTPUT_DIRECTORY =
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = /home/paul/
|
||||
STRIP_FROM_INC_PATH =
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
INHERIT_DOCS = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
TAB_SIZE = 8
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = NO
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = NO
|
||||
EXTRACT_LOCAL_CLASSES = YES
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = NO
|
||||
CASE_SENSE_NAMES = YES
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = /home/paul/Kdecvs/kdeaccessibility/kttsd/filters
|
||||
FILE_PATTERNS = *.c \
|
||||
*.cc \
|
||||
*.cxx \
|
||||
*.cpp \
|
||||
*.c++ \
|
||||
*.java \
|
||||
*.ii \
|
||||
*.ixx \
|
||||
*.ipp \
|
||||
*.i++ \
|
||||
*.inl \
|
||||
*.h \
|
||||
*.hh \
|
||||
*.hxx \
|
||||
*.hpp \
|
||||
*.h++ \
|
||||
*.idl \
|
||||
*.odl \
|
||||
*.cs \
|
||||
*.php \
|
||||
*.php3 \
|
||||
*.inc \
|
||||
*.m \
|
||||
*.mm \
|
||||
*.C \
|
||||
*.CC \
|
||||
*.C++ \
|
||||
*.II \
|
||||
*.I++ \
|
||||
*.H \
|
||||
*.HH \
|
||||
*.H++ \
|
||||
*.CS \
|
||||
*.PHP \
|
||||
*.PHP3 \
|
||||
*.M \
|
||||
*.MM \
|
||||
*.C \
|
||||
*.H \
|
||||
*.tlh \
|
||||
*.diff \
|
||||
*.patch \
|
||||
*.moc \
|
||||
*.xpm \
|
||||
*.dox
|
||||
RECURSIVE = yes
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = NO
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = html
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER =
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE =
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = YES
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = yes
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = xhtml2ssml.tag
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = YES
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
|
@ -1,5 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<p>Isn't it such a nice and <strong>bold</strong> day today?</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,40 +0,0 @@
|
|||
/**********************************************************************
|
||||
Copyright 2004 by Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) version 3.
|
||||
|
||||
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 <QtGui/QApplication>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtXml/qxml.h>
|
||||
#include <QtXml/qxml.h>
|
||||
#include <QtCore/QMap>
|
||||
#include <iostream>
|
||||
#include "xhtml2ssml.h"
|
||||
#include "xmlelement.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
QFile f("demonstration.html");
|
||||
QXmlInputSource input(&f);
|
||||
QXmlSimpleReader reader;
|
||||
XHTMLToSSMLParser *parser = new XHTMLToSSMLParser();
|
||||
reader.setContentHandler(parser);
|
||||
reader.parse(input);
|
||||
std::cout << parser->convertedText() << "\n";
|
||||
delete parser;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# This is a comment
|
||||
# and another one
|
||||
# a html 'b' or 'strong' tag is mapped to 'emphasis level="strong"'
|
||||
b:emphasis level="strong"
|
||||
strong:emphasis level="strong"
|
|
@ -1,108 +0,0 @@
|
|||
/****************************************************************************
|
||||
XHTMLToSSMLParser class
|
||||
|
||||
Parses a piece of XHTML markup and converts into SSML.
|
||||
-------------------
|
||||
Copyright 2004 by Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
-------------------
|
||||
Original author: Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) version 3.
|
||||
|
||||
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 "xhtml2ssml.h"
|
||||
|
||||
#include <QtXml/qxml.h>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "xmlelement.h"
|
||||
|
||||
/// Document parsing begin. Init stuff here.
|
||||
bool XHTMLToSSMLParser::startDocument() {
|
||||
/// Read the file which maps xhtml tags -> ssml tags. Look at the file for more information.
|
||||
QFile file("tagmappingrc");
|
||||
if(!file.open(QIODevice::ReadOnly)) {
|
||||
std::cerr << "Could not read config file 'tagmappingrc'. Please check that it exists and is readable.\n";
|
||||
// Kill further parsing
|
||||
return false;
|
||||
}
|
||||
QTextStream stream(&file);
|
||||
// File parsing.
|
||||
bool linestatus = true;
|
||||
while(!stream.atEnd()) {
|
||||
linestatus = readFileConfigEntry(stream.readLine());
|
||||
// If there's some syntactical error in the file then return false.
|
||||
if(!linestatus)
|
||||
return false;
|
||||
/// Maybe call processEvents() to prevent GUI blockages?
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XHTMLToSSMLParser::startElement(const QString &, const QString &, const QString &qName, const QXmlAttributes &atts) {
|
||||
QString attributes = "";
|
||||
if(atts.length() > 0) {
|
||||
const int attsLength = atts.length();
|
||||
for(int i = 0; i < attsLength; ++i)
|
||||
attributes += " " + atts.qName(i) + "=\"" + atts.value(i) + "\"";
|
||||
}
|
||||
QString fromelement = qName + attributes;
|
||||
// If this element is one of the keys that was specified in the configuration file, get what it should be converted to and
|
||||
// append to the output string.
|
||||
QString toelement = m_xhtml2ssml[fromelement];
|
||||
if(toelement)
|
||||
m_output.append(XMLElement::fromQString(toelement).startTag());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XHTMLToSSMLParser::endElement(const QString &, const QString &, const QString &qName) {
|
||||
QString fromelement = qName;
|
||||
QString toelement = m_xhtml2ssml[fromelement];
|
||||
if(toelement)
|
||||
m_output.append(XMLElement::fromQString(toelement).endTag());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool XHTMLToSSMLParser::characters(const QString &characters) {
|
||||
m_output.append(characters);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QString XHTMLToSSMLParser::convertedText() {
|
||||
return m_output.simplified();
|
||||
}
|
||||
|
||||
/// Parse a line from the configuration file which maps xhtml : ssml equivalent.
|
||||
/// It makes entries in the m_xhtml2ssml map accordingly.
|
||||
/// @param line A line from a file to parse
|
||||
/// @returns true if the syntax of the line was okay and the parsing succeeded - false otherwise.
|
||||
bool XHTMLToSSMLParser::readFileConfigEntry(const QString &line) {
|
||||
// comments
|
||||
if(line.trimmed().startsWith('#')) {
|
||||
return true;
|
||||
}
|
||||
// break into QStringList
|
||||
// the second parameter to split is the string, with all space simplified and all space around the : removed, i.e
|
||||
// "something : somethingelse" -> "something:somethingelse"
|
||||
QStringList keyvalue = QString( ':').replace(':').split( ':', line.simplified().replace(' :', ':'));
|
||||
if(keyvalue.count() != 2)
|
||||
return false;
|
||||
m_xhtml2ssml[keyvalue[0]] = keyvalue[1];
|
||||
return true;
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
|
||||
/****************************************************************************
|
||||
XHTMLToSSMLParser class
|
||||
|
||||
Parses a piece of XHTML markup and converts into SSML.
|
||||
-------------------
|
||||
Copyright 2004 by Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
-------------------
|
||||
Original author: Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) version 3.
|
||||
|
||||
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 XHTML2SSML_H
|
||||
#define XHTML2SSML_H
|
||||
|
||||
#include <QtXml/qxml.h>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
typedef QMap<QString, QString> QStringMap;
|
||||
#include <QString>
|
||||
|
||||
class XHTMLToSSMLParser : public QXmlDefaultHandler {
|
||||
|
||||
public:
|
||||
/// No need to reimplement constructor..
|
||||
/// The document parsing starts
|
||||
bool startDocument();
|
||||
/// start of an element encountered (<element foo="bar">)
|
||||
bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts);
|
||||
/// end of an element encountered (</element>)
|
||||
bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
|
||||
/// text encountered (blah bah blah)
|
||||
bool characters(const QString &);
|
||||
|
||||
/// Get the output text that was generated during the parsing.
|
||||
/// @returns The converted text.
|
||||
QString convertedText();
|
||||
|
||||
/// Parse a line from the configuration file which maps xhtml : ssml equivalent.
|
||||
/// It makes entries in the m_xhtml2ssml map accordingly.
|
||||
/// @param line A line from a file to parse
|
||||
/// @returns true if the syntax of the line was okay and the parsing succeeded - false otherwise.
|
||||
bool readFileConfigEntry(const QString &line);
|
||||
|
||||
private:
|
||||
/// Dict of xhtml tags -> ssml tags
|
||||
QStringMap m_xhtml2ssml;
|
||||
/// The output of the conversion
|
||||
QString m_output;
|
||||
};
|
||||
|
||||
#endif //XHTML2SSML_H
|
|
@ -1,112 +0,0 @@
|
|||
<?xml version = '1.0'?>
|
||||
<kdevelop>
|
||||
<general>
|
||||
<author>Paul Giannaros</author>
|
||||
<email>ceruleanblaze@gmail.com</email>
|
||||
<version>$VERSION$</version>
|
||||
<projectmanagement>KDevTrollProject</projectmanagement>
|
||||
<primarylanguage>C++</primarylanguage>
|
||||
<keywords>
|
||||
<keyword>Qt</keyword>
|
||||
</keywords>
|
||||
</general>
|
||||
<kdevfileview>
|
||||
<groups>
|
||||
<group pattern="*.cpp;*.cxx;*.h" name="Sources" />
|
||||
<group pattern="*.ui" name="User Interface" />
|
||||
<group pattern="*.png" name="Icons" />
|
||||
<group pattern="*" name="Others" />
|
||||
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||
<hidenonlocation>false</hidenonlocation>
|
||||
</groups>
|
||||
<tree>
|
||||
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
|
||||
<hidenonprojectfiles>false</hidenonprojectfiles>
|
||||
</tree>
|
||||
</kdevfileview>
|
||||
<kdevdoctreeview>
|
||||
<ignoretocs>
|
||||
<toc>bash</toc>
|
||||
<toc>bash_bugs</toc>
|
||||
<toc>clanlib</toc>
|
||||
<toc>w3c-dom-level2-html</toc>
|
||||
<toc>fortran_bugs_gcc</toc>
|
||||
<toc>gnome1</toc>
|
||||
<toc>gnustep</toc>
|
||||
<toc>gtk</toc>
|
||||
<toc>gtk_bugs</toc>
|
||||
<toc>haskell</toc>
|
||||
<toc>haskell_bugs_ghc</toc>
|
||||
<toc>java_bugs_gcc</toc>
|
||||
<toc>java_bugs_sun</toc>
|
||||
<toc>kde2book</toc>
|
||||
<toc>opengl</toc>
|
||||
<toc>pascal_bugs_fp</toc>
|
||||
<toc>php</toc>
|
||||
<toc>php_bugs</toc>
|
||||
<toc>perl</toc>
|
||||
<toc>perl_bugs</toc>
|
||||
<toc>python</toc>
|
||||
<toc>python_bugs</toc>
|
||||
<toc>qt-kdev3</toc>
|
||||
<toc>ruby</toc>
|
||||
<toc>ruby_bugs</toc>
|
||||
<toc>sdl</toc>
|
||||
<toc>stl</toc>
|
||||
<toc>w3c-svg</toc>
|
||||
<toc>sw</toc>
|
||||
<toc>w3c-uaag10</toc>
|
||||
<toc>wxwidgets_bugs</toc>
|
||||
</ignoretocs>
|
||||
<ignoredoxygen>
|
||||
<toc>KDE Libraries (Doxygen)</toc>
|
||||
</ignoredoxygen>
|
||||
</kdevdoctreeview>
|
||||
<kdevdebugger>
|
||||
<general>
|
||||
<dbgshell/>
|
||||
</general>
|
||||
</kdevdebugger>
|
||||
<kdevfilecreate>
|
||||
<useglobaltypes>
|
||||
<type ext="ui" />
|
||||
<type ext="cpp" />
|
||||
<type ext="h" />
|
||||
</useglobaltypes>
|
||||
</kdevfilecreate>
|
||||
<kdevtrollproject>
|
||||
<general>
|
||||
<activedir></activedir>
|
||||
</general>
|
||||
<run>
|
||||
<directoryradio>executable</directoryradio>
|
||||
</run>
|
||||
</kdevtrollproject>
|
||||
<kdevcppsupport>
|
||||
<references>
|
||||
<pcs>kdeincludedb</pcs>
|
||||
<pcs>qtincludedb</pcs>
|
||||
<pcs>qtincludesdb</pcs>
|
||||
<pcs>kgmailtoincludedb</pcs>
|
||||
</references>
|
||||
<codecompletion>
|
||||
<includeGlobalFunctions>true</includeGlobalFunctions>
|
||||
<includeTypes>true</includeTypes>
|
||||
<includeEnums>true</includeEnums>
|
||||
<includeTypedefs>false</includeTypedefs>
|
||||
<automaticCodeCompletion>true</automaticCodeCompletion>
|
||||
<automaticArgumentsHint>true</automaticArgumentsHint>
|
||||
<automaticHeaderCompletion>true</automaticHeaderCompletion>
|
||||
<codeCompletionDelay>250</codeCompletionDelay>
|
||||
<argumentsHintDelay>400</argumentsHintDelay>
|
||||
<headerCompletionDelay>250</headerCompletionDelay>
|
||||
</codecompletion>
|
||||
</kdevcppsupport>
|
||||
<kdevcvsservice>
|
||||
<recursivewhenupdate>true</recursivewhenupdate>
|
||||
<prunedirswhenupdate>true</prunedirswhenupdate>
|
||||
<createdirswhenupdate>true</createdirswhenupdate>
|
||||
<recursivewhencommitremove>true</recursivewhencommitremove>
|
||||
<revertoptions>-C</revertoptions>
|
||||
</kdevcvsservice>
|
||||
</kdevelop>
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version = '1.0' encoding = 'UTF-8'?>
|
||||
<!DOCTYPE KDevPrjSession>
|
||||
<KDevPrjSession>
|
||||
<DocsAndViews NumberOfDocuments="5" >
|
||||
<Doc0 NumberOfViews="1" URL="file:/home/paul/Kdecvs/kdeaccessibility/kttsd/filters/xhtml2ssml.cpp" >
|
||||
<View0 line="63" Type="Source" />
|
||||
</Doc0>
|
||||
<Doc1 NumberOfViews="1" URL="file:/home/paul/Kdecvs/kdeaccessibility/kttsd/filters/xhtml2ssml.h" >
|
||||
<View0 line="21" Type="Source" />
|
||||
</Doc1>
|
||||
<Doc2 NumberOfViews="1" URL="file:/home/paul/Kdecvs/kdeaccessibility/kttsd/filters/main.cpp" >
|
||||
<View0 line="17" Type="Source" />
|
||||
</Doc2>
|
||||
<Doc3 NumberOfViews="1" URL="file:/home/paul/Kdecvs/kdeaccessibility/kttsd/filters/xmlelement.cpp" >
|
||||
<View0 line="72" Type="Source" />
|
||||
</Doc3>
|
||||
<Doc4 NumberOfViews="1" URL="file:/home/paul/Kdecvs/kdeaccessibility/kttsd/filters/xmlelement.h" >
|
||||
<View0 line="75" Type="Source" />
|
||||
</Doc4>
|
||||
</DocsAndViews>
|
||||
<pluginList>
|
||||
<kdevbookmarks>
|
||||
<bookmarks/>
|
||||
</kdevbookmarks>
|
||||
<kdevsubversion>
|
||||
<subversion recurseresolve="1" recurserelocate="1" recursemerge="1" recursecommit="1" base="" recursepropget="1" recurseswitch="1" recurseupdate="1" recursepropset="1" recursediff="1" recurserevert="1" forcemove="1" recursecheckout="1" forceremove="1" recurseadd="1" recurseproplist="1" forcemerge="1" />
|
||||
</kdevsubversion>
|
||||
<kdevvalgrind>
|
||||
<executable path="" params="" />
|
||||
<valgrind path="" params="" />
|
||||
<calltree path="" params="" />
|
||||
<kcachegrind path="" />
|
||||
</kdevvalgrind>
|
||||
<kdevdebugger>
|
||||
<breakpointList/>
|
||||
</kdevdebugger>
|
||||
</pluginList>
|
||||
</KDevPrjSession>
|
|
@ -1,10 +0,0 @@
|
|||
######################################################################
|
||||
# Automatically generated by qmake (1.07a) Tue Dec 21 21:18:47 2004
|
||||
######################################################################
|
||||
|
||||
TEMPLATE = app
|
||||
INCLUDEPATH += .
|
||||
|
||||
# Input
|
||||
HEADERS += xhtml2ssml.h xmlelement.h
|
||||
SOURCES += main.cpp xhtml2ssml.cpp xmlelement.cpp
|
|
@ -1,107 +0,0 @@
|
|||
/****************************************************************************
|
||||
XMLElement class
|
||||
|
||||
Representation of an XML element with methods for getting/setting
|
||||
attributes and generating "opening" and "closing" tags.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2004 by Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
-------------------
|
||||
Original author: Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) version 3.
|
||||
|
||||
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 "xmlelement.h"
|
||||
#include <iostream>
|
||||
|
||||
/// Constructors
|
||||
XMLElement::XMLElement() {
|
||||
m_name = "";
|
||||
m_attrmapper = AttributeToValueMap();
|
||||
}
|
||||
XMLElement::XMLElement(const QString &name) {
|
||||
m_name = name;
|
||||
m_attrmapper = AttributeToValueMap();
|
||||
}
|
||||
/// Destructor
|
||||
XMLElement::~XMLElement() {
|
||||
return;
|
||||
}
|
||||
|
||||
/// Copy constructor
|
||||
XMLElement::XMLElement(const XMLElement &element) {
|
||||
m_attrmapper = element.m_attrmapper;
|
||||
m_name = element.m_name;
|
||||
}
|
||||
|
||||
/// Assignement operator
|
||||
XMLElement XMLElement::operator=(const XMLElement &element) {
|
||||
m_attrmapper = element.m_attrmapper;
|
||||
m_name = element.m_name;
|
||||
return *this;
|
||||
}
|
||||
|
||||
QString XMLElement::name() {
|
||||
return m_name;
|
||||
}
|
||||
QString XMLElement::startTag() {
|
||||
QString output = '<' + m_name + ' ';
|
||||
for(AttributeToValueMap::Iterator it = m_attrmapper.begin(); it != m_attrmapper.end(); ++it) {
|
||||
output.append(it.key() + "=\"" + it.data() + "\" ");
|
||||
}
|
||||
output = output.left(output.length() - 1);
|
||||
// Get rid of the space at the end and then append a '>'
|
||||
output.append(">");
|
||||
return output;
|
||||
}
|
||||
|
||||
QString XMLElement::endTag() {
|
||||
return "</" + m_name + '>';
|
||||
}
|
||||
|
||||
void XMLElement::setAttribute(const QString &attr, const QString &value) {
|
||||
m_attrmapper[attr] = value;
|
||||
}
|
||||
QString XMLElement::attribute(const QString &attr) {
|
||||
return m_attrmapper[attr];
|
||||
}
|
||||
|
||||
QString XMLElement::toQString() {
|
||||
QString tag = startTag();
|
||||
return tag.left(tag.length() - 1).right(tag.length() - 2);
|
||||
}
|
||||
|
||||
XMLElement XMLElement::fromQString(const QString &str) {
|
||||
QStringList sections = str.split( ' ');
|
||||
QString tagname = sections[0];
|
||||
XMLElement e(tagname.latin1());
|
||||
|
||||
sections.pop_front();
|
||||
// Loop over the remaining strings which are attributes="values"
|
||||
if(sections.count()) {
|
||||
const int sectionsCount = sections.count();
|
||||
for(int i = 0; i < sectionsCount; ++i) {
|
||||
QStringList list = sections[i].split( '=');
|
||||
if(list.count() != 2) {
|
||||
std::cerr << "XMLElement::fromQString: Cannot convert list: " << list.join("|") << ". `" << str << "' is not in valid format.\n";
|
||||
return XMLElement(" ");
|
||||
}
|
||||
e.setAttribute(list[0], list[1].left(list[1].length() - 1).right(list[1].length() -2));
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/****************************************************************************
|
||||
XMLElement class
|
||||
|
||||
Representation of an XML element with methods for getting/setting
|
||||
attributes and generating "opening" and "closing" tags.
|
||||
-------------------
|
||||
Copyright 2004 by Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
-------------------
|
||||
Original author: Paul Giannaros <ceruleanblaze@gmail.com>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) version 3.
|
||||
|
||||
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 XMLELEMENT_H
|
||||
#define XMLELEMENT_H
|
||||
|
||||
#include <QtCore/QMap>
|
||||
|
||||
#include <QString>
|
||||
|
||||
typedef QMap<QString, QString> AttributeToValueMap;
|
||||
|
||||
class XMLElement {
|
||||
public:
|
||||
XMLElement();
|
||||
explicit XMLElement(const QString &name);
|
||||
~XMLElement();
|
||||
|
||||
/// Copy constructor
|
||||
XMLElement(const XMLElement &);
|
||||
|
||||
/// Assignment operator
|
||||
XMLElement operator=(const XMLElement &element);
|
||||
|
||||
/// Get the name of the tag (the text between the greater than and less than symbols).
|
||||
/// @returns the name of the tag.
|
||||
QString name();
|
||||
|
||||
/// set the name of the tag.
|
||||
/// @param name the new name of the tag.
|
||||
void setName(const QString &name);
|
||||
|
||||
/// Get a textual representation of the starting of the tag with all attributes and their values set out.
|
||||
/// @verbatim
|
||||
/// XMLElement element("elem");
|
||||
/// element.addAttribute("foo", "bar");
|
||||
/// element.startTag(); <- <elem foo="bar">
|
||||
/// @endverbatim
|
||||
/// @returns A textual representation of the start of the element.
|
||||
QString startTag();
|
||||
|
||||
/// Get a textual representation of the closed tag that XMLElement represents.
|
||||
/// @returns A textual representation of the closed tag represented by the XMLElement.
|
||||
QString endTag();
|
||||
|
||||
/// Create an attribute and set its value.
|
||||
/// @param attr The attribute.
|
||||
/// @param value The value of the attribute.
|
||||
void setAttribute(const QString &attr, const QString &value);
|
||||
|
||||
/// Get the value of an attribute.
|
||||
/// @param attr The attribute.
|
||||
/// @returns The value of @param attr
|
||||
QString attribute(const QString &attr);
|
||||
|
||||
/// Convert to a QString.
|
||||
/// Had issues with QMap and custom classes. For now you can just convert to/from QString and use
|
||||
/// That as the key/value pair.
|
||||
/// @returns A QString representation of the XMLAttribute.
|
||||
QString toQString();
|
||||
|
||||
/// Create an XMLElement from a QString.
|
||||
/// @param str The QString to convert from. Must be of the following syntax- "foo name=\"bar\""
|
||||
static XMLElement fromQString(const QString &str);
|
||||
|
||||
private:
|
||||
/// The name of the tag.
|
||||
QString m_name;
|
||||
/// Attribute : value mappings.
|
||||
AttributeToValueMap m_attrmapper;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,30 +0,0 @@
|
|||
########### next target ###############
|
||||
|
||||
set(jovie_xmltransformerplugin_PART_SRCS
|
||||
xmltransformerconf.cpp
|
||||
xmltransformerproc.cpp
|
||||
xmltransformerplugin.cpp
|
||||
)
|
||||
|
||||
kde4_add_plugin(jovie_xmltransformerplugin ${jovie_xmltransformerplugin_PART_SRCS})
|
||||
|
||||
target_link_libraries(jovie_xmltransformerplugin ${KDE4_KIO_LIBS} kttsd)
|
||||
|
||||
install(
|
||||
TARGETS jovie_xmltransformerplugin
|
||||
DESTINATION ${KDE4_PLUGIN_INSTALL_DIR}
|
||||
)
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(
|
||||
FILES
|
||||
xhtml2ssml.xsl
|
||||
xhtml2ssml_simple.xsl
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/jovie/xmltransformer
|
||||
)
|
||||
|
||||
install(
|
||||
FILES jovie_xmltransformerplugin.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
|
@ -1,117 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Name=XML Transformer
|
||||
Name[ar]=محول XML
|
||||
Name[ast]=Tresformador XML
|
||||
Name[bg]=Трансформиране на XML
|
||||
Name[bs]=Transformator XML-a
|
||||
Name[ca]=Transformador XML
|
||||
Name[ca@valencia]=Transformador XML
|
||||
Name[cs]=XML transformace
|
||||
Name[da]=XML Transformatør
|
||||
Name[de]=XML-Umformer
|
||||
Name[el]=XML μετασχηματιστής
|
||||
Name[en_GB]=XML Transformer
|
||||
Name[es]=Transformador XML
|
||||
Name[et]=XML-i teisendus
|
||||
Name[eu]=XML Transformer
|
||||
Name[fa]=تبدیلکننده XML
|
||||
Name[fi]=XML-muunnin
|
||||
Name[fr]=Convertisseur XML
|
||||
Name[ga]=Trasfhoirmeoir XML
|
||||
Name[gl]=Transformador de XML
|
||||
Name[hi]=एक्सएमएल परिवर्तक
|
||||
Name[hne]=एक्सएमएल बदलइया
|
||||
Name[hr]=Transformator XML-a
|
||||
Name[hu]=XML-átalakító
|
||||
Name[is]=XML ummyndari
|
||||
Name[it]=Trasformatore XML
|
||||
Name[ja]=XML 変換
|
||||
Name[kk]=XML түрлендіргіші
|
||||
Name[km]=កម្មវិធីប្លែង XML
|
||||
Name[ko]=XML 변형 도구
|
||||
Name[ku]=Veguherînerê XML
|
||||
Name[lt]=XML keitiklis
|
||||
Name[lv]=XML transformators
|
||||
Name[mk]=XML-трансформирач
|
||||
Name[ml]=എക്സ്എംഎല് ട്രാന്സ്ഫോര്മര്
|
||||
Name[mr]=एक्सएमएल परिवर्तक
|
||||
Name[ms]=Transformer XML
|
||||
Name[nb]=XML Transformer
|
||||
Name[nds]=XML-Ümwanneln
|
||||
Name[ne]=XML रुपान्तरणकर्ता
|
||||
Name[nl]=XML-omvormer
|
||||
Name[nn]=XML-transformator
|
||||
Name[pa]=XML ਟਰਾਂਸਫਰਮਰ
|
||||
Name[pl]=Transformacja XML
|
||||
Name[pt]=Transformação de XML
|
||||
Name[pt_BR]=Transformador XML
|
||||
Name[ro]=Transformator XML
|
||||
Name[ru]=Преобразователь XML
|
||||
Name[sk]=XML transformácia
|
||||
Name[sl]=Preoblikovalnik XML
|
||||
Name[sq]=XML Transformues
|
||||
Name[sr]=Трансформатор ИксМЛ‑а
|
||||
Name[sr@ijekavian]=Трансформатор ИксМЛ‑а
|
||||
Name[sr@ijekavianlatin]=Transformator XML‑a
|
||||
Name[sr@latin]=Transformator XML‑a
|
||||
Name[sv]=XML-transformering
|
||||
Name[ta]=XML Transformer
|
||||
Name[tg]=Тағйирдиҳии XML
|
||||
Name[tr]=XML Dönüştürücü
|
||||
Name[ug]=XML ئالماشتۇرغۇچ
|
||||
Name[uk]=Перетворення XML
|
||||
Name[vi]=Trình chuyển đổi XML
|
||||
Name[x-test]=xxXML Transformerxx
|
||||
Name[zh_CN]=XML 转换器
|
||||
Name[zh_TW]=XML 轉換器
|
||||
Comment=Generic XML Transformation Filter Plugin for Jovie
|
||||
Comment[bg]=Приставка филтър за трансформиране на XML за Jovie
|
||||
Comment[bs]=Generički filterski priključak Jovie za transformisanje XML
|
||||
Comment[ca]=Connector del filtre genèric del transformador XML pel Jovie
|
||||
Comment[ca@valencia]=Connector del filtre genèric del transformador XML pel Jovie
|
||||
Comment[cs]=Modul filtru obecné XML transformace pro Jovie
|
||||
Comment[da]=Generisk XML Tranformationsfilter-plugin til Jovie
|
||||
Comment[de]=Ein allgemeines Modul zur XML-Umformung für Jovie
|
||||
Comment[el]=Γενικό πρόσθετο φίλτρου XML μετασχηματισμού για το Jovie
|
||||
Comment[en_GB]=Generic XML Transformation Filter Plugin for Jovie
|
||||
Comment[es]=Complemento genérico de filtro transformación de XML para Jovie
|
||||
Comment[et]=Jovie üldine XML-i teisenduse filtri plugin
|
||||
Comment[eu]=Jovierentzako XML eraldatzeko iragazki plugin generikoa
|
||||
Comment[fi]=Jovien yleinen XML-muunninliitännäinen
|
||||
Comment[fr]=Module de filtre générique de conversion XML pour Jovie
|
||||
Comment[ga]=Breiseán Trasfhoirmithe XML le haghaidh Jovie
|
||||
Comment[gl]=Complemento de filtro xenérico de transformación de XML para Jovie
|
||||
Comment[hr]=Generički priključak za Jovie za filtriranje transformiranja XML-a
|
||||
Comment[hu]=Általános XML-átalakító modul a Jovie-hoz
|
||||
Comment[is]=Almennt XML-ummyndunar-íforrit fyrir Jovie
|
||||
Comment[it]=Estensione generica per il filtro di trasformazione XML per Jovie
|
||||
Comment[ja]=Jovie 用汎用 XML 変換フィルタプラグイン
|
||||
Comment[kk]=Jovie-нің XML-ді түрлендіру жалпы сүзгі плагині
|
||||
Comment[ko]=Jovie 일반적 XML 변형 도구
|
||||
Comment[lt]=Bendro pobūdžio XML keitimo filtro priedas, skirtas Jovie
|
||||
Comment[lv]=Vienkāršs XML transformācijas filtra spraudnis priekš Jovie
|
||||
Comment[nb]=Filter-programtillegg til Jovie for alminnelig XML-transformasjon
|
||||
Comment[nds]=Jovie-Filtermoduul för dat Ümwanneln vun XML
|
||||
Comment[nl]=Generieke filter-plugin voor Jovie, voor XML-omvorming
|
||||
Comment[nn]=Generelt XML-transformatortillegg for Jovie
|
||||
Comment[pl]=Zwykła wtyczka filtra przekształcenia XML dla Jovie
|
||||
Comment[pt]='Plugin' Genérico de Transformação de XML para o Jovie
|
||||
Comment[pt_BR]=Plugin genérico do filtro de transformação XML para o Jovie
|
||||
Comment[ru]=Модуль преобразования XML для Jovie
|
||||
Comment[sk]=Všeobecný modul filtra pre XML transformáciu pre Jovie
|
||||
Comment[sl]=Splošni filtrirni vstavek za preoblikovanje XML za Jovie
|
||||
Comment[sr]=Генерички филтерски прикључак Џови за трансформисање ИксМЛ‑а
|
||||
Comment[sr@ijekavian]=Генерички филтерски прикључак Џови за трансформисање ИксМЛ‑а
|
||||
Comment[sr@ijekavianlatin]=Generički filterski priključak Džovi za transformisanje XML‑a
|
||||
Comment[sr@latin]=Generički filterski priključak Džovi za transformisanje XML‑a
|
||||
Comment[sv]=Insticksprogram för Jovie med generellt XML-transformeringsfilter
|
||||
Comment[tr]=Jovie için genel XML Dönüştürücü Süzgeci Eklentisi
|
||||
Comment[ug]=Jovie ئادەتتىكى XML ئالماشتۇرغۇچ سۈزگۈچ قىستۇرمىسى
|
||||
Comment[uk]=Додаток загального фільтра перетворення XML для Jovie
|
||||
Comment[x-test]=xxGeneric XML Transformation Filter Plugin for Joviexx
|
||||
Comment[zh_CN]=Jovie 通用 XML 转换过滤插件
|
||||
Comment[zh_TW]=Jovie 使用的一般 XML 轉換過濾外掛程式
|
||||
Type=Service
|
||||
ServiceTypes=Jovie/FilterPlugin
|
||||
X-KDE-Library=jovie_xmltransformerplugin
|
||||
X-KDE-Languages=en,en_US,en_GB,en_CA,es,es_mx,cy,de,fi,cs,pl
|
|
@ -1,252 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- ***********************************************************************
|
||||
Stylesheet for transforming XHTML into SSML markup.
|
||||
============
|
||||
Copyright : (C) 2005 by Gary Cramblitt
|
||||
============
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
***************************************************************************
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; version 2 of the License. *
|
||||
* *
|
||||
*************************************************************************** -->
|
||||
|
||||
<!-- ***********************************************************************
|
||||
The rendering is roughly based on the stylesheet from Appendix A of the
|
||||
CSS2 specification, http://www.w3.org/TR/REC-CSS2/sample.html
|
||||
|
||||
@media speech {
|
||||
H1, H2, H3,
|
||||
H4, H5, H6 { voice-family: paul, male; stress: 20; richness: 90 }
|
||||
H1 { pitch: x-low; pitch-range: 90 }
|
||||
H2 { pitch: x-low; pitch-range: 80 }
|
||||
H3 { pitch: low; pitch-range: 70 }
|
||||
H4 { pitch: medium; pitch-range: 60 }
|
||||
H5 { pitch: medium; pitch-range: 50 }
|
||||
H6 { pitch: medium; pitch-range: 40 }
|
||||
LI, DT, DD { pitch: medium; richness: 60 }
|
||||
DT { stress: 80 }
|
||||
PRE, CODE, TT { pitch: medium; pitch-range: 0; stress: 0; richness: 80 }
|
||||
EM { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
|
||||
STRONG { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
|
||||
DFN { pitch: high; pitch-range: 60; stress: 60 }
|
||||
S, STRIKE { richness: 0 }
|
||||
I { pitch: medium; pitch-range: 60; stress: 60; richness: 50 }
|
||||
B { pitch: medium; pitch-range: 60; stress: 90; richness: 90 }
|
||||
U { richness: 0 }
|
||||
A:link { voice-family: harry, male }
|
||||
A:visited { voice-family: betty, female }
|
||||
A:active { voice-family: betty, female; pitch-range: 80; pitch: x-high }
|
||||
}
|
||||
|
||||
As SSML does not seem to offer an equivalent for "stress" and "richness".
|
||||
They are mapped to rate and volume respectively.
|
||||
|
||||
H1 { male; pitch: x-low; range: x-high; rate: slow; volume: x-loud}
|
||||
H2 { male; pitch: x-low; range: high; rate: slow; volume: x-loud }
|
||||
H3 { male; pitch: low; range: high; rate: slow; volume: x-loud }
|
||||
H4 { male; pitch: medium; range: medium; rate: slow; volume: x-loud }
|
||||
H5 { male; pitch: medium; range: low; rate: slow; volume: x-loud }
|
||||
H6 { male; pitch: medium; range: x-low; rate: slow; volume: x-loud }
|
||||
LI, DD { pitch: medium; }
|
||||
DT { pitch: medium; rate: x-fast }
|
||||
PRE, CODE, TT { pitch: medium; range: x-low; rate: slow; volume: loud }
|
||||
EM { pitch: medium; range: medium; rate: medium; volume: loud }
|
||||
STRONG { pitch: medium; range: medium; rate: x-fast; volume: x-loud }
|
||||
DFN { pitch: high; range: medium; rate: medium }
|
||||
S, STRIKE { volume: x-soft }
|
||||
I { pitch: high; range: medium; rate: fast; volume: medium }
|
||||
B { pitch: high; range: medium; rate: x-fast; volume: x-loud }
|
||||
U { volume: medium }
|
||||
A { female }
|
||||
|
||||
*********************************************************************** -->
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" indent="no"/>
|
||||
|
||||
<!-- root -->
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- html -->
|
||||
<!-- local-name() must be used in order to ignore namespaces. -->
|
||||
<xsl:template match="*[local-name()='html' or local-name()='HTML']">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Ignore header, speak the body of xhtml document. -->
|
||||
<xsl:template match="*[local-name()='head' or local-name()='HEAD']"/>
|
||||
<xsl:template match="*[local-name()='body' or local-name()='BODY']">
|
||||
<xsl:element name="speak">
|
||||
<xsl:copy-of select="/html/@lang"/>
|
||||
<xsl:copy-of select="/HTML/@lang"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Paragraph -->
|
||||
<xsl:template match="*[local-name()='p' or local-name()='P']">
|
||||
<p><xsl:apply-templates/></p>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H1 { pitch: x-low; range: x-high; rate: slow; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='h1' or local-name()='H1']">
|
||||
<voice gender="male"><prosody pitch="x-low" range="x-high" rate="slow" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody></voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H2 { male; pitch: x-low; range: high; rate: slow; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='h2' or local-name()='H2']">
|
||||
<voice gender="male"><prosody pitch="x-low" range="high" rate="slow" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody></voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H3 { male; pitch: low; range: high; rate: slow; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='h3' or local-name()='H3']">
|
||||
<voice gender="male"><prosody pitch="low" range="high" rate="slow" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody></voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H4 { male; pitch: medium; range: medium; rate: slow; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='h4' or local-name()='H4']">
|
||||
<voice gender="male"><prosody pitch="medium" range="medium" rate="slow" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody></voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H5 { male; pitch: medium; range: low; rate: slow; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='h5' or local-name()='H5']">
|
||||
<voice gender="male"><prosody pitch="low" range="low" rate="slow" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody></voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H6 { male; pitch: medium; range: x-low; rate: slow; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='h6' or local-name()='H6']">
|
||||
<voice gender="male"><prosody pitch="medium" range="x-low" rate="slow" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody></voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- LI, DD { pitch: medium; } -->
|
||||
<xsl:template match="*[local-name()='li' or local-name()='LI']">
|
||||
<prosody pitch="medium">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
<xsl:template match="*[local-name()='dd' or local-name()='DD']">
|
||||
<prosody pitch="medium">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- DT { pitch: medium; rate: x-fast } -->
|
||||
<xsl:template match="*[local-name()='dt' or local-name()='DT']">
|
||||
<prosody pitch="medium" rate="x-fast">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- PRE, CODE, TT { pitch: medium; range: x-low; rate: slow; volume: loud } -->
|
||||
<xsl:template match="*[local-name()='pre' or local-name()='PRE']">
|
||||
<prosody pitch="medium" range="x-low" rate="slow" volume="loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
<xsl:template match="*[local-name()='code' or local-name()='CODE']">
|
||||
<prosody pitch="medium" range="x-low" rate="slow" volume="loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
<xsl:template match="*[local-name()='tt' or local-name()='TT']">
|
||||
<prosody pitch="medium" range="x-low" rate="slow" volume="loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- EM { pitch: medium; range: medium; rate: medium; volume: loud } -->
|
||||
<xsl:template match="*[local-name()='em' or local-name()='EM']">
|
||||
<prosody pitch="medium" range="medium" rate="medium" volume="loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- STRONG { pitch: medium; range: medium; rate: x-fast; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='strong' or local-name()='STRONG']">
|
||||
<prosody pitch="medium" range="medium" rate="x-fast" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- DFN { pitch: high; range: medium; rate: medium } -->
|
||||
<xsl:template match="*[local-name()='dfn' or local-name()='DFN']">
|
||||
<prosody pitch="high" range="medium" rate="medium">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- S, STRIKE { volume: x-soft } -->
|
||||
<xsl:template match="*[local-name()='s' or local-name()='S']">
|
||||
<prosody volume="x-soft">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
<xsl:template match="*[local-name()='strike' or local-name()='STRIKE']">
|
||||
<prosody volume="x-soft">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- I { pitch: high; range: medium; rate: fast; volume: medium } -->
|
||||
<xsl:template match="*[local-name()='i' or local-name()='I']">
|
||||
<prosody pitch="high" range="medium" rate="fast" volume="medium">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- B { pitch: high; range: medium; rate: x-fast; volume: x-loud } -->
|
||||
<xsl:template match="*[local-name()='b' or local-name()='B']">
|
||||
<prosody pitch="high" range="medium" rate="x-fast" volume="x-loud">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- U { volume: medium } -->
|
||||
<xsl:template match="*[local-name()='u' or local-name()='U']">
|
||||
<prosody pitch="medium">
|
||||
<xsl:apply-templates/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- A { female } -->
|
||||
<xsl:template match="*[local-name()='a' or local-name()='A']">
|
||||
<voice gender="female">
|
||||
<xsl:apply-templates/>
|
||||
</voice>
|
||||
</xsl:template>
|
||||
|
||||
<!-- HREF attribute -->
|
||||
<xsl:template match="@href">
|
||||
<prosody volume="soft">Address</prosody>
|
||||
<prosody rate="x-fast">
|
||||
<xsl:value-of select="."/>
|
||||
</prosody>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Ignore scripts. -->
|
||||
<xsl:template match="*[local-name()='script' or local-name()='SCRIPT']"/>
|
||||
|
||||
<!-- Ignore styles. -->
|
||||
<xsl:template match="*[local-name()='style' or local-name()='STYLE']"/>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,95 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- ***********************************************************************
|
||||
Stylesheet for transforming XHTML into SSML markup.
|
||||
============
|
||||
Copyright : (C) 2005 by Gary Cramblitt
|
||||
============
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
***************************************************************************
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; version 2 of the License. *
|
||||
* *
|
||||
*************************************************************************** -->
|
||||
|
||||
<!-- ***********************************************************************
|
||||
The rendering takes a minimalist approach, mapping <b>, <em>, <i>
|
||||
etc. to louder voices. Everything else is pretty much mapped to just
|
||||
paragraph and sentence tags. Hyperlink addresses are spoken fast.
|
||||
*********************************************************************** -->
|
||||
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="xml" indent="no"/>
|
||||
|
||||
<!-- root -->
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- html -->
|
||||
<!-- local-name() must be used in order to ignore namespaces. -->
|
||||
<xsl:template match="*[local-name()='html' or local-name()='HTML']">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Ignore header, speak the body of xhtml document. -->
|
||||
<xsl:template match="*[local-name()='head' or local-name()='HEAD']"/>
|
||||
<xsl:template match="*[local-name()='body' or local-name()='BODY']">
|
||||
<xsl:element name="speak">
|
||||
<xsl:copy-of select="/html/@lang"/>
|
||||
<xsl:copy-of select="/HTML/@lang"/>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Paragraph -->
|
||||
<xsl:template match="*[local-name()='p' or local-name()='P']">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- H1, H2, H3, H4, H5, H6: ignore tag, speak content as sentence. -->
|
||||
<xsl:template match="*[contains('h1|h2|h3|h4|h5|h6|H1|H2|H3|H4|H5|H6|',concat(local-name(),'|'))]">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- DFN, LI, DD, DT: ignore tag, speak content. -->
|
||||
<xsl:template match="*[contains('dfn|li|dd|dt|DFN|LI|DD|DT|',concat(local-name(),'|'))]">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- PRE, CODE, TT; ignore tag, speak content. -->
|
||||
<xsl:template match="*[contains('pre|code|tt|PRE|CODE|TT|',concat(local-name(),'|'))]">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<!-- EM, STRONG, I, B, S, STRIKE, U: speak emphasized. -->
|
||||
<xsl:template match="*[contains('em|strong|i|b|s|strike|EM|STRONG|I|B|S|STRIKE|',concat(local-name(),'|'))]">
|
||||
<emphasis level="strong">
|
||||
<xsl:apply-templates/>
|
||||
</emphasis>
|
||||
</xsl:template>
|
||||
|
||||
<!-- A: speak hyperlink emphasized, address fast. -->
|
||||
<xsl:template match="*[local-name()='a' or local-name()='A']">
|
||||
<xsl:if test="@href">
|
||||
<emphasis level="moderate">
|
||||
<xsl:apply-templates/>
|
||||
</emphasis>
|
||||
<prosody rate="fast" volume="soft">
|
||||
<xsl:value-of select="'Link to. '"/>
|
||||
<xsl:value-of select="@href"/>
|
||||
</prosody>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<!-- Ignore scripts. -->
|
||||
<xsl:template match="*[local-name()='script' or local-name()='SCRIPT']"/>
|
||||
|
||||
<!-- Ignore styles. -->
|
||||
<xsl:template match="*[local-name()='style' or local-name()='STYLE']"/>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,156 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic XML Transformation Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// XmlTransformer includes.
|
||||
#include "xmltransformerconf.h"
|
||||
#include "moc_xmltransformerconf.cpp"
|
||||
|
||||
// Qt includes.
|
||||
|
||||
|
||||
// KDE includes.
|
||||
#include <klocale.h>
|
||||
#include <klineedit.h>
|
||||
#include <kconfig.h>
|
||||
#include <kdialog.h>
|
||||
#include <kurlrequester.h>
|
||||
#include <kstandarddirs.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterconf.h"
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
XmlTransformerConf::XmlTransformerConf( QWidget *parent, const QVariantList &args) :
|
||||
KttsFilterConf(parent, args)
|
||||
{
|
||||
Q_UNUSED(args);
|
||||
kDebug() << "XmlTransformerConf::XmlTransformerConf: Running";
|
||||
|
||||
// Create configuration widget.
|
||||
setupUi(this);
|
||||
|
||||
// Set up defaults.
|
||||
kDebug() << "XmlTransformerConf:: setting up defaults";
|
||||
defaults();
|
||||
|
||||
// Connect signals.
|
||||
connect( nameLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()));
|
||||
connect( xsltPath, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()) );
|
||||
connect( xsltprocPath, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()) );
|
||||
connect( rootElementLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()) );
|
||||
connect( doctypeLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()) );
|
||||
connect( appIdLineEdit, SIGNAL(textChanged(QString)),
|
||||
this, SLOT(configChanged()) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
XmlTransformerConf::~XmlTransformerConf(){
|
||||
// kDebug() << "XmlTransformerConf::~XmlTransformerConf: Running";
|
||||
}
|
||||
|
||||
void XmlTransformerConf::load(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "XmlTransformerConf::load: Running";
|
||||
KConfigGroup config( c, configGroup );
|
||||
nameLineEdit->setText( config.readEntry( "UserFilterName", nameLineEdit->text() ) );
|
||||
xsltPath->setUrl( KUrl::fromPath( config.readEntry( "XsltFilePath", xsltPath->url().path() ) ) );
|
||||
xsltprocPath->setUrl( KUrl::fromPath( config.readEntry( "XsltprocPath", xsltprocPath->url().path() ) ) );
|
||||
rootElementLineEdit->setText(
|
||||
config.readEntry( "RootElement", rootElementLineEdit->text() ) );
|
||||
doctypeLineEdit->setText(
|
||||
config.readEntry( "DocType", doctypeLineEdit->text() ) );
|
||||
appIdLineEdit->setText(
|
||||
config.readEntry( "AppID", appIdLineEdit->text() ) );
|
||||
}
|
||||
|
||||
void XmlTransformerConf::save(KConfig* c, const QString& configGroup){
|
||||
// kDebug() << "XmlTransformerConf::save: Running";
|
||||
KConfigGroup config( c, configGroup );
|
||||
config.writeEntry( "UserFilterName", nameLineEdit->text() );
|
||||
config.writeEntry( "XsltFilePath", KStandardDirs::realFilePath( xsltPath->url().path() ) );
|
||||
config.writeEntry( "XsltprocPath", KStandardDirs::realFilePath( xsltprocPath->url().path() ) );
|
||||
config.writeEntry( "RootElement", rootElementLineEdit->text() );
|
||||
config.writeEntry( "DocType", doctypeLineEdit->text() );
|
||||
config.writeEntry( "AppID", appIdLineEdit->text().remove(QLatin1Char( ' ' )) );
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is called to set the settings in the module to sensible
|
||||
* default values. It gets called when hitting the "Default" button. The
|
||||
* default values should probably be the same as the ones the application
|
||||
* uses when started without a config file. Note that defaults should
|
||||
* be applied to the on-screen widgets; not to the config file.
|
||||
*/
|
||||
void XmlTransformerConf::defaults(){
|
||||
// kDebug() << "XmlTransformerConf::defaults: Running";
|
||||
// Default name.
|
||||
nameLineEdit->setText(i18n( "XML Transformer" ));
|
||||
// Default XSLT path to installed xsl files.
|
||||
xsltPath->setUrl( KUrl::fromPath( KStandardDirs::locate("data", QLatin1String( "kttsd/xmltransformer/" )) ) );
|
||||
// Default path to xsltproc.
|
||||
xsltprocPath->setUrl( KUrl("xsltproc") );
|
||||
// Default root element to "html".
|
||||
rootElementLineEdit->setText( QLatin1String( "html" ) );
|
||||
// Default doctype to blank.
|
||||
doctypeLineEdit->clear();
|
||||
// Default App ID to blank.
|
||||
appIdLineEdit->clear();
|
||||
// kDebug() << "XmlTransformerConf::defaults: Exiting";
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the plugin supports multiple instances. Return
|
||||
* False if only one instance of the plugin can be configured.
|
||||
* @return True if multiple instances are possible.
|
||||
*/
|
||||
bool XmlTransformerConf::supportsMultiInstance() { return true; }
|
||||
|
||||
/**
|
||||
* Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
|
||||
* If there can be more than one instance of a filter, it should return
|
||||
* a unique name for each instance. The name should be translated for
|
||||
* the user if possible. If the plugin is not correctly configured,
|
||||
* return an empty string.
|
||||
* @return Filter instance name.
|
||||
*/
|
||||
QString XmlTransformerConf::userPlugInName()
|
||||
{
|
||||
QString filePath = KStandardDirs::realFilePath(xsltprocPath->url().path());
|
||||
if (filePath.isEmpty()) return QString();
|
||||
if (KStandardDirs::findExe(filePath).isEmpty()) return QString();
|
||||
|
||||
filePath = KStandardDirs::realFilePath(xsltPath->url().path());
|
||||
if (filePath.isEmpty()) return QString();
|
||||
if (KStandardDirs::findExe(filePath).isEmpty()) return QString();
|
||||
if (!QFileInfo(filePath).isFile()) return QString();
|
||||
|
||||
return nameLineEdit->text();
|
||||
}
|
|
@ -1,118 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic XML Transformation Filter Configuration class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 XMLTRANSFORMERCONF_H
|
||||
#define XMLTRANSFORMERCONF_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
// KDE includes.
|
||||
#include <kconfig.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterconf.h"
|
||||
|
||||
// XmlTransformer includes.
|
||||
#include "ui_xmltransformerconfwidget.h"
|
||||
|
||||
class XmlTransformerConf : public KttsFilterConf, public Ui::XmlTransformerConfWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
explicit XmlTransformerConf( QWidget *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
*/
|
||||
virtual ~XmlTransformerConf();
|
||||
|
||||
/**
|
||||
* This method is invoked whenever the module should read its
|
||||
* configuration (most of the times from a config file) and update the
|
||||
* user interface. This happens when the user clicks the "Reset" button in
|
||||
* the control center, to undo all of his changes and restore the currently
|
||||
* valid settings. Note that KTTSMGR calls this when the plugin is
|
||||
* loaded, so it not necessary to call it in your constructor.
|
||||
* The plugin should read its configuration from the specified group
|
||||
* in the specified config file.
|
||||
* @param c Pointer to a KConfig object.
|
||||
* @param configGroup Call config->setGroup with this argument before
|
||||
* loading your configuration.
|
||||
*
|
||||
* When a plugin is first added to KTTSMGR, @e load will be called with
|
||||
* a Null @e configGroup. In this case, the plugin will not have
|
||||
* any instance-specific parameters to load, but it may still wish
|
||||
* to load parameters that apply to all instances of the plugin.
|
||||
*/
|
||||
virtual void load(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* This function gets called when the user wants to save the settings in
|
||||
* the user interface, updating the config files or wherever the
|
||||
* configuration is stored. The method is called when the user clicks "Apply"
|
||||
* or "Ok". The plugin should save its configuration in the specified
|
||||
* group of the specified config file.
|
||||
* @param c Pointer to a KConfig object.
|
||||
* @param configGroup Call config->setGroup with this argument before
|
||||
* saving your configuration.
|
||||
*/
|
||||
virtual void save(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* This function is called to set the settings in the module to sensible
|
||||
* default values. It gets called when hitting the "Default" button. The
|
||||
* default values should probably be the same as the ones the application
|
||||
* uses when started without a config file. Note that defaults should
|
||||
* be applied to the on-screen widgets; not to the config file.
|
||||
*/
|
||||
virtual void defaults();
|
||||
|
||||
/**
|
||||
* Indicates whether the plugin supports multiple instances. Return
|
||||
* False if only one instance of the plugin can be configured.
|
||||
* @return True if multiple instances are possible.
|
||||
*/
|
||||
virtual bool supportsMultiInstance();
|
||||
|
||||
/**
|
||||
* Returns the name of the plugin. Displayed in Filters tab of KTTSMgr.
|
||||
* If there can be more than one instance of a filter, it should return
|
||||
* a unique name for each instance. The name should be translated for
|
||||
* the user if possible. If the plugin is not correctly configured,
|
||||
* return an empty string.
|
||||
* @return Filter instance name.
|
||||
*/
|
||||
virtual QString userPlugInName();
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif //XMLTRANSFORMERCONF_H
|
|
@ -1,287 +0,0 @@
|
|||
<ui version="4.0" >
|
||||
<author>Gary Cramblitt <garycramblitt@comcast.net></author>
|
||||
<class>XmlTransformerConfWidget</class>
|
||||
<widget class="QWidget" name="XmlTransformerConfWidget" >
|
||||
<property name="geometry" >
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>548</width>
|
||||
<height>256</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<string>Configure XML Transformer</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="1" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="nameLineEdit" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Enter any descriptive name you like for this filter.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KUrlRequester" name="xsltPath" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Enter the full path to an XML Style Language - Transforms (XSLT) stylesheet file. XSLT files usually end with extension .xsl.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KUrlRequester" name="xsltprocPath" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>Enter the path to the xsltproc executable program. If it is in the PATH environment variable, just enter "xsltproc".</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="nameLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string comment="What's this text" >Enter any descriptive name you like for this filter.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Name:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>nameLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="xsltLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string>Enter the full path to an XML Style Language - Transforms (XSLT) stylesheet file. XSLT files usually end with extension .xsl.</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&XSLT file:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>xsltPath</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="xsltprocLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string>Enter the path to the xsltproc executable program. If it is in the PATH environment variable, just enter "xsltproc".</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>xsltproc &executable:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>xsltprocPath</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2" >
|
||||
<widget class="QGroupBox" name="applyGroupBox" >
|
||||
<property name="whatsThis" >
|
||||
<string>These settings determines when the filter is applied to text.</string>
|
||||
</property>
|
||||
<property name="title" >
|
||||
<string>Apply This &Filter When</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<number>11</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="0" column="1" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="rootElementLineEdit" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>This filter will be applied only to text having the specified XML root element. If blank, applies to all text. You may enter more than one root element separated by commas. Example: "html".</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="doctypeLineEdit" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string>This filter will be applied only to text having the specified DOCTYPE specification. If blank, applies to all text. You may enter more than one DOCTYPE separated by commas. Example: "xhtml".</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="KLineEdit" name="appIdLineEdit" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>5</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="whatsThis" >
|
||||
<string><qt>Enter a D-Bus Application ID. This filter will only apply to text queued by that application. You may enter more than one ID separated by commas. Use <b>knotify</b> to match all messages sent as KDE notifications. If blank, this filter applies to text queued by all applications. Tip: Use kdcop from the command line to get the Application IDs of running applications. Example: "konversation, kvirc,ksirc,kopete"</qt></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" >
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="rootElementLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string comment="What's this text" >This filter will be applied only to text having the specified XML root element. If blank, applies to all text. You may enter more than one root element separated by commas. Example: "html".</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>&Root element is:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>rootElementLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="doctypeLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string>This filter will be applied only to text having the specified DOCTYPE specification. If blank, applies to all text. You may enter more than one DOCTYPE separated by commas. Example: "xhtml".</string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>or DOC&TYPE is:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>doctypeLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="appIdLabel" >
|
||||
<property name="whatsThis" >
|
||||
<string><qt>Enter a D-Bus Application ID. This filter will only apply to text queued by that application. You may enter more than one ID separated by commas. Use <b>knotify</b> to match all messages sent as KDE notifications. If blank, this filter applies to text queued by all applications. Tip: Use kdcop from the command line to get the Application IDs of running applications. Example: "konversation, kvirc,ksirc,kopete"</qt></string>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string>and Application &ID contains:</string>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
<property name="buddy" >
|
||||
<cstring>appIdLineEdit</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KUrlRequester</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>kurlrequester.h</header>
|
||||
<container>1</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header>klineedit.h</header>
|
||||
<container>1</container>
|
||||
<pixmap></pixmap>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -1,35 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generating the factories so XML Transformer Filter can be used as plug in.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// KDE includes.
|
||||
#include <KPluginFactory>
|
||||
#include <KPluginLoader>
|
||||
|
||||
// Jovie includes.
|
||||
#include "filterproc.h"
|
||||
|
||||
#include "xmltransformerconf.h"
|
||||
#include "xmltransformerproc.h"
|
||||
|
||||
K_PLUGIN_FACTORY(XmlTransformerPluginFactory, registerPlugin<XmlTransformerProc>(); registerPlugin<XmlTransformerConf>();)
|
||||
K_EXPORT_PLUGIN(XmlTransformerPluginFactory("jovie"))
|
|
@ -1,439 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic XML Transformation Filter Processing class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// XmlTransformer includes.
|
||||
#include "xmltransformerproc.h"
|
||||
#include "moc_xmltransformerproc.cpp"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/qstring.h>
|
||||
#include <QtCore/QRegExp>
|
||||
#include <QtCore/QTextStream>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdeversion.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <ktemporaryfile.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
XmlTransformerProc::XmlTransformerProc( QObject *parent, const QVariantList& args) :
|
||||
KttsFilterProc(parent, args)
|
||||
{
|
||||
m_xsltProc = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
/*virtual*/ XmlTransformerProc::~XmlTransformerProc()
|
||||
{
|
||||
delete m_xsltProc;
|
||||
if (!m_inFilename.isEmpty()) QFile::remove(m_inFilename);
|
||||
if (!m_outFilename.isEmpty()) QFile::remove(m_outFilename);
|
||||
}
|
||||
|
||||
bool XmlTransformerProc::init(KConfig* c, const QString& configGroup)
|
||||
{
|
||||
// kDebug() << "XmlTransformerProc::init: Running.";
|
||||
KConfigGroup config( c, configGroup );
|
||||
m_UserFilterName = config.readEntry( "UserFilterName" );
|
||||
m_xsltFilePath = config.readEntry( "XsltFilePath" );
|
||||
m_xsltprocPath = config.readEntry( "XsltprocPath" );
|
||||
m_rootElementList = config.readEntry( "RootElement", QStringList() );
|
||||
m_doctypeList = config.readEntry( "DocType", QStringList() );
|
||||
m_appIdList = config.readEntry( "AppID", QStringList() );
|
||||
kDebug() << "XmlTransformerProc::init: m_xsltprocPath = " << m_xsltprocPath;
|
||||
kDebug() << "XmlTransformerProc::init: m_xsltFilePath = " << m_xsltFilePath;
|
||||
return ( m_xsltFilePath.isEmpty() || m_xsltprocPath.isEmpty() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns True if the plugin supports asynchronous processing,
|
||||
* i.e., supports asyncConvert method.
|
||||
* @return True if this plugin supports asynchronous processing.
|
||||
*
|
||||
* If the plugin returns True, it must also implement @ref getState .
|
||||
* It must also emit @ref filteringFinished when filtering is completed.
|
||||
* If the plugin returns True, it must also implement @ref stopFiltering .
|
||||
* It must also emit @ref filteringStopped when filtering has been stopped.
|
||||
*/
|
||||
/*virtual*/ bool XmlTransformerProc::supportsAsync() { return true; }
|
||||
|
||||
/**
|
||||
* Convert input, returning output.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
*/
|
||||
/*virtual*/ QString XmlTransformerProc::convert(const QString& inputText, TalkerCode* talkerCode,
|
||||
const QString& appId)
|
||||
{
|
||||
// kDebug() << "XmlTransformerProc::convert: Running.";
|
||||
// If not properly configured, do nothing.
|
||||
if ( m_xsltFilePath.isEmpty() || m_xsltprocPath.isEmpty() )
|
||||
{
|
||||
kDebug() << "XmlTransformerProc::convert: not properly configured";
|
||||
return inputText;
|
||||
}
|
||||
// Asynchronously convert and wait for completion.
|
||||
if (asyncConvert(inputText, talkerCode, appId))
|
||||
{
|
||||
waitForFinished();
|
||||
m_state = fsIdle;
|
||||
return m_text;
|
||||
} else
|
||||
return inputText;
|
||||
}
|
||||
|
||||
bool XmlTransformerProc::asyncConvert(const QString& inputText, TalkerCode* talkerCode,
|
||||
const QString& appId)
|
||||
{
|
||||
Q_UNUSED(talkerCode);
|
||||
m_wasModified = false;
|
||||
|
||||
// kDebug() << "XmlTransformerProc::asyncConvert: Running.";
|
||||
m_text = inputText;
|
||||
// If not properly configured, do nothing.
|
||||
if ( m_xsltFilePath.isEmpty() || m_xsltprocPath.isEmpty() )
|
||||
{
|
||||
kDebug() << "XmlTransformerProc::asyncConvert: not properly configured.";
|
||||
return false;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
// If not correct XML type, or DOCTYPE, do nothing.
|
||||
if ( !m_rootElementList.isEmpty() )
|
||||
{
|
||||
// kDebug() << "XmlTransformerProc::asyncConvert:: searching for root elements " << m_rootElementList;
|
||||
for ( int ndx=0; ndx < m_rootElementList.count(); ++ndx )
|
||||
{
|
||||
if ( hasRootElement( inputText, m_rootElementList[ndx] ) )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !found && m_doctypeList.isEmpty() )
|
||||
{
|
||||
kDebug() << "XmlTransformerProc::asyncConvert: Did not find root element(s)" << m_rootElementList;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ( !found && !m_doctypeList.isEmpty() )
|
||||
{
|
||||
for ( int ndx=0; ndx < m_doctypeList.count(); ++ndx )
|
||||
{
|
||||
if ( hasDoctype( inputText, m_doctypeList[ndx] ) )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
// kDebug() << "XmlTransformerProc::asyncConvert: Did not find doctype(s)" << m_doctypeList;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// If appId doesn't match, return input unmolested.
|
||||
if ( !m_appIdList.isEmpty() )
|
||||
{
|
||||
QString appIdStr = appId;
|
||||
// kDebug() << "XmlTransformrProc::convert: converting " << inputText << " if appId "
|
||||
// << appId << " matches " << m_appIdList << endl;
|
||||
found = false;
|
||||
for ( int ndx=0; ndx < m_appIdList.count(); ++ndx )
|
||||
{
|
||||
if ( appIdStr.contains(m_appIdList[ndx]) )
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( !found )
|
||||
{
|
||||
// kDebug() << "XmlTransformerProc::asyncConvert: Did not find appId(s)" << m_appIdList;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// Write @param text to a temporary file.
|
||||
KTemporaryFile inFile;
|
||||
inFile.setPrefix(QLatin1String( "kttsd-" ));
|
||||
inFile.setSuffix(QLatin1String( ".xml" ));
|
||||
inFile.setAutoRemove(false);
|
||||
inFile.open();
|
||||
m_inFilename = inFile.fileName();
|
||||
QTextStream wstream (&inFile);
|
||||
// TODO: Is encoding an issue here?
|
||||
// If input does not have xml processing instruction, add it.
|
||||
if (!inputText.startsWith(QLatin1String("<?xml"))) wstream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
|
||||
// FIXME: Temporary Fix until Konqi returns properly formatted xhtml with & coded as &
|
||||
// This will change & inside a CDATA section, which is not good, and also within comments and
|
||||
// processing instructions, which is OK because we don't speak those anyway.
|
||||
QString text = inputText;
|
||||
text.replace(QRegExp(QLatin1String( "&(?!amp;)") ),QLatin1String( "&" ));
|
||||
wstream << text;
|
||||
inFile.flush();
|
||||
|
||||
// Get a temporary output file name.
|
||||
KTemporaryFile outFile;
|
||||
outFile.setPrefix(QLatin1String( "kttsd-" ));
|
||||
outFile.setSuffix(QLatin1String( ".output" ));
|
||||
outFile.setAutoRemove(false);
|
||||
outFile.open();
|
||||
m_outFilename = outFile.fileName();
|
||||
|
||||
/// Spawn an xsltproc process to apply our stylesheet to input file.
|
||||
m_xsltProc = new QProcess;
|
||||
m_xsltProc->setProcessChannelMode(QProcess::SeparateChannels);
|
||||
const QStringList xsltProcArgs = QStringList()
|
||||
<< QLatin1String("-o") << m_outFilename << QLatin1String("--novalid")
|
||||
<< m_xsltFilePath << m_inFilename;
|
||||
// Warning: This won't compile under KDE 3.2. See FreeTTS::argsToStringList().
|
||||
// kDebug() << "SSMLConvert::transform: executing command: " <<
|
||||
// m_xsltProc->args() << endl;
|
||||
|
||||
m_state = fsFiltering;
|
||||
connect(m_xsltProc, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
this, SLOT(slotProcessExited(int,QProcess::ExitStatus)));
|
||||
connect(m_xsltProc, SIGNAL(readyReadStandardOutput()),
|
||||
this, SLOT(slotReceivedStdout()));
|
||||
connect(m_xsltProc, SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(slotReceivedStderr()));
|
||||
m_xsltProc->start(m_xsltprocPath, xsltProcArgs);
|
||||
if (!m_xsltProc->waitForStarted())
|
||||
{
|
||||
kWarning() << "XmlTransformerProc::convert: Error starting xsltproc";
|
||||
m_state = fsIdle;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Process output when xsltproc exits.
|
||||
void XmlTransformerProc::processOutput()
|
||||
{
|
||||
QFile::remove(m_inFilename);
|
||||
|
||||
int exitStatus = 11;
|
||||
if (m_xsltProc->exitStatus() == QProcess::NormalExit)
|
||||
exitStatus = m_xsltProc->exitCode();
|
||||
else
|
||||
kDebug() << "XmlTransformerProc::processOutput: xsltproc was killed.";
|
||||
|
||||
delete m_xsltProc;
|
||||
m_xsltProc = 0;
|
||||
|
||||
if (exitStatus != 0)
|
||||
{
|
||||
kDebug() << "XmlTransformerProc::processOutput: xsltproc abnormal exit. Status = " << exitStatus;
|
||||
m_state = fsFinished;
|
||||
QFile::remove(m_outFilename);
|
||||
emit filteringFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
/// Read back the data that was written to /tmp/fileName.output.
|
||||
QFile readfile(m_outFilename);
|
||||
if(!readfile.open(QIODevice::ReadOnly)) {
|
||||
/// uhh yeah... Issues writing to the output file.
|
||||
kDebug() << "XmlTransformerProc::processOutput: Could not read file " << m_outFilename;
|
||||
m_state = fsFinished;
|
||||
emit filteringFinished();
|
||||
}
|
||||
QTextStream rstream(&readfile);
|
||||
m_text = rstream.readAll();
|
||||
readfile.close();
|
||||
|
||||
kDebug() << QLatin1String( "XmlTransformerProc::processOutput: Read file at " ) + m_inFilename + QLatin1String( " and created " ) + m_outFilename + QLatin1String( " based on the stylesheet at " ) << m_xsltFilePath;
|
||||
|
||||
// Clean up.
|
||||
QFile::remove(m_outFilename);
|
||||
|
||||
m_state = fsFinished;
|
||||
m_wasModified = true;
|
||||
emit filteringFinished();
|
||||
}
|
||||
|
||||
/**
|
||||
* Waits for a previous call to asyncConvert to finish.
|
||||
*/
|
||||
/*virtual*/ void XmlTransformerProc::waitForFinished()
|
||||
{
|
||||
if (m_xsltProc)
|
||||
{
|
||||
if (m_xsltProc->state() != QProcess::NotRunning)
|
||||
{
|
||||
if ( !m_xsltProc->waitForFinished( 15 ) )
|
||||
{
|
||||
m_xsltProc->kill();
|
||||
kDebug() << "XmlTransformerProc::waitForFinished: After waiting 15 seconds, xsltproc process seems to hung. Killing it.";
|
||||
processOutput();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the state of the Filter.
|
||||
*/
|
||||
/*virtual*/ int XmlTransformerProc::getState() { return m_state; }
|
||||
|
||||
/**
|
||||
* Returns the filtered output.
|
||||
*/
|
||||
/*virtual*/ QString XmlTransformerProc::getOutput() { return m_text; }
|
||||
|
||||
/**
|
||||
* Acknowledges the finished filtering.
|
||||
*/
|
||||
/*virtual*/ void XmlTransformerProc::ackFinished()
|
||||
{
|
||||
m_state = fsIdle;
|
||||
m_text.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops filtering. The filteringStopped signal will emit when filtering
|
||||
* has in fact stopped and state returns to fsIdle;
|
||||
*/
|
||||
/*virtual*/ void XmlTransformerProc::stopFiltering()
|
||||
{
|
||||
m_state = fsStopping;
|
||||
m_xsltProc->kill();
|
||||
}
|
||||
|
||||
/**
|
||||
* Did this filter do anything? If the filter returns the input as output
|
||||
* unmolested, it should return False when this method is called.
|
||||
*/
|
||||
/*virtual*/ bool XmlTransformerProc::wasModified() { return m_wasModified; }
|
||||
|
||||
void XmlTransformerProc::slotProcessExited(int /*exitCode*/, QProcess::ExitStatus /*exitStatus*/)
|
||||
{
|
||||
// kDebug() << "XmlTransformerProc::slotProcessExited: xsltproc has exited.";
|
||||
processOutput();
|
||||
}
|
||||
|
||||
void XmlTransformerProc::slotReceivedStdout()
|
||||
{
|
||||
// QString buf = QString::fromLatin1(buffer, buflen);
|
||||
// kDebug() << "XmlTransformerProc::slotReceivedStdout: Received from xsltproc: " << buf;
|
||||
}
|
||||
|
||||
void XmlTransformerProc::slotReceivedStderr()
|
||||
{
|
||||
// QString buf = QString::fromLatin1(buffer, buflen);
|
||||
// kDebug() << "XmlTransformerProc::slotReceivedStderr: Received error from xsltproc: " << buf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an XML document has a certain root element.
|
||||
* @param xmldoc The document to check for the element.
|
||||
* @param elementName The element to check for in the document.
|
||||
* @returns True if the root element exists in the document, false otherwise.
|
||||
*/
|
||||
bool XmlTransformerProc::hasRootElement(const QString &xmldoc, const QString &elementName) {
|
||||
// Strip all whitespace and go from there.
|
||||
QString doc = xmldoc.simplified();
|
||||
// Take off the <?xml...?> if it exists
|
||||
if(doc.startsWith(QLatin1String("<?xml"))) {
|
||||
// Look for ?> and strip everything off from there to the start - effectively removing
|
||||
// <?xml...?>
|
||||
int xmlStatementEnd = doc.indexOf(QLatin1String( "?>" ));
|
||||
if(xmlStatementEnd == -1) {
|
||||
kDebug() << "KttsUtils::hasRootElement: Bad XML file syntax\n";
|
||||
return false;
|
||||
}
|
||||
xmlStatementEnd += 2; // len '?>' == 2
|
||||
doc = doc.right(doc.length() - xmlStatementEnd);
|
||||
}
|
||||
// Take off leading comments, if they exist.
|
||||
while(doc.startsWith(QLatin1String("<!--")) || doc.startsWith(QLatin1String(" <!--"))) {
|
||||
int commentStatementEnd = doc.indexOf(QLatin1String( "-->" ));
|
||||
if(commentStatementEnd == -1) {
|
||||
kDebug() << "KttsUtils::hasRootElement: Bad XML file syntax\n";
|
||||
return false;
|
||||
}
|
||||
commentStatementEnd += 3; // len '>' == 2
|
||||
doc = doc.right(doc.length() - commentStatementEnd);
|
||||
}
|
||||
// Take off the doctype statement if it exists.
|
||||
while(doc.startsWith(QLatin1String("<!DOCTYPE")) || doc.startsWith(QLatin1String(" <!DOCTYPE"))) {
|
||||
int doctypeStatementEnd = doc.indexOf(QLatin1Char( '>' ));
|
||||
if(doctypeStatementEnd == -1) {
|
||||
kDebug() << "KttsUtils::hasRootElement: Bad XML file syntax\n";
|
||||
return false;
|
||||
}
|
||||
doctypeStatementEnd += 1; // len '>' == 2
|
||||
doc = doc.right(doc.length() - doctypeStatementEnd);
|
||||
}
|
||||
// We should (hopefully) be left with the root element.
|
||||
return (doc.startsWith(QString(QLatin1Char( '<' ) + elementName)) || doc.startsWith(QString(QLatin1String( " <" ) + elementName)));
|
||||
}
|
||||
|
||||
bool XmlTransformerProc::hasDoctype(const QString &xmldoc, const QString &name) {
|
||||
// Strip all whitespace and go from there.
|
||||
QString doc = xmldoc.trimmed();
|
||||
// Take off the <?xml...?> if it exists
|
||||
if(doc.startsWith(QLatin1String("<?xml"))) {
|
||||
// Look for ?> and strip everything off from there to the start - effectively removing
|
||||
// <?xml...?>
|
||||
int xmlStatementEnd = doc.indexOf(QLatin1String( "?>" ));
|
||||
if(xmlStatementEnd == -1) {
|
||||
kDebug() << "XmlTransformerProc::hasDoctype: Bad XML file syntax\n";
|
||||
return false;
|
||||
}
|
||||
xmlStatementEnd += 2; // len '?>' == 2
|
||||
doc = doc.right(doc.length() - xmlStatementEnd);
|
||||
doc = doc.trimmed();
|
||||
}
|
||||
// Take off leading comments, if they exist.
|
||||
while(doc.startsWith(QLatin1String("<!--"))) {
|
||||
int commentStatementEnd = doc.indexOf(QLatin1String( "-->" ));
|
||||
if(commentStatementEnd == -1) {
|
||||
kDebug() << "XmlTransformerProc::hasDoctype: Bad XML file syntax\n";
|
||||
return false;
|
||||
}
|
||||
commentStatementEnd += 3; // len '>' == 2
|
||||
doc = doc.right(doc.length() - commentStatementEnd);
|
||||
doc = doc.trimmed();
|
||||
}
|
||||
// Match the doctype statement if it exists.
|
||||
// kDebug() << "XmlTransformerProc::hasDoctype: searching " << doc.left(20) << "... for " << "<!DOCTYPE " << name;
|
||||
return (doc.startsWith(QString(QLatin1String( "<!DOCTYPE " ) + name)));
|
||||
}
|
|
@ -1,183 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Generic XML Transformation Filter Processing class.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 XMLTRANSFORMERPROC_H
|
||||
#define XMLTRANSFORMERPROC_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
#include "talkercode.h"
|
||||
|
||||
class XmlTransformerProc : public KttsFilterProc
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
explicit XmlTransformerProc( QObject *parent, const QVariantList &args);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~XmlTransformerProc();
|
||||
|
||||
/**
|
||||
* Initialize the filter.
|
||||
* @param c Settings object.
|
||||
* @param configGroup Settings Group.
|
||||
* @return False if filter is not ready to filter.
|
||||
*
|
||||
* Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain
|
||||
* separate configuration files of their own.
|
||||
*/
|
||||
virtual bool init(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* Returns True if the plugin supports asynchronous processing,
|
||||
* i.e., supports asyncConvert method.
|
||||
* @return True if this plugin supports asynchronous processing.
|
||||
*
|
||||
* If the plugin returns True, it must also implement @ref getState .
|
||||
* It must also emit @ref filteringFinished when filtering is completed.
|
||||
* If the plugin returns True, it must also implement @ref stopFiltering .
|
||||
* It must also emit @ref filteringStopped when filtering has been stopped.
|
||||
*/
|
||||
virtual bool supportsAsync();
|
||||
|
||||
/**
|
||||
* Convert input, returning output.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
*/
|
||||
virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
|
||||
|
||||
/**
|
||||
* Convert input. Runs asynchronously.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
* @return False if the filter cannot perform the conversion.
|
||||
*
|
||||
* When conversion is completed, emits signal @ref filteringFinished. Calling
|
||||
* program may then call @ref getOutput to retrieve converted text. Calling
|
||||
* program must call @ref ackFinished to acknowledge the conversion.
|
||||
*/
|
||||
virtual bool asyncConvert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
|
||||
|
||||
/**
|
||||
* Waits for a previous call to asyncConvert to finish.
|
||||
*/
|
||||
virtual void waitForFinished();
|
||||
|
||||
/**
|
||||
* Returns the state of the Filter.
|
||||
*/
|
||||
virtual int getState();
|
||||
|
||||
/**
|
||||
* Returns the filtered output.
|
||||
*/
|
||||
virtual QString getOutput();
|
||||
|
||||
/**
|
||||
* Acknowledges the finished filtering.
|
||||
*/
|
||||
virtual void ackFinished();
|
||||
|
||||
/**
|
||||
* Stops filtering. The filteringStopped signal will emit when filtering
|
||||
* has in fact stopped and state returns to fsIdle;
|
||||
*/
|
||||
virtual void stopFiltering();
|
||||
|
||||
/**
|
||||
* Did this filter do anything? If the filter returns the input as output
|
||||
* unmolested, it should return False when this method is called.
|
||||
*/
|
||||
virtual bool wasModified();
|
||||
|
||||
private slots:
|
||||
void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void slotReceivedStdout();
|
||||
void slotReceivedStderr();
|
||||
|
||||
private:
|
||||
// Process output when xsltproc exits.
|
||||
void processOutput();
|
||||
|
||||
/**
|
||||
* Check if an XML document has a certain root element.
|
||||
* @param xmldoc The document to check for the element.
|
||||
* @param elementName The element to check for in the document.
|
||||
* @returns true if the root element exists in the document, false otherwise.
|
||||
*/
|
||||
bool hasRootElement(const QString &xmldoc, const QString &elementName);
|
||||
|
||||
/**
|
||||
* Check if an XML document has a certain DOCTYPE.
|
||||
* @param xmldoc The document to check for the doctype.
|
||||
* @param name The doctype name to check for. Pass QString() to not check the name.
|
||||
* @returns true if the parameters match the doctype, false otherwise.
|
||||
*/
|
||||
bool hasDoctype(const QString &xmldoc, const QString &name);
|
||||
|
||||
// If not empty, only apply to text queued by an applications containing one of these strings.
|
||||
QStringList m_appIdList;
|
||||
// If not empty, only apply to XML that has the specified root element.
|
||||
QStringList m_rootElementList;
|
||||
// If not empty, only apply to XML that has the specified DOCTYPE spec.
|
||||
QStringList m_doctypeList;
|
||||
// The text that is being filtered.
|
||||
QString m_text;
|
||||
// Processing state.
|
||||
int m_state;
|
||||
// xsltproc process.
|
||||
QProcess* m_xsltProc;
|
||||
// Input and Output filenames.
|
||||
QString m_inFilename;
|
||||
QString m_outFilename;
|
||||
// User's name for the filter.
|
||||
QString m_UserFilterName;
|
||||
// XSLT file.
|
||||
QString m_xsltFilePath;
|
||||
// Path to xsltproc processor.
|
||||
QString m_xsltprocPath;
|
||||
// Did this filter modify the text?
|
||||
bool m_wasModified;
|
||||
};
|
||||
|
||||
#endif // XMLTRANSFORMERPROC_H
|
|
@ -1 +0,0 @@
|
|||
kde4_install_icons(${KDE4_ICON_INSTALL_DIR})
|
Before Width: | Height: | Size: 136 B |
Before Width: | Height: | Size: 129 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 198 B |
Before Width: | Height: | Size: 183 B |
Before Width: | Height: | Size: 242 B |
Before Width: | Height: | Size: 229 B |
Before Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 286 B |
|
@ -1,56 +0,0 @@
|
|||
include_directories(${SPEECHD_INCLUDE_DIR})
|
||||
|
||||
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=2400)
|
||||
|
||||
########### next target ###############
|
||||
|
||||
set(jovie_SRCS
|
||||
main.cpp
|
||||
jovie.cpp
|
||||
speaker.cpp
|
||||
appdata.cpp
|
||||
ssmlconvert.cpp
|
||||
filtermgr.cpp
|
||||
talkermgr.cpp
|
||||
jovietrayicon.cpp
|
||||
)
|
||||
|
||||
qt4_add_dbus_adaptor(jovie_SRCS
|
||||
${KDE4_DBUS_INTERFACES_INSTALL_DIR}/org.kde.KSpeech.xml
|
||||
jovie.h
|
||||
Jovie
|
||||
)
|
||||
|
||||
add_executable(jovie_bin ${jovie_SRCS})
|
||||
|
||||
set_target_properties(jovie_bin PROPERTIES OUTPUT_NAME jovie)
|
||||
|
||||
target_link_libraries(jovie_bin
|
||||
${SPEECHD_LIBRARIES}
|
||||
${KDE4_KDECORE_LIBS}
|
||||
${KDE4_KDEUI_LIBS}
|
||||
${KDE4_KIO_LIBS}
|
||||
kttsd
|
||||
)
|
||||
|
||||
install(TARGETS jovie_bin ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||
|
||||
########### install files ###############
|
||||
|
||||
install(
|
||||
FILES SSMLtoPlainText.xsl
|
||||
DESTINATION ${KDE4_DATA_INSTALL_DIR}/jovie/xslt
|
||||
)
|
||||
|
||||
install(
|
||||
FILES
|
||||
jovie.desktop
|
||||
kttsd.desktop
|
||||
DESTINATION ${KDE4_SERVICES_INSTALL_DIR}
|
||||
)
|
||||
|
||||
install(
|
||||
PROGRAMS jovieapp.desktop
|
||||
DESTINATION ${KDE4_XDG_APPS_INSTALL_DIR}
|
||||
)
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
The kspeech.h file in this directory is a copy from
|
||||
kdelibs/interfaces/kspeech/
|
||||
|
||||
If anyone has can offer a way to eliminate it and build
|
||||
using the copy in kdelibs, I'd be grateful..grc.
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:output method="text" encoding="ISO-8859-1" indent="no"/>
|
||||
|
||||
<xsl:template match="speak">
|
||||
<xsl:value-of select="."/>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -1,113 +0,0 @@
|
|||
/*************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
This class holds the data for a single application.
|
||||
It contains the application's default settings.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 "appdata.h"
|
||||
|
||||
#include "kdebug.h"
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
class AppDataPrivate
|
||||
{
|
||||
public:
|
||||
AppDataPrivate(const QString& newAppId) :
|
||||
appId(newAppId),
|
||||
applicationName(appId),
|
||||
defaultPriority(KSpeech::jpMessage),
|
||||
sentenceDelimiter(QLatin1String( "([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))" )),
|
||||
filteringOn(true),
|
||||
isApplicationPaused(false),
|
||||
autoConfigureTalkersOn(false),
|
||||
isSystemManager(false),
|
||||
jobList(),
|
||||
unregistered(false) {}
|
||||
|
||||
friend class AppData;
|
||||
|
||||
protected:
|
||||
QString appId;
|
||||
QString applicationName;
|
||||
QString defaultTalker;
|
||||
KSpeech::JobPriority defaultPriority;
|
||||
QString sentenceDelimiter;
|
||||
bool filteringOn;
|
||||
bool isApplicationPaused;
|
||||
QString htmlFilterXsltFile;
|
||||
QString ssmlFilterXsltFile;
|
||||
bool autoConfigureTalkersOn;
|
||||
bool isSystemManager;
|
||||
TJobList jobList;
|
||||
bool unregistered;
|
||||
};
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
AppData::AppData(const QString& appId) { d = new AppDataPrivate(appId); }
|
||||
AppData::~AppData() { delete d; }
|
||||
|
||||
QString AppData::appId() const { return d->appId; }
|
||||
void AppData::setAppId(const QString& appId) { d->appId = appId; }
|
||||
QString AppData::applicationName() const { return d->applicationName; }
|
||||
void AppData::setApplicationName(const QString& applicationName) { d->applicationName = applicationName; }
|
||||
QString AppData::defaultTalker() const { return d->defaultTalker; }
|
||||
void AppData::setDefaultTalker(const QString& defaultTalker) { d->defaultTalker = defaultTalker; }
|
||||
KSpeech::JobPriority AppData::defaultPriority() const { return d->defaultPriority; }
|
||||
void AppData::setDefaultPriority(KSpeech::JobPriority priority) { d->defaultPriority = priority; }
|
||||
QString AppData::sentenceDelimiter() const { return d->sentenceDelimiter; }
|
||||
void AppData::setSentenceDelimiter(const QString& sentenceDelimiter) { d->sentenceDelimiter = sentenceDelimiter; }
|
||||
bool AppData::filteringOn() const { return d->filteringOn; }
|
||||
void AppData::setFilteringOn(bool filteringOn) { d->filteringOn = filteringOn; }
|
||||
bool AppData::isApplicationPaused() const { return d->isApplicationPaused; }
|
||||
void AppData::setIsApplicationPaused(bool isApplicationPaused) { d->isApplicationPaused = isApplicationPaused; }
|
||||
QString AppData::htmlFilterXsltFile() const { return d->htmlFilterXsltFile; }
|
||||
void AppData::setHtmlFilterXsltFile(const QString& filename) { d->htmlFilterXsltFile = filename; }
|
||||
QString AppData::ssmlFilterXsltFile() const { return d->ssmlFilterXsltFile; }
|
||||
void AppData::setSsmlFilterXsltFile(const QString& filename) { d->ssmlFilterXsltFile = filename; }
|
||||
bool AppData::autoConfigureTalkersOn() const { return d->autoConfigureTalkersOn; }
|
||||
void AppData::setAutoConfigureTalkersOn(bool autoConfigureTalkersOn) { d->autoConfigureTalkersOn = autoConfigureTalkersOn; }
|
||||
bool AppData::isSystemManager() const { return d->isSystemManager; }
|
||||
void AppData::setIsSystemManager(bool isSystemManager) { d->isSystemManager = isSystemManager; }
|
||||
int AppData::lastJobNum() const
|
||||
{
|
||||
if (d->jobList.isEmpty())
|
||||
return 0;
|
||||
else
|
||||
return d->jobList.last();
|
||||
}
|
||||
TJobListPtr AppData::jobList() const { return &(d->jobList); }
|
||||
bool AppData::unregistered() const { return d->unregistered; }
|
||||
void AppData::setUnregistered(bool unregistered) { d->unregistered = unregistered; }
|
||||
|
||||
/*
|
||||
void AppData::debugDump()
|
||||
{
|
||||
kDebug() << "AppData::debugDump: appId = " << appId() << " applicationName = " << applicationName()
|
||||
<< " defaultTalker = " << defaultTalker() << " defaultPriority = " << defaultPriority()
|
||||
<< " sentenceDelimiter = " << sentenceDelimiter() << " filteringOn = " << filteringOn()
|
||||
<< " isApplicationPaused = " << isApplicationPaused() << " htmlFilterXsltFile = " << htmlFilterXsltFile()
|
||||
<< " ssmlFilterXsltFile = " << ssmlFilterXsltFile() << " autoConfigureTalkersOn = "
|
||||
<< autoConfigureTalkersOn() << " isSystemManager = " << isSystemManager()
|
||||
<< " lastJobNum = " << lastJobNum() << endl;
|
||||
}
|
||||
*/
|
|
@ -1,226 +0,0 @@
|
|||
/*************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
This class holds the data for a single application.
|
||||
It contains the application's default settings.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 APPDATA_H
|
||||
#define APPDATA_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QList>
|
||||
|
||||
// KDE includes.
|
||||
#include <kspeech.h>
|
||||
|
||||
typedef QList<int> TJobList;
|
||||
typedef TJobList* TJobListPtr;
|
||||
|
||||
class AppDataPrivate;
|
||||
|
||||
/**
|
||||
* @class AppData
|
||||
*
|
||||
* Object to represent options chosen by a given application for interacting with Jovie.
|
||||
*/
|
||||
class AppData
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructs a new AppData object for the given DBUS AppId.
|
||||
* @param appId DBUS sender id.
|
||||
*/
|
||||
explicit AppData(const QString& appId);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~AppData();
|
||||
|
||||
/**
|
||||
* Returns the appId for the application.
|
||||
*/
|
||||
QString appId() const;
|
||||
|
||||
/**
|
||||
* Sets the appId for the application.
|
||||
*/
|
||||
void setAppId(const QString& appId);
|
||||
|
||||
/**
|
||||
* Returns the friendly display name for the application.
|
||||
* These generally are not translated.
|
||||
*/
|
||||
QString applicationName() const;
|
||||
|
||||
/**
|
||||
* Sets the friendly display name for the application.
|
||||
* @param applicationName Friendly application name.
|
||||
*
|
||||
* If not set, the AppId is used as the applicationName.
|
||||
*/
|
||||
void setApplicationName(const QString& applicationName);
|
||||
|
||||
/**
|
||||
* Returns the default talker code for the application.
|
||||
* Defaults to "", i.e., use the default talker configured in the system.
|
||||
*/
|
||||
QString defaultTalker() const;
|
||||
|
||||
/**
|
||||
* Sets the default talker code for the application.
|
||||
* @param defaultTalker Talker code.
|
||||
*/
|
||||
void setDefaultTalker(const QString& defaultTalker);
|
||||
|
||||
/**
|
||||
* Returns the default priority (job type) for the application.
|
||||
*/
|
||||
KSpeech::JobPriority defaultPriority() const;
|
||||
|
||||
/**
|
||||
* Set the default priority (job type) for the application.
|
||||
* @param defaultPriority Job Priority.
|
||||
*/
|
||||
void setDefaultPriority(KSpeech::JobPriority defaultPriority);
|
||||
|
||||
/**
|
||||
* Returns the GREP pattern that will be used as the sentence delimiter.
|
||||
*
|
||||
* The default delimiter is
|
||||
@verbatim
|
||||
([\\.\\?\\!\\:\\;])\\s
|
||||
@endverbatim
|
||||
*
|
||||
* @see setSentenceDelimiter
|
||||
*/
|
||||
QString sentenceDelimiter() const;
|
||||
|
||||
/**
|
||||
* Sets the GREP pattern that will be used as the sentence delimiter.
|
||||
* @param sentenceDelimiter A valid GREP pattern.
|
||||
*
|
||||
* Note that backward slashes must be escaped.
|
||||
*
|
||||
* @see sentenceDelimiter, sentenceparsing
|
||||
*/
|
||||
void setSentenceDelimiter(const QString& sentenceDelimiter);
|
||||
|
||||
/**
|
||||
* Returns the applications's current filtering enabled flag.
|
||||
*/
|
||||
bool filteringOn() const;
|
||||
|
||||
/**
|
||||
* Sets the applications's current filtering enabled flag.
|
||||
* @param filteringOn True or False.
|
||||
*/
|
||||
void setFilteringOn(bool filteringOn);
|
||||
|
||||
/**
|
||||
* Returns whether the jobs of the application are currently paused.
|
||||
*/
|
||||
bool isApplicationPaused() const;
|
||||
|
||||
/**
|
||||
* Sets whether the jobs of the application are currently paused.
|
||||
* @param isApplicationPaused True of False.
|
||||
*/
|
||||
void setIsApplicationPaused(bool isApplicationPaused);
|
||||
|
||||
/**
|
||||
* Returns the full path name of the XSLT file that performs
|
||||
* HTML filtering on jobs for the application.
|
||||
*/
|
||||
QString htmlFilterXsltFile() const;
|
||||
|
||||
/**
|
||||
* Sets the full path name of the XSLT file that performs
|
||||
* HTML filtering on jobs for the application.
|
||||
* @param filename Name of the XSLT file. Full path name.
|
||||
*/
|
||||
void setHtmlFilterXsltFile(const QString& filename);
|
||||
|
||||
/**
|
||||
* Returns the full path name of the XSLT file that performs
|
||||
* SSML filtering on jobs for the application.
|
||||
*/
|
||||
QString ssmlFilterXsltFile() const;
|
||||
|
||||
/**
|
||||
* Sets the full path name of the XSLT file that performs
|
||||
* SSML filtering on jobs for the application.
|
||||
* @param filename Name of the XSLT file. Full path name.
|
||||
*/
|
||||
void setSsmlFilterXsltFile(const QString& filename);
|
||||
|
||||
/**
|
||||
* Returns if KTTSD should attempt to automatically configure
|
||||
* talkers to meet requested talker attributes.
|
||||
*/
|
||||
bool autoConfigureTalkersOn() const;
|
||||
|
||||
/**
|
||||
* Sets whether KTTSD should attempt to automatically configure
|
||||
* talkers to meet requested talker attributes.
|
||||
* @param autoConfigureTalkersOn True if autoconfigure should be on.
|
||||
*/
|
||||
void setAutoConfigureTalkersOn(bool autoConfigureTalkersOn);
|
||||
|
||||
/**
|
||||
* Returns whether this application is a KTTS System Manager.
|
||||
* When an application is a System Manager, commands affect all jobs.
|
||||
* For example, a pause() command will pause all jobs of all applications.
|
||||
* Defaults to False.
|
||||
*/
|
||||
bool isSystemManager() const;
|
||||
|
||||
/**
|
||||
* Sets whether this application is a KTTS System Manager.
|
||||
* @param isSystemManager True or False.
|
||||
*/
|
||||
void setIsSystemManager(bool isSystemManager);
|
||||
|
||||
/**
|
||||
* Return the JobNum of the last job queued by the application.
|
||||
* 0 if none.
|
||||
*/
|
||||
int lastJobNum() const;
|
||||
|
||||
/**
|
||||
* List of jobs for this app. Caller may add or delete jobs,
|
||||
* but must not delete the list.
|
||||
*/
|
||||
TJobListPtr jobList() const;
|
||||
|
||||
/**
|
||||
* True when the app has exited.
|
||||
*/
|
||||
bool unregistered() const;
|
||||
void setUnregistered(bool unregistered);
|
||||
|
||||
// void debugDump();
|
||||
|
||||
private:
|
||||
AppDataPrivate* d;
|
||||
};
|
||||
|
||||
#endif // APPDATA_H
|
|
@ -1,233 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Description:t, applying each configured Filter in turn.
|
||||
Runs synchronously via call to convert()
|
||||
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
(C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// FilterMgr includes.
|
||||
#include "filtermgr.h"
|
||||
#include "moc_filtermgr.cpp"
|
||||
|
||||
// Qt includes
|
||||
|
||||
// KDE includes.
|
||||
#include <kdebug.h>
|
||||
#include <kconfig.h>
|
||||
#include <kconfiggroup.h>
|
||||
#include <kpluginloader.h>
|
||||
#include <ksharedconfig.h>
|
||||
#include <kservicetypetrader.h>
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
FilterMgr::FilterMgr( QObject *parent) :
|
||||
KttsFilterProc(parent, QVariantList())
|
||||
{
|
||||
// kDebug() << "FilterMgr::FilterMgr: Running";
|
||||
m_state = fsIdle;
|
||||
m_talkerCode = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
FilterMgr::~FilterMgr()
|
||||
{
|
||||
// kDebug() << "FilterMgr::~FilterMgr: Running";
|
||||
qDeleteAll(m_filterList);
|
||||
m_filterList.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads and initializes the filters.
|
||||
* @return False if FilterMgr is not ready to filter.
|
||||
*/
|
||||
bool FilterMgr::init(KConfig *c, const QString &configGroup)
|
||||
{
|
||||
// Load each of the filters and initialize.
|
||||
KSharedConfig::Ptr pConfig = KSharedConfig::openConfig( QLatin1String( "kttsdrc" ) );
|
||||
KConfigGroup config( pConfig, "General");
|
||||
KConfig* rawconfig = new KConfig(QLatin1String( "kttsdrc" ));
|
||||
QStringList filterIDsList = config.readEntry("FilterIDs", QStringList());
|
||||
kDebug() << "FilterMgr::init: FilterIDs = " << filterIDsList;
|
||||
|
||||
if ( !filterIDsList.isEmpty() )
|
||||
{
|
||||
QStringList::ConstIterator itEnd = filterIDsList.constEnd();
|
||||
for (QStringList::ConstIterator it = filterIDsList.constBegin(); it != itEnd; ++it)
|
||||
{
|
||||
QString filterID = *it;
|
||||
QString groupName = QLatin1String( "Filter_" ) + filterID;
|
||||
KConfigGroup thisgroup = pConfig->group(groupName);
|
||||
QString desktopEntryName = thisgroup.readEntry( "DesktopEntryName" );
|
||||
// If a DesktopEntryName is not in the config file, it was configured before
|
||||
// we started using them, when we stored translated plugin names instead.
|
||||
// Try to convert the translated plugin name to a DesktopEntryName.
|
||||
// DesktopEntryNames are better because user can change their desktop language
|
||||
// and DesktopEntryName won't change.
|
||||
if (desktopEntryName.isEmpty())
|
||||
{
|
||||
QString filterPlugInName = thisgroup.readEntry("PlugInName", QString());
|
||||
// See if the translated name will untranslate. If not, well, sorry.
|
||||
desktopEntryName = FilterNameToDesktopEntryName(filterPlugInName);
|
||||
// Record the DesktopEntryName from now on.
|
||||
if (!desktopEntryName.isEmpty())
|
||||
thisgroup.writeEntry("DesktopEntryName", desktopEntryName);
|
||||
}
|
||||
if (thisgroup.readEntry("Enabled",false) || thisgroup.readEntry("IsSBD",false))
|
||||
{
|
||||
kDebug() << "FilterMgr::init: filterID = " << filterID;
|
||||
KttsFilterProc* filterProc = loadFilterPlugin( desktopEntryName );
|
||||
if ( filterProc )
|
||||
{
|
||||
filterProc->init( rawconfig, groupName );
|
||||
m_filterList.append( filterProc );
|
||||
}
|
||||
//if (thisgroup.readEntry("DocType").contains("html") ||
|
||||
// thisgroup.readEntry("RootElement").contains("html"))
|
||||
//m_supportsHTML = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete rawconfig;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronously convert text.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that Jovie intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DCOP appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
* @return Converted text.
|
||||
*/
|
||||
QString FilterMgr::convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId)
|
||||
{
|
||||
m_text = inputText;
|
||||
m_talkerCode = talkerCode;
|
||||
m_appId = appId;
|
||||
m_filterIndex = -1;
|
||||
m_filterProc = 0;
|
||||
m_state = fsFiltering;
|
||||
//m_async = false;
|
||||
while ( m_state == fsFiltering )
|
||||
nextFilter();
|
||||
return m_text;
|
||||
}
|
||||
|
||||
// Finishes up with current filter (if any) and goes on to the next filter.
|
||||
void FilterMgr::nextFilter()
|
||||
{
|
||||
++m_filterIndex;
|
||||
if (m_filterIndex == m_filterList.count())
|
||||
{
|
||||
m_state = fsFinished;
|
||||
return;
|
||||
}
|
||||
m_filterProc = m_filterList.at(m_filterIndex);
|
||||
m_text = m_filterProc->convert( m_text, m_talkerCode, m_appId );
|
||||
if (m_filterProc->wasModified())
|
||||
kDebug() << "FilterMgr::nextFilter: Filter# " << m_filterIndex << " modified the text.";
|
||||
}
|
||||
|
||||
// Loads the processing plug in for a filter plug in given its DesktopEntryName.
|
||||
KttsFilterProc* FilterMgr::loadFilterPlugin(const QString& desktopEntryName)
|
||||
{
|
||||
// kDebug() << "FilterMgr::loadFilterPlugin: Running";
|
||||
|
||||
// Find the plugin.
|
||||
KService::List offers = KServiceTypeTrader::self()->query(QLatin1String( "Jovie/FilterPlugin" ),
|
||||
QString(QLatin1String( "DesktopEntryName == '%1'" )).arg(desktopEntryName));
|
||||
|
||||
if (offers.count() == 1)
|
||||
{
|
||||
// When the entry is found, load the plug in
|
||||
// First create a factory for the library
|
||||
KPluginLoader loader(offers[0]->library());
|
||||
KPluginFactory* factory = loader.factory();
|
||||
if (!factory) {
|
||||
// Something went wrong, returning null.
|
||||
kDebug() << "FilterMgr::loadFilterPlugin: Unable to create Factory object for plugin "
|
||||
<< desktopEntryName << endl;
|
||||
return NULL;
|
||||
} else {
|
||||
KttsFilterProc *plugIn = factory->create<KttsFilterProc>();
|
||||
if (plugIn) {
|
||||
return plugIn;
|
||||
} else {
|
||||
// Something went wrong, returning null.
|
||||
kDebug() << "FilterMgr::loadFilterPlugin: Unable to instantiate "
|
||||
<< "KttsFilterProc class for plugin " << desktopEntryName;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
//KPluginFactory *factory = KLibLoader::self()->factory(offers[0]->library().toLatin1());
|
||||
//if(factory){
|
||||
// // If the factory is created successfully, instantiate the KttsFilterConf class for the
|
||||
// // specific plug in to get the plug in configuration object.
|
||||
// KttsFilterProc *plugIn =
|
||||
// KLibLoader::createInstance<KttsFilterProc>(
|
||||
// offers[0]->library().toLatin1(), NULL, QStringList(offers[0]->library().toLatin1()),
|
||||
// &errorNo);
|
||||
// if(plugIn){
|
||||
// // If everything went ok, return the plug in pointer.
|
||||
// // kDebug() << "FilterMgr::loadFilterPlugin: plugin " << offers[0]->library().toLatin1() << " loaded successfully.";
|
||||
// return plugIn;
|
||||
// } else {
|
||||
// // Something went wrong, returning null.
|
||||
// kDebug() << "FilterMgr::loadFilterPlugin: Unable to instantiate KttsFilterProc class for plugin " << desktopEntryName << " error: " << errorNo;
|
||||
// return NULL;
|
||||
// }
|
||||
//} else {
|
||||
// // Something went wrong, returning null.
|
||||
// kDebug() << "FilterMgr::loadFilterPlugin: Unable to create Factory object for plugin "
|
||||
// << desktopEntryName << endl;
|
||||
// return NULL;
|
||||
//}
|
||||
}
|
||||
// The plug in was not found (unexpected behaviour, returns null).
|
||||
kDebug() << "FilterMgr::loadFilterPlugin: KTrader did not return an offer for plugin "
|
||||
<< desktopEntryName << endl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses KTrader to convert a translated Filter Plugin Name to DesktopEntryName.
|
||||
* @param name The translated plugin name. From Name= line in .desktop file.
|
||||
* @return DesktopEntryName. The name of the .desktop file (less .desktop).
|
||||
* QString() if not found.
|
||||
*/
|
||||
QString FilterMgr::FilterNameToDesktopEntryName(const QString& name)
|
||||
{
|
||||
if (name.isEmpty()) return QString();
|
||||
KService::List offers = KServiceTypeTrader::self()->query(QLatin1String( "Jovie/FilterPlugin" ),
|
||||
QString(QLatin1String( "Name == '%1'" )).arg(name));
|
||||
|
||||
if (offers.count() == 1)
|
||||
return offers[0]->desktopEntryName();
|
||||
else
|
||||
return QString();
|
||||
}
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Description:
|
||||
Filters text, applying each configured Filter in turn.
|
||||
Runs asynchronously, emitting Finished() signal when all Filters have run.
|
||||
|
||||
Copyright:
|
||||
(C) 2005 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
(C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 FILTERMGR_H
|
||||
#define FILTERMGR_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QList>
|
||||
|
||||
// KTTS includes.
|
||||
#include "filterproc.h"
|
||||
|
||||
class TalkerCode;
|
||||
|
||||
typedef QList<KttsFilterProc*> FilterList;
|
||||
|
||||
/**
|
||||
* @class FilterMgr
|
||||
*
|
||||
* Manager for filter objects. Loads and configures filters that have been
|
||||
* set up by the user as per the config file. Also filters text to bee spoken
|
||||
* by running it through all the configured filters.
|
||||
*/
|
||||
class FilterMgr : public KttsFilterProc
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
explicit FilterMgr(QObject *parent = 0);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~FilterMgr();
|
||||
|
||||
/**
|
||||
* Initialize the filters.
|
||||
* @return False if filter is not ready to filter.
|
||||
*
|
||||
* Note: The parameters are for reading from kttsdrc file. Plugins may wish to maintain
|
||||
* separate configuration files of their own.
|
||||
*/
|
||||
virtual bool init(KConfig *c, const QString &configGroup);
|
||||
|
||||
/**
|
||||
* Synchronously convert text.
|
||||
* @param inputText Input text.
|
||||
* @param talkerCode TalkerCode structure for the talker that KTTSD intends to
|
||||
* use for synthing the text. Useful for extracting hints about
|
||||
* how to filter the text. For example, languageCode.
|
||||
* @param appId The DBUS appId of the application that queued the text.
|
||||
* Also useful for hints about how to do the filtering.
|
||||
* @return Converted text.
|
||||
*/
|
||||
virtual QString convert(const QString& inputText, TalkerCode* talkerCode, const QString& appId);
|
||||
|
||||
private:
|
||||
// Loads the processing plug in for a named filter plug in.
|
||||
KttsFilterProc* loadFilterPlugin(const QString& plugInName);
|
||||
// Finishes up with current filter (if any) and goes on to the next filter.
|
||||
void nextFilter();
|
||||
// Uses KTrader to convert a translated Filter Plugin Name to DesktopEntryName.
|
||||
// @param name The translated plugin name. From Name= line in .desktop file.
|
||||
// @return DesktopEntryName. The name of the .desktop file (less .desktop).
|
||||
// QString() if not found.
|
||||
QString FilterNameToDesktopEntryName(const QString& name);
|
||||
|
||||
// List of filters.
|
||||
FilterList m_filterList;
|
||||
// Text being filtered.
|
||||
QString m_text;
|
||||
// Index to list of filters.
|
||||
int m_filterIndex;
|
||||
// Current filter.
|
||||
KttsFilterProc* m_filterProc;
|
||||
// Talker Code.
|
||||
TalkerCode* m_talkerCode;
|
||||
// AppId.
|
||||
QString m_appId;
|
||||
// FilterMgr state.
|
||||
int m_state;
|
||||
};
|
||||
|
||||
#endif // FILTERMGR_H
|
|
@ -1,619 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Jovie
|
||||
|
||||
The KDE Text-to-Speech object.
|
||||
------------------------------
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
(C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 "jovie.h"
|
||||
|
||||
#include <kspeech.h>
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtCore/QTextStream>
|
||||
#include <QtCore/QTextCodec>
|
||||
#include <QtCore/QFile>
|
||||
|
||||
// KDE includes.
|
||||
#include <kdebug.h>
|
||||
#include <kglobal.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <klocale.h>
|
||||
#include <kcomponentdata.h>
|
||||
#include <kfiledialog.h>
|
||||
#include <KRun>
|
||||
#include <kaboutdata.h>
|
||||
|
||||
|
||||
// Jovie includes.
|
||||
#include "talkermgr.h"
|
||||
#include "talkercode.h"
|
||||
// define spd_debug here to avoid a link error in speech-dispatcher 0.6.7's header file for now
|
||||
#define spd_debug spd_debug2
|
||||
#include "speaker.h"
|
||||
#include "jovietrayicon.h"
|
||||
|
||||
#include "kspeechadaptor.h"
|
||||
|
||||
/* JoviePrivate Class ================================================== */
|
||||
|
||||
class JoviePrivate
|
||||
{
|
||||
JoviePrivate()
|
||||
{
|
||||
trayIcon = new JovieTrayIcon();
|
||||
}
|
||||
|
||||
~JoviePrivate()
|
||||
{
|
||||
delete trayIcon;
|
||||
}
|
||||
|
||||
friend class Jovie;
|
||||
|
||||
protected:
|
||||
/*
|
||||
* The DBUS sender ID of last application to call KTTSD.
|
||||
*/
|
||||
QString callingAppId;
|
||||
|
||||
/*
|
||||
* The tray icon.
|
||||
*/
|
||||
JovieTrayIcon *trayIcon;
|
||||
|
||||
};
|
||||
|
||||
/* Jovie Class ========================================================= */
|
||||
|
||||
/* ---- Public Methods --------------------------------------------------- */
|
||||
Jovie * Jovie::m_instance = NULL;
|
||||
|
||||
Jovie * Jovie::Instance()
|
||||
{
|
||||
if (m_instance == NULL)
|
||||
{
|
||||
m_instance = new Jovie();
|
||||
}
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
Jovie::Jovie(QObject *parent) :
|
||||
QObject(parent), d(new JoviePrivate())
|
||||
{
|
||||
kDebug() << "Jovie::Jovie Running";
|
||||
}
|
||||
|
||||
Jovie::~Jovie()
|
||||
{
|
||||
kDebug() << "Jovie::~Jovie:: Stopping Jovie service";
|
||||
Speaker::Instance()->requestExit();
|
||||
delete d;
|
||||
announceEvent(QLatin1String( "~Jovie" ), QLatin1String( "jovieExiting" ));
|
||||
emit kttsdExiting();
|
||||
}
|
||||
|
||||
/* ---- DBUS exported functions ------------------------------------------ */
|
||||
|
||||
bool Jovie::isSpeaking() const
|
||||
{
|
||||
return Speaker::Instance()->isSpeaking();
|
||||
}
|
||||
|
||||
QString Jovie::version() const
|
||||
{
|
||||
return KGlobal::mainComponent().aboutData()->version();
|
||||
}
|
||||
|
||||
QString Jovie::applicationName()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->applicationName();
|
||||
}
|
||||
|
||||
void Jovie::setApplicationName(const QString &applicationName)
|
||||
{
|
||||
kDebug() << "setting application name to : " << applicationName;
|
||||
Speaker::Instance()->getAppData(callingAppId())->setApplicationName(applicationName);
|
||||
}
|
||||
|
||||
QString Jovie::defaultTalker()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->defaultTalker();
|
||||
}
|
||||
|
||||
void Jovie::setDefaultTalker(const QString &defaultTalker)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setDefaultTalker(defaultTalker);
|
||||
}
|
||||
|
||||
void Jovie::setCurrentTalker(const TalkerCode &talker)
|
||||
{
|
||||
Speaker::Instance()->setOutputModule(talker.outputModule());
|
||||
Speaker::Instance()->setLanguage(TalkerCode::languageCodeToLanguage(talker.language()));
|
||||
Speaker::Instance()->setVoiceType(talker.voiceType());
|
||||
Speaker::Instance()->setVolume(talker.volume());
|
||||
Speaker::Instance()->setSpeed(talker.rate());
|
||||
Speaker::Instance()->setPitch(talker.pitch());
|
||||
}
|
||||
|
||||
int Jovie::defaultPriority()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->defaultPriority();
|
||||
}
|
||||
|
||||
void Jovie::setDefaultPriority(int defaultPriority)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setDefaultPriority((KSpeech::JobPriority)defaultPriority);
|
||||
}
|
||||
|
||||
QString Jovie::sentenceDelimiter()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->sentenceDelimiter();
|
||||
}
|
||||
|
||||
void Jovie::setSentenceDelimiter(const QString &sentenceDelimiter)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setSentenceDelimiter(sentenceDelimiter);
|
||||
}
|
||||
|
||||
bool Jovie::filteringOn()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->filteringOn();
|
||||
}
|
||||
|
||||
void Jovie::setFilteringOn(bool filteringOn)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setFilteringOn(filteringOn);
|
||||
}
|
||||
|
||||
bool Jovie::autoConfigureTalkersOn()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->autoConfigureTalkersOn();
|
||||
}
|
||||
|
||||
void Jovie::setAutoConfigureTalkersOn(bool autoConfigureTalkersOn)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setAutoConfigureTalkersOn(autoConfigureTalkersOn);
|
||||
}
|
||||
|
||||
bool Jovie::isApplicationPaused()
|
||||
{
|
||||
return Speaker::Instance()->isApplicationPaused(callingAppId());
|
||||
}
|
||||
|
||||
QString Jovie::htmlFilterXsltFile()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->htmlFilterXsltFile();
|
||||
}
|
||||
|
||||
void Jovie::setHtmlFilterXsltFile(const QString &htmlFilterXsltFile)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setHtmlFilterXsltFile(htmlFilterXsltFile);
|
||||
}
|
||||
|
||||
QString Jovie::ssmlFilterXsltFile()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->ssmlFilterXsltFile();
|
||||
}
|
||||
|
||||
void Jovie::setSsmlFilterXsltFile(const QString &ssmlFilterXsltFile)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setSsmlFilterXsltFile(ssmlFilterXsltFile);
|
||||
}
|
||||
|
||||
bool Jovie::isSystemManager()
|
||||
{
|
||||
return Speaker::Instance()->getAppData(callingAppId())->isSystemManager();
|
||||
}
|
||||
|
||||
void Jovie::setIsSystemManager(bool isSystemManager)
|
||||
{
|
||||
Speaker::Instance()->getAppData(callingAppId())->setIsSystemManager(isSystemManager);
|
||||
}
|
||||
|
||||
int Jovie::say(const QString &text, int options) {
|
||||
// kDebug() << "Jovie::say: Adding '" << text << "' to queue.";
|
||||
Speaker * speaker = Speaker::Instance();
|
||||
return speaker->say(speaker->getAppData(callingAppId())->applicationName(), text, options);
|
||||
}
|
||||
|
||||
int Jovie::sayFile(const QString &filename, const QString &encoding)
|
||||
{
|
||||
// kDebug() << "Jovie::setFile: Running";
|
||||
QFile file(filename);
|
||||
int jobNum = 0;
|
||||
if ( file.open(QIODevice::ReadOnly) )
|
||||
{
|
||||
QTextStream stream(&file);
|
||||
if (!encoding.isEmpty())
|
||||
{
|
||||
QTextCodec* codec = QTextCodec::codecForName(encoding.toLatin1());
|
||||
if (codec) stream.setCodec(codec);
|
||||
}
|
||||
jobNum = Speaker::Instance()->say(callingAppId(), stream.readAll(), 0);
|
||||
file.close();
|
||||
}
|
||||
return jobNum;
|
||||
}
|
||||
|
||||
int Jovie::sayClipboard()
|
||||
{
|
||||
// Get the clipboard object.
|
||||
QClipboard *cb = qApp->clipboard();
|
||||
|
||||
// Copy text from the clipboard.
|
||||
QString text = cb->text();
|
||||
|
||||
// Speak it.
|
||||
if (!text.isEmpty())
|
||||
{
|
||||
return Speaker::Instance()->say(callingAppId(), text, 0);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
QStringList Jovie::outputModules()
|
||||
{
|
||||
return Speaker::Instance()->outputModules();
|
||||
}
|
||||
|
||||
QStringList Jovie::languagesByModule(const QString & module)
|
||||
{
|
||||
return Speaker::Instance()->languagesByModule(module);
|
||||
}
|
||||
|
||||
QStringList Jovie::getPossibleTalkers()
|
||||
{
|
||||
return Speaker::Instance()->getPossibleTalkers();
|
||||
}
|
||||
|
||||
void Jovie::setSpeed(int speed)
|
||||
{
|
||||
if (speed < -100 || speed > 100) {
|
||||
kDebug() << "setSpeed called with out of range speed value: " << speed;
|
||||
}
|
||||
else {
|
||||
Speaker::Instance()->setSpeed(speed);
|
||||
}
|
||||
}
|
||||
|
||||
int Jovie::speed()
|
||||
{
|
||||
return Speaker::Instance()->speed();
|
||||
}
|
||||
|
||||
void Jovie::setPitch(int pitch)
|
||||
{
|
||||
if (pitch < -100 || pitch > 100) {
|
||||
kDebug() << "setPitch called with out of range pitch value: " << pitch;
|
||||
}
|
||||
else {
|
||||
Speaker::Instance()->setPitch(pitch);
|
||||
}
|
||||
}
|
||||
|
||||
int Jovie::pitch()
|
||||
{
|
||||
return Speaker::Instance()->pitch();
|
||||
}
|
||||
|
||||
void Jovie::setVolume(int volume)
|
||||
{
|
||||
if (volume < -100 || volume > 100) {
|
||||
kDebug() << "setVolume called with out of range volume value: " << volume;
|
||||
}
|
||||
else {
|
||||
Speaker::Instance()->setVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
int Jovie::volume()
|
||||
{
|
||||
return Speaker::Instance()->volume();
|
||||
}
|
||||
|
||||
void Jovie::setOutputModule(const QString & module)
|
||||
{
|
||||
Speaker::Instance()->setOutputModule(module);
|
||||
}
|
||||
|
||||
void Jovie::setLanguage(const QString & language)
|
||||
{
|
||||
Speaker::Instance()->setLanguage(language);
|
||||
}
|
||||
|
||||
void Jovie::setVoiceType(int voiceType)
|
||||
{
|
||||
Speaker::Instance()->setVoiceType(voiceType);
|
||||
}
|
||||
|
||||
int Jovie::voiceType()
|
||||
{
|
||||
return Speaker::Instance()->voiceType();
|
||||
}
|
||||
|
||||
void Jovie::setPunctuationType(int punctuation)
|
||||
{
|
||||
Speaker::Instance()->setPunctuationType(punctuation);
|
||||
}
|
||||
|
||||
void Jovie::stop()
|
||||
{
|
||||
Speaker::Instance()->stop();
|
||||
}
|
||||
|
||||
void Jovie::cancel()
|
||||
{
|
||||
Speaker::Instance()->cancel();
|
||||
}
|
||||
|
||||
void Jovie::pause()
|
||||
{
|
||||
Speaker::Instance()->pause();
|
||||
}
|
||||
|
||||
void Jovie::resume()
|
||||
{
|
||||
Speaker::Instance()->resume();
|
||||
}
|
||||
|
||||
void Jovie::removeJob(int jobNum)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
}
|
||||
|
||||
void Jovie::removeAllJobs()
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
}
|
||||
|
||||
int Jovie::getSentenceCount(int jobNum)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Jovie::getCurrentJob()
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Jovie::getJobCount(int priority)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return 0;
|
||||
}
|
||||
|
||||
QStringList Jovie::getJobNumbers(int priority)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
int Jovie::getJobState(int jobNum)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return 0;
|
||||
}
|
||||
|
||||
QByteArray Jovie::getJobInfo(int jobNum)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
QString Jovie::getJobSentence(int jobNum, int sentenceNum)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return QString();
|
||||
}
|
||||
|
||||
QStringList Jovie::getTalkerCodes()
|
||||
{
|
||||
return TalkerMgr::Instance()->getTalkers();
|
||||
}
|
||||
|
||||
QString Jovie::talkerToTalkerId(const QString &talker)
|
||||
{
|
||||
return TalkerMgr::Instance()->talkerCodeToTalkerId(talker);
|
||||
}
|
||||
|
||||
int Jovie::getTalkerCapabilities1(const QString &talker)
|
||||
{
|
||||
// TODO:
|
||||
Q_UNUSED(talker);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int Jovie::getTalkerCapabilities2(const QString &talker)
|
||||
{
|
||||
// TODO:
|
||||
Q_UNUSED(talker);
|
||||
return 0;
|
||||
}
|
||||
|
||||
QStringList Jovie::getTalkerVoices(const QString &talker)
|
||||
{
|
||||
// TODO:
|
||||
Q_UNUSED(talker);
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
void Jovie::changeJobTalker(int jobNum, const QString &talker)
|
||||
{
|
||||
jobNum = applyDefaultJobNum(jobNum);
|
||||
Speaker::Instance()->setTalker(jobNum, talker);
|
||||
}
|
||||
|
||||
void Jovie::moveJobLater(int jobNum)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
}
|
||||
|
||||
int Jovie::moveRelSentence(int jobNum, int n)
|
||||
{
|
||||
kDebug() << "not implemented in speech-dispatcher yet";
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Jovie::showManagerDialog()
|
||||
{
|
||||
QString cmd = QLatin1String( "kcmshell4 kcmkttsd --caption " );
|
||||
cmd += QLatin1Char( '\'' ) + i18n("KDE Text-to-Speech") + QLatin1Char( '\'' );
|
||||
KRun::runCommand(cmd,NULL);
|
||||
}
|
||||
|
||||
void Jovie::kttsdExit()
|
||||
{
|
||||
announceEvent(QLatin1String( "kttsdExit" ), QLatin1String( "kttsdExiting" ));
|
||||
emit kttsdExiting();
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
void Jovie::init()
|
||||
{
|
||||
new KSpeechAdaptor(this);
|
||||
if (ready()) {
|
||||
QDBusConnection::sessionBus().registerObject(QLatin1String( "/KSpeech" ), this, QDBusConnection::ExportAdaptors);
|
||||
}
|
||||
}
|
||||
|
||||
void Jovie::reinit()
|
||||
{
|
||||
// Reload ourself.
|
||||
kDebug() << "Jovie::reinit: Running";
|
||||
//if (Speaker::Instance()->isSpeaking())
|
||||
// Speaker::Instance()->pause();
|
||||
Speaker::Instance()->init();
|
||||
QDBusConnection::sessionBus().unregisterObject(QLatin1String( "/KSpeech" ));
|
||||
if (ready()) {
|
||||
QDBusConnection::sessionBus().registerObject(QLatin1String( "/KSpeech" ), this, QDBusConnection::ExportAdaptors);
|
||||
}
|
||||
|
||||
d->trayIcon->slotUpdateTalkersMenu();
|
||||
}
|
||||
|
||||
void Jovie::setCallingAppId(const QString& appId)
|
||||
{
|
||||
d->callingAppId = appId;
|
||||
}
|
||||
|
||||
/* ---- Private Methods ------------------------------------------ */
|
||||
|
||||
bool Jovie::initializeConfigData()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Jovie::ready()
|
||||
{
|
||||
// TODO: add a check here to see if kttsd is ready (Speaker::Instance() will always be true...)
|
||||
//if (Speaker::Instance())
|
||||
// return true;
|
||||
//kDebug() << "Jovie::ready: Starting KTTSD service";
|
||||
if (!initializeTalkerMgr())
|
||||
return false;
|
||||
if (!initializeSpeaker())
|
||||
return false;
|
||||
announceEvent(QLatin1String( "ready" ), QLatin1String( "kttsdStarted" ));
|
||||
emit kttsdStarted();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Jovie::initializeTalkerMgr()
|
||||
{
|
||||
TalkerMgr::Instance()->loadTalkers(KGlobal::config().data());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Jovie::initializeSpeaker()
|
||||
{
|
||||
kDebug() << "Jovie::initializeSpeaker: Instantiating Speaker";
|
||||
|
||||
Speaker::Instance()->init();
|
||||
|
||||
// Establish ourself as a System Manager application.
|
||||
Speaker::Instance()->getAppData(QLatin1String( "jovie" ))->setIsSystemManager(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void Jovie::slotJobStateChanged(const QString& appId, int jobNum, KSpeech::JobState state)
|
||||
{
|
||||
announceEvent(QLatin1String( "slotJobStateChanged" ), QLatin1String( "jobStateChanged" ), appId, jobNum, state);
|
||||
emit jobStateChanged(appId, jobNum, state);
|
||||
}
|
||||
|
||||
void Jovie::slotMarker(const QString& appId, int jobNum, KSpeech::MarkerType markerType, const QString& markerData)
|
||||
{
|
||||
announceEvent(QLatin1String( "slotMarker" ), QLatin1String( "marker" ), appId, jobNum, markerType, markerData);
|
||||
emit marker(appId, jobNum, markerType, markerData);
|
||||
}
|
||||
|
||||
void Jovie::slotFilteringFinished()
|
||||
{
|
||||
//Speaker::Instance()->doUtterances();
|
||||
}
|
||||
|
||||
QString Jovie::callingAppId()
|
||||
{
|
||||
// TODO: What would be nice is if there were a way to get the
|
||||
// last DBUS sender() without having to add DBusMessage to every
|
||||
// slot. Then it would not be necessary to hand-edit the adaptor.
|
||||
return d->callingAppId;
|
||||
}
|
||||
|
||||
int Jovie::applyDefaultJobNum(int jobNum)
|
||||
{
|
||||
int jNum = jobNum;
|
||||
if (!jNum)
|
||||
{
|
||||
jNum = Speaker::Instance()->findJobNumByAppId(callingAppId());
|
||||
if (!jNum) jNum = getCurrentJob();
|
||||
if (!jNum) jNum = Speaker::Instance()->findJobNumByAppId(QString());
|
||||
}
|
||||
return jNum;
|
||||
}
|
||||
|
||||
void Jovie::announceEvent(const QString& slotName, const QString& eventName)
|
||||
{
|
||||
kDebug() << "Jovie::" << slotName << ": emitting DBUS signal " << eventName;
|
||||
}
|
||||
|
||||
void Jovie::announceEvent(const QString& slotName, const QString& eventName, const QString& appId,
|
||||
int jobNum, KSpeech::MarkerType markerType, const QString& markerData)
|
||||
{
|
||||
kDebug() << "Jovie::" << slotName << ": emitting DBUS signal " << eventName
|
||||
<< " with appId " << appId << " job number " << jobNum << " marker type " << markerType << " and data " << markerData << endl;
|
||||
}
|
||||
|
||||
void Jovie::announceEvent(const QString& slotName, const QString& eventName, const QString& appId,
|
||||
int jobNum, KSpeech::JobState state)
|
||||
{
|
||||
kDebug() << "Jovie::" << slotName << ": emitting DBUS signal " << eventName <<
|
||||
" with appId " << appId << " job number " << jobNum << " and state " << /* SpeechJob::jobStateToStr(state) << */ endl;
|
||||
}
|
|
@ -1,149 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
Exec=jovie
|
||||
Icon=preferences-desktop-text-to-speech
|
||||
ServiceTypes=DBUS/Text-to-Speech
|
||||
X-DBUS-StartupType=Unique
|
||||
X-KDE-StartupNotify=false
|
||||
GenericName=Text To Speech Service
|
||||
GenericName[bg]=Услуга за екранен четец
|
||||
GenericName[bs]=Usluga tekst u zvuk
|
||||
GenericName[ca]=Servei de text a veu
|
||||
GenericName[ca@valencia]=Servei de text a veu
|
||||
GenericName[cs]=Služba hlasové syntézy
|
||||
GenericName[da]=Tekst til tale-tjeneste
|
||||
GenericName[de]=Sprachausgabedienst
|
||||
GenericName[el]=Υπηρεσία από κείμενο σε ομιλία
|
||||
GenericName[en_GB]=Text To Speech Service
|
||||
GenericName[es]=Servicio de texto hablado
|
||||
GenericName[et]=Teksti ettelugemise teenus
|
||||
GenericName[eu]=Testutik hizketarako zerbitzua
|
||||
GenericName[fi]=Puhesyntetisaattoripalvelu
|
||||
GenericName[fr]=Service de synthèse vocale
|
||||
GenericName[ga]=Seirbhís Téacs-Go-Caint
|
||||
GenericName[gl]=Servizo de texto-para-voz
|
||||
GenericName[hu]=Szövegfelolvasó szolgáltatás
|
||||
GenericName[is]=Texti-í-tal þjónusta
|
||||
GenericName[it]=Servizio di pronuncia di KDE
|
||||
GenericName[kk]=Мәтінді дауыстап оқу қызметі
|
||||
GenericName[ko]=텍스트 읽어주기 서비스
|
||||
GenericName[lt]=Teksto keitimo į kalbą paslauga
|
||||
GenericName[lv]=Teksta izrunāšanas serviss
|
||||
GenericName[mr]=पाठ्य ते भाष्य सेवा
|
||||
GenericName[nb]=Tekst-til-tale-tjeneste
|
||||
GenericName[nds]=Vörlees-Deenst
|
||||
GenericName[nl]=Tekst-naar-spraak-service
|
||||
GenericName[pl]=Usługa tekstu-na-mowę
|
||||
GenericName[pt]=Serviço de Texto-para-Fala
|
||||
GenericName[pt_BR]=Serviço de sintetizador de voz
|
||||
GenericName[ru]=Служба синтеза речи
|
||||
GenericName[sk]=Služba Text na reč
|
||||
GenericName[sl]=Storitev besedilo-v-govor za KDE
|
||||
GenericName[sr]=Сервис за текст‑у‑говор
|
||||
GenericName[sr@ijekavian]=Сервис за текст‑у‑говор
|
||||
GenericName[sr@ijekavianlatin]=Servis za tekst‑u‑govor
|
||||
GenericName[sr@latin]=Servis za tekst‑u‑govor
|
||||
GenericName[sv]=Text-till-tal tjänst
|
||||
GenericName[tr]=Metin Okuma Servisi
|
||||
GenericName[ug]=تېكىستتىن ئاۋازغا مۇلازىمىتى
|
||||
GenericName[uk]=Служба синтезу мовлення з тексту
|
||||
GenericName[x-test]=xxText To Speech Servicexx
|
||||
GenericName[zh_CN]=文本到语音服务
|
||||
GenericName[zh_TW]=文字轉語音服務
|
||||
Name=Jovie
|
||||
Name[bg]=Jovie
|
||||
Name[bs]=Jovie
|
||||
Name[ca]=Jovie
|
||||
Name[ca@valencia]=Jovie
|
||||
Name[cs]=Jovie
|
||||
Name[da]=Jovie
|
||||
Name[de]=Jovie
|
||||
Name[el]=Jovie
|
||||
Name[en_GB]=Jovie
|
||||
Name[es]=Jovie
|
||||
Name[et]=Jovie
|
||||
Name[eu]=Jovie
|
||||
Name[fi]=Jovie
|
||||
Name[fr]=Jovie
|
||||
Name[ga]=Jovie
|
||||
Name[gl]=Jovie
|
||||
Name[hr]=Jovie
|
||||
Name[hu]=Jovie
|
||||
Name[is]=Jovie
|
||||
Name[it]=Jovie
|
||||
Name[ja]=Jovie
|
||||
Name[kk]=Jovie
|
||||
Name[ko]=Jovie
|
||||
Name[lt]=Jovie
|
||||
Name[lv]=Jovie
|
||||
Name[mr]=जोव्ही
|
||||
Name[nb]=Jovie
|
||||
Name[nds]=Jovie
|
||||
Name[nl]=Jovie
|
||||
Name[nn]=Jovie
|
||||
Name[pl]=Jovie
|
||||
Name[pt]=Jovie
|
||||
Name[pt_BR]=Jovie
|
||||
Name[ru]=Jovie
|
||||
Name[sk]=Jovie
|
||||
Name[sl]=Jovie
|
||||
Name[sr]=Џови
|
||||
Name[sr@ijekavian]=Џови
|
||||
Name[sr@ijekavianlatin]=Džovi
|
||||
Name[sr@latin]=Džovi
|
||||
Name[sv]=Jovie
|
||||
Name[tr]=Jovie
|
||||
Name[ug]=Jovie
|
||||
Name[uk]=Jovie
|
||||
Name[x-test]=xxJoviexx
|
||||
Name[zh_CN]=Jovie
|
||||
Name[zh_TW]=Jovie
|
||||
Comment=KDE Text To Speech Service
|
||||
Comment[bg]=Услуга на KDE за екранен четец
|
||||
Comment[bs]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[ca]=Servei de text a veu del KDE
|
||||
Comment[ca@valencia]=Servei de text a veu del KDE
|
||||
Comment[cs]=Služba hlasové syntézy KDE
|
||||
Comment[da]=KDE tekst til tale-tjeneste
|
||||
Comment[de]=KDE Sprachausgabedienst
|
||||
Comment[el]=KDE υπηρεσία από κείμενο-σε-ομιλία
|
||||
Comment[en_GB]=KDE Text To Speech Service
|
||||
Comment[es]=Servicio de KDE para la síntesis de texto a voz
|
||||
Comment[et]=KDE teksti ettelugemise deemon
|
||||
Comment[eu]=KDEren testutik hizketarako zerbitzua
|
||||
Comment[fi]=KDE:n puhesyntetisaattoripalvelu
|
||||
Comment[fr]=Service de synthèse vocale pour KDE
|
||||
Comment[ga]=Seirbhís Téacs-Go-Caint KDE
|
||||
Comment[gl]=Servizo de texto-para-voz de KDE.
|
||||
Comment[hr]=KDE-ov servis za pretvorbu teksta u govor
|
||||
Comment[hu]=KDE szövegfelolvasó szolgáltatás
|
||||
Comment[is]=KDE texti-í-tal þjónusta
|
||||
Comment[it]=Servizio di pronuncia di KDE
|
||||
Comment[ja]=KDE テキスト読み上げサービス
|
||||
Comment[kk]=KDE-нің мәтінді дауыстап оқу қызметі
|
||||
Comment[ko]=KDE 텍스트 읽어주기 서비스
|
||||
Comment[lt]=KDE teksto keitimo į kalbą paslauga
|
||||
Comment[lv]=KDE teksta izrunāšanas serviss
|
||||
Comment[mr]=केडीई पाठ्य ते भाष्य सेवा
|
||||
Comment[nb]=KDE tekst-til-tale-tjeneste
|
||||
Comment[nds]=Vörlees-Deenst vun KDE
|
||||
Comment[nl]=KDE tekst-naar-spraak-service
|
||||
Comment[nn]=Tekst-til-tale-teneste for KDE
|
||||
Comment[pl]=Usługa tekstu-na-mowę dla KDE
|
||||
Comment[pt]=Serviço de Texto-para-Fala do KDE
|
||||
Comment[pt_BR]=Serviço de sintetizador de voz do KDE
|
||||
Comment[ru]=Служба синтеза речи в KDE
|
||||
Comment[sk]=KDE služba Text na reč
|
||||
Comment[sl]=Storitev besedilo-v-govor za KDE
|
||||
Comment[sr]=КДЕ‑ов сервис за текст‑у‑говор
|
||||
Comment[sr@ijekavian]=КДЕ‑ов сервис за текст‑у‑говор
|
||||
Comment[sr@ijekavianlatin]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[sr@latin]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[sv]=KDE:s text-till-tal tjänst
|
||||
Comment[tr]=KDE Metin Okuma (Text To Speech) Hizmeti
|
||||
Comment[ug]=KDE تېكىستتىن ئاۋازغا مۇلازىمىتى
|
||||
Comment[uk]=Служба KDE синтезу мовлення з тексту
|
||||
Comment[x-test]=xxKDE Text To Speech Servicexx
|
||||
Comment[zh_CN]=KDE 文本到语音服务
|
||||
Comment[zh_TW]=KDE 文字轉語音服務
|
||||
Categories=Qt;KDE;Utility;Accessibility;
|
|
@ -1,642 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Jovie (KDE Text to Speech)
|
||||
|
||||
The KDE Text-to-Speech API.
|
||||
------------------------------
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
(C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef JOVIE_H
|
||||
#define JOVIE_H
|
||||
|
||||
// Qt includes
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QByteArray>
|
||||
|
||||
#include <kspeech.h>
|
||||
|
||||
class JoviePrivate;
|
||||
class TalkerCode;
|
||||
|
||||
/**
|
||||
* Jovie -- the KDE Text-to-Speech API.
|
||||
*
|
||||
* Note: Applications do not use this class directly.
|
||||
*/
|
||||
class Jovie : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* singleton accessor
|
||||
*/
|
||||
static Jovie * Instance();
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~Jovie();
|
||||
|
||||
public: // PROPERTIES
|
||||
Q_PROPERTY(bool isSpeaking READ isSpeaking)
|
||||
Q_PROPERTY(QString version READ version)
|
||||
|
||||
public Q_SLOTS: // METHODS
|
||||
/**
|
||||
* Returns true if KTTSD is currently speaking.
|
||||
* @return True if currently speaking.
|
||||
*/
|
||||
bool isSpeaking() const;
|
||||
|
||||
/**
|
||||
* Returns the version number of KTTSD.
|
||||
* @return Version number string.
|
||||
*/
|
||||
QString version() const;
|
||||
|
||||
/**
|
||||
* Returns the friendly display name for the application.
|
||||
* @return Application display name.
|
||||
*
|
||||
* If application has not provided a friendly name, the DBUS connection name is returned.
|
||||
*/
|
||||
QString applicationName();
|
||||
|
||||
/**
|
||||
* Sets a friendly display name for the application.
|
||||
* @param applicationName Friendly name for the application.
|
||||
*/
|
||||
void setApplicationName(const QString &applicationName);
|
||||
|
||||
/**
|
||||
* Returns the default talker for the application.
|
||||
* @return Talker.
|
||||
*
|
||||
* The default is "", which uses the default talker configured by user.
|
||||
*/
|
||||
QString defaultTalker();
|
||||
|
||||
/**
|
||||
* Sets the default talker for the application.
|
||||
* @param defaultTalker Default talker. Example: "en".
|
||||
*/
|
||||
void setDefaultTalker(const QString &defaultTalker);
|
||||
|
||||
/**
|
||||
* Sets the current talker for all applications.
|
||||
* @param talker TalkerCode representing wanted options
|
||||
*/
|
||||
void setCurrentTalker(const TalkerCode &talker);
|
||||
|
||||
/**
|
||||
* Returns the default priority for speech jobs submitted by the application.
|
||||
* @return Default job priority.
|
||||
*
|
||||
* @see JobPriority
|
||||
*/
|
||||
int defaultPriority();
|
||||
|
||||
/**
|
||||
* Sets the default priority for speech jobs submitted by the application.
|
||||
* @param defaultPriority Default job priority.
|
||||
*
|
||||
* @see JobPriority
|
||||
*/
|
||||
void setDefaultPriority(int defaultPriority);
|
||||
|
||||
/**
|
||||
* Returns the regular expression used to perform Sentence Boundary
|
||||
* Detection (SBD) for the application.
|
||||
* @return Sentence delimiter regular expression.
|
||||
*
|
||||
* The default sentence delimiter is
|
||||
@verbatim
|
||||
([\\.\\?\\!\\:\\;])(\\s|$|(\\n *\\n))
|
||||
@endverbatim
|
||||
*
|
||||
* Note that backward slashes must be escaped.
|
||||
*
|
||||
* @see sentenceparsing
|
||||
*/
|
||||
QString sentenceDelimiter();
|
||||
|
||||
/**
|
||||
* Sets the regular expression used to perform Sentence Boundary
|
||||
* Detection (SBD) for the application.
|
||||
* @param sentenceDelimiter Sentence delimiter regular expression.
|
||||
*/
|
||||
void setSentenceDelimiter(const QString &sentenceDelimiter);
|
||||
|
||||
/**
|
||||
* Returns whether speech jobs for this application are filtered using configured
|
||||
* filter plugins.
|
||||
* @return True if filtering is on.
|
||||
*
|
||||
* Filtering is on by default.
|
||||
*/
|
||||
bool filteringOn();
|
||||
|
||||
/**
|
||||
* Sets whether speech jobs for this application are filtered using configured
|
||||
* filter plugins.
|
||||
* @param filteringOn True to set filtering on.
|
||||
*/
|
||||
void setFilteringOn(bool filteringOn);
|
||||
|
||||
/**
|
||||
* Returns whether KTTSD will automatically attempt to configure new
|
||||
* talkers to meet required talker attributes.
|
||||
* @return True if KTTSD will autoconfigure talkers.
|
||||
*
|
||||
* @see defaultTalker
|
||||
*/
|
||||
bool autoConfigureTalkersOn();
|
||||
|
||||
/** Sets whether KTTSD will automatically attempt to configure new
|
||||
* talkers to meet required talker attributes.
|
||||
* @param autoConfigureTalkersOn True to enable auto configuration.
|
||||
*/
|
||||
void setAutoConfigureTalkersOn(bool autoConfigureTalkersOn);
|
||||
|
||||
/**
|
||||
* Returns whether application is paused.
|
||||
* @return True if application is paused.
|
||||
*/
|
||||
bool isApplicationPaused();
|
||||
|
||||
/**
|
||||
* Returns the full path name to XSLT file used to convert HTML
|
||||
* markup to speakable form.
|
||||
* @return XSLT filename.
|
||||
*/
|
||||
QString htmlFilterXsltFile();
|
||||
|
||||
/**
|
||||
* Sets the full path name to an XSLT file used to convert HTML
|
||||
* markup to speakable form.
|
||||
* @param htmlFilterXsltFile XSLT filename.
|
||||
*/
|
||||
void setHtmlFilterXsltFile(const QString &htmlFilterXsltFile);
|
||||
|
||||
/**
|
||||
* Returns the full path name to XSLT file used to convert SSML
|
||||
* markup to a speakable form.
|
||||
* @return XSLT filename.
|
||||
*/
|
||||
QString ssmlFilterXsltFile();
|
||||
|
||||
/**
|
||||
* Sets the full path name to XSLT file used to convert SSML
|
||||
* markup to a speakable form.
|
||||
* @param ssmlFilterXsltFile XSLT filename.
|
||||
*/
|
||||
void setSsmlFilterXsltFile(const QString &ssmlFilterXsltFile);
|
||||
|
||||
/**
|
||||
* Returns whether this is a System Manager application.
|
||||
* @return True if the application is a System Manager.
|
||||
*/
|
||||
bool isSystemManager();
|
||||
|
||||
/**
|
||||
* Sets whether this is a System Manager application.
|
||||
* @param isSystemManager True if this is a System Manager.
|
||||
*
|
||||
* System Managers are used to control and configure overall TTS output.
|
||||
* When True, many of the Jovie methods alter their behavior.
|
||||
*/
|
||||
void setIsSystemManager(bool isSystemManager);
|
||||
|
||||
/**
|
||||
* Creates and starts a speech job. The job is created at the application's
|
||||
* default job priority using the default talker.
|
||||
* @param text The text to be spoken.
|
||||
* @param options Speech options.
|
||||
* @return Job Number for the new job.
|
||||
*
|
||||
* @see JobPriority
|
||||
* @see SayOptions
|
||||
*/
|
||||
int say(const QString &text, int options);
|
||||
|
||||
/**
|
||||
* Creates and starts a speech job from a specified file.
|
||||
* @param filename Full path name of the file.
|
||||
* @param encoding The encoding of the file. Default UTF-8.
|
||||
* @return Job Number for the new job.
|
||||
*
|
||||
* The job is spoken using application's default talker.
|
||||
* @see defaultTalker
|
||||
*
|
||||
* Plain text is parsed into individual sentences using the current sentence delimiter.
|
||||
* Call @ref setSentenceDelimiter to change the sentence delimiter prior to calling sayFile.
|
||||
* Call @ref getSentenceCount to retrieve the sentence count after calling sayFile.
|
||||
*
|
||||
* The text may contain speech mark language, such as SMML,
|
||||
* provided that the speech plugin/engine support it. In this case,
|
||||
* sentence parsing follows the semantics of the markup language.
|
||||
*/
|
||||
int sayFile(const QString &filename, const QString &encoding);
|
||||
|
||||
/**
|
||||
* Submits a speech job from the contents of the clipboard.
|
||||
* The job is spoken using application's default talker.
|
||||
* @return Job Number for the new job.
|
||||
*
|
||||
* @see defaultTalker
|
||||
*/
|
||||
int sayClipboard();
|
||||
|
||||
/**
|
||||
* Pauses speech jobs belonging to the application.
|
||||
* When called by a System Manager, pauses all jobs of all applications.
|
||||
*/
|
||||
void pause();
|
||||
|
||||
/**
|
||||
* Resumes speech jobs belonging to the application.
|
||||
* When called by a System Manager, resumes all jobs of all applications.
|
||||
*/
|
||||
void resume();
|
||||
|
||||
|
||||
void stop();
|
||||
void cancel();
|
||||
|
||||
QStringList outputModules();
|
||||
QStringList languagesByModule(const QString & module);
|
||||
|
||||
/**
|
||||
* Get all possible talkers supported by speech-dispatcher configuration
|
||||
*
|
||||
* @returns QStringList of talkercodes
|
||||
*/
|
||||
QStringList getPossibleTalkers();
|
||||
|
||||
// runtime slots to change the current speech configuration
|
||||
void setSpeed(int speed);
|
||||
int speed();
|
||||
void setPitch(int pitch);
|
||||
int pitch();
|
||||
void setVolume(int volume);
|
||||
int volume();
|
||||
|
||||
void setOutputModule(const QString & module);
|
||||
void setLanguage(const QString & language);
|
||||
void setVoiceType(int voiceType);
|
||||
int voiceType();
|
||||
|
||||
void setPunctuationType(int punctuation);
|
||||
|
||||
/**
|
||||
* Removes the specified job. If the job is speaking, it is stopped.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
*/
|
||||
void removeJob(int jobNum);
|
||||
|
||||
/**
|
||||
* Removes all jobs belonging to the application.
|
||||
* When called from a System Manager, removes all jobs of all applications.
|
||||
*/
|
||||
void removeAllJobs();
|
||||
|
||||
/**
|
||||
* Returns the number of sentences in a job.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
* @return Number of sentences in the job.
|
||||
*/
|
||||
int getSentenceCount(int jobNum);
|
||||
|
||||
/**
|
||||
* Returns the job number of the currently speaking job (any application).
|
||||
* @return Job Number
|
||||
*/
|
||||
int getCurrentJob();
|
||||
|
||||
/**
|
||||
* Returns the number of jobs belonging to the application
|
||||
* with the specified job priority.
|
||||
* @param priority Job Priority.
|
||||
* @return Number of jobs.
|
||||
*
|
||||
* If priority is KSpeech::jpAll, returns the number of jobs belonging
|
||||
* to the application (all priorities).
|
||||
*
|
||||
* When called from a System Manager, returns count of all jobs of the
|
||||
* specified priority for all applications.
|
||||
*
|
||||
* @see JobPriority
|
||||
*/
|
||||
int getJobCount(int priority);
|
||||
|
||||
/**
|
||||
* Returns a list job numbers for the jobs belonging to the
|
||||
* application with the specified priority.
|
||||
* @param priority Job Priority.
|
||||
* @return List of job numbers. Note that the numbers
|
||||
* are strings.
|
||||
*
|
||||
* If priority is KSpeech::jpAll, returns the job numbers belonging
|
||||
* to the application (all priorities).
|
||||
*
|
||||
* When called from a System Manager, returns job numbers of the
|
||||
* specified priority for all applications.
|
||||
*
|
||||
* @see JobPriority
|
||||
*/
|
||||
QStringList getJobNumbers(int priority);
|
||||
|
||||
/**
|
||||
* Returns the state of a job.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
* @return Job state.
|
||||
*
|
||||
* @see JobState
|
||||
*/
|
||||
int getJobState(int jobNum);
|
||||
|
||||
/**
|
||||
* Get information about a job.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
* @return A QDataStream containing information about the job.
|
||||
* Blank if no such job.
|
||||
*
|
||||
* The stream contains the following elements:
|
||||
* - int priority Job Type.
|
||||
* - int state Job state.
|
||||
* - QString appId DBUS senderId of the application that requested the speech job.
|
||||
* - QString talker Talker code as requested by application.
|
||||
* - int sentenceNum Current sentence being spoken. Sentences are numbered starting at 1.
|
||||
* - int sentenceCount Total number of sentences in the job.
|
||||
* - QString applicationName Application's friendly name (if provided by app)
|
||||
*
|
||||
* If the job is currently filtering, waits for that to finish before returning.
|
||||
*
|
||||
* The following sample code will decode the stream:
|
||||
@verbatim
|
||||
QByteArray jobInfo = m_kspeech->getJobInfo(jobNum);
|
||||
if (jobInfo != QByteArray()) {
|
||||
QDataStream stream(&jobInfo, QIODevice::ReadOnly);
|
||||
qint32 priority;
|
||||
qint32 state;
|
||||
QString talker;
|
||||
qint32 sentenceNum;
|
||||
qint32 sentenceCount;
|
||||
QString applicationName;
|
||||
stream >> priority;
|
||||
stream >> state;
|
||||
stream >> appId;
|
||||
stream >> talker;
|
||||
stream >> sentenceNum;
|
||||
stream >> sentenceCount;
|
||||
stream >> applicationName;
|
||||
};
|
||||
@endverbatim
|
||||
*/
|
||||
QByteArray getJobInfo(int jobNum);
|
||||
|
||||
/**
|
||||
* Return a sentence of a job.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
* @param sentenceNum Sentence Number. Sentence numbers start at 1.
|
||||
* @return The specified sentence in the specified job. If no such
|
||||
* job or sentence, returns "".
|
||||
*/
|
||||
QString getJobSentence(int jobNum, int sentenceNum);
|
||||
|
||||
/**
|
||||
* Return a list of full Talker Codes for configured talkers.
|
||||
* @return List of Talker codes.
|
||||
*/
|
||||
QStringList getTalkerCodes();
|
||||
|
||||
/**
|
||||
* Given a talker, returns the Talker ID for the talker.
|
||||
* that will speak the job.
|
||||
* @param talker Talker. Example: "en".
|
||||
* @return Talker ID. A Talker ID is an internally-assigned
|
||||
* identifier for a talker.
|
||||
*
|
||||
* This method is normally used only by System Managers.
|
||||
*/
|
||||
QString talkerToTalkerId(const QString &talker);
|
||||
|
||||
/**
|
||||
* Returns a bitarray giving the capabilities of a talker.
|
||||
* @param talker Talker. Example: "en".
|
||||
* @return A word with bits set according to the capabilities
|
||||
* of the talker.
|
||||
*
|
||||
* @see TalkerCapabilities1
|
||||
* @see getTalkerCapabilities2
|
||||
*/
|
||||
int getTalkerCapabilities1(const QString &talker);
|
||||
|
||||
/**
|
||||
* Returns a bitarray giving the capabilities of a talker.
|
||||
* @param talker Talker. Example: "en".
|
||||
* @return A word with bits set according to the capabilities
|
||||
* of the talker.
|
||||
*
|
||||
* @see TalkerCapabilities2
|
||||
* @see getTalkerCapabilities1
|
||||
*/
|
||||
int getTalkerCapabilities2(const QString &talker);
|
||||
|
||||
/**
|
||||
* Return a list of the voice codes of voices available in the synthesizer
|
||||
* corresponding to a talker.
|
||||
* @param talker Talker. Example: "synthesizer='Festival'"
|
||||
* @return List of voice codes.
|
||||
*
|
||||
* Voice codes are synthesizer specific.
|
||||
*/
|
||||
QStringList getTalkerVoices(const QString &talker);
|
||||
|
||||
/**
|
||||
* Change the talker of an already-submitted job.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
* @param talker Desired new talker.
|
||||
*/
|
||||
void changeJobTalker(int jobNum, const QString &talker);
|
||||
|
||||
/**
|
||||
* Move a job one position down in the queue so that it is spoken later.
|
||||
* If the job is already speaking, it is stopped and will resume
|
||||
* when processing next gets to it.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
*
|
||||
* Since there is only one ScreenReaderOutput, this method is meaningless
|
||||
* for ScreenReaderOutput jobs.
|
||||
*/
|
||||
void moveJobLater(int jobNum);
|
||||
|
||||
/**
|
||||
* Advance or rewind N sentences in a job.
|
||||
* @param jobNum Job Number. If 0, the last job submitted by
|
||||
* the application.
|
||||
* @param n Number of sentences to advance (positive) or rewind (negative)
|
||||
* in the job.
|
||||
* @return Number of the sentence actually moved to. Sentence numbers
|
||||
* are numbered starting at 1.
|
||||
*
|
||||
* If no such job, does nothing and returns 0.
|
||||
* If n is zero, returns the current sentence number of the job.
|
||||
* Does not affect the current speaking/not-speaking state of the job.
|
||||
*
|
||||
* Since ScreenReaderOutput jobs are not split into sentences, this method
|
||||
* is meaningless for ScreenReaderOutput jobs.
|
||||
*/
|
||||
int moveRelSentence(int jobNum, int n);
|
||||
|
||||
/**
|
||||
* Display the KttsMgr program so that user can configure KTTS options.
|
||||
* Only one instance of KttsMgr is displayed.
|
||||
*/
|
||||
void showManagerDialog();
|
||||
|
||||
/**
|
||||
* Shuts down KTTSD. Do not call this!
|
||||
*/
|
||||
void kttsdExit();
|
||||
|
||||
/**
|
||||
* post ctor helper method that instantiates the dbus adaptor class, and registers
|
||||
*/
|
||||
void init();
|
||||
|
||||
/**
|
||||
* Cause KTTSD to re-read its configuration.
|
||||
*/
|
||||
void reinit();
|
||||
|
||||
/** Called by DBusAdaptor so that KTTSD knows the application that
|
||||
* called it.
|
||||
* @param appId DBUS connection name that called KSpeech.
|
||||
*/
|
||||
void setCallingAppId(const QString& appId);
|
||||
|
||||
Q_SIGNALS: // SIGNALS
|
||||
/**
|
||||
* This signal is emitted when KTTSD starts.
|
||||
*/
|
||||
void kttsdStarted();
|
||||
|
||||
/**
|
||||
* This signal is emitted just before KTTS exits.
|
||||
*/
|
||||
void kttsdExiting();
|
||||
|
||||
/**
|
||||
* This signal is emitted each time the state of a job changes.
|
||||
* @param appId The DBUS connection name of the application that
|
||||
* submitted the job.
|
||||
* @param jobNum Job Number.
|
||||
* @param state Job state.
|
||||
*/
|
||||
void jobStateChanged(const QString &appId, int jobNum, int state);
|
||||
|
||||
/**
|
||||
* This signal is emitted when a marker is processed.
|
||||
* Currently only emits mtSentenceBegin and mtSentenceEnd.
|
||||
* @param appId The DBUS connection name of the application that submitted the job.
|
||||
* @param jobNum Job Number of the job emitting the marker.
|
||||
* @param markerType The type of marker.
|
||||
* Currently either mtSentenceBegin or mtSentenceEnd.
|
||||
* @param markerData Data for the marker.
|
||||
* Currently, this is the sentence number of the sentence
|
||||
* begun or ended. Sentence numbers begin at 1.
|
||||
*/
|
||||
void marker(const QString &appId, int jobNum, int markerType, const QString &markerData);
|
||||
|
||||
private slots:
|
||||
void slotJobStateChanged(const QString& appId, int jobNum, KSpeech::JobState state);
|
||||
void slotMarker(const QString& appId, int jobNum, KSpeech::MarkerType markerType, const QString& markerData);
|
||||
void slotFilteringFinished();
|
||||
|
||||
private:
|
||||
/**
|
||||
* The DBUS connection name of the last application that called KTTSD.
|
||||
*/
|
||||
QString callingAppId();
|
||||
|
||||
/*
|
||||
* Checks if KTTSD is ready to speak and at least one talker is configured.
|
||||
* If not, user is prompted to display the configuration dialog.
|
||||
*/
|
||||
bool ready();
|
||||
|
||||
/**
|
||||
* Create and initialize the Configuration Data object.
|
||||
*/
|
||||
bool initializeConfigData();
|
||||
|
||||
/*
|
||||
* Create and initialize the TalkerMgr object.
|
||||
*/
|
||||
bool initializeTalkerMgr();
|
||||
|
||||
/*
|
||||
* Create and initialize the speaker.
|
||||
*/
|
||||
bool initializeSpeaker();
|
||||
|
||||
/*
|
||||
* If a job number is 0, returns the default job number for a command.
|
||||
* Returns the job number of the last job queued by the application, or if
|
||||
* no such job, the current job number.
|
||||
* @param jobNum The job number passed in the DBUS message. May be 0.
|
||||
* @return Default job number. 0 if no such job.
|
||||
*/
|
||||
int applyDefaultJobNum(int jobNum);
|
||||
|
||||
/*
|
||||
* Announces an event to kDebug.
|
||||
*/
|
||||
void announceEvent(const QString& slotName, const QString& eventName);
|
||||
void announceEvent(const QString& slotName, const QString& eventName, const QString& appId,
|
||||
int jobNum, KSpeech::MarkerType markerType, const QString& markerData);
|
||||
void announceEvent(const QString& slotName, const QString& eventName, const QString& appId,
|
||||
int jobNum, KSpeech::JobState state);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Constructor.
|
||||
* Note: Applications do not create instances of Jovie.
|
||||
* Instead create KSpeechInterface object. See @ref programming.
|
||||
*/
|
||||
Jovie(QObject *parent=0);
|
||||
|
||||
JoviePrivate *d;
|
||||
static Jovie *m_instance;
|
||||
|
||||
};
|
||||
|
||||
#endif // JOVIE_H
|
|
@ -1,104 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=jovie --icon '%i' --caption '%c'
|
||||
Icon=preferences-desktop-text-to-speech
|
||||
ServiceTypes=DBUS/Text-to-Speech
|
||||
X-DBUS-StartupType=Unique
|
||||
X-KDE-StartupNotify=false
|
||||
Name=Jovie
|
||||
Name[bg]=Jovie
|
||||
Name[bs]=Jovie
|
||||
Name[ca]=Jovie
|
||||
Name[ca@valencia]=Jovie
|
||||
Name[cs]=Jovie
|
||||
Name[da]=Jovie
|
||||
Name[de]=Jovie
|
||||
Name[el]=Jovie
|
||||
Name[en_GB]=Jovie
|
||||
Name[es]=Jovie
|
||||
Name[et]=Jovie
|
||||
Name[eu]=Jovie
|
||||
Name[fi]=Jovie
|
||||
Name[fr]=Jovie
|
||||
Name[ga]=Jovie
|
||||
Name[gl]=Jovie
|
||||
Name[hr]=Jovie
|
||||
Name[hu]=Jovie
|
||||
Name[is]=Jovie
|
||||
Name[it]=Jovie
|
||||
Name[ja]=Jovie
|
||||
Name[kk]=Jovie
|
||||
Name[ko]=Jovie
|
||||
Name[lt]=Jovie
|
||||
Name[lv]=Jovie
|
||||
Name[mr]=जोव्ही
|
||||
Name[nb]=Jovie
|
||||
Name[nds]=Jovie
|
||||
Name[nl]=Jovie
|
||||
Name[nn]=Jovie
|
||||
Name[pl]=Jovie
|
||||
Name[pt]=Jovie
|
||||
Name[pt_BR]=Jovie
|
||||
Name[ru]=Jovie
|
||||
Name[sk]=Jovie
|
||||
Name[sl]=Jovie
|
||||
Name[sr]=Џови
|
||||
Name[sr@ijekavian]=Џови
|
||||
Name[sr@ijekavianlatin]=Džovi
|
||||
Name[sr@latin]=Džovi
|
||||
Name[sv]=Jovie
|
||||
Name[tr]=Jovie
|
||||
Name[ug]=Jovie
|
||||
Name[uk]=Jovie
|
||||
Name[x-test]=xxJoviexx
|
||||
Name[zh_CN]=Jovie
|
||||
Name[zh_TW]=Jovie
|
||||
Comment=KDE Text To Speech Service
|
||||
Comment[bg]=Услуга на KDE за екранен четец
|
||||
Comment[bs]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[ca]=Servei de text a veu del KDE
|
||||
Comment[ca@valencia]=Servei de text a veu del KDE
|
||||
Comment[cs]=Služba hlasové syntézy KDE
|
||||
Comment[da]=KDE tekst til tale-tjeneste
|
||||
Comment[de]=KDE Sprachausgabedienst
|
||||
Comment[el]=KDE υπηρεσία από κείμενο-σε-ομιλία
|
||||
Comment[en_GB]=KDE Text To Speech Service
|
||||
Comment[es]=Servicio de KDE para la síntesis de texto a voz
|
||||
Comment[et]=KDE teksti ettelugemise deemon
|
||||
Comment[eu]=KDEren testutik hizketarako zerbitzua
|
||||
Comment[fi]=KDE:n puhesyntetisaattoripalvelu
|
||||
Comment[fr]=Service de synthèse vocale pour KDE
|
||||
Comment[ga]=Seirbhís Téacs-Go-Caint KDE
|
||||
Comment[gl]=Servizo de texto-para-voz de KDE.
|
||||
Comment[hr]=KDE-ov servis za pretvorbu teksta u govor
|
||||
Comment[hu]=KDE szövegfelolvasó szolgáltatás
|
||||
Comment[is]=KDE texti-í-tal þjónusta
|
||||
Comment[it]=Servizio di pronuncia di KDE
|
||||
Comment[ja]=KDE テキスト読み上げサービス
|
||||
Comment[kk]=KDE-нің мәтінді дауыстап оқу қызметі
|
||||
Comment[ko]=KDE 텍스트 읽어주기 서비스
|
||||
Comment[lt]=KDE teksto keitimo į kalbą paslauga
|
||||
Comment[lv]=KDE teksta izrunāšanas serviss
|
||||
Comment[mr]=केडीई पाठ्य ते भाष्य सेवा
|
||||
Comment[nb]=KDE tekst-til-tale-tjeneste
|
||||
Comment[nds]=Vörlees-Deenst vun KDE
|
||||
Comment[nl]=KDE tekst-naar-spraak-service
|
||||
Comment[nn]=Tekst-til-tale-teneste for KDE
|
||||
Comment[pl]=Usługa tekstu-na-mowę dla KDE
|
||||
Comment[pt]=Serviço de Texto-para-Fala do KDE
|
||||
Comment[pt_BR]=Serviço de sintetizador de voz do KDE
|
||||
Comment[ru]=Служба синтеза речи в KDE
|
||||
Comment[sk]=KDE služba Text na reč
|
||||
Comment[sl]=Storitev besedilo-v-govor za KDE
|
||||
Comment[sr]=КДЕ‑ов сервис за текст‑у‑говор
|
||||
Comment[sr@ijekavian]=КДЕ‑ов сервис за текст‑у‑говор
|
||||
Comment[sr@ijekavianlatin]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[sr@latin]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[sv]=KDE:s text-till-tal tjänst
|
||||
Comment[tr]=KDE Metin Okuma (Text To Speech) Hizmeti
|
||||
Comment[ug]=KDE تېكىستتىن ئاۋازغا مۇلازىمىتى
|
||||
Comment[uk]=Служба KDE синтезу мовлення з тексту
|
||||
Comment[x-test]=xxKDE Text To Speech Servicexx
|
||||
Comment[zh_CN]=KDE 文本到语音服务
|
||||
Comment[zh_TW]=KDE 文字轉語音服務
|
||||
Categories=Qt;KDE;Utility;Accessibility;
|
|
@ -1,233 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Jovie System Tray Application
|
||||
-------------------------------
|
||||
Copyright 2004-2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
Copyright 2010 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// Jovie includes.
|
||||
#include "jovietrayicon.h"
|
||||
#include "jovie.h"
|
||||
|
||||
// Qt includes.
|
||||
#include <QtGui/QImage>
|
||||
#include <QtGui/QPixmap>
|
||||
#include <QtGui/qevent.h>
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtCore/QProcess>
|
||||
#include <QtCore/QPointer>
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusConnectionInterface>
|
||||
|
||||
// KDE includes.
|
||||
#include <kactioncollection.h>
|
||||
#include <kaboutapplicationdialog.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kaction.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kconfig.h>
|
||||
#include <kdebug.h>
|
||||
#include <kicon.h>
|
||||
#include <klocale.h>
|
||||
#include <kmenu.h>
|
||||
#include <kshortcutsdialog.h>
|
||||
#include <ksystemtrayicon.h>
|
||||
#include <kstandardaction.h>
|
||||
#include <ktoolinvocation.h>
|
||||
#include <kuniqueapplication.h>
|
||||
|
||||
// libkttsd includes.
|
||||
#include <talkercode.h>
|
||||
|
||||
/* ------------------ JovieTrayIcon class ----------------------- */
|
||||
|
||||
JovieTrayIcon::JovieTrayIcon(QWidget *parent)
|
||||
:KStatusNotifierItem(QLatin1String( "jovie" ), parent)
|
||||
{
|
||||
setObjectName( QLatin1String("jovietrayicon" ));
|
||||
setStatus(KStatusNotifierItem::Active);
|
||||
setCategory(ApplicationStatus);
|
||||
|
||||
QString status = QLatin1String( "Jovie - " );
|
||||
status += i18n("KDE Text-to-Speech Manager");
|
||||
setToolTipTitle(status);
|
||||
setToolTipIconByName(QLatin1String( "preferences-desktop-text-to-speech" ));
|
||||
setIconByName(QLatin1String( "preferences-desktop-text-to-speech" ));
|
||||
|
||||
// Set up menu.
|
||||
actStop = actionCollection()->addAction(QLatin1String("stop"), this, SLOT(stopSelected()));
|
||||
actStop->setIcon(KIcon(QLatin1String("media-playback-stop")));
|
||||
actStop->setText(i18n("&Stop/Delete"));
|
||||
actStop->setGlobalShortcut(KShortcut());
|
||||
contextMenu()->addAction(actStop);
|
||||
|
||||
actPause = actionCollection()->addAction(QLatin1String("pause"), this, SLOT(pauseSelected()));
|
||||
actPause->setIcon(KIcon( QLatin1String( "media-playback-pause" )));
|
||||
actPause->setText(i18n("&Pause"));
|
||||
actPause->setGlobalShortcut(KShortcut());
|
||||
contextMenu()->addAction(actPause);
|
||||
|
||||
actResume = actionCollection()->addAction(QLatin1String("resume"), this, SLOT(resumeSelected()));
|
||||
actResume->setIcon(KIcon(QLatin1String( "media-playback-start" )));
|
||||
actResume->setText(i18n("&Resume"));
|
||||
actResume->setGlobalShortcut(KShortcut());
|
||||
contextMenu()->addAction(actResume);
|
||||
|
||||
actRepeat = actionCollection()->addAction(QLatin1String("repeat"), this, SLOT(repeatSelected()));
|
||||
actRepeat->setIcon(KIcon(QLatin1String( "view-refresh" )));
|
||||
actRepeat->setText(i18n("R&epeat"));
|
||||
actRepeat->setGlobalShortcut(KShortcut());
|
||||
contextMenu()->addAction(actRepeat);
|
||||
|
||||
(void)contextMenu()->addSeparator();
|
||||
|
||||
actSpeakClipboard = actionCollection()->addAction(QLatin1String("speakclipboard"),
|
||||
this, SLOT(speakClipboardSelected()));
|
||||
actSpeakClipboard->setIcon(KIcon(QLatin1String( "klipper" )));
|
||||
actSpeakClipboard->setText(i18n("Spea&k Clipboard Contents"));
|
||||
actSpeakClipboard->setGlobalShortcut(KShortcut());
|
||||
contextMenu()->addAction (actSpeakClipboard);
|
||||
|
||||
talkersMenu = new QMenu(i18n("Select Talker"));
|
||||
contextMenu()->addMenu(talkersMenu);
|
||||
|
||||
slotUpdateTalkersMenu();
|
||||
|
||||
actConfigure = KStandardAction::preferences(this, SLOT(configureSelected()), contextMenu());
|
||||
contextMenu()->addAction(actConfigure);
|
||||
|
||||
contextMenu()->addAction(
|
||||
KStandardAction::keyBindings(this, SLOT(configureKeysSelected()), contextMenu()));
|
||||
|
||||
(void)contextMenu()->addSeparator();
|
||||
(void)contextMenu()->addAction(
|
||||
KStandardAction::helpContents(this, SLOT(helpSelected()), contextMenu()));
|
||||
(void)contextMenu()->addAction (
|
||||
KStandardAction::aboutApp(this, SLOT(aboutSelected()), contextMenu()));
|
||||
|
||||
connect(this, SIGNAL(activateRequested(bool,QPoint)),
|
||||
SLOT(slotActivateRequested(bool,QPoint)));
|
||||
connect(contextMenu(), SIGNAL(aboutToShow()),
|
||||
SLOT(contextMenuAboutToShow()));
|
||||
}
|
||||
|
||||
JovieTrayIcon::~JovieTrayIcon()
|
||||
{
|
||||
}
|
||||
|
||||
void JovieTrayIcon::slotUpdateTalkersMenu(){
|
||||
talkersMenu->clear();
|
||||
|
||||
// Object for the KTTSD configuration.
|
||||
KConfig config(QLatin1String( "kttsdrc" ));
|
||||
|
||||
// Load existing Talkers into Talker List.
|
||||
TalkerCode::TalkerCodeList list = TalkerCode::loadTalkerCodesFromConfig(&config);
|
||||
|
||||
for (int i=0;i<list.size();i++) {
|
||||
TalkerCode talkerCode=list.at(i);
|
||||
KAction* act=new KAction(this);
|
||||
act->setText(talkerCode.name());
|
||||
act->setProperty("talkercode",talkerCode.getTalkerCode());
|
||||
connect(act,SIGNAL(triggered()),this,SLOT(talkerSelected()));
|
||||
talkersMenu->addAction(act);
|
||||
}
|
||||
}
|
||||
|
||||
void JovieTrayIcon::slotActivateRequested(bool active, const QPoint &pos)
|
||||
{
|
||||
Q_UNUSED(active)
|
||||
Q_UNUSED(pos)
|
||||
// pause/resume icon/app
|
||||
if (overlayIconName() == QLatin1String("media-playback-pause")) {
|
||||
Jovie::Instance()->resume();
|
||||
setOverlayIconByName(QLatin1String( "" ));
|
||||
}
|
||||
else {
|
||||
Jovie::Instance()->pause();
|
||||
setOverlayIconByName(QLatin1String( "media-playback-pause" ));
|
||||
}
|
||||
}
|
||||
|
||||
void JovieTrayIcon::contextMenuAboutToShow()
|
||||
{
|
||||
const bool configActive = (QDBusConnection::sessionBus().interface()->isServiceRegistered(QLatin1String( "org.kde.kcmshell_kcmkttsd" )));
|
||||
actConfigure->setEnabled(!configActive);
|
||||
}
|
||||
|
||||
void JovieTrayIcon::speakClipboardSelected()
|
||||
{
|
||||
Jovie::Instance()->sayClipboard();
|
||||
}
|
||||
|
||||
void JovieTrayIcon::talkerSelected()
|
||||
{
|
||||
KAction* act=(KAction*)QObject::sender ();
|
||||
TalkerCode talkerCode;
|
||||
talkerCode.setTalkerCode(act->property("talkercode").toString());
|
||||
Jovie::Instance()->setCurrentTalker(talkerCode);
|
||||
}
|
||||
|
||||
void JovieTrayIcon::aboutSelected()
|
||||
{
|
||||
QPointer<KAboutApplicationDialog> aboutDlg =
|
||||
new KAboutApplicationDialog(KGlobal::mainComponent().aboutData());
|
||||
aboutDlg->exec();
|
||||
delete aboutDlg;
|
||||
}
|
||||
|
||||
void JovieTrayIcon::helpSelected()
|
||||
{
|
||||
KToolInvocation::invokeHelp(QString(),QLatin1String( "jovie" ));
|
||||
}
|
||||
|
||||
void JovieTrayIcon::stopSelected()
|
||||
{
|
||||
Jovie::Instance()->stop();
|
||||
}
|
||||
|
||||
void JovieTrayIcon::pauseSelected()
|
||||
{
|
||||
Jovie::Instance()->pause();
|
||||
}
|
||||
|
||||
void JovieTrayIcon::resumeSelected()
|
||||
{
|
||||
Jovie::Instance()->resume();
|
||||
}
|
||||
|
||||
void JovieTrayIcon::repeatSelected()
|
||||
{
|
||||
//int jobNum = m_kspeech->getCurrentJob();
|
||||
//int seq = m_kspeech->moveRelSentence(jobNum, 0);
|
||||
//m_kspeech->moveRelSentence(jobNum, -seq);
|
||||
}
|
||||
|
||||
void JovieTrayIcon::configureSelected()
|
||||
{
|
||||
QStringList lst;
|
||||
lst << QLatin1String( "kcmkttsd" ) << QLatin1String( "--caption" ) << i18n("KDE Text-to-Speech");
|
||||
QProcess::startDetached(QLatin1String( "kcmshell4" ),lst);
|
||||
}
|
||||
|
||||
void JovieTrayIcon::configureKeysSelected()
|
||||
{
|
||||
KShortcutsDialog::configure( actionCollection() );
|
||||
}
|
||||
|
||||
#include "moc_jovietrayicon.cpp"
|
|
@ -1,78 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
JovieTrayIcon tray icon for jovie text to speech service
|
||||
-------------------------------
|
||||
Copyright 2004-2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
Copyright 2010 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
Current Maintainer: Jeremy Whiting <jpwhiting@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 _JOVIETRAYICON_H
|
||||
#define _JOVIETRAYICON_H
|
||||
|
||||
// KDE includes.
|
||||
#include <kmenu.h>
|
||||
#include <kstatusnotifieritem.h>
|
||||
#include "talkercode.h"
|
||||
#include <QEvent>
|
||||
class KAction;
|
||||
|
||||
/**
|
||||
* @class JovieTrayIcon
|
||||
*
|
||||
* Tray Icon object for Jovie application.
|
||||
*/
|
||||
class JovieTrayIcon: public KStatusNotifierItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit JovieTrayIcon(QWidget *parent=0);
|
||||
~JovieTrayIcon();
|
||||
|
||||
protected Q_SLOTS:
|
||||
void slotActivateRequested(bool active, const QPoint &pos);
|
||||
virtual void contextMenuAboutToShow();
|
||||
void slotUpdateTalkersMenu();
|
||||
|
||||
private slots:
|
||||
|
||||
void speakClipboardSelected();
|
||||
void stopSelected();
|
||||
void pauseSelected();
|
||||
void resumeSelected();
|
||||
void repeatSelected();
|
||||
void configureSelected();
|
||||
void configureKeysSelected();
|
||||
void aboutSelected();
|
||||
void helpSelected();
|
||||
void talkerSelected();
|
||||
private:
|
||||
void setupIcons();
|
||||
KAction* actStop;
|
||||
KAction* actPause;
|
||||
KAction* actResume;
|
||||
KAction* actRepeat;
|
||||
KAction* actSpeakClipboard;
|
||||
KAction* actConfigure;
|
||||
QMenu* talkersMenu;
|
||||
friend class Jovie;
|
||||
};
|
||||
|
||||
#endif // _JOVIETRAYICON_H
|
|
@ -1,104 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Service
|
||||
Exec=jovie
|
||||
Icon=preferences-desktop-text-to-speech
|
||||
ServiceTypes=DBUS/Text-to-Speech
|
||||
X-DBUS-StartupType=Unique
|
||||
X-KDE-StartupNotify=false
|
||||
Name=Jovie
|
||||
Name[bg]=Jovie
|
||||
Name[bs]=Jovie
|
||||
Name[ca]=Jovie
|
||||
Name[ca@valencia]=Jovie
|
||||
Name[cs]=Jovie
|
||||
Name[da]=Jovie
|
||||
Name[de]=Jovie
|
||||
Name[el]=Jovie
|
||||
Name[en_GB]=Jovie
|
||||
Name[es]=Jovie
|
||||
Name[et]=Jovie
|
||||
Name[eu]=Jovie
|
||||
Name[fi]=Jovie
|
||||
Name[fr]=Jovie
|
||||
Name[ga]=Jovie
|
||||
Name[gl]=Jovie
|
||||
Name[hr]=Jovie
|
||||
Name[hu]=Jovie
|
||||
Name[is]=Jovie
|
||||
Name[it]=Jovie
|
||||
Name[ja]=Jovie
|
||||
Name[kk]=Jovie
|
||||
Name[ko]=Jovie
|
||||
Name[lt]=Jovie
|
||||
Name[lv]=Jovie
|
||||
Name[mr]=जोव्ही
|
||||
Name[nb]=Jovie
|
||||
Name[nds]=Jovie
|
||||
Name[nl]=Jovie
|
||||
Name[nn]=Jovie
|
||||
Name[pl]=Jovie
|
||||
Name[pt]=Jovie
|
||||
Name[pt_BR]=Jovie
|
||||
Name[ru]=Jovie
|
||||
Name[sk]=Jovie
|
||||
Name[sl]=Jovie
|
||||
Name[sr]=Џови
|
||||
Name[sr@ijekavian]=Џови
|
||||
Name[sr@ijekavianlatin]=Džovi
|
||||
Name[sr@latin]=Džovi
|
||||
Name[sv]=Jovie
|
||||
Name[tr]=Jovie
|
||||
Name[ug]=Jovie
|
||||
Name[uk]=Jovie
|
||||
Name[x-test]=xxJoviexx
|
||||
Name[zh_CN]=Jovie
|
||||
Name[zh_TW]=Jovie
|
||||
Comment=KDE Text To Speech Service
|
||||
Comment[bg]=Услуга на KDE за екранен четец
|
||||
Comment[bs]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[ca]=Servei de text a veu del KDE
|
||||
Comment[ca@valencia]=Servei de text a veu del KDE
|
||||
Comment[cs]=Služba hlasové syntézy KDE
|
||||
Comment[da]=KDE tekst til tale-tjeneste
|
||||
Comment[de]=KDE Sprachausgabedienst
|
||||
Comment[el]=KDE υπηρεσία από κείμενο-σε-ομιλία
|
||||
Comment[en_GB]=KDE Text To Speech Service
|
||||
Comment[es]=Servicio de KDE para la síntesis de texto a voz
|
||||
Comment[et]=KDE teksti ettelugemise deemon
|
||||
Comment[eu]=KDEren testutik hizketarako zerbitzua
|
||||
Comment[fi]=KDE:n puhesyntetisaattoripalvelu
|
||||
Comment[fr]=Service de synthèse vocale pour KDE
|
||||
Comment[ga]=Seirbhís Téacs-Go-Caint KDE
|
||||
Comment[gl]=Servizo de texto-para-voz de KDE.
|
||||
Comment[hr]=KDE-ov servis za pretvorbu teksta u govor
|
||||
Comment[hu]=KDE szövegfelolvasó szolgáltatás
|
||||
Comment[is]=KDE texti-í-tal þjónusta
|
||||
Comment[it]=Servizio di pronuncia di KDE
|
||||
Comment[ja]=KDE テキスト読み上げサービス
|
||||
Comment[kk]=KDE-нің мәтінді дауыстап оқу қызметі
|
||||
Comment[ko]=KDE 텍스트 읽어주기 서비스
|
||||
Comment[lt]=KDE teksto keitimo į kalbą paslauga
|
||||
Comment[lv]=KDE teksta izrunāšanas serviss
|
||||
Comment[mr]=केडीई पाठ्य ते भाष्य सेवा
|
||||
Comment[nb]=KDE tekst-til-tale-tjeneste
|
||||
Comment[nds]=Vörlees-Deenst vun KDE
|
||||
Comment[nl]=KDE tekst-naar-spraak-service
|
||||
Comment[nn]=Tekst-til-tale-teneste for KDE
|
||||
Comment[pl]=Usługa tekstu-na-mowę dla KDE
|
||||
Comment[pt]=Serviço de Texto-para-Fala do KDE
|
||||
Comment[pt_BR]=Serviço de sintetizador de voz do KDE
|
||||
Comment[ru]=Служба синтеза речи в KDE
|
||||
Comment[sk]=KDE služba Text na reč
|
||||
Comment[sl]=Storitev besedilo-v-govor za KDE
|
||||
Comment[sr]=КДЕ‑ов сервис за текст‑у‑говор
|
||||
Comment[sr@ijekavian]=КДЕ‑ов сервис за текст‑у‑говор
|
||||
Comment[sr@ijekavianlatin]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[sr@latin]=KDE‑ov servis za tekst‑u‑govor
|
||||
Comment[sv]=KDE:s text-till-tal tjänst
|
||||
Comment[tr]=KDE Metin Okuma (Text To Speech) Hizmeti
|
||||
Comment[ug]=KDE تېكىستتىن ئاۋازغا مۇلازىمىتى
|
||||
Comment[uk]=Служба KDE синтезу мовлення з тексту
|
||||
Comment[x-test]=xxKDE Text To Speech Servicexx
|
||||
Comment[zh_CN]=KDE 文本到语音服务
|
||||
Comment[zh_TW]=KDE 文字轉語音服務
|
||||
Categories=Qt;KDE;Utility;Accessibility;
|
|
@ -1,89 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Jovie
|
||||
|
||||
The KDE Text-to-Speech Daemon.
|
||||
-----------------------------
|
||||
Copyright 2002-2003 by José Pablo Ezequiel "Pupeno" Fernández <pupeno@kde.org>
|
||||
Copyright 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
Copyright 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// KDE Includes.
|
||||
#include <kuniqueapplication.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kcrash.h>
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
|
||||
#include <QtDBus/QtDBus>
|
||||
|
||||
// KTTSD includes.
|
||||
#include "jovie.h"
|
||||
|
||||
int main (int argc, char *argv[]){
|
||||
KAboutData aboutdata("jovie", 0, ki18n("Jovie"),
|
||||
"0.6.0", ki18n("Text-to-speech synthesis daemon"),
|
||||
KAboutData::License_GPL, ki18n("(C) 2002, José Pablo Ezequiel Fernández"));
|
||||
aboutdata.addAuthor(ki18n("Jeremy Whiting"), ki18n("Current Maintainer"), "jpwhiting@kde.org");
|
||||
aboutdata.addAuthor(ki18n("José Pablo Ezequiel Fernández"),ki18n("Original Author"),"pupeno@pupeno.com");
|
||||
aboutdata.addAuthor(ki18n("Gary Cramblitt"), ki18n("Previous Maintainer"),"garycramblitt@comcast.net");
|
||||
aboutdata.addAuthor(ki18n("Gunnar Schmi Dt"), ki18n("Contributor"),"gunnar@schmi-dt.de");
|
||||
aboutdata.addAuthor(ki18n("Olaf Schmidt"), ki18n("Contributor"),"ojschmidt@kde.org");
|
||||
aboutdata.addAuthor(ki18n("Paul Giannaros"), ki18n("Contributor"), "ceruleanblaze@gmail.com");
|
||||
aboutdata.addAuthor(ki18n("Simion Ploscariu"), ki18n("Contributor"), "simion314@gmail.com");
|
||||
aboutdata.addCredit(ki18n("Jorge Luis Arzola"), ki18n("Testing"), "arzolacub@hotmail.com");
|
||||
aboutdata.addCredit(ki18n("David Powell"), ki18n("Testing"), "achiestdragon@gmail.com");
|
||||
aboutdata.setProgramIconName(QLatin1String( "preferences-desktop-text-to-speech" ));
|
||||
|
||||
KCmdLineArgs::init( argc, argv, &aboutdata );
|
||||
KUniqueApplication::addCmdLineOptions();
|
||||
|
||||
//KUniqueApplication::setOrganizationDomain("kde.org");
|
||||
//KUniqueApplication::setApplicationName("jovie");
|
||||
KUniqueApplication app;
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
if (!KUniqueApplication::start()) {
|
||||
kDebug() << "Jovie is already running";
|
||||
return (0);
|
||||
}
|
||||
|
||||
if (QDBusConnection::sessionBus().interface()->registerService(QLatin1String( "org.kde.KSpeech" ))
|
||||
!= QDBusConnectionInterface::ServiceRegistered) {
|
||||
kDebug() << "Could not register on KSpeech";
|
||||
}
|
||||
|
||||
if (QDBusConnection::sessionBus().interface()->registerService(QLatin1String( "org.kde.kttsd" ))
|
||||
!= QDBusConnectionInterface::ServiceRegistered) {
|
||||
kDebug() << "Could not register on kttsd";
|
||||
}
|
||||
|
||||
KCrash::setFlags(KCrash::AutoRestart);
|
||||
|
||||
// This app is started automatically, no need for session management
|
||||
app.disableSessionManagement();
|
||||
|
||||
kDebug() << "main: Creating Jovie Service";
|
||||
Jovie* service = Jovie::Instance();
|
||||
service->init();
|
||||
|
||||
// kDebug() << "Entering event loop.";
|
||||
return app.exec();
|
||||
delete service;
|
||||
}
|
|
@ -1,695 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Speaker class.
|
||||
|
||||
This class is in charge of getting the messages, warnings and text from
|
||||
the queue and calling speech-dispatcher to actually speak the texts.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
(C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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.
|
||||
******************************************************************************/
|
||||
|
||||
// Speaker includes.
|
||||
#include "speaker.h"
|
||||
#include "moc_speaker.cpp"
|
||||
|
||||
// System includes.
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtDBus/QtDBus>
|
||||
#include <QtXml/qdom.h>
|
||||
|
||||
// KDE includes.
|
||||
#include <kconfiggroup.h>
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <ktemporaryfile.h>
|
||||
#include <kservicetypetrader.h>
|
||||
#include <kspeech.h>
|
||||
//#include <kio/job.h>
|
||||
|
||||
// KTTS includes.
|
||||
#include "talkercode.h"
|
||||
|
||||
// KTTSD includes.
|
||||
//#include "talkermgr.h"
|
||||
#include "ssmlconvert.h"
|
||||
|
||||
|
||||
/**
|
||||
* The Speaker class manages all speech requests coming in from DBus, does any
|
||||
* filtering, and passes the resulting text on to speech-dispatcher through its
|
||||
* C api.
|
||||
*
|
||||
* The message queues are maintained in speech-dispatcher itself.
|
||||
*
|
||||
* Text jobs in the text queue each have a state (queued, speakable,
|
||||
* speaking, paused, finished).
|
||||
*
|
||||
* At the same time, it must issue the signals to inform programs
|
||||
* what is happening.
|
||||
*
|
||||
* Finally, users can pause, restart, delete, advance, or rewind text jobs
|
||||
* and Speaker must respond to these commands. In some cases, utterances that
|
||||
* have already been synthesized and are ready for audio output must be
|
||||
* discarded in response to these commands.
|
||||
*
|
||||
* Some general guidelines for programmers modifying this code:
|
||||
* - Avoid blocking at all cost. If a plugin won't stopText, keep going.
|
||||
* You might have to wait for the plugin to complete before asking it
|
||||
* to perform the next operation, but in the meantime, there might be
|
||||
* other useful work that can be performed.
|
||||
* - In no case allow the main thread Qt event loop to block.
|
||||
* - Plugins that do not have asynchronous support are wrapped in the
|
||||
* ThreadedPlugin class, which attempts to make them as asynchronous as
|
||||
* it can, but there are limits.
|
||||
* - doUtterances is the main worker method. If in doubt, call doUtterances.
|
||||
* - Because Speaker controls the ordering of utterances, most sequence-related
|
||||
* signals must be emitted by Speaker; not SpeechData. Only the add
|
||||
* and delete job-related signals eminate from SpeechData.
|
||||
* - The states of the 3 types of objects mentioned above (jobs, utterances,
|
||||
* and plugins) can interact in subtle ways. Test fully. For example, while
|
||||
* a text job might be in a paused state, the plugin could be synthesizing
|
||||
* in anticipation of resume, or sythesizing a Warning, Message, or
|
||||
* Screen Reader Output. Meanwhile, while one of the utterances might
|
||||
* have a paused state, others from the same job could be synthing, waiting,
|
||||
* or finished.
|
||||
*/
|
||||
|
||||
|
||||
class SpeakerPrivate
|
||||
{
|
||||
SpeakerPrivate(Speaker *parent) :
|
||||
connection(NULL),
|
||||
filterMgr(new FilterMgr()),
|
||||
config(new KConfig(QLatin1String( "kttsdrc" ))),
|
||||
q(parent)
|
||||
{
|
||||
filterMgr->init(config, QLatin1String( "General" ));
|
||||
}
|
||||
|
||||
~SpeakerPrivate()
|
||||
{
|
||||
spd_close(connection);
|
||||
connection = NULL;
|
||||
|
||||
// from speechdata class
|
||||
// kDebug() << "Running: SpeechDataPrivate::~SpeechDataPrivate";
|
||||
// Walk through jobs and emit jobStateChanged signal for each job.
|
||||
//foreach (SpeechJob* job, allJobs)
|
||||
// delete job;
|
||||
//allJobs.clear();
|
||||
|
||||
delete filterMgr;
|
||||
delete config;
|
||||
|
||||
foreach (AppData* applicationData, appData)
|
||||
delete applicationData;
|
||||
appData.clear();
|
||||
}
|
||||
|
||||
friend class Speaker;
|
||||
|
||||
protected:
|
||||
|
||||
bool ConnectToSpeechd()
|
||||
{
|
||||
bool retval = false;
|
||||
connection = spd_open("jovie", "main", NULL, SPD_MODE_THREADED);
|
||||
if (connection != NULL)
|
||||
{
|
||||
kDebug() << "successfully opened connection to speech dispatcher";
|
||||
connection->callback_begin = connection->callback_end =
|
||||
connection->callback_cancel = connection->callback_pause =
|
||||
connection->callback_resume = Speaker::speechdCallback;
|
||||
|
||||
spd_set_notification_on(connection, SPD_BEGIN);
|
||||
spd_set_notification_on(connection, SPD_END);
|
||||
spd_set_notification_on(connection, SPD_CANCEL);
|
||||
spd_set_notification_on(connection, SPD_PAUSE);
|
||||
spd_set_notification_on(connection, SPD_RESUME);
|
||||
char ** modulenames = spd_list_modules(connection);
|
||||
while (modulenames != NULL && modulenames[0] != NULL)
|
||||
{
|
||||
outputModules << QLatin1String( modulenames[0] );
|
||||
modulenames++;
|
||||
kDebug() << "added module " << outputModules.last();
|
||||
}
|
||||
|
||||
readTalkerData();
|
||||
|
||||
retval = true;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
// try to reconnect to speech-dispatcher, return true on success
|
||||
bool reconnect()
|
||||
{
|
||||
spd_close(connection);
|
||||
return ConnectToSpeechd();
|
||||
}
|
||||
|
||||
void readTalkerData()
|
||||
{
|
||||
config->reparseConfiguration();
|
||||
// Iterate through list of the TalkerCode IDs.
|
||||
KConfigGroup ttsconfig(config, "General");
|
||||
QStringList talkerIDsList = ttsconfig.readEntry("TalkerIDs", QStringList());
|
||||
// kDebug() << "TalkerListModel::loadTalkerCodesFromConfig: talkerIDsList = " << talkerIDsList;
|
||||
if (!talkerIDsList.isEmpty())
|
||||
{
|
||||
QStringList::ConstIterator itEnd = talkerIDsList.constEnd();
|
||||
for (QStringList::ConstIterator it = talkerIDsList.constBegin(); it != itEnd; ++it)
|
||||
{
|
||||
QString talkerID = *it;
|
||||
kDebug() << "TalkerListWidget::loadTalkerCodes: talkerID = " << talkerID;
|
||||
KConfigGroup talkGroup(config, "Talkers");
|
||||
QString talkerCode = talkGroup.readEntry(talkerID);
|
||||
TalkerCode tc = TalkerCode(talkerCode, true);
|
||||
if (defaultTalker.name().isEmpty())
|
||||
defaultTalker = tc;
|
||||
kDebug() << "TalkerCodeWidget::loadTalkerCodes: talkerCode = " << talkerCode;
|
||||
//tc.setId(talkerID);
|
||||
// do something with the talker codes read in
|
||||
}
|
||||
currentTalker = defaultTalker;
|
||||
|
||||
q->setOutputModule(defaultTalker.outputModule());
|
||||
q->setLanguage(defaultTalker.language());
|
||||
q->setVoiceType(defaultTalker.voiceType());
|
||||
q->setVolume(defaultTalker.volume());
|
||||
q->setPitch(defaultTalker.pitch());
|
||||
q->setSpeed(defaultTalker.rate());
|
||||
q->setPunctuationType(defaultTalker.punctuation());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* list of output modules speech-dispatcher has
|
||||
*/
|
||||
QStringList outputModules;
|
||||
|
||||
SPDConnection * connection;
|
||||
|
||||
/**
|
||||
* Application data.
|
||||
*/
|
||||
mutable QMap<QString, AppData*> appData;
|
||||
|
||||
/**
|
||||
* the filter manager
|
||||
*/
|
||||
FilterMgr * filterMgr;
|
||||
|
||||
/**
|
||||
* Object holding all the configuration
|
||||
*/
|
||||
KConfig *config;
|
||||
|
||||
Speaker *q;
|
||||
|
||||
/**
|
||||
* Keeps track of the default talker in the configuration file
|
||||
* for easy switching back to it.
|
||||
*/
|
||||
TalkerCode defaultTalker;
|
||||
|
||||
/**
|
||||
* Keeps track of the current talker information to give back to any users
|
||||
* and to know if we need to change the talker based on a filter's results.
|
||||
*/
|
||||
TalkerCode currentTalker;
|
||||
};
|
||||
|
||||
/* Public Methods ==========================================================*/
|
||||
|
||||
Speaker * Speaker::m_instance = NULL;
|
||||
|
||||
Speaker * Speaker::Instance()
|
||||
{
|
||||
if (m_instance == NULL)
|
||||
{
|
||||
m_instance = new Speaker();
|
||||
}
|
||||
return m_instance;
|
||||
}
|
||||
|
||||
void Speaker::speechdCallback(size_t msg_id, size_t /*client_id*/, SPDNotificationType type)
|
||||
{
|
||||
kDebug() << "speechdCallback called with messageid: " << msg_id << " and type: " << type;
|
||||
//KSpeech::JobState state(KSpeech::jsQueued);
|
||||
//switch (type) {
|
||||
// case SPD_EVENT_BEGIN:
|
||||
// state = KSpeech::jsSpeaking;
|
||||
// break;
|
||||
// case SPD_EVENT_END:
|
||||
// state = KSpeech::jsFinished;
|
||||
// break;
|
||||
// case SPD_EVENT_INDEX_MARK:
|
||||
// break;
|
||||
// case SPD_EVENT_CANCEL:
|
||||
// state = KSpeech::jsDeleted;
|
||||
// break;
|
||||
// case SPD_EVENT_PAUSE:
|
||||
// state = KSpeech::jsPaused;
|
||||
// break;
|
||||
// case SPD_EVENT_RESUME:
|
||||
// state = KSpeech::jsSpeaking;
|
||||
// break;
|
||||
//}
|
||||
}
|
||||
|
||||
Speaker::Speaker() :
|
||||
d(new SpeakerPrivate(this))
|
||||
{
|
||||
if (!d->ConnectToSpeechd())
|
||||
{
|
||||
kDebug() << "connection: " << d->connection;
|
||||
kError() << "could not get a connection to speech-dispatcher"<< endl;
|
||||
}
|
||||
// kDebug() << "Running: Speaker::Speaker()";
|
||||
// Connect ServiceUnregistered signal from DBUS so we know when apps have exited.
|
||||
connect (QDBusConnection::sessionBus().interface(), SIGNAL(serviceUnregistered(QString)),
|
||||
this, SLOT(slotServiceUnregistered(QString)));
|
||||
}
|
||||
|
||||
Speaker::~Speaker(){
|
||||
kDebug() << "Running: Speaker::~Speaker()";
|
||||
delete d;
|
||||
}
|
||||
|
||||
void Speaker::init()
|
||||
{
|
||||
// from speechdata
|
||||
// Create an initial FilterMgr for the pool to save time later.
|
||||
kDebug() << "Running: Speaker::init()";
|
||||
delete d->filterMgr;
|
||||
d->filterMgr = new FilterMgr();
|
||||
d->filterMgr->init(d->config, QLatin1String( "General" ));
|
||||
|
||||
// Reread config setting the top voice if there is one.
|
||||
d->readTalkerData();
|
||||
}
|
||||
|
||||
AppData* Speaker::getAppData(const QString& appId) const
|
||||
{
|
||||
if (!d->appData.contains(appId))
|
||||
d->appData.insert(appId, new AppData(appId));
|
||||
return d->appData[appId];
|
||||
}
|
||||
|
||||
bool Speaker::isSsml(const QString &text)
|
||||
{
|
||||
/// This checks to see if the root tag of the text is a <speak> tag.
|
||||
QDomDocument ssml;
|
||||
ssml.setContent(text, false); // No namespace processing.
|
||||
/// Check to see if this is SSML
|
||||
QDomElement root = ssml.documentElement();
|
||||
return (root.tagName() == QLatin1String( "speak" ));
|
||||
}
|
||||
|
||||
QStringList Speaker::parseText(const QString &text, const QString &appId /*=NULL*/)
|
||||
{
|
||||
// There has to be a better way
|
||||
// kDebug() << "I'm getting: "<< text << " from application " << appId;
|
||||
if (isSsml(text)) {
|
||||
QStringList tempList(text);
|
||||
return tempList;
|
||||
}
|
||||
// See if app has specified a custom sentence delimiter and use it, otherwise use default.
|
||||
QRegExp sentenceDelimiter(getAppData(appId)->sentenceDelimiter());
|
||||
QString temp = text;
|
||||
// Replace spaces, tabs, and formfeeds with a single space.
|
||||
temp.replace(QRegExp(QLatin1String( "[ \\t\\f]+") ), QLatin1String( " " ));
|
||||
// Replace sentence delimiters with tab.
|
||||
temp.replace(sentenceDelimiter, QLatin1String( "\\1\t" ));
|
||||
// Replace remaining newlines with spaces.
|
||||
temp.replace(QLatin1Char( '\n' ),QLatin1Char( ' ' ));
|
||||
temp.replace(QLatin1Char( '\r' ),QLatin1Char( ' ' ));
|
||||
// Remove leading spaces.
|
||||
temp.replace(QRegExp(QLatin1String( "\\t +" )), QLatin1String( "\t" ));
|
||||
// Remove trailing spaces.
|
||||
temp.replace(QRegExp(QLatin1String( " +\\t" )), QLatin1String( "\t" ));
|
||||
// Remove blank lines.
|
||||
temp.replace(QRegExp(QLatin1String( "\t\t+" )),QLatin1String( "\t" ));
|
||||
// Split into sentences.
|
||||
QStringList tempList = temp.split( QLatin1Char( '\t' ), QString::SkipEmptyParts);
|
||||
|
||||
// for ( QStringList::Iterator it = tempList.begin(); it != tempList.end(); ++it ) {
|
||||
// kDebug() << "'" << *it << "'";
|
||||
// }
|
||||
return tempList;
|
||||
}
|
||||
|
||||
int Speaker::say(const QString& appId, const QString& text, int sayOptions)
|
||||
{
|
||||
QString filteredText = text;
|
||||
int jobNum = -1;
|
||||
|
||||
AppData* appData = getAppData(appId);
|
||||
KSpeech::JobPriority priority = appData->defaultPriority();
|
||||
TalkerCode talkerCode = d->currentTalker;
|
||||
//kDebug() << "Speaker::say priority = " << priority;
|
||||
//kDebug() << "Running: Speaker::say appId = " << appId << " text = " << text;
|
||||
//QString talker = appData->defaultTalker();
|
||||
|
||||
SPDPriority spdpriority = SPD_PROGRESS; // default to least priority
|
||||
switch (priority)
|
||||
{
|
||||
case KSpeech::jpScreenReaderOutput: /**< Screen Reader job. SPD_IMPORTANT */
|
||||
spdpriority = SPD_IMPORTANT;
|
||||
break;
|
||||
case KSpeech::jpWarning: /**< Warning job. SPD_NOTIFICATION */
|
||||
spdpriority = SPD_NOTIFICATION;
|
||||
break;
|
||||
case KSpeech::jpMessage: /**< Message job.SPD_MESSAGE */
|
||||
spdpriority = SPD_MESSAGE;
|
||||
break;
|
||||
case KSpeech::jpText: /**< Text job. SPD_TEXT */
|
||||
spdpriority = SPD_TEXT;
|
||||
break;
|
||||
case KSpeech::jpProgress: /**< Progress report. SPD_PROGRESS added KDE 4.4 */
|
||||
spdpriority = SPD_PROGRESS;
|
||||
break;
|
||||
}
|
||||
|
||||
if (appData->filteringOn()) {
|
||||
filteredText = d->filterMgr->convert(text, &talkerCode, appId);
|
||||
}
|
||||
|
||||
// Change the voice to the talkerCode from the filter if needed.
|
||||
if (talkerCode != d->currentTalker)
|
||||
{
|
||||
kDebug() << "Changing language from " << d->currentTalker.getTranslatedDescription() <<
|
||||
" to " << talkerCode.getTranslatedDescription();
|
||||
setOutputModule(talkerCode.outputModule());
|
||||
// If there's a voiceName, use it, otherwise just use the language
|
||||
if (!talkerCode.voiceName().isEmpty())
|
||||
{
|
||||
setVoiceName(talkerCode.voiceName());
|
||||
}
|
||||
else
|
||||
{
|
||||
setLanguage(TalkerCode::languageCodeToLanguage(talkerCode.language()));
|
||||
}
|
||||
setVoiceType(talkerCode.voiceType());
|
||||
setVolume(talkerCode.volume());
|
||||
setSpeed(talkerCode.rate());
|
||||
setPitch(talkerCode.pitch());
|
||||
setPunctuationType(talkerCode.punctuation());
|
||||
}
|
||||
emit newJobFiltered(text, filteredText);
|
||||
|
||||
while (jobNum == -1 && d->connection != NULL)
|
||||
{
|
||||
switch (sayOptions)
|
||||
{
|
||||
case KSpeech::soNone: /**< No options specified. Autodetected. */
|
||||
jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
break;
|
||||
case KSpeech::soPlainText: /**< The text contains plain text. */
|
||||
jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
break;
|
||||
case KSpeech::soHtml: /**< The text contains HTML markup. */
|
||||
jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
break;
|
||||
case KSpeech::soSsml: /**< The text contains SSML markup. */
|
||||
spd_set_data_mode(d->connection, SPD_DATA_SSML);
|
||||
jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
spd_set_data_mode(d->connection, SPD_DATA_TEXT);
|
||||
break;
|
||||
case KSpeech::soChar: /**< The text should be spoken as individual characters. */
|
||||
spd_set_spelling(d->connection, SPD_SPELL_ON);
|
||||
jobNum = spd_say(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
spd_set_spelling(d->connection, SPD_SPELL_OFF);
|
||||
break;
|
||||
case KSpeech::soKey: /**< The text contains a keyboard symbolic key name. */
|
||||
jobNum = spd_key(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
break;
|
||||
case KSpeech::soSoundIcon: /**< The text is the name of a sound icon. */
|
||||
jobNum = spd_sound_icon(d->connection, spdpriority, filteredText.toUtf8().data());
|
||||
break;
|
||||
}
|
||||
if (jobNum == -1 && d->connection != NULL)
|
||||
{
|
||||
// job failure
|
||||
// try to reconnect once
|
||||
kDebug() << "trying to reconnect to speech dispatcher";
|
||||
if (!d->reconnect())
|
||||
{
|
||||
// replace this with an error stored in kttsd in a log? to be viewed on hover over kttsmgr?
|
||||
kDebug() << "could not connect to speech dispatcher";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jobNum != -1)
|
||||
{
|
||||
kDebug() << "incoming job with text: " << text;
|
||||
kDebug() << "saying post filtered text: " << filteredText;
|
||||
}
|
||||
|
||||
//// Note: Set state last so job is fully populated when jobStateChanged signal is emitted.
|
||||
appData->jobList()->append(jobNum);
|
||||
return jobNum;
|
||||
}
|
||||
|
||||
int Speaker::findJobNumByAppId(const QString& appId) const
|
||||
{
|
||||
if (appId.isEmpty())
|
||||
return 0; // d->lastJobNum;
|
||||
else
|
||||
return getAppData(appId)->lastJobNum();
|
||||
}
|
||||
|
||||
void Speaker::requestExit()
|
||||
{
|
||||
// kDebug() << "Speaker::requestExit: Running";
|
||||
//d->exitRequested = true;
|
||||
}
|
||||
|
||||
bool Speaker::isSpeaking()
|
||||
{
|
||||
return true; // TODO: ask speech-dispatcher somehow?
|
||||
}
|
||||
|
||||
void Speaker::setTalker(int jobNum, const QString &talker)
|
||||
{
|
||||
kDebug() << "Speaker::setTalker this is not implemented yet in speech-dispatcher";
|
||||
}
|
||||
|
||||
QStringList Speaker::outputModules()
|
||||
{
|
||||
return d->outputModules;
|
||||
}
|
||||
|
||||
QStringList Speaker::languagesByModule(const QString & module)
|
||||
{
|
||||
QStringList languages;
|
||||
if (d->connection && module != QLatin1String("dummy") &&
|
||||
spd_set_output_module(d->connection, module.toUtf8().data()) == 0)
|
||||
{
|
||||
SPDVoice ** voices = spd_list_synthesis_voices(d->connection);
|
||||
while (voices != NULL && voices[0] != NULL)
|
||||
{
|
||||
if (!languages.contains(QLatin1String( voices[0]->language) ))
|
||||
languages << QLatin1String( voices[0]->language );
|
||||
++voices;
|
||||
}
|
||||
}
|
||||
return languages;
|
||||
}
|
||||
|
||||
QStringList Speaker::getPossibleTalkers()
|
||||
{
|
||||
QStringList talkers;
|
||||
|
||||
foreach (const QString &module, d->outputModules)
|
||||
{
|
||||
if (d->connection &&
|
||||
spd_set_output_module(d->connection, module.toUtf8().data()) == 0)
|
||||
{
|
||||
SPDVoice ** voices = spd_list_synthesis_voices(d->connection);
|
||||
kDebug() << "Got voices for output module " << module;
|
||||
while (voices != NULL && voices[0] != NULL)
|
||||
{
|
||||
TalkerCode code;
|
||||
code.setOutputModule(module);
|
||||
code.setVoiceName(QLatin1String(voices[0]->name));
|
||||
code.setLanguage(QLatin1String(voices[0]->language));
|
||||
talkers.append (code.getTalkerCode());
|
||||
++voices;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return talkers;
|
||||
}
|
||||
|
||||
void Speaker::setSpeed(int speed)
|
||||
{
|
||||
if (d->connection) {
|
||||
spd_set_voice_rate(d->connection, speed);
|
||||
d->currentTalker.setRate(speed);
|
||||
}
|
||||
}
|
||||
|
||||
int Speaker::speed()
|
||||
{
|
||||
return d->currentTalker.rate();
|
||||
}
|
||||
|
||||
void Speaker::setPitch(int pitch)
|
||||
{
|
||||
if (d->connection) {
|
||||
spd_set_voice_pitch(d->connection, pitch);
|
||||
d->currentTalker.setPitch(pitch);
|
||||
}
|
||||
}
|
||||
|
||||
int Speaker::pitch()
|
||||
{
|
||||
return d->currentTalker.pitch();
|
||||
}
|
||||
|
||||
void Speaker::setVolume(int volume)
|
||||
{
|
||||
if (d->connection) {
|
||||
spd_set_volume(d->connection, volume);
|
||||
d->currentTalker.setVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
int Speaker::volume()
|
||||
{
|
||||
return d->currentTalker.volume();
|
||||
}
|
||||
|
||||
void Speaker::setOutputModule(const QString & module)
|
||||
{
|
||||
if (d->connection) {
|
||||
int result = spd_set_output_module(d->connection, module.toUtf8().data());
|
||||
d->currentTalker.setOutputModule(module);
|
||||
// discard result for now, TODO: add error reporting
|
||||
}
|
||||
}
|
||||
|
||||
QString Speaker::outputModule()
|
||||
{
|
||||
return d->currentTalker.outputModule();
|
||||
}
|
||||
|
||||
void Speaker::setVoiceName(const QString & voiceName)
|
||||
{
|
||||
if (d->connection) {
|
||||
int result = spd_set_synthesis_voice(d->connection, voiceName.toUtf8().data());
|
||||
d->currentTalker.setVoiceName(voiceName);
|
||||
}
|
||||
}
|
||||
|
||||
QString Speaker::voiceName()
|
||||
{
|
||||
return d->currentTalker.voiceName();
|
||||
}
|
||||
|
||||
void Speaker::setPunctuationType(int punctuation)
|
||||
{
|
||||
if(d->connection && punctuation >= SPD_PUNCT_ALL && punctuation <= SPD_PUNCT_SOME){
|
||||
int result = spd_set_punctuation(d->connection, SPDPunctuation(punctuation));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Speaker::setLanguage(const QString & language)
|
||||
{
|
||||
if (d->connection) {
|
||||
int result = spd_set_language(d->connection, language.toUtf8().data());
|
||||
d->currentTalker.setLanguage(language);
|
||||
// discard result for now, TODO: add error reporting
|
||||
}
|
||||
}
|
||||
|
||||
QString Speaker::language()
|
||||
{
|
||||
return d->currentTalker.language();
|
||||
}
|
||||
|
||||
void Speaker::setVoiceType(int voiceType)
|
||||
{
|
||||
if (d->connection) {
|
||||
int result = spd_set_voice_type(d->connection, SPDVoiceType(voiceType));
|
||||
d->currentTalker.setVoiceType(voiceType);
|
||||
// discard result for now, TODO: add error reporting
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int Speaker::voiceType()
|
||||
{
|
||||
return d->currentTalker.voiceType();
|
||||
}
|
||||
|
||||
void Speaker::stop()
|
||||
{
|
||||
if (d->connection)
|
||||
spd_stop(d->connection);
|
||||
else
|
||||
kDebug() << "unable to stop as there's no connection to speech-dispatcher";
|
||||
}
|
||||
|
||||
void Speaker::cancel()
|
||||
{
|
||||
if (d->connection)
|
||||
spd_cancel(d->connection);
|
||||
else
|
||||
kDebug() << "unable to cancel as there's no connection to speech-dispatcher";
|
||||
}
|
||||
|
||||
void Speaker::pause()
|
||||
{
|
||||
if (d->connection)
|
||||
spd_pause(d->connection);
|
||||
else
|
||||
kDebug() << "unable to pause as there's no connection to speech-dispatcher";
|
||||
}
|
||||
|
||||
void Speaker::resume()
|
||||
{
|
||||
if (d->connection)
|
||||
spd_resume(d->connection);
|
||||
else
|
||||
kDebug() << "unable to resume as there's no connection to speech-dispatcher";
|
||||
}
|
||||
|
||||
bool Speaker::isApplicationPaused(const QString& appId)
|
||||
{
|
||||
return getAppData(appId)->isApplicationPaused();
|
||||
}
|
||||
|
||||
void Speaker::slotServiceUnregistered(const QString& serviceName)
|
||||
{
|
||||
if (d->appData.contains(serviceName))
|
||||
d->appData[serviceName]->setUnregistered(true);
|
||||
}
|
|
@ -1,244 +0,0 @@
|
|||
/***************************************************** vim:set ts=4 sw=4 sts=4:
|
||||
Speaker class.
|
||||
|
||||
This class is in charge of getting the messages, warnings and text from
|
||||
the queue and calling speech-dispatcher to actually speak the texts.
|
||||
-------------------
|
||||
Copyright:
|
||||
(C) 2006 by Gary Cramblitt <garycramblitt@comcast.net>
|
||||
(C) 2009 by Jeremy Whiting <jpwhiting@kde.org>
|
||||
-------------------
|
||||
Original author: Gary Cramblitt <garycramblitt@comcast.net>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
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 SPEAKER_H
|
||||
#define SPEAKER_H
|
||||
|
||||
// Qt includes.
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QList>
|
||||
#include <QtCore/QEvent>
|
||||
|
||||
#include <kspeech.h>
|
||||
|
||||
#include <libspeechd.h>
|
||||
|
||||
#include "filtermgr.h"
|
||||
#include "appdata.h"
|
||||
#include "speechjob.h"
|
||||
|
||||
/**
|
||||
* Struct used to keep a pool of FilterMgr objects.
|
||||
*/
|
||||
//struct PooledFilterMgr {
|
||||
// FilterMgr* filterMgr; /* The FilterMgr object. */
|
||||
// bool busy; /* True if the FilterMgr is busy. */
|
||||
// SpeechJob* job; /* The job the FilterMgr is filtering. */
|
||||
// TalkerCode* talkerCode; /* TalkerCode object passed to FilterMgr. */
|
||||
//};
|
||||
|
||||
class SpeakerPrivate;
|
||||
|
||||
/**
|
||||
* @class Speaker
|
||||
*
|
||||
* This class is in charge of getting the messages, warnings and text from
|
||||
* the queue and calling speech-dispatcher to actually speak the texts. All
|
||||
* interaction with speech-dispatcher happens through this class.
|
||||
*/
|
||||
class Speaker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* singleton accessor
|
||||
*/
|
||||
static Speaker * Instance();
|
||||
|
||||
static void speechdCallback(size_t msg_id, size_t client_id, SPDNotificationType type);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
~Speaker();
|
||||
|
||||
/**
|
||||
* (re)initializes the filtermgr
|
||||
*/
|
||||
void init();
|
||||
|
||||
/**
|
||||
* Tells the thread to exit.
|
||||
* TODO: Is this used anymore?
|
||||
*/
|
||||
void requestExit();
|
||||
|
||||
/**
|
||||
* Determine if kttsd is currently speaking any jobs.
|
||||
* @return True if currently speaking any jobs.
|
||||
*/
|
||||
bool isSpeaking();
|
||||
|
||||
/**
|
||||
* Get application data.
|
||||
* If this is a new application, a new AppData object is created and initialized
|
||||
* with defaults.
|
||||
* Caller may set properties, but must not delete the returned AppData object.
|
||||
* Use releaseAppData instead.
|
||||
* @param appId The DBUS senderId of the application.
|
||||
*/
|
||||
AppData* getAppData(const QString& appId) const;
|
||||
|
||||
/**
|
||||
* Queue and start a speech job.
|
||||
* @param appId The DBUS senderId of the application.
|
||||
* @param text The text to be spoken.
|
||||
* @param sayOptions Option flags. @see SayOptions. Defaults to KSpeech::soNone.
|
||||
*
|
||||
* Based on the options, the text may contain the text to be spoken, with or withou
|
||||
* markup, or it may contain characters to be spelled out, or it may contain
|
||||
* the symbolic name of a keyboard key, or it may contain the name of a sound
|
||||
* icon.
|
||||
*
|
||||
* The job is given the applications current defaultPriority. @see defaultPriority.
|
||||
* The job is assigned the applications current defaultTalker. @see defaultTalker.
|
||||
*/
|
||||
int say(const QString& appId, const QString& text, int sayOptions);
|
||||
|
||||
/**
|
||||
* Change the talker for a job.
|
||||
* @param jobNum Job number of the job.
|
||||
* @param talker New code for the talker to do speaking. Example "en".
|
||||
* If NULL, defaults to the user's default talker.
|
||||
* If no plugin has been configured for the specified Talker code,
|
||||
* defaults to the closest matching talker.
|
||||
*
|
||||
* @see talker
|
||||
*/
|
||||
void setTalker(int jobNum, const QString &talker);
|
||||
|
||||
/**
|
||||
* Given an appId, returns the last (most recently queued) Job Number with that appId,
|
||||
* or if no such job, the Job Number of the last (most recent) job in the queue.
|
||||
* @param appId The DBUS senderId of the application.
|
||||
* @return Job Number.
|
||||
* If no such job, returns 0.
|
||||
* If appId is NULL, returns the Job Number of the last job in the queue.
|
||||
*/
|
||||
int findJobNumByAppId(const QString& appId) const;
|
||||
|
||||
/**
|
||||
* Given an appId, returns the last (most recently queued) job with that appId.
|
||||
* @param appId The DBUS senderId of the application.
|
||||
* @return Pointer to the job.
|
||||
* If no such job, returns 0.
|
||||
* If appId is NULL, returns the last job in the queue.
|
||||
*/
|
||||
SpeechJob* findLastJobByAppId(const QString& appId) const;
|
||||
|
||||
/**
|
||||
* Return true if the application is paused.
|
||||
*/
|
||||
bool isApplicationPaused(const QString& appId);
|
||||
|
||||
/**
|
||||
* Stops the message currently being spoken on a given connection.
|
||||
* If there is no message being spoken, does nothing. (It doesn't touch the messages waiting in queues).
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* Stops the currently spoken message from this connection (if there is any) and discards all the
|
||||
* queued messages from this connection.
|
||||
*/
|
||||
void cancel();
|
||||
|
||||
/**
|
||||
* Pauses the speech.
|
||||
*/
|
||||
void pause();
|
||||
|
||||
/**
|
||||
* Resumes the speech.
|
||||
*/
|
||||
void resume();
|
||||
|
||||
/**
|
||||
* Get the output modules available from speech-dispatcher
|
||||
*/
|
||||
QStringList outputModules();
|
||||
QStringList languagesByModule(const QString & module);
|
||||
|
||||
QStringList getPossibleTalkers();
|
||||
|
||||
void setSpeed(int speed);
|
||||
void setPitch(int pitch);
|
||||
void setVolume(int volume);
|
||||
|
||||
void setOutputModule(const QString & module);
|
||||
void setLanguage(const QString & language);
|
||||
void setVoiceType(int voiceType);
|
||||
void setVoiceName(const QString & voiceName);
|
||||
void setPunctuationType(int punctuation);
|
||||
|
||||
int speed();
|
||||
int pitch();
|
||||
int volume();
|
||||
QString outputModule();
|
||||
QString language();
|
||||
int voiceType();
|
||||
QString voiceName();
|
||||
|
||||
signals:
|
||||
/**
|
||||
* This signal is emitted when a new job coming in is filtered (or not filtered if no filters
|
||||
* are on).
|
||||
* @param prefilterText The text of the speech job
|
||||
* @param postfilterText The text of the speech job after any filters have been applied
|
||||
*/
|
||||
void newJobFiltered(const QString &prefilterText, const QString &postfilterText);
|
||||
|
||||
private slots:
|
||||
void slotServiceUnregistered(const QString& serviceName);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
Speaker();
|
||||
|
||||
/**
|
||||
* Determines whether the given text is SSML markup.
|
||||
*/
|
||||
bool isSsml(const QString &text);
|
||||
|
||||
/**
|
||||
* Parses a block of text into sentences using the application-specified regular expression
|
||||
* or (if not specified), the default regular expression.
|
||||
* @param text The message to be spoken.
|
||||
* @param appId The DBUS senderId of the application.
|
||||
* @return List of parsed sentences.
|
||||
*/
|
||||
QStringList parseText(const QString &text, const QString &appId);
|
||||
|
||||
private:
|
||||
SpeakerPrivate* const d;
|
||||
static Speaker * m_instance;
|
||||
};
|
||||
|
||||
#endif // SPEAKER_H
|