summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-03-26 13:50:43 +0100
committerSlávek Banko <slavek.banko@axis.cz>2016-03-26 13:50:43 +0100
commitd62c8c002c51fb7c36487839eeeb4ac89f044dee (patch)
treebb4d1f5c631ab1f22a3018ba39e6a806035f80fd
downloadkxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.tar.gz
kxmleditor-d62c8c002c51fb7c36487839eeeb4ac89f044dee.zip
Initial import of kxmleditor 1.1.4
-rw-r--r--AUTHORS4
-rw-r--r--CODING91
-rw-r--r--COPYING280
-rw-r--r--ChangeLog1269
-rw-r--r--Doxyfile266
-rw-r--r--INSTALL167
-rw-r--r--KXMLEditor.flwbin0 -> 2506 bytes
-rw-r--r--Makefile.am29
-rw-r--r--Makefile.dist14
-rw-r--r--README22
-rw-r--r--TODO2
-rw-r--r--configure.files2
-rw-r--r--configure.in.in4
-rw-r--r--doc/Makefile.am6
-rw-r--r--doc/en/Makefile.am10
-rw-r--r--doc/en/index.docbook1502
-rw-r--r--doc/en/kparts.pngbin0 -> 124983 bytes
-rw-r--r--doc/en/screenshot.pngbin0 -> 100110 bytes
-rw-r--r--doc/en/setupdefaults.pngbin0 -> 37047 bytes
-rw-r--r--doc/en/setupprintout.pngbin0 -> 32288 bytes
-rw-r--r--doc/en/setuptargz.pngbin0 -> 31677 bytes
-rw-r--r--doc/en/setuptexteditor.pngbin0 -> 41341 bytes
-rw-r--r--doc/en/setuptreeview.pngbin0 -> 35871 bytes
-rw-r--r--doc/en/specprocinstrdlg.pngbin0 -> 14023 bytes
-rw-r--r--doc/en/texteditor.pngbin0 -> 36009 bytes
-rw-r--r--doc/en/xml.pngbin0 -> 51086 bytes
-rw-r--r--kxmleditor.lsm14
-rw-r--r--kxmleditor.spec45
-rw-r--r--kxmleditor/Makefile.am51
-rw-r--r--kxmleditor/dcopiface_shell.cpp39
-rw-r--r--kxmleditor/dcopiface_shell.h70
-rw-r--r--kxmleditor/kxeshellmanager.cpp55
-rw-r--r--kxmleditor/kxeshellmanager.h65
-rw-r--r--kxmleditor/kxmleditor.desktop12
-rw-r--r--kxmleditor/kxmleditorshell.cpp495
-rw-r--r--kxmleditor/kxmleditorshell.h178
-rw-r--r--kxmleditor/kxmleditorshell.rc31
-rw-r--r--kxmleditor/main.cpp139
-rw-r--r--part/Makefile.am53
-rw-r--r--part/actions.cpp229
-rw-r--r--part/actions.h88
-rw-r--r--part/commands_edit.cpp778
-rw-r--r--part/commands_edit.h346
-rw-r--r--part/commands_file.cpp158
-rw-r--r--part/commands_file.h102
-rw-r--r--part/commands_insert.cpp329
-rw-r--r--part/commands_insert.h94
-rw-r--r--part/dcopiface_part_ro.cpp67
-rw-r--r--part/dcopiface_part_ro.h124
-rw-r--r--part/icons/Makefile.am155
-rw-r--r--part/icons/hi16-action-bookmark_next.pngbin0 -> 511 bytes
-rw-r--r--part/icons/hi16-action-bookmark_prev.pngbin0 -> 545 bytes
-rw-r--r--part/icons/hi16-action-collapse_node.pngbin0 -> 138 bytes
-rw-r--r--part/icons/hi16-action-expand_node.pngbin0 -> 188 bytes
-rw-r--r--part/icons/hi16-action-xml_cdata.pngbin0 -> 547 bytes
-rw-r--r--part/icons/hi16-action-xml_comment.pngbin0 -> 504 bytes
-rw-r--r--part/icons/hi16-action-xml_delete_attribute.pngbin0 -> 330 bytes
-rw-r--r--part/icons/hi16-action-xml_delete_contents.pngbin0 -> 299 bytes
-rw-r--r--part/icons/hi16-action-xml_delete_element.pngbin0 -> 358 bytes
-rw-r--r--part/icons/hi16-action-xml_delete_procins.pngbin0 -> 650 bytes
-rw-r--r--part/icons/hi16-action-xml_edit_attribute.pngbin0 -> 296 bytes
-rw-r--r--part/icons/hi16-action-xml_edit_contents.pngbin0 -> 259 bytes
-rw-r--r--part/icons/hi16-action-xml_edit_element.pngbin0 -> 340 bytes
-rw-r--r--part/icons/hi16-action-xml_edit_procins.pngbin0 -> 699 bytes
-rw-r--r--part/icons/hi16-action-xml_insert_attribute.pngbin0 -> 369 bytes
-rw-r--r--part/icons/hi16-action-xml_insert_contents.pngbin0 -> 343 bytes
-rw-r--r--part/icons/hi16-action-xml_insert_element.pngbin0 -> 415 bytes
-rw-r--r--part/icons/hi16-action-xml_insert_procins.pngbin0 -> 689 bytes
-rw-r--r--part/icons/hi16-action-xml_move_item_down.pngbin0 -> 188 bytes
-rw-r--r--part/icons/hi16-action-xml_move_item_up.pngbin0 -> 188 bytes
-rw-r--r--part/icons/hi16-action-xml_text.pngbin0 -> 580 bytes
-rw-r--r--part/icons/hi22-action-bookmark_next.pngbin0 -> 849 bytes
-rw-r--r--part/icons/hi22-action-bookmark_prev.pngbin0 -> 859 bytes
-rw-r--r--part/icons/hi22-action-collapse_node.pngbin0 -> 764 bytes
-rw-r--r--part/icons/hi22-action-expand_node.pngbin0 -> 793 bytes
-rw-r--r--part/icons/hi22-action-xml_delete_attribute.pngbin0 -> 389 bytes
-rw-r--r--part/icons/hi22-action-xml_delete_contents.pngbin0 -> 337 bytes
-rw-r--r--part/icons/hi22-action-xml_delete_element.pngbin0 -> 453 bytes
-rw-r--r--part/icons/hi22-action-xml_delete_procins.pngbin0 -> 1142 bytes
-rw-r--r--part/icons/hi22-action-xml_edit_attribute.pngbin0 -> 396 bytes
-rw-r--r--part/icons/hi22-action-xml_edit_contents.pngbin0 -> 334 bytes
-rw-r--r--part/icons/hi22-action-xml_edit_element.pngbin0 -> 454 bytes
-rw-r--r--part/icons/hi22-action-xml_edit_procins.pngbin0 -> 1133 bytes
-rw-r--r--part/icons/hi22-action-xml_insert_attribute.pngbin0 -> 507 bytes
-rw-r--r--part/icons/hi22-action-xml_insert_contents.pngbin0 -> 433 bytes
-rw-r--r--part/icons/hi22-action-xml_insert_element.pngbin0 -> 542 bytes
-rw-r--r--part/icons/hi22-action-xml_insert_procins.pngbin0 -> 1209 bytes
-rw-r--r--part/icons/hi22-action-xml_move_item_down.pngbin0 -> 736 bytes
-rw-r--r--part/icons/hi22-action-xml_move_item_up.pngbin0 -> 416 bytes
-rw-r--r--part/icons/hi32-action-bookmark_next.pngbin0 -> 1277 bytes
-rw-r--r--part/icons/hi32-action-bookmark_prev.pngbin0 -> 1305 bytes
-rw-r--r--part/icons/hi32-action-xml_move_item_down.pngbin0 -> 630 bytes
-rw-r--r--part/icons/hi32-action-xml_move_item_up.pngbin0 -> 762 bytes
-rw-r--r--part/icons/hi32-app-kxmleditor.pngbin0 -> 1813 bytes
-rw-r--r--part/icons/hi48-app-kxmleditor.pngbin0 -> 2698 bytes
-rw-r--r--part/icons/lo16-action-bookmark_next.pngbin0 -> 276 bytes
-rw-r--r--part/icons/lo16-action-bookmark_prev.pngbin0 -> 263 bytes
-rw-r--r--part/icons/lo16-action-collapse_node.pngbin0 -> 123 bytes
-rw-r--r--part/icons/lo16-action-expand_node.pngbin0 -> 155 bytes
-rw-r--r--part/icons/lo16-action-xml_delete_attribute.pngbin0 -> 281 bytes
-rw-r--r--part/icons/lo16-action-xml_delete_contents.pngbin0 -> 287 bytes
-rw-r--r--part/icons/lo16-action-xml_delete_element.pngbin0 -> 358 bytes
-rw-r--r--part/icons/lo16-action-xml_delete_procins.pngbin0 -> 449 bytes
-rw-r--r--part/icons/lo16-action-xml_edit_attribute.pngbin0 -> 246 bytes
-rw-r--r--part/icons/lo16-action-xml_edit_contents.pngbin0 -> 228 bytes
-rw-r--r--part/icons/lo16-action-xml_edit_element.pngbin0 -> 285 bytes
-rw-r--r--part/icons/lo16-action-xml_edit_procins.pngbin0 -> 480 bytes
-rw-r--r--part/icons/lo16-action-xml_insert_attribute.pngbin0 -> 288 bytes
-rw-r--r--part/icons/lo16-action-xml_insert_contents.pngbin0 -> 296 bytes
-rw-r--r--part/icons/lo16-action-xml_insert_element.pngbin0 -> 330 bytes
-rw-r--r--part/icons/lo16-action-xml_insert_procins.pngbin0 -> 448 bytes
-rw-r--r--part/icons/lo16-action-xml_move_item_down.pngbin0 -> 188 bytes
-rw-r--r--part/icons/lo16-action-xml_move_item_up.pngbin0 -> 188 bytes
-rw-r--r--part/icons/lo16-app-kxmleditor.pngbin0 -> 251 bytes
-rw-r--r--part/icons/lo32-app-kxmleditor.pngbin0 -> 578 bytes
-rw-r--r--part/kxe_treeview.cpp909
-rw-r--r--part/kxe_treeview.h235
-rw-r--r--part/kxe_treeviewitem.cpp330
-rw-r--r--part/kxe_treeviewitem.h125
-rw-r--r--part/kxe_viewattributes.cpp157
-rw-r--r--part/kxe_viewattributes.h71
-rw-r--r--part/kxe_viewelement.cpp126
-rw-r--r--part/kxe_viewelement.h94
-rw-r--r--part/kxearchiveextssettings.cpp153
-rw-r--r--part/kxearchiveextssettings.h113
-rw-r--r--part/kxearchiveextssettingspage.ui175
-rw-r--r--part/kxeattachdialogbase.ui144
-rw-r--r--part/kxeattributedialog.cpp179
-rw-r--r--part/kxeattributedialog.h82
-rw-r--r--part/kxeattributedialogbase.ui263
-rw-r--r--part/kxechardatadialog.cpp119
-rw-r--r--part/kxechardatadialog.h83
-rw-r--r--part/kxechardatadialogbase.ui213
-rw-r--r--part/kxechoosestringdialog.cpp42
-rw-r--r--part/kxechoosestringdialog.h44
-rw-r--r--part/kxechoosestringdialogbase.ui143
-rw-r--r--part/kxecommand.cpp25
-rw-r--r--part/kxecommand.h37
-rw-r--r--part/kxeconfiguration.cpp181
-rw-r--r--part/kxeconfiguration.h123
-rw-r--r--part/kxedocument.cpp631
-rw-r--r--part/kxedocument.h240
-rw-r--r--part/kxedocument.rc15
-rw-r--r--part/kxeelementdialog.cpp189
-rw-r--r--part/kxeelementdialog.h92
-rw-r--r--part/kxeelementdialogbase.ui339
-rw-r--r--part/kxefilenewdialog.cpp29
-rw-r--r--part/kxefilenewdialog.h31
-rw-r--r--part/kxenewfilesettings.cpp207
-rw-r--r--part/kxenewfilesettings.h111
-rw-r--r--part/kxenewfilesettingspage.ui176
-rw-r--r--part/kxeprintsettings.cpp134
-rw-r--r--part/kxeprintsettings.h95
-rw-r--r--part/kxeprintsettingspage.ui228
-rw-r--r--part/kxeprocinstrdialog.cpp183
-rw-r--r--part/kxeprocinstrdialog.h87
-rw-r--r--part/kxeprocinstrdialogbase.ui223
-rw-r--r--part/kxesearchdialog.cpp56
-rw-r--r--part/kxesearchdialog.h57
-rw-r--r--part/kxesearchdialogbase.ui350
-rw-r--r--part/kxesettings.cpp67
-rw-r--r--part/kxesettings.h175
-rw-r--r--part/kxespecprocinstrdialog.cpp135
-rw-r--r--part/kxespecprocinstrdialog.h54
-rw-r--r--part/kxespecprocinstrdialogbase.ui191
-rw-r--r--part/kxesyntaxhighlighter.cpp257
-rw-r--r--part/kxesyntaxhighlighter.h80
-rw-r--r--part/kxetexteditordialog.cpp120
-rw-r--r--part/kxetexteditordialog.h68
-rw-r--r--part/kxetexteditordialogbase.ui154
-rw-r--r--part/kxetextviewsettings.cpp173
-rw-r--r--part/kxetextviewsettings.h105
-rw-r--r--part/kxetextviewsettingspage.ui266
-rw-r--r--part/kxetreeviewsettings.cpp166
-rw-r--r--part/kxetreeviewsettings.h103
-rw-r--r--part/kxetreeviewsettingspage.ui226
-rw-r--r--part/kxmleditorabout.h50
-rw-r--r--part/kxmleditorfactory.cpp104
-rw-r--r--part/kxmleditorfactory.h55
-rw-r--r--part/kxmleditorpart.cpp1923
-rw-r--r--part/kxmleditorpart.desktop11
-rw-r--r--part/kxmleditorpart.h450
-rw-r--r--part/kxmleditorpartBrowseUI.rc81
-rw-r--r--part/kxmleditorpartEditUI.rc186
-rw-r--r--part/pics/Makefile.am38
-rw-r--r--part/pics/xml_attribute.pngbin0 -> 320 bytes
-rw-r--r--part/pics/xml_cdata.pngbin0 -> 468 bytes
-rw-r--r--part/pics/xml_cdata_b.pngbin0 -> 490 bytes
-rw-r--r--part/pics/xml_comment.pngbin0 -> 379 bytes
-rw-r--r--part/pics/xml_comment_b.pngbin0 -> 432 bytes
-rw-r--r--part/pics/xml_contents.pngbin0 -> 293 bytes
-rw-r--r--part/pics/xml_contents_b.pngbin0 -> 266 bytes
-rw-r--r--part/pics/xml_element.pngbin0 -> 367 bytes
-rw-r--r--part/pics/xml_element_b.pngbin0 -> 366 bytes
-rw-r--r--part/pics/xml_procinstr.pngbin0 -> 929 bytes
-rw-r--r--part/pics/xml_procinstr_b.pngbin0 -> 644 bytes
-rw-r--r--part/pics/xml_text.pngbin0 -> 533 bytes
-rw-r--r--part/pics/xml_text_b.pngbin0 -> 512 bytes
-rw-r--r--part/qdom_add.cpp352
-rw-r--r--part/qdom_add.h80
-rw-r--r--po/Makefile.am6
-rw-r--r--po/de.po1519
-rw-r--r--po/fr.po1469
-rw-r--r--po/pl.po1838
-rw-r--r--subdirs4
205 files changed, 25530 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..5e0ccde
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,4 @@
+Lumir Vanek <lvanek@users.sourceforge.net>
+Olaf Hartig <hartig@users.sourceforge.net>
+Mateusz Korniak <matkor@users.sourceforge.net>
+Adam Charytoniuk <a_charytoniuk@users.sourceforge.net> \ No newline at end of file
diff --git a/CODING b/CODING
new file mode 100644
index 0000000..6946486
--- /dev/null
+++ b/CODING
@@ -0,0 +1,91 @@
+NAMING CONVENTIONS
+==================
+
+CLASS NAMES
+
+Class names follow Qt and KDE schema, with KXE or KXMLEditor prefix:
+KXE....Dialog, KXE....View, KXE....Command for longer names.
+examples: KXESpecProcInstrDialog
+
+or
+
+KXMLEditor.... for short names
+examples: KXMLEditorShell, KXMLEditorShellIface, KXMLEditorAboutData,
+KXMLEditorPart
+
+
+VARIABLES
+
+(1) prefixes for variable names
+p - for pointer
+psz - for "char *" and "const char *" (zero-terminated usally)
+str - for QString objects
+b - for booleans
+i - for integers
+dlg - for dialogs
+pDlg - for pointers to dialogs
+cmd - for commands
+pCmd - for pointers to commands
+
+(2) prefixes for member variables
+Member variables should use the prefixes defined above but should additionally
+be prefixed with "m_" or "s_", if they are static.
+
+Example:
+ m_pDlgConfig - the member variable is a pointer to a dialog
+
+(3) prefixes for member functions
+sig - for signals
+slot - for (normal) slots
+slotAct - for slots connected to actions
+
+COMMENTS
+
+Comments in header files should stick to the rules for KDoc / Doxygen.
+Comments in CPP-files should use only the new C++-style comments // to make
+it possible to comment whole functions by using the C-style comments /* ... */.
+
+SOURCE FORMAT
+
+The source should be formatted in ANSI style and should be intended with tabs,
+like in the following example (use the "Show tabs" option or something similar
+in your editor to see the tabs):
+
+namespace foospace
+{
+ int Foo()
+ {
+ if (isBar)
+ {
+ bar(); // this is a
+ // very long comment
+ return 1;
+ }
+ else
+ return 0;
+ }
+}
+
+ADDING NEW FILES
+================
+
+Adding a new file to our project requires the following:
+
+* creating it in our source tree
+* adding it to the file Makefile.am in the subdirectory of the new file
+ - all files have to be added to the EXTRA_DIST variable
+ - all *.cpp and *.ui files have to be added to the *_SOURCES variable
+ - all *.h files have to be added to the noinst_HEADERS variable
+* remove old dependencies
+ Normally removing the .deps and .libs subdirectories should do. If the application
+ crashs later due to missing symbols, you have to come back to this point and do
+ make clean
+ make distclean
+* in the project's root dir call
+ make -f Makefile.dist
+ ./configure
+ make
+ make install (as root)
+* test the application
+* add the new file to CVS
+* commit the new file to CVS
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..c7aea18
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,280 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, 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
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..ceece31
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,1269 @@
+
+
+*********************************************************************
+* *
+* 1.1.4 Stable released *
+* *
+*********************************************************************
+
+12.12.2004, Lumir Vanek
+=======================
+1) Updated /admin with latest kde-common/admin contents
+
+12.11.2004, Olaf Hartig
+=======================
+1) Switched the default item insert point to "at bottom" for the "New Element", "New Proc.Instr." and "New CData" dialogs.
+
+21.10.2004, Olaf Hartig
+=======================
+1) Implemented feature request #1044396 "Reload function".
+
+20.10.2004, Olaf Hartig
+=======================
+1) Fixed a little usability bug. Tabbing between the widgets work (better) now (all unvisible widgets reject focus on tab).
+2) Fixed the bug mentioned in feature request #1049159 "Keyboard shortcut for closing the "Edit XML as raw text" win".
+
+19.10.2004, Olaf Hartig
+=======================
+1) Implemented feature request #1048738 "F2 button for editing text content".
+
+14.09.2004, Lumir Vanek
+=======================
+1) Added fix_paths script to fix hardcoded paths in files generated by dcopidl2cpp
+
+*********************************************************************
+* *
+* 1.1.3 Stable released *
+* *
+*********************************************************************
+
+12.09.2004, Lumir Vanek
+=======================
+1) Added french translation maded by Christophe Crier, www.heolys.com
+2) Fixed bug [ 988587 ] Non-existent files from cmdline cause silent quit
+
+18.08.2004, Lumir Vanek
+=======================
+1) Removed check for special characters in KXECharDataDialog::checkContents
+
+*********************************************************************
+* *
+* 1.1.2 Stable released *
+* *
+*********************************************************************
+
+08.08.2004, Lumir Vanek
+=======================
+1) Set raw XML editboxes to PlainText, instead to Auto, to avoid
+ unnecessary special character conversions.
+2) Moved rest of actions and KCommandHistory from doc to part.
+
+08.08.2004, Lumir Vanek
+=======================
+1) Moved actions for Save/SaveAs, Cut/Copy/Paste from Shell to Part,
+ where is better place for them. Started testing Quanta plugin.
+
+
+*********************************************************************
+* *
+* 1.1.1 Stable released *
+* *
+*********************************************************************
+
+08.07.2004, Lumir Vanek
+=======================
+1) Added Wrap on/off to text view configuration page
+
+17.07.2004, Lumir Vanek
+=======================
+1) Applied patch kxmleditor-1.1.0-gcc34.patch, Bugzilla Bug 57019 kxmleditor 1.1.0 fails
+ (http://bugs.gentoo.org/show_bug.cgi?id=57019)
+
+11.07.2004, Lumir Vanek
+=======================
+1) Applied patch #988560 Default to UTF-8 for new files
+2) Applied patch #988558 Desktop entry cleanup
+3) Applied patch #958302 Avoid warning on startup
+4) Applied patch #958301 Avoid deprecation warnings
+5) Changed 4 occurence of SLOT(0) to 0 in KXEShellManager *KXMLEditorShell
+
+*********************************************************************
+* *
+* 1.1.0 Stable released *
+* *
+*********************************************************************
+
+
+09.07.2004, Lumir Vanek
+=======================
+1) Updated version info in .ui files to 3.3
+2) Commented time meassuring in KXMLEditorPart::slotDocOpened()
+
+06.07.2004, Lumir Vanek
+=======================
+1) Fixed bug reported by Robin Rosenberg : when opened XML without specified encoding, default must be used (UTF-8)
+
+01.06.2004, Lumir Vanek
+=======================
+1) Minor fixes in documentation
+2) Fixed bug [ 946229 ] Element name cannot start with 'xml' or 'XML'?
+
+28.04.2004, Lumir Vanek
+=======================
+1) Added support for opening compressed SVG - svgz files to KXEDocument::open(...)
+
+27.04.2004, Lumir Vanek
+=======================
+1) Improved syntax highlighter to highlight multiline comment
+2) Increased max KXmlEditorComboAction items count from 5 to 15
+3) Added *.svg to supported file types
+
+11.04.2003, Lumir Vanek
+=======================
+1) Set active target
+2) Added check to KXMLEditorShell::setPart, last line connecting to NULL variable m_windowMenu
+
+26.03.2004, Olaf Hartig
+=======================
+1) Changed the code in KXE_TreeView::updateNodeMoved to remove the calls of
+ KListViewItem::moveItem, because this function is marked as deprecated
+ in the KDE API.
+2) Implemented the "create tree view items on demand" feature, that speeds
+ the loading of deep nested XML documents. This feature can be enabled/disabled
+ in the configuration dialog. Take a look at KXMLEditorPart::slotDocOpened to
+ learn about measuring the feature's advantage in loading time.
+3) Fixed a performance bug with opening documents in KXEDocument::open and
+ (temporary) introduced code to measure the difference.
+
+19.02.2004, Adam Charytoniuk
+=======================
+1) Introduction of document/view model. Started...
+2) New shell actions and new menu "Window".
+3) Updated pl.po file
+
+18.02.2004, Olaf Hartig
+=======================
+1) Finished the german localization.
+
+12.02.2003, Lumir Vanek
+=======================
+1) Removed kxmledtor.kdevprj from Makefile.am.
+
+10.02.2004, Olaf Hartig
+=======================
+1) Switched the project to be a KDevelop 3 project.
+
+08.02.2003, Adam Charytoniuk
+=======================
+1) Update of pl.po translation file
+
+05.02.2004, Olaf Hartig
+=======================
+1) Fixed a usability problem with a useless messagebox appearing, when the users wants to edit the properties of the special proc.instr.
+2) Removed several inconsisties with tooltips and What's This help in dialogs and configuration pages.
+
+04.02.2004, Adam Charytoniuk
+========================
+1) Added file for polish translation, translation started.
+
+02.02.2004, Olaf Hartig
+=======================
+1) Fixed the problems with our/KDE's localization framework.
+2) Added a file for the german translation.
+
+*********************************************************************
+* *
+* 1.0.0 Stable released *
+* *
+*********************************************************************
+
+
+24.01.2003, Adam Charytoniuk
+=======================
+1) New icons for application
+2) TODO updated
+
+25.01.2003, Lumir Vanek
+=======================
+1) Used KTempFile when compressed file open, instead of temporary.tmp
+
+20.01.2003, Lumir Vanek
+=======================
+1) Touched dialogs and tested compiling and making RPM on KDE 3.2 RC1. Successfull.
+
+17.01.2003, Lumir Vanek
+=======================
+1) Added Element indentation to text view setting
+2) Adjusted columns in KXE_ViewAttributes::slotChange
+
+10.01.2003, Lumir Vanek
+=======================
+1) Applyied patch [ 827616 ] "freedesktop.org desktop entry tweak" to kxmleditor.desktop
+
+*********************************************************************
+* *
+* 0.9.2 Beta released *
+* *
+*********************************************************************
+
+
+10.01.2003, Lumir Vanek
+=======================
+1) Renamed following dialogs in .kdevprj file:
+ ./part/kxeelementdialogbase.ui
+ ./part/kxeattributedialogbase.ui
+ ./part/kxechardatadialogbase.ui
+ ./part/kxesearchdialogbase.ui
+ ./part/kxechoosestringdialogbase.ui
+ ./part/kxeprocinstrdialogbase.ui
+ ./part/kxespecprocinstrdialogbase.ui
+2) Checked those dialogs if What's This help exist, and added it, if not.
+
+06.01.2004, Olaf Hartig
+=======================
+1) Removed the old configuration framework and the corresponding files:
+ ./part/confpage_defaults.ui
+ ./part/confpage_text_editor.ui
+ ./part/confpage_print.ui
+ ./part/confpage_treeview.ui
+ ./part/confpage_targzext.ui
+ ./part/confpage_xml.ui
+ ./part/dlgconfiguration.h
+ ./part/dlgconfiguration.cpp
+
+*********************************************************************
+* *
+* 0.9.1 Beta released *
+* *
+*********************************************************************
+
+03.01.2003, Lumir Vanek
+=======================
+1) Disabled m_pActEditRawXml when element is not selected
+2) Allowed to paste element with subtree to empty document
+3) Fixed bug in KXE_TreeViewItem. It's destructor not inform your nextSibling about deleting *this*,
+ and siblings m_pPrevSibling pointed to deleted KXE_TreeViewItem. I hope, this fixing bug #858730.
+4) Fixed another bug in KXE_TreeViewItem::lastChild(). It returned 0, if more than one lastChild() exists.
+5) Registered renamed files in KDevelop project
+6) Attribute name invalid characters set same as element
+
+02.01.2004, Adam Charytoniuk
+==============================
+1) Small compiler warnings removal started.
+
+31.12.2003, Olaf Hartig
+=======================
+1) Added What's This help to the configuration dialog's pages.
+
+30.12.2003, Olaf Hartig
+=======================
+1) Split the tree view configuration setting "enable drag and drop" to "enable dragging" and "enable dropping" and implemented the usage of these settings in the tree view.
+2) Updated the .cvsignore files.
+
+29.12.2003, Olaf Hartig
+=======================
+1) Renamed the files (containing stuff for dialog classes)
+ ./part/dlgxmlprocinstrbase.ui
+ ./part/dlgxmlprocinstr.h
+ ./part/dlgxmlprocinstr.cpp
+ ./part/dlgsearchbase.ui
+ ./part/dlgsearch.h
+ ./part/dlgsearch.cpp
+ ./part/dlgxmlspecprocinstrbase.ui
+ ./part/dlgxmlspecprocinstr.h
+ ./part/dlgxmlspecprocinstr.cpp
+ ./part/dlgxmlelementbase.ui
+ ./part/dlgxmlelement.h
+ ./part/dlgxmlelement.cpp
+ ./part/dlgxmlattributebase.ui
+ ./part/dlgxmlattribute.h
+ ./part/dlgxmlattribute.cpp
+ ./part/dlgxmlchardatabase.ui
+ ./part/dlgxmlchardata.h
+ ./part/dlgxmlchardata.cpp
+ ./part/dlgxmlattachbase.ui
+ ./part/dlgchoosestringbase.ui
+ ./part/dlgchoosestring.h
+ ./part/dlgchoosestring.cpp
+ ./part/dlgfilenew.h
+ ./part/dlgfilenew.cpp
+ to
+ ./part/kxeprocinstrdialogbase.ui
+ ./part/kxeprocinstrdialog.h
+ ./part/kxeprocinstrdialog.cpp
+ ./part/kxesearchdialogbase.ui
+ ./part/kxesearchdialog.h
+ ./part/kxesearchdialog.cpp
+ ./part/kxespecprocinstrdialogbase.ui
+ ./part/kxespecprocinstrdialog.h
+ ./part/kxespecprocinstrdialog.cpp
+ ./part/kxeelementdialogbase.ui
+ ./part/kxeelementdialog.h
+ ./part/kxeelementdialog.cpp
+ ./part/kxeattributedialogbase.ui
+ ./part/kxeattributedialog.h
+ ./part/kxeattributedialog.cpp
+ ./part/kxechardatadialogbase.ui
+ ./part/kxechardatadialog.h
+ ./part/kxechardatadialog.cpp
+ ./part/kxeattachdialogbase.ui
+ ./part/kxechoosestringdialogbase.ui
+ ./part/kxechoosestringdialog.h
+ ./part/kxechoosestringdialog.cpp
+ ./part/kxefilenewdialog.h
+ ./part/kxefilenewdialog.cpp
+
+28.12.2003, Adam Charytoniuk
+=============================
+1) Warning free code in kxmleditorpart.cpp file
+
+28.12.2003, Olaf Hartig
+=======================
+1) Added the function updatePage to all configuration setting groups and fixed a little bug that occured during the creation of their pages.
+2) Implemented the missing case of using the new configuration framework (see yesterdays entry).
+
+27.12.2003, Olaf Hartig
+=======================
+1) Implemented usage of the new configuration framework in all cases except one (this one is a little bit more difficult - I'm working on it).
+
+24.12.2003, Lumir Vanek
+=======================
+1) Registered KXE...Settings files in KDevelop
+
+23.12.2003, Olaf Hartig
+=======================
+1) Added the following classes for the new configuration framework:
+ - KXEConfiguration (files: kxeconfiguration.h, kxeconfiguration.cpp)
+ - KXESettings (files: kxesettings.h, kxesettings.cpp)
+ - KXETreeViewSettingsPage (files: kxetreeviewsettingspage.ui)
+ - KXETreeViewSettings (files: kxetreeviewsettings.h, kxetreeviewsettings.cpp)
+ - KXENewFileSettingsPage (files: kxenewfilesettingspage.ui)
+ - KXENewFileSettings (files: kxenewfilesettings.h kxenewfilesettings.cpp)
+ - KXEPrintSettingsPage (files: kxeprintsettingspage.ui)
+ - KXEPrintSettings (files: kxeprintsettings.h, kxeprintsettings.cpp)
+ - KXEArchiveExtsSettingsPage (files: kxearchiveextssettingspage.ui)
+ - KXEArchiveExtsSettings (files: kxearchiveextssettings.h, kxearchiveextssettings.cpp)
+2) Implemented the initialization of the new conf. framework in our factory.
+3) Added the configuration settings group for the text view and the corresponding dialog page. New classes:
+ - KXETextViewSettingsPage (file: kxetextviewsettingspage.ui)
+ - KXETextViewSettings (files: kxetextviewsettings.h, kxetextviewsettings.cpp)
+
+*********************************************************************
+* *
+* 0.9.0 Beta released *
+* *
+*********************************************************************
+
+
+22.12.2003, Lumir Vanek
+=======================
+1) Finished KXESyntaxHighlighter
+2) Updated documentation
+3) Added "new" symbol to char data icons
+4) Incremented version to 0.9
+
+21.12.2003, Adam Charytoniuk
+===============================
+1) Positions of splitters are saved and restored from config.
+2) inserting element action is disabled when processing instruction is selected
+3) splitters are working smoothly
+
+21.12.2003, Lumir Vanek
+=======================
+1) Enhanced KXESyntaxHighlighter
+2) Removed ConfPage_SpecChars from project
+3) Added ConfPage_TextEditor to project
+
+20.12.2003, Lumir Vanek
+=======================
+1) Finished KXEEditRawXmlCommand
+2) Finished KXETextEditorDialog
+
+20.12.2003, Adam Charytoniuk
+===============================
+1) Adding kxmleditorpart actions to configurable shortcut dialog.
+2) Mailing documents action added.
+3) Correcting background in a path toolbar label
+
+16.12.2003, Lumir Vanek
+=======================
+1) Added kxesyntaxhighlighter.cpp to Makefile.am
+
+16.12.2003, Adam Charytoniuk
+============================
+1) correction of Makefile.am in part directory
+2) KXEDeleteNodeCommand remembers it's sibling node now
+
+15.11.2003, Olaf Hartig
+=======================
+1) Appended the section "ADDING NEW FILES" to ./CODING
+2) Fixed bug in KXMLEditorShell::slotFileSaveAs resulting in wrong filename extensions.
+3) Moved of the filter for file dialogs from the header- to the sourcefile.
+
+14.12.2003, Lumir Vanek
+=======================
+1) Started implementing KXETextEditorDialog and KXESyntaxHighlighter
+
+*********************************************************************
+* *
+* 0.8.5 Beta released *
+* *
+*********************************************************************
+
+
+13.12.2003, Adam Charytoniuk
+============================
+1) bug with enabling Paste instead of Print action in shell contructor corrected.
+2) Apropriate captions for Insert Text, Insert CDATA, Insert Comment dialogs.
+3) slotTextChanged and slotFindInChanged in KXESearchDialog changed into virtual (like in base class)
+
+13.12.2003, Lumir Vanek
+=======================
+1) Added attribute checking, KXEAttributeDialog::slotNameChanged, ...
+2) Changed XML path information to more like XPATH standart
+3) Added new types to File Open/Save dialogs
+4) Resolved problem with proc. instr. in path bar
+
+12.12.2003, Lumir Vanek
+=======================
+1) Added character data checking, KXECharDataDialog::checkContents
+2) Added proc. instr. checking, KXEProcInstrDialog::slotTargetChanged, slotDataChanged
+
+09.12.2003, Adam Charytoniuk
+============================
+1) New actions for Insert Text, Insert CDATA, Insert Comment
+
+07.12.2003, Lumir Vanek
+=======================
+1) Renamed dialog classes, incremented version number
+2) Implemented paste Commands
+3) Implemented d&d undo/redo
+4) Added element name checking: KXEElementDialog::checkElementName
+5) Added element name checking to inplace element editing
+
+06.12.2003, Lumir Vanek
+=======================
+1) Implemented KXEEditCharDataCommand, KXEEditProcInstrCommand, KXEEditElementCommand
+2) Implemented KXEEditAttrNameCommand, KXEEditAttrValueCommand, KXEDeleteAllAttribCommand
+
+02.12.2003, Adam Charytoniuk
+=============================
+1) Implemented KXEVersionEncodingCommand
+
+30.11.2003, Lumir Vanek
+=======================
+1) Implemented KXEDeleteNodeCommand, KXEDeleteAttrCommand, KXEUpCommand, KXEDownCommand
+
+29.11.2003, Lumir Vanek
+=======================
+1) Added comands.h/cpp files to KDevelop project file (register it) to
+ display class names in tree
+2) Fixed bug in KXEStylesheetDetachCommand. Code for execute was mistakely placed
+ to destructor, and code for unexecute was in execute.
+3) Implemented KXEElementCommand, KXECharDataCommand, KXEProcInstrCommand, KXEAttributeCommand.
+
+
+26.11.2003, Lumir Vanek
+=======================
+1) Changes message "Pleasse use menu item XML -> Version and encoding ..." to "... File -> ..."
+
+24.11.2003, Adam Charytoniuk
+============================
+1) Undo/Redo framework added. KCommandHistory is now used in kxmleditorpart.
+
+24.11.2003, Adam Charytoniuk
+============================
+1) error in updateActions() detected & corrected - this was cause of crash when working in read-only mode.
+2) actions rearranged
+
+*********************************************************************
+* *
+* 0.8.4 Beta released *
+* *
+*********************************************************************
+
+20.11.2003, Adam Charytoniuk
+============================
+1) Updating some actions in XML menu after file is opened.
+2) Corrected Makefile.am in icons directory (previously also icons from local source directory were removed during uninstall)
+
+16.11.2003, Olaf Hartig
+=======================
+1) Removed the default name "Untitled" for new documents and changed the checks
+ for it. They use KURL::isEmpty now (it's more standard).
+2) Chanced the dates in the copyright notes in every sourcefile (*.h, *.cpp).
+
+15.11.2003, Lumir Vanek
+=======================
+1) Fixed KXMLEditorPart::openFile() and saveFile() - opening and saving compressed files.
+ New KOffice use KZip instead of KTarGz for storing files.
+2) Added Adam to developers list and increment version to 0.8.4
+
+13.11.2003, Adam Charytoniuk
+============================
+1) Controls on some dialogs have been rearranged, Tab order was corrected
+2) The order in which top-level processing instructions are enetered is as follows:
+ <?xml?> // special proc instruction
+ <? .... ?> // whatever top-level proc instruction, e.g. <? xml-stylesheet ?>
+ <document-element ...>
+
+13.11.2003, Olaf Hartig
+=======================
+1) Changed the behavior of opening a file to the SDI paradigm. This means, if the current shell doesn't contain a new and unmodified part, a new shell is created to open the file in.
+2) Fixed bug [ 835971 ] opening files is blocked
+ ( I left the test for being modified in KXMLEditorPart::openFile, but due to new behavior of opening files this test should never succeed. )
+
+11.11.2003, Olaf Hartig
+=======================
+1) Since KXMLEditorShell::slotFileNew always crashed (for me), I changed it. Additional advantage of the new code: the declaration of our part isn't needed (explicitly) in the shells definition anymore.
+2) Added the file CODING, which defines coding guidelines (these are conventions for variable names, comments and source format).
+
+10.11.2003, Adam Charytoniuk
+============================
+1) Attaching / detaching schemas for xml files
+2) Attaching / detaching stylesheets (XSL/XSLT) for xml files
+3) Configuring behaviour when new files are created in kxmleditor configuration
+
+09.11.2003, Adam Charytoniuk
+============================
+1) Support for File->New added
+
+
+*********************************************************************
+* *
+* 0.8.3 Beta released *
+* *
+*********************************************************************
+
+
+09.11.2003, Lumir Vanek
+=======================
+1) Fixed bug [ 819229 ] annoying behaviour when adding new attributes
+2) Fixed bug [ 726776 ] bad xml encoding
+
+03.11.2003, Lumir Vanek
+=======================
+1) Fixed main menu, not contained "Delete Attribute" item.
+2) Join toolbar icon "Delete Attribute" to function "Delete Attribute" istead of "Delete all Attributes"
+3) Added question before deleting all attributes
+4) Implemented in-place attribute names editing
+
+03.11.2003, Olaf Hartig
+=======================
+1) Added keyboard accelerators to our dialogs.
+2) Added the possibility to edit proc. instructions with double click (analog to the problem resolved by Lumir on 01.11.2003)
+
+01.11.2003, Lumir Vanek
+=======================
+1) Resolved problem "Double click for editing character data"
+
+29.07.2003, Olaf Hartig
+=======================
+1) Fixed the toolbar problems.
+
+23.07.2003, Lumir Vanek
+=======================
+1) Trying to fix problem with configuring main toolbar. I will continue discovery this problem
+
+13.07.2003, Lumir Vanek
+=======================
+1) Finished dialog DlgXMLSpecProcInstr for editing spec. proc. instr.
+
+10.07.2003, Lumir Vanek
+=======================
+1) Updated /admin for KDevelop 2.1.5
+
+06.07.2003, Lumir Vanek
+=======================
+1) Created dialog DlgXMLSpecProcInstr for proc. instruction: <?xml ... ?>
+
+
+*********************************************************************
+* *
+* 0.8.1 Beta released *
+* *
+*********************************************************************
+
+
+13.01.2003, Lumir Vanek
+=======================
+Fixed some losted edit lines in dialogs. Qt designer bug ?
+
+02.12.2002, Lumir Vanek
+=======================
+1) Fixed some compilation warnings
+
+07.11.2002, Olaf Hartig
+=======================
+1) Implemented the possibility to use namespaces for XML elements.
+
+14.10.2002, Lumir Vanek
+=======================
+1) Fixed dlgsearchbase.ui layout
+
+10.09.2002, Olaf Hartig
+=======================
+1) Fixed g++ 3.2 compile problem (#605853 - see sourceforge project page), removed the default arguments from ./part/dlgxmlattribute.cpp
+
+20.08.2002, Olaf Hartig
+=======================
+1) Added the possibility to have proc.instr. as root nodes.
+2) Added the write-actions to the tree views context menus.
+
+02.08.2002, Lumir Vanek
+=======================
+1) Inserted Find icon to toolbar
+2) After opening XML file, pathbar combo is cleared
+3) After selecting nonexists item in pathbar combo, item is removed from combo
+4) Fixed KXMLEditorPart::slotXmlElementDelete(). After deleting root element, Insert Element was disabled
+
+
+*********************************************************************
+* *
+* 0.8 Beta released *
+* *
+*********************************************************************
+
+25.07.2002, Olaf Hartig
+=======================
+1) Added the files ./part/actions.h and ./part/actions.cpp to the KDevelop project file.
+
+
+23.07.2002, Olaf Hartig
+=======================
+1) Forgot to remove ./kxmleditor/kxmleditorui.rc from ./kxmleditor/Makefile.am
+
+22.07.2002, Lumir Vanek
+=======================
+1) Removed rest of debugging code from DlgXMLElement::fillElement
+2) Changed version number to 0.8
+
+22.07.2002, Olaf Hartig
+=======================
+1) Removed the old KXMLEditor code. Therefore removed the following files from CVS:
+ ./kxmleditor/actions.cpp
+ ./kxmleditor/actions.h
+ ./kxmleditor/choosestringdlg.cpp
+ ./kxmleditor/choosestringdlg.h
+ ./kxmleditor/choosestringdlgbase.ui
+ ./kxmleditor/dcopiface_app.cpp
+ ./kxmleditor/dcopiface_app.h
+ ./kxmleditor/kxmleditor.cpp
+ ./kxmleditor/kxmleditor.h
+ ./kxmleditor/kxmleditoractions.h
+ ./kxmleditor/kxmleditordoc.cpp
+ ./kxmleditor/kxmleditordoc.h
+ ./kxmleditor/kxmleditorui.rc
+ ./kxmleditor/kxmleditorview.cpp
+ ./kxmleditor/kxmleditorview.h
+ ./kxmleditor/optionsdialog.cpp
+ ./kxmleditor/optionsdialog.h
+ ./kxmleditor/searchdlg.cpp
+ ./kxmleditor/searchdlg.h
+ ./kxmleditor/searchdlgbase.ui
+ ./kxmleditor/tablewidget.cpp
+ ./kxmleditor/tablewidget.h
+ ./kxmleditor/xml_base.cpp
+ ./kxmleditor/xml_base.h
+ ./kxmleditor/xmlattributedlg.cpp
+ ./kxmleditor/xmlattributedlg.h
+ ./kxmleditor/xmlattributedlgbase.ui
+ ./kxmleditor/xmlcontentsdlg.cpp
+ ./kxmleditor/xmlcontentsdlg.h
+ ./kxmleditor/xmlcontentsdlgbase.ui
+ ./kxmleditor/xmlelementdlg.cpp
+ ./kxmleditor/xmlelementdlg.h
+ ./kxmleditor/xmlelementdlgbase.ui
+ ./kxmleditor/xmlprocinsdlgbase.ui
+ ./kxmleditor/xmlprocinstrdlg.cpp
+ ./kxmleditor/xmlprocinstrdlg.h
+ ./kxmleditor/xmlstructureparser.cpp
+ ./kxmleditor/xmlstructureparser.h
+ ./kxmleditor/xmltreeview.cpp
+ ./kxmleditor/xmltreeview.h
+
+22.07.2002, Lumir Vanek
+=======================
+1) Documentation updated
+2) Modified KXMLEditorPart::saveFile() for several encodings
+
+19.07.2002, Olaf Hartig
+=======================
+1) Added inplace editing for attribute values to the attribute view (KXE_ViewAttributes).
+
+18.07.2002, Olaf Hartig
+=======================
+1) Implemented the dialog for defining XML attributes (class: DlgXMLAttribute)
+2) Implemented the possiblity to add attributes to XML elements.
+3) Added the possibility to request context menus to the part (KXMLEditorPart::slotContextMenuRequested).
+4) Added context menus to the attributes view.
+5) Modified the tree view (KXE_TreeView) to use the parts new context menu request possibility.
+6) Added the action "Delete All Attributes" to the part.
+7) Added the action "Delete Attribute" to the part.
+
+12.07.2002, Olaf Hartig
+=======================
+1) Added the files
+ ./part/dlgxmlattributebase.ui
+ ./part/dlgxmlattribute.h
+ ./part/dlgxmlattribute.cpp
+
+11.07.2002, Olaf Hartig
+=======================
+1) Removed KXE_TreeView::sigItemRenamedInplace since it's useless.
+2) Implemented the read only stuff for the attributes view (KXE_ViewAttributes).
+
+10.07.2002, Olaf Hartig
+=======================
+1) Fixed little issues:
+ - the shell doesn't has to know exactly about it's part (it's simply a KParts::ReadWritePart)
+ - changed the type of KXMLEditorShell::m_pPart to KParts::ReadWritePart*
+
+04.07.2002, Lumir Vanek
+=======================
+1) Fixed bug in drap&drop - moved item wasn't properly deleted
+
+28.06.2002, Lumir Vanek
+=======================
+1) Handle with Untitled document
+
+25.06.2002, Olaf Hartig
+=======================
+1) Updated ./part/pics/Makefile.am for Lumirs new icons.
+
+25.06.2002, Lumir Vanek
+=======================
+1) Finished implementing Save/Save As
+2) Painted icons for bookmarked items and use it
+3) Found bug - pressing "Prev bookbark" on first bookmarked item caused crash.
+ Fixed two KXE_TreeViewItem constructors to initialize m_pPrevSibling = 0.
+
+24.06.2002, Olaf Hartig
+=======================
+1) Added the files
+ - ./part/dlgchoosestringbase.ui
+ - ./part/dlgchoosestring.h
+ - ./part/dlgchoosestring.cpp
+
+24.06.2002, Lumir Vanek
+=======================
+1) Started implementing Save/Save As
+2) Modified Open code for compressed files
+
+20.06.2002, Lumir Vanek
+=======================
+1) Continue implementing Cut/Copy/Paste
+2) Started implementing Drag&Drop
+
+14.06.2002, Olaf Hartig
+=======================
+1) Commented everything for the XML and the special characters page in the parts configuration dialog because it is not needed for the part using only DOM parser.
+
+13.06.2002, Olaf Hartig
+=======================
+2) Implemented the correct behaviour for changing elements tag names via inplace-renaming in the parts tree view.
+
+13.06.2002, Lumir Vanek
+=======================
+1) Implemented KXMLEditorPart::slotEditCopy()
+2) Extended the KXMLEditorBrowserExtension class and implemented KXMLEditorShell to serve this browser extension as templates the actions "Edit Paste" without really implementing these actions.
+3) Implemented Cut/Copy/Paste for XML elements
+
+
+13.06.2002, Olaf Hartig
+=======================
+1) Fixed several little problems/bugs with the part
+ - quitting the app didn't care about modified documents (./kxmleditor/kxmleditorshell.cpp)
+ - merging in the shells main toolbar (./kxmleditor/kxmleditorshell.rc) and in ./part/kxmleditorpartBrowseUI.rc
+ - disabled word wraping for editboxes in the dialogs DlgXMLCharData (./part/dlgxmlchardatabase.ui) and DlgXMLProcInstr (./part/dlgxmlprocinstrbase.ui)
+ - changed the contents and proc.instruction view from QMultiLineEdit to QTextEdit (since QMultiLineEdit is obsolete in Qt3) and disabled wordwraping (./part/kxmleditorpart.cpp ./part/kxmleditorpart.h )
+ - changing a content element or a proc.instruction didn't updated the corresponding view immediately (./part/kxmleditorpart.cpp)
+
+12.06.2002, Olaf Hartig
+=======================
+1) Extended the KXMLEditorBrowserExtension class and implemented KXMLEditorShell to serve this browser extension as templates the actions "Edit Cut" and "Edit Copy" without really implementing these actions.
+2) Changed the proc.instruction view from KXE_ViewProcInstr to QMultiLineEdit.
+ therefore removed the files
+ ./part/kxe_viewprocinstr.cpp
+ ./part/kxe_viewprocinstr.h
+3) Changed the dialog DlgXMLProcInstr to use a multiline editbox for the processing instruction.
+4) Little change to the tree items representing porc.instructions - they now show only the target.
+5) Little bugfix - the icon for proc.instruction wasn't installed.
+
+9.6.2002, Lumir Vanek
+=====================
+1) Fixed problem with saving mixed elements + texts, xml_base.cpp - XmlElement::save. Bug reported by Ralf Ruth <ralf.ruth@gmx.de>
+
+
+28.05.2002, Olaf Hartig
+=======================
+1) Applied patch (#559922 - see sourceforge project page) from Robin Green to fix gcc 3.1 compile problems.
+2) Fixed bug (#556148 - see sourceforge project page) reported by R.F.Pels which removes the undefined symbol DlgXMLProcInstr::fillProcInstr
+3) Fixed a bug causing the part to crash in read only mode
+
+06.05.2002, Olaf Hartig
+=======================
+1) Added the actions "Move XML Node Up" and "Move XML Node Down" to the part
+2) Added automatic selection of created/changed/moved tree view items to the part
+3) Added enabling/disabling of the XML actions depending on the selected node
+
+
+*********************************************************************
+* *
+* 0.7.2 Beta released (USE_KPART 0) *
+* *
+*********************************************************************
+
+
+06.05.2002, Olaf Hartig
+=======================
+1) Implemented the class DlgXMLCharData
+2) Added the actions "Insert New Character Data", "Edit Character Data" and "Delete Character Data" to the part
+3) Fixed two little bugs with comment nodes
+
+25.04.2002, Olaf Hartig
+=======================
+1) Added the files
+ - ./part/dlgxmlchardatabase.ui
+ - ./part/dlgxmlchardata.h
+ - ./part/dlgxmlchardata.cpp
+
+24.04.2002, Olaf Hartig
+=======================
+1) Added the files
+ - ./part/dlgxmlprocinstrbase.ui
+ - ./part/dlgxmlprocinstr.h
+ - ./part/dlgxmlprocinstr.cpp
+2) Implemented the class DlgXMLProcInstr
+3) Changed the tab sequence of the parts XML element dialog
+4) Changed the tab sequence of the parts proc. instruction dialog
+5) Added the actions "Insert New Proc.Instruction", "Edit Proc.Instruction" and "Delete Proc.Instruction" to the part
+
+23.04.2002, Olaf Hartig
+=======================
+1) Developed the new slots
+ - KXE_TreeView::slotUpdateNodeChanged
+ - KXE_TreeView::slotUpdateNodeCreated
+ - KXE_TreeView::slotUpdateClear
+ which change or create new treeview items.
+2) Changed the code implementation of the "Insert New Element" and "Edit Element" actions, to use the new slots.
+3) Developed the new slot
+ - KXE_TreeView::slotUpdateNodeDeleted
+ which deletes treeview items corresponding to the deleted nodes.
+4) Added the "Delete Element" action to the part
+5) Slightly changed KXE_TreeView::selectNode
+
+19.04.2002, Olaf Hartig
+=======================
+1) Added parameter checking to DlgXMLElement functions to prevent crashes
+
+18.04.2002, Olaf Hartig
+=======================
+1) Extended DlgXMLElement dialog to append elements autonomous to their parents.
+
+17.04.2002, Olaf Hartig
+=======================
+1) Created a dialog for editing of XML elements for the part
+ New files:
+ - ./part/dlgxmlelementbase.ui
+ - ./part/dlgxmlelement.h
+ - ./part/dlgxmlelement.cpp
+2) Added the "Insert New Element" action to the part
+3) Slightly changed DlgXMLElement and commented this class
+4) Changed the name of KXMLEditorPart::slotXmlInsertElement to KXMLEditorPart::slotXmlElementInsert
+ (more consistent in my eyes)
+5) Fixed a little bug in KXMLEditorPart::slotXmlElementInsert
+ (Even pressing cancel in the XML element dialog made the document modified)
+6) Added the "Edit Element" action to the part
+7) Implemented window caption change (when the document was modified) to the part
+
+16.04.2002, Olaf Hartig
+=======================
+1) Splitted the XMLGUI resource file for the part (old name: ./part/kxmleditorpart.rc) into
+ ./part/kxmleditorpartBrowseUI.rc (with the read only actions) and
+ ./part/kxmleditorpartEditUI.rc (with the additionally write actions).
+ If the part is constructed as read/write part these files are merged.
+
+13.4.2002, Lumir Vanek
+=======================
+1) Added error detection, when XML is opened using QDomDocument::setContent(...)
+
+11.4.2002, Lumir Vanek
+=======================
+1) Version changed to 0.7.2, nonpublic release for KDE 3 with USE_KPART 0
+
+9.4.2002, Lumir Vanek
+======================
+1) Updated /admin subdirectory for build on KDE 3
+
+07.04.2002, Olaf Hartig
+=======================
+1) Changed the parts baseclass to KParts::ReadWritePart to start implementing write functionality.
+
+06.04.2002, Olaf Hartig
+=======================
+1) Added a statusbar to the shell.
+2) Added saving of window settings to the shell.
+3) Added the possibility to toggle the status- and the toolbar to the shell.
+4) Added the OpenRecentFiles action to the shell.
+5) Added the possibility to specify several files to be opened as command line arguments for the shell.
+6) Added session management to the shell.
+7) Added the possibility to configure key bindings and toolbars to the shell.
+
+02.04.2002, Olaf Hartig
+=======================
+1) (Re)Implemented different element display modes (no attributes, attribute names only, attribute names and values) to treeview of the part
+
+21.01.2002, Olaf Hartig
+=======================
+1) Included several Qt- and KDE-header files and changed the base class of KXMLEditorFactory (from KLibFactory to KParts::Factory) to make the whole project be compileable with KDE3
+
+20.01.2002, Olaf Hartig
+=======================
+1) (Re)Implemented the parts configuration dialog
+2) Removed ./config.h.in from CVS because it's not needed here
+
+19.1.2002, Lumir Vanek
+======================
+1) Decrease size of pixmap "locationbar_erase" on toobar to 16x16 in KXMLEditorPart::KXMLEditorPart, to make look uniform with Konqueror
+
+16.01.2001, Lumir Vanek
+=======================
+1) Fixed bug in, kxmleditorshell.cpp, KXMLEditorShell::KXMLEditorShell().
+ ...->factory("libkxmleditorpart") instead of "libkxmleditor".
+ Now application not crash after start when compiled with USE_KPART 1
+
+10.01.2002, Olaf Hartig
+=======================
+1) (Re)Implemented next/prev.bookmark action for the part.
+2) (Re)Implemented the possibility for the part to select a tree item by giving a path
+3) Added the action "Deselect" to the tree views context menus (popup menus)
+
+07.01.2002, Olaf Hartig
+=======================
+1) (Re)Implemented toggle bookmark action for the part.
+
+06.01.2002, Olaf Hartig
+=======================
+1) (Re)Implemented find and find next actions for the part. Moved the functionality from the tree view to the part itself.
+2) Added possibility to disable "Find"-button at the parts search dialog (DlgSearch) if no search-area (Find in...) is given.
+3) Removed service type "Browser/View" from ./part/kxmleditorpart.desktop
+
+05.01.2002, Olaf Hartig
+=======================
+1) Changed the parts search dialog classes (DlgSearchBase, DlgSearch) to reduce memory usage
+2) Added the functions domTool_nextNode and domTool_match (see ./part/qdom_add.h, ./part/qdom_add.cpp) for further implementation of find(next) actions to the part
+
+21.12.2001, Olaf Hartig
+=======================
+1) Fixed some issues due to yesterdays renaming of the part's class OptionsDialog to DlgConfiguration
+2) Renamed the part's class to DlgSearchBase (from SearchDlgBase)
+3) Renamed the part's class SearchDlg to DlgSearch
+4) Added the files in ./part/ to the KDevelop project file
+5) (Re)implemented KXE_TreeView::getSelectedPath()
+6) Moved the following files from ./part/ to ./part/icons/
+ lo16-app-kxmleditor.png
+ lo32-app-kxmleditor.png
+ hi32-app-kxmleditor.png
+ hi48-app-kxmleditor.png
+
+20.12.2001, Olaf Hartig
+=======================
+1) Removed ./kxmleditor/kxmleditorabout.h
+ now ./kxmleditor/main.cpp uses ./part/kxmleditorabout.h instead
+2) Renamed the following files:
+ ./part/searchdlg.cpp to ./part/dlgsearch.cpp
+ ./part/searchdlg.h to ./part/dlgsearch.h
+ ./part/searchdlgbase.ui to ./part/dlgsearchbase.ui
+ ./part/optionsdialog.h to ./part/dlgconfiguration.h
+ ./part/optionsdialog.cpp to ./part/dlgconfiguration.cpp
+
+18.12.2001, Lumir Vanek
+=======================
+1) Fixed bug: #487883 Doesn't remember filename after save as
+2) Fixed bug: #487859 Window title says [modified] after save
+3) Fixed bug: #487860 After cmdline start, win title wrong
+
+14.12.2001, Olaf Hartig
+=======================
+BIG CHANGES
+1) I rewrote the whole part stuff to have the internal data structures based on QDom. There are still some things open (marked with TODO) but it compiles and (surprise :-) works (at least here).
+2) I restructured the directory structure (new directory ./part/ now) and reworked the build system (automake stuff).
+
+07.12.2001, Olaf Hartig
+=======================
+1) Slightly changed ./kxmleditor/action.cpp to make it independend of KXMLEditor classes
+
+29.11.2001, Mateusz Korniak
+===========================
+1) Some changes in lodaing files specified by argument
+ - checking validity of given path
+ - fix loading local files ( 'kxmleditor file.xml' )
+
+31.10.2001, Olaf Hartig
+=======================
+1) Added statusbar texts to some actions of the kpart
+2) Slightly changed order of functions in ./kxmleditor/kxmleditorpart.cpp
+
+31.10.2001, Mateusz Korniak
+===========================
+1) Few changes corresponding to valuable Ole suggestions.
+
+30.10.2001, Olaf Hartig
+=======================
+1) Changed the following things corresponding to my remarks about Mateusz first commits (see thread "Remarks to current DCOP implementations" from 2001-10-30 21:50)
+ - added KXE_TreeView::getSelectedPath
+ - added KXMLEditorPart::getSelectedPath
+ - changed return type of KXMLEditorPart::slotPathSelected from bool to void (because its a slot)
+ - removed all calls of KXMLEditorPart::m_pDCOPIface functions in the part, except constructor and destructor
+ - Slightly changed KXMLEditorPartIfaceReadOnly::selectNode and KXMLEditorPartIfaceReadOnly::currentNode to use KXMLEditorPart::getSelectedPath
+2) Fixed bug in ./kxmleditor/kxmleditorshell.rc
+
+28.10.2001, Lumir Vanek
+=======================
+1) XMLEditorDoc::openDOM(QFile) - Fix for nonlatin1 symbols.
+
+
+28.10.2001, Mateusz Korniak
+===========================
+1) First code update heading for DCOP.
+2) DCOP functions proposals for: quit, loadURL, selectNode, currentNode.
+
+*********************************************************************
+* *
+* 0.7.1 Beta released *
+* *
+*********************************************************************
+
+
+25.10.2001, Lumir Vanek
+=======================
+1) Option "Append CR LF at end of line" moved to XML page, "Miscelaneous" page renamed to "Tree View".
+
+
+24.10.2001, Lumir Vanek
+=======================
+1) Modifyied script make_rpm for creating RPM from command line. Is possible to use
+ this script for create RPM instead of KDevelop.
+
+24.10.2001, Olaf Hartig
+=======================
+1) Added the following new files for DCOP interface implementation:
+ - ./kxmleditor/dcopiface_app.h
+ - ./kxmleditor/dcopiface_app.cpp
+
+23.10.2001, Olaf Hartig
+=======================
+1) Added the following new files for DCOP interface implementation:
+ - ./kxmleditor/dcopiface_part_ro.h
+ - ./kxmleditor/dcopiface_part_ro.cpp
+ - ./kxmleditor/dcopiface_shell.h
+ - ./kxmleditor/dcopiface_shell.cpp
+
+18.10.2001, Olaf Hartig
+=======================
+1) Added a shell (new class KXMLEditorShell) which embeds our kpart
+
+15.10.2001, Olaf Hartig
+=======================
+1) Added slots for the actions to the kpart itself
+2) Splitted KXmlEditorComboAction::slotClearEdit to slotFocusEdit and slotClearEdit
+3) Added deselect action to the kpart
+4) Added path toolbar to the kpart
+5) Added possibility to show proc.instr. attributes (new class KXE_ViewProcInstr) to kpart
+6) Added view of plain XML text for selected XML elements to kpart (new class KXE_ViewElement)
+
+12.10.2001, Olaf Hartig
+=======================
+1) Added configure action to the kpart
+
+11.10.2001, Olaf Hartig
+=======================
+1) Improved the behaviour of the OptionsDialog
+ - Added direct reading/saving of the configuration from/to the config file in OptionsDialog (new static functions: OptionsDialog::readConfiguration, OptionsDialog::saveConfiguration)
+ - Made the static members in OptionsDialog (the options itself) protected and added accessor functions
+ - Changed several files to use these new accessor functions
+2) Fixed a bug in OptionsDialog::slotApply
+ Changes made on an currently invisible page weren't applied, now they are
+3) Added saving of configuration to config file directly after changing it (see KXMLEditorApp::slotConfigurationChanged)
+
+7.10.2001, Lumir Vanek
+======================
+1) Replaced all files in /admin subdirectory with new ones, generated KDevelop 2.0.1
+ User manual creation now use meinproc instead of kdb2html. Index.docbook file updated.
+ Install libxml-1.8.11-53 or newer for creating doc (libxml2.rpm is available on www.suse.com).
+
+5.10.2001, Olaf Hartig
+======================
+1) Changed copyright notes for every source file
+
+*********************************************************************
+* *
+* 0.7 Beta released *
+* *
+*********************************************************************
+
+4.10.2001, Olaf Hartig
+======================
+1) Added treeitem_up action to the kpart
+2) Added enabling/disabling of actions depending on status to the kpart
+3) Added treeitem_expand and treeitem_collapse actions to the KPart treeview's context menus
+
+3.10.2001, Olaf Hartig
+======================
+1) Added context menus to the KPart's treeview
+
+29.9.2001, Olaf Hartig
+======================
+1) Added find and find_next actions to the kpart
+
+28.9.2001, Olaf Hartig
+======================
+1) Removed KXMLEditorApp::slotExpandNodeAboutToShow and KXMLEditorApp::slotCollapseNodeAboutToShow and moved their functionality to KXMLEditorApp::initActions, because it's enough to initialize the popupmenus once
+2) Fixed bug: Expanding/Collapsing treeviewitems to level 1 is now possible
+3) Minimal changes in KXMLEditorApp to use the id of the menuitems of expand/collapse popupmenus
+4) Added expand/collapse node actions to the kpart
+
+27.9.2001, Olaf Hartig
+======================
+1) Added the 3 bookmark actions and its functionality to the kpart
+
+26.9.2001, Olaf Hartig
+======================
+1) Added new file ./kxmleditor/kxmleditorpart.rc
+
+25.9.2001, Olaf Hartig
+======================
+1) New class KXMLEditorAboutData,
+ - see kxmleditorabout.h
+ - use of this new class in KXMLEditorFactory::instance and in main
+2) Added creation of attributes and contents view in the part
+ - KXMLEditorPart::m_pViewAttributes
+ - KXMLEditorPart::m_pViewContents
+3) Cosmetic changes in tablewidget.h and tablewidget.cpp
+4) Added functionality to update the attributes/contents view in the part depending on the selected treeitem
+ - KXE_TreeView::slotSelectionChanged
+ - KXE_TreeView::sigSelectionChanged( XmlElement * );
+ - KXE_TreeView::sigSelectionChanged( XmlContentsItem * )
+ - KXE_TreeView::sigSelectionChanged( XmlProcessingInstruction * )
+ - KXMLEditorPart::slotTreeSelectionChanged( XmlElement * pItem )
+ - KXMLEditorPart::slotTreeSelectionChanged( XmlContentsItem * )
+ - KXMLEditorPart::slotTreeSelectionChanged( XmlProcessingInstruction * )
+ - TableWidget::slotChange
+5) Removed ./libtool from CVS , because it isn't needed there
+
+25.9.2001, Lumir Vanek
+======================
+1) Removed KXMLEditorView::m_pSplitterVertical
+
+24.9.2001, Olaf Hartig
+======================
+1) Changed the type of XmlStructureParser::m_pListWiew from XmlTreeView * to KListView * and the corresponding constructor parameter for XmlStructureParser, XmlProcessingInstruction, XmlContentsItem and XmlElement
+2) Added first KParts code:
+ - added the files kxe_treeview.h, kxe_treeview.cpp, kxmleditorfactory.h, kxmleditorfactory.cpp, kxmleditorpart.h, kxmleditorpart.cpp and kxmleditorabout.h
+ - added lines to ./kxmleditor/kxmleditor.desktop
+ - changed ./kxmleditor/Makefile.am to make the shared library (libkxmleditor.la) and a binary (kxmleditor)
+ - changed the KDevelop Projekt Settings (./kxmleditor.kdevprj) to NOT modify the makefiles, because KDevelop can't handle making a shared lib and a binary in one project
+3) Removed the following files from CVS, because they aren't needed there:
+ ./doc/Makefile
+ ./doc/Makefile.in
+ ./doc/en/Makefile
+ ./doc/en/Makefile.in
+ ./po/Makefile
+ ./po/Makefile.in
+ ./kxmleditor/.deps
+
+23.9.2001, Lumir Vanek
+======================
+1) Implemented using DOM parser for opening XML
+
+
+22.9.2001, Lumir Vanek
+======================
+1) Prepared for using DOM parser
+
+*********************************************************************
+* *
+* 0.6 Beta released *
+* *
+*********************************************************************
+
+1.9.2001, Lumir Vanek
+======================
+1) Added feature: #449114 Show attributes in tree view
+
+26.8.2001, Lumir Vanek
+======================
+1) Fixed bug: #451510 element delete bug when Dragdrop
+2) Added feature: #449139 Open xmlfile with specified element
+3) Added feature: #449124 Shrunk mulitlined contents in tree-view
+
+26.7.2001, Lumir Vanek
+======================
+1) Changed KXMLEditorApp::m_pActions (pointer) to m_Actions (stardart member)
+
+25.7.2001, Olaf Hartig
+======================
+1) Renamed all actions in KXMLEditorApp to make them uniform
+2) Added the structure KXMLEditorActions (new file: kxmleditoractions) and moved the pointers to the actions to it. Changed KXMLEditorApp to use this new structure. (This is useful, because i want to move some of the functionality from the mainwindow to the view).
+
+24.7.2001, Olaf Hartig
+======================
+1) Clearing the path (location) bar with the toolbar button unselects the currently selected element.
+
+24.7.2001, Lumir Vanek
+======================
+1) Added special characters support. This allow define list of spec. chars, that are not converted
+ using codec, when file is saved, but it's saved as hexa string. For example french oe ligature
+ is saved as &#x153;
+
+23.7.2001, Lumir Vanek
+======================
+1) Fixed session management bug. Now XML editor load file properly, when session is restored.
+
+2) In KXmlEditorComboAction::~KXmlEditorComboAction() comented deleting m_pCombo, because
+ this cause crash every time, when app. exiting.
+
+21.7.2001, Olaf Hartig
+======================
+1) Merged the signals
+ KXMLEditorView::documentStateChanged and KXMLEditorView::selectedTreeItemChanged
+ to
+ KXMLEditorView::sigSelectedElementChanged
+ and the corresponding slots
+ KXMLEditorApp::slotDocumentStateChanged and KXMLEditorApp::slotSelectedTreeItemChanged
+ to
+ KXMLEditorApp::slotSelectedElementChanged
+
+2) Changed the information flow about the modification of the document
+ (added KXMLEditorDoc::sigModified and KXMLEditorApp::slotDocumentModified)
+
+20.7.2001, Olaf Hartig
+======================
+1) KXmlEditorComboAction handles its combobox now on its own.
+
+2) I removed the special handling of bookmarked elements in the path combobox.
+ I removed the signals KXMLEditorView::comboInsertPath and KXMLEditorView::comboRemovePath,
+ cause there's no need for them anymore.
+
+3) I renamed the actions in the path toolbar to make them uniform. Now they are:
+ path_clear
+ path_label
+ path_combo
+ The file $KDEHOME/share/apps/kxmleditor/kxmleditorui.rc needs to be removed by
+ the users.
+
+18.7.2001, Lumir Vanek
+======================
+1) Added support for XML encoding. While saving, codec selected based on
+ proc. instruction <xml encoding="xxx">.
+
+2) Transparent KOffice files handling. Added page to Configure dialog, for
+ editing list of extensions, that is TarGz files.
+
+*********************************************************************
+* *
+* Alpha *
+* *
+*********************************************************************
+
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..c5fe786
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,266 @@
+# Doxyfile 1.3.7-KDevelop
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = kxmleditor.kdevelop
+PROJECT_NUMBER = $VERSION$
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+USE_WINDOWS_ENCODING = NO
+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/lvanek/Projects/Own/kpogre/
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = 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/lvanek/Projects/Own/kxmleditor
+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 = kxmleditor.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_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 1000
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..02a4a07
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,167 @@
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes a while. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 4. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Compiling For Multiple Architectures
+====================================
+
+ You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not supports the `VPATH'
+variable, you have to compile the package for one architecture at a time
+in the source code directory. After you have installed the package for
+one architecture, use `make distclean' before reconfiguring for another
+architecture.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+ There may be some features `configure' can not figure out
+automatically, but needs to determine by the type of host the package
+will run on. Usually `configure' can figure that out, but if it prints
+a message saying it can not guess the host type, give it the
+`--host=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name with three fields:
+ CPU-COMPANY-SYSTEM
+
+See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the host type.
+
+ If you are building compiler tools for cross-compiling, you can also
+use the `--target=TYPE' option to select the type of system they will
+produce code for and the `--build=TYPE' option to select the type of
+system on which you are compiling the package.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Use and save the results of the tests in FILE instead of
+ `./config.cache'. Set FILE to `/dev/null' to disable caching, for
+ debugging `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
+
diff --git a/KXMLEditor.flw b/KXMLEditor.flw
new file mode 100644
index 0000000..9a2d854
--- /dev/null
+++ b/KXMLEditor.flw
Binary files differ
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..1fa9998
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,29 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+SUBDIRS = part kxmleditor po doc
+
+EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO kxmleditor.lsm admin
+
+####### kdevelop will overwrite this part!!! (end)############
+# not a GNU package. You can remove this line, if
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+ cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+ cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+ @cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files
+
+package-messages:
+ $(MAKE) -f admin/Makefile.common package-messages
+ $(MAKE) -C po merge
+
+dist-hook:
+ cd $(top_distdir) && perl admin/am_edit -padmin
+ cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
diff --git a/Makefile.dist b/Makefile.dist
new file mode 100644
index 0000000..be59a86
--- /dev/null
+++ b/Makefile.dist
@@ -0,0 +1,14 @@
+all:
+ @echo "This Makefile is only for the CVS repository"
+ @echo "This will be deleted before making the distribution"
+ @echo ""
+ @if test ! -d admin; then \
+ echo "Please recheckout this module!" ;\
+ echo "for cvs: use checkout once and after that update again" ;\
+ echo "for cvsup: checkout kde-common from cvsup and" ;\
+ echo " link kde-common/admin to ./admin" ;\
+ exit 1 ;\
+ fi
+ $(MAKE) -f admin/Makefile.common cvs
+
+.SILENT:
diff --git a/README b/README
new file mode 100644
index 0000000..58af37c
--- /dev/null
+++ b/README
@@ -0,0 +1,22 @@
+Thank you for downloading KXML Editor !
+
+KXML Editor is Open Source Software and developed under the GPL (see COPYING for details).
+
+====================================================================
+
+KXML Editor is KParts application, and it must be installed properly to KDE directories.
+
+Before ./configure, make and make install process, use
+
+export KDEDIR=/opt/kde3
+export QTDIR=/usr/lib/qt3
+
+Of course look where is KDE and Qt path in your system and use correct directories.
+
+If you experience startup crash, check if library libxmleditorpart.so.1.0.0
+is exists in KDEDIR/lib directory.
+
+=======================================================================
+
+Lumir Vanek
+lvanek@users.sourceforge.net \ No newline at end of file
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..a116bd7
--- /dev/null
+++ b/TODO
@@ -0,0 +1,2 @@
+Need fix:
++ documents with namespaces in attributes are not displayed properly when opened again
diff --git a/configure.files b/configure.files
new file mode 100644
index 0000000..030bce8
--- /dev/null
+++ b/configure.files
@@ -0,0 +1,2 @@
+./admin/configure.in.min
+configure.in.in
diff --git a/configure.in.in b/configure.in.in
new file mode 100644
index 0000000..9a5fee9
--- /dev/null
+++ b/configure.in.in
@@ -0,0 +1,4 @@
+#MIN_CONFIG
+
+AM_INIT_AUTOMAKE(kxmleditor,1.1.4)
+
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..05a9fba
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,6 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+SUBDIRS = en
+
+####### kdevelop will overwrite this part!!! (end)############
+
diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am
new file mode 100644
index 0000000..e1a4f66
--- /dev/null
+++ b/doc/en/Makefile.am
@@ -0,0 +1,10 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+
+EXTRA_DIST = index.docbook screenshot.png xml.png setuptargz.png setupprintout.png setupdefaults.png setuptexteditor.png setuptreeview.png specprocinstrdlg.png texteditor.png kparts.png
+
+####### kdevelop will overwrite this part!!! (end)############
+
+KDE_LANG = en
+KDE_DOCS = kxmleditor
+
diff --git a/doc/en/index.docbook b/doc/en/index.docbook
new file mode 100644
index 0000000..8785a5d
--- /dev/null
+++ b/doc/en/index.docbook
@@ -0,0 +1,1502 @@
+<?xml version="1.0" ?>
+<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.1-Based Variant V1.0//EN" "dtd/kdex.dtd" [
+ <!ENTITY kxmleditor "<application>KXML Editor</application>" >
+ <!ENTITY kappname "&kxmleditor;">
+ <!ENTITY % English "INCLUDE" >
+ <!ENTITY % addindex "IGNORE">
+]>
+
+<!-- ................................................................ -->
+
+<!-- The language must NOT be changed here. -->
+
+<book lang="&language;">
+
+<!-- This header contains all of the meta-information for the document such
+as Authors, publish date, the abstract, and Keywords -->
+
+<bookinfo>
+<title>The KXML Editor Handbook</title>
+
+<authorgroup>
+<author>
+<firstname>Lumir</firstname>
+<othername></othername>
+<surname>Vanek</surname>
+<affiliation>
+<address><email>lvanek@users.sourceforge.net</email></address>
+</affiliation>
+</author>
+</authorgroup>
+
+
+<copyright>
+<year>2004</year>
+<holder>Lumir Vanek</holder>
+</copyright>
+<!-- Translators: put here the copyright notice of the translation -->
+<!-- Put here the FDL notice. Read the explanation in fdl-notice.docbook
+ and in the FDL itself on how to use it. -->
+<legalnotice>&FDLNotice;</legalnotice>
+
+<!-- Date and version information of the documentation
+Don't forget to include this last date and this last revision number, we
+need them for translation coordination !
+Please respect the format of the date (DD/MM/YYYY) and of the version
+(V.MM.LL), it could be used by automation scripts.
+Do NOT change these in the translation. -->
+
+<date>07/08/2004</date>
+<releaseinfo>1.11</releaseinfo>
+
+<!-- Abstract about this handbook -->
+
+<abstract>
+<para>
+KXML Editor is an application for browsing and editing XML files.
+</para>
+
+<para>
+This document describes KXML Editor version 1.0.
+</para>
+
+</abstract>
+
+<!-- This is a set of Keywords for indexing by search engines.
+Please at least include KDE, the KDE package it is in, the name
+ of your application, and a few relevant keywords. -->
+
+<keywordset>
+<keyword>KDE</keyword>
+<keyword>KXML Editor</keyword>
+</keywordset>
+
+</bookinfo>
+
+<!-- The contents of the documentation begin here. Label
+each chapter so with the id attribute. This is necessary for two reasons: it
+allows you to easily reference the chapter from other chapters of your
+document, and if there is no ID, the name of the generated HTML files will vary
+from time to time making it hard to manage for maintainers and for the CVS
+system. Any chapter labelled (OPTIONAL) may be left out at the author's
+discretion. Other chapters should not be left out in order to maintain a
+consistent documentation style across all KDE apps. -->
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Fundamentals -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<chapter id="some-fundamentals">
+<title>Some Fundamentals</title>
+<para>
+Extensible Markup Language (XML) is wide standart for exchanging and
+transferring data in application development. XML stores character data
+in a structured way, using tags placed within the data representing its structure.
+An XML document has a tree structure, where "XML element" tags comprise the nodes.
+The "root element", begets all the other elements in the tree. All elements except the root
+have a single parent. Elements may contain character data - "XML contents".
+An element node may also own a list of "attributes".
+</para>
+
+<para>
+<screenshot>
+<screeninfo>XML structure</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="xml.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para>
+You may obtain <ulink url="http://www.zvon.org">more informations</ulink>
+ about XML on Web.
+</para>
+
+</chapter>
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Introduction -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<!-- The introduction chapter contains a brief introduction for the
+application that explains what it does and where to report
+problems. Basically a long version of the abstract. Don't include a
+revision history. (see installation appendix comment) -->
+
+<para>
+KXML Editor is a program that lets you browse and edit XML files. Main window is divided
+to two windows.
+</para>
+
+<para>
+Left side contain tree widget with XML structure. XML document has tree structute, one (and only one)
+element is root. Every element may own one or more childs elements or contents items.
+</para>
+
+<para>
+Right side contain detail for selected item. If XML element is selectected in left side,
+attributes list and raw XML are displayied. If XML contents is selectected in left side, edit widget with full
+context is displayied.
+</para>
+
+<para>
+<!-- Note that all graphics should be in .png format. Use no gifs because of
+patent issues. -->
+
+<screenshot>
+<screeninfo>Here's a screenshot of &kxmleditor;</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="screenshot.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+
+</para>
+
+<para>
+KXML Editor contain two toolbars with buttons - one with standart commands and second with
+commands for edit XML document. Third toolbar contain Konqueror-like path bar, that display
+path of selected XML item.
+</para>
+
+<para><interface>The Pathbar</interface> shows the path to the selected XML item,
+You can type a path here and press <keycap>Enter</keycap> to go to it.
+You may use combobox in path bar for select bookmarked item.
+The black icon at the left hand end of the Pathbar clears the text entry box.
+</para>
+
+
+</chapter>
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Edit XML -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<chapter id="edit-xml">
+<title>Edit XML document</title>
+
+<para>
+User may edit XML document using menu commands, or using drag and drop.
+</para>
+
+<note><para>
+Moving elements using clipboard or drag and drop has one side effect to
+bookmarks system. Moving elements and their subtrees leave its paths in
+<interface>Pathbar</interface> combobox nonvalid. </para>
+<para>
+When you cut/copy and paste items with bookmarks, or drag and drop it, bookmarks are not
+transfered.
+</para>
+</note>
+
+<sect1 id="clipboard">
+<title>Using clipboard</title>
+
+<para>To copy a XML element or contents item you can:</para>
+
+<para>
+<itemizedlist>
+
+<listitem><para>If the item is selected you can use the
+<guiicon>Copy</guiicon> button on the Toolbar or the Menubar
+<menuchoice><guimenu>Edit</guimenu> <guimenuitem>Copy</guimenuitem></menuchoice>
+item, or the <keycombo action="simul"><keycap>Ctrl</keycap><keycap>C</keycap></keycombo>
+hotkey.</para></listitem>
+
+<listitem><para>Then select item, where you can copy XML element.</para></listitem>
+
+<listitem><para><guiicon>Finally, use Paste</guiicon> button or the Menubar <menuchoice><guimenu>Edit</guimenu>
+<guimenuitem>Paste</guimenuitem></menuchoice> option or the <keycombo
+action="simul"><keycap>Ctrl</keycap><keycap>V</keycap></keycombo> hotkey.
+</para></listitem>
+
+</itemizedlist></para>
+
+<para>Moving a XML element or contents item can be done in the same
+way as copying, except that you choose the <guimenuitem>Cut</guimenuitem> option
+or <keycombo action="simul"><keycap>Ctrl</keycap><keycap>X</keycap></keycombo>
+instead of <guimenuitem>Copy</guimenuitem>. <!--The item that you have
+<guimenuitem>Cut</guimenuitem> will be removed from the original position when
+you do the <guimenuitem>Paste</guimenuitem> into the new directory. --> </para>
+
+<note><para>
+You can also exchange XML between &kxmleditor; and text editor using clipboard. Of course,
+when you paste XML element, clipboard must contain well formed XML.
+</para></note>
+
+</sect1>
+
+<sect1 id="drag-drop">
+<title>Using Drag 'n Drop</title>
+
+<para>&kxmleditor; supports Drag and Drop copying and moving of elements and
+contents items.</para>
+
+<procedure>
+<step><para>Set the tree view to show the item you wish to move. If you can copy,
+press <keycap>Ctrl</keycap> button and hold it.
+</para></step>
+<step><para>Position the mouse pointer over source item name or icon then, holding the &LMB;
+pressed, <quote>drag</quote> it over to the tree view and position the
+mouse pointer over the target item. Release the mouse button and <keycap>Ctrl</keycap> if you
+made copy.
+</para></step>
+</procedure>
+
+<note><para>
+You can also drag and drop between different instances of &kxmleditor;. Also is possible drag from
+&kxmleditor; and drop into text editor.
+</para></note>
+
+</sect1>
+
+<sect1 id="Encoding">
+<title>Encoding</title>
+
+<para>&kxmleditor; supports XML document encoding.</para>
+
+<para>
+When file is loaded, parser get information about encoding from processing instruction
+ &lt;?xml encoding="xxxx" ?&gt; and convert XML to Unicode.
+</para>
+
+<para>
+&kxmleditor; works internally with Unicode strings.
+</para>
+
+<para>
+While saving, &kxmleditor; convert XML from Unicode to encoding that depends on processing
+instruction &lt;?xml encoding="xxxx" ?&gt;, where xxxx may be ISO-8859-1, ISO-8859-2, UTF-8 etc.
+If you change encoding, you change codec, that is used while saving.
+</para>
+
+</sect1>
+
+<sect1 id="KParts">
+<title>KParts</title>
+
+<para>&kxmleditor; supports KParts technology.</para>
+
+<para>
+If you browse directory using Konqueror, you may select XML file and click on it by right
+mouse button. Then you may choose menu item <menuchoice><guimenu>Preview in</guimenu></menuchoice>
+and <menuchoice><guimenu>KXML Editor</guimenu></menuchoice> that starts KXML editor inside Konqueror
+main window.
+
+<screenshot>
+<screeninfo>Special processing instruction dialog</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="kparts.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+
+</para>
+
+</sect1>
+
+</chapter>
+<!-- ***************************************************************************** -->
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Menu Entries -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<!-- (OPTIONAL, BUT RECOMMENDED) This chapter should list all of the
+application windows and their menubar and toolbar commands for easy reference.
+Also include any keys that have a special function but have no equivalent in the
+menus or toolbars. This may not be necessary for small apps or apps with no tool
+or menu bars. -->
+
+
+<chapter id="the-menu-entries">
+<title>The Menu Entries</title>
+
+<!-- ******************************** File menu ********************************* -->
+<sect1 id="file">
+<title>The <guimenu>File</guimenu> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>N</keycap></keycombo></shortcut>
+<guimenu><accel>F</accel>ile</guimenu>
+<guimenuitem><accel>N</accel>ew</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Creates a new XML document. If there is a current document
+with unsaved changes the user is given a chance to save it. Program show dialog for
+special processing instruction, you may choose XML version and encoding.
+
+</action>
+
+<screenshot>
+<screeninfo>Special processing instruction dialog</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="specprocinstrdlg.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>O</keycap></keycombo></shortcut>
+<guimenu><accel>F</accel>ile</guimenu>
+<guimenuitem><accel>O</accel>pen</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+This command opens a file. It does this by means of a dialog box
+which allows the user to navigate the file system. The dialog operates
+like a small file manager. Clicking on directories displayed in the
+central window directs the dialog to enter that directory - displaying its
+contents. There is an entry/dropdown box which can be used to type in
+directly the location and name of the file or by clicking the arrow at the
+side choose from a dropdown list of recently used locations. Below this is
+a filter which similarly may have data entered directly or chosen from a
+dropdown list of recent filter types. The filter facility lets only files
+that meet its specifications be displayed in the central window. If the
+filter contained text such as <literal role="extension">*.xml</literal> then only files
+with the txt extension would be visible in the selection window. Below the filter
+is a status bar giving information about the number of files and subdirectories
+within the current directory.
+</para>
+
+<para>The toolbar, which is located at the top of the dialog, has left and right
+arrow buttons that let the user move back and forth through previously selected
+directories as well as an up arrow button for moving up the directory tree. The
+button with the little house takes the user to his or her home directory and the one
+with the two arrows curved in on each other updates the view of the current
+directory. The flag button lets the user set a new bookmark at the current directory
+or go to one that was previously set. <!-- The button with the wrench (spanner) -->
+<!-- icon even permits the user to change a few basic settings for the dialog -->
+<!-- box. --> The last button on the toolbar allows you to create a new
+directory, and finally there is dropdown box with a list of some commonly
+frequented directories.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>
+<menuchoice>
+<guimenu><accel>F</accel>ile</guimenu>
+<guimenuitem>Open<accel>R</accel>ecent</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This is a shortcut to open recently saved documents. Clicking on
+this item opens a list to the side of the menu with several of the most recently
+saved files. Clicking on a specific file will open it in &kxmleditor; - if the file
+still resides at the same location.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>S</keycap></keycombo></shortcut>
+<guimenu><accel>F</accel>ile</guimenu>
+<guimenuitem><accel>S</accel>ave</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>
+This saves the current document. If there has already been a save of the document then this will overwrite the previously
+saved file without asking for the user's consent. If it is the first save of a new document the save as dialog
+(described below) will be invoked.
+</action></para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Save <accel>A</accel>s</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allows a document to be saved with a new file name. This is
+done by means of the file dialog box described above in the Open
+ section of this help file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem><accel>M</accel>ail</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allows mail document using your mail client.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem><accel>V</accel>ersion &amp; Encoding</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+Program show dialog for special processing instruction, you may choose XML version and encoding.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Attach Schema</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allow to attach DTD schema file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Detach Schema</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allow to remove DTD schema file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Attach Stylesheet</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allow to insert processing instruction for ataching schema (obviously .xsl or .xslt) file.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem>Detach Stylesheet</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allow to remove processing instruction for ataching schema.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>File</guimenu>
+<guimenuitem><accel>P</accel>rint</guimenuitem>
+</menuchoice></term>
+<listitem><para>
+This allow print document.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Q</keycap></keycombo></shortcut>
+<guimenu><accel>F</accel>ile</guimenu>
+<guimenuitem><accel>Q</accel>uit</guimenuitem>
+</menuchoice></term>
+<listitem><para><action>Quits</action> &kxmleditor;</para></listitem>
+</varlistentry>
+
+</variablelist></para>
+
+</sect1>
+
+<!-- ******************************** Edit menu ********************************* -->
+<sect1 id="edit">
+<title>The <guimenu>Edit</guimenu> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Z</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>U</accel>ndo</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This is used to eliminate or reverse the most recent user action or operation.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>Z</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>R</accel>edo</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This will reverse the most recent change (if any) made using Undo
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu>Edit->Undo/Redo History</guimenu>
+</menuchoice></term>
+<listitem>
+<para>
+This will call a display box showing a list of the most recent actions on the left and another list of actions which have been 'undone' on the right.
+There are also three buttons at the right of the box labeled Undo, Redo, and Close.
+Clicking on the Undo button will cause the action at the top of the Undo list to be reversed which will place that particular action at the top of the Redo list.
+Likewise, clicking on the Redo button will reinstate the reversed action and move it back to the top of the Undo list. Clicking on an item below the top item in either
+list will select all the items from the top down to that point. A subsequent click on the corresponding button will cause all the selected actions to be undone or redone accordingly.
+This would be particularly useful when the user knows precisely the point to which she or he would like to proceed - making it unnecessary to go through a series of single undo or redo actions.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>X</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>C<accel>u</accel>t</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This command deletes the current selection and places it on the clipboard. The
+clipboard is a feature of KDE that works invisibly to provide a way to transfer data between
+applications.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>C</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>C</accel>opy</guimenuitem></menuchoice></term>
+<listitem>
+<para>This copies the currently selected text to the clipboard so that it may be
+pasted elsewhere. The clipboard is a feature of KDE that works invisibly to
+provide a way to transfer data between applications.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>V</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>P</accel>aste</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This will insert the contents of the clipboard at the cursor position. The
+clipboard is feature of KDE that works invisibly to provide a way to transfer
+data between applications.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Del</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>D</accel>elete</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This will delete selected XML node, including their child subtree, if any</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>Delete all attributes</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This will delete all attributes that contain selected XML element</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>Move <accel>U</accel>p</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>Move selected node Up, in their parent list</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>Move <accel>D</accel>own</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>Move selected node Down, in their parent list</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>E</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>D<accel>e</accel>select node</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This unselect node</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>F</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>F</accel>ind</guimenuitem></menuchoice></term>
+<listitem>
+<para>This opens the find dialog which is used to specify the <guilabel>Text to
+Find</guilabel> in the document. There is small text box for entering the search
+pattern. <!-- which also doubles as a dropdown box. Clicking on the dropdown arrow at
+the side of the box makes available other recent search patterns.--> Other
+parameters are included to make the search more efficient. Selecting
+<guilabel>Case Sensitive</guilabel> will limit finds to entries that match the
+case (upper or lower) of each of the characters in the search
+pattern. <!-- <guilabel>Find Backwards</guilabel> directs the search to proceed in an
+upwardly direction. The <guilabel>Selected Text</guilabel> option keeps the
+search within currently selected text. Checking <guilabel>Whole Words
+Only</guilabel> prevents the search from stopping on words that contain the
+searched for pattern. The <guilabel>Search from Cursor</guilabel> option begins
+the search from the current position of the cursor within the document rather
+than from the beginning. -->
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>F3</keycap></keycombo></shortcut>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>Find <accel>N</accel>ext</guimenuitem></menuchoice></term>
+<listitem>
+<para>This repeats the last find operation, if any, without calling the find
+dialog box.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem><accel>P</accel>roperties</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Display dialog which allows the user to change selected node properties. Dialog type
+depends on selected item type.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>E</accel>dit</guimenu>
+<guimenuitem>Edit <accel>r</accel>aw XML</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Display dialog which allows the user to edit selected element as raw XML.
+</para>
+
+<screenshot>
+<screeninfo>Special processing instruction dialog</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="texteditor.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+
+<para>
+You may press Validate button for checking, if XML is well formed.
+</para>
+
+</listitem>
+</varlistentry>
+
+
+</variablelist></para>
+</sect1>
+
+<!-- ******************************** View menu ********************************* -->
+<sect1 id="go">
+<title>The <guimenu>View</guimenu> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Alt</keycap><keysym>Up Arrow</keysym></keycombo></shortcut>
+<guimenu><accel>V</accel>iew</guimenu>
+<guimenuitem>To <accel>P</accel> arent node</guimenuitem></menuchoice></term>
+<listitem>
+<para>Go up a level in the tree hierarchy. Select parent node.</para> </listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keysym>Plus</keysym></keycombo></shortcut>
+<guimenu><accel>V</accel>iew</guimenu>
+<guimenuitem>E<accel>x</accel>pand node</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Expand selected XML element and show entire child subtree.
+</para>
+<para>
+Tip: You may expand node to choosed level. Press button for this function on toolbar,
+hold mouse pressed for small anmount of time. Program show menu, which allows the user to
+expand node to selected level.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keysym>Minus</keysym></keycombo></shortcut>
+<guimenu><accel>V</accel>iew</guimenu>
+<guimenuitem><accel>C</accel>ollapse node</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Collapse selected XML element and hide entire child subtree.
+</para>
+<para>
+Tip: You may collapse node from choosed level. Press button for this function on toolbar,
+hold mouse pressed for small anmount of time. Program show menu, which allows the user to
+collapse node from selected level.
+</para>
+</listitem>
+</varlistentry>
+
+</variablelist></para>
+</sect1>
+
+<!-- ******************************** Insert menu ***************************** -->
+<sect1 id="xml">
+<title>The <guimenu>Insert</guimenu> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>E</keycap></keycombo></shortcut>
+<guimenu><accel>I</accel>nsert</guimenu>
+<guimenuitem><accel>E</accel>lement</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Insert new XML element into tree. Display dialog which allows the user to enter element name.
+If you have void document, new element becomes root. If you have selected any existing element,
+new element becomes child of this element. You may decide, if new element will be placed to
+begin or end of childs items list.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>A</keycap></keycombo></shortcut>
+<guimenu><accel>I</accel>nsert</guimenu>
+<guimenuitem><accel>A</accel>ttribute</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Insert new XML attribute for selected XML element. Display dialog which allows the user to enter
+attribute name and value. Attribute name is checked for duplicity before inserting into
+attribute list.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>T</keycap></keycombo></shortcut>
+<guimenu><accel>I</accel>nsert</guimenu>
+<guimenuitem><accel>T</accel>ext</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Insert new XML text item into tree. Display dialog which allows the user to enter contents text.
+New item becomes child of celected XML element. You may decide, if new item will be
+placed to begin or end of childs items list.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>D</keycap></keycombo></shortcut>
+<guimenu><accel>I</accel>nsert</guimenu>
+<guimenuitem>C<accel>D</accel>ATA</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Insert new XML CDATA item into tree. Display dialog which allows the user to enter contents text.
+New item becomes child of celected XML element. You may decide, if new item will be
+placed to begin or end of childs items list.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>C</keycap></keycombo></shortcut>
+<guimenu><accel>I</accel>nsert</guimenu>
+<guimenuitem><accel>C</accel>omment</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Insert new XML comment item into tree. Display dialog which allows the user to enter contents text.
+New item becomes child of celected XML element. You may decide, if new item will be
+placed to begin or end of childs items list.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>Shift</keycap><keycap>P</keycap></keycombo></shortcut>
+<guimenu><accel>X</accel>ML</guimenu>
+<guimenuitem>Insert <accel>p</accel>roc. instruction</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+Insert new XML processing instruction into tree. Display dialog which allows
+the user to enter target and data.
+</para>
+</listitem>
+</varlistentry>
+
+
+</variablelist></para>
+</sect1>
+
+<!-- ******************************** Bookmarks menu **************************** -->
+
+<sect1 id="bookmarks">
+<title>The <guimenu>Bookmarks</guimenu> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Ctrl</keycap><keycap>B</keycap></keycombo></shortcut>
+<guimenu><accel>B</accel>ookmark</guimenu>
+<guimenuitem><accel>T</accel>oggle bookmark</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This creates a marker in the document at the selected item. Bookmarked item path as added
+into Pathbar combo. User may traverse bookmarks using
+Previous or Next Bookmark command,
+or directly select bookmarked item in Pathbar combobox.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Shift</keycap><keycap>F5</keycap></keycombo></shortcut>
+<guimenu><accel>B</accel>ookmark</guimenu>
+<guimenuitem><accel>P</accel>revious bookmark</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>Move selection to previous bookmark in document, relative to selected item. Bookmarked items,
+that are closed is skipped.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>F5</keycap></keycombo></shortcut>
+<guimenu><accel>B</accel>ookmark</guimenu>
+<guimenuitem><accel>N</accel>ext bookmark</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>Move selection to next bookmark in document, relative to selected item. Bookmarked items,
+that are closed is skipped.
+</para>
+</listitem>
+</varlistentry>
+
+</variablelist></para>
+</sect1>
+
+<!-- ******************************** Settings menu ****************************** -->
+<sect1 id="settings">
+<title>The <guimenu>Settings</guimenu> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>S</accel>ettings</guimenu>
+<guimenuitem>Show <accel>T</accel>oolbar</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+When checked, this displays a movable toolbar containing buttons used to
+initiate frequently used commands. When unchecked the toolbar is hidden.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>S</accel>ettings</guimenu>
+<guimenuitem>Show <accel>S</accel>tatusbar</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>When checked, this displays a small bar at the bottom of the main window
+containing information about the status of the current document. When unchecked
+the statusbar is hidden.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>S</accel>ettings</guimenu><guimenuitem>Configure S<accel>h</accel>ortcuts</guimenuitem></menuchoice></term>
+<listitem>
+<para>This command opens a dialog box whereby the key bindings may be changed.
+A display window at
+the top of the dialog box shows the list of commands (actions) that can have
+keyboard shortcuts. Below the display are three radio buttons. The user may choose
+between No Key, Default Key, and Custom Key. (Note that a set of radio buttons only
+allows the selection of one of the offered items - in the way that buttons on a car
+radio only offer the selection of one preset station. Also, the Default Key
+selection is only available for those commands that actually have a 'default'
+shortcut.) Selecting the Custom Key option activates the three check boxes and key
+button at the bottom of the dialog. The user may then select a key
+combination for the command in question by means of the check boxes and key
+button. For example, with the About KDE command selected in the display window,
+the user could select <keycap>Ctrl</keycap> and <keycap>Alt</keycap>, click on
+the key button, and then press the <keycap>K</keycap> key on the keyboard. This
+would mean that anytime he or she held down the <keycap>Ctrl</keycap> and
+<keycap>Alt</keycap> buttons and pressed <keycap>K</keycap> (while using
+&kxmleditor;) the About KDE display box would be called. </para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>S</accel>ettings</guimenu>
+<guimenuitem>Configure Tool<accel>b</accel>ars</guimenuitem>
+</menuchoice></term>
+<listitem><para>This will open the dialog whereby the toolbars configuration may
+be changed. The user can choose which shortcut buttons should appear on the
+toolbar. A display window on the left lists the commands available to placed
+on the toolbar. A display on the right lists those commands already on the
+toolbar. A set of four arrow buttons between the two displays manipulates the
+selections. The right pointing arrow places any command selected in the left
+pane onto the right pane, <abbrev>i.e.</abbrev>, it is added to the toolbar.
+The left arrow does just the opposite, removing any action selected in the right
+window from the toolbar. The up and down pointing arrows change the position of
+an action selected in the right window which changes the position of its button
+in the toolbar.</para> </listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>S</accel>ettings</guimenu>
+<guimenuitem><accel>C</accel>onfigure &kxmleditor;</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This menu item opens a dialog whereby several different <link
+linkend="pref-dialog">settings</link> may be adjusted.</para>
+</listitem>
+</varlistentry>
+
+</variablelist></para>
+</sect1>
+
+<!-- ******************************** Help menu ********************************** -->
+<sect1 id="help">
+<title>The <guimenuitem>Help</guimenuitem> Menu</title>
+<para><variablelist>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>F1</keycap></keycombo></shortcut>
+<guimenu><accel>H</accel>elp</guimenu>
+<guimenuitem><accel>C</accel>ontents</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This invokes the KDE help system starting at the &kxmleditor; help pages (this document).
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<shortcut><keycombo><keycap>Shift</keycap><keycap>F1</keycap></keycombo></shortcut>
+<guimenu><accel>H</accel>elp</guimenu>
+<guimenuitem>What's <accel>T</accel>his?</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>
+This changes the mouse cursor to a combination arrow and question mark.
+Clicking on items within &kxmleditor; with this arrow will open a help window (if
+one exists for the particular item) explaining the item's function.
+</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>H</accel>elp</guimenu>
+<guimenuitem><accel>R</accel>eport Bug</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para><action>
+This calls a dialog box to help
+the user help the KDE team to track down and solve any
+problems(bugs) in the program. The dialog attempts to do this by
+means of email using the information given by the user.
+</action></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>H</accel>elp</guimenu>
+<guimenuitem><accel>A</accel>bout KXML Editor</guimenuitem>
+</menuchoice></term>
+<listitem>
+<para>This will display version and author information.</para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term><menuchoice>
+<guimenu><accel>H</accel>elp</guimenu><guimenuitem>About <accel>K</accel>DE</guimenuitem></menuchoice></term>
+<listitem>
+<para>This displays the KDE version and other basic information.</para>
+</listitem>
+</varlistentry>
+
+</variablelist></para>
+
+</sect1>
+
+</chapter>
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Configuration -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<chapter id="pref-dialog">
+<title>Configure &kxmleditor;</title>
+
+<para>Selecting
+<menuchoice><guimenu>Settings</guimenu><guimenuitem>Configure
+KXML Editor</guimenuitem></menuchoice> from the menu brings up the Configure-KXML Editor
+dialog box. This dialog can be used to alter <!-- a number of different --> application settings. <!-- The
+settings available for change vary according to which category the user chooses from
+a vertical list on the left side of the dialog. --> By means of four buttons
+along the bottom of the box the user can control the process. She or he may invoke
+the <guilabel>Help</guilabel> system, accept the current settings pressing <guibutton>Apply</guibutton> button,
+accept the current settings and close the dialog by means of the <guibutton>OK</guibutton> button, or
+<guibutton>Cancel</guibutton> the process.
+</para>
+
+<sect1 id="preftreeview">
+
+<title>Tree View</title>
+<para>This category deals with following properties detailed below.</para>
+
+<para>
+<screenshot>
+<screeninfo>TarGz Extensions</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="setuptreeview.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para><variablelist>
+
+<varlistentry>
+<term><guilabel>Set root element decorated</guilabel></term>
+<listitem>
+<para>
+Set the root element in tree view decorated.
+Sets this view to show open/close sign on root item.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Default expand level</guilabel></term>
+<listitem>
+<para>
+Set the default expand level for tree view.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Enable drag &amp; drop</guilabel></term>
+<listitem>
+<para>
+Enables or disables drag &amp; drop. Disabling it may be useful, when X-Window client
+and server is not on the same machine and respond time is slow, that may cause unnecesary
+drag &amp; drop operation caused while selecting in tree view.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Show...</term>
+<listitem><para>
+This option allow display XML attributes for each element in left side tree window.
+You may choose one of this options: Show only element name or Element, attribute name
+or Element, attributes names and its value.
+</para></listitem>
+</varlistentry>
+
+</variablelist></para>
+
+</sect1>
+
+<sect1 id="defaults">
+
+<title>Defaults</title>
+<para>This category allow set default XML version, encoding and program behavior
+while creating new document</para>
+
+<para>
+<screenshot>
+<screeninfo>Defaults</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="setupdefaults.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para>
+<variablelist>
+
+<varlistentry>
+<term><guilabel>XML version</guilabel></term>
+<listitem>
+<para>
+Default XML version for new documents.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Encoding</guilabel></term>
+<listitem>
+<para>
+Default XML encoding for new documents.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Creating new files</guilabel></term>
+<listitem>
+<para>
+Behavior when creating new XML documents.
+</para></listitem>
+</varlistentry>
+
+
+</variablelist></para>
+
+</sect1>
+
+<sect1 id="printout">
+
+<title>Printout</title>
+<para>This category allow set parameters for printing XML document</para>
+
+<para>
+<screenshot>
+<screeninfo>Printout</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="setupprintout.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para>
+<variablelist>
+
+<varlistentry>
+<term><guilabel>Font family</guilabel></term>
+<listitem>
+<para>
+Choose font family for printing document.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Font size</guilabel></term>
+<listitem>
+<para>
+Choose font size for printing document.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Element intendation</guilabel></term>
+<listitem>
+<para>
+Choose element intendation for printing document.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Print header</guilabel></term>
+<listitem>
+<para>
+Choose if you can print header when printing document.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Print footer</guilabel></term>
+<listitem>
+<para>
+Choose if you can print footer when printing document.
+</para></listitem>
+</varlistentry>
+
+</variablelist></para>
+
+</sect1>
+
+
+<sect1 id="preftargz">
+
+<title>TarGz Extensions</title>
+<para>This category allow set list of XML files, that is TarGz archives.
+This allow open and save those files transparently. This may be useful
+for browsing KOffice files.</para>
+
+<para>
+<screenshot>
+<screeninfo>TarGz Extensions</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="setuptargz.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para>
+<variablelist>
+
+<varlistentry>
+<term><guilabel>Archive files extensions</guilabel></term>
+<listitem>
+<para>
+You may edit list of files extension using <guibutton>New</guibutton> and <guibutton>Delete</guibutton> buttons.
+Actually selected item may be changed using edit line.
+</para></listitem>
+</varlistentry>
+
+</variablelist></para>
+
+</sect1>
+
+<sect1 id="texteditor">
+
+<title>Text Editor</title>
+<para>This category allow set text edior syntax highlighting</para>
+
+<para>
+<screenshot>
+<screeninfo>Text Editor</screeninfo>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="setuptexteditor.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+</screenshot>
+</para>
+
+<para>
+<variablelist>
+
+<varlistentry>
+<term><guilabel>Syntax highlighting</guilabel></term>
+<listitem>
+<para>
+You may choose various colors for different XML syntax.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Element intendation</guilabel></term>
+<listitem>
+<para>
+Choose element intendation for raw XML editing. This intendation is used also for saving document.
+</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><guilabel>Wrap, instead of Hrz. Scroll bar</guilabel></term>
+<listitem>
+<para>
+Disable horizontal srcrollbar and set word wrap ON for raw XML view and editing.
+</para></listitem>
+</varlistentry>
+
+</variablelist></para>
+
+</sect1>
+
+</chapter>
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Credits and licences -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<!-- Include credits for the programmers, documentation writers, and
+contributors here. The license for your software should then be included below
+the credits with a reference to the appropriate license file included in the KDE
+distribution. -->
+<chapter id="credits">
+
+<!-- Include credits for the programmers, documentation writers, and
+contributors here. The license for your software should then be included below
+the credits with a reference to the appropriate license file included in the KDE
+distribution. -->
+
+<title>Credits and License</title>
+
+<para>
+&kxmleditor; Program copyright 2001-2003 the &kxmleditor; developers:
+</para>
+
+<para><variablelist>
+
+<varlistentry>
+<term>Lumir Vanek <email>lvanek@users.sourceforge.net</email></term>
+<listitem><para>Developer and maintainer</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Olaf Hartig <email>hartig@users.sourceforge.net</email></term>
+<listitem><para>Developer</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Adam Charytoniuk <email>a_charytoniuk@users.sourceforge.net</email></term>
+<listitem><para>Developer</para></listitem>
+</varlistentry>
+
+</variablelist></para>
+
+<para>
+Documentation copyright 2003 Lumir Vanek <email>lvanek@users.sourceforge.net</email>
+</para>
+
+<!--
+<para>
+Translations done by:
+<itemizedlist>
+<listitem>
+<para>Babel D. Fish <email>babelfish@kde.org</email> (Sanskrit)</para>
+</listitem>
+</itemizedlist>
+</para>
+-->
+
+&underFDL; <!-- FDL: do not remove -->
+
+<!-- Determine which license your application is licensed under,
+ and delete all the remaining licenses below:
+
+ (NOTE: All documentation are licensed under the FDL,
+ regardless of what license the application uses) -->
+
+&underGPL; <!-- GPL License -->
+
+</chapter>
+
+<!-- ***************************************************************************** -->
+<!-- -->
+<!-- Installation -->
+<!-- -->
+<!-- ***************************************************************************** -->
+
+<appendix id="installation">
+<title>Installation</title>
+
+<sect1 id="getting-kxmleditor">
+<title>How to obtain KXML Editor</title>
+
+<para>
+You may obtain &kxmleditor; from URL:
+<ulink url="http://sourceforge.net/projects/kxmleditor">http://sourceforge.net/projects/kxmleditor</ulink>.
+</para>
+</sect1>
+
+<sect1 id="requirements">
+<title>Requirements</title>
+
+<!--
+List any special requirements for your application here. This should include:
+.Libraries or other software that is not included in kdesupport,
+kdelibs, or kdebase.
+.Hardware requirements like amount of RAM, disk space, graphics card
+capabilities, screen resolution, special expansion cards, etc.
+.Operating systems the app will run on. If your app is designed only for a
+specific OS, (you wrote a graphical LILO configurator for example) put this
+information here.
+-->
+
+<para>
+In order to successfully use &kxmleditor;, you need KDE 3.1.x or higher.
+For instructions on acquiring &kde; please see <ulink url="http://www.kde.org">http://www.kde.org</ulink>.
+</para>
+
+</sect1>
+
+<sect1 id="compilation">
+<title>Compilation and installation</title>
+
+<para>
+In order to compile and install &kxmleditor; on your system, type the following in the base
+directory:
+<screen width="40">
+<prompt>%</prompt> <userinput>./configure</userinput>
+<prompt>%</prompt> <userinput>make</userinput>
+<prompt>%</prompt> <userinput>make install</userinput>
+</screen>
+</para>
+
+<para>Since &kxmleditor; uses autoconf and automake you should have not trouble compiling it.
+Should you run into problems please report them to author.</para>
+
+</sect1>
+
+</appendix>
+
+&documentation.index;
+</book>
+<!--
+Local Variables:
+mode: sgml
+sgml-minimize-attributes: nil
+sgml-general-insert-case: lower
+End:
+-->
diff --git a/doc/en/kparts.png b/doc/en/kparts.png
new file mode 100644
index 0000000..b6c1663
--- /dev/null
+++ b/doc/en/kparts.png
Binary files differ
diff --git a/doc/en/screenshot.png b/doc/en/screenshot.png
new file mode 100644
index 0000000..7a965ff
--- /dev/null
+++ b/doc/en/screenshot.png
Binary files differ
diff --git a/doc/en/setupdefaults.png b/doc/en/setupdefaults.png
new file mode 100644
index 0000000..59e1917
--- /dev/null
+++ b/doc/en/setupdefaults.png
Binary files differ
diff --git a/doc/en/setupprintout.png b/doc/en/setupprintout.png
new file mode 100644
index 0000000..0d4b083
--- /dev/null
+++ b/doc/en/setupprintout.png
Binary files differ
diff --git a/doc/en/setuptargz.png b/doc/en/setuptargz.png
new file mode 100644
index 0000000..623c817
--- /dev/null
+++ b/doc/en/setuptargz.png
Binary files differ
diff --git a/doc/en/setuptexteditor.png b/doc/en/setuptexteditor.png
new file mode 100644
index 0000000..8e26888
--- /dev/null
+++ b/doc/en/setuptexteditor.png
Binary files differ
diff --git a/doc/en/setuptreeview.png b/doc/en/setuptreeview.png
new file mode 100644
index 0000000..ce50d83
--- /dev/null
+++ b/doc/en/setuptreeview.png
Binary files differ
diff --git a/doc/en/specprocinstrdlg.png b/doc/en/specprocinstrdlg.png
new file mode 100644
index 0000000..2acd515
--- /dev/null
+++ b/doc/en/specprocinstrdlg.png
Binary files differ
diff --git a/doc/en/texteditor.png b/doc/en/texteditor.png
new file mode 100644
index 0000000..8f3ad21
--- /dev/null
+++ b/doc/en/texteditor.png
Binary files differ
diff --git a/doc/en/xml.png b/doc/en/xml.png
new file mode 100644
index 0000000..5be8cdd
--- /dev/null
+++ b/doc/en/xml.png
Binary files differ
diff --git a/kxmleditor.lsm b/kxmleditor.lsm
new file mode 100644
index 0000000..bef9475
--- /dev/null
+++ b/kxmleditor.lsm
@@ -0,0 +1,14 @@
+Begin3
+Title: KXMLEditor
+Version: 0.7
+Entered-date:
+Description: XML files editor for KDE
+Keywords: KDE, XML
+Author: Lumir Vanek, Olaf Hartig, Mateusz Korniak
+Maintained-by: Lumir Vanek <lvanek@eanet.cz>
+Primary-site: http://kxmleditor.sourceforge.net
+Home-page: http://kxmleditor.sourceforge.net
+Original-site:
+Platforms: Linux and other Unices
+Copying-policy: GNU Public License
+End
diff --git a/kxmleditor.spec b/kxmleditor.spec
new file mode 100644
index 0000000..b89b00a
--- /dev/null
+++ b/kxmleditor.spec
@@ -0,0 +1,45 @@
+Summary: KXML Editor for KDE 3.x
+Name: kxmleditor
+Version: 1.1.4
+Release: 0.1
+Copyright: GPL
+Vendor: Lumir Vanek <lvanek@users.sourceforge.net>
+Url: http://kxmleditor.sourceforge.net
+Packager: Lumir Vanek <lvanek@users.sourceforge.net>
+Group: Development/Tools
+Source: kxmleditor-1.1.4.tar.gz
+BuildRoot: %{_tmppath}/%{name}-buildroot
+
+%description
+XML Editor for KDE.
+
+%prep
+%setup
+CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \
+ \
+ $LOCALFLAGS
+%build
+# Setup for parallel builds
+numprocs=`egrep -c ^cpu[0-9]+ /proc/stat || :`
+if [ "$numprocs" = "0" ]; then
+ numprocs=1
+fi
+
+make -j$numprocs
+
+%install
+make install-strip DESTDIR=$RPM_BUILD_ROOT
+
+cd $RPM_BUILD_ROOT
+find . -type d | sed '1,2d;s,^\.,\%attr(-\,root\,root) \%dir ,' > $RPM_BUILD_DIR/file.list.kxmleditor
+find . -type f | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.kxmleditor
+find . -type l | sed 's,^\.,\%attr(-\,root\,root) ,' >> $RPM_BUILD_DIR/file.list.kxmleditor
+
+%clean
+rm -rf $RPM_BUILD_ROOT/*
+rm -rf $RPM_BUILD_DIR/kxmleditor
+rm -rf ../file.list.kxmleditor
+
+
+%files -f ../file.list.kxmleditor
+
diff --git a/kxmleditor/Makefile.am b/kxmleditor/Makefile.am
new file mode 100644
index 0000000..58a534c
--- /dev/null
+++ b/kxmleditor/Makefile.am
@@ -0,0 +1,51 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+bin_PROGRAMS = kxmleditor
+
+kxmleditor_SOURCES = dcopiface_shell.skel dcopiface_shell.cpp kxmleditorshell.cpp main.cpp kxeshellmanager.cpp
+kxmleditor_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kxmleditor_LDADD = $(LIB_KPARTS) $(LIB_KFILE) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT) $(LIBSOCKET)
+
+EXTRA_DIST = main.cpp \
+ kxmleditor.desktop \
+ kxmleditorshell.cpp kxmleditorshell.h kxmleditorshell.rc \
+ dcopiface_shell.cpp dcopiface_shell.h
+
+install-data-local:
+ $(mkinstalldirs) $(kde_appsdir)/Applications/
+ $(INSTALL_DATA) $(srcdir)/kxmleditor.desktop $(kde_appsdir)/Applications/kxmleditor.desktop
+
+uninstall-local:
+ -rm -f $(kde_appsdir)/Applications/kxmleditor.desktop
+ -rmdir $(kde_appsdir)/Applications
+
+####### kdevelop will overwrite this part!!! (end)############
+# this 10 paths are KDE specific. Use them:
+# kde_htmldir Where your docs should go to. (contains lang subdirs)
+# kde_appsdir Where your application file (.kdelnk) should go to.
+# kde_icondir Where your icon should go to.
+# kde_minidir Where your mini icon should go to.
+# kde_datadir Where you install application data. (Use a subdir)
+# kde_locale Where translation files should go to.(contains lang subdirs)
+# kde_cgidir Where cgi-bin executables should go to.
+# kde_confdir Where config files should go to.
+# kde_mimedir Where mimetypes should go to.
+# kde_toolbardir Where general toolbar icons should go to.
+# kde_wallpaperdir Where general wallpapers should go to.
+
+# set the include path for X, qt and KDE
+INCLUDES= $(all_includes)
+
+METASOURCES = AUTO
+
+rcdir = $(kde_datadir)/kxmleditor
+rc_DATA = kxmleditorshell.rc
+
+messages: rc.cpp
+ LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+ if test -n "$$LIST"; then \
+ if ! test -e $(podir)/kxmleditor.pot; then touch $(podir)/kxmleditor.pot; fi; \
+ $(XGETTEXT) -j $$LIST -o $(podir)/kxmleditor.pot; \
+ fi
+
+noinst_HEADERS = kxeshellmanager.h
diff --git a/kxmleditor/dcopiface_shell.cpp b/kxmleditor/dcopiface_shell.cpp
new file mode 100644
index 0000000..a03d149
--- /dev/null
+++ b/kxmleditor/dcopiface_shell.cpp
@@ -0,0 +1,39 @@
+/***************************************************************************
+ dcopiface_shell.cpp - description
+ -------------------
+ begin : Tue Oct 23 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "dcopiface_shell.h"
+#include "kxmleditorshell.h"
+
+QString
+KXMLEditorShellIface::Quit()
+{
+// m_pKXEShell->close();
+ m_KXEShell.close();
+ return "";
+
+}
+
+
+void
+KXMLEditorShellIface::FileOpen()
+{
+ m_KXEShell.slotFileOpen();
+}
+
+
+
+
diff --git a/kxmleditor/dcopiface_shell.h b/kxmleditor/dcopiface_shell.h
new file mode 100644
index 0000000..63a0f8c
--- /dev/null
+++ b/kxmleditor/dcopiface_shell.h
@@ -0,0 +1,70 @@
+/***************************************************************************
+ dcopiface_shell.h - description
+ -------------------
+ begin : Tue Oct 23 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#ifndef DCOPIFACE_SHELL_H
+#define DCOPIFACE_SHELL_H
+
+#include <dcopobject.h>
+#include <kurl.h>
+
+/**
+ *@short DCOP inteface for Kpart based kxmleditor shell.
+ *@author The KXMLEditor Team
+ * See the shell iface as an user, who can perform the _shell_ actions a live user can.
+ * This means opening a file via an fileopen dialog and not by giving a filename/url (this is up to the part's iface - but read on, I'll come back to it later). This means your openURL function should simply "open" and should show the file open dialog.
+ */
+class KXMLEditorShell;
+
+class KXMLEditorShellIface
+ :virtual public DCOPObject
+{
+ K_DCOP
+protected:
+ /**
+ Pointer to @ref KXMLEditorShell which iface manages.
+ **/
+ KXMLEditorShell & m_KXEShell;
+public:
+ /**
+ * Default constructor with default name of DCOP object used by @ref KXMLEditorShell
+ **/
+ KXMLEditorShellIface(KXMLEditorShell & KXEShell, const char * szDCOPObjectName = "KXMLEditorShellIface")
+ :DCOPObject(szDCOPObjectName)
+ ,m_KXEShell(KXEShell)
+ {
+// m_pKXEShell = pKXEShell;
+ }
+k_dcop:
+
+ /**
+ * Closes entire KXMLEditor.
+ *
+ * @returns Error description or empty string if program closed.
+ **/
+ QString Quit();
+
+
+ /**
+ * Calls and shows open file dialog.
+ **/
+
+ ASYNC FileOpen();
+
+
+};
+
+#endif // DCOPIFACE_SHELL_H
+
diff --git a/kxmleditor/kxeshellmanager.cpp b/kxmleditor/kxeshellmanager.cpp
new file mode 100644
index 0000000..b20b1af
--- /dev/null
+++ b/kxmleditor/kxeshellmanager.cpp
@@ -0,0 +1,55 @@
+//
+// C++ Implementation: kxeshellmanager
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kxeshellmanager.h"
+#include "kxmleditorshell.h"
+
+#include <qptrlist.h>
+
+KXEShellManager::KXEShellManager()
+{
+}
+
+KXEShellManager::~KXEShellManager()
+{
+}
+
+void KXEShellManager::addShell(KXMLEditorShell* pShell)
+{
+/*
+ for (unsigned int i=0; i<m_shells.count();i++)
+ {
+ m_shells.at(i)->slotShellAdded(pShell);
+ pShell->slotShellAdded(m_shells.at(i));
+ }
+ */
+ m_shells.append(pShell);
+}
+
+void KXEShellManager::removeShell(KXMLEditorShell* pShell)
+{
+ m_shells.remove(pShell);
+ /*
+ for (unsigned int i=0; i<m_shells.count();i++)
+ {
+ m_shells.at(i)->slotShellRemoved(pShell);
+ }
+ */
+}
+
+
+/*!
+ \fn KXEShellManager::shells()
+ */
+QPtrList<KXMLEditorShell>* KXEShellManager::shells()
+{
+ return &m_shells;
+}
diff --git a/kxmleditor/kxeshellmanager.h b/kxmleditor/kxeshellmanager.h
new file mode 100644
index 0000000..0eeff8e
--- /dev/null
+++ b/kxmleditor/kxeshellmanager.h
@@ -0,0 +1,65 @@
+//
+// C++ Interface: kxeshellmanager
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KXESHELLMANAGER_H
+#define KXESHELLMANAGER_H
+/**
+@file
+*/
+
+#include <qptrlist.h>
+
+class KXMLEditorShell;
+
+/**
+@short Available shell list
+
+Stores and dispatches informations about all KXMLEditorShell windows currently opened.
+Only one instance of this class is created. Eeach shell adds itself into this manager.
+
+@sa KXMLEditorShell
+
+@author Adam Charytoniuk
+*/
+class KXEShellManager{
+public:
+ /** @short Constructor */
+ KXEShellManager();
+
+ /** @short Destructor */
+ ~KXEShellManager();
+
+ /** @short Adds given part to the manager.
+
+ All opened Shells will be informed about that event by KXMLEditorShell::slotShellAdded()
+ method. In addition, newly added shell will be informed about presence of each of all existing
+ shells with the same method.
+ @param pShell newly added shell
+ */
+ void addShell(KXMLEditorShell* pShell);
+
+ /** @short Removes given part from manager.
+
+ All opened Shells will be informed about that event by KXMLEditorShell::slotShellRemoved()
+ method.
+ @param pShell to be removed (closed)
+ */
+ void removeShell(KXMLEditorShell* pShell);
+
+ /** @short Returns list of currently opened shells. */
+ QPtrList<KXMLEditorShell> *shells();
+
+private:
+ /** @short Internally stores list of available shells. */
+ QPtrList<KXMLEditorShell> m_shells;
+};
+
+#endif
diff --git a/kxmleditor/kxmleditor.desktop b/kxmleditor/kxmleditor.desktop
new file mode 100644
index 0000000..556f62a
--- /dev/null
+++ b/kxmleditor/kxmleditor.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Type=Application
+Exec=kxmleditor -caption "%c" %i %m
+Icon=kxmleditor.png
+DocPath=kxmleditor/index.html
+Comment=XML editor
+Comment[fi]=XML-editori
+Terminal=false
+Name=KXML Editor
+MimeType=text/xml;
+Encoding=UTF-8
+Categories=Application;Development;TextEditor;KDE;
diff --git a/kxmleditor/kxmleditorshell.cpp b/kxmleditor/kxmleditorshell.cpp
new file mode 100644
index 0000000..bbb6f02
--- /dev/null
+++ b/kxmleditor/kxmleditorshell.cpp
@@ -0,0 +1,495 @@
+/***************************************************************************
+ kxmleditorshell.cpp - description
+ -------------------
+ begin : Thu Oct 18 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+ /**
+ @file
+ */
+
+#include "kxmleditorshell.h"
+#include "kxeshellmanager.h"
+#include "../part/kxmleditorpart.h"
+#include "../part/kxedocument.h"
+
+#include <klibloader.h>
+#include <kstdaction.h>
+#include <kapplication.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kfiledialog.h>
+#include <kkeydialog.h>
+#include <kedittoolbar.h>
+#include <kstatusbar.h>
+#include <kparts/browserextension.h>
+#include <kparts/partmanager.h>
+#include <kmessagebox.h>
+
+#include <kpopupmenu.h>
+
+#include <qevent.h>
+
+#include "dcopiface_shell.h"
+
+
+KXEShellManager *KXMLEditorShell::s_manager=0L;
+
+KXMLEditorShell::KXMLEditorShell( const char * name, WFlags f )
+ : KParts::MainWindow( name, f ),
+ m_pPart(0),
+ m_pKXEShellIface(0)
+{
+ //////////////////////////////
+ // CREATE ACTIONS
+ //////////////////////////////
+
+ setXMLFile("kxmleditorshell.rc");
+
+ KStdAction::openNew( this,SLOT(slotActFileNew()),actionCollection() );
+ KStdAction::open( this, SLOT(slotFileOpen()), actionCollection() );
+ m_pActFileOpenRecent = KStdAction::openRecent( this, SLOT(slotFileOpenRecent(const KURL&)), actionCollection() );
+ m_pActFileOpenRecent->loadEntries( instance()->config() );
+ m_pActReload = new KAction( i18n("Reloa&d"), "reload", Key_F5, this, SLOT(slotFileReload()), actionCollection(), "reload" );
+
+ KToggleAction * pActToggleMainToolBar = KStdAction::showToolbar( this, SLOT(slotToggleMainToolBar()), actionCollection() );
+ KToggleAction * pActToggleStatusBar = KStdAction::showStatusbar( this, SLOT(slotToggleStatusBar()), actionCollection() );
+ KStdAction::keyBindings( this, SLOT(slotConfigureKeys()), actionCollection() );
+ KStdAction::configureToolbars( this, SLOT(slotConfigureToolbars()), actionCollection() );
+
+ KStdAction::mail( this, SLOT(mail()), actionCollection() );
+ KStdAction::close( this, SLOT(slotActClose()), actionCollection() );
+ KStdAction::quit( this, SLOT(close()), actionCollection());
+
+ // L.V. moved to part pActPrint = KStdAction::print( 0, 0, actionCollection(), "print" );
+
+ pActCloseW = new KAction( i18n("&Close"), 0, 0, this,SLOT(slotActWindowClose()), actionCollection(), "window_close" );
+ pActCloseAllW = new KAction( i18n("Close &all"), 0, 0, this,SLOT(slotActWindowCloseAll()), actionCollection(), "window_close_all" );
+ pActCloseAllO = new KAction( i18n("Close all &others"), 0, 0, this,SLOT(slotActWindowCloseAllOthers()), actionCollection(), "window_close_all_others" );
+
+ //////////////////////////////
+ // CREATE STATUSBAR
+ //////////////////////////////
+ statusBar()->message( i18n("Ready.") );
+
+ //////////////////////////////
+ // MISC. INITIALIZATION
+ //////////////////////////////
+
+ manager()->addShell(this);
+
+ setAutoSaveSettings();
+ pActToggleMainToolBar->setChecked( ! toolBar()->isHidden() );
+ pActToggleStatusBar->setChecked( ! statusBar()->isHidden() );
+
+ m_pKXEShellIface = new KXMLEditorShellIface(*this);
+
+ statusBar()->setSizeGripEnabled(true);
+
+ setPart(0L); // start empty
+
+}
+
+KXMLEditorShell::~KXMLEditorShell()
+{
+ if (m_pKXEShellIface)
+ delete m_pKXEShellIface;
+
+ manager()->removeShell(this);
+}
+
+/////////////////////////////////////////////////////////////////////
+// ACTION SLOTS
+/////////////////////////////////////////////////////////////////////
+
+void KXMLEditorShell::slotFileOpen()
+{
+ statusBar()->message( i18n("Opening file...") );
+
+ KURL url = KFileDialog::getOpenURL( QString::null,
+ i18n(FILE_DIALOG_FILTER),
+ this );
+ openURL(url);
+
+ // L.V.: tried to meve save functionality to Part
+ //m_pActFileSave->setEnabled(true); // TODO: L.V. Why File Save ? Why not Save as... ?
+
+ statusBar()->message( i18n("Ready.") );
+}
+
+void KXMLEditorShell::slotFileOpenRecent(const KURL & url)
+{
+ statusBar()->message( i18n("Opening file...") );
+
+ openURL(url);
+
+ statusBar()->message( i18n("Ready.") );
+}
+
+void KXMLEditorShell::slotFileReload()
+{
+ statusBar()->message( i18n("Reloading file...") );
+
+ // Try to (re)open the file.
+ // In case the file is modified, a Save/Discard/Cancel message box pops up.
+ if ( part() && ! part()->url().isEmpty() )
+ part()->openURL( part()->url() );
+
+ statusBar()->message( i18n("Ready.") );
+}
+
+void KXMLEditorShell::slotToggleMainToolBar()
+{
+ statusBar()->message( i18n("Toggle the toolbar...") );
+
+ if( toolBar()->isHidden() )
+ toolBar()->show();
+ else
+ toolBar()->hide();
+
+ statusBar()->message( i18n("Ready.") );
+}
+
+
+void KXMLEditorShell::slotToggleStatusBar()
+{
+ statusBar()->message( i18n("Toggle the statusbar...") );
+
+ if( statusBar()->isHidden() )
+ statusBar()->show();
+ else
+ statusBar()->hide();
+
+ statusBar()->message( i18n("Ready.") );
+}
+
+void KXMLEditorShell::slotConfigureKeys()
+{
+ KKeyDialog dlg;
+ dlg.insert(part()->actionCollection());
+ dlg.insert(actionCollection());
+ dlg.configure();
+}
+
+void KXMLEditorShell::slotConfigureToolbars()
+{
+ KEditToolbar dlg( factory() );
+ if ( dlg.exec() )
+ createGUI( part() );
+}
+
+/////////////////////////////////////////////////////////////////////
+// ADDITIONAL FUNCTIONS
+/////////////////////////////////////////////////////////////////////
+
+bool KXMLEditorShell::openURL( const KURL & url )
+{
+ if ( url.isEmpty() )
+ return false;
+
+ // About this function, the style guide (
+ // http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
+ // says that it should open a new window if the document is _not_
+ // in its initial state. This is what we do here.
+
+ // If there is no part yet created, create new one...
+ if (!part())
+ {
+ setPart(createXMLPart(this));
+ }
+
+ // We have to differenciate, if this shell could
+ // be used or a new one has to be created.
+ if ( part()->url().isEmpty() && ! part()->isModified() )
+ {
+ // this one can be used - try to open the file in it
+ if ( ! part()->openURL(url) )
+ return false;
+ }
+ else
+ {
+ // a new one has to be created
+ KXMLEditorShell * pShell = new KXMLEditorShell;
+ // and a new part too...
+ pShell->setPart(createXMLPart(pShell));
+
+ // try to open the file in the shell
+ if ( ! pShell->part()->openURL(url) )
+ return false;
+
+ // show the new shell
+ pShell->show();
+ }
+
+ // on success, the URL could be added to our list of recent files
+ m_pActFileOpenRecent->addURL(url);
+
+ return true;
+}
+
+bool KXMLEditorShell::queryClose()
+{
+ if ( part() && ! part()->closeURL() )
+ return false;
+
+ m_pActFileOpenRecent->saveEntries( instance()->config() );
+
+ return KParts::MainWindow::queryClose();
+}
+
+void KXMLEditorShell::saveProperties( KConfig * pConfig )
+{
+ if (part())
+ {
+ pConfig->writeEntry( "CurrentURL", part()->url().url() );
+ }
+ KParts::MainWindow::saveProperties(pConfig);
+}
+
+void KXMLEditorShell::readProperties( KConfig * pConfig )
+{
+ KParts::MainWindow::readProperties(pConfig);
+
+/// @todo Check if ths is a deadcode
+// QString strURL = pConfig->readEntry( "CurrentURL", "" );
+// if ( strURL.isEmpty())
+// part()->openURL( strURL );
+}
+
+void KXMLEditorShell::slotEnableBrowserExtActions( const char * pszName, bool bEnabled )
+{
+ KAction * pAct = actionCollection()->action( pszName );
+ if ( pAct )
+ pAct->setEnabled( bEnabled );
+ else
+ kdDebug() << "KXMLEditor " << k_funcinfo << " unknown action (" << pszName << ")" << endl;
+}
+
+// Set main window caption (by using the base class functionality),
+// Enables/disables Save button (corresponding to the parts modified status)
+void KXMLEditorShell::setCaption( const QString & strCaption )
+{
+ if (part())
+ {
+ KParts::MainWindow::setCaption( strCaption, part()->isModified() ); // base class functionality
+ }
+}
+
+
+//
+// Called when creating new file is requested.
+//
+void KXMLEditorShell::slotActFileNew()
+{
+
+ // About this function, the style guide (
+ // http://developer.kde.org/documentation/standards/kde/style/basics/index.html )
+ // says that it should open a new window if the document is _not_
+ // in its initial state. This is what we do here..
+ KXMLEditorShell * pShell;
+ KParts::ReadWritePart* pPart;
+
+ // 1. This shell is empty
+ if (!part())
+ {
+ pPart = createXMLPart(this);
+ pShell=this;
+ }
+ // 2. The shell contains modified part
+ else if (! part()->url().isEmpty() || part()->isModified() )
+ {
+ pShell = new KXMLEditorShell;
+ pPart = createXMLPart(pShell);
+ pShell->show();
+ }
+ // 3. The shell contains part, and it is empty and not modified
+ else
+ {
+ pPart=part();
+ pShell=this;
+ }
+
+ pShell->setPart(pPart);
+ // if there is a way to determine in KXMLEditorPart that it was created "for new file" then
+ // this part should be changed.
+ ((KXMLEditorPart *)pPart)->document()->newFile();
+}
+
+void KXMLEditorShell::mail()
+{
+ // L.V.: tried to meve save functionality to Part
+ //slotFileSave();
+
+ // first - our XML file have to be saved.
+ part()->save();
+
+ if (!part()->url().isEmpty())
+ {
+ QStringList urls(part()->url().url()); // we can prepare then list of attachments (1 element in the list)
+ QString theSubject(part()->url().fileName(false)); // and set the mail subject
+ kapp->invokeMailer(QString::null, // finally we can compose e-mail (addressed to no-one) out of that
+ QString::null,
+ QString::null,
+ theSubject, // subject
+ QString::null, // body
+ QString::null,
+ urls); // attachments
+ }
+}
+
+void KXMLEditorShell::setPart(KParts::ReadWritePart* pPart)
+{
+ if (pPart==m_pPart)
+ return; // nothing to do here...
+ else
+ {
+ if(pPart)
+ {
+ connect(static_cast <KXMLEditorPart *> (pPart), SIGNAL(sigAddRecentURL(const KURL &)),
+ this, SLOT(slotAddRecentURL(const KURL &)) );
+ }
+ }
+
+ if (m_pPart)
+ {
+ factory()->removeClient(m_pPart);
+ delete m_pPart;
+ }
+ m_pPart = pPart;
+ if (pPart)
+ {
+ // get the parts browser extension and connect additional actions to it
+ KParts::BrowserExtension * pBrowserExt = 0;
+ if ( (pBrowserExt = KParts::BrowserExtension::childObject(pPart)) ) // if there is one
+ {
+ connect( pBrowserExt, SIGNAL(enableAction( const char *, bool )), this, SLOT(slotEnableBrowserExtActions( const char *, bool )) );
+
+ // L.V. moved to part. connect(pActPrint,SIGNAL(activated()),pBrowserExt, SLOT(print()));
+ //pActPrint->setEnabled(pBrowserExt->isActionEnabled("print"));
+ }
+
+ createGUI(pPart);
+ setCentralWidget(pPart->widget() );
+ pPart->widget()->show();
+ stateChanged("part");
+ }
+ else
+ {
+ createGUI(0L);
+ setCentralWidget(0L);
+ stateChanged("empty");
+ }
+
+ // keep pointer to window menu
+ m_windowMenu = static_cast<KPopupMenu*>(factory()->container("window", this));
+ if(!m_windowMenu)
+ kdDebug() << "KXMLEditorShell::setPart - m_windowMenu is NULL" << endl;
+ else
+ connect(m_windowMenu,SIGNAL(aboutToShow()),this,SLOT(slotBeforeWindowMenuShown()));
+}
+
+KParts::ReadWritePart* KXMLEditorShell::createXMLPart(QObject *parent)
+{
+ return createPart(parent,"libkxmleditorpart", "KParts::ReadWritePart");
+}
+
+KParts::ReadWritePart* KXMLEditorShell::createPart(QObject *parent, const QString& libName, const QString& className)
+{
+ KParts::ReadWritePart* newPart = 0L;
+ KLibFactory * pFactory = KLibLoader::self()->factory(libName);
+ if (pFactory)
+ newPart = static_cast <KParts::ReadWritePart*> ( pFactory->create( parent, "KXMLEditor view", className ) );
+ else
+ kdFatal() << "KXMLEditorShell::KXMLEditorShell no " << libName << " found" << endl;
+ return newPart;
+}
+
+void KXMLEditorShell::slotActClose()
+{
+ if (part() && part()->queryClose())
+ setPart(0L);
+}
+
+void KXMLEditorShell::close()
+{
+ if (queryClose())
+ {
+ if (KMainWindow::memberList->count()==1)
+ kapp->deref();
+ delete this;
+ }
+}
+
+void KXMLEditorShell::slotActWindowCloseAllOthers()
+{
+ QPtrListIterator<KMainWindow> it(*KMainWindow::memberList);
+ for (it.toFirst();it.current();++it)
+ {
+ if (it.current()!=this)
+ it.current()->close();
+ }
+}
+
+ void KXMLEditorShell::slotActWindowClose()
+{
+ this->close();
+}
+
+void KXMLEditorShell::slotActWindowCloseAll()
+{
+ slotActWindowCloseAllOthers();
+ slotActWindowClose();
+}
+
+KXEShellManager* KXMLEditorShell::manager()
+{
+ if (!s_manager)
+ {
+ s_manager = new KXEShellManager();
+ }
+ return s_manager;
+}
+
+void KXMLEditorShell::slotBeforeWindowMenuShown()
+{
+ // first we have to clean all shell items...
+ m_windowMenu->clear();
+
+ // then we plug-in neccessary actions...
+ pActCloseW->plug(m_windowMenu);
+ pActCloseAllW->plug(m_windowMenu);
+ pActCloseAllO->plug(m_windowMenu);
+ m_windowMenu->insertSeparator();
+
+ // and then we can add entries for all shells
+ // that are registered in Shell Manager...
+ QPtrListIterator<KXMLEditorShell> it (*(manager()->shells()));
+ for (it.toFirst(); it.current();++it)
+ {
+ int id = m_windowMenu->insertItem(it.current()->caption(),it.current(),SLOT(slotActivate()));
+ m_windowMenu->setItemChecked(id,it.current()==this);
+ }
+}
+
+void KXMLEditorShell::slotActivate()
+{
+ /// @todo windows have to be activated over EWMH
+ showNormal(); // show it if it's minimized
+ raise(); // bring that to front
+}
+
+// Add URL to recent file list
+void KXMLEditorShell::slotAddRecentURL(const KURL &url)
+{
+ m_pActFileOpenRecent->addURL(url);
+}
diff --git a/kxmleditor/kxmleditorshell.h b/kxmleditor/kxmleditorshell.h
new file mode 100644
index 0000000..848e47a
--- /dev/null
+++ b/kxmleditor/kxmleditorshell.h
@@ -0,0 +1,178 @@
+/***************************************************************************
+ kxmleditorshell.h - description
+ -------------------
+ begin : Thu Oct 18 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+ /**
+ @file
+ */
+
+
+#ifndef KXMLEDITORSHELL_H
+#define KXMLEDITORSHELL_H
+
+#include <kparts/mainwindow.h>
+
+class KParts::ReadWritePart;
+class KXMLEditorShellIface;
+class KAction;
+class KXEShellManager;
+
+
+/**
+ @short The shell, which can contain our #KXMLEditorPart.
+
+ It is the window that owns main user interface elements.
+*/
+class KXMLEditorShell : public KParts::MainWindow
+{
+ Q_OBJECT
+ public:
+ /** @short Constructor
+
+ Creates shell and adds it into one global instance of KXEShellManager.
+ @sa KXEShellManager
+ */
+ KXMLEditorShell( const char * name = 0L, WFlags f = WDestructiveClose );
+
+ /** @short Destructor
+
+ Destroys shell. Performs also removing given shell from global instance
+ of KXEShellManager.
+ */
+ virtual ~KXMLEditorShell();
+
+ /** @short Opens new file and shows it in the current shell. */
+ bool openURL( const KURL & url ) ;
+
+ /** @short Closes this shell. */
+ virtual void close();
+
+ /** @short Returns part manager object */
+ KXEShellManager* manager();
+
+ /** @short Creates new part which can be shown in the shell.
+ @param parent parent object for the part*/
+ static KParts::ReadWritePart* createXMLPart(QObject *parent) ;
+
+ static KParts::ReadWritePart* createPart(QObject *parent, const QString& libName, const QString& className);
+
+ /** @short Changes currenly shown part. */
+ void setPart(KParts::ReadWritePart* pPart);
+
+ public slots:
+ /** @short Slot connected to File->New action. */
+ void slotActFileNew();
+
+ /** @short Slot connected to File->Open action. */
+ void slotFileOpen();
+
+ void slotFileOpenRecent( const KURL & url );
+
+ /** @short Slot connected to File->Reload action. */
+ void slotFileReload();
+
+ /** @short Slot connected to action responsible for showing and hiding main toolbar.*/
+ void slotToggleMainToolBar();
+
+ /** @short Slot connected to action responsible for showing and hiding status bar.*/
+ void slotToggleStatusBar();
+
+ /** @short Slot connected to action. Shows shortcut configuration dialog.*/
+ void slotConfigureKeys();
+
+ /** @short Slot connected to action. Shows toolbar configuration dialog.*/
+ void slotConfigureToolbars();
+
+ /** @short Changes shell caption.*/
+ virtual void setCaption( const QString & strCaption );
+
+ /** @short Sends currently opened XML file over e-mail.
+
+ The application will try to start default mail client and prepare
+ new empty mail with currently opened file as an attachment.
+ The file have to be saved first on a disc.
+ @sa KApplication::invokeMailer()
+ */
+ void mail();
+
+ /** @short Connected to File->Close action
+
+ Closes currently opened file, but not the shell itself. The shell
+ remaines empty but active, so it's possible for the user
+ to open another file in it.*/
+ void slotActClose();
+
+ /** @short slot connected to Window->Close action.
+ @sa close() */
+ void slotActWindowClose();
+
+ /** @short slot connected to Window->Close All action. */
+ void slotActWindowCloseAll();
+
+ /** @short slot connected to Window->Close All Others action. */
+ void slotActWindowCloseAllOthers();
+
+ void slotActivate();
+
+ protected:
+ virtual bool queryClose();
+ virtual void saveProperties( KConfig * );
+ virtual void readProperties( KConfig * );
+
+ /** @short Stores pointer to currenly shown part. */
+ KParts::ReadWritePart * m_pPart;
+
+ /** @short Action for recently opened files. */
+ KRecentFilesAction * m_pActFileOpenRecent;
+
+ /** @short Action for reloading the document currently open. */
+ KAction * m_pActReload;
+
+ /** @short Action for printing complete XML files.*/
+ // L.V. moved to part. KAction* pActPrint;
+
+ KAction* pActCloseW;
+ KAction* pActCloseAllW;
+ KAction* pActCloseAllO;
+
+ /** @short DCOP interface pointer (if no such iface pointer == 0).*/
+ KXMLEditorShellIface * m_pKXEShellIface;
+
+ /** @short Stores pointer to window menu.
+
+ This menu is expanded everytime new shell is shown. */
+ KPopupMenu* m_windowMenu;
+
+ /** @short Returns currently shown part. */
+ KParts::ReadWritePart* part() const {return m_pPart;}
+
+ /** @short Adds this shell window to part manager for monitoring */
+// void addToManager();
+
+ protected slots:
+ /** To enable/disable actions, the way the parts browser extension wishes. */
+ void slotEnableBrowserExtActions( const char * pszName, bool bEnabled );
+
+ void slotBeforeWindowMenuShown();
+
+ // Add URL to recent file list
+ void slotAddRecentURL(const KURL &);
+
+ private:
+ /** @short Stores pointer to global instance of #KParts::PartManager */
+ static KXEShellManager *s_manager;
+};
+
+#endif
diff --git a/kxmleditor/kxmleditorshell.rc b/kxmleditor/kxmleditorshell.rc
new file mode 100644
index 0000000..2ddfba2
--- /dev/null
+++ b/kxmleditor/kxmleditorshell.rc
@@ -0,0 +1,31 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kxmleditorshell" version="2">
+
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="reload"/>
+ <Separator lineSeparator="true"/>
+
+ <Merge/>
+
+ </Menu>
+ <Merge/>
+ <Menu name="window"><text>&amp;Window</text>
+ <Action name="window_close"/>
+ <Action name="window_close_all"/>
+ <Action name="window_close_all_others"/>
+ </Menu>
+ <Menu name="help"><text>&amp;Help</text>
+ </Menu>
+</MenuBar>
+
+<ToolBar fullWidth="true" name="mainToolBar" newline="true" position="top"><text>Main Toolbar</text>
+ <DefineGroup name="file_operations" />
+ <Action name="new" group="file_operations" />
+ <Action name="open" group="file_operations" />
+ <Merge/>
+ <Separator/>
+ <Merge/>
+</ToolBar>
+
+</kpartgui>
diff --git a/kxmleditor/main.cpp b/kxmleditor/main.cpp
new file mode 100644
index 0000000..23b1f8a
--- /dev/null
+++ b/kxmleditor/main.cpp
@@ -0,0 +1,139 @@
+/***************************************************************************
+ main.cpp - description
+ -------------------
+ begin : � �c 10 12:39:26 CEST 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <dcopclient.h>
+
+//#include "kxmleditor.h"
+#include "../part/kxmleditorabout.h"
+#include "kxmleditorshell.h"
+
+
+static KCmdLineOptions options[] =
+{
+ { "+[File(s)]", I18N_NOOP("XML file(s) to open"), 0 },
+ { 0, 0, 0 }
+};
+
+#define USE_KPART 1
+ // if set to true makes kxmleditor to be kpart based (currently developement version only)
+
+/** @short Main application function that starts-up the application */
+int main(int argc, char *argv[])
+{
+ KCmdLineArgs::init( argc, argv, new KXMLEditorAboutData() );
+ KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+
+ KApplication app;
+
+ // comment the following lines to use KXMLEditorShell instead of KXMLEditorApp
+#if ! USE_KPART
+ if (app.isRestored())
+ { RESTORE(KXMLEditorApp);
+ }
+ else
+ {
+ KXMLEditorApp *kxmleditor = new KXMLEditorApp();
+ kxmleditor->show();
+
+ KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+ if(args->count())
+ { QString strPath;
+
+ if(args->count() > 1)
+ { strPath = args->arg(1);
+ }
+ KURL url(args->arg(0));
+ if ( ! url.isValid() )
+ { // probably user entered just filename
+ url.setProtocol("file");
+ url.setPath(args->arg(0));
+ }
+ kxmleditor->openDocumentFile(url, strPath);
+ }
+ else
+ { kxmleditor->openDocumentFile();
+ }
+ args->clear();
+ }
+#else // USE_KPART
+
+ if (app.isRestored())
+ {
+ RESTORE(KXMLEditorShell);
+ }
+ else
+ {
+ KCmdLineArgs * pArgs = KCmdLineArgs::parsedArgs();
+ KXMLEditorShell * pShell;
+ bool bNoCorrectInstance = true;
+ if ( pArgs->count() > 0 )
+ {
+ for( int i = 0; i < pArgs->count(); i++ )
+ {
+ KURL url(pArgs->arg(i));
+ if ( ! url.isValid() )
+ {
+ url.setProtocol("file");
+ url.setPath(pArgs->arg(i));
+ }
+ pShell = new KXMLEditorShell();
+ if ( pShell->openURL(url) )
+ {
+ pShell->show();
+ bNoCorrectInstance = false;
+ }
+ else
+ {
+ kdDebug() << "Couldn't open file " << url.path() << endl;
+ KMessageBox::sorry(0, i18n("Couldn't open file !") + "\n" + url.path());
+ delete pShell;
+ }
+ }
+ }
+ else
+ {
+ pShell = new KXMLEditorShell();
+ KParts::ReadWritePart* pPart = KXMLEditorShell::createXMLPart(pShell);
+ pShell->setPart(pPart);
+ pShell->show();
+ bNoCorrectInstance = false;
+ }
+ pArgs->clear();
+
+ if ( bNoCorrectInstance )
+ return FALSE;
+ }
+
+ // registration as multi-instance DCOP client
+ DCOPClient *client = app.dcopClient();
+ client->attach();
+ client->registerAs(kapp->name());
+
+ // uncomment end
+#endif // USE_KPART
+
+ int iRetVal = app.exec();
+ return iRetVal;
+}
+
diff --git a/part/Makefile.am b/part/Makefile.am
new file mode 100644
index 0000000..3a1e59a
--- /dev/null
+++ b/part/Makefile.am
@@ -0,0 +1,53 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+lib_LTLIBRARIES = libkxmleditorpart.la
+
+libkxmleditorpart_la_SOURCES = kxesearchdialogbase.ui kxesearchdialog.cpp kxeprocinstrdialogbase.ui kxeprocinstrdialog.cpp kxespecprocinstrdialogbase.ui kxespecprocinstrdialog.cpp kxeelementdialogbase.ui kxeelementdialog.cpp kxeattributedialogbase.ui kxeattributedialog.cpp kxechardatadialogbase.ui kxechardatadialog.cpp kxeattachdialogbase.ui kxechoosestringdialogbase.ui kxechoosestringdialog.cpp kxefilenewdialog.cpp kxeconfiguration.cpp kxesettings.cpp kxetreeviewsettingspage.ui kxetreeviewsettings.cpp kxenewfilesettingspage.ui kxenewfilesettings.cpp kxeprintsettingspage.ui kxeprintsettings.cpp kxearchiveextssettingspage.ui kxearchiveextssettings.cpp kxetextviewsettingspage.ui kxetextviewsettings.cpp kxe_treeviewitem.cpp kxe_treeview.cpp kxe_viewelement.cpp kxe_viewattributes.cpp kxesyntaxhighlighter.cpp kxetexteditordialogbase.ui kxetexteditordialog.cpp actions.cpp qdom_add.cpp kxecommand.cpp commands_file.cpp commands_edit.cpp commands_insert.cpp kxmleditorpart.cpp kxmleditorfactory.cpp dcopiface_part_ro.skel dcopiface_part_ro.cpp kxedocument.cpp
+
+libkxmleditorpart_la_LDFLAGS = -module $(all_libraries) -version-info 1:0:0
+libkxmleditorpart_la_LIBADD = $(LIB_KDEPRINT) $(LIB_KPARTS) $(LIB_KFILE) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_QT)
+
+SUBDIRS = pics icons
+
+EXTRA_DIST = kxmleditorpartBrowseUI.rc kxmleditorpartEditUI.rc kxedocument.rc kxmleditorpart.desktop
+
+
+install-data-local:
+ $(mkinstalldirs) $(kde_servicesdir)
+ $(INSTALL_DATA) $(srcdir)/kxmleditorpart.desktop $(kde_servicesdir)/kxmleditorpart.desktop
+
+uninstall-local:
+ -rm -f $(kde_servicesdir)/kxmleditorpart.desktop
+ -rmdir $(kde_servicesdir)
+
+####### kdevelop will overwrite this part!!! (end)############
+# this 10 paths are KDE specific. Use them:
+# kde_htmldir Where your docs should go to. (contains lang subdirs)
+# kde_appsdir Where your application file (.kdelnk) should go to.
+# kde_icondir Where your icon should go to.
+# kde_minidir Where your mini icon should go to.
+# kde_datadir Where you install application data. (Use a subdir)
+# kde_locale Where translation files should go to.(contains lang subdirs)
+# kde_cgidir Where cgi-bin executables should go to.
+# kde_confdir Where config files should go to.
+# kde_mimedir Where mimetypes should go to.
+# kde_toolbardir Where general toolbar icons should go to.
+# kde_wallpaperdir Where general wallpapers should go to.
+
+# set the include path for X, qt and KDE
+INCLUDES= $(all_includes)
+
+METASOURCES = AUTO
+
+rcdir = $(kde_datadir)/kxmleditor
+rc_DATA = kxmleditorpartBrowseUI.rc kxmleditorpartEditUI.rc kxedocument.rc
+
+messages: rc.cpp
+ LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+ if test -n "$$LIST"; then \
+ if ! test -e $(podir)/kxmleditor.pot; then touch $(podir)/kxmleditor.pot; fi; \
+ $(XGETTEXT) -j $$LIST -o $(podir)/kxmleditor.pot; \
+ fi
+
+
+noinst_HEADERS = kxesearchdialog.h kxeprocinstrdialog.h kxespecprocinstrdialog.h kxeelementdialog.h kxeattributedialog.h kxechardatadialog.h kxechoosestringdialog.h kxefilenewdialog.h kxeconfiguration.h kxesettings.h kxetreeviewsettings.h kxenewfilesettings.h kxeprintsettings.h kxearchiveextssettings.h kxetextviewsettings.h kxe_treeviewitem.h kxe_treeview.h kxe_viewelement.h kxe_viewattributes.h kxesyntaxhighlighter.h kxetexteditordialog.h actions.h qdom_add.h kxecommand.h commands_file.h commands_edit.h commands_insert.h kxmleditorabout.h kxmleditorpart.h kxmleditorfactory.h dcopiface_part_ro.h kxedocument.h
diff --git a/part/actions.cpp b/part/actions.cpp
new file mode 100644
index 0000000..8b6abcb
--- /dev/null
+++ b/part/actions.cpp
@@ -0,0 +1,229 @@
+/***************************************************************************
+ actions.cpp - description
+ -------------------
+ begin : Tue Jul 10 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "actions.h"
+
+// include files for QT
+
+#include <qwhatsthis.h>
+#include <qdragobject.h>
+#include <qcombobox.h>
+#include <qapplication.h>
+
+// include files for KDE
+#include <ktoolbar.h>
+#include <kiconloader.h>
+#include <kmimetype.h>
+#include <kdebug.h>
+
+//-------------------------------------------------------------------
+//
+// KXmlEditorComboAction member functions
+//
+//-------------------------------------------------------------------
+
+KXmlEditorComboAction::KXmlEditorComboAction(const QString& text,
+ int accel,
+ const QObject *receiver,
+ const char *member,
+ QObject* parent,
+ const char* name)
+ : KAction(text, accel, parent, name),
+ m_pCombo(0)
+{
+ m_receiver = receiver;
+ m_member = member;
+}
+
+KXmlEditorComboAction::~KXmlEditorComboAction()
+{
+ //delete m_pCombo; // L.V. this cause crash !!!
+}
+
+QComboBox* KXmlEditorComboAction::comboBox()
+{
+ return m_pCombo;
+}
+
+int KXmlEditorComboAction::plug(QWidget *w, int index)
+{
+ // if ( !w->inherits( "KToolBar" ) );
+ // return -1;
+
+ KToolBar *toolBar = (KToolBar *) w;
+
+ int id = KAction::getToolButtonID();
+ //kdDebug() << "KXmlEditorComboAction::plug id=" << id << endl;
+
+ m_pCombo = new QComboBox( toolBar, "Path Combo" );
+ m_pCombo->setEditable(true);
+ m_pCombo->setInsertionPolicy(QComboBox::NoInsertion);
+ toolBar->insertWidget( id, 70, m_pCombo, index );
+ connect( m_pCombo, SIGNAL(activated(const QString&)), m_receiver, m_member );
+
+ addContainer( toolBar, id );
+
+ connect(toolBar, SIGNAL(destroyed()), this, SLOT(slotDestroyed()));
+
+ toolBar->setItemAutoSized(id, true);
+
+ QWhatsThis::add( m_pCombo, whatsThis() );
+
+ return containerCount() - 1;
+}
+
+void KXmlEditorComboAction::unplug(QWidget *w)
+{
+// if ( !w->inherits( "KToolBar" ) )
+// return;
+
+ KToolBar *toolBar = (KToolBar *)w;
+
+ int idx = findContainer( w );
+ //kdDebug() << "KXmlEditorComboAction::unplug idx=" << idx << " menuId=" << menuId(idx) << endl;
+
+ toolBar->removeItem( menuId( idx ) );
+
+ removeContainer( idx );
+ m_pCombo = 0;
+}
+
+void KXmlEditorComboAction::slotClear()
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::slotClear] action not plugged" << endl;
+ return;
+ }
+
+ m_pCombo->clear();
+}
+
+void KXmlEditorComboAction::slotClearEdit()
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::slotClearEdit] action not plugged" << endl;
+ return;
+ }
+
+ m_pCombo->clearEdit();
+}
+
+void KXmlEditorComboAction::slotFocusEdit()
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::slotFocusEdit] action not plugged" << endl;
+ return;
+ }
+
+ m_pCombo->setFocus();
+}
+
+QString KXmlEditorComboAction::currentText() const
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::currentText] action not plugged" << endl;
+ return QString::null;
+ }
+
+ return m_pCombo->currentText();
+}
+
+const QPixmap * KXmlEditorComboAction::currentPixmap() const
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::currentPixmap] action not plugged" << endl;
+ return 0;
+ }
+
+ return m_pCombo->pixmap( m_pCombo->currentItem() );
+}
+
+void KXmlEditorComboAction::insertItem( const QPixmap & pixmap, const QString & text )
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::insertItem] action not plugged" << endl;
+ return;
+ }
+
+ if ( text.isEmpty() )
+ kdWarning() << "[KXmlEditorComboAction::insertItem] empty string as parameter" << endl;
+
+ int nIndex = findItem(text);
+ if ( nIndex != -1 )
+ m_pCombo->removeItem(nIndex);
+
+ m_pCombo->insertItem( pixmap, text, 0 );
+ m_pCombo->setCurrentItem(0);
+
+ if ( m_pCombo->count() > 15 )
+ m_pCombo->removeItem(15);
+}
+
+void KXmlEditorComboAction::removeItem( const QString & text )
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::removeItem] action not plugged" << endl;
+ return;
+ }
+
+ int nIndex = findItem(text);
+ if ( nIndex == -1 )
+ {
+ kdDebug() << "KXmlEditorComboAction::removeItem] item not found" << endl;
+ return;
+ }
+
+ m_pCombo->removeItem(nIndex);
+}
+
+int KXmlEditorComboAction::findItem( const QString & text )
+{
+ if ( containerCount() == 0 )
+ {
+ kdWarning() << "[KXmlEditorComboAction::findItem] action not plugged" << endl;
+ return -1;
+ }
+
+ int nIndex = -1;
+ int i=0;
+ while ( ( i < m_pCombo->count() ) && ( nIndex == -1 ) )
+ {
+ if ( m_pCombo->text(i) == text )
+ nIndex = i;
+ i++;
+ }
+
+ return nIndex;
+}
+
+ToolbarLabel::ToolbarLabel( const QString& text )
+ : QLabel( text, 0L, "kde toolbar widget" ) // Use this name for it to be styled!
+// , m_mw(mw)
+{
+ setBackgroundMode( Qt::PaletteButton );
+ setAlignment( (QApplication::reverseLayout() ? Qt::AlignRight : Qt::AlignLeft) |
+ Qt::AlignVCenter | Qt::ShowPrefix );
+ adjustSize();
+ }
+
diff --git a/part/actions.h b/part/actions.h
new file mode 100644
index 0000000..43d0967
--- /dev/null
+++ b/part/actions.h
@@ -0,0 +1,88 @@
+/***************************************************************************
+ actions.h - description
+ -------------------
+ begin : Tue Jul 10 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef ACTIONS_H
+#define ACTIONS_H
+
+#include <kaction.h>
+#include <qlabel.h>
+class QComboBox;
+
+/**
+ *@author Lumir Vanek
+ */
+
+class KXmlEditorComboAction : public KAction
+{
+ Q_OBJECT
+public:
+ KXmlEditorComboAction(const QString& text, int accel, const QObject *receiver, const char *member, QObject* parent, const char* name);
+ ~KXmlEditorComboAction();
+
+ virtual int plug(QWidget *w, int index = -1);
+
+ virtual void unplug(QWidget *w);
+
+ /** Returns the text from the combobox' editline (@ref QComboBox::currentText). */
+ QString currentText() const;
+
+ /** Returns the current pixmap or 0, if there isn't any (see @ref QComboBox::pixmap). */
+ const QPixmap * currentPixmap() const;
+
+ /**
+ * Inserts the given item as the first.
+ * Deletes the old entry, if the item was already in the list.
+ */
+ void insertItem( const QPixmap & pixmap, const QString & text );
+
+ /** Tries to remove the item with the given text. */
+ void removeItem( const QString & text );
+
+ /** returns combo box */
+ QComboBox *comboBox();
+
+public slots:
+ /** Clears the whole combobox using @ref QComboBox::clear. */
+ void slotClear();
+ /** Clears the combobox' editline. */
+ void slotClearEdit();
+ /** Gives focus to the combobox' editline. */
+ void slotFocusEdit();
+
+protected:
+ /**
+ * Tries to find an item with the given text. If it finds it,
+ * the items id is returned, otherwise -1.
+ */
+ virtual int findItem( const QString & text );
+
+private:
+ const QObject *m_receiver;
+ const char *m_member;
+ QComboBox * m_pCombo;
+};
+
+
+class ToolbarLabel : public QLabel
+{
+ Q_OBJECT
+public:
+ ToolbarLabel( const QString & text );
+};
+
+
+#endif
diff --git a/part/commands_edit.cpp b/part/commands_edit.cpp
new file mode 100644
index 0000000..ba298b0
--- /dev/null
+++ b/part/commands_edit.cpp
@@ -0,0 +1,778 @@
+/***************************************************************************
+ commands_edit - description
+ -------------------
+ begin : Wed Nov 26 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : a_charytoniuk@user.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#include "commands_edit.h"
+
+#include <kdebug.h>
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Cutting element to clipboard //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXECutCommand::KXECutCommand(KXEDocument *pDocument, QDomNode &domNode)
+ : KXEDeleteNodeCommand(pDocument, domNode)
+{
+}
+
+KXECutCommand::~KXECutCommand()
+{
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Pasting node from clipboard to document //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEPasteToDocumentCommand::KXEPasteToDocumentCommand(
+ KXEDocument *pDocument,
+ QDomDocument *pDomTargetDoc,
+ QDomElement &domSourceElement
+ )
+ : KXECommand(pDocument)
+{
+ if ( pDomTargetDoc == 0 )
+ kdError() << "KXEPasteToDocumentCommand::KXEPasteToDocumentCommand the given XML document object is empty." << endl;
+
+ m_pDomTargetDoc = pDomTargetDoc;
+ m_domSourceElement = domSourceElement;
+}
+
+KXEPasteToDocumentCommand::~KXEPasteToDocumentCommand()
+{
+}
+
+void KXEPasteToDocumentCommand::execute()
+{
+ // Insert root element
+ QDomNode newNode = m_pDomTargetDoc->importNode(m_domSourceElement, true);
+ m_pDomTargetDoc->appendChild(newNode);
+ m_pDocument->updateNodeCreated(newNode);
+}
+
+void KXEPasteToDocumentCommand::unexecute()
+{
+ QDomNode removedNode = m_pDomTargetDoc->removeChild( m_pDomTargetDoc->documentElement());
+
+ if ( removedNode.isNull() )
+ kdError() << "KXEPasteToDocumentCommand::unexecute error removing node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(removedNode);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Pasting node from clipboard to element //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEPasteToElementCommand::KXEPasteToElementCommand(
+ KXEDocument *pDocument,
+ QDomElement & domTargetElement,
+ QDomNode &domSourceNode
+ )
+ : KXECommand(pDocument)
+{
+ if ( domTargetElement.isNull() )
+ kdError() << "KXEPasteCommand::KXEPasteCommand the given XML element object is empty." << endl;
+
+ m_domTargetElement = domTargetElement;
+ m_domSourceNode = domSourceNode;
+}
+
+KXEPasteToElementCommand::~KXEPasteToElementCommand()
+{
+}
+
+void KXEPasteToElementCommand::execute()
+{
+ m_domTargetElement.appendChild(m_domSourceNode);
+ m_pDocument->updateNodeCreated(m_domSourceNode);
+}
+
+void KXEPasteToElementCommand::unexecute()
+{
+ if ( m_domSourceNode.parentNode().removeChild( m_domSourceNode ).isNull() )
+ kdError() << "KXEPasteToElementCommand::unexecute error removing the node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domSourceNode);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Pasting proc.instr from clipboard to proc.instr //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEPasteToProcInstrCommand::KXEPasteToProcInstrCommand(
+ KXEDocument *pDocument,
+ QDomProcessingInstruction &domTargetProcInstr,
+ QDomProcessingInstruction &domSourceProcInstr
+ )
+ : KXECommand(pDocument)
+{
+ if ( domTargetProcInstr.isNull() )
+ kdError() << "KXEPasteToProcInstrCommand::KXEPasteToProcInstrCommand the given object is empty." << endl;
+
+ if ( domSourceProcInstr.isNull() )
+ kdError() << "KXEPasteToProcInstrCommand::KXEPasteToProcInstrCommand the given object is empty." << endl;
+
+ m_domTargetProcInstr = domTargetProcInstr;
+ m_strNewData = domSourceProcInstr.data();
+}
+
+KXEPasteToProcInstrCommand::~KXEPasteToProcInstrCommand()
+{
+}
+
+void KXEPasteToProcInstrCommand::execute()
+{
+ // Replace contents of selected proc. instr.
+ m_strOldData = m_domTargetProcInstr.data();
+ m_domTargetProcInstr.setData(m_strNewData);
+ m_pDocument->updateNodeChanged(m_domTargetProcInstr);
+}
+
+void KXEPasteToProcInstrCommand::unexecute()
+{
+ // Rverse action.
+ m_domTargetProcInstr.setData(m_strOldData);
+ m_pDocument->updateNodeChanged(m_domTargetProcInstr);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Pasting char. data from clipboard to char. data //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+
+KXEPasteToCharDataCommand::KXEPasteToCharDataCommand(
+ KXEDocument *pDocument,
+ QDomCharacterData &domTargetCharData,
+ QDomCharacterData &domSourceCharData
+ )
+ : KXECommand(pDocument)
+{
+ if ( domTargetCharData.isNull() )
+ kdError() << "KXEPasteToCharDataCommand::KXEPasteToCharDataCommand the given object is empty." << endl;
+
+ if ( domSourceCharData.isNull() )
+ kdError() << "KXEPasteToCharDataCommand::KXEPasteToCharDataCommand the given object is empty." << endl;
+
+ m_domTargetCharData = domTargetCharData;
+ m_strNewData = domSourceCharData.data();
+}
+
+KXEPasteToCharDataCommand::~KXEPasteToCharDataCommand()
+{
+}
+
+void KXEPasteToCharDataCommand::execute()
+{
+ // replace target contents with source
+ m_strOldData = m_domTargetCharData.data();
+ m_domTargetCharData.setData(m_strNewData);
+ m_pDocument->updateNodeChanged(m_domTargetCharData);
+}
+
+void KXEPasteToCharDataCommand::unexecute()
+{
+ m_domTargetCharData.setData(m_strOldData);
+ m_pDocument->updateNodeChanged(m_domTargetCharData);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Drag & drop node //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEDragDropMoveCommand::KXEDragDropMoveCommand(
+ KXEDocument *pDocument,
+ QDomElement & domTargetElement,
+ QDomNode &domSourceNode
+ )
+ : KXECommand(pDocument)
+{
+ if ( domTargetElement.isNull() )
+ kdError() << "KXEDragDropMoveCommand::KXEDragDropMoveCommand the given XML element object is empty." << endl;
+
+ m_domTargetElement = domTargetElement;
+ m_domSourceNode = domSourceNode;
+ m_domPreviousParentNode = m_domSourceNode.parentNode();
+}
+
+KXEDragDropMoveCommand::~KXEDragDropMoveCommand()
+{
+}
+
+void KXEDragDropMoveCommand::execute()
+{
+ // 1st, remove source node from its parent
+ if( m_domPreviousParentNode.removeChild( m_domSourceNode ).isNull() )
+ kdError() << "KXEDocument::slotXmlElementDelete error removing the selected node." << endl;
+ else
+ m_pDocument->updateNodeDeleted(m_domSourceNode);
+
+ // 2nd, append moved node to new parent
+ m_domTargetElement.appendChild(m_domSourceNode);
+ m_pDocument->updateNodeCreated(m_domSourceNode);
+}
+
+void KXEDragDropMoveCommand::unexecute()
+{
+ // 1st, remove source node from its parent
+ if ( m_domTargetElement.removeChild( m_domSourceNode ).isNull() )
+ kdError() << "KXEPasteToElementCommand::unexecute error removing the node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domSourceNode);
+ }
+
+ // 2nd, append moved node to previous parent
+ m_domPreviousParentNode.appendChild(m_domSourceNode);
+ m_pDocument->updateNodeCreated(m_domSourceNode);
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Deleting node //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEDeleteNodeCommand::KXEDeleteNodeCommand(KXEDocument *pDocument, QDomNode &domNode)
+ : KXECommand(pDocument)
+{
+ m_domNode = domNode;
+ m_domParentNode = m_domNode.parentNode();
+ m_afterNode = m_domNode.previousSibling();
+
+ if ( m_domParentNode.isNull() )
+ kdError() << "KXEDeleteNodeCommand::KXEDeleteNodeCommand selected nodes parent node is empty." << endl;
+}
+
+KXEDeleteNodeCommand::~KXEDeleteNodeCommand()
+{
+}
+
+void KXEDeleteNodeCommand::execute()
+{
+ if ( m_domParentNode.removeChild( m_domNode ).isNull() )
+ kdError() << "KXEDeleteNodeCommand::execute error removing the selected node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domNode);
+ }
+}
+
+void KXEDeleteNodeCommand::unexecute()
+{
+ if (m_afterNode.isNull())
+ m_domParentNode.insertBefore(m_domNode,m_afterNode);
+ else
+ m_domParentNode.insertAfter( m_domNode,m_afterNode );
+ m_pDocument->updateNodeCreated(m_domNode);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Deleting one attribute //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+
+KXEDeleteAttrCommand::KXEDeleteAttrCommand(
+ KXEDocument *pDocument,
+ QDomElement &domOwnerElement,
+ QDomAttr &domAttr
+ )
+ : KXECommand(pDocument)
+{
+ m_domOwnerElement = domOwnerElement;
+ m_domAttr = domAttr;
+}
+
+KXEDeleteAttrCommand::~KXEDeleteAttrCommand()
+{
+}
+
+void KXEDeleteAttrCommand::execute()
+{
+ m_domOwnerElement.removeAttributeNode(m_domAttr);
+ m_pDocument->updateNodeChanged(m_domOwnerElement);
+}
+
+void KXEDeleteAttrCommand::unexecute()
+{
+ m_domOwnerElement.setAttributeNode( m_domAttr );
+ m_pDocument->updateNodeChanged( m_domOwnerElement ) ;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Deleting all attributes //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEDeleteAllAttribCommand::KXEDeleteAllAttribCommand(
+ KXEDocument *pDocument,
+ QDomElement &domOwnerElement
+ )
+ : KXECommand(pDocument)
+{
+ m_domOwnerElement = domOwnerElement;
+ m_listRemovedAttributes.setAutoDelete( true ); // the list owns the objects
+}
+
+KXEDeleteAllAttribCommand::~KXEDeleteAllAttribCommand()
+{
+}
+
+void KXEDeleteAllAttribCommand::execute()
+{
+ QDomNamedNodeMap mapAttributes = m_domOwnerElement.attributes();
+ uint nAttributes = mapAttributes.count();
+
+ if( nAttributes == 0 )
+ return;
+
+ for( uint nRow = nAttributes; nRow > 0; nRow-- )
+ {
+ QDomNode node = mapAttributes.item(nRow-1);
+ if ( node.isAttr() )
+ { QDomAttr domAttr = node.toAttr();
+
+ QDomAttr *pNodeCloned = new QDomAttr(domAttr.cloneNode(true).toAttr());
+
+ m_listRemovedAttributes.append(pNodeCloned);
+ m_domOwnerElement.removeAttributeNode(node.toAttr());
+ }
+ else
+ kdDebug() << "KXMLEditor " << k_funcinfo << " node is not an attribute (but should be)" << node.nodeName() << endl;
+ }
+
+ m_pDocument->updateNodeChanged(m_domOwnerElement);
+}
+
+void KXEDeleteAllAttribCommand::unexecute()
+{
+ QDomNamedNodeMap mapAttributes = m_domOwnerElement.attributes();
+ uint nAttributes = m_listRemovedAttributes.count();
+
+ if ( nAttributes == 0 )
+ return;
+
+ QDomAttr *pDomAttr;
+ for ( pDomAttr = m_listRemovedAttributes.first(); pDomAttr; pDomAttr = m_listRemovedAttributes.next() )
+ {
+ if(!pDomAttr->namespaceURI().isEmpty())
+ m_domOwnerElement.setAttribute(pDomAttr->name(), pDomAttr->value());
+ else
+ m_domOwnerElement.setAttributeNS(pDomAttr->namespaceURI(), pDomAttr->name(), pDomAttr->value());
+ }
+
+ m_listRemovedAttributes.clear();
+
+ m_pDocument->updateNodeChanged(m_domOwnerElement);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Moving node up //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEUpCommand::KXEUpCommand(KXEDocument *pDocument, QDomNode &domNode)
+ : KXECommand(pDocument)
+{
+ m_domNode = domNode;
+ m_domParentNode = m_domNode.parentNode();
+
+ if ( m_domParentNode.isNull() )
+ kdError() << "KXEUpCommand::KXEUpCommand selected nodes parent node is empty." << endl;
+}
+
+KXEUpCommand::~KXEUpCommand()
+{
+}
+
+void KXEUpCommand::execute()
+{
+ QDomNode domPrevSibling = m_domNode.previousSibling();
+ if ( domPrevSibling.isNull() )
+ {
+ kdError() << "KXEUpCommand::execute selected node doesn't seem to have a previous sibling." << endl;
+ return;
+ }
+
+ QDomNode domNode = m_domParentNode.removeChild( m_domNode );
+ if ( domNode.isNull() )
+ kdError() << "KXEUpCommand::execute can't remove child node." << endl;
+ else
+ {
+ domNode = m_domParentNode.insertBefore( domNode, domPrevSibling );
+ if ( domNode.isNull() )
+ kdError() << "KXEUpCommand::execute can't insert child node." << endl;
+ else
+ {
+ m_pDocument->updateNodeMoved(domNode);
+ }
+ }
+}
+
+void KXEUpCommand::unexecute()
+{
+ QDomNode domNextSibling = m_domNode.nextSibling();
+ if ( domNextSibling.isNull() )
+ {
+ kdError() << "KXEUpCommand::unexecute selected node doesn't seem to have a next sibling." << endl;
+ return;
+ }
+
+ QDomNode domNode = m_domParentNode.removeChild( m_domNode );
+ if ( domNode.isNull() )
+ kdError() << "KXEUpCommand::unexecute can't remove child node." << endl;
+ else
+ {
+ domNode = m_domParentNode.insertAfter( domNode, domNextSibling );
+ if ( domNode.isNull() )
+ kdError() << "KXEUpCommand::unexecute can't insert child node." << endl;
+ else
+ {
+ m_pDocument->updateNodeMoved(domNode);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Moving node down //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEDownCommand::KXEDownCommand(KXEDocument *pDocument, QDomNode &domNode)
+ : KXECommand(pDocument)
+{
+ m_domNode = domNode;
+ m_domParentNode = m_domNode.parentNode();
+
+ if ( m_domParentNode.isNull() )
+ kdError() << "KXEDownCommand::KXEDownCommand selected nodes parent node is empty." << endl;
+}
+
+KXEDownCommand::~KXEDownCommand()
+{
+}
+
+void KXEDownCommand::execute()
+{
+ QDomNode domNextSibling = m_domNode.nextSibling();
+ if ( domNextSibling.isNull() )
+ {
+ kdError() << "KXEDownCommand::execute selected node doesn't seem to have a next sibling." << endl;
+ return;
+ }
+
+ QDomNode domNode = m_domParentNode.removeChild( m_domNode );
+ if ( domNode.isNull() )
+ kdError() << "KXEDownCommand::execute can't remove child node." << endl;
+ else
+ {
+ domNode = m_domParentNode.insertAfter( domNode, domNextSibling );
+ if ( domNode.isNull() )
+ kdError() << "KXEDownCommand::execute can't insert child node." << endl;
+ else
+ {
+ m_pDocument->updateNodeMoved(domNode);
+ }
+ }
+}
+
+void KXEDownCommand::unexecute()
+{
+ QDomNode domPrevSibling = m_domNode.previousSibling();
+ if ( domPrevSibling.isNull() )
+ {
+ kdError() << "KXEDownCommand::unexecute selected node doesn't seem to have a previous sibling." << endl;
+ return;
+ }
+
+ QDomNode domNode = m_domParentNode.removeChild( m_domNode );
+ if ( domNode.isNull() )
+ kdError() << "KXEDownCommand::unexecute can't remove child node." << endl;
+ else
+ {
+ domNode = m_domParentNode.insertBefore( domNode, domPrevSibling );
+ if ( domNode.isNull() )
+ kdError() << "KXEDownCommand::unexecute can't insert child node." << endl;
+ else
+ {
+ m_pDocument->updateNodeMoved(domNode);
+ }
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Editing char. data properties //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEEditCharDataCommand::KXEEditCharDataCommand(
+ KXEDocument *pDocument,
+ QDomCharacterData &domCharacterData,
+ const QString strNewContents
+ )
+ : KXECommand(pDocument)
+{
+ m_domCharacterData = domCharacterData;
+ m_strNewContents = strNewContents;
+}
+
+KXEEditCharDataCommand::~KXEEditCharDataCommand()
+{
+}
+
+void KXEEditCharDataCommand::execute()
+{
+ m_strOldContents = m_domCharacterData.data();
+ m_domCharacterData.setData( m_strNewContents );
+ m_pDocument->updateNodeChanged( m_domCharacterData );
+}
+
+void KXEEditCharDataCommand::unexecute()
+{
+ m_domCharacterData.setData( m_strOldContents );
+ m_pDocument->updateNodeChanged( m_domCharacterData );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Editing proc. instr properties //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEEditProcInstrCommand::KXEEditProcInstrCommand(
+ KXEDocument *pDocument,
+ QDomProcessingInstruction &domProcInstr,
+ const QString strNewData
+ )
+ : KXECommand(pDocument)
+{
+ m_domProcInstr = domProcInstr;
+ m_strNewData = strNewData;
+}
+
+KXEEditProcInstrCommand::~KXEEditProcInstrCommand()
+{
+}
+
+void KXEEditProcInstrCommand::execute()
+{
+ m_strOldData = m_domProcInstr.data();
+ m_domProcInstr.setData( m_strNewData );
+ m_pDocument->updateNodeChanged( m_domProcInstr );
+}
+
+void KXEEditProcInstrCommand::unexecute()
+{
+ m_domProcInstr.setData( m_strOldData );
+ m_pDocument->updateNodeChanged( m_domProcInstr );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Editing element data properties //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEEditElementCommand::KXEEditElementCommand(
+ KXEDocument *pDocument,
+ QDomElement &domElement,
+ const QString strNewPrefix,
+ const QString strNewName
+ )
+ : KXECommand(pDocument)
+{
+ m_domElement = domElement;
+ m_strNewPrefix = strNewPrefix;
+ m_strNewName = strNewName;
+}
+
+KXEEditElementCommand::~KXEEditElementCommand()
+{
+}
+
+void KXEEditElementCommand::execute()
+{
+ m_strOldPrefix = m_domElement.prefix();
+ m_strOldName = m_domElement.tagName();
+
+
+ if ( ! m_domElement.namespaceURI().isNull() )
+ m_domElement.setPrefix( m_strNewPrefix );
+
+ m_domElement.setTagName( m_strNewName );
+
+ m_pDocument->updateNodeChanged( m_domElement );
+}
+
+void KXEEditElementCommand::unexecute()
+{
+ if ( ! m_domElement.namespaceURI().isNull() )
+ m_domElement.setPrefix( m_strOldPrefix );
+
+ m_domElement.setTagName( m_strOldName );
+
+ m_pDocument->updateNodeChanged( m_domElement );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Edit attribute value //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+
+KXEEditAttrValueCommand::KXEEditAttrValueCommand(
+ KXEDocument *pDocument,
+ const QDomAttr &domAttr,
+ const QString strNewValue
+ )
+ : KXECommand(pDocument)
+{
+ m_domAttr = domAttr;
+ m_strNewValue = strNewValue;
+}
+
+KXEEditAttrValueCommand::~KXEEditAttrValueCommand()
+{
+}
+
+void KXEEditAttrValueCommand::execute()
+{
+ m_strOldValue = m_domAttr.value();
+ m_domAttr.setValue( m_strNewValue );
+
+ m_pDocument->updateNodeChanged(m_domAttr.ownerElement());
+}
+
+void KXEEditAttrValueCommand::unexecute()
+{
+ m_domAttr.setValue( m_strOldValue );
+
+ m_pDocument->updateNodeChanged(m_domAttr.ownerElement());
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Edit attribute name //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+
+KXEEditAttrNameCommand::KXEEditAttrNameCommand(
+ KXEDocument *pDocument,
+ const QDomAttr &domOldAttr,
+ const QString strNewName
+ )
+ : KXECommand(pDocument)
+{
+ m_strNewName = strNewName;
+ m_strOldName = domOldAttr.name();
+ m_strValue = domOldAttr.value();
+
+ if(!domOldAttr.namespaceURI().isEmpty())
+ m_strNamespaceURI = domOldAttr.namespaceURI();
+
+ m_domOwnerElement = domOldAttr.ownerElement();
+}
+
+KXEEditAttrNameCommand::~KXEEditAttrNameCommand()
+{
+}
+
+void KXEEditAttrNameCommand::execute()
+{
+ // it's not possible to change name. Must delete attribute and create new one
+ if(m_strNamespaceURI.isEmpty())
+ {
+ m_domOwnerElement.setAttribute(m_strNewName, m_strValue);
+ m_domOwnerElement.attributes().removeNamedItem(m_strOldName);
+ }
+ else
+ {
+ m_domOwnerElement.setAttributeNS( m_strNamespaceURI, m_strNewName, m_strValue);
+ m_domOwnerElement.attributes().removeNamedItemNS (m_strNamespaceURI, m_strOldName);
+ }
+
+ m_pDocument->updateNodeChanged(m_domOwnerElement);
+}
+
+void KXEEditAttrNameCommand::unexecute()
+{
+ // it's not possible to change name. Must delete attribute and create new one
+ if(m_strNamespaceURI.isEmpty())
+ {
+ m_domOwnerElement.setAttribute(m_strOldName, m_strValue);
+ m_domOwnerElement.attributes().removeNamedItem(m_strNewName);
+
+ }
+ else
+ {
+ m_domOwnerElement.setAttributeNS( m_strNamespaceURI, m_strOldName, m_strValue);
+ m_domOwnerElement.attributes().removeNamedItemNS (m_strNamespaceURI, m_strNewName);
+ }
+
+ m_pDocument->updateNodeChanged(m_domOwnerElement);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Editing element and its subtree as raw XML //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEEditRawXmlCommand::KXEEditRawXmlCommand(
+ KXEDocument *pDocument,
+ QDomElement &domOldElement,
+ QDomElement &domNewElement
+ )
+ : KXECommand(pDocument)
+{
+ m_domOldElement = domOldElement;
+ m_domNewElement = domNewElement;
+ m_domParentNode = domOldElement.parentNode();
+ m_afterNode = domOldElement.previousSibling();
+
+ if ( m_domParentNode.isNull() )
+ kdError() << "KXEEditRawXmlCommand::KXEEditRawXmlCommand selected nodes parent node is empty." << endl;
+
+}
+
+KXEEditRawXmlCommand::~KXEEditRawXmlCommand()
+{
+}
+
+void KXEEditRawXmlCommand::execute()
+{
+ // first delete node
+ if ( m_domParentNode.removeChild( m_domOldElement ).isNull() )
+ kdError() << "KXEEditRawXmlCommand::execute error removing the selected node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domOldElement);
+ }
+
+ // then insert new node
+ if (m_afterNode.isNull())
+ m_domParentNode.insertBefore(m_domNewElement, m_afterNode);
+ else
+ m_domParentNode.insertAfter( m_domNewElement, m_afterNode );
+ m_pDocument->updateNodeCreated(m_domNewElement);
+}
+
+void KXEEditRawXmlCommand::unexecute()
+{
+ // first delete node
+ if ( m_domParentNode.removeChild( m_domNewElement ).isNull() )
+ kdError() << "KXEEditRawXmlCommand::unexecute error removing the selected node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domNewElement);
+ }
+
+ // then insert new node
+ if (m_afterNode.isNull())
+ m_domParentNode.insertBefore(m_domOldElement, m_afterNode);
+ else
+ m_domParentNode.insertAfter( m_domOldElement, m_afterNode );
+ m_pDocument->updateNodeCreated(m_domOldElement);
+}
diff --git a/part/commands_edit.h b/part/commands_edit.h
new file mode 100644
index 0000000..c713861
--- /dev/null
+++ b/part/commands_edit.h
@@ -0,0 +1,346 @@
+/***************************************************************************
+ commands_edit - description
+ -------------------
+ begin : Wed Nov 26 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : a_charytoniuk@user.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#ifndef COMMANDS_EDIT_H
+#define COMMANDS_EDIT_H
+
+#include "kxecommand.h"
+
+#include <klocale.h>
+
+#include <qobjectlist.h>
+
+/**
+@file
+@author The KXMLEditor Team
+*/
+
+/**
+ @brief Command for removing any kind of nodes.
+*/
+class KXEDeleteNodeCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEDeleteNodeCommand(KXEDocument*, QDomNode &);
+ /** @brief Destructor */
+ ~KXEDeleteNodeCommand();
+ /** @brief Performs node removal.*/
+ virtual void execute();
+ /** @brief Node removal rollback.*/
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Delete node"); }
+ protected:
+ /** @short Stores infromation about parent node of the node to be deleted. */
+ QDomNode m_domParentNode;
+ /** @short Stores infromation the node to be deleted. */
+ QDomNode m_domNode;
+ /** @short Stores infromation about sibling node of the node to be deleted. */
+ QDomNode m_afterNode;
+};
+/**
+ @short Command for removing element attributes.
+*/
+class KXEDeleteAttrCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEDeleteAttrCommand(KXEDocument*, QDomElement &, QDomAttr &);
+ /** @brief Destructor */
+ ~KXEDeleteAttrCommand();
+ /** @brief Preforms attributte removal. */
+ virtual void execute();
+ /** @brief Attributte removal rollback. */
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Delete attribute"); }
+ protected:
+ /** @brief Stores attribute owner. */
+ QDomElement m_domOwnerElement;
+ /** @brief Attribute about to be removed. */
+ QDomAttr m_domAttr;
+};
+
+/**
+ @short Command for removing all element attributes.
+*/
+class KXEDeleteAllAttribCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEDeleteAllAttribCommand(KXEDocument*, QDomElement &);
+ /** @brief Destructor */
+ ~KXEDeleteAllAttribCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Delete all attributes"); }
+ protected:
+ QDomElement m_domOwnerElement;
+ QPtrList<QDomAttr> m_listRemovedAttributes;
+};
+
+/**
+ @short Command for cutting element to clipboard.
+*/
+class KXECutCommand : public KXEDeleteNodeCommand
+{
+ public:
+ /** @brief Constructor */
+ KXECutCommand(KXEDocument*, QDomNode &);
+ /** @brief Destructor */
+ ~KXECutCommand();
+ virtual QString name() const { return i18n("Cut node"); }
+};
+
+/**
+ @short Command for pasting to document from clipboard.
+*/
+class KXEPasteToDocumentCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEPasteToDocumentCommand(KXEDocument*, QDomDocument *, QDomElement &);
+ /** @brief Destructor */
+ ~KXEPasteToDocumentCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Paste node to document"); }
+ protected:
+ QDomDocument * m_pDomTargetDoc;
+ QDomElement m_domSourceElement;
+};
+
+/**
+ @short Command for pasting element from clipboard.
+*/
+class KXEPasteToElementCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEPasteToElementCommand(KXEDocument*, QDomElement &, QDomNode &);
+ /** @brief Destructor */
+ ~KXEPasteToElementCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Paste node to element"); }
+ protected:
+ QDomElement m_domTargetElement;
+ QDomNode m_domSourceNode;
+};
+
+class KXEPasteToProcInstrCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEPasteToProcInstrCommand(KXEDocument*, QDomProcessingInstruction &, QDomProcessingInstruction &);
+ /** @brief Destructor */
+ ~KXEPasteToProcInstrCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Paste node to proc. instruction"); }
+ protected:
+ QDomProcessingInstruction m_domTargetProcInstr;
+ QString m_strNewData;
+ QString m_strOldData;
+};
+
+class KXEPasteToCharDataCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEPasteToCharDataCommand(KXEDocument*, QDomCharacterData &, QDomCharacterData &);
+ /** @brief Destructor */
+ ~KXEPasteToCharDataCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Paste node to char. data"); }
+ protected:
+ QDomCharacterData m_domTargetCharData;
+ QString m_strNewData;
+ QString m_strOldData;
+};
+
+/**
+ @short Command for Drag & Drop.
+*/
+class KXEDragDropMoveCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEDragDropMoveCommand(KXEDocument*, QDomElement &, QDomNode &);
+ /** @brief Destructor */
+ ~KXEDragDropMoveCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Drag&&drop node"); }
+ protected:
+ QDomElement m_domTargetElement;
+ QDomNode m_domSourceNode;
+ QDomNode m_domPreviousParentNode;
+};
+
+/**
+ @short Command for moving selected node up.
+*/
+class KXEUpCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEUpCommand(KXEDocument*, QDomNode &);
+ /** @brief Destructor */
+ ~KXEUpCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Move node up"); }
+ protected:
+ QDomNode m_domParentNode;
+ QDomNode m_domNode;
+};
+
+/**
+ @short Command for moving selected node down.
+*/
+class KXEDownCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEDownCommand(KXEDocument*, QDomNode &);
+ /** @brief Destructor */
+ ~KXEDownCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Move node down"); }
+ protected:
+ QDomNode m_domParentNode;
+ QDomNode m_domNode;
+};
+
+class KXEEditCharDataCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEEditCharDataCommand(KXEDocument*, QDomCharacterData &, const QString);
+ /** @brief Destructor */
+ ~KXEEditCharDataCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Editing character data"); }
+ protected:
+ QDomCharacterData m_domCharacterData;
+ QString m_strNewContents;
+ QString m_strOldContents;
+};
+
+/**
+ @short Command for editing selected processing instruction.
+*/
+class KXEEditProcInstrCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEEditProcInstrCommand(KXEDocument*, QDomProcessingInstruction &, const QString);
+ /** @brief Destructor */
+ ~KXEEditProcInstrCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Editing proc. instruction"); }
+ protected:
+ QDomProcessingInstruction m_domProcInstr;
+ QString m_strNewData;
+ QString m_strOldData;
+};
+
+/**
+ @short Command for editing selected XML element.
+*/
+class KXEEditElementCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEEditElementCommand(KXEDocument*, QDomElement &, const QString, const QString);
+ /** @brief Destructor */
+ ~KXEEditElementCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Editing element"); }
+ protected:
+ QDomElement m_domElement;
+ QString m_strNewPrefix;
+ QString m_strNewName;
+ QString m_strOldPrefix;
+ QString m_strOldName;
+};
+
+/**
+ @short Command for editing element attribute value.
+*/
+class KXEEditAttrValueCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEEditAttrValueCommand(KXEDocument*, const QDomAttr &, const QString);
+ /** @brief Destructor */
+ ~KXEEditAttrValueCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Edit attribute value"); }
+ protected:
+ QDomAttr m_domAttr;
+ QString m_strNewValue;
+ QString m_strOldValue;
+};
+
+/**
+ @short Command for editing element attribute names.
+*/
+class KXEEditAttrNameCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEEditAttrNameCommand(KXEDocument*, const QDomAttr &, const QString);
+ /** @brief Destructor */
+ ~KXEEditAttrNameCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Edit attribute name"); }
+ protected:
+ QDomElement m_domOwnerElement;
+ QString m_strNewName;
+ QString m_strOldName;
+ QString m_strValue;
+ QString m_strNamespaceURI;
+};
+
+/**
+ @short Command for editing XML element as text.
+*/
+class KXEEditRawXmlCommand : public KXECommand
+{
+ public:
+ /** @brief Constructor */
+ KXEEditRawXmlCommand(KXEDocument*, QDomElement &, QDomElement &);
+ /** @brief Destructor */
+ ~KXEEditRawXmlCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Editing raw XML"); }
+ protected:
+ QDomElement m_domOldElement;
+ QDomNode m_domParentNode;
+ QDomElement m_domNewElement;
+ QDomNode m_afterNode;
+};
+
+#endif
diff --git a/part/commands_file.cpp b/part/commands_file.cpp
new file mode 100644
index 0000000..f30ff2d
--- /dev/null
+++ b/part/commands_file.cpp
@@ -0,0 +1,158 @@
+/***************************************************************************
+ commands_file - description
+ -------------------
+ begin : Wed Nov 26 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : a_charytoniuk@user.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#include "commands_file.h"
+#include <qstring.h>
+#include <kurl.h>
+#include <kmessagebox.h>
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Setting Version & Encoding //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEVersionEncodingCommand::KXEVersionEncodingCommand(KXEDocument* pDocument, const QString& oldData, const QString &newData)
+ : KXECommand(pDocument)
+{
+ m_strOldData = oldData;
+ m_strNewData = newData;
+}
+
+KXEVersionEncodingCommand::~KXEVersionEncodingCommand()
+{
+}
+
+void KXEVersionEncodingCommand::execute()
+{
+ m_pDocument->setSpecProcInstr("xml",m_strNewData);
+}
+
+void KXEVersionEncodingCommand::unexecute()
+{
+ m_pDocument->setSpecProcInstr("xml",m_strOldData);
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Attaching stylesheet //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEStylesheetAttachCommand::KXEStylesheetAttachCommand(KXEDocument* pDocument,const QString& prevStylesheet,const QString& newStylesheet)
+ : KXECommand(pDocument)
+{
+ m_strNewStylesheet = newStylesheet;
+ m_strPrevStylesheet = prevStylesheet;
+}
+
+KXEStylesheetAttachCommand::~KXEStylesheetAttachCommand()
+{
+}
+
+void KXEStylesheetAttachCommand::execute()
+{
+ m_pDocument->detachStylesheet();
+ m_pDocument->attachStylesheet(KURL(m_strNewStylesheet));
+}
+
+void KXEStylesheetAttachCommand::unexecute()
+{
+ m_pDocument->detachStylesheet();
+ if(!m_strPrevStylesheet.isEmpty())
+ m_pDocument->attachStylesheet(KURL(m_strPrevStylesheet));
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Detaching Stylesheet //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEStylesheetDetachCommand::KXEStylesheetDetachCommand(KXEDocument* pDocument,const QString& prevStylesheet)
+ : KXECommand(pDocument)
+{
+ m_strPrevStylesheet = prevStylesheet;
+}
+
+KXEStylesheetDetachCommand::~KXEStylesheetDetachCommand()
+{
+}
+
+void KXEStylesheetDetachCommand::execute()
+{
+ m_pDocument->detachStylesheet();
+}
+
+void KXEStylesheetDetachCommand::unexecute()
+{
+ if (!m_strPrevStylesheet.isEmpty())
+ m_pDocument->attachStylesheet(KURL(m_strPrevStylesheet));
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Attaching Schema //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXESchemaAttachCommand::KXESchemaAttachCommand(KXEDocument *pDocument,const QString& newSchema)
+ : KXECommand(pDocument)
+{
+ m_pDocument = pDocument;
+ m_strNewSchema = newSchema;
+ m_strPrevSchema = "";
+}
+KXESchemaAttachCommand::KXESchemaAttachCommand(KXEDocument *pDocument,const QString& newSchema,const QString& prevSchema)
+ : KXECommand(pDocument)
+{
+ m_strNewSchema = newSchema;
+ m_strPrevSchema = prevSchema;
+}
+
+KXESchemaAttachCommand::~KXESchemaAttachCommand()
+{
+}
+
+void KXESchemaAttachCommand::execute()
+{
+ m_pDocument->detachSchema(); // old schema is removed
+ m_pDocument->attachSchema(KURL(m_strNewSchema)); // new schema is applited
+}
+
+void KXESchemaAttachCommand::unexecute()
+{
+ m_pDocument->detachSchema(); // new schema is removed
+ if (!m_strPrevSchema.isEmpty())
+ m_pDocument->attachSchema(KURL(m_strPrevSchema)); // old schema is applied
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Detaching schema //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXESchemaDetachCommand::KXESchemaDetachCommand(KXEDocument* pDocument, const QString& schema)
+ : KXECommand(pDocument)
+{
+ m_schema = schema;
+}
+
+KXESchemaDetachCommand::~KXESchemaDetachCommand()
+{
+}
+
+void KXESchemaDetachCommand::execute()
+{
+ m_pDocument->detachSchema();
+}
+
+void KXESchemaDetachCommand::unexecute()
+{
+ if (!m_schema.isEmpty())
+ m_pDocument->attachSchema(KURL(m_schema));
+}
+
diff --git a/part/commands_file.h b/part/commands_file.h
new file mode 100644
index 0000000..00dc484
--- /dev/null
+++ b/part/commands_file.h
@@ -0,0 +1,102 @@
+/***************************************************************************
+ commands_file - description
+ -------------------
+ begin : Wed Nov 26 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : a_charytoniuk@user.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#ifndef COMMANDS_FILE_H
+#define COMMANDS_FILE_H
+
+#include "kxecommand.h"
+#include <klocale.h>
+
+/** @file
+ This file contains all commands taken from menu File which
+ can effect our edited document. These commans allows to have
+ undo/redo functionality.
+*/
+
+/**
+Command for setting version and encoding to XML file.
+
+@author The KXMLEditor Team
+*/
+
+class KXEDocument;
+class QString;
+
+class KXEVersionEncodingCommand : public KXECommand
+{
+ public:
+ KXEVersionEncodingCommand(KXEDocument* pDocument, const QString& oldData, const QString &newData);
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Changing version and encoding"); }
+ ~KXEVersionEncodingCommand();
+ protected:
+ QString m_strOldData;
+ QString m_strNewData;
+};
+
+class KXEStylesheetAttachCommand : public KXECommand
+{
+ public:
+ KXEStylesheetAttachCommand(KXEDocument* pDocument,const QString& prevStylesheet,const QString& newStylesheet);
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Attaching stylesheet ")+m_strNewStylesheet; }
+ ~KXEStylesheetAttachCommand();
+ protected:
+ QString m_strPrevStylesheet;
+ QString m_strNewStylesheet;
+};
+
+class KXEStylesheetDetachCommand : public KXECommand
+{
+ public:
+ KXEStylesheetDetachCommand(KXEDocument* pDocument,const QString& prevStylesheet);
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Detaching stylesheet ")+m_strPrevStylesheet; }
+ ~KXEStylesheetDetachCommand();
+ protected:
+ QString m_strPrevStylesheet;
+};
+
+class KXESchemaAttachCommand : public KXECommand
+{
+ public:
+ KXESchemaAttachCommand(KXEDocument *pDocument,const QString& newSchema);
+ KXESchemaAttachCommand(KXEDocument *pDocument,const QString& newSchema, const QString& prevSchema);
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Attaching schema ")+m_strNewSchema; }
+ ~KXESchemaAttachCommand();
+ protected:
+ QString m_strNewSchema;
+ QString m_strPrevSchema;
+};
+
+class KXESchemaDetachCommand : public KXECommand
+{
+ public:
+ KXESchemaDetachCommand(KXEDocument* pDocument, const QString& schema);
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Detaching schema ")+m_schema; }
+ ~KXESchemaDetachCommand();
+ protected:
+ QString m_schema;
+};
+
+#endif
diff --git a/part/commands_insert.cpp b/part/commands_insert.cpp
new file mode 100644
index 0000000..9f17d51
--- /dev/null
+++ b/part/commands_insert.cpp
@@ -0,0 +1,329 @@
+/***************************************************************************
+ commands_insert - description
+ -------------------
+ begin : Wed Nov 26 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek@user.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#include "commands_insert.h"
+
+#include <qstring.h>
+
+#include <kdebug.h>
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Inserting new XML element //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEElementCommand::KXEElementCommand(
+ KXEDocument *pDocument,
+ QDomDocument * pDomDoc,
+ QString strNsURI,
+ QString strPrefix,
+ QString strName
+ )
+ : KXECommand(pDocument)
+{
+ if ( pDomDoc == 0 )
+ kdError() << "KXEElementCommand::KXEElementCommand the given XML document object is empty." << endl;
+
+ m_pDomDoc = pDomDoc;
+
+ if ( strNsURI.isEmpty() )
+ m_domElement = m_pDomDoc->createElement( strName );
+ else
+ m_domElement = m_pDomDoc->createElementNS( strNsURI, strPrefix + ":" + strName );
+}
+
+KXEElementCommand::KXEElementCommand(
+ KXEDocument *pDocument,
+ QDomElement & domParentElement,
+ QString strNsURI,
+ QString strPrefix,
+ QString strName,
+ bool bAtTop
+ )
+ : KXECommand(pDocument)
+{
+ if ( domParentElement.isNull() )
+ kdError() << "KXEElementCommand::KXEElementCommand the given XML element object is empty." << endl;
+
+ m_domParentElement = domParentElement;
+ m_pDomDoc = 0;
+ m_bAtTop = bAtTop;
+
+ if ( strNsURI.isEmpty() )
+ m_domElement = m_domParentElement.ownerDocument().createElement( strName );
+ else
+ m_domElement = m_domParentElement.ownerDocument().createElementNS( strNsURI, strPrefix + ":" + strName );
+}
+
+KXEElementCommand::~KXEElementCommand()
+{
+}
+
+void KXEElementCommand::execute()
+{
+ if ( m_pDomDoc )
+ {
+ // Insert root element
+ m_pDomDoc->appendChild( m_domElement );
+ }
+ else
+ {
+ if( !m_domParentElement.isNull() )
+ {
+ // Insert child element
+ if ( m_bAtTop )
+ { // insert as first child
+ QDomNode domFirstChildNode = m_domParentElement.firstChild();
+ if ( domFirstChildNode.isNull() )
+ m_domParentElement.appendChild( m_domElement ); // no childs yet -> simply append
+ else
+ m_domParentElement.insertBefore( m_domElement, domFirstChildNode );
+ }
+ else // insert as last child
+ m_domParentElement.appendChild( m_domElement );
+ }
+ else
+ {
+ kdError() << "KXEElementCommand::execute document and element object is empty." << endl;
+ }
+ }
+ m_pDocument->updateNodeCreated(m_domElement);
+}
+
+void KXEElementCommand::unexecute()
+{
+ if ( m_domElement.parentNode().removeChild( m_domElement ).isNull() )
+ kdError() << "KXEElementCommand::unexecute error removing the selected node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domElement);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// inserting new attribute //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEAttributeCommand::KXEAttributeCommand(
+ KXEDocument *pDocument,
+ QDomElement &domOwnerElement,
+ QString strNamespace,
+ QString strQName,
+ QString strValue
+ )
+ : KXECommand(pDocument)
+{
+ if ( domOwnerElement.isNull() )
+ {
+ kdError() << k_funcinfo << "KXEAttributeCommand::KXEAttributeCommand - The given owner element is empty." << endl;
+ return;
+ }
+
+ m_domOwnerElement = domOwnerElement;
+ m_strNamespace = strNamespace;
+ m_strQName = strQName;
+ m_strValue = strValue;
+}
+
+KXEAttributeCommand::~KXEAttributeCommand()
+{
+}
+
+void KXEAttributeCommand::execute()
+{
+ if ( m_strNamespace.isEmpty() )
+ m_domOwnerElement.setAttribute( m_strQName, m_strValue );
+ else
+ m_domOwnerElement.setAttributeNS( m_strNamespace, m_strQName, m_strValue );
+
+ m_pDocument->updateNodeChanged( m_domOwnerElement ) ;
+}
+
+void KXEAttributeCommand::unexecute()
+{
+ if ( m_strNamespace.isEmpty() )
+ m_domOwnerElement.removeAttribute(m_strQName);
+ else
+ m_domOwnerElement.removeAttributeNS(m_strNamespace, m_strQName);
+
+ m_pDocument->updateNodeChanged( m_domOwnerElement ) ;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Inserting new character data //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXECharDataCommand::KXECharDataCommand(
+ KXEDocument *pDocument,
+ QDomElement & domParentElement,
+ bool bAtTop,
+ CharDataKind eCharDataKind,
+ QString strContents
+ )
+ : KXECommand(pDocument)
+{
+ if ( domParentElement.isNull() )
+ {
+ kdError() << k_funcinfo << "KXECharDataCommand::KXECharDataCommand - The given parent object is empty." << endl;
+ return;
+ }
+
+ m_domParentElement = domParentElement;
+ m_bAtTop = bAtTop;
+
+ switch ( eCharDataKind )
+ {
+ case CharDataTextNode:
+ m_domCharData = domParentElement.ownerDocument().createTextNode( strContents );
+ break;
+
+ case CharDataCDATASection:
+ m_domCharData = domParentElement.ownerDocument().createCDATASection( strContents );
+ break;
+
+ case CharDataComment:
+ m_domCharData = domParentElement.ownerDocument().createComment( strContents );
+ break;
+
+ default:
+ kdError() << "KXECharDataCommand::KXECharDataCommand unrecognized char. data type." << endl;
+ break;
+ }
+}
+
+KXECharDataCommand::~KXECharDataCommand()
+{
+}
+
+void KXECharDataCommand::execute()
+{
+ if ( m_bAtTop )
+ { // insert as first child
+ QDomNode domFirstChildNode = m_domParentElement.firstChild();
+ if ( domFirstChildNode.isNull() )
+ m_domParentElement.appendChild( m_domCharData ); // no childs yet -> simply append
+ else
+ m_domParentElement.insertBefore( m_domCharData, domFirstChildNode );
+ }
+ else // insert as last child
+ m_domParentElement.appendChild( m_domCharData );
+
+ m_pDocument->updateNodeCreated(m_domCharData);
+}
+
+void KXECharDataCommand::unexecute()
+{
+ if ( m_domCharData.parentNode().removeChild( m_domCharData ).isNull() )
+ kdError() << "KXECharDataCommand::unexecute error removing the selected node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domCharData);
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+/////////// Inserting new proc instr. //////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+KXEProcInstrCommand::KXEProcInstrCommand(
+ KXEDocument *pDocument,
+ QDomDocument * pDomDoc,
+ bool bAtTop,
+ QString strTarget,
+ QString strData
+ )
+ : KXECommand(pDocument)
+{
+ if ( pDomDoc == 0 )
+ {
+ kdError() << k_funcinfo << "KXEProcInstrCommand::KXEProcInstrCommand - The given parent object is empty." << endl;
+ return;
+ }
+
+ m_pDomDoc = pDomDoc;
+ m_bAtTop = bAtTop;
+
+ m_domProcInstr = pDomDoc->createProcessingInstruction( strTarget, strData );
+}
+
+KXEProcInstrCommand::KXEProcInstrCommand(
+ KXEDocument *pDocument,
+ QDomElement & domParentElement,
+ bool bAtTop,
+ QString strTarget,
+ QString strData
+ )
+ : KXECommand(pDocument)
+{
+ if ( domParentElement.isNull() )
+ {
+ kdError() << k_funcinfo << "KXEProcInstrCommand::KXEProcInstrCommand - The given parent object is empty." << endl;
+ return;
+ }
+
+ m_domParentElement = domParentElement;
+ m_pDomDoc = 0;
+ m_bAtTop = bAtTop;
+
+ m_domProcInstr = domParentElement.ownerDocument().createProcessingInstruction( strTarget, strData );
+}
+
+
+KXEProcInstrCommand::~KXEProcInstrCommand()
+{
+}
+
+void KXEProcInstrCommand::execute()
+{
+ if ( m_pDomDoc )
+ {
+ // Insert root proc. instr
+ m_pDomDoc->appendChild( m_domProcInstr );
+ }
+ else
+ {
+ if( !m_domParentElement.isNull() )
+ {
+ // Insert child proc. instr
+ if ( m_bAtTop )
+ { // insert as first child
+ QDomNode domFirstChildNode = m_domParentElement.firstChild();
+ if ( domFirstChildNode.isNull() )
+ m_domParentElement.appendChild( m_domProcInstr ); // no childs yet -> simply append
+ else
+ m_domParentElement.insertBefore( m_domProcInstr, domFirstChildNode );
+ }
+ else // insert as last child
+ m_domParentElement.appendChild( m_domProcInstr );
+ }
+ else
+ {
+ kdError() << "KXEElementCommand::execute document and element object is empty." << endl;
+ }
+ }
+ m_pDocument->updateNodeCreated(m_domProcInstr);
+}
+
+void KXEProcInstrCommand::unexecute()
+{
+ if ( m_domProcInstr.parentNode().removeChild( m_domProcInstr ).isNull() )
+ kdError() << "KXEProcInstrCommand::unexecute error removing the selected node." << endl;
+ else
+ {
+ m_pDocument->updateNodeDeleted(m_domProcInstr);
+ }
+}
+
+
diff --git a/part/commands_insert.h b/part/commands_insert.h
new file mode 100644
index 0000000..4d9da8d
--- /dev/null
+++ b/part/commands_insert.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+ commands_insert - description
+ -------------------
+ begin : Wed Nov 26 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#ifndef COMMANDS_INSERT_H
+#define COMMANDS_INSERT_H
+
+#include <klocale.h>
+
+#include "kxecommand.h"
+#include "kxechardatadialog.h"
+
+/**
+@author The KXMLEditor Team
+*/
+class KXEElementCommand : public KXECommand
+{
+ public:
+ KXEElementCommand(KXEDocument*, QDomDocument *, QString, QString, QString);
+ KXEElementCommand(KXEDocument*, QDomElement &, QString, QString, QString, bool);
+ ~KXEElementCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Insert element"); }
+
+ protected:
+ QDomDocument * m_pDomDoc;
+ QDomElement m_domParentElement;
+ bool m_bAtTop;
+ QDomElement m_domElement;
+};
+
+class KXEAttributeCommand : public KXECommand
+{
+ public:
+ KXEAttributeCommand(KXEDocument*, QDomElement &, QString, QString, QString);
+ ~KXEAttributeCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Insert attribute"); }
+
+ protected:
+ QString m_strNamespace;
+ QString m_strQName;
+ QString m_strValue;
+ QDomElement m_domOwnerElement;
+};
+
+class KXECharDataCommand : public KXECommand
+{
+ public:
+ KXECharDataCommand(KXEDocument*, QDomElement &, bool, CharDataKind, QString);
+ ~KXECharDataCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Insert char data"); }
+
+ protected:
+
+ bool m_bAtTop;
+ QDomElement m_domParentElement;
+ QDomCharacterData m_domCharData;
+};
+
+class KXEProcInstrCommand : public KXECommand
+{
+ public:
+ KXEProcInstrCommand(KXEDocument*, QDomDocument *, bool, QString, QString);
+ KXEProcInstrCommand(KXEDocument*, QDomElement &, bool, QString, QString);
+ ~KXEProcInstrCommand();
+ virtual void execute();
+ virtual void unexecute();
+ virtual QString name() const { return i18n("Insert proc. instr."); }
+
+ protected:
+ QDomDocument * m_pDomDoc;
+ QDomElement m_domParentElement;
+ bool m_bAtTop;
+ QDomProcessingInstruction m_domProcInstr;
+};
+
+#endif
diff --git a/part/dcopiface_part_ro.cpp b/part/dcopiface_part_ro.cpp
new file mode 100644
index 0000000..c2794d0
--- /dev/null
+++ b/part/dcopiface_part_ro.cpp
@@ -0,0 +1,67 @@
+/***************************************************************************
+ dcopiface_part_ro.cpp - description
+ -------------------
+ begin : Tue Oct 23 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+#include "dcopiface_part_ro.h"
+#include "kxmleditorpart.h"
+//---------------------------------------------------------------------------
+// KXMLEditorPartIfaceReadOnly
+//---------------------------------------------------------------------------
+QString
+KXMLEditorPartIfaceReadOnly::saveAsFile(const QString & )
+{
+ return "Not implemented.";
+}
+
+QString
+KXMLEditorPartIfaceReadOnly::selectNode(const QString & szPathToNode)
+{
+ m_pKXEPart->slotPathSelected(szPathToNode);
+
+ if ( m_pKXEPart->getSelectedPath() == szPathToNode )
+ return "Selecting node failed.";
+
+ return QString();
+}
+
+QString
+KXMLEditorPartIfaceReadOnly::currentNode() const
+{
+ return m_pKXEPart->getSelectedPath();
+}
+
+
+//---------------------------------------------------------------------------
+// KXMLEditorPartIface
+//---------------------------------------------------------------------------
+QString
+KXMLEditorPartIfaceReadWrite::openURL(const QString & szURL)
+{
+ KURL url(szURL);
+ if (! url.isValid () )
+ return "URL is not valid.";
+ if ( m_pKXEPart->openURL(url) )
+ return QString();
+ else
+ return "Opening URL failed.";
+}
+
+
+QString
+KXMLEditorPartIfaceReadWrite::close()
+{
+ return "Not implemented.";
+}
+
diff --git a/part/dcopiface_part_ro.h b/part/dcopiface_part_ro.h
new file mode 100644
index 0000000..90f5982
--- /dev/null
+++ b/part/dcopiface_part_ro.h
@@ -0,0 +1,124 @@
+/***************************************************************************
+ dcopiface_part_ro.h - description
+ -------------------
+ begin : Tue Oct 23 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef DCOPIFACE_PART_RO_H
+#define DCOPIFACE_PART_RO_H
+
+#include <dcopobject.h>
+
+
+class KXMLEditorPart;
+ /**
+ * Allows perform action on represetntaion of XML file via DCOP protocol.
+ * behavies as interface to @ref KXMLEditorPart and to it adresses most of requestests received by DCOP
+ *
+ *@see KXMLEditorPart
+ *
+ *@short Read only DCOP interface for XML document Kpart based kxmleditor.
+ *
+ *@author The KXMLEditor Team (matkor@users.sourceforge.net)
+ **/
+
+class KXMLEditorPartIfaceReadOnly
+ :virtual public DCOPObject
+{
+ K_DCOP
+
+protected:
+ /** @ref KXMLEditorPart which Iface represensts **/
+ KXMLEditorPart * m_pKXEPart;
+
+public:
+ /**
+ * Default constructor
+ *
+ * @param kxe_part Specifies on what @ref KXMLEditorPart will interface operate.
+ **/
+ KXMLEditorPartIfaceReadOnly(KXMLEditorPart * kxe_part,const char * dcop_name = "KXMLEditorPartIface")
+ : DCOPObject(dcop_name)
+ {
+ m_pKXEPart = kxe_part;
+ }
+ virtual ~KXMLEditorPartIfaceReadOnly()
+ {};
+k_dcop:
+ /**
+ * Saves document as file
+ *
+ * @returns Error description or empty string if file succesfully saved.
+ **/
+
+ QString saveAsFile(const QString & path_to_file);
+
+ /** Tries to change current node
+ * @param pathToNode Path to new node
+ * @returns Empty string if selection OK otherwise error description
+ **/
+ QString selectNode(const QString & pathToNode);
+
+ /** Returns path to current node
+ * @returns If error empty string
+ **/
+ QString currentNode() const;
+
+};
+
+
+
+ /**
+ *@short Read/Write DCOP inteface for Kpart based kxmleditor.
+ *@author The KXMLEditor Team
+ **/
+//
+class KXMLEditorPartIfaceReadWrite
+ :public KXMLEditorPartIfaceReadOnly
+{
+ K_DCOP
+ /**
+ * Default constructor
+ *
+ * @param kxe_part Specifies on what @ref KXMLEditorPart will interface operate.
+ **/
+public:
+ KXMLEditorPartIfaceReadWrite(KXMLEditorPart * kxe_part,const char * dcop_name = "KXMLEditorPartIface")
+ : DCOPObject(dcop_name)
+ ,KXMLEditorPartIfaceReadOnly(kxe_part,dcop_name)
+ {}
+ virtual ~KXMLEditorPartIfaceReadWrite()
+ {};
+k_dcop:
+
+ /**
+ * Opens given file
+ *
+ * @returns Error description or empty string if file succesfully loaded.
+ **/
+ QString openURL(const QString & szURL);
+
+ /**
+ * Closes object behind interface.
+ * In curent implementation it means closing entire KXMLEditor.
+ *
+ * @returns Error description or empty string if program closed.
+ **/
+ QString close();
+
+
+};
+
+
+#endif // DCOPIFACE_PART_RO_H
diff --git a/part/icons/Makefile.am b/part/icons/Makefile.am
new file mode 100644
index 0000000..41028ae
--- /dev/null
+++ b/part/icons/Makefile.am
@@ -0,0 +1,155 @@
+
+EXTRA_DIST = hi16-action-bookmark_next.png hi16-action-xml_cdata.png hi16-action-xml_comment.png hi16-action-xml_text.png hi16-action-bookmark_prev.png hi16-action-collapse_node.png hi16-action-expand_node.png hi16-action-xml_delete_attribute.png hi16-action-xml_delete_contents.png hi16-action-xml_delete_element.png hi16-action-xml_delete_procins.png hi16-action-xml_edit_attribute.png hi16-action-xml_edit_contents.png hi16-action-xml_edit_element.png hi16-action-xml_edit_procins.png hi16-action-xml_insert_attribute.png hi16-action-xml_insert_contents.png hi16-action-xml_insert_element.png hi16-action-xml_insert_procins.png hi16-action-xml_move_item_down.png hi16-action-xml_move_item_up.png hi22-action-bookmark_next.png hi22-action-bookmark_prev.png hi22-action-collapse_node.png hi22-action-expand_node.png hi22-action-xml_delete_attribute.png hi22-action-xml_delete_contents.png hi22-action-xml_delete_element.png hi22-action-xml_delete_procins.png hi22-action-xml_edit_attribute.png hi22-action-xml_edit_contents.png hi22-action-xml_edit_element.png hi22-action-xml_edit_procins.png hi22-action-xml_insert_attribute.png hi22-action-xml_insert_contents.png hi22-action-xml_insert_element.png hi22-action-xml_insert_procins.png hi22-action-xml_move_item_down.png hi22-action-xml_move_item_up.png hi32-action-bookmark_next.png hi32-action-bookmark_prev.png hi32-action-xml_move_item_down.png hi32-action-xml_move_item_up.png lo16-action-bookmark_next.png lo16-action-bookmark_prev.png lo16-action-collapse_node.png lo16-action-expand_node.png lo16-action-xml_delete_attribute.png lo16-action-xml_delete_contents.png lo16-action-xml_delete_element.png lo16-action-xml_delete_procins.png lo16-action-xml_edit_attribute.png lo16-action-xml_edit_contents.png lo16-action-xml_edit_element.png lo16-action-xml_edit_procins.png lo16-action-xml_insert_attribute.png lo16-action-xml_insert_contents.png lo16-action-xml_insert_element.png lo16-action-xml_insert_procins.png lo16-action-xml_move_item_down.png lo16-action-xml_move_item_up.png \
+ lo32-app-kxmleditor.png lo16-app-kxmleditor.png \
+ hi32-app-kxmleditor.png hi48-app-kxmleditor.png
+
+install-data-local:
+ $(mkinstalldirs) $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/
+ $(INSTALL_DATA) $(srcdir)/hi16-action-bookmark_next.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/bookmark_next.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-bookmark_prev.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/bookmark_prev.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-collapse_node.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/collapse_node.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-expand_node.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/expand_node.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_delete_attribute.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_attribute.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_delete_contents.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_contents.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_delete_element.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_element.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_delete_procins.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_procins.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_edit_attribute.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_attribute.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_edit_contents.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_contents.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_edit_element.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_element.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_edit_procins.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_procins.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_insert_attribute.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_attribute.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_insert_contents.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_contents.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_insert_element.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_element.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_insert_procins.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_procins.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_move_item_down.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_move_item_down.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_move_item_up.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_move_item_up.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_text.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_text.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_cdata.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_cdata.png
+ $(INSTALL_DATA) $(srcdir)/hi16-action-xml_comment.png $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_comment.png
+ $(mkinstalldirs) $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/
+ $(INSTALL_DATA) $(srcdir)/hi22-action-bookmark_next.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/bookmark_next.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-bookmark_prev.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/bookmark_prev.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-collapse_node.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/collapse_node.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-expand_node.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/expand_node.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_delete_attribute.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_attribute.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_delete_contents.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_contents.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_delete_element.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_element.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_delete_procins.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_procins.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_edit_attribute.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_attribute.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_edit_contents.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_contents.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_edit_element.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_element.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_edit_procins.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_procins.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_insert_attribute.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_attribute.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_insert_contents.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_contents.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_insert_element.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_element.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_insert_procins.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_procins.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_move_item_down.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_move_item_down.png
+ $(INSTALL_DATA) $(srcdir)/hi22-action-xml_move_item_up.png $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_move_item_up.png
+ $(mkinstalldirs) $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/
+ $(INSTALL_DATA) $(srcdir)/hi32-action-bookmark_next.png $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/bookmark_next.png
+ $(INSTALL_DATA) $(srcdir)/hi32-action-bookmark_prev.png $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/bookmark_prev.png
+ $(INSTALL_DATA) $(srcdir)/hi32-action-xml_move_item_down.png $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/xml_move_item_down.png
+ $(INSTALL_DATA) $(srcdir)/hi32-action-xml_move_item_up.png $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/xml_move_item_up.png
+ $(mkinstalldirs) $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/
+ $(INSTALL_DATA) $(srcdir)/lo16-action-bookmark_next.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/bookmark_next.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-bookmark_prev.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/bookmark_prev.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-collapse_node.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/collapse_node.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-expand_node.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/expand_node.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_delete_attribute.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_attribute.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_delete_contents.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_contents.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_delete_element.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_element.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_delete_procins.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_procins.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_edit_attribute.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_attribute.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_edit_contents.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_contents.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_edit_element.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_element.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_edit_procins.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_procins.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_insert_attribute.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_attribute.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_insert_contents.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_contents.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_insert_element.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_element.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_insert_procins.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_procins.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_move_item_down.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_move_item_down.png
+ $(INSTALL_DATA) $(srcdir)/lo16-action-xml_move_item_up.png $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_move_item_up.png
+ $(mkinstalldirs) $(kde_icondir)/locolor/32x32/apps/
+ $(INSTALL_DATA) $(srcdir)/lo32-app-kxmleditor.png $(kde_icondir)/locolor/32x32/apps/kxmleditor.png
+ $(mkinstalldirs) $(kde_icondir)/locolor/16x16/apps/
+ $(INSTALL_DATA) $(srcdir)/lo16-app-kxmleditor.png $(kde_icondir)/locolor/16x16/apps/kxmleditor.png
+ $(mkinstalldirs) $(kde_icondir)/hicolor/32x32/apps/
+ $(INSTALL_DATA) $(srcdir)/hi32-app-kxmleditor.png $(kde_icondir)/hicolor/32x32/apps/kxmleditor.png
+ $(mkinstalldirs) $(kde_icondir)/hicolor/48x48/apps/
+ $(INSTALL_DATA) $(srcdir)/hi48-app-kxmleditor.png $(kde_icondir)/hicolor/48x48/apps/kxmleditor.png
+
+
+uninstall-local:
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/bookmark_next.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/bookmark_prev.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/collapse_node.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/expand_node.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_delete_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_edit_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_insert_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_move_item_down.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/xml_move_item_up.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/bookmark_next.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/bookmark_prev.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/collapse_node.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/expand_node.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_delete_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_edit_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_insert_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_move_item_down.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/xml_move_item_up.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/bookmark_next.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/bookmark_prev.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/xml_move_item_down.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/xml_move_item_up.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_text.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_cdata.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_comment.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/bookmark_next.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/bookmark_prev.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/collapse_node.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/expand_node.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_delete_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_edit_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_element.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_insert_procins.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_move_item_down.png
+ -rm -f $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/xml_move_item_up.png
+ -rmdir $(kde_datadir)/kxmleditor/icons/hicolor/16x16/actions/
+ -rmdir $(kde_datadir)/kxmleditor/icons/hicolor/22x22/actions/
+ -rmdir $(kde_datadir)/kxmleditor/icons/hicolor/32x32/actions/
+ -rmdir $(kde_datadir)/kxmleditor/icons/locolor/16x16/actions/
+ -rm -f $(kde_icondir)/locolor/32x32/apps/kxmleditor.png
+ -rmdir $(kde_icondir)/locolor/32x32/apps/
+ -rm -f $(kde_icondir)/locolor/16x16/apps/kxmleditor.png
+ -rmdir $(kde_icondir)/locolor/16x16/apps/
+ -rm -f $(kde_icondir)/hicolor/32x32/apps/kxmleditor.png
+ -rmdir $(kde_icondir)/hicolor/32x32/apps/
+ -rm -f $(kde_icondir)/hicolor/48x48/apps/kxmleditor.png
+ -rmdir $(kde_icondir)/hicolor/48x48/apps/
diff --git a/part/icons/hi16-action-bookmark_next.png b/part/icons/hi16-action-bookmark_next.png
new file mode 100644
index 0000000..12b6893
--- /dev/null
+++ b/part/icons/hi16-action-bookmark_next.png
Binary files differ
diff --git a/part/icons/hi16-action-bookmark_prev.png b/part/icons/hi16-action-bookmark_prev.png
new file mode 100644
index 0000000..32cbc7a
--- /dev/null
+++ b/part/icons/hi16-action-bookmark_prev.png
Binary files differ
diff --git a/part/icons/hi16-action-collapse_node.png b/part/icons/hi16-action-collapse_node.png
new file mode 100644
index 0000000..9efc36a
--- /dev/null
+++ b/part/icons/hi16-action-collapse_node.png
Binary files differ
diff --git a/part/icons/hi16-action-expand_node.png b/part/icons/hi16-action-expand_node.png
new file mode 100644
index 0000000..f8354df
--- /dev/null
+++ b/part/icons/hi16-action-expand_node.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_cdata.png b/part/icons/hi16-action-xml_cdata.png
new file mode 100644
index 0000000..ba70ca1
--- /dev/null
+++ b/part/icons/hi16-action-xml_cdata.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_comment.png b/part/icons/hi16-action-xml_comment.png
new file mode 100644
index 0000000..1acd578
--- /dev/null
+++ b/part/icons/hi16-action-xml_comment.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_delete_attribute.png b/part/icons/hi16-action-xml_delete_attribute.png
new file mode 100644
index 0000000..671da71
--- /dev/null
+++ b/part/icons/hi16-action-xml_delete_attribute.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_delete_contents.png b/part/icons/hi16-action-xml_delete_contents.png
new file mode 100644
index 0000000..00f1416
--- /dev/null
+++ b/part/icons/hi16-action-xml_delete_contents.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_delete_element.png b/part/icons/hi16-action-xml_delete_element.png
new file mode 100644
index 0000000..4122060
--- /dev/null
+++ b/part/icons/hi16-action-xml_delete_element.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_delete_procins.png b/part/icons/hi16-action-xml_delete_procins.png
new file mode 100644
index 0000000..184cba6
--- /dev/null
+++ b/part/icons/hi16-action-xml_delete_procins.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_edit_attribute.png b/part/icons/hi16-action-xml_edit_attribute.png
new file mode 100644
index 0000000..10e5940
--- /dev/null
+++ b/part/icons/hi16-action-xml_edit_attribute.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_edit_contents.png b/part/icons/hi16-action-xml_edit_contents.png
new file mode 100644
index 0000000..e67bcf4
--- /dev/null
+++ b/part/icons/hi16-action-xml_edit_contents.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_edit_element.png b/part/icons/hi16-action-xml_edit_element.png
new file mode 100644
index 0000000..256a24e
--- /dev/null
+++ b/part/icons/hi16-action-xml_edit_element.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_edit_procins.png b/part/icons/hi16-action-xml_edit_procins.png
new file mode 100644
index 0000000..1773cda
--- /dev/null
+++ b/part/icons/hi16-action-xml_edit_procins.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_insert_attribute.png b/part/icons/hi16-action-xml_insert_attribute.png
new file mode 100644
index 0000000..b02f1e0
--- /dev/null
+++ b/part/icons/hi16-action-xml_insert_attribute.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_insert_contents.png b/part/icons/hi16-action-xml_insert_contents.png
new file mode 100644
index 0000000..c5cda99
--- /dev/null
+++ b/part/icons/hi16-action-xml_insert_contents.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_insert_element.png b/part/icons/hi16-action-xml_insert_element.png
new file mode 100644
index 0000000..fcc234f
--- /dev/null
+++ b/part/icons/hi16-action-xml_insert_element.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_insert_procins.png b/part/icons/hi16-action-xml_insert_procins.png
new file mode 100644
index 0000000..824ee57
--- /dev/null
+++ b/part/icons/hi16-action-xml_insert_procins.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_move_item_down.png b/part/icons/hi16-action-xml_move_item_down.png
new file mode 100644
index 0000000..30e0602
--- /dev/null
+++ b/part/icons/hi16-action-xml_move_item_down.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_move_item_up.png b/part/icons/hi16-action-xml_move_item_up.png
new file mode 100644
index 0000000..7bb1b68
--- /dev/null
+++ b/part/icons/hi16-action-xml_move_item_up.png
Binary files differ
diff --git a/part/icons/hi16-action-xml_text.png b/part/icons/hi16-action-xml_text.png
new file mode 100644
index 0000000..fb485a3
--- /dev/null
+++ b/part/icons/hi16-action-xml_text.png
Binary files differ
diff --git a/part/icons/hi22-action-bookmark_next.png b/part/icons/hi22-action-bookmark_next.png
new file mode 100644
index 0000000..d685663
--- /dev/null
+++ b/part/icons/hi22-action-bookmark_next.png
Binary files differ
diff --git a/part/icons/hi22-action-bookmark_prev.png b/part/icons/hi22-action-bookmark_prev.png
new file mode 100644
index 0000000..33ecf83
--- /dev/null
+++ b/part/icons/hi22-action-bookmark_prev.png
Binary files differ
diff --git a/part/icons/hi22-action-collapse_node.png b/part/icons/hi22-action-collapse_node.png
new file mode 100644
index 0000000..234711f
--- /dev/null
+++ b/part/icons/hi22-action-collapse_node.png
Binary files differ
diff --git a/part/icons/hi22-action-expand_node.png b/part/icons/hi22-action-expand_node.png
new file mode 100644
index 0000000..5738150
--- /dev/null
+++ b/part/icons/hi22-action-expand_node.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_delete_attribute.png b/part/icons/hi22-action-xml_delete_attribute.png
new file mode 100644
index 0000000..caef038
--- /dev/null
+++ b/part/icons/hi22-action-xml_delete_attribute.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_delete_contents.png b/part/icons/hi22-action-xml_delete_contents.png
new file mode 100644
index 0000000..3fe3eb6
--- /dev/null
+++ b/part/icons/hi22-action-xml_delete_contents.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_delete_element.png b/part/icons/hi22-action-xml_delete_element.png
new file mode 100644
index 0000000..c161c78
--- /dev/null
+++ b/part/icons/hi22-action-xml_delete_element.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_delete_procins.png b/part/icons/hi22-action-xml_delete_procins.png
new file mode 100644
index 0000000..df8f911
--- /dev/null
+++ b/part/icons/hi22-action-xml_delete_procins.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_edit_attribute.png b/part/icons/hi22-action-xml_edit_attribute.png
new file mode 100644
index 0000000..83da5de
--- /dev/null
+++ b/part/icons/hi22-action-xml_edit_attribute.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_edit_contents.png b/part/icons/hi22-action-xml_edit_contents.png
new file mode 100644
index 0000000..0cae376
--- /dev/null
+++ b/part/icons/hi22-action-xml_edit_contents.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_edit_element.png b/part/icons/hi22-action-xml_edit_element.png
new file mode 100644
index 0000000..ffa4149
--- /dev/null
+++ b/part/icons/hi22-action-xml_edit_element.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_edit_procins.png b/part/icons/hi22-action-xml_edit_procins.png
new file mode 100644
index 0000000..ca5ac18
--- /dev/null
+++ b/part/icons/hi22-action-xml_edit_procins.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_insert_attribute.png b/part/icons/hi22-action-xml_insert_attribute.png
new file mode 100644
index 0000000..e074c58
--- /dev/null
+++ b/part/icons/hi22-action-xml_insert_attribute.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_insert_contents.png b/part/icons/hi22-action-xml_insert_contents.png
new file mode 100644
index 0000000..8b463b1
--- /dev/null
+++ b/part/icons/hi22-action-xml_insert_contents.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_insert_element.png b/part/icons/hi22-action-xml_insert_element.png
new file mode 100644
index 0000000..83b71cb
--- /dev/null
+++ b/part/icons/hi22-action-xml_insert_element.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_insert_procins.png b/part/icons/hi22-action-xml_insert_procins.png
new file mode 100644
index 0000000..f861003
--- /dev/null
+++ b/part/icons/hi22-action-xml_insert_procins.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_move_item_down.png b/part/icons/hi22-action-xml_move_item_down.png
new file mode 100644
index 0000000..f5c0c69
--- /dev/null
+++ b/part/icons/hi22-action-xml_move_item_down.png
Binary files differ
diff --git a/part/icons/hi22-action-xml_move_item_up.png b/part/icons/hi22-action-xml_move_item_up.png
new file mode 100644
index 0000000..b3784ef
--- /dev/null
+++ b/part/icons/hi22-action-xml_move_item_up.png
Binary files differ
diff --git a/part/icons/hi32-action-bookmark_next.png b/part/icons/hi32-action-bookmark_next.png
new file mode 100644
index 0000000..4332ea8
--- /dev/null
+++ b/part/icons/hi32-action-bookmark_next.png
Binary files differ
diff --git a/part/icons/hi32-action-bookmark_prev.png b/part/icons/hi32-action-bookmark_prev.png
new file mode 100644
index 0000000..5e1dd5d
--- /dev/null
+++ b/part/icons/hi32-action-bookmark_prev.png
Binary files differ
diff --git a/part/icons/hi32-action-xml_move_item_down.png b/part/icons/hi32-action-xml_move_item_down.png
new file mode 100644
index 0000000..e7230c1
--- /dev/null
+++ b/part/icons/hi32-action-xml_move_item_down.png
Binary files differ
diff --git a/part/icons/hi32-action-xml_move_item_up.png b/part/icons/hi32-action-xml_move_item_up.png
new file mode 100644
index 0000000..046b99b
--- /dev/null
+++ b/part/icons/hi32-action-xml_move_item_up.png
Binary files differ
diff --git a/part/icons/hi32-app-kxmleditor.png b/part/icons/hi32-app-kxmleditor.png
new file mode 100644
index 0000000..763034d
--- /dev/null
+++ b/part/icons/hi32-app-kxmleditor.png
Binary files differ
diff --git a/part/icons/hi48-app-kxmleditor.png b/part/icons/hi48-app-kxmleditor.png
new file mode 100644
index 0000000..50fe869
--- /dev/null
+++ b/part/icons/hi48-app-kxmleditor.png
Binary files differ
diff --git a/part/icons/lo16-action-bookmark_next.png b/part/icons/lo16-action-bookmark_next.png
new file mode 100644
index 0000000..12c0854
--- /dev/null
+++ b/part/icons/lo16-action-bookmark_next.png
Binary files differ
diff --git a/part/icons/lo16-action-bookmark_prev.png b/part/icons/lo16-action-bookmark_prev.png
new file mode 100644
index 0000000..4278292
--- /dev/null
+++ b/part/icons/lo16-action-bookmark_prev.png
Binary files differ
diff --git a/part/icons/lo16-action-collapse_node.png b/part/icons/lo16-action-collapse_node.png
new file mode 100644
index 0000000..3fa8bff
--- /dev/null
+++ b/part/icons/lo16-action-collapse_node.png
Binary files differ
diff --git a/part/icons/lo16-action-expand_node.png b/part/icons/lo16-action-expand_node.png
new file mode 100644
index 0000000..82ee7ec
--- /dev/null
+++ b/part/icons/lo16-action-expand_node.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_delete_attribute.png b/part/icons/lo16-action-xml_delete_attribute.png
new file mode 100644
index 0000000..d63db43
--- /dev/null
+++ b/part/icons/lo16-action-xml_delete_attribute.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_delete_contents.png b/part/icons/lo16-action-xml_delete_contents.png
new file mode 100644
index 0000000..da87e2a
--- /dev/null
+++ b/part/icons/lo16-action-xml_delete_contents.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_delete_element.png b/part/icons/lo16-action-xml_delete_element.png
new file mode 100644
index 0000000..4122060
--- /dev/null
+++ b/part/icons/lo16-action-xml_delete_element.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_delete_procins.png b/part/icons/lo16-action-xml_delete_procins.png
new file mode 100644
index 0000000..ae65ec0
--- /dev/null
+++ b/part/icons/lo16-action-xml_delete_procins.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_edit_attribute.png b/part/icons/lo16-action-xml_edit_attribute.png
new file mode 100644
index 0000000..aa176b1
--- /dev/null
+++ b/part/icons/lo16-action-xml_edit_attribute.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_edit_contents.png b/part/icons/lo16-action-xml_edit_contents.png
new file mode 100644
index 0000000..770d7d8
--- /dev/null
+++ b/part/icons/lo16-action-xml_edit_contents.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_edit_element.png b/part/icons/lo16-action-xml_edit_element.png
new file mode 100644
index 0000000..2a60632
--- /dev/null
+++ b/part/icons/lo16-action-xml_edit_element.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_edit_procins.png b/part/icons/lo16-action-xml_edit_procins.png
new file mode 100644
index 0000000..080db82
--- /dev/null
+++ b/part/icons/lo16-action-xml_edit_procins.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_insert_attribute.png b/part/icons/lo16-action-xml_insert_attribute.png
new file mode 100644
index 0000000..b87786c
--- /dev/null
+++ b/part/icons/lo16-action-xml_insert_attribute.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_insert_contents.png b/part/icons/lo16-action-xml_insert_contents.png
new file mode 100644
index 0000000..5a768fd
--- /dev/null
+++ b/part/icons/lo16-action-xml_insert_contents.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_insert_element.png b/part/icons/lo16-action-xml_insert_element.png
new file mode 100644
index 0000000..9421231
--- /dev/null
+++ b/part/icons/lo16-action-xml_insert_element.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_insert_procins.png b/part/icons/lo16-action-xml_insert_procins.png
new file mode 100644
index 0000000..799e93a
--- /dev/null
+++ b/part/icons/lo16-action-xml_insert_procins.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_move_item_down.png b/part/icons/lo16-action-xml_move_item_down.png
new file mode 100644
index 0000000..30e0602
--- /dev/null
+++ b/part/icons/lo16-action-xml_move_item_down.png
Binary files differ
diff --git a/part/icons/lo16-action-xml_move_item_up.png b/part/icons/lo16-action-xml_move_item_up.png
new file mode 100644
index 0000000..7bb1b68
--- /dev/null
+++ b/part/icons/lo16-action-xml_move_item_up.png
Binary files differ
diff --git a/part/icons/lo16-app-kxmleditor.png b/part/icons/lo16-app-kxmleditor.png
new file mode 100644
index 0000000..5f8c3f2
--- /dev/null
+++ b/part/icons/lo16-app-kxmleditor.png
Binary files differ
diff --git a/part/icons/lo32-app-kxmleditor.png b/part/icons/lo32-app-kxmleditor.png
new file mode 100644
index 0000000..be1dac8
--- /dev/null
+++ b/part/icons/lo32-app-kxmleditor.png
Binary files differ
diff --git a/part/kxe_treeview.cpp b/part/kxe_treeview.cpp
new file mode 100644
index 0000000..f5bd08c
--- /dev/null
+++ b/part/kxe_treeview.cpp
@@ -0,0 +1,909 @@
+/***************************************************************************
+ kxe_treeview.cpp - description
+ -------------------
+ begin : Thu Sep 20 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "kxe_treeview.h"
+#include "kxe_treeviewitem.h"
+#include "kxesearchdialog.h"
+#include "kxmleditorpart.h"
+
+#include "kxmleditorfactory.h"
+#include "kxeconfiguration.h"
+#include "kxetreeviewsettings.h"
+
+#include <klocale.h>
+#include <kdebug.h>
+#include <kxmlgui.h>
+#include <kxmlguiclient.h>
+#include <kpopupmenu.h>
+#include <kglobalsettings.h>
+#include <kmessagebox.h>
+
+// include files for Qt
+#include "qdom_add.h"
+#include <qheader.h>
+#include <qdragobject.h>
+#include <qtimer.h>
+#include <qdom.h>
+#include <qcursor.h>
+#include <qevent.h>
+
+static const int autoOpenTimeout = 750;
+
+
+KXE_TreeView::KXE_TreeView( KXMLGUIClient * pGUIClient, QWidget * pParent, const char * pszName )
+ : KListView(pParent,pszName),
+ m_pGUIClient(pGUIClient),
+ m_nBookmarkedItems(0)
+{
+ setSorting(-1); // no sorting
+
+ addColumn(i18n("Qualified name"));
+
+ setSelectionMode(QListView::Single);
+
+ connect( this, SIGNAL(selectionChanged()), this, SLOT(slotSelectionChanged()) );
+ connect( this, SIGNAL(expanded(QListViewItem*)), this, SLOT(slotItemExpanded(QListViewItem*)) );
+
+ setReadWrite(false);
+
+ m_bDrag = false;
+ m_pCurrentBeforeDropItem = 0;
+ m_pDropItem = 0;
+
+ m_autoOpenTimer = new QTimer(this);
+ connect(m_autoOpenTimer, SIGNAL(timeout()), this, SLOT(slotAutoOpenFolder()));
+
+ // Apply current configuration
+ slotTreeViewSettingsChanged();
+ // and make sure to be informed about its changes.
+ connect( KXMLEditorFactory::configuration()->treeview(), SIGNAL(sigChanged()), this, SLOT(slotTreeViewSettingsChanged()) );
+}
+
+void KXE_TreeView::setReadWrite( bool fReadWrite )
+{
+ setItemsRenameable( fReadWrite );
+ setRenameable( 0, fReadWrite );
+
+ if ( fReadWrite ) // If the widget enters read/write mode, then enable/disable
+ { // dropping (according to the configuration data).
+ setAcceptDrops( KXMLEditorFactory::configuration()->treeview()->enableDropping() );
+ viewport()->setAcceptDrops( KXMLEditorFactory::configuration()->treeview()->enableDropping() );
+ }
+ else // If the widget enter read only mode,
+ { // then disable dropping.
+ setAcceptDrops( false );
+ viewport()->setAcceptDrops( false );
+ }
+}
+
+//////////////////////////////////////////////////////////////
+// configuration slots
+//////////////////////////////////////////////////////////////
+
+void KXE_TreeView::slotTreeViewSettingsChanged()
+{
+ setRootIsDecorated( KXMLEditorFactory::configuration()->treeview()->decorateRoot() );
+
+ if ( KXMLEditorFactory::configuration()->treeview()->elemDisplMode() == KXETreeViewSettings::NoAttributes )
+ {
+ if ( columns() > 1 )
+ removeColumn(1);
+ }
+ else
+ {
+ if ( columns() < 2 )
+ addColumn( i18n("Attributes") );
+ }
+
+ KXE_TreeViewItem * pItem = static_cast<KXE_TreeViewItem*> (firstChild());
+ while (pItem)
+ {
+ pItem->setTexts();
+ pItem = pItem->nextItem();
+ }
+
+ if ( itemsRenameable() ) // If the widget is in read/write mode, then enable/disable
+ { // dropping (according to the configuration data).
+ setAcceptDrops( KXMLEditorFactory::configuration()->treeview()->enableDropping() );
+ viewport()->setAcceptDrops( KXMLEditorFactory::configuration()->treeview()->enableDropping() );
+ }
+
+}
+
+//////////////////////////////////////////////////////////////
+// action slots
+//////////////////////////////////////////////////////////////
+
+void KXE_TreeView::editDeselect()
+{
+ clearSelection();
+}
+
+void KXE_TreeView::viewNodeUp()
+{
+ // get selected item from tree view
+ QListViewItem * pSelItem = selectedItem();
+ if ( ! pSelItem )
+ {
+ kdDebug() << "KXE_TreeView::slotViewNodeUp no item selected" << endl;
+ return;
+ }
+
+ // get parent item
+ QListViewItem * pParentItem = pSelItem->parent();
+
+ // select parent item in tree view
+ if (pParentItem)
+ {
+ setCurrentItem(pParentItem);
+ ensureItemVisible(pParentItem);
+ }
+}
+
+void KXE_TreeView::viewExpNode( int nLevel )
+{
+ // get selected item from tree view (if any)
+ QListViewItem * pSelItem = selectedItem();
+ if ( ! pSelItem )
+ {
+ kdDebug() << "KXE_TreeView::slotViewExpNode no item selected" << endl;
+ return;
+ }
+
+ // expand node
+ KXE_TreeViewItem * pSelTreeItem = static_cast <KXE_TreeViewItem*> (pSelItem);
+ pSelTreeItem->expandSubTree(nLevel);
+}
+
+void KXE_TreeView::viewColNode( int nLevel )
+{
+ // get selected item from tree view (if any)
+ QListViewItem * pSelItem = selectedItem();
+ if ( ! pSelItem )
+ {
+ kdDebug() << "KXE_TreeView::slotViewColNode no item selected" << endl;
+ return;
+ }
+
+ // expand node
+ KXE_TreeViewItem * pSelTreeItem = static_cast <KXE_TreeViewItem*> (pSelItem);
+ pSelTreeItem->collapseSubTree(nLevel);
+}
+
+void KXE_TreeView::bookmarksToggle()
+{
+ // get selected item from tree view
+ KXE_TreeViewItem * pSelItem = static_cast <KXE_TreeViewItem*> (selectedItem());
+ if ( ! pSelItem )
+ {
+ kdDebug() << "KXE_TreeView::bookmarksToggle: no item selected" << endl;
+ return;
+ }
+
+ // toggle bookmark on selected item
+ if(pSelItem->toggleBookmark())
+ m_nBookmarkedItems++;
+ else
+ m_nBookmarkedItems--;
+}
+
+void KXE_TreeView::bookmarksPrev()
+{
+ if ( childCount() < 1 )
+ {
+ kdDebug() << "KXE_TreeView::bookmarksPrev: internal error - this tree view is empty" << endl;
+ return;
+ }
+
+ // get selected item from tree view
+ KXE_TreeViewItem * pSelItem = static_cast <KXE_TreeViewItem*> (selectedItem());
+ if ( ! pSelItem ) // If there is no item selected we take
+ { // the last root items last grand child.
+ QListViewItem * pTmpItem = firstChild(); // Take first child and
+ while ( pTmpItem->nextSibling() ) // find last child by
+ pTmpItem = pTmpItem->nextSibling(); // traversing all childs
+
+ pSelItem = static_cast <KXE_TreeViewItem*> (pTmpItem); // this is the last root item
+ while ( pSelItem->lastChild() ) // find its last
+ pSelItem = pSelItem->lastChild(); // grand child
+
+ if ( pSelItem->isBookmarked() ) // We have to check its
+ { // bookmarked-status
+ selectItem(pSelItem); // and select it, in case
+ return; // it is bookmarked.
+ }
+ }
+
+ // Search items above the selected one
+ while ( (pSelItem = pSelItem->prevItem()) != 0 )
+ {
+ if ( pSelItem->isBookmarked() )
+ {
+ selectItem(pSelItem);
+ return;
+ }
+ }
+}
+
+void KXE_TreeView::bookmarksNext()
+{
+ if ( childCount() < 1 )
+ {
+ kdDebug() << "KXE_TreeView::bookmarksNext: internal error - this tree view is empty" << endl;
+ return;
+ }
+
+ // get selected item from tree view
+ KXE_TreeViewItem * pSelItem = static_cast <KXE_TreeViewItem*> (selectedItem());
+ if ( ! pSelItem )
+ { // If there is no item selected
+ pSelItem = static_cast <KXE_TreeViewItem*> (firstChild()); // we take the first root item,
+ if ( pSelItem->isBookmarked() ) // but we have to check its
+ { // bookmarked-status
+ selectItem(pSelItem); // and select it, in case
+ return; // it is bookmarked.
+ }
+ }
+
+ // Search items below the selected one
+ while ( (pSelItem = pSelItem->nextItem()) != 0 )
+ {
+ if ( pSelItem->isBookmarked() )
+ {
+ selectItem(pSelItem);
+ return;
+ }
+ }
+}
+
+void KXE_TreeView::selectItem( KXE_TreeViewItem * const pItem )
+{
+ if ( ! pItem )
+ {
+ kdDebug() << "KXE_TreeView::selectItem: the given pointer is a null pointer" << endl;
+ return;
+ }
+
+ setSelected( pItem, true );
+ setCurrentItem( pItem );
+ ensureItemVisible( pItem );
+}
+
+bool KXE_TreeView::selectNode( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdError() << "KXE_TreeView::selectNode: the given node is an empty one" << endl;
+ return false;
+ }
+
+ KXE_TreeViewItem * pItem = findCorrespondingItem(node);
+
+ if ( ! pItem ) // can't find the corresponding item
+ {
+ kdError() << "KXE_TreeView::selectNode can't find an item to the given node." << endl;
+ return false;
+ }
+
+ selectItem(pItem);
+ return true;
+}
+
+QDomNode * KXE_TreeView::getSelectedNode() const
+{
+ // get selected item from tree view
+ QListViewItem * pSelItem = selectedItem();
+ if ( ! pSelItem )
+ return 0;
+
+ KXE_TreeViewItem * pSelTreeItem = static_cast <KXE_TreeViewItem *> (pSelItem);
+ return pSelTreeItem->xmlNode();
+}
+
+QDomNode * KXE_TreeView::getSpecProcInstrNode(const QString& target) const
+{
+ KXE_TreeViewItem * pTreeItem = static_cast<KXE_TreeViewItem*> (firstChild());
+ while ( pTreeItem )
+ {
+ if (pTreeItem->xmlNode()->isProcessingInstruction())
+ {
+ QDomProcessingInstruction domProcInstr = pTreeItem->xmlNode()->toProcessingInstruction();
+ if(domProcInstr.target() == target)
+ return pTreeItem->xmlNode();
+ }
+
+ pTreeItem = pTreeItem->nextItem();
+ }
+
+ return 0;
+}
+
+// Return info, is root element is already created
+bool KXE_TreeView::hasRootNode()
+{
+ KXE_TreeViewItem * pTreeItem = static_cast<KXE_TreeViewItem*> (firstChild());
+ while ( pTreeItem )
+ {
+ if (pTreeItem->xmlNode()->isElement())
+ {
+ return true;
+ }
+
+ pTreeItem = pTreeItem->nextItem();
+ }
+
+ return false;
+}
+
+
+QString KXE_TreeView::getSelectedPath() const
+{
+ // get selected item from tree view
+ QListViewItem * pSelItem = selectedItem();
+ if ( ! pSelItem )
+ return QString();
+
+ KXE_TreeViewItem * pSelTreeItem = static_cast <KXE_TreeViewItem *> (pSelItem);
+ return domTool_getPath( * pSelTreeItem->xmlNode() );
+}
+
+void KXE_TreeView::contentsMousePressEvent( QMouseEvent * pEvent )
+{
+ KListView::contentsMousePressEvent(pEvent);
+
+ if ( pEvent->button() == RightButton )
+ {
+ QString szMenuName;
+
+ QListViewItem * pItem = itemAt( contentsToViewport(pEvent->pos()) );
+ if (pItem)
+ {
+ KXE_TreeViewItem * pTreeItem = static_cast <KXE_TreeViewItem*> (pItem);
+ switch( pTreeItem->xmlNode()->nodeType() )
+ {
+ case QDomNode::ElementNode:
+ szMenuName = "popupXmlElement";
+ break;
+ case QDomNode::TextNode:
+ case QDomNode::CDATASectionNode:
+ case QDomNode::CommentNode:
+ szMenuName = "popupXmlContent";
+ break;
+ case QDomNode::ProcessingInstructionNode:
+ szMenuName = "popupXmlProcInstr";
+ break;
+ default:
+ kdDebug() << "KXE_TreeView::contentsMousePressEvent unknown item type" << endl;
+ return;
+ }
+ }
+ else
+ szMenuName = "popupXmlTree";
+
+ emit sigContextMenuRequested( szMenuName, QCursor::pos() );
+ return;
+ }
+
+ //--- Drag & Drop ------------------------------------------------------
+ QPoint p(contentsToViewport(pEvent->pos()));
+ QListViewItem *i = itemAt(p);
+
+ if(pEvent->button() == LeftButton && i)
+ { // if the user clicked into the root decoration of the item, don't try to start a drag!
+ if(p.x() > header()->cellPos(header()->mapToActual(0)) +
+ treeStepSize() * ( i->depth() + (rootIsDecorated() ? 1 : 0)) + itemMargin() ||
+ p.x() < header()->cellPos(header()->mapToActual(0)))
+ {
+ m_dragPos = pEvent->pos();
+ m_bDrag = true;
+ }
+ }
+}
+
+void KXE_TreeView::slotSelectionChanged()
+{
+ KXE_TreeViewItem * pItem = static_cast <KXE_TreeViewItem*> (selectedItem());
+
+ if ( ! pItem )
+ emit sigSelectionCleared(hasRootNode());
+ else
+ {
+ QDomNode selectedNode = * ( pItem->xmlNode() ); // uses QDomNode copy constructor
+
+ // choose appropriate object kind
+ switch ( selectedNode.nodeType() )
+ {
+ case QDomNode::ElementNode:
+ emit sigSelectionChanged( selectedNode.toElement());
+ break;
+
+ case QDomNode::TextNode:
+ case QDomNode::CDATASectionNode:
+ case QDomNode::CommentNode:
+ emit sigSelectionChanged( selectedNode.toCharacterData());
+ break;
+
+ case QDomNode::ProcessingInstructionNode:
+ emit sigSelectionChanged( selectedNode.toProcessingInstruction());
+ break;
+
+ default:
+ kdDebug() << "KXE_TreeView::slotSelectionChanged unknown object type selected" << endl;
+ return;
+ }
+ }
+}
+
+
+void KXE_TreeView::slotItemExpanded( QListViewItem * pItem )
+{
+ KXE_TreeViewItem * pTreeViewItem = static_cast<KXE_TreeViewItem*> (pItem);
+ pTreeViewItem->ensureGrandChildItemsCreated();
+}
+
+
+//////////////////////////////////////////////////////////////
+// update slots
+//////////////////////////////////////////////////////////////
+
+void KXE_TreeView::updateNodeCreated( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeCreated the given node is an empty one." << endl;
+ return;
+ }
+
+ KXE_TreeViewItem * pNewItem;
+ if ( node.parentNode().isDocument() ) // the new nodes parent is the document itself,
+ {
+ // so we have to create a root item.
+ // Now it depends: either it's a processing instruction, or element
+ if (node.isProcessingInstruction())
+ // Tree looks much nicer if root processing instructions are ont the top...
+ {
+ QDomNode *pNode = getSpecProcInstrNode("xml");
+ if (pNode)
+ pNewItem = new KXE_TreeViewItem( node, this,findCorrespondingItem(*pNode));
+ else
+ pNewItem = new KXE_TreeViewItem( node, this);
+ }
+ else
+ // ...and root element is placed at the bottom.
+ pNewItem = new KXE_TreeViewItem( node, this,lastChild());
+// pNewItem = new KXE_TreeViewItem( node, this);
+
+ if ( ! rootIsDecorated() )
+ pNewItem->setOpen(true);
+ }
+ else
+ {
+ if ( node.parentNode().isNull() )
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeCreated the given node has no parent node (but should)." << endl;
+ return;
+ }
+
+ // To create the new item, we need (1st) the item corresponding to the parent node of the given one.
+ QDomNode parentNode = node.parentNode();
+ // Because the currently selected item is very likely (in many cases) the correct one, try it first.
+ KXE_TreeViewItem * pParentItem = static_cast<KXE_TreeViewItem*> (selectedItem());
+ if ( (!pParentItem) || ( *(pParentItem->xmlNode()) != parentNode ) )
+ { // no strike :-(
+ pParentItem = findCorrespondingItem(parentNode); // do it the "long" way
+ }
+
+ if ( ! pParentItem ) // can't find the corresponding item
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeCreated can't find an item to the given nodes parent node." << endl;
+ return;
+ }
+
+ // Now we need (2nd) the item corresponding to the previous sibling of the given one,
+ // because, the new item has to be inserted behind the given one.
+ QDomNode prevNode = node.previousSibling();
+ if ( prevNode.isNull() )
+ { // it seems to be the first child node, so create a first child item
+ pNewItem = new KXE_TreeViewItem( node, pParentItem );
+ }
+ else
+ {
+ KXE_TreeViewItem * pPrevItem = findCorrespondingItem(prevNode);
+ if ( ! pParentItem ) // can't find the corresponding item :-(
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeCreated can't find an item to the given nodes previous sibling." << endl;
+ return;
+ }
+ // everything's alright, let's create the new item
+ pNewItem = new KXE_TreeViewItem( node, pParentItem, pPrevItem );
+ }
+
+ }
+
+ setSelected( pNewItem, true );
+ ensureItemVisible( pNewItem );
+}
+
+void KXE_TreeView::updateNodeChanged( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeChanged the given node is an empty one." << endl;
+ return;
+ }
+
+ // To change the item, we have to find it.
+ // Because the currently selected item is very likely (in many cases) the correct one, try it first.
+ KXE_TreeViewItem * pItem = static_cast<KXE_TreeViewItem*> (selectedItem());
+ if ( (!pItem) || ( *(pItem->xmlNode()) != node ) ) // no strike :-(
+ pItem = findCorrespondingItem(node); // do it the "long" way
+
+ if ( ! pItem ) // can't find the corresponding item
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeChanged can't find an item to the given node." << endl;
+ return;
+ }
+
+ pItem->setTexts(); // update the item
+
+ setSelected( pItem, true );
+ ensureItemVisible( pItem );
+}
+
+void KXE_TreeView::updateNodeDeleted( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeDeleted the given node is an empty one." << endl;
+ return;
+ }
+
+ // To remove the item, we have to find it.
+ // Because the currently selected item is very likely (in many cases) the correct one, try it first.
+ KXE_TreeViewItem * pItem = static_cast<KXE_TreeViewItem*> (selectedItem());
+ if ( (!pItem) || ( *(pItem->xmlNode()) != node ) ) // no strike :-(
+ pItem = findCorrespondingItem(node); // do it the "long" way
+
+ if ( ! pItem ) // can't find the corresponding item
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeDeleted can't find an item to the given node." << endl;
+ return;
+ }
+
+ clearSelection();
+
+ delete pItem;
+
+ emit sigSelectionCleared(hasRootNode());
+}
+
+void KXE_TreeView::updateNodeMoved( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeMoved the given node is an empty one." << endl;
+ return;
+ }
+
+ // To move the item, we have to find it.
+ // Because the currently selected item is very likely (in many cases) the correct one, try it first.
+ KXE_TreeViewItem * pItem = static_cast<KXE_TreeViewItem*> (selectedItem());
+ if ( (!pItem) || ( *(pItem->xmlNode()) != node ) ) // no strike :-(
+ pItem = findCorrespondingItem(node); // do it the "long" way
+
+ if ( ! pItem ) // can't find the corresponding item
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeMoved can't find an item to the given node." << endl;
+ return;
+ }
+
+ // Now we can move the item (of the moved node).
+ // We have to differenciate between the following 2 cases.
+ if ( node.previousSibling().isNull() )
+ {
+ // The node does not has a previous sibling. This means, it has been moved
+ // to be its parent first child. In this case, we have to find the tree
+ // view item of the node's next sibling to swap them.
+ // It's very likely the previous sibling of the item corresponding to the
+ // moved node.
+ KXE_TreeViewItem * pOldPrevItem = pItem->prevSibling();
+ // Was it really?
+ if ( ! pOldPrevItem || ( *(pOldPrevItem->xmlNode()) != node.nextSibling() ) )
+ // It wasn't (how can it be?) - we have to find it using the "long" way.
+ pOldPrevItem = findCorrespondingItem( node.nextSibling() );
+
+ if ( ! pOldPrevItem ) // something went wrong
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeMoved can't find the item to the given node's next sibling." << endl;
+ return;
+ }
+
+ // Now we can swap them (make the old previous item the new next item of
+ // the moved node's item).
+ pOldPrevItem->moveItem( pItem );
+ }
+ else
+ {
+ // The node has a previous sibling. In this case we have to find the
+ // corresponding tree view item to swap it with the item corresponding to
+ // the moved node.
+ KXE_TreeViewItem * pNewPrevItem = findCorrespondingItem( node.previousSibling() );
+ if ( ! pNewPrevItem )
+ {
+ kdError() << "KXE_TreeView::slotUpdateNodeMoved can't find the new prev.item to the given nodes prev.node." << endl;
+ return;
+ }
+
+ // swap them (move the moved node's item after the previous sibling's item)
+ pItem->moveItem( pNewPrevItem );
+ }
+
+ setSelected( pItem, true );
+ ensureItemVisible( pItem );
+}
+
+void KXE_TreeView::updateClear()
+{
+ clear();
+}
+
+void KXE_TreeView::rename( QListViewItem * pItem, int nColumn )
+{
+ if ( nColumn != 0 ) // inplace editing only
+ return; // for the first column
+
+ KXE_TreeViewItem * pXMLItem = static_cast <KXE_TreeViewItem*> (pItem);
+ if ( pXMLItem->xmlNode()->isElement() ) // inplace-renaming only for items representing XML elements
+ KListView::rename( pItem, nColumn ); // inplace-renaming via base class functionality
+
+ else if(pXMLItem->xmlNode()->isCharacterData()) // launch dialog for editing text nodes
+ (dynamic_cast <KXMLEditorPart *> (m_pGUIClient))->slotXmlCharDataEdit();
+
+ else if(pXMLItem->xmlNode()->isProcessingInstruction()) // launch dialog for editing proc.instr.
+ (dynamic_cast <KXMLEditorPart *> (m_pGUIClient))->slotXmlProcInstrEdit();
+}
+
+//////////////////////////////////////////////////////////////
+// misc functions
+//////////////////////////////////////////////////////////////
+
+KXE_TreeViewItem * KXE_TreeView::findCorrespondingItem( const QDomNode & node )
+{
+ KXE_TreeViewItem * pItem = static_cast<KXE_TreeViewItem*> (firstChild());
+ while ( pItem )
+ {
+ if ( *(pItem->xmlNode()) == node )
+ return pItem;
+ pItem = pItem->nextItem();
+ }
+
+ return 0;
+}
+
+//////////////////////////////////////////////////////////////
+// Drag & Drop
+//////////////////////////////////////////////////////////////
+
+/** Overrides KListView::contentsMouseMoveEvent */
+void KXE_TreeView::contentsMouseMoveEvent(QMouseEvent *e)
+{
+ KListView::contentsMouseMoveEvent(e);
+
+ // exit, if dragging is disabled
+ if ( ! KXMLEditorFactory::configuration()->treeview()->enableDragging() )
+ return;
+
+ if(!m_bDrag || (e->pos() - m_dragPos).manhattanLength() <= KGlobalSettings::dndEventDelay())
+ return;
+
+ m_bDrag = false;
+
+ QListViewItem *item = itemAt(contentsToViewport(m_dragPos));
+
+ if(!item || !item->isSelectable())
+ return;
+
+ // copy item into clipboard
+ KXE_TreeViewItem *pXmlTreeItem = static_cast <KXE_TreeViewItem *> (item);
+ QTextDrag *pDrag = (dynamic_cast <KXMLEditorPart *> (m_pGUIClient))->copyNode(pXmlTreeItem->xmlNode());
+
+
+ // Start a drag
+ const QPixmap *pix = item->pixmap(0);
+ if(pix && pDrag->pixmap().isNull())
+ { QPoint hotspot(pix->width() / 2, pix->height() / 2);
+ pDrag->setPixmap(*pix, hotspot);
+ }
+
+ pDrag->drag();
+}
+
+/** Overrides KListView::contentsMouseReleaseEvent */
+void KXE_TreeView::contentsMouseReleaseEvent(QMouseEvent *e)
+{
+ KListView::contentsMouseReleaseEvent(e);
+ m_bDrag = false;
+}
+
+/** Overrides QScrollView::contentsDragEnterEvent */
+void KXE_TreeView::contentsDragEnterEvent(QDragEnterEvent *e)
+{
+ m_pDropItem = 0;
+ m_pCurrentBeforeDropItem = selectedItem();
+
+ // Save the available formats
+ m_lstDropFormats.clear();
+ for(int i = 0; e->format(i); i++)
+ { if(*(e->format(i)))
+ { m_lstDropFormats.append(e->format(i));
+ }
+ }
+}
+
+/** Overrides QScrollView::contentsDragMoveEvent */
+void KXE_TreeView::contentsDragMoveEvent(QDragMoveEvent *e)
+{
+ QListViewItem *item = itemAt(contentsToViewport(e->pos()));
+
+ // Accept drops on the background, if Texts
+ if(!item && (m_lstDropFormats.contains("text/")))
+ { m_pDropItem = 0;
+ e->acceptAction();
+ if(selectedItem())
+ setSelected(selectedItem(), false); // no item selected
+ return;
+ }
+
+ if(!item || !item->isSelectable())
+ { m_pDropItem = 0;
+ m_autoOpenTimer->stop();
+ e->ignore();
+ return;
+ }
+
+ e->acceptAction();
+
+ setSelected(item, true);
+
+ if(item != m_pDropItem )
+ { m_autoOpenTimer->stop();
+ m_pDropItem = item;
+ m_autoOpenTimer->start(autoOpenTimeout);
+ }
+}
+
+/** Overrides QScrollView::contentsDragLeaveEvent */
+void KXE_TreeView::contentsDragLeaveEvent(QDragLeaveEvent *e)
+{
+ e=e;
+ // Restore the current item to what it was before the dragging (#17070)
+ if(m_pCurrentBeforeDropItem)
+ setSelected(m_pCurrentBeforeDropItem, true);
+ else
+ setSelected(m_pDropItem, false); // no item selected
+
+ m_pCurrentBeforeDropItem = 0;
+ m_pDropItem = 0;
+ m_lstDropFormats.clear();
+}
+
+/** Overrides QScrollView::contentsDropEvent */
+void KXE_TreeView::contentsDropEvent(QDropEvent *pDropEvent)
+{
+ m_autoOpenTimer->stop();
+
+ drop(selectedItem(), pDropEvent);
+}
+
+/** Called, when m_autoOpenTimer timeout occured */
+void KXE_TreeView::slotAutoOpenFolder()
+{
+ m_autoOpenTimer->stop();
+
+ if(!m_pDropItem || m_pDropItem->isOpen())
+ return;
+
+ m_pDropItem->setOpen( true );
+ m_pDropItem->repaint();
+}
+
+/** Drop or paste text into item */
+bool KXE_TreeView::drop(QListViewItem *pItem, QDropEvent *pDropEvent)
+{
+ KXE_TreeViewItem* pTreeItem = 0;
+ if(pItem)
+ pTreeItem = static_cast <KXE_TreeViewItem *> (pItem);
+
+ QDomNode *pTargetNode = pTreeItem->xmlNode();
+
+ // First, make check, if moved item is not moved to their children
+ if((pDropEvent->source() == this) && (pDropEvent->action() == QDropEvent::Move))
+ { // make check, if moved item is not moved to itself
+ if(m_pCurrentBeforeDropItem && pTreeItem && (m_pCurrentBeforeDropItem == pTreeItem))
+ { return false;
+ }
+
+ if(m_pCurrentBeforeDropItem && pTreeItem &&
+ static_cast <KXE_TreeViewItem*> (m_pCurrentBeforeDropItem)->isMyChildren(pTreeItem))
+ { KMessageBox::sorry(0, i18n("An XML element can't be moved to its own subtree."));
+ return false;
+ }
+
+ if (pTreeItem->xmlNode()->isProcessingInstruction())
+ {
+ KMessageBox::sorry(0, i18n("An XML node can't be moved in a processing instruction."));
+ return false;
+ }
+
+ QDomNode * pNode = static_cast <KXE_TreeViewItem*> (m_pCurrentBeforeDropItem)->xmlNode();
+ if (pNode->isProcessingInstruction())
+ {
+ QDomProcessingInstruction domProcInstr = pNode->toProcessingInstruction();
+
+ if(domProcInstr.target() == "xml")
+ { KMessageBox::sorry(0, i18n("This processing instruction cannot be moved !"));
+ return false;
+ }
+ }
+ }
+
+ //-- If Move from same instance of this widget
+ if((pDropEvent->source() == this) && (pDropEvent->action() == QDropEvent::Move) && (m_pCurrentBeforeDropItem) && pTargetNode->isElement())
+ {
+ // remove source item
+ QDomNode * pSourceNode = static_cast <KXE_TreeViewItem*> (m_pCurrentBeforeDropItem)->xmlNode();
+ QDomElement domTargetElement = pTargetNode->toElement();
+
+ if((dynamic_cast <KXMLEditorPart *> (m_pGUIClient))->dropMoveNode(domTargetElement, *pSourceNode))
+ {
+ pDropEvent->acceptAction();
+ return true;
+ }
+ }
+ else
+ {
+ //-- If Copy, do standart Paste function
+ if((dynamic_cast <KXMLEditorPart *> (m_pGUIClient))->pasteNode(pTargetNode, pDropEvent))
+ {
+ pDropEvent->acceptAction();
+ return true;
+ }
+ }
+ return false;
+}
+
+
+//
+// returns last child on the tree (top-level)
+//
+KXE_TreeViewItem* KXE_TreeView::lastChild()
+{
+ QListViewItem* pItem = firstChild();
+ if (pItem && pItem->nextSibling())
+ do
+ pItem = pItem->nextSibling();
+ while (pItem->nextSibling());
+
+ // here we have it...
+ return (KXE_TreeViewItem*) pItem;
+}
+
+void KXE_TreeView::keyPressEvent(QKeyEvent *e)
+{
+ KListView::keyPressEvent(e);
+ emit sigKeyPressed(e);
+}
diff --git a/part/kxe_treeview.h b/part/kxe_treeview.h
new file mode 100644
index 0000000..0ba2c86
--- /dev/null
+++ b/part/kxe_treeview.h
@@ -0,0 +1,235 @@
+/***************************************************************************
+ kxe_treeview.h - description
+ -------------------
+ begin : Thu Sep 20 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXE_TREEVIEW_H
+#define KXE_TREEVIEW_H
+
+#include <klistview.h>
+#include <qstrlist.h>
+
+class KXESearchDialog;
+
+class QDomDocument;
+class QDomNode;
+class QDomElement;
+class QDomCharacterData;
+class QDomProcessingInstruction;
+
+class QMouseEvent;
+class QTimer;
+class QKeyEvent;
+class KXMLGUIClient;
+class KXE_TreeViewItem;
+
+/**
+ * This is a listview, which displays the XML tree structure.
+ * @short shows XML tree
+ */
+class KXE_TreeView : public KListView
+{
+ Q_OBJECT
+
+public:
+ KXE_TreeView( KXMLGUIClient * pGUIClient, QWidget * pParent = 0, const char * pszName = 0 );
+
+ /** Changes the behaviour of this view to readonly or readwrite. */
+ void setReadWrite( bool fReadWrite );
+
+ /** Selects the given item. */
+ void selectItem( KXE_TreeViewItem * const pItem );
+
+ /** Selects the item corresponding to the given node.
+ * Returns true on success, false otherwise. */
+ bool selectNode( const QDomNode & node );
+
+ /** Returns the a pointer to the selected items node or a null pointer (if no item is selected). */
+ QDomNode * getSelectedNode() const;
+
+ /** Returns the a pointer to the special processing instruction or a null pointer for (if no item is exists). */
+ QDomNode * getSpecProcInstrNode(const QString& target) const;
+
+ /** Returns the selected items path or an empty string, if no item is selected. */
+ QString getSelectedPath() const;
+
+ /** Returns true, if this tree view contains bookmarked tree items and false otherwise. */
+ bool containsBookmarkedItems() const { return (m_nBookmarkedItems>0); }
+
+ /** Drop or paste text into item */
+ bool drop(QListViewItem *, QDropEvent *);
+
+ /** toggles bookmark on the selected item */
+ void bookmarksToggle();
+
+ /** searches for the next bookmarked item */
+ void bookmarksPrev();
+
+ /** searches for the previous bookmarked item */
+ void bookmarksNext();
+
+ /** deselects currently selected item */
+ void editDeselect();
+
+ /** Selects the selected item's parent item. */
+ void viewNodeUp();
+
+ /** Expands the selected tree item's subtree to the given level (see @ref KXE_TreeViewItem::expandSubTree). */
+ void viewExpNode( int nLevel );
+
+ /** Collapses the selected tree item's subtree to the given level (see @ref KXE_TreeViewItem::collapseSubTree). */
+ void viewColNode( int nLevel );
+
+ /**
+ * Creates new item(s) to the given node (and its child nodes)
+ * and inserts it (or them) in the tree.
+ */
+ void updateNodeCreated( const QDomNode & node );
+
+ /** Changes the item corresponding to the given node. */
+ void updateNodeChanged( const QDomNode & node );
+
+ /** Removes the item corresponding to the given node. */
+ void updateNodeDeleted( const QDomNode & node );
+
+ /** Moves the item corresponding to the given node. */
+ void updateNodeMoved( const QDomNode & node );
+
+ /** Clears the whole tree. */
+ void updateClear();
+
+ /**
+ * Handles inplace-renaming of items, because in our case
+ * only items representing XML elements are to be renameable.
+ * For the actual renaming of the items text, the base
+ * class functionality is used and the signal
+ * @ref sigItemRenamedInplace emitted.
+ */
+ virtual void rename( QListViewItem * pItem, int nColumn );
+
+ /** Returns info, is root element is already created */
+ bool hasRootNode();
+ /** Returns last top-level child on the tree. If there are no chold in the tree, null is returned. */
+ KXE_TreeViewItem* lastChild();
+
+public slots:
+
+ // configuration slots
+ //////////////////////////////////////////////////////////////
+
+ /**
+ * Changes this tree view's settings according to the current
+ * configuration.
+ */
+ void slotTreeViewSettingsChanged();
+
+signals:
+ /** emitted, when no item is selected */
+ void sigSelectionCleared(bool);
+
+ /** emitted, when an XML element item is selected */
+ void sigSelectionChanged( const QDomElement & );
+
+ /** emitted, when an XML Content item is selected */
+ void sigSelectionChanged( const QDomCharacterData & );
+
+ /** emitted, when an XML proc.instr. item is selected */
+ void sigSelectionChanged( const QDomProcessingInstruction & );
+
+ /**
+ * Signals the change of bookmark status.
+ * true - item(s) bookmarked
+ * false - no item bookmarked
+ */
+ void sigNewBookmarkStatus( bool fStatus );
+
+ /** Emitted, when a context menu is requested */
+ void sigContextMenuRequested( const QString & szMenuName, const QPoint & pos );
+ /** Emitted when user presses a key. */
+ void sigKeyPressed(QKeyEvent* e);
+
+protected:
+ /** if RMB shows the popupmenu corresponding to the selected item */
+ void contentsMousePressEvent( QMouseEvent * );
+
+ /** Finds the corresponding treeview item to the given node. */
+ KXE_TreeViewItem * findCorrespondingItem( const QDomNode & node );
+
+ /** Overrides KListView::contentsMouseReleaseEvent */
+ void contentsMouseReleaseEvent(QMouseEvent *);
+
+ /** Overrides KListView::contentsMouseMoveEvent */
+ void contentsMouseMoveEvent(QMouseEvent *);
+
+ /** Overrides QScrollView::contentsDragEnterEvent */
+ void contentsDragEnterEvent(QDragEnterEvent *);
+
+ /** Overrides QScrollView::contentsDragMoveEvent */
+ void contentsDragMoveEvent(QDragMoveEvent *);
+
+ /** Overrides QScrollView::contentsDragLeaveEvent */
+ void contentsDragLeaveEvent(QDragLeaveEvent *);
+
+ /** Overrides QScrollView::contentsDropEvent */
+ void contentsDropEvent(QDropEvent *);
+ virtual void keyPressEvent(QKeyEvent *e);
+
+protected slots:
+ /** Checks, which type of item was selected an emits the corresponding signal. */
+ void slotSelectionChanged();
+ /**
+ * Ensures that the expanded item's grandchild items are created.
+ * This is very important for the "create items on demand" mode. But even in
+ * "create all items while loading" mode, this function has to be executed,
+ * because KXMLEditor could have been in "create items on demand" mode during
+ * the opening of the document.
+ *
+ * To be connected to the signal QListView::expanded(QListViewItem*).
+ */
+ void slotItemExpanded( QListViewItem * );
+
+private slots:
+
+ /** Called, when m_autoOpenTimer timeout occured */
+ void slotAutoOpenFolder();
+
+protected:
+
+ /** the GUI client, needed for the popupmenus */
+ KXMLGUIClient * m_pGUIClient;
+
+ /** number of bookmarked items */
+ unsigned int m_nBookmarkedItems;
+
+ /** True if drag&drop operation started, otherwise is false */
+ bool m_bDrag;
+
+ /** Contain mouse position of drag operation */
+ QPoint m_dragPos;
+
+ /** The item that was current before the drag-enter event happened */
+ QListViewItem *m_pCurrentBeforeDropItem;
+
+ /** The item we are moving the mouse over (during a drag) */
+ QListViewItem *m_pDropItem;
+
+ /** List of avalilable drop formats */
+ QStrList m_lstDropFormats;
+
+ /** Timer for counting time to auto open fselected folder while drag */
+ QTimer *m_autoOpenTimer;
+};
+
+#endif
diff --git a/part/kxe_treeviewitem.cpp b/part/kxe_treeviewitem.cpp
new file mode 100644
index 0000000..0107bee
--- /dev/null
+++ b/part/kxe_treeviewitem.cpp
@@ -0,0 +1,330 @@
+/***************************************************************************
+ kxe_treeviewitem.cpp - description
+ -------------------
+ begin : Wed Nov 21 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxe_treeviewitem.h"
+
+#include "kxmleditorfactory.h"
+#include "kxeconfiguration.h"
+#include "kxetreeviewsettings.h"
+
+#include "qdom_add.h"
+
+#include <qregexp.h>
+
+#include <klistview.h>
+#include <kdebug.h>
+#include <kiconloader.h>
+
+KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pParent )
+ : QListViewItem(pParent),
+ m_xmlNode(xmlNode),
+ m_pPrevSibling(0),
+ m_bBookmarked(false),
+ m_bChildsCreated(false),
+ m_bGrandChildsCreated(false)
+{
+ init();
+ initChilds();
+}
+
+KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, KListView * pParent, QListViewItem* pAfter)
+ : QListViewItem(pParent,pAfter),
+ m_xmlNode(xmlNode),
+ m_pPrevSibling(0),
+ m_bBookmarked(false),
+ m_bChildsCreated(false),
+ m_bGrandChildsCreated(false)
+{
+ init();
+ initChilds();
+}
+
+KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pParent, QListViewItem * pAfter )
+ : QListViewItem( pParent, pAfter ),
+ m_xmlNode(xmlNode),
+ m_pPrevSibling(0),
+ m_bBookmarked(false),
+ m_bChildsCreated(false),
+ m_bGrandChildsCreated(false)
+{
+ init();
+ initChilds();
+}
+
+KXE_TreeViewItem::~KXE_TreeViewItem()
+{
+ // inform the next sibling (if there's any) about destroying this item (as its previous sibling)
+ KXE_TreeViewItem * pNextItem = static_cast <KXE_TreeViewItem*> (nextSibling());
+ if ( pNextItem )
+ { pNextItem->setPrevSibling(m_pPrevSibling);
+ }
+}
+
+void KXE_TreeViewItem::init()
+{
+ // A tree view item can only be in-place renameable, if it represents an XML element
+ // (the final check occurs in KXE_TreeViewItem::startRename).
+ if ( m_xmlNode.isElement() )
+ setRenameEnabled( 0, true );
+
+ // inform the next sibling (if there's any) about this item (as its previous sibling)
+ KXE_TreeViewItem * pNextItem = static_cast <KXE_TreeViewItem*> (nextSibling());
+ if ( pNextItem )
+ pNextItem->setPrevSibling(this);
+
+ setPixmap(0, domTool_getIconForNodeType(m_xmlNode.nodeType(), false));
+
+ if ( domTool_getLevel(m_xmlNode) < (unsigned int)KXMLEditorFactory::configuration()->treeview()->dfltExpLevel() )
+ setOpen(true);
+
+ setTexts();
+}
+
+void KXE_TreeViewItem::setTexts()
+{
+ switch ( m_xmlNode.nodeType() )
+ {
+ case QDomNode::ElementNode:
+
+ setText( 0, m_xmlNode.toElement().nodeName() );
+
+ if ( KXMLEditorFactory::configuration()->treeview()->elemDisplMode() == KXETreeViewSettings::NoAttributes )
+ setText( 1, QString() );
+ else
+ {
+ // parse all attributes to fill the second column
+ QString str2ndCol;
+ for ( uint i=0; i < m_xmlNode.toElement().attributes().length(); i++ )
+ {
+ if ( i > 0 )
+ str2ndCol += ", ";
+ str2ndCol += m_xmlNode.toElement().attributes().item(i).toAttr().name();
+ if ( KXMLEditorFactory::configuration()->treeview()->elemDisplMode() == KXETreeViewSettings::NamesAndValues )
+ str2ndCol += '=' + m_xmlNode.toElement().attributes().item(i).toAttr().value();
+ }
+ setText( 1, str2ndCol );
+ }
+ break;
+
+ case QDomNode::TextNode:
+ case QDomNode::CDATASectionNode:
+ case QDomNode::CommentNode:
+ {
+ // set name
+ QString strText = m_xmlNode.toCharacterData().data();
+ strText = strText.replace( QRegExp("\n"), " " ); // replace every newline by a space
+ strText = strText.replace( QRegExp("\t"), "" ); // removes every tab
+ strText = strText.replace( QRegExp("\r"), "" ); // removes every return
+ strText = strText.simplifyWhiteSpace();
+ if( strText.length() > 30 ) // reduce name length, if necessary
+ strText = strText.left(30) + "...";
+ setText( 0, strText );
+
+ break;
+ }
+
+ case QDomNode::ProcessingInstructionNode:
+
+ setText( 0, m_xmlNode.toProcessingInstruction().target() );
+ break;
+
+ default:
+ kdDebug() << "KXE_TreeViewItem::init: unknown node type (" << m_xmlNode.nodeType() << ")" << endl;
+ }
+}
+
+void KXE_TreeViewItem::initChilds()
+{
+ if ( ! KXMLEditorFactory::configuration()->treeview()->createItemsOnDemand() ||
+ ( ! m_bChildsCreated &&
+ ( ! parent() || ( parent() && parent()->isOpen() ) )
+ )
+ )
+ ensureChildItemsCreated();
+}
+
+bool KXE_TreeViewItem::toggleBookmark()
+{
+ m_bBookmarked = ! m_bBookmarked;
+
+ setPixmap(0, domTool_getIconForNodeType(m_xmlNode.nodeType(), m_bBookmarked));
+
+ return m_bBookmarked;
+}
+
+KXE_TreeViewItem * KXE_TreeViewItem::lastChild() const
+{
+ // take the first child
+ QListViewItem * pTmpItem = firstChild();
+ // if there are no childs return 0
+ if ( ! pTmpItem )
+ return 0;
+
+ QListViewItem * pTmpItem2;
+ while ( (pTmpItem2 = pTmpItem->nextSibling()) != 0 ) // traversing all childs
+ {
+ pTmpItem = pTmpItem2;
+ }
+
+ return static_cast <KXE_TreeViewItem*> (pTmpItem);
+}
+
+KXE_TreeViewItem * KXE_TreeViewItem::prevItem()
+{
+ if ( m_pPrevSibling ) // if there is a prev. sibling
+ { // return its last grand child (if there is any)
+ KXE_TreeViewItem * pPrevItem = m_pPrevSibling;
+ KXE_TreeViewItem * pTmpItem;
+ while ( (pTmpItem=pPrevItem->lastChild()) )
+ pPrevItem = pTmpItem;
+ return pPrevItem;
+ }
+ else // if there is no prev. sibling,
+ return static_cast <KXE_TreeViewItem*> (parent()); // return this' parent (if there is any)
+}
+
+KXE_TreeViewItem * KXE_TreeViewItem::nextItem()
+{
+ // checking for a child
+ QListViewItem * pTmp = firstChild();
+ if (pTmp)
+ return static_cast <KXE_TreeViewItem*> (pTmp);
+
+ // there is no child -> checking for the next sibling
+ pTmp = nextSibling();
+ if (pTmp)
+ return static_cast <KXE_TreeViewItem*> (pTmp);
+
+ // there is no next sibling -> checking for parents' next sibling(s)
+ QListViewItem * pParent = parent();
+ while (pParent)
+ {
+ pTmp = pParent->nextSibling();
+ if (pTmp)
+ return static_cast <KXE_TreeViewItem*> (pTmp);
+ pParent = pParent->parent();
+ }
+ return 0;
+}
+
+void KXE_TreeViewItem::expandSubTree( int iLevel )
+{
+ setOpen(true); // expand this item
+
+ if ( iLevel == 0 ) // return, if we are deep enough
+ return;
+
+ // expand childs (recursive)
+ int iNewLevel = ( iLevel == -1 ) ? -1 : iLevel-1;
+ KXE_TreeViewItem * pChild = static_cast <KXE_TreeViewItem*> ( firstChild() );
+ while ( pChild )
+ {
+ pChild->expandSubTree(iNewLevel);
+ pChild = static_cast <KXE_TreeViewItem*> ( pChild->nextSibling() );
+ }
+}
+
+void KXE_TreeViewItem::collapseSubTree( int iLevel )
+{
+ if ( iLevel < 0 )
+ {
+ kdDebug() << "KXE_TreeViewItem::collapseSubTree: wrong level given (iLevel=" << iLevel << ")" << endl;
+ return;
+ }
+
+ int iNewLevel;
+ if (iLevel==0) // collapse this item,
+ { // because we are deep enough
+ setOpen(false);
+ iNewLevel = 0;
+ }
+ else
+ iNewLevel = iLevel - 1;
+
+ // collapsing in childs (recursive)
+ KXE_TreeViewItem * pChild = static_cast <KXE_TreeViewItem*> ( firstChild() );
+ while ( pChild )
+ {
+ pChild->collapseSubTree( iNewLevel );
+ pChild = static_cast <KXE_TreeViewItem*> ( pChild->nextSibling() );
+ }
+}
+
+/** Test, if item in parameter is my direct or indirect child item */
+bool KXE_TreeViewItem::isMyChildren(const KXE_TreeViewItem *pTestItem)
+{
+ KXE_TreeViewItem* pChildXmlTreeItem = (KXE_TreeViewItem*) firstChild();
+ while(pChildXmlTreeItem)
+ { if(pChildXmlTreeItem == pTestItem)
+ return true;
+
+ // test child item childrens
+ if(pChildXmlTreeItem->isMyChildren(pTestItem))
+ return true;
+
+ pChildXmlTreeItem = (KXE_TreeViewItem*) pChildXmlTreeItem->nextSibling();
+ }
+ return false;
+}
+
+
+void KXE_TreeViewItem::ensureChildItemsCreated()
+{
+ if ( ! m_bChildsCreated )
+ {
+ QDomNode tmpNode = m_xmlNode.lastChild();
+
+ while ( ! tmpNode.isNull() )
+ {
+ new KXE_TreeViewItem( tmpNode, this );
+ tmpNode = tmpNode.previousSibling();
+ }
+
+ m_bChildsCreated = true;
+ }
+}
+
+
+void KXE_TreeViewItem::ensureGrandChildItemsCreated()
+{
+ if ( ! m_bGrandChildsCreated )
+ {
+ // ensure, that all child items of this item are created
+ if ( ! m_bChildsCreated )
+ ensureChildItemsCreated();
+
+ // Iterate over all children now and ensure their child items
+ // (this' grandchildrens) are created.
+ KXE_TreeViewItem * pChild = static_cast <KXE_TreeViewItem*> ( firstChild() );
+ while ( pChild )
+ {
+ pChild->ensureChildItemsCreated();
+ pChild = static_cast <KXE_TreeViewItem*> ( pChild->nextSibling() );
+ }
+
+ m_bGrandChildsCreated = true;
+ }
+}
+
+void KXE_TreeViewItem::startRename( int iCol )
+{
+ // If the given column is set to be in-place renameable in this item's view,
+ // we can start renaming in-place.
+ // Remember: This function is only reached for items representing XML elements.
+ if ( (reinterpret_cast<KListView*> ( listView() ))->isRenameable( iCol ) )
+ QListViewItem::startRename( iCol );
+}
diff --git a/part/kxe_treeviewitem.h b/part/kxe_treeviewitem.h
new file mode 100644
index 0000000..c24b99f
--- /dev/null
+++ b/part/kxe_treeviewitem.h
@@ -0,0 +1,125 @@
+/***************************************************************************
+ kxe_treeviewitem.h - description
+ -------------------
+ begin : Wed Nov 21 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXE_TREEVIEWITEM_H
+#define KXE_TREEVIEWITEM_H
+
+#include <qlistview.h>
+#include <qpixmap.h>
+#include <qdom.h>
+
+class KListView;
+
+/**
+ * This is a tree item, which represents one XML node (see @ref QDomNode and its childclasses).
+ * @short tree item
+ * @author The KXMLEditor Team
+ */
+class KXE_TreeViewItem : public QListViewItem
+{
+ public:
+
+ KXE_TreeViewItem( const QDomNode & xmlNode, KListView * pParent, QListViewItem* pAfter=NULL);
+ KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pParent );
+ KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pParent, QListViewItem * pAfter );
+ ~KXE_TreeViewItem();
+
+ /**
+ * (Re)sets the texts of the columns of this listitem
+ * depending on type of corresponding XML node and
+ * element display mode, which is stored in the configuration
+ * (@ref KXETreeViewSettings::elemDisplMode).
+ */
+ void setTexts();
+
+ /** Returns the corresponding XML node, e.g. the XML node represented by this tree item. */
+ QDomNode * xmlNode() { return & m_xmlNode; }
+
+ /** Returns true, if this tree item is bookmarked (false otherwise). */
+ bool isBookmarked() const { return m_bBookmarked; }
+
+ /** Changes this items bookmark status (see @ref KXE_TreeViewItem::m_bBookmarked) and returns the new one. */
+ bool toggleBookmark();
+
+ /** Returns this items last child or a null pointer if there are no childs at all. */
+ KXE_TreeViewItem * lastChild() const;
+
+ /** Sets this items previous sibling. */
+ void setPrevSibling( KXE_TreeViewItem * const pPrevSibling ) { m_pPrevSibling = pPrevSibling; }
+
+ /** Returns this items previous sibling. */
+ KXE_TreeViewItem * prevSibling() const { return m_pPrevSibling; }
+
+ /**
+ * Does the same like @ref QListViewItem::itemAbove but the parent items doesn't need to be open.
+ * Returns this items previous siblings last grand child, if there is one.
+ * Otherwise it returns this items previous sibling or,
+ * if there are no sibling above, it returns this items parent or
+ * a null pointer (if there is no parent).
+ */
+ KXE_TreeViewItem * prevItem();
+
+ /**
+ * Does the same like @ref QListViewItem::itemBelow but the parent items doesn't need to be open.
+ * Returns a pointer to the next item of this or a null pointer if this is the last item.
+ * This will be it's first child,
+ * if there are no childs, it will be the next sibling
+ * and if there are no siblings below, it will be this' parents next sibling ...
+ */
+ KXE_TreeViewItem * nextItem();
+
+ /** Expands this items child tree up to the given level or expands the entire child tree, if iLevel == -1. */
+ void expandSubTree( int iLevel = -1 );
+
+ /** Collapses this items child tree to the given level or collapses the entire child tree, if iLevel == 0. */
+ void collapseSubTree( int iLevel = 0 );
+
+ /** Test, if item in parameter is my direct or indirect child item */
+ bool isMyChildren(const KXE_TreeViewItem *);
+
+ /**
+ * If the child items aren't created (initialized) yet
+ * (i.e. if m_bChildsCreated is false), it is done now.
+ */
+ void ensureChildItemsCreated();
+ /**
+ * If the grandchilds (child items of this item's childs) aren't created (initialized)
+ * yet (i.e. if m_bGrandChildsCreated is false), it is done now.
+ */
+ void ensureGrandChildItemsCreated();
+
+ /**
+ * Starts in-place renaming, if the given column is set to be in-place
+ * renameable in the item's view
+ */
+ virtual void startRename( int iCol );
+
+protected:
+
+ QDomNode m_xmlNode;
+ KXE_TreeViewItem * m_pPrevSibling;
+ bool m_bBookmarked;
+ bool m_bChildsCreated;
+ bool m_bGrandChildsCreated;
+
+private:
+
+ void init();
+ void initChilds();
+};
+
+#endif
diff --git a/part/kxe_viewattributes.cpp b/part/kxe_viewattributes.cpp
new file mode 100644
index 0000000..ec6bffe
--- /dev/null
+++ b/part/kxe_viewattributes.cpp
@@ -0,0 +1,157 @@
+/***************************************************************************
+ kxe_viewattributes.cpp - description
+ -------------------
+ begin : Thu Nov 22 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxe_viewattributes.h"
+
+#include "kxeattributedialog.h"
+
+#include <kmessagebox.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+KXE_ViewAttributes::KXE_ViewAttributes( QWidget * pParent, const char * pszName )
+ : QTable( 0, 3, pParent, pszName )
+{
+ horizontalHeader()->setLabel( 0, i18n("Namespace") );
+ horizontalHeader()->setLabel( 1, i18n("Name") );
+ horizontalHeader()->setLabel( 2, i18n("Value") );
+
+ setColumnReadOnly( 0, true );
+ setColumnReadOnly( 1, true );
+ setColumnReadOnly( 2, true );
+
+ connect( this, SIGNAL(valueChanged(int,int)), this, SLOT(slotItemRenamedInplace(int,int)) );
+}
+
+QDomAttr KXE_ViewAttributes::getSelectedAttribute() const
+{
+ if ( currentRow() == -1 )
+ return QDomAttr();
+
+ if ( m_domElement.attributes().item(currentRow()).isAttr() )
+ {
+ return m_domElement.attributes().item(currentRow()).toAttr();
+ }
+ else
+ return QDomAttr();
+}
+
+void KXE_ViewAttributes::setReadWrite( bool fReadWrite )
+{
+ setColumnReadOnly( 1, ! fReadWrite );
+ setColumnReadOnly( 2, ! fReadWrite );
+
+ if ( fReadWrite )
+ connect( this, SIGNAL(contextMenuRequested(int,int,const QPoint&)), this, SLOT(slotContextMenuRequested(int,int,const QPoint&)) );
+ else
+ disconnect( this, SIGNAL(contextMenuRequested(int,int,const QPoint&)), this, SLOT(slotContextMenuRequested(int,int,const QPoint&)) );
+}
+
+void KXE_ViewAttributes::slotContextMenuRequested( int nRow, int nCol, const QPoint & pos )
+{
+ nCol = nCol;
+ QString szMenuName = ( nRow == -1 ) ? "popupXmlAttributes" : "popupXmlAttribute";
+ emit sigContextMenuRequested( szMenuName, pos );
+}
+
+void KXE_ViewAttributes::slotChange( const QDomElement & element )
+{
+ m_domElement = element;
+
+ uint iLength = m_domElement.attributes().length();
+ setNumRows( iLength );
+
+ if ( iLength > 0 )
+ {
+ for ( uint iRow = 0; iRow < iLength; iRow++ )
+ {
+ QDomNode node = m_domElement.attributes().item(iRow);
+ if ( node.isAttr() )
+ {
+ setText( iRow, 0, node.toAttr().namespaceURI() );
+ setText( iRow, 1, node.toAttr().name() );
+ setText( iRow, 2, node.toAttr().value() );
+ adjustRow( iRow );
+ }
+ else
+ kdError() << "KXE_ViewAttributes::slotChange: node is not an attribute (but should be)" << endl;
+ }
+
+ adjustColumn(0);
+ adjustColumn(1);
+ adjustColumn(2);
+ }
+}
+
+void KXE_ViewAttributes::slotItemRenamedInplace( int nRow, int nCol )
+{
+ if ( nCol < 1) // only attributes names and values are changeable
+ {
+ kdError() << "KXMLEditor " << k_funcinfo << " column " << nCol << " should be unchangeable" << endl;
+ return;
+ }
+
+ QDomNode node = m_domElement.attributes().item(nRow);
+ if ( node.isAttr() )
+ { if (nCol == 1)
+ {
+ // check if name is OK
+ QString strMessage = KXEAttributeDialog::checkName(text(nRow,nCol));
+ if(strMessage.length() > 0)
+ {
+ // restore old name
+ setText( nRow, 1, node.toAttr().name() ); // set old name
+ KMessageBox::sorry(this, strMessage);
+ return;
+ }
+
+ // check, if new name not exists in attributes list
+ if(m_domElement.attributes().contains(text(nRow,nCol)) == false)
+ {
+ if ( node.toAttr().name() != text(nRow,nCol) ) // only if the name really was changed
+ {
+ emit sigAttributeNameChangedInplace(node.toAttr(), text(nRow,nCol) );
+ }
+ }
+ else
+ {
+ KMessageBox::sorry(this, i18n("Attribute name already exists !"));
+ setText( nRow, 1, node.toAttr().name() ); // set old name
+ return;
+ }
+ }
+ else
+ {
+ if ( node.toAttr().value() != text(nRow,nCol) ) // only if the value really was changed
+ {
+ // check if value is OK
+ QString strMessage = KXEAttributeDialog::checkValue(text(nRow,nCol));
+ if(strMessage.length() > 0)
+ {
+ // restore old value
+ setText( nRow, 2, node.toAttr().value() ); // set old value
+ KMessageBox::sorry(this, strMessage);
+ return;
+ }
+
+ emit sigAttributeValueChangedInplace( node.toAttr(), text(nRow, nCol) );
+ }
+ }
+ }
+ else
+ kdError() << "KXMLEditor " << k_funcinfo << " node is not an attribute (but should be)" << endl;
+}
diff --git a/part/kxe_viewattributes.h b/part/kxe_viewattributes.h
new file mode 100644
index 0000000..c314c56
--- /dev/null
+++ b/part/kxe_viewattributes.h
@@ -0,0 +1,71 @@
+/***************************************************************************
+ kxe_viewattributes.h - description
+ -------------------
+ begin : Thu Nov 22 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXE_VIEWATTRIBUTES_H
+#define KXE_VIEWATTRIBUTES_H
+
+#include <qtable.h>
+#include <qdom.h>
+
+/**
+ * @author The KXMLEditor Team
+ */
+class KXE_ViewAttributes : public QTable
+{
+ Q_OBJECT
+
+ public:
+
+ KXE_ViewAttributes( QWidget * pParent = 0, const char * pszName = 0 );
+
+ /** Returns a pointer to the currently selected attribute or a null pointer. */
+ QDomAttr getSelectedAttribute() const;
+
+ /** Changes the behaviour of this view to readonly or readwrite. */
+ void setReadWrite( bool fReadWrite );
+
+ public slots:
+
+ /** Changes/Rebuilds the whole table according to the given element's attributes. */
+ void slotChange( const QDomElement & element );
+
+ protected:
+
+ /** the currently selected node */
+ QDomElement m_domElement;
+
+ protected slots:
+
+ /** Called, when a context menu was requested (connected to @ref QTable::contextMenuRequested). */
+ void slotContextMenuRequested( int nRow, int nCol, const QPoint & pos );
+
+ /** Called, when an item was changed via inplace editing. */
+ void slotItemRenamedInplace( int nRow, int nCol );
+
+ signals:
+
+ /** Emitted, when a context menu is requested */
+ void sigContextMenuRequested( const QString & szMenuName, const QPoint & pos );
+
+ /** Emitted, when an attributes value was renamed via inplace editing. */
+ void sigAttributeNameChangedInplace( const QDomAttr &, const QString );
+
+ /** Emitted, when an attributes value was renamed via inplace editing. */
+ void sigAttributeValueChangedInplace( const QDomAttr &, const QString );
+};
+
+#endif
diff --git a/part/kxe_viewelement.cpp b/part/kxe_viewelement.cpp
new file mode 100644
index 0000000..2bae53c
--- /dev/null
+++ b/part/kxe_viewelement.cpp
@@ -0,0 +1,126 @@
+/***************************************************************************
+ kxe_viewelement.cpp - description
+ -------------------
+ begin : Mon Oct 15 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxe_viewelement.h"
+#include "kxe_viewattributes.h"
+#include "kxesyntaxhighlighter.h"
+
+#include "kxmleditorfactory.h"
+#include "kxeconfiguration.h"
+#include "kxetextviewsettings.h"
+
+#include <kconfig.h>
+#include <ktextedit.h>
+
+#include <qdom.h>
+#include <qcolor.h>
+#include <qpalette.h>
+
+
+#include "qdom_add.h"
+
+#define CONFIG_SPLITTER_SIZES "View Element splitter sizes"
+
+KXE_ViewElement::KXE_ViewElement( QWidget * pParent, KConfig *pConfig, const char * pszName )
+ : QSplitter( Qt::Vertical, pParent, pszName )
+{
+ setOpaqueResize(true);
+ m_pConfig = pConfig;
+ m_pViewAttributes = new KXE_ViewAttributes( this, "table of element attributes");
+ connect( m_pViewAttributes, SIGNAL(sigContextMenuRequested(const QString&,const QPoint&)), this, SIGNAL(sigContextMenuRequested(const QString&,const QPoint&)) );
+
+ connect( m_pViewAttributes, SIGNAL(sigAttributeNameChangedInplace(const QDomAttr&, const QString)), this, SIGNAL(sigAttributeNameChangedInplace(const QDomAttr&, const QString)) );
+ connect( m_pViewAttributes, SIGNAL(sigAttributeValueChangedInplace(const QDomAttr&, const QString)), this, SIGNAL(sigAttributeValueChangedInplace(const QDomAttr&, const QString)) );
+
+ m_pViewPlainXML = new KTextEdit( this, "plain XML" );
+ m_pViewPlainXML->setReadOnly(true);
+ m_pViewPlainXML->setTextFormat(KTextEdit::PlainText);
+ m_pViewPlainXML->setPaletteBackgroundColor(pParent->palette().active().base()); // Owerwrite read-only background color
+ m_pViewPlainXML->setWordWrap( QTextEdit::NoWrap );
+ m_pSyntaxHighlighter = new KXESyntaxHighlighter(m_pViewPlainXML);
+
+ // configuring splitter sizes
+ if (m_pConfig)
+ {
+ QValueList<int> list = m_pConfig->readIntListEntry(CONFIG_SPLITTER_SIZES);
+ if (!list.isEmpty())
+ setSizes(list);
+ }
+
+ // Apply current configuration
+ slotTextViewSettingsChanged();
+ // and make sure to be informed about its changes.
+ connect( KXMLEditorFactory::configuration()->textview(), SIGNAL(sigChanged()), this, SLOT(slotTextViewSettingsChanged()) );
+}
+
+KXE_ViewElement::~KXE_ViewElement()
+{
+ // saving splitter sizes
+ if (m_pConfig)
+ m_pConfig->writeEntry( CONFIG_SPLITTER_SIZES, sizes() );
+
+ delete m_pSyntaxHighlighter;
+}
+
+QDomAttr KXE_ViewElement::getSelectedAttribute() const
+{
+ return m_pViewAttributes->getSelectedAttribute();
+}
+
+void KXE_ViewElement::setReadWrite( bool fReadWrite )
+{
+ m_pViewAttributes->setReadWrite(fReadWrite);
+}
+
+void KXE_ViewElement::slotChange( const QDomElement & element )
+{
+ // change attribute view
+ m_pViewAttributes->slotChange(element);
+
+ int iIndent = KXMLEditorFactory::configuration()->textview()->indentSteps();
+
+ // change plain XML view
+ m_pViewPlainXML->setText( domTool_save(element, iIndent) );
+}
+
+//////////////////////////////////////////////////////////////
+// configuration slots
+//////////////////////////////////////////////////////////////
+
+void KXE_ViewElement::slotTextViewSettingsChanged()
+{
+ m_pSyntaxHighlighter->setColorDefaultText( KXMLEditorFactory::configuration()->textview()->colorDfltText() );
+ m_pSyntaxHighlighter->setColorElementNames( KXMLEditorFactory::configuration()->textview()->colorElemNames() );
+ m_pSyntaxHighlighter->setColorAttributeNames( KXMLEditorFactory::configuration()->textview()->colorAttrNames() );
+ m_pSyntaxHighlighter->setColorAttributeValues( KXMLEditorFactory::configuration()->textview()->colorAttrValues() );
+ m_pSyntaxHighlighter->setColorXmlSyntaxChars( KXMLEditorFactory::configuration()->textview()->colorSyntaxChars() );
+ m_pSyntaxHighlighter->setColorComments( KXMLEditorFactory::configuration()->textview()->colorComments() );
+ m_pSyntaxHighlighter->setColorSyntaxError( KXMLEditorFactory::configuration()->textview()->colorErrors() );
+
+ if(KXMLEditorFactory::configuration()->textview()->isWrapOn())
+ {
+ m_pViewPlainXML->setHScrollBarMode(QScrollView::AlwaysOff);
+ m_pViewPlainXML->setWordWrap(QTextEdit::WidgetWidth);
+ }
+ else
+ {
+ m_pViewPlainXML->setHScrollBarMode(QScrollView::Auto);
+ m_pViewPlainXML->setWordWrap(QTextEdit::NoWrap);
+ }
+
+ m_pSyntaxHighlighter->rehighlight();
+}
diff --git a/part/kxe_viewelement.h b/part/kxe_viewelement.h
new file mode 100644
index 0000000..bac7669
--- /dev/null
+++ b/part/kxe_viewelement.h
@@ -0,0 +1,94 @@
+/***************************************************************************
+ kxe_viewelement.h - description
+ -------------------
+ begin : Mon Oct 15 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXE_VIEWELEMENT_H
+#define KXE_VIEWELEMENT_H
+
+#include <qsplitter.h>
+
+#include <qdom.h>
+
+// forward declarations
+class KXE_ViewAttributes;
+class KTextEdit;
+class KConfig;
+class KXESyntaxHighlighter;
+
+
+/**
+ * This widget shows a table of XML elements attributes
+ * and plain XML text of this element and its children.
+ *
+ * @short Widget for XML elements.
+ */
+class KXE_ViewElement : public QSplitter
+{
+ Q_OBJECT
+
+ public:
+
+ KXE_ViewElement( QWidget * pParent, KConfig *pConfig, const char * pszName = 0 );
+ ~KXE_ViewElement();
+
+ /** Returns a pointer to the currently selected attribute or a null pointer. */
+ QDomAttr getSelectedAttribute() const;
+
+ /** Changes the behaviour of this view to readonly or readwrite. */
+ void setReadWrite( bool fReadWrite );
+
+ public slots:
+
+ /** Changes/Rebuilds the whole widget according to the given element. */
+ void slotChange( const QDomElement & );
+
+ /**
+ * Changes syntax highlighting colors.
+ */
+ void slotTextViewSettingsChanged();
+
+ protected:
+
+ /** table widget to display XML attributes */
+ KXE_ViewAttributes * m_pViewAttributes;
+ /** edit widget for plain XML */
+ KTextEdit * m_pViewPlainXML;
+
+ /** configuration used to store splitter sizes */
+ KConfig *m_pConfig;
+
+ /** Syntax highlighter for m_pViewPlainXML */
+ KXESyntaxHighlighter *m_pSyntaxHighlighter;
+
+ signals:
+
+ /** Emitted, when a context menu is requested (see @ref KXE_ViewAttributes::sigContextMenuRequested) */
+ void sigContextMenuRequested( const QString & szMenuName, const QPoint & pos );
+
+ /**
+ * Emitted, when an attributes name was renamed via inplace editing
+ * (see @ref KXE_ViewAttributes::sigAttributeChangedInplace).
+ */
+ void sigAttributeNameChangedInplace( const QDomAttr &, const QString );
+
+ /**
+ * Emitted, when an attributes value was renamed via inplace editing
+ * (see @ref KXE_ViewAttributes::sigAttributeChangedInplace).
+ */
+ void sigAttributeValueChangedInplace( const QDomAttr &, const QString );
+};
+
+#endif
diff --git a/part/kxearchiveextssettings.cpp b/part/kxearchiveextssettings.cpp
new file mode 100644
index 0000000..ec800c6
--- /dev/null
+++ b/part/kxearchiveextssettings.cpp
@@ -0,0 +1,153 @@
+/***************************************************************************
+ kxearchiveextssettings.cpp
+ --------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxearchiveextssettings.h"
+#include "kxearchiveextssettingspage.h"
+
+#include <klocale.h>
+#include <kconfig.h>
+
+#include <qframe.h>
+#include <qlistbox.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+
+#define CONF_ENTRY_NAME_EXTS_TARGZ "Extensions"
+
+KXEArchiveExtsSettings::KXEArchiveExtsSettings( QObject * pParent, const char * pszName )
+ : KXESettings( "TarGz Extensions", pParent, pszName ),
+ m_pDialogPage(0)
+{
+}
+
+
+void KXEArchiveExtsSettings::write( KConfig * pConfig ) const
+{
+ pConfig->writeEntry( CONF_ENTRY_NAME_EXTS_TARGZ, m_lstExtensions );
+}
+
+
+void KXEArchiveExtsSettings::read( const KConfig * pConfig )
+{
+ m_lstExtensions = pConfig->readListEntry( CONF_ENTRY_NAME_EXTS_TARGZ );
+}
+
+QString KXEArchiveExtsSettings::dialogPageName() const
+{
+ return i18n( "Archive Extensions" );
+}
+
+QString KXEArchiveExtsSettings::dialogPageHeader() const
+{
+ return i18n( "Specify Archive Extensions" );
+}
+
+QString KXEArchiveExtsSettings::dialogPageIcon() const
+{
+ return "filetypes";
+}
+
+QWidget * KXEArchiveExtsSettings::dialogPage( QFrame * pParent )
+{
+ if ( ! m_pDialogPage )
+ {
+ // create the page if necessary
+ m_pDialogPage = new KXEArchiveExtsSettingsPage( pParent, "archive extensions config.dialog page" );
+
+ // and fill its widgets with the corresponding values
+ updatePage();
+
+ connect( m_pDialogPage->m_pExtensions, SIGNAL(highlighted(const QString&)), this, SLOT(slotPageEditExtension(const QString&)) );
+ connect( m_pDialogPage->m_pBtnNew, SIGNAL(clicked()), this, SLOT(slotPageAddExtension()) );
+ connect( m_pDialogPage->m_pBtnDelete, SIGNAL(clicked()), this, SLOT(slotPageDeleteExtension()) );
+ connect( m_pDialogPage->m_pExtension, SIGNAL(textChanged(const QString&)), this, SLOT(slotPageUpdateExtension(const QString&)) );
+
+ connect( m_pDialogPage->m_pBtnNew, SIGNAL(clicked()), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pBtnDelete, SIGNAL(clicked()), this, SIGNAL(sigDialogPageChanged()) );
+ }
+
+ return m_pDialogPage;
+}
+
+
+void KXEArchiveExtsSettings::setFromPage()
+{
+ if ( m_pDialogPage )
+ {
+ m_lstExtensions.clear();
+ QListBoxItem * pTmpItem = m_pDialogPage->m_pExtensions->firstItem();
+ while ( pTmpItem )
+ {
+ m_lstExtensions << pTmpItem->text();
+ pTmpItem = pTmpItem->next();
+ }
+ }
+}
+
+void KXEArchiveExtsSettings::updatePage() const
+{
+ if ( m_pDialogPage )
+ {
+ m_pDialogPage->m_pExtensions->clear();
+ m_pDialogPage->m_pExtensions->insertStringList( m_lstExtensions );
+ m_pDialogPage->m_pExtension->setDisabled( true );
+ }
+}
+
+
+//////////////////////////////////////////////////////////////////////
+// additional slots for the corresponding configuration dialog page //
+//////////////////////////////////////////////////////////////////////
+
+void KXEArchiveExtsSettings::slotPageEditExtension( const QString & strText )
+{
+ m_pDialogPage->m_pExtension->setText( strText );
+ m_pDialogPage->m_pExtension->setEnabled( true );
+ m_pDialogPage->m_pExtension->setFocus();
+}
+
+void KXEArchiveExtsSettings::slotPageAddExtension()
+{
+ m_pDialogPage->m_pExtensions->insertItem( "zip", 0 );
+ m_pDialogPage->m_pExtensions->setCurrentItem( 0 );
+ m_pDialogPage->m_pExtension->selectAll();
+ m_pDialogPage->m_pExtension->setFocus();
+ m_pDialogPage->m_pExtension->setEnabled( true );
+}
+
+void KXEArchiveExtsSettings::slotPageDeleteExtension()
+{
+ m_pDialogPage->m_pExtensions->removeItem( m_pDialogPage->m_pExtensions->currentItem() );
+
+ if ( m_pDialogPage->m_pExtensions->count() == 0 )
+ {
+ m_pDialogPage->m_pExtension->clear();
+ m_pDialogPage->m_pExtension->setDisabled( true );
+ }
+ else
+ m_pDialogPage->m_pExtensions->setSelected( m_pDialogPage->m_pExtensions->currentItem(), true );
+}
+
+void KXEArchiveExtsSettings::slotPageUpdateExtension( const QString & strText )
+{
+ if ( ( m_pDialogPage->m_pExtensions->count() > 0 ) &&
+ ( m_pDialogPage->m_pExtensions->currentText() != m_pDialogPage->m_pExtension->text() ) )
+ {
+ m_pDialogPage->m_pExtensions->changeItem( strText, m_pDialogPage->m_pExtensions->currentItem() );
+ emit sigDialogPageChanged();
+ }
+}
diff --git a/part/kxearchiveextssettings.h b/part/kxearchiveextssettings.h
new file mode 100644
index 0000000..ad2f212
--- /dev/null
+++ b/part/kxearchiveextssettings.h
@@ -0,0 +1,113 @@
+/***************************************************************************
+ kxearchiveextssettings.h
+ ------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXEARCHIVEEXTSSETTINGS_H
+#define KXEARCHIVEEXTSSETTINGS_H
+
+#include "kxesettings.h"
+
+#include <qstringlist.h>
+
+class KXEArchiveExtsSettingsPage;
+
+/**
+ * This class represents the group of configuration settings for the
+ * archive extensions.
+ *
+ * @author Olaf Hartig
+ */
+class KXEArchiveExtsSettings : public KXESettings
+{
+ Q_OBJECT
+
+ public:
+
+ KXEArchiveExtsSettings( QObject * pParent = 0, const char * pszName = 0 );
+
+ // The following function(s) can be used to access this object's settings.
+ const QStringList & extensions() const { return m_lstExtensions; }
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageName() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageHeader() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageIcon() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QWidget * dialogPage( QFrame * pParent );
+
+ protected:
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void write( KConfig * ) const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void read( const KConfig * );
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void setFromPage();
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void updatePage() const;
+
+ // the settings itself
+ QStringList m_lstExtensions;
+
+ /**
+ * the corresponding configuration dialog page
+ * It is created on demand by @ref dialogPage.
+ */
+ KXEArchiveExtsSettingsPage * m_pDialogPage;
+
+ protected slots:
+
+ // The following slots contain additional functionality
+ // for the corresponding configuration dialog page.
+
+ /**
+ * Copies the selected item's extension to the editline.
+ */
+ void slotPageEditExtension( const QString & );
+ /**
+ * Creates a new (empty) item/ extension in the listbox and selects it.
+ */
+ void slotPageAddExtension();
+ /**
+ * Removes the currently selected item / extension from the listbox.
+ */
+ void slotPageDeleteExtension();
+ /**
+ * Copies the lineedit's current text to the currently selected item.
+ */
+ void slotPageUpdateExtension( const QString & );
+
+};
+
+#endif
diff --git a/part/kxearchiveextssettingspage.ui b/part/kxearchiveextssettingspage.ui
new file mode 100644
index 0000000..0936850
--- /dev/null
+++ b/part/kxearchiveextssettingspage.ui
@@ -0,0 +1,175 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEArchiveExtsSettingsPage</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KXEArchiveExtsSettingsPage</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>293</width>
+ <height>187</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Archive Exts Settings Page</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_pLblExtensions</cstring>
+ </property>
+ <property name="text">
+ <string>Extensions of archive &amp;files:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pExtensions</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Extensions of archive files&lt;/b&gt;
+&lt;br&gt;
+This list contains the known extensions for archive files.&lt;br&gt;
+You can choose one to edit or remove it with the dialog widgets below.</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="1" column="0">
+ <property name="name">
+ <cstring>m_pExtensions</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>80</height>
+ </size>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Extensions of archive files&lt;/b&gt;
+&lt;br&gt;
+This list contains the known extensions for archive files.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_pLblExtension</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Extension:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pExtension</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Extension&lt;/b&gt;
+&lt;br&gt;
+Change the selected extension here.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>m_pExtension</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Extension&lt;/b&gt;
+&lt;br&gt;
+Change the selected extension here.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="0">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>71</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New</string>
+ </property>
+ <property name="accel">
+ <string>Alt+N</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;New&lt;/b&gt;
+&lt;br&gt;
+You can create a new item for another known extension in the list above.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnDelete</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ <property name="accel">
+ <string>Alt+D</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Delete&lt;/b&gt;
+&lt;br&gt;
+You can delete the selected extension from the list above.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+</widget>
+<slots>
+ <slot>slotUpdateExtension( const QString &amp; )</slot>
+ <slot>slotDeleteExtension()</slot>
+ <slot>slotAddExtension()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxeattachdialogbase.ui b/part/kxeattachdialogbase.ui
new file mode 100644
index 0000000..447ac9f
--- /dev/null
+++ b/part/kxeattachdialogbase.ui
@@ -0,0 +1,144 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEAttachDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXEAttachDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>319</width>
+ <height>105</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Attach to XML</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>Label</cstring>
+ </property>
+ <property name="text">
+ <string>attachment URI:</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester">
+ <property name="name">
+ <cstring>attachURI</cstring>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonHelp</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Help</string>
+ </property>
+ <property name="accel">
+ <string>F1</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>buttonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEAttachDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>buttonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEAttachDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>attachURI</tabstop>
+ <tabstop>buttonOk</tabstop>
+ <tabstop>buttonCancel</tabstop>
+ <tabstop>buttonHelp</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/part/kxeattributedialog.cpp b/part/kxeattributedialog.cpp
new file mode 100644
index 0000000..d64b796
--- /dev/null
+++ b/part/kxeattributedialog.cpp
@@ -0,0 +1,179 @@
+/***************************************************************************
+ kxeattributedialog.cpp - description
+ ----------------------
+ begin : Fre Jul 12 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxeattributedialog.h"
+
+#include <klineedit.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+#include <qpushbutton.h>
+#include <qlabel.h>
+
+KXEAttributeDialog::KXEAttributeDialog( QWidget * pParent, const char * pszName, bool fModal, WFlags fl )
+ : KXEAttributeDialogBase( pParent, pszName, fModal, fl )
+{
+ connect( m_pEditNamespace, SIGNAL(textChanged(const QString &)), this, SLOT(slotNamespaceChanged(const QString &)) );
+ connect( m_pEditQName, SIGNAL(textChanged(const QString &)), this, SLOT(slotNameChanged(const QString &)) );
+ connect( m_pEditValue, SIGNAL(textChanged(const QString &)), this, SLOT(slotValueChanged(const QString &)) );
+}
+
+void KXEAttributeDialog::clearDialog()
+{
+ m_pEditNamespace->clear();
+ m_pEditQName->clear();
+ m_pEditValue->clear();
+}
+
+int KXEAttributeDialog::exec()
+{
+ clearDialog();
+
+ m_pBtnOK->setEnabled(false);
+
+ m_pEditQName->setFocus();
+ m_pBtnOK->setDefault(true);
+
+ int iReturn = KXEAttributeDialogBase::exec();
+ if ( iReturn == Accepted )
+ {
+ m_strNamespace = m_pEditNamespace->text();
+ m_strQName = m_pEditQName->text();
+ m_strValue = m_pEditValue->text();
+ }
+
+ return iReturn;
+}
+
+void KXEAttributeDialog::slotNameChanged(const QString & strNewName)
+{
+ QString strMessage = checkName(strNewName);
+ if(strMessage.isEmpty())
+ {
+ strMessage = checkNamespace(m_pEditNamespace->text());
+ if(strMessage.isEmpty())
+ strMessage = checkValue(m_pEditValue->text());
+ }
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( strNewName.isEmpty() || (strMessage.length() > 0) )
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+void KXEAttributeDialog::slotValueChanged(const QString & strNewValue)
+{
+ QString strMessage = checkName(m_pEditQName->text());
+ if(strMessage.isEmpty())
+ {
+ strMessage = checkNamespace(m_pEditNamespace->text());
+ if(strMessage.isEmpty())
+ strMessage = checkValue(strNewValue);
+ }
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( m_pEditQName->text().isEmpty() || (strMessage.length() > 0) )
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+void KXEAttributeDialog::slotNamespaceChanged(const QString & strNewNamespace)
+{
+ QString strMessage = checkName(m_pEditQName->text());
+ if(strMessage.isEmpty())
+ {
+ strMessage = checkNamespace(strNewNamespace);
+ if(strMessage.isEmpty())
+ strMessage = checkValue(m_pEditValue->text());
+ }
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( m_pEditQName->text().isEmpty() || (strMessage.length() > 0) )
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+// Check, if XML attribute name is OK
+QString KXEAttributeDialog::checkNamespace(const QString strAtttributeName)
+{
+ if(strAtttributeName.length() == 0)
+ return "";
+
+ // test for space
+ if(strAtttributeName.find(' ') >= 0)
+ return i18n("Atttribute namespace cannot contain space !");
+
+ // Forbidden characters
+ QString strForbiddenChars("<>\"'");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strAtttributeName.find(ch) >= 0)
+ return i18n("Atttribute namespace cannot contain character: %1 !").arg(ch);
+ }
+
+ return "";
+}
+
+// Check, if XML attribute name is OK
+QString KXEAttributeDialog::checkName(const QString strAtttributeName)
+{
+ if(strAtttributeName.length() == 0)
+ return "";
+
+ // test for space
+ if(strAtttributeName.find(' ') >= 0)
+ return i18n("Atttribute name cannot contain space !");
+
+ // Forbidden characters
+ QString strForbiddenChars("&@#$%^()%+?=:<>;\"'*");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strAtttributeName.find(ch) >= 0)
+ return i18n("Atttribute name cannot contain character: %1 !").arg(ch);
+ }
+
+ return "";
+}
+
+// Check, if XML attribute value is OK
+QString KXEAttributeDialog::checkValue(const QString strData)
+{
+ if(strData.length() == 0)
+ return "";
+
+ // Forbidden characters
+ QString strForbiddenChars("<>\"");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strData.find(ch) >= 0)
+ return i18n("Attribute value cannot contain character: %1 !").arg(ch);
+ }
+
+ return "";
+}
diff --git a/part/kxeattributedialog.h b/part/kxeattributedialog.h
new file mode 100644
index 0000000..e2019b9
--- /dev/null
+++ b/part/kxeattributedialog.h
@@ -0,0 +1,82 @@
+/***************************************************************************
+ kxeattributedialog.h - description
+ --------------------
+ begin : Fre Jul 12 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXEATTRIBUTEDIALOG_H
+#define KXEATTRIBUTEDIALOG_H
+
+#include "kxeattributedialogbase.h"
+
+#include <qdom.h>
+
+class KXEAttributeDialog : public KXEAttributeDialogBase
+{
+ Q_OBJECT
+
+ public:
+ KXEAttributeDialog( QWidget * pParent = 0, const char * pszName = 0, bool fModal = true, WFlags fl = 0 );
+
+ const QString attributeNamespace() const { return m_strNamespace; }
+ const QString QName() const { return m_strQName; }
+ const QString Value() const { return m_strValue; }
+
+ /**
+ * To be used for adding an attribute to new XML element.
+ *
+ * @return see @ref QDialog::exec
+ */
+ int exec( );
+
+ /**
+ * Clears the dialogs widgets.
+ */
+ void clearDialog();
+
+ // Check, if XML attribute name is OK
+ static QString checkName(const QString);
+
+ // Check, if XML attribute value is OK
+ static QString checkValue(const QString);
+
+ // Check, if XML attribute namespace is OK
+ static QString checkNamespace(const QString);
+
+ protected slots:
+ /**
+ * Called, when user change attribute name.
+ * Disables the OK button, if user input is wrong or incomplete.
+ */
+ void slotNameChanged(const QString &);
+
+ /**
+ * Called, when user change attribute value.
+ * Disables the OK button, if user input is wrong or incomplete.
+ */
+ void slotValueChanged(const QString &);
+
+ /**
+ * Called, when user change attribute namespace.
+ * Disables the OK button, if user input is wrong or incomplete.
+ */
+ void slotNamespaceChanged(const QString &);
+
+ protected:
+ QString m_strNamespace;
+ QString m_strQName;
+ QString m_strValue;
+};
+
+#endif
diff --git a/part/kxeattributedialogbase.ui b/part/kxeattributedialogbase.ui
new file mode 100644
index 0000000..d03b8eb
--- /dev/null
+++ b/part/kxeattributedialogbase.ui
@@ -0,0 +1,263 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEAttributeDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXEAttributeDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>339</width>
+ <height>262</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>XML Attribute</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>m_pEditNamespace</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Namespace URI&lt;/b&gt;
+&lt;br/&gt;
+Enter the namespace URI for this attribute here.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="5" column="0">
+ <property name="name">
+ <cstring>m_pEditValue</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Value&lt;/b&gt;
+&lt;br/&gt;
+Enter the attribute's value here.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>m_pEditQName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Qualified Name&lt;/b&gt;
+&lt;br/&gt;
+Enter a qualified name for the attribute here.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="7" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnOK</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string>Alt+C</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>m_pLblValue</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Value:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditValue</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Value&lt;/b&gt;
+&lt;br/&gt;
+Enter the attribute's value here.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_pLblQName</cstring>
+ </property>
+ <property name="text">
+ <string>Qualified &amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditQName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Qualified Name&lt;/b&gt;
+&lt;br/&gt;
+Enter a qualified name for the attribute here.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_pLblNamespace</cstring>
+ </property>
+ <property name="text">
+ <string>Namespace &amp;URI:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditNamespace</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Namespace URI&lt;/b&gt;
+&lt;br/&gt;
+Enter the namespace URI for this attribute here.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>m_pTextLabelMessage</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pBtnOK</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEAttributeDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_pBtnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEAttributeDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pEditQName</tabstop>
+ <tabstop>m_pEditValue</tabstop>
+ <tabstop>m_pBtnOK</tabstop>
+ <tabstop>m_pBtnCancel</tabstop>
+ <tabstop>m_pEditNamespace</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxechardatadialog.cpp b/part/kxechardatadialog.cpp
new file mode 100644
index 0000000..fb74ad4
--- /dev/null
+++ b/part/kxechardatadialog.cpp
@@ -0,0 +1,119 @@
+/***************************************************************************
+ kxechardatadialog.cpp - description
+ ---------------------
+ begin : Don Apr 25 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxechardatadialog.h"
+
+#include <qlabel.h>
+#include <qcombobox.h>
+#include <qpushbutton.h>
+#include <qtextedit.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+
+KXECharDataDialog::KXECharDataDialog( QWidget * pParent, const char * pszName, bool fModal, WFlags fl )
+ : KXECharDataDialogBase( pParent, pszName, fModal, fl )
+{
+ connect( m_pEditData, SIGNAL(textChanged()), this, SLOT(slotDataChanged()) );
+}
+
+void KXECharDataDialog::clearDialog()
+{
+ m_pEditData->clear();
+}
+
+int KXECharDataDialog::exec( bool bEditExisting )
+{
+ if(bEditExisting)
+ {
+ m_pComboInsert->hide();
+ m_pComboInsert->setDisabled(true);
+ m_pLblInsert->hide();
+ m_pLblInsert->setDisabled(true);
+
+// m_pComboType->setDisabled(true);
+
+ m_pEditData->setText( m_strContents );
+// m_pComboType->setCurrentItem(m_eCharDataKind);
+ }
+ else
+ {
+// m_pComboType->setEnabled(true);
+ clearDialog();
+ }
+
+ int iReturn = exec();
+ if ( iReturn == Accepted )
+ {
+ m_strContents = m_pEditData->text();
+ m_bAtTop = ( m_pComboInsert->currentItem() == 0 );
+// m_eCharDataKind = (CharDataKind) m_pComboType->currentItem();
+ }
+
+ return iReturn;
+}
+
+int KXECharDataDialog::exec()
+{
+ if ( m_pEditData->text().isEmpty() )
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+
+ m_pEditData->setFocus();
+ m_pBtnOK->setDefault(true);
+
+ return KXECharDataDialogBase::exec();
+}
+
+void KXECharDataDialog::slotDataChanged()
+{
+ QString strMessage = checkContents(m_pEditData->text());
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( m_pEditData->text().isEmpty() || (strMessage.length() > 0))
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+// Check, if XML chardata contents is OK
+QString KXECharDataDialog::checkContents(const QString strData)
+{
+ if(strData.length() == 0)
+ return "";
+
+ // Forbidden characters
+ /*QString strForbiddenChars("<>");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strData.find(ch) >= 0)
+ return i18n("Contents cannot contain character: %1 !").arg(ch);
+ }
+
+ L.V. Removed this check, bacause QDomCharacterData.setData() escapec special
+ charactesr and data() unescapes it back to original string
+
+ */
+
+ return "";
+}
+
+
diff --git a/part/kxechardatadialog.h b/part/kxechardatadialog.h
new file mode 100644
index 0000000..7e1507b
--- /dev/null
+++ b/part/kxechardatadialog.h
@@ -0,0 +1,83 @@
+/***************************************************************************
+ kxechardatadialog.h - description
+ -------------------
+ begin : Don Apr 25 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXECHARDATADIALOG_H
+#define KXECHARDATADIALOG_H
+
+#include "kxechardatadialogbase.h"
+
+enum CharDataKind
+ {
+ CharDataTextNode = 0,
+ CharDataCDATASection,
+ CharDataComment
+ };
+
+class KXECharDataDialog : public KXECharDataDialogBase
+{
+ Q_OBJECT
+
+ public:
+ KXECharDataDialog( QWidget * pParent = 0, const char * pszName = 0, bool fModal = true, WFlags fl = 0 );
+
+// const CharDataKind charDataKind() const { return m_eCharDataKind; }
+ const bool atTop() const { return m_bAtTop; }
+ const QString contents() const { return m_strContents; }
+
+ void setContents(const QString strContents) { m_strContents = strContents; }
+// void setCharDataKind(const CharDataKind eCharDataKind) { m_eCharDataKind = eCharDataKind; }
+
+ public:
+
+ /**
+ * To be used for inserting the given XML character data as child
+ * of the given parent element.
+ *
+ * @return see @ref QDialog::exec
+ */
+ int exec( bool );
+
+ /**
+ * Clears the dialogs widgets.
+ */
+ void clearDialog();
+
+ // check contents
+ static QString checkContents(const QString);
+
+ protected:
+ /**
+ * Don't use this function directly, it's for internal use only.
+ * Use one of the other @ref DlgXMLCharData::exec functions instead.
+ */
+ int exec();
+
+ protected slots:
+ /**
+ * Called, when the data in the text edit @ref DlgXMLCharDataBase::m_pEditData
+ * is changed.
+ * Disables the OK button, if the given string is empty.
+ */
+ void slotDataChanged();
+
+ protected:
+ //CharDataKind m_eCharDataKind;
+ bool m_bAtTop;
+ QString m_strContents;
+};
+
+#endif
diff --git a/part/kxechardatadialogbase.ui b/part/kxechardatadialogbase.ui
new file mode 100644
index 0000000..7f8b874
--- /dev/null
+++ b/part/kxechardatadialogbase.ui
@@ -0,0 +1,213 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXECharDataDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXECharDataDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>389</width>
+ <height>289</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>XML Character Data</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pComboInsert</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Insert&lt;/b&gt;
+&lt;br/&gt;
+Choose, where to place this XML character data in the XML elements list of childnodes.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>at bottom</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>at top</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_pComboInsert</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Insert&lt;/b&gt;
+&lt;br/&gt;
+Choose, where to place this XML character data in the XML elements list of childnodes.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QTextEdit" row="1" column="0">
+ <property name="name">
+ <cstring>m_pEditData</cstring>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can edit the XML character data in this editor.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnOK</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_pTextLabelMessage</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pBtnOK</sender>
+ <signal>clicked()</signal>
+ <receiver>KXECharDataDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_pBtnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXECharDataDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pEditData</tabstop>
+ <tabstop>m_pBtnOK</tabstop>
+ <tabstop>m_pBtnCancel</tabstop>
+ <tabstop>m_pComboInsert</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxechoosestringdialog.cpp b/part/kxechoosestringdialog.cpp
new file mode 100644
index 0000000..d36ed68
--- /dev/null
+++ b/part/kxechoosestringdialog.cpp
@@ -0,0 +1,42 @@
+/***************************************************************************
+ kxechoosestringdialog.cpp - description
+ -------------------------
+ begin : Fri Jul 20 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxechoosestringdialog.h"
+
+#include <qpushbutton.h>
+#include <qcombobox.h>
+#include <qlabel.h>
+
+KXEChooseStringDialog::KXEChooseStringDialog(QWidget *parent,
+ const char *name,
+ const char *szCaption,
+ const char *szPrompt)
+ : KXEChooseStringDialogBase(parent, name, true)
+{
+ m_pComboBox->setEditable(true);
+ m_pComboBox->setFocus();
+ m_pPushButtonOk->setDefault(true);
+ setCaption(szCaption);
+ m_pTextLabel->setText(szPrompt);
+}
+
+/** Called, when user press OK button */
+void KXEChooseStringDialog::slotOk()
+{
+ m_strChoosedText = m_pComboBox->currentText();
+ accept();
+}
diff --git a/part/kxechoosestringdialog.h b/part/kxechoosestringdialog.h
new file mode 100644
index 0000000..2065e3a
--- /dev/null
+++ b/part/kxechoosestringdialog.h
@@ -0,0 +1,44 @@
+/***************************************************************************
+ kxechoosestringdialog.h - description
+ -----------------------
+ begin : Fri Jul 20 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXECHOOSESTRINGDIALOG_H
+#define KXECHOOSESTRINGDIALOG_H
+
+#include "kxechoosestringdialogbase.h"
+
+#include <qwidget.h>
+
+/**Dialog with combobox that allow enter
+or select any string
+ *@author Lumir Vanek
+ */
+
+class KXEChooseStringDialog : public KXEChooseStringDialogBase
+{
+ Q_OBJECT
+public:
+ KXEChooseStringDialog(QWidget *, const char *, const char *, const char *);
+
+protected slots: // Protected slots
+ /** Called, when user press OK button */
+ void slotOk();
+public: // Public attributes
+ /** Contain text choosed by user */
+ QString m_strChoosedText;
+};
+
+#endif
diff --git a/part/kxechoosestringdialogbase.ui b/part/kxechoosestringdialogbase.ui
new file mode 100644
index 0000000..5fb8079
--- /dev/null
+++ b/part/kxechoosestringdialogbase.ui
@@ -0,0 +1,143 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEChooseStringDialogBase</class>
+<comment>Dialog with combobox that allow enter
+or select any string</comment>
+<author>Lumir Vanek</author>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXEChooseStringDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>228</width>
+ <height>137</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Choose string</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QComboBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pComboBox</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter string&lt;b/&gt;
+&lt;br/&gt;
+Enter or choose string, that you want.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pPushButtonOk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pPushButtonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_pTextLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Enter string:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pComboBox</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enter string&lt;b/&gt;
+&lt;br/&gt;
+Enter or choose string, that you want.</string>
+ </property>
+ </widget>
+ <spacer row="0" column="1">
+ <property name="name">
+ <cstring>Spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>117</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pPushButtonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEChooseStringDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>m_pPushButtonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEChooseStringDialogBase</receiver>
+ <slot>slotOk()</slot>
+ </connection>
+</connections>
+<slots>
+ <slot access="protected">slotOk()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxecommand.cpp b/part/kxecommand.cpp
new file mode 100644
index 0000000..f197fc3
--- /dev/null
+++ b/part/kxecommand.cpp
@@ -0,0 +1,25 @@
+//
+// C++ Implementation: kxecommand
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kxecommand.h"
+
+KXECommand::KXECommand(KXEDocument* pDocument)
+:KCommand()
+{
+ m_pDocument = pDocument;;
+}
+
+
+KXECommand::~KXECommand()
+{
+}
+
+
diff --git a/part/kxecommand.h b/part/kxecommand.h
new file mode 100644
index 0000000..8d05ebd
--- /dev/null
+++ b/part/kxecommand.h
@@ -0,0 +1,37 @@
+//
+// C++ Interface: kxecommand
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KXECOMMAND_H
+#define KXECOMMAND_H
+
+#include <kcommand.h>
+#include "kxedocument.h"
+
+/**
+This is a base class for undoable commands in our application
+
+@author Adam Charytoniuk
+*/
+class KXECommand : public KCommand
+{
+public:
+ /** Constructor. Commands refer only to KXEDocument, not parts or views.
+ The KXEDocument is a class that owns KCommandHistory objcect.
+ */
+ KXECommand(KXEDocument* pDocument);
+
+ ~KXECommand();
+
+protected:
+ KXEDocument* m_pDocument;
+};
+
+#endif
diff --git a/part/kxeconfiguration.cpp b/part/kxeconfiguration.cpp
new file mode 100644
index 0000000..d780add
--- /dev/null
+++ b/part/kxeconfiguration.cpp
@@ -0,0 +1,181 @@
+/***************************************************************************
+ kxeconfiguration.cpp
+ --------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxeconfiguration.h"
+#include "kxetreeviewsettings.h"
+#include "kxetextviewsettings.h"
+#include "kxenewfilesettings.h"
+#include "kxeprintsettings.h"
+#include "kxearchiveextssettings.h"
+
+#include <kglobal.h>
+#include <klocale.h>
+#include <kdialogbase.h>
+#include <kiconloader.h>
+
+#include <qlayout.h>
+
+
+KXEConfiguration::KXEConfiguration()
+ : QObject( 0, "KXMLEditor's configuration (KXEConfiguration)" ),
+ m_pDialog( 0 )
+{
+ // initialize all setting group objects
+ m_pTreeView = new KXETreeViewSettings( this, "tree view config. settings" );
+ m_pTextView = new KXETextViewSettings( this, "text view config. settings" );
+ m_pNewFile = new KXENewFileSettings( this, "new file config. settings" );
+ m_pPrint = new KXEPrintSettings( this, "printing config. settings" );
+ m_pArcExts = new KXEArchiveExtsSettings( this, "archive extension config. settings" );
+
+ // restore the settings from our config file
+ restore();
+}
+
+KXEConfiguration::~KXEConfiguration()
+{
+ if ( m_pDialog )
+ delete m_pDialog;
+}
+
+void KXEConfiguration::store( KConfig * pConfig ) const
+{
+ if ( ! pConfig )
+ pConfig = KGlobal::config();
+
+ m_pTreeView->store( pConfig );
+ m_pTextView->store( pConfig );
+ m_pNewFile->store( pConfig );
+ m_pPrint->store( pConfig );
+ m_pArcExts->store( pConfig );
+}
+
+
+void KXEConfiguration::restore( KConfig * pConfig )
+{
+ if ( ! pConfig )
+ pConfig = KGlobal::config();
+
+ m_pTreeView->restore( pConfig );
+ m_pTextView->restore( pConfig );
+ m_pNewFile->restore( pConfig );
+ m_pPrint->restore( pConfig );
+ m_pArcExts->restore( pConfig );
+}
+
+
+void KXEConfiguration::showDialog()
+{
+ if ( ! m_pDialog ) // if there is no dialog yet,
+ {
+ // create one
+ m_pDialog = new KDialogBase( KDialogBase::IconList, // dialog face
+ i18n("Configure KXMLEditor"), // caption
+ KDialogBase::Apply | KDialogBase::Ok | KDialogBase::Cancel | KDialogBase::Help, // buttons
+ KDialogBase::Ok, // default button
+ 0, // parent
+ "configuration dialog", // name
+ false, // not modal
+ true ); // show separator
+ connect( m_pDialog, SIGNAL(applyClicked()), this, SLOT(slotDlgApplied()) );
+ connect( m_pDialog, SIGNAL(okClicked()), this, SLOT(slotDlgApplied()) );
+
+ // and add the pages
+ QFrame * pFrame;
+ QWidget * pPage;
+ QVBoxLayout * pLayout;
+
+ // - tree view properties page
+ pFrame = m_pDialog->addPage( m_pTreeView->dialogPageName(),
+ m_pTreeView->dialogPageHeader(),
+ KGlobal::instance()->iconLoader()->loadIcon( m_pTreeView->dialogPageIcon(), KIcon::NoGroup, KIcon::SizeMedium ) );
+ pLayout = new QVBoxLayout( pFrame );
+ pPage = m_pTreeView->dialogPage( pFrame );
+ pLayout->addWidget( pPage );
+ connect( m_pTreeView, SIGNAL(sigDialogPageChanged()), this, SLOT(slotDlgChanged()) );
+
+ // - text view properties page
+ pFrame = m_pDialog->addPage( m_pTextView->dialogPageName(),
+ m_pTextView->dialogPageHeader(),
+ KGlobal::instance()->iconLoader()->loadIcon( m_pTextView->dialogPageIcon(), KIcon::NoGroup, KIcon::SizeMedium ) );
+ pLayout = new QVBoxLayout( pFrame );
+ pPage = m_pTextView->dialogPage( pFrame );
+ pLayout->addWidget( pPage );
+ connect( m_pTextView, SIGNAL(sigDialogPageChanged()), this, SLOT(slotDlgChanged()) );
+
+ // - new file settings page
+ pFrame = m_pDialog->addPage( m_pNewFile->dialogPageName(),
+ m_pNewFile->dialogPageHeader(),
+ KGlobal::instance()->iconLoader()->loadIcon( m_pNewFile->dialogPageIcon(), KIcon::NoGroup, KIcon::SizeMedium ) );
+ pLayout = new QVBoxLayout( pFrame );
+ pPage = m_pNewFile->dialogPage( pFrame );
+ pLayout->addWidget( pPage );
+ connect( m_pNewFile, SIGNAL(sigDialogPageChanged()), this, SLOT(slotDlgChanged()) );
+
+ // - printing's settings page
+ pFrame = m_pDialog->addPage( m_pPrint->dialogPageName(),
+ m_pPrint->dialogPageHeader(),
+ KGlobal::instance()->iconLoader()->loadIcon( m_pPrint->dialogPageIcon(), KIcon::NoGroup, KIcon::SizeMedium ) );
+ pLayout = new QVBoxLayout( pFrame );
+ pPage = m_pPrint->dialogPage( pFrame );
+ pLayout->addWidget( pPage );
+ connect( m_pPrint, SIGNAL(sigDialogPageChanged()), this, SLOT(slotDlgChanged()) );
+
+ // - archive extensions page
+ pFrame = m_pDialog->addPage( m_pArcExts->dialogPageName(),
+ m_pArcExts->dialogPageHeader(),
+ KGlobal::instance()->iconLoader()->loadIcon( m_pArcExts->dialogPageIcon(), KIcon::NoGroup, KIcon::SizeMedium ) );
+ pLayout = new QVBoxLayout( pFrame );
+ pPage = m_pArcExts->dialogPage( pFrame );
+ pLayout->addWidget( pPage );
+ connect( m_pArcExts, SIGNAL(sigDialogPageChanged()), this, SLOT(slotDlgChanged()) );
+ }
+
+ if ( m_pDialog->isVisible() ) // If the dialog is visible (probably opened by
+ { // another part), it has to be hidden to make
+ m_pDialog->hide(); // it appear on the current desktop by the later
+ } // call of show.
+ else // If the dialog is not visible, it's
+ { // Apply- and Ok-buttons have to be
+ m_pDialog->enableButtonApply( false ); // disabled (until something is changed
+ m_pDialog->enableButtonOK( false ); // within the dialog).
+ }
+
+ m_pDialog->show(); // show our configuration dialog
+}
+
+void KXEConfiguration::slotDlgApplied()
+{
+ // reset configuration dialog
+ m_pDialog->enableButtonApply( false );
+ m_pDialog->enableButtonOK( false );
+
+ // apply the page's data to the corresponding setting groups
+ m_pTreeView->apply();
+ m_pTextView->apply();
+ m_pNewFile->apply();
+ m_pPrint->apply();
+ m_pArcExts->apply();
+
+ // store the applied data to our config file
+ store();
+}
+
+void KXEConfiguration::slotDlgChanged()
+{
+ m_pDialog->enableButtonApply( true );
+ m_pDialog->enableButtonOK( true );
+}
diff --git a/part/kxeconfiguration.h b/part/kxeconfiguration.h
new file mode 100644
index 0000000..3afd8b2
--- /dev/null
+++ b/part/kxeconfiguration.h
@@ -0,0 +1,123 @@
+/***************************************************************************
+ kxeconfiguration.h
+ ------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXECONFIGURATION_H
+#define KXECONFIGURATION_H
+
+#include <qobject.h>
+
+class KXETreeViewSettings;
+class KXETextViewSettings;
+class KXENewFileSettings;
+class KXEPrintSettings;
+class KXEArchiveExtsSettings;
+
+class KConfig;
+class KDialogBase;
+
+/**
+ * This class is a container for KXMLEditor's configuration data.
+ * It consists of objects for the different groups of settings
+ * (objects of child classes of KXESettings) and manages the configuration
+ * dialog (@ref m_pDialog). This dialog consists of one page per settings
+ * group, that are initialized by them (using their dialogPage* functions).
+ *
+ * @short container for KXMLEditor's configuration data
+ * @author Olaf Hartig
+ */
+class KXEConfiguration : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * The constructor initializes the configuration setting groups
+ * (objects of KXESettings' child classes) and restores the
+ * configuration data from the config file by calling @ref restore.
+ */
+ KXEConfiguration();
+ /**
+ * The destructor deletes the configuration dialog, if there is one.
+ */
+ ~KXEConfiguration();
+
+ /**
+ * Stores all configuration to the given @ref KConfig object by
+ * using @ref KXESettings's @ref store function.
+ * If no @ref KConfig object is given, @ref KGlobal::config is
+ * used.
+ */
+ void store( KConfig * pConfig = 0 ) const;
+ /**
+ * Restores all configuration from the given @ref KConfig object
+ * by using @ref KXESettings's @ref restore function.
+ * If no @ref KConfig object is given, @ref KGlobal::config is
+ * used.
+ */
+ void restore( KConfig * pConfig = 0 );
+ /**
+ * Shows the configuration dialog.
+ * If there is no one yet, it is created by.
+ */
+ void showDialog();
+
+ // The following functions return pointers to the configuration setting
+ // groups (objects of KXESettings' child classes), that can be used to
+ // access their data (or to connect to their signals).
+
+ KXETreeViewSettings * const treeview() const { return m_pTreeView; }
+ KXETextViewSettings * const textview() const { return m_pTextView; }
+ KXENewFileSettings * const newfile() const { return m_pNewFile; }
+ KXEPrintSettings * const print() const { return m_pPrint; }
+ KXEArchiveExtsSettings * const archexts() const { return m_pArcExts; }
+
+ protected slots:
+
+ /**
+ * Applies the new data in the dialog's pages to our setting groups
+ * by using @ref KXESettings's @ref apply function and stores
+ * all settings with @ref store.
+ * After applying, the dialog's state is reseted (disabled Apply- and
+ * OK-buttons).
+ */
+ void slotDlgApplied();
+ /**
+ * Enables the configuration dialog's Apply- and OK-button.
+ */
+ void slotDlgChanged();
+
+ protected:
+
+ // The following members are the configuration setting
+ // groups (objects of KXESettings' child classes).
+
+ KXETreeViewSettings * m_pTreeView;
+ KXETextViewSettings * m_pTextView;
+ KXENewFileSettings * m_pNewFile;
+ KXEPrintSettings * m_pPrint;
+ KXEArchiveExtsSettings * m_pArcExts;
+
+ /**
+ * This is a pointer to our configuration dialog.
+ * The dialog itself is created on demand in @ref showDialog.
+ * It consists of one page per settings group.
+ */
+ KDialogBase * m_pDialog;
+};
+
+#endif
diff --git a/part/kxedocument.cpp b/part/kxedocument.cpp
new file mode 100644
index 0000000..c3775c5
--- /dev/null
+++ b/part/kxedocument.cpp
@@ -0,0 +1,631 @@
+//
+// C++ Implementation: kxedocument
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kxedocument.h"
+
+#include "kxmleditorfactory.h"
+#include "kxeconfiguration.h"
+#include "kxenewfilesettings.h"
+#include "kxearchiveextssettings.h"
+#include "kxeprintsettings.h"
+#include "kxetextviewsettings.h"
+#include "kxechoosestringdialog.h"
+#include "kxeattachdialogbase.h"
+#include "kxespecprocinstrdialog.h"
+#include "kxefilenewdialog.h"
+#include "commands_file.h"
+
+
+#include <kfile.h>
+#include <ktar.h>
+#include <kzip.h>
+#include <kfilterdev.h>
+#include <ktempfile.h>
+#include <kdebug.h>
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <kcommand.h>
+#include <kaction.h>
+#include <kurl.h>
+#include <kurlrequester.h>
+
+#include <qcombobox.h>
+#include <qbuffer.h>
+#include <qregexp.h>
+#include <qtextcodec.h>
+#include <qlabel.h>
+#include <qcheckbox.h>
+
+KXEDocument::KXEDocument(QObject *parent, const char *name)
+ :QObject (parent,name),
+ QDomDocument(),
+ KXMLGUIClient()
+{
+ m_bDocIsCompressed = false;
+ m_bIsModified = false;
+ m_strCompressedTarEntryName = "";
+ m_url = "";
+
+ //setXMLFile("kxedocument.rc");
+}
+
+
+KXEDocument::~KXEDocument()
+{
+}
+
+
+bool KXEDocument::save(const QString &strFileName)
+{
+ if (this->documentElement().isNull() &&
+ KMessageBox::warningContinueCancel(0,
+ i18n("Your file doesn't have root element defined. \n\
+ Continue saving?"))==KMessageBox::Cancel )
+ {
+ return false;
+ }
+
+ QString strXML;
+
+ QTextStream streamXML(&strXML, IO_WriteOnly);
+ int iIndent = KXMLEditorFactory::configuration()->textview()->indentSteps();
+ ((QDomDocument*)this)->save(streamXML, iIndent);
+
+ QString strEncoding;
+ QTextCodec *pTextCodec;
+
+ // find encoding info
+ if(strXML.left(5) == "<?xml")
+ { int iStart, iEnd;
+ if((iStart = strXML.find("encoding", 0)) > 0)
+ {
+ // info about encoding found;
+ iStart += 8; // skip encoding
+
+ // search " or ' after encoding
+ if((iStart = strXML.find(QRegExp("[\"']"), iStart)) > 0)
+ {
+ QChar ch = strXML[iStart];
+ iStart++; // skip ch
+ if((iEnd = strXML.find(ch, iStart)) > 0)
+ {
+ strEncoding = strXML.mid(iStart, iEnd - iStart);
+ }
+ }
+ }
+ }
+
+ if(strEncoding.length() <= 0)
+ pTextCodec = QTextCodec::codecForLocale(); // default
+ else
+ pTextCodec = QTextCodec::codecForName(strEncoding);
+
+ if(pTextCodec == 0)
+ { if(KMessageBox::questionYesNo(0, i18n("Codec for encoding %1 not found ! Continue saving ?").arg(strEncoding)) != KMessageBox::Yes)
+ return false;
+ }
+
+ QCString strDecoded;
+ if(pTextCodec)
+ { strDecoded = pTextCodec->fromUnicode(strXML);
+ }
+
+ // save string to file
+ if(!m_bDocIsCompressed)
+ { QFile file(strFileName);
+ if(file.open(IO_WriteOnly) == true)
+ { file.writeBlock(strDecoded, strDecoded.length());
+ file.flush();
+ file.close();
+ }
+ else
+ { KMessageBox::error(0,
+ i18n("Can't create file %1").arg(strFileName),
+ i18n("Write error !"));
+ }
+ }
+ else
+ { // obtain file extension -----------------------------------------
+ QString strExtension;
+
+ int iPos = strFileName.findRev('.');
+
+ if(iPos > 0)
+ { strExtension = strFileName.mid(iPos + 1);
+ }
+
+ if(strExtension == "svgz")
+ {
+ KMessageBox::sorry(0,
+ "Saving *.svgz not implemented yet",
+ "sory");
+ return false;
+ }
+ else
+ {
+ KZip tarGzFile(strFileName); // New KOffice use KZip instead of KTarGz for storing files
+ if(tarGzFile.open(IO_WriteOnly))
+ { tarGzFile.writeFile(m_strCompressedTarEntryName, "user", "group", strDecoded.length(), strDecoded);
+ tarGzFile.close();
+ }
+ else
+ { KMessageBox::error(0,
+ i18n("Can't create archive %1").arg(strFileName),
+ i18n("Write error !"));
+ }
+ }
+ }
+
+ return true;
+}
+
+bool KXEDocument::open(const QString &strFileName)
+{
+ QString strCompressedTarEntryName;
+
+ kdDebug() << "KXEDocument::open: opening file " << strFileName << endl;
+
+ // obtain file extension -----------------------------------------
+ QString strExtension;
+
+ int iPos = strFileName.findRev('.');
+
+ if(iPos > 0)
+ { strExtension = strFileName.mid(iPos + 1);
+ }
+
+ QString strTmpfileName;
+
+ if ( KXMLEditorFactory::configuration()->archexts()->extensions().contains(strExtension) )
+ {
+
+ KTempFile tmp;
+ if (tmp.status() != 0)
+ {
+ kdError() << "Couldn't open temp file" << endl;
+ KMessageBox::sorry(0, i18n("Couldn't open temp file !"));
+ return false;
+ }
+
+ tmp.setAutoDelete(false);
+ QFile &fileTemporary = *(tmp.file());
+
+
+ if(strExtension == "svgz")
+ {
+ //----------------------- It is gzip compressed file -----------------------
+
+ m_strCompressedTarEntryName = strFileName.left(strFileName.length() - 5); // For SVG compressed icons strip extension, e.g. "kate.svgz" has entry "kate" etc
+
+ iPos = m_strCompressedTarEntryName.findRev('/');
+
+ if(iPos > 0)
+ { m_strCompressedTarEntryName = m_strCompressedTarEntryName.mid(iPos + 1);
+ }
+
+ QIODevice *pIODevice = KFilterDev::deviceForFile(strFileName, "application/x-gzip");
+
+ if(pIODevice->open( IO_ReadOnly ))
+ {
+ QTextStream stream(pIODevice);
+ QString line;
+ //int i = 1;
+ while ( !stream.atEnd() )
+ {
+ line = stream.readLine(); // line of text excluding '\n'
+ //printf( "%3d: %s\n", i++, line.latin1() );
+ fileTemporary.writeBlock(line, line.length());
+ }
+ pIODevice->close();
+ }
+ }
+ else
+ {
+ //----------------------- It is zip archive file ---------------------------
+
+ KZip tarGzFile(strFileName); // new KOffice use KZip instead of KTarGz for storing files
+
+ tarGzFile.open(IO_ReadOnly);
+ fileTemporary.open(IO_WriteOnly);
+
+ const KTarDirectory *root = tarGzFile.directory();
+ if(!root)
+ {
+ return false;
+ }
+
+ // For KOffice files let user to choose maindoc or documentinfo
+ if(strCompressedTarEntryName.length() == 0)
+ { KXEChooseStringDialog dlgChooseString(0, 0, i18n("Choose file"), i18n("File:"));
+ dlgChooseString.m_pComboBox->insertItem("maindoc.xml");
+ dlgChooseString.m_pComboBox->insertItem("documentinfo.xml");
+
+ if(dlgChooseString.exec() != KXEChooseStringDialog::Accepted)
+ { return false;
+ }
+ m_strCompressedTarEntryName = dlgChooseString.m_strChoosedText;
+ }
+ else
+ {
+ m_strCompressedTarEntryName = strCompressedTarEntryName;
+ }
+
+ const KArchiveEntry *entry = root->entry(m_strCompressedTarEntryName);
+
+ if(entry && entry->isFile())
+ { const KArchiveFile *pTarFile = static_cast <const KArchiveFile *> (entry);
+
+ QBuffer buffer(pTarFile->data());
+ buffer.open(IO_ReadOnly);
+
+ fileTemporary.writeBlock(buffer.buffer(), buffer.size());
+ }
+ else
+ m_strCompressedTarEntryName.truncate(0);
+
+ tarGzFile.close();
+ }
+
+ strTmpfileName = fileTemporary.name();
+ fileTemporary.close();
+
+ m_bDocIsCompressed = true;
+ }
+ else
+ m_bDocIsCompressed = false;
+
+
+ // ( 1.) parse the file and fill our document
+ QFile file(m_bDocIsCompressed ? strTmpfileName : strFileName);
+ if(! file.open(IO_ReadOnly))
+ {
+ kdDebug() << "KXEDocument::openFile: Can't open file." << endl;
+ return false;
+ }
+
+ // auxiliary file for obtaining encoding info
+ QFile fileAux(m_bDocIsCompressed ? strTmpfileName : strFileName);
+ if(! fileAux.open(IO_ReadOnly))
+ {
+ kdDebug() << "KXEDocument::openFile: Can't open file." << endl;
+ return false;
+ }
+
+ QTextStream txtStreamLocal( & file );
+
+ // Lookup at XML document encoding -----------------------------------------------
+ QTextStream txtStreamAux( & fileAux );
+ QString strFirstLine = txtStreamAux.readLine();
+ fileAux.close();
+ int iStart, iEnd;
+ if((iStart = strFirstLine.find("encoding", 0)) > 0)
+ {
+ QString strEncoding;
+ // info about encoding found;
+ iStart += 8; // skip encoding
+
+ // search " or ' after encoding
+ if((iStart = strFirstLine.find(QRegExp("[\"']"), iStart)) > 0)
+ {
+ QChar ch = strFirstLine[iStart];
+ iStart++; // skip ch
+ if((iEnd = strFirstLine.find(ch, iStart)) > 0)
+ {
+ strEncoding = strFirstLine.mid(iStart, iEnd - iStart);
+
+ QTextCodec *pTextCodec = QTextCodec::codecForName(strEncoding);
+ if(pTextCodec)
+ txtStreamLocal.setCodec(pTextCodec);
+ else
+ {
+ KMessageBox::sorry(0, i18n("Codec for encoding %1 not found ! Using locale encoding for load.").arg(strEncoding));
+ txtStreamLocal.setEncoding(QTextStream::Locale);
+ }
+ }
+ }
+ }
+ else
+ {
+ // XML documment dont have info about encoding, set default UTF-8
+ txtStreamLocal.setCodec(QTextCodec::codecForName("UTF-8"));
+ }
+
+
+ //--------------------------------------------------------------------------------
+ QString strFileContents = txtStreamLocal.read();
+ file.close();
+
+ if(m_bDocIsCompressed)
+ {
+ QDir dir;
+ dir.remove(strTmpfileName);
+ }
+
+ //-- Set string with XML to QDomDocument ------------------------------------------
+ QString strErrorMsg;
+ int iErrorLine, iErrorColumn;
+ QDomDocument * pNewDoc = new QDomDocument; // first try with a new document
+
+ if( ! pNewDoc->setContent(strFileContents, true, &strErrorMsg, &iErrorLine, &iErrorColumn) )
+ { kdDebug() << "KXEDocument::openFile: Failed parsing the file." << endl;
+
+ KMessageBox::error(0,
+ i18n("%1 in line %2, column %3").arg(strErrorMsg).arg(iErrorLine).arg(iErrorColumn),
+ i18n("Parsing error !"));
+
+ delete pNewDoc; // remove the new document, because it's useless
+ return false;
+ }
+
+// The following commented code is performance wise buggy, because the string
+// gets parsed a second time. I replaced it with this code.
+ // copy the content of the parsed document to this one
+ QDomNode e = pNewDoc->removeChild( pNewDoc->documentElement() );
+ QDomDocument::operator=( *pNewDoc );
+ appendChild( e );
+// Here comes the "buggy" code.
+ //this->setContent(pNewDoc->toString(),true,0,0); // and take the new one
+ //delete pNewDoc; // remove the former document
+// To test/see the difference in loading time, you can switch the commented
+// codeblocks above and compare the loading-time-differences measured in
+// KXMLEditorPart::openFile.
+// Olaf
+// TODO: remove the comments above later
+
+ emit sigOpened();
+
+ return true;
+}
+
+void KXEDocument::setModified(bool value)
+{
+ m_bIsModified = value;
+ emit sigModified(value);
+}
+
+void KXEDocument::setURL(KURL url)
+{
+ m_url = url;
+ emit sigURLChanged(url);
+}
+
+void KXEDocument::updateNodeCreated(const QDomNode & node)
+{
+ emit sigNodeCreated(node);
+ setModified();
+}
+
+void KXEDocument::updateNodeDeleted(const QDomNode & node)
+{
+ emit sigNodeDeleted(node);
+ setModified();
+}
+
+void KXEDocument::updateNodeChanged( const QDomElement & domElement )
+{
+ emit sigNodeChanged(domElement);
+ setModified();
+}
+
+void KXEDocument::updateNodeChanged( const QDomCharacterData & node )
+{
+ emit sigNodeChanged(node);
+ setModified();
+}
+
+void KXEDocument::updateNodeChanged( const QDomProcessingInstruction &domProcInstr )
+{
+ emit sigNodeChanged(domProcInstr);
+ setModified();
+}
+
+void KXEDocument::updateNodeMoved( const QDomNode & node )
+{
+ emit sigNodeMoved(node);
+ setModified();
+}
+
+void KXEDocument::attachStylesheet(const KURL& stylesheet)
+{
+ setSpecProcInstr("xml-stylesheet",QString("type = 'text/xsl' href = '")+stylesheet.url()+"' ");
+}
+
+void KXEDocument::detachStylesheet()
+{
+ removeSpecProcInstr("xml-stylesheet");
+}
+
+void KXEDocument::attachSchema(const KURL& schema)
+{
+ QDomElement domElement = documentElement();
+ if (!domElement.isNull())
+ {
+ domElement.setAttributeNS(SCHEMA_NAMESPACE,
+ SCHEMA_ATTRIBUTE_XSI,
+ schema.url());
+ // refresh views
+ updateNodeChanged(domElement);
+ setModified();
+ }
+}
+
+void KXEDocument::detachSchema()
+{
+ QDomElement domElement = this->documentElement();
+ if (!domElement.isNull())
+ {
+ domElement.removeAttributeNS(SCHEMA_NAMESPACE,SCHEMA_ATTRIBUTE);
+ // refresh views
+ updateNodeChanged(domElement);
+ setModified();
+ }
+}
+
+void KXEDocument::setSpecProcInstr(const QString& target, const QString& data)
+{
+ // removing old one
+ removeSpecProcInstr(target);
+ // create new one
+ if (!data.isEmpty())
+ {
+ QDomProcessingInstruction domProcInstr = this->createProcessingInstruction(target,data);
+
+ QDomNode node = getSpecProcInstr("xml");
+ if (!node.isNull())
+ // if there is already xml instruction, then put that one below it
+ this->insertAfter(domProcInstr,node);
+ else
+ // otherwise put it always on the top
+ this->insertBefore(domProcInstr,this->firstChild());
+
+ updateNodeCreated(domProcInstr);
+ }
+ setModified();
+}
+
+void KXEDocument::removeSpecProcInstr(const QString &target)
+{
+ QDomNode domNode = getSpecProcInstr(target);
+ if (!domNode.isNull())
+ {
+ updateNodeDeleted(domNode);
+ ((QDomDocument*)this)->removeChild(domNode);
+ setModified();
+ }
+}
+
+QDomNode KXEDocument::getSpecProcInstr(const QString& target)
+{
+ QDomNode result;
+ QDomNodeList domNodeList = this->childNodes();
+ for (uint i=0;i<domNodeList.count();i++)
+ if (domNodeList.item(i).isProcessingInstruction())
+ {
+ QDomProcessingInstruction domProcInstr = domNodeList.item(i).toProcessingInstruction();
+ if (domProcInstr.target()==target)
+ return domNodeList.item(i);
+ }
+ return result;
+}
+
+void KXEDocument::newFile()
+{
+ switch ( KXMLEditorFactory::configuration()->newfile()->newFileCreaBehav() )
+ {
+ case KXENewFileSettings::CreateEmptyFile:
+ break; // nothing to do in this case
+
+ case KXENewFileSettings::CreateWithAssistance:
+ {
+
+ KXEFileNewDialog dlg( 0L);
+ dlg.fillDialog( KXMLEditorFactory::configuration()->newfile()->dfltVersion(),
+ KXMLEditorFactory::configuration()->newfile()->dfltEncoding() );
+ if( dlg.exec() )
+ { // if the dialog has been accepted (OK pressed)
+ setSpecProcInstr( "xml", dlg.getData() );
+
+ // if the dialog shouldn't be shown anymore, the settings have to be changed
+ if ( dlg.m_pDontShowAgain->isChecked() )
+ KXMLEditorFactory::configuration()->newfile()->setNewFileCreaBehav( KXENewFileSettings::UseDefaults, instance()->config() );
+ }
+
+ break;
+ }
+
+ case KXENewFileSettings::UseDefaults:
+ setSpecProcInstr( "xml", QString( "version='%1' encoding='%2'" ).arg(KXMLEditorFactory::configuration()->newfile()->dfltVersion()).arg(KXMLEditorFactory::configuration()->newfile()->dfltEncoding()) );
+ break;
+ }
+ emit sigOpened();
+ setModified();
+}
+
+//------------- SLOTS, called from Part --------------------------------
+
+KCommand * KXEDocument::actDetachStylesheet()
+{
+ QDomNode domNode = getSpecProcInstr("xml-stylesheet");
+ if (!domNode.isNull())
+ {
+ KCommand *pCmd = new KXEStylesheetDetachCommand(this,domNode.toProcessingInstruction().data());
+ return pCmd;
+ }
+ return 0L;
+}
+
+KCommand * KXEDocument::actAttachStylesheet()
+{
+ KXEAttachDialogBase dlg;
+ dlg.Label->setText(i18n("Stylesheet URL:"));
+ if (dlg.exec())
+ {
+ QDomNode domNode = getSpecProcInstr("xml-stylesheet");
+ QString data = "";
+ if (!domNode.isNull())
+ data = domNode.toProcessingInstruction().data();
+ KCommand *pCmd = new KXEStylesheetAttachCommand(this,data,dlg.attachURI->url());
+ return pCmd;
+ }
+ return 0L;
+}
+
+KCommand * KXEDocument::actDetachSchema()
+{
+ if (!documentElement().isNull()) // just for sure...
+ {
+ KCommand *pCmd = new KXESchemaDetachCommand(this,
+ documentElement().attributeNS(SCHEMA_NAMESPACE,
+ SCHEMA_ATTRIBUTE,"")
+ );
+ return pCmd;
+ }
+ return 0L;
+}
+
+KCommand * KXEDocument::actAttachSchema()
+{
+ KXEAttachDialogBase dlg;
+ dlg.Label->setText(i18n("Schema URL:"));
+ if (dlg.exec())
+ {
+ if (!documentElement().isNull()) // just for sure...
+ {
+ KCommand *pCmd = new KXESchemaAttachCommand(this,dlg.attachURI->url(),
+ documentElement().attributeNS(SCHEMA_NAMESPACE,SCHEMA_ATTRIBUTE,""));
+ return pCmd;
+ }
+ }
+ return 0L;
+}
+
+// Instert or edit special processing instruction <?xml ... ?>
+KCommand * KXEDocument::actVersionEncoding()
+{
+ QDomNode node = getSpecProcInstr("xml");
+ KXESpecProcInstrDialog dlg;
+
+ if(!node.isNull())
+ dlg.fillDialog(node.toProcessingInstruction().data());
+ else
+ dlg.fillDialog( KXMLEditorFactory::configuration()->newfile()->dfltVersion(),
+ KXMLEditorFactory::configuration()->newfile()->dfltEncoding() );
+
+ if(dlg.exec())
+ {
+ QString strOldData = "";
+ if (!node.isNull())
+ strOldData = node.toProcessingInstruction().data();
+ KCommand *pCmd = new KXEVersionEncodingCommand(this,strOldData,dlg.getData());
+ return pCmd;
+ }
+ return 0L;
+}
diff --git a/part/kxedocument.h b/part/kxedocument.h
new file mode 100644
index 0000000..2b78659
--- /dev/null
+++ b/part/kxedocument.h
@@ -0,0 +1,240 @@
+//
+// C++ Interface: kxedocument
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2004
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef KXEDOCUMENT_H
+#define KXEDOCUMENT_H
+
+#include <kurl.h>
+
+#include <qobject.h>
+#include <qdom.h>
+#include <kparts/part.h>
+#include <kxmlguiclient.h>
+
+#define SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema-instance"
+#define SCHEMA_ATTRIBUTE "schemaLocation"
+#define SCHEMA_ATTRIBUTE_XSI "xsi:schemaLocation"
+
+class QString;
+class KCommand;
+
+
+/**
+@file
+*/
+
+/**
+@short Base class for documents in KXMLEditor.
+
+Stores XML document data which can be manipulated by KXMLEditor application.
+
+
+@author Adam Charytoniuk
+*/
+class KXEDocument : public QObject, public QDomDocument, public KXMLGUIClient
+{
+ Q_OBJECT
+public:
+ /** @short Constructor */
+ KXEDocument(QObject *parent=0, const char *name=0);
+
+ /** @short Destructor */
+ ~KXEDocument();
+
+ /** @short Saves document into given file */
+ bool save(const QString &);
+
+ /** @short Loads document from given file */
+ bool open(const QString &);
+
+ /** @short Sets modification flag.
+
+ Should be called after every operation done on the document content */
+ void setModified(bool value=true);
+
+ /** @short Returns true if this document was modified and not saved yet */
+ bool isModified() {return m_bIsModified;}
+
+ /** @short Changes document url */
+ void setURL(KURL url);
+
+ /** @short Executes given command and adds it into internal document command history list
+
+ @param pCmd pointer to KXECommand object which encapsulates required operations
+ on a document content
+ */
+
+ /** @short Notifies views about creating new element
+
+ @param node newly created node
+ */
+ void updateNodeCreated(const QDomNode & node);
+
+ /** @short Notifies views about deleting node
+
+ This should be called before given node from the document will be deleted.
+ This will give a chanse to the views to remove that node visualization.
+ @param node that is going to be deleted
+ */
+ void updateNodeDeleted(const QDomNode & node);
+
+ /** @short Notifies views about element properties changes
+
+ Should be called after element name or element attributes are changed.
+ @param domElement element that has changed
+ */
+ void updateNodeChanged( const QDomElement & domElement );
+
+ /** @short Notifies views after change char. data properties
+
+ Should be called after any kind of character data is changed
+ (including texts, comments, .CDATA sections).
+ @param node character data node that has changed
+ */
+ void updateNodeChanged( const QDomCharacterData & node ) ;
+
+ /** @short Notifies views after change proc. instr. properties
+
+ Should be called after any processing intruction is changed.
+ @param domProcInstr processing instruction that has changed
+ */
+ void updateNodeChanged( const QDomProcessingInstruction &domProcInstr );
+
+ /** @short Notifies views after moving node
+
+ Should be called if any node in the document was moved.
+ @param node XML node that has been moved
+ */
+ void updateNodeMoved( const QDomNode & node );
+
+ /** @short Removes spec. processing instruction from XML file.
+
+ @param target name of the proc. instruction target
+ @warning Removes processing instruction from DomDocument children node list only (no subnodes are modiified).
+ @sa setSpecProcInstr()
+ */
+ void removeSpecProcInstr(const QString &target);
+
+ /** @short Adds or changes (if already exists) processing instruction.
+
+ Processing instruction will be added as a child in QDomDocument object.
+ @param target processing intruction target
+ @param data processing intruction data
+ @sa removeSpecProcInstr()
+ */
+ virtual void setSpecProcInstr(const QString& target, const QString& data);
+
+ /** @short Returns processing instruction located in QDomDocument.
+
+ If given processing intruction is not found, null node is returned.
+ @param target name of the processing instruction target.
+ @sa setSpecProcInstr()
+ */
+ QDomNode getSpecProcInstr(const QString& target);
+
+ /** @short Attaches stylesheet to current XML file.
+
+ If file is already attached to stylesheet, this attachment will be overriten.
+ @param stylesheet url to stylesheet location
+ @sa detachStylesheet()
+ */
+ virtual void attachStylesheet(const KURL& stylesheet);
+
+ /** @short Detaches stylesheet from current XML file.
+
+ @sa attachStylesheet()*/
+ virtual void detachStylesheet();
+
+ /** Attaches schema to current XML file. If file is already attached to schema,
+ this attachment will be overriten.
+ @param schema url to schema location
+ @sa detachSchema()*/
+ virtual void attachSchema(const KURL& schema);
+
+ /** @short Detaches schema from current XML file.
+
+ @sa attachSchema()*/
+ virtual void detachSchema();
+
+ /** @short prepares content of newly created document.
+
+ The preparation will be done accordingly to settings.
+ In addition, signal sigOpened() is emited to notify all views
+ about the change.*/
+ virtual void newFile();
+
+
+ /** @short Inserts special proc.instruction into document. */
+ KCommand * actVersionEncoding();
+
+ /** @short Called on user's action response.
+
+ Creates <?xml-stylesheet ...?> processing instruction
+ with reference to specified stylesheet URI.
+ */
+ KCommand * actAttachStylesheet();
+
+ /** @short Called on user's action response. */
+ KCommand * actDetachStylesheet();
+
+ /** @short Called on user's action response */
+ KCommand * actDetachSchema();
+
+ /** @short Called on user's action response */
+ KCommand * actAttachSchema();
+
+private:
+ QString m_strCompressedTarEntryName;
+ /** Equals true if document was opened from compressed file */
+ bool m_bDocIsCompressed;
+ /** @short Stores modification flag */
+ bool m_bIsModified;
+ KURL m_url;
+
+signals:
+ /** @short Emmited when document has a new content.
+
+ This may happen in the following scenarios:
+ - document was opened from the fille or URL,
+ - document has modified big part of the content
+ - document initialized it's content after creations
+
+ @sa newFile()
+ */
+ void sigOpened();
+
+ /** @short Emitted when document content have been changed.
+
+ This allows to notify all attached views about that event.*/
+ void sigModified(bool value);
+
+ void sigURLChanged(KURL url);
+ /** @short Emitted when new node was added to document.*/
+ void sigNodeCreated(const QDomNode & node);
+ /** @short Emitted everytime node was deleted from document.*/
+ void sigNodeDeleted(const QDomNode & node);
+ /** @short Emitted everytime document element was changed .*/
+ void sigNodeChanged( const QDomElement & domElement );
+ /** @short Emitted everytime character data node was changed.
+
+ This is the case for nodes like:
+ - text,
+ - comments,
+ - CDATA sections,
+ */
+ void sigNodeChanged( const QDomCharacterData & node ) ;
+ /** @short Emitted everytime processing instruction in document was changed .*/
+ void sigNodeChanged( const QDomProcessingInstruction &domProcInstr );
+ /** @short Emitted everytime document node was moved was changed .*/
+ void sigNodeMoved( const QDomNode & node );
+};
+
+#endif
diff --git a/part/kxedocument.rc b/part/kxedocument.rc
new file mode 100644
index 0000000..b580dee
--- /dev/null
+++ b/part/kxedocument.rc
@@ -0,0 +1,15 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kxedocument" version="1">
+<!-- document specific actions here -->
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="xml_ins_spec_procins"/>
+ <Separator lineSeparator="true"/>
+ <Action name="xml_attach_schema"/>
+ <Action name="xml_detach_schema"/>
+ <Action name="xml_attach_stylesheet"/>
+ <Action name="xml_detach_stylesheet"/>
+ <Separator lineSeparator="true"/>
+ </Menu>
+</MenuBar>
+</kpartgui>
diff --git a/part/kxeelementdialog.cpp b/part/kxeelementdialog.cpp
new file mode 100644
index 0000000..b9736b1
--- /dev/null
+++ b/part/kxeelementdialog.cpp
@@ -0,0 +1,189 @@
+/***************************************************************************
+ kxeelementdialog.cpp - description
+ -------------------
+ begin : Mit Apr 17 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxeelementdialog.h"
+
+#include <qlabel.h>
+#include <qcombobox.h>
+#include <qpushbutton.h>
+
+#include <klineedit.h>
+#include <kdebug.h>
+#include <klocale.h>
+
+KXEElementDialog::KXEElementDialog( QWidget * pParent, const char * pszName, bool fModal, WFlags fl )
+ : KXEElementDialogBase( pParent, pszName, fModal, fl )
+{
+ connect( m_pEditNsURI, SIGNAL(textChanged(const QString&)), this, SLOT(slotNsURIChanged(const QString&)) );
+ connect( m_pEditName, SIGNAL(textChanged(const QString&)), this, SLOT(slotNameChanged(const QString&)) );
+}
+
+void KXEElementDialog::clearDialog()
+{
+ m_pEditNsURI->clear();
+ m_pEditNsURI->setEnabled(true);
+ m_pEditNsURI->show();
+ m_pLblNsURI->setEnabled(true);
+ m_pLblNsURI->show();
+
+ m_pEditPrefix->clear();
+ m_pEditPrefix->setDisabled(true);
+ m_pEditPrefix->show();
+ m_pLblPrefix->setEnabled(true);
+ m_pLblPrefix->show();
+
+ m_pEditName->clear();
+
+ m_pComboInsert->setCurrentItem(0);
+}
+
+void KXEElementDialog::fillDialog( bool bNsURIIsNull )
+{
+ m_pEditNsURI->setDisabled(true);
+
+ if ( bNsURIIsNull )
+ {
+ m_pEditNsURI->hide();
+ m_pLblNsURI->hide();
+ m_pLblNsURI->setDisabled(true);
+
+ m_pEditPrefix->setDisabled(true);
+ m_pEditPrefix->hide();
+ m_pLblPrefix->hide();
+ m_pLblPrefix->setDisabled(true);
+ }
+ else
+ {
+ m_pEditNsURI->setText( m_strNsURI );
+ m_pEditNsURI->show();
+ m_pLblNsURI->show();
+ m_pLblNsURI->setEnabled(true);
+
+ m_pEditPrefix->setText( m_strPrefix );
+ m_pEditPrefix->setEnabled(true);
+ m_pEditPrefix->show();
+ m_pLblPrefix->show();
+ m_pLblPrefix->setEnabled(true);
+ }
+
+ m_pComboInsert->hide();
+ m_pComboInsert->setDisabled(true);
+ m_pLblInsert->hide();
+ m_pLblInsert->setDisabled(true);
+
+ m_pEditName->setText( m_strName );
+}
+
+int KXEElementDialog::exec( bool bEditExisting, bool bRootElement, bool bNsURIIsNull )
+{
+ if(bEditExisting)
+ {
+ fillDialog( bNsURIIsNull );
+ }
+ else
+ {
+ if( bRootElement )
+ {
+ m_pComboInsert->hide();
+ m_pComboInsert->setDisabled(true);
+ m_pLblInsert->hide();
+ m_pLblInsert->setDisabled(true);
+ }
+
+ clearDialog();
+ }
+
+ int iReturn = exec();
+ if ( iReturn == Accepted )
+ {
+ m_strNsURI = m_pEditNsURI->text();
+ m_strPrefix = m_pEditPrefix->text();
+ m_strName = m_pEditName->text();
+
+ m_bAtTop = ( m_pComboInsert->currentItem() == 0 );
+ }
+
+ return iReturn;
+}
+
+int KXEElementDialog::exec()
+{
+ if ( m_pEditName->text().isEmpty() )
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+
+ m_pEditName->setFocus();
+ m_pBtnOK->setDefault(true);
+
+ return KXEElementDialogBase::exec();
+}
+
+void KXEElementDialog::slotNsURIChanged( const QString & strNewNsURI )
+{
+ if ( strNewNsURI.isEmpty() )
+ m_pEditPrefix->setEnabled(false);
+ else
+ m_pEditPrefix->setEnabled(true);
+}
+
+void KXEElementDialog::slotNameChanged( const QString & strNewName )
+{
+ QString strMessage = checkName(strNewName);
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( strNewName.isEmpty() || (strMessage.length() > 0))
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+// Check, if XML element name is OK
+QString KXEElementDialog::checkName(const QString strElementName)
+{
+ if(strElementName.length() == 0)
+ return "";
+
+ // test for space
+ if(strElementName.find(' ') >= 0)
+ return i18n("Element name cannot contain space !");
+
+ // test for xml, XML ... on start
+ if(strElementName.find("xml", 0, false) == 0)
+ return i18n("Element name cannot start with 'xml' or 'XML' !");
+
+ // check first character
+ QChar firstChar(strElementName[0]);
+ if((firstChar != '_') && !firstChar.isLetter())
+ {
+ return i18n("Element name must start with an underscore or a letter !");
+ }
+
+ // Forbidden characters
+ QString strForbiddenChars("&@#$%^()%+?=:<>;\"'*");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strElementName.find(ch) >= 0)
+ return i18n("Element name cannot contain character: %1 !").arg(ch);
+ }
+
+ return "";
+}
+
diff --git a/part/kxeelementdialog.h b/part/kxeelementdialog.h
new file mode 100644
index 0000000..8012525
--- /dev/null
+++ b/part/kxeelementdialog.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+ kxeelementdialog.h - description
+ ------------------
+ begin : Mit Apr 17 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXEELEMENTDIALOG_H
+#define KXEELEMENTDIALOG_H
+
+#include "kxeelementdialogbase.h"
+
+class KXEElementDialog : public KXEElementDialogBase
+{
+ Q_OBJECT
+
+ public:
+ KXEElementDialog( QWidget * pParent = 0, const char * pszName = 0, bool fModal = true, WFlags fl = 0 );
+
+ public:
+
+ const QString nsURI() const { return m_strNsURI; }
+ const QString prefix() const { return m_strPrefix; }
+ const QString name() const { return m_strName; }
+ const bool atTop() const { return m_bAtTop; }
+
+ void setNsURI(const QString strNsURI) { m_strNsURI = strNsURI; }
+ void setPrefix(const QString strPrefix) { m_strPrefix = strPrefix; }
+ void setName(const QString strName) { m_strName = strName; }
+
+ /**
+ * To be used for creating a new XML element
+ *
+ * @return see @ref QDialog::exec
+ */
+ int exec( bool, bool, bool );
+
+ // check element name
+ static QString checkName(const QString);
+
+ protected:
+ /**
+ * Clears the dialogs widgets (removes their content).
+ */
+
+ void clearDialog();
+
+ /**
+ * Fills the dialogs widgets with the data members.
+ */
+ void fillDialog( bool );
+
+ /**
+ * Don't use this function directly, it's for internal use only.
+ * Use one of the other @ref DlgXMLElement::exec functions instead.
+ */
+ int exec();
+ /**
+ * Called, when the namespace URI in the edit line @ref DlgXMLElementBase::m_pEditNsURI
+ * is changed.
+ * Disables the prefix edit line (@ref DlgXMLElementBase::m_pEditPrefix),
+ * if the given string is empty.
+ */
+
+
+ protected slots:
+ void slotNsURIChanged( const QString & szNewNsURI );
+ /**
+ * Called, when the name in the edit line @ref DlgXMLElementBase::m_pEditName
+ * is changed.
+ * Disables the OK button, if the given string is empty.
+ */
+ void slotNameChanged( const QString & szNewName );
+
+protected:
+ QString m_strNsURI;
+ QString m_strPrefix;
+ QString m_strName;
+ bool m_bAtTop;
+};
+
+#endif
diff --git a/part/kxeelementdialogbase.ui b/part/kxeelementdialogbase.ui
new file mode 100644
index 0000000..0cf8cac
--- /dev/null
+++ b/part/kxeelementdialogbase.ui
@@ -0,0 +1,339 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEElementDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXEElementDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>344</width>
+ <height>321</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>XML Element</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>37</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pLblPrefix</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Prefix:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditPrefix</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Prefix&lt;/b&gt;
+&lt;br/&gt;
+You can enter the namespace prefix for this XML element here.</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>37</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>Spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>37</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>m_pEditNsURI</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Namespace URI&lt;/b&gt;&lt;br/&gt;
+You can enter the namespace URI of this XML element here.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="5" column="0">
+ <property name="name">
+ <cstring>m_pEditName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Local Name&lt;/b&gt;
+&lt;br/&gt;
+You have to enter this XML elements name here.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="3" column="0">
+ <property name="name">
+ <cstring>m_pEditPrefix</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Prefix&lt;/b&gt;
+&lt;br/&gt;
+You can enter the namespace prefix for this XML element here.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pLblTagName</cstring>
+ </property>
+ <property name="text">
+ <string>Local &amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Local Name&lt;/b&gt;
+&lt;br/&gt;
+You have to enter this XML elements name here.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pLblNsURI</cstring>
+ </property>
+ <property name="text">
+ <string>Namespace &amp;URI:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditNsURI</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Namespace URI&lt;/b&gt;&lt;br/&gt;
+You can enter the namespace URI of this XML element here.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="8" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnOK</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string>Alt+C</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="7" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pComboInsert</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Insert&lt;/b&gt;
+&lt;br/&gt;
+Choose, where to place this XML element in the parent elements list of childelements.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>at bottom</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>at top</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_pComboInsert</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Insert&lt;/b&gt;
+&lt;br/&gt;
+Choose, where to place this XML element in the parent elements list of childelements.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>181</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="6" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pTextLabelMessage</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pBtnOK</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEElementDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_pBtnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEElementDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pEditName</tabstop>
+ <tabstop>m_pComboInsert</tabstop>
+ <tabstop>m_pBtnOK</tabstop>
+ <tabstop>m_pBtnCancel</tabstop>
+ <tabstop>m_pEditNsURI</tabstop>
+ <tabstop>m_pEditPrefix</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxefilenewdialog.cpp b/part/kxefilenewdialog.cpp
new file mode 100644
index 0000000..807f477
--- /dev/null
+++ b/part/kxefilenewdialog.cpp
@@ -0,0 +1,29 @@
+//
+// C++ Implementation: kxefilenewdialog
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#include "kxefilenewdialog.h"
+
+#include <qcheckbox.h>
+#include <qframe.h>
+
+KXEFileNewDialog::KXEFileNewDialog(QWidget* parent, const char* name)
+ : KXESpecProcInstrDialog(parent, name)
+{
+ m_pDontShowAgain->show();
+ m_pHLine->show();
+}
+
+
+KXEFileNewDialog::~KXEFileNewDialog()
+{
+}
+
+
diff --git a/part/kxefilenewdialog.h b/part/kxefilenewdialog.h
new file mode 100644
index 0000000..20b3f1b
--- /dev/null
+++ b/part/kxefilenewdialog.h
@@ -0,0 +1,31 @@
+//
+// C++ Interface: kxefilenewdialog
+//
+// Description:
+//
+//
+// Author: Adam Charytoniuk <achary@poczta.onet.pl>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef DLGFILENEW_H
+#define DLGFILENEW_H
+
+#include "kxespecprocinstrdialog.h"
+
+/**
+Dialog for File->New assistance.
+
+@author Adam Charytoniuk
+*/
+class KXEFileNewDialog : public KXESpecProcInstrDialog
+{
+public:
+ KXEFileNewDialog(QWidget* parent, const char* name=0);
+
+ ~KXEFileNewDialog();
+
+};
+
+#endif
diff --git a/part/kxenewfilesettings.cpp b/part/kxenewfilesettings.cpp
new file mode 100644
index 0000000..fcd4562
--- /dev/null
+++ b/part/kxenewfilesettings.cpp
@@ -0,0 +1,207 @@
+/***************************************************************************
+ kxenewfilesettings.cpp
+ ----------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxenewfilesettings.h"
+#include "kxenewfilesettingspage.h"
+
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdebug.h>
+
+#include <qframe.h>
+#include <qlineedit.h>
+#include <qcombobox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+
+#define CONF_ENTRY_NAME_DFLT_VERSION "Default version"
+#define DFLT_VALUE_DFLT_VERSION "1.0"
+
+#define CONF_ENTRY_NAME_DFLT_ENCODING "Default encoding"
+#define DFLT_VALUE_DFLT_ENCODING "UTF-8"
+
+#define CONF_ENTRY_NAME_DFLT_NEWFILE_CREAT_BEHAVIOUR "Default behaviour"
+#define DFLT_VALUE_NEWFILE_CREAT_BEHAVIOUR UseDefaults
+
+
+KXENewFileSettings::KXENewFileSettings( QObject * pParent, const char * pszName )
+ : KXESettings( "New File Settings", pParent, pszName ),
+ m_strDfltVersion( DFLT_VALUE_DFLT_VERSION ),
+ m_strDfltEncoding( DFLT_VALUE_DFLT_ENCODING ),
+ m_enmNewFileCreaBehav( DFLT_VALUE_NEWFILE_CREAT_BEHAVIOUR ),
+ m_pDialogPage(0)
+{
+}
+
+
+void KXENewFileSettings::write( KConfig * pConfig ) const
+{
+ pConfig->writeEntry( CONF_ENTRY_NAME_DFLT_VERSION, m_strDfltVersion );
+ pConfig->writeEntry( CONF_ENTRY_NAME_DFLT_ENCODING, m_strDfltEncoding );
+ pConfig->writeEntry( CONF_ENTRY_NAME_DFLT_NEWFILE_CREAT_BEHAVIOUR, m_enmNewFileCreaBehav );
+}
+
+
+void KXENewFileSettings::read( const KConfig * pConfig )
+{
+ m_strDfltVersion = pConfig->readEntry( CONF_ENTRY_NAME_DFLT_VERSION, DFLT_VALUE_DFLT_VERSION );
+ m_strDfltEncoding = pConfig->readEntry( CONF_ENTRY_NAME_DFLT_ENCODING, DFLT_VALUE_DFLT_ENCODING );
+ m_enmNewFileCreaBehav = static_cast<NewFileCreationBehaviour> ( pConfig->readNumEntry( CONF_ENTRY_NAME_DFLT_NEWFILE_CREAT_BEHAVIOUR, DFLT_VALUE_NEWFILE_CREAT_BEHAVIOUR ) );
+}
+
+
+QString KXENewFileSettings::dialogPageName() const
+{
+ return i18n( "New Files" );
+}
+
+QString KXENewFileSettings::dialogPageHeader() const
+{
+ return i18n( "New File Settings" );
+}
+
+QString KXENewFileSettings::dialogPageIcon() const
+{
+ return "files";
+}
+
+
+QWidget * KXENewFileSettings::dialogPage( QFrame * pParent )
+{
+
+ if ( ! m_pDialogPage )
+ {
+ // create the page if necessary
+ m_pDialogPage = new KXENewFileSettingsPage( pParent, "new files config.dialog page" );
+
+ // and fill its widgets with the corresponding values
+ m_pDialogPage->m_pDfltEncoding->insertStringList( encodings() );
+ updatePage();
+
+ connect( m_pDialogPage->m_pDfltVersion, SIGNAL(textChanged(const QString&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pDfltEncoding, SIGNAL(activated(int)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pNewFileCreatBehav1, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pNewFileCreatBehav2, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pNewFileCreatBehav3, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ }
+
+ return m_pDialogPage;
+}
+
+void KXENewFileSettings::setFromPage()
+{
+ if ( m_pDialogPage )
+ {
+ m_strDfltVersion = m_pDialogPage->m_pDfltVersion->text();
+ m_strDfltEncoding = m_pDialogPage->m_pDfltEncoding->currentText();
+
+ if ( m_pDialogPage->m_pNewFileCreatBehav1->isChecked() )
+ m_enmNewFileCreaBehav = CreateEmptyFile;
+ else if ( m_pDialogPage->m_pNewFileCreatBehav2->isChecked() )
+ m_enmNewFileCreaBehav = CreateWithAssistance;
+ else if ( m_pDialogPage->m_pNewFileCreatBehav3->isChecked() )
+ m_enmNewFileCreaBehav = UseDefaults;
+ }
+}
+
+void KXENewFileSettings::updatePage() const
+{
+ if ( m_pDialogPage )
+ {
+ m_pDialogPage->m_pDfltVersion->setText( m_strDfltVersion );
+ m_pDialogPage->m_pDfltEncoding->setCurrentText( m_strDfltEncoding );
+
+ switch ( m_enmNewFileCreaBehav )
+ {
+ case CreateEmptyFile:
+ m_pDialogPage->m_pNewFileCreatBehav->setButton( m_pDialogPage->m_pNewFileCreatBehav->id( m_pDialogPage->m_pNewFileCreatBehav1 ) );
+ break;
+ case CreateWithAssistance:
+ m_pDialogPage->m_pNewFileCreatBehav->setButton( m_pDialogPage->m_pNewFileCreatBehav->id( m_pDialogPage->m_pNewFileCreatBehav2 ) );
+ break;
+ case UseDefaults:
+ m_pDialogPage->m_pNewFileCreatBehav->setButton( m_pDialogPage->m_pNewFileCreatBehav->id( m_pDialogPage->m_pNewFileCreatBehav3 ) );
+ break;
+ default:
+ kdError() << "KXENewFileSettings::updatePage: unknown creation behavior" << endl;
+ }
+ }
+}
+
+QStringList KXENewFileSettings::encodings()
+{
+ static QStringList lstEncs;
+ if ( lstEncs.empty() )
+ {
+ lstEncs.append("UTF-8");
+ lstEncs.append("ISO-8859-1");
+ lstEncs.append("ISO-8859-2");
+ lstEncs.append("ISO-8859-3");
+ lstEncs.append("ISO-8859-4");
+ lstEncs.append("ISO-8859-5");
+ lstEncs.append("ISO-8859-6");
+ lstEncs.append("ISO-8859-7");
+ lstEncs.append("ISO-8859-8");
+ lstEncs.append("ISO-8859-9");
+ }
+ return lstEncs;
+}
+
+
+/////////////////////////////////////////////////
+// function(s) to set this settings group data //
+/////////////////////////////////////////////////
+
+void KXENewFileSettings::setNewFileCreaBehav( NewFileCreationBehaviour enmNewFileCreaBehav, KConfig * pConfig )
+{
+ // if the data really has been changed
+ if ( m_enmNewFileCreaBehav != enmNewFileCreaBehav )
+ {
+ // set this object's data to the new one given
+ m_enmNewFileCreaBehav = enmNewFileCreaBehav;
+
+ // update the corresponding widget in the config.dialog page, if necessary
+ if ( m_pDialogPage )
+ {
+ blockSignals( true );
+
+ switch ( enmNewFileCreaBehav )
+ {
+ case CreateEmptyFile:
+ m_pDialogPage->m_pNewFileCreatBehav->setButton( m_pDialogPage->m_pNewFileCreatBehav->id( m_pDialogPage->m_pNewFileCreatBehav1 ) );
+ break;
+ case CreateWithAssistance:
+ m_pDialogPage->m_pNewFileCreatBehav->setButton( m_pDialogPage->m_pNewFileCreatBehav->id( m_pDialogPage->m_pNewFileCreatBehav2 ) );
+ break;
+ case UseDefaults:
+ m_pDialogPage->m_pNewFileCreatBehav->setButton( m_pDialogPage->m_pNewFileCreatBehav->id( m_pDialogPage->m_pNewFileCreatBehav3 ) );
+ break;
+ default:
+ kdError() << "KXENewFileSettings::dialogPage: unknown creation behavior" << endl;
+ }
+
+ blockSignals( false );
+ }
+
+ // store the new data (only the given one) to the given config file
+ setConfigGroup( pConfig );
+ pConfig->writeEntry( CONF_ENTRY_NAME_DFLT_NEWFILE_CREAT_BEHAVIOUR, m_enmNewFileCreaBehav );
+
+ // and inform everyone about the changing of our data
+ emit sigChanged();
+ }
+}
diff --git a/part/kxenewfilesettings.h b/part/kxenewfilesettings.h
new file mode 100644
index 0000000..b1203ec
--- /dev/null
+++ b/part/kxenewfilesettings.h
@@ -0,0 +1,111 @@
+/***************************************************************************
+ kxenewfilesettings.h
+ --------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXENEWFILESETTINGS_H
+#define KXENEWFILESETTINGS_H
+
+#include "kxesettings.h"
+
+class KXENewFileSettingsPage;
+
+/**
+ * This class represents the group of configuration settings for
+ * new files.
+ *
+ * @author Olaf Hartig
+ */
+class KXENewFileSettings : public KXESettings
+{
+ public:
+
+ enum NewFileCreationBehaviour
+ {
+ CreateEmptyFile,
+ CreateWithAssistance,
+ UseDefaults
+ };
+
+ KXENewFileSettings( QObject * pParent = 0, const char * pszName = 0 );
+
+ // The following functions can be used to access this object's settings.
+ QString dfltVersion() const { return m_strDfltVersion; }
+ QString dfltEncoding() const { return m_strDfltEncoding; }
+ NewFileCreationBehaviour newFileCreaBehav() const { return m_enmNewFileCreaBehav; }
+
+ /**
+ * Returns a list of all possible encodings.
+ */
+ static QStringList encodings();
+
+ /**
+ * Sets this object's new file creation behavior to the given one,
+ * updates the corresponding widget (in the config.dialog page
+ * @ref m_pDialogPage), stores this value to the given config.file
+ * and emits the signal @ref KXESettings::sigChanged.
+ */
+ void setNewFileCreaBehav( NewFileCreationBehaviour, KConfig * );
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageName() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageHeader() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageIcon() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QWidget * dialogPage( QFrame * pParent );
+
+ protected:
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void write( KConfig * ) const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void read( const KConfig * );
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void setFromPage();
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void updatePage() const;
+
+ // the settings itself
+ QString m_strDfltVersion;
+ QString m_strDfltEncoding;
+ NewFileCreationBehaviour m_enmNewFileCreaBehav;
+
+ /**
+ * the corresponding configuration dialog page
+ * It is created on demand by @ref dialogPage.
+ */
+ KXENewFileSettingsPage * m_pDialogPage;
+
+};
+
+#endif
diff --git a/part/kxenewfilesettingspage.ui b/part/kxenewfilesettingspage.ui
new file mode 100644
index 0000000..bf766e8
--- /dev/null
+++ b/part/kxenewfilesettingspage.ui
@@ -0,0 +1,176 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXENewFileSettingsPage</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KXENewFileSettingsPage</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>288</width>
+ <height>197</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>New File Settings Page</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblDfltVersion</cstring>
+ </property>
+ <property name="text">
+ <string>XML &amp;version:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pDfltVersion</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;XML version&lt;/b&gt;
+&lt;br&gt;
+You can determine the default XML version for XML documents being created. This version is the default setting in wizard dialogs.&lt;br&gt;
+Since there's only one XML version yet, you shouldn't change this value.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>m_pDfltVersion</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;XML version&lt;/b&gt;
+&lt;br&gt;
+You can determine the default XML version for XML documents being created. This version is the default setting in wizard dialogs.&lt;br&gt;
+Since there's only one XML version yet, you shouldn't change this value.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblDfltEncoding</cstring>
+ </property>
+ <property name="text">
+ <string>Default &amp;encoding:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pDfltEncoding</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Default encoding&lt;/b&gt;
+&lt;br&gt;
+You can determine the default encoding for XML documents being created. This version is the default setting in wizard dialogs.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>m_pDfltEncoding</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Default encoding&lt;/b&gt;
+&lt;br&gt;
+You can determine the default encoding for XML documents being created. This version is the default setting in wizard dialogs.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_pNewFileCreatBehav</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Behavior on creating new files</string>
+ </property>
+ <property name="exclusive">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Behavior on creating new files&lt;/b&gt;
+&lt;br&gt;
+You can determine the behavior on creating new XML documents. Choose one of the following:&lt;br&gt;
+&lt;br&gt;
+&lt;b&gt;&lt;i&gt;Start with new empty file&lt;/i&gt;&lt;/b&gt;&lt;br&gt;
+Creates an empty XML document.&lt;br&gt;
+&lt;br&gt;
+&lt;b&gt;&lt;i&gt;Start with file settings dialog assistance&lt;/i&gt;&lt;/b&gt;&lt;br&gt;
+Opens a dialog to choose the XML version and encoding of the new document.&lt;br&gt;
+&lt;br&gt;
+&lt;b&gt;&lt;i&gt;Start with new file with default settings&lt;/i&gt;&lt;/b&gt;&lt;br&gt;
+Creates an XML document with the default XML version and default encoding selected above.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_pNewFileCreatBehav1</cstring>
+ </property>
+ <property name="text">
+ <string>Start with new empty file</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_pNewFileCreatBehav2</cstring>
+ </property>
+ <property name="text">
+ <string>Start with file settings dialog assistance</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_pNewFileCreatBehav3</cstring>
+ </property>
+ <property name="text">
+ <string>Start with new file with default settings</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxeprintsettings.cpp b/part/kxeprintsettings.cpp
new file mode 100644
index 0000000..765102b
--- /dev/null
+++ b/part/kxeprintsettings.cpp
@@ -0,0 +1,134 @@
+/***************************************************************************
+ kxeprintsettings.cpp
+ --------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxeprintsettings.h"
+#include "kxeprintsettingspage.h"
+
+#include <klocale.h>
+#include <kconfig.h>
+#include <kfontcombo.h>
+
+#include <qframe.h>
+#include <qspinbox.h>
+#include <qcheckbox.h>
+
+#define CONF_ENTRY_NAME_FONTFAMILY "Print font family"
+#define DFLT_VALUE_FONTFAMILY "Courier"
+
+#define CONF_ENTRY_NAME_FONTSIZE "Print font size"
+#define DFLT_VALUE_FONTSIZE 10
+
+#define CONF_ENTRY_NAME_INDENT_STEPS "Print indentation"
+#define DFLT_VALUE_INDENT_STEPS 2
+
+#define CONF_ENTRY_NAME_WITH_FOOTER "Print has footer"
+#define DFLT_VALUE_WITH_FOOTER true
+
+#define CONF_ENTRY_NAME_WITH_HEADER "Print has header"
+#define DFLT_VALUE_WITH_HEADER true
+
+
+KXEPrintSettings::KXEPrintSettings( QObject * pParent, const char * pszName )
+ : KXESettings( "Print Settings", pParent, pszName ),
+ m_strFontFamily( DFLT_VALUE_FONTFAMILY ),
+ m_iFontSize( DFLT_VALUE_FONTSIZE ),
+ m_iIndentSteps( DFLT_VALUE_INDENT_STEPS ),
+ m_bWithHeader( DFLT_VALUE_WITH_FOOTER ),
+ m_bWithFooter( DFLT_VALUE_WITH_HEADER ),
+ m_pDialogPage(0)
+{
+}
+
+
+void KXEPrintSettings::write( KConfig * pConfig ) const
+{
+ pConfig->writeEntry( CONF_ENTRY_NAME_FONTFAMILY, m_strFontFamily );
+ pConfig->writeEntry( CONF_ENTRY_NAME_FONTSIZE, m_iFontSize );
+ pConfig->writeEntry( CONF_ENTRY_NAME_INDENT_STEPS, m_iIndentSteps );
+ pConfig->writeEntry( CONF_ENTRY_NAME_WITH_FOOTER, m_bWithHeader );
+ pConfig->writeEntry( CONF_ENTRY_NAME_WITH_HEADER, m_bWithFooter );
+}
+
+
+void KXEPrintSettings::read( const KConfig * pConfig )
+{
+ m_strFontFamily = pConfig->readEntry( CONF_ENTRY_NAME_FONTFAMILY, DFLT_VALUE_FONTFAMILY );
+ m_iFontSize = pConfig->readNumEntry( CONF_ENTRY_NAME_FONTSIZE, DFLT_VALUE_FONTSIZE );
+ m_iIndentSteps = pConfig->readNumEntry( CONF_ENTRY_NAME_INDENT_STEPS, DFLT_VALUE_INDENT_STEPS );
+ m_bWithHeader = pConfig->readBoolEntry( CONF_ENTRY_NAME_WITH_FOOTER, DFLT_VALUE_WITH_FOOTER );
+ m_bWithFooter = pConfig->readBoolEntry( CONF_ENTRY_NAME_WITH_HEADER, DFLT_VALUE_WITH_HEADER );
+}
+
+QString KXEPrintSettings::dialogPageName() const
+{
+ return i18n( "Printing" );
+}
+
+QString KXEPrintSettings::dialogPageHeader() const
+{
+ return i18n( "Print Settings" );
+}
+
+QString KXEPrintSettings::dialogPageIcon() const
+{
+ return "printer2";
+}
+
+QWidget * KXEPrintSettings::dialogPage( QFrame * pParent )
+{
+ if ( ! m_pDialogPage )
+ {
+ // create the page if necessary
+ m_pDialogPage = new KXEPrintSettingsPage( pParent, "printing config.dialog page" );
+
+ // and fill its widgets with the corresponding values
+ updatePage();
+
+ connect( m_pDialogPage->m_pFontFamily, SIGNAL(activated(int)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pFontSize, SIGNAL(valueChanged(int)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pIndentSteps, SIGNAL(valueChanged(int)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pWithHeader, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pWithFooter, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ }
+
+ return m_pDialogPage;
+}
+
+
+void KXEPrintSettings::setFromPage()
+{
+ if ( m_pDialogPage )
+ {
+ m_strFontFamily = m_pDialogPage->m_pFontFamily->currentText();
+ m_iFontSize = m_pDialogPage->m_pFontSize->value();
+ m_iIndentSteps = m_pDialogPage->m_pIndentSteps->value();
+ m_bWithHeader = m_pDialogPage->m_pWithHeader->isChecked();
+ m_bWithFooter = m_pDialogPage->m_pWithFooter->isChecked();
+ }
+}
+
+void KXEPrintSettings::updatePage() const
+{
+ if ( m_pDialogPage )
+ {
+ m_pDialogPage->m_pFontFamily->setCurrentFont( m_strFontFamily );
+ m_pDialogPage->m_pFontSize->setValue( m_iFontSize );
+ m_pDialogPage->m_pIndentSteps->setValue( m_iIndentSteps );
+ m_pDialogPage->m_pWithHeader->setChecked( m_bWithHeader );
+ m_pDialogPage->m_pWithFooter->setChecked( m_bWithFooter );
+ }
+}
diff --git a/part/kxeprintsettings.h b/part/kxeprintsettings.h
new file mode 100644
index 0000000..fb833f6
--- /dev/null
+++ b/part/kxeprintsettings.h
@@ -0,0 +1,95 @@
+/***************************************************************************
+ kxeprintsettings.h
+ ------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXEPRINTSETTINGS_H
+#define KXEPRINTSETTINGS_H
+
+#include "kxesettings.h"
+
+class KXEPrintSettingsPage;
+
+/**
+ * This class represents the group of configuration settings for
+ * printing.
+ *
+ * @author Olaf Hartig
+ */
+class KXEPrintSettings : public KXESettings
+{
+ public:
+
+ KXEPrintSettings( QObject * pParent = 0, const char * pszName = 0 );
+
+ // The following functions can be used to access this object's settings.
+ QString fontFamily() const { return m_strFontFamily; }
+ int fontSize() const { return m_iFontSize; }
+ int indentSteps() const { return m_iIndentSteps; }
+ bool hasHeader() const { return m_bWithHeader; }
+ bool hasFooter() const { return m_bWithFooter; }
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageName() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageHeader() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageIcon() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QWidget * dialogPage( QFrame * pParent );
+
+ protected:
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void write( KConfig * ) const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void read( const KConfig * );
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void setFromPage();
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void updatePage() const;
+
+ // the settings itself
+ QString m_strFontFamily;
+ int m_iFontSize;
+ int m_iIndentSteps;
+ bool m_bWithHeader;
+ bool m_bWithFooter;
+
+ /**
+ * the corresponding configuration dialog page
+ * It is created on demand by @ref dialogPage.
+ */
+ KXEPrintSettingsPage * m_pDialogPage;
+
+};
+
+#endif
diff --git a/part/kxeprintsettingspage.ui b/part/kxeprintsettingspage.ui
new file mode 100644
index 0000000..a857413
--- /dev/null
+++ b/part/kxeprintsettingspage.ui
@@ -0,0 +1,228 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEPrintSettingsPage</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KXEPrintSettingsPage</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>292</width>
+ <height>187</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Print Settings Page</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblFontFamily</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Plain</enum>
+ </property>
+ <property name="text">
+ <string>Font &amp;family:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pFontFamily</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Font family&lt;/b&gt;
+&lt;br&gt;
+Choose the font family you want to be used on printing your XML documents.</string>
+ </property>
+ </widget>
+ <widget class="KFontCombo">
+ <property name="name">
+ <cstring>m_pFontFamily</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Font family&lt;/b&gt;
+&lt;br&gt;
+Choose the font family you want to be used on printing your XML documents.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblFontSize</cstring>
+ </property>
+ <property name="text">
+ <string>Font &amp;size:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pFontSize</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Font size&lt;/b&gt;
+&lt;br&gt;
+Choose the font size you want to be used on printing your XML documents.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>m_pFontSize</cstring>
+ </property>
+ <property name="suffix">
+ <string>pt</string>
+ </property>
+ <property name="specialValueText">
+ <string></string>
+ </property>
+ <property name="minValue">
+ <number>6</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Font size&lt;/b&gt;
+&lt;br&gt;
+Choose the font size you want to be used on printing your XML documents.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblIndentSteps</cstring>
+ </property>
+ <property name="text">
+ <string>Element &amp;indentation:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pIndentSteps</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Element indentation&lt;/b&gt;
+&lt;br&gt;
+Choose the number of characters you want to be used for indenting childnodes on printing you XML documents.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>m_pIndentSteps</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Element indentation&lt;/b&gt;
+&lt;br&gt;
+Choose the number of characters you want to be used for indenting childnodes on printing you XML documents.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>41</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pWithHeader</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Print header</string>
+ </property>
+ <property name="accel">
+ <string>Alt+P</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Print header&lt;/b&gt;
+&lt;br&gt;
+You can determine wether you want a header to be printed on every page when printing you XML documents or not.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pWithFooter</cstring>
+ </property>
+ <property name="text">
+ <string>P&amp;rint footer</string>
+ </property>
+ <property name="accel">
+ <string>Alt+R</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Print footer&lt;/b&gt;
+&lt;br&gt;
+You can determine wether you want a footline to be printed on every page when printing you XML documents or not.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kfontcombo.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/part/kxeprocinstrdialog.cpp b/part/kxeprocinstrdialog.cpp
new file mode 100644
index 0000000..7ddbf21
--- /dev/null
+++ b/part/kxeprocinstrdialog.cpp
@@ -0,0 +1,183 @@
+/***************************************************************************
+ kxeprocinstrdialog.cpp - description
+ -------------------
+ begin : Mit Apr 24 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxeprocinstrdialog.h"
+
+#include <qlabel.h>
+#include <qcombobox.h>
+#include <qpushbutton.h>
+#include <qtextedit.h>
+
+#include <klineedit.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+KXEProcInstrDialog::KXEProcInstrDialog( QWidget * pParent, const char * pszName, bool fModal, WFlags fl )
+ : KXEProcInstrDialogBase( pParent, pszName, fModal, fl )
+{
+ // signals and slots connections
+ connect( m_pBtnOK, SIGNAL( clicked() ), this, SLOT( slotAccept() ) );
+ connect( m_pEditData, SIGNAL(textChanged()), this, SLOT(slotDataChanged()) );
+ connect( m_pEditTarget, SIGNAL(textChanged(const QString &)), this, SLOT(slotTargetChanged(const QString &)) );
+}
+
+
+void KXEProcInstrDialog::clearDialog()
+{
+ m_pEditTarget->clear();
+ m_pEditData->clear();
+}
+
+
+int KXEProcInstrDialog::exec( bool bEditExisting, bool bParentIsDocument )
+{
+ if(bEditExisting)
+ {
+ m_pComboInsert->hide();
+ m_pComboInsert->setDisabled(true);
+ m_pLblInsert->hide();
+ m_pLblInsert->setDisabled(true);
+
+ m_pEditTarget->setDisabled(true);
+
+ m_pEditTarget->setText( m_strTarget );
+ m_pEditData->setText( m_strData );
+ }
+ else
+ {
+ if ( bParentIsDocument )
+ {
+ m_pComboInsert->hide();
+ m_pComboInsert->setDisabled(true);
+ m_pLblInsert->hide();
+ m_pLblInsert->setDisabled(true);
+ }
+ m_pEditTarget->setEnabled(true);
+ clearDialog();
+ }
+
+ int iReturn = exec();
+ if ( iReturn == Accepted )
+ {
+ m_bAtTop = ( m_pComboInsert->currentItem() == 0 );
+ m_strTarget = m_pEditTarget->text();
+ m_strData = m_pEditData->text();
+ }
+
+ return iReturn;
+}
+
+int KXEProcInstrDialog::exec()
+{
+ if ( m_pEditTarget->text().isEmpty() )
+ m_pBtnOK->setEnabled(false);
+ else
+ m_pBtnOK->setEnabled(true);
+
+ if ( m_pEditTarget->isEnabled() )
+ m_pEditTarget->setFocus();
+ else
+ m_pEditData->setFocus();
+
+ m_pBtnOK->setDefault(true);
+
+ return KXEProcInstrDialogBase::exec();
+}
+
+void KXEProcInstrDialog::slotDataChanged()
+{
+ QString strMessage = checkData(m_pEditData->text());
+ if(strMessage.isEmpty())
+ strMessage = checkTarget(m_pEditTarget->text());
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( m_pEditData->text().isEmpty() ||
+ m_pEditTarget->text().isEmpty() ||
+ (strMessage.length() > 0)
+ )
+ m_pBtnOK->setDisabled(true);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+void KXEProcInstrDialog::slotTargetChanged(const QString &strNewTarget)
+{
+ QString strMessage = checkTarget(strNewTarget);
+ if(strMessage.isEmpty())
+ strMessage = checkData(m_pEditData->text());
+
+ m_pTextLabelMessage->setText(strMessage);
+
+ if ( m_pEditData->text().isEmpty() ||
+ strNewTarget.isEmpty() ||
+ (strMessage.length() > 0)
+ )
+ m_pBtnOK->setDisabled(true);
+ else
+ m_pBtnOK->setEnabled(true);
+}
+
+/** Called when user press OK button */
+void KXEProcInstrDialog::slotAccept()
+{
+ if(m_pEditTarget->text() == "xml")
+ { KMessageBox::sorry(this, i18n("Pleasse use menu item File -> Version and encoding for this processing instruction !"));
+ return;
+ }
+
+ accept();
+}
+
+// Check, if XML proc. instr. target is OK
+QString KXEProcInstrDialog::checkTarget(const QString strTarget)
+{
+ if(strTarget.length() == 0)
+ return "";
+
+ // Forbidden characters
+ QString strForbiddenChars("<>");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strTarget.find(ch) >= 0)
+ return i18n("Target cannot contain character: %1 !").arg(ch);
+ }
+
+ return "";
+}
+
+// Check, if XML proc. instr. data is OK
+QString KXEProcInstrDialog::checkData(const QString strData)
+{
+ if(strData.length() == 0)
+ return "";
+
+ // Forbidden characters
+ QString strForbiddenChars("<>");
+ for(unsigned int i = 0; i < strForbiddenChars.length(); i++)
+ {
+ QChar ch = strForbiddenChars[i];
+
+ if(strData.find(ch) >= 0)
+ return i18n("Contents cannot contain character: %1 !").arg(ch);
+ }
+
+ return "";
+}
diff --git a/part/kxeprocinstrdialog.h b/part/kxeprocinstrdialog.h
new file mode 100644
index 0000000..5b4de2e
--- /dev/null
+++ b/part/kxeprocinstrdialog.h
@@ -0,0 +1,87 @@
+/***************************************************************************
+ kxeprocinstrdialog.h - description
+ --------------------
+ begin : Mit Apr 24 2002
+ copyright : (C) 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXEPROCINSTRDIALOG_H
+#define KXEPROCINSTRDIALOG_H
+
+#include "kxeprocinstrdialogbase.h"
+
+class KXEProcInstrDialog : public KXEProcInstrDialogBase
+{
+ Q_OBJECT
+
+ public:
+ KXEProcInstrDialog( QWidget * pParent = 0, const char * pszName = 0, bool fModal = true, WFlags fl = 0 );
+
+ const bool atTop() const { return m_bAtTop; }
+ const QString target() const { return m_strTarget; }
+ const QString data() const { return m_strData; }
+
+ void setTarget(const QString strTarget) { m_strTarget = strTarget; }
+ void setData(const QString strData) { m_strData = strData; }
+
+ public:
+
+ /**
+ * To be used for inserting a proc.instruction as child
+ * of the given parent node.
+ *
+ * @return see @ref QDialog::exec
+ */
+ int exec( bool, bool );
+
+ /**
+ * Clears the dialogs widgets.
+ */
+ void clearDialog();
+
+ // check target
+ static QString checkTarget(const QString);
+
+ // check data
+ static QString checkData(const QString);
+
+ protected:
+ /**
+ * Don't use this function directly, it's for internal use only.
+ * Use one of the other @ref KXEProcInstrDialog::exec functions instead.
+ */
+ int exec();
+
+ protected slots:
+ /**
+ * Called, when the data edit box is changed.
+ * Disables the OK button, if the editbox is empty.
+ */
+ void slotDataChanged();
+
+ /**
+ * Called, when the target edit box is changed.
+ * Disables the OK button, if the editbox is empty.
+ */
+ void slotTargetChanged(const QString &);
+
+ /** Called when user press OK button */
+ void slotAccept();
+
+ protected:
+ QString m_strTarget;
+ QString m_strData;
+ bool m_bAtTop;
+};
+
+#endif
diff --git a/part/kxeprocinstrdialogbase.ui b/part/kxeprocinstrdialogbase.ui
new file mode 100644
index 0000000..c77d10b
--- /dev/null
+++ b/part/kxeprocinstrdialogbase.ui
@@ -0,0 +1,223 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXEProcInstrDialogBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXEProcInstrDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>367</width>
+ <height>244</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Processing Instruction</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblTarget</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Target:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditTarget</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Target&lt;/b&gt;&lt;br/&gt;
+Define the target of this processing instruction here.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>m_pEditTarget</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Target&lt;/b&gt;&lt;br/&gt;
+Define the target of this processing instruction here.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>60</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblInsert</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Insert:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pComboInsert</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Insert&lt;/b&gt;
+&lt;br/&gt;
+Choose, where to place this processing instruction in the parent elements list.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>at bottom</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>at top</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_pComboInsert</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Insert&lt;/b&gt;
+&lt;br/&gt;
+Choose, where to place this processing instruction in the parent elements list.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTextEdit" row="1" column="0">
+ <property name="name">
+ <cstring>m_pEditData</cstring>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Here you can enter the data (the instructions) of this XML processing instruction.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>Layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnOK</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string>Alt+C</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_pTextLabelMessage</cstring>
+ </property>
+ <property name="paletteForegroundColor">
+ <color>
+ <red>255</red>
+ <green>0</green>
+ <blue>0</blue>
+ </color>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pBtnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXEProcInstrDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pEditTarget</tabstop>
+ <tabstop>m_pComboInsert</tabstop>
+ <tabstop>m_pEditData</tabstop>
+ <tabstop>m_pBtnOK</tabstop>
+ <tabstop>m_pBtnCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxesearchdialog.cpp b/part/kxesearchdialog.cpp
new file mode 100644
index 0000000..5830e96
--- /dev/null
+++ b/part/kxesearchdialog.cpp
@@ -0,0 +1,56 @@
+/***************************************************************************
+ kxesearchdialog.cpp - description
+ -------------------
+ begin : Tue Jul 10 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxesearchdialog.h"
+
+#include <qpushbutton.h>
+
+KXESearchDialog::KXESearchDialog(QWidget *parent, const char *name, bool modal)
+ : KXESearchDialogBase(parent, name, modal)
+{
+ m_pPushButtonFind->setEnabled(false);
+ m_pEditSearchedString->setFocus();
+ m_pPushButtonFind->setDefault(true);
+}
+
+void KXESearchDialog::slotTextChanged(const QString& string)
+{
+ if ( string.isEmpty() )
+ m_pPushButtonFind->setEnabled(false);
+ else
+ m_pPushButtonFind->setEnabled(true);
+
+ toggleAcceptButton();
+}
+
+void KXESearchDialog::slotFindInChanged()
+{
+ toggleAcceptButton();
+}
+
+void KXESearchDialog::toggleAcceptButton()
+{
+ if ( (m_pCheckBoxElementNames->isChecked()) ||(m_pCheckBoxAttributeNames->isChecked()) || (m_pCheckBoxAttributeValues->isChecked()) || (m_pCheckBoxContents->isChecked()) )
+ {
+ if ( m_pEditSearchedString->text().isEmpty() )
+ m_pPushButtonFind->setEnabled(false);
+ else
+ m_pPushButtonFind->setEnabled(true);
+ }
+ else
+ m_pPushButtonFind->setEnabled(false);
+}
diff --git a/part/kxesearchdialog.h b/part/kxesearchdialog.h
new file mode 100644
index 0000000..abe7f3d
--- /dev/null
+++ b/part/kxesearchdialog.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ kxesearchdialog.h - description
+ -----------------
+ begin : Tue Jul 10 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXESEARCHDIALOG_H
+#define KXESEARCHDIALOG_H
+
+#include "kxesearchdialogbase.h"
+
+#include <qlineedit.h>
+#include <qcheckbox.h>
+
+/**
+ * Dialog for input information from user
+ * about searching in XML document
+ */
+// TODO add possibility to search backwards
+class KXESearchDialog : public KXESearchDialogBase
+{
+ Q_OBJECT
+
+ public:
+ KXESearchDialog( QWidget * pParent, const char * pszName = 0, bool bModal = true );
+
+ QString getSearchString() const { return m_pEditSearchedString->text(); }
+ bool getMatchCase() const { return m_pCheckBoxMatchCase->isChecked(); }
+ bool getInElementNames() const { return m_pCheckBoxElementNames->isChecked(); }
+ bool getInAttributeNames() const { return m_pCheckBoxAttributeNames->isChecked(); }
+ bool getInAttributeValues() const { return m_pCheckBoxAttributeValues->isChecked(); }
+ bool getInContents() const { return m_pCheckBoxContents->isChecked(); }
+
+ protected:
+ /** Enables/Disables the "Find"-button. */
+ void toggleAcceptButton();
+
+ protected slots:
+ /** Called when text in edit line is changed */
+ virtual void slotTextChanged(const QString & );
+
+ /** Called on a change of the "find in" checkbuttons. */
+ virtual void slotFindInChanged();
+};
+
+#endif
diff --git a/part/kxesearchdialogbase.ui b/part/kxesearchdialogbase.ui
new file mode 100644
index 0000000..23be699
--- /dev/null
+++ b/part/kxesearchdialogbase.ui
@@ -0,0 +1,350 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXESearchDialogBase</class>
+<comment>Dialog for input information from user
+about searching in XML document</comment>
+<author>Lumir Vanek</author>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXESearchDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>354</width>
+ <height>244</height>
+ </rect>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>330</width>
+ <height>240</height>
+ </size>
+ </property>
+ <property name="sizeIncrement">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="caption">
+ <string>Search</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>Layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pTextLabelSearchedString</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>MShape</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>MShadow</enum>
+ </property>
+ <property name="text">
+ <string>&amp;Search string:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pEditSearchedString</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Search string&lt;/b&gt;&lt;/br&gt;
+Here you can enter the string you want to search for in your XML document.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>262</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLineEdit" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>m_pEditSearchedString</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Search string&lt;/b&gt;&lt;/br&gt;
+Here you can enter the string you want to search for in your XML document.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout13</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>154</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pPushButtonFind</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Find</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pPushButtonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer9</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>131</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QGroupBox" row="2" column="0" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>m_pGroupBoxSearchIn</cstring>
+ </property>
+ <property name="title">
+ <string>Find &amp;in</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Find in&lt;/b&gt;
+&lt;br/&gt;
+Here you can choose the parts of your XML document that should be inspected during the search.
+&lt;br/&gt;
+These are
+&lt;br/&gt;
+&lt;br/&gt;
+&lt;b&gt;&lt;i&gt;Element names&lt;/i&gt;&lt;/b&gt;&lt;br/&gt;
+&lt;b&gt;&lt;i&gt;Attribute names&lt;/i&gt;&lt;/b&gt;&lt;br/&gt;
+&lt;b&gt;&lt;i&gt;Attribute values&lt;/i&gt;&lt;/b&gt;&lt;br/&gt;
+&lt;b&gt;&lt;i&gt;Content&lt;/i&gt;&lt;/b&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pCheckBoxElementNames</cstring>
+ </property>
+ <property name="text">
+ <string>Element names</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pCheckBoxAttributeNames</cstring>
+ </property>
+ <property name="text">
+ <string>Attribute names</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pCheckBoxAttributeValues</cstring>
+ </property>
+ <property name="text">
+ <string>Attribute values</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pCheckBoxContents</cstring>
+ </property>
+ <property name="text">
+ <string>Content</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="1">
+ <property name="name">
+ <cstring>layout23</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer19</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>18</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pCheckBoxMatchCase</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Match case</string>
+ </property>
+ <property name="accel">
+ <string>Alt+M</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Match case&lt;/b&gt;&lt;br/&gt;
+Check this for case sensitive search.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer20</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>19</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pEditSearchedString</sender>
+ <signal>textChanged(const QString&amp;)</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>slotTextChanged(const QString&amp;)</slot>
+ </connection>
+ <connection>
+ <sender>m_pPushButtonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>m_pPushButtonFind</sender>
+ <signal>clicked()</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_pCheckBoxElementNames</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>slotFindInChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_pCheckBoxAttributeNames</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>slotFindInChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_pCheckBoxAttributeValues</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>slotFindInChanged()</slot>
+ </connection>
+ <connection>
+ <sender>m_pCheckBoxContents</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>KXESearchDialogBase</receiver>
+ <slot>slotFindInChanged()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pEditSearchedString</tabstop>
+ <tabstop>m_pCheckBoxElementNames</tabstop>
+ <tabstop>m_pCheckBoxAttributeNames</tabstop>
+ <tabstop>m_pCheckBoxAttributeValues</tabstop>
+ <tabstop>m_pCheckBoxContents</tabstop>
+ <tabstop>m_pCheckBoxMatchCase</tabstop>
+ <tabstop>m_pPushButtonFind</tabstop>
+ <tabstop>m_pPushButtonCancel</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">slotFindInChanged()</slot>
+ <slot access="protected">slotTextChanged(const QString &amp;)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxesettings.cpp b/part/kxesettings.cpp
new file mode 100644
index 0000000..013e73f
--- /dev/null
+++ b/part/kxesettings.cpp
@@ -0,0 +1,67 @@
+/***************************************************************************
+ kxesettings.cpp
+ ---------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxesettings.h"
+
+#include <kconfig.h>
+
+KXESettings::KXESettings( const QString & strConfigGroup, QObject * pParent, const char * pszName )
+ : QObject( pParent, pszName ),
+ m_bPageChanged( false ),
+ m_strConfigGroup( strConfigGroup )
+{
+ connect( this, SIGNAL(sigDialogPageChanged()), this, SLOT(slotDialogPageChanged()) );
+}
+
+void KXESettings::setConfigGroup( KConfig * pConfig ) const
+{
+ pConfig->setGroup( m_strConfigGroup );
+}
+
+void KXESettings::store( KConfig * pConfig ) const
+{
+ setConfigGroup( pConfig );
+ write( pConfig );
+}
+
+void KXESettings::restore( KConfig * pConfig )
+{
+ setConfigGroup( pConfig );
+ read( pConfig );
+
+ // update the corresponding config.dialog page
+ blockSignals( true ); // block this object's signals (especially sigDialogPageChanged)
+ updatePage();
+ blockSignals( false ); // unblock the signals
+
+ emit sigChanged();
+}
+
+void KXESettings::slotDialogPageChanged()
+{
+ m_bPageChanged = true;
+}
+
+void KXESettings::apply()
+{
+ if ( m_bPageChanged )
+ {
+ setFromPage();
+ m_bPageChanged = false;
+ emit sigChanged();
+ }
+}
diff --git a/part/kxesettings.h b/part/kxesettings.h
new file mode 100644
index 0000000..804c63e
--- /dev/null
+++ b/part/kxesettings.h
@@ -0,0 +1,175 @@
+/***************************************************************************
+ kxesettings.h
+ -------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXESETTINGS_H
+#define KXESETTINGS_H
+
+#include <qobject.h>
+
+class KConfig;
+class QFrame;
+
+/**
+ * This is an abstract base class for classes representing a group, that stores
+ * several configuration settings and manages a corresponding page in the
+ * configuration dialog.
+ *
+ * @author Olaf Hartig
+ */
+class KXESettings : public QObject
+{
+ Q_OBJECT
+
+ public:
+
+ /**
+ * the constructor
+ *
+ * @param strConfigGroup the name of the corresponding group in the config file,
+ * it is copied to the member @ref m_strConfigGroup
+ */
+ KXESettings( const QString & strConfigGroup, QObject * pParent = 0, const char * pszName = 0 );
+
+ /**
+ * Stores this settings to the given @ref KConfig object, by doing the
+ * following things:
+ *
+ * - set the config group by calling @ref setConfigGroup
+ * - write the data to the given @ref KConfig object by calling @ref write
+ * (which is implemented in the child class)
+ */
+ void store( KConfig * ) const;
+ /**
+ * Restores the settings from the given @ref KConfig object, by doing
+ * following things:
+ *
+ * - set the config group by calling @ref setConfigGroup
+ * - read the data from the given @ref KConfig object by calling @ref read
+ * (which is implemented in the child class)
+ * - try to update the corresponding config.page by calling @ref updatePage
+ * (implemented in the child class)
+ * - emit the signal sigChanged
+ */
+ void restore( KConfig * );
+ /**
+ * If the data in the corresponding configuration dialog page has been
+ * changed (@ref m_bPageChanged), this data gets applied by the
+ * @ref setFromPage member function implemented in child classes,
+ * the flag @ref m_bPageChanged is reset (to false) and the signal
+ * sigChanged is emitted.
+ */
+ void apply();
+
+ /**
+ * Override this function and return the name of the corresponding
+ * configuration dialog page. This is the name used in the list of
+ * pages in the configuration dialog.
+ * This name has to be internationalized.
+ */
+ virtual QString dialogPageName() const = 0;
+ /**
+ * You can override this function and return a header line to
+ * be used for the corresponding configuration dialog page.
+ * If it's not overridden, the pages name is used (see
+ * @ref dialogPageName)
+ * This string has to be internationalized.
+ */
+ virtual QString dialogPageHeader() const { return QString::null; }
+ /**
+ * Override this function and return the (file-)name of the icon
+ * to be used in the configuration dialog for the corresponding page.
+ */
+ virtual QString dialogPageIcon() const = 0;
+ /**
+ * Override this function to create the corresponding configuration
+ * dialog page with the given parent and return it.
+ * Update the page's widgets (usually by using @ref updatePage).
+ * Connect the signal @ref sigDialogPageChanged to the page's
+ * data changed signal(s).
+ */
+ virtual QWidget * dialogPage( QFrame * pParent ) = 0;
+
+
+ signals:
+
+ /**
+ * This signal is always emitted when the settings change.
+ * It is emitted by @ref restore and @ref apply.
+ */
+ void sigChanged();
+ /**
+ * Emitted, when the data in the corresponding dialog page
+ * has been changed.
+ * Connect this signal to the page's changed signal in your
+ * child class in @ref dialogPage.
+ */
+ void sigDialogPageChanged();
+
+ protected:
+
+ /**
+ * Overide this function and write your settings to the given KConfig object.
+ * You mustn't change the config group.
+ */
+ virtual void write( KConfig * ) const = 0;
+ /**
+ * Overide this function and read the settings from the given KConfig object.
+ * You mustn't change the config group.
+ */
+ virtual void read( const KConfig * ) = 0;
+ /**
+ * Override this function to set this object's data to the data in the
+ * corresponding configuration dialog page, if a page has already been
+ * created (check this!).
+ */
+ virtual void setFromPage() = 0;
+ /**
+ * Override this function to update the widgets in the corresponding
+ * configuration dialog page with the current data (from your child class
+ * object), if a page has already been created (check this!).
+ */
+ virtual void updatePage() const = 0;
+
+ /**
+ * Sets the config group of the given @ref KConfig object to
+ * this setting's config group (@ref m_strConfigGroup).
+ */
+ void setConfigGroup( KConfig * ) const;
+
+ /**
+ * This flag is set to true if the data in the corresponding configuration
+ * dialog's page has been changed but not applied yet.
+ */
+ bool m_bPageChanged;
+
+ protected slots:
+
+ /**
+ * Sets the flag @ref m_bPageChanged to true.
+ */
+ void slotDialogPageChanged();
+
+ private:
+
+ /**
+ * name of the config group for this group of settings
+ */
+ const QString m_strConfigGroup;
+
+};
+
+#endif
diff --git a/part/kxespecprocinstrdialog.cpp b/part/kxespecprocinstrdialog.cpp
new file mode 100644
index 0000000..09f1224
--- /dev/null
+++ b/part/kxespecprocinstrdialog.cpp
@@ -0,0 +1,135 @@
+/***************************************************************************
+ kxespecprocinstrdialog.cpp - description
+ --------------------------
+ begin : Ne ?ec 6 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxespecprocinstrdialog.h"
+
+#include "kxmleditorfactory.h"
+#include "kxeconfiguration.h"
+#include "kxenewfilesettings.h"
+
+#include <qstring.h>
+#include <qcombobox.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qregexp.h>
+#include <qframe.h>
+#include <qcheckbox.h>
+
+#include <kdebug.h>
+
+KXESpecProcInstrDialog::KXESpecProcInstrDialog(QWidget *parent, const char *name )
+ : KXESpecProcInstrDialogBase(parent,name)
+{
+ m_pComboBoxEncoding->insertStringList( KXMLEditorFactory::configuration()->newfile()->encodings() );
+
+ m_pLineEditVersion->setText("1.0");
+
+ m_pHLine->hide();
+ m_pDontShowAgain->hide();
+
+ // signals and slots connections
+ connect( m_pBtnOK, SIGNAL( clicked() ), this, SLOT( slotAccept() ) );
+}
+
+KXESpecProcInstrDialog::~KXESpecProcInstrDialog()
+{
+}
+
+void KXESpecProcInstrDialog::fillDialog( const QString strData )
+{
+ QString strVersion;
+ QString strEncoding;
+
+ int iStart, iEnd;
+
+ // find version info
+ if((iStart = strData.find("version", 0)) >= 0)
+ {
+ // info about encoding found;
+ iStart += 7; // skip version
+
+ // search " or ' after encoding
+ if((iStart = strData.find(QRegExp("[\"']"), iStart)) > 0)
+ {
+ QChar ch = strData[iStart];
+ iStart++; // skip ch
+ if((iEnd = strData.find(ch, iStart)) > 0)
+ strVersion = strData.mid(iStart, iEnd - iStart);
+ }
+ }
+ else
+ strVersion = "1.0";
+
+ // find encoding info
+ if((iStart = strData.find("encoding", 0)) >= 0)
+ {
+ // info about encoding found;
+ iStart += 8; // skip encoding
+
+ // search " or ' after encoding
+ if((iStart = strData.find(QRegExp("[\"']"), iStart)) > 0)
+ {
+ QChar ch = strData[iStart];
+ iStart++; // skip ch
+ if((iEnd = strData.find(ch, iStart)) > 0)
+ strEncoding = strData.mid(iStart, iEnd - iStart);
+ }
+ }
+ else
+ strEncoding = "UTF-8";
+
+
+ m_pLineEditVersion->setText(strVersion);
+ m_pComboBoxEncoding->setCurrentText(strEncoding);
+}
+
+int KXESpecProcInstrDialog::exec()
+{
+ m_pBtnOK->setDefault(true);
+
+ return KXESpecProcInstrDialogBase::exec();
+}
+
+
+/** Called when user press OK button */
+void KXESpecProcInstrDialog::slotAccept()
+{
+ accept();
+}
+
+
+/*!
+ Initializes content of dialog controls with specified values.
+ @param version XML file version
+ @param encoding encoding type for the XML file
+ */
+void KXESpecProcInstrDialog::fillDialog(const QString& version, const QString& encoding)
+{
+
+ m_pLineEditVersion->setText(version);
+ m_pComboBoxEncoding->setCurrentText(encoding);
+}
+
+
+/*!
+ Returns content of the dialog as an string of format: '"version = '...' encoding = '...' ".
+ */
+QString KXESpecProcInstrDialog::getData()
+{
+ return QString("version = '")+m_pLineEditVersion->text()+
+ "' encoding = '"+m_pComboBoxEncoding->currentText()+"' ";
+}
diff --git a/part/kxespecprocinstrdialog.h b/part/kxespecprocinstrdialog.h
new file mode 100644
index 0000000..c78301f
--- /dev/null
+++ b/part/kxespecprocinstrdialog.h
@@ -0,0 +1,54 @@
+/***************************************************************************
+ kxespecprocinstrdialog.h - description
+ ------------------------
+ begin : Ne ?ec 6 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXESPECPROCINSTRDIALOG_H
+#define KXESPECPROCINSTRDIALOG_H
+
+#include "kxespecprocinstrdialogbase.h"
+
+#include <qwidget.h>
+
+/**
+ *@author Lumir Vanek
+ */
+
+class KXESpecProcInstrDialog : public KXESpecProcInstrDialogBase
+{
+ Q_OBJECT
+
+public:
+ KXESpecProcInstrDialog(QWidget *parent=0, const char *name=0);
+ ~KXESpecProcInstrDialog();
+
+ QString getData();
+
+ /** Initialize dialog from given target and data string */
+ void fillDialog(const QString&, const QString&);
+
+ /** Initialize dialog from given data string */
+ void fillDialog(const QString);
+
+ int exec();
+
+protected slots:
+
+ /** Called when user press OK button */
+ void slotAccept();
+
+};
+
+#endif
diff --git a/part/kxespecprocinstrdialogbase.ui b/part/kxespecprocinstrdialogbase.ui
new file mode 100644
index 0000000..1bcbb25
--- /dev/null
+++ b/part/kxespecprocinstrdialogbase.ui
@@ -0,0 +1,191 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXESpecProcInstrDialogBase</class>
+<author>Lumir Vanek</author>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXESpecProcInstrDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>216</width>
+ <height>191</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Special processing instruction</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>11</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_pTextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>XML &amp;version:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pLineEditVersion</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;XML version&lt;/b&gt;&lt;br/&gt;
+You can determine the XML version for XML document.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="0">
+ <property name="name">
+ <cstring>m_pLineEditVersion</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;XML version&lt;/b&gt;&lt;br/&gt;
+You can determine the XML version for XML document.</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_pTextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Encoding:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pComboBoxEncoding</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Encoding&lt;/b&gt;&lt;br/&gt;
+You can determine the encoding used while saving this XML document.</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="3" column="0">
+ <property name="name">
+ <cstring>m_pComboBoxEncoding</cstring>
+ </property>
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Encoding&lt;/b&gt;&lt;br/&gt;
+You can determine the encoding used while saving this XML document.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="4" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pDontShowAgain</cstring>
+ </property>
+ <property name="text">
+ <string>Do not show this dialog again</string>
+ </property>
+ <property name="accel">
+ <string>Ctrl+T</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Do not show this dialog again&lt;/b&gt;&lt;br/&gt;
+If you select this option, your choice will be remembered. Next time you create a new file, you won't be disturbed by this dialog box.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QFrame" row="5" column="0">
+ <property name="name">
+ <cstring>m_pHLine</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="6" column="0">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnOK</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>m_pBtnCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="autoDefault">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pBtnCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXESpecProcInstrDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pLineEditVersion</tabstop>
+ <tabstop>m_pComboBoxEncoding</tabstop>
+ <tabstop>m_pDontShowAgain</tabstop>
+ <tabstop>m_pBtnOK</tabstop>
+ <tabstop>m_pBtnCancel</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxesyntaxhighlighter.cpp b/part/kxesyntaxhighlighter.cpp
new file mode 100644
index 0000000..c783077
--- /dev/null
+++ b/part/kxesyntaxhighlighter.cpp
@@ -0,0 +1,257 @@
+/***************************************************************************
+ kxesyntaxhighlighter.cpp - XML Syntax highlighter
+ -------------------
+ begin : Ne pro 14 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxesyntaxhighlighter.h"
+
+#include <iostream>
+
+#include <qcolor.h>
+#include <qregexp.h>
+#include <qstring.h>
+#include <qstringlist.h>
+
+#include <ktextedit.h>
+
+// Regular expressions for parsing XML borrowed from:
+// http://www.cs.sfu.ca/~cameron/REX.html
+
+KXESyntaxHighlighter::KXESyntaxHighlighter(QTextEdit *textEdit)
+ : QSyntaxHighlighter(textEdit)
+{
+ m_clrDefaultText.setRgb(0, 0, 0);
+ m_clrElementName.setRgb(128, 0, 0);
+ m_clrAttributeName.setRgb(0, 255, 255);
+ m_clrAttributeValue.setRgb(0, 255, 0);
+ m_clrXmlSyntaxChar.setRgb(0, 0, 128);
+ m_clrComment.setRgb(128, 128, 128);
+ m_clrSyntaxError.setRgb(255, 0, 0);
+}
+
+KXESyntaxHighlighter::~KXESyntaxHighlighter()
+{
+}
+
+
+int KXESyntaxHighlighter::highlightParagraph(const QString& text, int endStateOfLastPara)
+{
+ //first I format the given line to default so any remaining highlighting is removed (Qt does not do it by itself)
+ setFormat(0 , text.length(), QColor(0, 0, 0));
+
+ int iBracketNesting = 0;
+ m_eParserState = parsingNone;
+ int pos;
+ unsigned int i = 0;
+
+ if(endStateOfLastPara == 1)
+ {
+ QRegExp patternComment("[^-]*-([^-][^-]*-)*->"); // search end of comment
+ pos=patternComment.search(text, i);
+
+ if(pos >= 0) // end comment found ?
+ {
+ int l = patternComment.matchedLength();
+
+ setFormat(0, l - 3, m_clrComment);
+ setFormat(l - 3, 3, m_clrXmlSyntaxChar );
+ i += l; // skip comment
+ }
+ else
+ {
+ setFormat(0, text.length(), m_clrComment);
+ return 1; // return 1 to signify "in comment"
+ }
+ }
+
+ for(; i < text.length() - 1; i++)
+ {
+ switch(text[i])
+ {
+ case '<':
+ iBracketNesting++;
+
+ if(iBracketNesting == 1)
+ { setFormat( i, 1, m_clrXmlSyntaxChar );
+ m_eParserState = expectElementNameOrSlash;
+ }
+ else
+ setFormat( i, 1, m_clrSyntaxError ); // wrong bracket nesting
+
+ break;
+
+ case '>':
+ iBracketNesting--;
+
+ if(iBracketNesting == 0)
+ setFormat( i, 1, m_clrXmlSyntaxChar );
+ else
+ setFormat( i, 1, m_clrSyntaxError ); // wrong bracket nesting
+
+ m_eParserState = parsingNone;
+
+ break;
+
+ case '/':
+
+ if(m_eParserState == expectElementNameOrSlash)
+ {
+ m_eParserState = expectElementName;
+ setFormat( i, 1, m_clrXmlSyntaxChar );
+ }
+ else
+ {
+ if(m_eParserState == expectAtttributeOrEndOfElement)
+ setFormat( i, 1, m_clrXmlSyntaxChar );
+ else
+ processDefaultText(i, text);
+ }
+
+ break;
+
+ case '=':
+ if(m_eParserState == expectEqual)
+ {
+ m_eParserState = expectAttributeValue;
+ setFormat( i, 1, m_clrXmlSyntaxChar );
+ }
+ else
+ {
+ processDefaultText(i, text);
+ }
+ break;
+
+ case '\"':
+
+ if(m_eParserState == expectAttributeValue)
+ {
+ QRegExp patternAttribute("\"[^<\"]*\"|'[^<']*'"); // search attribute value
+ pos=patternAttribute.search(text, i);
+
+ if(pos == (int) i) // attribute value found ?
+ {
+ int l = patternAttribute.matchedLength();
+
+ setFormat(i, 1, m_clrXmlSyntaxChar );
+ setFormat(i+1, l - 2, m_clrAttributeValue);
+ setFormat(i+l-1, 1, m_clrXmlSyntaxChar );
+
+ i += l - 1; // skip attribute value
+ m_eParserState = expectAtttributeOrEndOfElement;
+ }
+ else
+ processDefaultText(i, text);
+ }
+ else
+ processDefaultText(i, text);
+
+ break;
+
+ case '!':
+ if(m_eParserState == expectElementNameOrSlash)
+ {
+ QRegExp patternComment("<!--[^-]*-([^-][^-]*-)*->"); // search comment
+ pos=patternComment.search(text, i-1);
+
+ if(pos == (int) i-1) // comment found ?
+ {
+ int l = patternComment.matchedLength();
+
+ setFormat(pos, 4, m_clrXmlSyntaxChar);
+ setFormat(pos + 4, l - 7, m_clrComment);
+ setFormat(l - 3, 3, m_clrXmlSyntaxChar);
+ i += l - 2; // skip comment
+ m_eParserState = parsingNone;
+ iBracketNesting--;
+ }
+ else
+ { // Try find multiline comment
+ QRegExp patternCommentStart("<!--"); // search comment start
+ pos=patternCommentStart.search(text, i-1);
+
+ if(pos == (int)i-1) // comment found ?
+ {
+ setFormat(i, 3, m_clrXmlSyntaxChar );
+ setFormat(i + 3, text.length() - i - 3, m_clrComment);
+ return 1; // return 1 to signify "in comment"
+ }
+ else
+ processDefaultText(i, text);
+ }
+ }
+ else
+ processDefaultText(i, text);
+
+ break;
+
+ default:
+ int iLenght = processDefaultText(i, text);
+ if(iLenght > 0)
+ i += iLenght - 1;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+int KXESyntaxHighlighter::processDefaultText(int i, const QString& text)
+{
+ int l = 0; // length of matched text
+
+ switch(m_eParserState)
+ {
+ case expectElementNameOrSlash:
+ case expectElementName:
+ {
+ QRegExp patternName("([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*"); // search element name
+ int pos=patternName.search(text, i);
+
+ if(pos == i) // found ?
+ {
+ l = patternName.matchedLength();
+
+ setFormat(pos, l, m_clrElementName);
+ m_eParserState = expectAtttributeOrEndOfElement;
+ }
+ else
+ setFormat( i, 1, m_clrDefaultText );
+ }
+ break;
+
+ case expectAtttributeOrEndOfElement:
+ {
+ QRegExp patternName("([A-Za-z_:]|[^\\x00-\\x7F])([A-Za-z0-9_:.-]|[^\\x00-\\x7F])*"); // search attribute name
+ int pos=patternName.search(text, i);
+
+ if(pos == i) // found ?
+ {
+ l = patternName.matchedLength();
+
+ setFormat(pos, l, m_clrAttributeName);
+ m_eParserState = expectEqual;
+ }
+ else
+ setFormat( i, 1, m_clrDefaultText );
+ }
+ break;
+
+ default:
+ setFormat( i, 1, m_clrDefaultText );
+ break;
+ }
+ return l;
+}
+
diff --git a/part/kxesyntaxhighlighter.h b/part/kxesyntaxhighlighter.h
new file mode 100644
index 0000000..b6d8868
--- /dev/null
+++ b/part/kxesyntaxhighlighter.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+ kxesyntaxhighlighter.h - XML Syntax highlighter
+ -------------------
+ begin : Ne pro 14 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXESYNTAXHIGHLIGHTER_H
+#define KXESYNTAXHIGHLIGHTER_H
+
+#include <qsyntaxhighlighter.h>
+
+class QTextEdit;
+
+/**XML Syntax highlighter
+ *@author Lumir Vanek
+ */
+
+class KXESyntaxHighlighter : public QSyntaxHighlighter
+{
+public:
+ KXESyntaxHighlighter(QTextEdit *);
+ ~KXESyntaxHighlighter();
+
+ int highlightParagraph(const QString &text, int endStateOfLastPara);
+
+ void setColorDefaultText(const QColor color) { m_clrDefaultText = color; }
+ void setColorElementNames(const QColor color) { m_clrElementName = color; }
+ void setColorAttributeNames(const QColor color) { m_clrAttributeName = color; }
+ void setColorAttributeValues(const QColor color) { m_clrAttributeValue = color; }
+ void setColorXmlSyntaxChars(const QColor color) { m_clrXmlSyntaxChar = color; }
+ void setColorComments(const QColor color) { m_clrComment = color; }
+ void setColorSyntaxError(const QColor color) { m_clrSyntaxError = color; }
+
+ const QColor colorDefaultText() const { return m_clrDefaultText; }
+ const QColor colorElementNames() const { return m_clrElementName; }
+ const QColor colorAttributeNames() const { return m_clrAttributeName; }
+ const QColor colorAttributeValues() const { return m_clrAttributeValue; }
+ const QColor colorXmlSyntaxChars() const { return m_clrXmlSyntaxChar; }
+ const QColor colorComments() const { return m_clrComment; }
+ const QColor colorSyntaxError() const { return m_clrSyntaxError; }
+
+protected:
+ int processDefaultText(int, const QString&);
+
+protected:
+
+ QColor m_clrDefaultText;
+ QColor m_clrElementName;
+ QColor m_clrAttributeName;
+ QColor m_clrAttributeValue;
+ QColor m_clrXmlSyntaxChar; // < > = "
+ QColor m_clrComment;
+ QColor m_clrSyntaxError;
+
+ // states for parsing XML
+ enum ParserState
+ {
+ parsingNone = 0,
+ expectElementNameOrSlash,
+ expectElementName,
+ expectAtttributeOrEndOfElement,
+ expectEqual,
+ expectAttributeValue
+ };
+
+ ParserState m_eParserState;
+};
+
+#endif
diff --git a/part/kxetexteditordialog.cpp b/part/kxetexteditordialog.cpp
new file mode 100644
index 0000000..d4b35b8
--- /dev/null
+++ b/part/kxetexteditordialog.cpp
@@ -0,0 +1,120 @@
+/***************************************************************************
+ kxetexteditordialog.cpp - description
+ -------------------
+ begin : Ne pro 14 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxetexteditordialog.h"
+
+#include "kxmleditorfactory.h"
+#include "kxeconfiguration.h"
+#include "kxetextviewsettings.h"
+
+#include <qdom.h>
+#include <qpushbutton.h>
+
+#include <kmessagebox.h>
+#include <ktextedit.h>
+#include <klocale.h>
+#include <kdebug.h>
+
+KXETextEditorDialog::KXETextEditorDialog(QWidget *parent, const char *name)
+ : KXETextEditorDialogBase(parent,name)
+{
+ m_pSyntaxHighlighter = new KXESyntaxHighlighter(m_pTextEditor);
+
+ connect( m_pTextEditor, SIGNAL(textChanged()), this, SLOT(slotTextChanged()) );
+
+ // Apply current configuration
+ slotTextViewSettingsChanged();
+ // and make sure to be informed about its changes.
+ connect( KXMLEditorFactory::configuration()->textview(), SIGNAL(sigChanged()), this, SLOT(slotTextViewSettingsChanged()) );
+}
+
+KXETextEditorDialog::~KXETextEditorDialog()
+{
+ delete m_pSyntaxHighlighter;
+}
+
+void KXETextEditorDialog::slotTextChanged()
+{
+ if ( m_pTextEditor->text().isEmpty())
+ m_pButtonOk->setEnabled(false);
+ else
+ m_pButtonOk->setEnabled(true);
+}
+
+void KXETextEditorDialog::slotValidate()
+{
+ validateXml(true);
+}
+
+void KXETextEditorDialog::accept()
+{
+ if(validateXml(false))
+ KXETextEditorDialogBase::accept();
+}
+
+bool KXETextEditorDialog::validateXml(bool bInfoIfOK)
+{
+ QString strXML = "<root>" + editorText() + "</root>";
+
+ // create XML documemt from text
+ QString strErrorMsg;
+ int iErrorLine, iErrorColumn;
+ QDomDocument doc;
+
+ if(!doc.setContent(strXML, true, &strErrorMsg, &iErrorLine, &iErrorColumn) )
+ { kdDebug() << "KXETextEditorDialog::validateXml: Failed parsing the file." << endl;
+
+ KMessageBox::error(this,
+ i18n("%1 in line %2, column %3").arg(strErrorMsg).arg(iErrorLine).arg(iErrorColumn),
+ i18n("Parsing error !"));
+
+
+ m_pTextEditor->setCursorPosition(iErrorLine - 1, iErrorColumn - 1);
+
+ return false;
+ }
+
+ // check if root item already exists
+ if(!doc.firstChild().firstChild().isElement())
+ { KMessageBox::sorry(this, i18n("You are changed root element to another node type, while editing !"));
+ return false;
+ }
+
+ if(bInfoIfOK)
+ KMessageBox::information(this, i18n("OK"));
+
+ return true;
+}
+
+void KXETextEditorDialog::slotTextViewSettingsChanged()
+{
+ m_pSyntaxHighlighter->setColorDefaultText( KXMLEditorFactory::configuration()->textview()->colorDfltText() );
+ m_pSyntaxHighlighter->setColorElementNames( KXMLEditorFactory::configuration()->textview()->colorElemNames() );
+ m_pSyntaxHighlighter->setColorAttributeNames( KXMLEditorFactory::configuration()->textview()->colorAttrNames() );
+ m_pSyntaxHighlighter->setColorAttributeValues( KXMLEditorFactory::configuration()->textview()->colorAttrValues() );
+ m_pSyntaxHighlighter->setColorXmlSyntaxChars( KXMLEditorFactory::configuration()->textview()->colorSyntaxChars() );
+ m_pSyntaxHighlighter->setColorComments( KXMLEditorFactory::configuration()->textview()->colorComments() );
+ m_pSyntaxHighlighter->setColorSyntaxError( KXMLEditorFactory::configuration()->textview()->colorErrors() );
+
+ if(KXMLEditorFactory::configuration()->textview()->isWrapOn())
+ {
+ m_pTextEditor->setHScrollBarMode(QScrollView::AlwaysOff);
+ m_pTextEditor->setWordWrap(QTextEdit::WidgetWidth);
+ }
+
+ m_pSyntaxHighlighter->rehighlight();
+}
diff --git a/part/kxetexteditordialog.h b/part/kxetexteditordialog.h
new file mode 100644
index 0000000..8d17be2
--- /dev/null
+++ b/part/kxetexteditordialog.h
@@ -0,0 +1,68 @@
+/***************************************************************************
+ kxetexteditordialog.h - description
+ -------------------
+ begin : Ne pro 14 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : lvanek.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXETEXTEDITORDIALOG_H
+#define KXETEXTEDITORDIALOG_H
+
+#include <qwidget.h>
+#include <qstring.h>
+#include <qsyntaxhighlighter.h>
+
+#include <ktextedit.h>
+
+#include "kxetexteditordialogbase.h"
+#include "kxesyntaxhighlighter.h"
+
+/**Dialog for editing raw XML as text
+ *@author Lumir Vanek
+ */
+
+class KXETextEditorDialog : public KXETextEditorDialogBase
+{
+ Q_OBJECT
+public:
+ KXETextEditorDialog(QWidget *parent=0, const char *name=0);
+ ~KXETextEditorDialog();
+
+ QString editorText() const { return m_pTextEditor->text(); }
+ void setEditorText(const QString strText) { m_pTextEditor->setText(strText); }
+
+public slots:
+
+ /**
+ * Changes syntax highlighting colors.
+ */
+ void slotTextViewSettingsChanged();
+
+protected:
+ bool validateXml(bool);
+
+protected slots:
+ // fired, when user press Validate button
+ virtual void slotValidate();
+
+ // fired, when user change text editor contents
+ void slotTextChanged();
+
+ // fired, when user press OK button
+ virtual void accept();
+
+private:
+ KXESyntaxHighlighter *m_pSyntaxHighlighter;
+};
+
+#endif
diff --git a/part/kxetexteditordialogbase.ui b/part/kxetexteditordialogbase.ui
new file mode 100644
index 0000000..0f454b9
--- /dev/null
+++ b/part/kxetexteditordialogbase.ui
@@ -0,0 +1,154 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXETextEditorDialogBase</class>
+<comment>Dialog for editing XML node as raw text</comment>
+<author>Lumir Vanek</author>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>KXETextEditorDialogBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>511</width>
+ <height>318</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Edit XML as raw text</string>
+ </property>
+ <property name="sizeGripEnabled">
+ <bool>true</bool>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KTextEdit" row="0" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>m_pTextEditor</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <family>Courier</family>
+ </font>
+ </property>
+ <property name="vScrollBarMode">
+ <enum>AlwaysOn</enum>
+ </property>
+ <property name="hScrollBarMode">
+ <enum>Auto</enum>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <enum>NoWrap</enum>
+ </property>
+ <property name="autoFormatting">
+ <set>AutoAll</set>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can edit your XML document as raw text in this editor.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="2">
+ <property name="name">
+ <cstring>m_pButtonOk</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="3">
+ <property name="name">
+ <cstring>m_pButtonCancel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ <property name="accel">
+ <string>Alt+C</string>
+ </property>
+ <property name="autoDefault">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>m_pButtonValidate</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Validate</string>
+ </property>
+ <property name="accel">
+ <string>Alt+V</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Validate&lt;/b&gt;&lt;br/&gt;
+Press this button, if you want your XML document in the above editor to be validated.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="1">
+ <property name="name">
+ <cstring>Horizontal Spacing2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>160</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>m_pButtonOk</sender>
+ <signal>clicked()</signal>
+ <receiver>KXETextEditorDialogBase</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>m_pButtonCancel</sender>
+ <signal>clicked()</signal>
+ <receiver>KXETextEditorDialogBase</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>m_pButtonValidate</sender>
+ <signal>clicked()</signal>
+ <receiver>KXETextEditorDialogBase</receiver>
+ <slot>slotValidate()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>m_pTextEditor</tabstop>
+ <tabstop>m_pButtonValidate</tabstop>
+</tabstops>
+<slots>
+ <slot access="protected">slotValidate()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>ktextedit.h</includehint>
+</includehints>
+</UI>
diff --git a/part/kxetextviewsettings.cpp b/part/kxetextviewsettings.cpp
new file mode 100644
index 0000000..7ed6ac6
--- /dev/null
+++ b/part/kxetextviewsettings.cpp
@@ -0,0 +1,173 @@
+/***************************************************************************
+ kxetextviewsettings.cpp
+ ----------------------
+ begin : Tue Dec 23 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxetextviewsettings.h"
+#include "kxetextviewsettingspage.h"
+
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <kcolorbutton.h>
+#include <qcheckbox.h>
+
+#include <qframe.h>
+#include <qspinbox.h>
+
+#define CONF_ENTRY_NAME_COLOR_DEFAULT_TEXT "DefaultText"
+#define DFLT_VALUE_COLOR_DEFAULT_TEXT QColor( "#000000" )
+
+#define CONF_ENTRY_NAME_COLOR_ELEMENT_NAMES "ElementNames"
+#define DFLT_VALUE_COLOR_ELEMENT_NAMES QColor( "#800000" )
+
+#define CONF_ENTRY_NAME_COLOR_ATTR_NAMES "AttributeNames"
+#define DFLT_VALUE_COLOR_ATTR_NAMES QColor( "#00ffff" )
+
+#define CONF_ENTRY_NAME_COLOR_ATTR_VALUES "AttributeValues"
+#define DFLT_VALUE_COLOR_ATTR_VALUES QColor( "#00ff00" )
+
+#define CONF_ENTRY_NAME_COLOR_SYNTAX_CHARS "SyntaxChars"
+#define DFLT_VALUE_COLOR_SYNTAX_CHARS QColor( "#000080" )
+
+#define CONF_ENTRY_NAME_COLOR_COMENTS "Comments"
+#define DFLT_VALUE_COLOR_COMENTS QColor( "#808080" )
+
+#define CONF_ENTRY_NAME_COLOR_ERRORS "SyntaxError"
+#define DFLT_VALUE_COLOR_ERRORS QColor( "#ff0000" )
+
+#define CONF_ENTRY_NAME_INDENT_STEPS "XML indentation"
+#define DFLT_VALUE_INDENT_STEPS 2
+
+#define CONF_ENTRY_WRAP_ON "Text Wrap On"
+#define DFLT_VALUE_WRAP_ON false
+
+KXETextViewSettings::KXETextViewSettings( QObject * pParent, const char * pszName )
+ : KXESettings( "Text editor", pParent, pszName ),
+ m_colorDfltText( DFLT_VALUE_COLOR_DEFAULT_TEXT ),
+ m_colorElemNames( DFLT_VALUE_COLOR_ELEMENT_NAMES ),
+ m_colorAttrNames( DFLT_VALUE_COLOR_ATTR_NAMES ),
+ m_colorAttrValues( DFLT_VALUE_COLOR_ATTR_VALUES ),
+ m_colorSyntaxChars( DFLT_VALUE_COLOR_SYNTAX_CHARS ),
+ m_colorComments( DFLT_VALUE_COLOR_COMENTS ),
+ m_colorErrors( DFLT_VALUE_COLOR_ERRORS ),
+ m_iIndentSteps( DFLT_VALUE_INDENT_STEPS ),
+ m_bWrapOn(DFLT_VALUE_WRAP_ON),
+ m_pDialogPage(0)
+
+{
+}
+
+
+void KXETextViewSettings::write( KConfig * pConfig ) const
+{
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_DEFAULT_TEXT, m_colorDfltText );
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_ELEMENT_NAMES, m_colorElemNames );
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_ATTR_NAMES, m_colorAttrNames );
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_ATTR_VALUES, m_colorAttrValues );
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_SYNTAX_CHARS, m_colorSyntaxChars );
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_COMENTS, m_colorComments );
+ pConfig->writeEntry( CONF_ENTRY_NAME_COLOR_ERRORS, m_colorErrors );
+ pConfig->writeEntry( CONF_ENTRY_NAME_INDENT_STEPS, m_iIndentSteps );
+ pConfig->writeEntry( CONF_ENTRY_WRAP_ON, m_bWrapOn );
+}
+
+
+void KXETextViewSettings::read( const KConfig * pConfig )
+{
+ m_colorDfltText = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_DEFAULT_TEXT, & DFLT_VALUE_COLOR_DEFAULT_TEXT );
+ m_colorElemNames = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_ELEMENT_NAMES, & DFLT_VALUE_COLOR_ELEMENT_NAMES );
+ m_colorAttrNames = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_ATTR_NAMES, & DFLT_VALUE_COLOR_ATTR_NAMES );
+ m_colorAttrValues = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_ATTR_VALUES, & DFLT_VALUE_COLOR_ATTR_VALUES );
+ m_colorSyntaxChars = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_SYNTAX_CHARS, & DFLT_VALUE_COLOR_SYNTAX_CHARS );
+ m_colorComments = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_COMENTS, & DFLT_VALUE_COLOR_COMENTS );
+ m_colorErrors = pConfig->readColorEntry( CONF_ENTRY_NAME_COLOR_ERRORS, &DFLT_VALUE_COLOR_ERRORS );
+ m_iIndentSteps = pConfig->readNumEntry( CONF_ENTRY_NAME_INDENT_STEPS, DFLT_VALUE_INDENT_STEPS );
+ m_bWrapOn = pConfig->readNumEntry( CONF_ENTRY_WRAP_ON, DFLT_VALUE_WRAP_ON );
+}
+
+
+QString KXETextViewSettings::dialogPageName() const
+{
+ return i18n( "Text view" );
+}
+
+QString KXETextViewSettings::dialogPageHeader() const
+{
+ return i18n( "Text view properties" );
+}
+
+QString KXETextViewSettings::dialogPageIcon() const
+{
+ return "colorize";
+}
+
+
+QWidget * KXETextViewSettings::dialogPage( QFrame * pParent )
+{
+ if ( ! m_pDialogPage )
+ {
+ // create the page if necessary
+ m_pDialogPage = new KXETextViewSettingsPage( pParent, "text view config.dialog page" );
+
+ // and fill its widgets with the corresponding values
+ updatePage();
+
+ connect( m_pDialogPage->m_pColorDfltText, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pColorElemNames, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pColorAttrNames, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pColorAttrValues, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pColorSyntaxChars, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pColorComments, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pColorErrors, SIGNAL(changed(const QColor&)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pIndentSteps, SIGNAL(valueChanged(int)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pCheckBoxWrapOn, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ }
+
+ return m_pDialogPage;
+}
+
+
+void KXETextViewSettings::setFromPage()
+{
+ if ( m_pDialogPage )
+ {
+ m_colorDfltText = m_pDialogPage->m_pColorDfltText->color();
+ m_colorElemNames = m_pDialogPage->m_pColorElemNames->color();
+ m_colorAttrNames = m_pDialogPage->m_pColorAttrNames->color();
+ m_colorAttrValues = m_pDialogPage->m_pColorAttrValues->color();
+ m_colorSyntaxChars = m_pDialogPage->m_pColorSyntaxChars->color();
+ m_colorComments = m_pDialogPage->m_pColorComments->color();
+ m_colorErrors = m_pDialogPage->m_pColorErrors->color();
+ m_iIndentSteps = m_pDialogPage->m_pIndentSteps->value();
+ m_bWrapOn = m_pDialogPage->m_pCheckBoxWrapOn->isChecked();
+ }
+}
+
+void KXETextViewSettings::updatePage() const
+{
+ if ( m_pDialogPage )
+ {
+ m_pDialogPage->m_pColorDfltText->setColor( m_colorDfltText );
+ m_pDialogPage->m_pColorElemNames->setColor( m_colorElemNames );
+ m_pDialogPage->m_pColorAttrNames->setColor( m_colorAttrNames );
+ m_pDialogPage->m_pColorAttrValues->setColor( m_colorAttrValues );
+ m_pDialogPage->m_pColorSyntaxChars->setColor( m_colorSyntaxChars );
+ m_pDialogPage->m_pColorComments->setColor( m_colorComments );
+ m_pDialogPage->m_pColorErrors->setColor( m_colorErrors );
+ m_pDialogPage->m_pIndentSteps->setValue( m_iIndentSteps );
+ m_pDialogPage->m_pCheckBoxWrapOn->setChecked( m_bWrapOn );
+ }
+}
diff --git a/part/kxetextviewsettings.h b/part/kxetextviewsettings.h
new file mode 100644
index 0000000..117282a
--- /dev/null
+++ b/part/kxetextviewsettings.h
@@ -0,0 +1,105 @@
+/***************************************************************************
+ kxetextviewsettings.h
+ --------------------
+ begin : Tue Dec 23 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXETEXTVIEWSETTINGS_H
+#define KXETEXTVIEWSETTINGS_H
+
+#include "kxesettings.h"
+
+#include <qcolor.h>
+
+class KXETextViewSettingsPage;
+
+/**
+ * This class represents the group of configuration settings for
+ * the text view.
+ *
+ * @author Olaf Hartig
+ */
+class KXETextViewSettings : public KXESettings
+{
+ public:
+
+ KXETextViewSettings( QObject * pParent = 0, const char * pszName = 0 );
+
+ // The following functions can be used to access this object's settings.
+ const QColor & colorDfltText() const { return m_colorDfltText; }
+ const QColor & colorElemNames() const { return m_colorElemNames; }
+ const QColor & colorAttrNames() const { return m_colorAttrNames; }
+ const QColor & colorAttrValues() const { return m_colorAttrValues; }
+ const QColor & colorSyntaxChars() const { return m_colorSyntaxChars; }
+ const QColor & colorComments() const { return m_colorComments; }
+ const QColor & colorErrors() const { return m_colorErrors; }
+ int indentSteps() const { return m_iIndentSteps; }
+ bool isWrapOn() const { return m_bWrapOn; }
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageName() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageHeader() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageIcon() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QWidget * dialogPage( QFrame * pParent );
+
+ protected:
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void write( KConfig * ) const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void read( const KConfig * );
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void setFromPage();
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void updatePage() const;
+
+ // the settings itself
+ QColor m_colorDfltText;
+ QColor m_colorElemNames;
+ QColor m_colorAttrNames;
+ QColor m_colorAttrValues;
+ QColor m_colorSyntaxChars;
+ QColor m_colorComments;
+ QColor m_colorErrors;
+ int m_iIndentSteps;
+ bool m_bWrapOn;
+
+ /**
+ * the corresponding configuration dialog page
+ * It is created on demand by @ref dialogPage.
+ */
+ KXETextViewSettingsPage * m_pDialogPage;
+
+};
+
+#endif
diff --git a/part/kxetextviewsettingspage.ui b/part/kxetextviewsettingspage.ui
new file mode 100644
index 0000000..f82c830
--- /dev/null
+++ b/part/kxetextviewsettingspage.ui
@@ -0,0 +1,266 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXETextViewSettingsPage</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KXETextViewSettingsPage</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>254</width>
+ <height>370</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Text view settings</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>m_pBoxSyntaxHL</cstring>
+ </property>
+ <property name="title">
+ <string>Syntax highlighting</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Syntax highlightning&lt;/b&gt;
+&lt;br&gt;
+You can define the colors to be used, when showing your XML documents as raw text.</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>m_pLblColorDfltText</cstring>
+ </property>
+ <property name="text">
+ <string>Default &amp;Text:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorDfltText</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="4" column="1">
+ <property name="name">
+ <cstring>m_pColorSyntaxChars</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>m_pLblColorElemNames</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Element names:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorElemNames</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="5" column="1">
+ <property name="name">
+ <cstring>m_pColorComments</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="6" column="0">
+ <property name="name">
+ <cstring>m_pLblColorErrors</cstring>
+ </property>
+ <property name="text">
+ <string>Syntax E&amp;rrors:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorErrors</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>m_pLblColorAttrValues</cstring>
+ </property>
+ <property name="text">
+ <string>Attribute &amp;values:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorAttrValues</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>m_pColorElemNames</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="5" column="0">
+ <property name="name">
+ <cstring>m_pLblColorComments</cstring>
+ </property>
+ <property name="text">
+ <string>Co&amp;mments:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorComments</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>m_pLblColorAttrNames</cstring>
+ </property>
+ <property name="text">
+ <string>Attribute &amp;names:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorAttrNames</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>m_pColorDfltText</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="2" column="1">
+ <property name="name">
+ <cstring>m_pColorAttrNames</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>m_pLblColorSyntaxChars</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Syntax characters:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pColorSyntaxChars</cstring>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="3" column="1">
+ <property name="name">
+ <cstring>m_pColorAttrValues</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="6" column="1">
+ <property name="name">
+ <cstring>m_pColorErrors</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblIndentSteps</cstring>
+ </property>
+ <property name="text">
+ <string>Element &amp;indentation:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pIndentSteps</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Element indentation&lt;/b&gt;
+&lt;br&gt;
+You can choose the number of characters you want to be used for indenting childnodes, when showing your XML documents as raw text.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>m_pIndentSteps</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Element indentation&lt;/b&gt;
+&lt;br&gt;
+You can choose the number of characters you want to be used for indenting childnodes, when showing your XML documents as raw text.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer row="3" column="0">
+ <property name="name">
+ <cstring>spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>m_pCheckBoxWrapOn</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Wrap, instead of Hrz. Scroll bar</string>
+ </property>
+ <property name="accel">
+ <string>Alt+W</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<tabstops>
+ <tabstop>m_pColorDfltText</tabstop>
+ <tabstop>m_pColorElemNames</tabstop>
+ <tabstop>m_pColorAttrNames</tabstop>
+ <tabstop>m_pColorAttrValues</tabstop>
+ <tabstop>m_pColorSyntaxChars</tabstop>
+ <tabstop>m_pColorComments</tabstop>
+ <tabstop>m_pColorErrors</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxetreeviewsettings.cpp b/part/kxetreeviewsettings.cpp
new file mode 100644
index 0000000..fc59634
--- /dev/null
+++ b/part/kxetreeviewsettings.cpp
@@ -0,0 +1,166 @@
+/***************************************************************************
+ kxetreeviewsettings.cpp
+ -----------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#include "kxetreeviewsettings.h"
+#include "kxetreeviewsettingspage.h"
+
+#include <klocale.h>
+#include <kconfig.h>
+#include <kdebug.h>
+
+#include <qframe.h>
+#include <qcheckbox.h>
+#include <qspinbox.h>
+#include <qbuttongroup.h>
+#include <qradiobutton.h>
+
+#define CONF_ENTRY_NAME_ITEMS_ON_DEMAND "Create items on demand"
+#define DFLT_VALUE_ITEMS_ON_DEMAND true
+
+#define CONF_ENTRY_NAME_DFLT_EXP_LEVEL "Expand to level"
+#define DFLT_VALUE_DFLT_EXP_LEVEL 5
+
+#define CONF_ENTRY_NAME_DECORATE_ROOT "Root decorated"
+#define DFLT_VALUE_DECORATE_ROOT false
+
+#define CONF_ENTRY_NAME_ENABLE_DRAG "Enable Dragging"
+#define DFLT_VALUE_ENABLE_DRAG true
+
+#define CONF_ENTRY_NAME_ENABLE_DROP "Enable Dropping"
+#define DFLT_VALUE_ENABLE_DROP true
+
+#define CONF_ENTRY_NAME_ELEM_DISPL_MODE "Element display mode"
+#define DFLT_VALUE_ELEM_DISPL_MODE NoAttributes
+
+
+KXETreeViewSettings::KXETreeViewSettings( QObject * pParent, const char * pszName )
+ : KXESettings( "Tree View", pParent, pszName ),
+ m_bCreateItemsOnDemand( DFLT_VALUE_ITEMS_ON_DEMAND ),
+ m_iDfltExpLevel( DFLT_VALUE_DFLT_EXP_LEVEL ),
+ m_bDecorateRoot( DFLT_VALUE_DECORATE_ROOT ),
+ m_bEnableDragging( DFLT_VALUE_ENABLE_DRAG ),
+ m_bEnableDropping( DFLT_VALUE_ENABLE_DROP ),
+ m_enmElemDisplMode( DFLT_VALUE_ELEM_DISPL_MODE ),
+ m_pDialogPage(0)
+{
+}
+
+void KXETreeViewSettings::write( KConfig * pConfig ) const
+{
+ pConfig->writeEntry( CONF_ENTRY_NAME_ITEMS_ON_DEMAND, m_bCreateItemsOnDemand );
+ pConfig->writeEntry( CONF_ENTRY_NAME_DFLT_EXP_LEVEL, m_iDfltExpLevel );
+ pConfig->writeEntry( CONF_ENTRY_NAME_DECORATE_ROOT, m_bDecorateRoot );
+ pConfig->writeEntry( CONF_ENTRY_NAME_ENABLE_DRAG, m_bEnableDragging );
+ pConfig->writeEntry( CONF_ENTRY_NAME_ENABLE_DROP, m_bEnableDropping );
+ pConfig->writeEntry( CONF_ENTRY_NAME_ELEM_DISPL_MODE, m_enmElemDisplMode );
+}
+
+void KXETreeViewSettings::read( const KConfig * pConfig )
+{
+ m_bCreateItemsOnDemand = pConfig->readBoolEntry( CONF_ENTRY_NAME_ITEMS_ON_DEMAND, DFLT_VALUE_ITEMS_ON_DEMAND );
+ m_iDfltExpLevel = pConfig->readNumEntry( CONF_ENTRY_NAME_DFLT_EXP_LEVEL, DFLT_VALUE_DFLT_EXP_LEVEL );
+ m_bDecorateRoot = pConfig->readBoolEntry( CONF_ENTRY_NAME_DECORATE_ROOT, DFLT_VALUE_DECORATE_ROOT );
+ m_bEnableDragging = pConfig->readBoolEntry( CONF_ENTRY_NAME_ENABLE_DRAG, DFLT_VALUE_ENABLE_DRAG );
+ m_bEnableDropping = pConfig->readBoolEntry( CONF_ENTRY_NAME_ENABLE_DROP, DFLT_VALUE_ENABLE_DROP );
+ m_enmElemDisplMode = static_cast<AttributeVisibility> ( pConfig->readNumEntry( CONF_ENTRY_NAME_ELEM_DISPL_MODE, DFLT_VALUE_ELEM_DISPL_MODE ) );
+}
+
+QString KXETreeViewSettings::dialogPageName() const
+{
+ return i18n( "Tree View" );
+}
+
+QString KXETreeViewSettings::dialogPageHeader() const
+{
+ return i18n( "Tree view properties" );
+}
+
+QString KXETreeViewSettings::dialogPageIcon() const
+{
+ return "view_tree";
+}
+
+
+QWidget * KXETreeViewSettings::dialogPage( QFrame * pParent )
+{
+ if ( ! m_pDialogPage )
+ {
+ // create the page if necessary
+ m_pDialogPage = new KXETreeViewSettingsPage( pParent, "tree view config.dialog page" );
+
+ // and fill its widgets with the corresponding values
+ updatePage();
+
+ connect( m_pDialogPage->m_pCreateItemsOnDemand, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pDecorateRoot, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pDfltExpLevel, SIGNAL(valueChanged(int)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pEnableDrag, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pEnableDrop, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pElemDisplMode1, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pElemDisplMode2, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ connect( m_pDialogPage->m_pElemDisplMode3, SIGNAL(toggled(bool)), this, SIGNAL(sigDialogPageChanged()) );
+ }
+
+ return m_pDialogPage;
+}
+
+
+void KXETreeViewSettings::setFromPage()
+{
+ if ( m_pDialogPage )
+ {
+ m_bCreateItemsOnDemand = m_pDialogPage->m_pCreateItemsOnDemand->isChecked();
+ m_bDecorateRoot = m_pDialogPage->m_pDecorateRoot->isChecked();
+ m_iDfltExpLevel = m_pDialogPage->m_pDfltExpLevel->value();
+ m_bEnableDragging = m_pDialogPage->m_pEnableDrag->isChecked();
+ m_bEnableDropping = m_pDialogPage->m_pEnableDrop->isChecked();
+
+ if ( m_pDialogPage->m_pElemDisplMode1->isChecked() )
+ m_enmElemDisplMode = NoAttributes;
+ else if ( m_pDialogPage->m_pElemDisplMode2->isChecked() )
+ m_enmElemDisplMode = NamesOnly;
+ else if ( m_pDialogPage->m_pElemDisplMode3->isChecked() )
+ m_enmElemDisplMode = NamesAndValues;
+ }
+}
+
+void KXETreeViewSettings::updatePage() const
+{
+ if ( m_pDialogPage )
+ {
+ m_pDialogPage->m_pCreateItemsOnDemand->setChecked( m_bCreateItemsOnDemand );
+ m_pDialogPage->m_pDecorateRoot->setChecked( m_bDecorateRoot );
+ m_pDialogPage->m_pDfltExpLevel->setValue( m_iDfltExpLevel );
+ m_pDialogPage->m_pEnableDrag->setChecked( m_bEnableDragging );
+ m_pDialogPage->m_pEnableDrop->setChecked( m_bEnableDropping );
+
+ switch ( m_enmElemDisplMode )
+ {
+ case NoAttributes:
+ m_pDialogPage->m_pElemDisplMode->setButton( m_pDialogPage->m_pElemDisplMode->id( m_pDialogPage->m_pElemDisplMode1 ) );
+ break;
+ case NamesOnly:
+ m_pDialogPage->m_pElemDisplMode->setButton( m_pDialogPage->m_pElemDisplMode->id( m_pDialogPage->m_pElemDisplMode2 ) );
+ break;
+ case NamesAndValues:
+ m_pDialogPage->m_pElemDisplMode->setButton( m_pDialogPage->m_pElemDisplMode->id( m_pDialogPage->m_pElemDisplMode3 ) );
+ break;
+ default:
+ kdError() << "KXETreeViewSettings::updatePage: unknown element display mode" << endl;
+ }
+ }
+}
diff --git a/part/kxetreeviewsettings.h b/part/kxetreeviewsettings.h
new file mode 100644
index 0000000..403a0bb
--- /dev/null
+++ b/part/kxetreeviewsettings.h
@@ -0,0 +1,103 @@
+/***************************************************************************
+ kxetreeviewsettings.h
+ ---------------------
+ begin : Tue Dec 02 2003
+ copyright : (C) 2003 by The KXMLEditor Team
+ email : hartig@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXETREEVIEWSETTINGS_H
+#define KXETREEVIEWSETTINGS_H
+
+#include "kxesettings.h"
+
+class KXETreeViewSettingsPage;
+
+/**
+ * This class represents the group of configuration settings for the
+ * tree view.
+ *
+ * @author Olaf Hartig
+ */
+class KXETreeViewSettings : public KXESettings
+{
+ public:
+
+ enum AttributeVisibility
+ {
+ NoAttributes,
+ NamesOnly,
+ NamesAndValues
+ };
+
+ KXETreeViewSettings( QObject * pParent = 0, const char * pszName = 0 );
+
+ // The following functions can be used to access this object's settings.
+ bool createItemsOnDemand() const { return m_bCreateItemsOnDemand; }
+ int dfltExpLevel() const { return m_iDfltExpLevel; }
+ bool decorateRoot() const { return m_bDecorateRoot; }
+ bool enableDragging() const { return m_bEnableDragging; }
+ bool enableDropping() const { return m_bEnableDropping; }
+ AttributeVisibility elemDisplMode() const { return m_enmElemDisplMode; }
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageName() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageHeader() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QString dialogPageIcon() const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual QWidget * dialogPage( QFrame * pParent );
+
+ protected:
+
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void write( KConfig * ) const;
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void read( const KConfig * );
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void setFromPage();
+ /**
+ * Derived from @ref KXESettings
+ */
+ virtual void updatePage() const;
+
+ // the settings itself
+ bool m_bCreateItemsOnDemand;
+ int m_iDfltExpLevel;
+ bool m_bDecorateRoot;
+ bool m_bEnableDragging;
+ bool m_bEnableDropping;
+ AttributeVisibility m_enmElemDisplMode;
+
+ /**
+ * the corresponding configuration dialog page
+ * It is created on demand by @ref dialogPage.
+ */
+ KXETreeViewSettingsPage * m_pDialogPage;
+};
+
+#endif
diff --git a/part/kxetreeviewsettingspage.ui b/part/kxetreeviewsettingspage.ui
new file mode 100644
index 0000000..8cce39b
--- /dev/null
+++ b/part/kxetreeviewsettingspage.ui
@@ -0,0 +1,226 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KXETreeViewSettingsPage</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KXETreeViewSettingsPage</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>218</width>
+ <height>325</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Tree View Settings Page</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pCreateItemsOnDemand</cstring>
+ </property>
+ <property name="text">
+ <string>Create items &amp;on demand</string>
+ </property>
+ <property name="accel">
+ <string>Alt+O</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Create items on demand&lt;/b&gt;
+&lt;br&gt;
+You can determine when to create the tree view items.
+Wether they are created on demand, which means their creation is postponed until
+their grandparent item is opened, or all items are created while opening the XML
+file.
+&lt;br&gt;
+Creating items on demand saves time and memory while opening very big, deep nested XML documents.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pDecorateRoot</cstring>
+ </property>
+ <property name="text">
+ <string>Set &amp;root element decorated</string>
+ </property>
+ <property name="accel">
+ <string>Alt+R</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Set root element decorated&lt;/b&gt;
+&lt;br&gt;
+You can determine wether the tree view item corresponding to the XML document's root element should have a decoration or not.
+&lt;br&gt;
+A decoration is a + or - icon, with which the item can be opened or closed to show or hide its childitems.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_pLblDfltExpLevel</cstring>
+ </property>
+ <property name="text">
+ <string>Default &amp;expand level:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_pDfltExpLevel</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Default expand level&lt;/b&gt;
+&lt;br&gt;
+You can determine up to which level the tree view items should be opened (showing their childitems) when opening a document.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>m_pDfltExpLevel</cstring>
+ </property>
+ <property name="value">
+ <number>5</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Default expand level&lt;/b&gt;
+&lt;br&gt;
+You can determine up to which level the tree view items should be opened (showing their childitems) when opening a document.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>m_pBoxDnD</cstring>
+ </property>
+ <property name="title">
+ <string>Drag and drop</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pEnableDrag</cstring>
+ </property>
+ <property name="text">
+ <string>Enable dra&amp;gging</string>
+ </property>
+ <property name="accel">
+ <string>Alt+G</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enable dragging&lt;/b&gt;
+&lt;br&gt;
+You can determine wether dragging items (and their corresponding XML nodes) from the tree view is enabled or disabled.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>m_pEnableDrop</cstring>
+ </property>
+ <property name="text">
+ <string>Enable dro&amp;pping</string>
+ </property>
+ <property name="accel">
+ <string>Alt+P</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="tristate">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;b&gt;Enable dropping&lt;/b&gt;
+&lt;br&gt;
+You can determine wether dropping XML nodes to the tree view is enabled or disabled.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>m_pElemDisplMode</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Show ...</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can determine which information about XML element's attributes you want to see in the tree view. Choose between:&lt;br&gt;
+&lt;br&gt;
+&lt;b&gt;&lt;i&gt;no attributes&lt;/i&gt;&lt;/b&gt;&lt;br&gt;
+no information about attributes at all&lt;br&gt;
+&lt;br&gt;
+&lt;b&gt;&lt;i&gt;attribute names only&lt;/i&gt;&lt;/b&gt;&lt;br&gt;
+the attributes' names are shown&lt;br&gt;
+&lt;br&gt;
+&lt;b&gt;&lt;i&gt;attribute names &amp; values&lt;/i&gt;&lt;/b&gt;&lt;br&gt;
+the attributes' names and the corresponding values are shown</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_pElemDisplMode1</cstring>
+ </property>
+ <property name="text">
+ <string>No attributes</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_pElemDisplMode2</cstring>
+ </property>
+ <property name="text">
+ <string>Attribute names only</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>m_pElemDisplMode3</cstring>
+ </property>
+ <property name="text">
+ <string>Attribute names &amp;&amp; values</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/part/kxmleditorabout.h b/part/kxmleditorabout.h
new file mode 100644
index 0000000..67478f0
--- /dev/null
+++ b/part/kxmleditorabout.h
@@ -0,0 +1,50 @@
+/***************************************************************************
+ kxmleditorabout.h - description
+ -------------------
+ begin : Mon Sep 24 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXMLEDITORABOUT_H
+#define KXMLEDITORABOUT_H
+
+#include <kaboutdata.h>
+#include <klocale.h>
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+static const char *description = I18N_NOOP("KXML Editor is an utility to display and edit XML files");
+
+class KXMLEditorAboutData : public KAboutData
+{
+ public:
+ KXMLEditorAboutData()
+ : KAboutData( "kxmleditor",
+ I18N_NOOP("KXML Editor"),
+ VERSION,
+ description,
+ KAboutData::License_GPL,
+ "(c) 2001-2004, The KXML Editor Developers",
+ 0,
+ "http://kxmleditor.sourceforge.net",
+ "lvanek@users.sourceforge.net" )
+ {
+ addAuthor("Lumir Vanek", I18N_NOOP("Developer and maintainer"), "lvanek@users.sourceforge.net", "http://www.valachnet.cz/lvanek");
+ addAuthor("Olaf Hartig", I18N_NOOP("Developer"), "hartig@users.sourceforge.net");
+ addAuthor("Adam Charytoniuk", I18N_NOOP("Developer"), "a_charytoniuk@users.sourceforge.net");
+ }
+};
+
+#endif
diff --git a/part/kxmleditorfactory.cpp b/part/kxmleditorfactory.cpp
new file mode 100644
index 0000000..40819db
--- /dev/null
+++ b/part/kxmleditorfactory.cpp
@@ -0,0 +1,104 @@
+/***************************************************************************
+ kxmleditorfactory.cpp - description
+ -------------------
+ begin : Wed Sep 19 2001
+ copyright : (C) 2001, 2002, 2003 byThe KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "kxmleditorfactory.h"
+#include "kxmleditorpart.h"
+#include "kxmleditorabout.h"
+#include "kxeconfiguration.h"
+#include "kxedocument.h"
+
+#include <kinstance.h>
+#include <kdebug.h>
+
+extern "C"
+{
+ void * init_libkxmleditorpart()
+ {
+ return new KXMLEditorFactory;
+ }
+}
+
+KInstance * KXMLEditorFactory::s_instance = 0L;
+KXEConfiguration * KXMLEditorFactory::s_pKXEConfig = 0L;
+
+KXMLEditorFactory::KXMLEditorFactory( QObject * pParent, const char * pszName )
+ : KParts::Factory(pParent,pszName)
+{
+}
+
+KXMLEditorFactory::~KXMLEditorFactory()
+{
+ if ( s_pKXEConfig )
+ delete s_pKXEConfig;
+
+ s_pKXEConfig = 0L;
+
+ if (s_instance)
+ delete s_instance;
+
+ s_instance = 0L;
+}
+
+KParts::Part * KXMLEditorFactory::createPartObject( QWidget * pParentWidget, const char * pszWidgetName, QObject * pParent, const char * pszName, const char * pszClassName, const QStringList & )
+{
+ // eliminating compiler warnings
+ pParent = pParent;
+ pszName = pszName;
+
+ KParts::Part * pPart=0L;
+ KXEDocument* pDocument=0L;
+ if ( QCString(pszClassName) == "KParts::ReadOnlyPart" )
+ {
+ pDocument = new KXEDocument();
+ pPart = new KXMLEditorPart( false, pDocument, pParentWidget, pszWidgetName );
+ kdDebug() << "KXMLEditorFactory::createPartObject: read only KXMLEditorPart created" << endl;
+ }
+ else if ( (QCString(pszClassName) == "KParts::ReadWritePart") ||
+ (QCString(pszClassName) == "KXMLEditorPart") )
+ {
+ pDocument = new KXEDocument();
+ pPart = new KXMLEditorPart( true, pDocument, pParentWidget, pszWidgetName );
+ kdDebug() << "KXMLEditorFactory::createPartObject: read/write KXMLEditorPart created" << endl;
+ }
+ else
+ {
+ kdError() << "KXMLEditorFactory::createPartObject: classname isn't KParts::ReadOnlyPart nor KParts::ReadWritePart." << endl;
+ return 0L;
+ }
+
+
+ emit objectCreated( pPart );
+
+ return pPart;
+}
+
+KInstance * KXMLEditorFactory::instance()
+{
+ if ( ! s_instance )
+ {
+ s_instance = new KInstance( new KXMLEditorAboutData() );
+ }
+ return s_instance;
+}
+
+KXEConfiguration * KXMLEditorFactory::configuration()
+{
+ if ( ! s_pKXEConfig )
+ s_pKXEConfig = new KXEConfiguration();
+
+ return s_pKXEConfig;
+}
diff --git a/part/kxmleditorfactory.h b/part/kxmleditorfactory.h
new file mode 100644
index 0000000..b2c5e15
--- /dev/null
+++ b/part/kxmleditorfactory.h
@@ -0,0 +1,55 @@
+/***************************************************************************
+ kxmleditorfactory.h - description
+ -------------------
+ begin : Wed Sep 19 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+ /**
+@file
+*/
+
+#ifndef KXMLEDITORFACTORY_H
+#define KXMLEDITORFACTORY_H
+
+#include <kparts/factory.h>
+
+class KInstance;
+class KXEConfiguration;
+/**
+ @brief Factory for creating our parts.
+*/
+class KXMLEditorFactory : public KParts::Factory
+{
+ Q_OBJECT
+
+ public:
+ /** @brief Constructor */
+ KXMLEditorFactory( QObject * pParent = 0, const char * pszName = 0 );
+ /** @brief Destructor */
+ virtual ~KXMLEditorFactory();
+
+ /** @short Creates part object, depending on given part class */
+ virtual KParts::Part * createPartObject( QWidget * pParentWidget = 0, const char * pszWidgetName = 0, QObject * pParent = 0, const char * pszName = 0, const char * pszClassName = "KParts::Part", const QStringList & args = QStringList() );
+
+ static KInstance * instance();
+ static KXEConfiguration * configuration();
+
+ private:
+ static KInstance * s_instance;
+
+ /** @brief Our configuration - the same for all parts. */
+ static KXEConfiguration * s_pKXEConfig;
+};
+
+#endif
diff --git a/part/kxmleditorpart.cpp b/part/kxmleditorpart.cpp
new file mode 100644
index 0000000..6abe508
--- /dev/null
+++ b/part/kxmleditorpart.cpp
@@ -0,0 +1,1923 @@
+/***************************************************************************
+ kxmleditorpart.cpp - description
+ -------------------
+ begin : Wed Sep 19 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#include "kxmleditorpart.h"
+#include "kxmleditorfactory.h"
+
+#include "kxedocument.h"
+
+#include "kxeconfiguration.h"
+#include "kxenewfilesettings.h"
+#include "kxearchiveextssettings.h"
+#include "kxeprintsettings.h"
+#include "kxetextviewsettings.h"
+
+#include "commands_edit.h"
+#include "commands_insert.h"
+
+#include "kxe_viewelement.h"
+#include "kxe_treeviewitem.h"
+
+#include "kxesearchdialog.h"
+#include "kxechoosestringdialog.h"
+#include "kxeelementdialog.h"
+#include "kxeattributedialog.h"
+#include "kxeprocinstrdialog.h"
+#include "kxespecprocinstrdialog.h"
+#include "kxefilenewdialog.h"
+#include "kxechardatadialog.h"
+#include "kxeattachdialogbase.h"
+#include "kxetexteditordialog.h"
+
+#include "actions.h"
+#include "qdom_add.h"
+
+#include <kinstance.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kaction.h>
+#include <kstdaction.h>
+#include <kpopupmenu.h>
+#include <kiconloader.h>
+#include <kmessagebox.h>
+#include <kprinter.h>
+#include <ktar.h>
+#include <kzip.h>
+#include <ktempfile.h>
+#include <kconfig.h>
+#include <kurlrequester.h>
+#include <kcommand.h>
+#include <ktoolbar.h>
+#include <kfiledialog.h>
+
+#include <qregexp.h>
+#include <qtextcodec.h>
+#include <qstringlist.h>
+#include <qsplitter.h>
+#include <qtabwidget.h>
+#include <qtextedit.h>
+#include <qcombobox.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qclipboard.h>
+#include <qdragobject.h>
+#include <qapplication.h>
+#include <qbuffer.h>
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qpaintdevicemetrics.h>
+#include <qevent.h>
+
+#include "dcopiface_part_ro.h" // DCOP Iface
+
+#define CONFIG_MAIN_SPLITTER_SIZES "Main splitter sizes"
+
+
+KXMLEditorPart::KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, QWidget * pParent, const char * pszName )
+ : KParts::ReadWritePart(pParent,pszName),
+ m_pDlgSearch(0),
+ m_pDocument(0)
+{
+ //////////////////////////////
+ // INIT PART
+ //////////////////////////////
+
+ setInstance(KXMLEditorFactory::instance());
+
+ if(fReadWrite)
+ m_pBrowserExt = 0L; // Create Browser extension only for read-only part
+ else
+ m_pBrowserExt = new KXMLEditorBrowserExtension( this, "KXMLEditorPart browser extension" );
+
+ m_pPrinter = 0L;
+
+ m_bAlreadyModified = false;
+
+ //////////////////////////////
+ // CREATE ACTIONS
+ //////////////////////////////
+
+ // file actions
+ if(fReadWrite)
+ {
+ KStdAction::save(this, SLOT(save()), actionCollection());
+ KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection());
+ }
+
+ // edit actions
+ m_pActEditFind = KStdAction::find( this, SLOT(slotEditFind()), actionCollection());
+ m_pActEditFindNext = KStdAction::findNext( this, SLOT(slotEditFindNext()), actionCollection());
+ m_pActEditDeselect = new KAction( i18n("D&eselect Node"), CTRL+Key_E, this,
+ SLOT(slotEditDeselect()), actionCollection(), "deselect" );
+
+ // view actions
+ m_pActViewNodeUp = new KAction( i18n("To &Parent Node"), "up", 0, this,
+ SLOT(slotViewNodeUp()), actionCollection(), "treeitem_up" );
+
+ m_pActViewExpNode = new KToolBarPopupAction( i18n("&Expand Node"), "expand_node", CTRL+Key_Plus, this,
+ SLOT(slotViewExpNode()), actionCollection(), "treeitem_expand" );
+ KPopupMenu * pMenuExpNode = m_pActViewExpNode->popupMenu();
+ connect( pMenuExpNode, SIGNAL(activated(int)), this, SLOT(slotViewExpNode(int)) );
+ for ( uint i = 1; i <= 8; i++ )
+ pMenuExpNode->insertItem( i18n("Expand To Level %1").arg(i), i-1 );
+
+ m_pActViewColNode = new KToolBarPopupAction( i18n("&Collapse Node"), "collapse_node", CTRL+Key_Minus, this,
+ SLOT(slotViewColNode()), actionCollection(), "treeitem_collapse" );
+ KPopupMenu * pMenuColNode = m_pActViewColNode->popupMenu();
+ connect( pMenuColNode, SIGNAL(activated(int)), this, SLOT(slotViewColNode(int)) );
+ for ( uint i = 0; i <= 7; i++ )
+ pMenuColNode->insertItem( i18n("Collapse To Level %1").arg(i), i );
+
+ // bookmark actions
+ m_pActBookmarksToggle = new KAction( i18n("&Toggle Bookmark"), "bookmark_add", CTRL+Key_B, this,
+ SLOT(slotBookmarksToggle()), actionCollection(), "bookmark_toggle" );
+ m_pActBookmarksPrev = new KAction( i18n("&Previous Bookmark"), "bookmark_prev", SHIFT+Key_F5, this,
+ SLOT(slotBookmarksPrev()), actionCollection(), "bookmark_prev" );
+ m_pActBookmarksNext = new KAction( i18n("&Next Bookmark"), "bookmark_next", Key_F5, this,
+ SLOT(slotBookmarksNext()), actionCollection(), "bookmark_next" );
+
+ // settings actions
+ new KAction( i18n("&Configure KXMLEditor..."), "configure", 0, this,
+ SLOT (slotConfigure()), actionCollection(), "configure" );
+
+ // path toolbar
+ m_pActPathCombo = new KXmlEditorComboAction( i18n("Path Bar"), 0, this,
+ SLOT(slotPathSelected(const QString &)), actionCollection(), "path_combo" );
+ new KAction( i18n("Clear Path Bar"), BarIcon("locationbar_erase", 16), 0, this,
+ SLOT(slotPathClear()), actionCollection(), "path_clear" );
+ QLabel *m_locationLabel = new ToolbarLabel( i18n("Path: ") );
+ new KWidgetAction( m_locationLabel, i18n("Path: "), 0, this, 0, actionCollection(), "path_label" );
+ m_locationLabel->setBuddy( m_pActPathCombo->comboBox());
+
+ if ( ! fReadWrite )
+ {
+ setXMLFile( "kxmleditorpartBrowseUI.rc", true );
+
+ KStdAction::cut( m_pBrowserExt, SLOT(slotEditCut()), actionCollection(), "cut" );
+ KStdAction::copy( m_pBrowserExt, SLOT(slotEditCopy()), actionCollection(), "copy" );
+ KStdAction::paste( m_pBrowserExt, SLOT(slotEditPaste()), actionCollection(), "paste");
+
+ m_pCmdHistory = 0L;
+
+ m_pActVersionEncoding = 0L;
+ m_pActAttachSchema = 0L;
+ m_pActDetachSchema = 0L;
+ m_pActAttachStylesheet = 0L;
+ m_pActDetachStylesheet = 0L;
+ }
+ else
+ {
+ // document specific actions here
+ m_pActVersionEncoding = new KAction( i18n("&Version && Encoding..."), 0, 0, this, SLOT(slotActVersionEncoding()), actionCollection(), "xml_ins_spec_procins" );
+ m_pActAttachSchema = new KAction(i18n("Attach Schema..."),0,0,this,SLOT(slotActAttachSchema()), actionCollection(), "xml_attach_schema");
+ m_pActDetachSchema = new KAction(i18n("Detach Schema"),0,0,this,SLOT(slotActDetachSchema()), actionCollection(), "xml_detach_schema");
+ m_pActAttachStylesheet = new KAction(i18n("Attach Stylesheet..."),0,0,this,SLOT(slotActAttachStylesheet()), actionCollection(), "xml_attach_stylesheet");
+ m_pActDetachStylesheet = new KAction(i18n("Detach Stylesheet"),0,0,this,SLOT(slotActDetachStylesheet()), actionCollection(), "xml_detach_stylesheet");
+
+ KStdAction::print( this, SLOT(slotActPrint()), actionCollection(), "print" );
+
+ m_pActAttachSchema->setEnabled(false);
+ m_pActDetachSchema->setEnabled(false);
+ m_pActDetachStylesheet->setEnabled(false);
+
+
+ // undo & redo
+ KStdAction::undo(this, SLOT(slotActUndo()), actionCollection());
+ KStdAction::redo(this, SLOT(slotActRedo()), actionCollection());
+
+ m_pCmdHistory = new KCommandHistory(actionCollection());
+
+ m_pActEditCut = KStdAction::cut( this, SLOT(slotEditCut()), actionCollection());
+ m_pActEditCopy = KStdAction::copy( this, SLOT(slotEditCopy()), actionCollection());
+ m_pActEditPaste = KStdAction::paste( this, SLOT(slotEditPaste()), actionCollection());
+
+ // Move node Up & Down
+ m_pActXmlMoveNodeUp = new KAction( i18n("&Move Up"), "xml_move_item_up", CTRL+Key_U, this, SLOT(slotXmlMoveNodeUp()), actionCollection(), "xml_move_item_up" );
+ m_pActXmlMoveNodeDown = new KAction( i18n("Move &Down"), "xml_move_item_down", CTRL+Key_D, this, SLOT(slotXmlMoveNodeDown()), actionCollection(), "xml_move_item_down" );
+
+ // Insert actions
+ m_pActXmlElementInsert = new KAction( i18n("&Element..."), "xml_insert_element", CTRL+SHIFT+Key_E, this, SLOT(slotXmlElementInsert()), actionCollection(), "xml_ins_element" );
+ m_pActXmlAttributesAdd = new KAction( i18n("&Attribute..."), "xml_insert_attribute", CTRL+SHIFT+Key_A, this, SLOT(slotXmlAttributesAdd()), actionCollection(), "xml_add_attribute" );
+ m_pActInsertText = new KAction( i18n("&Text..."), "xml_text", CTRL+SHIFT+Key_T, this, SLOT(slotActInsertText()), actionCollection(), "insert_text" );
+ m_pActInsertCDATA = new KAction( i18n("C&DATA..."), "xml_cdata", CTRL+SHIFT+Key_D, this, SLOT(slotActInsertCDATA()), actionCollection(), "insert_cdata" );
+ m_pActInsertComment = new KAction( i18n("&Comment..."), "xml_comment", CTRL+SHIFT+Key_C, this, SLOT(slotActInsertComment()), actionCollection(), "insert_comment" );
+ m_pActXmlProcInstrInsert = new KAction( i18n("&Processing Instruction..."), "xml_insert_procins", CTRL+SHIFT+Key_P, this, SLOT(slotXmlProcInstrInsert()), actionCollection(), "xml_ins_procins" );
+
+ // Edit node properties
+ m_pActProperties = new KAction(i18n("&Properties..."),"edit",0,this,SLOT(slotActProperties()),actionCollection(),"edit_properties");
+ m_pActEditRawXml = new KAction(i18n("Edit &raw XML..."), 0, 0, this, SLOT(slotActEditRawXml()),actionCollection(),"edit_as_raw_xml");
+
+ // delete actions
+ m_pActXmlAttributeDel = new KAction( i18n("&Delete"), "editdelete", 0, this, SLOT(slotXmlAttributeDel()), actionCollection(), "xml_del_attribute" );
+ m_pActXmlAttributesDel = new KAction( i18n("Delete all Attributes..."), 0, 0, this, SLOT(slotXmlAttributesDel()), actionCollection(), "xml_del_attributes" );
+ m_pActDelete = new KAction(i18n("&Delete"),"editdelete",0,this,SLOT(slotActDelete()),actionCollection(),"edit_delete");
+
+ setXMLFile( "kxmleditorpartEditUI.rc", true );
+
+ // we are not modified since we haven't done anything yet
+ setModified(false);
+ }
+
+ //////////////////////////////
+ // CREATE WIDGETS
+ //////////////////////////////
+
+ pSplitter = new QSplitter( pParent, "KXMLEditorPart main widget (Splitter)" );
+ pSplitter->setFocusPolicy( QWidget::NoFocus );
+ pSplitter->setOpaqueResize(true);
+ setWidget( pSplitter );
+
+ // create the tree view -------------------
+ m_pViewTree = new KXE_TreeView( this, pSplitter, "KXMLEditorPart treeview" );
+
+ connect( m_pViewTree, SIGNAL(sigSelectionCleared(bool)), this, SLOT(slotSelectionCleared(bool)) );
+ connect( m_pViewTree, SIGNAL(sigSelectionChanged(const QDomElement &)), this, SLOT(slotSelectionChanged(const QDomElement &)) );
+ connect( m_pViewTree, SIGNAL(sigSelectionChanged(const QDomCharacterData &)), this, SLOT(slotSelectionChanged(const QDomCharacterData &)) );
+ connect( m_pViewTree, SIGNAL(sigSelectionChanged(const QDomProcessingInstruction &)), this, SLOT(slotSelectionChanged(const QDomProcessingInstruction &)) );
+ connect( m_pViewTree, SIGNAL(sigContextMenuRequested(const QString&,const QPoint&)), this, SLOT(slotContextMenuRequested(const QString&,const QPoint&)) );
+ connect( m_pViewTree, SIGNAL(itemRenamed(QListViewItem *)), this, SLOT(slotItemRenamedInplace(QListViewItem *)) );
+ connect( m_pViewTree, SIGNAL(sigKeyPressed(QKeyEvent* )),this,SLOT(slotTreeViewKeyPressed(QKeyEvent*)));
+
+ // create tab widget ----------------------
+ m_pTabWidget = new QTabWidget( pSplitter, "KXMLEditorPart tabwidget");
+ m_pTabWidget->setFocusPolicy( QWidget::NoFocus );
+
+ // create element view
+ m_pViewElement = new KXE_ViewElement( m_pTabWidget, instance()->config(), "KXMLEditorPart element view" );
+ m_pTabWidget->addTab( m_pViewElement, g_iconElement, i18n("Element") );
+ connect( m_pViewElement, SIGNAL(sigContextMenuRequested(const QString&,const QPoint&)), this, SLOT(slotContextMenuRequested(const QString&,const QPoint&)) );
+ connect( m_pViewElement, SIGNAL(sigAttributeNameChangedInplace(const QDomAttr&, const QString)), this, SLOT(slotAttributeNameChangedInplace(const QDomAttr&, const QString)) );
+ connect( m_pViewElement, SIGNAL(sigAttributeValueChangedInplace(const QDomAttr&, const QString)), this, SLOT(slotAttributeValueChangedInplace(const QDomAttr&, const QString)) );
+
+ // create edit widget, that display XML character data contents
+ m_pViewContents = new QTextEdit( m_pTabWidget, "KXMLEditorPart contents view" );
+ m_pTabWidget->addTab( m_pViewContents, g_iconText, i18n("Contents") );
+ m_pViewContents->setReadOnly( true );
+ m_pViewContents->setWordWrap( QTextEdit::NoWrap );
+ m_pViewContents->setTextFormat(QTextEdit::PlainText);
+
+ // create proc.instr. view
+ m_pViewProcInstr = new QTextEdit( m_pTabWidget, "KXMLEditorPart proc.instr. view" );
+ m_pTabWidget->addTab( m_pViewProcInstr, g_iconProcessingInstruction, i18n("Proc.Instruction") );
+ m_pViewProcInstr->setReadOnly( true );
+ m_pViewProcInstr->setWordWrap( QTextEdit::NoWrap );
+
+ connect( this, SIGNAL(started(KIO::Job*)), this, SLOT(started()) );
+ connect( this, SIGNAL(completed()), this, SLOT(completed()) );
+ connect( this, SIGNAL(canceled(const QString &)), this, SLOT(canceled()) );
+
+ //////////////////////////////
+ // INIT BEGIN STATE
+ //////////////////////////////
+
+ // Disable actions
+ if(m_pBrowserExt)
+ m_pBrowserExt->emit enableAction("copy", false);
+ else
+ m_pActEditCopy->setEnabled(false);
+
+ m_pActEditFindNext->setEnabled(false);
+ m_pActEditDeselect->setEnabled(false);
+ m_pActViewNodeUp->setEnabled(false);
+ m_pActViewExpNode->setEnabled(false);
+ m_pActViewColNode->setEnabled(false);
+ m_pActBookmarksToggle->setEnabled(false);
+ m_pActBookmarksPrev->setEnabled(false);
+ m_pActBookmarksNext->setEnabled(false);
+
+ if ( fReadWrite )
+ {
+ m_pActEditCut->setEnabled(false);
+ m_pActEditPaste->setEnabled(true);
+
+ m_pActXmlElementInsert->setEnabled(true);
+ m_pActXmlAttributesAdd->setEnabled(false);
+ m_pActXmlAttributesDel->setEnabled(false);
+ m_pActXmlProcInstrInsert->setEnabled(true);
+ m_pActInsertText->setEnabled(false);
+ m_pActInsertCDATA->setEnabled(false);
+ m_pActInsertComment->setEnabled(false);
+ m_pActXmlMoveNodeUp->setEnabled(false);
+ m_pActXmlMoveNodeDown->setEnabled(false);
+ m_pActDelete->setEnabled(false);
+ m_pActProperties->setEnabled(false);
+ m_pActEditRawXml->setEnabled(false);
+ }
+
+ m_pTabWidget->setTabEnabled( m_pViewElement, false );
+ m_pTabWidget->setTabEnabled( m_pViewContents, false );
+ m_pTabWidget->setTabEnabled( m_pViewProcInstr, false );
+
+ setReadWrite(fReadWrite);
+
+ // configuring splitter sizes
+ QValueList<int> list = instance()->config()->readIntListEntry(CONFIG_MAIN_SPLITTER_SIZES);
+ if (!list.isEmpty())
+ pSplitter->setSizes(list);
+
+ //////////////////////////////
+ // INIT DCOP object (if any)
+ //////////////////////////////
+ //m_pDCOPIface = NULL;
+ //m_pDCOPIface = new KXMLEditorPartIfaceReadOnly(this);
+ m_pDCOPIface = new KXMLEditorPartIfaceReadWrite(this); // temporarly to test openUrl
+
+ setDocument(pDocument);
+
+}
+
+KXMLEditorPart::~KXMLEditorPart()
+{
+ // saving splitter configuration
+ KConfig *pConfig = instance()->config();
+ pConfig->writeEntry( CONFIG_MAIN_SPLITTER_SIZES, pSplitter->sizes() );
+
+ if (m_pDCOPIface)
+ delete m_pDCOPIface;
+
+ if (m_pDlgSearch)
+ delete m_pDlgSearch;
+
+ if (m_pPrinter)
+ delete m_pPrinter;
+
+ if (document())
+ delete document();
+
+ delete m_pCmdHistory;
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// KPART FUNCTIONALITY
+/////////////////////////////////////////////////////////////////////
+
+bool KXMLEditorPart::openFile()
+{
+ if( isModified() )
+ kdError() << "KXMLEditorPart::openFile the current document is modified." << endl;
+
+ document()->setURL(m_url);
+ bool bResult = document()->open(m_file);
+ updateActions();
+ return bResult;
+}
+
+bool KXMLEditorPart::saveFile()
+{
+ emit setStatusBarText( i18n("Saving file...") );
+
+ if( url().isEmpty() )
+ {
+ return slotFileSaveAs();
+ }
+
+ // delegate this operation to underlying document object
+ document()->setURL(m_url);
+ bool bRetVal = document()->save(m_file);
+
+ emit setStatusBarText( i18n("Ready.") );
+ return bRetVal;
+}
+
+void KXMLEditorPart::setModified( bool bModified )
+{
+ KParts::ReadWritePart::setModified( bModified ); // base functionality
+
+ if ( m_bAlreadyModified != bModified )
+ {
+ m_bAlreadyModified = bModified;
+
+ QString szNewCaption = m_url.prettyURL();
+ emit setWindowCaption( szNewCaption );
+ }
+
+ // get a handle on our Save action and make sure it is valid
+ KAction *pActFileSave = actionCollection()->action(KStdAction::stdName(KStdAction::Save));
+ if(!pActFileSave)
+ return;
+
+ // if so, we either enable or disable it based on the current state
+ pActFileSave->setEnabled(bModified);
+
+ // Update others actions
+ updateActions();
+}
+
+void KXMLEditorPart::setReadWrite( bool fReadWrite )
+{
+ m_pViewTree->setReadWrite(fReadWrite);
+ m_pViewElement->setReadWrite(fReadWrite);
+
+ KParts::ReadWritePart::setReadWrite( fReadWrite ); // base functionality
+}
+
+void KXMLEditorPart::started()
+{
+ kdDebug() << "KXMLEditorPart::started" << endl;
+}
+void KXMLEditorPart::completed()
+{
+ kdDebug() << "KXMLEditorPart::completed" << endl;
+}
+void KXMLEditorPart::canceled()
+{
+ kdDebug() << "KXMLEditorPart::canceled" << endl;
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// ACTION SLOTS
+/////////////////////////////////////////////////////////////////////
+
+void KXMLEditorPart::slotActPrint()
+{
+ // this slot is called whenever the File->Print menu is selected,
+ // the Print shortcut is pressed (usually CTRL+P) or the Print toolbar
+ // button is clicked
+ if (!m_pPrinter)
+ m_pPrinter = new KPrinter;
+
+ if (m_pPrinter->setup(widget()))
+ print(m_pPrinter);
+}
+
+void KXMLEditorPart::slotActProperties()
+{
+ QDomNode* pNode = m_pViewTree->getSelectedNode();
+ if (pNode)
+ {
+ if (pNode->isElement())
+ slotXmlElementEdit();
+ else if (pNode->isCharacterData())
+ slotXmlCharDataEdit();
+ else if (pNode->isProcessingInstruction())
+ slotXmlProcInstrEdit();
+ else
+ kdError() << "Unknown node selected.";
+ }
+}
+
+void KXMLEditorPart::slotActDelete()
+{
+ QDomNode* pNode = m_pViewTree->getSelectedNode();
+
+ if (!m_pViewElement->hasFocus())
+ {
+ // delete nodes selected there
+ if (pNode)
+ {
+ KCommand *pCmd = new KXEDeleteNodeCommand(document(), *pNode);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+ else
+ {
+ // we can have also delete attribute selected on a element view
+ QDomAttr domAttr = m_pViewElement->getSelectedAttribute();
+ if (!domAttr.isNull())
+ {
+ QDomElement domElement = pNode->toElement();
+ QDomAttr domAttr = m_pViewElement->getSelectedAttribute();
+
+ KCommand *pCmd = new KXEDeleteAttrCommand(document(), domElement, domAttr);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+}
+
+void KXMLEditorPart::slotEditCut()
+{
+ kdDebug() << "KXMLEditor " << k_funcinfo << endl;
+
+ if(! isReadWrite())
+ {
+ kdError() << "KXMLEditorPart::slotEditCut called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+
+ if(pNode)
+ { // copy to clipboard
+ slotEditCopy();
+
+ // and cut it
+ KCommand *pCmd = new KXECutCommand(document(), *pNode);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+}
+
+void KXMLEditorPart::slotEditCopy()
+{
+ kdDebug() << "KXMLEditor " << k_funcinfo << endl;
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+
+ if(pNode)
+ {
+ QTextDrag *pDrag = copyNode(m_pViewTree->getSelectedNode());
+ if(pDrag)
+ QApplication::clipboard()->setData(pDrag);
+ }
+ else
+ kdError() << "KXMLEditorPart::slotEditCopy no element selected." << endl;
+}
+
+void KXMLEditorPart::slotEditPaste()
+{
+ kdDebug() << "KXMLEditor " << k_funcinfo << endl;
+
+ if(!isReadWrite())
+ {
+ kdError() << "KXMLEditorPart::slotEditPaste called in readonly mode." << endl;
+ return;
+ }
+
+ if (document()->documentElement().isNull())
+ {
+ pasteNode(0, QApplication::clipboard()->data());
+ }
+ else
+ {
+ pasteNode(m_pViewTree->getSelectedNode(), QApplication::clipboard()->data());
+ }
+}
+
+void KXMLEditorPart::slotEditFind()
+{
+ emit setStatusBarText( i18n("Search in XML tree ...") );
+
+ if ( ! m_pDlgSearch )
+ {
+ m_pDlgSearch = new KXESearchDialog( widget(), "search dialog", true );
+ }
+
+ if ( m_pDlgSearch->exec() == KXESearchDialog::Accepted )
+ slotEditFindNext();
+
+ m_pActEditFindNext->setEnabled(true);
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotEditFindNext()
+{
+ emit setStatusBarText( i18n("Search in XML tree ...") );
+
+ if ( ! m_pDlgSearch )
+ {
+ kdDebug() << "KXMLEditorPart::slotEditFindNext implementation error - no search dialog" << endl;
+ emit setStatusBarText( i18n("Ready.") );
+ return;
+ }
+
+ // get node to start with (either the next node of the item selected at the tree view or documents root node)
+ QDomNode node = ( (m_pViewTree->getSelectedNode()) && (! m_pViewTree->getSelectedNode()->isNull()) ) ? domTool_nextNode(* m_pViewTree->getSelectedNode()) : document()->documentElement();
+
+ // start testing til the last node
+ while( ! node.isNull() )
+ {
+ if ( domTool_match( node, m_pDlgSearch ) )
+ {
+ m_pViewTree->selectNode(node);
+ emit setStatusBarText( i18n("Ready.") );
+ return;
+ }
+
+ node = domTool_nextNode(node);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlElementInsert()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlElementInsert called in readonly mode." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Inserting XML element into document...") );
+
+ KXEElementDialog dlg( widget(), "XML element dialog" );
+
+ if ( document()->documentElement().isNull() ) // the document doesn't
+ { // have a root element yet
+ if ( dlg.exec( false, true, false ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEElementCommand(document(), document(), dlg.nsURI(), dlg.prefix(), dlg.name());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+ else // the document seems to
+ { // have a root element
+ QDomNode * pParentNode = m_pViewTree->getSelectedNode();
+
+ if ( (pParentNode) && (pParentNode->isElement()) )
+ {
+ QDomElement domParentElement = pParentNode->toElement();
+
+ if ( dlg.exec( false, false, false ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEElementCommand(document(), domParentElement, dlg.nsURI(), dlg.prefix(), dlg.name(), dlg.atTop());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+ else
+ kdError() << "KXMLEditorPart::slotXmlElementInsert no element selected." << endl;
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlElementEdit()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlElementEdit called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotXmlElementEdit no node selected or selected node is no XML element." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Editing XML element...") );
+
+ QDomElement domElement = pNode->toElement();
+
+ KXEElementDialog dlg( widget(), "XML element dialog" );
+
+ dlg.setPrefix(domElement.prefix());
+ dlg.setName(domElement.tagName());
+ if(!domElement.namespaceURI().isNull())
+ dlg.setNsURI(domElement.namespaceURI() );
+
+ if ( dlg.exec( true, false, domElement.namespaceURI().isNull() ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEEditElementCommand(document(), domElement, dlg.prefix(), dlg.name());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotActEditRawXml()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotActEditRawXml called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotActEditRawXml no node selected or selected node is no XML element." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Editing raw XML...") );
+
+ QDomElement domElement = pNode->toElement();
+
+ QString strXML;
+
+ QTextStream streamXML(&strXML, IO_WriteOnly);
+ int iIndent = KXMLEditorFactory::configuration()->textview()->indentSteps();
+ pNode->save(streamXML, iIndent);
+
+ KXETextEditorDialog dlg(0, "Text dialog");
+ dlg.setEditorText(strXML);
+ if((dlg.exec() == QDialog::Accepted) && (strXML != dlg.editorText()))
+ {
+ QString strXML = "<root>" + dlg.editorText() + "</root>";
+
+ // create XML documemt from text
+ QString strErrorMsg;
+ int iErrorLine, iErrorColumn;
+ QDomDocument doc;
+
+ if(!doc.setContent(strXML, true, &strErrorMsg, &iErrorLine, &iErrorColumn) )
+ {
+ kdDebug() << "KXMLEditorPart::slotActEditRawXml: Failed parsing the file." << endl;
+
+ KMessageBox::error(m_pViewTree,
+ i18n("%1 in line %2, column %3").arg(strErrorMsg).arg(iErrorLine).arg(iErrorColumn),
+ i18n("Parsing error !"));
+
+ return;
+ }
+
+ // check if root item already exists
+ if(!doc.firstChild().firstChild().isElement())
+ {
+ KMessageBox::sorry(m_pViewTree, i18n("You are changed root element to another node type, while editing !"));
+ return;
+ }
+
+ QDomElement domNewElement = doc.firstChild().firstChild().toElement();
+ KCommand *pCmd = new KXEEditRawXmlCommand(document(), domElement, domNewElement);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlAttributesAdd()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlAttributesAdd called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotXmlAttributesAdd no node selected or selected node is no XML element." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Add attribute...") );
+
+ KXEAttributeDialog dlg( widget(), "attribute dialog" );
+
+ QDomElement domOwnerElement = pNode->toElement();
+ if ( dlg.exec( ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEAttributeCommand(document(), domOwnerElement, dlg.attributeNamespace(), dlg.QName(), dlg.Value());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlAttributesDel()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlAttributesDel called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotXmlAttributesDel no node selected or selected node is no XML element." << endl;
+ return;
+ }
+
+ if(KMessageBox::questionYesNo(0, i18n("Remove all attributes from selected node ?")) != KMessageBox::Yes)
+ return;
+
+ emit setStatusBarText( i18n("Delete all attributes...") );
+
+ QDomElement domOwnerElement = pNode->toElement();
+
+ KCommand *pCmd = new KXEDeleteAllAttribCommand(document(), domOwnerElement);
+ m_pCmdHistory->addCommand(pCmd);
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+
+void KXMLEditorPart::slotXmlAttributeDel()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlAttributeDel called in readonly mode." << endl;
+
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotXmlAttributeDel no node selected or selected node is no XML element." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Delete attribute...") );
+
+ QDomElement domElement = pNode->toElement();
+ QDomAttr domAttr = m_pViewElement->getSelectedAttribute();
+
+ KCommand *pCmd = new KXEDeleteAttrCommand(document(), domElement, domAttr);
+ m_pCmdHistory->addCommand(pCmd);
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlProcInstrInsert()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlProcInstrInsert called in readonly mode." << endl;
+ return;
+ }
+
+ KXEProcInstrDialog dlg( widget(), "proc. instr. dialog" );
+
+ QDomNode * pParentNode = m_pViewTree->getSelectedNode();
+ if ( (pParentNode) && (!pParentNode->isElement()) )
+ {
+ kdError() << k_funcinfo << " The selected node is no XML element." << endl;
+ return;
+ }
+ else
+ {
+ if ( ! pParentNode ) // no node selected -> the new node should be a direct child of the document
+ {
+ if ( dlg.exec( false, true ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEProcInstrCommand(document(), document(), dlg.atTop(), dlg.target(), dlg.data());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+ else
+ {
+ if ( dlg.exec( false, false ) == QDialog::Accepted )
+ {
+ QDomElement domParentElement = pParentNode->toElement();
+
+ KCommand *pCmd = new KXEProcInstrCommand(document(), domParentElement, dlg.atTop(), dlg.target(), dlg.data());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+ }
+
+ emit setStatusBarText( i18n("Inserting processing instruction into document...") );
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlProcInstrEdit()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlProcInstrEdit called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isProcessingInstruction()) )
+ {
+ kdError() << "KXMLEditorPart::slotXmlProcInstrEdit no node selected or selected node is no processing instruction." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Editing processing instruction...") );
+
+ QDomProcessingInstruction domProcInstr = pNode->toProcessingInstruction();
+
+ // We have two different kinds of processing instructions:
+ // - a special one - defining the documents XML version and encoding
+ // - others
+ // and both cases require different dialogs.
+ if( domProcInstr.target() == "xml" ) // 1st case (special proc.instr.)
+ document()->actVersionEncoding();
+ else // 2nd case (others)
+ {
+ KXEProcInstrDialog dlg( widget(), "proc. instr. dialog" );
+
+ dlg.setTarget(domProcInstr.target());
+ dlg.setData(domProcInstr.data());
+
+ if ( dlg.exec( true, false ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEEditProcInstrCommand(document(), domProcInstr, dlg.data());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotActInsertText()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotActInsertText called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotActInsertText no element selected." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Inserting text into document...") );
+
+ KXECharDataDialog dlg( widget());
+ dlg.setCaption(i18n("Insert text"));
+
+ QDomElement domParentElement = pNode->toElement();
+
+ if ( dlg.exec( false ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXECharDataCommand(document(), domParentElement, dlg.atTop(), CharDataTextNode, dlg.contents());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotActInsertCDATA()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotActInsertCDATA called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotActInsertCDATA no element selected." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Inserting CDATA into document...") );
+
+ KXECharDataDialog dlg( widget());
+ dlg.setCaption(i18n("Insert CDATA"));
+
+ QDomElement domParentElement = pNode->toElement();
+
+ if ( dlg.exec( false ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXECharDataCommand(document(), domParentElement, dlg.atTop(), CharDataCDATASection, dlg.contents());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotActInsertComment()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotActInsertComment called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isElement()) )
+ {
+ kdError() << "KXMLEditorPart::slotActInsertComment no element selected." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Inserting comment into document...") );
+
+ KXECharDataDialog dlg( widget());
+ dlg.setCaption(i18n("Insert comment"));
+
+ QDomElement domParentElement = pNode->toElement();
+
+ if ( dlg.exec( false ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXECharDataCommand(document(), domParentElement, dlg.atTop(), CharDataComment, dlg.contents());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+
+
+void KXMLEditorPart::slotXmlCharDataEdit()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlCharDataEdit called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( (!pNode) || (!pNode->isCharacterData()) )
+ {
+ kdError() << "KXMLEditorPart::slotXmlCharDataEdit no node selected or selected node is no character data." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Editing character data...") );
+
+ QDomCharacterData domCharData = pNode->toCharacterData();
+
+ KXECharDataDialog dlg( widget() );
+
+ CharDataKind eCharDataKind;
+ if(domCharData.isText())
+ eCharDataKind = CharDataTextNode;
+ else
+ {
+ if(domCharData.isCDATASection())
+ eCharDataKind = CharDataCDATASection;
+ else
+ eCharDataKind = CharDataComment;
+ }
+
+ // dlg.setCharDataKind(eCharDataKind);
+ dlg.setContents(domCharData.data());
+
+ if ( dlg.exec( true ) == QDialog::Accepted )
+ {
+ KCommand *pCmd = new KXEEditCharDataCommand(document(), domCharData, dlg.contents());
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlMoveNodeUp()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlMoveNodeUp called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( ! pNode )
+ {
+ kdError() << "KXMLEditorPart::slotXmlMoveNodeUp no node selected." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Moving node up...") );
+
+ KCommand *pCmd = new KXEUpCommand(document(), * pNode);
+ m_pCmdHistory->addCommand(pCmd);
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotXmlMoveNodeDown()
+{
+ if ( ! isReadWrite() )
+ {
+ kdError() << "KXMLEditorPart::slotXmlMoveNodeDown called in readonly mode." << endl;
+ return;
+ }
+
+ QDomNode * pNode = m_pViewTree->getSelectedNode();
+ if ( ! pNode )
+ {
+ kdError() << "KXMLEditorPart::slotXmlMoveNodeDown no node selected." << endl;
+ return;
+ }
+
+ emit setStatusBarText( i18n("Moving node down...") );
+
+ KCommand *pCmd = new KXEDownCommand(document(), * pNode);
+ m_pCmdHistory->addCommand(pCmd);
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotBookmarksToggle()
+{
+ m_pViewTree->bookmarksToggle();
+ m_pActBookmarksPrev->setEnabled(m_pViewTree->containsBookmarkedItems());
+ m_pActBookmarksNext->setEnabled(m_pViewTree->containsBookmarkedItems());
+}
+
+void KXMLEditorPart::slotConfigure()
+{
+ emit setStatusBarText( i18n("Configure KXML Editor ...") );
+
+ KXMLEditorFactory::configuration()->showDialog();
+
+ emit setStatusBarText( i18n("Ready.") );
+}
+
+void KXMLEditorPart::slotPathSelected( )
+{
+
+}
+
+void KXMLEditorPart::slotPathSelected( const QString & strPath )
+{
+ QDomNode node = domTool_matchingNode( document()->toDocument(), strPath );
+ if(node.isNull())
+ { // node don't exists, remove item from combo
+ m_pActPathCombo->removeItem(strPath);
+ m_pActPathCombo->slotClearEdit();
+ return;
+ }
+
+ if(!m_pViewTree->selectNode(node))
+ { // node not found, remove item from combo
+ m_pActPathCombo->removeItem(strPath);
+ m_pActPathCombo->slotClearEdit();
+ }
+}
+
+void KXMLEditorPart::slotPathClear()
+{
+ slotEditDeselect();
+ m_pActPathCombo->slotFocusEdit();
+}
+
+void KXMLEditorPart::slotItemRenamedInplace( QListViewItem * pItem )
+{
+ KXE_TreeViewItem * pXMLItem = static_cast <KXE_TreeViewItem*> (pItem);
+
+ if ( ! pXMLItem->xmlNode()->isElement() ) // check, if it really represents an XML element
+ {
+ kdFatal() << "KXMLEditorPart " << k_funcinfo << " the given item doesn't represent an XML element." << endl;
+ return;
+ }
+
+ QDomElement domElement = pXMLItem->xmlNode()->toElement();
+
+ if ( domElement.nodeName() != pItem->text(0) ) // if really something was changed
+ {
+ // else the element is "namespaced"
+ int nPosColon = pItem->text(0).find(':');
+
+ if ( nPosColon == -1 ) // if no namespace prefix was entered,
+ {
+ // check name
+ QString strMessage = KXEElementDialog::checkName(pItem->text(0));
+ if(strMessage.length() > 0)
+ {
+ // restore old name
+ m_pViewTree->updateNodeChanged(domElement);
+ KMessageBox::sorry(m_pViewTree, strMessage);
+ return;
+ }
+
+ // clear the elements namespace prefix
+ // and set the entered text as its tag name
+ KCommand *pCmd = new KXEEditElementCommand(document(), domElement, QString::null, pItem->text(0));
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ else
+ {
+ // otherwise split up the entered text by the first colon and
+ QString strPrefix(pItem->text(0).left(nPosColon));
+ QString strName(pItem->text(0).right( pItem->text(0).length() - nPosColon - 1 ));
+
+ // check name
+ QString strMessage = KXEElementDialog::checkName(strName);
+ if(strMessage.length() > 0)
+ {
+ // restore old name
+ m_pViewTree->updateNodeChanged(domElement);
+ KMessageBox::sorry(m_pViewTree, strMessage);
+ return;
+ }
+
+ KCommand *pCmd = new KXEEditElementCommand(
+ document(),
+ domElement,
+ strPrefix,
+ strName
+ );
+
+ m_pCmdHistory->addCommand(pCmd);
+ }
+
+
+ if ( m_pViewTree->selectedItem() == pItem ) // and if the item is still selected
+ {
+ m_pActPathCombo->insertItem( domTool_getIconForNodeType(pXMLItem->xmlNode()->nodeType(), false),
+ domTool_getPath(*pXMLItem->xmlNode()) ); // the path combo
+ }
+ }
+}
+
+void KXMLEditorPart::slotAttributeNameChangedInplace( const QDomAttr & domAttr, const QString strNewName )
+{
+ if ( *m_pViewTree->getSelectedNode() == domAttr.ownerElement() ) // if the corresponding element
+ { // is still selected
+ KCommand *pCmd = new KXEEditAttrNameCommand(document(), domAttr, strNewName);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+}
+
+void KXMLEditorPart::slotAttributeValueChangedInplace( const QDomAttr & domAttr, const QString strNewValue )
+{
+ if ( *m_pViewTree->getSelectedNode() == domAttr.ownerElement() ) // if the corresponding element
+ { // is still selected
+ KCommand *pCmd = new KXEEditAttrValueCommand(document(), domAttr, strNewValue);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+}
+
+/////////////////////////////////////////////////////////////////////
+// MISC FUNCTIONS
+/////////////////////////////////////////////////////////////////////
+
+/** Copy XML node into clipboard */
+QTextDrag * KXMLEditorPart::copyNode(QDomNode * pNode)
+{
+ QTextDrag *pDrag = 0;
+ QString strXML;
+
+ QTextStream streamXML(&strXML, IO_WriteOnly);
+ int iIndent = KXMLEditorFactory::configuration()->textview()->indentSteps();
+ pNode->save(streamXML, iIndent);
+ pDrag = new QTextDrag(strXML, m_pViewTree);
+
+ /*if(pNode->isElement())
+ pDrag->setSubtype(KXE_TreeViewItem::m_strSubtypeXML);
+
+ if(pNode->isProcessingInstruction())
+ pDrag->setSubtype(KXE_TreeViewItem::m_strSubtypeXML_procins);
+
+ if(pNode->isText())
+ pDrag->setSubtype(KXE_TreeViewItem::m_strSubtypeXML_text);
+
+ if(pNode->isCDATASection())
+ pDrag->setSubtype(KXE_TreeViewItem::m_strSubtypeXML_cdata);
+
+ if(pNode->isComment())
+ pDrag->setSubtype(KXE_TreeViewItem::m_strSubtypeXML_comment); */
+
+ return pDrag;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Paste XML node from clipboard into document
+//
+// pTargetNode - target node
+// data - data to pasted
+//
+//-----------------------------------------------------------------------------
+bool KXMLEditorPart::pasteNode(QDomNode * pTargetNode, QMimeSource *data)
+{
+ QString strText;
+
+ // Drop XML Processing Instruction
+ if(QTextDrag::decode(data, strText))
+ { if(strText.find("<?xml ") == 0)
+ {
+ KMessageBox::sorry(0, i18n("This processing instruction cannot be pasted here !"));
+ return false;
+ }
+
+ //---
+
+ QString strXML = "<root>" + strText + "</root>";
+
+ // Paste clipboard contents as XML element
+ QString strErrorMsg;
+ int iErrorLine, iErrorColumn;
+ QDomDocument doc;
+
+ if(!doc.setContent(strXML, true, &strErrorMsg, &iErrorLine, &iErrorColumn) )
+ { kdDebug() << "KXMLEditorPart::pasteNode: Failed parsing the file." << endl;
+
+ KMessageBox::error(m_pViewTree,
+ i18n("%1 in line %2, column %3").arg(strErrorMsg).arg(iErrorLine).arg(iErrorColumn),
+ i18n("Parsing error !"));
+
+ return false;
+ }
+
+ // Import parsed document to main document
+ if(doc.hasChildNodes())
+ { if(pTargetNode == 0)
+ { // check if root item already exists
+ if(!document()->documentElement().isNull() /*(this->documentElement().isElement())*/ && (doc.firstChild().firstChild().isElement()) )
+ { KMessageBox::sorry(m_pViewTree, i18n("Root element already exists !"));
+ return false;
+ }
+
+ if(doc.documentElement().firstChild().isElement() == false)
+ {
+ KMessageBox::sorry(m_pViewTree, i18n("Node pasted to document must be element !"));
+ return false;
+ }
+
+ // Append it as root node
+ QDomElement newNode = doc.documentElement().firstChild().cloneNode(true).toElement();
+
+ KCommand *pCmd = new KXEPasteToDocumentCommand(document(), document(), newNode);
+ m_pCmdHistory->addCommand(pCmd);
+ }
+ else
+ { QDomNode sourceNode = doc.firstChild().firstChild().cloneNode(true);
+
+ /*
+ L.V.
+
+ TESTING CODE FOR [ 925668 ] Attribute values in a copied element can't be changed.
+
+ if(sourceNode.isElement())
+ {
+ QDomElement domSourceElement = sourceNode.toElement();
+
+ QDomNamedNodeMap list = domSourceElement.attributes();
+ unsigned int iLength = list.length();
+
+
+ for ( unsigned int iRow = 0; iRow < iLength; iRow++ )
+ {
+ QDomAttr a = list.item(iRow).toAttr();
+
+ QDomElement domOwnerElement = a.ownerElement();
+ if(domOwnerElement.isNull())
+ KMessageBox::sorry(m_pViewTree, i18n("Cloned owner is null !"));
+ }*/
+ //---
+
+ if(pTargetNode->isElement())
+ {
+ QDomElement domTargetElement = pTargetNode->toElement();
+ KCommand *pCmd = new KXEPasteToElementCommand(document(), domTargetElement, sourceNode);
+ m_pCmdHistory->addCommand(pCmd);
+ return true;
+ }
+
+ if(pTargetNode->isProcessingInstruction() && sourceNode.isProcessingInstruction())
+ { // Replace contents of selected node
+ QDomProcessingInstruction domTargetProcInstr = pTargetNode->toProcessingInstruction();
+ QDomProcessingInstruction domSourceProcInstr = sourceNode.toProcessingInstruction();
+
+ KCommand *pCmd = new KXEPasteToProcInstrCommand(document(), domTargetProcInstr, domSourceProcInstr);
+ m_pCmdHistory->addCommand(pCmd);
+ return true;
+ }
+
+ if(pTargetNode->isCharacterData() && sourceNode.isCharacterData())
+ { // Replace contents of selected node
+ QDomCharacterData domTargetCharData = pTargetNode->toCharacterData();
+ QDomCharacterData domSourceCharData = sourceNode.toCharacterData();
+
+ KCommand *pCmd = new KXEPasteToCharDataCommand(document(), domTargetCharData, domSourceCharData);
+ m_pCmdHistory->addCommand(pCmd);
+ return true;
+ }
+
+ KMessageBox::sorry(m_pViewTree, i18n("Incompactible node types for drag&drop !"));
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+}
+
+//-----------------------------------------------------------------------------
+//
+// Drag & Drop MOVE operation
+//
+// domTrgetElement - target element
+// domSourceNode - source node
+//
+//-----------------------------------------------------------------------------
+bool KXMLEditorPart::dropMoveNode(QDomElement & domTargetElement, QDomNode & domSourceNode)
+{
+ KCommand *pCmd = new KXEDragDropMoveCommand(document(), domTargetElement, domSourceNode);
+ m_pCmdHistory->addCommand(pCmd);
+ return true;
+}
+
+/////////////////////////////////////////////////////////////////////
+// PRINTING
+/////////////////////////////////////////////////////////////////////
+
+// these defines should rather stay fixed and not configurable by the user.
+#define headerMargin 30;
+#define footerMargin 50;
+#define m_printLinespace 0.4 // percent of font size used to make line indent
+
+int headerHeight, footerHeight; // used in few functions, nevertheless temporary...
+
+void KXMLEditorPart::print(KPrinter* pPrinter)
+{
+ // setup the printer. with Qt, you always "print" to a
+ // QPainter.. whether the output medium is a pixmap, a screen, or paper
+ QPainter p;
+ QPainter *painter = &p;
+ QFont font( KXMLEditorFactory::configuration()->print()->fontFamily(),
+ KXMLEditorFactory::configuration()->print()->fontSize() );
+
+ QPaintDeviceMetrics metrics((QPrinter*)pPrinter); // determining
+ int width = metrics.width(); // width and
+ int height = metrics.height(); // height of the page
+
+ footerHeight = font.pointSize()+footerMargin;
+ headerHeight = font.pointSize()+headerMargin;
+
+ int pageNumber = 0;
+
+ painter->begin(pPrinter); // start print job
+ painter->setFont(font); // set up fonts for printout
+ printHeader(painter,pageNumber,0,width); // draw header on a first page
+ while (printPage (painter,pageNumber,
+ headerHeight,width,
+ height-headerHeight-footerHeight)) // and start printing loop
+ {
+ printFooter(painter, pageNumber, height-footerHeight,width); // draw footer at the end of that page
+ pageNumber++;
+ pPrinter->newPage();
+ printHeader(painter,pageNumber,0,width); // draw header on new page
+ }
+ printFooter(painter,pageNumber,height-footerHeight,width); // draw footer on last page
+ painter->end(); // finish print job
+}
+
+void KXMLEditorPart::printHeader(QPainter* painter,int pageNumber, int ypos, int width)
+{
+ pageNumber = pageNumber;
+ if ( KXMLEditorFactory::configuration()->print()->hasHeader() )
+ {
+ painter->drawText(0,ypos,m_url.prettyURL());
+ painter->drawLine(0,ypos,width,ypos);
+ }
+}
+
+bool KXMLEditorPart::printPage(QPainter* painter,int pageNumber, int top, int width, int height)
+{
+ width = width;
+ if (pageNumber==0)
+ {
+ // initialization of working variables is done when
+ // first page is about to be printed
+ m_printLineNumber = 0;
+ m_printLines = QStringList::split( "\n", document()->toString(KXMLEditorFactory::configuration()->print()->indentSteps()) );
+ }
+ int lineHeight = (int)(painter->font().pointSize()*(1+m_printLinespace));
+ int y = top;
+ while ( y <= height )
+ {
+ painter->drawText(0,y,m_printLines[m_printLineNumber]);
+ if (m_printLineNumber++==m_printLines.size())
+ return false; // no more pages to print
+ y += lineHeight;
+ }
+ return true; // there are still some pages to print
+}
+
+void KXMLEditorPart::printFooter(QPainter* painter,int pageNumber, int ypos, int width)
+{
+ if ( KXMLEditorFactory::configuration()->print()->hasFooter() )
+ {
+ int fh = painter->font().pointSize();
+ painter->drawText(0,ypos,i18n("Page %1").arg(pageNumber+1));
+ painter->drawLine(0,ypos-fh,width,ypos-fh);
+ }
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// OTHER SLOTS
+/////////////////////////////////////////////////////////////////////
+
+void KXMLEditorPart::slotTreeViewKeyPressed(QKeyEvent *e)
+{
+ // few keypresses are recognized and proper actions
+ // are executed.
+ switch (e->key())
+ {
+ case Qt::Key_Delete : slotActDelete(); break;
+ case Qt::Key_Return :
+ case Qt::Key_Enter : slotActProperties(); break;
+ }
+}
+
+void KXMLEditorPart::slotSelectionCleared(bool bRootElementExists)
+{
+ // Enable/Disable actions
+ if(m_pBrowserExt)
+ m_pBrowserExt->emit enableAction( "copy", false );
+ else
+ m_pActEditCopy->setEnabled(false);
+
+ m_pActEditDeselect->setEnabled(false);
+ m_pActViewNodeUp->setEnabled(false);
+ m_pActViewExpNode->setEnabled(false);
+ m_pActViewColNode->setEnabled(false);
+ m_pActBookmarksToggle->setEnabled(false);
+
+ if ( isReadWrite() )
+ {
+ m_pActEditCut->setEnabled(false );
+ m_pActEditPaste->setEnabled(true );
+
+ m_pActXmlElementInsert->setEnabled(!bRootElementExists);
+ m_pActXmlAttributesAdd->setEnabled(false);
+ m_pActXmlAttributesDel->setEnabled(false);
+ m_pActXmlProcInstrInsert->setEnabled(true);
+ m_pActInsertText->setEnabled(false);
+ m_pActInsertCDATA->setEnabled(false);
+ m_pActInsertComment->setEnabled(false);
+ m_pActXmlMoveNodeUp->setEnabled(false);
+ m_pActXmlMoveNodeDown->setEnabled(false);
+ m_pActDelete->setEnabled(false);
+ m_pActProperties->setEnabled(false);
+ m_pActEditRawXml->setEnabled(false);
+ }
+
+ m_pActPathCombo->slotClearEdit();
+
+ // change views
+ m_pViewContents->clear();
+
+ m_pTabWidget->setTabEnabled( m_pViewElement, false );
+ m_pTabWidget->setTabEnabled( m_pViewContents, false );
+ m_pTabWidget->setTabEnabled( m_pViewProcInstr, false );
+
+ m_pTabWidget->showPage( m_pViewContents );
+
+ // change path combo
+ m_pActPathCombo->slotClearEdit();
+}
+
+void KXMLEditorPart::slotSelectionChanged( const QDomElement & selectedNode)
+{
+ // Enable/Disable actions
+ if(m_pBrowserExt)
+ m_pBrowserExt->emit enableAction( "copy", true );
+ else
+ m_pActEditCopy->setEnabled(true);
+
+ m_pActEditDeselect->setEnabled(true);
+ m_pActViewNodeUp->setEnabled( ! selectedNode.parentNode().isNull() ); // disable if it's a root item
+ m_pActViewExpNode->setEnabled( ! selectedNode.firstChild().isNull() ); // no childs -> disable
+ m_pActViewColNode->setEnabled( ! selectedNode.firstChild().isNull() ); // no childs -> disable
+ m_pActBookmarksToggle->setEnabled(true);
+
+ if ( isReadWrite() )
+ {
+ m_pActEditCut->setEnabled(true);
+ m_pActEditPaste->setEnabled(true);
+
+ m_pActXmlElementInsert->setEnabled(true);
+ m_pActXmlAttributesAdd->setEnabled(true);
+ m_pActXmlAttributesDel->setEnabled( (selectedNode.attributes().count() != 0) );
+ m_pActXmlProcInstrInsert->setEnabled(true);
+// m_pActXmlCharDataInsert->setEnabled(true);
+ m_pActInsertText->setEnabled(true);
+ m_pActInsertCDATA->setEnabled(true);
+ m_pActInsertComment->setEnabled(true);
+ m_pActDelete->setEnabled(true);
+ m_pActProperties->setEnabled(true);
+ m_pActEditRawXml->setEnabled(true);
+
+ if ( selectedNode.parentNode().isDocument() )
+ {
+ m_pActXmlMoveNodeUp->setEnabled(false);
+ m_pActXmlMoveNodeDown->setEnabled(false);
+ }
+ else
+ {
+ m_pActXmlMoveNodeUp->setEnabled( ! selectedNode.previousSibling().isNull() );
+ m_pActXmlMoveNodeDown->setEnabled( ! selectedNode.nextSibling().isNull() );
+ }
+ }
+
+ // change views
+ m_pViewElement->slotChange(selectedNode);
+
+ m_pTabWidget->setTabEnabled( m_pViewElement, true );
+ m_pTabWidget->setTabEnabled( m_pViewContents, false );
+ m_pTabWidget->setTabEnabled( m_pViewProcInstr, false );
+
+ m_pTabWidget->showPage(m_pViewElement);
+
+ // change path combo
+ m_pActPathCombo->insertItem( domTool_getIconForNodeType(selectedNode.nodeType(), false), domTool_getPath(selectedNode) );
+}
+
+void KXMLEditorPart::slotSelectionChanged( const QDomCharacterData & selectedNode )
+{
+ // Enable/Disable actions
+ if(m_pBrowserExt)
+ m_pBrowserExt->emit enableAction( "copy", true );
+ else
+ m_pActEditCopy->setEnabled(true);
+
+ m_pActEditDeselect->setEnabled(true);
+ m_pActViewNodeUp->setEnabled( ! selectedNode.parentNode().isNull() ); // disable if it's a root item
+ m_pActViewExpNode->setEnabled(false);
+ m_pActViewColNode->setEnabled(false);
+ m_pActBookmarksToggle->setEnabled(true);
+
+ if ( isReadWrite() )
+ {
+ m_pActEditCut->setEnabled(true);
+ m_pActEditPaste->setEnabled(true);
+
+ m_pActXmlElementInsert->setEnabled(false);
+ m_pActXmlAttributesAdd->setEnabled(false);
+ m_pActXmlAttributesDel->setEnabled(false);
+ m_pActXmlProcInstrInsert->setEnabled(false);
+ m_pActInsertText->setEnabled(false);
+ m_pActInsertCDATA->setEnabled(false);
+ m_pActInsertComment->setEnabled(false);
+ m_pActXmlMoveNodeUp->setEnabled( ! selectedNode.previousSibling().isNull() );
+ m_pActXmlMoveNodeDown->setEnabled( ! selectedNode.nextSibling().isNull() );
+ m_pActDelete->setEnabled(true);
+ m_pActProperties->setEnabled(true);
+ m_pActEditRawXml->setEnabled(false);
+ }
+
+ // change views
+ m_pViewContents->setText( selectedNode.data() );
+
+ m_pTabWidget->setTabEnabled( m_pViewElement, false );
+ m_pTabWidget->setTabEnabled( m_pViewContents, true );
+ m_pTabWidget->setTabEnabled( m_pViewProcInstr, false );
+
+ m_pTabWidget->showPage( m_pViewContents );
+
+ // change path combo
+ m_pActPathCombo->insertItem( domTool_getIconForNodeType(selectedNode.nodeType(), false), domTool_getPath(selectedNode) );
+}
+
+void KXMLEditorPart::slotSelectionChanged( const QDomProcessingInstruction & selectedNode )
+{
+ // Enable/Disable actions
+ if(m_pBrowserExt)
+ m_pBrowserExt->emit enableAction( "copy", true );
+ else
+ m_pActEditCopy->setEnabled(true);
+
+ m_pActEditDeselect->setEnabled(true);
+ m_pActViewNodeUp->setEnabled( ! selectedNode.parentNode().isNull() ); // disable if it's a root item
+ m_pActViewExpNode->setEnabled(false);
+ m_pActViewColNode->setEnabled(false);
+ m_pActBookmarksToggle->setEnabled(true);
+
+ if ( isReadWrite() )
+ {
+ m_pActEditCut->setEnabled(true);
+ m_pActEditPaste->setEnabled(true);
+
+ m_pActXmlAttributesAdd->setEnabled(false);
+ m_pActXmlAttributesDel->setEnabled(false);
+ m_pActXmlProcInstrInsert->setEnabled(false);
+ m_pActInsertText->setEnabled(false);
+ m_pActInsertCDATA->setEnabled(false);
+ m_pActInsertComment->setEnabled(false);
+ m_pActDelete->setEnabled(true);
+ m_pActProperties->setEnabled(true);
+ m_pActEditRawXml->setEnabled(false);
+ m_pActXmlElementInsert->setEnabled(selectedNode.parentNode().isDocument() &&
+ document()->documentElement().isNull());
+
+ if ( selectedNode.parentNode().isDocument() )
+ {
+ m_pActXmlMoveNodeUp->setEnabled(false);
+ m_pActXmlMoveNodeDown->setEnabled(false);
+ }
+ else
+ {
+ m_pActXmlMoveNodeUp->setEnabled( ! selectedNode.previousSibling().isNull() );
+ m_pActXmlMoveNodeDown->setEnabled( ! selectedNode.nextSibling().isNull() );
+ }
+ }
+
+ // change views
+ m_pViewProcInstr->setText( selectedNode.data() );
+
+ m_pTabWidget->setTabEnabled( m_pViewElement, false );
+ m_pTabWidget->setTabEnabled( m_pViewContents, false );
+ m_pTabWidget->setTabEnabled( m_pViewProcInstr, true );
+
+ m_pTabWidget->showPage( m_pViewProcInstr );
+
+ // change path combo
+ m_pActPathCombo->insertItem( domTool_getIconForNodeType(selectedNode.nodeType(), false), domTool_getPath(selectedNode) );
+}
+
+void KXMLEditorPart::slotContextMenuRequested( const QString & szMenuName, const QPoint & pos )
+{
+ QWidget * pContainer = hostContainer(szMenuName);
+
+ if ( ! pContainer )
+ {
+ kdError() << "KXMLEditor " << k_funcinfo << " Couldn't get a container widget for the given menu name (" << szMenuName << ")" << endl;
+ return;
+ }
+
+ if ( ! pContainer->inherits("KPopupMenu") )
+ {
+ kdError() << "KXMLEditor " << k_funcinfo << " Wrong container widget" << endl;
+ return;
+ }
+
+ KPopupMenu * pMenu = static_cast <KPopupMenu*> (pContainer);
+ pMenu->popup( pos );
+}
+
+
+/////////////////////////////////////////////////////////////////////
+// FUNCTIONS CALLED FROM KXECommand CHILD CLASSES
+/////////////////////////////////////////////////////////////////////
+
+void KXMLEditorPart::updateNodeCreated(const QDomNode & node)
+{
+ m_pViewTree->updateNodeCreated(node);
+}
+
+void KXMLEditorPart::updateNodeDeleted( const QDomNode & node )
+{
+ m_pViewTree->updateNodeDeleted(node);
+
+ // if root element deleted, enable Insert Element
+ if(node.isElement() && (m_pViewTree->firstChild() == 0) && (isReadWrite()))
+ m_pActXmlElementInsert->setEnabled(true);
+}
+
+void KXMLEditorPart::updateNodeChanged( const QDomElement & domElement )
+{
+ m_pViewTree->updateNodeChanged(domElement);
+ m_pViewElement->slotChange(domElement);
+}
+
+void KXMLEditorPart::updateNodeChanged( const QDomCharacterData & domCharData )
+{
+ m_pViewTree->updateNodeChanged(domCharData);
+ m_pViewContents->setText( domCharData.data() );
+}
+
+void KXMLEditorPart::updateNodeChanged( const QDomProcessingInstruction &domProcInstr )
+{
+ m_pViewTree->updateNodeChanged(domProcInstr);
+ m_pViewProcInstr->setText( domProcInstr.data() );
+}
+
+void KXMLEditorPart::updateNodeMoved( const QDomNode & domNode )
+{
+ m_pViewTree->updateNodeMoved(domNode);
+}
+
+
+bool KXMLEditorPart::slotFileSaveAs()
+{
+ emit setStatusBarText( i18n("Saving file with a new filename...") );
+
+ KFileDialog dlg( QDir::currentDirPath(), // start dir.
+ i18n(FILE_DIALOG_FILTER), // filter
+ widget(), // parent
+ "file dialog for saving", // name
+ true ); // modal
+ dlg.setCaption( i18n("Save as...") );
+ dlg.setOperationMode( KFileDialog::Saving );
+ dlg.exec();
+
+ KURL url = dlg.selectedURL();
+ bool bRetVal = false;
+
+ if(!url.isEmpty())
+ {
+ // append filetype if necessary
+ if(dlg.currentFilter() != "*.*")
+ { QString strExtension = dlg.currentFilter();
+ strExtension.remove('*');
+
+ if(strExtension != url.fileName().right(strExtension.length()))
+ url.setFileName(url.fileName() + strExtension );
+ }
+
+ if((bRetVal = saveAs(url))) // something may go wrong
+ {
+ emit sigAddRecentURL(url);
+ setModified(false);
+ }
+ }
+
+ emit setStatusBarText( i18n("Ready.") );
+ return bRetVal;
+}
+
+void KXMLEditorPart::slotDocOpened()
+{
+// I temporary introduced code to measure the loading time using
+// the different tree view item initialization modes.
+// Simply open a document, remember the measured time difference,
+// change the mode (in the configuration dialog), load the
+// same document again and compare the measurements.
+// Olaf
+//
+// TODO: the three lines operating with the QTime objects
+// can be removed later
+
+ // update the view
+ m_pViewTree->updateClear();
+ int i = document()->childNodes().length();
+ //QTime t1 = QTime::currentTime(); //TODO: remove this line later (Olaf)
+ while ( i > 0 )
+ {
+ i--;
+ m_pViewTree->updateNodeCreated( document()->childNodes().item(i) );
+ }
+
+ //QTime t2 = QTime::currentTime(); //TODO: remove this and the next line later (Olaf)
+ //kdDebug() << "KXMLEditorPart::slotDocOpened() time difference: " << t1.msecsTo(t2) << " msecs" << endl;
+
+ m_pActPathCombo->slotClear();
+}
+
+void KXMLEditorPart::setDocument(KXEDocument *pDocument)
+{
+ // detach previously used document
+ if (m_pDocument)
+ {
+ disconnect (m_pDocument,0,this,0);
+ }
+ m_pDocument = pDocument;
+ if (pDocument)
+ {
+ // open document notification
+ connect(pDocument,SIGNAL(sigOpened()),this,SLOT(slotDocOpened()));
+ // document modification is also dispatched
+ connect(pDocument,SIGNAL(sigModified(bool)),this,SLOT(setModified(bool)));
+ // update notifications
+ connect(pDocument,SIGNAL(sigNodeChanged(const QDomElement&)),this,SLOT(updateNodeChanged(const QDomElement&)));
+ connect(pDocument,SIGNAL(sigNodeChanged(const QDomProcessingInstruction&)),this,SLOT(updateNodeChanged(const QDomProcessingInstruction&)));
+ connect(pDocument,SIGNAL(sigNodeChanged(const QDomCharacterData&)),this,SLOT(updateNodeChanged(const QDomCharacterData&)));
+ connect(pDocument,SIGNAL(sigNodeCreated(const QDomNode&)),this,SLOT(updateNodeCreated(const QDomNode&)));
+ connect(pDocument,SIGNAL(sigNodeDeleted(const QDomNode&)),this,SLOT(updateNodeDeleted(const QDomNode&)));
+ connect(pDocument,SIGNAL(sigNodeMoved(const QDomNode&)),this,SLOT(updateNodeMoved(const QDomNode&)));
+ // merging document action collection
+ insertChildClient(pDocument);
+ }
+}
+
+void KXMLEditorPart::slotActRedo()
+{
+ m_pCmdHistory->redo();
+}
+
+void KXMLEditorPart::slotActUndo()
+{
+ m_pCmdHistory->undo();
+}
+
+void KXMLEditorPart::slotActDetachStylesheet()
+{
+ KCommand *pCmd = m_pDocument->actDetachStylesheet();
+ if(pCmd) m_pCmdHistory->addCommand(pCmd);
+}
+
+void KXMLEditorPart::slotActAttachStylesheet()
+{
+ KCommand *pCmd = m_pDocument->actAttachStylesheet();
+ if(pCmd) m_pCmdHistory->addCommand(pCmd);
+}
+
+void KXMLEditorPart::slotActDetachSchema()
+{
+ KCommand *pCmd = m_pDocument->actDetachSchema();
+ if(pCmd) m_pCmdHistory->addCommand(pCmd);
+}
+
+void KXMLEditorPart::slotActAttachSchema()
+{
+ KCommand *pCmd = m_pDocument->actAttachSchema();
+ if(pCmd) m_pCmdHistory->addCommand(pCmd);
+}
+
+// Instert or edit special processing instruction <?xml ... ?>
+void KXMLEditorPart::slotActVersionEncoding()
+{
+ KCommand *pCmd = m_pDocument->actVersionEncoding();
+ if(pCmd) m_pCmdHistory->addCommand(pCmd);
+}
+
+void KXMLEditorPart::updateActions()
+{
+ if(!m_pDocument) return;
+ if(!m_pActAttachSchema) return; // not in read-write mode
+
+ // Schema
+ bool bSchemaExists = !m_pDocument->documentElement().isNull() &&
+ // that's a question why it works with negated condition ??????
+ !m_pDocument->documentElement().hasAttributeNS(SCHEMA_NAMESPACE,SCHEMA_ATTRIBUTE);
+
+ m_pActAttachSchema->setEnabled(!m_pDocument->documentElement().isNull() && !bSchemaExists);
+ m_pActDetachSchema->setEnabled(bSchemaExists);
+
+ // Stylesheet
+ m_pActDetachStylesheet->setEnabled(!m_pDocument->getSpecProcInstr("xml-stylesheet").isNull());
+}
diff --git a/part/kxmleditorpart.desktop b/part/kxmleditorpart.desktop
new file mode 100644
index 0000000..8aa3b97
--- /dev/null
+++ b/part/kxmleditorpart.desktop
@@ -0,0 +1,11 @@
+# KDE Config File
+[Desktop Entry]
+Name=KXMLEditorPart
+Name[de]=KXMLEditor-Objekt
+MimeType=text/xml;
+ServiceTypes=KParts/ReadOnlyPart,KParts/ReadWritePart
+X-KDE-Library=libkxmleditorpart
+Type=Service
+Icon=kxmleditor.png
+MiniIcon=kxmleditor.png
+# DocPath=kxmleditor/index.html
diff --git a/part/kxmleditorpart.h b/part/kxmleditorpart.h
new file mode 100644
index 0000000..319c577
--- /dev/null
+++ b/part/kxmleditorpart.h
@@ -0,0 +1,450 @@
+/***************************************************************************
+ kxmleditorpart.h - description
+ -------------------
+ begin : Wed Sep 19 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : OleBowle@gmx.de
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
+
+#ifndef KXMLEDITORPART_H
+#define KXMLEDITORPART_H
+
+#include <kparts/part.h>
+#include <kparts/browserextension.h>
+
+#include <qdom.h>
+#include <qptrlist.h>
+
+#include "kxe_treeview.h"
+
+#define FILE_DIALOG_FILTER "*.xml|XML files\n*.xsl|XSL files\n*.xslt|XSLT files\n*.svg|SVG files\n*.xul|XUL files\n*.rc|Resource UI files\n*.ui|User Interface UI files\n*|All files"
+
+class QTabWidget;
+class KXE_ViewElement;
+class KXESearchDialog;
+class QTextEdit;
+class KAction;
+class KToolBarPopupAction;
+class KXmlEditorComboAction;
+class QDomNode;
+class QKeyEvent;
+class KXMLEditorPartIfaceReadOnly; // DCOP interface
+class KCommandHistory;
+class KPrinter;
+class QSplitter;
+class KXEDocument;
+
+
+/** @short This is the KPart of KXMLEditor. */
+class KXMLEditorPart : public KParts::ReadWritePart
+{
+ Q_OBJECT
+
+public:
+ /** @short Constructor
+
+ Creates the actions, the view (widgets) and changes to "begin state".
+ */
+ KXMLEditorPart( bool fReadWrite, KXEDocument* pDocument, QWidget * pParent, const char * pszName );
+
+ /** @short Destructor */
+ virtual ~KXMLEditorPart();
+
+ /** @short Changes the behaviour of this part to readonly or readwrite. */
+ virtual void setReadWrite( bool fReadWrite = true );
+
+ /** @short Returns the selected XML object's path or an empty string, if no object is selected. */
+ QString getSelectedPath() const { return m_pViewTree->getSelectedPath(); }
+
+ /** @short Copy XML node into clipboard */
+ QTextDrag * copyNode(QDomNode *);
+
+ /** @short Paste XML node from clipboard into document */
+ bool pasteNode(QDomNode *, QMimeSource *);
+
+ /** @short Drag&Drop move */
+ bool dropMoveNode(QDomElement &, QDomNode &);
+
+ /** @short Prints the document on specified printer.
+ @param pPrinter printer which will be used for printing. */
+ virtual void print(KPrinter* pPrinter);
+
+ /** @short Returns underlying document. */
+ KXEDocument* document() { return m_pDocument; }
+
+ /** @short Changes underlying document object */
+ void setDocument(KXEDocument *pDocument);
+
+public slots:
+ /**
+ * Reimplemented from @ref KParts::KReadWritePart::setModified.
+ *
+ * Alters the window caption according to the given flag and
+ * calls the base functionality.
+ */
+ virtual void setModified( bool fModified );
+
+ /** @short Updates tree view after creating new element */
+ void updateNodeCreated(const QDomNode & node);
+
+ /** @short Updates tree view after deleting new element */
+ void updateNodeDeleted(const QDomNode & node);
+
+ /** @short Updates tree view after change element properties */
+ void updateNodeChanged( const QDomElement & domElement );
+
+ /** @short Updates tree view after change char. data properties */
+ void updateNodeChanged( const QDomCharacterData & node ) ;
+
+ /** @short Updates tree view after change proc. instr. properties */
+ void updateNodeChanged( const QDomProcessingInstruction &domProcInstr );
+
+ /** @short Updates tree view after move node */
+ void updateNodeMoved( const QDomNode & node );
+
+ /**
+ * @short Reimplemented from @ref KParts::KReadWritePart::setModified.
+ */
+ virtual void setModified() { setModified(true); }
+
+ /** @short Slot connected to File->Save As action. */
+ bool slotFileSaveAs();
+
+ /** @short Inserts special proc.instruction into document. */
+ void slotActVersionEncoding();
+
+ /** @short Called on user's action response.
+ Creates <?xml-stylesheet ...?> processing instruction
+ with reference to specified stylesheet URI.
+ */
+ void slotActAttachStylesheet();
+
+ /** @short Called on user's action response. */
+ void slotActDetachStylesheet();
+
+ /** @short Called on user's action response */
+ void slotActDetachSchema();
+
+ /** @short Called on user's action response */
+ void slotActAttachSchema();
+
+ /** @short Cut the marked text/object into the clipboard */
+ void slotEditCut();
+
+ /** @short Copy the marked text/object into the clipboard */
+ void slotEditCopy();
+
+ /** @short Paste the clipboard into the document */
+ void slotEditPaste();
+
+ /** @short Displays search dialog and finds string in this tree view */
+ void slotEditFind();
+
+ /** @short Finds next occurence of string in this tree view */
+ void slotEditFindNext();
+
+ /** @short Deselects currently selected item */
+ void slotEditDeselect() { m_pViewTree->editDeselect(); }
+
+ /** @short Selects the selected item's parent item. */
+ void slotViewNodeUp() { m_pViewTree->viewNodeUp(); }
+
+ /** @short Expands the selected tree item's subtree. */
+ void slotViewExpNode() { m_pViewTree->viewExpNode(-1); }
+
+ /** @short Expands the selected tree item's subtree to the given level. */
+ void slotViewExpNode( int nLevel ) { m_pViewTree->viewExpNode(nLevel); }
+
+ /** @short Collapses the selected tree item's subtree. */
+ void slotViewColNode() { m_pViewTree->viewColNode(0); }
+
+ /** @short Collapses the selected tree item's subtree to the given level. */
+ void slotViewColNode( int nLevel ) { m_pViewTree->viewColNode(nLevel); }
+
+ /** @short Insert XML element into document */
+ void slotXmlElementInsert();
+
+ /** @short Edit XML element */
+ void slotXmlElementEdit();
+
+ /** @short Add attribute to an XML element. */
+ void slotXmlAttributesAdd();
+
+ /** @short Delete all attributes of an XML element. */
+ void slotXmlAttributesDel();
+
+ /** @short Delete an attribute of an XML element. */
+ void slotXmlAttributeDel();
+
+ /** @short Insert proc.instruction into document */
+ void slotXmlProcInstrInsert();
+
+ /** @short Edit proc.instruction */
+ void slotXmlProcInstrEdit();
+
+ /* @short Insert text into element. */
+ void slotActInsertText();
+
+ /* @short Insert CDATA section. */
+ void slotActInsertCDATA();
+
+ /* @short Insert comment to element. */
+ void slotActInsertComment();
+
+ /* @short Edit character data */
+ void slotXmlCharDataEdit();
+
+ /* @short Moves a node up (change its position with its prev. siblings position) */
+ void slotXmlMoveNodeUp();
+
+ /* @short Moves a node down (change its position with its next siblings position) */
+ void slotXmlMoveNodeDown();
+
+ /** @short toggles bookmark on the selected item */
+ void slotBookmarksToggle();
+
+ /** @short Searches for the previous bookmarked item */
+ void slotBookmarksPrev() { m_pViewTree->bookmarksPrev(); }
+
+ /** @short Searches for the next bookmarked item */
+ void slotBookmarksNext() { m_pViewTree->bookmarksNext(); }
+
+ /** @short Shows configuration dialog (@ref OptionsDialog) */
+ void slotConfigure();
+
+ void slotPathSelected( const QString & szPath );
+ void slotPathSelected();
+ void slotPathClear();
+
+ /** @short Called when a tree view items text was changed via inplace-renaming. */
+ void slotItemRenamedInplace( QListViewItem * pItem );
+
+ /** @short Called whan an attributes name was changed via inplace editing. */
+ void slotAttributeNameChangedInplace( const QDomAttr &, const QString );
+
+ /** @short Called whan an attributes value was changed via inplace editing. */
+ void slotAttributeValueChangedInplace( const QDomAttr &, const QString );
+
+ /** @short Called when File->Print or icon from the toolbar is selected. */
+ void slotActPrint();
+
+ /** @short Slot for editing node properties. */
+ void slotActProperties();
+
+ /** @short Slot for editing xml as a text in separate dialog window. */
+ void slotActEditRawXml();
+
+ /** @short Slot for removing XML nodes. */
+ void slotActDelete();
+
+ void slotTreeViewKeyPressed(QKeyEvent *e);
+
+ /** @short Slot that performs redo function. */
+ void slotActRedo();
+
+ /** @short Slot that performs undo function. */
+ void slotActUndo();
+
+protected:
+
+ void updateActions();
+
+ /** @short Opens the file @ref KParts::ReadOnlyPart::m_file. */
+ virtual bool openFile();
+
+ /** @short Saves the file @ref KParts::ReadOnlyPart::m_file. */
+ virtual bool saveFile();
+
+ /** @short Draws header for printouts (made of file name).
+ @param painter a painter to use for drawing
+ @param pageNumber number of currently drawn page counted from 0
+ @param ypos y coordinate of upper border of the header
+ @sa printPage() @sa printFooter()
+ */
+ void printHeader(QPainter* painter, int pageNumber, int ypos, int width);
+
+ /** @short Draws footer for printouts (page number).
+ @param painter a painter to use for drawing
+ @param pageNumber number of currently drawn page counted from 0
+ @param ypos y coordinate of upper border of the footer
+ @sa printHeader() @sa printFooter()
+ */
+ void printFooter(QPainter* painter,int pageNumber, int ypos, int width);
+
+ /** @short Draws page for printing purposes.
+
+ If there are more pages to print, method
+ returns true. Otherwise returns false.
+ @param painter a painter to use for srawing
+ @param pageNumber number of currently drawn page counted from 0
+ @param top y coordinate of upper edge from where page should be drawn
+ @param width,height size of the medium (e.g. paper)
+ @sa printPage() @sa printHeader()
+ */
+ bool printPage(QPainter* painter,int pageNumber, int top, int width, int height);
+
+ /** @short Used in printing function printPage(). */
+ unsigned int m_printLineNumber;
+
+ /** @short Used in printing function printPage(). */
+ QStringList m_printLines;
+
+ // the actions
+ KAction * m_pActEditFind;
+ KAction * m_pActEditFindNext;
+ KAction * m_pActEditDeselect;
+ KAction * m_pActViewNodeUp;
+ KToolBarPopupAction * m_pActViewExpNode;
+ KToolBarPopupAction * m_pActViewColNode;
+ KAction * m_pActXmlElementInsert;
+ KAction * m_pActXmlAttributesAdd;
+ KAction * m_pActXmlAttributesDel;
+ KAction * m_pActXmlAttributeDel;
+ KAction * m_pActXmlProcInstrInsert;
+ KAction * m_pActInsertText;
+ KAction * m_pActInsertCDATA;
+ KAction * m_pActInsertComment;
+ KAction * m_pActXmlMoveNodeUp;
+ KAction * m_pActXmlMoveNodeDown;
+ KAction * m_pActBookmarksToggle;
+ KAction * m_pActBookmarksPrev;
+ KAction * m_pActBookmarksNext;
+ KXmlEditorComboAction * m_pActPathCombo;
+
+ protected slots:
+ void started();
+ void completed();
+ void canceled();
+
+ /** @short Enables/disables actions and changes views */
+ void slotSelectionCleared(bool);
+
+ /** @short Enables/disables actions depending on the given XML element and changes views */
+ void slotSelectionChanged( const QDomElement & );
+
+ /** @short Enables/disables actions and changes views */
+ void slotSelectionChanged( const QDomCharacterData & );
+
+ /** @short Enables/disables actions and changes views */
+ void slotSelectionChanged( const QDomProcessingInstruction & );
+
+ /** @short Shows the requested context menu at the given position. */
+ void slotContextMenuRequested( const QString & szMenuName, const QPoint & pos );
+
+ /** @short Invoked everytime document has new content */
+ void slotDocOpened();
+
+ private:
+ /** this view displays the XML-document's tree structure */
+ KXE_TreeView * m_pViewTree;
+
+ /** the tab widget, contains: m_pViewElement, m_pViewContents */
+ QTabWidget * m_pTabWidget;
+
+ /** widget to display XML element */
+ KXE_ViewElement * m_pViewElement;
+
+ /** edit widget for contents */
+ QTextEdit * m_pViewContents;
+
+ /** widget to display a proc.instr. */
+ QTextEdit * m_pViewProcInstr;
+
+ /** the search dialog, used for find action */
+ KXESearchDialog * m_pDlgSearch;
+
+ /** DCOP object having access to XML document. It may by NULL if no DCOP inteface is provided
+ or read only privided by @ref KXMLEditorPartReadOnlyIface or full read-write @ref KXMLEditorPartIface .*/
+ KXMLEditorPartIfaceReadOnly * m_pDCOPIface;
+
+ bool m_bAlreadyModified;
+
+ /** our browser extension */
+ KParts::BrowserExtension * m_pBrowserExt;
+
+ /** @short Stores pointer to command history list, which provide undo/redo functionality */
+ KCommandHistory* m_pCmdHistory;
+
+ /** @short Action for cutting nodes to clipboard.*/
+ KAction* m_pActEditCut;
+
+ /** @short Action for copying nodes to clipboard.*/
+ KAction* m_pActEditCopy;
+
+ /** @short Action for pasting nodes from clipboard.*/
+ KAction* m_pActEditPaste;
+
+ /** Action for editing properties of currently selected node. */
+ KAction* m_pActProperties;
+
+ /** Action for editing raw XML of currently selected node. */
+ KAction* m_pActEditRawXml;
+
+ /** Action for deleting currently selected node. */
+ KAction* m_pActDelete;
+
+ /** @short Action for changing version and encoding of XM file. */
+ KAction* m_pActVersionEncoding;
+
+ /** @short Action for attaching stylehseets to xml files. */
+ KAction* m_pActAttachStylesheet;
+
+ /** @short Action for detaching stylehseets from xml files. */
+ KAction* m_pActDetachStylesheet;
+
+ /** @short Action for attaching schemas to xml files. */
+ KAction* m_pActAttachSchema;
+
+ /** @short Action for detaching schemas from xml files. */
+ KAction* m_pActDetachSchema;
+
+ /** Printer object. */
+ KPrinter *m_pPrinter;
+
+ /** spitter - main widget in the part */
+ QSplitter *pSplitter;
+
+ /** Pointer to underlying KXEDocument object */
+ KXEDocument* m_pDocument;
+
+signals:
+ // Add URL to recent file list
+ void sigAddRecentURL(const KURL &);
+};
+
+/**
+ * The browser extension for our part (@ref KXMLEditorPart).
+ */
+class KXMLEditorBrowserExtension : public KParts::BrowserExtension
+{
+ Q_OBJECT
+
+ public:
+ /** @short Constructor */
+ KXMLEditorBrowserExtension( KXMLEditorPart * pParent, const char * pszName = "KXMLEditorBrowserExtension" )
+ : KParts::BrowserExtension( pParent, pszName ),
+ m_pPart(pParent)
+ { emit enableAction("print", true); }
+
+ public slots:
+ void slotEditCut() { m_pPart->slotEditCut(); }
+ void slotEditCopy() { m_pPart->slotEditCopy(); }
+ void slotEditPaste() { m_pPart->slotEditPaste(); }
+ void print() { m_pPart->slotActPrint(); }
+
+ protected:
+ /** @short Stores pointer to the part. */
+ KXMLEditorPart * m_pPart;
+};
+
+#endif
+
diff --git a/part/kxmleditorpartBrowseUI.rc b/part/kxmleditorpartBrowseUI.rc
new file mode 100644
index 0000000..cc939bf
--- /dev/null
+++ b/part/kxmleditorpartBrowseUI.rc
@@ -0,0 +1,81 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kxmleditorpart" version="1">
+<MenuBar>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <Separator/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="edit_find"/>
+ <Action name="edit_find_next"/>
+ </Menu>
+ <Menu name="view"><text>&amp;View</text>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Action name="treeitem_expand"/>
+ <Action name="treeitem_collapse"/>
+ </Menu>
+ <Menu name="bookmarks"><text>&amp;Bookmarks</text>
+ <Action name="bookmark_toggle"/>
+ <Action name="bookmark_prev"/>
+ <Action name="bookmark_next"/>
+ </Menu>
+ <Menu name="settings"><text>&amp;Settings</text>
+ <Action name="configure"/>
+ </Menu>
+</MenuBar>
+
+<Menu name="popupXmlElement">
+ <Title>XML Element</Title>
+ <Action name="treeitem_up"/>
+ <Action name="treeitem_expand"/>
+ <Action name="treeitem_collapse"/>
+ <Separator/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+</Menu>
+
+<Menu name="popupXmlContent">
+ <Title>XML Content</Title>
+ <Action name="treeitem_up"/>
+ <Separator/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+</Menu>
+
+<Menu name="popupXmlProcInstr">
+ <Title>XML Proc.Instruction</Title>
+ <Action name="treeitem_up"/>
+ <Separator/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+</Menu>
+
+<Menu name="popupXmlTree">
+ <Title>XML Tree</Title>
+ <Action name="deselect"/>
+</Menu>
+
+<ToolBar name="mainToolBar">
+ <text>Main Toolbar</text>
+ <Action name="find"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+ <Action name="bookmark_prev"/>
+ <Action name="bookmark_next"/>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Action name="treeitem_expand"/>
+ <Action name="treeitem_collapse"/>
+</ToolBar>
+
+<ToolBar fullWidth="true" name="pathToolBar" newline="true">
+ <text>Path Toolbar</text>
+ <Action name="path_clear"/>
+ <Action name="path_label"/>
+ <Action name="path_combo"/>
+</ToolBar>
+
+</kpartgui>
diff --git a/part/kxmleditorpartEditUI.rc b/part/kxmleditorpartEditUI.rc
new file mode 100644
index 0000000..d4f65e1
--- /dev/null
+++ b/part/kxmleditorpartEditUI.rc
@@ -0,0 +1,186 @@
+<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
+<kpartgui name="kxmleditorpart" version="1">
+<MenuBar>
+ <Menu name="file"><text>&amp;File</text>
+ <Action name="file_save" />
+ <action name="file_save_as"/>
+ <Separator lineSeparator="true"/>
+ <Action name="xml_ins_spec_procins"/>
+ <Separator lineSeparator="true"/>
+ <Action name="xml_attach_schema"/>
+ <Action name="xml_detach_schema"/>
+ <Action name="xml_attach_stylesheet"/>
+ <Action name="xml_detach_stylesheet"/>
+ <Separator lineSeparator="true"/>
+ <Action name="print"/>
+ <Separator lineSeparator="true"/>
+ </Menu>
+ <Menu name="edit"><text>&amp;Edit</text>
+ <Action name="edit_undo" group="edit_operations"/>
+ <Action name="edit_redo" group="edit_operations"/>
+ <Separator/>
+ <Action name="edit_cut" group="edit_operations"/>
+ <Action name="edit_copy" group="edit_operations"/>
+ <Action name="edit_paste" group="edit_operations"/>
+ <Separator/>
+ <Action name="edit_delete" group="edit_operations"/>
+ <Action name="xml_del_attributes" group="edit_operations"/>
+ <Separator lineSeparator="true"/>
+ <Action name="xml_move_item_up"/>
+ <Action name="xml_move_item_down"/>
+ <Action name="deselect"/>
+ <Separator lineSeparator="true"/>
+ <Action name="edit_find"/>
+ <Action name="edit_find_next"/>
+ <Separator lineSeparator="true"/>
+ <Action name="edit_properties"/>
+ <Action name="edit_as_raw_xml"/>
+ </Menu>
+ <Menu name="view"><text>&amp;View</text>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Action name="treeitem_expand"/>
+ <Action name="treeitem_collapse"/>
+ </Menu>
+ <Menu name="insert"><text>&amp;Insert</text>
+ <Action name="xml_ins_element"/>
+ <Action name="xml_add_attribute"/>
+ <Action name="insert_text"/>
+ <Action name="insert_cdata"/>
+ <Action name="insert_comment"/>
+ <Action name="xml_ins_procins"/>
+ </Menu>
+ <Menu name="bookmarks"><text>&amp;Bookmarks</text>
+ <Action name="bookmark_toggle"/>
+ <Action name="bookmark_prev"/>
+ <Action name="bookmark_next"/>
+ </Menu>
+ <Menu name="settings"><text>&amp;Settings</text>
+ <Action name="configure"/>
+ </Menu>
+ <Merge/>
+</MenuBar>
+
+<Menu name="popupXmlElement">
+ <Title>XML Element</Title>
+ <Action name="edit_properties"/>
+ <Action name="edit_as_raw_xml"/>
+ <Separator/>
+ <Action name="xml_ins_element"/>
+ <Action name="xml_add_attribute"/>
+ <Action name="insert_text"/>
+ <Action name="insert_cdata"/>
+ <Action name="insert_comment"/>
+ <Action name="xml_ins_procins"/>
+ <Separator/>
+ <Action name="edit_delete"/>
+ <Action name="xml_del_attributes"/>
+ <Separator/>
+ <Action name="xml_move_item_up"/>
+ <Action name="xml_move_item_down"/>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Action name="treeitem_expand"/>
+ <Action name="treeitem_collapse"/>
+ <Separator/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+</Menu>
+
+<Menu name="popupXmlContent">
+ <Title>XML Content</Title>
+ <Action name="edit_properties"/>
+ <Separator/>
+ <Action name="xml_move_item_up"/>
+ <Action name="xml_move_item_down"/>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Separator/>
+ <Action name="edit_delete"/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+</Menu>
+
+<Menu name="popupXmlProcInstr">
+ <Title>XML Proc.Instruction</Title>
+ <Action name="edit_properties"/>
+ <Separator/>
+ <Action name="xml_move_item_up"/>
+ <Action name="xml_move_item_down"/>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Separator/>
+ <Action name="edit_delete"/>
+ <Action name="deselect"/>
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+</Menu>
+
+<Menu name="popupXmlTree">
+ <Title>XML Tree</Title>
+ <Action name="xml_ins_element"/>
+ <Action name="xml_ins_procins"/>
+ <Separator/>
+ <Action name="deselect"/>
+</Menu>
+
+<Menu name="popupXmlAttribute">
+ <Title>XML Attribute</Title>
+ <Action name="xml_add_attribute"/>
+ <Separator/>
+ <Action name="xml_del_attribute"/>
+</Menu>
+
+<Menu name="popupXmlAttributes">
+ <Title>XML Attributes</Title>
+ <Action name="xml_add_attribute"/>
+</Menu>
+
+<ToolBar name="mainToolBar">
+ <text>Main Toolbar</text>
+ <Action name="file_save" group="file_operations" />
+ <action name="file_save_as" group="file_operations" />
+ <Action name="print" group="file_operations" />
+ <Separator/>
+ <Action name="edit_cut" group="edit_operations" />
+ <Action name="edit_copy" group="edit_operations" />
+ <Action name="edit_paste" group="edit_operations" />
+ <Separator/>
+ <Action name="edit_undo" group="edit_operations" />
+ <Action name="edit_redo" group="edit_operations" />
+ <Action name="edit_delete" group="edit_operations" />
+ <Action name="edit_find" group="edit_operations" />
+ <Separator/>
+ <Action name="bookmark_toggle"/>
+ <Action name="bookmark_prev"/>
+ <Action name="bookmark_next"/>
+ <Separator/>
+ <Action name="treeitem_up"/>
+ <Action name="treeitem_expand"/>
+ <Action name="treeitem_collapse"/>
+</ToolBar>
+
+<ToolBar fullWidth="true" name="pathToolBar" newline="true">
+ <text>Path Toolbar</text>
+ <Action name="path_clear"/>
+ <Action name="path_label"/>
+ <Action name="path_combo"/>
+</ToolBar>
+
+<ToolBar fullWidth="true" name="xmlToolBar" position="left">
+ <text>XML Toolbar</text>
+ <Action name="xml_ins_element"/>
+ <Action name="xml_add_attribute"/>
+ <Action name="insert_text"/>
+ <Action name="insert_cdata"/>
+ <Action name="insert_comment"/>
+ <Action name="xml_ins_procins"/>
+ <Action name="edit_properties"/>
+ <Separator lineSeparator="true"/>
+ <Action name="xml_move_item_up"/>
+ <Action name="xml_move_item_down"/>
+</ToolBar>
+
+</kpartgui>
diff --git a/part/pics/Makefile.am b/part/pics/Makefile.am
new file mode 100644
index 0000000..a291541
--- /dev/null
+++ b/part/pics/Makefile.am
@@ -0,0 +1,38 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+EXTRA_DIST = xml_attribute.png xml_cdata.png xml_comment.png xml_element.png xml_text.png xml_procinstr.png xml_cdata_b.png xml_comment_b.png xml_element_b.png xml_text_b.png xml_procinstr_b.png
+
+install-data-local:
+ $(mkinstalldirs) $(kde_datadir)/kxmleditor/
+ $(mkinstalldirs) $(kde_datadir)/kxmleditor/pics/
+ $(INSTALL_DATA) $(srcdir)/xml_attribute.png $(kde_datadir)/kxmleditor/pics/xml_attribute.png
+ $(INSTALL_DATA) $(srcdir)/xml_cdata.png $(kde_datadir)/kxmleditor/pics/xml_cdata.png
+ $(INSTALL_DATA) $(srcdir)/xml_contents.png $(kde_datadir)/kxmleditor/pics/xml_contents.png
+ $(INSTALL_DATA) $(srcdir)/xml_comment.png $(kde_datadir)/kxmleditor/pics/xml_comment.png
+ $(INSTALL_DATA) $(srcdir)/xml_element.png $(kde_datadir)/kxmleditor/pics/xml_element.png
+ $(INSTALL_DATA) $(srcdir)/xml_text.png $(kde_datadir)/kxmleditor/pics/xml_text.png
+ $(INSTALL_DATA) $(srcdir)/xml_procinstr.png $(kde_datadir)/kxmleditor/pics/xml_procinstr.png
+ $(INSTALL_DATA) $(srcdir)/xml_cdata_b.png $(kde_datadir)/kxmleditor/pics/xml_cdata_b.png
+ $(INSTALL_DATA) $(srcdir)/xml_contents_b.png $(kde_datadir)/kxmleditor/pics/xml_contents_b.png
+ $(INSTALL_DATA) $(srcdir)/xml_comment_b.png $(kde_datadir)/kxmleditor/pics/xml_comment_b.png
+ $(INSTALL_DATA) $(srcdir)/xml_element_b.png $(kde_datadir)/kxmleditor/pics/xml_element_b.png
+ $(INSTALL_DATA) $(srcdir)/xml_text_b.png $(kde_datadir)/kxmleditor/pics/xml_text_b.png
+ $(INSTALL_DATA) $(srcdir)/xml_procinstr_b.png $(kde_datadir)/kxmleditor/pics/xml_procinstr_b.png
+
+uninstall-local:
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_attribute.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_cdata.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_contents.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_comment.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_element.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_text.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_procinstr.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_cdata_b.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_contents_b.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_comment_b.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_element_b.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_text_b.png
+ -rm -f $(kde_datadir)/kxmleditor/pics/xml_procinstr_b.png
+ -rmdir $(kde_datadir)/kxmleditor/pics
+
+####### kdevelop will overwrite this part!!! (end)############
diff --git a/part/pics/xml_attribute.png b/part/pics/xml_attribute.png
new file mode 100644
index 0000000..56063b0
--- /dev/null
+++ b/part/pics/xml_attribute.png
Binary files differ
diff --git a/part/pics/xml_cdata.png b/part/pics/xml_cdata.png
new file mode 100644
index 0000000..69950ea
--- /dev/null
+++ b/part/pics/xml_cdata.png
Binary files differ
diff --git a/part/pics/xml_cdata_b.png b/part/pics/xml_cdata_b.png
new file mode 100644
index 0000000..42e1b07
--- /dev/null
+++ b/part/pics/xml_cdata_b.png
Binary files differ
diff --git a/part/pics/xml_comment.png b/part/pics/xml_comment.png
new file mode 100644
index 0000000..ba37057
--- /dev/null
+++ b/part/pics/xml_comment.png
Binary files differ
diff --git a/part/pics/xml_comment_b.png b/part/pics/xml_comment_b.png
new file mode 100644
index 0000000..81fb79d
--- /dev/null
+++ b/part/pics/xml_comment_b.png
Binary files differ
diff --git a/part/pics/xml_contents.png b/part/pics/xml_contents.png
new file mode 100644
index 0000000..d17730e
--- /dev/null
+++ b/part/pics/xml_contents.png
Binary files differ
diff --git a/part/pics/xml_contents_b.png b/part/pics/xml_contents_b.png
new file mode 100644
index 0000000..b134b9d
--- /dev/null
+++ b/part/pics/xml_contents_b.png
Binary files differ
diff --git a/part/pics/xml_element.png b/part/pics/xml_element.png
new file mode 100644
index 0000000..6bd8993
--- /dev/null
+++ b/part/pics/xml_element.png
Binary files differ
diff --git a/part/pics/xml_element_b.png b/part/pics/xml_element_b.png
new file mode 100644
index 0000000..88b623b
--- /dev/null
+++ b/part/pics/xml_element_b.png
Binary files differ
diff --git a/part/pics/xml_procinstr.png b/part/pics/xml_procinstr.png
new file mode 100644
index 0000000..90178b7
--- /dev/null
+++ b/part/pics/xml_procinstr.png
Binary files differ
diff --git a/part/pics/xml_procinstr_b.png b/part/pics/xml_procinstr_b.png
new file mode 100644
index 0000000..d854262
--- /dev/null
+++ b/part/pics/xml_procinstr_b.png
Binary files differ
diff --git a/part/pics/xml_text.png b/part/pics/xml_text.png
new file mode 100644
index 0000000..fd477a7
--- /dev/null
+++ b/part/pics/xml_text.png
Binary files differ
diff --git a/part/pics/xml_text_b.png b/part/pics/xml_text_b.png
new file mode 100644
index 0000000..0fb8946
--- /dev/null
+++ b/part/pics/xml_text_b.png
Binary files differ
diff --git a/part/qdom_add.cpp b/part/qdom_add.cpp
new file mode 100644
index 0000000..142b873
--- /dev/null
+++ b/part/qdom_add.cpp
@@ -0,0 +1,352 @@
+/***************************************************************************
+ qdom_add.cpp - description
+ -------------------
+ begin : Wed Nov 21 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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 file contains useful datatypes and functions in addition to the Qt DOM classes. */
+
+#include "qdom_add.h"
+
+#include <kiconloader.h>
+#include <kdebug.h>
+
+#include <qtextstream.h>
+
+#include "kxmleditorfactory.h"
+#include "kxesearchdialog.h"
+
+QPixmap g_iconElement( UserIcon("xml_element",KXMLEditorFactory::instance()) );
+QPixmap g_iconText( UserIcon("xml_text",KXMLEditorFactory::instance()) );
+QPixmap g_iconComment( UserIcon("xml_comment",KXMLEditorFactory::instance()) );
+QPixmap g_iconCDATASection( UserIcon("xml_cdata",KXMLEditorFactory::instance()) );
+QPixmap g_iconProcessingInstruction( UserIcon("xml_procinstr",KXMLEditorFactory::instance()) );
+QPixmap g_iconElement_b( UserIcon("xml_element_b",KXMLEditorFactory::instance()) );
+QPixmap g_iconText_b( UserIcon("xml_text_b",KXMLEditorFactory::instance()) );
+QPixmap g_iconComment_b( UserIcon("xml_comment_b",KXMLEditorFactory::instance()) );
+QPixmap g_iconCDATASection_b( UserIcon("xml_cdata_b",KXMLEditorFactory::instance()) );
+QPixmap g_iconProcessingInstruction_b( UserIcon("xml_procinstr_b",KXMLEditorFactory::instance()) );
+QPixmap g_iconUnknown;
+
+const QPixmap & domTool_getIconForNodeType( QDomNode::NodeType type, bool bBookmarked )
+{
+ if(!bBookmarked)
+ { switch(type)
+ { case QDomNode::ElementNode: return g_iconElement; break;
+ case QDomNode::TextNode: return g_iconText; break;
+ case QDomNode::CDATASectionNode: return g_iconCDATASection; break;
+ case QDomNode::CommentNode: return g_iconComment; break;
+ case QDomNode::ProcessingInstructionNode: return g_iconProcessingInstruction; break;
+
+ default:
+ kdDebug() << "domTool_getIconForNodeType: unknown node type (" << type << ")" << endl;
+ }
+ }
+ else
+ { switch(type)
+ { case QDomNode::ElementNode: return g_iconElement_b; break;
+ case QDomNode::TextNode: return g_iconText_b; break;
+ case QDomNode::CDATASectionNode: return g_iconCDATASection_b; break;
+ case QDomNode::CommentNode: return g_iconComment_b; break;
+ case QDomNode::ProcessingInstructionNode: return g_iconProcessingInstruction_b; break;
+
+ default:
+ kdDebug() << "domTool_getIconForNodeType: unknown node type (" << type << ")" << endl;
+ }
+ }
+ return g_iconUnknown;
+}
+
+// Obtain XPath for all nodes, instead of elements
+QString domTool_getPath( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdDebug() << "domTool_getPath: elelent given" << endl;
+ return QString();
+ }
+
+ if(node.isElement())
+ {
+ kdDebug() << "use domTool_getPath( const QDomElement & domElement ) for elements" << endl;
+ }
+
+ QString strReturn;
+
+ QDomNode parentNode = node.parentNode();
+ if ( (!parentNode.isNull()) && (!parentNode.isDocument()) )
+ {
+ strReturn = domTool_getPath( parentNode.toElement() ); // get the parent's path
+ strReturn += "/"; // append slash
+ strReturn += node.nodeName(); // append the given node's name
+ }
+ else
+ strReturn = node.nodeName(); // set the given node's name (must be root element)
+
+ return strReturn;
+}
+
+// Obtain XPath for elements
+QString domTool_getPath( const QDomElement & domElement )
+{
+ if ( domElement.isNull() )
+ {
+ kdDebug() << "domTool_getPath: no node given" << endl;
+ return QString();
+ }
+
+ QString strReturn;
+ QDomNode parentNode = domElement.parentNode();
+ if ( (!parentNode.isNull()) && (!parentNode.isDocument()) )
+ {
+ // calculate index - only for elements with the same name
+ int i = 0;
+ bool bUseIndex = false; // index is used only when exist sibling(s) with the same name
+
+ // traverse previous sibling elements with same name and calculate index
+ QDomNode tmpNode = domElement.previousSibling();
+ while ( ! tmpNode.isNull() )
+ {
+ if(tmpNode.isElement())
+ {
+ QDomElement domSiblingElement = tmpNode.toElement();
+
+ if(domElement.tagName() == domSiblingElement.tagName())
+ { i++; bUseIndex = true;
+ }
+ }
+ tmpNode = tmpNode.previousSibling();
+ }
+
+ if(bUseIndex == false)
+ {
+ // traverse next sibling elements with same name
+ // and decide, if index is necessary
+ QDomNode tmpNode = domElement.nextSibling();
+ while ( ! tmpNode.isNull() )
+ {
+ if(tmpNode.isElement())
+ {
+ QDomElement domSiblingElement = tmpNode.toElement();
+
+ if(domElement.tagName() == domSiblingElement.tagName())
+ bUseIndex = true;
+ }
+
+ tmpNode = tmpNode.nextSibling();
+
+ }
+ }
+
+ strReturn = domTool_getPath( parentNode.toElement() ); // get the parent's path
+ strReturn += "/"; // append slash
+ strReturn += domElement.nodeName(); // append the given node's name
+
+ if(bUseIndex)
+ {
+ QString strIndex;
+ strIndex.setNum(i+1);
+ strReturn += "[" + strIndex + "]"; // append the index
+ }
+ }
+ else
+ strReturn = domElement.nodeName(); // set the given node's name (must be root element)
+
+ return strReturn;
+}
+
+unsigned int domTool_getLevel( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdDebug() << "domTool_getLevel: internal implementation error - the given node is an empty one" << endl;
+ return 0;
+ }
+
+ unsigned int iLevel = 0;
+ QDomNode parentNode = node.parentNode();
+ while ( ! parentNode.isNull() )
+ {
+ iLevel++;
+ parentNode = parentNode.parentNode();
+ }
+
+ return iLevel - 1;
+}
+
+QString domTool_save( const QDomNode & node, int iIndent )
+{
+ QString strXML;
+ QTextStream ts( & strXML, IO_WriteOnly );
+
+ node.save(ts, iIndent);
+ return strXML;
+}
+
+QDomNode domTool_prevNode( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdDebug() << "domTool_prevNode: internal implementation error - the given node is an empty one" << endl;
+ return QDomNode();
+ }
+
+ if ( ! node.previousSibling().isNull() ) // if there is a prev. sibling
+ { // return its last grand child (if there is any)
+ QDomNode prevNode = node.previousSibling();
+ while ( ! prevNode.lastChild().isNull() )
+ prevNode = prevNode.lastChild();
+ return prevNode;
+ }
+ else // if there is no prev. sibling, return
+ return node.parentNode(); // the nodes parent (if there is any)
+
+}
+
+QDomNode domTool_nextNode( const QDomNode & node )
+{
+ if ( node.isNull() )
+ {
+ kdDebug() << "domTool_nextNode: internal implementation error - the given node is an empty one" << endl;
+ return QDomNode();
+ }
+
+ // checking for a child
+ if ( ! node.firstChild().isNull() )
+ return node.firstChild();
+
+ // there is no child -> checking for the next sibling
+ if ( ! node.nextSibling().isNull() )
+ return node.nextSibling();
+
+ // there is no next sibling -> checking for parents' next sibling(s)
+ QDomNode nodeParent = node.parentNode();
+ while ( ! nodeParent.isNull() )
+ {
+ if ( ! nodeParent.nextSibling().isNull() )
+ return nodeParent.nextSibling();
+
+ nodeParent = nodeParent.parentNode(); // parent has no sibling - try its parent
+ }
+
+ // parent has no parents anymore
+ return QDomNode(); // return empty node
+}
+
+QDomNode domTool_matchingNode( const QDomNode & node, const QString & szPath )
+{
+ if(szPath.length() == 0)
+ return QDomNode(); // return void node
+
+ QString szNodePath = node.isDocument() ? QString("") : domTool_getPath(node);
+ if ( szPath == szNodePath ) // test if the strings match
+ return node;
+
+ /* L.V. those optimalizations disallow find proc. instr. at doc. level
+
+ // we will find any node in root element subtree
+ if ( szPath.length() <= szNodePath.length() ) // the given string must be longer
+ return QDomNode(); // otherwise we don't need to check the childs
+
+ if ( szPath.left(szNodePath.length()) != szNodePath ) // the nodes path must be left part of the given path
+ return QDomNode(); // otherwise we don't need to check the childs
+ */
+
+ // recursively check the childs
+ QDomNode nodeChild = node.firstChild();
+ QDomNode nodeTmp;
+ while ( ! nodeChild.isNull() )
+ {
+ nodeTmp = domTool_matchingNode( nodeChild, szPath );
+ if ( ! nodeTmp.isNull() )
+ return nodeTmp;
+ nodeChild = nodeChild.nextSibling();
+ }
+
+ return QDomNode(); // nothing found -> return empty node
+}
+
+bool domTool_match( QDomNode node, const KXESearchDialog * const pConditions )
+{
+ if ( node.isNull() )
+ {
+ kdDebug() << "domTool_match: internal implementation error - the given node is an empty one" << endl;
+ return false;
+ }
+
+ if ( ! pConditions )
+ {
+ kdDebug() << "domTool_match: internal implementation error - the given pointer is a null pointer" << endl;
+ return false;
+ }
+
+ switch ( node.nodeType() )
+ {
+ case QDomNode::ElementNode: // ----------------------------------------
+ {
+ if ( pConditions->getInElementNames() )
+ {
+ if ( node.toElement().tagName().find( pConditions->getSearchString(), 0, pConditions->getMatchCase() ) >= 0 )
+ return true;
+ }
+
+ if ( ( pConditions->getInAttributeNames() ) || ( pConditions->getInAttributeValues() ) )
+ {
+ QDomNamedNodeMap list = node.toElement().attributes();
+ unsigned int iLength = list.length();
+ if ( iLength <= 0 )
+ return false; // no attributes
+
+ for ( unsigned int iRow = 0; iRow < iLength; iRow++ )
+ {
+ if ( pConditions->getInAttributeNames() )
+ if ( list.item(iRow).toAttr().name().find( pConditions->getSearchString(), 0, pConditions->getMatchCase() ) >= 0 )
+ return true;
+ if ( pConditions->getInAttributeValues() )
+ if ( list.item(iRow).toAttr().value().find( pConditions->getSearchString(), 0, pConditions->getMatchCase() ) >= 0 )
+ return true;
+ }
+ return false;
+ }
+
+ return false;
+ break;
+ }
+
+ case QDomNode::TextNode: // ----------------------------------------
+ case QDomNode::CDATASectionNode:
+ case QDomNode::CommentNode:
+ {
+ if ( pConditions->getInContents() )
+ {
+ if ( node.toCharacterData().data().find( pConditions->getSearchString(), 0, pConditions->getMatchCase() ) >= 0 )
+ return true;
+ else
+ return false;
+ }
+ else
+ return false;
+
+ break;
+ }
+
+// TODO implement this for the other node types (eg proc.instr.)
+
+ default:
+ kdDebug() << "domTool_match: unknown node type (" << node.nodeType() << ")" << endl;
+ }
+
+ return true;
+}
+
diff --git a/part/qdom_add.h b/part/qdom_add.h
new file mode 100644
index 0000000..4e9634c
--- /dev/null
+++ b/part/qdom_add.h
@@ -0,0 +1,80 @@
+/***************************************************************************
+ qdom_add.h - description
+ -------------------
+ begin : Wed Nov 21 2001
+ copyright : (C) 2001, 2002, 2003 by The KXMLEditor Team
+ email : lvanek@users.sourceforge.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. *
+ * *
+ ***************************************************************************/
+
+#ifndef QDOM_ADD_H
+#define QDOM_ADD_H
+
+/** This file contains useful datatypes and functions in addition to the Qt DOM classes. */
+
+#include <qpixmap.h>
+#include <qdom.h>
+
+class KXESearchDialog;
+
+extern QPixmap g_iconElement;
+extern QPixmap g_iconText;
+extern QPixmap g_iconComment;
+extern QPixmap g_iconCDATASection;
+extern QPixmap g_iconProcessingInstruction;
+extern QPixmap g_iconElement_b;
+extern QPixmap g_iconText_b;
+extern QPixmap g_iconComment_b;
+extern QPixmap g_iconCDATASection_b;
+extern QPixmap g_iconProcessingInstruction_b;
+
+/** Returns the corresponding pixmap/icon to the given node type. */
+const QPixmap & domTool_getIconForNodeType( QDomNode::NodeType type, bool );
+
+/** Returns the path of the given node. */
+QString domTool_getPath( const QDomNode & );
+
+/** Returns the path of the given node. */
+QString domTool_getPath( const QDomElement & );
+
+/** Returns the level (how deep in tree) of the given node. */
+unsigned int domTool_getLevel( const QDomNode & );
+
+/** Returns a QString with the XML representation of the given node including all its children (uses @ref QDomNode::save). */
+QString domTool_save( const QDomNode &, int );
+
+/**
+ * Returns the previous node of the given one or an empty node, if it is the first.
+ * This will be its previous siblings last grand child, if there is one.
+ * Otherwise it is the previous sibling or,
+ * if there is no sibling above, it will be its parent or
+ * an empty node (if there is no parent).
+ */
+QDomNode domTool_prevNode( const QDomNode & node );
+/**
+ * Returns the next node of the given one or an empty node, if it is the last.
+ * This will be it's first child,
+ * if there are no childs, it will be the next sibling
+ * and if there are no siblings below, it will be the parent's next sibling ...
+ */
+QDomNode domTool_nextNode( const QDomNode & node );
+
+/**
+ * Tests the given node and its (grand)childs.
+ * Returns the node, which matches the given path, oran empty node (if no one matches).
+ */
+QDomNode domTool_matchingNode( const QDomNode & node, const QString & szPath );
+
+/** Tests, if the given node matches the conditions of the given search. */
+bool domTool_match( QDomNode node, const KXESearchDialog * const pConditions );
+
+#endif
+
diff --git a/po/Makefile.am b/po/Makefile.am
new file mode 100644
index 0000000..50aeed8
--- /dev/null
+++ b/po/Makefile.am
@@ -0,0 +1,6 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+
+####### kdevelop will overwrite this part!!! (end)############
+POFILES = AUTO
+
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 0000000..22e8be8
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,1519 @@
+# German translation of KXMLEditor
+# Copyright (C) 2004, The KXMLEditor Team
+# This file is distributed under the same license as the KXMLEditor package.
+# Olaf Hartig <hartig@users.sf.net>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: de\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-02-05 19:31+0100\n"
+"PO-Revision-Date: 2004-02-17 21:49+0100\n"
+"Last-Translator: Olaf Hartig <hartig@users.sf.net>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.3\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: kxechoosestringdialog.moc.cpp:34 kxechoosestringdialog.moc.cpp:42
+msgid "KXEChooseStringDialog"
+msgstr "KXEChooseStringDialog"
+
+#: actions.moc.cpp:34 actions.moc.cpp:42
+msgid "KXmlEditorComboAction"
+msgstr "KXmlEditorComboAction"
+
+#: actions.moc.cpp:122 actions.moc.cpp:130
+msgid "ToolbarLabel"
+msgstr "ToolbarLabel"
+
+#: kxesettings.moc.cpp:34 kxesettings.moc.cpp:42
+msgid "KXESettings"
+msgstr "KXESettings"
+
+#: kxeprintsettings.cpp:78
+msgid "Printing"
+msgstr "Drucken"
+
+#: kxeprintsettings.cpp:83
+msgid "Print Settings"
+msgstr "Druckeinstellungen"
+
+#: kxetexteditordialog.moc.cpp:34 kxetexteditordialog.moc.cpp:42
+msgid "KXETextEditorDialog"
+msgstr "KXETextEditorDialog"
+
+#: kxetreeviewsettingspage.cpp:107 rc.cpp:186
+msgid "Tree View Settings Page"
+msgstr "Einstellungen Baumansicht"
+
+#: kxetreeviewsettingspage.cpp:108 rc.cpp:187
+msgid "Set &root element decorated"
+msgstr "Wurzelelement &dekoriert"
+
+#: kxetreeviewsettingspage.cpp:109 rc.cpp:114 rc.cpp:188
+#: kxeprintsettingspage.cpp:127
+msgid "Alt+R"
+msgstr "Alt+R"
+
+#: kxetreeviewsettingspage.cpp:110 rc.cpp:189
+msgid ""
+"<b>Set root element decorated</b>\n"
+"<br>\n"
+"You can determine wether the tree view item corresponding to the XML "
+"document's root element should have a decoration or not.\n"
+"<br>\n"
+"A decoration is a + or - icon, with which the item can be opened or closed "
+"to show or hide its childitems."
+msgstr ""
+"<b>Wurzelelement aufklappbar</b>\n"
+"<br>\n"
+"Sie können entscheiden, ob das zum Wurzelelement des XML Dokuments gehörende "
+"Element der Baumansicht mit einer Dekoration dargestellt werden soll.\n"
+"<br>\n"
+"Eine Dekoration ist ein + oder - Piktogramm, mit dem das Element auf- und "
+"zugeklappt werden kann um die Unterelemente anzuzeigen oder zu verstecken."
+
+#: kxetreeviewsettingspage.cpp:115 rc.cpp:190
+msgid "Default &expand level:"
+msgstr "Standard-Aufklapp-&Tiefe:"
+
+#: kxetreeviewsettingspage.cpp:116 kxetreeviewsettingspage.cpp:119 rc.cpp:191
+#: rc.cpp:192
+msgid ""
+"<b>Default expand level</b>\n"
+"<br>\n"
+"You can determine up to which level the tree view items should be opened "
+"(showing their childitems) when opening a document."
+msgstr ""
+"<b>Standard-Aufklapp-Tiefe</b>\n"
+"<br>\n"
+"Sie können festlegen, bis zu welcher Tiefe nach dem Öffnen eines Dokuments "
+"die Elemente der Baumansicht aufgeklappt sein sollen. Das heisst, ab welcher "
+"Tiefe die Unterelemente versteckt sein sollen."
+
+#: kxetreeviewsettingspage.cpp:122 rc.cpp:193
+msgid "Drag and drop"
+msgstr "Ziehen und Fallenlassen (Drag and Drop)"
+
+#: kxetreeviewsettingspage.cpp:123 rc.cpp:194
+msgid "Enable dra&gging"
+msgstr "Z&iehen aktiviert"
+
+#: kxetreeviewsettingspage.cpp:124 rc.cpp:195
+msgid "Alt+G"
+msgstr "Alt+G"
+
+#: kxetreeviewsettingspage.cpp:125 rc.cpp:196
+msgid ""
+"<b>Enable dragging</b>\n"
+"<br>\n"
+"You can determine wether dragging items (and their corresponding XML nodes) "
+"from the tree view is enabled or disabled."
+msgstr ""
+"<b>Ziehen aktiviert</b>\n"
+"<br>\n"
+"Sie können festlegen, ob das Ziehen bzw. Verschieben von Elementen der "
+"Baumansicht (und den zugeordneten XML Elementen) erlaubt ist."
+
+#: kxetreeviewsettingspage.cpp:128 rc.cpp:197
+msgid "Enable dro&pping"
+msgstr "&Fallenlassen aktiviert"
+
+#: kxetreeviewsettingspage.cpp:129 rc.cpp:111 rc.cpp:198
+#: kxeprintsettingspage.cpp:122
+msgid "Alt+P"
+msgstr "Alt+P"
+
+#: kxetreeviewsettingspage.cpp:130 rc.cpp:199
+msgid ""
+"<b>Enable dropping</b>\n"
+"<br>\n"
+"You can determine wether dropping XML nodes to the tree view is enabled or "
+"disabled."
+msgstr ""
+"<b>Fallenlassen aktiviert</b>\n"
+"<br>\n"
+"Sie können festlegen, ob es möglich ist, mit der Maus verschobene XML Knoten "
+"über der Baumansicht loszulassen. Das würde zum Einfügen des XML Knotens in "
+"das aktuelle XML Dokument führen."
+
+#: kxetreeviewsettingspage.cpp:133 rc.cpp:200
+msgid "&Show ..."
+msgstr "&Zeige ..."
+
+#: kxetreeviewsettingspage.cpp:134 rc.cpp:201
+msgid ""
+"You can determine which information about XML element's attributes you want "
+"to see in the tree view. Choose between:<br>\n"
+"<br>\n"
+"<b><i>no attributes</i></b><br>\n"
+"no information about attributes at all<br>\n"
+"<br>\n"
+"<b><i>attribute names only</i></b><br>\n"
+"the attributes' names are shown<br>\n"
+"<br>\n"
+"<b><i>attribute names & values</i></b><br>\n"
+"the attributes' names and the corresponding values are shown"
+msgstr ""
+"Sie können festlegen, welche Informationen über die Attribute von XML "
+"Elementen in der Baumansicht dargestellt werden sollen.Wählen Sie eine der "
+"folgenden Möglichkeiten:<br>\n"
+"<br>\n"
+"<b><i>keine Attribute</i></b><br>\n"
+"Es werden überhaupt keine Informationen zu Attributen angezeigt.<br>\n"
+"<br>\n"
+"<b><i>nur Attributnamen</i></b><br>\n"
+"Die Namen der Attribute werden angezeigt.<br>\n"
+"<br>\n"
+"<b><i>Attributnamen und -werte</i></b><br>\n"
+"Die Namen und Werte der Attribute werden angezeigt."
+
+#: kxetreeviewsettingspage.cpp:144 rc.cpp:202
+msgid "No attributes"
+msgstr "keine Attribute"
+
+#: kxetreeviewsettingspage.cpp:145 rc.cpp:203
+msgid "Attribute names only"
+msgstr "nur Attributnamen"
+
+#: kxetreeviewsettingspage.cpp:146 rc.cpp:204
+msgid "Attribute names && values"
+msgstr "Attributnamen und -werte"
+
+#: kxeprocinstrdialog.cpp:140
+msgid ""
+"Pleasse use menu item File -> Version and encoding for this processing "
+"instruction !"
+msgstr ""
+"Bitte nutzen Sie für diese Processing Instruction den Menüpunkt \"Datei\" -> "
+"\"Version und Codierung\"."
+
+#: kxeprocinstrdialog.cpp:160
+msgid "Target cannot contain character: %1 !"
+msgstr "Das Ziel kann nicht das Zeichen \"%1\" enthalten."
+
+#: kxeprocinstrdialog.cpp:179 kxechardatadialog.cpp:108
+msgid "Contents cannot contain character: %1 !"
+msgstr "Die Anweisung darf nicht das Zeichen \"%1\" enthalten."
+
+#: kxesearchdialog.moc.cpp:34 kxesearchdialog.moc.cpp:42
+msgid "KXESearchDialog"
+msgstr "KXESearchDialog"
+
+#: kxeelementdialog.moc.cpp:34 kxeelementdialog.moc.cpp:42
+msgid "KXEElementDialog"
+msgstr "KXEElementDialog"
+
+#: kxespecprocinstrdialogbase.cpp:114 rc.cpp:145
+msgid "Special processing instruction"
+msgstr "Spezielle Processing Instruction"
+
+#: kxespecprocinstrdialogbase.cpp:115 kxenewfilesettingspage.cpp:98 rc.cpp:87
+#: rc.cpp:146
+msgid "XML &version:"
+msgstr "XML &Version:"
+
+#: kxespecprocinstrdialogbase.cpp:116 kxespecprocinstrdialogbase.cpp:118
+#: rc.cpp:147 rc.cpp:148
+msgid ""
+"<b>XML version</b><br/>\n"
+"You can determine the XML version for XML document."
+msgstr ""
+"<b>XML Version</b><br/>Sie können hier die verwendete Version von XML "
+"festlegen."
+
+#: kxespecprocinstrdialogbase.cpp:120 rc.cpp:149
+msgid "&Encoding:"
+msgstr "&Codierung"
+
+#: kxespecprocinstrdialogbase.cpp:121 kxespecprocinstrdialogbase.cpp:123
+#: rc.cpp:150 rc.cpp:151
+msgid ""
+"<b>Encoding</b><br/>\n"
+"You can determine the encoding used while saving this XML document."
+msgstr ""
+"<b>Codierung</b> <br/> Sie können hier die Codierung festlegen, welche beim "
+"Speichern des Dokumentes verwendet wird."
+
+#: kxespecprocinstrdialogbase.cpp:125 rc.cpp:152
+msgid "Do not show this dialog again"
+msgstr "Diesen Dialog nicht mehr anzeigen"
+
+#: kxespecprocinstrdialogbase.cpp:126 rc.cpp:153
+msgid "Ctrl+T"
+msgstr "Ctrl+T"
+
+#: kxespecprocinstrdialogbase.cpp:127 rc.cpp:154
+msgid ""
+"<b>Do not show this dialog again</b><br/>\n"
+"If you select this option, your choice will be remembered. Next time you "
+"create a new file, you won't be disturbed by this dialog box."
+msgstr ""
+"<b>Diesen Dialog nicht mehr anzeigen</b><br/> Wenn Sie diese Option "
+"aktivieren wird Ihre Wahl als Standard vorgemerkt. Beim nächsten Öffnen "
+"einer neuen Datei erscheint dieser Dialog nicht wieder."
+
+#: kxearchiveextssettings.cpp:51
+msgid "Archive Extensions"
+msgstr "Archivdatei-Erweiterungen"
+
+#: kxearchiveextssettings.cpp:56
+msgid "Specify Archive Extensions"
+msgstr "Archivdatei-Erweiterungen angeben"
+
+#: kxeconfiguration.cpp:86
+msgid "Configure KXMLEditor"
+msgstr "KXMLEditor Konfiguration"
+
+#: kxe_treeview.cpp:54
+msgid "Qualified name"
+msgstr "Name"
+
+#: kxe_treeview.cpp:108
+msgid "Attributes"
+msgstr "Attribute"
+
+#: kxe_treeview.cpp:825
+msgid "An XML element can't be moved to its own subtree."
+msgstr ""
+"Ein XML Element kann nicht in seinen eigenen Unterbaum verschoben werden."
+
+#: kxe_treeview.cpp:831
+msgid "An XML node can't be moved in a processing instruction."
+msgstr ""
+"Ein XML Knoten kann nicht auf eine Processing Instruction verschoben werden."
+
+#: kxe_treeview.cpp:841
+msgid "This processing instruction cannot be moved !"
+msgstr "Diese Processing Instruction kann nicht verschoben werden."
+
+#: kxmleditorpart.moc.cpp:34 kxmleditorpart.moc.cpp:42
+msgid "KXMLEditorPart"
+msgstr "KXMLEditorPart"
+
+#: kxmleditorpart.moc.cpp:311 kxmleditorpart.moc.cpp:319
+msgid "KXMLEditorBrowserExtension"
+msgstr "KXMLEditorBrowserExtension"
+
+#: commands_insert.h:36
+msgid "Insert element"
+msgstr "Element einfügen"
+
+#: commands_insert.h:52
+msgid "Insert attribute"
+msgstr "Attribut einfügen"
+
+#: commands_insert.h:68
+msgid "Insert char data"
+msgstr "Zeichendaten einfügen"
+
+#: commands_insert.h:85
+msgid "Insert proc. instr."
+msgstr "Processing Instruction einfügen"
+
+#: kxenewfilesettings.cpp:69
+msgid "New Files"
+msgstr "Neue Dateien"
+
+#: kxenewfilesettings.cpp:74
+msgid "New File Settings"
+msgstr "Voreinstellungen für neue Dateien"
+
+#: kxeelementdialog.cpp:164
+msgid "Element name cannot contain space !"
+msgstr "Der Name eines XML Elements darf kein Leerzeichen enthalten."
+
+#: kxeelementdialog.cpp:168
+msgid "Element name cannot start with 'xml' or 'XML' !"
+msgstr "Der Name eines XML Elements darf nicht mit 'xml' oder 'XML' beginnen."
+
+#: kxeelementdialog.cpp:174
+msgid "Element name must start with an underscore or a letter !"
+msgstr ""
+"Der Name eines XML Elements muss mit einem Unterstrich oder einem Buchstaben "
+"beginnen."
+
+#: kxeelementdialog.cpp:184
+msgid "Element name cannot contain character: %1 !"
+msgstr "Der Elementname darf nicht das Zeichen '%1' beinhalten."
+
+#: kxespecprocinstrdialog.moc.cpp:34 kxespecprocinstrdialog.moc.cpp:42
+msgid "KXESpecProcInstrDialog"
+msgstr "KXESpecProcInstrDialog"
+
+#: kxechardatadialogbase.cpp:105 rc.cpp:51
+msgid "XML Character Data"
+msgstr "XML Zeichendaten"
+
+#: kxechardatadialogbase.cpp:106 rc.cpp:52 rc.cpp:81 rc.cpp:120
+#: kxeprocinstrdialogbase.cpp:118 kxeelementdialogbase.cpp:160
+msgid "&Insert:"
+msgstr "&Einfügen:"
+
+#: kxechardatadialogbase.cpp:107 kxechardatadialogbase.cpp:113 rc.cpp:53
+#: rc.cpp:56
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this XML character data in the XML elements list of "
+"childnodes."
+msgstr ""
+"<b>Einfügen</b> <br/> Legen Sie fest, an welcher Stelle die neuen XML "
+"Zeichendaten eingefügt werden sollen."
+
+#: kxechardatadialogbase.cpp:111 rc.cpp:54 rc.cpp:83 rc.cpp:122
+#: kxeprocinstrdialogbase.cpp:123 kxeelementdialogbase.cpp:165
+msgid "at top"
+msgstr "oben"
+
+#: kxechardatadialogbase.cpp:112 rc.cpp:55 rc.cpp:84 rc.cpp:123
+#: kxeprocinstrdialogbase.cpp:124 kxeelementdialogbase.cpp:166
+msgid "at bottom"
+msgstr "unten"
+
+#: kxechardatadialogbase.cpp:116 rc.cpp:57
+msgid "You can edit the XML character data in this editor."
+msgstr "Bearbeiten Sie die XML Zeichendaten in diesem Fenster."
+
+#: kxechardatadialogbase.cpp:118 kxeattributedialogbase.cpp:131 rc.cpp:42
+#: rc.cpp:59 rc.cpp:78 rc.cpp:127 kxeprocinstrdialogbase.cpp:130
+#: kxeelementdialogbase.cpp:157
+msgid "Alt+O"
+msgstr "Alt+O"
+
+#: kxearchiveextssettings.moc.cpp:34 kxearchiveextssettings.moc.cpp:42
+msgid "KXEArchiveExtsSettings"
+msgstr "KXEArchiveExtsSettings"
+
+#: kxmleditorabout.h:28
+msgid "KXML Editor is an utility to display and edit XML files"
+msgstr "Der KXMLEditor dient zum Anzeigen und Bearbeiten von XML Dateien."
+
+#: kxmleditorabout.h:35
+msgid "KXML Editor"
+msgstr "KXMLEditor"
+
+#: kxmleditorabout.h:44
+msgid "Developer and maintainer"
+msgstr "Entwickler und Koordinator"
+
+#: kxmleditorabout.h:45 kxmleditorabout.h:47
+msgid "Developer"
+msgstr "Entwickler"
+
+#: kxeattributedialog.cpp:124
+msgid "Atttribute namespace cannot contain space !"
+msgstr "Der Namensraum von Attributen darf keine Leerzeichen enthalten."
+
+#: kxeattributedialog.cpp:133
+msgid "Atttribute namespace cannot contain character: %1 !"
+msgstr "Der Namensraum eines Attributs darf nicht das Zeichen '%1' enthalten."
+
+#: kxeattributedialog.cpp:147
+msgid "Atttribute name cannot contain space !"
+msgstr "Der Name eines Attributs darf kein Leerzeichen enthalten."
+
+#: kxeattributedialog.cpp:156
+msgid "Atttribute name cannot contain character: %1 !"
+msgstr "Der Name eines Attributs darf nicht das Zeichen '%1' enthalten."
+
+#: kxeattributedialog.cpp:175
+msgid "Attribute value cannot contain character: %1 !"
+msgstr "Der Wert eines Attributs darf nicht das Zeichen '%1' enthalten."
+
+#: kxeattributedialogbase.cpp:120 rc.cpp:37
+msgid "XML Attribute"
+msgstr "XML Attribut"
+
+#: kxeattributedialogbase.cpp:121 kxeattributedialogbase.cpp:143 rc.cpp:38
+#: rc.cpp:50
+msgid ""
+"<b>Namespace URI</b>\n"
+"<br/>\n"
+"Enter the namespace URI for this attribute here."
+msgstr ""
+"<b>Namenraum-URI</b> <br/>Geben Sie hier den Namensraum-URI für das "
+"Attribute an."
+
+#: kxeattributedialogbase.cpp:124 kxeattributedialogbase.cpp:135 rc.cpp:39
+#: rc.cpp:46
+msgid ""
+"<b>Value</b>\n"
+"<br/>\n"
+"Enter the attribute's value here."
+msgstr "<b>Wert</b><br/>Geben Sie hier den Wert des Attributs an."
+
+#: kxeattributedialogbase.cpp:127 kxeattributedialogbase.cpp:139 rc.cpp:40
+#: rc.cpp:48
+msgid ""
+"<b>Qualified Name</b>\n"
+"<br/>\n"
+"Enter a qualified name for the attribute here."
+msgstr "<b>Name</b><br/>Geben Sie hier den Namen des Attributs an."
+
+#: kxeattributedialogbase.cpp:133 rc.cpp:44 rc.cpp:80 rc.cpp:129
+#: kxeprocinstrdialogbase.cpp:132 kxeelementdialogbase.cpp:159
+msgid "Alt+C"
+msgstr "Alt+C"
+
+#: kxeattributedialogbase.cpp:134 rc.cpp:45
+msgid "&Value:"
+msgstr "&Wert:"
+
+#: kxeattributedialogbase.cpp:138 rc.cpp:47
+msgid "Qualified &Name:"
+msgstr "&Name:"
+
+#: kxeattributedialogbase.cpp:142 rc.cpp:49 rc.cpp:75
+#: kxeelementdialogbase.cpp:153
+msgid "Namespace &URI:"
+msgstr "Namensraum-&URI:"
+
+#: kxenewfilesettingspage.cpp:97 rc.cpp:86
+msgid "New File Settings Page"
+msgstr "Seite mit Voreinstellungen für neue Dateien"
+
+#: kxenewfilesettingspage.cpp:99 kxenewfilesettingspage.cpp:103 rc.cpp:88
+#: rc.cpp:89
+msgid ""
+"<b>XML version</b>\n"
+"<br>\n"
+"You can determine the default XML version for XML documents being created. "
+"This version is the default setting in wizard dialogs.<br>\n"
+"Since there's only one XML version yet, you shouldn't change this value."
+msgstr ""
+"<b>XML Version</b>\n"
+"<br>\n"
+"Sie können die Version von XML festlegen, welche standardmässig für neue XML "
+"Dokumente verwendet wird.Diese Version wird als Standardeinstellung im "
+"Wizard-Dialog verwendet.<br>\n"
+"Da momentan nur eine Version von XML existiert, sollten Sie diesen Wert "
+"nicht verändern."
+
+#: kxenewfilesettingspage.cpp:107 rc.cpp:90
+msgid "Default &encoding:"
+msgstr "Standard &Codierung"
+
+#: kxenewfilesettingspage.cpp:108 kxenewfilesettingspage.cpp:111 rc.cpp:91
+#: rc.cpp:92
+msgid ""
+"<b>Default encoding</b>\n"
+"<br>\n"
+"You can determine the default encoding for XML documents being created. This "
+"version is the default setting in wizard dialogs."
+msgstr ""
+"<b>Standard &Codierung </b>\n"
+"<br>\n"
+"Hier können Sie die Codierung festlegen, welche standardmässig für neue XML "
+"Dokumente verwendet wird. Diese Codierung wird als Standardeinstellung im "
+"Wizard-Dialog verwendet."
+
+#: kxenewfilesettingspage.cpp:114 rc.cpp:93
+msgid "&Behavior on creating new files"
+msgstr "Verhalten beim Erstellen &neuer Dateien"
+
+#: kxenewfilesettingspage.cpp:115 rc.cpp:94
+msgid ""
+"<b>Behavior on creating new files</b>\n"
+"<br>\n"
+"You can determine the behavior on creating new XML documents. Choose one of "
+"the following:<br>\n"
+"<br>\n"
+"<b><i>Start with new empty file</i></b><br>\n"
+"Creates an empty XML document.<br>\n"
+"<br>\n"
+"<b><i>Start with file settings dialog assistance</i></b><br>\n"
+"Opens a dialog to choose the XML version and encoding of the new document."
+"<br>\n"
+"<br>\n"
+"<b><i>Start with new file with default settings</i></b><br>\n"
+"Creates an XML document with the default XML version and default encoding "
+"selected above."
+msgstr ""
+"<b>Verhalten beim Erstellen neuer Dateien</b>\n"
+"<br>\n"
+"Hier können Sie das Verhalten beim Erstellen neuer XML Dokumente festlegen. "
+"Wählen Sie eine der folgenden Möglichkeiten. <br>\n"
+"<br>\n"
+"<b><i>mit leerer Datei beginnen</i></b><br>\n"
+"Es wird ein leeres XML Dokument erstellt.<br>\n"
+"<br>\n"
+"<b><i>Unterstützung durch Wizard-Dialog</i></b><br>\n"
+"Es wird ein Dialog geöffnet, in dem XML Version und Codierung des zu "
+"erstellenden XML Dokuments festgelegt werden können.<br>\n"
+"<br>\n"
+"<b><i>Datei mit Standardeinstellungen erstellen</i></b><br>\n"
+"Erstellt ein XML Dokument mit der oben festgelegten XML Version und "
+"Codierung."
+
+#: kxenewfilesettingspage.cpp:127 rc.cpp:95
+msgid "Start with new empty file"
+msgstr "mit leerer Datei beginnen"
+
+#: kxenewfilesettingspage.cpp:128 rc.cpp:96
+msgid "Start with file settings dialog assistance"
+msgstr "Unterstützung durch Wizard-Dialog"
+
+#: kxenewfilesettingspage.cpp:129 rc.cpp:97
+msgid "Start with new file with default settings"
+msgstr "Datei mit Standardeinstellungen erstellen"
+
+#: kxearchiveextssettingspage.cpp:90 rc.cpp:16
+msgid "Archive Exts Settings Page"
+msgstr "Archivdatei-Endungen"
+
+#: kxearchiveextssettingspage.cpp:91 rc.cpp:17
+msgid "Extensions of archive &files:"
+msgstr "Endungen von &Archivdateien:"
+
+#: kxearchiveextssettingspage.cpp:92 rc.cpp:18
+msgid ""
+"<b>Extensions of archive files</b>\n"
+"<br>\n"
+"This list contains the known extensions for archive files.<br>\n"
+"You can choose one to edit or remove it with the dialog widgets below."
+msgstr ""
+"<b>Endungen von Archivdateien</b>\n"
+"<br>\n"
+"Diese Liste enthält die bekannten Datei-Endungen von Archivdateien.<br>\n"
+"Die ausgewählte Endung können Sie unten bearbeiten oder aus dieser Liste "
+"entfernen."
+
+#: kxearchiveextssettingspage.cpp:96 rc.cpp:19
+msgid ""
+"<b>Extensions of archive files</b>\n"
+"<br>\n"
+"This list contains the known extensions for archive files."
+msgstr ""
+"<b>Endungen von Archivdateien</b>\n"
+"<br>\n"
+"Diese Liste enthält die bekannten Datei-Endungen von Archivdateien.<br>\n"
+"Die ausgewählte Endung können Sie unten bearbeiten oder aus dieser List "
+"entfernen."
+
+#: kxearchiveextssettingspage.cpp:99 rc.cpp:20
+msgid "&Extension:"
+msgstr "&Endung:"
+
+#: kxearchiveextssettingspage.cpp:100 kxearchiveextssettingspage.cpp:103
+#: rc.cpp:21 rc.cpp:22
+msgid ""
+"<b>Extension</b>\n"
+"<br>\n"
+"Change the selected extension here."
+msgstr ""
+"<b>Endung</b>\n"
+"<br>\n"
+"Hier können Sie die ausgewählte Endung ändern."
+
+#: kxearchiveextssettingspage.cpp:106 rc.cpp:23
+msgid "&New"
+msgstr "&Neu"
+
+#: kxearchiveextssettingspage.cpp:107 rc.cpp:24
+msgid "Alt+N"
+msgstr "Alt+N"
+
+#: kxearchiveextssettingspage.cpp:108 rc.cpp:25
+msgid ""
+"<b>New</b>\n"
+"<br>\n"
+"You can create a new item for another known extension in the list above."
+msgstr ""
+"<b>Neu</b>\n"
+"<br>\n"
+"Hiermit können Sie ein neues Listenelement für eine weitere bekannte Endung "
+"erstellen."
+
+#: kxearchiveextssettingspage.cpp:112 rc.cpp:27
+msgid "Alt+D"
+msgstr "Alt+D"
+
+#: kxearchiveextssettingspage.cpp:113 rc.cpp:28
+msgid ""
+"<b>Delete</b>\n"
+"<br>\n"
+"You can delete the selected extension from the list above."
+msgstr ""
+"<b>Löschen<br>\n"
+"Hiermit können Sie die ausgewählte Endung aus der Liste entfernen."
+
+#: kxetextviewsettings.cpp:96
+msgid "Text view"
+msgstr "Textansicht"
+
+#: kxetextviewsettings.cpp:101
+msgid "Text view properties"
+msgstr "Eigenschaften der Textansicht"
+
+#: kxmleditorfactory.moc.cpp:34 kxmleditorfactory.moc.cpp:42
+msgid "KXMLEditorFactory"
+msgstr "KXMLEditorFactory"
+
+#: kxetreeviewsettings.cpp:78
+msgid "Tree View"
+msgstr "Baumansicht"
+
+#: kxetreeviewsettings.cpp:83
+msgid "Tree view properties"
+msgstr "Eigenschaften der Baumansicht"
+
+#: kxeconfiguration.moc.cpp:34 kxeconfiguration.moc.cpp:42
+msgid "KXEConfiguration"
+msgstr "KXEConfiguration"
+
+#: kxe_viewelement.moc.cpp:34 kxe_viewelement.moc.cpp:42
+msgid "KXE_ViewElement"
+msgstr "KXE_ViewElement"
+
+#: rc.cpp:6 rc.cpp:14
+msgid "Path Toolbar"
+msgstr "Pfad-Werkzeugleiste"
+
+#: rc.cpp:15
+msgid "XML Toolbar"
+msgstr "XML-Werkzeugleiste"
+
+#: rc.cpp:29 kxeattachdialogbase.cpp:87
+msgid "Attach to XML"
+msgstr "Anfügen"
+
+#: rc.cpp:30 kxeattachdialogbase.cpp:88
+msgid "attachment URI:"
+msgstr "Agehängte URI:"
+
+#: rc.cpp:32 kxeattachdialogbase.cpp:90
+msgid "F1"
+msgstr "F1"
+
+#: rc.cpp:61 kxechoosestringdialogbase.cpp:82
+msgid "Choose string"
+msgstr "Auswählen einer Zeichenkette"
+
+#: rc.cpp:62 rc.cpp:66 kxechoosestringdialogbase.cpp:83
+#: kxechoosestringdialogbase.cpp:89
+msgid ""
+"<b>Enter string<b/>\n"
+"<br/>\n"
+"Enter or choose string, that you want."
+msgstr ""
+"<b>Zeichenkette eingeben<b/> <br/> Geben Sie die gewünschte Zeichenkette "
+"hier ein."
+
+#: rc.cpp:65 kxechoosestringdialogbase.cpp:88
+msgid "&Enter string:"
+msgstr "&Zeichenkette eingeben:"
+
+#: rc.cpp:67 kxeelementdialogbase.cpp:136
+msgid "XML Element"
+msgstr "XML Element"
+
+#: rc.cpp:68 kxeelementdialogbase.cpp:137
+msgid "&Prefix:"
+msgstr "&Prefix:"
+
+#: rc.cpp:69 rc.cpp:72 kxeelementdialogbase.cpp:138
+#: kxeelementdialogbase.cpp:146
+msgid ""
+"<b>Prefix</b>\n"
+"<br/>\n"
+"You can enter the namespace prefix for this XML element here."
+msgstr ""
+"<b>Prefix</b> <br/> Geben Sie hier den Namensraum-Prefix für das XML Element "
+"an."
+
+#: rc.cpp:70 rc.cpp:76 kxeelementdialogbase.cpp:141
+#: kxeelementdialogbase.cpp:154
+msgid ""
+"<b>Namespace URI</b><br/>\n"
+"You can enter the namespace URI of this XML element here."
+msgstr ""
+"<b>Namenraum-URI</b> <br/> Geben Sie hier den Namensraum-URI für das "
+"Attribute an."
+
+#: rc.cpp:71 rc.cpp:74 kxeelementdialogbase.cpp:143
+#: kxeelementdialogbase.cpp:150
+msgid ""
+"<b>Local Name</b>\n"
+"<br/>\n"
+"You have to enter this XML elements name here."
+msgstr "<b>Name</b> <br/> Geben Sie hier den Namen des XML Elements an."
+
+#: rc.cpp:73 kxeelementdialogbase.cpp:149
+msgid "Local &Name:"
+msgstr "&Name:"
+
+#: rc.cpp:82 rc.cpp:85 kxeelementdialogbase.cpp:161
+#: kxeelementdialogbase.cpp:167
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this XML element in the parent elements list of "
+"childelements."
+msgstr ""
+"<b>Einfügen</b> <br/> Wählen Sie aus, an welcher Stelle das XML Element in "
+"die Liste des (übergeordneten) Elternelements eingefügt werden soll."
+
+#: rc.cpp:98 kxeprintsettingspage.cpp:97
+msgid "Print Settings Page"
+msgstr "Druck-Einstellungen"
+
+#: rc.cpp:99 kxeprintsettingspage.cpp:98
+msgid "Font &family:"
+msgstr "Schrift&familie:"
+
+#: rc.cpp:100 rc.cpp:101 kxeprintsettingspage.cpp:99
+#: kxeprintsettingspage.cpp:102
+msgid ""
+"<b>Font family</b>\n"
+"<br>\n"
+"Choose the font family you want to be used on printing your XML documents."
+msgstr ""
+"<b>Schriftfamilie</b>\n"
+"<br>\n"
+"Legen Sie hier die Schriftfamilie fest, welche zum Drucken Ihrer XML "
+"Dokumente verwendet werden soll."
+
+#: rc.cpp:102 kxeprintsettingspage.cpp:105
+msgid "Font &size:"
+msgstr "Schrift&grösse:"
+
+#: rc.cpp:103 rc.cpp:106 kxeprintsettingspage.cpp:106
+#: kxeprintsettingspage.cpp:111
+msgid ""
+"<b>Font size</b>\n"
+"<br>\n"
+"Choose the font size you want to be used on printing your XML documents."
+msgstr ""
+"<b>Schriftgrösse</b>\n"
+"<br>\n"
+"Legen Sie hier die Grösse der Schrift fest, welche zum Drucken Ihrer XML "
+"Dokumente verwendet werden soll."
+
+#: rc.cpp:104 kxeprintsettingspage.cpp:109
+msgid "pt"
+msgstr "pt"
+
+#: rc.cpp:107 rc.cpp:183 kxeprintsettingspage.cpp:114
+#: kxetextviewsettingspage.cpp:165
+msgid "Element &indentation:"
+msgstr "Ein&rückung:"
+
+#: rc.cpp:108 rc.cpp:109 kxeprintsettingspage.cpp:115
+#: kxeprintsettingspage.cpp:118
+msgid ""
+"<b>Element indentation</b>\n"
+"<br>\n"
+"Choose the number of characters you want to be used for indenting childnodes "
+"on printing you XML documents."
+msgstr ""
+"<b>Einrückung</b>\n"
+"<br>\n"
+"Legen Sie hier die Anzahl an Leerzeichen fest, die beim Drucken zur "
+"Einrückung von Unterelementen verwendet werden soll."
+
+#: rc.cpp:110 kxeprintsettingspage.cpp:121
+msgid "&Print header"
+msgstr "&Kopfzeile drucken"
+
+#: rc.cpp:112 kxeprintsettingspage.cpp:123
+msgid ""
+"<b>Print header</b>\n"
+"<br>\n"
+"You can determine wether you want a header to be printed on every page when "
+"printing you XML documents or not."
+msgstr ""
+"<b>Kopfzeile drucken</b>\n"
+"<br>\n"
+"Hier können Sie festlegen, ob beim Drucken Ihrer XML Dokumente auf jeder "
+"Seite eine Kopfzeile gedruckt werden soll."
+
+#: rc.cpp:113 kxeprintsettingspage.cpp:126
+msgid "P&rint footer"
+msgstr "F&usszeile drucken"
+
+#: rc.cpp:115 kxeprintsettingspage.cpp:128
+msgid ""
+"<b>Print footer</b>\n"
+"<br>\n"
+"You can determine wether you want a footline to be printed on every page "
+"when printing you XML documents or not."
+msgstr ""
+"<b>Fusszeile drucken</b>\n"
+"<br>\n"
+"Hier können Sie festlegen, ob beim Drucken Ihrer XML Dokumente auf jeder "
+"Seite eine Fusszeile gedruckt werden soll."
+
+#: rc.cpp:116 kxeprocinstrdialogbase.cpp:112
+msgid "Processing Instruction"
+msgstr "Processing Instruction"
+
+#: rc.cpp:117 kxeprocinstrdialogbase.cpp:113
+msgid "&Target:"
+msgstr "&Ziel:"
+
+#: rc.cpp:118 rc.cpp:119 kxeprocinstrdialogbase.cpp:114
+#: kxeprocinstrdialogbase.cpp:116
+msgid ""
+"<b>Target</b><br/>\n"
+"Define the target of this processing instruction here."
+msgstr ""
+"<b>Ziel</b><br/>Geben Sie hier das Ziel (Target) der Processing Instruction "
+"an."
+
+#: rc.cpp:121 rc.cpp:124 kxeprocinstrdialogbase.cpp:119
+#: kxeprocinstrdialogbase.cpp:125
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this processing instruction in the parent elements "
+"list."
+msgstr ""
+"<b>Einfügen</b><br/>Wählen Sie aus, an welcher Stelle diese Processing "
+"Instruction in die Liste des (übergeordneten) Elternelements eingefügt "
+"werden soll."
+
+#: rc.cpp:125 kxeprocinstrdialogbase.cpp:128
+msgid ""
+"Here you can enter the data (the instructions) of this XML processing "
+"instruction."
+msgstr ""
+"Hier können Sie die Anweisung(en) dieser Processing Instruction eingeben."
+
+#: rc.cpp:130 kxesearchdialogbase.cpp:139
+msgid "Search"
+msgstr "Suche"
+
+#: rc.cpp:131 kxesearchdialogbase.cpp:140
+msgid "&Search string:"
+msgstr "&Zeichenkette:"
+
+#: rc.cpp:132 rc.cpp:133 kxesearchdialogbase.cpp:141
+#: kxesearchdialogbase.cpp:143
+msgid ""
+"<b>Search string</b></br>\n"
+"Here you can enter the string you want to search for in your XML document."
+msgstr ""
+"<b>Zeichenkette</b></br>Geben Sie hier die Zeichenkette ein, nach welcher "
+"Sie in Ihrem XML Dokument suchen wollen."
+
+#: rc.cpp:134 kxesearchdialogbase.cpp:145
+msgid "&Find"
+msgstr "&Finde"
+
+#: rc.cpp:136 kxesearchdialogbase.cpp:147
+msgid "Find &in"
+msgstr "Suche &in"
+
+#: rc.cpp:137 kxesearchdialogbase.cpp:148
+msgid ""
+"<b>Find in</b>\n"
+"<br/>\n"
+"Here you can choose the parts of your XML document that should be inspected "
+"during the search. \n"
+"<br/>\n"
+"These are\n"
+"<br/>\n"
+"<br/>\n"
+"<b><i>Element names</i></b><br/>\n"
+"<b><i>Attribute names</i></b><br/>\n"
+"<b><i>Attribute values</i></b><br/>\n"
+"<b><i>Content</i></b>"
+msgstr ""
+"<b>Suche in</b>\n"
+"<br/>\n"
+"Hier können Sie die Teile des XML Dokuments festlegen, welche bei der Suche "
+"beachtet werden sollen.\n"
+"<br/>\n"
+"Möglich sind:\n"
+"<br/>\n"
+"<br/>\n"
+"<b><i>Elementnamen</i></b><br/>\n"
+"<b><i>Attributnamen</i></b><br/>\n"
+"<b><i>Attributwerte</i></b><br/>\n"
+"<b><i>Inhalt (Zeichendaten)</i></b>"
+
+#: rc.cpp:138 kxesearchdialogbase.cpp:159
+msgid "Element names"
+msgstr "Elementnamen"
+
+#: rc.cpp:139 kxesearchdialogbase.cpp:160
+msgid "Attribute names"
+msgstr "Attributnamen"
+
+#: rc.cpp:140 kxesearchdialogbase.cpp:161
+msgid "Attribute values"
+msgstr "Attributwerte"
+
+#: rc.cpp:141 kxesearchdialogbase.cpp:162
+msgid "Content"
+msgstr "Inhalt (Zeichendaten)"
+
+#: rc.cpp:142 kxesearchdialogbase.cpp:163
+msgid "&Match case"
+msgstr "&Gross-/Kleinschreibung beachten"
+
+#: rc.cpp:143 kxesearchdialogbase.cpp:164
+msgid "Alt+M"
+msgstr "Alt+M"
+
+#: rc.cpp:144 kxesearchdialogbase.cpp:165
+msgid ""
+"<b>Match case</b><br/>\n"
+"Check this for case sensitive search."
+msgstr ""
+"<b>Gross-/Kleinschreibung beachten</b><br/>\n"
+"Setzen Sie den Haken, wenn bei der Suche Gross-/Kleinschreibung beachtet "
+"werden soll."
+
+#: rc.cpp:157 kxetexteditordialogbase.cpp:91
+msgid "Edit XML as raw text"
+msgstr "XML Dokument als puren Text bearbeiten"
+
+#: rc.cpp:158 kxetexteditordialogbase.cpp:92
+msgid "You can edit your XML document as raw text in this editor."
+msgstr ""
+"In diesem Fenster können Sie Ihr XML Dokument als puren Text bearbeiten."
+
+#: rc.cpp:163 kxetexteditordialogbase.cpp:97
+msgid "&Validate"
+msgstr "&Validieren"
+
+#: rc.cpp:164 kxetexteditordialogbase.cpp:98
+msgid "Alt+V"
+msgstr "Alt+V"
+
+#: rc.cpp:165 kxetexteditordialogbase.cpp:99
+msgid ""
+"<b>Validate</b><br/>\n"
+"Press this button, if you want your XML document in the above editor to be "
+"validated."
+msgstr ""
+"<b>Validieren</b><br/>\n"
+"Klicken Sie hier, wenn Sie Ihr XML Dokument im obigen Fenster validieren "
+"lassen wollen."
+
+#: rc.cpp:166 kxetextviewsettingspage.cpp:146
+msgid "Text view settings"
+msgstr "Einstellungen der Textansicht"
+
+#: rc.cpp:167 kxetextviewsettingspage.cpp:147
+msgid "Syntax highlighting"
+msgstr "Syntax-Hervorhebungen"
+
+#: rc.cpp:168 kxetextviewsettingspage.cpp:148
+msgid ""
+"<b>Syntax highlightning</b>\n"
+"<br>\n"
+"You can define the colors to be used, when showing your XML documents as raw "
+"text."
+msgstr ""
+"<b>Syntax-Hervorhebungen</b>\n"
+"<br>\n"
+"Hier können Sie die Farben zur Hervorhebung der unterschiedlichen "
+"syntaktischen Elemente festlegen, welche bei der Anzeige Ihrer XML Dokumente "
+"als purer Text verwendet werden sollen."
+
+#: rc.cpp:169 kxetextviewsettingspage.cpp:151
+msgid "Default &Text:"
+msgstr "Standard &Text:"
+
+#: rc.cpp:171 kxetextviewsettingspage.cpp:153
+msgid "&Element names:"
+msgstr "&Elementnamen:"
+
+#: rc.cpp:173 kxetextviewsettingspage.cpp:155
+msgid "Syntax E&rrors:"
+msgstr "Syntax&fehler:"
+
+#: rc.cpp:174 kxetextviewsettingspage.cpp:156
+msgid "Attribute &values:"
+msgstr "&Attributwerte"
+
+#: rc.cpp:176 kxetextviewsettingspage.cpp:158
+msgid "Co&mments:"
+msgstr "&Kommentare"
+
+#: rc.cpp:177 kxetextviewsettingspage.cpp:159
+msgid "Attribute &names:"
+msgstr "Attribut&namen:"
+
+#: rc.cpp:180 kxetextviewsettingspage.cpp:162
+msgid "&Syntax characters:"
+msgstr "Syntax&zeichen:"
+
+#: rc.cpp:184 rc.cpp:185 kxetextviewsettingspage.cpp:166
+#: kxetextviewsettingspage.cpp:169
+msgid ""
+"<b>Element indentation</b>\n"
+"<br>\n"
+"You can choose the number of characters you want to be used for indenting "
+"childnodes, when showing your XML documents as raw text."
+msgstr ""
+"<b>Einrückung</b>\n"
+"<br>\n"
+"Legen Sie hier die Anzahl an Leerzeichen fest, die beim Drucken zur "
+"Einrückung von Unterelementen verwendet werden soll."
+
+#: commands_edit.h:38
+msgid "Delete node"
+msgstr "Knoten löschen"
+
+#: commands_edit.h:52
+msgid "Delete attribute"
+msgstr "Attribut löschen"
+
+#: commands_edit.h:66
+msgid "Delete all attributes"
+msgstr "Alle Attribute löschen"
+
+#: commands_edit.h:78
+msgid "Cut node"
+msgstr "Knoten ausschneiden"
+
+#: commands_edit.h:88
+msgid "Paste node to document"
+msgstr "Knoten in Dokument einfügen"
+
+#: commands_edit.h:102
+msgid "Paste node to element"
+msgstr "Knoten unter Element einfügen"
+
+#: commands_edit.h:116
+msgid "Paste node to proc. instruction"
+msgstr "Knoten in Proc.Instruction einfügen"
+
+#: commands_edit.h:131
+msgid "Paste node to char. data"
+msgstr "Knoten in Zeichendaten einfügen"
+
+#: commands_edit.h:146
+msgid "Drag&&drop node"
+msgstr "Knoten ziehen&&fallenlassen"
+
+#: commands_edit.h:161
+msgid "Move node up"
+msgstr "Knoten hoch"
+
+#: commands_edit.h:175
+msgid "Move node down"
+msgstr "Knoten runter"
+
+#: commands_edit.h:189
+msgid "Editing character data"
+msgstr "Zeichendaten bearbeiten"
+
+#: commands_edit.h:204
+msgid "Editing proc. instruction"
+msgstr "Processing Instruction bearbeiten"
+
+#: commands_edit.h:219
+msgid "Editing element"
+msgstr "Element bearbeiten"
+
+#: commands_edit.h:236
+msgid "Edit attribute value"
+msgstr "Attributwert bearbeiten"
+
+#: commands_edit.h:251
+msgid "Edit attribute name"
+msgstr "Attributname bearbeiten"
+
+#: commands_edit.h:268
+msgid "Editing raw XML"
+msgstr "Puren Text bearbeiten"
+
+#: commands_file.h:44
+msgid "Changing version and encoding"
+msgstr "Version und Codierung ändern"
+
+#: commands_file.h:57
+msgid "Attaching stylesheet "
+msgstr "Stylesheet anfügen"
+
+#: commands_file.h:70
+msgid "Detaching stylesheet "
+msgstr "Stylesheet abtrennen"
+
+#: commands_file.h:83
+msgid "Attaching schema "
+msgstr "Schema anfügen"
+
+#: commands_file.h:96
+msgid "Detaching schema "
+msgstr "Schema abtrennen"
+
+#: kxe_viewattributes.moc.cpp:34 kxe_viewattributes.moc.cpp:42
+msgid "KXE_ViewAttributes"
+msgstr "KXE_ViewAttributes"
+
+#: kxechardatadialog.moc.cpp:34 kxechardatadialog.moc.cpp:42
+msgid "KXECharDataDialog"
+msgstr "KXECharDataDialog"
+
+#: kxeattributedialog.moc.cpp:34 kxeattributedialog.moc.cpp:42
+msgid "KXEAttributeDialog"
+msgstr "KXEAttributeDialog"
+
+#: kxe_treeview.moc.cpp:34 kxe_treeview.moc.cpp:42
+msgid "KXE_TreeView"
+msgstr "KXE_TreeView"
+
+#: kxmleditorpart.cpp:114
+msgid "D&eselect Node"
+msgstr "Auswahl aufhe&ben"
+
+#: kxmleditorpart.cpp:118
+msgid "To &Parent Node"
+msgstr "zu &Elternknoten"
+
+#: kxmleditorpart.cpp:121
+msgid "&Expand Node"
+msgstr "Knoten &ausklappen"
+
+#: kxmleditorpart.cpp:126
+msgid "Expand To Level %1"
+msgstr "Ausklappen bis Tiefe %1"
+
+#: kxmleditorpart.cpp:128
+msgid "&Collapse Node"
+msgstr "Knoten &zusammenklappen"
+
+#: kxmleditorpart.cpp:133
+msgid "Collapse To Level %1"
+msgstr "Zusammenklappen bis Tiefe %1"
+
+#: kxmleditorpart.cpp:136
+msgid "&Toggle Bookmark"
+msgstr "&Lesezeichen setzen/löschen"
+
+#: kxmleditorpart.cpp:138
+msgid "&Previous Bookmark"
+msgstr "&Vorheriges Lesezeichen"
+
+#: kxmleditorpart.cpp:140
+msgid "&Next Bookmark"
+msgstr "&Nächstes Lesezeichen"
+
+#: kxmleditorpart.cpp:144
+msgid "&Configure KXMLEditor..."
+msgstr "KXMLEditor &einrichten..."
+
+#: kxmleditorpart.cpp:148
+msgid "Path Bar"
+msgstr "Pfad-Leiste"
+
+#: kxmleditorpart.cpp:150
+msgid "Clear Path Bar"
+msgstr "Pfad-Leiste leeren"
+
+#: kxmleditorpart.cpp:152 kxmleditorpart.cpp:153
+msgid "Path: "
+msgstr "Pfad: "
+
+#: kxmleditorpart.cpp:162
+msgid "&Move Up"
+msgstr "&Hoch"
+
+#: kxmleditorpart.cpp:163
+msgid "Move &Down"
+msgstr "R&unter"
+
+#: kxmleditorpart.cpp:166
+msgid "&Element..."
+msgstr "&Element..."
+
+#: kxmleditorpart.cpp:167
+msgid "&Attribute..."
+msgstr "&Attribut..."
+
+#: kxmleditorpart.cpp:168
+msgid "&Text..."
+msgstr "&Text..."
+
+#: kxmleditorpart.cpp:169
+msgid "C&DATA..."
+msgstr "C&DATA..."
+
+#: kxmleditorpart.cpp:170
+msgid "&Comment..."
+msgstr "&Kommentar..."
+
+#: kxmleditorpart.cpp:171
+msgid "&Processing Instruction..."
+msgstr "&Processing Instruction..."
+
+#: kxmleditorpart.cpp:175
+msgid "Edit &raw XML..."
+msgstr "Bearbeiten als &purer Text..."
+
+#: kxmleditorpart.cpp:179
+msgid "Delete all Attributes..."
+msgstr "Alle Attribute löschen..."
+
+#: kxmleditorpart.cpp:183
+msgid "&Version && Encoding..."
+msgstr "V&ersion && Codierung..."
+
+#: kxmleditorpart.cpp:184
+msgid "Attach Schema..."
+msgstr "Schema anfügen..."
+
+#: kxmleditorpart.cpp:185
+msgid "Detach Schema"
+msgstr "Schema abtrennen"
+
+#: kxmleditorpart.cpp:186
+msgid "Attach Stylesheet..."
+msgstr "Stylesheet anfügen..."
+
+#: kxmleditorpart.cpp:187
+msgid "Detach Stylesheet"
+msgstr "Stylesheet abtrennen"
+
+#: kxmleditorpart.cpp:220
+msgid "Element"
+msgstr "Element"
+
+#: kxmleditorpart.cpp:233
+msgid "Proc.Instruction"
+msgstr "Proc.Instruction"
+
+#: kxmleditorpart.cpp:349
+msgid "Couldn't open temp file !"
+msgstr "Die temporäre Datei kann nicht geöffnet werden."
+
+#: kxmleditorpart.cpp:364
+msgid "Choose file"
+msgstr "Datei auswählen"
+
+#: kxmleditorpart.cpp:364
+msgid "File:"
+msgstr "Datei:"
+
+#: kxmleditorpart.cpp:444
+msgid "Codec for encoding %1 not found ! Using locale encoding for load."
+msgstr ""
+"Der Codec für die Kodierung %1 kann nicht gefunden werden. Benutzen der "
+"lokalen Kodierung zum Laden."
+
+#: kxmleditorpart.cpp:476 kxmleditorpart.cpp:959 kxmleditorpart.cpp:1558
+#: kxetexteditordialog.cpp:82
+msgid "%1 in line %2, column %3"
+msgstr "%1 in Zeile %2, Spalte %3"
+
+#: kxmleditorpart.cpp:477 kxmleditorpart.cpp:960 kxmleditorpart.cpp:1559
+#: kxetexteditordialog.cpp:83
+msgid "Parsing error !"
+msgstr "Parserfehler"
+
+#: kxmleditorpart.cpp:507
+msgid ""
+"Your file doesn't have root element defined. \n"
+"\t\tContinue saving?"
+msgstr ""
+"Ihrem Dokument hat kein Wurzelelement.\n"
+"\t\tSoll das Speichern fortgesetzt werden?"
+
+#: kxmleditorpart.cpp:552
+msgid "Codec for encoding %1 not found ! Continue saving ?"
+msgstr ""
+"Der Codec für die Kodierung %1 kann nicht gefunden werden. Soll das "
+"Speichern fortgesetzt werden?"
+
+#: kxmleditorpart.cpp:571
+msgid "Can't create file %1"
+msgstr "Die Datei %1 kann nicht angelegt werden."
+
+#: kxmleditorpart.cpp:572 kxmleditorpart.cpp:584
+msgid "Write error !"
+msgstr "Schreibfehler"
+
+#: kxmleditorpart.cpp:583
+msgid "Can't create archive %1"
+msgstr "Das Archiv %1 kann nicht angelegt werden."
+
+#: kxmleditorpart.cpp:646
+msgid "Stylesheet URL:"
+msgstr "Stylesheet URL:"
+
+#: kxmleditorpart.cpp:671
+msgid "Schema URL:"
+msgstr "Schema URL:"
+
+#: kxmleditorpart.cpp:798 kxmleditorpart.cpp:815
+msgid "Search in XML tree ..."
+msgstr "Suche im XML Baum..."
+
+#: kxmleditorpart.cpp:810 kxmleditorpart.cpp:820 kxmleditorpart.cpp:833
+#: kxmleditorpart.cpp:840 kxmleditorpart.cpp:881 kxmleditorpart.cpp:916
+#: kxmleditorpart.cpp:976 kxmleditorpart.cpp:1005 kxmleditorpart.cpp:1033
+#: kxmleditorpart.cpp:1060 kxmleditorpart.cpp:1103 kxmleditorpart.cpp:1145
+#: kxmleditorpart.cpp:1206 kxmleditorpart.cpp:1237 kxmleditorpart.cpp:1267
+#: kxmleditorpart.cpp:1312 kxmleditorpart.cpp:1335 kxmleditorpart.cpp:1358
+#: kxmleditorpart.cpp:1374 kxmleditorshell.cpp:100 kxmleditorshell.cpp:134
+#: kxmleditorshell.cpp:143 kxmleditorshell.cpp:155 kxmleditorshell.cpp:193
+#: kxmleditorshell.cpp:205 kxmleditorshell.cpp:217
+msgid "Ready."
+msgstr "Fertig."
+
+#: kxmleditorpart.cpp:851
+msgid "Inserting XML element into document..."
+msgstr "XML Element in Dokument einfügen..."
+
+#: kxmleditorpart.cpp:899
+msgid "Editing XML element..."
+msgstr "Bearbeiten eines XML Elements..."
+
+#: kxmleditorpart.cpp:934
+msgid "Editing raw XML..."
+msgstr "Dokument als puren Text bearbeiten..."
+
+#: kxmleditorpart.cpp:967 kxetexteditordialog.cpp:93
+msgid "You are changed root element to another node type, while editing !"
+msgstr ""
+"Sie haben während des Bearbeitens die Knotenart des Wurzelelements geändert."
+
+#: kxmleditorpart.cpp:994
+msgid "Add attribute..."
+msgstr "Attribut hinzufügen..."
+
+#: kxmleditorpart.cpp:1023
+msgid "Remove all attributes from selected node ?"
+msgstr "Sollen alle Attribute des ausgewählten Elements entfernt werden?"
+
+#: kxmleditorpart.cpp:1026
+msgid "Delete all attributes..."
+msgstr "Alle Attribute löschen..."
+
+#: kxmleditorpart.cpp:1052
+msgid "Delete attribute..."
+msgstr "Attribut löschen..."
+
+#: kxmleditorpart.cpp:1101
+msgid "Inserting processing instruction into document..."
+msgstr "Einfügen einer Processing Instruction..."
+
+#: kxmleditorpart.cpp:1121
+msgid "Editing processing instruction..."
+msgstr "Bearbeiten einer Processing Instruction..."
+
+#: kxmleditorpart.cpp:1157
+msgid "Setting XML version and encoding of document..."
+msgstr "XML Version und Kodierung setzen..."
+
+#: kxmleditorpart.cpp:1193
+msgid "Inserting text into document..."
+msgstr "Einfügen von Text..."
+
+#: kxmleditorpart.cpp:1196
+msgid "Insert text"
+msgstr "Text einfügen"
+
+#: kxmleditorpart.cpp:1224
+msgid "Inserting CDATA into document..."
+msgstr "Einfügen von CDATA..."
+
+#: kxmleditorpart.cpp:1227
+msgid "Insert CDATA"
+msgstr "CDATA einfügen"
+
+#: kxmleditorpart.cpp:1255
+msgid "Inserting comment into document..."
+msgstr "Einfügen eines Kommentars..."
+
+#: kxmleditorpart.cpp:1258
+msgid "Insert comment"
+msgstr "Kommentar einfügen"
+
+#: kxmleditorpart.cpp:1287
+msgid "Editing character data..."
+msgstr "Bearbeiten von Zeichendaten..."
+
+#: kxmleditorpart.cpp:1330
+msgid "Moving node up..."
+msgstr "Knoten hoch bewegen..."
+
+#: kxmleditorpart.cpp:1353
+msgid "Moving node down..."
+msgstr "Knoten runter bewegen..."
+
+#: kxmleditorpart.cpp:1370
+msgid "Configure KXML Editor ..."
+msgstr "KXMLEditor einrichten..."
+
+#: kxmleditorpart.cpp:1541
+msgid "This processing instruction cannot be pasted here !"
+msgstr ""
+"Diese Processing Instruction kann an dieser Stelle nicht eingefügt werden."
+
+#: kxmleditorpart.cpp:1569
+msgid "Root element already exists !"
+msgstr "Es existiert bereits ein Wurzelelement."
+
+#: kxmleditorpart.cpp:1575
+msgid "Node pasted to document must be element !"
+msgstr "Der einzufügende Knoten muss ein Element sein."
+
+#: kxmleditorpart.cpp:1617
+msgid "Incompactible node types for drag&drop !"
+msgstr "Die Knotentypen sind für Ziehen&Fallenlassen inkompatibel."
+
+#: kxmleditorpart.cpp:1798
+msgid "Page %1"
+msgstr "Seite %1"
+
+#: kxe_viewattributes.cpp:29
+msgid "Namespace"
+msgstr "Namensraum"
+
+#: kxe_viewattributes.cpp:30
+msgid "Name"
+msgstr "Name"
+
+#: kxe_viewattributes.cpp:31
+msgid "Value"
+msgstr "Wert"
+
+#: kxe_viewattributes.cpp:132
+msgid "Attribute name already exists !"
+msgstr "Der Attributname existiert bereits."
+
+#: kxeprocinstrdialog.moc.cpp:34 kxeprocinstrdialog.moc.cpp:42
+msgid "KXEProcInstrDialog"
+msgstr "KXEProcInstrDialog"
+
+#: main.cpp:31
+msgid "XML file(s) to open"
+msgstr "Zu öffnende XML Datei(en)"
+
+#: kxmleditorshell.moc.cpp:34 kxmleditorshell.moc.cpp:42
+msgid "KXMLEditorShell"
+msgstr "KXMLEditorShell"
+
+#: kxmleditorshell.cpp:126 kxmleditorshell.cpp:139
+msgid "Opening file..."
+msgstr "Datei öffnen..."
+
+#: kxmleditorshell.cpp:148
+msgid "Saving file..."
+msgstr "Datei speichern..."
+
+#: kxmleditorshell.cpp:160
+msgid "Saving file with a new filename..."
+msgstr "Datei unter neuem Namen speichern..."
+
+#: kxmleditorshell.cpp:167
+msgid "Save as..."
+msgstr "Speichern als..."
+
+#: kxmleditorshell.cpp:198
+msgid "Toggle the toolbar..."
+msgstr "Werkzeugleiste ein/ausschalten..."
+
+#: kxmleditorshell.cpp:210
+msgid "Toggle the statusbar..."
+msgstr "Statusleiste ein/ausschalten..."
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 0000000..26c6f30
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,1469 @@
+# translation of fr.po to
+# Christophe Crier <christophe.crier@heolys.com>, 2004.
+#
+msgid ""
+msgstr ""
+"Last-Translator: Christophe Crier <christophe.crier@heolys.com>\n"
+"PO-Revision-Date: 2004-09-08 23:16+0200\n"
+"Project-Id-Version: fr\n"
+"Language-Team: <fr@li.org>\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.3.1\n"
+"MIME-Version: 1.0\n"
+
+#: kxeprintsettings.cpp:78
+msgid "Printing"
+msgstr "Impression"
+
+#: kxeprintsettings.cpp:83
+msgid "Print Settings"
+msgstr "Options d'impression"
+
+#: kxedocument.cpp:70
+msgid ""
+"Your file doesn't have root element defined. \n"
+"\t\tContinue saving?"
+msgstr ""
+"Votre fichier n'a pas défini de racine. \n"
+"\t\tSauvegarder quand même ?"
+
+#: kxedocument.cpp:112
+msgid "Codec for encoding %1 not found ! Continue saving ?"
+msgstr "Le Codec d'encodage %1 n'a pas été trouvé ! Sauvegarder quand même ?"
+
+#: kxedocument.cpp:131
+msgid "Can't create file %1"
+msgstr "Impossible de créer le fichier %1"
+
+#: kxedocument.cpp:132 kxedocument.cpp:162
+msgid "Write error !"
+msgstr "Erreur d'écriture !"
+
+#: kxedocument.cpp:161
+msgid "Can't create archive %1"
+msgstr "Impossible de créer l'archive %1"
+
+#: kxedocument.cpp:194
+msgid "Couldn't open temp file !"
+msgstr "Impossible d'ouvrir le fichier temporaire !"
+
+#: kxedocument.cpp:247
+msgid "Choose file"
+msgstr "Choisir un fichier"
+
+#: kxedocument.cpp:247
+msgid "File:"
+msgstr "Fichier :"
+
+#: kxedocument.cpp:329
+msgid "Codec for encoding %1 not found ! Using locale encoding for load."
+msgstr "Impossible de trouver le Codec d'encodage %1 ! Utilisation de l'encodage local pour le chargement."
+
+#: kxedocument.cpp:361 kxmleditorpart.cpp:724 kxmleditorpart.cpp:1296
+#: kxetexteditordialog.cpp:82
+msgid "%1 in line %2, column %3"
+msgstr "%1 en ligne %2, colonne %3"
+
+#: kxedocument.cpp:362 kxmleditorpart.cpp:725 kxmleditorpart.cpp:1297
+#: kxetexteditordialog.cpp:83
+msgid "Parsing error !"
+msgstr "Erreur d'analyse !"
+
+#: kxedocument.cpp:568
+msgid "Stylesheet URL:"
+msgstr "URL de la feuille de style :"
+
+#: kxedocument.cpp:597
+msgid "Schema URL:"
+msgstr "URL du schéma :"
+
+#: kxetreeviewsettingspage.cpp:110 rc.cpp:189
+msgid "Tree View Settings Page"
+msgstr "Page des options de la vue de l'arbre"
+
+#: kxetreeviewsettingspage.cpp:111 rc.cpp:190
+msgid "Create items &on demand"
+msgstr "Créer les éléments à la &demande"
+
+#: kxetreeviewsettingspage.cpp:112 kxechardatadialogbase.cpp:119
+#: kxeattributedialogbase.cpp:131 rc.cpp:43 rc.cpp:63 rc.cpp:79 rc.cpp:128
+#: rc.cpp:191 kxeprocinstrdialogbase.cpp:130 kxeelementdialogbase.cpp:157
+msgid "Alt+O"
+msgstr "Alt+O"
+
+#: kxetreeviewsettingspage.cpp:113 rc.cpp:192
+msgid ""
+"<b>Create items on demand</b>\n"
+"<br>\n"
+"You can determine when to create the tree view items.\n"
+"Wether they are created on demand, which means their creation is postponed "
+"until\n"
+"their grandparent item is opened, or all items are created while opening the "
+"XML \n"
+"file.\n"
+"<br>\n"
+"Creating items on demand saves time and memory while opening very big, deep "
+"nested XML documents."
+msgstr ""
+"<b>Créer les éléments à la demande</b>\n"
+"<br>\n"
+"Vous pouvez déterminer le moment où les éléments seront créés dans la vue de "
+"l'arbre.\n"
+"Soit ils sont crées à la demande Cela signifie que leur création est retardée, "
+"jusqu'à ce que leur grand-parent soit ouvert, soit ils sont tous créés à l'ouverture "
+"du fichier \n"
+"XML.\n"
+"<br>\n"
+"Créer les éléments à la demande permet de réduire le temps et la mémoire nécessaires "
+"lors de l'ouverture de documents XML lourds et complexes."
+
+#: kxetreeviewsettingspage.cpp:121 rc.cpp:193
+msgid "Set &root element decorated"
+msgstr "Décorer l'élément &racine"
+
+#: kxetreeviewsettingspage.cpp:122 rc.cpp:115 rc.cpp:194
+#: kxeprintsettingspage.cpp:127
+msgid "Alt+R"
+msgstr "Alt+R"
+
+#: kxetreeviewsettingspage.cpp:123 rc.cpp:195
+msgid ""
+"<b>Set root element decorated</b>\n"
+"<br>\n"
+"You can determine wether the tree view item corresponding to the XML "
+"document's root element should have a decoration or not.\n"
+"<br>\n"
+"A decoration is a + or - icon, with which the item can be opened or closed "
+"to show or hide its childitems."
+msgstr ""
+"<b>Décorer l'élément racine</b>\n"
+"<br>\n"
+"Vous pouvez choisir si dans la vue de l'arbre si l'élément racine du "
+"document a une décoration ou non.\n"
+"<br>\n"
+"Une décoration est le signe + ou -, avec lequel un élément peut être déployé ou replié de manière à afficher ou non ses éléments enfants."
+
+#: kxetreeviewsettingspage.cpp:128 rc.cpp:196
+msgid "Default &expand level:"
+msgstr "Niveau de &déploiement par défaut :"
+
+#: kxetreeviewsettingspage.cpp:129 kxetreeviewsettingspage.cpp:132 rc.cpp:197
+#: rc.cpp:198
+msgid ""
+"<b>Default expand level</b>\n"
+"<br>\n"
+"You can determine up to which level the tree view items should be opened "
+"(showing their childitems) when opening a document."
+msgstr ""
+"<b>Niveau de déploiement par défaut</b>\n"
+"<br>\n"
+"Vous pouvez choisir le nombre de niveaux qui devront être déployés "
+"(montrer leurs enfants)quand vous ouvrirez un document."
+
+#: kxetreeviewsettingspage.cpp:135 rc.cpp:199
+msgid "Drag and drop"
+msgstr "Glisser-déposer"
+
+#: kxetreeviewsettingspage.cpp:136 rc.cpp:200
+msgid "Enable dra&gging"
+msgstr "Activer le dép&lacement"
+
+#: kxetreeviewsettingspage.cpp:137 rc.cpp:201
+msgid "Alt+G"
+msgstr "Alt+G"
+
+#: kxetreeviewsettingspage.cpp:138 rc.cpp:202
+msgid ""
+"<b>Enable dragging</b>\n"
+"<br>\n"
+"You can determine wether dragging items (and their corresponding XML nodes) "
+"from the tree view is enabled or disabled."
+msgstr ""
+"<b>Activer le déplacement</b>\n"
+"<br>\n"
+"Vous pouvez choisir si le déplacement d'éléments (Et ses noeuds XML associés) "
+"dans la vue de l'arbre est possible ou non."
+
+#: kxetreeviewsettingspage.cpp:141 rc.cpp:203
+msgid "Enable dro&pping"
+msgstr "Activer le dé&posé"
+
+#: kxetreeviewsettingspage.cpp:142 rc.cpp:112 rc.cpp:204
+#: kxeprintsettingspage.cpp:122
+msgid "Alt+P"
+msgstr "Alt+P"
+
+#: kxetreeviewsettingspage.cpp:143 rc.cpp:205
+msgid ""
+"<b>Enable dropping</b>\n"
+"<br>\n"
+"You can determine wether dropping XML nodes to the tree view is enabled or "
+"disabled."
+msgstr ""
+"<b>Activer le déposé</b>\n"
+"<br>\n"
+"Vous pouvez choisir si le déposé de noeuds XML dans la vue de l'arbre "
+"est possible ou non."
+
+#: kxetreeviewsettingspage.cpp:146 rc.cpp:206
+msgid "&Show ..."
+msgstr "&Affichage ..."
+
+#: kxetreeviewsettingspage.cpp:147 rc.cpp:207
+msgid ""
+"You can determine which information about XML element's attributes you want "
+"to see in the tree view. Choose between:<br>\n"
+"<br>\n"
+"<b><i>no attributes</i></b><br>\n"
+"no information about attributes at all<br>\n"
+"<br>\n"
+"<b><i>attribute names only</i></b><br>\n"
+"the attributes' names are shown<br>\n"
+"<br>\n"
+"<b><i>attribute names & values</i></b><br>\n"
+"the attributes' names and the corresponding values are shown"
+msgstr ""
+"Vous pouvez choisir les informations des attributs d'éléments que vous voulez "
+"voir dans la vue de l'arbre. Choissisez entre :<br>\n"
+"<br>\n"
+"<b><i>aucun attribut<i></b><br>\n"
+"Aucune information à propos des attributs<br>\n"
+"<br>\n"
+"<b><i>Seulement les noms des attributs</i></b><br>\n"
+"Les noms des attributs sont affichés<br>\n"
+"<br>\n"
+"<b><i>Les noms et les valeurs des attributs</i></b><br>\n"
+"Les noms et les valeurs correspondantes seront affichés"
+
+#: kxetreeviewsettingspage.cpp:157 rc.cpp:208
+msgid "No attributes"
+msgstr "Aucun attribut"
+
+#: kxetreeviewsettingspage.cpp:158 rc.cpp:209
+msgid "Attribute names only"
+msgstr "Seulement les noms des attributs"
+
+#: kxetreeviewsettingspage.cpp:159 rc.cpp:210
+msgid "Attribute names && values"
+msgstr "Les noms et les valeurs des attributs"
+
+#: kxeprocinstrdialog.cpp:140
+msgid ""
+"Pleasse use menu item File -> Version and encoding for this processing "
+"instruction !"
+msgstr ""
+"Veuillez utiliser le menu Fichier -> Version et encodage pour cette "
+"instruction de traitement !"
+
+#: kxeprocinstrdialog.cpp:160
+msgid "Target cannot contain character: %1 !"
+msgstr "La destination ne peut pas contenir le caractère %1 !"
+
+#: kxeprocinstrdialog.cpp:179 kxechardatadialog.cpp:108
+msgid "Contents cannot contain character: %1 !"
+msgstr "Le caratère %1 ne peut pas faire parti du contenu !"
+
+#: kxespecprocinstrdialogbase.cpp:114 rc.cpp:146
+msgid "Special processing instruction"
+msgstr "Instruction de traitement spécifique"
+
+#: kxespecprocinstrdialogbase.cpp:115 kxenewfilesettingspage.cpp:98 rc.cpp:88
+#: rc.cpp:147
+msgid "XML &version:"
+msgstr "&Version XML :"
+
+#: kxespecprocinstrdialogbase.cpp:116 kxespecprocinstrdialogbase.cpp:118
+#: rc.cpp:148 rc.cpp:149
+msgid ""
+"<b>XML version</b><br/>\n"
+"You can determine the XML version for XML document."
+msgstr ""
+"<b>Version XML</b><br/>\n"
+"Vous pouvez choisir la version XML du document XML."
+
+#: kxespecprocinstrdialogbase.cpp:120 rc.cpp:150
+msgid "&Encoding:"
+msgstr "&Encodage :"
+
+#: kxespecprocinstrdialogbase.cpp:121 kxespecprocinstrdialogbase.cpp:123
+#: rc.cpp:151 rc.cpp:152
+msgid ""
+"<b>Encoding</b><br/>\n"
+"You can determine the encoding used while saving this XML document."
+msgstr ""
+"<b>Encodage</b><br/>\n"
+"Vous pouvez choisir l'encodage utilisé lors de l'enregistrement du document XML."
+
+#: kxespecprocinstrdialogbase.cpp:125 rc.cpp:153
+msgid "Do not show this dialog again"
+msgstr "Ne pas réafficher cette boîte de dialogue"
+
+#: kxespecprocinstrdialogbase.cpp:126 rc.cpp:154
+msgid "Ctrl+T"
+msgstr "Ctrl+T"
+
+#: kxespecprocinstrdialogbase.cpp:127 rc.cpp:155
+msgid ""
+"<b>Do not show this dialog again</b><br/>\n"
+"If you select this option, your choice will be remembered. Next time you "
+"create a new file, you won't be disturbed by this dialog box."
+msgstr ""
+"<b>Ne pas réafficher cette boîte de dialogue</b><br/>\n"
+"Si vous choisissez cette option, votre choix sera enregistré."
+"La prochaine fois que vous créerez un nouveau fichier, cette boîte de "
+"dialogue ne s'affichera plus."
+
+#: kxearchiveextssettings.cpp:51
+msgid "Archive Extensions"
+msgstr "Extension de l'archive"
+
+#: kxearchiveextssettings.cpp:56
+msgid "Specify Archive Extensions"
+msgstr "Précisez l'extension de l'archive"
+
+#: kxeconfiguration.cpp:86
+msgid "Configure KXMLEditor"
+msgstr "Configurer KXMLEditor"
+
+#: kxe_treeview.cpp:54
+msgid "Qualified name"
+msgstr "Nom qualifié"
+
+#: kxe_treeview.cpp:109
+msgid "Attributes"
+msgstr "Attributs"
+
+#: kxe_treeview.cpp:842
+msgid "An XML element can't be moved to its own subtree."
+msgstr "Un élément XML ne peut pas être déplacé dans son propre sous-arbre."
+
+#: kxe_treeview.cpp:848
+msgid "An XML node can't be moved in a processing instruction."
+msgstr "Un noeud XML ne peut pas être déplacé dans une instruction de traitement."
+
+#: kxe_treeview.cpp:858
+msgid "This processing instruction cannot be moved !"
+msgstr "Cette instruction de traitement ne peut pas être déplacée !"
+
+#: commands_insert.h:36
+msgid "Insert element"
+msgstr "Insérer un élement"
+
+#: commands_insert.h:52
+msgid "Insert attribute"
+msgstr "Insérer un attribut"
+
+#: commands_insert.h:68
+msgid "Insert char data"
+msgstr "Insérer une donnée caractère"
+
+#: commands_insert.h:85
+msgid "Insert proc. instr."
+msgstr "Insérer une instr. de trait."
+
+#: kxenewfilesettings.cpp:69
+msgid "New Files"
+msgstr "Nouveaux fichiers"
+
+#: kxenewfilesettings.cpp:74
+msgid "New File Settings"
+msgstr "Options des nouveaux fichiers"
+
+#: kxeelementdialog.cpp:164
+msgid "Element name cannot contain space !"
+msgstr "Un nom d'élément ne peut pas contenir d'espace !"
+
+#: kxeelementdialog.cpp:168
+msgid "Element name cannot start with 'xml' or 'XML' !"
+msgstr "Un élément ne peut pas commencer par 'xml' ou 'XML' !"
+
+#: kxeelementdialog.cpp:174
+msgid "Element name must start with an underscore or a letter !"
+msgstr "Un nom d'élément doit commencer par une lettre ou un caractère de soulignement !"
+
+#: kxeelementdialog.cpp:184
+msgid "Element name cannot contain character: %1 !"
+msgstr "Un nom d'élément ne peut pas contenir le caractère %1 !"
+
+#: kxechardatadialogbase.cpp:106 rc.cpp:71
+msgid "XML Character Data"
+msgstr "Donnée caractère XML"
+
+#: kxechardatadialogbase.cpp:107 rc.cpp:66 rc.cpp:72 rc.cpp:121
+#: kxeprocinstrdialogbase.cpp:118 kxeelementdialogbase.cpp:160
+msgid "&Insert:"
+msgstr "&Insérer :"
+
+#: kxechardatadialogbase.cpp:108 kxechardatadialogbase.cpp:114 rc.cpp:73
+#: rc.cpp:76
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this XML character data in the XML elements list of "
+"childnodes."
+msgstr ""
+"<b>Insérer</b>\n"
+"<br/>\n"
+"Choisissez où vous voulez placer cette donnée caratère XML dans la liste "
+"des éléments XML des noeuds enfants."
+
+#: kxechardatadialogbase.cpp:112 rc.cpp:68 rc.cpp:74 rc.cpp:123
+#: kxeprocinstrdialogbase.cpp:123 kxeelementdialogbase.cpp:165
+msgid "at top"
+msgstr "en haut"
+
+#: kxechardatadialogbase.cpp:113 rc.cpp:69 rc.cpp:75 rc.cpp:124
+#: kxeprocinstrdialogbase.cpp:124 kxeelementdialogbase.cpp:166
+msgid "at bottom"
+msgstr "en bas"
+
+#: kxechardatadialogbase.cpp:117 rc.cpp:77
+msgid "You can edit the XML character data in this editor."
+msgstr "Vous pouvez éditer la donnée caractère XML dans cet éditeur."
+
+#: kxmleditorabout.h:28
+msgid "KXML Editor is an utility to display and edit XML files"
+msgstr "KXML Editor est un utilitaire qui permet l'affichage et l'édition de fichiers XML "
+
+#: kxmleditorabout.h:35
+msgid "KXML Editor"
+msgstr "KXML Editor"
+
+#: kxmleditorabout.h:44
+msgid "Developer and maintainer"
+msgstr "Développeur et mainteneur"
+
+#: kxmleditorabout.h:45 kxmleditorabout.h:47
+msgid "Developer"
+msgstr "Développeur"
+
+#: kxeattributedialog.cpp:124
+msgid "Atttribute namespace cannot contain space !"
+msgstr "Pas d'espace dans l'espace de nom d'un attribut !"
+
+#: kxeattributedialog.cpp:133
+msgid "Atttribute namespace cannot contain character: %1 !"
+msgstr "Pas de caratère %1 dans l'espace de nom d'un attribut !"
+
+#: kxeattributedialog.cpp:147
+msgid "Atttribute name cannot contain space !"
+msgstr "Pas d'espace dans le nom d'un attribut !"
+
+#: kxeattributedialog.cpp:156
+msgid "Atttribute name cannot contain character: %1 !"
+msgstr "Pas de caractère %1 dans le nom d'un attribut !"
+
+#: kxeattributedialog.cpp:175
+msgid "Attribute value cannot contain character: %1 !"
+msgstr "Pas de caratère %1 dans la valeur d'un attribut !"
+
+#: kxeattributedialogbase.cpp:120 rc.cpp:38
+msgid "XML Attribute"
+msgstr "Attribut XML"
+
+#: kxeattributedialogbase.cpp:121 kxeattributedialogbase.cpp:143 rc.cpp:39
+#: rc.cpp:51
+msgid ""
+"<b>Namespace URI</b>\n"
+"<br/>\n"
+"Enter the namespace URI for this attribute here."
+msgstr ""
+"<b>URI de l'espace de nom</b>\n"
+"<br/>\n"
+"Donner ici l'URI de l'espace de nom pour cet attribut."
+
+#: kxeattributedialogbase.cpp:124 kxeattributedialogbase.cpp:135 rc.cpp:40
+#: rc.cpp:47
+msgid ""
+"<b>Value</b>\n"
+"<br/>\n"
+"Enter the attribute's value here."
+msgstr ""
+"<b>Valeur</b>\n"
+"<br/>\n"
+"Donner ici la valeur de l'attribut."
+
+#: kxeattributedialogbase.cpp:127 kxeattributedialogbase.cpp:139 rc.cpp:41
+#: rc.cpp:49
+msgid ""
+"<b>Qualified Name</b>\n"
+"<br/>\n"
+"Enter a qualified name for the attribute here."
+msgstr ""
+"<b>Nom qualifié</b>\n"
+"<br/>\n"
+"Donner ici un nom qualifié pour l'attribut."
+
+#: kxeattributedialogbase.cpp:133 rc.cpp:45 rc.cpp:65 rc.cpp:130
+#: kxeprocinstrdialogbase.cpp:132 kxeelementdialogbase.cpp:159
+msgid "Alt+C"
+msgstr "Alt+C"
+
+#: kxeattributedialogbase.cpp:134 rc.cpp:46
+msgid "&Value:"
+msgstr "&Valeur :"
+
+#: kxeattributedialogbase.cpp:138 rc.cpp:48
+msgid "Qualified &Name:"
+msgstr "&Nom qualifié :"
+
+#: kxeattributedialogbase.cpp:142 rc.cpp:50 rc.cpp:60
+#: kxeelementdialogbase.cpp:153
+msgid "Namespace &URI:"
+msgstr "&URI de l'espace de nom :"
+
+#: kxenewfilesettingspage.cpp:97 rc.cpp:87
+msgid "New File Settings Page"
+msgstr "Page d'options des nouveaux fichiers"
+
+#: kxenewfilesettingspage.cpp:99 kxenewfilesettingspage.cpp:103 rc.cpp:89
+#: rc.cpp:90
+msgid ""
+"<b>XML version</b>\n"
+"<br>\n"
+"You can determine the default XML version for XML documents being created. "
+"This version is the default setting in wizard dialogs.<br>\n"
+"Since there's only one XML version yet, you shouldn't change this value."
+msgstr ""
+"<b>Version XML</b>\n"
+"<br>\n"
+"Vous pouvez fixer la version XML par défaut utilisée par les nouveaux documents XML."
+"Cette version sera l'option par défaut dans la boîte de dialogue de l'assistant.<br>\n"
+"Il n'y a encore qu'une seule version XML , vous ne pourrez pas changer cette valeur."
+
+#: kxenewfilesettingspage.cpp:107 rc.cpp:91
+msgid "Default &encoding:"
+msgstr "&Encodage par défaut :"
+
+#: kxenewfilesettingspage.cpp:108 kxenewfilesettingspage.cpp:111 rc.cpp:92
+#: rc.cpp:93
+msgid ""
+"<b>Default encoding</b>\n"
+"<br>\n"
+"You can determine the default encoding for XML documents being created. This "
+"version is the default setting in wizard dialogs."
+msgstr ""
+"<b>Encodage par défaut</b>\n"
+"<br>\n"
+"Vous pouvez fixer l'encodage par défaut du document XML en cours de création."
+"Cet encodage sera la valeur défaut utilisée dans les boîtes de dialogue de l'assistant."
+
+#: kxenewfilesettingspage.cpp:114 rc.cpp:94
+msgid "&Behavior on creating new files"
+msgstr "&Comportement lors de la création de nouveaux fichiers"
+
+#: kxenewfilesettingspage.cpp:115 rc.cpp:95
+msgid ""
+"<b>Behavior on creating new files</b>\n"
+"<br>\n"
+"You can determine the behavior on creating new XML documents. Choose one of "
+"the following:<br>\n"
+"<br>\n"
+"<b><i>Start with new empty file</i></b><br>\n"
+"Creates an empty XML document.<br>\n"
+"<br>\n"
+"<b><i>Start with file settings dialog assistance</i></b><br>\n"
+"Opens a dialog to choose the XML version and encoding of the new document."
+"<br>\n"
+"<br>\n"
+"<b><i>Start with new file with default settings</i></b><br>\n"
+"Creates an XML document with the default XML version and default encoding "
+"selected above."
+msgstr ""
+"<b>Comportement lors de la création de nouveaux fichiers</b>\n"
+"<br>\n"
+"Vous pouvez fixer le comportement lors de la création de nouveaux documents XML."
+"Choisissez dans ce qui suit :"
+"<br>\n"
+"<br>\n"
+"<b><i>Commencer avec un nouveau fichier vide</i></b><br>\n"
+"Création d'un document XML vide<br>\n"
+"<br>\n"
+"<b><i>Commencer avec l'assistant des options de fichiers</i></b><br>\n"
+"Ouverture d'une boîte de dialogues permettant de choisir la version XML et l'encodage "
+"du nouveau document."
+"<br>\n"
+"<br>\n"
+"<b><i>Commencer le nouveau fichier avec les options par défaut</i></b><br>\n"
+"Création d'un document XML avec la version XML et l'encodage par défaut sélectionnés "
+"précédemment."
+
+#: kxenewfilesettingspage.cpp:127 rc.cpp:96
+msgid "Start with new empty file"
+msgstr "Commencer avec un nouveau fichier vide"
+
+#: kxenewfilesettingspage.cpp:128 rc.cpp:97
+msgid "Start with file settings dialog assistance"
+msgstr "Commencer avec l'assistant des options de fichiers"
+
+#: kxenewfilesettingspage.cpp:129 rc.cpp:98
+msgid "Start with new file with default settings"
+msgstr "Commencer le nouveau fichier avec les options par défaut"
+
+#: kxearchiveextssettingspage.cpp:90 rc.cpp:17
+msgid "Archive Exts Settings Page"
+msgstr "Page d'options des ext. d'archive"
+
+#: kxearchiveextssettingspage.cpp:91 rc.cpp:18
+msgid "Extensions of archive &files:"
+msgstr "Extentions des &fichiers d'archive :"
+
+#: kxearchiveextssettingspage.cpp:92 rc.cpp:19
+msgid ""
+"<b>Extensions of archive files</b>\n"
+"<br>\n"
+"This list contains the known extensions for archive files.<br>\n"
+"You can choose one to edit or remove it with the dialog widgets below."
+msgstr ""
+"<b>Extentions des fichiers d'archive</b>\n"
+"<br>\n"
+"Cette liste contient les extensions connues pour les fichiers d'archive.<br>\n"
+"Vous pouvez en sélectionner un pour l'éditer ou le supprimer avec l'élément graphique ci-dessous."
+
+#: kxearchiveextssettingspage.cpp:96 rc.cpp:20
+msgid ""
+"<b>Extensions of archive files</b>\n"
+"<br>\n"
+"This list contains the known extensions for archive files."
+msgstr ""
+" <b>Extensions des fichiers d'archive</b>\n"
+"<br>\n"
+"Cette liste contient les extensions connues pour les fichiers d'archive."
+
+#: kxearchiveextssettingspage.cpp:99 rc.cpp:21
+msgid "&Extension:"
+msgstr "&Extension :"
+
+#: kxearchiveextssettingspage.cpp:100 kxearchiveextssettingspage.cpp:103
+#: rc.cpp:22 rc.cpp:23
+msgid ""
+"<b>Extension</b>\n"
+"<br>\n"
+"Change the selected extension here."
+msgstr ""
+"<b>Extension</b>\n"
+"<br>\n"
+"Modifier ici l'extension sélectionnée."
+
+#: kxearchiveextssettingspage.cpp:106 rc.cpp:24
+msgid "&New"
+msgstr "&Nouveau"
+
+#: kxearchiveextssettingspage.cpp:107 rc.cpp:25
+msgid "Alt+N"
+msgstr "Alt+N"
+
+#: kxearchiveextssettingspage.cpp:108 rc.cpp:26
+msgid ""
+"<b>New</b>\n"
+"<br>\n"
+"You can create a new item for another known extension in the list above."
+msgstr ""
+"<b>Nouveau</b>\n"
+"<br>\n"
+"Vous pouvez créer un nouvel élément pour une autre extension connue dans "
+"la liste ci-dessous."
+
+#: kxearchiveextssettingspage.cpp:112 rc.cpp:28
+msgid "Alt+D"
+msgstr "Alt+D"
+
+#: kxearchiveextssettingspage.cpp:113 rc.cpp:29
+msgid ""
+"<b>Delete</b>\n"
+"<br>\n"
+"You can delete the selected extension from the list above."
+msgstr ""
+"<b>Effacer</b>\n"
+"<br>\n"
+"Vous pouvez effacer l'extension séléctionnées de la liste ci-dessous."
+
+#: kxetextviewsettings.cpp:104
+msgid "Text view"
+msgstr "Vue texte"
+
+#: kxetextviewsettings.cpp:109
+msgid "Text view properties"
+msgstr "Propriétés de la vue texte"
+
+#: kxetreeviewsettings.cpp:84
+msgid "Tree View"
+msgstr "Vue de l'arbre"
+
+#: kxetreeviewsettings.cpp:89
+msgid "Tree view properties"
+msgstr "Propriétés de la vue de l'arbre"
+
+#: rc.cpp:7 rc.cpp:15
+msgid "Path Toolbar"
+msgstr "Barre d'outils du chemin"
+
+#: rc.cpp:16
+msgid "XML Toolbar"
+msgstr "Barre d'outils XML"
+
+#: rc.cpp:30 kxeattachdialogbase.cpp:87
+msgid "Attach to XML"
+msgstr "Attacher à l'XML"
+
+#: rc.cpp:31 kxeattachdialogbase.cpp:88
+msgid "attachment URI:"
+msgstr "URI d'attachment :"
+
+#: rc.cpp:33 kxeattachdialogbase.cpp:90
+msgid "F1"
+msgstr "F1"
+
+#: rc.cpp:52 kxeelementdialogbase.cpp:136
+msgid "XML Element"
+msgstr "Élément XML"
+
+#: rc.cpp:53 kxeelementdialogbase.cpp:137
+msgid "&Prefix:"
+msgstr "&Préfix :"
+
+#: rc.cpp:54 rc.cpp:57 kxeelementdialogbase.cpp:138
+#: kxeelementdialogbase.cpp:146
+msgid ""
+"<b>Prefix</b>\n"
+"<br/>\n"
+"You can enter the namespace prefix for this XML element here."
+msgstr ""
+"<b>Préfix</b>\n"
+"<br/>\n"
+"Vous pouvez donner ici le préfix de l'espace de nom pour cet élément."
+
+#: rc.cpp:55 rc.cpp:61 kxeelementdialogbase.cpp:141
+#: kxeelementdialogbase.cpp:154
+msgid ""
+"<b>Namespace URI</b><br/>\n"
+"You can enter the namespace URI of this XML element here."
+msgstr ""
+"<b>URI de l'espace de nom</b><br/>\n"
+"Vous pouvez donner ici l'URI de l'espace de nom de l'élément XML."
+
+#: rc.cpp:56 rc.cpp:59 kxeelementdialogbase.cpp:143
+#: kxeelementdialogbase.cpp:150
+msgid ""
+"<b>Local Name</b>\n"
+"<br/>\n"
+"You have to enter this XML elements name here."
+msgstr ""
+"<b>Nom local</b>\n"
+"<br/>\n"
+"Vous devez donner ici le nom de cet élément XML."
+
+#: rc.cpp:58 kxeelementdialogbase.cpp:149
+msgid "Local &Name:"
+msgstr "&Nom local :"
+
+#: rc.cpp:67 rc.cpp:70 kxeelementdialogbase.cpp:161
+#: kxeelementdialogbase.cpp:167
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this XML element in the parent elements list of "
+"childelements."
+msgstr ""
+"<b>Insérez</b>\n"
+"<br/>\n"
+"Choisissez la place de cet élément XML dans la liste des éléments parent des éléments enfant."
+
+#: rc.cpp:81 kxechoosestringdialogbase.cpp:82
+msgid "Choose string"
+msgstr "Choisissez une chaîne"
+
+#: rc.cpp:82 rc.cpp:86 kxechoosestringdialogbase.cpp:83
+#: kxechoosestringdialogbase.cpp:89
+msgid ""
+"<b>Enter string<b/>\n"
+"<br/>\n"
+"Enter or choose string, that you want."
+msgstr ""
+"<b>Donner une chaîne<b/>\n"
+"<br/>\n"
+"Donnez ou choisissez la chaîne que vous voulez."
+
+#: rc.cpp:85 kxechoosestringdialogbase.cpp:88
+msgid "&Enter string:"
+msgstr "Donn&er une chaîne :"
+
+#: rc.cpp:99 kxeprintsettingspage.cpp:97
+msgid "Print Settings Page"
+msgstr "Page des options d'impression"
+
+#: rc.cpp:100 kxeprintsettingspage.cpp:98
+msgid "Font &family:"
+msgstr "&Famille de la police :"
+
+#: rc.cpp:101 rc.cpp:102 kxeprintsettingspage.cpp:99
+#: kxeprintsettingspage.cpp:102
+msgid ""
+"<b>Font family</b>\n"
+"<br>\n"
+"Choose the font family you want to be used on printing your XML documents."
+msgstr ""
+"<b>Famille de la police</b>\n"
+"<br>\n"
+"Choisissez la famille de la police que vous voulez utiliser lors de l'impression de vos documents XML."
+
+#: rc.cpp:103 kxeprintsettingspage.cpp:105
+msgid "Font &size:"
+msgstr "&Taille de la police :"
+
+#: rc.cpp:104 rc.cpp:107 kxeprintsettingspage.cpp:106
+#: kxeprintsettingspage.cpp:111
+msgid ""
+"<b>Font size</b>\n"
+"<br>\n"
+"Choose the font size you want to be used on printing your XML documents."
+msgstr ""
+"<b>Taille de la police</b>\n"
+"<br>\n"
+"Choisissez la taille de la police que vous voulez utiliser lors de l'impression de vos documents XML."
+
+#: rc.cpp:105 kxeprintsettingspage.cpp:109
+msgid "pt"
+msgstr "pt"
+
+#: rc.cpp:108 rc.cpp:184 kxeprintsettingspage.cpp:114
+#: kxetextviewsettingspage.cpp:173
+msgid "Element &indentation:"
+msgstr "&Indentation d'élément :"
+
+#: rc.cpp:109 rc.cpp:110 kxeprintsettingspage.cpp:115
+#: kxeprintsettingspage.cpp:118
+msgid ""
+"<b>Element indentation</b>\n"
+"<br>\n"
+"Choose the number of characters you want to be used for indenting childnodes "
+"on printing you XML documents."
+msgstr ""
+"<b>Indentation d'élément</b>\n"
+"<br>\n"
+"Donner le nombre de caractère que vous voulez qui soit utilisé pour l'indentation des noeuds enfant lors de l'impression de votre document XML."
+
+#: rc.cpp:111 kxeprintsettingspage.cpp:121
+msgid "&Print header"
+msgstr "Im&pression d'entête"
+
+#: rc.cpp:113 kxeprintsettingspage.cpp:123
+msgid ""
+"<b>Print header</b>\n"
+"<br>\n"
+"You can determine wether you want a header to be printed on every page when "
+"printing you XML documents or not."
+msgstr ""
+"<b>Impression d'entête</b>\n"
+"<br>\n"
+"Vous pouvez spécifier si vous voulez ou non qu'un entête soit imprimé sur chaque page lors de l'impression de votre document XML."
+
+#: rc.cpp:114 kxeprintsettingspage.cpp:126
+msgid "P&rint footer"
+msgstr "Imp&ression de pied de page"
+
+#: rc.cpp:116 kxeprintsettingspage.cpp:128
+msgid ""
+"<b>Print footer</b>\n"
+"<br>\n"
+"You can determine wether you want a footline to be printed on every page "
+"when printing you XML documents or not."
+msgstr ""
+"<b>Impression de pied de page</b>\n"
+"<br>\n"
+"Vous pouvez spécifier si vous voulez ou non qu'un pied de page soit imprimé sur chaque page lors de l'impression de votre document XML."
+
+#: rc.cpp:117 kxeprocinstrdialogbase.cpp:112
+msgid "Processing Instruction"
+msgstr "Instruction de traitement"
+
+#: rc.cpp:118 kxeprocinstrdialogbase.cpp:113
+msgid "&Target:"
+msgstr "&Cible :"
+
+#: rc.cpp:119 rc.cpp:120 kxeprocinstrdialogbase.cpp:114
+#: kxeprocinstrdialogbase.cpp:116
+msgid ""
+"<b>Target</b><br/>\n"
+"Define the target of this processing instruction here."
+msgstr ""
+"<b>Cible</b><br/>\n"
+"Définissez ici la cible de cette instruction de traitement."
+
+#: rc.cpp:122 rc.cpp:125 kxeprocinstrdialogbase.cpp:119
+#: kxeprocinstrdialogbase.cpp:125
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this processing instruction in the parent elements "
+"list."
+msgstr ""
+"<b>Insérer</b>\n"
+"<br/>\n"
+"Choisissez la place de cette instruction de traiterment dans la liste des éléments parent."
+
+#: rc.cpp:126 kxeprocinstrdialogbase.cpp:128
+msgid ""
+"Here you can enter the data (the instructions) of this XML processing "
+"instruction."
+msgstr ""
+"Vous pouvez donner ici la donnée (l'instruction) de cette instruction "
+"de traitement XML."
+
+#: rc.cpp:131 kxesearchdialogbase.cpp:139
+msgid "Search"
+msgstr "Chercher"
+
+#: rc.cpp:132 kxesearchdialogbase.cpp:140
+msgid "&Search string:"
+msgstr "&Texte à chercher :"
+
+#: rc.cpp:133 rc.cpp:134 kxesearchdialogbase.cpp:141
+#: kxesearchdialogbase.cpp:143
+msgid ""
+"<b>Search string</b></br>\n"
+"Here you can enter the string you want to search for in your XML document."
+msgstr ""
+"<b>Texte à chercher</b></br>\n"
+"Vous pouvez donner ici la chaîne de caractère à rechercher dans votre document XML."
+
+#: rc.cpp:135 kxesearchdialogbase.cpp:145
+msgid "&Find"
+msgstr "&Trouver"
+
+#: rc.cpp:137 kxesearchdialogbase.cpp:147
+msgid "Find &in"
+msgstr "Trouver &dans"
+
+#: rc.cpp:138 kxesearchdialogbase.cpp:148
+msgid ""
+"<b>Find in</b>\n"
+"<br/>\n"
+"Here you can choose the parts of your XML document that should be inspected "
+"during the search. \n"
+"<br/>\n"
+"These are\n"
+"<br/>\n"
+"<br/>\n"
+"<b><i>Element names</i></b><br/>\n"
+"<b><i>Attribute names</i></b><br/>\n"
+"<b><i>Attribute values</i></b><br/>\n"
+"<b><i>Content</i></b>"
+msgstr ""
+"<b>Trouver dans</b>\n"
+"<br/>\n"
+"Vous pouvez choisir ici la partie de votre document XML dans laquelle la recherche sera effectuée. \n"
+"<br/>\n"
+"Elle peut être dans\n"
+"<br/>\n"
+"<br/>\n"
+"<b><i>Les noms d'éléments</i></b><br/>\n"
+"<b><i>Les noms d'attributs</i></b><br/>\n"
+"<b><i>Les valeurs d'attributs</i></b><br/>\n"
+"<b><i>Contenu</i></b>"
+
+#: rc.cpp:139 kxesearchdialogbase.cpp:159
+msgid "Element names"
+msgstr "Nom d'élément"
+
+#: rc.cpp:140 kxesearchdialogbase.cpp:160
+msgid "Attribute names"
+msgstr "Nom d'attribut"
+
+#: rc.cpp:141 kxesearchdialogbase.cpp:161
+msgid "Attribute values"
+msgstr "Valeur d'attribut"
+
+#: rc.cpp:142 kxesearchdialogbase.cpp:162
+msgid "Content"
+msgstr "Contenu"
+
+#: rc.cpp:143 kxesearchdialogbase.cpp:163
+msgid "&Match case"
+msgstr "&Respecter la casse"
+
+#: rc.cpp:144 kxesearchdialogbase.cpp:164
+msgid "Alt+M"
+msgstr "Alt+M"
+
+#: rc.cpp:145 kxesearchdialogbase.cpp:165
+msgid ""
+"<b>Match case</b><br/>\n"
+"Check this for case sensitive search."
+msgstr ""
+"<b>Respecter la casse</b><br/>\n"
+"Cocher ceci pour effectuer la recherche en respectant la casse."
+
+#: rc.cpp:158 kxetexteditordialogbase.cpp:91
+msgid "Edit XML as raw text"
+msgstr "Editer l'XML comme du texte brut"
+
+#: rc.cpp:159 kxetexteditordialogbase.cpp:92
+msgid "You can edit your XML document as raw text in this editor."
+msgstr "Dans cet éditeur, vous pouvez éditer en mode texte brut votre document XML."
+
+#: rc.cpp:164 kxetexteditordialogbase.cpp:97
+msgid "&Validate"
+msgstr "&Validation"
+
+#: rc.cpp:165 kxetexteditordialogbase.cpp:98
+msgid "Alt+V"
+msgstr "Alt+V"
+
+#: rc.cpp:166 kxetexteditordialogbase.cpp:99
+msgid ""
+"<b>Validate</b><br/>\n"
+"Press this button, if you want your XML document in the above editor to be "
+"validated."
+msgstr ""
+"<b>Validation</b><br/>\n"
+"Pour valider votre document XML se trouvant dans l'éditeur ci-dessous, appuyez sur ce bouton."
+
+#: rc.cpp:167 kxetextviewsettingspage.cpp:154
+msgid "Text view settings"
+msgstr "Options de la vue texte"
+
+#: rc.cpp:168 kxetextviewsettingspage.cpp:155
+msgid "Syntax highlighting"
+msgstr "Coloration syntaxique"
+
+#: rc.cpp:169 kxetextviewsettingspage.cpp:156
+msgid ""
+"<b>Syntax highlightning</b>\n"
+"<br>\n"
+"You can define the colors to be used, when showing your XML documents as raw "
+"text."
+msgstr ""
+"<b>Syntax highlightning</b>\n"
+"<br>\n"
+"Vous pouvez définir les couleurs utilisées losque votre document XML est affiché comme du texte brut."
+
+#: rc.cpp:170 kxetextviewsettingspage.cpp:159
+msgid "Default &Text:"
+msgstr "&Texte par défaut :"
+
+#: rc.cpp:172 kxetextviewsettingspage.cpp:161
+msgid "&Element names:"
+msgstr "Nom d'élém&ent :"
+
+#: rc.cpp:174 kxetextviewsettingspage.cpp:163
+msgid "Syntax E&rrors:"
+msgstr "E&rreur de syntaxe :"
+
+#: rc.cpp:175 kxetextviewsettingspage.cpp:164
+msgid "Attribute &values:"
+msgstr "&Valeur de l'attribut :"
+
+#: rc.cpp:177 kxetextviewsettingspage.cpp:166
+msgid "Co&mments:"
+msgstr "Co&mmentaires :"
+
+#: rc.cpp:178 kxetextviewsettingspage.cpp:167
+msgid "Attribute &names:"
+msgstr "&Nom de l'attribut :"
+
+#: rc.cpp:181 kxetextviewsettingspage.cpp:170
+msgid "&Syntax characters:"
+msgstr "Caractéres de &syntax :"
+
+#: rc.cpp:185 rc.cpp:186 kxetextviewsettingspage.cpp:174
+#: kxetextviewsettingspage.cpp:177
+msgid ""
+"<b>Element indentation</b>\n"
+"<br>\n"
+"You can choose the number of characters you want to be used for indenting "
+"childnodes, when showing your XML documents as raw text."
+msgstr ""
+"<b>Indentation d'élément</b>\n"
+"<br>\n"
+"Donner le nombre de caractère que vous voulez qui soit utilisé pour l'indentation des noeuds enfant lors de l'affichage de votre document XML comme du texte brut."
+
+#: rc.cpp:187 kxetextviewsettingspage.cpp:180
+msgid "&Wrap, instead of Hrz. Scroll bar"
+msgstr "&Aller à la ligne, au lieu d'une barre de defil. "
+
+#: rc.cpp:188 kxetextviewsettingspage.cpp:181
+msgid "Alt+W"
+msgstr "Alt+W"
+
+#: commands_edit.h:45
+msgid "Delete node"
+msgstr "Efface un noeud"
+
+#: commands_edit.h:68
+msgid "Delete attribute"
+msgstr "Efface un attribut"
+
+#: commands_edit.h:88
+msgid "Delete all attributes"
+msgstr "Efface tous les attributs"
+
+#: commands_edit.h:104
+msgid "Cut node"
+msgstr "Coupé un noeud"
+
+#: commands_edit.h:119
+msgid "Paste node to document"
+msgstr "Coller le noeud dans le document"
+
+#: commands_edit.h:137
+msgid "Paste node to element"
+msgstr "Coller le noeud dans l'élement"
+
+#: commands_edit.h:152
+msgid "Paste node to proc. instruction"
+msgstr "Coller le noeud dans l'instr. de trait. "
+
+#: commands_edit.h:168
+msgid "Paste node to char. data"
+msgstr "Coller le noeud vers une donnée caract. "
+
+#: commands_edit.h:187
+msgid "Drag&&drop node"
+msgstr "Glisser-déposer le noeud"
+
+#: commands_edit.h:206
+msgid "Move node up"
+msgstr "Monter le noeud"
+
+#: commands_edit.h:224
+msgid "Move node down"
+msgstr "Descendre le noeud"
+
+#: commands_edit.h:239
+msgid "Editing character data"
+msgstr "Edition de la donnée caractère"
+
+#: commands_edit.h:258
+msgid "Editing proc. instruction"
+msgstr "Modification de l'instruction de trait. "
+
+#: commands_edit.h:277
+msgid "Editing element"
+msgstr "Modification de l'élément"
+
+#: commands_edit.h:298
+msgid "Edit attribute value"
+msgstr "Modifier la valeur de l'attribut"
+
+#: commands_edit.h:317
+msgid "Edit attribute name"
+msgstr "Modifier le nom de l'attribut"
+
+#: commands_edit.h:338
+msgid "Editing raw XML"
+msgstr "Éditer des données XML brute"
+
+#: commands_file.h:44
+msgid "Changing version and encoding"
+msgstr "Changer la version et encodage"
+
+#: commands_file.h:57
+msgid "Attaching stylesheet "
+msgstr "Attacher une feuille de style"
+
+#: commands_file.h:70
+msgid "Detaching stylesheet "
+msgstr "Détacher la feuille de style"
+
+#: commands_file.h:83
+msgid "Attaching schema "
+msgstr "Attacher un schéma"
+
+#: commands_file.h:96
+msgid "Detaching schema "
+msgstr "Détacher le schéma"
+
+#: kxmleditorpart.cpp:124
+msgid "D&eselect Node"
+msgstr "Désél&ectionner le noeud"
+
+#: kxmleditorpart.cpp:128
+msgid "To &Parent Node"
+msgstr "Vers le noeud &parent"
+
+#: kxmleditorpart.cpp:131
+msgid "&Expand Node"
+msgstr "&Déployer le noeud"
+
+#: kxmleditorpart.cpp:136
+msgid "Expand To Level %1"
+msgstr "Déployer le niveau %1"
+
+#: kxmleditorpart.cpp:138
+msgid "&Collapse Node"
+msgstr "&Replier le noeud"
+
+#: kxmleditorpart.cpp:143
+msgid "Collapse To Level %1"
+msgstr "Replier le niveau %1"
+
+#: kxmleditorpart.cpp:146
+msgid "&Toggle Bookmark"
+msgstr "&Basculer le signet"
+
+#: kxmleditorpart.cpp:148
+msgid "&Previous Bookmark"
+msgstr "Signet &précédent"
+
+#: kxmleditorpart.cpp:150
+msgid "&Next Bookmark"
+msgstr "Signet &suivant"
+
+#: kxmleditorpart.cpp:154
+msgid "&Configure KXMLEditor..."
+msgstr "&Configurer KXMLEditor ..."
+
+#: kxmleditorpart.cpp:158
+msgid "Path Bar"
+msgstr "Barre de chemin"
+
+#: kxmleditorpart.cpp:160
+msgid "Clear Path Bar"
+msgstr "Vider la barre de chemin"
+
+#: kxmleditorpart.cpp:162 kxmleditorpart.cpp:163
+msgid "Path: "
+msgstr "Chemin : "
+
+#: kxmleditorpart.cpp:185
+msgid "&Version && Encoding..."
+msgstr "&Version && Encodage ..."
+
+#: kxmleditorpart.cpp:186
+msgid "Attach Schema..."
+msgstr "Attacher un schéma ..."
+
+#: kxmleditorpart.cpp:187
+msgid "Detach Schema"
+msgstr "Détacher le schéma"
+
+#: kxmleditorpart.cpp:188
+msgid "Attach Stylesheet..."
+msgstr "Attacher une feuille de style ..."
+
+#: kxmleditorpart.cpp:189
+msgid "Detach Stylesheet"
+msgstr "Détacher la feuille de style"
+
+#: kxmleditorpart.cpp:209
+msgid "&Move Up"
+msgstr "&Monter"
+
+#: kxmleditorpart.cpp:210
+msgid "Move &Down"
+msgstr "&Descendre"
+
+#: kxmleditorpart.cpp:213
+msgid "&Element..."
+msgstr "&Élément ..."
+
+#: kxmleditorpart.cpp:214
+msgid "&Attribute..."
+msgstr "&Attribut ..."
+
+#: kxmleditorpart.cpp:215
+msgid "&Text..."
+msgstr "&Texte ..."
+
+#: kxmleditorpart.cpp:216
+msgid "C&DATA..."
+msgstr "C&DATA ..."
+
+#: kxmleditorpart.cpp:217
+msgid "&Comment..."
+msgstr "&Commentaire ..."
+
+#: kxmleditorpart.cpp:218
+msgid "&Processing Instruction..."
+msgstr "&Instruction de traitement ..."
+
+#: kxmleditorpart.cpp:222
+msgid "Edit &raw XML..."
+msgstr "Éditer des données XML &brute ..."
+
+#: kxmleditorpart.cpp:226
+msgid "Delete all Attributes..."
+msgstr "Effacer tous les attributs ..."
+
+#: kxmleditorpart.cpp:260
+msgid "Element"
+msgstr "Élément"
+
+#: kxmleditorpart.cpp:274
+msgid "Proc.Instruction"
+msgstr "Instr. de trait. "
+
+#: kxmleditorpart.cpp:381
+msgid "Saving file..."
+msgstr "Enregistrement du fichier ..."
+
+#: kxmleditorpart.cpp:392 kxmleditorpart.cpp:574 kxmleditorpart.cpp:584
+#: kxmleditorpart.cpp:597 kxmleditorpart.cpp:604 kxmleditorpart.cpp:645
+#: kxmleditorpart.cpp:680 kxmleditorpart.cpp:742 kxmleditorpart.cpp:771
+#: kxmleditorpart.cpp:799 kxmleditorpart.cpp:827 kxmleditorpart.cpp:870
+#: kxmleditorpart.cpp:912 kxmleditorpart.cpp:943 kxmleditorpart.cpp:974
+#: kxmleditorpart.cpp:1004 kxmleditorpart.cpp:1050 kxmleditorpart.cpp:1073
+#: kxmleditorpart.cpp:1096 kxmleditorpart.cpp:1112 kxmleditorpart.cpp:1808
+#: kxmleditorshell.cpp:85 kxmleditorshell.cpp:129 kxmleditorshell.cpp:138
+#: kxmleditorshell.cpp:150 kxmleditorshell.cpp:163
+msgid "Ready."
+msgstr "Prêt."
+
+#: kxmleditorpart.cpp:562 kxmleditorpart.cpp:579
+msgid "Search in XML tree ..."
+msgstr "Chercher dans l'arbre XML ..."
+
+#: kxmleditorpart.cpp:615
+msgid "Inserting XML element into document..."
+msgstr "Insertion d'un élément XML dans le document ..."
+
+#: kxmleditorpart.cpp:663
+msgid "Editing XML element..."
+msgstr "Édition d'un élément XML ..."
+
+#: kxmleditorpart.cpp:698
+msgid "Editing raw XML..."
+msgstr "Édition des données XML brute ..."
+
+#: kxmleditorpart.cpp:733 kxetexteditordialog.cpp:93
+msgid "You are changed root element to another node type, while editing !"
+msgstr "Pendant l'édition, vous avez transformé en noeud l'élément racine !"
+
+#: kxmleditorpart.cpp:760
+msgid "Add attribute..."
+msgstr "Ajout d'un attribut ..."
+
+#: kxmleditorpart.cpp:789
+msgid "Remove all attributes from selected node ?"
+msgstr "Enlever tous les attributs du noeud sélectionné ?"
+
+#: kxmleditorpart.cpp:792
+msgid "Delete all attributes..."
+msgstr "Effacer tous les attributs ..."
+
+#: kxmleditorpart.cpp:819
+msgid "Delete attribute..."
+msgstr "Effacer un attribut ..."
+
+#: kxmleditorpart.cpp:868
+msgid "Inserting processing instruction into document..."
+msgstr "Insertion d'une instruction de traitement dans le document ..."
+
+#: kxmleditorpart.cpp:888
+msgid "Editing processing instruction..."
+msgstr "Edition d'une instruction de traitement ..."
+
+#: kxmleditorpart.cpp:930
+msgid "Inserting text into document..."
+msgstr "Insertion d'un texte dans le document ..."
+
+#: kxmleditorpart.cpp:933
+msgid "Insert text"
+msgstr "Insérer un texte"
+
+#: kxmleditorpart.cpp:961
+msgid "Inserting CDATA into document..."
+msgstr "Insertion d'une section CDATA dans le document ..."
+
+#: kxmleditorpart.cpp:964
+msgid "Insert CDATA"
+msgstr "Insérer une section CDATA"
+
+#: kxmleditorpart.cpp:992
+msgid "Inserting comment into document..."
+msgstr "Insertion d'un commentaire dans le document ..."
+
+#: kxmleditorpart.cpp:995
+msgid "Insert comment"
+msgstr "Insérer un commentaire"
+
+#: kxmleditorpart.cpp:1024
+msgid "Editing character data..."
+msgstr "Edition d'une donnée caractère ..."
+
+#: kxmleditorpart.cpp:1068
+msgid "Moving node up..."
+msgstr "Monter le noeud ..."
+
+#: kxmleditorpart.cpp:1091
+msgid "Moving node down..."
+msgstr "Descendre le noeud ..."
+
+#: kxmleditorpart.cpp:1108
+msgid "Configure KXML Editor ..."
+msgstr "Configurer KXML Editor ..."
+
+#: kxmleditorpart.cpp:1279
+msgid "This processing instruction cannot be pasted here !"
+msgstr "Cette instruction de traitement ne peut pas être collée ici !"
+
+#: kxmleditorpart.cpp:1307
+msgid "Root element already exists !"
+msgstr "L'élément racine existe déjà !"
+
+#: kxmleditorpart.cpp:1313
+msgid "Node pasted to document must be element !"
+msgstr "Un noeud collé dans un document doit être un élément !"
+
+#: kxmleditorpart.cpp:1377
+msgid "Incompactible node types for drag&drop !"
+msgstr "Type de noeud incompatible avec le &glisser-déposer !"
+
+#: kxmleditorpart.cpp:1483
+msgid "Page %1"
+msgstr "Page %1"
+
+#: kxmleditorpart.cpp:1776
+msgid "Saving file with a new filename..."
+msgstr "Enregistrer ce fichier sous un nouveau nom ..."
+
+#: kxmleditorpart.cpp:1783
+msgid "Save as..."
+msgstr "Enregistrer sous ..."
+
+#: kxe_viewattributes.cpp:29
+msgid "Namespace"
+msgstr "Espace de nom"
+
+#: kxe_viewattributes.cpp:30
+msgid "Name"
+msgstr "Nom"
+
+#: kxe_viewattributes.cpp:31
+msgid "Value"
+msgstr "Valeur"
+
+#: kxe_viewattributes.cpp:132
+msgid "Attribute name already exists !"
+msgstr "Ce nom d'attribut est déjà utilisé !"
+
+#: main.cpp:31
+msgid "XML file(s) to open"
+msgstr "Fichier(s) XML à ouvrir"
+
+#: rc.cpp:3
+msgid "&Window"
+msgstr "&Fenêtre"
+
+#: kxmleditorshell.cpp:79
+msgid "Close &all"
+msgstr "Tout &fermer"
+
+#: kxmleditorshell.cpp:80
+msgid "Close all &others"
+msgstr "Fermer toutes les &autres"
+
+#: kxmleditorshell.cpp:119 kxmleditorshell.cpp:134
+msgid "Opening file..."
+msgstr "Ouverture de fichier ..."
+
+#: kxmleditorshell.cpp:143
+msgid "Toggle the toolbar..."
+msgstr "Afficher la barre d'outils ..."
+
+#: kxmleditorshell.cpp:156
+msgid "Toggle the statusbar..."
+msgstr "Afficher la barre d'état ..."
+
diff --git a/po/pl.po b/po/pl.po
new file mode 100644
index 0000000..c5eab57
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,1838 @@
+# translation of pl2.po to Polski
+# translation of pl.po to Polski
+# Polish translation of KXMLEditor
+# Copyright (C) 2004, The KXMLEditor Team
+# This file is distributed under the same license as the KXMLEditor package.
+# Adam Charytoniuk <achary@poczta.onet.pl>, 2004.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: pl\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-02-02 22:07+0100\n"
+"PO-Revision-Date: 2004-02-16 21:41+0100\n"
+"Last-Translator: Adam Charytoniuk <achary@poczta.onet.pl>\n"
+"Language-Team: Polski <pl@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: KBabel 1.0.2\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: kxmleditorshell.cpp:78
+msgid "Close &all"
+msgstr "Zamknij &wszystkie"
+
+#: kxmleditorshell.cpp:79
+msgid "Close all &others"
+msgstr "Zamknij wszystkie &inne"
+
+#: kxmleditorshell.cpp:84 kxmleditorshell.cpp:122 kxmleditorshell.cpp:131
+#: kxmleditorshell.cpp:143 kxmleditorshell.cpp:181 kxmleditorshell.cpp:193
+#: kxmleditorshell.cpp:206 kxmleditorpart.cpp:838 kxmleditorpart.cpp:848
+#: kxmleditorpart.cpp:861 kxmleditorpart.cpp:868 kxmleditorpart.cpp:909
+#: kxmleditorpart.cpp:944 kxmleditorpart.cpp:1006 kxmleditorpart.cpp:1035
+#: kxmleditorpart.cpp:1063 kxmleditorpart.cpp:1091 kxmleditorpart.cpp:1134
+#: kxmleditorpart.cpp:1176 kxmleditorpart.cpp:1237 kxmleditorpart.cpp:1268
+#: kxmleditorpart.cpp:1298 kxmleditorpart.cpp:1344 kxmleditorpart.cpp:1367
+#: kxmleditorpart.cpp:1390 kxmleditorpart.cpp:1406
+msgid "Ready."
+msgstr "Gotowy."
+
+#: kxmleditorshell.cpp:114 kxmleditorshell.cpp:127
+msgid "Opening file..."
+msgstr "Otwieranie pliku..."
+
+#: kxmleditorshell.cpp:136
+msgid "Saving file..."
+msgstr "Zapisywanie pliku..."
+
+#: kxmleditorshell.cpp:148
+msgid "Saving file with a new filename..."
+msgstr "Zapisywanie pliku pod nową nazwą..."
+
+#: kxmleditorshell.cpp:155
+msgid "Save as..."
+msgstr "Zapisz jako..."
+
+#: kxmleditorshell.cpp:186
+msgid "Toggle the toolbar..."
+msgstr "Wyświetl pasek narzędziowy..."
+
+#: kxmleditorshell.cpp:199
+msgid "Toggle the statusbar..."
+msgstr "Wyświetl pasek stanu..."
+
+#: main.cpp:31
+msgid "XML file(s) to open"
+msgstr "Plik(i) XML do otwarcia"
+
+#: kxmleditorshell.moc.cpp:34 kxmleditorshell.moc.cpp:42
+msgid "KXMLEditorShell"
+msgstr "KXMLEditorShell"
+
+#: rc.cpp:3
+msgid "&Window"
+msgstr "&Okno"
+
+#: commands_edit.h:45
+msgid "Delete node"
+msgstr "Usuń węzeł"
+
+#: commands_edit.h:68
+msgid "Delete attribute"
+msgstr "Usuń atrybut"
+
+#: commands_edit.h:88
+msgid "Delete all attributes"
+msgstr "Usuń wszystkie atrybuty"
+
+#: commands_edit.h:104
+msgid "Cut node"
+msgstr "Wytnij węzeł"
+
+#: commands_edit.h:119
+msgid "Paste node to document"
+msgstr "Wklej węzeł do dokumentu"
+
+#: commands_edit.h:137
+msgid "Paste node to element"
+msgstr "Wklej węzeł do elementu"
+
+#: commands_edit.h:152
+msgid "Paste node to proc. instruction"
+msgstr "Wklej węzeł do instrukcji przetwarzania"
+
+#: commands_edit.h:168
+msgid "Paste node to char. data"
+msgstr "Wklej węzeł do danych tekstowych"
+
+#: commands_edit.h:187
+msgid "Drag&&drop node"
+msgstr "Przeciągnij&&upuść węzeł"
+
+#: commands_edit.h:206
+msgid "Move node up"
+msgstr "Przenieś węzeł w górę"
+
+#: commands_edit.h:224
+msgid "Move node down"
+msgstr "Przenieś węzeł w dół"
+
+#: commands_edit.h:239
+msgid "Editing character data"
+msgstr "Edytuj dane tekstowe"
+
+#: commands_edit.h:258
+msgid "Editing proc. instruction"
+msgstr "Edytuj instrukcję przetwarzania"
+
+#: commands_edit.h:277
+msgid "Editing element"
+msgstr "Edytuj element"
+
+#: commands_edit.h:298
+msgid "Edit attribute value"
+msgstr "Edytuj vartość atrybutu"
+
+#: commands_edit.h:317
+msgid "Edit attribute name"
+msgstr "Edytuj nazwę atrybutu"
+
+#: commands_edit.h:338
+msgid "Editing raw XML"
+msgstr "Edytuj ręcznie XML"
+
+#: commands_file.h:44
+msgid "Changing version and encoding"
+msgstr "Zmiana wersji i kodowania"
+
+#: commands_file.h:57
+msgid "Attaching stylesheet "
+msgstr "Dołączanie arkusza stylów"
+
+#: commands_file.h:70
+msgid "Detaching stylesheet "
+msgstr "Odłączanie arkusza stylów"
+
+#: commands_file.h:83
+msgid "Attaching schema "
+msgstr "Dołączanie schematu"
+
+#: commands_file.h:96
+msgid "Detaching schema "
+msgstr "Odłączanie schematu"
+
+#: commands_insert.h:36
+msgid "Insert element"
+msgstr "Wstaw element"
+
+#: commands_insert.h:52
+msgid "Insert attribute"
+msgstr "Wstaw atrybut"
+
+#: commands_insert.h:68
+msgid "Insert char data"
+msgstr "Wstaw tekst"
+
+#: commands_insert.h:85
+msgid "Insert proc. instr."
+msgstr "Wstaw instrukcję przetwarzania"
+
+#: kxe_treeview.cpp:54
+msgid "Qualified name"
+msgstr "Nazwa"
+
+#: kxe_treeview.cpp:108
+msgid "Attributes"
+msgstr "Atrybuty"
+
+#: kxe_treeview.cpp:825
+msgid "An XML element can't be moved to its own subtree."
+msgstr "Element XML nie może być przeniesiony do własnego poddrzewa."
+
+#: kxe_treeview.cpp:831
+msgid "An XML node can't be moved in a processing instruction."
+msgstr "Element XML nie może być przeniesiony do instrukcji przetwarzania."
+
+#: kxe_treeview.cpp:841
+msgid "This processing instruction cannot be moved !"
+msgstr "Ta instrukcja przetwarzania nie może być przeniesiona!"
+
+#: kxe_viewattributes.cpp:29
+msgid "Namespace"
+msgstr "Przestrzeń nazw"
+
+#: kxe_viewattributes.cpp:30
+msgid "Name"
+msgstr "Nazwa"
+
+#: kxe_viewattributes.cpp:31
+msgid "Value"
+msgstr "Wartość"
+
+#: kxe_viewattributes.cpp:132
+msgid "Attribute name already exists !"
+msgstr "Atrybut o takiej nazwie już istnieje!"
+
+#: kxearchiveextssettings.cpp:51
+msgid "Archive Extensions"
+msgstr "Rozszerzenia archiwów"
+
+#: kxearchiveextssettings.cpp:56
+msgid "Specify Archive Extensions"
+msgstr "Podaj rozszerzenia archiwów"
+
+#: kxeattributedialog.cpp:124
+msgid "Atttribute namespace cannot contain space !"
+msgstr "Przestrzeń nazw atrybutu nie może zawierać spacji!"
+
+#: kxeattributedialog.cpp:133
+msgid "Atttribute namespace cannot contain character: %1 !"
+msgstr "Przestrzeń nazw atrybutu nie może zawierać znaku \"%1\"!"
+
+#: kxeattributedialog.cpp:147
+msgid "Atttribute name cannot contain space !"
+msgstr "Nazwa atrybutu nie może zawierać spacji!"
+
+#: kxeattributedialog.cpp:156
+msgid "Atttribute name cannot contain character: %1 !"
+msgstr "Nazwa atrybutu nie może zawierać znaku \"%1\"!"
+
+#: kxeattributedialog.cpp:175
+msgid "Attribute value cannot contain character: %1 !"
+msgstr "Wartość atrybutu nie może zawierać znaku \"%1\"!"
+
+#: kxechardatadialog.cpp:108 kxeprocinstrdialog.cpp:179
+msgid "Contents cannot contain character: %1 !"
+msgstr "Zawartość nie może zawierać znaku \"%1\" !"
+
+#: kxeconfiguration.cpp:86
+msgid "Configure KXMLEditor"
+msgstr "Konfiguruj KXMLEditor"
+
+#: kxeelementdialog.cpp:164
+msgid "Element name cannot contain space !"
+msgstr "Nazwa elementu nie może zawierać spacji!"
+
+#: kxeelementdialog.cpp:168
+msgid "Element name cannot start with 'xml' or 'XML' !"
+msgstr "Nazwa elementu nie może zawierać \"xml\" lub \"XML\"!"
+
+#: kxeelementdialog.cpp:174
+msgid "Element name must start with an underscore or a letter !"
+msgstr "Nazwa elementu musi zaczynać się od podkreślenia lub litery!"
+
+#: kxeelementdialog.cpp:184
+msgid "Element name cannot contain character: %1 !"
+msgstr "Nazwa elementu nie może zawierać znaku \"%1\"!"
+
+#: kxenewfilesettings.cpp:69
+msgid "New Files"
+msgstr "Nowe pliki"
+
+#: kxenewfilesettings.cpp:74
+msgid "New File Settings"
+msgstr "Ustawienia nowych plików"
+
+#: kxeprintsettings.cpp:78
+msgid "Printing"
+msgstr "Drukowanie"
+
+#: kxeprintsettings.cpp:83
+msgid "Print Settings"
+msgstr "Ustawienia wydruku"
+
+#: kxeprocinstrdialog.cpp:140
+msgid ""
+"Pleasse use menu item File -> Version and encoding for this processing "
+"instruction !"
+msgstr "Użyj opcji Plik->Wersja i kodowanie aby wprowadzić zmiany w tej intrukcji!"
+
+#: kxeprocinstrdialog.cpp:160
+msgid "Target cannot contain character: %1 !"
+msgstr "Dana nie może zawierać znaku \"%1\" !"
+
+#: kxetexteditordialog.cpp:82 kxmleditorpart.cpp:988 kxmleditorpart.cpp:1590
+#: kxedocument.cpp:323
+msgid "%1 in line %2, column %3"
+msgstr "%1 w linii %2, kolumna %3"
+
+#: kxetexteditordialog.cpp:83 kxmleditorpart.cpp:989 kxmleditorpart.cpp:1591
+#: kxedocument.cpp:324
+msgid "Parsing error !"
+msgstr "Błąd parsera!"
+
+#: kxetexteditordialog.cpp:93 kxmleditorpart.cpp:997
+msgid "You are changed root element to another node type, while editing !"
+msgstr "W czasie edycji zmieniłeś typ elementu głównego na inny rodzaj węzła!"
+
+#: kxetextviewsettings.cpp:96
+msgid "Text view"
+msgstr "Widok tekstowy"
+
+#: kxetextviewsettings.cpp:101
+msgid "Text view properties"
+msgstr "Ustawienia widoku tekstowego"
+
+#: kxetreeviewsettings.cpp:78
+msgid "Tree View"
+msgstr "Widok drzewa"
+
+#: kxetreeviewsettings.cpp:83
+msgid "Tree view properties"
+msgstr "Ustawienia widoku drzewa"
+
+#: kxmleditorabout.h:28
+msgid "KXML Editor is an utility to display and edit XML files"
+msgstr "KXMLEditor jest programem narzędziowym do prezentacji i edycji plików XML."
+
+#: kxmleditorabout.h:35
+msgid "KXML Editor"
+msgstr "KXMLEditor"
+
+#: kxmleditorabout.h:44
+msgid "Developer and maintainer"
+msgstr "Programista i szef projektu"
+
+#: kxmleditorabout.h:45 kxmleditorabout.h:47
+msgid "Developer"
+msgstr "Programista"
+
+#: kxmleditorpart.cpp:112
+msgid "D&eselect Node"
+msgstr "&Odznacz węzeł"
+
+#: kxmleditorpart.cpp:116
+msgid "To &Parent Node"
+msgstr "Do węzła &nadrzędnego"
+
+#: kxmleditorpart.cpp:119
+msgid "&Expand Node"
+msgstr "&Rozwiń węzeł"
+
+#: kxmleditorpart.cpp:124
+msgid "Expand To Level %1"
+msgstr "Rozwiń do poziomu %1"
+
+#: kxmleditorpart.cpp:126
+msgid "&Collapse Node"
+msgstr "&Zwiń węzeł"
+
+#: kxmleditorpart.cpp:131
+msgid "Collapse To Level %1"
+msgstr "Zwiń do poziomu %1"
+
+#: kxmleditorpart.cpp:134
+msgid "&Toggle Bookmark"
+msgstr "Przełącz &zakładkę"
+
+#: kxmleditorpart.cpp:136
+msgid "&Previous Bookmark"
+msgstr "&Poprzednia zakładka"
+
+#: kxmleditorpart.cpp:138
+msgid "&Next Bookmark"
+msgstr "&Następna zakładka"
+
+#: kxmleditorpart.cpp:142
+msgid "&Configure KXMLEditor..."
+msgstr "&Konfiguruj KXMLEditor..."
+
+#: kxmleditorpart.cpp:146
+msgid "Path Bar"
+msgstr "Pasek ścieżki"
+
+#: kxmleditorpart.cpp:148
+msgid "Clear Path Bar"
+msgstr "Wyczyść ścieżkę"
+
+#: kxmleditorpart.cpp:150 kxmleditorpart.cpp:151
+msgid "Path: "
+msgstr "Ścieżka: "
+
+#: kxmleditorpart.cpp:164
+msgid "&Move Up"
+msgstr "Przenieś w &górę"
+
+#: kxmleditorpart.cpp:165
+msgid "Move &Down"
+msgstr "Przenieś w &dół"
+
+#: kxmleditorpart.cpp:168
+msgid "&Element..."
+msgstr "&Element..."
+
+#: kxmleditorpart.cpp:169
+msgid "&Attribute..."
+msgstr "&Atrybut..."
+
+#: kxmleditorpart.cpp:170
+msgid "&Text..."
+msgstr "&Tekst..."
+
+#: kxmleditorpart.cpp:171
+msgid "C&DATA..."
+msgstr "C&DATA..."
+
+#: kxmleditorpart.cpp:172
+msgid "&Comment..."
+msgstr "&Komentarz..."
+
+#: kxmleditorpart.cpp:173
+msgid "&Processing Instruction..."
+msgstr "Instrukcja &przetwarzania..."
+
+#: kxmleditorpart.cpp:177
+msgid "Edit &raw XML..."
+msgstr "Edytuj &ręcznie XML..."
+
+#: kxmleditorpart.cpp:181
+msgid "Delete all Attributes..."
+msgstr "Usuń wszystkie atrybuty..."
+
+#: kxmleditorpart.cpp:223
+msgid "Element"
+msgstr "Element"
+
+#: kxmleditorpart.cpp:236
+msgid "Proc.Instruction"
+msgstr "Instrukcja przetwarzania"
+
+#: kxmleditorpart.cpp:826 kxmleditorpart.cpp:843
+msgid "Search in XML tree ..."
+msgstr "Szukaj w drzewie XML:"
+
+#: kxmleditorpart.cpp:879
+msgid "Inserting XML element into document..."
+msgstr "Wstawianie elementu XML do dokumentu..."
+
+#: kxmleditorpart.cpp:927
+msgid "Editing XML element..."
+msgstr "Edycja elementu XML..."
+
+#: kxmleditorpart.cpp:962
+msgid "Editing raw XML..."
+msgstr "Ręczna edycja XML'a..."
+
+#: kxmleditorpart.cpp:1024
+msgid "Add attribute..."
+msgstr "Dodanie atrybutu..."
+
+#: kxmleditorpart.cpp:1053
+msgid "Remove all attributes from selected node ?"
+msgstr "Czy usunąć wszystkie atrybuty z zaznaczonego węzła?"
+
+#: kxmleditorpart.cpp:1056
+msgid "Delete all attributes..."
+msgstr "Usuwanie wszystkich atrybutów.."
+
+#: kxmleditorpart.cpp:1083
+msgid "Delete attribute..."
+msgstr "Usuwanie atrybutu..."
+
+#: kxmleditorpart.cpp:1132
+msgid "Inserting processing instruction into document..."
+msgstr "Wstawianie instrukcji przetwarzania do dokumentu..."
+
+#: kxmleditorpart.cpp:1152
+msgid "Editing processing instruction..."
+msgstr "Edycja instrukcji przetwarzania..."
+
+#: kxmleditorpart.cpp:1224
+msgid "Inserting text into document..."
+msgstr "Wstawianie tekstu do dokumentu..."
+
+#: kxmleditorpart.cpp:1227
+msgid "Insert text"
+msgstr "Wstaw tekst"
+
+#: kxmleditorpart.cpp:1255
+msgid "Inserting CDATA into document..."
+msgstr "Wstawianie sekcji CDATA do dokumentu..."
+
+#: kxmleditorpart.cpp:1258
+msgid "Insert CDATA"
+msgstr "Wsatw sekcję CDATA"
+
+#: kxmleditorpart.cpp:1286
+msgid "Inserting comment into document..."
+msgstr "Wstawianie komentarza do dokumentu..."
+
+#: kxmleditorpart.cpp:1289
+msgid "Insert comment"
+msgstr "Wstaw komentarz"
+
+#: kxmleditorpart.cpp:1318
+msgid "Editing character data..."
+msgstr "Edycja danych tekstowych..."
+
+#: kxmleditorpart.cpp:1362
+msgid "Moving node up..."
+msgstr "Przenoszenie węzła w górę..."
+
+#: kxmleditorpart.cpp:1385
+msgid "Moving node down..."
+msgstr "Przenoszenie węzła w dół..."
+
+#: kxmleditorpart.cpp:1402
+msgid "Configure KXML Editor ..."
+msgstr "Konfiguruj KXMLEditor"
+
+#: kxmleditorpart.cpp:1573
+msgid "This processing instruction cannot be pasted here !"
+msgstr "Ta instrukcja przetwarzania nie może być tu wklejona!"
+
+#: kxmleditorpart.cpp:1601
+msgid "Root element already exists !"
+msgstr "Element główny już istnieje!"
+
+#: kxmleditorpart.cpp:1607
+msgid "Node pasted to document must be element !"
+msgstr "Węzeł wklejany do dokumentu powinien być elementem!"
+
+#: kxmleditorpart.cpp:1649
+msgid "Incompactible node types for drag&drop !"
+msgstr "Nie kompatybilny rodzaj węzła dla operacji Drag&Drop!"
+
+#: kxmleditorpart.cpp:1810
+msgid "Page %1"
+msgstr "Strona %1"
+
+#: rc.cpp:7 rc.cpp:14
+msgid "Path Toolbar"
+msgstr "Pasek ścieżki"
+
+#: rc.cpp:15
+msgid "XML Toolbar"
+msgstr "Pasek XML"
+
+#: rc.cpp:16 kxearchiveextssettingspage.cpp:90
+msgid "Archive Exts Settings Page"
+msgstr "Strona ustawień rozszerzeń plików skompresowanych"
+
+#: rc.cpp:17 kxearchiveextssettingspage.cpp:91
+msgid "Extensions of archive &files:"
+msgstr "Rozszerzenia &plików skompresowanych:"
+
+#: rc.cpp:18 kxearchiveextssettingspage.cpp:92
+msgid ""
+"<b>Extensions of archive files</b>\n"
+"<br>\n"
+"This list contains the known extensions for archive files.<br>\n"
+"You can choose one to edit or remove it with the dialog widgets below."
+msgstr ""
+"<b>Rozszerzenia plików skompresowanych</b>\n"
+"<br/>\n"
+"Lista ta zawiera znane roszerzenia dla plików skompresowanych.<br>\n"
+"Możesz wybrać każde z nich do edycji przty pomocy pól edycyjnych poniżej."
+
+#: rc.cpp:19 kxearchiveextssettingspage.cpp:96
+msgid ""
+"<b>Extensions of archive files</b>\n"
+"<br>\n"
+"This list contains the known extensions for archive files."
+msgstr ""
+"<b>Rozszerzenia plików skompresowanych</b>\n"
+"<br/>\n"
+"Lista ta zawiera znane roszerzenia dla plików skompresowanych."
+
+#: rc.cpp:20 kxearchiveextssettingspage.cpp:99
+msgid "&Extension:"
+msgstr "&Rozszerzenie:"
+
+#: rc.cpp:21 rc.cpp:22 kxearchiveextssettingspage.cpp:100
+#: kxearchiveextssettingspage.cpp:103
+msgid ""
+"<b>Extension</b>\n"
+"<br>\n"
+"Change the selected extension here."
+msgstr ""
+"<b>Rozszerzenie</b>\n"
+"<br>\n"
+"Zmień zaznaczone tu rozszerzenie."
+
+#: rc.cpp:23 kxearchiveextssettingspage.cpp:106
+msgid "&New"
+msgstr "&Nowe"
+
+#: rc.cpp:24 kxearchiveextssettingspage.cpp:107
+msgid "Alt+N"
+msgstr "Alt+N"
+
+#: rc.cpp:25 kxearchiveextssettingspage.cpp:108
+msgid ""
+"<b>New</b>\n"
+"<br>\n"
+"You can create a new item for another known extension in the list above."
+msgstr ""
+"<b>Nowe</b>\n"
+"<br>\n"
+"Możesz dodać nowy wpis dla kolejnego znanego rozszerzenia do powyższej listy."
+
+#: rc.cpp:27 kxearchiveextssettingspage.cpp:112
+msgid "Alt+D"
+msgstr "Alt+D"
+
+#: rc.cpp:28 kxearchiveextssettingspage.cpp:113
+msgid ""
+"<b>Delete</b>\n"
+"<br>\n"
+"You can delete the selected extension from the list above."
+msgstr ""
+"<b>Usuń</b>\n"
+".<br>\n"
+"Możesz usunąć zaznaczony wpis z powyższej listy."
+
+#: rc.cpp:29 kxeattachdialogbase.cpp:87
+msgid "Attach to XML"
+msgstr "Dołącz do XML"
+
+#: rc.cpp:30 kxeattachdialogbase.cpp:88
+msgid "attachment URI:"
+msgstr "URI załącznika:"
+
+#: rc.cpp:32 kxeattachdialogbase.cpp:90
+msgid "F1"
+msgstr "F1"
+
+#: rc.cpp:37 kxeattributedialogbase.cpp:120
+msgid "XML Attribute"
+msgstr "Atrybut XML"
+
+#: rc.cpp:38 rc.cpp:50 kxeattributedialogbase.cpp:121
+#: kxeattributedialogbase.cpp:143
+msgid ""
+"<b>Namespace URI</b>\n"
+"<br/>\n"
+"Enter the namespace URI for this attribute here."
+msgstr ""
+"<b>URI przestrzeni nazw</b>\n"
+"<br/>\n"
+"Podaj URI przestrzeni nazw dla tego atrybutu."
+
+#: rc.cpp:39 rc.cpp:46 kxeattributedialogbase.cpp:124
+#: kxeattributedialogbase.cpp:135
+msgid ""
+"<b>Value</b>\n"
+"<br/>\n"
+"Enter the attribute's value here."
+msgstr ""
+"<b>Wartość</b><br/>\n"
+"Podaj wartość atrybutu."
+
+#: rc.cpp:40 rc.cpp:48 kxeattributedialogbase.cpp:127
+#: kxeattributedialogbase.cpp:139
+msgid ""
+"<b>Qualified Name</b>\n"
+"<br/>\n"
+"Enter a qualified name for the attribute here."
+msgstr ""
+"<b>Nazwa</b>\n"
+"<br/>\n"
+"Podaj prawidłową nazwę dla atrybutu."
+
+#: rc.cpp:42 rc.cpp:59 rc.cpp:78 rc.cpp:127 kxeprocinstrdialogbase.cpp:130
+#: kxeelementdialogbase.cpp:157 kxeattributedialogbase.cpp:131
+#: kxechardatadialogbase.cpp:118
+msgid "Alt+O"
+msgstr "Alt+O"
+
+#: rc.cpp:44 rc.cpp:80 rc.cpp:129 kxeprocinstrdialogbase.cpp:132
+#: kxeelementdialogbase.cpp:159 kxeattributedialogbase.cpp:133
+msgid "Alt+C"
+msgstr "Alt+C"
+
+#: rc.cpp:45 kxeattributedialogbase.cpp:134
+msgid "&Value:"
+msgstr "&Wartość:"
+
+#: rc.cpp:47 kxeattributedialogbase.cpp:138
+msgid "Qualified &Name:"
+msgstr "&Nazwa:"
+
+#: rc.cpp:49 rc.cpp:75 kxeelementdialogbase.cpp:153
+#: kxeattributedialogbase.cpp:142
+msgid "Namespace &URI:"
+msgstr "&URI przesrzeni nazw:"
+
+#: rc.cpp:51 kxechardatadialogbase.cpp:105
+msgid "XML Character Data"
+msgstr "Dane tekstowe XML"
+
+#: rc.cpp:52 rc.cpp:81 rc.cpp:120 kxeprocinstrdialogbase.cpp:118
+#: kxeelementdialogbase.cpp:160 kxechardatadialogbase.cpp:106
+msgid "&Insert:"
+msgstr "Ws&taw"
+
+#: rc.cpp:53 rc.cpp:56 kxechardatadialogbase.cpp:107
+#: kxechardatadialogbase.cpp:113
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this XML character data in the XML elements list of "
+"childnodes."
+msgstr "<b>Wstaw</b><br/> Wybierz miejsce gdzie chcesz wstawić dane tekstowe XML"
+
+#: rc.cpp:54 rc.cpp:83 rc.cpp:122 kxeprocinstrdialogbase.cpp:123
+#: kxeelementdialogbase.cpp:165 kxechardatadialogbase.cpp:111
+msgid "at top"
+msgstr "jako pierwszy"
+
+#: rc.cpp:55 rc.cpp:84 rc.cpp:123 kxeprocinstrdialogbase.cpp:124
+#: kxeelementdialogbase.cpp:166 kxechardatadialogbase.cpp:112
+msgid "at bottom"
+msgstr "jako ostatni"
+
+#: rc.cpp:57 kxechardatadialogbase.cpp:116
+msgid "You can edit the XML character data in this editor."
+msgstr "Możesz edytować dane tesktowe w tym edytorze."
+
+#: rc.cpp:61 kxechoosestringdialogbase.cpp:82
+msgid "Choose string"
+msgstr "Wybierz tekst"
+
+#: rc.cpp:62 rc.cpp:66 kxechoosestringdialogbase.cpp:83
+#: kxechoosestringdialogbase.cpp:89
+msgid ""
+"<b>Enter string<b/>\n"
+"<br/>\n"
+"Enter or choose string, that you want."
+msgstr "<b>Wybierz tekst</b><br/>Wpisz lub wybierz pożadany tekst."
+
+#: rc.cpp:65 kxechoosestringdialogbase.cpp:88
+msgid "&Enter string:"
+msgstr "Wybierz &tekst"
+
+#: rc.cpp:67 kxeelementdialogbase.cpp:136
+msgid "XML Element"
+msgstr "Element XML"
+
+#: rc.cpp:68 kxeelementdialogbase.cpp:137
+msgid "&Prefix:"
+msgstr "&Prefiks:"
+
+#: rc.cpp:69 rc.cpp:72 kxeelementdialogbase.cpp:138
+#: kxeelementdialogbase.cpp:146
+msgid ""
+"<b>Prefix</b>\n"
+"<br/>\n"
+"You can enter the namespace prefix for this XML element here."
+msgstr "<b>Prefiks:</b><br/>Podaj prefiks dla przestrzeni nazw elementu."
+
+#: rc.cpp:70 rc.cpp:76 kxeelementdialogbase.cpp:141
+#: kxeelementdialogbase.cpp:154
+msgid ""
+"<b>Namespace URI</b><br/>\n"
+"You can enter the namespace URI of this XML element here."
+msgstr ""
+"<b>URI przestrzeni nazw</b>\n"
+"<br/>\n"
+"Podaj URI przestrzeni nazw dla tego atrybutu."
+
+#: rc.cpp:71 rc.cpp:74 kxeelementdialogbase.cpp:143
+#: kxeelementdialogbase.cpp:150
+msgid ""
+"<b>Local Name</b>\n"
+"<br/>\n"
+"You have to enter this XML elements name here."
+msgstr "<b>Nazwa lokalna:</b><br/>Musisz podać tu nazwe elementu XML."
+
+#: rc.cpp:73 kxeelementdialogbase.cpp:149
+msgid "Local &Name:"
+msgstr "Nazwa &lokalna:"
+
+#: rc.cpp:82 rc.cpp:85 kxeelementdialogbase.cpp:161
+#: kxeelementdialogbase.cpp:167
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this XML element in the parent elements list of "
+"childelements."
+msgstr "<b>Wstaw:</b><br/>Wybierz gdzie umieścić wybrany element XML w liście."
+
+#: rc.cpp:86 kxenewfilesettingspage.cpp:97
+msgid "New File Settings Page"
+msgstr "Strona ustawień nowych plików"
+
+#: rc.cpp:87 rc.cpp:146 kxespecprocinstrdialogbase.cpp:115
+#: kxenewfilesettingspage.cpp:98
+msgid "XML &version:"
+msgstr "&Wersja XML'a:"
+
+#: rc.cpp:88 rc.cpp:89 kxenewfilesettingspage.cpp:99
+#: kxenewfilesettingspage.cpp:103
+msgid ""
+"<b>XML version</b>\n"
+"<br>\n"
+"You can determine the default XML version for XML documents being created. "
+"This version is the default setting in wizard dialogs.<br>\n"
+"Since there's only one XML version yet, you shouldn't change this value."
+msgstr ""
+"<b>Wersja XML'a</b>\n"
+"<br>\n"
+" Możesz określić domyślną wersję XML'a dla nowo tworzonych plików. Wersja ta "
+"będzie domyślną wartością w oknie dialogowym nowego pliku.<br>\n"
+"Ponieważ w chwili obecnej używana jest jedynie jedna wersja XML'a, nie "
+"powinieneś raczej zmieniać tej wartości."
+
+#: rc.cpp:90 kxenewfilesettingspage.cpp:107
+msgid "Default &encoding:"
+msgstr "&Kodowanie domyślne:"
+
+#: rc.cpp:91 rc.cpp:92 kxenewfilesettingspage.cpp:108
+#: kxenewfilesettingspage.cpp:111
+msgid ""
+"<b>Default encoding</b>\n"
+"<br>\n"
+"You can determine the default encoding for XML documents being created. This "
+"version is the default setting in wizard dialogs."
+msgstr ""
+"<b>Kodowanie domyślne</b>\n"
+"<br>\n"
+"Możesz określić domyślne kodowanie dla nowo tworzonych plików XML. Kodowanie "
+"to będzie domyślnym ustawieniem w oknie dialogowym nowych plików."
+
+#: rc.cpp:93 kxenewfilesettingspage.cpp:114
+msgid "&Behavior on creating new files"
+msgstr "&Zachowanie w czasie tworzenia nowych plików"
+
+#: rc.cpp:94 kxenewfilesettingspage.cpp:115
+msgid ""
+"<b>Behavior on creating new files</b>\n"
+"<br>\n"
+"You can determine the behavior on creating new XML documents. Choose one of "
+"the following:<br>\n"
+"<br>\n"
+"<b><i>Start with new empty file</i></b><br>\n"
+"Creates an empty XML document.<br>\n"
+"<br>\n"
+"<b><i>Start with file settings dialog assistance</i></b><br>\n"
+"Opens a dialog to choose the XML version and encoding of the new document."
+"<br>\n"
+"<br>\n"
+"<b><i>Start with new file with default settings</i></b><br>\n"
+"Creates an XML document with the default XML version and default encoding "
+"selected above."
+msgstr ""
+"<b>Zachowanie w czasie tworzenia nowych plików</b>\n"
+"<br>\n"
+"Możesz ustawić zachowanie programu w czasie tworzenia nowych plików. Wybierz "
+"jedną z poniższych opcji:<br>\n"
+"<br>\n"
+"<b><i>Rozpocznij z nowym plikiem</i></b><br>\n"
+"Tworzy nowy pusty dokument<br>\n"
+"<br>\n"
+"<b><i>Rozpocznij z asystującym oknem dialogowym</i></b><br>\n"
+"Otwiera okno dialogow z wyborem wersji XML'a i kodowaniem znaków w "
+"dokumencie.<br>\n"
+"<br>\n"
+"<b><i>Rozpocznij z nowym plikiem i domyślnymi ustawieniami</i></b><br>\n"
+"Tworzy nowy dokument XML z domyślnymi ustawieniami wersji i kodowania znaków."
+
+#: rc.cpp:95 kxenewfilesettingspage.cpp:127
+msgid "Start with new empty file"
+msgstr "Rozpocznij z nowym pustym plikiem."
+
+#: rc.cpp:96 kxenewfilesettingspage.cpp:128
+msgid "Start with file settings dialog assistance"
+msgstr "Rozpocznij z asystującym oknem dialogowym"
+
+#: rc.cpp:97 kxenewfilesettingspage.cpp:129
+msgid "Start with new file with default settings"
+msgstr "Rozpocznij z nowym plikiem i domyślnymi ustawieniami"
+
+#: rc.cpp:98 kxeprintsettingspage.cpp:97
+msgid "Print Settings Page"
+msgstr "Strona ustawieńµ wydruku"
+
+#: rc.cpp:99 kxeprintsettingspage.cpp:98
+msgid "Font &family:"
+msgstr "&Czcionka:"
+
+#: rc.cpp:100 rc.cpp:101 kxeprintsettingspage.cpp:99
+#: kxeprintsettingspage.cpp:102
+msgid ""
+"<b>Font family</b>\n"
+"<br>\n"
+"Choose the font family you want to be used on printing your XML documents."
+msgstr ""
+"<b>Czcionka</b>\n"
+"<br>\n"
+"Wybierz rodzaj czcionki, jaka będzie użyta do wydruku dokumentów XML."
+
+#: rc.cpp:102 kxeprintsettingspage.cpp:105
+msgid "Font &size:"
+msgstr "&Rozmiar:"
+
+#: rc.cpp:103 rc.cpp:106 kxeprintsettingspage.cpp:106
+#: kxeprintsettingspage.cpp:111
+msgid ""
+"<b>Font size</b>\n"
+"<br>\n"
+"Choose the font size you want to be used on printing your XML documents."
+msgstr ""
+"<b>Rozmiar</b>\n"
+"<br>\n"
+"Wybierz rozmiar czcionki, jaka będzie użyta do wydruku dokumentów XML."
+
+#: rc.cpp:104 kxeprintsettingspage.cpp:109
+msgid "pt"
+msgstr "pt"
+
+#: rc.cpp:107 rc.cpp:183 kxeprintsettingspage.cpp:114
+#: kxetextviewsettingspage.cpp:165
+msgid "Element &indentation:"
+msgstr "&Wcięcia:"
+
+#: rc.cpp:108 rc.cpp:109 kxeprintsettingspage.cpp:115
+#: kxeprintsettingspage.cpp:118
+msgid ""
+"<b>Element indentation</b>\n"
+"<br>\n"
+"Choose the number of characters you want to be used for indenting childnodes "
+"on printing you XML documents."
+msgstr ""
+"<b>Wcięcia</b>\n"
+"<br>\n"
+"Podaj ilośc znaków, jaka ma być uzyta do tworzenia wcięć w wydrukach "
+"dokumentów XML."
+
+#: rc.cpp:110 kxeprintsettingspage.cpp:121
+msgid "&Print header"
+msgstr "Wydrukuj &nagłówek"
+
+#: rc.cpp:111 rc.cpp:198 kxetreeviewsettingspage.cpp:129
+#: kxeprintsettingspage.cpp:122
+msgid "Alt+P"
+msgstr "Alt+P"
+
+#: rc.cpp:112 kxeprintsettingspage.cpp:123
+msgid ""
+"<b>Print header</b>\n"
+"<br>\n"
+"You can determine wether you want a header to be printed on every page when "
+"printing you XML documents or not."
+msgstr ""
+"<b>Wydrukuj nagłówek</b>\n"
+"<br>\n"
+"Możesz ustawić czy na każdej drukowanej stronie dokumentu XML "
+"powininenpojawić się nagłówek, czy też nie."
+
+#: rc.cpp:113 kxeprintsettingspage.cpp:126
+msgid "P&rint footer"
+msgstr "Wydrukuj &stopkę"
+
+#: rc.cpp:114 rc.cpp:188 kxetreeviewsettingspage.cpp:109
+#: kxeprintsettingspage.cpp:127
+msgid "Alt+R"
+msgstr "Alt+R"
+
+#: rc.cpp:115 kxeprintsettingspage.cpp:128
+msgid ""
+"<b>Print footer</b>\n"
+"<br>\n"
+"You can determine wether you want a footline to be printed on every page "
+"when printing you XML documents or not."
+msgstr ""
+"<b>Wydrukuj stopkę</b>\n"
+"<br>\n"
+"Możesz ustawić czy na każdej drukowanej stronie dokumentu XML powinnapojawić "
+"się stopka, czy też nie."
+
+#: rc.cpp:116 kxeprocinstrdialogbase.cpp:112
+msgid "Processing Instruction"
+msgstr "Instrukcja przetwarzania"
+
+#: rc.cpp:117 kxeprocinstrdialogbase.cpp:113
+msgid "&Target:"
+msgstr "&Nazwa:"
+
+#: rc.cpp:118 rc.cpp:119 kxeprocinstrdialogbase.cpp:114
+#: kxeprocinstrdialogbase.cpp:116
+msgid ""
+"<b>Target</b><br/>\n"
+"Define the target of this processing instruction here."
+msgstr "<b>Nazwa:</b><br/>Podaj nazwę instrukcji przetwarzania"
+
+#: rc.cpp:121 rc.cpp:124 kxeprocinstrdialogbase.cpp:119
+#: kxeprocinstrdialogbase.cpp:125
+msgid ""
+"<b>Insert</b>\n"
+"<br/>\n"
+"Choose, where to place this processing instruction in the parent elements "
+"list."
+msgstr ""
+"<b>Wstaw:</b><br/>Wybierz gdzie umieścić instrukcję przetwarzania w liście "
+"elementu nadrzędnego."
+
+#: rc.cpp:125 kxeprocinstrdialogbase.cpp:128
+msgid ""
+"Here you can enter the data (the instructions) of this XML processing "
+"instruction."
+msgstr "Możesz wprowadzić tu zawartość intrukcji przetwarzania dla XML."
+
+#: rc.cpp:130 kxesearchdialogbase.cpp:139
+msgid "Search"
+msgstr "Szukaj"
+
+#: rc.cpp:131 kxesearchdialogbase.cpp:140
+msgid "&Search string:"
+msgstr "Szukany &tekst:"
+
+#: rc.cpp:132 rc.cpp:133 kxesearchdialogbase.cpp:141
+#: kxesearchdialogbase.cpp:143
+msgid ""
+"<b>Search string</b></br>\n"
+"Here you can enter the string you want to search for in your XML document."
+msgstr "<b>Szukany tekst</b></br>Wprowadź szukany tekst."
+
+#: rc.cpp:134 kxesearchdialogbase.cpp:145
+msgid "&Find"
+msgstr "&Znajdź"
+
+#: rc.cpp:136 kxesearchdialogbase.cpp:147
+msgid "Find &in"
+msgstr "Znajdź &w"
+
+#: rc.cpp:137 kxesearchdialogbase.cpp:148
+msgid ""
+"<b>Find in</b>\n"
+"<br/>\n"
+"Here you can choose the parts of your XML document that should be inspected "
+"during the search. \n"
+"<br/>\n"
+"These are\n"
+"<br/>\n"
+"<br/>\n"
+"<b><i>Element names</i></b><br/>\n"
+"<b><i>Attribute names</i></b><br/>\n"
+"<b><i>Attribute values</i></b><br/>\n"
+"<b><i>Content</i></b>"
+msgstr ""
+"<b>Znajdź w</b>\n"
+"<br/>\n"
+"Możesz ustawić tu rodzaje węzłół w pliku XML jakie powinny zostać "
+"przeszukane \n"
+"<br/>\n"
+"Są to\n"
+"<br/>\n"
+"<br/>\n"
+"<b><i>Nazwy elementół</i></b><br/>\n"
+"<b><i>Nazwy atrybutów</i></b><br/>\n"
+"<b><i>Wartości atrybutów</i></b><br/>\n"
+"<b><i>Zawartość</i></b>"
+
+#: rc.cpp:138 kxesearchdialogbase.cpp:159
+msgid "Element names"
+msgstr "Nazwy elementów"
+
+#: rc.cpp:139 kxesearchdialogbase.cpp:160
+msgid "Attribute names"
+msgstr "Nazwy atrybutów"
+
+#: rc.cpp:140 kxesearchdialogbase.cpp:161
+msgid "Attribute values"
+msgstr "Wartości atrybutów"
+
+#: rc.cpp:141 kxesearchdialogbase.cpp:162
+msgid "Content"
+msgstr "Zawartość"
+
+#: rc.cpp:142 kxesearchdialogbase.cpp:163
+msgid "&Match case"
+msgstr "&Rozróżniaj wielkość znaków"
+
+#: rc.cpp:143 kxesearchdialogbase.cpp:164
+msgid "Alt+M"
+msgstr "Alt+M"
+
+#: rc.cpp:144 kxesearchdialogbase.cpp:165
+msgid ""
+"<b>Match case</b><br/>\n"
+"Check this for case sensitive search."
+msgstr ""
+"<b>Rozróżniaj wielkość znaków</b><br/>Zaznacz tę opcję jeśli chcesz "
+"przeszukiwać z uwzględnieniem wielkości znaków."
+
+#: rc.cpp:145 kxespecprocinstrdialogbase.cpp:114
+msgid "Special processing instruction"
+msgstr "Specjalna instrukcja przetwarzania"
+
+#: rc.cpp:147 rc.cpp:148 kxespecprocinstrdialogbase.cpp:116
+#: kxespecprocinstrdialogbase.cpp:118
+msgid ""
+"<b>XML version</b><br/>\n"
+"You can determine the XML version for XML document."
+msgstr "<b>Wersja XML'a</b><br/>Możesz tu podać wersję XML'a."
+
+#: rc.cpp:149 kxespecprocinstrdialogbase.cpp:120
+msgid "&Encoding:"
+msgstr "&Kodowanie:"
+
+#: rc.cpp:150 rc.cpp:151 kxespecprocinstrdialogbase.cpp:121
+#: kxespecprocinstrdialogbase.cpp:123
+msgid ""
+"<b>Encoding</b><br/>\n"
+"You can determine the encoding used while saving this XML document."
+msgstr "<b>Kodowanie</b><br/>Kodowanie wykorzystane do właściwego zapisu dokumentu."
+
+#: rc.cpp:152 kxespecprocinstrdialogbase.cpp:125
+msgid "Do not show this dialog again"
+msgstr "Nie pokazuj więcej tego okna"
+
+#: rc.cpp:153 kxespecprocinstrdialogbase.cpp:126
+msgid "Ctrl+T"
+msgstr "Ctr+T"
+
+#: rc.cpp:154 kxespecprocinstrdialogbase.cpp:127
+msgid ""
+"<b>Do not show this dialog again</b><br/>\n"
+"If you select this option, your choice will be remembered. Next time you "
+"create a new file, you won't be disturbed by this dialog box."
+msgstr ""
+"<b>Nie pokazuj więcej tego okna</b><br/> Jeśli wybierzesz tą opcję, twój "
+"wybór zostanie zapamiętany. Następnym razem gdy będziesz tworzył nowy plik, "
+"nie będziesz widział tego okna dialogowego."
+
+#: rc.cpp:157 kxetexteditordialogbase.cpp:91
+msgid "Edit XML as raw text"
+msgstr "Edytuj XML jako tekst"
+
+#: rc.cpp:158 kxetexteditordialogbase.cpp:92
+msgid "You can edit your XML document as raw text in this editor."
+msgstr "Możesz edytować XML w postaci tekstowej w tym edytorze."
+
+#: rc.cpp:163 kxetexteditordialogbase.cpp:97
+msgid "&Validate"
+msgstr "&Sprawdź"
+
+#: rc.cpp:164 kxetexteditordialogbase.cpp:98
+msgid "Alt+V"
+msgstr "Alt+S"
+
+#: rc.cpp:165 kxetexteditordialogbase.cpp:99
+msgid ""
+"<b>Validate</b><br/>\n"
+"Press this button, if you want your XML document in the above editor to be "
+"validated."
+msgstr ""
+"<b>Sprawdź</b><br/>\n"
+"Naciśnij ten klawisz jeśli chcesz sprawdzić poprawność fragmeny XML w tym "
+"edytorze."
+
+#: rc.cpp:166 kxetextviewsettingspage.cpp:146
+msgid "Text view settings"
+msgstr "Ustawienia widoku tekstowego"
+
+#: rc.cpp:167 kxetextviewsettingspage.cpp:147
+msgid "Syntax highlighting"
+msgstr "Podświetlanie składni"
+
+#: rc.cpp:168 kxetextviewsettingspage.cpp:148
+msgid ""
+"<b>Syntax highlightning</b>\n"
+"<br>\n"
+"You can define the colors to be used, when showing your XML documents as raw "
+"text."
+msgstr ""
+"<b>Podświetlanie składni</b>\n"
+"<br>\n"
+"Możesz zdefiniować kolory, jakie zostaną użyte w czasie tekstowej edycji "
+"XML'a."
+
+#: rc.cpp:169 kxetextviewsettingspage.cpp:151
+msgid "Default &Text:"
+msgstr "Tekst &domyślny:"
+
+#: rc.cpp:171 kxetextviewsettingspage.cpp:153
+msgid "&Element names:"
+msgstr "Nazwy &elementów:"
+
+#: rc.cpp:173 kxetextviewsettingspage.cpp:155
+msgid "Syntax E&rrors:"
+msgstr "&Błędy składniowe:"
+
+#: rc.cpp:174 kxetextviewsettingspage.cpp:156
+msgid "Attribute &values:"
+msgstr "&Wartości atrybutów"
+
+#: rc.cpp:176 kxetextviewsettingspage.cpp:158
+msgid "Co&mments:"
+msgstr "&Komentarze:"
+
+#: rc.cpp:177 kxetextviewsettingspage.cpp:159
+msgid "Attribute &names:"
+msgstr "Nazwy &atrybutów:"
+
+#: rc.cpp:180 kxetextviewsettingspage.cpp:162
+msgid "&Syntax characters:"
+msgstr "&Znaki składniowe:"
+
+#: rc.cpp:184 rc.cpp:185 kxetextviewsettingspage.cpp:166
+#: kxetextviewsettingspage.cpp:169
+msgid ""
+"<b>Element indentation</b>\n"
+"<br>\n"
+"You can choose the number of characters you want to be used for indenting "
+"childnodes, when showing your XML documents as raw text."
+msgstr ""
+"<b>Wcięcia elementów</b>\n"
+"<br>\n"
+"Podaj ilośc znaków, jaka ma być użyta do tworzenia wcięć w widoku XML."
+
+#: rc.cpp:186 kxetreeviewsettingspage.cpp:107
+msgid "Tree View Settings Page"
+msgstr "Ustawienia widoku drzewa"
+
+#: rc.cpp:187 kxetreeviewsettingspage.cpp:108
+msgid "Set &root element decorated"
+msgstr "Element główny deko&rowany"
+
+#: rc.cpp:189 kxetreeviewsettingspage.cpp:110
+msgid ""
+"<b>Set root element decorated</b>\n"
+"<br>\n"
+"You can determine wether the tree view item corresponding to the XML "
+"document's root element should have a decoration or not.\n"
+"<br>\n"
+"A decoration is a + or - icon, with which the item can be opened or closed "
+"to show or hide its childitems."
+msgstr ""
+"<b>Ustaw dekorację dla elementu głównego</b>\n"
+"<br>\n"
+"Możesz ustawić dekorację dla głównego elementu pliku XML w widoku drzewa.\n"
+"<br>\n"
+"Dekoracją jest znak + lub - przy pomocy którego może on zostać otwarty lub "
+"zamknięty w celu pokazania lub ukrycia elementów potomnych."
+
+#: rc.cpp:190 kxetreeviewsettingspage.cpp:115
+msgid "Default &expand level:"
+msgstr "Domyślny poziom rozwi&jania:"
+
+#: rc.cpp:191 rc.cpp:192 kxetreeviewsettingspage.cpp:116
+#: kxetreeviewsettingspage.cpp:119
+msgid ""
+"<b>Default expand level</b>\n"
+"<br>\n"
+"You can determine up to which level the tree view items should be opened "
+"(showing their childitems) when opening a document."
+msgstr ""
+"<b>Domyślny poziom rozwijania</b>\n"
+"<br>\n"
+"Możesz ustawić do jakiego poziomu elementy widoku drzewa powinny zostać "
+"roziwnięte podczas otwierania dokumentu."
+
+#: rc.cpp:193 kxetreeviewsettingspage.cpp:122
+msgid "Drag and drop"
+msgstr "Przeciągnij i upuść (Drag and Drop)"
+
+#: rc.cpp:194 kxetreeviewsettingspage.cpp:123
+msgid "Enable dra&gging"
+msgstr "Włącz &przeciąganie."
+
+#: rc.cpp:195 kxetreeviewsettingspage.cpp:124
+msgid "Alt+G"
+msgstr "Alt+G"
+
+#: rc.cpp:196 kxetreeviewsettingspage.cpp:125
+msgid ""
+"<b>Enable dragging</b>\n"
+"<br>\n"
+"You can determine wether dragging items (and their corresponding XML nodes) "
+"from the tree view is enabled or disabled."
+msgstr ""
+"<b>Włącz przeciąganie</b>\n"
+"<br>\n"
+"Możesz zadecydować czy przeciąganie elementów w widoku drzewa jest włączone "
+"lub wyłączone."
+
+#: rc.cpp:197 kxetreeviewsettingspage.cpp:128
+msgid "Enable dro&pping"
+msgstr "Włącz u&puszczanie"
+
+#: rc.cpp:199 kxetreeviewsettingspage.cpp:130
+msgid ""
+"<b>Enable dropping</b>\n"
+"<br>\n"
+"You can determine wether dropping XML nodes to the tree view is enabled or "
+"disabled."
+msgstr ""
+"<b>Włącz upuszczanie</b>\n"
+"<br>\n"
+"Możesz ustawić czy upuszczanie elementów w widoku drzewa jest włączone czy "
+"wyłączone."
+
+#: rc.cpp:200 kxetreeviewsettingspage.cpp:133
+msgid "&Show ..."
+msgstr "&Pokaż..."
+
+#: rc.cpp:201 kxetreeviewsettingspage.cpp:134
+msgid ""
+"You can determine which information about XML element's attributes you want "
+"to see in the tree view. Choose between:<br>\n"
+"<br>\n"
+"<b><i>no attributes</i></b><br>\n"
+"no information about attributes at all<br>\n"
+"<br>\n"
+"<b><i>attribute names only</i></b><br>\n"
+"the attributes' names are shown<br>\n"
+"<br>\n"
+"<b><i>attribute names & values</i></b><br>\n"
+"the attributes' names and the corresponding values are shown"
+msgstr ""
+"Możesz wybrać jakie informacje o atrybutach elementów XML będą pokazane w "
+"widoku drzewa. Wybierz spośród:<br>\n"
+"<br>\n"
+"<b><i>brak atrybutów</i></b><br>\n"
+"brak jakichkolwiek atrybutów w widoku<br>\n"
+"<br>\n"
+"<b><i>nazwy atrybutów</i></b><br>\n"
+"pokazane są wyłącznie nazwy atrybutów<br>\n"
+"<br>\n"
+"<b><i>nazwy atrybutów i ich wartości</i></b><br>\n"
+"pokazane są zarówno nazwy jak i wartości atrybutów"
+
+#: rc.cpp:202 kxetreeviewsettingspage.cpp:144
+msgid "No attributes"
+msgstr "Brak atrybutów"
+
+#: rc.cpp:203 kxetreeviewsettingspage.cpp:145
+msgid "Attribute names only"
+msgstr "Wyłącznie nazwy atrybutów"
+
+#: rc.cpp:204 kxetreeviewsettingspage.cpp:146
+msgid "Attribute names && values"
+msgstr "Nazwy atrybutów && i ich wartości"
+
+#: kxedocument.cpp:64
+msgid "&Version && Encoding..."
+msgstr "&Wersja i kodowanie"
+
+#: kxedocument.cpp:65
+msgid "Attach Schema..."
+msgstr "Dołącz schemat..."
+
+#: kxedocument.cpp:66
+msgid "Detach Schema"
+msgstr "Odłącz schemat"
+
+#: kxedocument.cpp:67
+msgid "Attach Stylesheet..."
+msgstr "Dołącz arkusz stylów..."
+
+#: kxedocument.cpp:68
+msgid "Detach Stylesheet"
+msgstr "Odłącz arkusz stylów"
+
+#: kxedocument.cpp:88
+msgid ""
+"Your file doesn't have root element defined. \n"
+"\t\tContinue saving?"
+msgstr ""
+"Twój plik nie posiada zdefiniowanego elementu głównego.\n"
+"\t\tKontynuować zapis?"
+
+#: kxedocument.cpp:133
+msgid "Codec for encoding %1 not found ! Continue saving ?"
+msgstr "Nie znaleziono kodeka dla kodowania %1! Kontynuować zapis?"
+
+#: kxedocument.cpp:152
+msgid "Can't create file %1"
+msgstr "Nie moża utworzyć pliku %1."
+
+#: kxedocument.cpp:153 kxedocument.cpp:165
+msgid "Write error !"
+msgstr "Błąd zapisu!"
+
+#: kxedocument.cpp:164
+msgid "Can't create archive %1"
+msgstr "Nie można utworzyć pliku skompresowanego %1"
+
+#: kxedocument.cpp:196
+msgid "Couldn't open temp file !"
+msgstr "NIe można otworzyć pliku tymczasowego!"
+
+#: kxedocument.cpp:211
+msgid "Choose file"
+msgstr "Wybierz plik"
+
+#: kxedocument.cpp:211
+msgid "File:"
+msgstr "Plik:"
+
+#: kxedocument.cpp:291
+msgid "Codec for encoding %1 not found ! Using locale encoding for load."
+msgstr ""
+"Nie znaleziono kodeka dla kodowania %1! Wykorzystanie lokalnego kodowania do "
+"wczytania pliku."
+
+#: kxedocument.cpp:500
+msgid "Stylesheet URL:"
+msgstr "URL arkusza stylów:"
+
+#: kxedocument.cpp:527
+msgid "Schema URL:"
+msgstr "URL schematu:"
+
+#: actions.moc.cpp:34 actions.moc.cpp:42
+msgid "KXmlEditorComboAction"
+msgstr "KXmlEditorComboAction"
+
+#: actions.moc.cpp:122 actions.moc.cpp:130
+msgid "ToolbarLabel"
+msgstr "ToolbarLabel"
+
+#: kxe_viewattributes.moc.cpp:34 kxe_viewattributes.moc.cpp:42
+msgid "KXE_ViewAttributes"
+msgstr "KXE_ViewAttributes"
+
+#: kxeprocinstrdialog.moc.cpp:34 kxeprocinstrdialog.moc.cpp:42
+msgid "KXEProcInstrDialog"
+msgstr "KXEProcInstrDialog"
+
+#: kxeconfiguration.moc.cpp:34 kxeconfiguration.moc.cpp:42
+msgid "KXEConfiguration"
+msgstr "KXEConfiguration"
+
+#: kxearchiveextssettings.moc.cpp:34 kxearchiveextssettings.moc.cpp:42
+msgid "KXEArchiveExtsSettings"
+msgstr "KXEArchiveExtsSettings"
+
+#: kxetexteditordialog.moc.cpp:34 kxetexteditordialog.moc.cpp:42
+msgid "KXETextEditorDialog"
+msgstr "KXETextEditorDialog"
+
+#: kxe_treeview.moc.cpp:34 kxe_treeview.moc.cpp:42
+msgid "KXE_TreeView"
+msgstr "KXE_TreeView"
+
+#: kxesettings.moc.cpp:34 kxesettings.moc.cpp:42
+msgid "KXESettings"
+msgstr "KXESettings"
+
+#: kxechoosestringdialog.moc.cpp:34 kxechoosestringdialog.moc.cpp:42
+msgid "KXEChooseStringDialog"
+msgstr "KXEChooseStringDialog"
+
+#: kxesearchdialog.moc.cpp:34 kxesearchdialog.moc.cpp:42
+msgid "KXESearchDialog"
+msgstr "KXESearchDialog"
+
+#: kxeelementdialog.moc.cpp:34 kxeelementdialog.moc.cpp:42
+msgid "KXEElementDialog"
+msgstr "KXEElementDialog"
+
+#: kxmleditorpart.moc.cpp:34 kxmleditorpart.moc.cpp:42
+msgid "KXMLEditorPart"
+msgstr "KXMLEditorPart"
+
+#: kxmleditorpart.moc.cpp:347 kxmleditorpart.moc.cpp:355
+msgid "KXMLEditorBrowserExtension"
+msgstr "KXMLEditorBrowserExtension"
+
+#: kxespecprocinstrdialog.moc.cpp:34 kxespecprocinstrdialog.moc.cpp:42
+msgid "KXESpecProcInstrDialog"
+msgstr "KXESpecProcInstrDialog"
+
+#: kxechardatadialog.moc.cpp:34 kxechardatadialog.moc.cpp:42
+msgid "KXECharDataDialog"
+msgstr "KXECharDataDialog"
+
+#: kxe_viewelement.moc.cpp:34 kxe_viewelement.moc.cpp:42
+msgid "KXE_ViewElement"
+msgstr "KXE_ViewElement"
+
+#: kxeattributedialog.moc.cpp:34 kxeattributedialog.moc.cpp:42
+msgid "KXEAttributeDialog"
+msgstr "KXEAttributeDialog"
+
+#: kxmleditorfactory.moc.cpp:34 kxmleditorfactory.moc.cpp:42
+msgid "KXMLEditorFactory"
+msgstr "KXMLEditorFactory"
+
+#: kxedocument.moc.cpp:34 kxedocument.moc.cpp:42
+msgid "KXEDocument"
+msgstr "KXEDocument"
+
+#~ msgid "Setting XML version and encoding of document..."
+#~ msgstr "Ustawianie wersji i kodowania dokumentu..."
+
+#~ msgid ""
+#~ "You can determine wether the tree view item corresponding to the XML "
+#~ "document's root element should have a decoration or not"
+#~ msgstr ""
+#~ "Możesz ustawić dekorację dla głównego elementu pliku XML w widoku drzewa"
+
+#~ msgid ""
+#~ "You can determine up to which level the tree view items should be opened "
+#~ "(showing their childitems) when opening a document"
+#~ msgstr ""
+#~ "Możesz ustawić do jakiego poziomu elementy widoku drzewa powinny zostać "
+#~ "roziwnięte podczas otwierania dokumentu"
+
+#~ msgid ""
+#~ "You can determine wether dragging items (and their corresponding XML "
+#~ "nodes) from the tree view is enabled or disabled."
+#~ msgstr ""
+#~ "Możesz zadecydować czy przeciąganie elementów w widoku drzewa jest "
+#~ "włączone lub wyłączone."
+
+#~ msgid ""
+#~ "You can determine wether dropping XML nodes to the tree view is enabled "
+#~ "or disabled."
+#~ msgstr ""
+#~ "Możesz ustawić czy upuszczanie elementów w widoku drzewa jest włączone "
+#~ "czy wyłączone."
+
+#~ msgid "Don't show attributes in Tree view"
+#~ msgstr "Brak jakichkolwiek atrybutów w widoku drzewa"
+
+#~ msgid "<b>No attributes</b><br>Don't show attributes in Tree view"
+#~ msgstr ""
+#~ "<b>Brak atrybutów</b><br>\n"
+#~ "Brak jakichkolwiek atrybutów w widoku drzewa"
+
+#~ msgid "Show attributes names in Tree view"
+#~ msgstr "Pokaż nazwy atrybutów w widoku drzewa"
+
+#~ msgid "<b>Attribute names only</b><br>Show attributes names in Tree view"
+#~ msgstr ""
+#~ "<b>Wyłącznie nazwy atrybutów</b><br>\n"
+#~ "Pokaż nazwy atrybutów w widoku drzewa."
+
+#~ msgid "Show attributes names and values in Tree view"
+#~ msgstr "Pokaż nazwy atrybutów i ich wartości w widoku drzewa."
+
+#~ msgid ""
+#~ "<b>Attribute names & values</b><br>Show attributes names and values in "
+#~ "Tree view"
+#~ msgstr ""
+#~ "<b>Nazwy atrybutów i ich wartości</b><br>Pokaż nazwy atrybutów i ich "
+#~ "wartości w widoku drzewa"
+
+#~ msgid "You can enter version of XML here."
+#~ msgstr "Możesz tu podać wersję XML'a."
+
+#~ msgid "Encoding used while saving a document"
+#~ msgstr "Kodowanie wykorzystane do właściwego zapisu dokumentu"
+
+#~ msgid ""
+#~ "If you select this option, your choice will be remembered. Next time you "
+#~ "create a new file, you won't be disturbed by this dialog box."
+#~ msgstr ""
+#~ "Jeśli wybierzesz tą opcję, twój wybór zostanie zapamiętany. Następnym "
+#~ "razem gdy będziesz tworzył nowy plik, nie będziesz widział tego okna "
+#~ "dialogowego."
+
+#, fuzzy
+#~ msgid "Choose where to place new XML character data"
+#~ msgstr "Wybierz miejsce gdzie chcesz wstawić dane tekstowe XML"
+
+#~ msgid "<b>XML character data</b><br/>Edit XML character data in this editor"
+#~ msgstr "<b>Dane tekstowe XML</b><br/>Edytuj dane tesktowe w tym edytorze"
+
+#~ msgid "Enter the namespace URI for this attribute here."
+#~ msgstr "Podaj URI namespace'u dla tego atrybutu."
+
+#~ msgid "Enter the attribute's value here."
+#~ msgstr "Podaj wartość atrybutu"
+
+#, fuzzy
+#~ msgid "Enter a qualified name for the attribute here."
+#~ msgstr "Podaj prawidłową nazwę dla atrybutu."
+
+#~ msgid ""
+#~ "Since there's only one XML version yet, you shouldn't change this value."
+#~ msgstr ""
+#~ "Ponieważ w chwili obecnej używana jest jedynie jedna wersja XML'a, nie "
+#~ "powinieneś raczej zmieniać tej wartości."
+
+#~ msgid ""
+#~ "You can determine the default encoding for XML documents being created. "
+#~ "This version is the default setting in wizard dialogs."
+#~ msgstr ""
+#~ "Możesz określić domyślne kodowanie dla nowo tworzonych plików XML. "
+#~ "Kodowanie to będzie domyślnym ustawieniem w oknie dialogowym nowych "
+#~ "plików."
+
+#~ msgid "When created new file, create empty document"
+#~ msgstr "Tworząc nowy dokument, utwórz pusty dokument"
+
+#~ msgid ""
+#~ "<b>Start with new empty file</b>\n"
+#~ "<br>\n"
+#~ "When created new file, create empty document"
+#~ msgstr ""
+#~ "<b>Rozpocznij z nowym pustym plikiem</b>\n"
+#~ "<br/>\n"
+#~ "Tworząc nowy dokument, utwórz pusty dokument"
+
+#~ msgid "When created new file, allow to choose XML version and encoding"
+#~ msgstr ""
+#~ "Tworząc nowty dokument, pozwól wybrać wersję XML'a i standard kodowania "
+#~ "znaków"
+
+#~ msgid ""
+#~ "<b>Start with file settings dialog assistance</b>\n"
+#~ "<br>\n"
+#~ "When created new file, allow to choose XML version and encoding"
+#~ msgstr ""
+#~ "<b>Rozpocznij z asystującym oknem dialogowym</b>\n"
+#~ "<br/> Tworząc nowty dokument, pozwól wybrać wersję XML'a i standard "
+#~ "kodowania znaków"
+
+#~ msgid "When created new file, use default setting"
+#~ msgstr "Tworząc nowy dokument użyj domyślnych ustawień"
+
+#~ msgid ""
+#~ "<b>Start with new file with default settings</b>\n"
+#~ "<br>\n"
+#~ "When created new file, use default setting"
+#~ msgstr ""
+#~ "<b>Rozpocznij z nowym plikiem i domyślnymi ustawieniami</b>\n"
+#~ "<br/>\n"
+#~ "Tworząc nowy dokument użyj domyślnych ustawień"
+
+#~ msgid "This list contains the known extensions for archive files."
+#~ msgstr "Lista ta zawiera znane roszerzenia dla plików skompresowanych."
+
+#~ msgid "Change the selected extension here."
+#~ msgstr "Zmień zaznaczone tu rozszerzenie."
+
+#~ msgid ""
+#~ "You can create a new item for another known extension in the list above."
+#~ msgstr ""
+#~ "Możesz dodać nowy wpis dla kolejnego znanego rozszerzenia do powyższej "
+#~ "listy."
+
+#~ msgid "You can delete the selected extension from the list above."
+#~ msgstr "Możesz usunąć zaznaczony wpis z powyższej listy."
+
+#~ msgid "Enter or choose string, that you want"
+#~ msgstr "Wpisz lub wybierz pożadany tekst"
+
+#, fuzzy
+#~ msgid "Enter XML element namespace URI"
+#~ msgstr "Podaj namespace URI dla elementu"
+
+#~ msgid "<b>Namespace URI:</b><br/>Enter XML element namespace URI"
+#~ msgstr "<b>Namesapce URI:</b><br/>Podaj namespace URI dla elementu"
+
+#~ msgid "Enter XML element name"
+#~ msgstr "Podaj nazwe elementu XML"
+
+#, fuzzy
+#~ msgid "Enter namespace prefix for element"
+#~ msgstr "Podaj prefiks dla namespace'u elementu"
+
+#~ msgid "Choose, where to insert this XML element in parent list"
+#~ msgstr "Wybierz gdzie umieścić wybrany element XML w liście"
+
+#~ msgid ""
+#~ "Choose the font family you want to be used on printing your XML documents"
+#~ msgstr ""
+#~ "Wybierz rodzaj czcionki, jaka będzie użyta do wydruku dokumentów XML."
+
+#~ msgid ""
+#~ "Choose the font size you want to be used on printing your XML documents"
+#~ msgstr ""
+#~ "Wybierz rozmiar czcionki, jaka będzie użyta do wydruku dokumentów XML"
+
+#~ msgid ""
+#~ "Choose the number of characters you want to be used for indenting "
+#~ "childnodes on printing you XML documents"
+#~ msgstr ""
+#~ "Podaj ilośc znaków, jaka ma być użyta do tworzenia wcięć w wydrukach "
+#~ "dokumentów XML."
+
+#~ msgid ""
+#~ "You can determine wether you want a header to be printed on every page "
+#~ "when printing you XML documents or not"
+#~ msgstr ""
+#~ "Możesz ustawić czy na każdej drukowanej stronie dokumentu XML "
+#~ "powininenpojawić się nagłówek, czy też nie."
+
+#~ msgid ""
+#~ "You can determine wether you want a footline to be printed on every page "
+#~ "when printing you XML documents or not"
+#~ msgstr ""
+#~ "Możesz ustawić czy na każdej drukowanej stronie dokumentu XML "
+#~ "powinnapojawić się stopka, czy też nie."
+
+#, fuzzy
+#~ msgid "Enter XML processing instruction target"
+#~ msgstr "Podaj cel instrukcji procesowej"
+
+#~ msgid "Choose, where to place processing instruction in parent element list"
+#~ msgstr ""
+#~ "Wybierz gdzie umieścić instrukcję procesową w liście elementu nadrzędnego"
+
+#~ msgid "Enter XML processing instruction data"
+#~ msgstr "Podaj dane instrukcji procesowej XML'a"
+
+#~ msgid ""
+#~ "<b>XML processing instruction data</b><br/>Enter XML processing "
+#~ "instruction data"
+#~ msgstr ""
+#~ "<b>Dane instrukcji procesowej</b><br/>Podaj dane instrukcji procesowej "
+#~ "XML'a"
+
+#~ msgid "Enter string, that you want to search in XML document"
+#~ msgstr "Wprowadź szukany tekst"
+
+#~ msgid "Check this, if you want to search in XML element names"
+#~ msgstr "Zaznacz tę opcję jeśli chciałbyś przeszukać nazwy elementów"
+
+#~ msgid ""
+#~ "<b>Element names</b><br/>Check this, if you want to search in XML element "
+#~ "names"
+#~ msgstr ""
+#~ "<b>Nazwy elementów</b><br/>Zaznacz tę opcję jeśli chciałbyś przeszukać "
+#~ "nazwy elementów"
+
+#~ msgid "Check this, if you want to search in XML attribute names"
+#~ msgstr "Zaznacz tę opcję jeśli chciałbyś przeszukać nazwy atrybutów"
+
+#~ msgid ""
+#~ "<b>Attribute names</b><br/>Check this, if you want to search in XML "
+#~ "attribute names"
+#~ msgstr ""
+#~ "<b>Nazwy atrybutów</b><br/>Zaznacz tę opcję jeśli chciałbyś przeszukać "
+#~ "nazwy atrybutów"
+
+#~ msgid "Check this, if you want to search in XML attribute values"
+#~ msgstr "Zaznacz tę opcję jeśli chciałbyś przeszukać wartości atrybutów"
+
+#~ msgid ""
+#~ "<b>Attribute values</b><br/>Check this, if you want to search in XML "
+#~ "attribute values"
+#~ msgstr ""
+#~ "<b>Wartości atrybutów</b><br/>Zaznacz tę opcję jeśli chciałbyś przeszukać "
+#~ "nazwy atrybutów"
+
+#~ msgid ""
+#~ "Check this, if you want to search in XML char. data contents, CDATA or "
+#~ "comments"
+#~ msgstr ""
+#~ "Zaznacz tę opcję jeśli chciałbyś przeszukać elementy tekstowe, komentarze "
+#~ "czy sekcje CDATA"
+
+#~ msgid ""
+#~ "<b>Contents</b><br/>Check this, if you want to search in XML char. data "
+#~ "contents, CDATA or comments"
+#~ msgstr ""
+#~ "<b>Zawartość</b><br/>Zaznacz tę opcję jeśli chciałbyś przeszukać elementy "
+#~ "tekstowe, komentarze czy sekcje CDATA"
+
+#~ msgid "Check this for case sensitive search"
+#~ msgstr ""
+#~ "Zaznacz tę opcję jeśli chcesz przeszukiwać z uwzględnieniem wielkości "
+#~ "znaków"
+
+#~ msgid "Edit XML using this editor"
+#~ msgstr "Edytuj XML'a używając tego edytora"
+
+#~ msgid "<b>Raw XML</b><br/>Edit XML using this editor"
+#~ msgstr "<b>Surowy XML</b><br/>Edytuj XML'a używając tego edytora"
+
+#~ msgid "Validate XML in editor"
+#~ msgstr "Sprawdź poprawność XML'a w edytorze"
+
+#~ msgid "<b>Validate</b><br/>Validate XML in editor"
+#~ msgstr "<b>Sprawdź</b><br/>Sprawdź poprawność XML'a w edytorze"
+
+#~ msgid "Choose color for XML syntax characters"
+#~ msgstr "Wybierz kolor do podświetlania znaków"
+
+#~ msgid "<b>Syntax characters</b><br/>Choose color for XML syntax characters"
+#~ msgstr "<b>Znaki składniowe</b><br/>Wybierz kolor do podświetlania znaków"
+
+#~ msgid "Choose color for XML comments"
+#~ msgstr "Wybierz kolor dla komentarzy"
+
+#~ msgid "<b>Comments</b><br/>Choose color for XML comments"
+#~ msgstr "<b>Komentarze</b><br/>Wybierz kolor dla komentarzy"
+
+#~ msgid "Choose color for XML element names"
+#~ msgstr "Wybierz kolor dla nazw elementów"
+
+#~ msgid "<b>Element names</b><br/>Choose color for XML element names"
+#~ msgstr "<b>Nazwy elementów</b><br/>Wybierz kolor dla nazw elementów"
+
+#~ msgid "Choose color for default text"
+#~ msgstr "Wybierz domyślny kolor dla tekstu"
+
+#~ msgid "<b></b>Default Text<br/>Choose color for default text"
+#~ msgstr "<b>Tekst domyślny</b><br/>Wybierz domyślny kolor dla tekstu"
+
+#~ msgid "Choose color for attribute names"
+#~ msgstr "Wybierz kolor dla nazw atrybutów"
+
+#~ msgid "<b>Attribute names</b><br/>Choose color for attribute names"
+#~ msgstr "<b>Nazwy atrybutów</b><br/>Wybierz kolor dla nazw atrybutów"
+
+#~ msgid "Choose color for attribute values"
+#~ msgstr "Wybierz kolor dla wartości atrybutów"
+
+#~ msgid "<b>Attribute values</b><br/>Choose color for attribute values"
+#~ msgstr "<b>Wartości atrybutów</b><br/>Wybierz kolor dla wartości atrybutów"
+
+#~ msgid "Choose color for errors"
+#~ msgstr "Wybierz kolor dla zaznaczania błedów"
+
+#~ msgid "<b>Syntax Errors</b><br/>Choose color for errors"
+#~ msgstr "<b>Błędy składniowe</b><br/>Wybierz kolor dla zaznaczania błedów"
+
+#~ msgid ""
+#~ "Choose the number of characters you want to be used for indenting "
+#~ "childnodes on you XML documents"
+#~ msgstr ""
+#~ "Podaj ilośc znaków, jaka ma być użyta do tworzenia wcięć w widoku XML."
+
+#~ msgid ""
+#~ "Please use menu item FILE -> Version and encoding for this processing "
+#~ "instruction !"
+#~ msgstr ""
+#~ "Użyj opcji Plik->Wersja i kodowanie aby wprowadzić zmiany w tej intrukcji!"
+
diff --git a/subdirs b/subdirs
new file mode 100644
index 0000000..da956f5
--- /dev/null
+++ b/subdirs
@@ -0,0 +1,4 @@
+doc
+kxmleditor
+part
+po