From dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:21 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- interfaces/CMakeLists.txt | 8 +- interfaces/Makefile.am | 4 +- interfaces/khexedit/Makefile.am | 2 +- interfaces/khexedit/byteseditinterface.h | 2 +- interfaces/kimproxy/CMakeLists.txt | 13 - interfaces/kimproxy/Makefile.am | 1 - interfaces/kimproxy/TODO | 10 - interfaces/kimproxy/interface/CMakeLists.txt | 22 - interfaces/kimproxy/interface/Makefile.am | 13 - .../interface/dcopinstantmessenger.desktop | 72 --- .../interface/kcm_instantmessenger.desktop | 138 ----- interfaces/kimproxy/interface/kimiface.h | 500 ---------------- interfaces/kimproxy/library/CMakeLists.txt | 51 -- interfaces/kimproxy/library/Makefile.am | 26 - interfaces/kimproxy/library/icons/CMakeLists.txt | 13 - interfaces/kimproxy/library/icons/Makefile.am | 1 - .../library/icons/cr16-action-presence_away.png | Bin 852 -> 0 bytes .../library/icons/cr16-action-presence_offline.png | Bin 549 -> 0 bytes .../library/icons/cr16-action-presence_online.png | Bin 922 -> 0 bytes .../library/icons/cr16-action-presence_unknown.png | Bin 822 -> 0 bytes .../library/icons/cr32-action-presence_away.png | Bin 2402 -> 0 bytes .../library/icons/cr32-action-presence_offline.png | Bin 1407 -> 0 bytes .../library/icons/cr32-action-presence_online.png | Bin 2547 -> 0 bytes .../library/icons/cr32-action-presence_unknown.png | Bin 2483 -> 0 bytes .../library/icons/cr48-action-presence_away.png | Bin 3328 -> 0 bytes .../library/icons/cr48-action-presence_offline.png | Bin 1717 -> 0 bytes .../library/icons/cr48-action-presence_online.png | Bin 3370 -> 0 bytes interfaces/kimproxy/library/kimproxy.cpp | 653 -------------------- interfaces/kimproxy/library/kimproxy.h | 654 --------------------- interfaces/kimproxy/library/kimproxyiface.h | 38 -- interfaces/kmediaplayer/CMakeLists.txt | 60 -- interfaces/kmediaplayer/Makefile.am | 18 - .../kmediaplayer/kfileaudiopreview/CMakeLists.txt | 46 -- .../kmediaplayer/kfileaudiopreview/Makefile.am | 13 - .../kfileaudiopreview/kfileaudiopreview.cpp | 146 ----- .../kfileaudiopreview/kfileaudiopreview.h | 64 -- interfaces/kmediaplayer/kmediaplayer.desktop | 4 - interfaces/kmediaplayer/kmediaplayerengine.desktop | 3 - interfaces/kmediaplayer/player.cpp | 79 --- interfaces/kmediaplayer/player.h | 143 ----- interfaces/kmediaplayer/playerdcopobject.h | 62 -- interfaces/kmediaplayer/view.cpp | 89 --- interfaces/kmediaplayer/view.h | 98 --- interfaces/kscript/CMakeLists.txt | 56 -- interfaces/kscript/Makefile.am | 21 - interfaces/kscript/README | 14 - interfaces/kscript/sample/CMakeLists.txt | 43 -- interfaces/kscript/sample/Makefile.am | 13 - interfaces/kscript/sample/shellscript.cpp | 85 --- interfaces/kscript/sample/shellscript.desktop | 153 ----- interfaces/kscript/sample/shellscript.h | 48 -- interfaces/kscript/scriptclientinterface.h | 124 ---- interfaces/kscript/scriptinterface.desktop | 89 --- interfaces/kscript/scriptinterface.h | 88 --- interfaces/kscript/scriptloader.cpp | 104 ---- interfaces/kscript/scriptloader.h | 59 -- interfaces/kscript/scriptmanager.cpp | 132 ----- interfaces/kscript/scriptmanager.h | 139 ----- interfaces/kspeech/Makefile.am | 2 +- interfaces/kspeech/kspeech.h | 2 +- interfaces/ktexteditor/.kateconfig | 1 - interfaces/ktexteditor/CMakeLists.txt | 96 --- interfaces/ktexteditor/Makefile.am | 52 -- .../ktexteditor/blockselectiondcopinterface.cpp | 33 -- .../ktexteditor/blockselectiondcopinterface.h | 60 -- interfaces/ktexteditor/blockselectioninterface.cpp | 74 --- interfaces/ktexteditor/blockselectioninterface.h | 82 --- interfaces/ktexteditor/clipboarddcopinterface.cpp | 40 -- interfaces/ktexteditor/clipboarddcopinterface.h | 54 -- interfaces/ktexteditor/clipboardinterface.cpp | 56 -- interfaces/ktexteditor/clipboardinterface.h | 74 --- interfaces/ktexteditor/codecompletioninterface.cpp | 51 -- interfaces/ktexteditor/codecompletioninterface.h | 202 ------- interfaces/ktexteditor/configinterface.cpp | 79 --- interfaces/ktexteditor/configinterface.h | 93 --- .../ktexteditor/configinterfaceextension.cpp | 84 --- interfaces/ktexteditor/configinterfaceextension.h | 116 ---- interfaces/ktexteditor/cursorinterface.cpp | 69 --- interfaces/ktexteditor/cursorinterface.h | 84 --- interfaces/ktexteditor/document.h | 85 --- interfaces/ktexteditor/documentdcopinfo.cpp | 33 -- interfaces/ktexteditor/documentdcopinfo.h | 47 -- interfaces/ktexteditor/documentinfo.cpp | 65 -- interfaces/ktexteditor/documentinfo.h | 60 -- interfaces/ktexteditor/dynwordwrapinterface.cpp | 69 --- interfaces/ktexteditor/dynwordwrapinterface.h | 64 -- interfaces/ktexteditor/editdcopinterface.cpp | 61 -- interfaces/ktexteditor/editdcopinterface.h | 90 --- interfaces/ktexteditor/editinterface.cpp | 57 -- interfaces/ktexteditor/editinterface.h | 137 ----- interfaces/ktexteditor/editinterfaceext.cpp | 50 -- interfaces/ktexteditor/editinterfaceext.h | 74 --- interfaces/ktexteditor/editor.h | 65 -- interfaces/ktexteditor/editorchooser.cpp | 162 ----- interfaces/ktexteditor/editorchooser.h | 58 -- interfaces/ktexteditor/editorchooser_ui.ui | 64 -- interfaces/ktexteditor/encodingdcopinterface.cpp | 28 - interfaces/ktexteditor/encodingdcopinterface.h | 46 -- interfaces/ktexteditor/encodinginterface.cpp | 76 --- interfaces/ktexteditor/encodinginterface.h | 63 -- interfaces/ktexteditor/highlightinginterface.cpp | 69 --- interfaces/ktexteditor/highlightinginterface.h | 92 --- interfaces/ktexteditor/kcm_ktexteditor.desktop | 172 ------ interfaces/ktexteditor/ktexteditor.cpp | 242 -------- interfaces/ktexteditor/ktexteditor.desktop | 86 --- interfaces/ktexteditor/ktexteditoreditor.desktop | 86 --- interfaces/ktexteditor/ktexteditorplugin.desktop | 87 --- interfaces/ktexteditor/markinterface.cpp | 74 --- interfaces/ktexteditor/markinterface.h | 171 ------ interfaces/ktexteditor/markinterfaceextension.cpp | 69 --- interfaces/ktexteditor/markinterfaceextension.h | 83 --- interfaces/ktexteditor/plugin.h | 88 --- interfaces/ktexteditor/popupmenuinterface.cpp | 69 --- interfaces/ktexteditor/popupmenuinterface.h | 66 --- interfaces/ktexteditor/printdcopinterface.cpp | 30 - interfaces/ktexteditor/printdcopinterface.h | 46 -- interfaces/ktexteditor/printinterface.cpp | 74 --- interfaces/ktexteditor/printinterface.h | 63 -- interfaces/ktexteditor/searchdcopinterface.cpp | 95 --- interfaces/ktexteditor/searchdcopinterface.h | 59 -- interfaces/ktexteditor/searchinterface.cpp | 55 -- interfaces/ktexteditor/searchinterface.h | 65 -- interfaces/ktexteditor/selectiondcopinterface.cpp | 64 -- interfaces/ktexteditor/selectiondcopinterface.h | 72 --- interfaces/ktexteditor/selectionextdcopinterface.h | 57 -- interfaces/ktexteditor/selectioninterface.cpp | 65 -- interfaces/ktexteditor/selectioninterface.h | 100 ---- interfaces/ktexteditor/selectioninterfaceext.cpp | 115 ---- interfaces/ktexteditor/selectioninterfaceext.h | 74 --- interfaces/ktexteditor/sessionconfiginterface.cpp | 88 --- interfaces/ktexteditor/sessionconfiginterface.h | 71 --- interfaces/ktexteditor/templateinterface.cpp | 197 ------- interfaces/ktexteditor/templateinterface.h | 131 ----- interfaces/ktexteditor/texthintinterface.cpp | 66 --- interfaces/ktexteditor/texthintinterface.h | 79 --- interfaces/ktexteditor/undodcopinterface.cpp | 57 -- interfaces/ktexteditor/undodcopinterface.h | 54 -- interfaces/ktexteditor/undointerface.cpp | 74 --- interfaces/ktexteditor/undointerface.h | 84 --- interfaces/ktexteditor/variableinterface.cpp | 48 -- interfaces/ktexteditor/variableinterface.h | 72 --- interfaces/ktexteditor/view.h | 68 --- interfaces/ktexteditor/viewcursordcopinterface.cpp | 68 --- interfaces/ktexteditor/viewcursordcopinterface.h | 74 --- interfaces/ktexteditor/viewcursorinterface.cpp | 74 --- interfaces/ktexteditor/viewcursorinterface.h | 95 --- .../ktexteditor/viewstatusmsgdcopinterface.cpp | 29 - .../ktexteditor/viewstatusmsgdcopinterface.h | 45 -- interfaces/ktexteditor/viewstatusmsginterface.cpp | 76 --- interfaces/ktexteditor/viewstatusmsginterface.h | 63 -- interfaces/ktexteditor/wordwrapinterface.cpp | 70 --- interfaces/ktexteditor/wordwrapinterface.h | 66 --- interfaces/tdeimproxy/CMakeLists.txt | 13 + interfaces/tdeimproxy/Makefile.am | 1 + interfaces/tdeimproxy/TODO | 10 + interfaces/tdeimproxy/interface/CMakeLists.txt | 22 + interfaces/tdeimproxy/interface/Makefile.am | 13 + .../interface/dcopinstantmessenger.desktop | 72 +++ .../interface/kcm_instantmessenger.desktop | 138 +++++ interfaces/tdeimproxy/interface/kimiface.h | 500 ++++++++++++++++ interfaces/tdeimproxy/library/CMakeLists.txt | 51 ++ interfaces/tdeimproxy/library/Makefile.am | 26 + interfaces/tdeimproxy/library/icons/CMakeLists.txt | 13 + interfaces/tdeimproxy/library/icons/Makefile.am | 1 + .../library/icons/cr16-action-presence_away.png | Bin 0 -> 852 bytes .../library/icons/cr16-action-presence_offline.png | Bin 0 -> 549 bytes .../library/icons/cr16-action-presence_online.png | Bin 0 -> 922 bytes .../library/icons/cr16-action-presence_unknown.png | Bin 0 -> 822 bytes .../library/icons/cr32-action-presence_away.png | Bin 0 -> 2402 bytes .../library/icons/cr32-action-presence_offline.png | Bin 0 -> 1407 bytes .../library/icons/cr32-action-presence_online.png | Bin 0 -> 2547 bytes .../library/icons/cr32-action-presence_unknown.png | Bin 0 -> 2483 bytes .../library/icons/cr48-action-presence_away.png | Bin 0 -> 3328 bytes .../library/icons/cr48-action-presence_offline.png | Bin 0 -> 1717 bytes .../library/icons/cr48-action-presence_online.png | Bin 0 -> 3370 bytes interfaces/tdeimproxy/library/tdeimproxy.cpp | 653 ++++++++++++++++++++ interfaces/tdeimproxy/library/tdeimproxy.h | 654 +++++++++++++++++++++ interfaces/tdeimproxy/library/tdeimproxyiface.h | 38 ++ interfaces/tdemediaplayer/CMakeLists.txt | 60 ++ interfaces/tdemediaplayer/Makefile.am | 18 + .../kfileaudiopreview/CMakeLists.txt | 46 ++ .../tdemediaplayer/kfileaudiopreview/Makefile.am | 13 + .../kfileaudiopreview/kfileaudiopreview.cpp | 146 +++++ .../kfileaudiopreview/kfileaudiopreview.h | 64 ++ interfaces/tdemediaplayer/player.cpp | 79 +++ interfaces/tdemediaplayer/player.h | 143 +++++ interfaces/tdemediaplayer/playerdcopobject.h | 62 ++ interfaces/tdemediaplayer/tdemediaplayer.desktop | 4 + .../tdemediaplayer/tdemediaplayerengine.desktop | 3 + interfaces/tdemediaplayer/view.cpp | 89 +++ interfaces/tdemediaplayer/view.h | 98 +++ interfaces/tdescript/CMakeLists.txt | 56 ++ interfaces/tdescript/Makefile.am | 21 + interfaces/tdescript/README | 14 + interfaces/tdescript/sample/CMakeLists.txt | 43 ++ interfaces/tdescript/sample/Makefile.am | 13 + interfaces/tdescript/sample/shellscript.cpp | 85 +++ interfaces/tdescript/sample/shellscript.desktop | 153 +++++ interfaces/tdescript/sample/shellscript.h | 48 ++ interfaces/tdescript/scriptclientinterface.h | 124 ++++ interfaces/tdescript/scriptinterface.desktop | 89 +++ interfaces/tdescript/scriptinterface.h | 88 +++ interfaces/tdescript/scriptloader.cpp | 104 ++++ interfaces/tdescript/scriptloader.h | 59 ++ interfaces/tdescript/scriptmanager.cpp | 132 +++++ interfaces/tdescript/scriptmanager.h | 139 +++++ interfaces/tdetexteditor/.kateconfig | 1 + interfaces/tdetexteditor/CMakeLists.txt | 96 +++ interfaces/tdetexteditor/Makefile.am | 52 ++ .../tdetexteditor/blockselectiondcopinterface.cpp | 33 ++ .../tdetexteditor/blockselectiondcopinterface.h | 60 ++ .../tdetexteditor/blockselectioninterface.cpp | 74 +++ interfaces/tdetexteditor/blockselectioninterface.h | 82 +++ .../tdetexteditor/clipboarddcopinterface.cpp | 40 ++ interfaces/tdetexteditor/clipboarddcopinterface.h | 54 ++ interfaces/tdetexteditor/clipboardinterface.cpp | 56 ++ interfaces/tdetexteditor/clipboardinterface.h | 74 +++ .../tdetexteditor/codecompletioninterface.cpp | 51 ++ interfaces/tdetexteditor/codecompletioninterface.h | 202 +++++++ interfaces/tdetexteditor/configinterface.cpp | 79 +++ interfaces/tdetexteditor/configinterface.h | 93 +++ .../tdetexteditor/configinterfaceextension.cpp | 84 +++ .../tdetexteditor/configinterfaceextension.h | 116 ++++ interfaces/tdetexteditor/cursorinterface.cpp | 69 +++ interfaces/tdetexteditor/cursorinterface.h | 84 +++ interfaces/tdetexteditor/document.h | 85 +++ interfaces/tdetexteditor/documentdcopinfo.cpp | 33 ++ interfaces/tdetexteditor/documentdcopinfo.h | 47 ++ interfaces/tdetexteditor/documentinfo.cpp | 65 ++ interfaces/tdetexteditor/documentinfo.h | 60 ++ interfaces/tdetexteditor/dynwordwrapinterface.cpp | 69 +++ interfaces/tdetexteditor/dynwordwrapinterface.h | 64 ++ interfaces/tdetexteditor/editdcopinterface.cpp | 61 ++ interfaces/tdetexteditor/editdcopinterface.h | 90 +++ interfaces/tdetexteditor/editinterface.cpp | 57 ++ interfaces/tdetexteditor/editinterface.h | 137 +++++ interfaces/tdetexteditor/editinterfaceext.cpp | 50 ++ interfaces/tdetexteditor/editinterfaceext.h | 74 +++ interfaces/tdetexteditor/editor.h | 65 ++ interfaces/tdetexteditor/editorchooser.cpp | 162 +++++ interfaces/tdetexteditor/editorchooser.h | 58 ++ interfaces/tdetexteditor/editorchooser_ui.ui | 64 ++ interfaces/tdetexteditor/encodingdcopinterface.cpp | 28 + interfaces/tdetexteditor/encodingdcopinterface.h | 46 ++ interfaces/tdetexteditor/encodinginterface.cpp | 76 +++ interfaces/tdetexteditor/encodinginterface.h | 63 ++ interfaces/tdetexteditor/highlightinginterface.cpp | 69 +++ interfaces/tdetexteditor/highlightinginterface.h | 92 +++ interfaces/tdetexteditor/kcm_tdetexteditor.desktop | 172 ++++++ interfaces/tdetexteditor/markinterface.cpp | 74 +++ interfaces/tdetexteditor/markinterface.h | 171 ++++++ .../tdetexteditor/markinterfaceextension.cpp | 69 +++ interfaces/tdetexteditor/markinterfaceextension.h | 83 +++ interfaces/tdetexteditor/plugin.h | 88 +++ interfaces/tdetexteditor/popupmenuinterface.cpp | 69 +++ interfaces/tdetexteditor/popupmenuinterface.h | 66 +++ interfaces/tdetexteditor/printdcopinterface.cpp | 30 + interfaces/tdetexteditor/printdcopinterface.h | 46 ++ interfaces/tdetexteditor/printinterface.cpp | 74 +++ interfaces/tdetexteditor/printinterface.h | 63 ++ interfaces/tdetexteditor/searchdcopinterface.cpp | 95 +++ interfaces/tdetexteditor/searchdcopinterface.h | 59 ++ interfaces/tdetexteditor/searchinterface.cpp | 55 ++ interfaces/tdetexteditor/searchinterface.h | 65 ++ .../tdetexteditor/selectiondcopinterface.cpp | 64 ++ interfaces/tdetexteditor/selectiondcopinterface.h | 72 +++ .../tdetexteditor/selectionextdcopinterface.h | 57 ++ interfaces/tdetexteditor/selectioninterface.cpp | 65 ++ interfaces/tdetexteditor/selectioninterface.h | 100 ++++ interfaces/tdetexteditor/selectioninterfaceext.cpp | 115 ++++ interfaces/tdetexteditor/selectioninterfaceext.h | 74 +++ .../tdetexteditor/sessionconfiginterface.cpp | 88 +++ interfaces/tdetexteditor/sessionconfiginterface.h | 71 +++ interfaces/tdetexteditor/tdetexteditor.cpp | 242 ++++++++ interfaces/tdetexteditor/tdetexteditor.desktop | 86 +++ .../tdetexteditor/tdetexteditoreditor.desktop | 86 +++ .../tdetexteditor/tdetexteditorplugin.desktop | 87 +++ interfaces/tdetexteditor/templateinterface.cpp | 197 +++++++ interfaces/tdetexteditor/templateinterface.h | 131 +++++ interfaces/tdetexteditor/texthintinterface.cpp | 66 +++ interfaces/tdetexteditor/texthintinterface.h | 79 +++ interfaces/tdetexteditor/undodcopinterface.cpp | 57 ++ interfaces/tdetexteditor/undodcopinterface.h | 54 ++ interfaces/tdetexteditor/undointerface.cpp | 74 +++ interfaces/tdetexteditor/undointerface.h | 84 +++ interfaces/tdetexteditor/variableinterface.cpp | 48 ++ interfaces/tdetexteditor/variableinterface.h | 72 +++ interfaces/tdetexteditor/view.h | 68 +++ .../tdetexteditor/viewcursordcopinterface.cpp | 68 +++ interfaces/tdetexteditor/viewcursordcopinterface.h | 74 +++ interfaces/tdetexteditor/viewcursorinterface.cpp | 74 +++ interfaces/tdetexteditor/viewcursorinterface.h | 95 +++ .../tdetexteditor/viewstatusmsgdcopinterface.cpp | 29 + .../tdetexteditor/viewstatusmsgdcopinterface.h | 45 ++ .../tdetexteditor/viewstatusmsginterface.cpp | 76 +++ interfaces/tdetexteditor/viewstatusmsginterface.h | 63 ++ interfaces/tdetexteditor/wordwrapinterface.cpp | 70 +++ interfaces/tdetexteditor/wordwrapinterface.h | 66 +++ interfaces/terminal/Makefile.am | 4 +- interfaces/terminal/test/main.cc | 2 +- 300 files changed, 11302 insertions(+), 11302 deletions(-) delete mode 100644 interfaces/kimproxy/CMakeLists.txt delete mode 100644 interfaces/kimproxy/Makefile.am delete mode 100644 interfaces/kimproxy/TODO delete mode 100644 interfaces/kimproxy/interface/CMakeLists.txt delete mode 100644 interfaces/kimproxy/interface/Makefile.am delete mode 100644 interfaces/kimproxy/interface/dcopinstantmessenger.desktop delete mode 100644 interfaces/kimproxy/interface/kcm_instantmessenger.desktop delete mode 100644 interfaces/kimproxy/interface/kimiface.h delete mode 100644 interfaces/kimproxy/library/CMakeLists.txt delete mode 100644 interfaces/kimproxy/library/Makefile.am delete mode 100644 interfaces/kimproxy/library/icons/CMakeLists.txt delete mode 100644 interfaces/kimproxy/library/icons/Makefile.am delete mode 100644 interfaces/kimproxy/library/icons/cr16-action-presence_away.png delete mode 100644 interfaces/kimproxy/library/icons/cr16-action-presence_offline.png delete mode 100644 interfaces/kimproxy/library/icons/cr16-action-presence_online.png delete mode 100644 interfaces/kimproxy/library/icons/cr16-action-presence_unknown.png delete mode 100644 interfaces/kimproxy/library/icons/cr32-action-presence_away.png delete mode 100644 interfaces/kimproxy/library/icons/cr32-action-presence_offline.png delete mode 100644 interfaces/kimproxy/library/icons/cr32-action-presence_online.png delete mode 100644 interfaces/kimproxy/library/icons/cr32-action-presence_unknown.png delete mode 100644 interfaces/kimproxy/library/icons/cr48-action-presence_away.png delete mode 100644 interfaces/kimproxy/library/icons/cr48-action-presence_offline.png delete mode 100644 interfaces/kimproxy/library/icons/cr48-action-presence_online.png delete mode 100644 interfaces/kimproxy/library/kimproxy.cpp delete mode 100644 interfaces/kimproxy/library/kimproxy.h delete mode 100644 interfaces/kimproxy/library/kimproxyiface.h delete mode 100644 interfaces/kmediaplayer/CMakeLists.txt delete mode 100644 interfaces/kmediaplayer/Makefile.am delete mode 100644 interfaces/kmediaplayer/kfileaudiopreview/CMakeLists.txt delete mode 100644 interfaces/kmediaplayer/kfileaudiopreview/Makefile.am delete mode 100644 interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.cpp delete mode 100644 interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.h delete mode 100644 interfaces/kmediaplayer/kmediaplayer.desktop delete mode 100644 interfaces/kmediaplayer/kmediaplayerengine.desktop delete mode 100644 interfaces/kmediaplayer/player.cpp delete mode 100644 interfaces/kmediaplayer/player.h delete mode 100644 interfaces/kmediaplayer/playerdcopobject.h delete mode 100644 interfaces/kmediaplayer/view.cpp delete mode 100644 interfaces/kmediaplayer/view.h delete mode 100644 interfaces/kscript/CMakeLists.txt delete mode 100644 interfaces/kscript/Makefile.am delete mode 100644 interfaces/kscript/README delete mode 100644 interfaces/kscript/sample/CMakeLists.txt delete mode 100644 interfaces/kscript/sample/Makefile.am delete mode 100644 interfaces/kscript/sample/shellscript.cpp delete mode 100644 interfaces/kscript/sample/shellscript.desktop delete mode 100644 interfaces/kscript/sample/shellscript.h delete mode 100644 interfaces/kscript/scriptclientinterface.h delete mode 100644 interfaces/kscript/scriptinterface.desktop delete mode 100644 interfaces/kscript/scriptinterface.h delete mode 100644 interfaces/kscript/scriptloader.cpp delete mode 100644 interfaces/kscript/scriptloader.h delete mode 100644 interfaces/kscript/scriptmanager.cpp delete mode 100644 interfaces/kscript/scriptmanager.h delete mode 100644 interfaces/ktexteditor/.kateconfig delete mode 100644 interfaces/ktexteditor/CMakeLists.txt delete mode 100644 interfaces/ktexteditor/Makefile.am delete mode 100644 interfaces/ktexteditor/blockselectiondcopinterface.cpp delete mode 100644 interfaces/ktexteditor/blockselectiondcopinterface.h delete mode 100644 interfaces/ktexteditor/blockselectioninterface.cpp delete mode 100644 interfaces/ktexteditor/blockselectioninterface.h delete mode 100644 interfaces/ktexteditor/clipboarddcopinterface.cpp delete mode 100644 interfaces/ktexteditor/clipboarddcopinterface.h delete mode 100644 interfaces/ktexteditor/clipboardinterface.cpp delete mode 100644 interfaces/ktexteditor/clipboardinterface.h delete mode 100644 interfaces/ktexteditor/codecompletioninterface.cpp delete mode 100644 interfaces/ktexteditor/codecompletioninterface.h delete mode 100644 interfaces/ktexteditor/configinterface.cpp delete mode 100644 interfaces/ktexteditor/configinterface.h delete mode 100644 interfaces/ktexteditor/configinterfaceextension.cpp delete mode 100644 interfaces/ktexteditor/configinterfaceextension.h delete mode 100644 interfaces/ktexteditor/cursorinterface.cpp delete mode 100644 interfaces/ktexteditor/cursorinterface.h delete mode 100644 interfaces/ktexteditor/document.h delete mode 100644 interfaces/ktexteditor/documentdcopinfo.cpp delete mode 100644 interfaces/ktexteditor/documentdcopinfo.h delete mode 100644 interfaces/ktexteditor/documentinfo.cpp delete mode 100644 interfaces/ktexteditor/documentinfo.h delete mode 100644 interfaces/ktexteditor/dynwordwrapinterface.cpp delete mode 100644 interfaces/ktexteditor/dynwordwrapinterface.h delete mode 100644 interfaces/ktexteditor/editdcopinterface.cpp delete mode 100644 interfaces/ktexteditor/editdcopinterface.h delete mode 100644 interfaces/ktexteditor/editinterface.cpp delete mode 100644 interfaces/ktexteditor/editinterface.h delete mode 100644 interfaces/ktexteditor/editinterfaceext.cpp delete mode 100644 interfaces/ktexteditor/editinterfaceext.h delete mode 100644 interfaces/ktexteditor/editor.h delete mode 100644 interfaces/ktexteditor/editorchooser.cpp delete mode 100644 interfaces/ktexteditor/editorchooser.h delete mode 100644 interfaces/ktexteditor/editorchooser_ui.ui delete mode 100644 interfaces/ktexteditor/encodingdcopinterface.cpp delete mode 100644 interfaces/ktexteditor/encodingdcopinterface.h delete mode 100644 interfaces/ktexteditor/encodinginterface.cpp delete mode 100644 interfaces/ktexteditor/encodinginterface.h delete mode 100644 interfaces/ktexteditor/highlightinginterface.cpp delete mode 100644 interfaces/ktexteditor/highlightinginterface.h delete mode 100644 interfaces/ktexteditor/kcm_ktexteditor.desktop delete mode 100644 interfaces/ktexteditor/ktexteditor.cpp delete mode 100644 interfaces/ktexteditor/ktexteditor.desktop delete mode 100644 interfaces/ktexteditor/ktexteditoreditor.desktop delete mode 100644 interfaces/ktexteditor/ktexteditorplugin.desktop delete mode 100644 interfaces/ktexteditor/markinterface.cpp delete mode 100644 interfaces/ktexteditor/markinterface.h delete mode 100644 interfaces/ktexteditor/markinterfaceextension.cpp delete mode 100644 interfaces/ktexteditor/markinterfaceextension.h delete mode 100644 interfaces/ktexteditor/plugin.h delete mode 100644 interfaces/ktexteditor/popupmenuinterface.cpp delete mode 100644 interfaces/ktexteditor/popupmenuinterface.h delete mode 100644 interfaces/ktexteditor/printdcopinterface.cpp delete mode 100644 interfaces/ktexteditor/printdcopinterface.h delete mode 100644 interfaces/ktexteditor/printinterface.cpp delete mode 100644 interfaces/ktexteditor/printinterface.h delete mode 100644 interfaces/ktexteditor/searchdcopinterface.cpp delete mode 100644 interfaces/ktexteditor/searchdcopinterface.h delete mode 100644 interfaces/ktexteditor/searchinterface.cpp delete mode 100644 interfaces/ktexteditor/searchinterface.h delete mode 100644 interfaces/ktexteditor/selectiondcopinterface.cpp delete mode 100644 interfaces/ktexteditor/selectiondcopinterface.h delete mode 100644 interfaces/ktexteditor/selectionextdcopinterface.h delete mode 100644 interfaces/ktexteditor/selectioninterface.cpp delete mode 100644 interfaces/ktexteditor/selectioninterface.h delete mode 100644 interfaces/ktexteditor/selectioninterfaceext.cpp delete mode 100644 interfaces/ktexteditor/selectioninterfaceext.h delete mode 100644 interfaces/ktexteditor/sessionconfiginterface.cpp delete mode 100644 interfaces/ktexteditor/sessionconfiginterface.h delete mode 100644 interfaces/ktexteditor/templateinterface.cpp delete mode 100644 interfaces/ktexteditor/templateinterface.h delete mode 100644 interfaces/ktexteditor/texthintinterface.cpp delete mode 100644 interfaces/ktexteditor/texthintinterface.h delete mode 100644 interfaces/ktexteditor/undodcopinterface.cpp delete mode 100644 interfaces/ktexteditor/undodcopinterface.h delete mode 100644 interfaces/ktexteditor/undointerface.cpp delete mode 100644 interfaces/ktexteditor/undointerface.h delete mode 100644 interfaces/ktexteditor/variableinterface.cpp delete mode 100644 interfaces/ktexteditor/variableinterface.h delete mode 100644 interfaces/ktexteditor/view.h delete mode 100644 interfaces/ktexteditor/viewcursordcopinterface.cpp delete mode 100644 interfaces/ktexteditor/viewcursordcopinterface.h delete mode 100644 interfaces/ktexteditor/viewcursorinterface.cpp delete mode 100644 interfaces/ktexteditor/viewcursorinterface.h delete mode 100644 interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp delete mode 100644 interfaces/ktexteditor/viewstatusmsgdcopinterface.h delete mode 100644 interfaces/ktexteditor/viewstatusmsginterface.cpp delete mode 100644 interfaces/ktexteditor/viewstatusmsginterface.h delete mode 100644 interfaces/ktexteditor/wordwrapinterface.cpp delete mode 100644 interfaces/ktexteditor/wordwrapinterface.h create mode 100644 interfaces/tdeimproxy/CMakeLists.txt create mode 100644 interfaces/tdeimproxy/Makefile.am create mode 100644 interfaces/tdeimproxy/TODO create mode 100644 interfaces/tdeimproxy/interface/CMakeLists.txt create mode 100644 interfaces/tdeimproxy/interface/Makefile.am create mode 100644 interfaces/tdeimproxy/interface/dcopinstantmessenger.desktop create mode 100644 interfaces/tdeimproxy/interface/kcm_instantmessenger.desktop create mode 100644 interfaces/tdeimproxy/interface/kimiface.h create mode 100644 interfaces/tdeimproxy/library/CMakeLists.txt create mode 100644 interfaces/tdeimproxy/library/Makefile.am create mode 100644 interfaces/tdeimproxy/library/icons/CMakeLists.txt create mode 100644 interfaces/tdeimproxy/library/icons/Makefile.am create mode 100644 interfaces/tdeimproxy/library/icons/cr16-action-presence_away.png create mode 100644 interfaces/tdeimproxy/library/icons/cr16-action-presence_offline.png create mode 100644 interfaces/tdeimproxy/library/icons/cr16-action-presence_online.png create mode 100644 interfaces/tdeimproxy/library/icons/cr16-action-presence_unknown.png create mode 100644 interfaces/tdeimproxy/library/icons/cr32-action-presence_away.png create mode 100644 interfaces/tdeimproxy/library/icons/cr32-action-presence_offline.png create mode 100644 interfaces/tdeimproxy/library/icons/cr32-action-presence_online.png create mode 100644 interfaces/tdeimproxy/library/icons/cr32-action-presence_unknown.png create mode 100644 interfaces/tdeimproxy/library/icons/cr48-action-presence_away.png create mode 100644 interfaces/tdeimproxy/library/icons/cr48-action-presence_offline.png create mode 100644 interfaces/tdeimproxy/library/icons/cr48-action-presence_online.png create mode 100644 interfaces/tdeimproxy/library/tdeimproxy.cpp create mode 100644 interfaces/tdeimproxy/library/tdeimproxy.h create mode 100644 interfaces/tdeimproxy/library/tdeimproxyiface.h create mode 100644 interfaces/tdemediaplayer/CMakeLists.txt create mode 100644 interfaces/tdemediaplayer/Makefile.am create mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt create mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am create mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp create mode 100644 interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h create mode 100644 interfaces/tdemediaplayer/player.cpp create mode 100644 interfaces/tdemediaplayer/player.h create mode 100644 interfaces/tdemediaplayer/playerdcopobject.h create mode 100644 interfaces/tdemediaplayer/tdemediaplayer.desktop create mode 100644 interfaces/tdemediaplayer/tdemediaplayerengine.desktop create mode 100644 interfaces/tdemediaplayer/view.cpp create mode 100644 interfaces/tdemediaplayer/view.h create mode 100644 interfaces/tdescript/CMakeLists.txt create mode 100644 interfaces/tdescript/Makefile.am create mode 100644 interfaces/tdescript/README create mode 100644 interfaces/tdescript/sample/CMakeLists.txt create mode 100644 interfaces/tdescript/sample/Makefile.am create mode 100644 interfaces/tdescript/sample/shellscript.cpp create mode 100644 interfaces/tdescript/sample/shellscript.desktop create mode 100644 interfaces/tdescript/sample/shellscript.h create mode 100644 interfaces/tdescript/scriptclientinterface.h create mode 100644 interfaces/tdescript/scriptinterface.desktop create mode 100644 interfaces/tdescript/scriptinterface.h create mode 100644 interfaces/tdescript/scriptloader.cpp create mode 100644 interfaces/tdescript/scriptloader.h create mode 100644 interfaces/tdescript/scriptmanager.cpp create mode 100644 interfaces/tdescript/scriptmanager.h create mode 100644 interfaces/tdetexteditor/.kateconfig create mode 100644 interfaces/tdetexteditor/CMakeLists.txt create mode 100644 interfaces/tdetexteditor/Makefile.am create mode 100644 interfaces/tdetexteditor/blockselectiondcopinterface.cpp create mode 100644 interfaces/tdetexteditor/blockselectiondcopinterface.h create mode 100644 interfaces/tdetexteditor/blockselectioninterface.cpp create mode 100644 interfaces/tdetexteditor/blockselectioninterface.h create mode 100644 interfaces/tdetexteditor/clipboarddcopinterface.cpp create mode 100644 interfaces/tdetexteditor/clipboarddcopinterface.h create mode 100644 interfaces/tdetexteditor/clipboardinterface.cpp create mode 100644 interfaces/tdetexteditor/clipboardinterface.h create mode 100644 interfaces/tdetexteditor/codecompletioninterface.cpp create mode 100644 interfaces/tdetexteditor/codecompletioninterface.h create mode 100644 interfaces/tdetexteditor/configinterface.cpp create mode 100644 interfaces/tdetexteditor/configinterface.h create mode 100644 interfaces/tdetexteditor/configinterfaceextension.cpp create mode 100644 interfaces/tdetexteditor/configinterfaceextension.h create mode 100644 interfaces/tdetexteditor/cursorinterface.cpp create mode 100644 interfaces/tdetexteditor/cursorinterface.h create mode 100644 interfaces/tdetexteditor/document.h create mode 100644 interfaces/tdetexteditor/documentdcopinfo.cpp create mode 100644 interfaces/tdetexteditor/documentdcopinfo.h create mode 100644 interfaces/tdetexteditor/documentinfo.cpp create mode 100644 interfaces/tdetexteditor/documentinfo.h create mode 100644 interfaces/tdetexteditor/dynwordwrapinterface.cpp create mode 100644 interfaces/tdetexteditor/dynwordwrapinterface.h create mode 100644 interfaces/tdetexteditor/editdcopinterface.cpp create mode 100644 interfaces/tdetexteditor/editdcopinterface.h create mode 100644 interfaces/tdetexteditor/editinterface.cpp create mode 100644 interfaces/tdetexteditor/editinterface.h create mode 100644 interfaces/tdetexteditor/editinterfaceext.cpp create mode 100644 interfaces/tdetexteditor/editinterfaceext.h create mode 100644 interfaces/tdetexteditor/editor.h create mode 100644 interfaces/tdetexteditor/editorchooser.cpp create mode 100644 interfaces/tdetexteditor/editorchooser.h create mode 100644 interfaces/tdetexteditor/editorchooser_ui.ui create mode 100644 interfaces/tdetexteditor/encodingdcopinterface.cpp create mode 100644 interfaces/tdetexteditor/encodingdcopinterface.h create mode 100644 interfaces/tdetexteditor/encodinginterface.cpp create mode 100644 interfaces/tdetexteditor/encodinginterface.h create mode 100644 interfaces/tdetexteditor/highlightinginterface.cpp create mode 100644 interfaces/tdetexteditor/highlightinginterface.h create mode 100644 interfaces/tdetexteditor/kcm_tdetexteditor.desktop create mode 100644 interfaces/tdetexteditor/markinterface.cpp create mode 100644 interfaces/tdetexteditor/markinterface.h create mode 100644 interfaces/tdetexteditor/markinterfaceextension.cpp create mode 100644 interfaces/tdetexteditor/markinterfaceextension.h create mode 100644 interfaces/tdetexteditor/plugin.h create mode 100644 interfaces/tdetexteditor/popupmenuinterface.cpp create mode 100644 interfaces/tdetexteditor/popupmenuinterface.h create mode 100644 interfaces/tdetexteditor/printdcopinterface.cpp create mode 100644 interfaces/tdetexteditor/printdcopinterface.h create mode 100644 interfaces/tdetexteditor/printinterface.cpp create mode 100644 interfaces/tdetexteditor/printinterface.h create mode 100644 interfaces/tdetexteditor/searchdcopinterface.cpp create mode 100644 interfaces/tdetexteditor/searchdcopinterface.h create mode 100644 interfaces/tdetexteditor/searchinterface.cpp create mode 100644 interfaces/tdetexteditor/searchinterface.h create mode 100644 interfaces/tdetexteditor/selectiondcopinterface.cpp create mode 100644 interfaces/tdetexteditor/selectiondcopinterface.h create mode 100644 interfaces/tdetexteditor/selectionextdcopinterface.h create mode 100644 interfaces/tdetexteditor/selectioninterface.cpp create mode 100644 interfaces/tdetexteditor/selectioninterface.h create mode 100644 interfaces/tdetexteditor/selectioninterfaceext.cpp create mode 100644 interfaces/tdetexteditor/selectioninterfaceext.h create mode 100644 interfaces/tdetexteditor/sessionconfiginterface.cpp create mode 100644 interfaces/tdetexteditor/sessionconfiginterface.h create mode 100644 interfaces/tdetexteditor/tdetexteditor.cpp create mode 100644 interfaces/tdetexteditor/tdetexteditor.desktop create mode 100644 interfaces/tdetexteditor/tdetexteditoreditor.desktop create mode 100644 interfaces/tdetexteditor/tdetexteditorplugin.desktop create mode 100644 interfaces/tdetexteditor/templateinterface.cpp create mode 100644 interfaces/tdetexteditor/templateinterface.h create mode 100644 interfaces/tdetexteditor/texthintinterface.cpp create mode 100644 interfaces/tdetexteditor/texthintinterface.h create mode 100644 interfaces/tdetexteditor/undodcopinterface.cpp create mode 100644 interfaces/tdetexteditor/undodcopinterface.h create mode 100644 interfaces/tdetexteditor/undointerface.cpp create mode 100644 interfaces/tdetexteditor/undointerface.h create mode 100644 interfaces/tdetexteditor/variableinterface.cpp create mode 100644 interfaces/tdetexteditor/variableinterface.h create mode 100644 interfaces/tdetexteditor/view.h create mode 100644 interfaces/tdetexteditor/viewcursordcopinterface.cpp create mode 100644 interfaces/tdetexteditor/viewcursordcopinterface.h create mode 100644 interfaces/tdetexteditor/viewcursorinterface.cpp create mode 100644 interfaces/tdetexteditor/viewcursorinterface.h create mode 100644 interfaces/tdetexteditor/viewstatusmsgdcopinterface.cpp create mode 100644 interfaces/tdetexteditor/viewstatusmsgdcopinterface.h create mode 100644 interfaces/tdetexteditor/viewstatusmsginterface.cpp create mode 100644 interfaces/tdetexteditor/viewstatusmsginterface.h create mode 100644 interfaces/tdetexteditor/wordwrapinterface.cpp create mode 100644 interfaces/tdetexteditor/wordwrapinterface.h (limited to 'interfaces') diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index 99d359979..1fb53eca4 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -9,12 +9,12 @@ # ################################################# -add_subdirectory( ktexteditor ) -add_subdirectory( kscript ) +add_subdirectory( tdetexteditor ) +add_subdirectory( tdescript ) add_subdirectory( kregexpeditor ) -add_subdirectory( kmediaplayer ) +add_subdirectory( tdemediaplayer ) add_subdirectory( kio ) add_subdirectory( terminal ) add_subdirectory( khexedit ) -add_subdirectory( kimproxy ) +add_subdirectory( tdeimproxy ) add_subdirectory( kspeech ) diff --git a/interfaces/Makefile.am b/interfaces/Makefile.am index 583a7055d..e5eedaf90 100644 --- a/interfaces/Makefile.am +++ b/interfaces/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = ktexteditor kscript kregexpeditor kmediaplayer kio terminal khexedit kimproxy kspeech +SUBDIRS = tdetexteditor tdescript kregexpeditor tdemediaplayer kio terminal khexedit tdeimproxy kspeech -DOXYGEN_REFERENCES = tdecore tdefx tdeui kparts dcop +DOXYGEN_REFERENCES = tdecore tdefx tdeui tdeparts dcop DOXYGEN_SET_RECURSIVE = YES include ../admin/Doxyfile.am diff --git a/interfaces/khexedit/Makefile.am b/interfaces/khexedit/Makefile.am index e2eb8a472..f5f3f23d0 100644 --- a/interfaces/khexedit/Makefile.am +++ b/interfaces/khexedit/Makefile.am @@ -1,5 +1,5 @@ -INCLUDES= -I$(top_srcdir)/kparts $(all_includes) +INCLUDES= -I$(top_srcdir)/tdeparts $(all_includes) # the service type servicetypedir = $(kde_servicetypesdir) diff --git a/interfaces/khexedit/byteseditinterface.h b/interfaces/khexedit/byteseditinterface.h index ae23721ae..3bc5749d2 100644 --- a/interfaces/khexedit/byteseditinterface.h +++ b/interfaces/khexedit/byteseditinterface.h @@ -19,7 +19,7 @@ #define BYTESEDITINTERFACE_H // kde specific -#include +#include #include diff --git a/interfaces/kimproxy/CMakeLists.txt b/interfaces/kimproxy/CMakeLists.txt deleted file mode 100644 index f52118353..000000000 --- a/interfaces/kimproxy/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( interface ) -add_subdirectory( library ) diff --git a/interfaces/kimproxy/Makefile.am b/interfaces/kimproxy/Makefile.am deleted file mode 100644 index 105f84291..000000000 --- a/interfaces/kimproxy/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = interface library \ No newline at end of file diff --git a/interfaces/kimproxy/TODO b/interfaces/kimproxy/TODO deleted file mode 100644 index fc66130fe..000000000 --- a/interfaces/kimproxy/TODO +++ /dev/null @@ -1,10 +0,0 @@ -For the future, the following modifications need to be done: - -Currently there is a function : - virtual QString presenceString( const QString & uid ) = 0; -This needs to be broken into: - virtual QString presenceString( const QString & uid ) = 0; - virtual QString presenceLongString( const QString & uid ) = 0; - -The former returning, say "Away", the latter returning the long away -message. diff --git a/interfaces/kimproxy/interface/CMakeLists.txt b/interfaces/kimproxy/interface/CMakeLists.txt deleted file mode 100644 index d62819ed8..000000000 --- a/interfaces/kimproxy/interface/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -##### headers ################################### - -install( FILES - kimiface.h - DESTINATION ${INCLUDE_INSTALL_DIR} ) - - -##### other data ################################ - -install( FILES kcm_instantmessenger.desktop DESTINATION ${DATA_INSTALL_DIR}/kcm_componentchooser ) -install( FILES dcopinstantmessenger.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) diff --git a/interfaces/kimproxy/interface/Makefile.am b/interfaces/kimproxy/interface/Makefile.am deleted file mode 100644 index 348130e46..000000000 --- a/interfaces/kimproxy/interface/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDES = $(all_includes) - -kimifaceinclude_HEADERS = kimiface.h -kimifaceincludedir = $(includedir) - -servicetypedir = $(kde_servicetypesdir) -servicetype_DATA = dcopinstantmessenger.desktop - -kcm_instantmessenger_DATA = kcm_instantmessenger.desktop -kcm_instantmessengerdir = $(kde_datadir)/kcm_componentchooser - -include $(top_srcdir)/admin/Doxyfile.am -DOXYGEN_REFERENCES = kabc diff --git a/interfaces/kimproxy/interface/dcopinstantmessenger.desktop b/interfaces/kimproxy/interface/dcopinstantmessenger.desktop deleted file mode 100644 index a69994421..000000000 --- a/interfaces/kimproxy/interface/dcopinstantmessenger.desktop +++ /dev/null @@ -1,72 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=DCOP/InstantMessenger -Comment=Instant Messenger with a DCOP interface -Comment[af]=Oombliklike Boodskapper met DCOP intervlak -Comment[be]=Імгненны абвестнік з інтэрфэйсам DCOP -Comment[bg]=Програма за съобщения в реално време с интерфейс DCOP -Comment[bn]=ডিকপ (DCOP) ইন্টারফেস সহ ইনস্ট্যান্ট মেসেঞ্জার -Comment[bs]=Instant poruke sa DCOP interfejsom -Comment[ca]=Missatgeria instantània amb una interfície DCOP -Comment[cs]=Komunikátor s DCOP rozhraním -Comment[csb]=Internetowi kòmùnikator z interfejsã DCOP -Comment[cy]=Negesydd Chwim efo rhyngwyneb DCOP -Comment[da]=Instant Messenger med en DCOP-grænseflade -Comment[de]=Instant Messenger mit DCOP-Schnittstelle -Comment[el]=Στιγμιαίος αποστολέας με διασύνδεση DCOP -Comment[eo]=Tujmesaĝilo kun DCOP-interfaco -Comment[es]=Instant Messenger con un interfaz DCOP -Comment[et]=Kiirsuhtlemisrakendus DCOP-liidesega -Comment[eu]=Berehalako mezularitza DCOP interfazearekin -Comment[fa]=پیام‌رسان فوری با یک واسط DCOP -Comment[fi]=Pikaviestiohjelma, jossa on DCOP-rajapinta -Comment[fr]=Messagerie instantanée munie d'une interface DCOP -Comment[fy]=Instant Messenger mei in DCOP-interface -Comment[ga]=Clár teachtaireachtaí meandaracha le comhéadan DCOP -Comment[gl]=Mensaxeria Instantánea con interface DCOP -Comment[he]=תכנת מסרים מידיים עם ממשק DCOP -Comment[hi]=डीकॉप इंटरफेस सहित इंस्टैंट मैसेंजर -Comment[hr]=Trenutne poruke s DCOP sučeljem -Comment[hsb]=Instant Messenger z DCOP-interfejsom -Comment[hu]=Azonnali üzenetküldő DCOP-felülettel -Comment[id]=Instant Messenger dengan antarmuka DCOP -Comment[is]=Spjallforrit með DCOP viðmóti -Comment[it]=Messaggistica istantanea con un'interfaccia DCOP -Comment[ja]=DCOP インターフェースをもつインスタントメッセンジャー -Comment[ka]=DCOP ინტერფეისთან შეტყობინებების გაცვლის შიკრიკი -Comment[kk]=DCOP интерфейсті жедел хабарласу бағдарламасы -Comment[km]=​កម្មវិធី​ជជែក​កំសាន្ត​ដែល​មាន​ចំណុច​ប្រទាក់ DCOP -Comment[lb]=Instant Messenger mat engem DCOP-Interface -Comment[lt]=Momentinių žinučių klientas su DCOP sąsaja -Comment[mk]=Инстант Гласник (Messenger) со DCOP интерфејс -Comment[ms]=Utusan Segera dengan antaramuka DCOP -Comment[nb]=Lynmeldingsprogram med DCOP-grensesnitt -Comment[nds]=Kortnarichten-Maker mit DCOP-Koppelsteed -Comment[ne]=DCOP इन्टरफेससँग आवश्यक मेसेन्जर -Comment[nl]=Instant messenger met een DCOP interface -Comment[nn]=Lynmeldingsprogram med DCOP-grensesnitt -Comment[pa]=ਇੱਕ DCOP ਇੰਟਰਫੇਸ ਲਈ ਇੱਕ ਮੌਕਾ ਸੁਨੇਹਾਕਾਰ -Comment[pl]=Komunikator internetowy z interfejsem DCOP -Comment[pt]=Mensageiro Instantâneo com interface DCOP -Comment[pt_BR]=Mensageiro Instantâneo com uma interface DCOP -Comment[ro]=Aplicaţie de mesaje instantanee cu interfaţă DCOP -Comment[ru]=Клиент обмена сообщениями с интерфейсом DCOP -Comment[rw]=Intumwa y'Akokanya ifite imigaragarire DCOP -Comment[se]=Šleađgadiehtoprográmma mas lea DCOP-lákta -Comment[sk]=Instant Messanger s rozhraním DCOP -Comment[sl]=Takojšni sporočilnik z vmesnikom DCOP -Comment[sr]=Брзи гласник са DCOP интерфејсом -Comment[sr@Latn]=Brzi glasnik sa DCOP interfejsom -Comment[sv]=Direktmeddelanden med ett DCOP-gränssnitt -Comment[ta]=உடனடி செய்தியாளர் DCOP இடைமுகத்தோடு -Comment[te]=డిసిఓపి ఇంటర్ఫెస్ కలిగివున్న ఇంస్టెంట్ మెస్సెన్జర్ -Comment[tg]=Мубодилаи паёмҳо бо интерфейси DCOP -Comment[th]=โปรแกรมส่งข้อความแบบทันที ด้วยส่วนติดต่อกับ DCOP -Comment[tr]=DCOP arayüzüyle Anında Mesajlaşma -Comment[tt]=DCOP protokolı belän Aşığıç Xäbärçe -Comment[uk]=Програма для миттєвого зв'язку через DCOP -Comment[vi]=Bộ tin nhắn tức khắc có giao diện DCOP -Comment[wa]=Messaedjreye sol moumint avou ene eterface DCOP -Comment[zh_CN]=带 DCOP 接口的即时通讯程序 -Comment[zh_HK]=附有 DCOP 介面的即時通訊軟件 -Comment[zh_TW]=DCOP 介面的即時通訊系統 diff --git a/interfaces/kimproxy/interface/kcm_instantmessenger.desktop b/interfaces/kimproxy/interface/kcm_instantmessenger.desktop deleted file mode 100644 index 860f82944..000000000 --- a/interfaces/kimproxy/interface/kcm_instantmessenger.desktop +++ /dev/null @@ -1,138 +0,0 @@ -Name=Instant Messenger -Name[af]=Oombliklike Boodskapper -Name[be]=Імгненны абвеснік -Name[bg]=Съобщения в реално време -Name[bn]=ইনস্ট্যান্ট মেসেঞ্জার -Name[br]=Posteler a-benn-kaer -Name[bs]=Instant poruke -Name[ca]=Missatgeria instantània -Name[cs]=Komunikátor -Name[csb]=Internetowi kòmùnikator -Name[cy]=Negesydd Chwim -Name[el]=Στιγμιαίος αποστολέας -Name[eo]=Tujmesaĝilo -Name[et]=Kiirsuhtlus -Name[eu]=Berehalako mezularitza -Name[fa]=پیام‌رسان فوری -Name[fi]=Pikaviestiohjelma -Name[fr]=Messagerie instantanée -Name[ga]=Clár teachtaireachtaí meandaracha -Name[gl]=Mensaxeria Instantánea -Name[he]=מסרים מידיים -Name[hi]=इंस्टैंट मैसेंजर -Name[hu]=Azonnali üzenetküldő -Name[is]=Spjallforrit -Name[it]=Messaggistica istantanea -Name[ja]=インスタントメッセンジャー -Name[ka]=შიკრიკი -Name[kk]=Жедел хабарласу -Name[km]=កម្មវិធី​វិធីជជែក​កំសាន្ត -Name[lt]=Momentinių žinučių klientas -Name[mk]=Инстант Гласник (Messenger) -Name[ms]=Mesej Segera -Name[nb]=Lynmelding -Name[nds]=Kortnarichten-Maker -Name[ne]=आवश्यक मेसेन्जर -Name[nl]=Instant messenger -Name[nn]=Lynmelding -Name[pa]=ਮੌਕਾ ਸੁਨੇਹਾਕਾਰ -Name[pl]=Komunikator internetowy -Name[pt]=Mensageiro Instantâneo -Name[pt_BR]=Mensagem Instantâneo -Name[ro]=Mesaje instantanee -Name[ru]=Обмен сообщениями -Name[se]=Šleađgadieđut -Name[sl]=Takojšni sporočilnik -Name[sr]=Брзи гласник -Name[sr@Latn]=Brzi glasnik -Name[sv]=Direktmeddelanden -Name[ta]=உடனடி செய்தியாளர் -Name[te]=ఇంస్టెంట్ మెస్సెన్జర్ -Name[tg]=Мубодилаи паёмҳо -Name[th]=โปรแกรมส่งข้อความทันที -Name[tr]=Anında Mesajlaşma -Name[tt]=Aşığıç Xäbärçe -Name[uk]=Програма для миттєвого зв'язку через DCOP -Name[uz]=Xabar almashish vositasi -Name[uz@cyrillic]=Хабар алмашиш воситаси -Name[vi]=Bộ tin nhắn tức khắc -Name[wa]=Messaedjreye sol moumint -Name[zh_CN]=即时通讯程序 -Name[zh_HK]=即時通訊軟件 -Name[zh_TW]=即時通訊 -Comment=The instant messenger allows two-way chat between individuals and groups. -Comment[af]=Die oombliklike boodskappe laat twee rigting kommunikasie tussen individue en groepe toe. -Comment[be]=Імгненны абвеснік дазваляе весці размову двум і больш асобам/гуртам. -Comment[bg]=Разговор между различни хора в реално време. -Comment[bn]=ইনস্ট্যান্ট মেসেঞ্জার একাধিক ব্যক্তি বা গোষ্ঠীকে দ্বিমুখী বার্তালাপ বা আড্ডার সুযোগ দেয়। -Comment[bs]=Program za instant poruke omogućuje dvosmjernu komunikaciju između pojedinaca i grupa. -Comment[ca]=La missatgeria instantània permet converses en dos sentits entre individus i grups. -Comment[cs]=Komunikátor vám umožňuje obousměrný rozhovor s jednotlivci nebo skupinami. -Comment[csb]=Internetowi kòmùnikator dôwô mòżnota kôrbionczi midzë lëdzama ë karnama. -Comment[cy]=Mae'r negesydd chwim yn caniatàu sgwrs dwy-ffordd rhwng unigolion a grwpiau. -Comment[da]=Instant messenger tillader tovejs chat mellem individer og grupper. -Comment[de]=Der Instant Messenger ermöglicht Chats zwischen Personen und Gruppen in jede Richtung. -Comment[el]=Ο στιγμιαίος αποστολέας επιτρέπει τη συζήτηση μεταξύ ατόμων και ομάδων. -Comment[eo]=La tujmesaĝilo ebligas ambaŭdirekta parolado inter homoj kaj grupoj -Comment[es]=El Instant Messenger permite conversación en dos sentidos entre indivíduos y grupos. -Comment[et]=Kiirsuhtlus võimaldab üksikisikute ja gruppide kahepoolset vestlust. -Comment[eu]=Berehalako mezularitzak banan-banako edo taldeen arteko berriketan aritzeko. -Comment[fa]=پیام‌رسان فوری امکان گپ دو طرفه بین افراد و گروهها را می‌دهد. -Comment[fi]=Pikaviestiohjelman avulla voidaan keskustella kahden kesken tai ryhmässä. -Comment[fr]=La messagerie instantanée permet un dialogue bidirectionnel entre individus et groupes. -Comment[fy]=Mei de instant messenger kinne jo twaspraak hâlde mei in yndividu en groepen. -Comment[ga]=Is féidir comhrá déthreoch a dhéanamh idir daoine agus grúpaí leis an gclár teachtaireachtaí meandaracha. -Comment[gl]=O instant messenger permite conversas nos dous sentidos entre indivíduos e grupos. -Comment[he]=תוכנת מסרים מידיים מאשרת לשוחח ברשת (לצ'טט) בין יחידים או קבוצות -Comment[hi]=इंस्टैंट मैसेंजर जो व्यक्तियों या समूहों के बीच दो-तरफा गपशप स्वीकारता है. -Comment[hr]=Trenutne poruke omogućuju dvosmjerno brbljanje između pojedinaca i grupa. -Comment[hsb]=Instant messenger zmóžni jednotliwcam a skupinam spěšnu wuměnu zdźělenkow. -Comment[hu]=Interaktív társalgást tesz lehetővé az interneten keresztül két személy vagy csoport között. -Comment[id]=Instant messenger memungkinan chat dua-arah antara individu dan grup -Comment[is]=Spjallforritið gerir einstaklingum og hópum kleyft að spjalla saman á einfaldan máta. -Comment[it]=La messaggistica istantanea permette di chiacchierare tra due persone o in gruppo. -Comment[ja]=インスタントメッセンジャーは個人とグループとの双方向チャットを可能にします。 -Comment[ka]=შიკრიკი პიროვნებებსა და ჯგუფებს შორის მყისი შეტყობინებების გაცვლის საშუალებას იძლევა. -Comment[kk]=Жедел хабарласу жеке тұлға және топтар араларында әңгімелесу мүмкіндігін береді. -Comment[km]=កម្មវិធី​ជជែក​កំសាន្ត​អនុញ្ញាត​ឲ្យ​ជជែក​តាម​របៀប​ពីរ​បែប​រវាង​បុគ្គល និង​ក្រុម ។ -Comment[lb]=Den Instant Messenger erlaabt eng zwee-Weeër Kommunikatioun tëschent eenzelne Persounen a Gruppen. -Comment[lt]=Momentinių žinučių klientas kalbėtis individams ir grupėms. -Comment[mk]=Инстант гласникот овозможува двонасочна комуникација меѓу индивидуи и групи. -Comment[ms]=Utusan segera membenarkan perbualan di antara individu dan kumpulan. -Comment[nb]=Et lynmeldingsprogram som tallater toveis samtale mellom enkeltpersoner og grupper. -Comment[nds]=Mit den Kortnarichten-Maker köönt enkelte Minschen oder Gruppen ünnerenanner snacken. -Comment[ne]= आवश्यक मेसेन्जरले एकल र समूहहरुबीच दोहोरो कुराकानीलाई अनुमति दिन्छ । -Comment[nl]=De instant messenger maakt directe communicatie tussen personen of groepen mogelijk. -Comment[nn]=Eit lynmeldingsprogram som tillèt tovegsprat mellom enkeltpersonar og grupper. -Comment[pa]=ਇਹ ਮੌਕਾ ਸੁਨੇਹਾਕਾਰ ਇੱਕਲੇ ਤੇ ਸਮੂਹ ਵਿਚਕਾਰ ਦੋ ਪਾਸੀ ਗਲਬਾਤ ਲਈ ਸਹਾਇਕ ਹੈ -Comment[pl]=Komunikator internetowy umożliwia pogawędki między dwiema osobami lub grupami osób. -Comment[pt]=O mensageiro instantâneo permite conversar entre dois extremos com indivíduos e com grupos. -Comment[pt_BR]=O mensageiro instantâneo permite que exista um bate-papo entre indivíduos e grupos -Comment[ro]=Aplicaţia de mesaje instantanee permite convorbiri între persoane sau grupuri de persoane. -Comment[ru]=Клиент обмена сообщениями служит для обмена сообщениями между людьми и группами. -Comment[rw]=Intumwa y'Akokanya yemerera inzira-zombi z'ikiganiroInterineti hagati y'abantu ubwabo n'amatsinda -Comment[se]=Šleađgadiehtoprográmma gos olbmot ja joavkkut sáhttet buillardallat (chat). -Comment[sk]=Instant messenger umožňuje rozhovor medzi rôznymi osobami a skupinami. -Comment[sl]=Takojšni sporočilnik omogoča dvosmeren klepet med posamezniki in skupinami. -Comment[sr]=Брзи гласник вам омогућава двосмерно ћаскање између појединаца и група. -Comment[sr@Latn]=Brzi glasnik vam omogućava dvosmerno ćaskanje između pojedinaca i grupa. -Comment[sv]=Direktmeddelanden möjliggör tvåvägschatt mellan individer och grupper. -Comment[ta]=உடனடி தகவல் உங்களை இரண்டு வழியில் தனிநபர் மற்றும் குழுக்கள் இடையே அனுமதிக்கும். -Comment[te]=ఇంస్టెంట్ మెస్సెన్జర్ వ్యక్తు లు మరయు గుంపుల తొ ఇరువయపుల నుంచి సంబాషించవచ్చు -Comment[tg]=Мубодилаи паёмҳо барои сӯҳбат бо шахсони ҷудогона ва гурӯҳӣ иҷозат медиҳад. -Comment[th]=โปรแกรมส่งข้อความแบบทันที จะอนุญาตให้มีการพูดคุยสองทาง ทั้งระหว่าง บุคคลและกลุ่ม -Comment[tr]=Anında mesajlaştırıcı iki yollu sohbet sağlar: bireyler ve gruplar. -Comment[tt]=Bu aşığıç xäbärçe aşa keşe-törkemnär arasında ike-yaqlı aralaşu mömkinlegen birä. -Comment[uk]=Програма для миттєвого зв'язку дозволяє розмовляти з іншою людиною чи групою людей. -Comment[vi]=Bộ tin nhắn tức khắc cho phép trò chuyện hai chiều giữa người riêng và nhóm. -Comment[wa]=Li messaedjreye sol moumint permete di berdeler dins les deus sinses etur deus djins ou e groupe. -Comment[zh_CN]=允许在个人和群组之间双向聊天的即时通讯程序。 -Comment[zh_HK]=即時通訊軟件可以讓用戶和別的用戶或羣組通訊。 -Comment[zh_TW]=即時通訊系統允許兩個人或兩個群組間的聊天與對話 -ServiceTypeToConfigure=DCOP/InstantMessenger -MimeTypeOfInterest=DCOP/InstantMessenger -defaultImplementation=kopete -storeInFile=default_components -valueSection=InstantMessenger -valueName=imClient -configurationType=component diff --git a/interfaces/kimproxy/interface/kimiface.h b/interfaces/kimproxy/interface/kimiface.h deleted file mode 100644 index f3212df6d..000000000 --- a/interfaces/kimproxy/interface/kimiface.h +++ /dev/null @@ -1,500 +0,0 @@ -/* - kimiface.h - KDE Instant Messenger DCOP Interface - - Copyright (c) 2004-5 Will Stephenson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KIMIFACE_H -#define KIMIFACE_H - -#include -#include -#include -#include - -/** - * @brief Generic DCOP interface for KDE instant messenger applications - * - * The interface has two parts: - * - methods to get information about IM-contacts, such as their reachability - * or their presence status (if the are online or away, etc) - * - methods to initiate communication with IM-contacts, e.g. sending messages - * - * @note If you are looking for a information about accessing application's - * that implement this interface, have a look at the KIMProxy class. - * - * Contacts are identified using unique identifier strings (UID) used by - * KABC, the KDE address book library. - * The UID generation is handled by KABC::Addressee so the your application - * will either have to access the address book or provide a possibility - * for associating a contact of your application with an entry of the address - * book. - * - * @note one omission of this interface is the lack of control over the range - * of values used for protocols' names. - * - * If you are implementing this interface, note that your application must - * have the following information in its desktop file, so that it can be - * identified as providing KIMIface at runtime: - * @code - * X-DCOP-ServiceName= - * ServiceTypes=DCOP/InstantMessenger - * @endcode - * and the class implementing KIMIface must pass "KIMIface" to the DCOPObject constructor: - * @code - * // just need TQObject inheritance and Q_OBJECT if you want signals and slots - * // no need to use K_DCOP macro again - * - * class MyIMIface : public TQObject, public KIMIface - * { - * Q_OBJECT - * public: - * MyIMIface(TQObject* parent = 0, const char* name) : - * DCOPObject("KIMIface"), // <-- passing the interface name as required - * TQObject(parent, name) {} - * }; - * @endcode - * - * The DCOP part of the interface needs to be processed by the DCOP IDL - * compiler. The KDE autotools framework will do this automatically, all - * you have to do is add kimiface.skel and kimiface.stub to the - * @c SOURCES list in your @c Makefile.am - * - * @see KIMProxy - * @see KABC::AddressBook - * @see KABC::Addressee - * - * @since 3.3 - * @author Will Stephenson - */ -class KIMIface : virtual public DCOPObject -{ - K_DCOP - -k_dcop: -// ACCESSORS -// contact list - /** - * @brief Obtain a list of IM-contacts that are known to the application - * - * Return a list of KABC UIDs of all the contacts you have such IDs for. - * - * @return a list of KABC UIDs known to the application - * - * @see reachableContacts() - * @see onlineContacts() - * @see fileTransferContacts() - * @see isPresent() - * @see KABC::Addressee::uid() - */ - virtual TQStringList allContacts() = 0; - - /** - * @brief Obtain a list of IM-contacts that are currently reachable - * - * Return a list of KABC UIDs of the contacts that are reachable in the - * sense that you are connected to the IM-service they are - * associated with. - * - * For example if your application supports ICQ and AIM and the ICQ account is - * active but the AIM account isn't, return just the ICQ contacts. - * - * @return a list of KABC UIDs who can receive a message, even if offline - * - * @see allContacts() - * @see onlineContacts() - * @see fileTransferContacts() - * @see messageContact() - * @see KABC::Addressee::uid() - */ - virtual TQStringList reachableContacts() = 0; - - /** - * @brief Obtain a list of IM-contacts that are currently online - * - * Return a list of KABC UIDs of the contacts you have any presence - * information for that indicates that they are connected to the - * IM-service they are associated with. - * - * @return a list of KABC UIDs who are online with unspecified presence - * - * @see allContacts() - * @see reachableContacts() - * @see fileTransferContacts() - * @see messageContact() - * @see chatWithContact() - * @see KABC::Addressee::uid() - */ - virtual TQStringList onlineContacts() = 0; - - /** - * @brief Obtain a list of IM-contacts who may receive file transfers - * - * Return a list of KABC UIDs of the contacts that are capable of - * receiving file transfers based on the IM-service they are associated - * with, i.e. if it is technically able to provide this, on their online - * state, i.e. can likely not receive files while offline, and perhaps even - * information your application has additionally, e.g. a user config that - * tells you that the contact is behind a firewall. - * - * The simplest implementation is to return the same list as - * onlineContacts(), provided all the IM-services that are currently used - * support it. - * - * @return a list of KABC UIDs capable of file transfer - * - * @see allContacts() - * @see reachableContacts() - * @see onlineContacts() - * @see canReceiveFiles() - * @see sendFile() - * @see KABC::Addressee::uid() - */ - virtual TQStringList fileTransferContacts() = 0; - -// individual - /** - * @brief Confirm if a given contact is known to the IM application - * - * Check if you can map the given KABC UID to one if the IM-contacts, e.g. - * the would be part of the list returned by allContacts() - * - * @param uid the KABC UID you are interested in - * @return whether the program knows of this KABC UID - * - * @see allContacts() - * @see presenceString() - * @see presenceStatus() - * @see KABC::Addressee::uid() - */ - virtual bool isPresent( const TQString & uid ) = 0; - - /** - * @brief Obtain the IM app's idea of the contact's display name - * - * Useful if KABC lookups may be too slow. Should return whatever - * the application uses in its contact list or similar GUI, e.g. - * a nick name, a user configured name string, etc. - * - * @param uid the KABC UID you are interested in - * @return the corresponding display name or TQString:null if the - * UID is unknown - * - * @see isPresent() - * @see presenceString() - * @see presenceStatus() - * @see KABC::Addressee::uid() - */ - virtual TQString displayName( const TQString & uid ) = 0; - - /** - * @brief Obtain the IM presence as a i18ned string for the specified - * contact - * - * Return a translated string your application would use when displaying - * the contact's presence, e.g. i18n("Online"), i18n("Away") - * - * @param uid the KABC UID you want the presence for - * @return the i18ned string describing the contact's presence or - * TQString::null if the UID is unknown - * - * @see isPresent() - * @see presenceStatus() - * @see KABC::Addressee::uid() - */ - virtual TQString presenceString( const TQString & uid ) = 0; - - /** - * @brief Obtain the IM presence as a number for the specified contact - * - * Return one of the following values depending on the given contact's - * presence: - * - 0 - @c Unknown: for contacts where you can not use any of the other - * values - * - * - 1 - @c Offline: for contacts that are offline, i.e. not connected to - * their IM-service. If the application itself or the IM-service for the - * given contact is offline return @c Unknown instead - * - * - 2 - @c Connecting - * - * - 3 - @c Away: for contacts that are connected to their IM-service but - * not @c Online - * - * - 4 - @c Online - * - * @param uid the KABC UID you want the presence for - * @return a numeric representation of presence - currently one of - * 0 (Unknown), 1 (Offline), 2 (Connecting), 3 (Away), 4 (Online). - * Returns 0 if the given UID is unknown - * - * @see isPresent() - * @see presenceString() - * @see KABC::Addressee::uid() - */ - virtual int presenceStatus( const TQString & uid ) = 0; - - /** - * @brief Indicate if a given contact can receive files - * - * @param uid the KABC UID you want to the file transfer capability for - * @return whether the specified contact can receive files - * - * @see fileTransferContacts() - * @see KABC::Addressee::uid() - */ - virtual bool canReceiveFiles( const TQString & uid ) = 0; - - /** - * @brief Indicate if a given contact will be able to respond - * - * Some media are unidirectional (e.g., sending SMS via a web interface). - * This refers to the contact's ability to respond as defined by the - * medium, not by their presence. - * - * Someone may appear offline (SMS has no presence) to you but in fact be - * able to respond. - * - * @param uid the KABC UID you are interested in - * @return whether the specified contact can respond - * - * @see isPresent() - * @see KABC::Addressee::uid() - */ - virtual bool canRespond( const TQString & uid ) = 0; - - /** - * @brief Obtain the KABC UID corresponding to the given IM address - * - * @param contactId the protocol specific identifier for the contact, - * e.g. UIN for ICQ, screenname for AIM, nick for IRC - * @param protocol the IM protocol/service to check. See protocols() - * @return the KABC UID for the given contact or @c TQString::null if not - * found or either input stream was empty or the protocol is not - * supported - * - * @see protocols() - * @see addContact() - * @see isPresent() - * @see KABC::Addressee::uid() - */ - virtual TQString locate( const TQString & contactId, const TQString & protocol ) = 0; - -// metadata - /** - * @brief Obtain the icon representing the IM presence for the specified - * contact - * - * Return the image the application would use to display a contact's presence. - * The size and other properties of the image are currently unspecified. - * - * @param uid the KABC UID you want the presence icon for - * @return a pixmap representing the contact's presence or a null pixmap - * if the contact is unknown. See TQPixmap::isNull() - * - * @see isPresent() - * @see presenceString() - * @see presenceStatus() - * @see KABC::Addressee::uid() - */ - virtual TQPixmap icon( const TQString & uid ) = 0; - - /** - * @brief Obtain the given contact's current context (home, work, or any) - * - * Not all IM services/protocols support the concept of contexts. If the - * given UID maps to such a service, just return @c TQString::null - * - * @param uid the KABC UID you want the context for - * @return a string describing the context, or @c TQString::null if not - * supported or if the contact is unknown - * - * @see isPresent() - * @see KABC::Addressee::uid() - */ - virtual TQString context( const TQString & uid ) = 0; - -// App capabilities - /** - * @brief Obtain a list of supported IM services/protocols - * - * Protocol names are currently of the form "protocol name" + "Protocol" - * for example: - * - AIMProtocol: AOL instant messenger protocol - * - MSNProtocol: Microsoft messanger protocol - * - ICQProtocol: AOL (Mirabilis) ICQ protocol - * - .... - * - * The string is currently just an identifier to use with methods such as - * locate(), addContact() or messageNewContact() - * - * @return the set of protocols that the application supports - * - * @see locate() - * @see addContact() - * @see messageNewContact - */ - virtual TQStringList protocols() = 0; - -// ACTORS - /** - * @brief Send a single message to the specified contact - * - * Any response will be handled by the IM client as a normal - * conversation. - * - * Implementations might send the message silently, ask the user for - * permission or just prefill the usual message input GUI. - * - * @note As sending any text could potentially be a breach of the user's - * privacy it is recommended to let the user know about it. - * - * @param uid the KABC UID you want to send the message to - * @param message the message text to send to the contact - * - * @see messageNewContact() - * @see chatWithContact() - * @see sendFile() - * @see isPresent() - * @see reachableContacts() - * @see KABC::Addressee::uid() - */ - virtual void messageContact( const TQString &uid, const TQString& message ) = 0; - - /** - * @brief Send a single message to a contact given only its protocol - * specific identifier - * - * This could be used to send a message without having to know the KABC UID - * of the contact or without having to add it first. - * - * @param contactId the protocol specific identifier for the contact, - * e.g. UIN for ICQ, screenname for AIM, nick for IRC - * @param protocol the IM protocol/service to check. See protocols() - * - * @see messageContact() - * @see chatWithContact() - * @see sendFile() - * @see locate() - * @see protocols() - * @see addContact() - */ - virtual void messageNewContact( const TQString &contactId, const TQString &protocol ) = 0; - - /** - * @brief Start a chat session with the specified contact - * - * Applications that do not support a chat mode or when the IM-service - * of the given contact does not support it, this can also open - * a normal message input GUI. - * - * @param uid the KABC UID you want to chat with - * - * @see messageContact() - * @see messageNewContact() - * @see sendFile() - * @see isPresent() - * @see reachableContacts() - * @see KABC::Addressee::uid() - */ - virtual void chatWithContact( const TQString &uid ) = 0; - - /** - * @brief Send a file to the contact - * - * Initiates a file transfer with the given contact if possible. - * - * Implementations might start the transfer right away, ask the user's - * permission or just prefill the usual file transfer GUI. - * - * @note As sending any file could potentially be a breach of the user's - * privacy it is recommended to let the user know about it. - * - * @param uid the KABC UID you want to send to - * @param sourceURL a KURL pointing to the file to send - * @param altFileName an alternate filename describing the file or a - * description or title - * @param fileSize file size in bytes - * - * @see messageContact() - * @see messageNewContact() - * @see chatWithContact() - * @see isPresent() - * @see fileTransferContacts() - * @see KABC::Addressee::uid() - */ - virtual void sendFile(const TQString &uid, const KURL &sourceURL, - const TQString &altFileName = TQString::null, uint fileSize = 0) = 0; - -// MUTATORS -// Contact list - /** - * @brief Add a new contact given its protocol specific identifier - * - * Implementations might add the contact silently, including sending an - * authorization request if necessary, ask the user for confirmation or - * just prefill the usual contact addingGUI. - * - * @param contactId the protocol specific identifier for the contact - * e.g. UIN for ICQ, screenname for AIM, nick for IRC - * @param protocol the IM protocol/service to use. See protocols() - * @return whether the add succeeded. @c false may signal already present, - * protocol not supported, or add operation not supported. - * - * @see locate() - * @see protocols() - * @see messageNewContact() - */ - virtual bool addContact( const TQString &contactId, const TQString &protocol ) = 0; - -// SIGNALS -k_dcop_signals: - /** - * @brief Indicates that a contact's presence has changed - * - * Notifies connected DCOP receivers about a change in a contact's - * presence. - * - * Implementations just have to call this method with the appropriate - * values to get the DCOP signal emitted. - * - * @param uid the KABC UID whose presence changed - * @param appId the DCOP application ID of the program the signal - * originates from - * @param presence the new presence's numeric value. See presenceStatus() - * - * @see presenceStatus() - * @see KABC::Addressee::uid() - * @see DCOPClient::appId() - */ - void contactPresenceChanged( TQString uid, TQCString appId, int presence ); -}; - -#endif - - - -/* - * Local variables: - * c-indentation-style: k&r - * c-basic-offset: 8 - * indent-tabs-mode: t - * End: - */ -// vim: set noet ts=4 sts=4 sw=4: - diff --git a/interfaces/kimproxy/library/CMakeLists.txt b/interfaces/kimproxy/library/CMakeLists.txt deleted file mode 100644 index 347e552a5..000000000 --- a/interfaces/kimproxy/library/CMakeLists.txt +++ /dev/null @@ -1,51 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( icons ) - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio/kio -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - kimproxy.h kimproxyiface.h - DESTINATION ${INCLUDE_INSTALL_DIR} ) - - -##### kimproxy ################################## - -set( target kimproxy ) - -set( ${target}_SRCS - kimproxy.cpp kimproxyiface.skel - ${CMAKE_SOURCE_DIR}/interfaces/kimproxy/interface/kimiface.stub -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 0.0.0 - LINK kio-shared - DESTINATION ${LIB_INSTALL_DIR} - DEPENDENCIES dcopidl -) diff --git a/interfaces/kimproxy/library/Makefile.am b/interfaces/kimproxy/library/Makefile.am deleted file mode 100644 index 94f2974ac..000000000 --- a/interfaces/kimproxy/library/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ -SUBDIRS = icons - -INCLUDES = $(all_includes) - -noinst_HEADERS = kimproxyiface.h - -METASOURCES = AUTO - -AM_CPPFLAGS = $(all_includes) - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kimproxy.pot - -kimproxyincludedir = $(includedir) -kimproxyinclude_HEADERS = kimproxy.h kimproxyiface.h - -lib_LTLIBRARIES = libkimproxy.la -libkimproxy_la_LDFLAGS = -no-undefined $(all_libraries) -libkimproxy_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) -libkimproxy_la_SOURCES = kimproxy.cpp kimiface.stub kimproxyiface.skel - -kimiface_DIR = $(top_srcdir)/interfaces/kimproxy/interface - -include $(top_srcdir)/admin/Doxyfile.am -DOXYGEN_REFERENCES = kabc dcop - diff --git a/interfaces/kimproxy/library/icons/CMakeLists.txt b/interfaces/kimproxy/library/icons/CMakeLists.txt deleted file mode 100644 index ac95aa58c..000000000 --- a/interfaces/kimproxy/library/icons/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_install_icons( ) - diff --git a/interfaces/kimproxy/library/icons/Makefile.am b/interfaces/kimproxy/library/icons/Makefile.am deleted file mode 100644 index a4b97f06a..000000000 --- a/interfaces/kimproxy/library/icons/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -KDE_ICON=AUTO diff --git a/interfaces/kimproxy/library/icons/cr16-action-presence_away.png b/interfaces/kimproxy/library/icons/cr16-action-presence_away.png deleted file mode 100644 index f96a9c65f..000000000 Binary files a/interfaces/kimproxy/library/icons/cr16-action-presence_away.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr16-action-presence_offline.png b/interfaces/kimproxy/library/icons/cr16-action-presence_offline.png deleted file mode 100644 index f5c53d711..000000000 Binary files a/interfaces/kimproxy/library/icons/cr16-action-presence_offline.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr16-action-presence_online.png b/interfaces/kimproxy/library/icons/cr16-action-presence_online.png deleted file mode 100644 index 6cb52496b..000000000 Binary files a/interfaces/kimproxy/library/icons/cr16-action-presence_online.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr16-action-presence_unknown.png b/interfaces/kimproxy/library/icons/cr16-action-presence_unknown.png deleted file mode 100644 index 290bc852a..000000000 Binary files a/interfaces/kimproxy/library/icons/cr16-action-presence_unknown.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr32-action-presence_away.png b/interfaces/kimproxy/library/icons/cr32-action-presence_away.png deleted file mode 100644 index 086184582..000000000 Binary files a/interfaces/kimproxy/library/icons/cr32-action-presence_away.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr32-action-presence_offline.png b/interfaces/kimproxy/library/icons/cr32-action-presence_offline.png deleted file mode 100644 index caadb14d4..000000000 Binary files a/interfaces/kimproxy/library/icons/cr32-action-presence_offline.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr32-action-presence_online.png b/interfaces/kimproxy/library/icons/cr32-action-presence_online.png deleted file mode 100644 index 41e79ad9d..000000000 Binary files a/interfaces/kimproxy/library/icons/cr32-action-presence_online.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr32-action-presence_unknown.png b/interfaces/kimproxy/library/icons/cr32-action-presence_unknown.png deleted file mode 100644 index 52ab79ed5..000000000 Binary files a/interfaces/kimproxy/library/icons/cr32-action-presence_unknown.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr48-action-presence_away.png b/interfaces/kimproxy/library/icons/cr48-action-presence_away.png deleted file mode 100644 index 58e62c1d3..000000000 Binary files a/interfaces/kimproxy/library/icons/cr48-action-presence_away.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr48-action-presence_offline.png b/interfaces/kimproxy/library/icons/cr48-action-presence_offline.png deleted file mode 100644 index b69630f33..000000000 Binary files a/interfaces/kimproxy/library/icons/cr48-action-presence_offline.png and /dev/null differ diff --git a/interfaces/kimproxy/library/icons/cr48-action-presence_online.png b/interfaces/kimproxy/library/icons/cr48-action-presence_online.png deleted file mode 100644 index 52fdad8f9..000000000 Binary files a/interfaces/kimproxy/library/icons/cr48-action-presence_online.png and /dev/null differ diff --git a/interfaces/kimproxy/library/kimproxy.cpp b/interfaces/kimproxy/library/kimproxy.cpp deleted file mode 100644 index e8118b8bc..000000000 --- a/interfaces/kimproxy/library/kimproxy.cpp +++ /dev/null @@ -1,653 +0,0 @@ -/* - kimproxy.cpp - - IM service library for KDE - - Copyright (c) 2004 Will Stephenson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "kimiface_stub.h" - -#include "kimproxy.h" - -static KStaticDeleter _staticDeleter; - -KIMProxy * KIMProxy::s_instance = 0L; - -struct AppPresenceCurrent -{ - TQCString appId; - int presence; -}; - -class ContactPresenceListCurrent : public TQValueList -{ - public: - // return value indicates if the supplied parameter was better than any existing presence - bool update( const AppPresenceCurrent ); - AppPresenceCurrent best(); -}; - - -struct KIMProxy::Private -{ - DCOPClient * dc; - // list of the strings in use by KIMIface - TQStringList presence_strings; - // list of the icon names in use by KIMIface - TQStringList presence_icons; - // map of presences - PresenceStringMap presence_map; -}; - -bool ContactPresenceListCurrent::update( AppPresenceCurrent ap ) -{ - if ( isEmpty() ) - { - append( ap ); - return true; - } - - bool bestChanged = false; - AppPresenceCurrent best; - best.presence = -1; - ContactPresenceListCurrent::iterator it = begin(); - const ContactPresenceListCurrent::iterator itEnd = end(); - ContactPresenceListCurrent::iterator existing = itEnd; - - while ( it != itEnd ) - { - if ( (*it).presence > best.presence ) - best = (*it); - if ( (*it).appId == ap.appId ) - existing = it; - ++it; - } - - if ( ap.presence > best.presence || - best.appId == ap.appId ) - bestChanged = true; - - if ( existing != itEnd ) - { - remove( existing ); - append( ap ); - } - return bestChanged; -} - -AppPresenceCurrent ContactPresenceListCurrent::best() -{ - AppPresenceCurrent best; - best.presence = -1; - ContactPresenceListCurrent::iterator it = begin(); - const ContactPresenceListCurrent::iterator itEnd = end(); - while ( it != itEnd ) - { - if ( (*it).presence > best.presence ) - best = (*it); - ++it; - } - // if it's still -1 here, we have no presence data, so we return Unknown - if ( best.presence == -1 ) - best.presence = 0; - return best; -} - -// int bestPresence( AppPresence* ap ) -// { -// Q_ASSERT( ap ); -// AppPresence::const_iterator it; -// it = ap->begin(); -// int best = 0; // unknown -// if ( it != ap->end() ) -// { -// best = it.data(); -// ++it; -// for ( ; it != ap->end(); ++it ) -// { -// if ( it.data() > best ) -// best = it.data(); -// } -// } -// return best; -// } -// -// TQCString bestAppId( AppPresence* ap ) -// { -// Q_ASSERT( ap ); -// AppPresence::const_iterator it; -// TQCString bestAppId; -// it = ap->begin(); -// if ( it != ap->end() ) -// { -// int best = it.data(); -// bestAppId = it.key(); -// ++it; -// for ( ; it != ap->end(); ++it ) -// { -// if ( it.data() > best ) -// { -// best = it.data(); -// bestAppId = it.key(); -// } -// } -// } -// return bestAppId; -// } - -KIMProxy * KIMProxy::instance( DCOPClient * client ) -{ - if ( client ) - { - if ( !s_instance ) - _staticDeleter.setObject( s_instance, new KIMProxy( client ) ); - return s_instance; - } - else - return 0L; -} - -KIMProxy::KIMProxy( DCOPClient* dc ) : DCOPObject( "KIMProxyIface" ), TQObject(), d( new Private ) -{ - m_im_client_stubs.setAutoDelete( true ); - - d->dc = dc; - m_initialized = false; - connect( d->dc, TQT_SIGNAL( applicationRemoved( const TQCString& ) ) , this, TQT_SLOT( unregisteredFromDCOP( const TQCString& ) ) ); - connect( d->dc, TQT_SIGNAL( applicationRegistered( const TQCString& ) ) , this, TQT_SLOT( registeredToDCOP( const TQCString& ) ) ); - d->dc->setNotifications( true ); - - d->presence_strings.append( "Unknown" ); - d->presence_strings.append( "Offline" ); - d->presence_strings.append( "Connecting" ); - d->presence_strings.append( "Away" ); - d->presence_strings.append( "Online" ); - - d->presence_icons.append( "presence_unknown" ); - d->presence_icons.append( "presence_offline" ); - d->presence_icons.append( "presence_connecting" ); - d->presence_icons.append( "presence_away" ); - d->presence_icons.append( "presence_online" ); - - //TQCString senderApp = "Kopete"; - //TQCString senderObjectId = "KIMIface"; - TQCString method = "contactPresenceChanged( TQString, TQCString, int )"; - //TQCString receiverObjectId = "KIMProxyIface"; - - // FIXME: make this work when the sender object id is set to KIMIFace - if ( !connectDCOPSignal( 0, 0, method, method, false ) ) - kdWarning() << "Couldn't connect DCOP signal. Won't receive any status notifications!" << endl; -} - -KIMProxy::~KIMProxy( ) -{ - //d->dc->setNotifications( false ); -} - -bool KIMProxy::initialize() -{ - if ( !m_initialized ) - { - m_initialized = true; // we should only do this once, as registeredToDCOP() will catch any new starts - // So there is no error from a failed query when using tdelibs 3.2, which don't have this servicetype - if ( KServiceType::serviceType( IM_SERVICE_TYPE ) ) - { - //kdDebug( 790 ) << k_funcinfo << endl; - TQCString dcopObjectId = "KIMIface"; - - // see what apps implementing our service type are out there - KService::List offers = KServiceType::offers( IM_SERVICE_TYPE ); - KService::List::iterator offer; - typedef TQValueList QCStringList; - QCStringList registeredApps = d->dc->registeredApplications(); - QCStringList::iterator app; - const QCStringList::iterator end = registeredApps.end(); - // for each registered app - for ( app = registeredApps.begin(); app != end; ++app ) - { - //kdDebug( 790 ) << " considering: " << *app << endl; - //for each offer - for ( offer = offers.begin(); offer != offers.end(); ++offer ) - { - TQCString dcopService = (*offer)->property("X-DCOP-ServiceName").toString().latin1(); - if ( !dcopService.isEmpty() ) - { - //kdDebug( 790 ) << " is it: " << dcopService << "?" << endl; - // get the application name ( minus any process ID ) - TQCString instanceName = (*app).left( dcopService.length() ); - // if the application implements the dcop service, add it - if ( instanceName == dcopService ) - { - m_apps_available = true; - //kdDebug( 790 ) << " app name: " << (*offer)->name() << ", has instance " << *app << ", dcopService: " << dcopService << endl; - if ( !m_im_client_stubs.find( dcopService ) ) - { - kdDebug( 790 ) << "App " << *app << ", dcopObjectId " << dcopObjectId << " found, using it for presence info." << endl; - m_im_client_stubs.insert( *app, new KIMIface_stub( d->dc, *app, dcopObjectId ) ); - pollApp( *app ); - } - } - } - } - } - } - } - return !m_im_client_stubs.isEmpty(); -} - -void KIMProxy::registeredToDCOP( const TQCString& appId ) -{ - //kdDebug( 790 ) << k_funcinfo << " appId '" << appId << "'" << endl; - // check that appId implements our service - // if the appId ends with a number, i.e. a pid like in foobar-12345, - if ( appId.isEmpty() ) - return; - - bool newApp = false; - // get an up to date list of offers in case a new app was installed - // and check each of the offers that implement the service type we're looking for, - // to see if any of them are the app that just registered - const KService::List offers = KServiceType::offers( IM_SERVICE_TYPE ); - KService::List::const_iterator it; - for ( it = offers.begin(); it != offers.end(); ++it ) - { - TQCString dcopObjectId = "KIMIface"; - TQCString dcopService = (*it)->property("X-DCOP-ServiceName").toString().latin1(); - if ( appId.left( dcopService.length() ) == dcopService ) - { - // if it's not already known, insert it - if ( !m_im_client_stubs.find( appId ) ) - { - newApp = true; - kdDebug( 790 ) << "App: " << appId << ", dcopService: " << dcopService << " started, using it for presence info."<< endl; - m_im_client_stubs.insert( appId, new KIMIface_stub( d->dc, appId, dcopObjectId ) ); - } - } - //else - // kdDebug( 790 ) << "App doesn't implement our ServiceType" << endl; - } - //if ( newApp ) - // emit sigPresenceInfoExpired(); -} - -void KIMProxy::unregisteredFromDCOP( const TQCString& appId ) -{ - //kdDebug( 790 ) << k_funcinfo << appId << endl; - if ( m_im_client_stubs.find( appId ) ) - { - kdDebug( 790 ) << appId << " quit, removing its presence info." << endl; - - PresenceStringMap::Iterator it = d->presence_map.begin(); - const PresenceStringMap::Iterator end = d->presence_map.end(); - for ( ; it != end; ++it ) - { - ContactPresenceListCurrent list = it.data(); - ContactPresenceListCurrent::iterator cpIt = list.begin(); - while( cpIt != list.end() ) - { - ContactPresenceListCurrent::iterator gone = cpIt++; - if ( (*gone).appId == appId ) - { - list.remove( gone ); - } - } - } - m_im_client_stubs.remove( appId ); - emit sigPresenceInfoExpired(); - } -} - -void KIMProxy::contactPresenceChanged( TQString uid, TQCString appId, int presence ) -{ - // update the presence map - //kdDebug( 790 ) << k_funcinfo << "uid: " << uid << " appId: " << appId << " presence " << presence << endl; - ContactPresenceListCurrent current; - current = d->presence_map[ uid ]; - //kdDebug( 790 ) << "current best presence from : " << current.best().appId << " is: " << current.best().presence << endl; - AppPresenceCurrent newPresence; - newPresence.appId = appId; - newPresence.presence = presence; - - if ( current.update( newPresence ) ) - { - d->presence_map.insert( uid, current ); - emit sigContactPresenceChanged( uid ); - } -} - -int KIMProxy::presenceNumeric( const TQString& uid ) -{ - AppPresenceCurrent ap; - ap.presence = 0; - if ( initialize() ) - { - ContactPresenceListCurrent presence = d->presence_map[ uid ]; - ap = presence.best(); - } - return ap.presence; -} - -TQString KIMProxy::presenceString( const TQString& uid ) -{ - AppPresenceCurrent ap; - ap.presence = 0; - if ( initialize() ) - { - ContactPresenceListCurrent presence = d->presence_map[ uid ]; - ap = presence.best(); - } - if ( ap.appId.isEmpty() ) - return TQString::null; - else - return d->presence_strings[ ap.presence ]; -} - -TQPixmap KIMProxy::presenceIcon( const TQString& uid ) -{ - AppPresenceCurrent ap; - ap.presence = 0; - if ( initialize() ) - { - ContactPresenceListCurrent presence = d->presence_map[ uid ]; - ap = presence.best(); - } - if ( ap.appId.isEmpty() ) - { - //kdDebug( 790 ) << k_funcinfo << "returning a null TQPixmap because we were asked for an icon for a uid we know nothing about" << endl; - return TQPixmap(); - } - else - { - //kdDebug( 790 ) << k_funcinfo << "returning this: " << d->presence_icons[ ap.presence ] << endl; - return SmallIcon( d->presence_icons[ ap.presence ]); - } -} - -TQStringList KIMProxy::allContacts() -{ - TQStringList value = d->presence_map.keys(); - return value; -} - -TQStringList KIMProxy::reachableContacts() -{ - TQStringList value; - - if ( initialize() ) - { - TQDictIterator it( m_im_client_stubs ); - for ( ; it.current(); ++it ) - { - value += it.current()->reachableContacts( ); - } - } - return value; -} - -TQStringList KIMProxy::onlineContacts() -{ - TQStringList value; - PresenceStringMap::iterator it = d->presence_map.begin(); - const PresenceStringMap::iterator end= d->presence_map.end(); - for ( ; it != end; ++it ) - if ( it.data().best().presence > 2 /*Better than Connecting, ie Away or Online*/ ) - value.append( it.key() ); - - return value; -} - -TQStringList KIMProxy::fileTransferContacts() -{ - TQStringList value; - - if ( initialize() ) - { - TQDictIterator it( m_im_client_stubs ); - for ( ; it.current(); ++it ) - { - value += it.current()->fileTransferContacts( ); - } - } - return value; -} - -bool KIMProxy::isPresent( const TQString& uid ) -{ - return ( !d->presence_map[ uid ].isEmpty() ); -} - -TQString KIMProxy::displayName( const TQString& uid ) -{ - TQString name; - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForUid( uid ) ) - name = s->displayName( uid ); - } - //kdDebug( 790 ) << k_funcinfo << name << endl; - return name; -} - -bool KIMProxy::canReceiveFiles( const TQString & uid ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForUid( uid ) ) - return s->canReceiveFiles( uid ); - } - return false; -} - -bool KIMProxy::canRespond( const TQString & uid ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForUid( uid ) ) - return s->canRespond( uid ); - } - return false; -} - -TQString KIMProxy::context( const TQString & uid ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForUid( uid ) ) - return s->context( uid ); - } - return TQString::null; -} - -void KIMProxy::chatWithContact( const TQString& uid ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForUid( uid ) ) - { - kapp->updateRemoteUserTimestamp( s->app() ); - s->chatWithContact( uid ); - } - } - return; -} - -void KIMProxy::messageContact( const TQString& uid, const TQString& message ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForUid( uid ) ) - { - kapp->updateRemoteUserTimestamp( s->app() ); - s->messageContact( uid, message ); - } - } - return; -} - -void KIMProxy::sendFile(const TQString &uid, const KURL &sourceURL, const TQString &altFileName, uint fileSize ) -{ - if ( initialize() ) - { - TQDictIterator it( m_im_client_stubs ); - for ( ; it.current(); ++it ) - { - if ( it.current()->canReceiveFiles( uid ) ) - { - kapp->updateRemoteUserTimestamp( it.current()->app() ); - it.current()->sendFile( uid, sourceURL, altFileName, fileSize ); - break; - } - } - } - return; -} - -bool KIMProxy::addContact( const TQString &contactId, const TQString &protocol ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForProtocol( protocol ) ) - return s->addContact( contactId, protocol ); - } - return false; -} - -TQString KIMProxy::locate( const TQString & contactId, const TQString & protocol ) -{ - if ( initialize() ) - { - if ( KIMIface_stub* s = stubForProtocol( protocol ) ) - return s->locate( contactId, protocol ); - } - return TQString::null; -} - -bool KIMProxy::imAppsAvailable() -{ - return ( !m_im_client_stubs.isEmpty() ); -} - -bool KIMProxy::startPreferredApp() -{ - TQString preferences = TQString("[X-DCOP-ServiceName] = '%1'").arg( preferredApp() ); - // start/find an instance of DCOP/InstantMessenger - TQString error; - TQCString dcopService; - // Get a preferred IM client. - // The app will notify itself to us using registeredToDCOP, so we don't need to record a stub for it here - // FIXME: error in preferences, see debug output - preferences = TQString::null; - int result = KDCOPServiceStarter::self()->findServiceFor( IM_SERVICE_TYPE, TQString::null, preferences, &error, &dcopService ); - - kdDebug( 790 ) << k_funcinfo << "error was: " << error << ", dcopService: " << dcopService << endl; - - return ( result == 0 ); -} - - -void KIMProxy::pollAll( const TQString &uid ) -{ -/* // We only need to call this function if we don't have any data at all - // otherwise, the data will be kept fresh by received presence change - // DCOP signals - if ( !d->presence_map.contains( uid ) ) - { - AppPresence *presence = new AppPresence(); - // record current presence from known clients - TQDictIterator it( m_im_client_stubs ); - for ( ; it.current(); ++it ) - { - presence->insert( it.currentKey().ascii(), it.current()->presenceStatus( uid ) ); // m_im_client_stubs has qstring keys... - } - d->presence_map.insert( uid, presence ); - }*/ -} - -void KIMProxy::pollApp( const TQCString & appId ) -{ - //kdDebug( 790 ) << k_funcinfo << endl; - KIMIface_stub * appStub = m_im_client_stubs[ appId ]; - TQStringList contacts = m_im_client_stubs[ appId ]->allContacts(); - TQStringList::iterator it = contacts.begin(); - TQStringList::iterator end = contacts.end(); - for ( ; it != end; ++it ) - { - ContactPresenceListCurrent current = d->presence_map[ *it ]; - AppPresenceCurrent ap; - ap.appId = appId; - ap.presence = appStub->presenceStatus( *it ); - current.append( ap ); - - d->presence_map.insert( *it, current ); - if ( current.update( ap ) ) - emit sigContactPresenceChanged( *it ); - //kdDebug( 790 ) << " uid: " << *it << " presence: " << ap.presence << endl; - } -} - -KIMIface_stub * KIMProxy::stubForUid( const TQString &uid ) -{ - // get best appPresence - AppPresenceCurrent ap = d->presence_map[ uid ].best(); - // look up the presence string from that app - return m_im_client_stubs.find( ap.appId ); -} - -KIMIface_stub * KIMProxy::stubForProtocol( const TQString &protocol) -{ - KIMIface_stub * app; - // see if the preferred client supports this protocol - TQString preferred = preferredApp(); - if ( ( app = m_im_client_stubs.find( preferred ) ) ) - { - if ( app->protocols().grep( protocol ).count() > 0 ) - return app; - } - // preferred doesn't do this protocol, try the first of the others that says it does - TQDictIterator it( m_im_client_stubs ); - for ( ; it.current(); ++it ) - { - if ( it.current()->protocols().grep( protocol ).count() > 0 ) - return it.current(); - } - return 0L; -} - -TQString KIMProxy::preferredApp() -{ - TDEConfig *store = new KSimpleConfig( IM_CLIENT_PREFERENCES_FILE ); - store->setGroup( IM_CLIENT_PREFERENCES_SECTION ); - TQString preferredApp = store->readEntry( IM_CLIENT_PREFERENCES_ENTRY ); - //kdDebug( 790 ) << k_funcinfo << "found preferred app: " << preferredApp << endl; - return preferredApp; -} - -#include "kimproxy.moc" diff --git a/interfaces/kimproxy/library/kimproxy.h b/interfaces/kimproxy/library/kimproxy.h deleted file mode 100644 index d4312b341..000000000 --- a/interfaces/kimproxy/library/kimproxy.h +++ /dev/null @@ -1,654 +0,0 @@ -/* - kimproxy.h - - IM service library for KDE - - Copyright (c) 2004 Will Stephenson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KIMPROXY_H -#define KIMPROXY_H - -#include -#include -#include -#include - - -#define IM_SERVICE_TYPE "DCOP/InstantMessenger" -#define IM_CLIENT_PREFERENCES_FILE "default_components" -#define IM_CLIENT_PREFERENCES_SECTION "InstantMessenger" -#define IM_CLIENT_PREFERENCES_ENTRY "imClient" - -#include "kimproxyiface.h" - -class DCOPClient; -class KIMIface_stub; -class KURL; -class ContactPresenceListCurrent; - -/** FIXME: remove for KDE4, binary compability again. */ -typedef TQMap AppPresence; // appId->presence; contains all applications' ideas of a user's presence -typedef TQDict PresenceMap; // uid->AppPresence; contains a AppPresences for all users -/** FIXME: remove presenceMap and call this presenceMap in KDE4. This hack is for binary compatibility */ -typedef TQMap PresenceStringMap; - -/** - * @brief Provides access to instant messenger programs which implement KDE's - * instant messanger interface KIMIface - * - * This class provides an easy-to-use interface to all running instant - * messengers or chat programs that implement KIMIface. - * - * It works simultaneously with any running programs that implement the - * ServiceType @c DCOP/InstantMessenger. - * - * IM-contacts are identified using unique identifier strings (UID) used by - * KDE's address book framework KABC. - * However the use of the address book API is optional, KIMProxy provides - * methods to fetch lists of available contact UIDs from the applications. - * If a UID is reachable with more than one program, KIMProxy aggregates the - * available information and presents the 'best' presence. For example, for a - * contact who can be seen to be @c Away in @c IRC on program A but @c Online - * using @c ICQ on program B, the information from program B will be used. - * - * KIMProxy is designed for simple information in a wide number of cases, not - * for detailed messaging. - * - * The class is implemented as a singleton, so whenever you need access to - * one of its methods, just retrieve the single instance using instance(). - * The following code snippet demonstrated how to send a message to all - * reachable IM-contacts: - * @code - * // get proxy instance - * KIMProxy* proxy = KIMProxy::instance(); - * - * // check if there are suitable applications reachable - * if (!proxy->initialize()) return; - * - * TQString message = "Hi!\nHow are you on this wonderful day?"; - * - * // iterate over the list of reachable contacts - * TQStringList reachableContacts = proxy->reachableContacts(); - * for (TQStringList::const_iterator it = reachableContacts.begin(); - * it != reachableContacts.end(); ++it) - * { - proxy->messageContact(*it, message); - * } - * @endcode - * - * @note While it is possible to communicate with each of those application's - * by DCOP using KIMProxy has the advantage of communicating with all - * applications simultaneously and thus getting an augmented view of - * availability, capability and presence (online status) of IM-contacts. - * - * @see KIMIface - * @see KABC::AddressBook - * @see KABC::Addressee - * - * @since 3.3 - * @author Will Stephenson - */ -class KIMPROXY_EXPORT KIMProxy : public TQObject, virtual public KIMProxyIface -{ - Q_OBJECT - struct Private; - - template friend class KStaticDeleter; - ~KIMProxy(); - - public: - /** - * @brief Obtain an instance of KIMProxy - * - * Creates a new instance if it is called for the first time. - * Call initialize() to check if there are applications available for - * communication. - * - * @note KIMProxy uses DCOPClient::setNotifications() to make sure - * it updates its information about IM applications it interacts with, - * e.g. that it gets notified about newly available applications or - * about applications exiting - * - * @param client your application's DCOP client - * @return the singleton instance of this class - */ - static KIMProxy * instance( DCOPClient * client ); - - /** - * @brief Get the proxy ready to connect - * - * Discover any running IM clients and setup communication handlers for - * them. The list of available clients is updated automatically - * through notification about added or removed DCOP applications as - * provided by DCOPClient. - * - * It is safe to call this method more than once, initialization only - * occurs at the first time. - * - * @return whether the proxy is ready to use. - * @c false if there are no suitable apps running - */ - bool initialize(); - - /** - * @brief Obtain a list of IM-contacts known to IM-applications - * - * Returns a list of KABC UIDs gathered by merging the lists of - * each application the proxy can communicate with. - * The method uses cached information to make it fast and not - * require actually communicating with the applications every time - * it is called. - * - * @return a list of KABC UIDs known to any IM-application - * - * @see reachableContacts() - * @see onlineContacts() - * @see fileTransferContacts() - * @see isPresent() - * @see KABC::Addressee::uid() - */ - TQStringList allContacts(); - - /** - * @brief Obtain a list of IM-contacts that are currently reachable - * - * Returns a list of KABC UIDs gathered by merging the lists of - * each application the proxy can communicate with. - * - * @return a list of KABC UIDs who can receive a message, even if offline - * - * @see allContacts() - * @see onlineContacts() - * @see fileTransferContacts() - * @see messageContact() - * @see KABC::Addressee::uid() - */ - TQStringList reachableContacts(); - - /** - * @brief Obtain a list of IM-contacts that are currently online - * - * Returns a list of KABC UIDs gathered by merging the lists of - * each application the proxy can communicate with. - * The method uses cached information to make it fast and not - * require actually communicating with the applications every time - * it is called. - * - * @return a list of KABC UIDs who are online with unspecified presence - * - * @see allContacts() - * @see reachableContacts() - * @see fileTransferContacts() - * @see messageContact() - * @see chatWithContact() - * @see KABC::Addressee::uid() - */ - TQStringList onlineContacts(); - - /** - * @brief Obtain a list of IM-contacts who may receive file transfers - * - * Returned IM-contacts might not be capable of receiving file - * tranfers due to limitations of their clients or because they are - * behind a firewall. - * KIMProxy doesn't have the possibilities to discover this and will - * list them as well. - * - * Returns a list of KABC UIDs gathered by merging the lists of - * each application the proxy can communicate with. - * - * @return a list of KABC UIDs capable of file transfer - * - * @see allContacts() - * @see reachableContacts() - * @see onlineContacts() - * @see canReceiveFiles() - * @see KABC::Addressee::uid() - */ - TQStringList fileTransferContacts(); - - /** - * @brief Confirm if a given contact is known to the proxy - * - * A contact is known to the proxy if it is know to at least one - * IM-application the proxy is communicating with. - * - * The method uses cached information to make it fast and not - * require actually communicating with the applications every time - * it is called. - * - * @param uid the KABC UID you are interested in - * @return whether any IM-program knows of this KABC UID - * - * @see allContacts() - * @see presenceString() - * @see presenceNumeric() - * @see KABC::Addressee::uid() - */ - bool isPresent( const TQString& uid ); - - /** - * @brief Obtain the proxy's idea of the contact's display name - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and @c Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * Useful if KABC lookups may be too slow. - * - * @param uid the KABC UID you are interested in - * @return the corresponding display name or TQString:null if the - * UID is unknown - * - * @see isPresent() - * @see presenceString() - * @see presenceNumeric() - * @see KABC::Addressee::uid() - */ - TQString displayName( const TQString& uid ); - - /** - * @brief Obtain the IM presence as a number for the specified contact - * - * Returns one of the following values depending on the given contact's - * presence: - * - 0 - @c Unknown: for contacts where you can not use any of the - * other values - * - * - 1 - @c Offline: for contacts that are offline, i.e. not connected - * to their IM-service. - * - * - 2 - @c Connecting - * - * - 3 - @c Away: for contacts that are connected to their IM-service - * but not @c Online - * - * - 4 - @c Online - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * The method uses cached information to make it fast and not - * require actually communicating with the applications every time - * it is called. - * - * @param uid the KABC UID you want the presence for - * @return a numeric representation of presence - currently one of - * 0 (Unknown), 1 (Offline), 2 (Connecting), 3 (Away), - * 4 (Online). Returns 0 if the given UID is unknown - * - * @see isPresent() - * @see presenceString() - * @see presenceIcon() - * @see KIMIface::presenceStatus() - * @see KABC::Addressee::uid() - */ - int presenceNumeric( const TQString& uid ); - - /** - * @brief Obtain the IM presence as a i18ned string for the specified - * contact - * - * The presence string is one of the following: - * - i18n("Unknown") - * - i18n("Offline") - * - i18n("Connecting") - * - i18n("Away") - * - i18n("Online") - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * @note The presence string is created based on the numerical - * presence value returned by the applications. It currently - * does not return the presence strings used by the applications. - * - * The method uses cached information to make it fast and not - * require actually communicating with the applications every time - * it is called. - * - * @param uid the KABC UID you want the presence for - * @return the i18ned string describing the contact's presence or - * TQString::null if the UID is unknown - * - * @see isPresent() - * @see presenceNumeric() - * @see presenceIcon() - * @see KABC::Addressee::uid() - */ - TQString presenceString( const TQString& uid ); - - /** - * @brief Obtain the icon representing the IM presence for the - * specified contact - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * @note The presence icon is chosen based on the numerical - * presence value returned by the applications. It currently - * does not return the presence icon used by the applications. - * - * The method uses cached information to make it fast and not - * require actually communicating with the applications every time - * it is called. - * - * @param uid the KABC UID you want the presence icon for - * @return a pixmap representing the contact's presence or a null - * pixmap if the contact is unknown. See TQPixmap::isNull() - * - * @see isPresent() - * @see presenceString() - * @see presenceNumeric() - * @see KABC::Addressee::uid() - */ - TQPixmap presenceIcon( const TQString& uid ); - - /** - * @brief Indicate if a given contact can receive files - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * @param uid the KABC UID you want to the file transfer capability for - * @return whether the specified contact can receive files - * - * @see fileTransferContacts() - * @see KABC::Addressee::uid() - */ - bool canReceiveFiles( const TQString & uid ); - - /** - * @brief Indicate if a given contact will be able to respond - * - * Some media are unidirectional (e.g., sending SMS via a web - * interface). - * This refers to the contact's ability to respond as defined by the - * medium, not by their presence. - * - * Someone may appear offline (SMS has no presence) to you but in fact - * be able to respond. - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * @param uid the KABC UID you are interested in - * @return whether the specified contact can respond - * - * @see isPresent() - * @see KABC::Addressee::uid() - */ - bool canRespond( const TQString & uid ); - - /** - * @brief Obtain the KABC UID corresponding to the given IM address - * - * @param contactId the protocol specific identifier for the contact, - * e.g. UIN for ICQ, screenname for AIM, nick for IRC - * @param protocol the IM protocol/service to check. - * See KIMIface::protocols() - * @return the KABC UID for the given contact or @c TQString::null if - * not found or either input stream was empty or the protocol - * is not supported - * - * @see KIMIface::protocols() - * @see addContact() - * @see isPresent() - * @see KABC::Addressee::uid() - */ - TQString locate( const TQString & contactId, const TQString & protocol ); - - /** - * @brief Obtain the given contact's current context (home, work, or - * any) - * - * Not all IM services/protocols support the concept of contexts. If the - * given UID maps to such a service, @c TQString::null will be returned - * - * If the given KABC UID is known to more than one IM-application - * the result of the application which has the best presence for the - * contact is taken. - * For example if a contact is @c Online on ICQ and Away on AIM, the - * value returned by the application providing ICQ is taken. - * - * @param uid the KABC UID you want the context for - * @return a string describing the context, or @c TQString::null if not - * supported or if the contact is unknown - * - * @see isPresent() - * @see KABC::Addressee::uid() - */ - TQString context( const TQString & uid ); - - /** - * @brief Start a chat session with the specified contact - * - * @param uid the KABC UID you want to chat with - * - * @see messageContact() - * @see sendFile() - * @see isPresent() - * @see reachableContacts() - * @see KABC::Addressee::uid() - */ - void chatWithContact( const TQString& uid ); - - /** - * @brief Send a single message to the specified contact - * - * Any response will be handled by the IM client as a normal - * conversation. - * - * @param uid the KABC UID you want to send the message to - * @param message the message text to send to the contact - * - * @see chatWithContact() - * @see sendFile() - * @see isPresent() - * @see reachableContacts() - * @see KABC::Addressee::uid() - */ - void messageContact( const TQString& uid, const TQString& message ); - - /** - * @brief Send a file to the contact - * - * Initiates a file transfer with the given contact if possible. - * - * @param uid the KABC UID you want to send to - * @param sourceURL a KURL pointing to the file to send - * @param altFileName an alternate filename describing the file or a - * description or title - * @param fileSize file size in bytes - * - * @see messageContact() - * @see chatWithContact() - * @see isPresent() - * @see fileTransferContacts() - * @see KABC::Addressee::uid() - */ - void sendFile(const TQString &uid, const KURL &sourceURL, - const TQString &altFileName = TQString::null, uint fileSize = 0); - - /** - * @brief Add a new contact given its protocol specific identifier - * - * @param contactId the protocol specific identifier for the contact - * e.g. UIN for ICQ, screenname for AIM, nick for IRC - * @param protocol the IM protocol/service to use. - * See KIMIface:::protocols() - * @return whether the add succeeded. @c false may signal already present, - * protocol not supported, or add operation not supported. - * - * @see locate() - * @see KIMIface::protocols() - */ - bool addContact( const TQString &contactId, const TQString &protocol ); - - /** - * @brief Checks if there are any compatible instant messaging - * applications available - * - * Available means that they are started and registered with DCOP - * and implementing the correct DCOP service. - * This information will be updated on the first call to initialize() - * and whenever an application registers or unregisters with DCOP, - * i.e. the information will be kept up to date. - * - * @return @c true if there are any apps available - */ - bool imAppsAvailable(); - - /** - * @brief Start the user's preferred IM application - * @return whether a preferred app was found. No guarantee that it - * started correctly - */ - bool startPreferredApp(); - - /** - * Just exists to let the IDL compiler make the DCOP signal for this - */ - void contactPresenceChanged( TQString uid, TQCString appId, int presence ); - - public slots: - /** - * @brief Updates the proxy's data after a new application registered - * with DCOP - * - * Checks if the application specified by the given DCOP application - * identifier implements the instant messenger service. - * - * @param appId the DCOP application ID of the newly registered - * application - * - * @see DCOPClient::applicationRegistered() - */ - void registeredToDCOP( const TQCString& appId ); - - /** - * @brief Updates the proxy's data after an application unregistered - * with DCOP - * - * If the application specified by the given DCOP application - * identifier is one of the instant messenger applications of the - * proxy, it will remove the presence information it gathered from it - * earlier on. - * - * Emits sigPresenceInfoExpired() to let the using applcation know - * its presence related information might need updating. - * - * @param appId the DCOP application ID of the now unregistered - * application - * - * @see DCOPClient::applicationRemoved() - */ - void unregisteredFromDCOP( const TQCString& appId ); - signals: - /** - * @brief Indicates that the specified IM-contact's presence changed - * - * @param uid the KABC UID whose presence changed - * - * @see isPresent() - * @see presenceNumeric() - * @see presenceIcon() - * @see KABC::Addressee::uid() - */ - void sigContactPresenceChanged( const TQString &uid ); - - /** - * @brief Indicates that presence information obtained earlier on might - * not be valid any longer - * - * After the sources of presence information have changed so any - * previously supplied presence info is invalid. - */ - void sigPresenceInfoExpired(); - protected: - /** - * Bootstrap our presence data for a newly registered app - */ - void pollApp( const TQCString & appId ); - /** - * Bootstrap our presence data by polling all known apps - */ - void pollAll( const TQString &uid ); - - /** - * Update our records with the given data - */ - bool updatePresence( const TQString &uid, const TQCString &appId, int presence ); - - /** - * Get the name of the user's IM application of choice - */ - TQString preferredApp(); - - /** - * Get the app stub best able to reach this uid - */ - KIMIface_stub * stubForUid( const TQString &uid ); - - /** - * Get the app stub for this protocol. - * Take the preferred app first, then any other. - */ - KIMIface_stub * stubForProtocol( const TQString &protocol ); - - private: - // client stubs used to get presence - // appId (from DCOP) -> KIMIface_stub - TQDict m_im_client_stubs; - // map containing numeric presence and the originating application ID for each KABC uid we know of - // KABC Uid -> (appId, numeric presence )(AppPresence) - PresenceMap m_presence_map; - // cache of the client strings in use by each application - // dictionary of KIMIface_stub -> map of numeric presence -> string presence - // FIXME: remove for KDE4 - UNUSED but maintained for binary compatibility in KDE 3.4 - TQPtrDict m_client_presence_strings; - Private * d; - bool m_apps_available; - bool m_initialized; - /** - * Construct an instance of the proxy library. - */ - KIMProxy( DCOPClient * client); - static KIMProxy * s_instance; -}; - -#endif - diff --git a/interfaces/kimproxy/library/kimproxyiface.h b/interfaces/kimproxy/library/kimproxyiface.h deleted file mode 100644 index fa11183c9..000000000 --- a/interfaces/kimproxy/library/kimproxyiface.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - kimproxyiface.cpp - - IM service library for KDE - - DCOP interface to allow us to receive DCOP signals - - Copyright (c) 2004 Will Stephenson - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KIMPROXYIFACE_H -#define KIMPROXYIFACE_H - -#include - -class KIMProxyIface : virtual public DCOPObject -{ - K_DCOP - k_dcop: - virtual void contactPresenceChanged( TQString uid, TQCString appId, int presence ) = 0; -}; - -#endif diff --git a/interfaces/kmediaplayer/CMakeLists.txt b/interfaces/kmediaplayer/CMakeLists.txt deleted file mode 100644 index 98346388c..000000000 --- a/interfaces/kmediaplayer/CMakeLists.txt +++ /dev/null @@ -1,60 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -if( ARTS_FOUND ) - add_subdirectory( kfileaudiopreview ) -endif( ARTS_FOUND ) - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/interfaces - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - player.h playerdcopobject.h view.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kmediaplayer ) - - -##### other data ################################ - -install( FILES - kmediaplayerengine.desktop kmediaplayer.desktop - DESTINATION ${SERVICETYPES_INSTALL_DIR} ) - - -##### kmediaplayer ############################## - -set( target kmediaplayer ) - -set( ${target}_SRCS - player.cpp view.cpp playerdcopobject.skel -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 0.0.0 - LINK kparts-shared - DESTINATION ${LIB_INSTALL_DIR} - DEPENDENCIES dcopidl -) diff --git a/interfaces/kmediaplayer/Makefile.am b/interfaces/kmediaplayer/Makefile.am deleted file mode 100644 index 5b26d844e..000000000 --- a/interfaces/kmediaplayer/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -if include_ARTS -kfileaudiopreview_subdir = kfileaudiopreview -endif - -SUBDIRS = . $(kfileaudiopreview_subdir) -INCLUDES = -I$(srcdir)/.. $(all_includes) - -lib_LTLIBRARIES = libkmediaplayer.la - -libkmediaplayer_la_SOURCES = player.cpp playerdcopobject.skel view.cpp -libkmediaplayer_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined -libkmediaplayer_la_LIBADD = $(LIB_KPARTS) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) -libkmediaplayer_la_METASOURCES = AUTO - -kmediaplayerinclude_HEADERS = player.h playerdcopobject.h view.h -kmediaplayerincludedir = $(includedir)/kmediaplayer - -kde_servicetypes_DATA = kmediaplayerengine.desktop kmediaplayer.desktop diff --git a/interfaces/kmediaplayer/kfileaudiopreview/CMakeLists.txt b/interfaces/kmediaplayer/kfileaudiopreview/CMakeLists.txt deleted file mode 100644 index 03237da87..000000000 --- a/interfaces/kmediaplayer/kfileaudiopreview/CMakeLists.txt +++ /dev/null @@ -1,46 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${ARTS_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/interfaces - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kio/kfile - ${CMAKE_SOURCE_DIR}/arts/kde -) - -link_directories( - ${TQT_LIBRARY_DIRS} - ${ARTS_LIBRARY_DIRS} -) - - -##### kfileaudiopreview ######################### - -set( target kfileaudiopreview ) - -set( ${target}_SRCS - kfileaudiopreview.cpp -) - -tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK kmediaplayer-shared artskde-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am b/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am deleted file mode 100644 index e4232cd78..000000000 --- a/interfaces/kmediaplayer/kfileaudiopreview/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDES = -I$(top_srcdir)/interfaces/ -I$(top_srcdir)/arts/kde -I$(includedir)/arts $(all_includes) -METASOURCES = AUTO - -kde_module_LTLIBRARIES = kfileaudiopreview.la - -kfileaudiopreview_la_SOURCES = kfileaudiopreview.cpp -kfileaudiopreview_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined -kfileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/kmediaplayer/libkmediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) - -noinst_HEADERS = kfileaudiopreview.h - -messages: - $(XGETTEXT) $(kfileaudiopreview_la_SOURCES) -o $(podir)/kfileaudiopreview.pot diff --git a/interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.cpp b/interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.cpp deleted file mode 100644 index 2998af9f5..000000000 --- a/interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include "kfileaudiopreview.h" - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -class KFileAudioPreviewFactory : public KLibFactory -{ -protected: - virtual TQObject *createObject( TQObject *parent, const char *name, - const char *className, const TQStringList & args) - { - Q_UNUSED(className); - Q_UNUSED(args); - return TQT_TQOBJECT(new KFileAudioPreview( dynamic_cast( parent ), name )); - } -}; - -K_EXPORT_COMPONENT_FACTORY( kfileaudiopreview, KFileAudioPreviewFactory ) - - -/////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// - - -class KFileAudioPreview::KFileAudioPreviewPrivate -{ -public: - KFileAudioPreviewPrivate( TQWidget *parent ) - { - player = KParts::ComponentFactory::createInstanceFromQuery( "KMediaPlayer/Player", TQString(), TQT_TQOBJECT(parent) ); - } - - ~KFileAudioPreviewPrivate() - { - delete player; - } - - KMediaPlayer::Player *player; -}; - - -KFileAudioPreview::KFileAudioPreview( TQWidget *parent, const char *name ) - : KPreviewWidgetBase( parent, name ) -{ - TDEGlobal::locale()->insertCatalogue("kfileaudiopreview"); - - TQStringList formats = KDE::PlayObjectFactory::mimeTypes(); - // ### - TQStringList::ConstIterator it = formats.begin(); - for ( ; it != formats.end(); ++it ) - m_supportedFormats.insert( *it, (void*) 1 ); - - TQVGroupBox *box = new TQVGroupBox( i18n("Media Player"), this ); - TQVBoxLayout *layout = new TQVBoxLayout( this ); - layout->addWidget( box ); - - (void) new TQWidget( box ); // spacer - - d = new KFileAudioPreviewPrivate( 0L ); // not box -- being reparented anyway - if ( d->player ) // only if there actually is a component... - { - setSupportedMimeTypes( formats ); - KMediaPlayer::View *view = d->player->view(); - view->setEnabled( false ); - - // if we have access to the video widget, show it above the player - // So, reparent first the video widget, then the view. - if ( view->videoWidget() ) - { - TQHBox *frame = new TQHBox( box ); - frame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - frame->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); - view->videoWidget()->reparent( frame, TQPoint(0,0) ); - } - - view->reparent( box, TQPoint(0,0) ); - } - - m_autoPlay = new TQCheckBox( i18n("Play &automatically"), box ); - TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); - m_autoPlay->setChecked( config.readBoolEntry( "Autoplay sounds", true ) ); - connect( m_autoPlay, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleAuto(bool)) ); -} - -KFileAudioPreview::~KFileAudioPreview() -{ - TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); - config.writeEntry( "Autoplay sounds", m_autoPlay->isChecked() ); - - delete d; -} - -void KFileAudioPreview::showPreview( const KURL &url ) -{ - if ( !d->player || !url.isValid() ) - return; - - KMimeType::Ptr mt = KMimeType::findByURL( url ); - bool supported = m_supportedFormats.find( mt->name() ); - d->player->view()->setEnabled( supported ); - if ( !supported ) - return; - - static_cast(d->player)->openURL( url ); - if ( m_autoPlay->isChecked() ) - d->player->play(); -} - -void KFileAudioPreview::clearPreview() -{ - if ( d->player ) - { - d->player->stop(); - d->player->closeURL(); - } -} - -void KFileAudioPreview::toggleAuto( bool on ) -{ - if ( !d->player ) - return; - - if ( on && m_currentURL.isValid() && d->player->view()->isEnabled() ) - d->player->play(); - else - d->player->stop(); -} - -void KFileAudioPreview::virtual_hook( int, void* ) -{} - -#include "kfileaudiopreview.moc" diff --git a/interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.h b/interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.h deleted file mode 100644 index de48e4712..000000000 --- a/interfaces/kmediaplayer/kfileaudiopreview/kfileaudiopreview.h +++ /dev/null @@ -1,64 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2003 Carsten Pfeiffer - - library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation, version 2. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KFILEAUDIOPREVIEW_H -#define KFILEAUDIOPREVIEW_H - -#include - -#include -#include - -class TQCheckBox; -class TQPushButton; -class TQLabel; - -class KFileDialog; -class KFileItem; - -/** - * Audio "preview" widget for the file dialog. - */ -class KFileAudioPreview : public KPreviewWidgetBase -{ - Q_OBJECT - -public: - KFileAudioPreview(TQWidget *parent = 0, const char *name = 0 ); - ~KFileAudioPreview(); - -public slots: - virtual void showPreview(const KURL &url); - virtual void clearPreview(); - -private slots: - void toggleAuto(bool); - -private: - TQDict m_supportedFormats; - KURL m_currentURL; - TQCheckBox *m_autoPlay; - -protected: - virtual void virtual_hook( int id, void* data ); -private: - class KFileAudioPreviewPrivate; - KFileAudioPreviewPrivate *d; -}; - -#endif // KFILEAUDIOPREVIEW_H diff --git a/interfaces/kmediaplayer/kmediaplayer.desktop b/interfaces/kmediaplayer/kmediaplayer.desktop deleted file mode 100644 index 85c1df65b..000000000 --- a/interfaces/kmediaplayer/kmediaplayer.desktop +++ /dev/null @@ -1,4 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=KMediaPlayer/Player -X-TDE-Derived=KParts/ReadOnlyPart diff --git a/interfaces/kmediaplayer/kmediaplayerengine.desktop b/interfaces/kmediaplayer/kmediaplayerengine.desktop deleted file mode 100644 index ba7bf0403..000000000 --- a/interfaces/kmediaplayer/kmediaplayerengine.desktop +++ /dev/null @@ -1,3 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=KMediaPlayer/Engine diff --git a/interfaces/kmediaplayer/player.cpp b/interfaces/kmediaplayer/player.cpp deleted file mode 100644 index 681459731..000000000 --- a/interfaces/kmediaplayer/player.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2002 Neil Stevens -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Except as contained in this notice, the name(s) of the author(s) shall not be -// used in advertising or otherwise to promote the sale, use or other dealings -// in this Software without prior written authorization from the author(s). - -#include - -KMediaPlayer::PlayerDCOPObject::PlayerDCOPObject(void) - : DCOPObject("KMediaPlayer") -{ -} - -KMediaPlayer::Player::Player(TQWidget *, const char *, TQObject *parent, const char *name) - : KParts::ReadOnlyPart(parent, name) - , currentLooping(false) - , currentState(Empty) - , d(0) -{ -} - -KMediaPlayer::Player::Player(TQObject *parent, const char *name) - : KParts::ReadOnlyPart(parent, name) - , currentLooping(false) - , currentState(Empty) - , d(0) -{ -} - -KMediaPlayer::Player::~Player(void) -{ -} - -void KMediaPlayer::Player::setLooping(bool b) -{ - if(b != currentLooping) - { - currentLooping = b; - emit loopingChanged(b); - } -} - -bool KMediaPlayer::Player::isLooping(void) const -{ - return currentLooping; -} - -void KMediaPlayer::Player::setState(int s) -{ - if(s != currentState) - { - currentState = (State)s; - emit stateChanged(s); - } -} - -int KMediaPlayer::Player::state(void) const -{ - return (int)currentState; -} - -#include "player.moc" diff --git a/interfaces/kmediaplayer/player.h b/interfaces/kmediaplayer/player.h deleted file mode 100644 index 10e9f4a74..000000000 --- a/interfaces/kmediaplayer/player.h +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (C) 2002 Neil Stevens -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Except as contained in this notice, the name(s) of the author(s) shall not be -// used in advertising or otherwise to promote the sale, use or other dealings -// in this Software without prior written authorization from the author(s). - -#ifndef KMEDIAPLAYERPLAYER_H -#define KMEDIAPLAYERPLAYER_H - -#include -#include -#include - -/** KMediaPlayer contains an interface to reusable media player components. -*/ -namespace KMediaPlayer -{ - -/** Player is the center of the KMediaPlayer interface. It provides all of - * the necessary media player operations, and optionally provides the GUI to - * control them. - * - * There are two servicetypes for Player: KMediaPlayer/Player and - * KMediaPlayer/Engine. KMediaPlayer/Player provides a widget (accessable - * through view as well as XML GUI KActions. KMediaPlayer/Engine omits - * the user interface facets, for those who wish to provide their own - * interface. - */ -class KDE_EXPORT Player : public KParts::ReadOnlyPart, public PlayerDCOPObject -{ -Q_OBJECT - -public: - /** This constructor is what to use when no GUI is required, as in the - * case of a KMediaPlayer/Engine. - */ - Player(TQObject *parent, const char *name); - - /** This constructor is what to use when a GUI is required, as in the - * case of a KMediaPlayer/Player. - */ - Player(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name); - - virtual ~Player(void); - - /** A convenience function returning a pointer to the View for this - * Player, or 0 if this Player has no GUI. - */ - virtual View *view(void) = 0; - -public slots: - /** Pause playback of the media track.*/ - virtual void pause(void) = 0; - - /** Begin playing the media track.*/ - virtual void play(void) = 0; - - /** Stop playback of the media track and return to the beginning.*/ - virtual void stop(void) = 0; - - /** Move the current playback position to the specified time in - * milliseconds, if the track is seekable. Some streams may not be - * seeked. - */ - virtual void seek(unsigned long msec) = 0; -public: - /** Returns whether the current track honors seek requests.*/ - virtual bool isSeekable(void) const = 0; - - /** Returns the current playback position in the track.*/ - virtual unsigned long position(void) const = 0; - - /** Returns whether the current track has a length. Some streams are - * endless, and do not have one. */ - virtual bool hasLength(void) const = 0; - - /** Returns the length of the current track.*/ - virtual unsigned long length(void) const = 0; - -public slots: - /** Set whether the Player should continue playing at the beginning of - * the track when the end of the track is reached. - */ - void setLooping(bool); -public: - /** Return the current looping state. */ - bool isLooping(void) const; -signals: - /** Emitted when the looping state is changed. */ - void loopingChanged(bool); - -public: - /** The possible states of the Player */ - enum State - { - /** No track is loaded. */ - Empty, - /** Not playing. */ - Stop, - /** Playing is temporarily suspended. */ - Pause, - /** The media is currently being output. */ - Play - }; - /** Return the current state of the player. */ - int state(void) const; -signals: - /** Emitted when the state changes. */ - void stateChanged(int); - -protected slots: - /** Implementers use this to control what users see as the current - * state.*/ - void setState(int); - -private: - bool currentLooping; - State currentState; - - struct Data; - Data *d; -}; - -} - -#endif diff --git a/interfaces/kmediaplayer/playerdcopobject.h b/interfaces/kmediaplayer/playerdcopobject.h deleted file mode 100644 index 73a1cfa1d..000000000 --- a/interfaces/kmediaplayer/playerdcopobject.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2002 Neil Stevens -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Except as contained in this notice, the name(s) of the author(s) shall not be -// used in advertising or otherwise to promote the sale, use or other dealings -// in this Software without prior written authorization from the author(s). - -#ifndef KMEDIAPLAYERPLAYERDCOPOBJECT_H -#define KMEDIAPLAYERPLAYERDCOPOBJECT_H - -#include -#include - -namespace KMediaPlayer -{ - -class KDE_EXPORT PlayerDCOPObject : public DCOPObject -{ -K_DCOP - -public: - PlayerDCOPObject(void); - -k_dcop: - virtual bool openURL(const KURL &file) = 0; - virtual void pause() = 0; - virtual void play() = 0; - virtual void stop() = 0; - - virtual void seek(unsigned long msec) = 0; - virtual bool isSeekable() const = 0; - virtual unsigned long position() const = 0; - - virtual bool hasLength() const = 0; - virtual unsigned long length() const = 0; - - virtual void setLooping(bool) = 0; - virtual bool isLooping() const = 0; - - virtual int state() const = 0; - virtual void setState(int) = 0; -}; - -} - -#endif diff --git a/interfaces/kmediaplayer/view.cpp b/interfaces/kmediaplayer/view.cpp deleted file mode 100644 index 64e3bf484..000000000 --- a/interfaces/kmediaplayer/view.cpp +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (C) 2002 Neil Stevens -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Except as contained in this notice, the name(s) of the author(s) shall not be -// used in advertising or otherwise to promote the sale, use or other dealings -// in this Software without prior written authorization from the author(s). - -#include - -struct KMediaPlayer::View::Data -{ - Data() : videoWidget(0L) {} - - TQWidget *videoWidget; -}; - -KMediaPlayer::View::View(TQWidget *parent, const char *name) - : TQWidget(parent, name) - , currentButtons((int)All) - , d(new Data()) -{ -} - -KMediaPlayer::View::~View(void) -{ - delete d; -} - -int KMediaPlayer::View::buttons(void) -{ - return currentButtons; -} - -void KMediaPlayer::View::setButtons(int buttons) -{ - if(buttons != currentButtons) - { - currentButtons = buttons; - emit buttonsChanged(buttons); - } -} - -bool KMediaPlayer::View::button(int b) -{ - return currentButtons & b; -} - -void KMediaPlayer::View::showButton(int b) -{ - setButtons(currentButtons | b); -} - -void KMediaPlayer::View::hideButton(int b) -{ - setButtons(currentButtons & ~b); -} - -void KMediaPlayer::View::toggleButton(int b) -{ - setButtons(currentButtons ^ b); -} - -void KMediaPlayer::View::setVideoWidget(TQWidget *videoWidget) -{ - d->videoWidget = videoWidget; -} - -TQWidget* KMediaPlayer::View::videoWidget() -{ - return d->videoWidget; -} - -#include "view.moc" diff --git a/interfaces/kmediaplayer/view.h b/interfaces/kmediaplayer/view.h deleted file mode 100644 index c1d9dbe41..000000000 --- a/interfaces/kmediaplayer/view.h +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (C) 2002 Neil Stevens -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Except as contained in this notice, the name(s) of the author(s) shall not be -// used in advertising or otherwise to promote the sale, use or other dealings -// in this Software without prior written authorization from the author(s). - -#ifndef KMEDIAPLAYERVIEW_H -#define KMEDIAPLAYERVIEW_H - -#include -#include - -namespace KMediaPlayer -{ - -/** View is part of the user interface of a Player. */ -class KDE_EXPORT View : public TQWidget -{ -Q_OBJECT - -public: - /** Your typical TQWidget constructor. */ - View(TQWidget *parent, const char *name); - virtual ~View(void); - - /** The Possible buttons that can appear in the UI. */ - enum Button - { - /** Button that connects to Player::play */ - Play = 1, - /** Button that connects to Player::stop */ - Stop = 2, - /** Button that connects to Player::pause */ - Pause = 4, - /** A seeker that interfaces with Player::seek */ - Seeker = 8, - /** Show all buttons. */ - All = 255 - }; - - /** Return which buttons are being displayed. */ - int buttons(void); - - /** Return the TQWidget in which video is displayed. - May Return 0L if there is none. */ - TQWidget *videoWidget(); - -public slots: - /** Set which buttons to display. See Button. */ - void setButtons(int); - - /** Returns if a particular button is being displayed. */ - bool button(int); - /** Display a particular button. */ - void showButton(int); - /** Stop displaying a particular button. */ - void hideButton(int); - /** Toggle the display of a particular button. */ - void toggleButton(int); - -signals: - /** Emitted when the set of displayed buttons changes. */ - void buttonsChanged(int); - -protected: - /** The implementing view should set the widget in which - the video will be displayed. KMediaPlayer users may - reparent() it to somewhere else, for example. - */ - void setVideoWidget(TQWidget *videoWidget); - -private: - int currentButtons; - - struct Data; - Data *d; -}; - -} - -#endif diff --git a/interfaces/kscript/CMakeLists.txt b/interfaces/kscript/CMakeLists.txt deleted file mode 100644 index 233dc1c49..000000000 --- a/interfaces/kscript/CMakeLists.txt +++ /dev/null @@ -1,56 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( sample ) - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - scriptinterface.h scriptclientinterface.h scriptmanager.h - DESTINATION ${INCLUDE_INSTALL_DIR} ) - - -##### other data ################################ - -install( FILES scriptinterface.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) - - -##### kscript ################################### - -set( target kscript ) - -set( ${target}_SRCS - scriptmanager.cpp -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 0.0.0 - LINK kio-shared - DESTINATION ${LIB_INSTALL_DIR} -) diff --git a/interfaces/kscript/Makefile.am b/interfaces/kscript/Makefile.am deleted file mode 100644 index ede5f4fa0..000000000 --- a/interfaces/kscript/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -SUBDIRS = . sample - -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(srcdir) -I$(srcdir)/.. $(all_includes) - -#lib_LTLIBRARIES = libkscriptloader.la libkscript.la -lib_LTLIBRARIES = libkscript.la -#libkscriptloader_la_SOURCES = scriptloader.cpp -#libkscriptloader_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -#libkscriptloader_la_LIBADD = $(LIB_KPARTS) - -libkscript_la_SOURCES = scriptmanager.cpp -libkscript_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined -libkscript_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) - -kscriptinclude_HEADERS = scriptinterface.h scriptclientinterface.h scriptmanager.h -kscriptincludedir = $(includedir) - -METASOURCES = AUTO - -servicetypedir = $(kde_servicetypesdir) -servicetype_DATA = scriptinterface.desktop diff --git a/interfaces/kscript/README b/interfaces/kscript/README deleted file mode 100644 index 213a0c277..000000000 --- a/interfaces/kscript/README +++ /dev/null @@ -1,14 +0,0 @@ -Script interface ----------------- -Overview: -scriptloader - used to load script engines and scripts from the GUI -scriptinterface - the base of all script engines - -Script Engines: - -TODO - -Script Loader: - -TODO - diff --git a/interfaces/kscript/sample/CMakeLists.txt b/interfaces/kscript/sample/CMakeLists.txt deleted file mode 100644 index cdb2505e9..000000000 --- a/interfaces/kscript/sample/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/interfaces/kscript - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES shellscript.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) - - -##### libshellscript ############################ - -set( target libshellscript ) - -set( ${target}_SRCS - shellscript.cpp -) - -tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK kscript-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/interfaces/kscript/sample/Makefile.am b/interfaces/kscript/sample/Makefile.am deleted file mode 100644 index 5dae5193f..000000000 --- a/interfaces/kscript/sample/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir)/interfaces -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/interfaces/kscript $(all_includes) - -kde_module_LTLIBRARIES = libshellscript.la - -libshellscript_la_SOURCES = shellscript.cpp -libshellscript_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -no-undefined -avoid-version -libshellscript_la_LIBADD = ../libkscript.la $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la - - -METASOURCES = AUTO - -servicetypedir = $(kde_servicesdir) -servicetype_DATA = shellscript.desktop diff --git a/interfaces/kscript/sample/shellscript.cpp b/interfaces/kscript/sample/shellscript.cpp deleted file mode 100644 index 9ec34f7a2..000000000 --- a/interfaces/kscript/sample/shellscript.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "shellscript.h" -#include -#include -#include - -#include -#include -//using namespace KScriptInterface; -typedef KGenericFactory ShellScriptFactory; -K_EXPORT_COMPONENT_FACTORY( libshellscript, ShellScriptFactory( "ShellScript" ) ) - -ShellScript::ShellScript(KScriptClientInterface *parent, const char *, const TQStringList & ) : ScriptClientInterface(parent) -{ - m_script = new TDEProcess(); - connect ( m_script, TQT_SIGNAL(processExited(TDEProcess *)), TQT_SLOT(Exit(TDEProcess *))); - connect ( m_script, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)), TQT_SLOT(stdOut(TDEProcess *, char *, int ))); - connect ( m_script, TQT_SIGNAL(receivedStderr(TDEProcess *, char *, int)), TQT_SLOT(stdErr(TDEProcess *, char *, int ))); - // Connect feedback signals and slots - //kdDebug() << "Building new script engine" << endl; -} - -ShellScript::~ShellScript() -{ -} - -TQString ShellScript::script() const -{ - return m_scriptName; -} - -void ShellScript::setScript( const TQString &scriptFile ) -{ - m_scriptName = scriptFile; - *m_script << "sh" << m_scriptName << kapp->dcopClient()->appId(); -} - -void ShellScript::setScript( const TQString &, const TQString & ) -{ - // ### what is this? -} - -void ShellScript::run(TQObject *, const TQVariant &) -{ - m_script->start(TDEProcess::NotifyOnExit,TDEProcess::All); -} -void ShellScript::kill() -{ - if (!m_script->kill()) // Kill the process - m_script->kill(9); // Kill it harder -} - -void ShellScript::Exit(TDEProcess *proc) -{ - ScriptClientInterface->done((KScriptClientInterface::Result)proc->exitStatus(), ""); -} - -void ShellScript::stdErr(TDEProcess *, char *buffer, int) -{ - ScriptClientInterface->error(buffer); -} -void ShellScript::stdOut(TDEProcess *, char *buffer, int) -{ - ScriptClientInterface->output(buffer); -} - -#include "shellscript.moc" diff --git a/interfaces/kscript/sample/shellscript.desktop b/interfaces/kscript/sample/shellscript.desktop deleted file mode 100644 index e65713a3b..000000000 --- a/interfaces/kscript/sample/shellscript.desktop +++ /dev/null @@ -1,153 +0,0 @@ -[Desktop Entry] -Name=Bash Shell Script Runner -Name[af]=Bash Tolk Skrip Hardloper -Name[az]=Bash Qabıq Skripti İcraçısı -Name[be]=Выкананне сцэнараў абалонкі bash -Name[bn]=ব্যাশ শেল স্ক্রিপ্ট চালক -Name[bs]=Izvršavanje Bash shell skripti -Name[ca]=Processa script bash a l'intèrpret de comandaments -Name[cs]=Spouštěč skriptů pro BASH -Name[csb]=Programa zrëszôjącô skriptë Bash -Name[cy]=Rhedydd Sgript Plisgyn Bash -Name[da]=Bash Skal-script-udførsel -Name[de]=Ausführung von Bash-Skripten -Name[el]=Εκτελεστής σεναρίων κελύφους Bash -Name[eo]=Baŝoskriptlanĉilo -Name[es]=Ejecutor de script para intérprete de órdenes de bash -Name[et]=Bash shelli skripti käivitaja -Name[eu]=Bash shell script-aren abiarazlea -Name[fa]=اجراکنندۀ دست‌نوشتۀ پوستۀ bash -Name[fi]=Komentotulkkiohjelmien käynnistäjä -Name[fr]=Lanceur de scripts shell Bash -Name[fy]=Bash Flues Skript Rinner -Name[ga]=Reathaí Script Bhlaoisce bash -Name[gl]=Guión Executábel da Shell Bash -Name[he]=הרצת תסריט מעטפת של Bash -Name[hi]=बैश शेल स्क्रिप्ट चालक -Name[hr]=Pokretač Bash skripti ljuske -Name[hu]=Bash parancsfájl futtatása -Name[is]=Keyrsluforrit bash skeljaforrita -Name[it]=Esecutore script bash -Name[ja]=Bash シェルスクリプト 実行 -Name[ka]=bash სკრიპტების შესრულება -Name[kk]=Bash қоршау-ортаның скриптерін орындау -Name[km]=កម្មវិធី​រត់​ស្គ្រីប​សែល Bash -Name[ko]=배쉬 쉘 스크립트 실행기 -Name[lb]=Ausféierer fir Bash-Kommandozeil-Skripter -Name[lt]=Bash apvalkalo scenarijų paleidėjas -Name[lv]=Bash čaulas skriptu darbinātājs -Name[mk]=Стартувач на скрипти за школката Bash -Name[mn]=Bash-Shell-Скрипт ажиллуулагч -Name[ms]=Pelaksana Skrip Cengkerang Bash -Name[nb]=Bash skallskriptkjører -Name[nds]=Bashskript-Starter -Name[ne]=बाश शेल स्क्रिप्ट सञ्चालक -Name[nn]=Bash-skalskriptkøyrar -Name[pa]=ਬੈਸ਼ ਸ਼ੈਲ ਸਕ੍ਰਿਪਟ ਰਨਰ(Bash Shell) -Name[pl]=Program uruchamiający skrypty Bash -Name[pt]=Execução de Programa da 'Shell' BASH -Name[pt_BR]=Executor de Script Shell do Bash -Name[ro]=Executor scripturi de interpretor -Name[ru]=Запуск скриптов bash -Name[rw]=Mutangiza Gaporogaramu Bash Shell -Name[se]=Skálžu-skriptavuodji -Name[sk]=Spustenie Bash shell skriptu -Name[sl]=Zaganjalnik lupinski skriptov -Name[sq]=Egzekutuesi i skriptave të Guacës Bash -Name[sr]=Извршавач скрипти Bash шкољке -Name[sr@Latn]=Izvršavač skripti Bash školjke -Name[sv]=Kör Bash-skalskript -Name[ta]=பேஷ் ஓட்டு எழுத்தாக்க இயக்கி -Name[te]=బేష్ షెల్ స్క్రిప్ట్లను నిర్వర్తించెది -Name[tg]=Иҷрокунандаи Bash Shell -Name[th]=ตัวสั่งสคริปต์ของ bash เชลล์ให้ทำงาน -Name[tr]=Kabuk Betiği Çalıştırıcısı -Name[tt]=Qabıqnıñ Bash Ämerlek Cibärgeçe -Name[uk]=Виконувач скриптів командної оболонки (bash) -Name[uz]=Bash shell skriptini ishga tushuruvchi -Name[uz@cyrillic]=Bash шелл скриптини ишга тушурувчи -Name[vi]=Bộ chạy tập lệnh hệ vỏ Bash -Name[wa]=Enondeu di scripes shell bash -Name[zh_CN]=Bash Shell 脚本运行程序 -Name[zh_TW]=Bash Shell Script 執行器 -Type=Service -X-TDE-Library=libshellscript -X-TDE-Script-Runner=ShellScript/bash -ServiceTypes=KScriptRunner/KScriptRunner -Comment=Runs bash shell scripts from inside the application. -Comment[af]=Laai bash tolk skripte vanuit die program. -Comment[ar]=يشغَل bash shell scripts من داخل التطبيق -Comment[az]=Proqramın içindən bash qabıq skriptlərini icra edin -Comment[be]=Выконвае сцэнары абалонкі bash у межах праграмы. -Comment[bg]=Изпълнение на скриптове на bash от друга програма. -Comment[bn]=অ্যাপ্লিকেশনের ভেতরে ব্যাশ শেল স্ক্রিপ্ট (bash shell script) চালায়। -Comment[bs]=Izvršava bash shell skripte iz same aplikacije. -Comment[ca]=Processa scripts bash des de les aplicacions. -Comment[cs]=Spouští BASH skript z aplikace. -Comment[csb]=Zrëszô skriptë Bash bënë aplikacëji. -Comment[cy]=Yn rhedeg sgriptiau plisgyn bash o tu fewn y cymhwysiad. -Comment[da]=Kører bash skal-scripter inde fra programmet. -Comment[de]=Führt Bash-Shell-Skripte innerhalb von Programmen aus -Comment[el]=Εκτελεί σενάρια κελύφους bash μέσα από την εφαρμογή. -Comment[eo]=Enaplikaĵe lanĉas ŝelskriptojn. -Comment[es]=Ejecuta procedimientos del intérprete de órdenes bash desde dentro de la aplicación. -Comment[et]=Käivitab bash shelli skripte rakendustes. -Comment[eu]=Aplikazioaren baitatik bash-eko shell script-ak abiarazteko. -Comment[fa]=دست‌نوشته‌های پوستۀ bash را از درون کاربرد اجرا می‌کند. -Comment[fi]=Suorittaa Bash-komentotulkkiohjelmia ohjelman sisästä -Comment[fr]=Exécute des scripts shell Bash depuis l'intérieur de l'application. -Comment[fy]=Bash flues skript rint yn de applikaasje. -Comment[ga]=Ritheann seo scripteanna blaoisce bash ó thaobh istigh an fheidhmchláir. -Comment[gl]=Executa guións da shell bash desde dentro da aplicación. -Comment[he]=מריץ תסריטי Bash מתוך היישום -Comment[hi]=अनुप्रयोगों के भीतर से ही बैश शेल स्क्रिप्ट चलाता है. -Comment[hr]=Pokretanje bash skripti ljuske iz aplikacije. -Comment[hsb]=Wuwjedźe skripty za bash znutřka aplikacije. -Comment[hu]=Bash parancsfájlok futtatása alkalmazásokból. -Comment[id]=Menjalankan skrip bash dari aplikasi -Comment[is]=Keyrir bash skeljaforrit innan forritsins -Comment[it]=Esegue gli script bash all'interno dell'applicazione. -Comment[ja]=アプリケーション内部からの Bash シェルスクリプトを実行します。 -Comment[ka]=bash სკრიპტების პროგრამებში შესრულება. -Comment[kk]=Қолданбаның ішінен bash скрипттерін орындайды. -Comment[km]=រត់​ស្គ្រីប​សែល bash ពី​ក្នុង​កម្មវិធី ។ -Comment[ko]=응용 프로그램에서 배쉬 쉘 스크립트를 실행합니다. -Comment[lb]=Féiert Skripter fir d'Bash-Kommandozeil aus dem Programm selwer aus. -Comment[lt]=Paleidžia bash apvalkalo scenarijus iš taikomosios programos. -Comment[lv]=Darbina Bash čaulas skriptus iekš programmas. -Comment[mk]=Ги стартува bash shell скриптите од апликацијата. -Comment[mn]=Програм дотроос Bash-Shell-Скрипт ажиллуулах. -Comment[ms]=Laksanakan skrip cengkerang bash di dalam aplikasi. -Comment[nb]=Kjører bash skallskript fra innsiden av programmet. -Comment[nds]=Dor köönt Programmen Bash-Konsoolskripten mit utföhren. -Comment[ne]=अनुप्रयोगको भित्रबाट बाश शेल स्क्रिप्ट सञ्चालन गर्दछ । -Comment[nl]=Voert Bash-shellscripts uit binnen de toepassing. -Comment[nn]=Køyrer Bash-skalskript innanfrå programmet. -Comment[pa]=ਇੱਕ ਕਾਰਜ ਵਿੱਚ ਬੈਸ਼ ਸ਼ੈਲ ਸਕ੍ਰਿਪਟਾਂ ਚਲਾਉਣ ਲਈ ਸਹਾਇਕ ਹੈ -Comment[pl]=Uruchamia skrypty Bash wewnątrz programu. -Comment[pt]=Corre os programas da 'shell' 'bash' dentro das aplicações. -Comment[pt_BR]=Executa shell scripts do bash de dentro do aplicativo -Comment[ro]=Execută scripturi de interpretor "bash" din interiorul unei aplicaţii. -Comment[ru]=Запуск bash-скриптов из приложений. -Comment[rw]=Itangiza inyandikoporogaramu ya sheli bash guhera imberemo ya porogaramu. -Comment[se]=Vuodjá bash-skálzoskriptaid prográmma siskobeales. -Comment[sk]=Spustí bash shell skript z aplikácie. -Comment[sl]=Požene lupinske skripte znotraj programa. -Comment[sq]=I ekzekuton skriptat Guacës Bash përbrenda aplikacionit. -Comment[sr]=Покреће скриптре bash шкољке унутар програма. -Comment[sr@Latn]=Pokreće skriptre bash školjke unutar programa. -Comment[sv]=Kör Bash-skalskript inifrån programmet. -Comment[ta]=பயன்பாட்டில் இருந்து பேஷ் ஓட்டு எழுத்தாக்க இயக்குகிறது -Comment[te]=బేష్ షెల్ స్క్రిప్ట్లను కార్యక్షేత్రం లొపల నుంచి నిర్వర్తించెది -Comment[tg]=Скриптҳои bash shell даруни барномаҳо иҷро мекунад. -Comment[th]=สั่งให้สคริปต์ของ bash เชลล์ทำงานภายในแอพพลิเคชัน -Comment[tr]=Uygulama içinden bash betiği çalıştırır. -Comment[tt]=Yazılım eçennän bash ämerleklär cibärä. -Comment[uk]=Запускає скрипти командної оболонки (bash) з програми. -Comment[uz]=Dasturlarning ichdan bash shell skriptini ishga tushiradi -Comment[uz@cyrillic]=Дастурларнинг ичдан bash шелл скриптини ишга туширади -Comment[vi]=Chạy tập lệnh hệ vỏ bash bên trong ứng dụng. -Comment[wa]=Enonder des scripes shell bash a pårti do programe -Comment[zh_CN]=在应用程序内运行 bash shell 脚本。 -Comment[zh_HK]=於程式內執行 bash shell script 檔案 -Comment[zh_TW]=於程式內執行 bash shell script 檔案 diff --git a/interfaces/kscript/sample/shellscript.h b/interfaces/kscript/sample/shellscript.h deleted file mode 100644 index 2cdaf7e5a..000000000 --- a/interfaces/kscript/sample/shellscript.h +++ /dev/null @@ -1,48 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef __shellscript_h__ -#define __shellscript_h__ - -#include -#include -#include -#include -//using namespace KScriptInterface; -class ShellScript : public KScriptInterface -{ - Q_OBJECT -public: - ShellScript(KScriptClientInterface *parent, const char *name, const TQStringList &args); - virtual ~ShellScript(); - TQString script() const; - void setScript( const TQString &scriptFile ); - void setScript( const TQString &scriptLibFile, const TQString &method ); - void run(TQObject *context = 0, const TQVariant &arg = 0); - void kill(); -private slots: - void Exit(TDEProcess *proc); - void stdErr(TDEProcess *proc, char *buffer, int buflen); - void stdOut(TDEProcess *proc, char *buffer, int buflen); -private: - TDEProcess *m_script; - KScriptClientInterface *ScriptClientInterface; - TQString m_scriptName; -}; - -#endif diff --git a/interfaces/kscript/scriptclientinterface.h b/interfaces/kscript/scriptclientinterface.h deleted file mode 100644 index 0f07d34b2..000000000 --- a/interfaces/kscript/scriptclientinterface.h +++ /dev/null @@ -1,124 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef __scriptclientinterface_h__ -#define __scriptclientinterface_h__ -#include - -class TQString; - -//namespace KScriptInterface -//{ - /** - * This class is used for allowing feedback to the main system. - * @author Ian Reinhart Geiser - * - * To implement KScript in your application you would use this class to interface with the scripting engine. - * There are currently a few implementations of script managers around but developers can implement their own custom - * interfaces with this class. - * @code - * class MyScript : public TQObject, public KScriptClientInterface { - * Q_OBJECT - * public: - * - * MyScript(TQObject *parent) - * { - * // Create your @ref KScriptInterface here. - * m_interface = KParts::ComponentFactory::createInstanceFromQuery( - * "KScriptRunner/KScriptRunner", "([X-TDE-Script-Runner] == 'bash/shell')", this ); - * } - * - * virtual ~KScriptAction() - * { - * delete m_interface; - * } - * - * signals: - * void error ( const TQString &msg ); - * void warning ( const TQString &msg ); - * void output ( const TQString &msg ); - * void progress ( int percent ); - * void done ( KScriptClientInterface::Result result, const TQVariant &returned ); - * - * public slots: - * void activate(const TQVariant &args) - * { - * m_interface->run(parent(), args); - * } - * - * private: - * - * KScriptInterface *m_interface; - * }; - * @endcode - * Things to note about this example are that it only handles a single script type and instance. You may wish to - * extend this. - **/ - - class KScriptClientInterface - { - public: - enum Result { ResultSuccess, ResultFailure, ResultContinue, ResultBreak }; - /** - * This function will allow the main application of any errors - * that have occurred during processing of the script. - * For script clients its best to implement this as a signal so feedback - * can be sent to the main application. - */ - virtual void error( const TQString &msg ) =0; - /** - * This function will allow the main application of any warnings - * that have occurred during the processing of the script. - * For script clients its best to implement this as a signal so feedback - * can be sent to the main application. - */ - virtual void warning( const TQString &msg ) =0; - /** - * This function will allow the main application of any normal - * output that has occurred during the processing of the script. - * For script clients its best to implement this as a signal so feedback - * can be sent to the main application. - */ - virtual void output( const TQString &msg ) =0; - /** - * This function will allow feedback to any progress bars in the main - * application as to how far along the script is. This is very useful when - * a script is processing files or doing some long operation that is of a - * known duration.] - * For script clients its best to implement this as a signal so feedback - * can be sent to the main application. - */ - virtual void progress( int percent ) =0; - /** - * This function will allow feedback on completion of the script. - * It turns the result as a KScriptInteface::Result, and a return - * value as a QVariant - * For script clients its best to implement this as a signal so feedback - * can be sent to the main application. - */ - virtual void done( KScriptClientInterface::Result result, const TQVariant &returned ) =0; - /** - * Returned when the script has finished running. - * For script clients its best to implement this as a signal so feedback - * can be sent to the main application. - **/ - //virtual bool isRunning() =0; - }; -//}; - -#endif diff --git a/interfaces/kscript/scriptinterface.desktop b/interfaces/kscript/scriptinterface.desktop deleted file mode 100644 index 397e650d8..000000000 --- a/interfaces/kscript/scriptinterface.desktop +++ /dev/null @@ -1,89 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=KScriptRunner/KScriptRunner -Comment=This is a generic test script engine for testing the script interface. -Comment[af]=Hierdie is 'n generies toets skrip masjien vir toetsing die skrip koppelvlak. -Comment[ar]=هذه آلة نصوص برمجية اختبارية لاختبار واجهة النص البرمجي. -Comment[az]=Skript ara üzünü sınamaq üçün ümumi sınaq skriptidir. -Comment[be]=Простая сістэма праверкі выканання сцэнараў. -Comment[bg]=Модул за тестване на скриптове. -Comment[bs]=Ovo je opšti engine za testiranje interfejsa skripti. -Comment[ca]=Aquest és un enginy per a provar la interfície de l'script. -Comment[cs]=Toto je obecný testovací skript pro testování skriptovacího rozhranní. -Comment[csb]=Mòduł testowaniô skriptowegò interfejsu. -Comment[cy]=Mae hyn yn beiriant sgript prawf generig i brofi y sgript rhyngwyneb. -Comment[da]=Dette er en generisk testscript-maskine til at teste scriptgrænsefladen. -Comment[de]=Dies ist eine allgemeine Sammlung von Testroutinen für die Skript-Schnittstelle. -Comment[el]=Αυτό είναι μια γενική μηχανή ελέγχου σεναρίων για τον έλεγχο της διασύνδεσης σεναρίων. -Comment[eo]=Tio estas testprogram-maŝino por testi la programinterfaco. -Comment[es]=Este es un motor de script genérico para probar el interfaz de script. -Comment[et]=Üldise skriptimootori testskript liidese testimiseks. -Comment[eu]=Hau script motoreen proba generikoa da script-aren interfazea probatzeko. -Comment[fa]=این یک موتور دست‌نوشتۀ آزمون عمومی برای آزمایش واسط دست‌نوشته می‌باشد. -Comment[fi]=Tämä on yleinen skriptitestimoottori skriptin käyttöliittymän testaamiseen -Comment[fo]=Hetta er ein almen royndarforritsskipan til at nároyna fjølvisforritsmarkamótið. -Comment[fr]=Ceci est un moteur de script de test générique pour expérimenter l'interface de script. -Comment[fy]=Dit is in algemiene samling testroutines foar it testen fan de skript-interface. -Comment[ga]=Is inneall tástála cineálach scripteanna é seo a úsáidtear chun an comhéadan scripte a thástáil. -Comment[gl]=Ésta é unha ferramenta para probar a interface dos guións. -Comment[he]=זהו מנוע תסריטים כללי לבדיקת ממשק התסריטים -Comment[hi]= स्क्रिप्ट इंटरफेस जांचने के लिए यह एक जेनरिक टेस्ट स्क्रिप्ट इंजन है. -Comment[hr]=Ovo je generička ispitna skripta programa za ispitivanje sučelja skripte. -Comment[hsb]=To je program za testowanje skript-interfejsa. -Comment[hu]=Ez egy tesztszkript a szkript-felület kipróbálásához. -Comment[id]=Mesin skrip tes generik untuk menguji antarmuka skrip -Comment[is]=Þetta er almennur þýðandi til að prófa skriftuviðmótið. -Comment[it]=Questo è un motore di script generico per provare l'interfaccia di script. -Comment[ja]=これはスクリプトインターフェースをテストする一般的なテストスクリプトです。 -Comment[ka]=ეს ძრავი სკრიპტების ინტერფეისის შესამოწმებლად გამოიყენება -Comment[kk]=Бұл скрипт интерфейсін сынауға арналған тетік. -Comment[km]=នេះ​ជា0​ម៉ាស៊ីន​ស្គ្រីប​សាកល្បង​ទូទៅ​មួយ ដើម្បី​សាកល្បង​ចំណុច​ប្រទាក់​ស្គ្រីប ។ -Comment[ko]=스크립트 인터페이스를 시험하는데 쓰이는 일반 시험 스크립트 엔진입니다. -Comment[lb]=Dësst ass eng allgemeng Test-Skript-Engine fir de Skript-Interface ze testen. -Comment[lt]=Tai yra bendras testavimo scenarijų variklis skirtas scenarijų sąsajos testavimui. -Comment[lv]=Šis ir vispārējs skriptu testa dzinējs skriptu saskarsmes virsmas testēšanai. -Comment[mk]=Ова е општа тест-скрипта за тестирање на скриптниот интерфејс -Comment[mn]=Энэ бол скриптын харьцах хэсгийн (interface) тестчилэлийн хувьд дахь ерөнхий тестийн горимын цуглуулга. -Comment[ms]=Ini ialah enjin skrip uji generik untuk mencuba antaramuka skrip. -Comment[mt]=Magna ġenerika biex tittestja l-interfaċċja tal-iskritti -Comment[nb]=Dette er et generisk testskript for å teste skriptgrensesnitt. -Comment[nds]=Dit is en allgemeen Koppel vun Testskripten för dat Pröven vun de Skript-Koppelsteed. -Comment[ne]=स्क्रिप्ट इन्टरफेस परीक्षणका लागि यो एउटा जेनेरिक परीक्षण स्क्रिप्ट हो । -Comment[nl]= Dit is een algemene verzameling van testroutines voor het testen dan de script-interface. -Comment[nn]=Dette er ein generell testskriptmotor for å prøva ut skriptgrensesnittet. -Comment[nso]=Ye ke engine ya thswaelo ya teko ya kakaretso yeo e somiswago go leka sefahlego sa tshwaelo. -Comment[pa]=ਇਹ ਇੱਕ ਸਕ੍ਰਿਪਟ ਇੰਟਰਫੇਸ ਨੂੰ ਜਾਂਚਣ ਲਈ ਇੱਕ ਸਧਾਰਨ ਜਾਂਚ ਇੰਜਣ ਹੈ। -Comment[pl]=Moduł do testowania interfejsu skryptowego. -Comment[pt]=Este é um motor de 'scripts' de teste para testar a interface de 'scripting'. -Comment[pt_BR]=Este é um mecanismo de teste genérico para testar a interface de script. -Comment[ro]=Acesta este un script de test generic pentru testarea interfeţei de scriptare. -Comment[ru]=Этот движок предназначен для тестирования интерфейса скриптов. -Comment[rw]=Iyi ni imashini rusange y'inyandikoporogaramu y'igerageza ikoreshwa mu kugerageza imigaragarire y'inyandikoporogaramu. -Comment[se]=Dát lea oppalaš geahččalanskriptamohtor testendihte skriptalavtta -Comment[sk]=Toto je generický testovací skript pre testovanie skriptovacieho rozhrania. -Comment[sl]=To je generični poskusni skriptni pogon za preizkušanje skriptnega vmesnika. -Comment[sr]=Ово је генерички програм за тестирање интерфејса скрипти. -Comment[sr@Latn]=Ovo je generički program za testiranje interfejsa skripti. -Comment[ss]=Lena yinjini yelibhuku leluhlolo lolubanti lekuhlola sichumanisi selibhuku. -Comment[sv]=Det här är ett generellt skripttestprogram för att testa skriptgränssnittet -Comment[ta]=எழுத்தாக்க இடைமுகத்தைச் சோதிக்க உதவும் ஒரு பொதுவான சோதனை இயந்திரம். -Comment[te]=ఇది స్క్రిప్ట్ ఇంటర్ఫెస్లను పరీక్షించెందుకు వాడె సాధరణ పరీక్షా స్క్రిప్ట్ ఇంజను -Comment[tg]=Ин ҷрокунандаи скрипт интерфейси скрипт тафтиш мекунад. -Comment[th]=นี่เป็นกลไกทดสอบสคริปต์ทั่วไป สำหรับทดสอบส่วนติดต่อสคริปต์ -Comment[tr]=Bu betik arayüzünü test etmek için bir genel test betik motorudur. -Comment[tt]=Ämeklek yözarasın tikşerü öçen sınaw qoralı bu. -Comment[uk]=Це - загальний рушій тестових скриптів для перевірки інтерфейсу скрипту. -Comment[uz]=Skriptning interfeysini tekshirish uchun umumiy sinov skript boshqaruvchisi -Comment[uz@cyrillic]=Скриптнинг интерфейсини текшириш учун умумий синов скрипт бошқарувчиси -Comment[ven]=Heyi ndi inzhini ya bammbiri la mulingo lau linga vhuvha ha bammbiri. -Comment[vi]=Đây là cơ chế tập lệnh thử ra giống loài để thử ra giao diện tập lệnh. -Comment[wa]=Çouchal est on programe di saye po vey kimint rote l' eterface di scripes. -Comment[xh]=Olu luvavanyo luka wonke-wonke lwenjini yokushicilelweyo yokuvavanya ujongano loshicilelo. -Comment[zh_CN]=这是一个用于测试脚本接口的通用脚本测试引擎。 -Comment[zh_HK]=這是用來測試手稿介面用的一般性測試手稿引擎 -Comment[zh_TW]=這是用來測試手稿介面用的一般性測試手稿引擎 -Comment[zu]=Lena yinjini yesikripti sokuvivinya sawonke wonke yokuvivinya isikripti somxhumanisi. - -[PropertyDef::X-TDE-Script-Runner] -Type=TQString - diff --git a/interfaces/kscript/scriptinterface.h b/interfaces/kscript/scriptinterface.h deleted file mode 100644 index 1c37b7f71..000000000 --- a/interfaces/kscript/scriptinterface.h +++ /dev/null @@ -1,88 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -/** -* \section Generic interface for building scripting engines -* -* This interface will create a generic API for implementing script engines. -* These engines can then be accessed from any application that supports this interface. -* -* -**/ -#ifndef __scriptinterface_h__ -#define __scriptinterface_h__ -#include -#include -#include - -//#include -class TQString; -class TQObject; -class KScriptClientInterface; - - -//namespace KScriptInterface -//{ - /** - * This class is the base for all script engines. - * @author Ian Reinhart Geiser - * - **/ - class KDE_EXPORT KScriptInterface : public TQObject - { - Q_OBJECT - public: - /** - * Return the current script code data - * @returns TQString containing the currenly runable code - **/ - virtual TQString script() const = 0; - /** - * Sets the path to the script library that we are going to embed. - **/ - virtual void setScript( const TQString &scriptFile ) = 0; - /** - * Sets the path to the script library that we are going to embed. - * The second argument is the function from the script library that - * we wish to call. - **/ - virtual void setScript( const TQString &scriptLibFile, const TQString &method ) = 0; - /** - * Run the actual script code - * This can both take a context object that will be shared between the - * main application and a variant that will contain the arguments. - **/ - virtual void run(TQObject *context = 0, const TQVariant &arg = 0) = 0; - /** - * Abort the scripts run - **/ - virtual void kill() =0; - public: - /** - * This is the method for sending feedback to applications. - * example of how this works: - * \code - * ScriptClientInterface->error( message_to_send_back_to_the_main_application ); - * \endcode - * Will send the error message back to the main application. - **/ - KScriptClientInterface *ScriptClientInterface; - }; -//}; -#endif diff --git a/interfaces/kscript/scriptloader.cpp b/interfaces/kscript/scriptloader.cpp deleted file mode 100644 index 621ceb5d1..000000000 --- a/interfaces/kscript/scriptloader.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#include "scriptloader.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - -ScriptLoader::ScriptLoader(KMainWindow *parent) : TQObject (parent) -{ - m_parent = parent; - m_scripts.clear(); - m_theAction = new KSelectAction ( i18n("KDE Scripts"), - 0, - this, - TQT_SLOT(runAction()), - m_parent->actionCollection(), - "scripts"); -} - -ScriptLoader::~ScriptLoader() -{ - // Clean out the list - m_scripts.clear(); -} - -KSelectAction * ScriptLoader::getScripts() -{ - // Get the available scripts for this application. - TQStringList pluginList = ""; - // Find plugins - TQString searchPath = kapp->name(); - searchPath += "/scripts/"; - TQDir d(locate( "data", searchPath)); - kdDebug() << "loading plugin from " << locate( "data", searchPath) << endl; - const QFileInfoList *fileList = d.entryInfoList("*.desktop"); - QFileInfoListIterator it ( *fileList ); - TQFileInfo *fi; - // Find all available script desktop files - while( (fi=it.current())) - { - // Query each desktop file - if(KDesktopFile::isDesktopFile(fi->absFilePath())) - { - KDesktopFile desktop((fi->absFilePath()), true); - kdDebug () << "Trying to load script type: " << desktop.readType() << endl; - KScriptInterface *tmpIface = KParts::ComponentFactory::createInstanceFromQuery(desktop.readType() ); - if( tmpIface != 0 ) - { - m_scripts.append(tmpIface); - m_scripts.current()->setScript(desktop.readURL()); - //if(m_parent != 0) - //m_scripts.current()->setParent(m_parent); - pluginList.append(desktop.readName()); - } - else - kdDebug() << desktop.readName() << " could not be loaded!" << endl; - } - ++it; - } - m_theAction->clear(); - m_theAction->setItems(pluginList); - return m_theAction; -} - -void ScriptLoader::runAction() -{ - TQString scriptName = m_theAction->currentText(); - -} - -void ScriptLoader::stopAction() -{ - -} - -#include "scriptloader.moc" diff --git a/interfaces/kscript/scriptloader.h b/interfaces/kscript/scriptloader.h deleted file mode 100644 index 20b135231..000000000 --- a/interfaces/kscript/scriptloader.h +++ /dev/null @@ -1,59 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef _script_loader_h -#define _script_loader_h -#include -#include -#include -#include - -/** - * Script loader - */ -class ScriptLoader : virtual public QObject -{ - Q_OBJECT - public: - /** - * Default Constructor - */ - ScriptLoader(KMainWindow *parent=0); - ~ScriptLoader(); - /** Return the a KSelectAction with all of the scripts - * @returns KSelectAction containing access to all of the scripts - */ - KSelectAction *getScripts(); - public slots: - /** Run the current action. - */ - void runAction(); - /** Stop the currently running scripts operations - */ - void stopAction(); - signals: - virtual void errors(TQString messages); - virtual void output(TQString messages); - virtual void done(int errorCode); - private: - TQPtrList m_scripts; - KSelectAction *m_theAction; - int m_currentSelection; - KMainWindow *m_parent; -}; -#endif diff --git a/interfaces/kscript/scriptmanager.cpp b/interfaces/kscript/scriptmanager.cpp deleted file mode 100644 index 647410b8b..000000000 --- a/interfaces/kscript/scriptmanager.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include "scriptmanager.h" -#include -#include -#include -#include -#include - -#include -#include -#include - -//using namespace KScriptInterface; -class ScriptInfo -{ - public: - TQString scriptType; - TQString scriptFile; - TQString scriptMethod; - ScriptInfo(); - ~ScriptInfo(){} -}; -ScriptInfo::ScriptInfo() -{ - scriptType = ""; - scriptFile = ""; - scriptMethod = ""; -} -KScriptManager::KScriptManager(TQObject *parent, const char *name) : - TQObject(parent,name), KScriptClientInterface() -{ - -} -KScriptManager::~KScriptManager() -{ - m_scripts.setAutoDelete(true); - m_scriptCache.setAutoDelete(true); - -} -bool KScriptManager::addScript( const TQString &scriptDesktopFile) -{ - //m_scriptNames.append(scriptName); - // lets get some information about the script we are going to run... - bool success = false; - TQString tmpScriptType = ""; - TQString tmpScriptFile = ""; - TQString tmpScriptMethod = ""; - // Read the desktop file - - if(KDesktopFile::isDesktopFile(scriptDesktopFile)) - { - KDesktopFile desktop(scriptDesktopFile, true); - m_scripts.insert(desktop.readName(), new ScriptInfo()); - m_scripts[desktop.readName()]->scriptType = desktop.readType(); - TQString localpath = TQString(kapp->name()) + "/scripts/" + desktop.readEntry("X-TDE-ScriptName", ""); - m_scripts[desktop.readName()]->scriptFile = locate("data", localpath); -// m_scripts[desktop.readName()]->scriptMethod = tmpScriptMethod; - success = true; - } - return success; -} -bool KScriptManager::removeScript( const TQString &scriptName ) -{ - bool result = m_scriptCache.remove(scriptName); - result = m_scripts.remove(scriptName); - return result; -} -TQStringList KScriptManager::scripts() -{ - TQDictIterator it( m_scripts ); -// return m_scriptNames; - TQStringList scriptList; - while ( it.current() ) - { - scriptList.append(it.currentKey()); - ++it; - } - return scriptList; -} -void KScriptManager::clear() -{ - m_scriptCache.clear(); - m_scripts.clear(); -} -void KScriptManager::runScript( const TQString &scriptName, TQObject *context, const TQVariant &arg) -{ - ScriptInfo *newScript = m_scripts[scriptName]; - if (newScript) - { - TQString scriptType = "([X-TDE-Script-Runner] == '" + newScript->scriptType + "')"; - kdDebug()<<"running script, type = '"<( "KScriptRunner/KScriptRunner", scriptType, this ); - if ( ksif ) - { - m_scriptCache.insert( scriptName, ksif ); - - } - else - { - KMessageBox::sorry(0, i18n("Unable to get KScript Runner for type \"%1\".").arg(newScript->scriptType), i18n("KScript Error")); - return; - } - } - m_currentScript = scriptName; - - if ( m_scriptCache[m_currentScript] ) - { - m_scriptCache[m_currentScript]->ScriptClientInterface = this; - if (!newScript->scriptMethod.isEmpty()) - m_scriptCache[m_currentScript]->setScript( newScript->scriptFile, newScript->scriptMethod ); - else - m_scriptCache[m_currentScript]->setScript( newScript->scriptFile ); - m_scriptCache[m_currentScript]->run(context, arg); - } - else - { - // Dialog and say we cant go on... - // This is also a broken script so we need to remove it - m_scriptCache.remove(m_currentScript); - } - } - else - KMessageBox::sorry(0, i18n("Unable find script \"%1\".").arg(scriptName), i18n("KScript Error")); -} -#include "scriptmanager.moc" -#include "scriptinterface.moc" diff --git a/interfaces/kscript/scriptmanager.h b/interfaces/kscript/scriptmanager.h deleted file mode 100644 index d21219901..000000000 --- a/interfaces/kscript/scriptmanager.h +++ /dev/null @@ -1,139 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef __scriptmanager_h__ -#define __scriptmanager_h__ - -#include -#include -#include -#include -#include - -#include - -class ScriptInfo; -//namespace KScriptInterface -//{ - - /** - * This class is the base for all script engines. - * @author Ian Reinhart Geiser - * - **/ - class KDE_EXPORT KScriptManager : public TQObject, public KScriptClientInterface - { - Q_OBJECT - friend class KScriptInterface; - public: - /** - * Create a new instance of the script engine. - */ - KScriptManager(TQObject *parent, const char *name); - /** - * Destroy the current script engine. - */ - virtual ~KScriptManager(); - /** - * Add a new script instance to the script engine. - * This should be the full name and path to the desktop - * file. - */ - bool addScript( const TQString &scriptDesktopFile); - /** - * Remove a script instance from the script engine. - * @returns the success of the operation. - */ - bool removeScript( const TQString &scriptName ); - /** - * Access the names of script instances from the script engine. - * @returns a TQStringList of the current scripts. - */ - TQStringList scripts(); - /** - * Clear all script intstances in memory - */ - void clear(); - /** - * This function will allow the main application of any errors - * that have occurred during processing of the script. - */ - void error( const TQString &msg ) {emit scriptError(msg);} - /** - * This function will allow the main application of any warnings - * that have occurred during the processing of the script. - */ - void warning( const TQString &msg ) {emit scriptWarning(msg);} - /** - * This function will allow the main application of any normal - * output that has occurred during the processing of the script. - */ - void output( const TQString &msg ) {emit scriptOutput(msg);} - /** - * This function will allow feedback to any progress bars in the main - * application as to how far along the script is. This is very useful when - * a script is processing files or doing some long operation that is of a - * known duration. - */ - void progress( int percent ) {emit scriptProgress(percent);} - /** - * This function will allow feedback on completion of the script. - * It turns the result as a KScriptInteface::Result, and a return - * value as a QVariant - */ - void done( KScriptClientInterface::Result result, const TQVariant &returned ) {emit scriptDone(result, returned);} - - public slots: - /** - * Run the selected script - */ - void runScript( const TQString &scriptName, TQObject *context = 0, const TQVariant &arg = 0 ); - signals: - /** - * Send out a signal of the error message from the current running - * script. - */ - void scriptError( const TQString &msg ); - /** - * Send out a signal of the warning message from the current running - * script. - */ - void scriptWarning( const TQString &msg ); - /** - * Send out a signal of the output message from the current running - * script. - */ - void scriptOutput( const TQString &msg ); - /** - * Send out a signal of the progress of the current running - * script. - */ - void scriptProgress( int percent); - /** - * Send out a signal of the exit status of the script - * - */ - void scriptDone( KScriptClientInterface::Result result, const TQVariant &returned); - protected: - TQDict m_scripts; - TQDict m_scriptCache; - //TQStringList m_scriptNames; - TQString m_currentScript; - }; -//}; -#endif diff --git a/interfaces/kspeech/Makefile.am b/interfaces/kspeech/Makefile.am index f8f2b936d..dc183251d 100644 --- a/interfaces/kspeech/Makefile.am +++ b/interfaces/kspeech/Makefile.am @@ -6,5 +6,5 @@ include_HEADERS = kspeech.h kspeechsink.h # Define DCOP/Text-to-Speech Service Type. kde_servicetypes_DATA = dcoptexttospeech.desktop -DOXYGEN_REFERENCES = tdecore dcop kio tdeui kparts +DOXYGEN_REFERENCES = tdecore dcop kio tdeui tdeparts include ../../admin/Doxyfile.am diff --git a/interfaces/kspeech/kspeech.h b/interfaces/kspeech/kspeech.h index 4780b169d..d24683517 100644 --- a/interfaces/kspeech/kspeech.h +++ b/interfaces/kspeech/kspeech.h @@ -186,7 +186,7 @@ * * There are two methods of making DCOP calls from your application to %KTTSD. * - * - Manually code them using dcopClient object. See tdebase/konqueror/kttsplugin/khtmlkttsd.cpp + * - Manually code them using dcopClient object. See tdebase/konqueror/kttsplugin/tdehtmlkttsd.cpp * for an example. This method is recommended if you want to make a few simple calls to KTTSD. * - Use kspeech_stub as described below. This method generates the marshalling code for you * and is recommended for a more complex speech-enabled applications. kcmkttsmgr in the diff --git a/interfaces/ktexteditor/.kateconfig b/interfaces/ktexteditor/.kateconfig deleted file mode 100644 index 5b0885abe..000000000 --- a/interfaces/ktexteditor/.kateconfig +++ /dev/null @@ -1 +0,0 @@ -kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/interfaces/ktexteditor/CMakeLists.txt b/interfaces/ktexteditor/CMakeLists.txt deleted file mode 100644 index 3f430b50c..000000000 --- a/interfaces/ktexteditor/CMakeLists.txt +++ /dev/null @@ -1,96 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_BINARY_DIR}/kabc - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/kio - ${CMAKE_SOURCE_DIR}/kio/kio - ${CMAKE_SOURCE_DIR}/kabc - ${CMAKE_SOURCE_DIR}/interfaces -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - document.h view.h editor.h plugin.h editinterface.h - undointerface.h selectioninterface.h cursorinterface.h - clipboardinterface.h popupmenuinterface.h viewcursorinterface.h - searchinterface.h highlightinginterface.h blockselectioninterface.h - codecompletioninterface.h configinterface.h markinterface.h - printinterface.h wordwrapinterface.h dynwordwrapinterface.h - markinterfaceextension.h configinterfaceextension.h - encodinginterface.h viewstatusmsginterface.h - sessionconfiginterface.h editorchooser.h documentinfo.h - selectioninterfaceext.h selectionextdcopinterface.h - texthintinterface.h editinterfaceext.h variableinterface.h - templateinterface.h - DESTINATION ${INCLUDE_INSTALL_DIR}/ktexteditor ) - - -##### other data ################################ - -install( FILES - ktexteditor.desktop ktexteditoreditor.desktop - ktexteditorplugin.desktop - DESTINATION ${SERVICETYPES_INSTALL_DIR} ) - -install( FILES - kcm_ktexteditor.desktop - DESTINATION ${DATA_INSTALL_DIR}/kcm_componentchooser ) - - - -##### ktexteditor ############################### - -set( target ktexteditor ) - -set( ${target}_SRCS - ktexteditor.cpp - editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp - codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp - configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp - printinterface.cpp highlightinginterface.cpp markinterface.cpp - popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp - editdcopinterface.cpp editdcopinterface.skel clipboarddcopinterface.cpp - clipboarddcopinterface.skel selectiondcopinterface.cpp selectiondcopinterface.skel - searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp - configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp - viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp - blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp - blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp - encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel - undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp - viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp - viewstatusmsgdcopinterface.skel selectioninterfaceext.cpp selectionextdcopinterface.skel - texthintinterface.cpp editinterfaceext.cpp variableinterface.cpp templateinterface.cpp -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 0.0.0 - LINK tdeui-shared kabc-shared kparts-shared - DEPENDENCIES dcopidl dcopidl2cpp - DESTINATION ${LIB_INSTALL_DIR} -) diff --git a/interfaces/ktexteditor/Makefile.am b/interfaces/ktexteditor/Makefile.am deleted file mode 100644 index cc41c788f..000000000 --- a/interfaces/ktexteditor/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(top_srcdir)/interfaces -I$(top_builddir)/interfaces -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) - -lib_LTLIBRARIES = libktexteditor.la - -libktexteditor_la_SOURCES = ktexteditor.cpp \ - editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp \ - codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp \ - configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp \ - printinterface.cpp highlightinginterface.cpp markinterface.cpp \ - popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp \ - editdcopinterface.cpp editdcopinterface.skel clipboarddcopinterface.cpp \ - clipboarddcopinterface.skel selectiondcopinterface.cpp selectiondcopinterface.skel \ - searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp \ - configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp \ - viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp \ - blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp\ - blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp \ - encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel \ - undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp \ - viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp \ - viewstatusmsgdcopinterface.skel selectioninterfaceext.cpp selectionextdcopinterface.skel \ - texthintinterface.cpp editinterfaceext.cpp variableinterface.cpp templateinterface.cpp - - -libktexteditor_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -lktexteditor -libktexteditor_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/dcop/libDCOP.la $(LIB_KABC) $(LIB_TDECORE) $(LIB_QT) $(LIB_KFILE) $(LIB_TDEUI) - -ktexteditorinclude_HEADERS = document.h view.h editor.h plugin.h editinterface.h undointerface.h \ - selectioninterface.h cursorinterface.h \ - clipboardinterface.h popupmenuinterface.h \ - viewcursorinterface.h searchinterface.h highlightinginterface.h \ - blockselectioninterface.h codecompletioninterface.h \ - configinterface.h markinterface.h printinterface.h wordwrapinterface.h \ - dynwordwrapinterface.h markinterfaceextension.h configinterfaceextension.h \ - encodinginterface.h viewstatusmsginterface.h sessionconfiginterface.h editorchooser.h \ - documentinfo.h selectioninterfaceext.h selectionextdcopinterface.h texthintinterface.h \ - editinterfaceext.h variableinterface.h templateinterface.h - -ktexteditorincludedir = $(includedir)/ktexteditor - -METASOURCES = AUTO - -servicetypedir = $(kde_servicetypesdir) -servicetype_DATA = ktexteditor.desktop ktexteditoreditor.desktop ktexteditorplugin.desktop - -kcm_ktexteditor_DATA = kcm_ktexteditor.desktop -kcm_ktexteditordir = $(kde_datadir)/kcm_componentchooser - -templateinterface.lo: $(top_builddir)/kabc/addressee.h - -include ../../admin/Doxyfile.am - diff --git a/interfaces/ktexteditor/blockselectiondcopinterface.cpp b/interfaces/ktexteditor/blockselectiondcopinterface.cpp deleted file mode 100644 index 34b7294b2..000000000 --- a/interfaces/ktexteditor/blockselectiondcopinterface.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "blockselectiondcopinterface.h" -#include "blockselectioninterface.h" - -#include -using namespace KTextEditor; - -BlockSelectionDCOPInterface::BlockSelectionDCOPInterface( BlockSelectionInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -BlockSelectionDCOPInterface::~BlockSelectionDCOPInterface() -{ - -} - -uint BlockSelectionDCOPInterface::blockSelectionInterfaceNumber () -{ - return m_parent->blockSelectionInterfaceNumber(); -} -bool BlockSelectionDCOPInterface::blockSelectionMode () -{ - return m_parent->blockSelectionMode (); -} -bool BlockSelectionDCOPInterface::setBlockSelectionMode (bool on) -{ - return m_parent->setBlockSelectionMode (on); -} -bool BlockSelectionDCOPInterface::toggleBlockSelectionMode () -{ - return m_parent->toggleBlockSelectionMode (); -} diff --git a/interfaces/ktexteditor/blockselectiondcopinterface.h b/interfaces/ktexteditor/blockselectiondcopinterface.h deleted file mode 100644 index 4b74fd2a0..000000000 --- a/interfaces/ktexteditor/blockselectiondcopinterface.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef BlockSelection_DCOP_INTERFACE_H -#define BlockSelection_DCOP_INTERFACE_H - -#include -#include -#include -#include - -namespace KTextEditor -{ - class BlockSelectionInterface; - /** - This is the main interface to the BlockSelectionInterface of KTextEditor. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to BlockSelectionInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT BlockSelectionDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent BlockSelectionInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - BlockSelectionDCOPInterface( BlockSelectionInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~BlockSelectionDCOPInterface(); - k_dcop: - uint blockSelectionInterfaceNumber (); - - /** - * Returns the status of the selection mode - true indicates block selection mode is on. - * If this is true, selections applied via the SelectionInterface are handled as - * blockselections and the paste functions of the ClipboardInterface works on - * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;) - */ - bool blockSelectionMode (); - - /** - * set blockselection mode to state "on" - */ - bool setBlockSelectionMode (bool on) ; - - /** - * toggle blockseletion mode - */ - bool toggleBlockSelectionMode (); - - private: - BlockSelectionInterface *m_parent; - }; -} -#endif diff --git a/interfaces/ktexteditor/blockselectioninterface.cpp b/interfaces/ktexteditor/blockselectioninterface.cpp deleted file mode 100644 index 6d562a43e..000000000 --- a/interfaces/ktexteditor/blockselectioninterface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "blockselectioninterface.h" -#include "blockselectiondcopinterface.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivateBlockSelectionInterface -{ - public: - PrivateBlockSelectionInterface() {interface = 0;} - ~PrivateBlockSelectionInterface() {} - BlockSelectionDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int BlockSelectionInterface::globalBlockSelectionInterfaceNumber = 0; - -BlockSelectionInterface::BlockSelectionInterface() -{ - globalBlockSelectionInterfaceNumber++; - myBlockSelectionInterfaceNumber = globalBlockSelectionInterfaceNumber++; - TQString name = "BlockSelectionInterface#" + TQString::number(myBlockSelectionInterfaceNumber); - - d = new PrivateBlockSelectionInterface(); - d->interface = new BlockSelectionDCOPInterface(this, name.latin1()); -} - -BlockSelectionInterface::~BlockSelectionInterface() -{ - delete d->interface; - delete d; -} - -unsigned int BlockSelectionInterface::blockSelectionInterfaceNumber () const -{ - return myBlockSelectionInterfaceNumber; -} - -void BlockSelectionInterface::setBlockSelectionInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("BlockSelectionInterface#"+suffix); -} - -BlockSelectionInterface *KTextEditor::blockSelectionInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/blockselectioninterface.h b/interfaces/ktexteditor/blockselectioninterface.h deleted file mode 100644 index 3fae34682..000000000 --- a/interfaces/ktexteditor/blockselectioninterface.h +++ /dev/null @@ -1,82 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_blockselectioninterface_h__ -#define __ktexteditor_blockselectioninterface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** - * An interface for the Document class which allows the selection - * method to be changed between selecting rectangular blocks of text and normal mode - * (all text between the start cursor and the current cursor). - */ -class KTEXTEDITOR_EXPORT BlockSelectionInterface -{ - friend class PrivateBlockSelectionInterface; - - public: - BlockSelectionInterface (); - virtual ~BlockSelectionInterface (); - - unsigned int blockSelectionInterfaceNumber () const; - - protected: - void setBlockSelectionInterfaceDCOPSuffix (const TQCString &suffix); - - /** - * slots !!! - */ - public: - /** - * Returns the status of the selection mode - true indicates block selection mode is on. - * If this is true, selections applied via the SelectionInterface are handled as - * blockselections and the paste functions of the ClipboardInterface works on - * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;) - */ - virtual bool blockSelectionMode () = 0; - - /** - * Set block selection mode to state "on" - */ - virtual bool setBlockSelectionMode (bool on) = 0; - - /** - * toggle block seletion mode - */ - virtual bool toggleBlockSelectionMode () = 0; - - private: - class PrivateBlockSelectionInterface *d; - static unsigned int globalBlockSelectionInterfaceNumber; - unsigned int myBlockSelectionInterfaceNumber; -}; - -/** - * Access the block selection interface of document @param doc - */ -KTEXTEDITOR_EXPORT BlockSelectionInterface *blockSelectionInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/clipboarddcopinterface.cpp b/interfaces/ktexteditor/clipboarddcopinterface.cpp deleted file mode 100644 index 334046ee5..000000000 --- a/interfaces/ktexteditor/clipboarddcopinterface.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "clipboarddcopinterface.h" -#include "clipboardinterface.h" - -#include -using namespace KTextEditor; - -ClipboardDCOPInterface::ClipboardDCOPInterface( ClipboardInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -ClipboardDCOPInterface::~ClipboardDCOPInterface() -{ - -} - - /** - * Copies selected text. - */ - void ClipboardDCOPInterface::copy ( ) - { - m_parent->copy(); - } - - /** - * Cuts selected text. - */ - void ClipboardDCOPInterface::cut ( ) - { - m_parent->cut(); - } - - /** - * Pastes text from clipboard. - */ - void ClipboardDCOPInterface::paste ( ) - { - m_parent->paste(); - } diff --git a/interfaces/ktexteditor/clipboarddcopinterface.h b/interfaces/ktexteditor/clipboarddcopinterface.h deleted file mode 100644 index 8104e9d4d..000000000 --- a/interfaces/ktexteditor/clipboarddcopinterface.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef Clipboard_DCOP_INTERFACE_H -#define Clipboard_DCOP_INTERFACE_H - -#include -#include -#include -#include - -namespace KTextEditor -{ - class ClipboardInterface; - /** - This is the main interface to the ClipboardInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to ClipboardInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT ClipboardDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent ClipboardInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - ClipboardDCOPInterface( ClipboardInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~ClipboardDCOPInterface(); - k_dcop: - /** - * copies selected text - */ - void copy ( ); - /** - * cuts selected text - */ - void cut ( ); - /** - * pastes selected text - */ - void paste ( ); - private: - ClipboardInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/clipboardinterface.cpp b/interfaces/ktexteditor/clipboardinterface.cpp deleted file mode 100644 index 89f92d089..000000000 --- a/interfaces/ktexteditor/clipboardinterface.cpp +++ /dev/null @@ -1,56 +0,0 @@ -#include "clipboardinterface.h" -#include "clipboarddcopinterface.h" - -#include "view.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateClipboardInterface - { - public: - PrivateClipboardInterface() - { - interface = 0; - } - ~PrivateClipboardInterface(){} - // Data Members - ClipboardDCOPInterface *interface; - }; - -} - -unsigned int ClipboardInterface::globalClipboardInterfaceNumber = 0; - -ClipboardInterface::ClipboardInterface() -{ - d = new PrivateClipboardInterface(); - globalClipboardInterfaceNumber++; - myClipboardInterfaceNumber = globalClipboardInterfaceNumber++; - TQString name = "ClipboardInterface#" + TQString::number(myClipboardInterfaceNumber); - d->interface = new ClipboardDCOPInterface(this, name.latin1()); -} -ClipboardInterface::~ClipboardInterface() -{ - delete d->interface; - delete d; -} - -unsigned int ClipboardInterface::clipboardInterfaceNumber () const -{ - return myClipboardInterfaceNumber; -} - -void ClipboardInterface::setClipboardInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("ClipboardInterface#"+suffix); -} - -ClipboardInterface *KTextEditor::clipboardInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} diff --git a/interfaces/ktexteditor/clipboardinterface.h b/interfaces/ktexteditor/clipboardinterface.h deleted file mode 100644 index 365006b37..000000000 --- a/interfaces/ktexteditor/clipboardinterface.h +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_clipboardinterface_h__ -#define __ktexteditor_clipboardinterface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface for accessing the clipboard through the View class. -*/ -class KTEXTEDITOR_EXPORT ClipboardInterface -{ - friend class PrivateClipboardInterface; - - public: - ClipboardInterface(); - virtual ~ClipboardInterface(); - - unsigned int clipboardInterfaceNumber () const; - - protected: - void setClipboardInterfaceDCOPSuffix (const TQCString &suffix); - - /** - * slots !!! - */ - public: - /** - * copies selected text - */ - virtual void copy ( ) const = 0; - - /** - * copies selected text - */ - virtual void cut ( ) = 0; - - /** - * copies selected text - */ - virtual void paste ( ) = 0; - - private: - class PrivateClipboardInterface *d; - static unsigned int globalClipboardInterfaceNumber; - unsigned int myClipboardInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT ClipboardInterface *clipboardInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/codecompletioninterface.cpp b/interfaces/ktexteditor/codecompletioninterface.cpp deleted file mode 100644 index 416dd593a..000000000 --- a/interfaces/ktexteditor/codecompletioninterface.cpp +++ /dev/null @@ -1,51 +0,0 @@ - -#include "codecompletioninterface.h" -#include "view.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateCodeCompletionInterface - { - public: - PrivateCodeCompletionInterface() {} - ~PrivateCodeCompletionInterface(){} - - }; -} - -unsigned int CodeCompletionInterface::globalCodeCompletionInterfaceNumber = 0; - -CodeCompletionInterface::CodeCompletionInterface() -{ - globalCodeCompletionInterfaceNumber++; - myCodeCompletionInterfaceNumber = globalCodeCompletionInterfaceNumber++; - - d = new PrivateCodeCompletionInterface(); -} - -CodeCompletionInterface::~CodeCompletionInterface() -{ - delete d; -} - -unsigned int CodeCompletionInterface::codeCompletionInterfaceNumber () const -{ - return myCodeCompletionInterfaceNumber; -} - -void CodeCompletionInterface::setCodeCompletionInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("CodeCompletionInterface#"+suffix); -} - -CodeCompletionInterface *KTextEditor::codeCompletionInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} - - diff --git a/interfaces/ktexteditor/codecompletioninterface.h b/interfaces/ktexteditor/codecompletioninterface.h deleted file mode 100644 index 2fab7231e..000000000 --- a/interfaces/ktexteditor/codecompletioninterface.h +++ /dev/null @@ -1,202 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_codecompletioninterface_h__ -#define __ktexteditor_codecompletioninterface_h__ - -#include -#include - -#include - -namespace KTextEditor -{ - -/** - * An item for the completion popup. text is the completed string, - * prefix appears in front of it, suffix appears after it. - * type does not appear in the completion list. - * prefix, suffix, and type are not part of the - * inserted text if a completion takes place. comment appears in a tooltip right of - * the completion list for the currently selected item. userdata can be - * free formed data, which the user of this interface can use in - * CodeCompletionInterface::filterInsertString(). - * - * - */ -class KTEXTEDITOR_EXPORT CompletionEntry -{ - public: - TQString type; - TQString text; - TQString prefix; - TQString postfix; - TQString comment; - - TQString userdata; - - bool operator==( const CompletionEntry &c ) const { - return ( c.type == type && - c.text == text && - c.postfix == postfix && - c.prefix == prefix && - c.comment == comment && - c.userdata == userdata); - } -}; - -/** - * This is an interface for the KTextEditor::View class. It can be used - * to show completion lists, i.e. lists that pop up while a user is typing. - * The user can then choose from the list or he can just keep typing. The - * completion list will disappear if an item is chosen, if no completion - * is available or if the user presses Esc etc. The contents of the list - * is automatically adapted to the string the user types. - * - * There are other signals, which may be implmemented, but aren't documented here, because - * it would have been a BIC change...: - * - * void completionExtendedComment(CompletionEntry) - * - * This is emitted when the user has completed the argument entry (ie. enters the wrapping symbol(s) - * void argHintCompleted() - * - * This is emitted when there is a reason other than completion for the hint being hidden. - * void argHintAborted() - * - * This is emitted when a code completion box is about to be displayed - * void aboutToShowCompletionBox() - * - */ -class KTEXTEDITOR_EXPORT CodeCompletionInterface -{ - friend class PrivateCodeCompletionInterface; - - public: - CodeCompletionInterface(); - virtual ~CodeCompletionInterface(); - - unsigned int codeCompletionInterfaceNumber () const; - - protected: - void setCodeCompletionInterfaceDCOPSuffix (const TQCString &suffix); - - - public: - // - // slots !!! - // - /** - * This shows an argument hint. - */ - virtual void showArgHint (TQStringList functionList, const TQString& strWrapping, const TQString& strDelimiter) = 0; - - /** - * This shows a completion list. @p offset is the real start of the text that - * should be completed. 0 means that the text starts at the current cursor - * position. if @p casesensitive is @p true, the popup will only contain completions - * that match the input text regarding case. - */ - virtual void showCompletionBox (TQValueList complList,int offset=0, bool casesensitive=true)=0; - - // - // signals !!! - // - public: - - - /** - * This signal is emitted when the completion list disappears and no completion has - * been done. This is the case e.g. when the user presses Escape. - * - * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback - * when the implementation doesn't support it - * - * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited - * function, if you support it, declare it as a signal - */ - virtual void completionAborted()=0; - - /** - * This signal is emitted when the completion list disappears and a completion has - * been inserted into text. This is the case e.g. when the user presses Return - * on a selected item in the completion list. - * - * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback - * when the implementation doesn't support it - * - * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited - * function, if you support it, declare it as a signal - */ - virtual void completionDone()=0; - - /** - * This signal is the same as completionDone(), but additionally it carries - * the information which completion item was used. - * - * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback - * when the implementation doesn't support it - * - * IMPORTANT: The pointer to the CompleteionEntry, is only valid in the slots connected to this signal - * when the connected slots are left, the data element may be destroyed, depending on the implementation - * - * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited - * function, if you support it, declare it as a signal. - * - */ - virtual void completionDone(CompletionEntry)=0; - - /** - * This signal is emitted when the argument hint disappears. - * This is the case e.g. when the user moves the cursor somewhere else. - * - * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback - * when the implementation doesn't support it - * - * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited - * function, if you support it, declare it as a signal - */ - virtual void argHintHidden()=0; - - /** - * This signal is emitted just before a completion takes place. - * You can use it to modify the CompletionEntry. The modified - * entry will not be visible in the completion list (because that has - * just disappeared) but it will be used when the completion is - * inserted into the text. - * - * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback - * when the implementation doesn't support it - * - * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited - * function, if you support it, declare it as a signal - */ - virtual void filterInsertString(CompletionEntry*,TQString*)=0; - - - private: - class PrivateCodeCompletionInterface *d; - static unsigned int globalCodeCompletionInterfaceNumber; - unsigned int myCodeCompletionInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT CodeCompletionInterface *codeCompletionInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/configinterface.cpp b/interfaces/ktexteditor/configinterface.cpp deleted file mode 100644 index 63bf086e0..000000000 --- a/interfaces/ktexteditor/configinterface.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "configinterface.h" - -#include "document.h" -#include "plugin.h" - -namespace KTextEditor -{ - -class PrivateConfigInterface -{ - public: - PrivateConfigInterface() {} - ~PrivateConfigInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int ConfigInterface::globalConfigInterfaceNumber = 0; - -ConfigInterface::ConfigInterface() -{ - globalConfigInterfaceNumber++; - myConfigInterfaceNumber = globalConfigInterfaceNumber++; - - d = new PrivateConfigInterface(); -} - -ConfigInterface::~ConfigInterface() -{ - delete d; -} - -unsigned int ConfigInterface::configInterfaceNumber () const -{ - return myConfigInterfaceNumber; -} - -void ConfigInterface::setConfigInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("ConfigInterface#"+suffix); -} - -ConfigInterface *KTextEditor::configInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - -ConfigInterface *KTextEditor::configInterface (Plugin *plugin) -{ - if (!plugin) - return 0; - - return dynamic_cast(plugin); -} diff --git a/interfaces/ktexteditor/configinterface.h b/interfaces/ktexteditor/configinterface.h deleted file mode 100644 index 4879fa66b..000000000 --- a/interfaces/ktexteditor/configinterface.h +++ /dev/null @@ -1,93 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_configinterface_h__ -#define __ktexteditor_configinterface_h__ - -#include - -class TQCString; -class TDEConfig; - -namespace KTextEditor -{ - -/** -* This is an interface for accessing the configuration of the -* Document and Plugin classes. -*/ -class KTEXTEDITOR_EXPORT ConfigInterface -{ - friend class PrivateConfigInterface; - - public: - ConfigInterface(); - virtual ~ConfigInterface(); - - unsigned int configInterfaceNumber () const; - - protected: - void setConfigInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - /** - Read/Write the config to the standard place where this editor - part saves it config, say: read/save default values for that - editor part, which means for all current open documents - */ - virtual void readConfig () = 0; - virtual void writeConfig () = 0; - - /** - Read/Write the config of the part to a given kconfig object - to store the settings in a different place than the standard - */ - virtual void readConfig (TDEConfig *) = 0; - virtual void writeConfig (TDEConfig *) = 0; - - /** - Read/Write session config of only this document/view/plugin - */ - virtual void readSessionConfig (TDEConfig *) = 0; - virtual void writeSessionConfig (TDEConfig *) = 0; - - /** - Shows a config dialog for the part, changes will be applied - to the part, but not saved anywhere automagically, call - writeConfig to save it - */ - virtual void configDialog () = 0; - - private: - class PrivateConfigInterface *d; - static unsigned int globalConfigInterfaceNumber; - unsigned int myConfigInterfaceNumber; -}; - -class Plugin; -class Document; - -KTEXTEDITOR_EXPORT ConfigInterface *configInterface (Document *doc); -KTEXTEDITOR_EXPORT ConfigInterface *configInterface (Plugin *plugin); - -} - -#endif diff --git a/interfaces/ktexteditor/configinterfaceextension.cpp b/interfaces/ktexteditor/configinterfaceextension.cpp deleted file mode 100644 index 460d930a4..000000000 --- a/interfaces/ktexteditor/configinterfaceextension.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "configinterfaceextension.h" -#include "configinterfaceextension.moc" - -#include "document.h" -#include "plugin.h" - -namespace KTextEditor -{ - -class PrivateConfigInterfaceExtension -{ - public: - PrivateConfigInterfaceExtension() {} - ~PrivateConfigInterfaceExtension() {} -}; - -} - -using namespace KTextEditor; - -ConfigPage::ConfigPage ( TQWidget *parent, const char *name ) : TQWidget (parent, name) { ; } - -ConfigPage::~ConfigPage () { ; } - -unsigned int ConfigInterfaceExtension::globalConfigInterfaceExtensionNumber = 0; - -ConfigInterfaceExtension::ConfigInterfaceExtension() -{ - globalConfigInterfaceExtensionNumber++; - myConfigInterfaceExtensionNumber = globalConfigInterfaceExtensionNumber++; - - d = new PrivateConfigInterfaceExtension(); -} - -ConfigInterfaceExtension::~ConfigInterfaceExtension() -{ - delete d; -} - -unsigned int ConfigInterfaceExtension::configInterfaceExtensionNumber () const -{ - return myConfigInterfaceExtensionNumber; -} - -void ConfigInterfaceExtension::setConfigInterfaceExtensionDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("ConfigInterfaceExtension#"+suffix); -} - -ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - -ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Plugin *plugin) -{ - if (!plugin) - return 0; - - return dynamic_cast(plugin); -} diff --git a/interfaces/ktexteditor/configinterfaceextension.h b/interfaces/ktexteditor/configinterfaceextension.h deleted file mode 100644 index e324e2ba2..000000000 --- a/interfaces/ktexteditor/configinterfaceextension.h +++ /dev/null @@ -1,116 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_configinterfaceextension_h__ -#define __ktexteditor_configinterfaceextension_h__ - -#include -#include -#include - -namespace KTextEditor -{ - -class KTEXTEDITOR_EXPORT ConfigPage : public TQWidget -{ - Q_OBJECT - - public: - ConfigPage ( TQWidget *parent=0, const char *name=0 ); - virtual ~ConfigPage (); - - // - // slots !!! - // - public: - /** - Applies the changes to all documents - */ - virtual void apply () = 0; - - /** - Reset the changes - */ - virtual void reset () = 0; - - /** - Sets default options - */ - virtual void defaults () = 0; - - signals: - /** - Emitted when something changes - */ - void changed(); -}; - -/** -* This is an interface to extend the configuration of the -* Document, Plugin and PluginViewInterface classes. -*/ -class KTEXTEDITOR_EXPORT ConfigInterfaceExtension -{ - friend class PrivateConfigInterfaceExtension; - - public: - ConfigInterfaceExtension(); - virtual ~ConfigInterfaceExtension(); - - unsigned int configInterfaceExtensionNumber () const; - - protected: - void setConfigInterfaceExtensionDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - /** - Number of available config pages - */ - virtual uint configPages () const = 0; - - /** - returns config page with the given number, - config pages from 0 to configPages()-1 are available - if configPages() > 0 - */ - virtual ConfigPage *configPage (uint number = 0, TQWidget *parent = 0, const char *name=0 ) = 0; - - virtual TQString configPageName (uint number = 0) const = 0; - virtual TQString configPageFullName (uint number = 0) const = 0; - virtual TQPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const = 0; - - - private: - class PrivateConfigInterfaceExtension *d; - static unsigned int globalConfigInterfaceExtensionNumber; - unsigned int myConfigInterfaceExtensionNumber; -}; - -class Document; -class Plugin; -class ViewPlugin; - -KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Document *doc); -KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Plugin *plugin); - -} - -#endif diff --git a/interfaces/ktexteditor/cursorinterface.cpp b/interfaces/ktexteditor/cursorinterface.cpp deleted file mode 100644 index 96d00290e..000000000 --- a/interfaces/ktexteditor/cursorinterface.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "cursorinterface.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivateCursorInterface -{ - public: - PrivateCursorInterface() {} - ~PrivateCursorInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int CursorInterface::globalCursorInterfaceNumber = 0; - -CursorInterface::CursorInterface() -{ - globalCursorInterfaceNumber++; - myCursorInterfaceNumber = globalCursorInterfaceNumber++; - - d = new PrivateCursorInterface(); -} - -CursorInterface::~CursorInterface() -{ - delete d; -} - -unsigned int CursorInterface::cursorInterfaceNumber () const -{ - return myCursorInterfaceNumber; -} - -void CursorInterface::setCursorInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("CursorInterface#"+suffix); -} - -CursorInterface *KTextEditor::cursorInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/cursorinterface.h b/interfaces/ktexteditor/cursorinterface.h deleted file mode 100644 index e6e8e848a..000000000 --- a/interfaces/ktexteditor/cursorinterface.h +++ /dev/null @@ -1,84 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_cursorinterface_h__ -#define __ktexteditor_cursorinterface_h__ - -#include -#include - -#include - -namespace KTextEditor -{ - -/** - * This class represents a text cursor. - */ -class KTEXTEDITOR_EXPORT Cursor -{ - public: - virtual void position ( unsigned int *line, unsigned int *col ) const = 0; - - virtual bool setPosition ( unsigned int line, unsigned int col ) = 0; - - virtual bool insertText ( const TQString& text ) = 0; - - virtual bool removeText ( unsigned int numberOfCharacters ) = 0; - - virtual TQChar currentChar () const = 0; -}; - -/** -* This is an interface for accessing the cursor of the Document class. -*/ -class KTEXTEDITOR_EXPORT CursorInterface -{ - friend class PrivateCursorInterface; - - public: - CursorInterface (); - virtual ~CursorInterface (); - - unsigned int cursorInterfaceNumber () const; - - protected: - void setCursorInterfaceDCOPSuffix (const TQCString &suffix); - - public: - /** - * Create a new cursor object - */ - virtual Cursor *createCursor ( ) = 0; - - /* - * Accessor to the list of cursors. - */ - virtual TQPtrList cursors () const = 0; - - private: - class PrivateCursorInterface *d; - static unsigned int globalCursorInterfaceNumber; - unsigned int myCursorInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT CursorInterface *cursorInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/document.h b/interfaces/ktexteditor/document.h deleted file mode 100644 index 12823e600..000000000 --- a/interfaces/ktexteditor/document.h +++ /dev/null @@ -1,85 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_document_h__ -#define __ktexteditor_document_h__ - -#include "editor.h" - -namespace KTextEditor -{ - -/** - * The main class representing a text document. - * This class provides access to the document's views. - */ -class KTEXTEDITOR_EXPORT Document : public KTextEditor::Editor -{ - friend class PrivateDocument; - - Q_OBJECT - - - public: - Document ( TQObject *parent = 0, const char *name = 0 ); - virtual ~Document (); - - /** - * Returns the global number of this document in your app. - */ - unsigned int documentNumber () const; - - /** - * Returns this document's DCOP suffix for identifiying its DCOP interface. - */ - TQCString documentDCOPSuffix () const; - - /** - * Create a view that will display the document data. You can create as many - * views as you like. When the user modifies data in one view then all other - * views will be updated as well. - */ - virtual class View *createView ( TQWidget *parent, const char *name = 0 ) = 0; - - /* - * Returns a list of all views of this document. - */ - virtual TQPtrList views () const = 0; - - /** - * Returns the list position of this document in your app, if applicable. - */ - long documentListPosition () const; - - /** - * Sets the list position of this document in your app, if applicable. - */ - void setDocumentListPosition (long pos); - - private: - class PrivateDocument *d; - static unsigned int globalDocumentNumber; - unsigned int myDocumentNumber; - long myDocumentListPosition; -}; - -KTEXTEDITOR_EXPORT Document *createDocument ( const char* libname, TQObject *parent = 0, const char *name = 0 ); - -} - -#endif diff --git a/interfaces/ktexteditor/documentdcopinfo.cpp b/interfaces/ktexteditor/documentdcopinfo.cpp deleted file mode 100644 index b339d01cd..000000000 --- a/interfaces/ktexteditor/documentdcopinfo.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "documentinfo.h" -#include "documentdcopinfo.h" - -#include -using namespace KTextEditor; - -DocumentInfoDCOPInterface::DocumentInfoDCOPInterface( DocumentInfoInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -DocumentInfoDCOPInterface::~DocumentInfoDCOPInterface() -{ - -} - -TQString DocumentInfoDCOPInterface::mimeType() -{ - return m_parent->mimeType(); -} -long DocumentInfoDCOPInterface::fileSize() -{ - return m_parent->fileSize(); -} -TQString DocumentInfoDCOPInterface::niceFileSize() -{ - return m_parent->niceFileSize(); -} -uint DocumentInfoDCOPInterface::documentInfoInterfaceNumber () -{ - return m_parent->documentInfoInterfaceNumber (); -} diff --git a/interfaces/ktexteditor/documentdcopinfo.h b/interfaces/ktexteditor/documentdcopinfo.h deleted file mode 100644 index ea25284fe..000000000 --- a/interfaces/ktexteditor/documentdcopinfo.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef DocumentInfo_DCOP_INTERFACE_H -#define DocumentInfo_DCOP_INTERFACE_H - -#include -#include -#include -#include - -namespace KTextEditor -{ - class DocumentInfoInterface; - /** - This is the main interface to the DocumentInfoInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to DocumentInfoInterface. - @author Ian Reinhart Geiser - */ - - class KTEXTEDITOR_EXPORT DocumentInfoDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent DocumentInfoInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - DocumentInfoDCOPInterface( DocumentInfoInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~DocumentInfoDCOPInterface(); - k_dcop: - TQString mimeType(); - long fileSize(); - TQString niceFileSize(); - uint documentInfoInterfaceNumber (); - private: - DocumentInfoInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/documentinfo.cpp b/interfaces/ktexteditor/documentinfo.cpp deleted file mode 100644 index c675bfb5f..000000000 --- a/interfaces/ktexteditor/documentinfo.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "documentinfo.h" -#include "documentdcopinfo.h" - -namespace KTextEditor -{ - -class PrivateDocumentInfoInterface -{ - public: - PrivateDocumentInfoInterface() {interface = 0;} - ~PrivateDocumentInfoInterface() {} - DocumentInfoDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int DocumentInfoInterface::globalDocumentInfoInterfaceNumber = 0; - -DocumentInfoInterface::DocumentInfoInterface() -{ - globalDocumentInfoInterfaceNumber++; - myDocumentInfoInterfaceNumber = globalDocumentInfoInterfaceNumber++; - - d = new PrivateDocumentInfoInterface(); - TQString name = "DocumentInterface#" + TQString::number(myDocumentInfoInterfaceNumber); - d->interface = new DocumentInfoDCOPInterface(this, name.latin1()); -} - -DocumentInfoInterface::~DocumentInfoInterface() -{ - delete d->interface; - delete d; -} - -unsigned int DocumentInfoInterface::documentInfoInterfaceNumber () const -{ - return myDocumentInfoInterfaceNumber; -} - -void DocumentInfoInterface::setDocumentInfoInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("DocumentInfoInterface#"+suffix); -} diff --git a/interfaces/ktexteditor/documentinfo.h b/interfaces/ktexteditor/documentinfo.h deleted file mode 100644 index b6d393eb7..000000000 --- a/interfaces/ktexteditor/documentinfo.h +++ /dev/null @@ -1,60 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2002 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_documentinfointerface_h__ -#define __ktexteditor_documentinfointerface_h__ - -class TQString; -class TQCString; - -#include - -namespace KTextEditor -{ - -/** - * This is an interface for accessing information about files open - * in the Document, Plugin and PluginViewInterface classes. - */ -class KTEXTEDITOR_EXPORT DocumentInfoInterface -{ - friend class PrivateDocumentInterface; - - public: - DocumentInfoInterface(); - virtual ~DocumentInfoInterface(); - - virtual TQString mimeType()=0; - virtual long fileSize()=0; - virtual TQString niceFileSize()=0; - - unsigned int documentInfoInterfaceNumber () const; - - protected: - void setDocumentInfoInterfaceDCOPSuffix (const TQCString &suffix); - - private: - class PrivateDocumentInfoInterface *d; - static unsigned int globalDocumentInfoInterfaceNumber; - unsigned int myDocumentInfoInterfaceNumber; -}; - - -} - -#endif diff --git a/interfaces/ktexteditor/dynwordwrapinterface.cpp b/interfaces/ktexteditor/dynwordwrapinterface.cpp deleted file mode 100644 index 9c1da6d4b..000000000 --- a/interfaces/ktexteditor/dynwordwrapinterface.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "dynwordwrapinterface.h" -#include "view.h" - -namespace KTextEditor -{ - -class PrivateDynWordWrapInterface -{ - public: - PrivateDynWordWrapInterface() {} - ~PrivateDynWordWrapInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int DynWordWrapInterface::globalDynWordWrapInterfaceNumber = 0; - -DynWordWrapInterface::DynWordWrapInterface() -{ - globalDynWordWrapInterfaceNumber++; - myDynWordWrapInterfaceNumber = globalDynWordWrapInterfaceNumber++; - - d = new PrivateDynWordWrapInterface(); -} - -DynWordWrapInterface::~DynWordWrapInterface() -{ - delete d; -} - -unsigned int DynWordWrapInterface::dynWordWrapInterfaceNumber () const -{ - return myDynWordWrapInterfaceNumber; -} - -void DynWordWrapInterface::setDynWordWrapInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("DynWordWrapInterface#"+suffix); -} - -DynWordWrapInterface *KTextEditor::dynWordWrapInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} diff --git a/interfaces/ktexteditor/dynwordwrapinterface.h b/interfaces/ktexteditor/dynwordwrapinterface.h deleted file mode 100644 index 8d796c4ae..000000000 --- a/interfaces/ktexteditor/dynwordwrapinterface.h +++ /dev/null @@ -1,64 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_dynwordwrapinterface_h__ -#define __ktexteditor_dynwordwrapinterface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** - * This is an interface for accessing dynamic word wrapping functionality - * of the View class. - */ -class KTEXTEDITOR_EXPORT DynWordWrapInterface -{ - friend class PrivateDynWordWrapInterface; - - public: - DynWordWrapInterface (); - virtual ~DynWordWrapInterface (); - - unsigned int dynWordWrapInterfaceNumber () const; - - protected: - void setDynWordWrapInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - virtual void setDynWordWrap (bool) = 0; - virtual bool dynWordWrap () const = 0; - - private: - class PrivateDynWordWrapInterface *d; - static unsigned int globalDynWordWrapInterfaceNumber; - unsigned int myDynWordWrapInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT DynWordWrapInterface *dynWordWrapInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/editdcopinterface.cpp b/interfaces/ktexteditor/editdcopinterface.cpp deleted file mode 100644 index 6130ccd14..000000000 --- a/interfaces/ktexteditor/editdcopinterface.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "editdcopinterface.h" -#include "editinterface.h" - -#include -using namespace KTextEditor; - -EditDCOPInterface::EditDCOPInterface( EditInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -EditDCOPInterface::~EditDCOPInterface() -{ - -} - -TQString EditDCOPInterface::text () -{ - return m_parent->text(); -} - -TQString EditDCOPInterface::textLine ( uint line ) -{ - return m_parent->textLine(line); -} - -int EditDCOPInterface::numLines () -{ - return m_parent->numLines(); -} - -int EditDCOPInterface::length () -{ - return m_parent->length(); -} - -void EditDCOPInterface::setText ( const TQString &text ) -{ - m_parent->setText(text); -} - -bool EditDCOPInterface::insertText ( uint line, uint col, const TQString &text ) -{ - return m_parent->insertText( line, col, text); -} - -bool EditDCOPInterface::removeText ( uint startLine, uint startCol, uint endLine, uint endCol ) -{ - return m_parent->removeText( startLine, startCol, endLine, endCol); -} - -bool EditDCOPInterface::insertLine ( uint line, const TQString &text ) -{ - return m_parent->insertLine( line, text); -} - -bool EditDCOPInterface::removeLine ( uint line ) -{ - return m_parent->removeLine( line ); -} diff --git a/interfaces/ktexteditor/editdcopinterface.h b/interfaces/ktexteditor/editdcopinterface.h deleted file mode 100644 index f169fb15b..000000000 --- a/interfaces/ktexteditor/editdcopinterface.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef EDIT_DCOP_INTERFACE_H -#define EDIT_DCOP_INTERFACE_H - -#include -#include -#include -#include -//#include "editdcopinterface.moc" -namespace KTextEditor -{ - class EditInterface; - /** - This is the main interface to the EditInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to EditInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT EditDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent EditInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - EditDCOPInterface( EditInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - **/ - virtual ~EditDCOPInterface(); - k_dcop: - /** - * @return the complete document as a single QString - */ - virtual TQString text (); - - /** - * @return All the text from the requested line. - */ - virtual TQString textLine ( uint line ); - - /** - * @return The current number of lines in the document - */ - virtual int numLines (); - - /** - * @return the number of characters in the document - */ - virtual int length (); - - /** - * Set the given text into the view. - * Warning: This will overwrite any data currently held in this view. - */ - virtual void setText (const TQString &text ); - - /** - * Inserts text at line "line", column "col" - * returns true if success - */ - virtual bool insertText ( uint line, uint col, const TQString &text ); - - /** - * remove text at line "line", column "col" - * returns true if success - */ - virtual bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol) ; - - /** - * Insert line(s) at the given line number. - */ - virtual bool insertLine ( uint line, const TQString &text ); - - /** - * Insert line(s) at the given line number. - * If only one line is in the current document, removeLine will fail (return false) - */ - virtual bool removeLine ( uint line ); - private: - EditInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/editinterface.cpp b/interfaces/ktexteditor/editinterface.cpp deleted file mode 100644 index cfa0b67bc..000000000 --- a/interfaces/ktexteditor/editinterface.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "editinterface.h" -#include "editdcopinterface.h" -#include "document.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateEditInterface - { - public: - PrivateEditInterface() - { - interface = 0; - } - ~PrivateEditInterface(){} - // Data Members - EditDCOPInterface *interface; - }; - -} - -uint EditInterface::globalEditInterfaceNumber = 0; - -EditInterface::EditInterface() -{ - d = new PrivateEditInterface(); - globalEditInterfaceNumber++; - myEditInterfaceNumber = globalEditInterfaceNumber; - TQString name = "EditInterface#" + TQString::number(myEditInterfaceNumber); - d->interface = new EditDCOPInterface(this, name.latin1()); -} - -EditInterface::~EditInterface() -{ - delete d->interface; - delete d; -} - -uint EditInterface::editInterfaceNumber () const -{ - return myEditInterfaceNumber; -} - -void EditInterface::setEditInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("EditInterface#"+suffix); -} - -EditInterface *KTextEditor::editInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - diff --git a/interfaces/ktexteditor/editinterface.h b/interfaces/ktexteditor/editinterface.h deleted file mode 100644 index 7844995e8..000000000 --- a/interfaces/ktexteditor/editinterface.h +++ /dev/null @@ -1,137 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_editinterface_h__ -#define __ktexteditor_editinterface_h__ - -#include - -#include - -namespace KTextEditor -{ - -/** -* This is the main interface for accessing and modifying -* text of the Document class. -*/ -class KTEXTEDITOR_EXPORT EditInterface -{ - friend class PrivateEditInterface; - - public: - EditInterface(); - virtual ~EditInterface(); - - uint editInterfaceNumber () const; - - protected: - void setEditInterfaceDCOPSuffix (const TQCString &suffix); - - public: - /** - * slots !!! - */ - /** - * @return the complete document as a single QString - */ - virtual TQString text () const = 0; - - /** - * @return a QString - */ - virtual TQString text ( uint startLine, uint startCol, uint endLine, uint endCol ) const = 0; - - /** - * @return All the text from the requested line. - */ - virtual TQString textLine ( uint line ) const = 0; - - /** - * @return The current number of lines in the document - */ - virtual uint numLines () const = 0; - - /** - * @return the number of characters in the document - */ - virtual uint length () const = 0; - - /** - * @return the number of characters in the line (-1 if no line "line") - */ - virtual int lineLength ( uint line ) const = 0; - - /** - * Set the given text into the view. - * Warning: This will overwrite any data currently held in this view. - */ - virtual bool setText ( const TQString &text ) = 0; - - /** - * clears the document - * Warning: This will overwrite any data currently held in this view. - */ - virtual bool clear () = 0; - - /** - * Inserts text at line "line", column "col" - * returns true if success - * Use insertText(numLines(), ...) to append text at end of document - */ - virtual bool insertText ( uint line, uint col, const TQString &text ) = 0; - - /** - * remove text at line "line", column "col" - * returns true if success - */ - virtual bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol ) = 0; - - /** - * Insert line(s) at the given line number. - * Use insertLine(numLines(), text) to append line at end of document - */ - virtual bool insertLine ( uint line, const TQString &text ) = 0; - - /** - * Remove line(s) at the given line number. - */ - virtual bool removeLine ( uint line ) = 0; - - /** - * signals !!! - */ - public: - virtual void textChanged () = 0; - - virtual void charactersInteractivelyInserted(int ,int ,const TQString&)=0; //line, col, characters if you don't support this, don't create a signal, just overload it. - - /** - * only for the interface itself - REAL PRIVATE - */ - private: - class PrivateEditInterface *d; - static uint globalEditInterfaceNumber; - uint myEditInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT EditInterface *editInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/editinterfaceext.cpp b/interfaces/ktexteditor/editinterfaceext.cpp deleted file mode 100644 index 008fa488d..000000000 --- a/interfaces/ktexteditor/editinterfaceext.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2003 Hamish Rodda - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "editinterfaceext.h" -#include "document.h" - -using namespace KTextEditor; - -uint EditInterfaceExt::globalEditInterfaceExtNumber = 0; - -EditInterfaceExt::EditInterfaceExt() - : d(0L) -{ - globalEditInterfaceExtNumber++; - myEditInterfaceExtNumber = globalEditInterfaceExtNumber; -} - -EditInterfaceExt::~EditInterfaceExt() -{ -} - -uint EditInterfaceExt::editInterfaceExtNumber() const -{ - return myEditInterfaceExtNumber; -} - -EditInterfaceExt *KTextEditor::editInterfaceExt (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - diff --git a/interfaces/ktexteditor/editinterfaceext.h b/interfaces/ktexteditor/editinterfaceext.h deleted file mode 100644 index a4fcb414c..000000000 --- a/interfaces/ktexteditor/editinterfaceext.h +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2003 Hamish Rodda - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_editinterfaceext_h__ -#define __ktexteditor_editinterfaceext_h__ - -#include - -#include - -namespace KTextEditor -{ - -/** -* This is the main interface for accessing and modifying -* text of the Document class. -*/ -class KTEXTEDITOR_EXPORT EditInterfaceExt -{ - friend class PrivateEditInterfaceExt; - - public: - EditInterfaceExt(); - virtual ~EditInterfaceExt(); - - uint editInterfaceExtNumber() const; - - /** - * Begin an editing sequence. Edit commands during this sequence will be - * bunched together such that they represent a single undo command in the - * editor, and so that repaint events do not occur inbetween. - * - * Your application should not return control to the event loop while it - * has an unterminated (no matching editEnd() call) editing sequence - * (result undefined) - so do all of your work in one go... - */ - virtual void editBegin() = 0; - - /** - * End and editing sequence. - */ - virtual void editEnd() = 0; - - public: - /** - * only for the interface itself - REAL PRIVATE - */ - private: - class PrivateEditInterfaceExt *d; - static uint globalEditInterfaceExtNumber; - uint myEditInterfaceExtNumber; -}; - -KTEXTEDITOR_EXPORT EditInterfaceExt *editInterfaceExt (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/editor.h b/interfaces/ktexteditor/editor.h deleted file mode 100644 index a9f542043..000000000 --- a/interfaces/ktexteditor/editor.h +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_editor_h__ -#define __ktexteditor_editor_h__ - -#include - -/** - * KTextEditor is KDE's standard text editing KPart interface. - */ -namespace KTextEditor -{ - -/** - * This is a simplfied version of the Document & View classes - * Usage: Load it, merge it's gui + be happy - * Extensibility: Use the Document / View classes if you want - * advanced features, interfaces, etc. This class is just a good text editor - * widget replacement for applications which just need an embedded text edtor - * and are not interested in using advanced interfaces. - */ - -class KTEXTEDITOR_EXPORT Editor : public KParts::ReadWritePart -{ - friend class PrivateEditor; - - Q_OBJECT - - - public: - /** - * Create a new editor widget. - */ - Editor ( TQObject *parent = 0, const char *name = 0 ); - virtual ~Editor (); - - unsigned int editorNumber () const; - - private: - class PrivateEditor *d; - static unsigned int globalEditorNumber; - unsigned int myEditorNumber; -}; - -KTEXTEDITOR_EXPORT Editor *createEditor ( const char* libname, TQWidget *parentWidget = 0, const char *widgetName = 0, TQObject *parent = 0, const char *name = 0 ); - -} - -#endif diff --git a/interfaces/ktexteditor/editorchooser.cpp b/interfaces/ktexteditor/editorchooser.cpp deleted file mode 100644 index 807d342d0..000000000 --- a/interfaces/ktexteditor/editorchooser.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "editorchooser_ui.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateEditorChooser - { - public: - PrivateEditorChooser() - { - } - ~PrivateEditorChooser(){} - // Data Members - EditorChooser_UI *chooser; - TQStringList ElementNames; - TQStringList elements; - }; - -} - -EditorChooser::EditorChooser(TQWidget *parent,const char *name) : - TQWidget (parent,name) - { - d = new PrivateEditorChooser (); - - // sizemanagment - TQGridLayout *grid = new TQGridLayout( this, 1, 1 ); - - - d->chooser = new EditorChooser_UI (this, name); - - grid->addWidget( d->chooser, 0, 0); - - - KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes"); - TDEConfig *config=new TDEConfig("default_components"); - config->setGroup("KTextEditor"); - TQString editor = config->readPathEntry("embeddedEditor"); - - if (editor.isEmpty()) editor="katepart"; - - for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) - { - if ((*it)->desktopEntryName().contains(editor)) - { - d->chooser->editorCombo->insertItem(TQString(i18n("System Default (%1)").arg((*it)->name()))); - break; - } - } - - for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) - { - d->chooser->editorCombo->insertItem((*it)->name()); - d->elements.append((*it)->desktopEntryName()); - } - d->chooser->editorCombo->setCurrentItem(0); -} - -EditorChooser:: ~EditorChooser(){ - delete d; -} - -void EditorChooser::readAppSetting(const TQString& postfix){ - TDEConfig *cfg=kapp->config(); - TQString previousGroup=cfg->group(); - cfg->setGroup("KTEXTEDITOR:"+postfix); - TQString editor=cfg->readPathEntry("editor"); - if (editor.isEmpty()) d->chooser->editorCombo->setCurrentItem(0); - else - { - int idx=d->elements.findIndex(editor); - idx=idx+1; - d->chooser->editorCombo->setCurrentItem(idx); - } - cfg->setGroup(previousGroup); -} - -void EditorChooser::writeAppSetting(const TQString& postfix){ - TDEConfig *cfg=kapp->config(); - TQString previousGroup=cfg->group(); - cfg->setGroup("KTEXTEDITOR:"+postfix); - cfg->writeEntry("DEVELOPER_INFO","NEVER TRY TO USE VALUES FROM THAT GROUP, THEY ARE SUBJECT TO CHANGES"); - cfg->writePathEntry("editor", (d->chooser->editorCombo->currentItem()==0) ? - TQString::null : (*d->elements.at(d->chooser->editorCombo->currentItem()-1))); - cfg->sync(); - cfg->setGroup(previousGroup); - -} - -KTextEditor::Document *EditorChooser::createDocument(TQObject *parent,const char* name, const TQString& postfix,bool fallBackToKatePart){ - - KTextEditor::Document *tmpDoc=0; - - TDEConfig *cfg=kapp->config(); - TQString previousGroup=cfg->group(); - cfg->setGroup("KTEXTEDITOR:"+postfix); - TQString editor=cfg->readPathEntry("editor"); - cfg->setGroup(previousGroup); - if (editor.isEmpty()) - { - TDEConfig *config=new TDEConfig("default_components"); - config->setGroup("KTextEditor"); - editor = config->readPathEntry("embeddedEditor", "katepart"); - delete config; - } - - KService::Ptr serv=KService::serviceByDesktopName(editor); - if (serv) - { - tmpDoc=KTextEditor::createDocument(serv->library().latin1(),parent,name); - if (tmpDoc) return tmpDoc; - } - if (fallBackToKatePart) - return KTextEditor::createDocument("libkatepart",parent,name); - - return 0; -} - -KTextEditor::Editor *EditorChooser::createEditor(TQWidget *parentWidget,TQObject *parent,const char* widgetName, - const char* name,const TQString& postfix,bool fallBackToKatePart){ - - KTextEditor::Editor *tmpEd=0; - - TDEConfig *cfg=kapp->config(); - TQString previousGroup=cfg->group(); - cfg->setGroup("KTEXTEDITOR:"+postfix); - TQString editor=cfg->readPathEntry("editor"); - cfg->setGroup(previousGroup); - if (editor.isEmpty()) - { - TDEConfig *config=new TDEConfig("default_components"); - config->setGroup("KTextEditor"); - editor = config->readPathEntry("embeddedEditor", "katepart"); - delete config; - } - - KService::Ptr serv=KService::serviceByDesktopName(editor); - if (serv) - { - tmpEd=KTextEditor::createEditor(serv->library().latin1(),parentWidget,widgetName,parent,name); - if (tmpEd) return tmpEd; - } - if (fallBackToKatePart) - return KTextEditor::createEditor("libkatepart",parentWidget,widgetName,parent,name); - - return 0; -} - diff --git a/interfaces/ktexteditor/editorchooser.h b/interfaces/ktexteditor/editorchooser.h deleted file mode 100644 index d56e8d8e5..000000000 --- a/interfaces/ktexteditor/editorchooser.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef _EDITOR_CHOOSER_H_ -#define _EDITOR_CHOOSER_H_ - -#include -#include - -#include - -class TDEConfig; -class TQString; - -namespace KTextEditor -{ - -class KTEXTEDITOR_EXPORT EditorChooser: public TQWidget -{ - friend class PrivateEditorChooser; - - Q_OBJECT - - public: - EditorChooser(TQWidget *parent=0,const char *name=0); - virtual ~EditorChooser(); - - /* void writeSysDefault();*/ - - void readAppSetting(const TQString& postfix=TQString::null); - void writeAppSetting(const TQString& postfix=TQString::null); - - static KTextEditor::Document *createDocument(TQObject* parent=0,const char *name=0,const TQString& postfix=TQString::null, bool fallBackToKatePart=true); - static KTextEditor::Editor *createEditor(TQWidget *parentWidget,TQObject *parent,const char* widgetName=0,const char* name=0,const TQString& postfix=TQString::null,bool fallBackToKatePart=true); - private: - class PrivateEditorChooser *d; -}; - -/* -class EditorChooserBackEnd: public ComponentChooserPlugin { - -Q_OBJECT -public: - EditorChooserBackEnd(TQObject *parent=0, const char *name=0); - virtual ~EditorChooserBackEnd(); - - virtual TQWidget *widget(TQWidget *); - virtual const TQStringList &choices(); - virtual void saveSettings(); - - void readAppSetting(TDEConfig *cfg,const TQString& postfix); - void writeAppSetting(TDEConfig *cfg,const TQString& postfix); - -public slots: - virtual void madeChoice(int pos,const TQString &choice); - -}; -*/ - -} -#endif diff --git a/interfaces/ktexteditor/editorchooser_ui.ui b/interfaces/ktexteditor/editorchooser_ui.ui deleted file mode 100644 index e2bc82adb..000000000 --- a/interfaces/ktexteditor/editorchooser_ui.ui +++ /dev/null @@ -1,64 +0,0 @@ - -EditorChooser_UI - - - EditorChooser - - - - 0 - 0 - 482 - 141 - - - - Editor Chooser - - - - unnamed - - - - layout4 - - - - unnamed - - - - TextLabel1 - - - - 460 - 0 - - - - Please choose the default text editing component that you wish to use in this application. If you choose <B>System Default</B>, the application will honor your changes in the Control Center. All other choices will override that setting. - - - WordBreak|AlignVCenter|AlignLeft - - - - - editorCombo - - - - - - - - editorCombo - - - kdialog.h - - - - diff --git a/interfaces/ktexteditor/encodingdcopinterface.cpp b/interfaces/ktexteditor/encodingdcopinterface.cpp deleted file mode 100644 index eb408c16e..000000000 --- a/interfaces/ktexteditor/encodingdcopinterface.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "encodingdcopinterface.h" -#include "encodinginterface.h" - -#include -using namespace KTextEditor; - -EncodingDCOPInterface::EncodingDCOPInterface( EncodingInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -EncodingDCOPInterface::~EncodingDCOPInterface() -{ - - } -uint EncodingDCOPInterface::encodingInterfaceNumber () -{ - return m_parent->encodingInterfaceNumber (); -} -void EncodingDCOPInterface::setEncoding (TQString e) -{ - m_parent->setEncoding (e); -} -TQString EncodingDCOPInterface::encoding() -{ - return m_parent->encoding(); -} diff --git a/interfaces/ktexteditor/encodingdcopinterface.h b/interfaces/ktexteditor/encodingdcopinterface.h deleted file mode 100644 index 38de4e0aa..000000000 --- a/interfaces/ktexteditor/encodingdcopinterface.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef Encoding_DCOP_INTERFACE_H -#define Encoding_DCOP_INTERFACE_H - -#include -#include -#include -#include -//#include "editdcopinterface.moc" -namespace KTextEditor -{ - class EncodingInterface; - /** - This is the main interface to the EncodingInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to EncodingInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT EncodingDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent EncodingInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - EncodingDCOPInterface( EncodingInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~EncodingDCOPInterface(); - k_dcop: - uint encodingInterfaceNumber (); - void setEncoding (TQString e) ; - TQString encoding(); - - private: - EncodingInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/encodinginterface.cpp b/interfaces/ktexteditor/encodinginterface.cpp deleted file mode 100644 index a0ef1ad22..000000000 --- a/interfaces/ktexteditor/encodinginterface.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "encodinginterface.h" -#include "encodingdcopinterface.h" -#include "document.h" - - - -namespace KTextEditor -{ - -class PrivateEncodingInterface -{ - public: - PrivateEncodingInterface() {interface=0;} - ~PrivateEncodingInterface() {} - EncodingDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int EncodingInterface::globalEncodingInterfaceNumber = 0; - -EncodingInterface::EncodingInterface() -{ - globalEncodingInterfaceNumber++; - myEncodingInterfaceNumber = globalEncodingInterfaceNumber++; - - d = new PrivateEncodingInterface(); - ::TQString name = "EncodingInterface#" + ::TQString::number(myEncodingInterfaceNumber); - d->interface = new EncodingDCOPInterface(this, name.latin1()); -} - -EncodingInterface::~EncodingInterface() -{ - delete d->interface; - delete d; -} - -unsigned int EncodingInterface::encodingInterfaceNumber () const -{ - return myEncodingInterfaceNumber; -} - -void EncodingInterface::setEncodingInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("EncodingInterface#"+suffix); -} - -EncodingInterface *KTextEditor::encodingInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/encodinginterface.h b/interfaces/ktexteditor/encodinginterface.h deleted file mode 100644 index 5133d4a6e..000000000 --- a/interfaces/ktexteditor/encodinginterface.h +++ /dev/null @@ -1,63 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_encodinginterface_h__ -#define __ktexteditor_encodinginterface_h__ - -#include - -class TQString; -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface to the text encoding of a Document class. -*/ -class KTEXTEDITOR_EXPORT EncodingInterface -{ - friend class PrivateEncodingInterface; - - public: - EncodingInterface(); - virtual ~EncodingInterface(); - - unsigned int encodingInterfaceNumber () const; - - protected: - void setEncodingInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - virtual void setEncoding (const class TQString &e) = 0; - virtual class TQString encoding() const = 0; - - private: - class PrivateEncodingInterface *d; - static unsigned int globalEncodingInterfaceNumber; - unsigned int myEncodingInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT EncodingInterface *encodingInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/highlightinginterface.cpp b/interfaces/ktexteditor/highlightinginterface.cpp deleted file mode 100644 index 1677ca87c..000000000 --- a/interfaces/ktexteditor/highlightinginterface.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "highlightinginterface.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivateHighlightingInterface -{ - public: - PrivateHighlightingInterface() {} - ~PrivateHighlightingInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int HighlightingInterface::globalHighlightingInterfaceNumber = 0; - -HighlightingInterface::HighlightingInterface() -{ - globalHighlightingInterfaceNumber++; - myHighlightingInterfaceNumber = globalHighlightingInterfaceNumber++; - - d = new PrivateHighlightingInterface(); -} - -HighlightingInterface::~HighlightingInterface() -{ - delete d; -} - -unsigned int HighlightingInterface::highlightingInterfaceNumber () const -{ - return myHighlightingInterfaceNumber; -} - -void HighlightingInterface::setHighlightingInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("HighlightingInterface#"+suffix); -} - -HighlightingInterface *KTextEditor::highlightingInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/highlightinginterface.h b/interfaces/ktexteditor/highlightinginterface.h deleted file mode 100644 index 4eb31659f..000000000 --- a/interfaces/ktexteditor/highlightinginterface.h +++ /dev/null @@ -1,92 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_highlightinginterface_h__ -#define __ktexteditor_highlightinginterface_h__ - -#include - -class TQString; -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface for syntax highlighting of a Document. -*/ -class KTEXTEDITOR_EXPORT HighlightingInterface -{ - friend class PrivateHighlightingInterface; - - public: - HighlightingInterface (); - virtual ~HighlightingInterface (); - - unsigned int highlightingInterfaceNumber () const; - - protected: - void setHighlightingInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - /** - * returns the current active highlighting mode - */ - virtual unsigned int hlMode () = 0; - - /** - * set the current active highlighting mode - */ - virtual bool setHlMode (unsigned int mode) = 0; - - /** - * returns the number of available highlightings - */ - virtual unsigned int hlModeCount () = 0; - - /** - * returns the name of the highlighting with number "mode" - */ - virtual TQString hlModeName (unsigned int mode) = 0; - - /** - * returns the sectionname of the highlighting with number "mode" - */ - virtual TQString hlModeSectionName (unsigned int mode) = 0; - - // - // signals !!! - // - public: - virtual void hlChanged () = 0; - - private: - class PrivateHighlightingInterface *d; - static unsigned int globalHighlightingInterfaceNumber; - unsigned int myHighlightingInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT HighlightingInterface *highlightingInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/kcm_ktexteditor.desktop b/interfaces/ktexteditor/kcm_ktexteditor.desktop deleted file mode 100644 index 490fad3ae..000000000 --- a/interfaces/ktexteditor/kcm_ktexteditor.desktop +++ /dev/null @@ -1,172 +0,0 @@ -Name=Embedded Text Editor -Name[af]=Ingebedde Teks Redigeerder -Name[ar]=محرر نص مدمج -Name[az]=Daxili Mətn Editoru -Name[be]=Унутраны тэкставы рэдактар -Name[bg]=Текстов редактор -Name[bn]=অভ্যন্তরীন টেক্সট সম্পাদক -Name[br]=Aozer skrid enframmet -Name[bs]=Umetnuti tekst editor -Name[ca]=Editor de text, encastable -Name[cs]=Zabudovaný textový editor -Name[csb]=Òbsôdzony editora tekstu -Name[cy]=Golygydd Testun Mewnol -Name[da]=Indlejret teksteditor -Name[de]=Erweiterte Editorkomponente -Name[el]=Ενσωματωμένος επεξεργαστής κειμένου -Name[eo]=Interna tekstredaktilo -Name[es]=Editor de texto empotrable -Name[et]=Põimitud tekstiredaktor -Name[eu]=Kapsulatutako testu-editorea -Name[fa]=ویرایشگر متن نهفته -Name[fi]=Upotettava tekstieditori -Name[fr]=Éditeur de texte intégré -Name[fy]=Ynsletten tekstbewurker -Name[ga]=Eagarthóir téacs leabaithe -Name[gl]=Editor de Textos Incrustado -Name[he]=עורך טקסט מוטבע -Name[hi]=अंतर्निहित पाठ संपादक -Name[hr]=Ugrađeni uređivač teksta -Name[hsb]=Integrowane wobdźěłanje tekstow -Name[hu]=Beágyazott szövegszerkesztő -Name[id]=Komponen Editor Teks Embedded -Name[is]=Ívafinn textaritill -Name[it]=Editor di testi integrato -Name[ja]=埋め込みテキストエディタ -Name[ka]=ტექსტის ჩადგმული რედაქტორი -Name[kk]=Ендірілетін мәтін редакторы -Name[km]=កម្មវិធី​និពន្ធ​អត្ថបទ​ដែល​បាន​បង្កប់ -Name[ko]=끼워넣은 글월 편집기 -Name[lb]=Agebauten Texteditor -Name[lt]=Įdėtas tekstų redaktorius -Name[lv]=Iegultais teksta redaktors -Name[mk]=Вгнезден текст уредувач -Name[mn]=Холбоост текст боловсруулагч -Name[ms]=Editor Teks Terimplan -Name[nb]=Innebygget skriveprogram -Name[nds]=Inbett Texteditor -Name[ne]=सम्मिलित पाठ सम्पादक -Name[nl]=Ingebedde tekst-editor -Name[nn]=Inkluderbart skriveprogram -Name[nso]=Mofetosi wa Sengwalwana yo a Robaditswego -Name[pa]=ਸ਼ਾਮਿਲ ਪਾਠ ਸੰਪਾਦਕ -Name[pl]=Osadzony edytor tekstu -Name[pt]=Editor de Texto Embebido -Name[pt_BR]=Editor de textos integrado -Name[ro]=Editor de text înglobat -Name[ru]=Встроенный текстовый редактор -Name[rw]=Muhinduzi yUmwandiko Irimo -Name[se]=Vuojuhahtti čállinprográmma -Name[sk]=Vložiteľný textový editor -Name[sl]=Vključeni urejevalnik besedil -Name[sq]=Tekst Editori i ngulur -Name[sr]=Уграђени уређивач текста -Name[sr@Latn]=Ugrađeni uređivač teksta -Name[ss]=Sihleli sembhalo lesilele -Name[sv]=Inbäddad texteditor -Name[ta]=உட்பொதிந்த உரை தொகுப்பி -Name[te]=పొదగిన వాచకం సరిచేయునది -Name[tg]=Таҳриргари матни дарунсохт -Name[th]=โปรแกรมแก้ไขข้อความแบบฝังตัว -Name[tr]=Gömülü Metin Düzenleyici -Name[tt]=Mäten öçen Quşılma-Üzgärtkeçe -Name[uk]=Вмонтований текстовий редактор -Name[uz]=Ichki matn tahrirchi -Name[uz@cyrillic]=Ички матн таҳрирчи -Name[ven]=Musengulusi wa manwalwa o dzheniswaho -Name[vi]=Bộ Soạn thảo Văn bản nhúng -Name[wa]=Ravalé aspougneu di tecse -Name[xh]=Umhleli Wombhalo Olungiselelweyo -Name[zh_CN]=嵌入式文本编辑器 -Name[zh_HK]=嵌入式文字編輯器 -Name[zh_TW]=嵌入式文字編輯器 -Name[zu]=Umlungisi Wombhalo Oshuthekiwe -Comment=The text editor service provides applications with a text viewer and editor. TDE applications that provide text editing facilities should use this service. -Comment[af]=Die teks redigeerder diens verskaf programme met 'n teks aansig en redigeerder. Kde programme wat verskaf teks redigering fasiliteite moet gebruik hierdie diens. -Comment[ar]=تقوم خدمة محرر النصوص بتزويد التطبيقات بمعاين نصوص ومحرر. يجب أن تستخدم تطبيقات كيدي التي تزود بتسهيلات تحرير النصوص هذه الخدمة. -Comment[az]=Mətn redaktə xidməti proqramları mətn nümayişçisi və editoru ilə tə'min edir. Mətn redaktə bacarıqları olan proqramlar bu xidməti işlətməlidir. -Comment[be]=Сервіс тэкставага рэдактара дазваляе праглядаць і рэдагаваць тэкст у праграмах. Праграмы TDE, якія выконваюць гэтыя функцыі, павінны працаваць з гэтым сервісам. -Comment[bg]=Текстовия редактор, представлява компонент за вграждане в другите програми, който предоставя функционалност за разглеждане и редактиране на текстови файлове. -Comment[bn]=টেক্সট সম্পাদক সার্ভিসটি বিভিন্ন অ্যাপলিকেশন-কে একটি টেক্সট প্রদর্শক এবং সম্পাদক ব্যবহার করার সুযোগ দেয়। কোন কে.ডি.ই. অ্যাপলিকেশন টেক্সট সম্পাদনা করার সুবিধা দিতে চাইলে তার এই সার্ভিসটি ব্যবহার করা উচিত্‍। -Comment[bs]=Text editor servis pruža aplikacijama preglednik i editor teksta. TDE aplikacije koje imaju mogućnost editovanja teksta bi trebale koristiti ovaj servis. -Comment[ca]=El servei de l'editor de text proveeix d'aplicacions amb un visor i un editor de text. Les aplicacions TDE que proveeixen de facilitats d'edició haurien d'emprar aquest servei. -Comment[cs]=Služba textového editoru poskytuje aplikacím prohlížeč a editor textu. Aplikace TDE, které umožňují editovat text, by měly používat tuto službu. -Comment[csb]=Ùsłëżnota tekstowegò editora zezwôlô aplikacejom na przezéranié ë edicejã tekstów. Programë TDE, jaczé ùprzistãpniają nã edicëjną fùnkcëjã, mają brëkòwac ti ùsłëżnonë. -Comment[cy]=Mae'r gwasanaeth golygu testun yn darparu gwelydd testun a golygydd i gymhwysiadau. dylai cymhwysiadau TDE sy'n darparu galluoedd golygu testun ddefnyddio'r gwasanaeth yma. -Comment[da]=Teksteditor-tjenesten udstyrer programmer med en tekstfremviser og editor. TDE-programmer der bruger tekstredigeringsfaciliteter bør benytte denne tjeneste. -Comment[de]=Diese Komponente stellt Programmen einen Textbetrachter und -editor zur Verfügung. TDE-Anwendungen, die mit Textbearbeitung zu tun haben, sollten dieses Angebot nutzen. -Comment[el]=Η υπηρεσία επεξεργαστή κειμένου παρέχει στις εφαρμογές έναν προβολέα και επεξεργαστή κειμένου. Οι εφαρμογές του TDE που παρέχουν δυνατότητες επεξεργασίας κειμένου θα πρέπει να χρησιμοποιούν αυτή την υπηρεσία. -Comment[eo]=La tekstredaktila servo donas vin aplikaĵojn kun tekstrigardilo kaj redaktilo. TDE aplikaĵoj kiuj volas uzi tekstredaktadon uzu tiun ĉi servon. -Comment[es]=El servicio del editor de texto proporciona aplicaciones con un visor de textos y un editor de textos. Las aplicaciones TDE que suministran propiedades de edición deberían utilizar este servicio. -Comment[et]=Tekstiredaktori teenus annab rakendustele komponendi teksti vaatamiseks ja redigeerimiseks. Seda kasutavad kõik TDE rakendused, mis tegelevad teksti redigeerimisega. -Comment[eu]=Testu-editorearen zerbitzuak testu-ikustailea eta editorea duten aplikazioak eskaintzen ditu. Testuak editatzeko aukera ematen duten TDE aplikazioek erabili beharko lukete zerbitzu hau. -Comment[fa]=خدمت ویرایشگر متن، کاربردهایی را توسط یک مشاهده‌گر و ویرایشگر متن، فراهم می‌کند. کاربردهای TDE که امکانات ویرایش متن را فراهم می‌کنند باید از این \ خدمت استفاده نمایند. -Comment[fi]=Tekstieditoripalvelu tarjoaa sovelluksille tekstinäyttäjän- ja muokkaimen. TDE-sovelluksien, jotka tarjoavat tekstinmuokkauspalveluita, tulisi käyttää tätä palvelua. -Comment[fo]=Tekstritiltænastuni gera forrit út við ein tekstvísari og -ritil. TDE-forrit ið geva nýtarin møguleiki fyri at rætta tekst eiga at nýta hesa tænasta. -Comment[fr]=Le service d'édition de texte fournit des applications comportant un afficheur de texte et un éditeur. Les applications TDE qui fournissent des fonctions d'édition de texte devraient utiliser ce service. -Comment[fy]=De tekstbewurkings-fasiliteit foarsjocht programma's fan een tekstwerjouwer en -ferwurker. TDE-applikaasjes mei tekstferwurkingsmooglikheden kinne hjir gebrûk fan meitsje. -Comment[ga]=Cuirtear amharcán téacs agus eagarthóir ar fáil d'fheidhmchláir trín seirbhís eagarthóireachta téacs. Ba cheart d'fheidhmchláir TDE a sholáthraíonn áiseanna eagarthóireachta an tseirbhís seo a úsáid. -Comment[gl]=O servizo de edición de texto fornece ás aplicacións de visor e editor de textos. Todas as aplicacións de TDE que fornezan facilidades de edición de textos deberan empregar este servizo. -Comment[he]=שירות עורך הטקסט מספק ליישומים מציג ועורך טקסט. יישומי TDE שמספקים אמצעים לעריכת טקסט ישתמשו בשירות זה. -Comment[hi]=पाठ संपादक सेवा जो अनुप्रयोगों को एक पाठ दर्शक व एक संपादक उपलब्घ कराती है। केडीई अनुप्रयोग जो पाठ संपादन सुविधा उपलब्ध कराती हैं, उन्हें इसका प्रयोग करना चाहिए। -Comment[hr]=Usluga tekstualnog uređivača aplikacijama omugućuje pregledavanje i uređivanje teksta. TDE aplikacije koje omogućuju uređivanje teksta trebale bi upotrebljavati ovo sučelje. -Comment[hsb]=Wobdźěłanje teksta staji programam wobdźěłarja a wobhladowarja teksta k dispoziciji. TDE-aplikacije, kiž tajke něšto trjebaja, měli tutón serwis wužiwać. -Comment[hu]=A szövegszerkesztő szolgáltatáson keresztül az alkalmazások szövegek megtekintését és szerkesztését végezhetik el. A TDE szövegszerkesztő programjai használhatják. -Comment[id]=Layanan penyuntingan teks memberikan penampil dan penyunting teks untuk aplikasi. Aplikasi TDE yang menyediakan fasilitas penyuntingan teks seharusnya menggunakan layanan ini. -Comment[is]=Ívafni ritillinn færir forritum texta-skoðara og ritil. TDE forrit sem birta ritil til textavinnslu ættu að nota þessa þjónustu. -Comment[it]=Il servizio di editor di testi fornisce alle applicazioni un visualizzatore ed un editor di testi. Le applicazioni TDE che permettono l'elaborazione di testi dovrebbero usare questo servizio. -Comment[ja]=テキストエディタサービスはアプリケーションにテキストビューアとテキストエディタを提供します。テキスト編集の機能を持つ TDE アプリケーションはこれを使用します。 -Comment[ka]=პროგრამების ტექსტური რედაქტორი ტექსტების საჩვენებლად და დასარედაქტირებლად. იგი გამოიყენება იმ TDE პროგრამების მიერ, რომელთაც ტექსტის რედაქტირება ესაჭიროებათ. -Comment[kk]=Қолданбаларға мәтінді қарау және өңдеу мүмкіншілікті беретін қызмет. Мәтінді өңдеу үшін TDE қолданбалар осы қызметті пайдалану керек. -Comment[km]=សេវា​កម្មវិធី​និពន្ធ​អត្ថបទ​ផ្តល់​នូវ​សំណុំ​កម្មវិធីរួម​មាន​កម្មវិធី​មើល​អត្ថបទ និង​កម្មវិធី​និពន្ធ​អត្ថបទ ។ សំណុំ​កម្មវិធី TDE ដែល​ផ្តល់​មធ្យោបាយ​និពន្ធ​អត្ថបទ គួរ​ប្រើ​សេវា​នេះ ។ -Comment[ko]=이 글월 편집기 서비스는 응용 프로그램이 글월을 보거나 고칠 수 있는 기능을 제공합니다. 글월을 고칠 수 있는 TDE 응용 프로그램은 이 서비스를 써야 합니다. -Comment[lb]=Den Texeditor-Service stellt Programmer en Textlieser an en Texteditor zur Verfügung.TDE-Programmer, déi Textmanipuléierungsfunktiounen ubidden, sollen dëse Service benotzen. -Comment[lt]=Teksto redaktoriaus tarnyba pateikia programoms teksto žiūriklį ir redaktorių. TDE programos, leidžiančios redaguoti tekstą, turėtų naudoti šią tarnybą. -Comment[lv]=Teksta redaktora serviss sniedz teksta aplūkošanas un rediģēšanas pakalpojumus programmām. TDE programmām, kurām tas ir nepieciešams, vajadzētu izmantot šo servisu. -Comment[mk]=Сервисот за текст уредувач ги снабдува апликациите со текст прегледник и уредувач. TDE апликациите што овозможуваат уредување текст би требало да го користат овој сервис. -Comment[mn]=Текст засварлагч үйлчилгээ нь текст харах болон засварлах прогрммуудаар хангадаг. TDE программууд энэ үйлчилгээний хэрэглэх хэрэгтэй текст засварлах нэмэлт боломжуудаар хангадаг. -Comment[ms]= Servis penyunting teks yang menyediakan aplikasi dengan pelihat teks dan editor. Aplikasi TDE yang menyediakan kemudahan penyuntingan teks patut menggunakan servis ini. -Comment[mt]=Is-servizz ta' editur ta' test jipprovdi l-programmi b'werrej u editur ta' test. Programmi tal-TDE li jipprovdu servizzi ta' editjar ta' test għandhom jużaw dan is-servizz. -Comment[nb]=Skriveprogrammet gir kan vise og redigere teks. TDE-programmer som kan redigere tekst bør bruke denne tjenesten. -Comment[nds]=De Texteditor-Deenst föögt Programmen en Textwieser un -editor to. TDE-Programmen, mit de Texten bewerkt warrt, schöölt em bruken. -Comment[ne]=पाठ सम्पादक सेवाले पाठ दर्शक र सम्पादकसँग अनुप्रयोग उपलब्ध गराउँछ । TDE अनुप्रयोग जसले पाठ सम्पादक सुविधाहरू उपलब्ध गर्छ त्यसले यो सेवा प्रयोग गर्छ । -Comment[nl]=Dit component stelt programma's een tekstviewer en -editor tot hun beschikking. TDE-toepassingen die te maken hebben met het bewerken van tekst kunnen gebruik maken van deze aangeboden dienst. -Comment[nn]=Skriveprogramtenesta tilbyr vising og redigering av tekst. TDE-program som skal visa eller redigera tekst bør bruka denne tenesta. -Comment[nso]=Tirelo ya phetoso ya sengwalwana e aba ditshumiso le molebeledi lemofetosi wa sengwalwana. Ditshumiso tsa TDE tseo di abago ditirelo tsaphetoso ya sengwalwana di swanetse go somisa tirelo ye. -Comment[pa]=ਪਾਠ ਸੰਪਾਦਕ ਸੇਵਾ ਉਹ ਸਾਰੇ ਕਾਰਜ ਉਪਲੱਬਧ ਕਰਵਾਉਦਾ ਹੈ, ਜੋ ਕਿ ਪਾਠ ਦਰਸ਼ਕ ਤੇ ਸੰਪਾਦਕ ਸ਼ਾਮਿਲ ਹਨ। TDE ਕਾਰਜ ਜੋ ਕਿ ਪਾਠ ਸੰਪਾਦਨ ਦੀ ਸਹੂਲਤ ਉਪਲੱਬਧ ਕਰਵਾਉਦੀਆਂ ਹਨ, ਇਸ ਨੂੰ ਇਸਤੇਮਾਲ ਕਰਦੀਆਂ ਹਨ। -Comment[pl]=Usługa edytora tekstowego pozwala programom na przeglądanie i edycję tekstów. Programy TDE, które udostępniają funkcje edycyjne, powinny używać tej usługi. -Comment[pt]=O serviço de edição de texto oferece às aplicações um visualizador e editor de texto. As aplicações do TDE que oferecem funcionalidade de edição de texto devem usar este serviço. -Comment[pt_BR]=O serviço de edição de texto fornece aplicações com um visualizador e um editor de textos. Aplicações do TDE que fornecem facilidades de edição de texto devem usar este serviço. -Comment[ro]=Serviciul de editare text asigură aplicaţiilor un vizualizor de text şi un editor. Aplicaţiile TDE care oferă capabilităţi de editare de text ar trebui să utilizeze acest serviciu. -Comment[ru]=Сервис текстового редактора для приложений, в которых требуется просмотр и редактирование текста. Его должны использовать приложения TDE, где требуется редактирование текста. -Comment[rw]=Serivise ya muhinduzi y'umwandiko itanga amaporogaramu afite mugaragaza na muhinduzi y'umwandiko. Amaporogaramu TDE atanga uburyo bwo guhindura umwandiko agomba gukoresha iyi serivise. -Comment[se]=Čállinprográmmabálvalus fállá teakstačájeheami ja -doaimmaheaheami. TDE-prográmmat, mat fállet teakstadoaimmahanvejolašvuođaid, galggašedje geavahit dán bálvalusa. -Comment[sk]=Služba textového editora poskytuje aplikáciám prehliadač a editor textových súborov. Aplikácie TDE, ktoré podporujú úpravu textu, by mali používať túto službu. -Comment[sl]=Storitev urejevalnika besedila omogoča programom dostop do pregledovalnika in urejevalnika besedil. Programi za TDE, ki omogočajo urejanje besedila, naj bi uporabljali to storitev. -Comment[sq]=Servisi i tekst editorit i pajis aplikacionet me vështruesin dhe editorin e tekstit. Aplikacionet e TDE-së që na pajisin me shërbime të editimit të tekstit duhet ta përdorin këtë servis. -Comment[sr]= Сервис уређивача текста обезбеђује програмима преглед и измене текстова. TDE програми који обезбеђују могућност обраде текста требало би да користе овај сервис. -Comment[sr@Latn]= Servis uređivača teksta obezbeđuje programima pregled i izmene tekstova. TDE programi koji obezbeđuju mogućnost obrade teksta trebalo bi da koriste ovaj servis. -Comment[ss]=Lusito lwekuhleal umbhalo luniketa ticelo letinesibuki sembhalo kanye nesihleli. Ticelo te KDe letiniketa tinsita tekuhlelwa kwembhalo kufanele tisebentise lolusito. -Comment[sv]=Texteditortjänsten ger program en textvisare och editor. TDE-program som tillhandahåller textredigeringsfunktioner bör använda denna tjänst. -Comment[ta]=உரை மற்றும் தொகுப்பாளருடனான பயன்பாடுகளை உரை தொகுப்பாளர் சேவை வழங்குகிறது. உரை தொகுக்கும் வசதிகளை வழங்கும் கேடிஇ பயன்பாடுகள் இச்சேவையைப் பயன்படுத்த வேண்டும். -Comment[te]=కార్యక్రమాలకు వాచకం సరిచేయు సేవ ఒక వాచకం విక్షణ మరియు సరిచెయుటకు సహాయపడును. కెడిఈ కార్యక్రమాలు వాచకం సరిచెయు సౌకర్యాలు వున్నట్టైతె దిని సేవ ను ఉపయొగించొకొవలెను -Comment[tg]=Хидмати таҳриргари матн барномаҳоро бо намоишгар ва таҳриргари матн таъмин мекунад. Барномаҳои TDE дорои таҳриргари матн бояд ин хидмат истифода барад. -Comment[th]=บริการตัวแก้ไขข้อความ จะจัดเตรียมตัวดูข้อความและตัวแก้ไขข้อความให้กับแอพพลิเคชัน แอพพลิเคชันของ TDE ที่เตรียมความสามารถในการแก้ไขข้อความมาให้ ควรที่จะใช้บริการนี้ -Comment[tt]=Mäten üzgärtü xezmäte törle yazılımnarnı mäten kürsätkeçe/üzgärtkeçe belän tä'min itä. Mäten üzgärtüçe TDE-yazılımnar bu xezmätne qullanırğa tieş. -Comment[uk]=Служба "Текстовий редактор" постачає програми з переглядачем та редактором тексту. Програми TDE, які надають можливість редагування тексту, повинні користуватись цією службою. -Comment[uz]=Matn tarhrirchi xizmati dasturlarni matn koʻruvchi va tahrirchi bilan taʼminlaydi. Matn tahrirlash imkoniyatini yaratuvchi TDE dasturlari shu xizmatni ishlatishi kerak. -Comment[uz@cyrillic]=Матн тарҳрирчи хизмати дастурларни матн кўрувчи ва таҳрирчи билан таъминлайди. Матн таҳрирлаш имкониятини яратувчи TDE дастурлари шу хизматни ишлатиши керак. -Comment[ven]=Tshumelo ya musengulusi wa manwalwa i diswa apulifikhesheni dzirena na vhavhoni vha manwalwa na musengulusi. Apulifikhesheni ya TDE ine ya disa zwishumiswa zwa u sengulusa manwalwa i fanela u shumisa tshumelo ino. -Comment[vi]=Dịch vụ soạn thảo văn bản cung cấp cho ứng dụng một bộ xem và soạn thảo văn bản. Các ứng dụng TDE mà cung cấp khả năng soạn thảo văn bản nên dùng dịch vụ này. -Comment[xh]=Inkonzo yomhleli wombhalo onika izicelo ngombonisi wombhalo nomhleli Izicelo ze TDE ezinikezela ngohlelo lombhalo ekufuneka isebenzise lenkonzo. -Comment[zh_CN]=文本编辑器服务提供了文本查看器和编辑器的应用程序。提供文本编辑功能的 TDE 应用程序都应该使用此服务。 -Comment[zh_HK]=文字編輯服務為各種程式提供一個檢視和編輯文字的介面。任何提供文字編輯功能的 TDE 程式都應該使用這項服務。 -Comment[zh_TW]=文字編輯服務提供程式一個文字檢視器以及編輯器。提供文字編輯功能的 TDE 程式擁該使用這項服務。 -Comment[zu]=Umsebenzi womlungisi wombhalo onikeza imiyaleli ngombukisi wombhalo kanye nomhleli.Abayaleli abanikeza izisebenzi zokulungisa umbhalo okumele zisebenzise lomsebenzi. -ServiceTypeToConfigure=KTextEditor/Document -MimeTypeOfInterest=text/plain -defaultImplementation=katepart -storeInFile=default_components -valueSection=KTextEditor -valueName=embeddedEditor -configurationType=component diff --git a/interfaces/ktexteditor/ktexteditor.cpp b/interfaces/ktexteditor/ktexteditor.cpp deleted file mode 100644 index c822dc93c..000000000 --- a/interfaces/ktexteditor/ktexteditor.cpp +++ /dev/null @@ -1,242 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include "document.h" -#include "view.h" -#include "plugin.h" -#include "editor.h" - -#include -#include -#include - -#include "document.moc" -#include "view.moc" -#include "plugin.moc" -#include "editor.moc" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateDocument - { - public: - PrivateDocument () - { - } - - ~PrivateDocument() - { - } - }; - - class PrivateView - { - public: - PrivateView () - { - } - - ~PrivateView() - { - } - }; - - class PrivatePlugin - { - public: - PrivatePlugin () - { - } - - ~PrivatePlugin () - { - } - - class Document *m_doc; - }; - - class PrivatePluginViewInterface - { - public: - PrivatePluginViewInterface () - { - } - - ~PrivatePluginViewInterface () - { - } - }; - - class PrivateEditor - { - public: - PrivateEditor () - { - } - - ~PrivateEditor() - { - } - }; -} - -unsigned int Document::globalDocumentNumber = 0; -unsigned int View::globalViewNumber = 0; -unsigned int Plugin::globalPluginNumber = 0; -unsigned int PluginViewInterface::globalPluginViewInterfaceNumber = 0; -unsigned int Editor::globalEditorNumber = 0; - -Document::Document( TQObject *parent, const char *name ) : KTextEditor::Editor (parent, name ) -{ - globalDocumentNumber++; - myDocumentNumber = globalDocumentNumber; - myDocumentListPosition = -1; // Don't care -} - -Document::~Document() -{ -} - -unsigned int Document::documentNumber () const -{ - return myDocumentNumber; -} - -long Document::documentListPosition () const -{ - return myDocumentListPosition; -} - -void Document::setDocumentListPosition (long pos) -{ - myDocumentListPosition = pos; -} - -TQCString Document::documentDCOPSuffix () const -{ - TQCString num; - num.setNum (documentNumber()); - - return num; -} - -View::View( Document *, TQWidget *parent, const char *name ) : TQWidget( parent, name ) -{ - globalViewNumber++; - myViewNumber = globalViewNumber; -} - -View::~View() -{ -} - -unsigned int View::viewNumber () const -{ - return myViewNumber; -} - -TQCString View::viewDCOPSuffix () const -{ - TQCString num1, num2; - num1.setNum (viewNumber()); - num2.setNum (document()->documentNumber()); - - return num2 + "-" + num1; -} - -Plugin::Plugin( Document *document, const char *name ) : TQObject (document, name ) -{ - globalPluginNumber++; - myPluginNumber = globalPluginNumber; - d = new PrivatePlugin (); - d->m_doc = document; -} - -Plugin::~Plugin() -{ - delete d; -} - -unsigned int Plugin::pluginNumber () const -{ - return myPluginNumber; -} - -Document *Plugin::document () const -{ - return d->m_doc; -} - -PluginViewInterface::PluginViewInterface() -{ - globalPluginViewInterfaceNumber++; - myPluginViewInterfaceNumber = globalPluginViewInterfaceNumber; -} - -PluginViewInterface::~PluginViewInterface() -{ -} - -unsigned int PluginViewInterface::pluginViewInterfaceNumber () const -{ - return myPluginViewInterfaceNumber; -} - -Editor::Editor( TQObject *parent, const char *name ) : KParts::ReadWritePart( parent, name ) -{ - globalEditorNumber++; - myEditorNumber = globalEditorNumber; -} - -Editor::~Editor() -{ -} - -unsigned int Editor::editorNumber () const -{ - return myEditorNumber; -} - -Editor *KTextEditor::createEditor ( const char* libname, TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name ) -{ - return KParts::ComponentFactory::createPartInstanceFromLibrary( libname, parentWidget, widgetName, parent, name ); -} - -Document *KTextEditor::createDocument ( const char* libname, TQObject *parent, const char *name ) -{ - return KParts::ComponentFactory::createPartInstanceFromLibrary( libname, 0, 0, parent, name ); -} - -Plugin *KTextEditor::createPlugin ( const char* libname, Document *document, const char *name ) -{ - return KParts::ComponentFactory::createInstanceFromLibrary( libname, document, name ); -} - -PluginViewInterface *KTextEditor::pluginViewInterface (Plugin *plugin) -{ - if (!plugin) - return 0; - - return dynamic_cast(plugin); -} - diff --git a/interfaces/ktexteditor/ktexteditor.desktop b/interfaces/ktexteditor/ktexteditor.desktop deleted file mode 100644 index 17556bdf6..000000000 --- a/interfaces/ktexteditor/ktexteditor.desktop +++ /dev/null @@ -1,86 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=KTextEditor/Document -X-TDE-Derived=KParts/ReadWritePart -Comment=Embeddable Text Editor Component (with Doc/View Separation) -Comment[af]=Inlegbare Teks Redigeerder Komponent (met Dok/Besigtig Seperasie) -Comment[ar]=مكوّن تحرير النصوص القابل للدمج )مع Doc/View Separation( -Comment[az]=Hopdurula Bilən Mətn Editor Komponenti (Doc/Nümayiş Ayrımlı) -Comment[be]=Унутраны тэкставы рэдактар (з падзелам Дакумент/Прагляд) -Comment[bg]=Текстов редактор (с разделение между Doc/View) -Comment[bn]=অভ্যন্তরীণ টেক্সট সম্পাদক কম্পোনেন্ট (পৃথক ডক/ভিউ সহ) -Comment[bs]=Umetljiva komponenta za obradu teksta (sa odvojenim Doc/View) -Comment[ca]=Component encastable de l'editor de text (amb separació Doc/Vista) -Comment[cs]=Pohltitelná komponenta textového editoru (s oddělením Doc/View) -Comment[csb]=Dzéł editora tekstu (do òbsôdzaniô, z paradygmatã Dokùment/Wëzdrzatk) -Comment[cy]=Cydran Golygydd Testun Mewnadeiladwy (wrth Wahanu Dogfen/Golwg) -Comment[da]=Teksteditorkomponent som kan indlejres (med dok./visning-adskillelse) -Comment[de]=Einbettungsfähige Editorkomponente (mit Text/Ansicht-Aufteilung) -Comment[el]=Ενσωματώσιμο στοιχείο επεξεργαστή κειμένου (με διαχωρισμό Doc/View) -Comment[eo]=Enkorpigebla redaktilo (kun apartigo de dokumento kaj rigardo) -Comment[es]=Componente incrustable de editor de textos (con separación Doc/Vista) -Comment[et]=Põimitav tekstiredaktori komponent (dokument/vaade eraldamisega) -Comment[eu]=Testu-editorearen kapsulatutako osagaia (Dok/Ikusi bereizketarekin) -Comment[fa]=مولفۀ ویرایشگر متن نهفته )با سند/نمای مجزا( -Comment[fi]=Upotettava tekstimuokkauskomponentti (Asiakirja/Näkymä-jaolla) -Comment[fr]=Composant d'édition de texte intégrable (avec séparation doc / vue) -Comment[fy]=Yn te sluten tekstbewurkerkomponint (mei skieding fan tekst/werjefte) -Comment[ga]=Comhpháirt eagarthóireacht téacs inleabaithe (le deighilt idir cáipéis agus amharc) -Comment[gl]=Compoñente incrustábel de Edición de Texto (cunha Separación Doc/Vista) -Comment[he]=רכיב עורך טקסט בר הטבעה (עם הפרדה בין מסמך לתצוגה) -Comment[hi]=अंतर्निहित किया जा सकने वाला पाठ संपादक (डाक/व्यू सेपरेशन के साथ) -Comment[hr]=Ugradiva komponenta obrade teksta (s Doc/View razdvajanjem) -Comment[hsb]=Komponenta za integrowane wobdźěłanje teksta -Comment[hu]=Beágyazható szövegszerkesztő (dokumentum/nézet modellel) -Comment[id]=Komponen Penyuntingan Teks Tersisipkan (dengan Pemisahan Doc/View) -Comment[is]=Ívafinn textaritill (með skjal/sýn aðskilnaði) -Comment[it]=Componente integrabile per l'elaborazione di testi (con separazione documento/vista) -Comment[ja]=埋め込み可能なテキストエディタコンポーネント (Doc/View 分離) -Comment[ka]=ტექსტის რედაქტირების ჩადგმადი კომპონენტი (დოკუმენტი/ჩვენება მოდელის მხარდაჭერით) -Comment[kk]=Ендірілетін мәтін өңдеу компоненті (Құжат/көрініс үлгіні қолдайтын) -Comment[km]=សមាសភាគ​កម្មវិធីនិពន្ធ​អត្ថបទដែល​អាចបង្កប់ (ដោយ​ប្រើ​ការ​បំបែក Doc/View) -Comment[ko]=끼워넣는 글월 편집기 구성 요소 (Doc/View 나눔) -Comment[lb]=Abettbar Texteditor-Komponent (mat Dokument/Usiicht Trennung) -Comment[lt]=Įdedamas tekstų redaktoriaus komponentas (su Doc/View atskyrimu) -Comment[lv]=Iegulstama tekstu redaktora komponente (ar Dok/Skatīt atdalīšanu) -Comment[mk]=Вгнездлива компонента за уредување на текст (со Док/Приказ раздвојување) -Comment[mn]=Суулгах боломж бүхий засварлагчийн бүрдэл хэсэг(Teкст/Харах-тусгаарлалттай) -Comment[ms]=Komponen Penyunting Teks Boleh Selit (Dokumentasi/Pelihat berasingan) -Comment[mt]=Komponent integrat editur tat-test (b'separazzjoni dokument/wiri) -Comment[nb]=Innebyggbar tekstredigeringskomponent (med Doc/View-skille) -Comment[nds]=Inbettbor Texteditor-Komponent (mit Dokment/Ansicht-Trennen) -Comment[ne]=सम्मिलित पाठ सम्पादक अवयव (डक/दृश्य विभाजनसँग) -Comment[nl]=Ingebed teksteditorcomponent (met scheiding van tekst/weergave) -Comment[nn]=Inkluderbart komponent for tekstvising (med Doc/View-deling) -Comment[nso]=Seripa seo se Robatsegago sa Mofetosi wa Sengwalwana (le Karogano ya Doc/Bona) -Comment[pa]=ਸ਼ਾਮਿਲ ਹੋਣਯੋਗ ਪਾਠ ਸੰਪਾਦਕ ਭਾਗ (Doc/ਦਰਿਸ਼ ਵੱਖ ਕਰਨ ਨਾਲ) -Comment[pl]=Składnik edytora tekstu (do osadzania, z paradygmatem Dokument/Widok) -Comment[pt]=Componente Incorporado do Editor de Texto (com Separação entre Documentos) -Comment[pt_BR]=Componente de edição de textos integrado (com separação de Documentação/Visualização) -Comment[ro]=Componentă de editare text (cu separare Doc/Vizualizare) -Comment[ru]=Встраиваемый элемент редактора текста (с поддержкой модели документ/вид) -Comment[rw]=Inyangingo Muhinduzi y'Umwandiko Ishyirwamo (ifite itandukanya Inyandiko/Ukugaragaza) -Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (Doc/View-sirremiin) -Comment[sk]=Vložiteľný komponent textového editora (s oddelením Doc/View) -Comment[sl]=Vgradljiva komponenta urejevalnika besedil (z ločevanjem pogleda in dokumenta) -Comment[sq]=Komponenta e ngulshme e Tekst Editorit (me ndarje Dokument/Vështrues) -Comment[sr]=Уградива компонента за уређивање текста (са „документ/приказ“ одвајањем) -Comment[sr@Latn]=Ugradiva komponenta za uređivanje teksta (sa „dokument/prikaz“ odvajanjem) -Comment[ss]=Incenye yesihleli sembhalo lenamatselekako (ne Doc/Bona kwehlukana) -Comment[sv]=Inbäddningsbar texteditor (med dok/vyseparation) -Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் பகுதி (ஆவண/காட்சி பிரிவுகளுடன்) -Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన వున్నది) -Comment[tg]=Қисми таҳриргари матни дарунсохт (бо вазифаи намоиши санад) -Comment[th]=คอมโปเนนท์แก้ไขข้อความที่ฝังได้ (โดยแยก เอกสาร/แสดงผล) -Comment[tr]=Gömülebilir Metin Düzenleyici Bileşeni (Doc/View ayrımı dahil) -Comment[tt]=Mäten Üzgärtüçe Quşılma-Komponent (İstälek/Küreneş ayıru belän) -Comment[uk]=Компонент редактора текстів, який можна вбудовувати (з розділенням документ/вигляд) -Comment[uz]=Ichiga oʻrnatib boʻladigan matn tahrirchi komponenti (hujjat/koʻrinish imkoniyati bilan) -Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган матн таҳрирчи компоненти (ҳужжат/кўриниш имконияти билан) -Comment[ven]=Khomphonente ya musengulusi ya manwalwa (ina Doc/u khethekana ha u vhona) -Comment[vi]=Thành phần Soạn thảo Văn bản có nhúng được (có khả năng phân cách tài liệu/khung xem) -Comment[xh]=Inxenye Yomhleli Wombhalo Olungiselelweyo (ngo Xwebhu/Ulwahlulo Lwemboniselo) -Comment[zh_CN]=可嵌入的文本编辑器部件(带 文档/查看 分离) -Comment[zh_HK]=可嵌入的文字編輯器元件 (Doc/View 分開) -Comment[zh_TW]=可嵌入的文字編輯器元件 (Doc/View 分開) -Comment[zu]=IIunga Lomlungisi Wombhalo (Ngokuhlukana kwe-Doc/Umbukiso) diff --git a/interfaces/ktexteditor/ktexteditoreditor.desktop b/interfaces/ktexteditor/ktexteditoreditor.desktop deleted file mode 100644 index 6048da92b..000000000 --- a/interfaces/ktexteditor/ktexteditoreditor.desktop +++ /dev/null @@ -1,86 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=KTextEditor/Editor -X-TDE-Derived=KParts/ReadWritePart -Comment=Embeddable Text Editor Component (without Doc/View Separation) -Comment[af]=Inlegbare Teks Redigeerder Komponent (sonder om te Dok/Besigtig Seperasie) -Comment[ar]=مكوّن تحرير النصوص القابل للدمج )مع Doc/View Separation( -Comment[az]=Hopdurula Bilən Mətn Editor Komponenti (Doc/Nümayiş Ayrımsız) -Comment[be]=Унутраны тэкставы рэдактар (без падзелу Дакумент/Прагляд) -Comment[bg]=Текстов редактор (без разделение между Doc/View) -Comment[bn]=অভ্যন্তরীণ টেক্সট সম্পাদক কম্পোনেন্ট (পৃথক ডক/ভিউ ছাড়া) -Comment[bs]=Umetljiva komponenta za obradu teksta (bez odvojenog Doc/View) -Comment[ca]=Component encastable de l'editor de text (sense separació Doc/Vista) -Comment[cs]=Pohltitelná komponenta textového editoru (bez oddělení Doc/View) -Comment[csb]=Dzéł editora tekstu (do òbsôdzaniô, bez paradygmatu Dokùment/Wëzdrzatk) -Comment[cy]=Cydran Golygydd Testun Mewnadeiladwy (heb Wahanu Dogfen/Golwg) -Comment[da]=Teksteditorkomponent som kan indlejres (uden dok./visning-adskillelse) -Comment[de]=Einbettungsfähige Editorkomponente (ohne Text/Ansicht-Aufteilung) -Comment[el]=Ενσωματώσιμο στοιχείο επεξεργαστή κειμένου (χωρίς διαχωρισμό Doc/View) -Comment[eo]=Enkorpigebla redaktilo (sen apartigo de dokumento kaj rigardo) -Comment[es]=Componente incrustable de editor de textos (sin separación Doc/Vista) -Comment[et]=Põimitav tekstiredaktori komponent -Comment[eu]=Testu-editorearen kapsulatutako osagaia (Dok/Ikusi bereizketarik gabe) -Comment[fa]=مولفۀ ویرایشگر متن نهفته ) بدون سند/نمای مجزا( -Comment[fi]=Upotettava tekstimuokkauskomponentti (ilman Asiakirja/Näkymä-jakoa) -Comment[fr]=Composant d'édition de texte intégrable (sans séparation doc / vue) -Comment[fy]=Yn te sluten tekstbewurkerkomponint (sûnder skieding fan tekst/werjefte) -Comment[ga]=Comhpháirt eagarthóireacht téacs inleabaithe (gan deighilt idir cáipéis agus amharc) -Comment[gl]=Compoñente incrustábel de Edición de Texto (sen Separación Doc/Vista) -Comment[he]=רכיב עורך טקסט בר הטבעה (בלי הפרדה בין מסמך לתצוגה) -Comment[hi]=अंतर्निहित किया जा सकने वाला पाठ संपादक (डाक/व्यू सेपरेशन के बगैर) -Comment[hr]=Ugradiva komponenta obrade teksta (bez Doc/View razdvajanja) -Comment[hsb]=Integrujomna komponenta za wobdźěłanje tekstow (bjez doc/view-separacije) -Comment[hu]=Beágyazható szövegszerkesztő (dokumentum/nézet modell nélkül) -Comment[id]=Komponen Penyuntingan Teks Tersisipkan (tanpa Pemisahan Doc/View) -Comment[is]=Ívafinn textaritill (án skjal/sýn aðskilnaðar) -Comment[it]=Componente integrabile per l'elaborazione di testi (senza separazione documento/vista) -Comment[ja]=埋め込み可能なテキストエディタコンポーネント (Doc/View 分離なし) -Comment[ka]=ტექსტის რედაქტირების ჩადგმადი კომპონენტი (დოკუმენტი/ჩვენება მოდელის მხარდაჭერის გარეშე) -Comment[kk]=Ендірілетін мәтін өңдеу компоненті (Құжат/көрініс үлгіні қолдамайтын) -Comment[km]=សមាសភាគ​កម្មវិធីនិពន្ធ​អត្ថបទ​ដែល​អាច​បង្កប់ (ដោយ​គ្មាន​ការបំបែក Doc/View) -Comment[ko]=끼워넣는 글월 편집기 구성 요소 (Doc/View 나누지 않음) -Comment[lb]=Abettbar Texteditor-Komponent (ouni Dokument/Usiicht Trennung) -Comment[lt]=Įdedamas tekstų redaktoriaus komponentas (be Doc/View atskyrimo) -Comment[lv]=Iegulstama tekstu redaktora komponente (bez Dok/Skatīt atdalīšanas) -Comment[mk]=Вгнездлива компонента за уредување на текст (без Док/Приказ раздвојување) -Comment[mn]=Суулгах боломж бүхий засварлагчийн бүрдэл хэсэг(Teкст/Харах-тусгаарлалтгүй) -Comment[ms]=Komponen Penyunting Teks Boleh Selit (Dokumentasi/Pelihat tidak berasingan) -Comment[mt]=Komponent integrat editur tat-test (mingħajr separazzjoni dokument/wiri) -Comment[nb]=Innebyggbar tekstredigeringskomponent (uten Doc/View skille) -Comment[nds]=Inbettbor Texteditor-Komponent (ahn Dokment/Ansicht-Trennen) -Comment[ne]=सम्मिलित पाठ सम्पादक अवयव (डक/दृश्य विभाजनवाहेक) -Comment[nl]=Ingebed teksteditorcomponent (zonder scheiding van tekst/weergave) -Comment[nn]=Inkluderbart komponent for tekstvising (utan Doc/View-deling) -Comment[nso]=Seripa seo se Robatsegago sa Mofetosi wa Sengwalwana (kantle le Karogano ya Doc/Bona) -Comment[pa]=ਸ਼ਾਮਿਲ ਹੋਣਯੋਗ ਪਾਠ ਸੰਪਾਦਕ ਭਾਗ (Doc/ਦਰਿਸ਼ ਵੱਖ ਕਰਨ ਬਿਨਾਂ) -Comment[pl]=Składnik edytora tekstu (do osadzania, bez paradygmatu Dokument/Widok) -Comment[pt]=Componente Incorporado do Editor de Texto (sem Separação entre Documentos) -Comment[pt_BR]=Componente de edição de textos integrado (sem separação de Documentação/Visualização) -Comment[ro]=Componentă de editare text (fără separare Doc/Vizualizare) -Comment[ru]=Встраиваемый элемент редактора текста (без поддержки модели документ/вид) -Comment[rw]=Inyangingo Muhinduzi y'Umwandiko Ishyirwamo (nta tandukanya Inyandiko/Ukugaragaza) -Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (almmá Doc/View-sirrema) -Comment[sk]=Vložiteľný komponent textového editora (bez oddelenia Doc/View) -Comment[sl]=Vgradljiva komponenta urejevalnika besedil (brez ločevanja pogleda in dokumenta) -Comment[sq]=Komponenta e ngulshme e Tekst Editorit (pa ndarje Dokument/Vështrues) -Comment[sr]=Уградива компонента за уређивање текста (без „документ/приказ“ одвајања) -Comment[sr@Latn]=Ugradiva komponenta za uređivanje teksta (bez „dokument/prikaz“ odvajanja) -Comment[ss]=Incenye yesihleli sembhalo lenamatselekako (ngaphandle kwe Doc/Bona kwehlukana) -Comment[sv]=Inbäddningsbar texteditor (utan dok/vyseparation) -Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் கூறு (ஆவண/காட்சி பிரிவுகளற்ற) -Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన లేకుండా) -Comment[tg]=Қисми таҳриргари матни дарунсохт (бе вазифаи намоиши санад) -Comment[th]=คอมโปเนนท์แก้ไขข้อความที่ฝังได้ (โดยไม่แยก เอกสาร/แสดงผล) -Comment[tr]=Gömülebilir Metin Düzenleyici Bileşeni (Doc/View ayrımı yok) -Comment[tt]=Mäten Üzgärtüçe Quşılma-Komponent (İstälek/Küreneş ayıru belän tügel) -Comment[uk]=Компонент редактора текстів, який можна вбудовувати (без розділення документ/вигляд) -Comment[uz]=Ichiga oʻrnatib boʻladigan matn tahrirchi komponenti (hujjat/koʻrinish imkoniyatsiz) -Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган матн таҳрирчи компоненти (ҳужжат/кўриниш имкониятсиз) -Comment[ven]=Khomphonente ya musengulusi wa manwalwa (i sina Doc/U khethekana hau vhona) -Comment[vi]=Thành phần Soạn thảo Văn bản có nhúng được (không có khả năng phân cách tài liệu/khung xem) -Comment[xh]=Ingxenye Yomhleli Wombhalo Olungiselekayo (ngaphandle Koxwebhu/Ulwahlulo Lwemboniselo) -Comment[zh_CN]=可嵌入的文本编辑器部件(不带 文档/查看 分离) -Comment[zh_HK]=可嵌入的文字編輯器元件 (Doc/View 不分開) -Comment[zh_TW]=可嵌入的文字編輯器元件 (Doc/View 不分開) -Comment[zu]=Ilunga Lomlungisi Wombhalo (ngaphandle Kokuhlukana kwe-Doc/Umbukiso) diff --git a/interfaces/ktexteditor/ktexteditorplugin.desktop b/interfaces/ktexteditor/ktexteditorplugin.desktop deleted file mode 100644 index b2e180a93..000000000 --- a/interfaces/ktexteditor/ktexteditorplugin.desktop +++ /dev/null @@ -1,87 +0,0 @@ -[Desktop Entry] -Type=ServiceType -X-TDE-ServiceType=KTextEditor/Plugin -X-TDE-Derived= -Comment=KTextEditor Plugin -Comment[af]=KTextEditor Inprop Module -Comment[ar]=مساعد برنامج KTextEditor -Comment[az]=KTextEditor Əlavəsi -Comment[be]=Модуль KTextEditor -Comment[bg]=Приставка KTextEditor -Comment[bn]=কে-টেক্সট-এডিটর প্লাগ-ইন -Comment[br]=Lugent KTextEditor -Comment[bs]=Dodatak za KTextEditor -Comment[ca]=Connector del KTextEditor -Comment[cs]=Modul textového editoru -Comment[csb]=Plugins editora tekstu -Comment[cy]=Atodyn KTextEditor -Comment[da]=KTextEditor-plugin -Comment[de]=KTextEditor-Erweiterung -Comment[el]=Πρόσθετο KTextEditor -Comment[eo]=Ktekstredaktila kromaĵeto -Comment[es]=Plugin de KTextEditor -Comment[et]=KTextEditori plugin -Comment[eu]=KTextEditor plugin-a -Comment[fa]=وصلۀ KTextEditor -Comment[fi]=KTextEditor-lisäosa -Comment[fr]=Module externe KTextEditor -Comment[fy]=KTextFerwurker-plugin -Comment[ga]=Breiseán KTextEditor -Comment[gl]=Plugin KTextEditor -Comment[he]=תוסף KTextEditor -Comment[hi]=के-टेक्स्ट-एडिटर प्लगइन -Comment[hr]=KTextEditor dodatak -Comment[hu]=KTextEditor-bővítőmodul -Comment[id]=Plugin KTextEditor -Comment[is]=KTextEditor-íforrit -Comment[it]=Plugin KTextEditor -Comment[ja]=KTextEditor プラグイン -Comment[ka]=KTextEditor მოდული -Comment[kk]=KTextEditor модулі -Comment[km]=កម្មវិធី​ជំនួយ​ខាង​ក្នុង KTextEditor -Comment[ko]=K글월편집기 플러그인 -Comment[lb]=KTextEditor-Plugin -Comment[lt]=KTextEditor priedas -Comment[lv]=KTextEditor spraudnis -Comment[mk]=KTextEditor приклучок -Comment[mn]=Текст засварлагч -Comment[ms]=Plugmasuk KTextEditor -Comment[mt]=Plagin KTextEditor -Comment[nb]=KTextEditor-programtillegg -Comment[nds]=KTextEditor-Plugin -Comment[ne]=KTextEditor प्लगइन -Comment[nl]=KTextEditor-plugin -Comment[nn]=TDE-skriveprogramtillegg -Comment[nso]=Tsenyo ya Mofetosi wa Sengwalwana sa K -Comment[pa]=ਕੇ ਪਾਠਸੰਪਾਦਕ ਪਲੱਗਿੰਨ -Comment[pl]=Wtyczka edytora tekstu -Comment[pt]='Plugin' do KTextEditor -Comment[pt_BR]=Plug-in do Editor de Texto -Comment[ro]=Modul editor de text -Comment[ru]=Модуль KTextEditor -Comment[rw]=Icomeka KMuhinduziUmwandiko -Comment[se]=TDE-čállinprográmma lassemoduvla -Comment[sk]=Modul KTextEditor -Comment[sl]=Vstavek KTextEditor -Comment[sq]=Shtojca KTextEditor -Comment[sr]=KTextEditor прикључак -Comment[sr@Latn]=KTextEditor priključak -Comment[ss]=I-plugini ye KTextEditor -Comment[sv]=Insticksprogram för texteditor -Comment[ta]=கேஉரைதொகுப்பி சொருகுப்பொருள் -Comment[te]=కెటెక్స్ట్ ఎడిటర్ ప్లగిన్ -Comment[tg]=Пуркунандаи KTextEditor -Comment[th]=ปลักอิน KTextEditor -Comment[tr]=KTextEditor Eklentisi -Comment[tt]=KTextEditor Östämäse -Comment[uk]=Втулок KTextEditor -Comment[uz]=KTextEditor plagini -Comment[uz@cyrillic]=KTextEditor плагини -Comment[ven]=Pulagini ya musengulusi wa manwalwa a K -Comment[vi]=Bộ cầm phít Soạn thảo Văn bản -Comment[wa]=Tchôke-divins KTextEditor -Comment[xh]=KTextEditor ye Plagi efakiweyo -Comment[zh_CN]=KTextEditor 插件 -Comment[zh_HK]=KTextEditor 外掛程式 -Comment[zh_TW]=KTextEditor 外掛程式 -Comment[zu]= Ukungena ngaphakathi kwe-KTextEditor diff --git a/interfaces/ktexteditor/markinterface.cpp b/interfaces/ktexteditor/markinterface.cpp deleted file mode 100644 index 024db35c4..000000000 --- a/interfaces/ktexteditor/markinterface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "markinterface.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivateMarkInterface -{ - public: - PrivateMarkInterface() {} - ~PrivateMarkInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int MarkInterface::globalMarkInterfaceNumber = 0; - -MarkInterface::MarkInterface() -{ - globalMarkInterfaceNumber++; - myMarkInterfaceNumber = globalMarkInterfaceNumber++; - - d = new PrivateMarkInterface(); -} - -MarkInterface::~MarkInterface() -{ - delete d; -} - -unsigned int MarkInterface::markInterfaceNumber () const -{ - return myMarkInterfaceNumber; -} - -void MarkInterface::setMarkInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("MarkInterface#"+suffix); -} - -MarkInterface *KTextEditor::markInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - -int MarkInterface::reservedMarkersCount() -{ - return 7; -} diff --git a/interfaces/ktexteditor/markinterface.h b/interfaces/ktexteditor/markinterface.h deleted file mode 100644 index 025bcc47c..000000000 --- a/interfaces/ktexteditor/markinterface.h +++ /dev/null @@ -1,171 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_markinterface_h__ -#define __ktexteditor_markinterface_h__ - -#include - -#include - -class TQCString; - -namespace KTextEditor -{ - -class Mark -{ - public: - uint line; - uint type; -}; - -/** -* This is an interface to enable marks to be made in the iconborder of the Document class. -*/ -class KTEXTEDITOR_EXPORT MarkInterface -{ - friend class PrivateMarkInterface; - - public: - MarkInterface (); - virtual ~MarkInterface (); - - unsigned int markInterfaceNumber () const; - - protected: - void setMarkInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - /** - * @return a uint representing the marks set in @p line OR'ed togeather. - */ - virtual uint mark (uint line) = 0; - - /** - * Adds a mark of type @p markType to @p line. - * Has no effect if the line allready contains a mark of that type. - */ - virtual void setMark (uint line, uint markType) = 0; - /** - * Clears all marks set in @p line. - */ - virtual void clearMark (uint line) = 0; - - virtual void addMark (uint line, uint markType) = 0; - /** - * Removes any mark of type @p markType from @p line. - */ - virtual void removeMark (uint line, uint markType) = 0; - - /** - * @return a list of all marks in the document - */ - virtual TQPtrList marks () = 0; - /** - * Clears all marks in the document. - */ - virtual void clearMarks () = 0; - - /** - * get the number of predefined marker types we have so far. - * @note If you change this you have to make sure katepart supports the new size! - * @return number of reserved marker types - * @since 3.3 - */ - static int reservedMarkersCount(); - - /** - * Pre-defined mark types. - * - * To create a non-standard mark type, use MarkInterfaceExtension. - * To add a new standard mark type, edit this interface to document the type. - */ - enum MarkTypes - { - /** Bookmark */ - markType01= 0x1, - /** Breakpoint active */ - markType02= 0x2, - /** Breakpoint reached */ - markType03= 0x4, - /** Breakpoint disabled */ - markType04= 0x8, - /** Execution mark */ - markType05= 0x10, - /** Warning */ - markType06= 0x20, - /** Error */ - markType07= 0x40, - - markType08= 0x80, - markType09= 0x100, - markType10= 0x200, - markType11= 0x400, - markType12= 0x800, - markType13= 0x1000, - markType14= 0x2000, - markType15= 0x4000, - markType16= 0x8000, - markType17= 0x10000, - markType18= 0x20000, - markType19= 0x40000, - markType20= 0x80000, - markType21= 0x100000, - markType22= 0x200000, - markType23= 0x400000, - markType24= 0x800000, - markType25= 0x1000000, - markType26= 0x2000000, - markType27= 0x4000000, - markType28= 0x8000000, - markType29= 0x10000000, - markType30= 0x20000000, - markType31= 0x40000000, - markType32= 0x80000000, - /* reserved marks */ - Bookmark = markType01, - BreakpointActive = markType02, - BreakpointReached = markType03, - BreakpointDisabled = markType04, - Execution = markType05, - Warning = markType06, - Error = markType07 - }; - - // - // signals !!! - // - public: - virtual void marksChanged () = 0; - - private: - class PrivateMarkInterface *d; - static unsigned int globalMarkInterfaceNumber; - unsigned int myMarkInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT MarkInterface *markInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/markinterfaceextension.cpp b/interfaces/ktexteditor/markinterfaceextension.cpp deleted file mode 100644 index 86538abfc..000000000 --- a/interfaces/ktexteditor/markinterfaceextension.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2002 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "markinterfaceextension.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivateMarkInterfaceExtension -{ - public: - PrivateMarkInterfaceExtension() {} - ~PrivateMarkInterfaceExtension() {} -}; - -} - -using namespace KTextEditor; - -unsigned int MarkInterfaceExtension::globalMarkInterfaceExtensionNumber = 0; - -MarkInterfaceExtension::MarkInterfaceExtension() -{ - globalMarkInterfaceExtensionNumber++; - myMarkInterfaceExtensionNumber = globalMarkInterfaceExtensionNumber++; - - d = new PrivateMarkInterfaceExtension(); -} - -MarkInterfaceExtension::~MarkInterfaceExtension() -{ - delete d; -} - -unsigned int MarkInterfaceExtension::markInterfaceExtensionNumber () const -{ - return myMarkInterfaceExtensionNumber; -} - -void MarkInterfaceExtension::setMarkInterfaceExtensionDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("MarkInterfaceExtension#"+suffix); -} - -MarkInterfaceExtension *KTextEditor::markInterfaceExtension (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/markinterfaceextension.h b/interfaces/ktexteditor/markinterfaceextension.h deleted file mode 100644 index efb7356de..000000000 --- a/interfaces/ktexteditor/markinterfaceextension.h +++ /dev/null @@ -1,83 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_markinterface_extension_h__ -#define __ktexteditor_markinterface_extension_h__ - -#include -#include -#include -#include "markinterface.h" - -class TQCString; - -namespace KTextEditor -{ - - -/** -* This is an interface for custom extensions of the MarkInterface. -* It allows the developer to set pixmaps for custom marks and to indicate which -* marks are settable by the user, for example (in kate), as actions in the iconborder's popup menu. -*/ -class KTEXTEDITOR_EXPORT MarkInterfaceExtension -{ - friend class PrivateMarkInterfaceExtension; - - public: - MarkInterfaceExtension (); - virtual ~MarkInterfaceExtension (); - - unsigned int markInterfaceExtensionNumber () const; - - protected: - void setMarkInterfaceExtensionDCOPSuffix (const TQCString &suffix); - - public: - virtual void setPixmap(MarkInterface::MarkTypes, const TQPixmap &)=0; - virtual void setDescription(MarkInterface::MarkTypes, const TQString &)=0; - virtual void setMarksUserChangable(uint markMask)=0; - - enum MarkChangeAction { - MarkAdded=0, - MarkRemoved=1 - }; - // - // slots !!! - // - public: - - // - // signals !!! - // - public: - virtual void markChanged (KTextEditor::Mark mark, - KTextEditor::MarkInterfaceExtension::MarkChangeAction action) = 0; - - private: - class PrivateMarkInterfaceExtension *d; - static unsigned int globalMarkInterfaceExtensionNumber; - unsigned int myMarkInterfaceExtensionNumber; -}; - -KTEXTEDITOR_EXPORT MarkInterfaceExtension *markInterfaceExtension (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/plugin.h b/interfaces/ktexteditor/plugin.h deleted file mode 100644 index f3cf5d4fc..000000000 --- a/interfaces/ktexteditor/plugin.h +++ /dev/null @@ -1,88 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_plugin_h__ -#define __ktexteditor_plugin_h__ - -#include - -#include - -namespace KTextEditor -{ - -class Document; -class View; - -/** - * Basic KTextEditor plugin class. - * This plugin will be bound to a Document. - */ -class KTEXTEDITOR_EXPORT Plugin : public TQObject -{ - friend class PrivatePlugin; - - Q_OBJECT - - public: - Plugin ( Document *document = 0, const char *name = 0 ); - virtual ~Plugin (); - - unsigned int pluginNumber () const; - - Document *document () const; - - private: - class PrivatePlugin *d; - static unsigned int globalPluginNumber; - unsigned int myPluginNumber; -}; - -KTEXTEDITOR_EXPORT Plugin *createPlugin ( const char* libname, Document *document = 0, const char *name = 0 ); - -/** - * View plugin class. - * This plugin will be bound to a View - */ -class KTEXTEDITOR_EXPORT PluginViewInterface -{ - friend class PrivatePluginViewInterface; - - public: - PluginViewInterface (); - virtual ~PluginViewInterface (); - - unsigned int pluginViewInterfaceNumber () const; - - /* - * will be called from the part to bound the plugin to a view - */ - virtual void addView (View *) = 0; - virtual void removeView (View *) = 0; - - private: - class PrivatePluginViewInterface *d; - static unsigned int globalPluginViewInterfaceNumber; - unsigned int myPluginViewInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin); - -} - -#endif diff --git a/interfaces/ktexteditor/popupmenuinterface.cpp b/interfaces/ktexteditor/popupmenuinterface.cpp deleted file mode 100644 index 350fa138b..000000000 --- a/interfaces/ktexteditor/popupmenuinterface.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "popupmenuinterface.h" -#include "view.h" - -namespace KTextEditor -{ - -class PrivatePopupMenuInterface -{ - public: - PrivatePopupMenuInterface() {} - ~PrivatePopupMenuInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int PopupMenuInterface::globalPopupMenuInterfaceNumber = 0; - -PopupMenuInterface::PopupMenuInterface() -{ - globalPopupMenuInterfaceNumber++; - myPopupMenuInterfaceNumber = globalPopupMenuInterfaceNumber++; - - d = new PrivatePopupMenuInterface(); -} - -PopupMenuInterface::~PopupMenuInterface() -{ - delete d; -} - -unsigned int PopupMenuInterface::popupMenuInterfaceNumber () const -{ - return myPopupMenuInterfaceNumber; -} - -void PopupMenuInterface::setPopupMenuInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("PopupMenuInterface#"+suffix); -} - -PopupMenuInterface *KTextEditor::popupMenuInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} diff --git a/interfaces/ktexteditor/popupmenuinterface.h b/interfaces/ktexteditor/popupmenuinterface.h deleted file mode 100644 index 23c38f707..000000000 --- a/interfaces/ktexteditor/popupmenuinterface.h +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_popupmenuinterface_h__ -#define __ktexteditor_popupmenuinterface_h__ - -#include - -class TQCString; -class TQPopupMenu; - -namespace KTextEditor -{ - -/** -* This is an interface to provide custom popup menus for a View. -*/ -class KTEXTEDITOR_EXPORT PopupMenuInterface -{ - friend class PrivatePopupMenuInterface; - - public: - PopupMenuInterface (); - virtual ~PopupMenuInterface (); - - unsigned int popupMenuInterfaceNumber () const; - - protected: - void setPopupMenuInterfaceDCOPSuffix (const TQCString &suffix); - - // - // normal methodes - // - public: - /** - Install a Popup Menu. The Popup Menu will be activated on - a right mouse button press event. - */ - virtual void installPopup (TQPopupMenu *rmb_Menu) = 0; - - private: - class PrivatePopupMenuInterface *d; - static unsigned int globalPopupMenuInterfaceNumber; - unsigned int myPopupMenuInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT PopupMenuInterface *popupMenuInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/printdcopinterface.cpp b/interfaces/ktexteditor/printdcopinterface.cpp deleted file mode 100644 index 3b9eddfe9..000000000 --- a/interfaces/ktexteditor/printdcopinterface.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "printdcopinterface.h" -#include "printinterface.h" - -#include -using namespace KTextEditor; - -PrintDCOPInterface::PrintDCOPInterface( PrintInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -PrintDCOPInterface::~PrintDCOPInterface() -{ - -} - -uint PrintDCOPInterface::printInterfaceNumber () -{ - return m_parent->printInterfaceNumber(); -} -bool PrintDCOPInterface::printDialog () -{ - return m_parent->printDialog(); -} -bool PrintDCOPInterface::print () -{ - return m_parent->print(); -} - diff --git a/interfaces/ktexteditor/printdcopinterface.h b/interfaces/ktexteditor/printdcopinterface.h deleted file mode 100644 index e41e6da5d..000000000 --- a/interfaces/ktexteditor/printdcopinterface.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef Print_DCOP_INTERFACE_H -#define Print_DCOP_INTERFACE_H - -#include -#include -#include -#include -//#include "editdcopinterface.moc" -namespace KTextEditor -{ - class PrintInterface; - /** - This is the main interface to the PrintInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to PrintInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT PrintDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent PrintInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - PrintDCOPInterface( PrintInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~PrintDCOPInterface(); - k_dcop: - uint printInterfaceNumber () ; - bool printDialog (); - bool print (); - - private: - PrintInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/printinterface.cpp b/interfaces/ktexteditor/printinterface.cpp deleted file mode 100644 index 5a4011eb4..000000000 --- a/interfaces/ktexteditor/printinterface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "printinterface.h" -#include "printdcopinterface.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivatePrintInterface -{ - public: - PrivatePrintInterface() {interface=0;} - ~PrivatePrintInterface() {} - PrintDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int PrintInterface::globalPrintInterfaceNumber = 0; - -PrintInterface::PrintInterface() -{ - globalPrintInterfaceNumber++; - myPrintInterfaceNumber = globalPrintInterfaceNumber++; - - d = new PrivatePrintInterface(); - TQString name = "PrintInterface#" + TQString::number(myPrintInterfaceNumber); - d->interface = new PrintDCOPInterface(this, name.latin1()); -} - -PrintInterface::~PrintInterface() -{ - delete d->interface; - delete d; -} - -unsigned int PrintInterface::printInterfaceNumber () const -{ - return myPrintInterfaceNumber; -} - -void PrintInterface::setPrintInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("PrintInterface#"+suffix); -} - -PrintInterface *KTextEditor::printInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/printinterface.h b/interfaces/ktexteditor/printinterface.h deleted file mode 100644 index 3da6213ac..000000000 --- a/interfaces/ktexteditor/printinterface.h +++ /dev/null @@ -1,63 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_printinterface_h__ -#define __ktexteditor_printinterface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface to printing functions of a Document. -*/ -class KTEXTEDITOR_EXPORT PrintInterface -{ - friend class PrivatePrintInterface; - - public: - PrintInterface (); - virtual ~PrintInterface (); - - unsigned int printInterfaceNumber () const; - - protected: - void setPrintInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - virtual bool printDialog () = 0; - virtual bool print () = 0; - - private: - class PrivatePrintInterface *d; - static unsigned int globalPrintInterfaceNumber; - unsigned int myPrintInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT PrintInterface *printInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/searchdcopinterface.cpp b/interfaces/ktexteditor/searchdcopinterface.cpp deleted file mode 100644 index ce29e4927..000000000 --- a/interfaces/ktexteditor/searchdcopinterface.cpp +++ /dev/null @@ -1,95 +0,0 @@ -#include "searchdcopinterface.h" -#include "searchinterface.h" - -#include -#include - -using namespace KTextEditor; - -SearchDCOPInterface::SearchDCOPInterface( SearchInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; - m_currentcol = 0; - m_currentrow = 0; - m_currentmatchlen = 0; -} - -SearchDCOPInterface::~SearchDCOPInterface() -{ - -} - -bool SearchDCOPInterface::findFirstString( TQString text, bool caseSensitive) -{ - return m_parent->searchText(0, 0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive); -} -bool SearchDCOPInterface::findNextString( TQString text, bool caseSensitive) -{ - return m_parent->searchText(m_currentrow, m_currentcol+1, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive); -} - -bool SearchDCOPInterface::findPreviousString( TQString text, bool caseSensitive) -{ - if( m_currentcol == 0) - m_currentrow--; - else - m_currentcol--; - return m_parent->searchText(m_currentrow, m_currentcol, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true); -} - -bool SearchDCOPInterface::findLastString( TQString text, bool caseSensitive) -{ - return m_parent->searchText(0,0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true); -} - -bool SearchDCOPInterface::findStringAt( uint row, uint col, TQString text, bool caseSensitive) -{ - return m_parent->searchText(row,col, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive); - -} - -bool SearchDCOPInterface::findFirstRegExp( TQString regexp) -{ - return m_parent->searchText( 0,0, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen); -} - -bool SearchDCOPInterface::findNextRegExp( TQString regexp) -{ - return m_parent->searchText( m_currentrow, m_currentcol+1, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen); -} - -bool SearchDCOPInterface::findPreviousRegExp( TQString regexp) -{ - if( m_currentcol == 0) - m_currentrow--; - else - m_currentcol--; - return m_parent->searchText( m_currentrow, m_currentcol, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true); - -} - -bool SearchDCOPInterface::findLastRegExp(TQString regexp) -{ - return m_parent->searchText( 0,0, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true); -} - -bool SearchDCOPInterface::findRegExpAt( uint row, uint col, TQString regexp) -{ - return m_parent->searchText( row, col, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, false); -} - -uint SearchDCOPInterface::currentMatchLine() -{ - return m_currentrow; -} -uint SearchDCOPInterface::currentMatchCol() -{ - return m_currentcol; -} -uint SearchDCOPInterface::currentMatchLength() -{ - return m_currentmatchlen; -} - - diff --git a/interfaces/ktexteditor/searchdcopinterface.h b/interfaces/ktexteditor/searchdcopinterface.h deleted file mode 100644 index d4f558a26..000000000 --- a/interfaces/ktexteditor/searchdcopinterface.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef SEARCH_DCOP_INTERFACE_H -#define SEARCH_DCOP_INTERFACE_H - -#include -#include -#include -#include - -namespace KTextEditor -{ - class SearchInterface; - /** - This is the main interface to the SearchInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to SearchInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT SearchDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent SearchInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - SearchDCOPInterface( SearchInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - **/ - virtual ~SearchDCOPInterface(); - k_dcop: - bool findFirstString(TQString text, bool caseSensitive); - bool findNextString(TQString text, bool caseSensitive); - bool findPreviousString( TQString text, bool caseSensitive); - bool findLastString(TQString text, bool caseSensitive); - bool findStringAt( uint row, uint col, TQString text, bool caseSensitive); - - bool findFirstRegExp( TQString regexp); - bool findNextRegExp( TQString regexp); - bool findPreviousRegExp( TQString regexp); - bool findLastRegExp( TQString regexp); - bool findRegExpAt( uint row, uint col, TQString regexp); - - uint currentMatchLine(); - uint currentMatchCol(); - uint currentMatchLength(); - - private: - SearchInterface *m_parent; - uint m_currentcol; - uint m_currentrow; - uint m_currentmatchlen; - }; -} -#endif diff --git a/interfaces/ktexteditor/searchinterface.cpp b/interfaces/ktexteditor/searchinterface.cpp deleted file mode 100644 index 6ea021e0d..000000000 --- a/interfaces/ktexteditor/searchinterface.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "searchinterface.h" -#include "searchdcopinterface.h" -#include "document.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateSearchInterface - { - public: - PrivateSearchInterface() - { - interface = 0; - } - ~PrivateSearchInterface(){} - // Data Members - SearchDCOPInterface *interface; - }; - -} - -unsigned int SearchInterface::globalSearchInterfaceNumber = 0; - -SearchInterface::SearchInterface() -{ - d = new PrivateSearchInterface(); - globalSearchInterfaceNumber++; - mySearchInterfaceNumber=globalSearchInterfaceNumber; - TQString name = "SearchInterface#" + TQString::number(mySearchInterfaceNumber); - d->interface = new SearchDCOPInterface(this, name.latin1()); -} -SearchInterface::~SearchInterface() -{ - delete d->interface; - delete d; -} - -unsigned int SearchInterface::searchInterfaceNumber () const -{ - return mySearchInterfaceNumber; -} - -void SearchInterface::setSearchInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("SearchInterface#"+suffix); -} - -SearchInterface *KTextEditor::searchInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/searchinterface.h b/interfaces/ktexteditor/searchinterface.h deleted file mode 100644 index 69952b785..000000000 --- a/interfaces/ktexteditor/searchinterface.h +++ /dev/null @@ -1,65 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_searchinterface_h__ -#define __ktexteditor_searchinterface_h__ - -#include - -class TQRegExp; -class TQString; -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface to allow searching of a Document. -*/ -class KTEXTEDITOR_EXPORT SearchInterface -{ - friend class PrivateSearchInterface; - - public: - SearchInterface(); - virtual ~SearchInterface(); - - unsigned int searchInterfaceNumber () const; - - protected: - void setSearchInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - virtual bool searchText (unsigned int startLine, unsigned int startCol, const TQString &text, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool casesensitive = true, bool backwards = false) = 0; - virtual bool searchText (unsigned int startLine, unsigned int startCol, const TQRegExp ®exp, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool backwards = false) = 0; - - private: - class PrivateSearchInterface *d; - static unsigned int globalSearchInterfaceNumber; - unsigned int mySearchInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT SearchInterface *searchInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/selectiondcopinterface.cpp b/interfaces/ktexteditor/selectiondcopinterface.cpp deleted file mode 100644 index f341297e0..000000000 --- a/interfaces/ktexteditor/selectiondcopinterface.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "selectiondcopinterface.h" -#include "selectioninterface.h" - -#include -using namespace KTextEditor; - -SelectionDCOPInterface::SelectionDCOPInterface( SelectionInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -SelectionDCOPInterface::~SelectionDCOPInterface() -{ - -} - - /** - * @return set the selection from line_start,col_start to line_end,col_end - */ - bool SelectionDCOPInterface::setSelection ( uint startLine, uint startCol, uint endLine, uint endCol ) - { - return m_parent->setSelection ( startLine, startCol, endLine, endCol ); - } - - /** - * removes the current Selection (not Text) - */ - bool SelectionDCOPInterface::clearSelection () - { - return m_parent->clearSelection(); - } - - /** - * @return true if there is a selection - */ - bool SelectionDCOPInterface::hasSelection () - { - return m_parent->hasSelection(); - } - - /** - * @return a TQString for the selected text - */ - TQString SelectionDCOPInterface::selection () - { - return m_parent->selection(); - } - - /** - * removes the selected Text - */ - bool SelectionDCOPInterface::removeSelectedText () - { - return m_parent->removeSelectedText(); - } - - /** - * select the whole text - */ - bool SelectionDCOPInterface::selectAll () - { - return m_parent->selectAll(); - } diff --git a/interfaces/ktexteditor/selectiondcopinterface.h b/interfaces/ktexteditor/selectiondcopinterface.h deleted file mode 100644 index aa2973540..000000000 --- a/interfaces/ktexteditor/selectiondcopinterface.h +++ /dev/null @@ -1,72 +0,0 @@ -#ifndef SELECTION_DCOP_INTERFACE_H -#define SELECTION_DCOP_INTERFACE_H - -#include -#include -#include -#include - -namespace KTextEditor -{ - class SelectionInterface; - /** - This is the main interface to the SelectionInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to SelectionInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT SelectionDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent SelectionInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - SelectionDCOPInterface( SelectionInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - **/ - virtual ~SelectionDCOPInterface(); - k_dcop: - /** - * @return set the selection from line_start,col_start to line_end,col_end - */ - bool setSelection ( uint startLine, uint startCol, uint endLine, uint endCol ); - - /** - * removes the current Selection (not Text) - */ - bool clearSelection (); - - /** - * @return true if there is a selection - */ - bool hasSelection (); - - /** - * @return a TQString for the selected text - */ - TQString selection (); - - /** - * removes the selected Text - */ - bool removeSelectedText (); - - /** - * select the whole text - */ - bool selectAll (); - - private: - SelectionInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/selectionextdcopinterface.h b/interfaces/ktexteditor/selectionextdcopinterface.h deleted file mode 100644 index 5c3e32baf..000000000 --- a/interfaces/ktexteditor/selectionextdcopinterface.h +++ /dev/null @@ -1,57 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Anders Lund - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - $Id$ -*/ - -#ifndef _SELECTION_EXT_DCOP_INTERFACE_H_ -#define _SELECTION_EXT_DCOP_INTERFACE_H_ - -#include "selectioninterfaceext.h" - -#include -#include -#include - -namespace KTextEditor { -/** - DCOP interface for the SelectionInterfaceExt. - @author Anders Lund -*/ -class KTEXTEDITOR_EXPORT SelectionExtDCOPInterface : virtual public DCOPObject -{ - K_DCOP - public: - SelectionExtDCOPInterface( SelectionInterfaceExt *parent, const char *name ); - virtual ~SelectionExtDCOPInterface(); - k_dcop: - /** The selection start line number */ - int selStartLine(); - /** The selection start col */ - int selStartCol(); - /** The selection end line */ - int selEndLine(); - /** The selection end col */ - int selEndCol(); - private: - SelectionInterfaceExt *m_parent; -}; - -} // namespace KTextEditor - -#endif // _SELECTION_EXT_DCOP_INTERFACE_H_ diff --git a/interfaces/ktexteditor/selectioninterface.cpp b/interfaces/ktexteditor/selectioninterface.cpp deleted file mode 100644 index 0a8dc6b00..000000000 --- a/interfaces/ktexteditor/selectioninterface.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "selectioninterface.h" -#include "selectiondcopinterface.h" -#include "document.h" -#include "view.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateSelectionInterface - { - public: - PrivateSelectionInterface() - { - interface = 0; - } - ~PrivateSelectionInterface(){} - // Data Members - SelectionDCOPInterface *interface; - }; - -} - -unsigned int SelectionInterface::globalSelectionInterfaceNumber = 0; - -SelectionInterface::SelectionInterface() -{ - d = new PrivateSelectionInterface(); - globalSelectionInterfaceNumber++; - mySelectionInterfaceNumber = globalSelectionInterfaceNumber; - TQString name = "SelectionInterface#" + TQString::number(mySelectionInterfaceNumber); - d->interface = new SelectionDCOPInterface(this, name.latin1()); -} -SelectionInterface::~SelectionInterface() -{ - delete d->interface; - delete d; -} - -unsigned int SelectionInterface::selectionInterfaceNumber () const -{ - return mySelectionInterfaceNumber; -} - -void SelectionInterface::setSelectionInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("SelectionInterface#"+suffix); -} - -SelectionInterface *KTextEditor::selectionInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - -SelectionInterface *KTextEditor::selectionInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} - diff --git a/interfaces/ktexteditor/selectioninterface.h b/interfaces/ktexteditor/selectioninterface.h deleted file mode 100644 index a6ba67bd8..000000000 --- a/interfaces/ktexteditor/selectioninterface.h +++ /dev/null @@ -1,100 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_selectioninterface_h__ -#define __ktexteditor_selectioninterface_h__ - -#include - -#include - -namespace KTextEditor -{ - -/** -* This is an interface to text selection for the Document class. -*/ -class KTEXTEDITOR_EXPORT SelectionInterface -{ - friend class PrivateSelectionInterface; - - public: - SelectionInterface(); - virtual ~SelectionInterface(); - - unsigned int selectionInterfaceNumber () const; - - protected: - void setSelectionInterfaceDCOPSuffix (const TQCString &suffix); - - /* - * slots !!! - */ - public: - /** - * @return set the selection from line_start,col_start to line_end,col_end - */ - virtual bool setSelection ( unsigned int startLine, unsigned int startCol, unsigned int endLine, unsigned int endCol ) = 0; - - /** - * removes the current Selection (not Text) - */ - virtual bool clearSelection () = 0; - - /** - * @return true if there is a selection - */ - virtual bool hasSelection () const = 0; - - /** - * @return a TQString for the selected text - */ - virtual TQString selection () const = 0; - - /** - * removes the selected Text - */ - virtual bool removeSelectedText () = 0; - - /** - * select the whole text - */ - virtual bool selectAll () = 0; - - // - // signals !!! - // - public: - virtual void selectionChanged () = 0; - - private: - class PrivateSelectionInterface *d; - static unsigned int globalSelectionInterfaceNumber; - unsigned int mySelectionInterfaceNumber; -}; - -class Document; -class View; - -KTEXTEDITOR_EXPORT SelectionInterface *selectionInterface (Document *doc); -KTEXTEDITOR_EXPORT SelectionInterface *selectionInterface (View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/selectioninterfaceext.cpp b/interfaces/ktexteditor/selectioninterfaceext.cpp deleted file mode 100644 index 3034f33a5..000000000 --- a/interfaces/ktexteditor/selectioninterfaceext.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Anders Lund - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - $Id$ -*/ - -#include "selectioninterfaceext.h" -#include "selectionextdcopinterface.h" -#include "document.h" -#include "view.h" -#include - -using namespace KTextEditor; - -//BEGIN KTextEditor::SelectionInterfaceExt -class KTextEditor::PrivateSelectionInterfaceExt { - public: - PrivateSelectionInterfaceExt() : interface( 0 ) {} - ~PrivateSelectionInterfaceExt() {} - - SelectionExtDCOPInterface *interface; -}; - -unsigned int SelectionInterfaceExt::globalSelectionInterfaceExtNumber = 0; - -SelectionInterfaceExt::SelectionInterfaceExt() - : d ( new PrivateSelectionInterfaceExt ) -{ - globalSelectionInterfaceExtNumber++; - mySelectionInterfaceExtNumber = globalSelectionInterfaceExtNumber; - TQString name = "SelectionInterfaceExt#" + TQString::number(mySelectionInterfaceExtNumber); - d->interface = new SelectionExtDCOPInterface(this, name.latin1()); -} - -SelectionInterfaceExt::~SelectionInterfaceExt() -{ - delete d->interface; - delete d; -} - -unsigned int SelectionInterfaceExt::selectionInterfaceExtNumber () const -{ - return mySelectionInterfaceExtNumber; -} - -void SelectionInterfaceExt::setSelectionInterfaceExtDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("SelectionInterfaceExt#"+suffix); -} - -SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - -SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} - -//END KTextEditor::SelectionInterfaceExt - -//BEGIN KTextEditor::SelectionExtDCOPInterface -SelectionExtDCOPInterface::SelectionExtDCOPInterface( - SelectionInterfaceExt *parent, const char* name ) - : DCOPObject( name ), - m_parent( parent ) -{ -} - -SelectionExtDCOPInterface::~SelectionExtDCOPInterface() -{ -} - -int SelectionExtDCOPInterface::selStartLine() -{ - return m_parent->selStartLine(); -} - -int SelectionExtDCOPInterface::selStartCol() -{ - return m_parent->selStartCol(); -} - -int SelectionExtDCOPInterface::selEndLine() -{ - return m_parent->selEndLine(); -} - -int SelectionExtDCOPInterface::selEndCol() -{ - return m_parent->selEndCol(); -} -//END KTextEditor::SelectionExtDCOPInterface diff --git a/interfaces/ktexteditor/selectioninterfaceext.h b/interfaces/ktexteditor/selectioninterfaceext.h deleted file mode 100644 index 255d76f64..000000000 --- a/interfaces/ktexteditor/selectioninterfaceext.h +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2002 Anders Lund - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - $Id$ -*/ - -#ifndef __ktexteditor_selectioninterface_ext_h__ -#define __ktexteditor_selectioninterface_ext_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** - Provide access to seleciton positions. - This is an interface for the Document class. - Mainly here for dcop and the sake of scripting. - @author Anders Lund -*/ -class KTEXTEDITOR_EXPORT SelectionInterfaceExt -{ - friend class PrivateSelectionInterfaceExt; - - public: - SelectionInterfaceExt(); - virtual ~SelectionInterfaceExt(); - - unsigned int selectionInterfaceExtNumber () const; - - protected: - void setSelectionInterfaceExtDCOPSuffix (const TQCString &suffix); - - public: - /** The selection start line number */ - virtual int selStartLine()=0; - /** The selection start col */ - virtual int selStartCol()=0; - /** The selection end line */ - virtual int selEndLine()=0; - /** The selection end col */ - virtual int selEndCol()=0; - - private: - class PrivateSelectionInterfaceExt *d; - static unsigned int globalSelectionInterfaceExtNumber; - unsigned int mySelectionInterfaceExtNumber; -}; - -class Document; -class View; - -KTEXTEDITOR_EXPORT SelectionInterfaceExt *selectionInterfaceExt (Document *doc); -KTEXTEDITOR_EXPORT SelectionInterfaceExt *selectionInterfaceExt (View *view); - -} // namespace KTextEditor -#endif diff --git a/interfaces/ktexteditor/sessionconfiginterface.cpp b/interfaces/ktexteditor/sessionconfiginterface.cpp deleted file mode 100644 index def7bf0a5..000000000 --- a/interfaces/ktexteditor/sessionconfiginterface.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "sessionconfiginterface.h" - -#include "document.h" -#include "view.h" -#include "plugin.h" - -namespace KTextEditor -{ - -class PrivateSessionConfigInterface -{ - public: - PrivateSessionConfigInterface() {} - ~PrivateSessionConfigInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int SessionConfigInterface::globalSessionConfigInterfaceNumber = 0; - -SessionConfigInterface::SessionConfigInterface() -{ - globalSessionConfigInterfaceNumber++; - mySessionConfigInterfaceNumber = globalSessionConfigInterfaceNumber++; - - d = new PrivateSessionConfigInterface(); -} - -SessionConfigInterface::~SessionConfigInterface() -{ - delete d; -} - -unsigned int SessionConfigInterface::configInterfaceNumber () const -{ - return mySessionConfigInterfaceNumber; -} - -void SessionConfigInterface::setSessionConfigInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("SessionConfigInterface#"+suffix); -} - -SessionConfigInterface *KTextEditor::sessionConfigInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} - -SessionConfigInterface *KTextEditor::sessionConfigInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} - -SessionConfigInterface *KTextEditor::sessionConfigInterface (Plugin *plugin) -{ - if (!plugin) - return 0; - - return dynamic_cast(plugin); -} diff --git a/interfaces/ktexteditor/sessionconfiginterface.h b/interfaces/ktexteditor/sessionconfiginterface.h deleted file mode 100644 index b4fb52233..000000000 --- a/interfaces/ktexteditor/sessionconfiginterface.h +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_sessionconfiginterface_h__ -#define __ktexteditor_sessionconfiginterface_h__ - -#include - -class TQCString; -class TDEConfig; - -namespace KTextEditor -{ - -/** -* This is an interface to session-specific configuration of the -* Document, Plugin and PluginViewInterface classes. -*/ -class KTEXTEDITOR_EXPORT SessionConfigInterface -{ - friend class PrivateSessionConfigInterface; - - public: - SessionConfigInterface(); - virtual ~SessionConfigInterface(); - - unsigned int configInterfaceNumber () const; - - protected: - void setSessionConfigInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - /** - * Read/Write session config of only this document/view/plugin - * In case of the document, that means for example it should reload the file, - * restore all marks, ... - */ - virtual void readSessionConfig (TDEConfig *) = 0; - virtual void writeSessionConfig (TDEConfig *) = 0; - - private: - class PrivateSessionConfigInterface *d; - static unsigned int globalSessionConfigInterfaceNumber; - unsigned int mySessionConfigInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class Document *doc); -KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class View *view); -KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class Plugin *plugin); - -} - -#endif diff --git a/interfaces/ktexteditor/templateinterface.cpp b/interfaces/ktexteditor/templateinterface.cpp deleted file mode 100644 index ecc34c7e2..000000000 --- a/interfaces/ktexteditor/templateinterface.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "templateinterface.h" -#include "document.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -using namespace KTextEditor; - -unsigned int TemplateInterface::globalTemplateInterfaceNumber = 0; - -TemplateInterface::TemplateInterface() -{ - myTemplateInterfaceNumber = globalTemplateInterfaceNumber++; -} - -TemplateInterface::~TemplateInterface() -{} - -uint TemplateInterface::templateInterfaceNumber () const -{ - return myTemplateInterfaceNumber; -} - -void TemplateInterface::setTemplateInterfaceDCOPSuffix ( const TQCString &suffix ) -{} - -#define INITKABC do { \ - if (addrBook==0) { \ - addrBook=KABC::StdAddressBook::self(); \ - userAddress=addrBook->whoAmI(); \ - if (userAddress.isEmpty()) { \ - if ( KMessageBox::questionYesNo(parentWindow, \ - i18n( "This template uses personal data that is stored in the TDE addressbook, but you have not selected a personal entry. You can still use the template without one, but you will have to type personal data. Would you like to select one now?" ), \ - "Personal data requested", \ - KStdGuiItem::yes(), KStdGuiItem::no(), "select personal data entry") == KMessageBox::Yes ) { \ - userAddress = KABC::AddresseeDialog::getAddressee(parentWindow); \ - if ( ! userAddress.isEmpty() ) \ - KABC::StdAddressBook::self()->setWhoAmI( userAddress ); \ - }\ - /*return false;//no, why??*/ \ - } \ - } \ -} while(false) - -bool TemplateInterface::expandMacros( TQMap &map, TQWidget *parentWindow ) -{ - KABC::StdAddressBook *addrBook = 0; - KABC::Addressee userAddress; - TQDateTime datetime = TQDateTime::currentDateTime(); - TQDate date = TQT_TQDATE_OBJECT(datetime.date()); - TQTime time = TQT_TQTIME_OBJECT(datetime.time()); - - TQMap::Iterator it; - for ( it = map.begin(); it != map.end(); ++it ) - { - TQString placeholder = it.key(); - if ( map[ placeholder ].isEmpty() ) - { - if ( placeholder == "index" ) map[ placeholder ] = "i"; - else if ( placeholder == "loginname" ) - {} - else if ( placeholder == "firstname" ) - { - INITKABC; - if ( !userAddress.isEmpty() ) - map[ placeholder ] = userAddress.givenName(); - } - else if ( placeholder == "lastname" ) - { - INITKABC; - if ( !userAddress.isEmpty() ) - map[ placeholder ] = userAddress.familyName(); - } - else if ( placeholder == "fullname" ) - { - INITKABC; - if ( !userAddress.isEmpty() ) - map[ placeholder ] = userAddress.assembledName(); - } - else if ( placeholder == "email" ) - { - INITKABC; - if ( !userAddress.isEmpty() ) - map[ placeholder ] = userAddress.preferredEmail(); - } - else if ( placeholder == "date" ) - { - map[ placeholder ] = TDEGlobal::locale() ->formatDate( date, true ); - } - else if ( placeholder == "time" ) - { - map[ placeholder ] = TDEGlobal::locale() ->formatTime( time, true, false ); - } - else if ( placeholder == "year" ) - { - map[ placeholder ] = TDEGlobal::locale() ->calendar() ->yearString( date, false ); - } - else if ( placeholder == "month" ) - { - map[ placeholder ] = TQString::number( TDEGlobal::locale() ->calendar() ->month( date ) ); - } - else if ( placeholder == "day" ) - { - map[ placeholder ] = TQString::number( TDEGlobal::locale() ->calendar() ->day( date ) ); - } - else if ( placeholder == "hostname" ) - { - char hostname[ 256 ]; - hostname[ 0 ] = 0; - gethostname( hostname, 255 ); - hostname[ 255 ] = 0; - map[ placeholder ] = TQString::fromLocal8Bit( hostname ); - } - else if ( placeholder == "cursor" ) - { - map[ placeholder ] = "|"; - } - else map[ placeholder ] = placeholder; - } - } - return true; -} - -bool TemplateInterface::insertTemplateText ( uint line, uint column, const TQString &templateString, const TQMap &initialValues, TQWidget *parentWindow ) -{ - TQMap enhancedInitValues( initialValues ); - - TQRegExp rx( "[$%]\\{([^}\\s]+)\\}" ); - rx.setMinimal( true ); - int pos = 0; - int opos = 0; - - while ( pos >= 0 ) - { - pos = rx.search( templateString, pos ); - - if ( pos > -1 ) - { - if ( ( pos - opos ) > 0 ) - { - if ( templateString[ pos - 1 ] == '\\' ) - { - pos = opos = pos + 1; - continue; - } - } - TQString placeholder = rx.cap( 1 ); - if ( ! enhancedInitValues.contains( placeholder ) ) - enhancedInitValues[ placeholder ] = ""; - - pos += rx.matchedLength(); - opos = pos; - } - } - - return expandMacros( enhancedInitValues, parentWindow ) - && insertTemplateTextImplementation( line, column, templateString, enhancedInitValues, parentWindow ); -} - - - -TemplateInterface *KTextEditor::templateInterface ( KTextEditor::Document *doc ) -{ - if ( !doc ) - return 0; - - return dynamic_cast( doc ); -} - diff --git a/interfaces/ktexteditor/templateinterface.h b/interfaces/ktexteditor/templateinterface.h deleted file mode 100644 index a786bf461..000000000 --- a/interfaces/ktexteditor/templateinterface.h +++ /dev/null @@ -1,131 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2004 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_templateinterface_h__ -#define __ktexteditor_templateinterface_h__ - -#include -#include -#include - -#include - -namespace KTextEditor -{ - -class Document; - -/** - * This is an interface for inserting template strings with user editable - * fields into a document. - */ -class KTEXTEDITOR_EXPORT TemplateInterface //should be named AbstractTemplateInterface, but for consistency with the other classes it is not (for the 3.x release series) -{ - friend class PrivateTemplateInterface; - - public: - TemplateInterface(); - virtual ~TemplateInterface(); - - /** - * Parses @p templateString for macros in the form [$%]{NAME} and finds - * the value corresponding to NAME if any. The NAME string may contain - * any non-whitespace character execpt '}' - * @param initialValues a map with the keys for the macros to expand. - * keys with a value are ignored. - * @param parentWindow is used if dialogs have to be shown - * @return true if all macros was sucessfully expanded - * @see insertTemplateText for a list of supported macros - */ - static bool expandMacros( TQMap &initialValues, TQWidget *parentWindow ); - - uint templateInterfaceNumber () const; - - protected: - void setTemplateInterfaceDCOPSuffix (const TQCString &suffix); - - public: - - /** - * Inserts an interactive ediable template text at line "line", column "col". - * @p parentWindow is used if dialogs have to be shown - * @return true if inserting the string succeeded - * - * Use insertTemplateText(numLines(), ...) to append text at end of document - * Template strings look like - * "for( int ${index}=0;${index}<10;${index}++) { ${cursor} };" - * or "%{date}" - * - * This syntax is somewhat similiar to the one found in the Eclipse editor. - * - * There are certain common placeholders (macros), which get assigned a - * default initialValue, If the second parameter does not a given value. - * For all others the initial value is the name of the placeholder. - * - * Placeholder names may only consist of a-zA-Z0-9_ - * Common placeholders and values are - * - * - index: "i" - * - loginname: The current users's loginname - * - firstname: The current user's first name retrieved from kabc - * - lastname: The current user's last name retrieved from kabc - * - fullname: The current user's first and last name retrieved from kabc - * - email: The current user's primary email adress retrieved from kabc - * - date: current date - * - time: current time - * - year: current year - * - month: current month - * - day: current day - * - hostname: hostname of the computer - * - cursor: at this position the cursor will be after editing of the - * template has finished, this has to be taken care of by the actual - * implementation. The placeholder gets a value of "|" assigned. - * - * If a macro is started with a % (persent sign) like "%{date}" it isn't added - * to the list editable strings ( for example TAB key navigation) if a value - * differing from the macro name is found. - * - * If the editor supports some kind of smart indentation, the inserted code - * should be layouted by the indenter. - */ - bool insertTemplateText ( uint line, uint column, const TQString &templateString, const TQMap &initialValues, TQWidget *parentWindow=0); - -protected: - /** - * You must implement this, it is called by insertTemplateText, after all - * default values are inserted. If you are implementing this interface, - * this method should work as described in the documentation for - * insertTemplateText above. - * @return true if any text was inserted. - */ - virtual bool insertTemplateTextImplementation ( uint line, uint column, const TQString &templateString, const TQMap &initialValues, TQWidget *parentWindow=0 )=0; - - /** - * only for the interface itself - REAL PRIVATE - */ - private: - class PrivateTemplateInterface *d; - static uint globalTemplateInterfaceNumber; - uint myTemplateInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT TemplateInterface *templateInterface (Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/texthintinterface.cpp b/interfaces/ktexteditor/texthintinterface.cpp deleted file mode 100644 index f6aa4f0b3..000000000 --- a/interfaces/ktexteditor/texthintinterface.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - - -#include "texthintinterface.h" -#include "view.h" - -using namespace KTextEditor; - -namespace KTextEditor -{ - class PrivateTextHintInterface - { - public: - PrivateTextHintInterface() {} - ~PrivateTextHintInterface(){} - - }; - -unsigned int TextHintInterface::globalTextHintInterfaceNumber = 0; - -TextHintInterface::TextHintInterface() -{ - globalTextHintInterfaceNumber++; - myTextHintInterfaceNumber = globalTextHintInterfaceNumber++; - - d = new PrivateTextHintInterface(); -} - -TextHintInterface::~TextHintInterface() -{ - delete d; -} - -unsigned int TextHintInterface::textHintInterfaceNumber () const -{ - return myTextHintInterfaceNumber; -} - - -TextHintInterface *textHintInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} - - -} - diff --git a/interfaces/ktexteditor/texthintinterface.h b/interfaces/ktexteditor/texthintinterface.h deleted file mode 100644 index e124fa369..000000000 --- a/interfaces/ktexteditor/texthintinterface.h +++ /dev/null @@ -1,79 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Joseph Wenninger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_texthintinterface_h__ -#define __ktexteditor_texthintinterface_h__ - -#include -#include - -#include - -namespace KTextEditor -{ - -/** - * This is an interface for the KTextEditor::View class. - - */ -class KTEXTEDITOR_EXPORT TextHintInterface -{ - friend class PrivateTextHintInterface; -public: - TextHintInterface(); - virtual ~TextHintInterface(); - - /** - * enable Texthints. If they are enabled a signal needTextHint is emitted, if the mouse - * changed the position and a new character is beneath the mouse cursor. The signal is delayed - * for a certain time, specifiedin the timeout parameter. - */ - virtual void enableTextHints(int timeout)=0; - - /** - * Disable texthints. Per default they are disabled. - */ - virtual void disableTextHints()=0; - - /** - * This method returns a number, unique during one application run - * - */ - unsigned int textHintInterfaceNumber () const; - - - //signals - - /** - * emit this signal, if a tooltip text is needed for displaying. - * I you don't want a tooltip to be displayd set text to an emtpy string in a connected slot, - * otherwise set text to the string you want the editor to display - */ - virtual void needTextHint(int line, int col, TQString &text)=0; - - private: - class PrivateTextHintInterface *d; - static unsigned int globalTextHintInterfaceNumber; - unsigned int myTextHintInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT TextHintInterface *textHintInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/undodcopinterface.cpp b/interfaces/ktexteditor/undodcopinterface.cpp deleted file mode 100644 index 69eb2ebd5..000000000 --- a/interfaces/ktexteditor/undodcopinterface.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include "undodcopinterface.h" -#include "undointerface.h" - -#include -using namespace KTextEditor; - -UndoDCOPInterface::UndoDCOPInterface( UndoInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -UndoDCOPInterface::~UndoDCOPInterface() -{ - -} - -uint UndoDCOPInterface::undoInterfaceNumber () -{ - return m_parent->undoInterfaceNumber(); -} -void UndoDCOPInterface::undo () -{ - m_parent->undo(); -} -void UndoDCOPInterface::redo () -{ - m_parent->redo(); -} -void UndoDCOPInterface::clearUndo () -{ - m_parent->clearUndo(); -} -void UndoDCOPInterface::clearRedo () -{ - m_parent->clearRedo(); -} -uint UndoDCOPInterface::undoCount () -{ - return m_parent->undoCount(); -} -uint UndoDCOPInterface::redoCount () -{ - return m_parent->redoCount(); -} -uint UndoDCOPInterface::undoSteps () -{ - return m_parent->undoSteps(); -} -void UndoDCOPInterface::setUndoSteps ( uint steps ) -{ - m_parent->setUndoSteps(steps); -} -void UndoDCOPInterface::undoChanged () -{ - m_parent->undoChanged(); -} diff --git a/interfaces/ktexteditor/undodcopinterface.h b/interfaces/ktexteditor/undodcopinterface.h deleted file mode 100644 index b1a217036..000000000 --- a/interfaces/ktexteditor/undodcopinterface.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef Undo_DCOP_INTERFACE_H -#define Undo_DCOP_INTERFACE_H - -#include -#include -#include -#include -//#include "editdcopinterface.moc" -namespace KTextEditor -{ - class UndoInterface; - /** - This is the main interface to the UndoInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to UndoInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT UndoDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent UndoInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - UndoDCOPInterface( UndoInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~UndoDCOPInterface(); - k_dcop: - uint undoInterfaceNumber (); - void undo (); - void redo () ; - void clearUndo () ; - void clearRedo () ; - uint undoCount () ; - uint redoCount (); - uint undoSteps () ; - void setUndoSteps ( uint steps ); - void undoChanged (); - - - private: - UndoInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/undointerface.cpp b/interfaces/ktexteditor/undointerface.cpp deleted file mode 100644 index 30a1dd292..000000000 --- a/interfaces/ktexteditor/undointerface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "undointerface.h" -#include "undodcopinterface.h" -#include "document.h" - -namespace KTextEditor -{ - -class PrivateUndoInterface -{ - public: - PrivateUndoInterface() {interface = 0;} - ~PrivateUndoInterface() {} - UndoDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int UndoInterface::globalUndoInterfaceNumber = 0; - -UndoInterface::UndoInterface() -{ - globalUndoInterfaceNumber++; - myUndoInterfaceNumber = globalUndoInterfaceNumber++; - - d = new PrivateUndoInterface(); - TQString name = "UndoInterface#" + TQString::number(myUndoInterfaceNumber); - d->interface = new UndoDCOPInterface(this, name.latin1()); -} - -UndoInterface::~UndoInterface() -{ - delete d->interface; - delete d; -} - -unsigned int UndoInterface::undoInterfaceNumber () const -{ - return myUndoInterfaceNumber; -} - -void UndoInterface::setUndoInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("UndoInterface#"+suffix); -} - -UndoInterface *KTextEditor::undoInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/undointerface.h b/interfaces/ktexteditor/undointerface.h deleted file mode 100644 index b03e4cb4e..000000000 --- a/interfaces/ktexteditor/undointerface.h +++ /dev/null @@ -1,84 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_undointerface_h__ -#define __ktexteditor_undointerface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface to undo functionality of a Document. -*/ -class KTEXTEDITOR_EXPORT UndoInterface -{ - friend class PrivateUndoInterface; - - public: - UndoInterface (); - virtual ~UndoInterface (); - - unsigned int undoInterfaceNumber () const; - - protected: - void setUndoInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - virtual void undo () = 0; - - virtual void redo () = 0; - - virtual void clearUndo () = 0; - - virtual void clearRedo () = 0; - - virtual unsigned int undoCount () const = 0; - - virtual unsigned int redoCount () const = 0; - - /** - returns the maximum of undo steps possible, 0 means no limit ! - */ - virtual unsigned int undoSteps () const = 0; - - virtual void setUndoSteps ( unsigned int steps ) = 0; - - // - // signals !!! - // - public: - virtual void undoChanged () = 0; - - private: - class PrivateUndoInterface *d; - static unsigned int globalUndoInterfaceNumber; - unsigned int myUndoInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT UndoInterface *undoInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/ktexteditor/variableinterface.cpp b/interfaces/ktexteditor/variableinterface.cpp deleted file mode 100644 index 616e0beab..000000000 --- a/interfaces/ktexteditor/variableinterface.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - --- - Copyright (C) 2004, Anders Lund -*/ - -#include "variableinterface.h" -#include "document.h" - -using namespace KTextEditor; - -unsigned int VariableInterface::globalVariableInterfaceNumber = 0; - -VariableInterface::VariableInterface() -{ - globalVariableInterfaceNumber++; - myVariableInterfaceNumber = globalVariableInterfaceNumber++; -} - -VariableInterface::~VariableInterface() -{ -} - -unsigned int VariableInterface::variableInterfaceNumber() -{ - return myVariableInterfaceNumber; -} - -VariableInterface *KTextEditor::variableInterface( Document *doc ) -{ - if ( ! doc ) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/variableinterface.h b/interfaces/ktexteditor/variableinterface.h deleted file mode 100644 index 31310a43c..000000000 --- a/interfaces/ktexteditor/variableinterface.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. - - --- - Copyright (C) 2004, Anders Lund -*/ -#ifndef _KTEXTEDITOR_VARIABLE_INTERFACE_H_ -#define _KTEXTEDITOR_VARIABLE_INTERFACE_H_ - -#include - -class TQString; - -namespace KTextEditor { - -/** - * This interface is designed to provide access to "document variables", - * for example variables defined in files like "kate: variable value;" - * or the emacs style "-*- variable: value -*-". - * - * The purpose is to allow KTE plugins to use variables. - * A document implementing this interface should return values for variable - * that it does not otherwise know how to use, since they could be of interrest - * to plugins. A document implementing this interface must emit the variableChanged() - * signal whenever a variable is set that it will return a value for. - * - * @short KTextEditor interface to Document Variables - */ -class KTEXTEDITOR_EXPORT VariableInterface -{ - public: - VariableInterface(); - virtual ~VariableInterface(); - - unsigned int variableInterfaceNumber(); - - /** - * @return the value of the variable @p name, or an empty string if the - * variable is not set or has no value. - */ - virtual TQString variable( const TQString &name ) const = 0; - - // - // signals!! - // - public: - /** - * Signal: emitted when a variable is set - */ - virtual void variableChanged( const TQString &variable, const TQString &value ) = 0; - - private: - static unsigned int globalVariableInterfaceNumber; - unsigned int myVariableInterfaceNumber; -}; - - -KTEXTEDITOR_EXPORT VariableInterface *variableInterface( class Document * ); -} // namespace KTextEditor -#endif //_KTEXTEDITOR_VARIABLE_INTERFACE_H_ diff --git a/interfaces/ktexteditor/view.h b/interfaces/ktexteditor/view.h deleted file mode 100644 index caa14d021..000000000 --- a/interfaces/ktexteditor/view.h +++ /dev/null @@ -1,68 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_view_h__ -#define __ktexteditor_view_h__ - -#include -#include - -namespace KTextEditor -{ - -/** - * The View class represents a single view of a Document . - */ - -class KTEXTEDITOR_EXPORT View : public TQWidget, public KXMLGUIClient -{ - friend class PrivateView; - - Q_OBJECT - - public: - /** - * Create a new view to the given document. The document must be non-null. - */ - View ( class Document *, TQWidget *parent, const char *name = 0 ); - virtual ~View (); - - /** - * Returns the number of this view - */ - unsigned int viewNumber () const; - - /** - * Returns the DCOP suffix to allow identification of this view's DCOP interface. - */ - TQCString viewDCOPSuffix () const; - - /** - * Acess the parent Document. - */ - virtual class Document *document () const = 0; - - private: - class PrivateView *d; - static unsigned int globalViewNumber; - unsigned int myViewNumber; -}; - -} - -#endif diff --git a/interfaces/ktexteditor/viewcursordcopinterface.cpp b/interfaces/ktexteditor/viewcursordcopinterface.cpp deleted file mode 100644 index f26385414..000000000 --- a/interfaces/ktexteditor/viewcursordcopinterface.cpp +++ /dev/null @@ -1,68 +0,0 @@ -#include "viewcursordcopinterface.h" -#include "viewcursorinterface.h" - -#include - -#include -using namespace KTextEditor; - -ViewCursorDCOPInterface::ViewCursorDCOPInterface( ViewCursorInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -ViewCursorDCOPInterface::~ViewCursorDCOPInterface() -{ - -} - -uint ViewCursorDCOPInterface::viewCursorInterfaceNumber () -{ - return m_parent->viewCursorInterfaceNumber (); -} - -::TQPoint ViewCursorDCOPInterface::cursorCoordinates () -{ - return m_parent->cursorCoordinates (); -} - -void ViewCursorDCOPInterface::cursorPosition (uint line, uint col) -{ - m_parent->cursorPosition (&line, &col); -} - -void ViewCursorDCOPInterface::cursorPositionReal (uint line, uint col) -{ - m_parent->cursorPositionReal (&line, &col); -} - -bool ViewCursorDCOPInterface::setCursorPosition (uint line, uint col) -{ - return m_parent->setCursorPosition ( line, col); -} - -bool ViewCursorDCOPInterface::setCursorPositionReal (uint line, uint col) -{ - return m_parent->setCursorPositionReal ( line, col); -} - -uint ViewCursorDCOPInterface::cursorLine () -{ - return m_parent->cursorLine (); -} - -uint ViewCursorDCOPInterface::cursorColumn () -{ - return m_parent->cursorColumn (); -} - -uint ViewCursorDCOPInterface::cursorColumnReal () -{ - return m_parent->cursorColumnReal (); -} - -void ViewCursorDCOPInterface::cursorPositionChanged () -{ - m_parent->cursorPositionChanged (); -} diff --git a/interfaces/ktexteditor/viewcursordcopinterface.h b/interfaces/ktexteditor/viewcursordcopinterface.h deleted file mode 100644 index 4bae0b520..000000000 --- a/interfaces/ktexteditor/viewcursordcopinterface.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef ViewCursor_DCOP_INTERFACE_H -#define ViewCursor_DCOP_INTERFACE_H - -#include -#include -#include -#include -//#include "editdcopinterface.moc" -namespace KTextEditor -{ - class ViewCursorInterface; - /** - This is the main interface to the ViewCursorInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to ViewCursorInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT ViewCursorDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent ViewCursorInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - ViewCursorDCOPInterface( ViewCursorInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~ViewCursorDCOPInterface(); - k_dcop: - - uint viewCursorInterfaceNumber (); - /** - * Get the current cursor coordinates in pixels. - */ - class TQPoint cursorCoordinates (); - - /** - * Get the cursor position - */ - void cursorPosition (uint line, uint col); - - /** - * Get the cursor position, calculated with 1 character per tab - */ - void cursorPositionReal (uint line, uint col); - - /** - * Set the cursor position - */ - bool setCursorPosition (uint line, uint col); - - /** - * Set the cursor position, use 1 character per tab - */ - bool setCursorPositionReal (uint line, uint col); - - uint cursorLine (); - uint cursorColumn (); - uint cursorColumnReal (); - void cursorPositionChanged (); - - private: - ViewCursorInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/viewcursorinterface.cpp b/interfaces/ktexteditor/viewcursorinterface.cpp deleted file mode 100644 index 58cea6289..000000000 --- a/interfaces/ktexteditor/viewcursorinterface.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "viewcursorinterface.h" -#include "viewcursordcopinterface.h" -#include "view.h" - -namespace KTextEditor -{ - -class PrivateViewCursorInterface -{ - public: - PrivateViewCursorInterface() {interface=0;} - ~PrivateViewCursorInterface() {} - ViewCursorDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int ViewCursorInterface::globalViewCursorInterfaceNumber = 0; - -ViewCursorInterface::ViewCursorInterface() -{ - globalViewCursorInterfaceNumber++; - myViewCursorInterfaceNumber = globalViewCursorInterfaceNumber++; - - d = new PrivateViewCursorInterface(); - TQString name = "ViewCursorInterface#" + TQString::number(myViewCursorInterfaceNumber); - d->interface = new ViewCursorDCOPInterface(this, name.latin1()); -} - -ViewCursorInterface::~ViewCursorInterface() -{ - delete d->interface; - delete d; -} - -unsigned int ViewCursorInterface::viewCursorInterfaceNumber () const -{ - return myViewCursorInterfaceNumber; -} - -void ViewCursorInterface::setViewCursorInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("ViewCursorInterface#"+suffix); -} - -ViewCursorInterface *KTextEditor::viewCursorInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} diff --git a/interfaces/ktexteditor/viewcursorinterface.h b/interfaces/ktexteditor/viewcursorinterface.h deleted file mode 100644 index fd6dae8ff..000000000 --- a/interfaces/ktexteditor/viewcursorinterface.h +++ /dev/null @@ -1,95 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_viewcursorinterface_h__ -#define __ktexteditor_viewcursorinterface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface to access the text cursor of a View class. -*/ -class KTEXTEDITOR_EXPORT ViewCursorInterface -{ - friend class PrivateViewCursorInterface; - - public: - ViewCursorInterface (); - virtual ~ViewCursorInterface (); - - unsigned int viewCursorInterfaceNumber () const; - - protected: - void setViewCursorInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - /** - * Get the current cursor coordinates in pixels. - */ - virtual class TQPoint cursorCoordinates () = 0; - - /** - * Get the cursor position - */ - virtual void cursorPosition (unsigned int *line, unsigned int *col) = 0; - - /** - * Get the cursor position, calculated with 1 character per tab - */ - virtual void cursorPositionReal (unsigned int *line, unsigned int *col) = 0; - - /** - * Set the cursor position - */ - virtual bool setCursorPosition (unsigned int line, unsigned int col) = 0; - - /** - * Set the cursor position, use 1 character per tab - */ - virtual bool setCursorPositionReal (unsigned int line, unsigned int col) = 0; - - virtual unsigned int cursorLine () = 0; - virtual unsigned int cursorColumn () = 0; - virtual unsigned int cursorColumnReal () = 0; - - // - // signals !!! - // - public: - virtual void cursorPositionChanged () = 0; - - private: - class PrivateViewCursorInterface *d; - static unsigned int globalViewCursorInterfaceNumber; - unsigned int myViewCursorInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT ViewCursorInterface *viewCursorInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp b/interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp deleted file mode 100644 index d38b9b938..000000000 --- a/interfaces/ktexteditor/viewstatusmsgdcopinterface.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include "viewstatusmsgdcopinterface.h" -#include "viewstatusmsginterface.h" - -#include - -#include -using namespace KTextEditor; - -ViewStatusMsgDCOPInterface::ViewStatusMsgDCOPInterface( ViewStatusMsgInterface *Parent, const char *name) - : DCOPObject(name) -{ - m_parent = Parent; -} - -ViewStatusMsgDCOPInterface::~ViewStatusMsgDCOPInterface() -{ - -} - -uint ViewStatusMsgDCOPInterface::viewStatusMsgInterfaceNumber () -{ - return m_parent->viewStatusMsgInterfaceNumber (); -} - -void ViewStatusMsgDCOPInterface::viewStatusMsg (TQString msg) -{ - m_parent->viewStatusMsg(msg); -} - diff --git a/interfaces/ktexteditor/viewstatusmsgdcopinterface.h b/interfaces/ktexteditor/viewstatusmsgdcopinterface.h deleted file mode 100644 index b4c5cf72e..000000000 --- a/interfaces/ktexteditor/viewstatusmsgdcopinterface.h +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef ViewStatusMsg_DCOP_INTERFACE_H -#define ViewStatusMsg_DCOP_INTERFACE_H - -#include -#include -#include -#include -//#include "editdcopinterface.moc" -namespace KTextEditor -{ - class ViewStatusMsgInterface; - /** - This is the main interface to the ViewStatusMsgInterface of KTextEdit. - This will provide a consistant dcop interface to all KDE applications that use it. - @short DCOP interface to ViewStatusMsgInterface. - @author Ian Reinhart Geiser - */ - class KTEXTEDITOR_EXPORT ViewStatusMsgDCOPInterface : virtual public DCOPObject - { - K_DCOP - - public: - /** - Construct a new interface object for the text editor. - @param Parent the parent ViewStatusMsgInterface object - that will provide us with the functions for the interface. - @param name the QObject's name - */ - ViewStatusMsgDCOPInterface( ViewStatusMsgInterface *Parent, const char *name ); - /** - Destructor - Cleans up the object. - */ - virtual ~ViewStatusMsgDCOPInterface(); - k_dcop: - uint viewStatusMsgInterfaceNumber (); - void viewStatusMsg (class TQString msg) ; - - private: - ViewStatusMsgInterface *m_parent; - }; -} -#endif - - diff --git a/interfaces/ktexteditor/viewstatusmsginterface.cpp b/interfaces/ktexteditor/viewstatusmsginterface.cpp deleted file mode 100644 index af8870c80..000000000 --- a/interfaces/ktexteditor/viewstatusmsginterface.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "viewstatusmsginterface.h" -#include "viewstatusmsgdcopinterface.h" -#include "view.h" - -#include - -namespace KTextEditor -{ - -class PrivateViewStatusMsgInterface -{ - public: - PrivateViewStatusMsgInterface() {interface=0;} - ~PrivateViewStatusMsgInterface() {} - ViewStatusMsgDCOPInterface *interface; -}; - -} - -using namespace KTextEditor; - -unsigned int ViewStatusMsgInterface::globalViewStatusMsgInterfaceNumber = 0; - -ViewStatusMsgInterface::ViewStatusMsgInterface() -{ - globalViewStatusMsgInterfaceNumber++; - myViewStatusMsgInterfaceNumber = globalViewStatusMsgInterfaceNumber++; - - d = new PrivateViewStatusMsgInterface(); - ::TQString name = "ViewStatusMsgInterface#" + ::TQString::number(myViewStatusMsgInterfaceNumber); - d->interface = new ViewStatusMsgDCOPInterface(this, name.latin1()); -} - -ViewStatusMsgInterface::~ViewStatusMsgInterface() -{ - delete d->interface; - delete d; -} - -unsigned int ViewStatusMsgInterface::viewStatusMsgInterfaceNumber () const -{ - return myViewStatusMsgInterfaceNumber; -} - -void ViewStatusMsgInterface::setViewStatusMsgInterfaceDCOPSuffix (const TQCString &suffix) -{ - d->interface->setObjId ("ViewStatusMsgInterface#"+suffix); -} - -ViewStatusMsgInterface *KTextEditor::viewStatusMsgInterface (View *view) -{ - if (!view) - return 0; - - return dynamic_cast(view); -} diff --git a/interfaces/ktexteditor/viewstatusmsginterface.h b/interfaces/ktexteditor/viewstatusmsginterface.h deleted file mode 100644 index 709448124..000000000 --- a/interfaces/ktexteditor/viewstatusmsginterface.h +++ /dev/null @@ -1,63 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_viewstatusmsginterface_h__ -#define __ktexteditor_viewstatusmsginterface_h__ - -#include - -class TQString; -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface for retrieving status bar messages from the Document class. -*/ -class KTEXTEDITOR_EXPORT ViewStatusMsgInterface -{ - friend class PrivateViewStatusMsgInterface; - - public: - ViewStatusMsgInterface(); - virtual ~ViewStatusMsgInterface(); - - unsigned int viewStatusMsgInterfaceNumber () const; - - protected: - void setViewStatusMsgInterfaceDCOPSuffix (const TQCString &suffix); - - // - // signals !!! - // - public: - virtual void viewStatusMsg (const class TQString &msg) = 0; - - - private: - class PrivateViewStatusMsgInterface *d; - static unsigned int globalViewStatusMsgInterfaceNumber; - unsigned int myViewStatusMsgInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT ViewStatusMsgInterface *viewStatusMsgInterface (class View *view); - -} - -#endif diff --git a/interfaces/ktexteditor/wordwrapinterface.cpp b/interfaces/ktexteditor/wordwrapinterface.cpp deleted file mode 100644 index 6be76120b..000000000 --- a/interfaces/ktexteditor/wordwrapinterface.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 2001 Christoph Cullmann - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -// $Id$ - -#include "wordwrapinterface.h" -#include "document.h" - - -namespace KTextEditor -{ - -class PrivateWordWrapInterface -{ - public: - PrivateWordWrapInterface() {} - ~PrivateWordWrapInterface() {} -}; - -} - -using namespace KTextEditor; - -unsigned int WordWrapInterface::globalWordWrapInterfaceNumber = 0; - -WordWrapInterface::WordWrapInterface() -{ - globalWordWrapInterfaceNumber++; - myWordWrapInterfaceNumber = globalWordWrapInterfaceNumber++; - - d = new PrivateWordWrapInterface(); -} - -WordWrapInterface::~WordWrapInterface() -{ - delete d; -} - -unsigned int WordWrapInterface::wordWrapInterfaceNumber () const -{ - return myWordWrapInterfaceNumber; -} - -void WordWrapInterface::setWordWrapInterfaceDCOPSuffix (const TQCString &/*suffix*/) -{ - //d->interface->setObjId ("WordWrapInterface#"+suffix); -} - -WordWrapInterface *KTextEditor::wordWrapInterface (Document *doc) -{ - if (!doc) - return 0; - - return dynamic_cast(doc); -} diff --git a/interfaces/ktexteditor/wordwrapinterface.h b/interfaces/ktexteditor/wordwrapinterface.h deleted file mode 100644 index 155e69ae2..000000000 --- a/interfaces/ktexteditor/wordwrapinterface.h +++ /dev/null @@ -1,66 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef __ktexteditor_wordwrapinterface_h__ -#define __ktexteditor_wordwrapinterface_h__ - -#include - -class TQCString; - -namespace KTextEditor -{ - -/** -* This is an interface to control fixed-column word-wrapping of a Document. -*/ -class KTEXTEDITOR_EXPORT WordWrapInterface -{ - friend class PrivateWordWrapInterface; - - public: - WordWrapInterface (); - virtual ~WordWrapInterface (); - - unsigned int wordWrapInterfaceNumber () const; - - protected: - void setWordWrapInterfaceDCOPSuffix (const TQCString &suffix); - - // - // slots !!! - // - public: - virtual void setWordWrap (bool) = 0; - virtual bool wordWrap () = 0; - - virtual void setWordWrapAt (unsigned int ) = 0; - virtual unsigned int wordWrapAt () = 0; - - private: - class PrivateWordWrapInterface *d; - static unsigned int globalWordWrapInterfaceNumber; - unsigned int myWordWrapInterfaceNumber; -}; - -KTEXTEDITOR_EXPORT WordWrapInterface *wordWrapInterface (class Document *doc); - -} - -#endif diff --git a/interfaces/tdeimproxy/CMakeLists.txt b/interfaces/tdeimproxy/CMakeLists.txt new file mode 100644 index 000000000..f52118353 --- /dev/null +++ b/interfaces/tdeimproxy/CMakeLists.txt @@ -0,0 +1,13 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( interface ) +add_subdirectory( library ) diff --git a/interfaces/tdeimproxy/Makefile.am b/interfaces/tdeimproxy/Makefile.am new file mode 100644 index 000000000..105f84291 --- /dev/null +++ b/interfaces/tdeimproxy/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = interface library \ No newline at end of file diff --git a/interfaces/tdeimproxy/TODO b/interfaces/tdeimproxy/TODO new file mode 100644 index 000000000..fc66130fe --- /dev/null +++ b/interfaces/tdeimproxy/TODO @@ -0,0 +1,10 @@ +For the future, the following modifications need to be done: + +Currently there is a function : + virtual QString presenceString( const QString & uid ) = 0; +This needs to be broken into: + virtual QString presenceString( const QString & uid ) = 0; + virtual QString presenceLongString( const QString & uid ) = 0; + +The former returning, say "Away", the latter returning the long away +message. diff --git a/interfaces/tdeimproxy/interface/CMakeLists.txt b/interfaces/tdeimproxy/interface/CMakeLists.txt new file mode 100644 index 000000000..d62819ed8 --- /dev/null +++ b/interfaces/tdeimproxy/interface/CMakeLists.txt @@ -0,0 +1,22 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +##### headers ################################### + +install( FILES + kimiface.h + DESTINATION ${INCLUDE_INSTALL_DIR} ) + + +##### other data ################################ + +install( FILES kcm_instantmessenger.desktop DESTINATION ${DATA_INSTALL_DIR}/kcm_componentchooser ) +install( FILES dcopinstantmessenger.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) diff --git a/interfaces/tdeimproxy/interface/Makefile.am b/interfaces/tdeimproxy/interface/Makefile.am new file mode 100644 index 000000000..348130e46 --- /dev/null +++ b/interfaces/tdeimproxy/interface/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = $(all_includes) + +kimifaceinclude_HEADERS = kimiface.h +kimifaceincludedir = $(includedir) + +servicetypedir = $(kde_servicetypesdir) +servicetype_DATA = dcopinstantmessenger.desktop + +kcm_instantmessenger_DATA = kcm_instantmessenger.desktop +kcm_instantmessengerdir = $(kde_datadir)/kcm_componentchooser + +include $(top_srcdir)/admin/Doxyfile.am +DOXYGEN_REFERENCES = kabc diff --git a/interfaces/tdeimproxy/interface/dcopinstantmessenger.desktop b/interfaces/tdeimproxy/interface/dcopinstantmessenger.desktop new file mode 100644 index 000000000..a69994421 --- /dev/null +++ b/interfaces/tdeimproxy/interface/dcopinstantmessenger.desktop @@ -0,0 +1,72 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=DCOP/InstantMessenger +Comment=Instant Messenger with a DCOP interface +Comment[af]=Oombliklike Boodskapper met DCOP intervlak +Comment[be]=Імгненны абвестнік з інтэрфэйсам DCOP +Comment[bg]=Програма за съобщения в реално време с интерфейс DCOP +Comment[bn]=ডিকপ (DCOP) ইন্টারফেস সহ ইনস্ট্যান্ট মেসেঞ্জার +Comment[bs]=Instant poruke sa DCOP interfejsom +Comment[ca]=Missatgeria instantània amb una interfície DCOP +Comment[cs]=Komunikátor s DCOP rozhraním +Comment[csb]=Internetowi kòmùnikator z interfejsã DCOP +Comment[cy]=Negesydd Chwim efo rhyngwyneb DCOP +Comment[da]=Instant Messenger med en DCOP-grænseflade +Comment[de]=Instant Messenger mit DCOP-Schnittstelle +Comment[el]=Στιγμιαίος αποστολέας με διασύνδεση DCOP +Comment[eo]=Tujmesaĝilo kun DCOP-interfaco +Comment[es]=Instant Messenger con un interfaz DCOP +Comment[et]=Kiirsuhtlemisrakendus DCOP-liidesega +Comment[eu]=Berehalako mezularitza DCOP interfazearekin +Comment[fa]=پیام‌رسان فوری با یک واسط DCOP +Comment[fi]=Pikaviestiohjelma, jossa on DCOP-rajapinta +Comment[fr]=Messagerie instantanée munie d'une interface DCOP +Comment[fy]=Instant Messenger mei in DCOP-interface +Comment[ga]=Clár teachtaireachtaí meandaracha le comhéadan DCOP +Comment[gl]=Mensaxeria Instantánea con interface DCOP +Comment[he]=תכנת מסרים מידיים עם ממשק DCOP +Comment[hi]=डीकॉप इंटरफेस सहित इंस्टैंट मैसेंजर +Comment[hr]=Trenutne poruke s DCOP sučeljem +Comment[hsb]=Instant Messenger z DCOP-interfejsom +Comment[hu]=Azonnali üzenetküldő DCOP-felülettel +Comment[id]=Instant Messenger dengan antarmuka DCOP +Comment[is]=Spjallforrit með DCOP viðmóti +Comment[it]=Messaggistica istantanea con un'interfaccia DCOP +Comment[ja]=DCOP インターフェースをもつインスタントメッセンジャー +Comment[ka]=DCOP ინტერფეისთან შეტყობინებების გაცვლის შიკრიკი +Comment[kk]=DCOP интерфейсті жедел хабарласу бағдарламасы +Comment[km]=​កម្មវិធី​ជជែក​កំសាន្ត​ដែល​មាន​ចំណុច​ប្រទាក់ DCOP +Comment[lb]=Instant Messenger mat engem DCOP-Interface +Comment[lt]=Momentinių žinučių klientas su DCOP sąsaja +Comment[mk]=Инстант Гласник (Messenger) со DCOP интерфејс +Comment[ms]=Utusan Segera dengan antaramuka DCOP +Comment[nb]=Lynmeldingsprogram med DCOP-grensesnitt +Comment[nds]=Kortnarichten-Maker mit DCOP-Koppelsteed +Comment[ne]=DCOP इन्टरफेससँग आवश्यक मेसेन्जर +Comment[nl]=Instant messenger met een DCOP interface +Comment[nn]=Lynmeldingsprogram med DCOP-grensesnitt +Comment[pa]=ਇੱਕ DCOP ਇੰਟਰਫੇਸ ਲਈ ਇੱਕ ਮੌਕਾ ਸੁਨੇਹਾਕਾਰ +Comment[pl]=Komunikator internetowy z interfejsem DCOP +Comment[pt]=Mensageiro Instantâneo com interface DCOP +Comment[pt_BR]=Mensageiro Instantâneo com uma interface DCOP +Comment[ro]=Aplicaţie de mesaje instantanee cu interfaţă DCOP +Comment[ru]=Клиент обмена сообщениями с интерфейсом DCOP +Comment[rw]=Intumwa y'Akokanya ifite imigaragarire DCOP +Comment[se]=Šleađgadiehtoprográmma mas lea DCOP-lákta +Comment[sk]=Instant Messanger s rozhraním DCOP +Comment[sl]=Takojšni sporočilnik z vmesnikom DCOP +Comment[sr]=Брзи гласник са DCOP интерфејсом +Comment[sr@Latn]=Brzi glasnik sa DCOP interfejsom +Comment[sv]=Direktmeddelanden med ett DCOP-gränssnitt +Comment[ta]=உடனடி செய்தியாளர் DCOP இடைமுகத்தோடு +Comment[te]=డిసిఓపి ఇంటర్ఫెస్ కలిగివున్న ఇంస్టెంట్ మెస్సెన్జర్ +Comment[tg]=Мубодилаи паёмҳо бо интерфейси DCOP +Comment[th]=โปรแกรมส่งข้อความแบบทันที ด้วยส่วนติดต่อกับ DCOP +Comment[tr]=DCOP arayüzüyle Anında Mesajlaşma +Comment[tt]=DCOP protokolı belän Aşığıç Xäbärçe +Comment[uk]=Програма для миттєвого зв'язку через DCOP +Comment[vi]=Bộ tin nhắn tức khắc có giao diện DCOP +Comment[wa]=Messaedjreye sol moumint avou ene eterface DCOP +Comment[zh_CN]=带 DCOP 接口的即时通讯程序 +Comment[zh_HK]=附有 DCOP 介面的即時通訊軟件 +Comment[zh_TW]=DCOP 介面的即時通訊系統 diff --git a/interfaces/tdeimproxy/interface/kcm_instantmessenger.desktop b/interfaces/tdeimproxy/interface/kcm_instantmessenger.desktop new file mode 100644 index 000000000..860f82944 --- /dev/null +++ b/interfaces/tdeimproxy/interface/kcm_instantmessenger.desktop @@ -0,0 +1,138 @@ +Name=Instant Messenger +Name[af]=Oombliklike Boodskapper +Name[be]=Імгненны абвеснік +Name[bg]=Съобщения в реално време +Name[bn]=ইনস্ট্যান্ট মেসেঞ্জার +Name[br]=Posteler a-benn-kaer +Name[bs]=Instant poruke +Name[ca]=Missatgeria instantània +Name[cs]=Komunikátor +Name[csb]=Internetowi kòmùnikator +Name[cy]=Negesydd Chwim +Name[el]=Στιγμιαίος αποστολέας +Name[eo]=Tujmesaĝilo +Name[et]=Kiirsuhtlus +Name[eu]=Berehalako mezularitza +Name[fa]=پیام‌رسان فوری +Name[fi]=Pikaviestiohjelma +Name[fr]=Messagerie instantanée +Name[ga]=Clár teachtaireachtaí meandaracha +Name[gl]=Mensaxeria Instantánea +Name[he]=מסרים מידיים +Name[hi]=इंस्टैंट मैसेंजर +Name[hu]=Azonnali üzenetküldő +Name[is]=Spjallforrit +Name[it]=Messaggistica istantanea +Name[ja]=インスタントメッセンジャー +Name[ka]=შიკრიკი +Name[kk]=Жедел хабарласу +Name[km]=កម្មវិធី​វិធីជជែក​កំសាន្ត +Name[lt]=Momentinių žinučių klientas +Name[mk]=Инстант Гласник (Messenger) +Name[ms]=Mesej Segera +Name[nb]=Lynmelding +Name[nds]=Kortnarichten-Maker +Name[ne]=आवश्यक मेसेन्जर +Name[nl]=Instant messenger +Name[nn]=Lynmelding +Name[pa]=ਮੌਕਾ ਸੁਨੇਹਾਕਾਰ +Name[pl]=Komunikator internetowy +Name[pt]=Mensageiro Instantâneo +Name[pt_BR]=Mensagem Instantâneo +Name[ro]=Mesaje instantanee +Name[ru]=Обмен сообщениями +Name[se]=Šleađgadieđut +Name[sl]=Takojšni sporočilnik +Name[sr]=Брзи гласник +Name[sr@Latn]=Brzi glasnik +Name[sv]=Direktmeddelanden +Name[ta]=உடனடி செய்தியாளர் +Name[te]=ఇంస్టెంట్ మెస్సెన్జర్ +Name[tg]=Мубодилаи паёмҳо +Name[th]=โปรแกรมส่งข้อความทันที +Name[tr]=Anında Mesajlaşma +Name[tt]=Aşığıç Xäbärçe +Name[uk]=Програма для миттєвого зв'язку через DCOP +Name[uz]=Xabar almashish vositasi +Name[uz@cyrillic]=Хабар алмашиш воситаси +Name[vi]=Bộ tin nhắn tức khắc +Name[wa]=Messaedjreye sol moumint +Name[zh_CN]=即时通讯程序 +Name[zh_HK]=即時通訊軟件 +Name[zh_TW]=即時通訊 +Comment=The instant messenger allows two-way chat between individuals and groups. +Comment[af]=Die oombliklike boodskappe laat twee rigting kommunikasie tussen individue en groepe toe. +Comment[be]=Імгненны абвеснік дазваляе весці размову двум і больш асобам/гуртам. +Comment[bg]=Разговор между различни хора в реално време. +Comment[bn]=ইনস্ট্যান্ট মেসেঞ্জার একাধিক ব্যক্তি বা গোষ্ঠীকে দ্বিমুখী বার্তালাপ বা আড্ডার সুযোগ দেয়। +Comment[bs]=Program za instant poruke omogućuje dvosmjernu komunikaciju između pojedinaca i grupa. +Comment[ca]=La missatgeria instantània permet converses en dos sentits entre individus i grups. +Comment[cs]=Komunikátor vám umožňuje obousměrný rozhovor s jednotlivci nebo skupinami. +Comment[csb]=Internetowi kòmùnikator dôwô mòżnota kôrbionczi midzë lëdzama ë karnama. +Comment[cy]=Mae'r negesydd chwim yn caniatàu sgwrs dwy-ffordd rhwng unigolion a grwpiau. +Comment[da]=Instant messenger tillader tovejs chat mellem individer og grupper. +Comment[de]=Der Instant Messenger ermöglicht Chats zwischen Personen und Gruppen in jede Richtung. +Comment[el]=Ο στιγμιαίος αποστολέας επιτρέπει τη συζήτηση μεταξύ ατόμων και ομάδων. +Comment[eo]=La tujmesaĝilo ebligas ambaŭdirekta parolado inter homoj kaj grupoj +Comment[es]=El Instant Messenger permite conversación en dos sentidos entre indivíduos y grupos. +Comment[et]=Kiirsuhtlus võimaldab üksikisikute ja gruppide kahepoolset vestlust. +Comment[eu]=Berehalako mezularitzak banan-banako edo taldeen arteko berriketan aritzeko. +Comment[fa]=پیام‌رسان فوری امکان گپ دو طرفه بین افراد و گروهها را می‌دهد. +Comment[fi]=Pikaviestiohjelman avulla voidaan keskustella kahden kesken tai ryhmässä. +Comment[fr]=La messagerie instantanée permet un dialogue bidirectionnel entre individus et groupes. +Comment[fy]=Mei de instant messenger kinne jo twaspraak hâlde mei in yndividu en groepen. +Comment[ga]=Is féidir comhrá déthreoch a dhéanamh idir daoine agus grúpaí leis an gclár teachtaireachtaí meandaracha. +Comment[gl]=O instant messenger permite conversas nos dous sentidos entre indivíduos e grupos. +Comment[he]=תוכנת מסרים מידיים מאשרת לשוחח ברשת (לצ'טט) בין יחידים או קבוצות +Comment[hi]=इंस्टैंट मैसेंजर जो व्यक्तियों या समूहों के बीच दो-तरफा गपशप स्वीकारता है. +Comment[hr]=Trenutne poruke omogućuju dvosmjerno brbljanje između pojedinaca i grupa. +Comment[hsb]=Instant messenger zmóžni jednotliwcam a skupinam spěšnu wuměnu zdźělenkow. +Comment[hu]=Interaktív társalgást tesz lehetővé az interneten keresztül két személy vagy csoport között. +Comment[id]=Instant messenger memungkinan chat dua-arah antara individu dan grup +Comment[is]=Spjallforritið gerir einstaklingum og hópum kleyft að spjalla saman á einfaldan máta. +Comment[it]=La messaggistica istantanea permette di chiacchierare tra due persone o in gruppo. +Comment[ja]=インスタントメッセンジャーは個人とグループとの双方向チャットを可能にします。 +Comment[ka]=შიკრიკი პიროვნებებსა და ჯგუფებს შორის მყისი შეტყობინებების გაცვლის საშუალებას იძლევა. +Comment[kk]=Жедел хабарласу жеке тұлға және топтар араларында әңгімелесу мүмкіндігін береді. +Comment[km]=កម្មវិធី​ជជែក​កំសាន្ត​អនុញ្ញាត​ឲ្យ​ជជែក​តាម​របៀប​ពីរ​បែប​រវាង​បុគ្គល និង​ក្រុម ។ +Comment[lb]=Den Instant Messenger erlaabt eng zwee-Weeër Kommunikatioun tëschent eenzelne Persounen a Gruppen. +Comment[lt]=Momentinių žinučių klientas kalbėtis individams ir grupėms. +Comment[mk]=Инстант гласникот овозможува двонасочна комуникација меѓу индивидуи и групи. +Comment[ms]=Utusan segera membenarkan perbualan di antara individu dan kumpulan. +Comment[nb]=Et lynmeldingsprogram som tallater toveis samtale mellom enkeltpersoner og grupper. +Comment[nds]=Mit den Kortnarichten-Maker köönt enkelte Minschen oder Gruppen ünnerenanner snacken. +Comment[ne]= आवश्यक मेसेन्जरले एकल र समूहहरुबीच दोहोरो कुराकानीलाई अनुमति दिन्छ । +Comment[nl]=De instant messenger maakt directe communicatie tussen personen of groepen mogelijk. +Comment[nn]=Eit lynmeldingsprogram som tillèt tovegsprat mellom enkeltpersonar og grupper. +Comment[pa]=ਇਹ ਮੌਕਾ ਸੁਨੇਹਾਕਾਰ ਇੱਕਲੇ ਤੇ ਸਮੂਹ ਵਿਚਕਾਰ ਦੋ ਪਾਸੀ ਗਲਬਾਤ ਲਈ ਸਹਾਇਕ ਹੈ +Comment[pl]=Komunikator internetowy umożliwia pogawędki między dwiema osobami lub grupami osób. +Comment[pt]=O mensageiro instantâneo permite conversar entre dois extremos com indivíduos e com grupos. +Comment[pt_BR]=O mensageiro instantâneo permite que exista um bate-papo entre indivíduos e grupos +Comment[ro]=Aplicaţia de mesaje instantanee permite convorbiri între persoane sau grupuri de persoane. +Comment[ru]=Клиент обмена сообщениями служит для обмена сообщениями между людьми и группами. +Comment[rw]=Intumwa y'Akokanya yemerera inzira-zombi z'ikiganiroInterineti hagati y'abantu ubwabo n'amatsinda +Comment[se]=Šleađgadiehtoprográmma gos olbmot ja joavkkut sáhttet buillardallat (chat). +Comment[sk]=Instant messenger umožňuje rozhovor medzi rôznymi osobami a skupinami. +Comment[sl]=Takojšni sporočilnik omogoča dvosmeren klepet med posamezniki in skupinami. +Comment[sr]=Брзи гласник вам омогућава двосмерно ћаскање између појединаца и група. +Comment[sr@Latn]=Brzi glasnik vam omogućava dvosmerno ćaskanje između pojedinaca i grupa. +Comment[sv]=Direktmeddelanden möjliggör tvåvägschatt mellan individer och grupper. +Comment[ta]=உடனடி தகவல் உங்களை இரண்டு வழியில் தனிநபர் மற்றும் குழுக்கள் இடையே அனுமதிக்கும். +Comment[te]=ఇంస్టెంట్ మెస్సెన్జర్ వ్యక్తు లు మరయు గుంపుల తొ ఇరువయపుల నుంచి సంబాషించవచ్చు +Comment[tg]=Мубодилаи паёмҳо барои сӯҳбат бо шахсони ҷудогона ва гурӯҳӣ иҷозат медиҳад. +Comment[th]=โปรแกรมส่งข้อความแบบทันที จะอนุญาตให้มีการพูดคุยสองทาง ทั้งระหว่าง บุคคลและกลุ่ม +Comment[tr]=Anında mesajlaştırıcı iki yollu sohbet sağlar: bireyler ve gruplar. +Comment[tt]=Bu aşığıç xäbärçe aşa keşe-törkemnär arasında ike-yaqlı aralaşu mömkinlegen birä. +Comment[uk]=Програма для миттєвого зв'язку дозволяє розмовляти з іншою людиною чи групою людей. +Comment[vi]=Bộ tin nhắn tức khắc cho phép trò chuyện hai chiều giữa người riêng và nhóm. +Comment[wa]=Li messaedjreye sol moumint permete di berdeler dins les deus sinses etur deus djins ou e groupe. +Comment[zh_CN]=允许在个人和群组之间双向聊天的即时通讯程序。 +Comment[zh_HK]=即時通訊軟件可以讓用戶和別的用戶或羣組通訊。 +Comment[zh_TW]=即時通訊系統允許兩個人或兩個群組間的聊天與對話 +ServiceTypeToConfigure=DCOP/InstantMessenger +MimeTypeOfInterest=DCOP/InstantMessenger +defaultImplementation=kopete +storeInFile=default_components +valueSection=InstantMessenger +valueName=imClient +configurationType=component diff --git a/interfaces/tdeimproxy/interface/kimiface.h b/interfaces/tdeimproxy/interface/kimiface.h new file mode 100644 index 000000000..f3212df6d --- /dev/null +++ b/interfaces/tdeimproxy/interface/kimiface.h @@ -0,0 +1,500 @@ +/* + kimiface.h - KDE Instant Messenger DCOP Interface + + Copyright (c) 2004-5 Will Stephenson + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KIMIFACE_H +#define KIMIFACE_H + +#include +#include +#include +#include + +/** + * @brief Generic DCOP interface for KDE instant messenger applications + * + * The interface has two parts: + * - methods to get information about IM-contacts, such as their reachability + * or their presence status (if the are online or away, etc) + * - methods to initiate communication with IM-contacts, e.g. sending messages + * + * @note If you are looking for a information about accessing application's + * that implement this interface, have a look at the KIMProxy class. + * + * Contacts are identified using unique identifier strings (UID) used by + * KABC, the KDE address book library. + * The UID generation is handled by KABC::Addressee so the your application + * will either have to access the address book or provide a possibility + * for associating a contact of your application with an entry of the address + * book. + * + * @note one omission of this interface is the lack of control over the range + * of values used for protocols' names. + * + * If you are implementing this interface, note that your application must + * have the following information in its desktop file, so that it can be + * identified as providing KIMIface at runtime: + * @code + * X-DCOP-ServiceName= + * ServiceTypes=DCOP/InstantMessenger + * @endcode + * and the class implementing KIMIface must pass "KIMIface" to the DCOPObject constructor: + * @code + * // just need TQObject inheritance and Q_OBJECT if you want signals and slots + * // no need to use K_DCOP macro again + * + * class MyIMIface : public TQObject, public KIMIface + * { + * Q_OBJECT + * public: + * MyIMIface(TQObject* parent = 0, const char* name) : + * DCOPObject("KIMIface"), // <-- passing the interface name as required + * TQObject(parent, name) {} + * }; + * @endcode + * + * The DCOP part of the interface needs to be processed by the DCOP IDL + * compiler. The KDE autotools framework will do this automatically, all + * you have to do is add kimiface.skel and kimiface.stub to the + * @c SOURCES list in your @c Makefile.am + * + * @see KIMProxy + * @see KABC::AddressBook + * @see KABC::Addressee + * + * @since 3.3 + * @author Will Stephenson + */ +class KIMIface : virtual public DCOPObject +{ + K_DCOP + +k_dcop: +// ACCESSORS +// contact list + /** + * @brief Obtain a list of IM-contacts that are known to the application + * + * Return a list of KABC UIDs of all the contacts you have such IDs for. + * + * @return a list of KABC UIDs known to the application + * + * @see reachableContacts() + * @see onlineContacts() + * @see fileTransferContacts() + * @see isPresent() + * @see KABC::Addressee::uid() + */ + virtual TQStringList allContacts() = 0; + + /** + * @brief Obtain a list of IM-contacts that are currently reachable + * + * Return a list of KABC UIDs of the contacts that are reachable in the + * sense that you are connected to the IM-service they are + * associated with. + * + * For example if your application supports ICQ and AIM and the ICQ account is + * active but the AIM account isn't, return just the ICQ contacts. + * + * @return a list of KABC UIDs who can receive a message, even if offline + * + * @see allContacts() + * @see onlineContacts() + * @see fileTransferContacts() + * @see messageContact() + * @see KABC::Addressee::uid() + */ + virtual TQStringList reachableContacts() = 0; + + /** + * @brief Obtain a list of IM-contacts that are currently online + * + * Return a list of KABC UIDs of the contacts you have any presence + * information for that indicates that they are connected to the + * IM-service they are associated with. + * + * @return a list of KABC UIDs who are online with unspecified presence + * + * @see allContacts() + * @see reachableContacts() + * @see fileTransferContacts() + * @see messageContact() + * @see chatWithContact() + * @see KABC::Addressee::uid() + */ + virtual TQStringList onlineContacts() = 0; + + /** + * @brief Obtain a list of IM-contacts who may receive file transfers + * + * Return a list of KABC UIDs of the contacts that are capable of + * receiving file transfers based on the IM-service they are associated + * with, i.e. if it is technically able to provide this, on their online + * state, i.e. can likely not receive files while offline, and perhaps even + * information your application has additionally, e.g. a user config that + * tells you that the contact is behind a firewall. + * + * The simplest implementation is to return the same list as + * onlineContacts(), provided all the IM-services that are currently used + * support it. + * + * @return a list of KABC UIDs capable of file transfer + * + * @see allContacts() + * @see reachableContacts() + * @see onlineContacts() + * @see canReceiveFiles() + * @see sendFile() + * @see KABC::Addressee::uid() + */ + virtual TQStringList fileTransferContacts() = 0; + +// individual + /** + * @brief Confirm if a given contact is known to the IM application + * + * Check if you can map the given KABC UID to one if the IM-contacts, e.g. + * the would be part of the list returned by allContacts() + * + * @param uid the KABC UID you are interested in + * @return whether the program knows of this KABC UID + * + * @see allContacts() + * @see presenceString() + * @see presenceStatus() + * @see KABC::Addressee::uid() + */ + virtual bool isPresent( const TQString & uid ) = 0; + + /** + * @brief Obtain the IM app's idea of the contact's display name + * + * Useful if KABC lookups may be too slow. Should return whatever + * the application uses in its contact list or similar GUI, e.g. + * a nick name, a user configured name string, etc. + * + * @param uid the KABC UID you are interested in + * @return the corresponding display name or TQString:null if the + * UID is unknown + * + * @see isPresent() + * @see presenceString() + * @see presenceStatus() + * @see KABC::Addressee::uid() + */ + virtual TQString displayName( const TQString & uid ) = 0; + + /** + * @brief Obtain the IM presence as a i18ned string for the specified + * contact + * + * Return a translated string your application would use when displaying + * the contact's presence, e.g. i18n("Online"), i18n("Away") + * + * @param uid the KABC UID you want the presence for + * @return the i18ned string describing the contact's presence or + * TQString::null if the UID is unknown + * + * @see isPresent() + * @see presenceStatus() + * @see KABC::Addressee::uid() + */ + virtual TQString presenceString( const TQString & uid ) = 0; + + /** + * @brief Obtain the IM presence as a number for the specified contact + * + * Return one of the following values depending on the given contact's + * presence: + * - 0 - @c Unknown: for contacts where you can not use any of the other + * values + * + * - 1 - @c Offline: for contacts that are offline, i.e. not connected to + * their IM-service. If the application itself or the IM-service for the + * given contact is offline return @c Unknown instead + * + * - 2 - @c Connecting + * + * - 3 - @c Away: for contacts that are connected to their IM-service but + * not @c Online + * + * - 4 - @c Online + * + * @param uid the KABC UID you want the presence for + * @return a numeric representation of presence - currently one of + * 0 (Unknown), 1 (Offline), 2 (Connecting), 3 (Away), 4 (Online). + * Returns 0 if the given UID is unknown + * + * @see isPresent() + * @see presenceString() + * @see KABC::Addressee::uid() + */ + virtual int presenceStatus( const TQString & uid ) = 0; + + /** + * @brief Indicate if a given contact can receive files + * + * @param uid the KABC UID you want to the file transfer capability for + * @return whether the specified contact can receive files + * + * @see fileTransferContacts() + * @see KABC::Addressee::uid() + */ + virtual bool canReceiveFiles( const TQString & uid ) = 0; + + /** + * @brief Indicate if a given contact will be able to respond + * + * Some media are unidirectional (e.g., sending SMS via a web interface). + * This refers to the contact's ability to respond as defined by the + * medium, not by their presence. + * + * Someone may appear offline (SMS has no presence) to you but in fact be + * able to respond. + * + * @param uid the KABC UID you are interested in + * @return whether the specified contact can respond + * + * @see isPresent() + * @see KABC::Addressee::uid() + */ + virtual bool canRespond( const TQString & uid ) = 0; + + /** + * @brief Obtain the KABC UID corresponding to the given IM address + * + * @param contactId the protocol specific identifier for the contact, + * e.g. UIN for ICQ, screenname for AIM, nick for IRC + * @param protocol the IM protocol/service to check. See protocols() + * @return the KABC UID for the given contact or @c TQString::null if not + * found or either input stream was empty or the protocol is not + * supported + * + * @see protocols() + * @see addContact() + * @see isPresent() + * @see KABC::Addressee::uid() + */ + virtual TQString locate( const TQString & contactId, const TQString & protocol ) = 0; + +// metadata + /** + * @brief Obtain the icon representing the IM presence for the specified + * contact + * + * Return the image the application would use to display a contact's presence. + * The size and other properties of the image are currently unspecified. + * + * @param uid the KABC UID you want the presence icon for + * @return a pixmap representing the contact's presence or a null pixmap + * if the contact is unknown. See TQPixmap::isNull() + * + * @see isPresent() + * @see presenceString() + * @see presenceStatus() + * @see KABC::Addressee::uid() + */ + virtual TQPixmap icon( const TQString & uid ) = 0; + + /** + * @brief Obtain the given contact's current context (home, work, or any) + * + * Not all IM services/protocols support the concept of contexts. If the + * given UID maps to such a service, just return @c TQString::null + * + * @param uid the KABC UID you want the context for + * @return a string describing the context, or @c TQString::null if not + * supported or if the contact is unknown + * + * @see isPresent() + * @see KABC::Addressee::uid() + */ + virtual TQString context( const TQString & uid ) = 0; + +// App capabilities + /** + * @brief Obtain a list of supported IM services/protocols + * + * Protocol names are currently of the form "protocol name" + "Protocol" + * for example: + * - AIMProtocol: AOL instant messenger protocol + * - MSNProtocol: Microsoft messanger protocol + * - ICQProtocol: AOL (Mirabilis) ICQ protocol + * - .... + * + * The string is currently just an identifier to use with methods such as + * locate(), addContact() or messageNewContact() + * + * @return the set of protocols that the application supports + * + * @see locate() + * @see addContact() + * @see messageNewContact + */ + virtual TQStringList protocols() = 0; + +// ACTORS + /** + * @brief Send a single message to the specified contact + * + * Any response will be handled by the IM client as a normal + * conversation. + * + * Implementations might send the message silently, ask the user for + * permission or just prefill the usual message input GUI. + * + * @note As sending any text could potentially be a breach of the user's + * privacy it is recommended to let the user know about it. + * + * @param uid the KABC UID you want to send the message to + * @param message the message text to send to the contact + * + * @see messageNewContact() + * @see chatWithContact() + * @see sendFile() + * @see isPresent() + * @see reachableContacts() + * @see KABC::Addressee::uid() + */ + virtual void messageContact( const TQString &uid, const TQString& message ) = 0; + + /** + * @brief Send a single message to a contact given only its protocol + * specific identifier + * + * This could be used to send a message without having to know the KABC UID + * of the contact or without having to add it first. + * + * @param contactId the protocol specific identifier for the contact, + * e.g. UIN for ICQ, screenname for AIM, nick for IRC + * @param protocol the IM protocol/service to check. See protocols() + * + * @see messageContact() + * @see chatWithContact() + * @see sendFile() + * @see locate() + * @see protocols() + * @see addContact() + */ + virtual void messageNewContact( const TQString &contactId, const TQString &protocol ) = 0; + + /** + * @brief Start a chat session with the specified contact + * + * Applications that do not support a chat mode or when the IM-service + * of the given contact does not support it, this can also open + * a normal message input GUI. + * + * @param uid the KABC UID you want to chat with + * + * @see messageContact() + * @see messageNewContact() + * @see sendFile() + * @see isPresent() + * @see reachableContacts() + * @see KABC::Addressee::uid() + */ + virtual void chatWithContact( const TQString &uid ) = 0; + + /** + * @brief Send a file to the contact + * + * Initiates a file transfer with the given contact if possible. + * + * Implementations might start the transfer right away, ask the user's + * permission or just prefill the usual file transfer GUI. + * + * @note As sending any file could potentially be a breach of the user's + * privacy it is recommended to let the user know about it. + * + * @param uid the KABC UID you want to send to + * @param sourceURL a KURL pointing to the file to send + * @param altFileName an alternate filename describing the file or a + * description or title + * @param fileSize file size in bytes + * + * @see messageContact() + * @see messageNewContact() + * @see chatWithContact() + * @see isPresent() + * @see fileTransferContacts() + * @see KABC::Addressee::uid() + */ + virtual void sendFile(const TQString &uid, const KURL &sourceURL, + const TQString &altFileName = TQString::null, uint fileSize = 0) = 0; + +// MUTATORS +// Contact list + /** + * @brief Add a new contact given its protocol specific identifier + * + * Implementations might add the contact silently, including sending an + * authorization request if necessary, ask the user for confirmation or + * just prefill the usual contact addingGUI. + * + * @param contactId the protocol specific identifier for the contact + * e.g. UIN for ICQ, screenname for AIM, nick for IRC + * @param protocol the IM protocol/service to use. See protocols() + * @return whether the add succeeded. @c false may signal already present, + * protocol not supported, or add operation not supported. + * + * @see locate() + * @see protocols() + * @see messageNewContact() + */ + virtual bool addContact( const TQString &contactId, const TQString &protocol ) = 0; + +// SIGNALS +k_dcop_signals: + /** + * @brief Indicates that a contact's presence has changed + * + * Notifies connected DCOP receivers about a change in a contact's + * presence. + * + * Implementations just have to call this method with the appropriate + * values to get the DCOP signal emitted. + * + * @param uid the KABC UID whose presence changed + * @param appId the DCOP application ID of the program the signal + * originates from + * @param presence the new presence's numeric value. See presenceStatus() + * + * @see presenceStatus() + * @see KABC::Addressee::uid() + * @see DCOPClient::appId() + */ + void contactPresenceChanged( TQString uid, TQCString appId, int presence ); +}; + +#endif + + + +/* + * Local variables: + * c-indentation-style: k&r + * c-basic-offset: 8 + * indent-tabs-mode: t + * End: + */ +// vim: set noet ts=4 sts=4 sw=4: + diff --git a/interfaces/tdeimproxy/library/CMakeLists.txt b/interfaces/tdeimproxy/library/CMakeLists.txt new file mode 100644 index 000000000..9aa1f60ee --- /dev/null +++ b/interfaces/tdeimproxy/library/CMakeLists.txt @@ -0,0 +1,51 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( icons ) + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/kio/kio +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + tdeimproxy.h tdeimproxyiface.h + DESTINATION ${INCLUDE_INSTALL_DIR} ) + + +##### tdeimproxy ################################## + +set( target tdeimproxy ) + +set( ${target}_SRCS + tdeimproxy.cpp tdeimproxyiface.skel + ${CMAKE_SOURCE_DIR}/interfaces/tdeimproxy/interface/kimiface.stub +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 0.0.0 + LINK kio-shared + DESTINATION ${LIB_INSTALL_DIR} + DEPENDENCIES dcopidl +) diff --git a/interfaces/tdeimproxy/library/Makefile.am b/interfaces/tdeimproxy/library/Makefile.am new file mode 100644 index 000000000..743b76424 --- /dev/null +++ b/interfaces/tdeimproxy/library/Makefile.am @@ -0,0 +1,26 @@ +SUBDIRS = icons + +INCLUDES = $(all_includes) + +noinst_HEADERS = tdeimproxyiface.h + +METASOURCES = AUTO + +AM_CPPFLAGS = $(all_includes) + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/tdeimproxy.pot + +tdeimproxyincludedir = $(includedir) +tdeimproxyinclude_HEADERS = tdeimproxy.h tdeimproxyiface.h + +lib_LTLIBRARIES = libtdeimproxy.la +libtdeimproxy_la_LDFLAGS = -no-undefined $(all_libraries) +libtdeimproxy_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) +libtdeimproxy_la_SOURCES = tdeimproxy.cpp kimiface.stub tdeimproxyiface.skel + +kimiface_DIR = $(top_srcdir)/interfaces/tdeimproxy/interface + +include $(top_srcdir)/admin/Doxyfile.am +DOXYGEN_REFERENCES = kabc dcop + diff --git a/interfaces/tdeimproxy/library/icons/CMakeLists.txt b/interfaces/tdeimproxy/library/icons/CMakeLists.txt new file mode 100644 index 000000000..ac95aa58c --- /dev/null +++ b/interfaces/tdeimproxy/library/icons/CMakeLists.txt @@ -0,0 +1,13 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_install_icons( ) + diff --git a/interfaces/tdeimproxy/library/icons/Makefile.am b/interfaces/tdeimproxy/library/icons/Makefile.am new file mode 100644 index 000000000..a4b97f06a --- /dev/null +++ b/interfaces/tdeimproxy/library/icons/Makefile.am @@ -0,0 +1 @@ +KDE_ICON=AUTO diff --git a/interfaces/tdeimproxy/library/icons/cr16-action-presence_away.png b/interfaces/tdeimproxy/library/icons/cr16-action-presence_away.png new file mode 100644 index 000000000..f96a9c65f Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr16-action-presence_away.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr16-action-presence_offline.png b/interfaces/tdeimproxy/library/icons/cr16-action-presence_offline.png new file mode 100644 index 000000000..f5c53d711 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr16-action-presence_offline.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr16-action-presence_online.png b/interfaces/tdeimproxy/library/icons/cr16-action-presence_online.png new file mode 100644 index 000000000..6cb52496b Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr16-action-presence_online.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr16-action-presence_unknown.png b/interfaces/tdeimproxy/library/icons/cr16-action-presence_unknown.png new file mode 100644 index 000000000..290bc852a Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr16-action-presence_unknown.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr32-action-presence_away.png b/interfaces/tdeimproxy/library/icons/cr32-action-presence_away.png new file mode 100644 index 000000000..086184582 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr32-action-presence_away.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr32-action-presence_offline.png b/interfaces/tdeimproxy/library/icons/cr32-action-presence_offline.png new file mode 100644 index 000000000..caadb14d4 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr32-action-presence_offline.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr32-action-presence_online.png b/interfaces/tdeimproxy/library/icons/cr32-action-presence_online.png new file mode 100644 index 000000000..41e79ad9d Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr32-action-presence_online.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr32-action-presence_unknown.png b/interfaces/tdeimproxy/library/icons/cr32-action-presence_unknown.png new file mode 100644 index 000000000..52ab79ed5 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr32-action-presence_unknown.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr48-action-presence_away.png b/interfaces/tdeimproxy/library/icons/cr48-action-presence_away.png new file mode 100644 index 000000000..58e62c1d3 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr48-action-presence_away.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr48-action-presence_offline.png b/interfaces/tdeimproxy/library/icons/cr48-action-presence_offline.png new file mode 100644 index 000000000..b69630f33 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr48-action-presence_offline.png differ diff --git a/interfaces/tdeimproxy/library/icons/cr48-action-presence_online.png b/interfaces/tdeimproxy/library/icons/cr48-action-presence_online.png new file mode 100644 index 000000000..52fdad8f9 Binary files /dev/null and b/interfaces/tdeimproxy/library/icons/cr48-action-presence_online.png differ diff --git a/interfaces/tdeimproxy/library/tdeimproxy.cpp b/interfaces/tdeimproxy/library/tdeimproxy.cpp new file mode 100644 index 000000000..a65388974 --- /dev/null +++ b/interfaces/tdeimproxy/library/tdeimproxy.cpp @@ -0,0 +1,653 @@ +/* + tdeimproxy.cpp + + IM service library for KDE + + Copyright (c) 2004 Will Stephenson + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kimiface_stub.h" + +#include "tdeimproxy.h" + +static KStaticDeleter _staticDeleter; + +KIMProxy * KIMProxy::s_instance = 0L; + +struct AppPresenceCurrent +{ + TQCString appId; + int presence; +}; + +class ContactPresenceListCurrent : public TQValueList +{ + public: + // return value indicates if the supplied parameter was better than any existing presence + bool update( const AppPresenceCurrent ); + AppPresenceCurrent best(); +}; + + +struct KIMProxy::Private +{ + DCOPClient * dc; + // list of the strings in use by KIMIface + TQStringList presence_strings; + // list of the icon names in use by KIMIface + TQStringList presence_icons; + // map of presences + PresenceStringMap presence_map; +}; + +bool ContactPresenceListCurrent::update( AppPresenceCurrent ap ) +{ + if ( isEmpty() ) + { + append( ap ); + return true; + } + + bool bestChanged = false; + AppPresenceCurrent best; + best.presence = -1; + ContactPresenceListCurrent::iterator it = begin(); + const ContactPresenceListCurrent::iterator itEnd = end(); + ContactPresenceListCurrent::iterator existing = itEnd; + + while ( it != itEnd ) + { + if ( (*it).presence > best.presence ) + best = (*it); + if ( (*it).appId == ap.appId ) + existing = it; + ++it; + } + + if ( ap.presence > best.presence || + best.appId == ap.appId ) + bestChanged = true; + + if ( existing != itEnd ) + { + remove( existing ); + append( ap ); + } + return bestChanged; +} + +AppPresenceCurrent ContactPresenceListCurrent::best() +{ + AppPresenceCurrent best; + best.presence = -1; + ContactPresenceListCurrent::iterator it = begin(); + const ContactPresenceListCurrent::iterator itEnd = end(); + while ( it != itEnd ) + { + if ( (*it).presence > best.presence ) + best = (*it); + ++it; + } + // if it's still -1 here, we have no presence data, so we return Unknown + if ( best.presence == -1 ) + best.presence = 0; + return best; +} + +// int bestPresence( AppPresence* ap ) +// { +// Q_ASSERT( ap ); +// AppPresence::const_iterator it; +// it = ap->begin(); +// int best = 0; // unknown +// if ( it != ap->end() ) +// { +// best = it.data(); +// ++it; +// for ( ; it != ap->end(); ++it ) +// { +// if ( it.data() > best ) +// best = it.data(); +// } +// } +// return best; +// } +// +// TQCString bestAppId( AppPresence* ap ) +// { +// Q_ASSERT( ap ); +// AppPresence::const_iterator it; +// TQCString bestAppId; +// it = ap->begin(); +// if ( it != ap->end() ) +// { +// int best = it.data(); +// bestAppId = it.key(); +// ++it; +// for ( ; it != ap->end(); ++it ) +// { +// if ( it.data() > best ) +// { +// best = it.data(); +// bestAppId = it.key(); +// } +// } +// } +// return bestAppId; +// } + +KIMProxy * KIMProxy::instance( DCOPClient * client ) +{ + if ( client ) + { + if ( !s_instance ) + _staticDeleter.setObject( s_instance, new KIMProxy( client ) ); + return s_instance; + } + else + return 0L; +} + +KIMProxy::KIMProxy( DCOPClient* dc ) : DCOPObject( "KIMProxyIface" ), TQObject(), d( new Private ) +{ + m_im_client_stubs.setAutoDelete( true ); + + d->dc = dc; + m_initialized = false; + connect( d->dc, TQT_SIGNAL( applicationRemoved( const TQCString& ) ) , this, TQT_SLOT( unregisteredFromDCOP( const TQCString& ) ) ); + connect( d->dc, TQT_SIGNAL( applicationRegistered( const TQCString& ) ) , this, TQT_SLOT( registeredToDCOP( const TQCString& ) ) ); + d->dc->setNotifications( true ); + + d->presence_strings.append( "Unknown" ); + d->presence_strings.append( "Offline" ); + d->presence_strings.append( "Connecting" ); + d->presence_strings.append( "Away" ); + d->presence_strings.append( "Online" ); + + d->presence_icons.append( "presence_unknown" ); + d->presence_icons.append( "presence_offline" ); + d->presence_icons.append( "presence_connecting" ); + d->presence_icons.append( "presence_away" ); + d->presence_icons.append( "presence_online" ); + + //TQCString senderApp = "Kopete"; + //TQCString senderObjectId = "KIMIface"; + TQCString method = "contactPresenceChanged( TQString, TQCString, int )"; + //TQCString receiverObjectId = "KIMProxyIface"; + + // FIXME: make this work when the sender object id is set to KIMIFace + if ( !connectDCOPSignal( 0, 0, method, method, false ) ) + kdWarning() << "Couldn't connect DCOP signal. Won't receive any status notifications!" << endl; +} + +KIMProxy::~KIMProxy( ) +{ + //d->dc->setNotifications( false ); +} + +bool KIMProxy::initialize() +{ + if ( !m_initialized ) + { + m_initialized = true; // we should only do this once, as registeredToDCOP() will catch any new starts + // So there is no error from a failed query when using tdelibs 3.2, which don't have this servicetype + if ( KServiceType::serviceType( IM_SERVICE_TYPE ) ) + { + //kdDebug( 790 ) << k_funcinfo << endl; + TQCString dcopObjectId = "KIMIface"; + + // see what apps implementing our service type are out there + KService::List offers = KServiceType::offers( IM_SERVICE_TYPE ); + KService::List::iterator offer; + typedef TQValueList QCStringList; + QCStringList registeredApps = d->dc->registeredApplications(); + QCStringList::iterator app; + const QCStringList::iterator end = registeredApps.end(); + // for each registered app + for ( app = registeredApps.begin(); app != end; ++app ) + { + //kdDebug( 790 ) << " considering: " << *app << endl; + //for each offer + for ( offer = offers.begin(); offer != offers.end(); ++offer ) + { + TQCString dcopService = (*offer)->property("X-DCOP-ServiceName").toString().latin1(); + if ( !dcopService.isEmpty() ) + { + //kdDebug( 790 ) << " is it: " << dcopService << "?" << endl; + // get the application name ( minus any process ID ) + TQCString instanceName = (*app).left( dcopService.length() ); + // if the application implements the dcop service, add it + if ( instanceName == dcopService ) + { + m_apps_available = true; + //kdDebug( 790 ) << " app name: " << (*offer)->name() << ", has instance " << *app << ", dcopService: " << dcopService << endl; + if ( !m_im_client_stubs.find( dcopService ) ) + { + kdDebug( 790 ) << "App " << *app << ", dcopObjectId " << dcopObjectId << " found, using it for presence info." << endl; + m_im_client_stubs.insert( *app, new KIMIface_stub( d->dc, *app, dcopObjectId ) ); + pollApp( *app ); + } + } + } + } + } + } + } + return !m_im_client_stubs.isEmpty(); +} + +void KIMProxy::registeredToDCOP( const TQCString& appId ) +{ + //kdDebug( 790 ) << k_funcinfo << " appId '" << appId << "'" << endl; + // check that appId implements our service + // if the appId ends with a number, i.e. a pid like in foobar-12345, + if ( appId.isEmpty() ) + return; + + bool newApp = false; + // get an up to date list of offers in case a new app was installed + // and check each of the offers that implement the service type we're looking for, + // to see if any of them are the app that just registered + const KService::List offers = KServiceType::offers( IM_SERVICE_TYPE ); + KService::List::const_iterator it; + for ( it = offers.begin(); it != offers.end(); ++it ) + { + TQCString dcopObjectId = "KIMIface"; + TQCString dcopService = (*it)->property("X-DCOP-ServiceName").toString().latin1(); + if ( appId.left( dcopService.length() ) == dcopService ) + { + // if it's not already known, insert it + if ( !m_im_client_stubs.find( appId ) ) + { + newApp = true; + kdDebug( 790 ) << "App: " << appId << ", dcopService: " << dcopService << " started, using it for presence info."<< endl; + m_im_client_stubs.insert( appId, new KIMIface_stub( d->dc, appId, dcopObjectId ) ); + } + } + //else + // kdDebug( 790 ) << "App doesn't implement our ServiceType" << endl; + } + //if ( newApp ) + // emit sigPresenceInfoExpired(); +} + +void KIMProxy::unregisteredFromDCOP( const TQCString& appId ) +{ + //kdDebug( 790 ) << k_funcinfo << appId << endl; + if ( m_im_client_stubs.find( appId ) ) + { + kdDebug( 790 ) << appId << " quit, removing its presence info." << endl; + + PresenceStringMap::Iterator it = d->presence_map.begin(); + const PresenceStringMap::Iterator end = d->presence_map.end(); + for ( ; it != end; ++it ) + { + ContactPresenceListCurrent list = it.data(); + ContactPresenceListCurrent::iterator cpIt = list.begin(); + while( cpIt != list.end() ) + { + ContactPresenceListCurrent::iterator gone = cpIt++; + if ( (*gone).appId == appId ) + { + list.remove( gone ); + } + } + } + m_im_client_stubs.remove( appId ); + emit sigPresenceInfoExpired(); + } +} + +void KIMProxy::contactPresenceChanged( TQString uid, TQCString appId, int presence ) +{ + // update the presence map + //kdDebug( 790 ) << k_funcinfo << "uid: " << uid << " appId: " << appId << " presence " << presence << endl; + ContactPresenceListCurrent current; + current = d->presence_map[ uid ]; + //kdDebug( 790 ) << "current best presence from : " << current.best().appId << " is: " << current.best().presence << endl; + AppPresenceCurrent newPresence; + newPresence.appId = appId; + newPresence.presence = presence; + + if ( current.update( newPresence ) ) + { + d->presence_map.insert( uid, current ); + emit sigContactPresenceChanged( uid ); + } +} + +int KIMProxy::presenceNumeric( const TQString& uid ) +{ + AppPresenceCurrent ap; + ap.presence = 0; + if ( initialize() ) + { + ContactPresenceListCurrent presence = d->presence_map[ uid ]; + ap = presence.best(); + } + return ap.presence; +} + +TQString KIMProxy::presenceString( const TQString& uid ) +{ + AppPresenceCurrent ap; + ap.presence = 0; + if ( initialize() ) + { + ContactPresenceListCurrent presence = d->presence_map[ uid ]; + ap = presence.best(); + } + if ( ap.appId.isEmpty() ) + return TQString::null; + else + return d->presence_strings[ ap.presence ]; +} + +TQPixmap KIMProxy::presenceIcon( const TQString& uid ) +{ + AppPresenceCurrent ap; + ap.presence = 0; + if ( initialize() ) + { + ContactPresenceListCurrent presence = d->presence_map[ uid ]; + ap = presence.best(); + } + if ( ap.appId.isEmpty() ) + { + //kdDebug( 790 ) << k_funcinfo << "returning a null TQPixmap because we were asked for an icon for a uid we know nothing about" << endl; + return TQPixmap(); + } + else + { + //kdDebug( 790 ) << k_funcinfo << "returning this: " << d->presence_icons[ ap.presence ] << endl; + return SmallIcon( d->presence_icons[ ap.presence ]); + } +} + +TQStringList KIMProxy::allContacts() +{ + TQStringList value = d->presence_map.keys(); + return value; +} + +TQStringList KIMProxy::reachableContacts() +{ + TQStringList value; + + if ( initialize() ) + { + TQDictIterator it( m_im_client_stubs ); + for ( ; it.current(); ++it ) + { + value += it.current()->reachableContacts( ); + } + } + return value; +} + +TQStringList KIMProxy::onlineContacts() +{ + TQStringList value; + PresenceStringMap::iterator it = d->presence_map.begin(); + const PresenceStringMap::iterator end= d->presence_map.end(); + for ( ; it != end; ++it ) + if ( it.data().best().presence > 2 /*Better than Connecting, ie Away or Online*/ ) + value.append( it.key() ); + + return value; +} + +TQStringList KIMProxy::fileTransferContacts() +{ + TQStringList value; + + if ( initialize() ) + { + TQDictIterator it( m_im_client_stubs ); + for ( ; it.current(); ++it ) + { + value += it.current()->fileTransferContacts( ); + } + } + return value; +} + +bool KIMProxy::isPresent( const TQString& uid ) +{ + return ( !d->presence_map[ uid ].isEmpty() ); +} + +TQString KIMProxy::displayName( const TQString& uid ) +{ + TQString name; + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForUid( uid ) ) + name = s->displayName( uid ); + } + //kdDebug( 790 ) << k_funcinfo << name << endl; + return name; +} + +bool KIMProxy::canReceiveFiles( const TQString & uid ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForUid( uid ) ) + return s->canReceiveFiles( uid ); + } + return false; +} + +bool KIMProxy::canRespond( const TQString & uid ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForUid( uid ) ) + return s->canRespond( uid ); + } + return false; +} + +TQString KIMProxy::context( const TQString & uid ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForUid( uid ) ) + return s->context( uid ); + } + return TQString::null; +} + +void KIMProxy::chatWithContact( const TQString& uid ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForUid( uid ) ) + { + kapp->updateRemoteUserTimestamp( s->app() ); + s->chatWithContact( uid ); + } + } + return; +} + +void KIMProxy::messageContact( const TQString& uid, const TQString& message ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForUid( uid ) ) + { + kapp->updateRemoteUserTimestamp( s->app() ); + s->messageContact( uid, message ); + } + } + return; +} + +void KIMProxy::sendFile(const TQString &uid, const KURL &sourceURL, const TQString &altFileName, uint fileSize ) +{ + if ( initialize() ) + { + TQDictIterator it( m_im_client_stubs ); + for ( ; it.current(); ++it ) + { + if ( it.current()->canReceiveFiles( uid ) ) + { + kapp->updateRemoteUserTimestamp( it.current()->app() ); + it.current()->sendFile( uid, sourceURL, altFileName, fileSize ); + break; + } + } + } + return; +} + +bool KIMProxy::addContact( const TQString &contactId, const TQString &protocol ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForProtocol( protocol ) ) + return s->addContact( contactId, protocol ); + } + return false; +} + +TQString KIMProxy::locate( const TQString & contactId, const TQString & protocol ) +{ + if ( initialize() ) + { + if ( KIMIface_stub* s = stubForProtocol( protocol ) ) + return s->locate( contactId, protocol ); + } + return TQString::null; +} + +bool KIMProxy::imAppsAvailable() +{ + return ( !m_im_client_stubs.isEmpty() ); +} + +bool KIMProxy::startPreferredApp() +{ + TQString preferences = TQString("[X-DCOP-ServiceName] = '%1'").arg( preferredApp() ); + // start/find an instance of DCOP/InstantMessenger + TQString error; + TQCString dcopService; + // Get a preferred IM client. + // The app will notify itself to us using registeredToDCOP, so we don't need to record a stub for it here + // FIXME: error in preferences, see debug output + preferences = TQString::null; + int result = KDCOPServiceStarter::self()->findServiceFor( IM_SERVICE_TYPE, TQString::null, preferences, &error, &dcopService ); + + kdDebug( 790 ) << k_funcinfo << "error was: " << error << ", dcopService: " << dcopService << endl; + + return ( result == 0 ); +} + + +void KIMProxy::pollAll( const TQString &uid ) +{ +/* // We only need to call this function if we don't have any data at all + // otherwise, the data will be kept fresh by received presence change + // DCOP signals + if ( !d->presence_map.contains( uid ) ) + { + AppPresence *presence = new AppPresence(); + // record current presence from known clients + TQDictIterator it( m_im_client_stubs ); + for ( ; it.current(); ++it ) + { + presence->insert( it.currentKey().ascii(), it.current()->presenceStatus( uid ) ); // m_im_client_stubs has qstring keys... + } + d->presence_map.insert( uid, presence ); + }*/ +} + +void KIMProxy::pollApp( const TQCString & appId ) +{ + //kdDebug( 790 ) << k_funcinfo << endl; + KIMIface_stub * appStub = m_im_client_stubs[ appId ]; + TQStringList contacts = m_im_client_stubs[ appId ]->allContacts(); + TQStringList::iterator it = contacts.begin(); + TQStringList::iterator end = contacts.end(); + for ( ; it != end; ++it ) + { + ContactPresenceListCurrent current = d->presence_map[ *it ]; + AppPresenceCurrent ap; + ap.appId = appId; + ap.presence = appStub->presenceStatus( *it ); + current.append( ap ); + + d->presence_map.insert( *it, current ); + if ( current.update( ap ) ) + emit sigContactPresenceChanged( *it ); + //kdDebug( 790 ) << " uid: " << *it << " presence: " << ap.presence << endl; + } +} + +KIMIface_stub * KIMProxy::stubForUid( const TQString &uid ) +{ + // get best appPresence + AppPresenceCurrent ap = d->presence_map[ uid ].best(); + // look up the presence string from that app + return m_im_client_stubs.find( ap.appId ); +} + +KIMIface_stub * KIMProxy::stubForProtocol( const TQString &protocol) +{ + KIMIface_stub * app; + // see if the preferred client supports this protocol + TQString preferred = preferredApp(); + if ( ( app = m_im_client_stubs.find( preferred ) ) ) + { + if ( app->protocols().grep( protocol ).count() > 0 ) + return app; + } + // preferred doesn't do this protocol, try the first of the others that says it does + TQDictIterator it( m_im_client_stubs ); + for ( ; it.current(); ++it ) + { + if ( it.current()->protocols().grep( protocol ).count() > 0 ) + return it.current(); + } + return 0L; +} + +TQString KIMProxy::preferredApp() +{ + TDEConfig *store = new KSimpleConfig( IM_CLIENT_PREFERENCES_FILE ); + store->setGroup( IM_CLIENT_PREFERENCES_SECTION ); + TQString preferredApp = store->readEntry( IM_CLIENT_PREFERENCES_ENTRY ); + //kdDebug( 790 ) << k_funcinfo << "found preferred app: " << preferredApp << endl; + return preferredApp; +} + +#include "tdeimproxy.moc" diff --git a/interfaces/tdeimproxy/library/tdeimproxy.h b/interfaces/tdeimproxy/library/tdeimproxy.h new file mode 100644 index 000000000..1a20c4b22 --- /dev/null +++ b/interfaces/tdeimproxy/library/tdeimproxy.h @@ -0,0 +1,654 @@ +/* + tdeimproxy.h + + IM service library for KDE + + Copyright (c) 2004 Will Stephenson + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KIMPROXY_H +#define KIMPROXY_H + +#include +#include +#include +#include + + +#define IM_SERVICE_TYPE "DCOP/InstantMessenger" +#define IM_CLIENT_PREFERENCES_FILE "default_components" +#define IM_CLIENT_PREFERENCES_SECTION "InstantMessenger" +#define IM_CLIENT_PREFERENCES_ENTRY "imClient" + +#include "tdeimproxyiface.h" + +class DCOPClient; +class KIMIface_stub; +class KURL; +class ContactPresenceListCurrent; + +/** FIXME: remove for KDE4, binary compability again. */ +typedef TQMap AppPresence; // appId->presence; contains all applications' ideas of a user's presence +typedef TQDict PresenceMap; // uid->AppPresence; contains a AppPresences for all users +/** FIXME: remove presenceMap and call this presenceMap in KDE4. This hack is for binary compatibility */ +typedef TQMap PresenceStringMap; + +/** + * @brief Provides access to instant messenger programs which implement KDE's + * instant messanger interface KIMIface + * + * This class provides an easy-to-use interface to all running instant + * messengers or chat programs that implement KIMIface. + * + * It works simultaneously with any running programs that implement the + * ServiceType @c DCOP/InstantMessenger. + * + * IM-contacts are identified using unique identifier strings (UID) used by + * KDE's address book framework KABC. + * However the use of the address book API is optional, KIMProxy provides + * methods to fetch lists of available contact UIDs from the applications. + * If a UID is reachable with more than one program, KIMProxy aggregates the + * available information and presents the 'best' presence. For example, for a + * contact who can be seen to be @c Away in @c IRC on program A but @c Online + * using @c ICQ on program B, the information from program B will be used. + * + * KIMProxy is designed for simple information in a wide number of cases, not + * for detailed messaging. + * + * The class is implemented as a singleton, so whenever you need access to + * one of its methods, just retrieve the single instance using instance(). + * The following code snippet demonstrated how to send a message to all + * reachable IM-contacts: + * @code + * // get proxy instance + * KIMProxy* proxy = KIMProxy::instance(); + * + * // check if there are suitable applications reachable + * if (!proxy->initialize()) return; + * + * TQString message = "Hi!\nHow are you on this wonderful day?"; + * + * // iterate over the list of reachable contacts + * TQStringList reachableContacts = proxy->reachableContacts(); + * for (TQStringList::const_iterator it = reachableContacts.begin(); + * it != reachableContacts.end(); ++it) + * { + proxy->messageContact(*it, message); + * } + * @endcode + * + * @note While it is possible to communicate with each of those application's + * by DCOP using KIMProxy has the advantage of communicating with all + * applications simultaneously and thus getting an augmented view of + * availability, capability and presence (online status) of IM-contacts. + * + * @see KIMIface + * @see KABC::AddressBook + * @see KABC::Addressee + * + * @since 3.3 + * @author Will Stephenson + */ +class KIMPROXY_EXPORT KIMProxy : public TQObject, virtual public KIMProxyIface +{ + Q_OBJECT + struct Private; + + template friend class KStaticDeleter; + ~KIMProxy(); + + public: + /** + * @brief Obtain an instance of KIMProxy + * + * Creates a new instance if it is called for the first time. + * Call initialize() to check if there are applications available for + * communication. + * + * @note KIMProxy uses DCOPClient::setNotifications() to make sure + * it updates its information about IM applications it interacts with, + * e.g. that it gets notified about newly available applications or + * about applications exiting + * + * @param client your application's DCOP client + * @return the singleton instance of this class + */ + static KIMProxy * instance( DCOPClient * client ); + + /** + * @brief Get the proxy ready to connect + * + * Discover any running IM clients and setup communication handlers for + * them. The list of available clients is updated automatically + * through notification about added or removed DCOP applications as + * provided by DCOPClient. + * + * It is safe to call this method more than once, initialization only + * occurs at the first time. + * + * @return whether the proxy is ready to use. + * @c false if there are no suitable apps running + */ + bool initialize(); + + /** + * @brief Obtain a list of IM-contacts known to IM-applications + * + * Returns a list of KABC UIDs gathered by merging the lists of + * each application the proxy can communicate with. + * The method uses cached information to make it fast and not + * require actually communicating with the applications every time + * it is called. + * + * @return a list of KABC UIDs known to any IM-application + * + * @see reachableContacts() + * @see onlineContacts() + * @see fileTransferContacts() + * @see isPresent() + * @see KABC::Addressee::uid() + */ + TQStringList allContacts(); + + /** + * @brief Obtain a list of IM-contacts that are currently reachable + * + * Returns a list of KABC UIDs gathered by merging the lists of + * each application the proxy can communicate with. + * + * @return a list of KABC UIDs who can receive a message, even if offline + * + * @see allContacts() + * @see onlineContacts() + * @see fileTransferContacts() + * @see messageContact() + * @see KABC::Addressee::uid() + */ + TQStringList reachableContacts(); + + /** + * @brief Obtain a list of IM-contacts that are currently online + * + * Returns a list of KABC UIDs gathered by merging the lists of + * each application the proxy can communicate with. + * The method uses cached information to make it fast and not + * require actually communicating with the applications every time + * it is called. + * + * @return a list of KABC UIDs who are online with unspecified presence + * + * @see allContacts() + * @see reachableContacts() + * @see fileTransferContacts() + * @see messageContact() + * @see chatWithContact() + * @see KABC::Addressee::uid() + */ + TQStringList onlineContacts(); + + /** + * @brief Obtain a list of IM-contacts who may receive file transfers + * + * Returned IM-contacts might not be capable of receiving file + * tranfers due to limitations of their clients or because they are + * behind a firewall. + * KIMProxy doesn't have the possibilities to discover this and will + * list them as well. + * + * Returns a list of KABC UIDs gathered by merging the lists of + * each application the proxy can communicate with. + * + * @return a list of KABC UIDs capable of file transfer + * + * @see allContacts() + * @see reachableContacts() + * @see onlineContacts() + * @see canReceiveFiles() + * @see KABC::Addressee::uid() + */ + TQStringList fileTransferContacts(); + + /** + * @brief Confirm if a given contact is known to the proxy + * + * A contact is known to the proxy if it is know to at least one + * IM-application the proxy is communicating with. + * + * The method uses cached information to make it fast and not + * require actually communicating with the applications every time + * it is called. + * + * @param uid the KABC UID you are interested in + * @return whether any IM-program knows of this KABC UID + * + * @see allContacts() + * @see presenceString() + * @see presenceNumeric() + * @see KABC::Addressee::uid() + */ + bool isPresent( const TQString& uid ); + + /** + * @brief Obtain the proxy's idea of the contact's display name + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and @c Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * Useful if KABC lookups may be too slow. + * + * @param uid the KABC UID you are interested in + * @return the corresponding display name or TQString:null if the + * UID is unknown + * + * @see isPresent() + * @see presenceString() + * @see presenceNumeric() + * @see KABC::Addressee::uid() + */ + TQString displayName( const TQString& uid ); + + /** + * @brief Obtain the IM presence as a number for the specified contact + * + * Returns one of the following values depending on the given contact's + * presence: + * - 0 - @c Unknown: for contacts where you can not use any of the + * other values + * + * - 1 - @c Offline: for contacts that are offline, i.e. not connected + * to their IM-service. + * + * - 2 - @c Connecting + * + * - 3 - @c Away: for contacts that are connected to their IM-service + * but not @c Online + * + * - 4 - @c Online + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * The method uses cached information to make it fast and not + * require actually communicating with the applications every time + * it is called. + * + * @param uid the KABC UID you want the presence for + * @return a numeric representation of presence - currently one of + * 0 (Unknown), 1 (Offline), 2 (Connecting), 3 (Away), + * 4 (Online). Returns 0 if the given UID is unknown + * + * @see isPresent() + * @see presenceString() + * @see presenceIcon() + * @see KIMIface::presenceStatus() + * @see KABC::Addressee::uid() + */ + int presenceNumeric( const TQString& uid ); + + /** + * @brief Obtain the IM presence as a i18ned string for the specified + * contact + * + * The presence string is one of the following: + * - i18n("Unknown") + * - i18n("Offline") + * - i18n("Connecting") + * - i18n("Away") + * - i18n("Online") + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * @note The presence string is created based on the numerical + * presence value returned by the applications. It currently + * does not return the presence strings used by the applications. + * + * The method uses cached information to make it fast and not + * require actually communicating with the applications every time + * it is called. + * + * @param uid the KABC UID you want the presence for + * @return the i18ned string describing the contact's presence or + * TQString::null if the UID is unknown + * + * @see isPresent() + * @see presenceNumeric() + * @see presenceIcon() + * @see KABC::Addressee::uid() + */ + TQString presenceString( const TQString& uid ); + + /** + * @brief Obtain the icon representing the IM presence for the + * specified contact + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * @note The presence icon is chosen based on the numerical + * presence value returned by the applications. It currently + * does not return the presence icon used by the applications. + * + * The method uses cached information to make it fast and not + * require actually communicating with the applications every time + * it is called. + * + * @param uid the KABC UID you want the presence icon for + * @return a pixmap representing the contact's presence or a null + * pixmap if the contact is unknown. See TQPixmap::isNull() + * + * @see isPresent() + * @see presenceString() + * @see presenceNumeric() + * @see KABC::Addressee::uid() + */ + TQPixmap presenceIcon( const TQString& uid ); + + /** + * @brief Indicate if a given contact can receive files + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * @param uid the KABC UID you want to the file transfer capability for + * @return whether the specified contact can receive files + * + * @see fileTransferContacts() + * @see KABC::Addressee::uid() + */ + bool canReceiveFiles( const TQString & uid ); + + /** + * @brief Indicate if a given contact will be able to respond + * + * Some media are unidirectional (e.g., sending SMS via a web + * interface). + * This refers to the contact's ability to respond as defined by the + * medium, not by their presence. + * + * Someone may appear offline (SMS has no presence) to you but in fact + * be able to respond. + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * @param uid the KABC UID you are interested in + * @return whether the specified contact can respond + * + * @see isPresent() + * @see KABC::Addressee::uid() + */ + bool canRespond( const TQString & uid ); + + /** + * @brief Obtain the KABC UID corresponding to the given IM address + * + * @param contactId the protocol specific identifier for the contact, + * e.g. UIN for ICQ, screenname for AIM, nick for IRC + * @param protocol the IM protocol/service to check. + * See KIMIface::protocols() + * @return the KABC UID for the given contact or @c TQString::null if + * not found or either input stream was empty or the protocol + * is not supported + * + * @see KIMIface::protocols() + * @see addContact() + * @see isPresent() + * @see KABC::Addressee::uid() + */ + TQString locate( const TQString & contactId, const TQString & protocol ); + + /** + * @brief Obtain the given contact's current context (home, work, or + * any) + * + * Not all IM services/protocols support the concept of contexts. If the + * given UID maps to such a service, @c TQString::null will be returned + * + * If the given KABC UID is known to more than one IM-application + * the result of the application which has the best presence for the + * contact is taken. + * For example if a contact is @c Online on ICQ and Away on AIM, the + * value returned by the application providing ICQ is taken. + * + * @param uid the KABC UID you want the context for + * @return a string describing the context, or @c TQString::null if not + * supported or if the contact is unknown + * + * @see isPresent() + * @see KABC::Addressee::uid() + */ + TQString context( const TQString & uid ); + + /** + * @brief Start a chat session with the specified contact + * + * @param uid the KABC UID you want to chat with + * + * @see messageContact() + * @see sendFile() + * @see isPresent() + * @see reachableContacts() + * @see KABC::Addressee::uid() + */ + void chatWithContact( const TQString& uid ); + + /** + * @brief Send a single message to the specified contact + * + * Any response will be handled by the IM client as a normal + * conversation. + * + * @param uid the KABC UID you want to send the message to + * @param message the message text to send to the contact + * + * @see chatWithContact() + * @see sendFile() + * @see isPresent() + * @see reachableContacts() + * @see KABC::Addressee::uid() + */ + void messageContact( const TQString& uid, const TQString& message ); + + /** + * @brief Send a file to the contact + * + * Initiates a file transfer with the given contact if possible. + * + * @param uid the KABC UID you want to send to + * @param sourceURL a KURL pointing to the file to send + * @param altFileName an alternate filename describing the file or a + * description or title + * @param fileSize file size in bytes + * + * @see messageContact() + * @see chatWithContact() + * @see isPresent() + * @see fileTransferContacts() + * @see KABC::Addressee::uid() + */ + void sendFile(const TQString &uid, const KURL &sourceURL, + const TQString &altFileName = TQString::null, uint fileSize = 0); + + /** + * @brief Add a new contact given its protocol specific identifier + * + * @param contactId the protocol specific identifier for the contact + * e.g. UIN for ICQ, screenname for AIM, nick for IRC + * @param protocol the IM protocol/service to use. + * See KIMIface:::protocols() + * @return whether the add succeeded. @c false may signal already present, + * protocol not supported, or add operation not supported. + * + * @see locate() + * @see KIMIface::protocols() + */ + bool addContact( const TQString &contactId, const TQString &protocol ); + + /** + * @brief Checks if there are any compatible instant messaging + * applications available + * + * Available means that they are started and registered with DCOP + * and implementing the correct DCOP service. + * This information will be updated on the first call to initialize() + * and whenever an application registers or unregisters with DCOP, + * i.e. the information will be kept up to date. + * + * @return @c true if there are any apps available + */ + bool imAppsAvailable(); + + /** + * @brief Start the user's preferred IM application + * @return whether a preferred app was found. No guarantee that it + * started correctly + */ + bool startPreferredApp(); + + /** + * Just exists to let the IDL compiler make the DCOP signal for this + */ + void contactPresenceChanged( TQString uid, TQCString appId, int presence ); + + public slots: + /** + * @brief Updates the proxy's data after a new application registered + * with DCOP + * + * Checks if the application specified by the given DCOP application + * identifier implements the instant messenger service. + * + * @param appId the DCOP application ID of the newly registered + * application + * + * @see DCOPClient::applicationRegistered() + */ + void registeredToDCOP( const TQCString& appId ); + + /** + * @brief Updates the proxy's data after an application unregistered + * with DCOP + * + * If the application specified by the given DCOP application + * identifier is one of the instant messenger applications of the + * proxy, it will remove the presence information it gathered from it + * earlier on. + * + * Emits sigPresenceInfoExpired() to let the using applcation know + * its presence related information might need updating. + * + * @param appId the DCOP application ID of the now unregistered + * application + * + * @see DCOPClient::applicationRemoved() + */ + void unregisteredFromDCOP( const TQCString& appId ); + signals: + /** + * @brief Indicates that the specified IM-contact's presence changed + * + * @param uid the KABC UID whose presence changed + * + * @see isPresent() + * @see presenceNumeric() + * @see presenceIcon() + * @see KABC::Addressee::uid() + */ + void sigContactPresenceChanged( const TQString &uid ); + + /** + * @brief Indicates that presence information obtained earlier on might + * not be valid any longer + * + * After the sources of presence information have changed so any + * previously supplied presence info is invalid. + */ + void sigPresenceInfoExpired(); + protected: + /** + * Bootstrap our presence data for a newly registered app + */ + void pollApp( const TQCString & appId ); + /** + * Bootstrap our presence data by polling all known apps + */ + void pollAll( const TQString &uid ); + + /** + * Update our records with the given data + */ + bool updatePresence( const TQString &uid, const TQCString &appId, int presence ); + + /** + * Get the name of the user's IM application of choice + */ + TQString preferredApp(); + + /** + * Get the app stub best able to reach this uid + */ + KIMIface_stub * stubForUid( const TQString &uid ); + + /** + * Get the app stub for this protocol. + * Take the preferred app first, then any other. + */ + KIMIface_stub * stubForProtocol( const TQString &protocol ); + + private: + // client stubs used to get presence + // appId (from DCOP) -> KIMIface_stub + TQDict m_im_client_stubs; + // map containing numeric presence and the originating application ID for each KABC uid we know of + // KABC Uid -> (appId, numeric presence )(AppPresence) + PresenceMap m_presence_map; + // cache of the client strings in use by each application + // dictionary of KIMIface_stub -> map of numeric presence -> string presence + // FIXME: remove for KDE4 - UNUSED but maintained for binary compatibility in KDE 3.4 + TQPtrDict m_client_presence_strings; + Private * d; + bool m_apps_available; + bool m_initialized; + /** + * Construct an instance of the proxy library. + */ + KIMProxy( DCOPClient * client); + static KIMProxy * s_instance; +}; + +#endif + diff --git a/interfaces/tdeimproxy/library/tdeimproxyiface.h b/interfaces/tdeimproxy/library/tdeimproxyiface.h new file mode 100644 index 000000000..a7d416371 --- /dev/null +++ b/interfaces/tdeimproxy/library/tdeimproxyiface.h @@ -0,0 +1,38 @@ +/* + tdeimproxyiface.cpp + + IM service library for KDE + + DCOP interface to allow us to receive DCOP signals + + Copyright (c) 2004 Will Stephenson + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KIMPROXYIFACE_H +#define KIMPROXYIFACE_H + +#include + +class KIMProxyIface : virtual public DCOPObject +{ + K_DCOP + k_dcop: + virtual void contactPresenceChanged( TQString uid, TQCString appId, int presence ) = 0; +}; + +#endif diff --git a/interfaces/tdemediaplayer/CMakeLists.txt b/interfaces/tdemediaplayer/CMakeLists.txt new file mode 100644 index 000000000..00ab7f3d9 --- /dev/null +++ b/interfaces/tdemediaplayer/CMakeLists.txt @@ -0,0 +1,60 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +if( ARTS_FOUND ) + add_subdirectory( kfileaudiopreview ) +endif( ARTS_FOUND ) + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/interfaces + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + player.h playerdcopobject.h view.h + DESTINATION ${INCLUDE_INSTALL_DIR}/tdemediaplayer ) + + +##### other data ################################ + +install( FILES + tdemediaplayerengine.desktop tdemediaplayer.desktop + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) + + +##### tdemediaplayer ############################## + +set( target tdemediaplayer ) + +set( ${target}_SRCS + player.cpp view.cpp playerdcopobject.skel +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 0.0.0 + LINK tdeparts-shared + DESTINATION ${LIB_INSTALL_DIR} + DEPENDENCIES dcopidl +) diff --git a/interfaces/tdemediaplayer/Makefile.am b/interfaces/tdemediaplayer/Makefile.am new file mode 100644 index 000000000..0b7aded07 --- /dev/null +++ b/interfaces/tdemediaplayer/Makefile.am @@ -0,0 +1,18 @@ +if include_ARTS +kfileaudiopreview_subdir = kfileaudiopreview +endif + +SUBDIRS = . $(kfileaudiopreview_subdir) +INCLUDES = -I$(srcdir)/.. $(all_includes) + +lib_LTLIBRARIES = libtdemediaplayer.la + +libtdemediaplayer_la_SOURCES = player.cpp playerdcopobject.skel view.cpp +libtdemediaplayer_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined +libtdemediaplayer_la_LIBADD = $(LIB_KPARTS) $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) +libtdemediaplayer_la_METASOURCES = AUTO + +tdemediaplayerinclude_HEADERS = player.h playerdcopobject.h view.h +tdemediaplayerincludedir = $(includedir)/tdemediaplayer + +kde_servicetypes_DATA = tdemediaplayerengine.desktop tdemediaplayer.desktop diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt b/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt new file mode 100644 index 000000000..17485b65a --- /dev/null +++ b/interfaces/tdemediaplayer/kfileaudiopreview/CMakeLists.txt @@ -0,0 +1,46 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${ARTS_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/interfaces + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/kio + ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/kio/kfile + ${CMAKE_SOURCE_DIR}/arts/kde +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${ARTS_LIBRARY_DIRS} +) + + +##### kfileaudiopreview ######################### + +set( target kfileaudiopreview ) + +set( ${target}_SRCS + kfileaudiopreview.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdemediaplayer-shared artskde-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am b/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am new file mode 100644 index 000000000..4f88a0c87 --- /dev/null +++ b/interfaces/tdemediaplayer/kfileaudiopreview/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = -I$(top_srcdir)/interfaces/ -I$(top_srcdir)/arts/kde -I$(includedir)/arts $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = kfileaudiopreview.la + +kfileaudiopreview_la_SOURCES = kfileaudiopreview.cpp +kfileaudiopreview_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version -no-undefined +kfileaudiopreview_la_LIBADD = $(top_builddir)/interfaces/tdemediaplayer/libtdemediaplayer.la $(top_builddir)/arts/kde/libartskde.la $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) + +noinst_HEADERS = kfileaudiopreview.h + +messages: + $(XGETTEXT) $(kfileaudiopreview_la_SOURCES) -o $(podir)/kfileaudiopreview.pot diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp new file mode 100644 index 000000000..1d83fc590 --- /dev/null +++ b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.cpp @@ -0,0 +1,146 @@ +#include "kfileaudiopreview.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +class KFileAudioPreviewFactory : public KLibFactory +{ +protected: + virtual TQObject *createObject( TQObject *parent, const char *name, + const char *className, const TQStringList & args) + { + Q_UNUSED(className); + Q_UNUSED(args); + return TQT_TQOBJECT(new KFileAudioPreview( dynamic_cast( parent ), name )); + } +}; + +K_EXPORT_COMPONENT_FACTORY( kfileaudiopreview, KFileAudioPreviewFactory ) + + +/////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////// + + +class KFileAudioPreview::KFileAudioPreviewPrivate +{ +public: + KFileAudioPreviewPrivate( TQWidget *parent ) + { + player = KParts::ComponentFactory::createInstanceFromQuery( "KMediaPlayer/Player", TQString(), TQT_TQOBJECT(parent) ); + } + + ~KFileAudioPreviewPrivate() + { + delete player; + } + + KMediaPlayer::Player *player; +}; + + +KFileAudioPreview::KFileAudioPreview( TQWidget *parent, const char *name ) + : KPreviewWidgetBase( parent, name ) +{ + TDEGlobal::locale()->insertCatalogue("kfileaudiopreview"); + + TQStringList formats = KDE::PlayObjectFactory::mimeTypes(); + // ### + TQStringList::ConstIterator it = formats.begin(); + for ( ; it != formats.end(); ++it ) + m_supportedFormats.insert( *it, (void*) 1 ); + + TQVGroupBox *box = new TQVGroupBox( i18n("Media Player"), this ); + TQVBoxLayout *layout = new TQVBoxLayout( this ); + layout->addWidget( box ); + + (void) new TQWidget( box ); // spacer + + d = new KFileAudioPreviewPrivate( 0L ); // not box -- being reparented anyway + if ( d->player ) // only if there actually is a component... + { + setSupportedMimeTypes( formats ); + KMediaPlayer::View *view = d->player->view(); + view->setEnabled( false ); + + // if we have access to the video widget, show it above the player + // So, reparent first the video widget, then the view. + if ( view->videoWidget() ) + { + TQHBox *frame = new TQHBox( box ); + frame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + frame->setSizePolicy( TQSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ) ); + view->videoWidget()->reparent( frame, TQPoint(0,0) ); + } + + view->reparent( box, TQPoint(0,0) ); + } + + m_autoPlay = new TQCheckBox( i18n("Play &automatically"), box ); + TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); + m_autoPlay->setChecked( config.readBoolEntry( "Autoplay sounds", true ) ); + connect( m_autoPlay, TQT_SIGNAL(toggled(bool)), TQT_SLOT(toggleAuto(bool)) ); +} + +KFileAudioPreview::~KFileAudioPreview() +{ + TDEConfigGroup config( TDEGlobal::config(), ConfigGroup ); + config.writeEntry( "Autoplay sounds", m_autoPlay->isChecked() ); + + delete d; +} + +void KFileAudioPreview::showPreview( const KURL &url ) +{ + if ( !d->player || !url.isValid() ) + return; + + KMimeType::Ptr mt = KMimeType::findByURL( url ); + bool supported = m_supportedFormats.find( mt->name() ); + d->player->view()->setEnabled( supported ); + if ( !supported ) + return; + + static_cast(d->player)->openURL( url ); + if ( m_autoPlay->isChecked() ) + d->player->play(); +} + +void KFileAudioPreview::clearPreview() +{ + if ( d->player ) + { + d->player->stop(); + d->player->closeURL(); + } +} + +void KFileAudioPreview::toggleAuto( bool on ) +{ + if ( !d->player ) + return; + + if ( on && m_currentURL.isValid() && d->player->view()->isEnabled() ) + d->player->play(); + else + d->player->stop(); +} + +void KFileAudioPreview::virtual_hook( int, void* ) +{} + +#include "kfileaudiopreview.moc" diff --git a/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h new file mode 100644 index 000000000..de48e4712 --- /dev/null +++ b/interfaces/tdemediaplayer/kfileaudiopreview/kfileaudiopreview.h @@ -0,0 +1,64 @@ +/* This file is part of the KDE libraries + Copyright (C) 2003 Carsten Pfeiffer + + library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation, version 2. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KFILEAUDIOPREVIEW_H +#define KFILEAUDIOPREVIEW_H + +#include + +#include +#include + +class TQCheckBox; +class TQPushButton; +class TQLabel; + +class KFileDialog; +class KFileItem; + +/** + * Audio "preview" widget for the file dialog. + */ +class KFileAudioPreview : public KPreviewWidgetBase +{ + Q_OBJECT + +public: + KFileAudioPreview(TQWidget *parent = 0, const char *name = 0 ); + ~KFileAudioPreview(); + +public slots: + virtual void showPreview(const KURL &url); + virtual void clearPreview(); + +private slots: + void toggleAuto(bool); + +private: + TQDict m_supportedFormats; + KURL m_currentURL; + TQCheckBox *m_autoPlay; + +protected: + virtual void virtual_hook( int id, void* data ); +private: + class KFileAudioPreviewPrivate; + KFileAudioPreviewPrivate *d; +}; + +#endif // KFILEAUDIOPREVIEW_H diff --git a/interfaces/tdemediaplayer/player.cpp b/interfaces/tdemediaplayer/player.cpp new file mode 100644 index 000000000..2d97aa1f7 --- /dev/null +++ b/interfaces/tdemediaplayer/player.cpp @@ -0,0 +1,79 @@ +// Copyright (C) 2002 Neil Stevens +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Except as contained in this notice, the name(s) of the author(s) shall not be +// used in advertising or otherwise to promote the sale, use or other dealings +// in this Software without prior written authorization from the author(s). + +#include + +KMediaPlayer::PlayerDCOPObject::PlayerDCOPObject(void) + : DCOPObject("KMediaPlayer") +{ +} + +KMediaPlayer::Player::Player(TQWidget *, const char *, TQObject *parent, const char *name) + : KParts::ReadOnlyPart(parent, name) + , currentLooping(false) + , currentState(Empty) + , d(0) +{ +} + +KMediaPlayer::Player::Player(TQObject *parent, const char *name) + : KParts::ReadOnlyPart(parent, name) + , currentLooping(false) + , currentState(Empty) + , d(0) +{ +} + +KMediaPlayer::Player::~Player(void) +{ +} + +void KMediaPlayer::Player::setLooping(bool b) +{ + if(b != currentLooping) + { + currentLooping = b; + emit loopingChanged(b); + } +} + +bool KMediaPlayer::Player::isLooping(void) const +{ + return currentLooping; +} + +void KMediaPlayer::Player::setState(int s) +{ + if(s != currentState) + { + currentState = (State)s; + emit stateChanged(s); + } +} + +int KMediaPlayer::Player::state(void) const +{ + return (int)currentState; +} + +#include "player.moc" diff --git a/interfaces/tdemediaplayer/player.h b/interfaces/tdemediaplayer/player.h new file mode 100644 index 000000000..493a921e3 --- /dev/null +++ b/interfaces/tdemediaplayer/player.h @@ -0,0 +1,143 @@ +// Copyright (C) 2002 Neil Stevens +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Except as contained in this notice, the name(s) of the author(s) shall not be +// used in advertising or otherwise to promote the sale, use or other dealings +// in this Software without prior written authorization from the author(s). + +#ifndef KMEDIAPLAYERPLAYER_H +#define KMEDIAPLAYERPLAYER_H + +#include +#include +#include + +/** KMediaPlayer contains an interface to reusable media player components. +*/ +namespace KMediaPlayer +{ + +/** Player is the center of the KMediaPlayer interface. It provides all of + * the necessary media player operations, and optionally provides the GUI to + * control them. + * + * There are two servicetypes for Player: KMediaPlayer/Player and + * KMediaPlayer/Engine. KMediaPlayer/Player provides a widget (accessable + * through view as well as XML GUI KActions. KMediaPlayer/Engine omits + * the user interface facets, for those who wish to provide their own + * interface. + */ +class KDE_EXPORT Player : public KParts::ReadOnlyPart, public PlayerDCOPObject +{ +Q_OBJECT + +public: + /** This constructor is what to use when no GUI is required, as in the + * case of a KMediaPlayer/Engine. + */ + Player(TQObject *parent, const char *name); + + /** This constructor is what to use when a GUI is required, as in the + * case of a KMediaPlayer/Player. + */ + Player(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name); + + virtual ~Player(void); + + /** A convenience function returning a pointer to the View for this + * Player, or 0 if this Player has no GUI. + */ + virtual View *view(void) = 0; + +public slots: + /** Pause playback of the media track.*/ + virtual void pause(void) = 0; + + /** Begin playing the media track.*/ + virtual void play(void) = 0; + + /** Stop playback of the media track and return to the beginning.*/ + virtual void stop(void) = 0; + + /** Move the current playback position to the specified time in + * milliseconds, if the track is seekable. Some streams may not be + * seeked. + */ + virtual void seek(unsigned long msec) = 0; +public: + /** Returns whether the current track honors seek requests.*/ + virtual bool isSeekable(void) const = 0; + + /** Returns the current playback position in the track.*/ + virtual unsigned long position(void) const = 0; + + /** Returns whether the current track has a length. Some streams are + * endless, and do not have one. */ + virtual bool hasLength(void) const = 0; + + /** Returns the length of the current track.*/ + virtual unsigned long length(void) const = 0; + +public slots: + /** Set whether the Player should continue playing at the beginning of + * the track when the end of the track is reached. + */ + void setLooping(bool); +public: + /** Return the current looping state. */ + bool isLooping(void) const; +signals: + /** Emitted when the looping state is changed. */ + void loopingChanged(bool); + +public: + /** The possible states of the Player */ + enum State + { + /** No track is loaded. */ + Empty, + /** Not playing. */ + Stop, + /** Playing is temporarily suspended. */ + Pause, + /** The media is currently being output. */ + Play + }; + /** Return the current state of the player. */ + int state(void) const; +signals: + /** Emitted when the state changes. */ + void stateChanged(int); + +protected slots: + /** Implementers use this to control what users see as the current + * state.*/ + void setState(int); + +private: + bool currentLooping; + State currentState; + + struct Data; + Data *d; +}; + +} + +#endif diff --git a/interfaces/tdemediaplayer/playerdcopobject.h b/interfaces/tdemediaplayer/playerdcopobject.h new file mode 100644 index 000000000..73a1cfa1d --- /dev/null +++ b/interfaces/tdemediaplayer/playerdcopobject.h @@ -0,0 +1,62 @@ +// Copyright (C) 2002 Neil Stevens +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Except as contained in this notice, the name(s) of the author(s) shall not be +// used in advertising or otherwise to promote the sale, use or other dealings +// in this Software without prior written authorization from the author(s). + +#ifndef KMEDIAPLAYERPLAYERDCOPOBJECT_H +#define KMEDIAPLAYERPLAYERDCOPOBJECT_H + +#include +#include + +namespace KMediaPlayer +{ + +class KDE_EXPORT PlayerDCOPObject : public DCOPObject +{ +K_DCOP + +public: + PlayerDCOPObject(void); + +k_dcop: + virtual bool openURL(const KURL &file) = 0; + virtual void pause() = 0; + virtual void play() = 0; + virtual void stop() = 0; + + virtual void seek(unsigned long msec) = 0; + virtual bool isSeekable() const = 0; + virtual unsigned long position() const = 0; + + virtual bool hasLength() const = 0; + virtual unsigned long length() const = 0; + + virtual void setLooping(bool) = 0; + virtual bool isLooping() const = 0; + + virtual int state() const = 0; + virtual void setState(int) = 0; +}; + +} + +#endif diff --git a/interfaces/tdemediaplayer/tdemediaplayer.desktop b/interfaces/tdemediaplayer/tdemediaplayer.desktop new file mode 100644 index 000000000..85c1df65b --- /dev/null +++ b/interfaces/tdemediaplayer/tdemediaplayer.desktop @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=KMediaPlayer/Player +X-TDE-Derived=KParts/ReadOnlyPart diff --git a/interfaces/tdemediaplayer/tdemediaplayerengine.desktop b/interfaces/tdemediaplayer/tdemediaplayerengine.desktop new file mode 100644 index 000000000..ba7bf0403 --- /dev/null +++ b/interfaces/tdemediaplayer/tdemediaplayerengine.desktop @@ -0,0 +1,3 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=KMediaPlayer/Engine diff --git a/interfaces/tdemediaplayer/view.cpp b/interfaces/tdemediaplayer/view.cpp new file mode 100644 index 000000000..87d1d78a5 --- /dev/null +++ b/interfaces/tdemediaplayer/view.cpp @@ -0,0 +1,89 @@ +// Copyright (C) 2002 Neil Stevens +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Except as contained in this notice, the name(s) of the author(s) shall not be +// used in advertising or otherwise to promote the sale, use or other dealings +// in this Software without prior written authorization from the author(s). + +#include + +struct KMediaPlayer::View::Data +{ + Data() : videoWidget(0L) {} + + TQWidget *videoWidget; +}; + +KMediaPlayer::View::View(TQWidget *parent, const char *name) + : TQWidget(parent, name) + , currentButtons((int)All) + , d(new Data()) +{ +} + +KMediaPlayer::View::~View(void) +{ + delete d; +} + +int KMediaPlayer::View::buttons(void) +{ + return currentButtons; +} + +void KMediaPlayer::View::setButtons(int buttons) +{ + if(buttons != currentButtons) + { + currentButtons = buttons; + emit buttonsChanged(buttons); + } +} + +bool KMediaPlayer::View::button(int b) +{ + return currentButtons & b; +} + +void KMediaPlayer::View::showButton(int b) +{ + setButtons(currentButtons | b); +} + +void KMediaPlayer::View::hideButton(int b) +{ + setButtons(currentButtons & ~b); +} + +void KMediaPlayer::View::toggleButton(int b) +{ + setButtons(currentButtons ^ b); +} + +void KMediaPlayer::View::setVideoWidget(TQWidget *videoWidget) +{ + d->videoWidget = videoWidget; +} + +TQWidget* KMediaPlayer::View::videoWidget() +{ + return d->videoWidget; +} + +#include "view.moc" diff --git a/interfaces/tdemediaplayer/view.h b/interfaces/tdemediaplayer/view.h new file mode 100644 index 000000000..c1d9dbe41 --- /dev/null +++ b/interfaces/tdemediaplayer/view.h @@ -0,0 +1,98 @@ +// Copyright (C) 2002 Neil Stevens +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// THE AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Except as contained in this notice, the name(s) of the author(s) shall not be +// used in advertising or otherwise to promote the sale, use or other dealings +// in this Software without prior written authorization from the author(s). + +#ifndef KMEDIAPLAYERVIEW_H +#define KMEDIAPLAYERVIEW_H + +#include +#include + +namespace KMediaPlayer +{ + +/** View is part of the user interface of a Player. */ +class KDE_EXPORT View : public TQWidget +{ +Q_OBJECT + +public: + /** Your typical TQWidget constructor. */ + View(TQWidget *parent, const char *name); + virtual ~View(void); + + /** The Possible buttons that can appear in the UI. */ + enum Button + { + /** Button that connects to Player::play */ + Play = 1, + /** Button that connects to Player::stop */ + Stop = 2, + /** Button that connects to Player::pause */ + Pause = 4, + /** A seeker that interfaces with Player::seek */ + Seeker = 8, + /** Show all buttons. */ + All = 255 + }; + + /** Return which buttons are being displayed. */ + int buttons(void); + + /** Return the TQWidget in which video is displayed. + May Return 0L if there is none. */ + TQWidget *videoWidget(); + +public slots: + /** Set which buttons to display. See Button. */ + void setButtons(int); + + /** Returns if a particular button is being displayed. */ + bool button(int); + /** Display a particular button. */ + void showButton(int); + /** Stop displaying a particular button. */ + void hideButton(int); + /** Toggle the display of a particular button. */ + void toggleButton(int); + +signals: + /** Emitted when the set of displayed buttons changes. */ + void buttonsChanged(int); + +protected: + /** The implementing view should set the widget in which + the video will be displayed. KMediaPlayer users may + reparent() it to somewhere else, for example. + */ + void setVideoWidget(TQWidget *videoWidget); + +private: + int currentButtons; + + struct Data; + Data *d; +}; + +} + +#endif diff --git a/interfaces/tdescript/CMakeLists.txt b/interfaces/tdescript/CMakeLists.txt new file mode 100644 index 000000000..bcddb1068 --- /dev/null +++ b/interfaces/tdescript/CMakeLists.txt @@ -0,0 +1,56 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( sample ) + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/kio + ${CMAKE_SOURCE_DIR}/kio/kio +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + scriptinterface.h scriptclientinterface.h scriptmanager.h + DESTINATION ${INCLUDE_INSTALL_DIR} ) + + +##### other data ################################ + +install( FILES scriptinterface.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR} ) + + +##### tdescript ################################### + +set( target tdescript ) + +set( ${target}_SRCS + scriptmanager.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 0.0.0 + LINK kio-shared + DESTINATION ${LIB_INSTALL_DIR} +) diff --git a/interfaces/tdescript/Makefile.am b/interfaces/tdescript/Makefile.am new file mode 100644 index 000000000..55d4cac35 --- /dev/null +++ b/interfaces/tdescript/Makefile.am @@ -0,0 +1,21 @@ +SUBDIRS = . sample + +INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(srcdir) -I$(srcdir)/.. $(all_includes) + +#lib_LTLIBRARIES = libtdescriptloader.la libtdescript.la +lib_LTLIBRARIES = libtdescript.la +#libtdescriptloader_la_SOURCES = scriptloader.cpp +#libtdescriptloader_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +#libtdescriptloader_la_LIBADD = $(LIB_KPARTS) + +libtdescript_la_SOURCES = scriptmanager.cpp +libtdescript_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined +libtdescript_la_LIBADD = $(LIB_KIO) $(LIB_QT) $(LIB_TDECORE) $(LIB_TDEUI) + +tdescriptinclude_HEADERS = scriptinterface.h scriptclientinterface.h scriptmanager.h +tdescriptincludedir = $(includedir) + +METASOURCES = AUTO + +servicetypedir = $(kde_servicetypesdir) +servicetype_DATA = scriptinterface.desktop diff --git a/interfaces/tdescript/README b/interfaces/tdescript/README new file mode 100644 index 000000000..213a0c277 --- /dev/null +++ b/interfaces/tdescript/README @@ -0,0 +1,14 @@ +Script interface +---------------- +Overview: +scriptloader - used to load script engines and scripts from the GUI +scriptinterface - the base of all script engines + +Script Engines: + +TODO + +Script Loader: + +TODO + diff --git a/interfaces/tdescript/sample/CMakeLists.txt b/interfaces/tdescript/sample/CMakeLists.txt new file mode 100644 index 000000000..46d031bff --- /dev/null +++ b/interfaces/tdescript/sample/CMakeLists.txt @@ -0,0 +1,43 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/interfaces/tdescript + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES shellscript.desktop DESTINATION ${SERVICES_INSTALL_DIR} ) + + +##### libshellscript ############################ + +set( target libshellscript ) + +set( ${target}_SRCS + shellscript.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdescript-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/interfaces/tdescript/sample/Makefile.am b/interfaces/tdescript/sample/Makefile.am new file mode 100644 index 000000000..77d39b28c --- /dev/null +++ b/interfaces/tdescript/sample/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir)/interfaces -I$(srcdir) -I$(top_srcdir) -I$(top_srcdir)/interfaces/tdescript $(all_includes) + +kde_module_LTLIBRARIES = libshellscript.la + +libshellscript_la_SOURCES = shellscript.cpp +libshellscript_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -no-undefined -avoid-version +libshellscript_la_LIBADD = ../libtdescript.la $(LIB_QT) $(LIB_TDECORE) $(top_builddir)/dcop/libDCOP.la + + +METASOURCES = AUTO + +servicetypedir = $(kde_servicesdir) +servicetype_DATA = shellscript.desktop diff --git a/interfaces/tdescript/sample/shellscript.cpp b/interfaces/tdescript/sample/shellscript.cpp new file mode 100644 index 000000000..9ec34f7a2 --- /dev/null +++ b/interfaces/tdescript/sample/shellscript.cpp @@ -0,0 +1,85 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "shellscript.h" +#include +#include +#include + +#include +#include +//using namespace KScriptInterface; +typedef KGenericFactory ShellScriptFactory; +K_EXPORT_COMPONENT_FACTORY( libshellscript, ShellScriptFactory( "ShellScript" ) ) + +ShellScript::ShellScript(KScriptClientInterface *parent, const char *, const TQStringList & ) : ScriptClientInterface(parent) +{ + m_script = new TDEProcess(); + connect ( m_script, TQT_SIGNAL(processExited(TDEProcess *)), TQT_SLOT(Exit(TDEProcess *))); + connect ( m_script, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)), TQT_SLOT(stdOut(TDEProcess *, char *, int ))); + connect ( m_script, TQT_SIGNAL(receivedStderr(TDEProcess *, char *, int)), TQT_SLOT(stdErr(TDEProcess *, char *, int ))); + // Connect feedback signals and slots + //kdDebug() << "Building new script engine" << endl; +} + +ShellScript::~ShellScript() +{ +} + +TQString ShellScript::script() const +{ + return m_scriptName; +} + +void ShellScript::setScript( const TQString &scriptFile ) +{ + m_scriptName = scriptFile; + *m_script << "sh" << m_scriptName << kapp->dcopClient()->appId(); +} + +void ShellScript::setScript( const TQString &, const TQString & ) +{ + // ### what is this? +} + +void ShellScript::run(TQObject *, const TQVariant &) +{ + m_script->start(TDEProcess::NotifyOnExit,TDEProcess::All); +} +void ShellScript::kill() +{ + if (!m_script->kill()) // Kill the process + m_script->kill(9); // Kill it harder +} + +void ShellScript::Exit(TDEProcess *proc) +{ + ScriptClientInterface->done((KScriptClientInterface::Result)proc->exitStatus(), ""); +} + +void ShellScript::stdErr(TDEProcess *, char *buffer, int) +{ + ScriptClientInterface->error(buffer); +} +void ShellScript::stdOut(TDEProcess *, char *buffer, int) +{ + ScriptClientInterface->output(buffer); +} + +#include "shellscript.moc" diff --git a/interfaces/tdescript/sample/shellscript.desktop b/interfaces/tdescript/sample/shellscript.desktop new file mode 100644 index 000000000..e65713a3b --- /dev/null +++ b/interfaces/tdescript/sample/shellscript.desktop @@ -0,0 +1,153 @@ +[Desktop Entry] +Name=Bash Shell Script Runner +Name[af]=Bash Tolk Skrip Hardloper +Name[az]=Bash Qabıq Skripti İcraçısı +Name[be]=Выкананне сцэнараў абалонкі bash +Name[bn]=ব্যাশ শেল স্ক্রিপ্ট চালক +Name[bs]=Izvršavanje Bash shell skripti +Name[ca]=Processa script bash a l'intèrpret de comandaments +Name[cs]=Spouštěč skriptů pro BASH +Name[csb]=Programa zrëszôjącô skriptë Bash +Name[cy]=Rhedydd Sgript Plisgyn Bash +Name[da]=Bash Skal-script-udførsel +Name[de]=Ausführung von Bash-Skripten +Name[el]=Εκτελεστής σεναρίων κελύφους Bash +Name[eo]=Baŝoskriptlanĉilo +Name[es]=Ejecutor de script para intérprete de órdenes de bash +Name[et]=Bash shelli skripti käivitaja +Name[eu]=Bash shell script-aren abiarazlea +Name[fa]=اجراکنندۀ دست‌نوشتۀ پوستۀ bash +Name[fi]=Komentotulkkiohjelmien käynnistäjä +Name[fr]=Lanceur de scripts shell Bash +Name[fy]=Bash Flues Skript Rinner +Name[ga]=Reathaí Script Bhlaoisce bash +Name[gl]=Guión Executábel da Shell Bash +Name[he]=הרצת תסריט מעטפת של Bash +Name[hi]=बैश शेल स्क्रिप्ट चालक +Name[hr]=Pokretač Bash skripti ljuske +Name[hu]=Bash parancsfájl futtatása +Name[is]=Keyrsluforrit bash skeljaforrita +Name[it]=Esecutore script bash +Name[ja]=Bash シェルスクリプト 実行 +Name[ka]=bash სკრიპტების შესრულება +Name[kk]=Bash қоршау-ортаның скриптерін орындау +Name[km]=កម្មវិធី​រត់​ស្គ្រីប​សែល Bash +Name[ko]=배쉬 쉘 스크립트 실행기 +Name[lb]=Ausféierer fir Bash-Kommandozeil-Skripter +Name[lt]=Bash apvalkalo scenarijų paleidėjas +Name[lv]=Bash čaulas skriptu darbinātājs +Name[mk]=Стартувач на скрипти за школката Bash +Name[mn]=Bash-Shell-Скрипт ажиллуулагч +Name[ms]=Pelaksana Skrip Cengkerang Bash +Name[nb]=Bash skallskriptkjører +Name[nds]=Bashskript-Starter +Name[ne]=बाश शेल स्क्रिप्ट सञ्चालक +Name[nn]=Bash-skalskriptkøyrar +Name[pa]=ਬੈਸ਼ ਸ਼ੈਲ ਸਕ੍ਰਿਪਟ ਰਨਰ(Bash Shell) +Name[pl]=Program uruchamiający skrypty Bash +Name[pt]=Execução de Programa da 'Shell' BASH +Name[pt_BR]=Executor de Script Shell do Bash +Name[ro]=Executor scripturi de interpretor +Name[ru]=Запуск скриптов bash +Name[rw]=Mutangiza Gaporogaramu Bash Shell +Name[se]=Skálžu-skriptavuodji +Name[sk]=Spustenie Bash shell skriptu +Name[sl]=Zaganjalnik lupinski skriptov +Name[sq]=Egzekutuesi i skriptave të Guacës Bash +Name[sr]=Извршавач скрипти Bash шкољке +Name[sr@Latn]=Izvršavač skripti Bash školjke +Name[sv]=Kör Bash-skalskript +Name[ta]=பேஷ் ஓட்டு எழுத்தாக்க இயக்கி +Name[te]=బేష్ షెల్ స్క్రిప్ట్లను నిర్వర్తించెది +Name[tg]=Иҷрокунандаи Bash Shell +Name[th]=ตัวสั่งสคริปต์ของ bash เชลล์ให้ทำงาน +Name[tr]=Kabuk Betiği Çalıştırıcısı +Name[tt]=Qabıqnıñ Bash Ämerlek Cibärgeçe +Name[uk]=Виконувач скриптів командної оболонки (bash) +Name[uz]=Bash shell skriptini ishga tushuruvchi +Name[uz@cyrillic]=Bash шелл скриптини ишга тушурувчи +Name[vi]=Bộ chạy tập lệnh hệ vỏ Bash +Name[wa]=Enondeu di scripes shell bash +Name[zh_CN]=Bash Shell 脚本运行程序 +Name[zh_TW]=Bash Shell Script 執行器 +Type=Service +X-TDE-Library=libshellscript +X-TDE-Script-Runner=ShellScript/bash +ServiceTypes=KScriptRunner/KScriptRunner +Comment=Runs bash shell scripts from inside the application. +Comment[af]=Laai bash tolk skripte vanuit die program. +Comment[ar]=يشغَل bash shell scripts من داخل التطبيق +Comment[az]=Proqramın içindən bash qabıq skriptlərini icra edin +Comment[be]=Выконвае сцэнары абалонкі bash у межах праграмы. +Comment[bg]=Изпълнение на скриптове на bash от друга програма. +Comment[bn]=অ্যাপ্লিকেশনের ভেতরে ব্যাশ শেল স্ক্রিপ্ট (bash shell script) চালায়। +Comment[bs]=Izvršava bash shell skripte iz same aplikacije. +Comment[ca]=Processa scripts bash des de les aplicacions. +Comment[cs]=Spouští BASH skript z aplikace. +Comment[csb]=Zrëszô skriptë Bash bënë aplikacëji. +Comment[cy]=Yn rhedeg sgriptiau plisgyn bash o tu fewn y cymhwysiad. +Comment[da]=Kører bash skal-scripter inde fra programmet. +Comment[de]=Führt Bash-Shell-Skripte innerhalb von Programmen aus +Comment[el]=Εκτελεί σενάρια κελύφους bash μέσα από την εφαρμογή. +Comment[eo]=Enaplikaĵe lanĉas ŝelskriptojn. +Comment[es]=Ejecuta procedimientos del intérprete de órdenes bash desde dentro de la aplicación. +Comment[et]=Käivitab bash shelli skripte rakendustes. +Comment[eu]=Aplikazioaren baitatik bash-eko shell script-ak abiarazteko. +Comment[fa]=دست‌نوشته‌های پوستۀ bash را از درون کاربرد اجرا می‌کند. +Comment[fi]=Suorittaa Bash-komentotulkkiohjelmia ohjelman sisästä +Comment[fr]=Exécute des scripts shell Bash depuis l'intérieur de l'application. +Comment[fy]=Bash flues skript rint yn de applikaasje. +Comment[ga]=Ritheann seo scripteanna blaoisce bash ó thaobh istigh an fheidhmchláir. +Comment[gl]=Executa guións da shell bash desde dentro da aplicación. +Comment[he]=מריץ תסריטי Bash מתוך היישום +Comment[hi]=अनुप्रयोगों के भीतर से ही बैश शेल स्क्रिप्ट चलाता है. +Comment[hr]=Pokretanje bash skripti ljuske iz aplikacije. +Comment[hsb]=Wuwjedźe skripty za bash znutřka aplikacije. +Comment[hu]=Bash parancsfájlok futtatása alkalmazásokból. +Comment[id]=Menjalankan skrip bash dari aplikasi +Comment[is]=Keyrir bash skeljaforrit innan forritsins +Comment[it]=Esegue gli script bash all'interno dell'applicazione. +Comment[ja]=アプリケーション内部からの Bash シェルスクリプトを実行します。 +Comment[ka]=bash სკრიპტების პროგრამებში შესრულება. +Comment[kk]=Қолданбаның ішінен bash скрипттерін орындайды. +Comment[km]=រត់​ស្គ្រីប​សែល bash ពី​ក្នុង​កម្មវិធី ។ +Comment[ko]=응용 프로그램에서 배쉬 쉘 스크립트를 실행합니다. +Comment[lb]=Féiert Skripter fir d'Bash-Kommandozeil aus dem Programm selwer aus. +Comment[lt]=Paleidžia bash apvalkalo scenarijus iš taikomosios programos. +Comment[lv]=Darbina Bash čaulas skriptus iekš programmas. +Comment[mk]=Ги стартува bash shell скриптите од апликацијата. +Comment[mn]=Програм дотроос Bash-Shell-Скрипт ажиллуулах. +Comment[ms]=Laksanakan skrip cengkerang bash di dalam aplikasi. +Comment[nb]=Kjører bash skallskript fra innsiden av programmet. +Comment[nds]=Dor köönt Programmen Bash-Konsoolskripten mit utföhren. +Comment[ne]=अनुप्रयोगको भित्रबाट बाश शेल स्क्रिप्ट सञ्चालन गर्दछ । +Comment[nl]=Voert Bash-shellscripts uit binnen de toepassing. +Comment[nn]=Køyrer Bash-skalskript innanfrå programmet. +Comment[pa]=ਇੱਕ ਕਾਰਜ ਵਿੱਚ ਬੈਸ਼ ਸ਼ੈਲ ਸਕ੍ਰਿਪਟਾਂ ਚਲਾਉਣ ਲਈ ਸਹਾਇਕ ਹੈ +Comment[pl]=Uruchamia skrypty Bash wewnątrz programu. +Comment[pt]=Corre os programas da 'shell' 'bash' dentro das aplicações. +Comment[pt_BR]=Executa shell scripts do bash de dentro do aplicativo +Comment[ro]=Execută scripturi de interpretor "bash" din interiorul unei aplicaţii. +Comment[ru]=Запуск bash-скриптов из приложений. +Comment[rw]=Itangiza inyandikoporogaramu ya sheli bash guhera imberemo ya porogaramu. +Comment[se]=Vuodjá bash-skálzoskriptaid prográmma siskobeales. +Comment[sk]=Spustí bash shell skript z aplikácie. +Comment[sl]=Požene lupinske skripte znotraj programa. +Comment[sq]=I ekzekuton skriptat Guacës Bash përbrenda aplikacionit. +Comment[sr]=Покреће скриптре bash шкољке унутар програма. +Comment[sr@Latn]=Pokreće skriptre bash školjke unutar programa. +Comment[sv]=Kör Bash-skalskript inifrån programmet. +Comment[ta]=பயன்பாட்டில் இருந்து பேஷ் ஓட்டு எழுத்தாக்க இயக்குகிறது +Comment[te]=బేష్ షెల్ స్క్రిప్ట్లను కార్యక్షేత్రం లొపల నుంచి నిర్వర్తించెది +Comment[tg]=Скриптҳои bash shell даруни барномаҳо иҷро мекунад. +Comment[th]=สั่งให้สคริปต์ของ bash เชลล์ทำงานภายในแอพพลิเคชัน +Comment[tr]=Uygulama içinden bash betiği çalıştırır. +Comment[tt]=Yazılım eçennän bash ämerleklär cibärä. +Comment[uk]=Запускає скрипти командної оболонки (bash) з програми. +Comment[uz]=Dasturlarning ichdan bash shell skriptini ishga tushiradi +Comment[uz@cyrillic]=Дастурларнинг ичдан bash шелл скриптини ишга туширади +Comment[vi]=Chạy tập lệnh hệ vỏ bash bên trong ứng dụng. +Comment[wa]=Enonder des scripes shell bash a pårti do programe +Comment[zh_CN]=在应用程序内运行 bash shell 脚本。 +Comment[zh_HK]=於程式內執行 bash shell script 檔案 +Comment[zh_TW]=於程式內執行 bash shell script 檔案 diff --git a/interfaces/tdescript/sample/shellscript.h b/interfaces/tdescript/sample/shellscript.h new file mode 100644 index 000000000..2cdaf7e5a --- /dev/null +++ b/interfaces/tdescript/sample/shellscript.h @@ -0,0 +1,48 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef __shellscript_h__ +#define __shellscript_h__ + +#include +#include +#include +#include +//using namespace KScriptInterface; +class ShellScript : public KScriptInterface +{ + Q_OBJECT +public: + ShellScript(KScriptClientInterface *parent, const char *name, const TQStringList &args); + virtual ~ShellScript(); + TQString script() const; + void setScript( const TQString &scriptFile ); + void setScript( const TQString &scriptLibFile, const TQString &method ); + void run(TQObject *context = 0, const TQVariant &arg = 0); + void kill(); +private slots: + void Exit(TDEProcess *proc); + void stdErr(TDEProcess *proc, char *buffer, int buflen); + void stdOut(TDEProcess *proc, char *buffer, int buflen); +private: + TDEProcess *m_script; + KScriptClientInterface *ScriptClientInterface; + TQString m_scriptName; +}; + +#endif diff --git a/interfaces/tdescript/scriptclientinterface.h b/interfaces/tdescript/scriptclientinterface.h new file mode 100644 index 000000000..0f07d34b2 --- /dev/null +++ b/interfaces/tdescript/scriptclientinterface.h @@ -0,0 +1,124 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef __scriptclientinterface_h__ +#define __scriptclientinterface_h__ +#include + +class TQString; + +//namespace KScriptInterface +//{ + /** + * This class is used for allowing feedback to the main system. + * @author Ian Reinhart Geiser + * + * To implement KScript in your application you would use this class to interface with the scripting engine. + * There are currently a few implementations of script managers around but developers can implement their own custom + * interfaces with this class. + * @code + * class MyScript : public TQObject, public KScriptClientInterface { + * Q_OBJECT + * public: + * + * MyScript(TQObject *parent) + * { + * // Create your @ref KScriptInterface here. + * m_interface = KParts::ComponentFactory::createInstanceFromQuery( + * "KScriptRunner/KScriptRunner", "([X-TDE-Script-Runner] == 'bash/shell')", this ); + * } + * + * virtual ~KScriptAction() + * { + * delete m_interface; + * } + * + * signals: + * void error ( const TQString &msg ); + * void warning ( const TQString &msg ); + * void output ( const TQString &msg ); + * void progress ( int percent ); + * void done ( KScriptClientInterface::Result result, const TQVariant &returned ); + * + * public slots: + * void activate(const TQVariant &args) + * { + * m_interface->run(parent(), args); + * } + * + * private: + * + * KScriptInterface *m_interface; + * }; + * @endcode + * Things to note about this example are that it only handles a single script type and instance. You may wish to + * extend this. + **/ + + class KScriptClientInterface + { + public: + enum Result { ResultSuccess, ResultFailure, ResultContinue, ResultBreak }; + /** + * This function will allow the main application of any errors + * that have occurred during processing of the script. + * For script clients its best to implement this as a signal so feedback + * can be sent to the main application. + */ + virtual void error( const TQString &msg ) =0; + /** + * This function will allow the main application of any warnings + * that have occurred during the processing of the script. + * For script clients its best to implement this as a signal so feedback + * can be sent to the main application. + */ + virtual void warning( const TQString &msg ) =0; + /** + * This function will allow the main application of any normal + * output that has occurred during the processing of the script. + * For script clients its best to implement this as a signal so feedback + * can be sent to the main application. + */ + virtual void output( const TQString &msg ) =0; + /** + * This function will allow feedback to any progress bars in the main + * application as to how far along the script is. This is very useful when + * a script is processing files or doing some long operation that is of a + * known duration.] + * For script clients its best to implement this as a signal so feedback + * can be sent to the main application. + */ + virtual void progress( int percent ) =0; + /** + * This function will allow feedback on completion of the script. + * It turns the result as a KScriptInteface::Result, and a return + * value as a QVariant + * For script clients its best to implement this as a signal so feedback + * can be sent to the main application. + */ + virtual void done( KScriptClientInterface::Result result, const TQVariant &returned ) =0; + /** + * Returned when the script has finished running. + * For script clients its best to implement this as a signal so feedback + * can be sent to the main application. + **/ + //virtual bool isRunning() =0; + }; +//}; + +#endif diff --git a/interfaces/tdescript/scriptinterface.desktop b/interfaces/tdescript/scriptinterface.desktop new file mode 100644 index 000000000..397e650d8 --- /dev/null +++ b/interfaces/tdescript/scriptinterface.desktop @@ -0,0 +1,89 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=KScriptRunner/KScriptRunner +Comment=This is a generic test script engine for testing the script interface. +Comment[af]=Hierdie is 'n generies toets skrip masjien vir toetsing die skrip koppelvlak. +Comment[ar]=هذه آلة نصوص برمجية اختبارية لاختبار واجهة النص البرمجي. +Comment[az]=Skript ara üzünü sınamaq üçün ümumi sınaq skriptidir. +Comment[be]=Простая сістэма праверкі выканання сцэнараў. +Comment[bg]=Модул за тестване на скриптове. +Comment[bs]=Ovo je opšti engine za testiranje interfejsa skripti. +Comment[ca]=Aquest és un enginy per a provar la interfície de l'script. +Comment[cs]=Toto je obecný testovací skript pro testování skriptovacího rozhranní. +Comment[csb]=Mòduł testowaniô skriptowegò interfejsu. +Comment[cy]=Mae hyn yn beiriant sgript prawf generig i brofi y sgript rhyngwyneb. +Comment[da]=Dette er en generisk testscript-maskine til at teste scriptgrænsefladen. +Comment[de]=Dies ist eine allgemeine Sammlung von Testroutinen für die Skript-Schnittstelle. +Comment[el]=Αυτό είναι μια γενική μηχανή ελέγχου σεναρίων για τον έλεγχο της διασύνδεσης σεναρίων. +Comment[eo]=Tio estas testprogram-maŝino por testi la programinterfaco. +Comment[es]=Este es un motor de script genérico para probar el interfaz de script. +Comment[et]=Üldise skriptimootori testskript liidese testimiseks. +Comment[eu]=Hau script motoreen proba generikoa da script-aren interfazea probatzeko. +Comment[fa]=این یک موتور دست‌نوشتۀ آزمون عمومی برای آزمایش واسط دست‌نوشته می‌باشد. +Comment[fi]=Tämä on yleinen skriptitestimoottori skriptin käyttöliittymän testaamiseen +Comment[fo]=Hetta er ein almen royndarforritsskipan til at nároyna fjølvisforritsmarkamótið. +Comment[fr]=Ceci est un moteur de script de test générique pour expérimenter l'interface de script. +Comment[fy]=Dit is in algemiene samling testroutines foar it testen fan de skript-interface. +Comment[ga]=Is inneall tástála cineálach scripteanna é seo a úsáidtear chun an comhéadan scripte a thástáil. +Comment[gl]=Ésta é unha ferramenta para probar a interface dos guións. +Comment[he]=זהו מנוע תסריטים כללי לבדיקת ממשק התסריטים +Comment[hi]= स्क्रिप्ट इंटरफेस जांचने के लिए यह एक जेनरिक टेस्ट स्क्रिप्ट इंजन है. +Comment[hr]=Ovo je generička ispitna skripta programa za ispitivanje sučelja skripte. +Comment[hsb]=To je program za testowanje skript-interfejsa. +Comment[hu]=Ez egy tesztszkript a szkript-felület kipróbálásához. +Comment[id]=Mesin skrip tes generik untuk menguji antarmuka skrip +Comment[is]=Þetta er almennur þýðandi til að prófa skriftuviðmótið. +Comment[it]=Questo è un motore di script generico per provare l'interfaccia di script. +Comment[ja]=これはスクリプトインターフェースをテストする一般的なテストスクリプトです。 +Comment[ka]=ეს ძრავი სკრიპტების ინტერფეისის შესამოწმებლად გამოიყენება +Comment[kk]=Бұл скрипт интерфейсін сынауға арналған тетік. +Comment[km]=នេះ​ជា0​ម៉ាស៊ីន​ស្គ្រីប​សាកល្បង​ទូទៅ​មួយ ដើម្បី​សាកល្បង​ចំណុច​ប្រទាក់​ស្គ្រីប ។ +Comment[ko]=스크립트 인터페이스를 시험하는데 쓰이는 일반 시험 스크립트 엔진입니다. +Comment[lb]=Dësst ass eng allgemeng Test-Skript-Engine fir de Skript-Interface ze testen. +Comment[lt]=Tai yra bendras testavimo scenarijų variklis skirtas scenarijų sąsajos testavimui. +Comment[lv]=Šis ir vispārējs skriptu testa dzinējs skriptu saskarsmes virsmas testēšanai. +Comment[mk]=Ова е општа тест-скрипта за тестирање на скриптниот интерфејс +Comment[mn]=Энэ бол скриптын харьцах хэсгийн (interface) тестчилэлийн хувьд дахь ерөнхий тестийн горимын цуглуулга. +Comment[ms]=Ini ialah enjin skrip uji generik untuk mencuba antaramuka skrip. +Comment[mt]=Magna ġenerika biex tittestja l-interfaċċja tal-iskritti +Comment[nb]=Dette er et generisk testskript for å teste skriptgrensesnitt. +Comment[nds]=Dit is en allgemeen Koppel vun Testskripten för dat Pröven vun de Skript-Koppelsteed. +Comment[ne]=स्क्रिप्ट इन्टरफेस परीक्षणका लागि यो एउटा जेनेरिक परीक्षण स्क्रिप्ट हो । +Comment[nl]= Dit is een algemene verzameling van testroutines voor het testen dan de script-interface. +Comment[nn]=Dette er ein generell testskriptmotor for å prøva ut skriptgrensesnittet. +Comment[nso]=Ye ke engine ya thswaelo ya teko ya kakaretso yeo e somiswago go leka sefahlego sa tshwaelo. +Comment[pa]=ਇਹ ਇੱਕ ਸਕ੍ਰਿਪਟ ਇੰਟਰਫੇਸ ਨੂੰ ਜਾਂਚਣ ਲਈ ਇੱਕ ਸਧਾਰਨ ਜਾਂਚ ਇੰਜਣ ਹੈ। +Comment[pl]=Moduł do testowania interfejsu skryptowego. +Comment[pt]=Este é um motor de 'scripts' de teste para testar a interface de 'scripting'. +Comment[pt_BR]=Este é um mecanismo de teste genérico para testar a interface de script. +Comment[ro]=Acesta este un script de test generic pentru testarea interfeţei de scriptare. +Comment[ru]=Этот движок предназначен для тестирования интерфейса скриптов. +Comment[rw]=Iyi ni imashini rusange y'inyandikoporogaramu y'igerageza ikoreshwa mu kugerageza imigaragarire y'inyandikoporogaramu. +Comment[se]=Dát lea oppalaš geahččalanskriptamohtor testendihte skriptalavtta +Comment[sk]=Toto je generický testovací skript pre testovanie skriptovacieho rozhrania. +Comment[sl]=To je generični poskusni skriptni pogon za preizkušanje skriptnega vmesnika. +Comment[sr]=Ово је генерички програм за тестирање интерфејса скрипти. +Comment[sr@Latn]=Ovo je generički program za testiranje interfejsa skripti. +Comment[ss]=Lena yinjini yelibhuku leluhlolo lolubanti lekuhlola sichumanisi selibhuku. +Comment[sv]=Det här är ett generellt skripttestprogram för att testa skriptgränssnittet +Comment[ta]=எழுத்தாக்க இடைமுகத்தைச் சோதிக்க உதவும் ஒரு பொதுவான சோதனை இயந்திரம். +Comment[te]=ఇది స్క్రిప్ట్ ఇంటర్ఫెస్లను పరీక్షించెందుకు వాడె సాధరణ పరీక్షా స్క్రిప్ట్ ఇంజను +Comment[tg]=Ин ҷрокунандаи скрипт интерфейси скрипт тафтиш мекунад. +Comment[th]=นี่เป็นกลไกทดสอบสคริปต์ทั่วไป สำหรับทดสอบส่วนติดต่อสคริปต์ +Comment[tr]=Bu betik arayüzünü test etmek için bir genel test betik motorudur. +Comment[tt]=Ämeklek yözarasın tikşerü öçen sınaw qoralı bu. +Comment[uk]=Це - загальний рушій тестових скриптів для перевірки інтерфейсу скрипту. +Comment[uz]=Skriptning interfeysini tekshirish uchun umumiy sinov skript boshqaruvchisi +Comment[uz@cyrillic]=Скриптнинг интерфейсини текшириш учун умумий синов скрипт бошқарувчиси +Comment[ven]=Heyi ndi inzhini ya bammbiri la mulingo lau linga vhuvha ha bammbiri. +Comment[vi]=Đây là cơ chế tập lệnh thử ra giống loài để thử ra giao diện tập lệnh. +Comment[wa]=Çouchal est on programe di saye po vey kimint rote l' eterface di scripes. +Comment[xh]=Olu luvavanyo luka wonke-wonke lwenjini yokushicilelweyo yokuvavanya ujongano loshicilelo. +Comment[zh_CN]=这是一个用于测试脚本接口的通用脚本测试引擎。 +Comment[zh_HK]=這是用來測試手稿介面用的一般性測試手稿引擎 +Comment[zh_TW]=這是用來測試手稿介面用的一般性測試手稿引擎 +Comment[zu]=Lena yinjini yesikripti sokuvivinya sawonke wonke yokuvivinya isikripti somxhumanisi. + +[PropertyDef::X-TDE-Script-Runner] +Type=TQString + diff --git a/interfaces/tdescript/scriptinterface.h b/interfaces/tdescript/scriptinterface.h new file mode 100644 index 000000000..1c37b7f71 --- /dev/null +++ b/interfaces/tdescript/scriptinterface.h @@ -0,0 +1,88 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +/** +* \section Generic interface for building scripting engines +* +* This interface will create a generic API for implementing script engines. +* These engines can then be accessed from any application that supports this interface. +* +* +**/ +#ifndef __scriptinterface_h__ +#define __scriptinterface_h__ +#include +#include +#include + +//#include +class TQString; +class TQObject; +class KScriptClientInterface; + + +//namespace KScriptInterface +//{ + /** + * This class is the base for all script engines. + * @author Ian Reinhart Geiser + * + **/ + class KDE_EXPORT KScriptInterface : public TQObject + { + Q_OBJECT + public: + /** + * Return the current script code data + * @returns TQString containing the currenly runable code + **/ + virtual TQString script() const = 0; + /** + * Sets the path to the script library that we are going to embed. + **/ + virtual void setScript( const TQString &scriptFile ) = 0; + /** + * Sets the path to the script library that we are going to embed. + * The second argument is the function from the script library that + * we wish to call. + **/ + virtual void setScript( const TQString &scriptLibFile, const TQString &method ) = 0; + /** + * Run the actual script code + * This can both take a context object that will be shared between the + * main application and a variant that will contain the arguments. + **/ + virtual void run(TQObject *context = 0, const TQVariant &arg = 0) = 0; + /** + * Abort the scripts run + **/ + virtual void kill() =0; + public: + /** + * This is the method for sending feedback to applications. + * example of how this works: + * \code + * ScriptClientInterface->error( message_to_send_back_to_the_main_application ); + * \endcode + * Will send the error message back to the main application. + **/ + KScriptClientInterface *ScriptClientInterface; + }; +//}; +#endif diff --git a/interfaces/tdescript/scriptloader.cpp b/interfaces/tdescript/scriptloader.cpp new file mode 100644 index 000000000..79fa2055a --- /dev/null +++ b/interfaces/tdescript/scriptloader.cpp @@ -0,0 +1,104 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include "scriptloader.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +ScriptLoader::ScriptLoader(KMainWindow *parent) : TQObject (parent) +{ + m_parent = parent; + m_scripts.clear(); + m_theAction = new KSelectAction ( i18n("KDE Scripts"), + 0, + this, + TQT_SLOT(runAction()), + m_parent->actionCollection(), + "scripts"); +} + +ScriptLoader::~ScriptLoader() +{ + // Clean out the list + m_scripts.clear(); +} + +KSelectAction * ScriptLoader::getScripts() +{ + // Get the available scripts for this application. + TQStringList pluginList = ""; + // Find plugins + TQString searchPath = kapp->name(); + searchPath += "/scripts/"; + TQDir d(locate( "data", searchPath)); + kdDebug() << "loading plugin from " << locate( "data", searchPath) << endl; + const QFileInfoList *fileList = d.entryInfoList("*.desktop"); + QFileInfoListIterator it ( *fileList ); + TQFileInfo *fi; + // Find all available script desktop files + while( (fi=it.current())) + { + // Query each desktop file + if(KDesktopFile::isDesktopFile(fi->absFilePath())) + { + KDesktopFile desktop((fi->absFilePath()), true); + kdDebug () << "Trying to load script type: " << desktop.readType() << endl; + KScriptInterface *tmpIface = KParts::ComponentFactory::createInstanceFromQuery(desktop.readType() ); + if( tmpIface != 0 ) + { + m_scripts.append(tmpIface); + m_scripts.current()->setScript(desktop.readURL()); + //if(m_parent != 0) + //m_scripts.current()->setParent(m_parent); + pluginList.append(desktop.readName()); + } + else + kdDebug() << desktop.readName() << " could not be loaded!" << endl; + } + ++it; + } + m_theAction->clear(); + m_theAction->setItems(pluginList); + return m_theAction; +} + +void ScriptLoader::runAction() +{ + TQString scriptName = m_theAction->currentText(); + +} + +void ScriptLoader::stopAction() +{ + +} + +#include "scriptloader.moc" diff --git a/interfaces/tdescript/scriptloader.h b/interfaces/tdescript/scriptloader.h new file mode 100644 index 000000000..a249283d6 --- /dev/null +++ b/interfaces/tdescript/scriptloader.h @@ -0,0 +1,59 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef _script_loader_h +#define _script_loader_h +#include +#include +#include +#include + +/** + * Script loader + */ +class ScriptLoader : virtual public QObject +{ + Q_OBJECT + public: + /** + * Default Constructor + */ + ScriptLoader(KMainWindow *parent=0); + ~ScriptLoader(); + /** Return the a KSelectAction with all of the scripts + * @returns KSelectAction containing access to all of the scripts + */ + KSelectAction *getScripts(); + public slots: + /** Run the current action. + */ + void runAction(); + /** Stop the currently running scripts operations + */ + void stopAction(); + signals: + virtual void errors(TQString messages); + virtual void output(TQString messages); + virtual void done(int errorCode); + private: + TQPtrList m_scripts; + KSelectAction *m_theAction; + int m_currentSelection; + KMainWindow *m_parent; +}; +#endif diff --git a/interfaces/tdescript/scriptmanager.cpp b/interfaces/tdescript/scriptmanager.cpp new file mode 100644 index 000000000..cd20655d0 --- /dev/null +++ b/interfaces/tdescript/scriptmanager.cpp @@ -0,0 +1,132 @@ +#include "scriptmanager.h" +#include +#include +#include +#include +#include + +#include +#include +#include + +//using namespace KScriptInterface; +class ScriptInfo +{ + public: + TQString scriptType; + TQString scriptFile; + TQString scriptMethod; + ScriptInfo(); + ~ScriptInfo(){} +}; +ScriptInfo::ScriptInfo() +{ + scriptType = ""; + scriptFile = ""; + scriptMethod = ""; +} +KScriptManager::KScriptManager(TQObject *parent, const char *name) : + TQObject(parent,name), KScriptClientInterface() +{ + +} +KScriptManager::~KScriptManager() +{ + m_scripts.setAutoDelete(true); + m_scriptCache.setAutoDelete(true); + +} +bool KScriptManager::addScript( const TQString &scriptDesktopFile) +{ + //m_scriptNames.append(scriptName); + // lets get some information about the script we are going to run... + bool success = false; + TQString tmpScriptType = ""; + TQString tmpScriptFile = ""; + TQString tmpScriptMethod = ""; + // Read the desktop file + + if(KDesktopFile::isDesktopFile(scriptDesktopFile)) + { + KDesktopFile desktop(scriptDesktopFile, true); + m_scripts.insert(desktop.readName(), new ScriptInfo()); + m_scripts[desktop.readName()]->scriptType = desktop.readType(); + TQString localpath = TQString(kapp->name()) + "/scripts/" + desktop.readEntry("X-TDE-ScriptName", ""); + m_scripts[desktop.readName()]->scriptFile = locate("data", localpath); +// m_scripts[desktop.readName()]->scriptMethod = tmpScriptMethod; + success = true; + } + return success; +} +bool KScriptManager::removeScript( const TQString &scriptName ) +{ + bool result = m_scriptCache.remove(scriptName); + result = m_scripts.remove(scriptName); + return result; +} +TQStringList KScriptManager::scripts() +{ + TQDictIterator it( m_scripts ); +// return m_scriptNames; + TQStringList scriptList; + while ( it.current() ) + { + scriptList.append(it.currentKey()); + ++it; + } + return scriptList; +} +void KScriptManager::clear() +{ + m_scriptCache.clear(); + m_scripts.clear(); +} +void KScriptManager::runScript( const TQString &scriptName, TQObject *context, const TQVariant &arg) +{ + ScriptInfo *newScript = m_scripts[scriptName]; + if (newScript) + { + TQString scriptType = "([X-TDE-Script-Runner] == '" + newScript->scriptType + "')"; + kdDebug()<<"running script, type = '"<( "KScriptRunner/KScriptRunner", scriptType, this ); + if ( ksif ) + { + m_scriptCache.insert( scriptName, ksif ); + + } + else + { + KMessageBox::sorry(0, i18n("Unable to get KScript Runner for type \"%1\".").arg(newScript->scriptType), i18n("KScript Error")); + return; + } + } + m_currentScript = scriptName; + + if ( m_scriptCache[m_currentScript] ) + { + m_scriptCache[m_currentScript]->ScriptClientInterface = this; + if (!newScript->scriptMethod.isEmpty()) + m_scriptCache[m_currentScript]->setScript( newScript->scriptFile, newScript->scriptMethod ); + else + m_scriptCache[m_currentScript]->setScript( newScript->scriptFile ); + m_scriptCache[m_currentScript]->run(context, arg); + } + else + { + // Dialog and say we cant go on... + // This is also a broken script so we need to remove it + m_scriptCache.remove(m_currentScript); + } + } + else + KMessageBox::sorry(0, i18n("Unable find script \"%1\".").arg(scriptName), i18n("KScript Error")); +} +#include "scriptmanager.moc" +#include "scriptinterface.moc" diff --git a/interfaces/tdescript/scriptmanager.h b/interfaces/tdescript/scriptmanager.h new file mode 100644 index 000000000..d21219901 --- /dev/null +++ b/interfaces/tdescript/scriptmanager.h @@ -0,0 +1,139 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Ian Reinhart Geiser (geiseri@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef __scriptmanager_h__ +#define __scriptmanager_h__ + +#include +#include +#include +#include +#include + +#include + +class ScriptInfo; +//namespace KScriptInterface +//{ + + /** + * This class is the base for all script engines. + * @author Ian Reinhart Geiser + * + **/ + class KDE_EXPORT KScriptManager : public TQObject, public KScriptClientInterface + { + Q_OBJECT + friend class KScriptInterface; + public: + /** + * Create a new instance of the script engine. + */ + KScriptManager(TQObject *parent, const char *name); + /** + * Destroy the current script engine. + */ + virtual ~KScriptManager(); + /** + * Add a new script instance to the script engine. + * This should be the full name and path to the desktop + * file. + */ + bool addScript( const TQString &scriptDesktopFile); + /** + * Remove a script instance from the script engine. + * @returns the success of the operation. + */ + bool removeScript( const TQString &scriptName ); + /** + * Access the names of script instances from the script engine. + * @returns a TQStringList of the current scripts. + */ + TQStringList scripts(); + /** + * Clear all script intstances in memory + */ + void clear(); + /** + * This function will allow the main application of any errors + * that have occurred during processing of the script. + */ + void error( const TQString &msg ) {emit scriptError(msg);} + /** + * This function will allow the main application of any warnings + * that have occurred during the processing of the script. + */ + void warning( const TQString &msg ) {emit scriptWarning(msg);} + /** + * This function will allow the main application of any normal + * output that has occurred during the processing of the script. + */ + void output( const TQString &msg ) {emit scriptOutput(msg);} + /** + * This function will allow feedback to any progress bars in the main + * application as to how far along the script is. This is very useful when + * a script is processing files or doing some long operation that is of a + * known duration. + */ + void progress( int percent ) {emit scriptProgress(percent);} + /** + * This function will allow feedback on completion of the script. + * It turns the result as a KScriptInteface::Result, and a return + * value as a QVariant + */ + void done( KScriptClientInterface::Result result, const TQVariant &returned ) {emit scriptDone(result, returned);} + + public slots: + /** + * Run the selected script + */ + void runScript( const TQString &scriptName, TQObject *context = 0, const TQVariant &arg = 0 ); + signals: + /** + * Send out a signal of the error message from the current running + * script. + */ + void scriptError( const TQString &msg ); + /** + * Send out a signal of the warning message from the current running + * script. + */ + void scriptWarning( const TQString &msg ); + /** + * Send out a signal of the output message from the current running + * script. + */ + void scriptOutput( const TQString &msg ); + /** + * Send out a signal of the progress of the current running + * script. + */ + void scriptProgress( int percent); + /** + * Send out a signal of the exit status of the script + * + */ + void scriptDone( KScriptClientInterface::Result result, const TQVariant &returned); + protected: + TQDict m_scripts; + TQDict m_scriptCache; + //TQStringList m_scriptNames; + TQString m_currentScript; + }; +//}; +#endif diff --git a/interfaces/tdetexteditor/.kateconfig b/interfaces/tdetexteditor/.kateconfig new file mode 100644 index 000000000..5b0885abe --- /dev/null +++ b/interfaces/tdetexteditor/.kateconfig @@ -0,0 +1 @@ +kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/interfaces/tdetexteditor/CMakeLists.txt b/interfaces/tdetexteditor/CMakeLists.txt new file mode 100644 index 000000000..a9d39edbb --- /dev/null +++ b/interfaces/tdetexteditor/CMakeLists.txt @@ -0,0 +1,96 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/kio + ${CMAKE_SOURCE_DIR}/kio/kio + ${CMAKE_SOURCE_DIR}/kabc + ${CMAKE_SOURCE_DIR}/interfaces +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + document.h view.h editor.h plugin.h editinterface.h + undointerface.h selectioninterface.h cursorinterface.h + clipboardinterface.h popupmenuinterface.h viewcursorinterface.h + searchinterface.h highlightinginterface.h blockselectioninterface.h + codecompletioninterface.h configinterface.h markinterface.h + printinterface.h wordwrapinterface.h dynwordwrapinterface.h + markinterfaceextension.h configinterfaceextension.h + encodinginterface.h viewstatusmsginterface.h + sessionconfiginterface.h editorchooser.h documentinfo.h + selectioninterfaceext.h selectionextdcopinterface.h + texthintinterface.h editinterfaceext.h variableinterface.h + templateinterface.h + DESTINATION ${INCLUDE_INSTALL_DIR}/tdetexteditor ) + + +##### other data ################################ + +install( FILES + tdetexteditor.desktop tdetexteditoreditor.desktop + tdetexteditorplugin.desktop + DESTINATION ${SERVICETYPES_INSTALL_DIR} ) + +install( FILES + kcm_tdetexteditor.desktop + DESTINATION ${DATA_INSTALL_DIR}/kcm_componentchooser ) + + + +##### tdetexteditor ############################### + +set( target tdetexteditor ) + +set( ${target}_SRCS + tdetexteditor.cpp + editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp + codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp + configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp + printinterface.cpp highlightinginterface.cpp markinterface.cpp + popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp + editdcopinterface.cpp editdcopinterface.skel clipboarddcopinterface.cpp + clipboarddcopinterface.skel selectiondcopinterface.cpp selectiondcopinterface.skel + searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp + configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp + viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp + blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp + blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp + encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel + undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp + viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp + viewstatusmsgdcopinterface.skel selectioninterfaceext.cpp selectionextdcopinterface.skel + texthintinterface.cpp editinterfaceext.cpp variableinterface.cpp templateinterface.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 0.0.0 + LINK tdeui-shared kabc-shared tdeparts-shared + DEPENDENCIES dcopidl dcopidl2cpp + DESTINATION ${LIB_INSTALL_DIR} +) diff --git a/interfaces/tdetexteditor/Makefile.am b/interfaces/tdetexteditor/Makefile.am new file mode 100644 index 000000000..5663bb761 --- /dev/null +++ b/interfaces/tdetexteditor/Makefile.am @@ -0,0 +1,52 @@ +INCLUDES = -I$(top_srcdir)/kio -I$(top_srcdir) -I$(top_srcdir)/interfaces -I$(top_builddir)/interfaces -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +lib_LTLIBRARIES = libtdetexteditor.la + +libtdetexteditor_la_SOURCES = tdetexteditor.cpp \ + editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp \ + codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp \ + configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp \ + printinterface.cpp highlightinginterface.cpp markinterface.cpp \ + popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp \ + editdcopinterface.cpp editdcopinterface.skel clipboarddcopinterface.cpp \ + clipboarddcopinterface.skel selectiondcopinterface.cpp selectiondcopinterface.skel \ + searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp \ + configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp \ + viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp \ + blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp\ + blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp \ + encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel \ + undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp \ + viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp \ + viewstatusmsgdcopinterface.skel selectioninterfaceext.cpp selectionextdcopinterface.skel \ + texthintinterface.cpp editinterfaceext.cpp variableinterface.cpp templateinterface.cpp + + +libtdetexteditor_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +libtdetexteditor_la_LIBADD = $(LIB_KPARTS) $(top_builddir)/dcop/libDCOP.la $(LIB_KABC) $(LIB_TDECORE) $(LIB_QT) $(LIB_KFILE) $(LIB_TDEUI) + +tdetexteditorinclude_HEADERS = document.h view.h editor.h plugin.h editinterface.h undointerface.h \ + selectioninterface.h cursorinterface.h \ + clipboardinterface.h popupmenuinterface.h \ + viewcursorinterface.h searchinterface.h highlightinginterface.h \ + blockselectioninterface.h codecompletioninterface.h \ + configinterface.h markinterface.h printinterface.h wordwrapinterface.h \ + dynwordwrapinterface.h markinterfaceextension.h configinterfaceextension.h \ + encodinginterface.h viewstatusmsginterface.h sessionconfiginterface.h editorchooser.h \ + documentinfo.h selectioninterfaceext.h selectionextdcopinterface.h texthintinterface.h \ + editinterfaceext.h variableinterface.h templateinterface.h + +tdetexteditorincludedir = $(includedir)/tdetexteditor + +METASOURCES = AUTO + +servicetypedir = $(kde_servicetypesdir) +servicetype_DATA = tdetexteditor.desktop tdetexteditoreditor.desktop tdetexteditorplugin.desktop + +kcm_tdetexteditor_DATA = kcm_tdetexteditor.desktop +kcm_tdetexteditordir = $(kde_datadir)/kcm_componentchooser + +templateinterface.lo: $(top_builddir)/kabc/addressee.h + +include ../../admin/Doxyfile.am + diff --git a/interfaces/tdetexteditor/blockselectiondcopinterface.cpp b/interfaces/tdetexteditor/blockselectiondcopinterface.cpp new file mode 100644 index 000000000..34b7294b2 --- /dev/null +++ b/interfaces/tdetexteditor/blockselectiondcopinterface.cpp @@ -0,0 +1,33 @@ +#include "blockselectiondcopinterface.h" +#include "blockselectioninterface.h" + +#include +using namespace KTextEditor; + +BlockSelectionDCOPInterface::BlockSelectionDCOPInterface( BlockSelectionInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +BlockSelectionDCOPInterface::~BlockSelectionDCOPInterface() +{ + +} + +uint BlockSelectionDCOPInterface::blockSelectionInterfaceNumber () +{ + return m_parent->blockSelectionInterfaceNumber(); +} +bool BlockSelectionDCOPInterface::blockSelectionMode () +{ + return m_parent->blockSelectionMode (); +} +bool BlockSelectionDCOPInterface::setBlockSelectionMode (bool on) +{ + return m_parent->setBlockSelectionMode (on); +} +bool BlockSelectionDCOPInterface::toggleBlockSelectionMode () +{ + return m_parent->toggleBlockSelectionMode (); +} diff --git a/interfaces/tdetexteditor/blockselectiondcopinterface.h b/interfaces/tdetexteditor/blockselectiondcopinterface.h new file mode 100644 index 000000000..4b74fd2a0 --- /dev/null +++ b/interfaces/tdetexteditor/blockselectiondcopinterface.h @@ -0,0 +1,60 @@ +#ifndef BlockSelection_DCOP_INTERFACE_H +#define BlockSelection_DCOP_INTERFACE_H + +#include +#include +#include +#include + +namespace KTextEditor +{ + class BlockSelectionInterface; + /** + This is the main interface to the BlockSelectionInterface of KTextEditor. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to BlockSelectionInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT BlockSelectionDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent BlockSelectionInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + BlockSelectionDCOPInterface( BlockSelectionInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~BlockSelectionDCOPInterface(); + k_dcop: + uint blockSelectionInterfaceNumber (); + + /** + * Returns the status of the selection mode - true indicates block selection mode is on. + * If this is true, selections applied via the SelectionInterface are handled as + * blockselections and the paste functions of the ClipboardInterface works on + * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;) + */ + bool blockSelectionMode (); + + /** + * set blockselection mode to state "on" + */ + bool setBlockSelectionMode (bool on) ; + + /** + * toggle blockseletion mode + */ + bool toggleBlockSelectionMode (); + + private: + BlockSelectionInterface *m_parent; + }; +} +#endif diff --git a/interfaces/tdetexteditor/blockselectioninterface.cpp b/interfaces/tdetexteditor/blockselectioninterface.cpp new file mode 100644 index 000000000..6d562a43e --- /dev/null +++ b/interfaces/tdetexteditor/blockselectioninterface.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "blockselectioninterface.h" +#include "blockselectiondcopinterface.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivateBlockSelectionInterface +{ + public: + PrivateBlockSelectionInterface() {interface = 0;} + ~PrivateBlockSelectionInterface() {} + BlockSelectionDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int BlockSelectionInterface::globalBlockSelectionInterfaceNumber = 0; + +BlockSelectionInterface::BlockSelectionInterface() +{ + globalBlockSelectionInterfaceNumber++; + myBlockSelectionInterfaceNumber = globalBlockSelectionInterfaceNumber++; + TQString name = "BlockSelectionInterface#" + TQString::number(myBlockSelectionInterfaceNumber); + + d = new PrivateBlockSelectionInterface(); + d->interface = new BlockSelectionDCOPInterface(this, name.latin1()); +} + +BlockSelectionInterface::~BlockSelectionInterface() +{ + delete d->interface; + delete d; +} + +unsigned int BlockSelectionInterface::blockSelectionInterfaceNumber () const +{ + return myBlockSelectionInterfaceNumber; +} + +void BlockSelectionInterface::setBlockSelectionInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("BlockSelectionInterface#"+suffix); +} + +BlockSelectionInterface *KTextEditor::blockSelectionInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/blockselectioninterface.h b/interfaces/tdetexteditor/blockselectioninterface.h new file mode 100644 index 000000000..b2cd785eb --- /dev/null +++ b/interfaces/tdetexteditor/blockselectioninterface.h @@ -0,0 +1,82 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_blockselectioninterface_h__ +#define __tdetexteditor_blockselectioninterface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** + * An interface for the Document class which allows the selection + * method to be changed between selecting rectangular blocks of text and normal mode + * (all text between the start cursor and the current cursor). + */ +class KTEXTEDITOR_EXPORT BlockSelectionInterface +{ + friend class PrivateBlockSelectionInterface; + + public: + BlockSelectionInterface (); + virtual ~BlockSelectionInterface (); + + unsigned int blockSelectionInterfaceNumber () const; + + protected: + void setBlockSelectionInterfaceDCOPSuffix (const TQCString &suffix); + + /** + * slots !!! + */ + public: + /** + * Returns the status of the selection mode - true indicates block selection mode is on. + * If this is true, selections applied via the SelectionInterface are handled as + * blockselections and the paste functions of the ClipboardInterface works on + * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;) + */ + virtual bool blockSelectionMode () = 0; + + /** + * Set block selection mode to state "on" + */ + virtual bool setBlockSelectionMode (bool on) = 0; + + /** + * toggle block seletion mode + */ + virtual bool toggleBlockSelectionMode () = 0; + + private: + class PrivateBlockSelectionInterface *d; + static unsigned int globalBlockSelectionInterfaceNumber; + unsigned int myBlockSelectionInterfaceNumber; +}; + +/** + * Access the block selection interface of document @param doc + */ +KTEXTEDITOR_EXPORT BlockSelectionInterface *blockSelectionInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/clipboarddcopinterface.cpp b/interfaces/tdetexteditor/clipboarddcopinterface.cpp new file mode 100644 index 000000000..334046ee5 --- /dev/null +++ b/interfaces/tdetexteditor/clipboarddcopinterface.cpp @@ -0,0 +1,40 @@ +#include "clipboarddcopinterface.h" +#include "clipboardinterface.h" + +#include +using namespace KTextEditor; + +ClipboardDCOPInterface::ClipboardDCOPInterface( ClipboardInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +ClipboardDCOPInterface::~ClipboardDCOPInterface() +{ + +} + + /** + * Copies selected text. + */ + void ClipboardDCOPInterface::copy ( ) + { + m_parent->copy(); + } + + /** + * Cuts selected text. + */ + void ClipboardDCOPInterface::cut ( ) + { + m_parent->cut(); + } + + /** + * Pastes text from clipboard. + */ + void ClipboardDCOPInterface::paste ( ) + { + m_parent->paste(); + } diff --git a/interfaces/tdetexteditor/clipboarddcopinterface.h b/interfaces/tdetexteditor/clipboarddcopinterface.h new file mode 100644 index 000000000..8104e9d4d --- /dev/null +++ b/interfaces/tdetexteditor/clipboarddcopinterface.h @@ -0,0 +1,54 @@ +#ifndef Clipboard_DCOP_INTERFACE_H +#define Clipboard_DCOP_INTERFACE_H + +#include +#include +#include +#include + +namespace KTextEditor +{ + class ClipboardInterface; + /** + This is the main interface to the ClipboardInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to ClipboardInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT ClipboardDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent ClipboardInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + ClipboardDCOPInterface( ClipboardInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~ClipboardDCOPInterface(); + k_dcop: + /** + * copies selected text + */ + void copy ( ); + /** + * cuts selected text + */ + void cut ( ); + /** + * pastes selected text + */ + void paste ( ); + private: + ClipboardInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/clipboardinterface.cpp b/interfaces/tdetexteditor/clipboardinterface.cpp new file mode 100644 index 000000000..89f92d089 --- /dev/null +++ b/interfaces/tdetexteditor/clipboardinterface.cpp @@ -0,0 +1,56 @@ +#include "clipboardinterface.h" +#include "clipboarddcopinterface.h" + +#include "view.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateClipboardInterface + { + public: + PrivateClipboardInterface() + { + interface = 0; + } + ~PrivateClipboardInterface(){} + // Data Members + ClipboardDCOPInterface *interface; + }; + +} + +unsigned int ClipboardInterface::globalClipboardInterfaceNumber = 0; + +ClipboardInterface::ClipboardInterface() +{ + d = new PrivateClipboardInterface(); + globalClipboardInterfaceNumber++; + myClipboardInterfaceNumber = globalClipboardInterfaceNumber++; + TQString name = "ClipboardInterface#" + TQString::number(myClipboardInterfaceNumber); + d->interface = new ClipboardDCOPInterface(this, name.latin1()); +} +ClipboardInterface::~ClipboardInterface() +{ + delete d->interface; + delete d; +} + +unsigned int ClipboardInterface::clipboardInterfaceNumber () const +{ + return myClipboardInterfaceNumber; +} + +void ClipboardInterface::setClipboardInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("ClipboardInterface#"+suffix); +} + +ClipboardInterface *KTextEditor::clipboardInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} diff --git a/interfaces/tdetexteditor/clipboardinterface.h b/interfaces/tdetexteditor/clipboardinterface.h new file mode 100644 index 000000000..8eeeb77ba --- /dev/null +++ b/interfaces/tdetexteditor/clipboardinterface.h @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_clipboardinterface_h__ +#define __tdetexteditor_clipboardinterface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface for accessing the clipboard through the View class. +*/ +class KTEXTEDITOR_EXPORT ClipboardInterface +{ + friend class PrivateClipboardInterface; + + public: + ClipboardInterface(); + virtual ~ClipboardInterface(); + + unsigned int clipboardInterfaceNumber () const; + + protected: + void setClipboardInterfaceDCOPSuffix (const TQCString &suffix); + + /** + * slots !!! + */ + public: + /** + * copies selected text + */ + virtual void copy ( ) const = 0; + + /** + * copies selected text + */ + virtual void cut ( ) = 0; + + /** + * copies selected text + */ + virtual void paste ( ) = 0; + + private: + class PrivateClipboardInterface *d; + static unsigned int globalClipboardInterfaceNumber; + unsigned int myClipboardInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT ClipboardInterface *clipboardInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/codecompletioninterface.cpp b/interfaces/tdetexteditor/codecompletioninterface.cpp new file mode 100644 index 000000000..416dd593a --- /dev/null +++ b/interfaces/tdetexteditor/codecompletioninterface.cpp @@ -0,0 +1,51 @@ + +#include "codecompletioninterface.h" +#include "view.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateCodeCompletionInterface + { + public: + PrivateCodeCompletionInterface() {} + ~PrivateCodeCompletionInterface(){} + + }; +} + +unsigned int CodeCompletionInterface::globalCodeCompletionInterfaceNumber = 0; + +CodeCompletionInterface::CodeCompletionInterface() +{ + globalCodeCompletionInterfaceNumber++; + myCodeCompletionInterfaceNumber = globalCodeCompletionInterfaceNumber++; + + d = new PrivateCodeCompletionInterface(); +} + +CodeCompletionInterface::~CodeCompletionInterface() +{ + delete d; +} + +unsigned int CodeCompletionInterface::codeCompletionInterfaceNumber () const +{ + return myCodeCompletionInterfaceNumber; +} + +void CodeCompletionInterface::setCodeCompletionInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("CodeCompletionInterface#"+suffix); +} + +CodeCompletionInterface *KTextEditor::codeCompletionInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} + + diff --git a/interfaces/tdetexteditor/codecompletioninterface.h b/interfaces/tdetexteditor/codecompletioninterface.h new file mode 100644 index 000000000..4f726578f --- /dev/null +++ b/interfaces/tdetexteditor/codecompletioninterface.h @@ -0,0 +1,202 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_codecompletioninterface_h__ +#define __tdetexteditor_codecompletioninterface_h__ + +#include +#include + +#include + +namespace KTextEditor +{ + +/** + * An item for the completion popup. text is the completed string, + * prefix appears in front of it, suffix appears after it. + * type does not appear in the completion list. + * prefix, suffix, and type are not part of the + * inserted text if a completion takes place. comment appears in a tooltip right of + * the completion list for the currently selected item. userdata can be + * free formed data, which the user of this interface can use in + * CodeCompletionInterface::filterInsertString(). + * + * + */ +class KTEXTEDITOR_EXPORT CompletionEntry +{ + public: + TQString type; + TQString text; + TQString prefix; + TQString postfix; + TQString comment; + + TQString userdata; + + bool operator==( const CompletionEntry &c ) const { + return ( c.type == type && + c.text == text && + c.postfix == postfix && + c.prefix == prefix && + c.comment == comment && + c.userdata == userdata); + } +}; + +/** + * This is an interface for the KTextEditor::View class. It can be used + * to show completion lists, i.e. lists that pop up while a user is typing. + * The user can then choose from the list or he can just keep typing. The + * completion list will disappear if an item is chosen, if no completion + * is available or if the user presses Esc etc. The contents of the list + * is automatically adapted to the string the user types. + * + * There are other signals, which may be implmemented, but aren't documented here, because + * it would have been a BIC change...: + * + * void completionExtendedComment(CompletionEntry) + * + * This is emitted when the user has completed the argument entry (ie. enters the wrapping symbol(s) + * void argHintCompleted() + * + * This is emitted when there is a reason other than completion for the hint being hidden. + * void argHintAborted() + * + * This is emitted when a code completion box is about to be displayed + * void aboutToShowCompletionBox() + * + */ +class KTEXTEDITOR_EXPORT CodeCompletionInterface +{ + friend class PrivateCodeCompletionInterface; + + public: + CodeCompletionInterface(); + virtual ~CodeCompletionInterface(); + + unsigned int codeCompletionInterfaceNumber () const; + + protected: + void setCodeCompletionInterfaceDCOPSuffix (const TQCString &suffix); + + + public: + // + // slots !!! + // + /** + * This shows an argument hint. + */ + virtual void showArgHint (TQStringList functionList, const TQString& strWrapping, const TQString& strDelimiter) = 0; + + /** + * This shows a completion list. @p offset is the real start of the text that + * should be completed. 0 means that the text starts at the current cursor + * position. if @p casesensitive is @p true, the popup will only contain completions + * that match the input text regarding case. + */ + virtual void showCompletionBox (TQValueList complList,int offset=0, bool casesensitive=true)=0; + + // + // signals !!! + // + public: + + + /** + * This signal is emitted when the completion list disappears and no completion has + * been done. This is the case e.g. when the user presses Escape. + * + * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback + * when the implementation doesn't support it + * + * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited + * function, if you support it, declare it as a signal + */ + virtual void completionAborted()=0; + + /** + * This signal is emitted when the completion list disappears and a completion has + * been inserted into text. This is the case e.g. when the user presses Return + * on a selected item in the completion list. + * + * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback + * when the implementation doesn't support it + * + * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited + * function, if you support it, declare it as a signal + */ + virtual void completionDone()=0; + + /** + * This signal is the same as completionDone(), but additionally it carries + * the information which completion item was used. + * + * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback + * when the implementation doesn't support it + * + * IMPORTANT: The pointer to the CompleteionEntry, is only valid in the slots connected to this signal + * when the connected slots are left, the data element may be destroyed, depending on the implementation + * + * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited + * function, if you support it, declare it as a signal. + * + */ + virtual void completionDone(CompletionEntry)=0; + + /** + * This signal is emitted when the argument hint disappears. + * This is the case e.g. when the user moves the cursor somewhere else. + * + * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback + * when the implementation doesn't support it + * + * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited + * function, if you support it, declare it as a signal + */ + virtual void argHintHidden()=0; + + /** + * This signal is emitted just before a completion takes place. + * You can use it to modify the CompletionEntry. The modified + * entry will not be visible in the completion list (because that has + * just disappeared) but it will be used when the completion is + * inserted into the text. + * + * IMPORTANT: Please check if a connect to this signal worked, and implement some fallback + * when the implementation doesn't support it + * + * IMPORTANT FOR IMPLEMENTERS: When you don't support this signal, please just override the inherited + * function, if you support it, declare it as a signal + */ + virtual void filterInsertString(CompletionEntry*,TQString*)=0; + + + private: + class PrivateCodeCompletionInterface *d; + static unsigned int globalCodeCompletionInterfaceNumber; + unsigned int myCodeCompletionInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT CodeCompletionInterface *codeCompletionInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/configinterface.cpp b/interfaces/tdetexteditor/configinterface.cpp new file mode 100644 index 000000000..63bf086e0 --- /dev/null +++ b/interfaces/tdetexteditor/configinterface.cpp @@ -0,0 +1,79 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "configinterface.h" + +#include "document.h" +#include "plugin.h" + +namespace KTextEditor +{ + +class PrivateConfigInterface +{ + public: + PrivateConfigInterface() {} + ~PrivateConfigInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int ConfigInterface::globalConfigInterfaceNumber = 0; + +ConfigInterface::ConfigInterface() +{ + globalConfigInterfaceNumber++; + myConfigInterfaceNumber = globalConfigInterfaceNumber++; + + d = new PrivateConfigInterface(); +} + +ConfigInterface::~ConfigInterface() +{ + delete d; +} + +unsigned int ConfigInterface::configInterfaceNumber () const +{ + return myConfigInterfaceNumber; +} + +void ConfigInterface::setConfigInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("ConfigInterface#"+suffix); +} + +ConfigInterface *KTextEditor::configInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + +ConfigInterface *KTextEditor::configInterface (Plugin *plugin) +{ + if (!plugin) + return 0; + + return dynamic_cast(plugin); +} diff --git a/interfaces/tdetexteditor/configinterface.h b/interfaces/tdetexteditor/configinterface.h new file mode 100644 index 000000000..ed6a80d81 --- /dev/null +++ b/interfaces/tdetexteditor/configinterface.h @@ -0,0 +1,93 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_configinterface_h__ +#define __tdetexteditor_configinterface_h__ + +#include + +class TQCString; +class TDEConfig; + +namespace KTextEditor +{ + +/** +* This is an interface for accessing the configuration of the +* Document and Plugin classes. +*/ +class KTEXTEDITOR_EXPORT ConfigInterface +{ + friend class PrivateConfigInterface; + + public: + ConfigInterface(); + virtual ~ConfigInterface(); + + unsigned int configInterfaceNumber () const; + + protected: + void setConfigInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + /** + Read/Write the config to the standard place where this editor + part saves it config, say: read/save default values for that + editor part, which means for all current open documents + */ + virtual void readConfig () = 0; + virtual void writeConfig () = 0; + + /** + Read/Write the config of the part to a given kconfig object + to store the settings in a different place than the standard + */ + virtual void readConfig (TDEConfig *) = 0; + virtual void writeConfig (TDEConfig *) = 0; + + /** + Read/Write session config of only this document/view/plugin + */ + virtual void readSessionConfig (TDEConfig *) = 0; + virtual void writeSessionConfig (TDEConfig *) = 0; + + /** + Shows a config dialog for the part, changes will be applied + to the part, but not saved anywhere automagically, call + writeConfig to save it + */ + virtual void configDialog () = 0; + + private: + class PrivateConfigInterface *d; + static unsigned int globalConfigInterfaceNumber; + unsigned int myConfigInterfaceNumber; +}; + +class Plugin; +class Document; + +KTEXTEDITOR_EXPORT ConfigInterface *configInterface (Document *doc); +KTEXTEDITOR_EXPORT ConfigInterface *configInterface (Plugin *plugin); + +} + +#endif diff --git a/interfaces/tdetexteditor/configinterfaceextension.cpp b/interfaces/tdetexteditor/configinterfaceextension.cpp new file mode 100644 index 000000000..460d930a4 --- /dev/null +++ b/interfaces/tdetexteditor/configinterfaceextension.cpp @@ -0,0 +1,84 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "configinterfaceextension.h" +#include "configinterfaceextension.moc" + +#include "document.h" +#include "plugin.h" + +namespace KTextEditor +{ + +class PrivateConfigInterfaceExtension +{ + public: + PrivateConfigInterfaceExtension() {} + ~PrivateConfigInterfaceExtension() {} +}; + +} + +using namespace KTextEditor; + +ConfigPage::ConfigPage ( TQWidget *parent, const char *name ) : TQWidget (parent, name) { ; } + +ConfigPage::~ConfigPage () { ; } + +unsigned int ConfigInterfaceExtension::globalConfigInterfaceExtensionNumber = 0; + +ConfigInterfaceExtension::ConfigInterfaceExtension() +{ + globalConfigInterfaceExtensionNumber++; + myConfigInterfaceExtensionNumber = globalConfigInterfaceExtensionNumber++; + + d = new PrivateConfigInterfaceExtension(); +} + +ConfigInterfaceExtension::~ConfigInterfaceExtension() +{ + delete d; +} + +unsigned int ConfigInterfaceExtension::configInterfaceExtensionNumber () const +{ + return myConfigInterfaceExtensionNumber; +} + +void ConfigInterfaceExtension::setConfigInterfaceExtensionDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("ConfigInterfaceExtension#"+suffix); +} + +ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + +ConfigInterfaceExtension *KTextEditor::configInterfaceExtension (Plugin *plugin) +{ + if (!plugin) + return 0; + + return dynamic_cast(plugin); +} diff --git a/interfaces/tdetexteditor/configinterfaceextension.h b/interfaces/tdetexteditor/configinterfaceextension.h new file mode 100644 index 000000000..d139ba696 --- /dev/null +++ b/interfaces/tdetexteditor/configinterfaceextension.h @@ -0,0 +1,116 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_configinterfaceextension_h__ +#define __tdetexteditor_configinterfaceextension_h__ + +#include +#include +#include + +namespace KTextEditor +{ + +class KTEXTEDITOR_EXPORT ConfigPage : public TQWidget +{ + Q_OBJECT + + public: + ConfigPage ( TQWidget *parent=0, const char *name=0 ); + virtual ~ConfigPage (); + + // + // slots !!! + // + public: + /** + Applies the changes to all documents + */ + virtual void apply () = 0; + + /** + Reset the changes + */ + virtual void reset () = 0; + + /** + Sets default options + */ + virtual void defaults () = 0; + + signals: + /** + Emitted when something changes + */ + void changed(); +}; + +/** +* This is an interface to extend the configuration of the +* Document, Plugin and PluginViewInterface classes. +*/ +class KTEXTEDITOR_EXPORT ConfigInterfaceExtension +{ + friend class PrivateConfigInterfaceExtension; + + public: + ConfigInterfaceExtension(); + virtual ~ConfigInterfaceExtension(); + + unsigned int configInterfaceExtensionNumber () const; + + protected: + void setConfigInterfaceExtensionDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + /** + Number of available config pages + */ + virtual uint configPages () const = 0; + + /** + returns config page with the given number, + config pages from 0 to configPages()-1 are available + if configPages() > 0 + */ + virtual ConfigPage *configPage (uint number = 0, TQWidget *parent = 0, const char *name=0 ) = 0; + + virtual TQString configPageName (uint number = 0) const = 0; + virtual TQString configPageFullName (uint number = 0) const = 0; + virtual TQPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const = 0; + + + private: + class PrivateConfigInterfaceExtension *d; + static unsigned int globalConfigInterfaceExtensionNumber; + unsigned int myConfigInterfaceExtensionNumber; +}; + +class Document; +class Plugin; +class ViewPlugin; + +KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Document *doc); +KTEXTEDITOR_EXPORT ConfigInterfaceExtension *configInterfaceExtension (Plugin *plugin); + +} + +#endif diff --git a/interfaces/tdetexteditor/cursorinterface.cpp b/interfaces/tdetexteditor/cursorinterface.cpp new file mode 100644 index 000000000..96d00290e --- /dev/null +++ b/interfaces/tdetexteditor/cursorinterface.cpp @@ -0,0 +1,69 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "cursorinterface.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivateCursorInterface +{ + public: + PrivateCursorInterface() {} + ~PrivateCursorInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int CursorInterface::globalCursorInterfaceNumber = 0; + +CursorInterface::CursorInterface() +{ + globalCursorInterfaceNumber++; + myCursorInterfaceNumber = globalCursorInterfaceNumber++; + + d = new PrivateCursorInterface(); +} + +CursorInterface::~CursorInterface() +{ + delete d; +} + +unsigned int CursorInterface::cursorInterfaceNumber () const +{ + return myCursorInterfaceNumber; +} + +void CursorInterface::setCursorInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("CursorInterface#"+suffix); +} + +CursorInterface *KTextEditor::cursorInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/cursorinterface.h b/interfaces/tdetexteditor/cursorinterface.h new file mode 100644 index 000000000..e31d33395 --- /dev/null +++ b/interfaces/tdetexteditor/cursorinterface.h @@ -0,0 +1,84 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_cursorinterface_h__ +#define __tdetexteditor_cursorinterface_h__ + +#include +#include + +#include + +namespace KTextEditor +{ + +/** + * This class represents a text cursor. + */ +class KTEXTEDITOR_EXPORT Cursor +{ + public: + virtual void position ( unsigned int *line, unsigned int *col ) const = 0; + + virtual bool setPosition ( unsigned int line, unsigned int col ) = 0; + + virtual bool insertText ( const TQString& text ) = 0; + + virtual bool removeText ( unsigned int numberOfCharacters ) = 0; + + virtual TQChar currentChar () const = 0; +}; + +/** +* This is an interface for accessing the cursor of the Document class. +*/ +class KTEXTEDITOR_EXPORT CursorInterface +{ + friend class PrivateCursorInterface; + + public: + CursorInterface (); + virtual ~CursorInterface (); + + unsigned int cursorInterfaceNumber () const; + + protected: + void setCursorInterfaceDCOPSuffix (const TQCString &suffix); + + public: + /** + * Create a new cursor object + */ + virtual Cursor *createCursor ( ) = 0; + + /* + * Accessor to the list of cursors. + */ + virtual TQPtrList cursors () const = 0; + + private: + class PrivateCursorInterface *d; + static unsigned int globalCursorInterfaceNumber; + unsigned int myCursorInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT CursorInterface *cursorInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/document.h b/interfaces/tdetexteditor/document.h new file mode 100644 index 000000000..83d8b7cf6 --- /dev/null +++ b/interfaces/tdetexteditor/document.h @@ -0,0 +1,85 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_document_h__ +#define __tdetexteditor_document_h__ + +#include "editor.h" + +namespace KTextEditor +{ + +/** + * The main class representing a text document. + * This class provides access to the document's views. + */ +class KTEXTEDITOR_EXPORT Document : public KTextEditor::Editor +{ + friend class PrivateDocument; + + Q_OBJECT + + + public: + Document ( TQObject *parent = 0, const char *name = 0 ); + virtual ~Document (); + + /** + * Returns the global number of this document in your app. + */ + unsigned int documentNumber () const; + + /** + * Returns this document's DCOP suffix for identifiying its DCOP interface. + */ + TQCString documentDCOPSuffix () const; + + /** + * Create a view that will display the document data. You can create as many + * views as you like. When the user modifies data in one view then all other + * views will be updated as well. + */ + virtual class View *createView ( TQWidget *parent, const char *name = 0 ) = 0; + + /* + * Returns a list of all views of this document. + */ + virtual TQPtrList views () const = 0; + + /** + * Returns the list position of this document in your app, if applicable. + */ + long documentListPosition () const; + + /** + * Sets the list position of this document in your app, if applicable. + */ + void setDocumentListPosition (long pos); + + private: + class PrivateDocument *d; + static unsigned int globalDocumentNumber; + unsigned int myDocumentNumber; + long myDocumentListPosition; +}; + +KTEXTEDITOR_EXPORT Document *createDocument ( const char* libname, TQObject *parent = 0, const char *name = 0 ); + +} + +#endif diff --git a/interfaces/tdetexteditor/documentdcopinfo.cpp b/interfaces/tdetexteditor/documentdcopinfo.cpp new file mode 100644 index 000000000..b339d01cd --- /dev/null +++ b/interfaces/tdetexteditor/documentdcopinfo.cpp @@ -0,0 +1,33 @@ +#include "documentinfo.h" +#include "documentdcopinfo.h" + +#include +using namespace KTextEditor; + +DocumentInfoDCOPInterface::DocumentInfoDCOPInterface( DocumentInfoInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +DocumentInfoDCOPInterface::~DocumentInfoDCOPInterface() +{ + +} + +TQString DocumentInfoDCOPInterface::mimeType() +{ + return m_parent->mimeType(); +} +long DocumentInfoDCOPInterface::fileSize() +{ + return m_parent->fileSize(); +} +TQString DocumentInfoDCOPInterface::niceFileSize() +{ + return m_parent->niceFileSize(); +} +uint DocumentInfoDCOPInterface::documentInfoInterfaceNumber () +{ + return m_parent->documentInfoInterfaceNumber (); +} diff --git a/interfaces/tdetexteditor/documentdcopinfo.h b/interfaces/tdetexteditor/documentdcopinfo.h new file mode 100644 index 000000000..ea25284fe --- /dev/null +++ b/interfaces/tdetexteditor/documentdcopinfo.h @@ -0,0 +1,47 @@ +#ifndef DocumentInfo_DCOP_INTERFACE_H +#define DocumentInfo_DCOP_INTERFACE_H + +#include +#include +#include +#include + +namespace KTextEditor +{ + class DocumentInfoInterface; + /** + This is the main interface to the DocumentInfoInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to DocumentInfoInterface. + @author Ian Reinhart Geiser + */ + + class KTEXTEDITOR_EXPORT DocumentInfoDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent DocumentInfoInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + DocumentInfoDCOPInterface( DocumentInfoInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~DocumentInfoDCOPInterface(); + k_dcop: + TQString mimeType(); + long fileSize(); + TQString niceFileSize(); + uint documentInfoInterfaceNumber (); + private: + DocumentInfoInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/documentinfo.cpp b/interfaces/tdetexteditor/documentinfo.cpp new file mode 100644 index 000000000..c675bfb5f --- /dev/null +++ b/interfaces/tdetexteditor/documentinfo.cpp @@ -0,0 +1,65 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "documentinfo.h" +#include "documentdcopinfo.h" + +namespace KTextEditor +{ + +class PrivateDocumentInfoInterface +{ + public: + PrivateDocumentInfoInterface() {interface = 0;} + ~PrivateDocumentInfoInterface() {} + DocumentInfoDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int DocumentInfoInterface::globalDocumentInfoInterfaceNumber = 0; + +DocumentInfoInterface::DocumentInfoInterface() +{ + globalDocumentInfoInterfaceNumber++; + myDocumentInfoInterfaceNumber = globalDocumentInfoInterfaceNumber++; + + d = new PrivateDocumentInfoInterface(); + TQString name = "DocumentInterface#" + TQString::number(myDocumentInfoInterfaceNumber); + d->interface = new DocumentInfoDCOPInterface(this, name.latin1()); +} + +DocumentInfoInterface::~DocumentInfoInterface() +{ + delete d->interface; + delete d; +} + +unsigned int DocumentInfoInterface::documentInfoInterfaceNumber () const +{ + return myDocumentInfoInterfaceNumber; +} + +void DocumentInfoInterface::setDocumentInfoInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("DocumentInfoInterface#"+suffix); +} diff --git a/interfaces/tdetexteditor/documentinfo.h b/interfaces/tdetexteditor/documentinfo.h new file mode 100644 index 000000000..46a19bfd5 --- /dev/null +++ b/interfaces/tdetexteditor/documentinfo.h @@ -0,0 +1,60 @@ +/* This file is part of the KDE libraries + Copyright (C) 2002 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_documentinfointerface_h__ +#define __tdetexteditor_documentinfointerface_h__ + +class TQString; +class TQCString; + +#include + +namespace KTextEditor +{ + +/** + * This is an interface for accessing information about files open + * in the Document, Plugin and PluginViewInterface classes. + */ +class KTEXTEDITOR_EXPORT DocumentInfoInterface +{ + friend class PrivateDocumentInterface; + + public: + DocumentInfoInterface(); + virtual ~DocumentInfoInterface(); + + virtual TQString mimeType()=0; + virtual long fileSize()=0; + virtual TQString niceFileSize()=0; + + unsigned int documentInfoInterfaceNumber () const; + + protected: + void setDocumentInfoInterfaceDCOPSuffix (const TQCString &suffix); + + private: + class PrivateDocumentInfoInterface *d; + static unsigned int globalDocumentInfoInterfaceNumber; + unsigned int myDocumentInfoInterfaceNumber; +}; + + +} + +#endif diff --git a/interfaces/tdetexteditor/dynwordwrapinterface.cpp b/interfaces/tdetexteditor/dynwordwrapinterface.cpp new file mode 100644 index 000000000..9c1da6d4b --- /dev/null +++ b/interfaces/tdetexteditor/dynwordwrapinterface.cpp @@ -0,0 +1,69 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "dynwordwrapinterface.h" +#include "view.h" + +namespace KTextEditor +{ + +class PrivateDynWordWrapInterface +{ + public: + PrivateDynWordWrapInterface() {} + ~PrivateDynWordWrapInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int DynWordWrapInterface::globalDynWordWrapInterfaceNumber = 0; + +DynWordWrapInterface::DynWordWrapInterface() +{ + globalDynWordWrapInterfaceNumber++; + myDynWordWrapInterfaceNumber = globalDynWordWrapInterfaceNumber++; + + d = new PrivateDynWordWrapInterface(); +} + +DynWordWrapInterface::~DynWordWrapInterface() +{ + delete d; +} + +unsigned int DynWordWrapInterface::dynWordWrapInterfaceNumber () const +{ + return myDynWordWrapInterfaceNumber; +} + +void DynWordWrapInterface::setDynWordWrapInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("DynWordWrapInterface#"+suffix); +} + +DynWordWrapInterface *KTextEditor::dynWordWrapInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} diff --git a/interfaces/tdetexteditor/dynwordwrapinterface.h b/interfaces/tdetexteditor/dynwordwrapinterface.h new file mode 100644 index 000000000..9a6ce116b --- /dev/null +++ b/interfaces/tdetexteditor/dynwordwrapinterface.h @@ -0,0 +1,64 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_dynwordwrapinterface_h__ +#define __tdetexteditor_dynwordwrapinterface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** + * This is an interface for accessing dynamic word wrapping functionality + * of the View class. + */ +class KTEXTEDITOR_EXPORT DynWordWrapInterface +{ + friend class PrivateDynWordWrapInterface; + + public: + DynWordWrapInterface (); + virtual ~DynWordWrapInterface (); + + unsigned int dynWordWrapInterfaceNumber () const; + + protected: + void setDynWordWrapInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + virtual void setDynWordWrap (bool) = 0; + virtual bool dynWordWrap () const = 0; + + private: + class PrivateDynWordWrapInterface *d; + static unsigned int globalDynWordWrapInterfaceNumber; + unsigned int myDynWordWrapInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT DynWordWrapInterface *dynWordWrapInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/editdcopinterface.cpp b/interfaces/tdetexteditor/editdcopinterface.cpp new file mode 100644 index 000000000..6130ccd14 --- /dev/null +++ b/interfaces/tdetexteditor/editdcopinterface.cpp @@ -0,0 +1,61 @@ +#include "editdcopinterface.h" +#include "editinterface.h" + +#include +using namespace KTextEditor; + +EditDCOPInterface::EditDCOPInterface( EditInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +EditDCOPInterface::~EditDCOPInterface() +{ + +} + +TQString EditDCOPInterface::text () +{ + return m_parent->text(); +} + +TQString EditDCOPInterface::textLine ( uint line ) +{ + return m_parent->textLine(line); +} + +int EditDCOPInterface::numLines () +{ + return m_parent->numLines(); +} + +int EditDCOPInterface::length () +{ + return m_parent->length(); +} + +void EditDCOPInterface::setText ( const TQString &text ) +{ + m_parent->setText(text); +} + +bool EditDCOPInterface::insertText ( uint line, uint col, const TQString &text ) +{ + return m_parent->insertText( line, col, text); +} + +bool EditDCOPInterface::removeText ( uint startLine, uint startCol, uint endLine, uint endCol ) +{ + return m_parent->removeText( startLine, startCol, endLine, endCol); +} + +bool EditDCOPInterface::insertLine ( uint line, const TQString &text ) +{ + return m_parent->insertLine( line, text); +} + +bool EditDCOPInterface::removeLine ( uint line ) +{ + return m_parent->removeLine( line ); +} diff --git a/interfaces/tdetexteditor/editdcopinterface.h b/interfaces/tdetexteditor/editdcopinterface.h new file mode 100644 index 000000000..f169fb15b --- /dev/null +++ b/interfaces/tdetexteditor/editdcopinterface.h @@ -0,0 +1,90 @@ +#ifndef EDIT_DCOP_INTERFACE_H +#define EDIT_DCOP_INTERFACE_H + +#include +#include +#include +#include +//#include "editdcopinterface.moc" +namespace KTextEditor +{ + class EditInterface; + /** + This is the main interface to the EditInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to EditInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT EditDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent EditInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + EditDCOPInterface( EditInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + **/ + virtual ~EditDCOPInterface(); + k_dcop: + /** + * @return the complete document as a single QString + */ + virtual TQString text (); + + /** + * @return All the text from the requested line. + */ + virtual TQString textLine ( uint line ); + + /** + * @return The current number of lines in the document + */ + virtual int numLines (); + + /** + * @return the number of characters in the document + */ + virtual int length (); + + /** + * Set the given text into the view. + * Warning: This will overwrite any data currently held in this view. + */ + virtual void setText (const TQString &text ); + + /** + * Inserts text at line "line", column "col" + * returns true if success + */ + virtual bool insertText ( uint line, uint col, const TQString &text ); + + /** + * remove text at line "line", column "col" + * returns true if success + */ + virtual bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol) ; + + /** + * Insert line(s) at the given line number. + */ + virtual bool insertLine ( uint line, const TQString &text ); + + /** + * Insert line(s) at the given line number. + * If only one line is in the current document, removeLine will fail (return false) + */ + virtual bool removeLine ( uint line ); + private: + EditInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/editinterface.cpp b/interfaces/tdetexteditor/editinterface.cpp new file mode 100644 index 000000000..cfa0b67bc --- /dev/null +++ b/interfaces/tdetexteditor/editinterface.cpp @@ -0,0 +1,57 @@ +#include "editinterface.h" +#include "editdcopinterface.h" +#include "document.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateEditInterface + { + public: + PrivateEditInterface() + { + interface = 0; + } + ~PrivateEditInterface(){} + // Data Members + EditDCOPInterface *interface; + }; + +} + +uint EditInterface::globalEditInterfaceNumber = 0; + +EditInterface::EditInterface() +{ + d = new PrivateEditInterface(); + globalEditInterfaceNumber++; + myEditInterfaceNumber = globalEditInterfaceNumber; + TQString name = "EditInterface#" + TQString::number(myEditInterfaceNumber); + d->interface = new EditDCOPInterface(this, name.latin1()); +} + +EditInterface::~EditInterface() +{ + delete d->interface; + delete d; +} + +uint EditInterface::editInterfaceNumber () const +{ + return myEditInterfaceNumber; +} + +void EditInterface::setEditInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("EditInterface#"+suffix); +} + +EditInterface *KTextEditor::editInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + diff --git a/interfaces/tdetexteditor/editinterface.h b/interfaces/tdetexteditor/editinterface.h new file mode 100644 index 000000000..05e4941f2 --- /dev/null +++ b/interfaces/tdetexteditor/editinterface.h @@ -0,0 +1,137 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_editinterface_h__ +#define __tdetexteditor_editinterface_h__ + +#include + +#include + +namespace KTextEditor +{ + +/** +* This is the main interface for accessing and modifying +* text of the Document class. +*/ +class KTEXTEDITOR_EXPORT EditInterface +{ + friend class PrivateEditInterface; + + public: + EditInterface(); + virtual ~EditInterface(); + + uint editInterfaceNumber () const; + + protected: + void setEditInterfaceDCOPSuffix (const TQCString &suffix); + + public: + /** + * slots !!! + */ + /** + * @return the complete document as a single QString + */ + virtual TQString text () const = 0; + + /** + * @return a QString + */ + virtual TQString text ( uint startLine, uint startCol, uint endLine, uint endCol ) const = 0; + + /** + * @return All the text from the requested line. + */ + virtual TQString textLine ( uint line ) const = 0; + + /** + * @return The current number of lines in the document + */ + virtual uint numLines () const = 0; + + /** + * @return the number of characters in the document + */ + virtual uint length () const = 0; + + /** + * @return the number of characters in the line (-1 if no line "line") + */ + virtual int lineLength ( uint line ) const = 0; + + /** + * Set the given text into the view. + * Warning: This will overwrite any data currently held in this view. + */ + virtual bool setText ( const TQString &text ) = 0; + + /** + * clears the document + * Warning: This will overwrite any data currently held in this view. + */ + virtual bool clear () = 0; + + /** + * Inserts text at line "line", column "col" + * returns true if success + * Use insertText(numLines(), ...) to append text at end of document + */ + virtual bool insertText ( uint line, uint col, const TQString &text ) = 0; + + /** + * remove text at line "line", column "col" + * returns true if success + */ + virtual bool removeText ( uint startLine, uint startCol, uint endLine, uint endCol ) = 0; + + /** + * Insert line(s) at the given line number. + * Use insertLine(numLines(), text) to append line at end of document + */ + virtual bool insertLine ( uint line, const TQString &text ) = 0; + + /** + * Remove line(s) at the given line number. + */ + virtual bool removeLine ( uint line ) = 0; + + /** + * signals !!! + */ + public: + virtual void textChanged () = 0; + + virtual void charactersInteractivelyInserted(int ,int ,const TQString&)=0; //line, col, characters if you don't support this, don't create a signal, just overload it. + + /** + * only for the interface itself - REAL PRIVATE + */ + private: + class PrivateEditInterface *d; + static uint globalEditInterfaceNumber; + uint myEditInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT EditInterface *editInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/editinterfaceext.cpp b/interfaces/tdetexteditor/editinterfaceext.cpp new file mode 100644 index 000000000..008fa488d --- /dev/null +++ b/interfaces/tdetexteditor/editinterfaceext.cpp @@ -0,0 +1,50 @@ +/* This file is part of the KDE libraries + Copyright (C) 2003 Hamish Rodda + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "editinterfaceext.h" +#include "document.h" + +using namespace KTextEditor; + +uint EditInterfaceExt::globalEditInterfaceExtNumber = 0; + +EditInterfaceExt::EditInterfaceExt() + : d(0L) +{ + globalEditInterfaceExtNumber++; + myEditInterfaceExtNumber = globalEditInterfaceExtNumber; +} + +EditInterfaceExt::~EditInterfaceExt() +{ +} + +uint EditInterfaceExt::editInterfaceExtNumber() const +{ + return myEditInterfaceExtNumber; +} + +EditInterfaceExt *KTextEditor::editInterfaceExt (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + diff --git a/interfaces/tdetexteditor/editinterfaceext.h b/interfaces/tdetexteditor/editinterfaceext.h new file mode 100644 index 000000000..25b74201c --- /dev/null +++ b/interfaces/tdetexteditor/editinterfaceext.h @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2003 Hamish Rodda + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_editinterfaceext_h__ +#define __tdetexteditor_editinterfaceext_h__ + +#include + +#include + +namespace KTextEditor +{ + +/** +* This is the main interface for accessing and modifying +* text of the Document class. +*/ +class KTEXTEDITOR_EXPORT EditInterfaceExt +{ + friend class PrivateEditInterfaceExt; + + public: + EditInterfaceExt(); + virtual ~EditInterfaceExt(); + + uint editInterfaceExtNumber() const; + + /** + * Begin an editing sequence. Edit commands during this sequence will be + * bunched together such that they represent a single undo command in the + * editor, and so that repaint events do not occur inbetween. + * + * Your application should not return control to the event loop while it + * has an unterminated (no matching editEnd() call) editing sequence + * (result undefined) - so do all of your work in one go... + */ + virtual void editBegin() = 0; + + /** + * End and editing sequence. + */ + virtual void editEnd() = 0; + + public: + /** + * only for the interface itself - REAL PRIVATE + */ + private: + class PrivateEditInterfaceExt *d; + static uint globalEditInterfaceExtNumber; + uint myEditInterfaceExtNumber; +}; + +KTEXTEDITOR_EXPORT EditInterfaceExt *editInterfaceExt (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/editor.h b/interfaces/tdetexteditor/editor.h new file mode 100644 index 000000000..8b6699f9f --- /dev/null +++ b/interfaces/tdetexteditor/editor.h @@ -0,0 +1,65 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_editor_h__ +#define __tdetexteditor_editor_h__ + +#include + +/** + * KTextEditor is KDE's standard text editing KPart interface. + */ +namespace KTextEditor +{ + +/** + * This is a simplfied version of the Document & View classes + * Usage: Load it, merge it's gui + be happy + * Extensibility: Use the Document / View classes if you want + * advanced features, interfaces, etc. This class is just a good text editor + * widget replacement for applications which just need an embedded text edtor + * and are not interested in using advanced interfaces. + */ + +class KTEXTEDITOR_EXPORT Editor : public KParts::ReadWritePart +{ + friend class PrivateEditor; + + Q_OBJECT + + + public: + /** + * Create a new editor widget. + */ + Editor ( TQObject *parent = 0, const char *name = 0 ); + virtual ~Editor (); + + unsigned int editorNumber () const; + + private: + class PrivateEditor *d; + static unsigned int globalEditorNumber; + unsigned int myEditorNumber; +}; + +KTEXTEDITOR_EXPORT Editor *createEditor ( const char* libname, TQWidget *parentWidget = 0, const char *widgetName = 0, TQObject *parent = 0, const char *name = 0 ); + +} + +#endif diff --git a/interfaces/tdetexteditor/editorchooser.cpp b/interfaces/tdetexteditor/editorchooser.cpp new file mode 100644 index 000000000..807d342d0 --- /dev/null +++ b/interfaces/tdetexteditor/editorchooser.cpp @@ -0,0 +1,162 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "editorchooser_ui.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateEditorChooser + { + public: + PrivateEditorChooser() + { + } + ~PrivateEditorChooser(){} + // Data Members + EditorChooser_UI *chooser; + TQStringList ElementNames; + TQStringList elements; + }; + +} + +EditorChooser::EditorChooser(TQWidget *parent,const char *name) : + TQWidget (parent,name) + { + d = new PrivateEditorChooser (); + + // sizemanagment + TQGridLayout *grid = new TQGridLayout( this, 1, 1 ); + + + d->chooser = new EditorChooser_UI (this, name); + + grid->addWidget( d->chooser, 0, 0); + + + KTrader::OfferList offers = KTrader::self()->query("text/plain", "'KTextEditor/Document' in ServiceTypes"); + TDEConfig *config=new TDEConfig("default_components"); + config->setGroup("KTextEditor"); + TQString editor = config->readPathEntry("embeddedEditor"); + + if (editor.isEmpty()) editor="katepart"; + + for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) + { + if ((*it)->desktopEntryName().contains(editor)) + { + d->chooser->editorCombo->insertItem(TQString(i18n("System Default (%1)").arg((*it)->name()))); + break; + } + } + + for (KTrader::OfferList::Iterator it = offers.begin(); it != offers.end(); ++it) + { + d->chooser->editorCombo->insertItem((*it)->name()); + d->elements.append((*it)->desktopEntryName()); + } + d->chooser->editorCombo->setCurrentItem(0); +} + +EditorChooser:: ~EditorChooser(){ + delete d; +} + +void EditorChooser::readAppSetting(const TQString& postfix){ + TDEConfig *cfg=kapp->config(); + TQString previousGroup=cfg->group(); + cfg->setGroup("KTEXTEDITOR:"+postfix); + TQString editor=cfg->readPathEntry("editor"); + if (editor.isEmpty()) d->chooser->editorCombo->setCurrentItem(0); + else + { + int idx=d->elements.findIndex(editor); + idx=idx+1; + d->chooser->editorCombo->setCurrentItem(idx); + } + cfg->setGroup(previousGroup); +} + +void EditorChooser::writeAppSetting(const TQString& postfix){ + TDEConfig *cfg=kapp->config(); + TQString previousGroup=cfg->group(); + cfg->setGroup("KTEXTEDITOR:"+postfix); + cfg->writeEntry("DEVELOPER_INFO","NEVER TRY TO USE VALUES FROM THAT GROUP, THEY ARE SUBJECT TO CHANGES"); + cfg->writePathEntry("editor", (d->chooser->editorCombo->currentItem()==0) ? + TQString::null : (*d->elements.at(d->chooser->editorCombo->currentItem()-1))); + cfg->sync(); + cfg->setGroup(previousGroup); + +} + +KTextEditor::Document *EditorChooser::createDocument(TQObject *parent,const char* name, const TQString& postfix,bool fallBackToKatePart){ + + KTextEditor::Document *tmpDoc=0; + + TDEConfig *cfg=kapp->config(); + TQString previousGroup=cfg->group(); + cfg->setGroup("KTEXTEDITOR:"+postfix); + TQString editor=cfg->readPathEntry("editor"); + cfg->setGroup(previousGroup); + if (editor.isEmpty()) + { + TDEConfig *config=new TDEConfig("default_components"); + config->setGroup("KTextEditor"); + editor = config->readPathEntry("embeddedEditor", "katepart"); + delete config; + } + + KService::Ptr serv=KService::serviceByDesktopName(editor); + if (serv) + { + tmpDoc=KTextEditor::createDocument(serv->library().latin1(),parent,name); + if (tmpDoc) return tmpDoc; + } + if (fallBackToKatePart) + return KTextEditor::createDocument("libkatepart",parent,name); + + return 0; +} + +KTextEditor::Editor *EditorChooser::createEditor(TQWidget *parentWidget,TQObject *parent,const char* widgetName, + const char* name,const TQString& postfix,bool fallBackToKatePart){ + + KTextEditor::Editor *tmpEd=0; + + TDEConfig *cfg=kapp->config(); + TQString previousGroup=cfg->group(); + cfg->setGroup("KTEXTEDITOR:"+postfix); + TQString editor=cfg->readPathEntry("editor"); + cfg->setGroup(previousGroup); + if (editor.isEmpty()) + { + TDEConfig *config=new TDEConfig("default_components"); + config->setGroup("KTextEditor"); + editor = config->readPathEntry("embeddedEditor", "katepart"); + delete config; + } + + KService::Ptr serv=KService::serviceByDesktopName(editor); + if (serv) + { + tmpEd=KTextEditor::createEditor(serv->library().latin1(),parentWidget,widgetName,parent,name); + if (tmpEd) return tmpEd; + } + if (fallBackToKatePart) + return KTextEditor::createEditor("libkatepart",parentWidget,widgetName,parent,name); + + return 0; +} + diff --git a/interfaces/tdetexteditor/editorchooser.h b/interfaces/tdetexteditor/editorchooser.h new file mode 100644 index 000000000..251776c10 --- /dev/null +++ b/interfaces/tdetexteditor/editorchooser.h @@ -0,0 +1,58 @@ +#ifndef _EDITOR_CHOOSER_H_ +#define _EDITOR_CHOOSER_H_ + +#include +#include + +#include + +class TDEConfig; +class TQString; + +namespace KTextEditor +{ + +class KTEXTEDITOR_EXPORT EditorChooser: public TQWidget +{ + friend class PrivateEditorChooser; + + Q_OBJECT + + public: + EditorChooser(TQWidget *parent=0,const char *name=0); + virtual ~EditorChooser(); + + /* void writeSysDefault();*/ + + void readAppSetting(const TQString& postfix=TQString::null); + void writeAppSetting(const TQString& postfix=TQString::null); + + static KTextEditor::Document *createDocument(TQObject* parent=0,const char *name=0,const TQString& postfix=TQString::null, bool fallBackToKatePart=true); + static KTextEditor::Editor *createEditor(TQWidget *parentWidget,TQObject *parent,const char* widgetName=0,const char* name=0,const TQString& postfix=TQString::null,bool fallBackToKatePart=true); + private: + class PrivateEditorChooser *d; +}; + +/* +class EditorChooserBackEnd: public ComponentChooserPlugin { + +Q_OBJECT +public: + EditorChooserBackEnd(TQObject *parent=0, const char *name=0); + virtual ~EditorChooserBackEnd(); + + virtual TQWidget *widget(TQWidget *); + virtual const TQStringList &choices(); + virtual void saveSettings(); + + void readAppSetting(TDEConfig *cfg,const TQString& postfix); + void writeAppSetting(TDEConfig *cfg,const TQString& postfix); + +public slots: + virtual void madeChoice(int pos,const TQString &choice); + +}; +*/ + +} +#endif diff --git a/interfaces/tdetexteditor/editorchooser_ui.ui b/interfaces/tdetexteditor/editorchooser_ui.ui new file mode 100644 index 000000000..e2bc82adb --- /dev/null +++ b/interfaces/tdetexteditor/editorchooser_ui.ui @@ -0,0 +1,64 @@ + +EditorChooser_UI + + + EditorChooser + + + + 0 + 0 + 482 + 141 + + + + Editor Chooser + + + + unnamed + + + + layout4 + + + + unnamed + + + + TextLabel1 + + + + 460 + 0 + + + + Please choose the default text editing component that you wish to use in this application. If you choose <B>System Default</B>, the application will honor your changes in the Control Center. All other choices will override that setting. + + + WordBreak|AlignVCenter|AlignLeft + + + + + editorCombo + + + + + + + + editorCombo + + + kdialog.h + + + + diff --git a/interfaces/tdetexteditor/encodingdcopinterface.cpp b/interfaces/tdetexteditor/encodingdcopinterface.cpp new file mode 100644 index 000000000..eb408c16e --- /dev/null +++ b/interfaces/tdetexteditor/encodingdcopinterface.cpp @@ -0,0 +1,28 @@ +#include "encodingdcopinterface.h" +#include "encodinginterface.h" + +#include +using namespace KTextEditor; + +EncodingDCOPInterface::EncodingDCOPInterface( EncodingInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +EncodingDCOPInterface::~EncodingDCOPInterface() +{ + + } +uint EncodingDCOPInterface::encodingInterfaceNumber () +{ + return m_parent->encodingInterfaceNumber (); +} +void EncodingDCOPInterface::setEncoding (TQString e) +{ + m_parent->setEncoding (e); +} +TQString EncodingDCOPInterface::encoding() +{ + return m_parent->encoding(); +} diff --git a/interfaces/tdetexteditor/encodingdcopinterface.h b/interfaces/tdetexteditor/encodingdcopinterface.h new file mode 100644 index 000000000..38de4e0aa --- /dev/null +++ b/interfaces/tdetexteditor/encodingdcopinterface.h @@ -0,0 +1,46 @@ +#ifndef Encoding_DCOP_INTERFACE_H +#define Encoding_DCOP_INTERFACE_H + +#include +#include +#include +#include +//#include "editdcopinterface.moc" +namespace KTextEditor +{ + class EncodingInterface; + /** + This is the main interface to the EncodingInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to EncodingInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT EncodingDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent EncodingInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + EncodingDCOPInterface( EncodingInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~EncodingDCOPInterface(); + k_dcop: + uint encodingInterfaceNumber (); + void setEncoding (TQString e) ; + TQString encoding(); + + private: + EncodingInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/encodinginterface.cpp b/interfaces/tdetexteditor/encodinginterface.cpp new file mode 100644 index 000000000..a0ef1ad22 --- /dev/null +++ b/interfaces/tdetexteditor/encodinginterface.cpp @@ -0,0 +1,76 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "encodinginterface.h" +#include "encodingdcopinterface.h" +#include "document.h" + + + +namespace KTextEditor +{ + +class PrivateEncodingInterface +{ + public: + PrivateEncodingInterface() {interface=0;} + ~PrivateEncodingInterface() {} + EncodingDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int EncodingInterface::globalEncodingInterfaceNumber = 0; + +EncodingInterface::EncodingInterface() +{ + globalEncodingInterfaceNumber++; + myEncodingInterfaceNumber = globalEncodingInterfaceNumber++; + + d = new PrivateEncodingInterface(); + ::TQString name = "EncodingInterface#" + ::TQString::number(myEncodingInterfaceNumber); + d->interface = new EncodingDCOPInterface(this, name.latin1()); +} + +EncodingInterface::~EncodingInterface() +{ + delete d->interface; + delete d; +} + +unsigned int EncodingInterface::encodingInterfaceNumber () const +{ + return myEncodingInterfaceNumber; +} + +void EncodingInterface::setEncodingInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("EncodingInterface#"+suffix); +} + +EncodingInterface *KTextEditor::encodingInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/encodinginterface.h b/interfaces/tdetexteditor/encodinginterface.h new file mode 100644 index 000000000..42d0186ad --- /dev/null +++ b/interfaces/tdetexteditor/encodinginterface.h @@ -0,0 +1,63 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_encodinginterface_h__ +#define __tdetexteditor_encodinginterface_h__ + +#include + +class TQString; +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface to the text encoding of a Document class. +*/ +class KTEXTEDITOR_EXPORT EncodingInterface +{ + friend class PrivateEncodingInterface; + + public: + EncodingInterface(); + virtual ~EncodingInterface(); + + unsigned int encodingInterfaceNumber () const; + + protected: + void setEncodingInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + virtual void setEncoding (const class TQString &e) = 0; + virtual class TQString encoding() const = 0; + + private: + class PrivateEncodingInterface *d; + static unsigned int globalEncodingInterfaceNumber; + unsigned int myEncodingInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT EncodingInterface *encodingInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/highlightinginterface.cpp b/interfaces/tdetexteditor/highlightinginterface.cpp new file mode 100644 index 000000000..1677ca87c --- /dev/null +++ b/interfaces/tdetexteditor/highlightinginterface.cpp @@ -0,0 +1,69 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "highlightinginterface.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivateHighlightingInterface +{ + public: + PrivateHighlightingInterface() {} + ~PrivateHighlightingInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int HighlightingInterface::globalHighlightingInterfaceNumber = 0; + +HighlightingInterface::HighlightingInterface() +{ + globalHighlightingInterfaceNumber++; + myHighlightingInterfaceNumber = globalHighlightingInterfaceNumber++; + + d = new PrivateHighlightingInterface(); +} + +HighlightingInterface::~HighlightingInterface() +{ + delete d; +} + +unsigned int HighlightingInterface::highlightingInterfaceNumber () const +{ + return myHighlightingInterfaceNumber; +} + +void HighlightingInterface::setHighlightingInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("HighlightingInterface#"+suffix); +} + +HighlightingInterface *KTextEditor::highlightingInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/highlightinginterface.h b/interfaces/tdetexteditor/highlightinginterface.h new file mode 100644 index 000000000..e7bd811e2 --- /dev/null +++ b/interfaces/tdetexteditor/highlightinginterface.h @@ -0,0 +1,92 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_highlightinginterface_h__ +#define __tdetexteditor_highlightinginterface_h__ + +#include + +class TQString; +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface for syntax highlighting of a Document. +*/ +class KTEXTEDITOR_EXPORT HighlightingInterface +{ + friend class PrivateHighlightingInterface; + + public: + HighlightingInterface (); + virtual ~HighlightingInterface (); + + unsigned int highlightingInterfaceNumber () const; + + protected: + void setHighlightingInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + /** + * returns the current active highlighting mode + */ + virtual unsigned int hlMode () = 0; + + /** + * set the current active highlighting mode + */ + virtual bool setHlMode (unsigned int mode) = 0; + + /** + * returns the number of available highlightings + */ + virtual unsigned int hlModeCount () = 0; + + /** + * returns the name of the highlighting with number "mode" + */ + virtual TQString hlModeName (unsigned int mode) = 0; + + /** + * returns the sectionname of the highlighting with number "mode" + */ + virtual TQString hlModeSectionName (unsigned int mode) = 0; + + // + // signals !!! + // + public: + virtual void hlChanged () = 0; + + private: + class PrivateHighlightingInterface *d; + static unsigned int globalHighlightingInterfaceNumber; + unsigned int myHighlightingInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT HighlightingInterface *highlightingInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/kcm_tdetexteditor.desktop b/interfaces/tdetexteditor/kcm_tdetexteditor.desktop new file mode 100644 index 000000000..490fad3ae --- /dev/null +++ b/interfaces/tdetexteditor/kcm_tdetexteditor.desktop @@ -0,0 +1,172 @@ +Name=Embedded Text Editor +Name[af]=Ingebedde Teks Redigeerder +Name[ar]=محرر نص مدمج +Name[az]=Daxili Mətn Editoru +Name[be]=Унутраны тэкставы рэдактар +Name[bg]=Текстов редактор +Name[bn]=অভ্যন্তরীন টেক্সট সম্পাদক +Name[br]=Aozer skrid enframmet +Name[bs]=Umetnuti tekst editor +Name[ca]=Editor de text, encastable +Name[cs]=Zabudovaný textový editor +Name[csb]=Òbsôdzony editora tekstu +Name[cy]=Golygydd Testun Mewnol +Name[da]=Indlejret teksteditor +Name[de]=Erweiterte Editorkomponente +Name[el]=Ενσωματωμένος επεξεργαστής κειμένου +Name[eo]=Interna tekstredaktilo +Name[es]=Editor de texto empotrable +Name[et]=Põimitud tekstiredaktor +Name[eu]=Kapsulatutako testu-editorea +Name[fa]=ویرایشگر متن نهفته +Name[fi]=Upotettava tekstieditori +Name[fr]=Éditeur de texte intégré +Name[fy]=Ynsletten tekstbewurker +Name[ga]=Eagarthóir téacs leabaithe +Name[gl]=Editor de Textos Incrustado +Name[he]=עורך טקסט מוטבע +Name[hi]=अंतर्निहित पाठ संपादक +Name[hr]=Ugrađeni uređivač teksta +Name[hsb]=Integrowane wobdźěłanje tekstow +Name[hu]=Beágyazott szövegszerkesztő +Name[id]=Komponen Editor Teks Embedded +Name[is]=Ívafinn textaritill +Name[it]=Editor di testi integrato +Name[ja]=埋め込みテキストエディタ +Name[ka]=ტექსტის ჩადგმული რედაქტორი +Name[kk]=Ендірілетін мәтін редакторы +Name[km]=កម្មវិធី​និពន្ធ​អត្ថបទ​ដែល​បាន​បង្កប់ +Name[ko]=끼워넣은 글월 편집기 +Name[lb]=Agebauten Texteditor +Name[lt]=Įdėtas tekstų redaktorius +Name[lv]=Iegultais teksta redaktors +Name[mk]=Вгнезден текст уредувач +Name[mn]=Холбоост текст боловсруулагч +Name[ms]=Editor Teks Terimplan +Name[nb]=Innebygget skriveprogram +Name[nds]=Inbett Texteditor +Name[ne]=सम्मिलित पाठ सम्पादक +Name[nl]=Ingebedde tekst-editor +Name[nn]=Inkluderbart skriveprogram +Name[nso]=Mofetosi wa Sengwalwana yo a Robaditswego +Name[pa]=ਸ਼ਾਮਿਲ ਪਾਠ ਸੰਪਾਦਕ +Name[pl]=Osadzony edytor tekstu +Name[pt]=Editor de Texto Embebido +Name[pt_BR]=Editor de textos integrado +Name[ro]=Editor de text înglobat +Name[ru]=Встроенный текстовый редактор +Name[rw]=Muhinduzi yUmwandiko Irimo +Name[se]=Vuojuhahtti čállinprográmma +Name[sk]=Vložiteľný textový editor +Name[sl]=Vključeni urejevalnik besedil +Name[sq]=Tekst Editori i ngulur +Name[sr]=Уграђени уређивач текста +Name[sr@Latn]=Ugrađeni uređivač teksta +Name[ss]=Sihleli sembhalo lesilele +Name[sv]=Inbäddad texteditor +Name[ta]=உட்பொதிந்த உரை தொகுப்பி +Name[te]=పొదగిన వాచకం సరిచేయునది +Name[tg]=Таҳриргари матни дарунсохт +Name[th]=โปรแกรมแก้ไขข้อความแบบฝังตัว +Name[tr]=Gömülü Metin Düzenleyici +Name[tt]=Mäten öçen Quşılma-Üzgärtkeçe +Name[uk]=Вмонтований текстовий редактор +Name[uz]=Ichki matn tahrirchi +Name[uz@cyrillic]=Ички матн таҳрирчи +Name[ven]=Musengulusi wa manwalwa o dzheniswaho +Name[vi]=Bộ Soạn thảo Văn bản nhúng +Name[wa]=Ravalé aspougneu di tecse +Name[xh]=Umhleli Wombhalo Olungiselelweyo +Name[zh_CN]=嵌入式文本编辑器 +Name[zh_HK]=嵌入式文字編輯器 +Name[zh_TW]=嵌入式文字編輯器 +Name[zu]=Umlungisi Wombhalo Oshuthekiwe +Comment=The text editor service provides applications with a text viewer and editor. TDE applications that provide text editing facilities should use this service. +Comment[af]=Die teks redigeerder diens verskaf programme met 'n teks aansig en redigeerder. Kde programme wat verskaf teks redigering fasiliteite moet gebruik hierdie diens. +Comment[ar]=تقوم خدمة محرر النصوص بتزويد التطبيقات بمعاين نصوص ومحرر. يجب أن تستخدم تطبيقات كيدي التي تزود بتسهيلات تحرير النصوص هذه الخدمة. +Comment[az]=Mətn redaktə xidməti proqramları mətn nümayişçisi və editoru ilə tə'min edir. Mətn redaktə bacarıqları olan proqramlar bu xidməti işlətməlidir. +Comment[be]=Сервіс тэкставага рэдактара дазваляе праглядаць і рэдагаваць тэкст у праграмах. Праграмы TDE, якія выконваюць гэтыя функцыі, павінны працаваць з гэтым сервісам. +Comment[bg]=Текстовия редактор, представлява компонент за вграждане в другите програми, който предоставя функционалност за разглеждане и редактиране на текстови файлове. +Comment[bn]=টেক্সট সম্পাদক সার্ভিসটি বিভিন্ন অ্যাপলিকেশন-কে একটি টেক্সট প্রদর্শক এবং সম্পাদক ব্যবহার করার সুযোগ দেয়। কোন কে.ডি.ই. অ্যাপলিকেশন টেক্সট সম্পাদনা করার সুবিধা দিতে চাইলে তার এই সার্ভিসটি ব্যবহার করা উচিত্‍। +Comment[bs]=Text editor servis pruža aplikacijama preglednik i editor teksta. TDE aplikacije koje imaju mogućnost editovanja teksta bi trebale koristiti ovaj servis. +Comment[ca]=El servei de l'editor de text proveeix d'aplicacions amb un visor i un editor de text. Les aplicacions TDE que proveeixen de facilitats d'edició haurien d'emprar aquest servei. +Comment[cs]=Služba textového editoru poskytuje aplikacím prohlížeč a editor textu. Aplikace TDE, které umožňují editovat text, by měly používat tuto službu. +Comment[csb]=Ùsłëżnota tekstowegò editora zezwôlô aplikacejom na przezéranié ë edicejã tekstów. Programë TDE, jaczé ùprzistãpniają nã edicëjną fùnkcëjã, mają brëkòwac ti ùsłëżnonë. +Comment[cy]=Mae'r gwasanaeth golygu testun yn darparu gwelydd testun a golygydd i gymhwysiadau. dylai cymhwysiadau TDE sy'n darparu galluoedd golygu testun ddefnyddio'r gwasanaeth yma. +Comment[da]=Teksteditor-tjenesten udstyrer programmer med en tekstfremviser og editor. TDE-programmer der bruger tekstredigeringsfaciliteter bør benytte denne tjeneste. +Comment[de]=Diese Komponente stellt Programmen einen Textbetrachter und -editor zur Verfügung. TDE-Anwendungen, die mit Textbearbeitung zu tun haben, sollten dieses Angebot nutzen. +Comment[el]=Η υπηρεσία επεξεργαστή κειμένου παρέχει στις εφαρμογές έναν προβολέα και επεξεργαστή κειμένου. Οι εφαρμογές του TDE που παρέχουν δυνατότητες επεξεργασίας κειμένου θα πρέπει να χρησιμοποιούν αυτή την υπηρεσία. +Comment[eo]=La tekstredaktila servo donas vin aplikaĵojn kun tekstrigardilo kaj redaktilo. TDE aplikaĵoj kiuj volas uzi tekstredaktadon uzu tiun ĉi servon. +Comment[es]=El servicio del editor de texto proporciona aplicaciones con un visor de textos y un editor de textos. Las aplicaciones TDE que suministran propiedades de edición deberían utilizar este servicio. +Comment[et]=Tekstiredaktori teenus annab rakendustele komponendi teksti vaatamiseks ja redigeerimiseks. Seda kasutavad kõik TDE rakendused, mis tegelevad teksti redigeerimisega. +Comment[eu]=Testu-editorearen zerbitzuak testu-ikustailea eta editorea duten aplikazioak eskaintzen ditu. Testuak editatzeko aukera ematen duten TDE aplikazioek erabili beharko lukete zerbitzu hau. +Comment[fa]=خدمت ویرایشگر متن، کاربردهایی را توسط یک مشاهده‌گر و ویرایشگر متن، فراهم می‌کند. کاربردهای TDE که امکانات ویرایش متن را فراهم می‌کنند باید از این \ خدمت استفاده نمایند. +Comment[fi]=Tekstieditoripalvelu tarjoaa sovelluksille tekstinäyttäjän- ja muokkaimen. TDE-sovelluksien, jotka tarjoavat tekstinmuokkauspalveluita, tulisi käyttää tätä palvelua. +Comment[fo]=Tekstritiltænastuni gera forrit út við ein tekstvísari og -ritil. TDE-forrit ið geva nýtarin møguleiki fyri at rætta tekst eiga at nýta hesa tænasta. +Comment[fr]=Le service d'édition de texte fournit des applications comportant un afficheur de texte et un éditeur. Les applications TDE qui fournissent des fonctions d'édition de texte devraient utiliser ce service. +Comment[fy]=De tekstbewurkings-fasiliteit foarsjocht programma's fan een tekstwerjouwer en -ferwurker. TDE-applikaasjes mei tekstferwurkingsmooglikheden kinne hjir gebrûk fan meitsje. +Comment[ga]=Cuirtear amharcán téacs agus eagarthóir ar fáil d'fheidhmchláir trín seirbhís eagarthóireachta téacs. Ba cheart d'fheidhmchláir TDE a sholáthraíonn áiseanna eagarthóireachta an tseirbhís seo a úsáid. +Comment[gl]=O servizo de edición de texto fornece ás aplicacións de visor e editor de textos. Todas as aplicacións de TDE que fornezan facilidades de edición de textos deberan empregar este servizo. +Comment[he]=שירות עורך הטקסט מספק ליישומים מציג ועורך טקסט. יישומי TDE שמספקים אמצעים לעריכת טקסט ישתמשו בשירות זה. +Comment[hi]=पाठ संपादक सेवा जो अनुप्रयोगों को एक पाठ दर्शक व एक संपादक उपलब्घ कराती है। केडीई अनुप्रयोग जो पाठ संपादन सुविधा उपलब्ध कराती हैं, उन्हें इसका प्रयोग करना चाहिए। +Comment[hr]=Usluga tekstualnog uređivača aplikacijama omugućuje pregledavanje i uređivanje teksta. TDE aplikacije koje omogućuju uređivanje teksta trebale bi upotrebljavati ovo sučelje. +Comment[hsb]=Wobdźěłanje teksta staji programam wobdźěłarja a wobhladowarja teksta k dispoziciji. TDE-aplikacije, kiž tajke něšto trjebaja, měli tutón serwis wužiwać. +Comment[hu]=A szövegszerkesztő szolgáltatáson keresztül az alkalmazások szövegek megtekintését és szerkesztését végezhetik el. A TDE szövegszerkesztő programjai használhatják. +Comment[id]=Layanan penyuntingan teks memberikan penampil dan penyunting teks untuk aplikasi. Aplikasi TDE yang menyediakan fasilitas penyuntingan teks seharusnya menggunakan layanan ini. +Comment[is]=Ívafni ritillinn færir forritum texta-skoðara og ritil. TDE forrit sem birta ritil til textavinnslu ættu að nota þessa þjónustu. +Comment[it]=Il servizio di editor di testi fornisce alle applicazioni un visualizzatore ed un editor di testi. Le applicazioni TDE che permettono l'elaborazione di testi dovrebbero usare questo servizio. +Comment[ja]=テキストエディタサービスはアプリケーションにテキストビューアとテキストエディタを提供します。テキスト編集の機能を持つ TDE アプリケーションはこれを使用します。 +Comment[ka]=პროგრამების ტექსტური რედაქტორი ტექსტების საჩვენებლად და დასარედაქტირებლად. იგი გამოიყენება იმ TDE პროგრამების მიერ, რომელთაც ტექსტის რედაქტირება ესაჭიროებათ. +Comment[kk]=Қолданбаларға мәтінді қарау және өңдеу мүмкіншілікті беретін қызмет. Мәтінді өңдеу үшін TDE қолданбалар осы қызметті пайдалану керек. +Comment[km]=សេវា​កម្មវិធី​និពន្ធ​អត្ថបទ​ផ្តល់​នូវ​សំណុំ​កម្មវិធីរួម​មាន​កម្មវិធី​មើល​អត្ថបទ និង​កម្មវិធី​និពន្ធ​អត្ថបទ ។ សំណុំ​កម្មវិធី TDE ដែល​ផ្តល់​មធ្យោបាយ​និពន្ធ​អត្ថបទ គួរ​ប្រើ​សេវា​នេះ ។ +Comment[ko]=이 글월 편집기 서비스는 응용 프로그램이 글월을 보거나 고칠 수 있는 기능을 제공합니다. 글월을 고칠 수 있는 TDE 응용 프로그램은 이 서비스를 써야 합니다. +Comment[lb]=Den Texeditor-Service stellt Programmer en Textlieser an en Texteditor zur Verfügung.TDE-Programmer, déi Textmanipuléierungsfunktiounen ubidden, sollen dëse Service benotzen. +Comment[lt]=Teksto redaktoriaus tarnyba pateikia programoms teksto žiūriklį ir redaktorių. TDE programos, leidžiančios redaguoti tekstą, turėtų naudoti šią tarnybą. +Comment[lv]=Teksta redaktora serviss sniedz teksta aplūkošanas un rediģēšanas pakalpojumus programmām. TDE programmām, kurām tas ir nepieciešams, vajadzētu izmantot šo servisu. +Comment[mk]=Сервисот за текст уредувач ги снабдува апликациите со текст прегледник и уредувач. TDE апликациите што овозможуваат уредување текст би требало да го користат овој сервис. +Comment[mn]=Текст засварлагч үйлчилгээ нь текст харах болон засварлах прогрммуудаар хангадаг. TDE программууд энэ үйлчилгээний хэрэглэх хэрэгтэй текст засварлах нэмэлт боломжуудаар хангадаг. +Comment[ms]= Servis penyunting teks yang menyediakan aplikasi dengan pelihat teks dan editor. Aplikasi TDE yang menyediakan kemudahan penyuntingan teks patut menggunakan servis ini. +Comment[mt]=Is-servizz ta' editur ta' test jipprovdi l-programmi b'werrej u editur ta' test. Programmi tal-TDE li jipprovdu servizzi ta' editjar ta' test għandhom jużaw dan is-servizz. +Comment[nb]=Skriveprogrammet gir kan vise og redigere teks. TDE-programmer som kan redigere tekst bør bruke denne tjenesten. +Comment[nds]=De Texteditor-Deenst föögt Programmen en Textwieser un -editor to. TDE-Programmen, mit de Texten bewerkt warrt, schöölt em bruken. +Comment[ne]=पाठ सम्पादक सेवाले पाठ दर्शक र सम्पादकसँग अनुप्रयोग उपलब्ध गराउँछ । TDE अनुप्रयोग जसले पाठ सम्पादक सुविधाहरू उपलब्ध गर्छ त्यसले यो सेवा प्रयोग गर्छ । +Comment[nl]=Dit component stelt programma's een tekstviewer en -editor tot hun beschikking. TDE-toepassingen die te maken hebben met het bewerken van tekst kunnen gebruik maken van deze aangeboden dienst. +Comment[nn]=Skriveprogramtenesta tilbyr vising og redigering av tekst. TDE-program som skal visa eller redigera tekst bør bruka denne tenesta. +Comment[nso]=Tirelo ya phetoso ya sengwalwana e aba ditshumiso le molebeledi lemofetosi wa sengwalwana. Ditshumiso tsa TDE tseo di abago ditirelo tsaphetoso ya sengwalwana di swanetse go somisa tirelo ye. +Comment[pa]=ਪਾਠ ਸੰਪਾਦਕ ਸੇਵਾ ਉਹ ਸਾਰੇ ਕਾਰਜ ਉਪਲੱਬਧ ਕਰਵਾਉਦਾ ਹੈ, ਜੋ ਕਿ ਪਾਠ ਦਰਸ਼ਕ ਤੇ ਸੰਪਾਦਕ ਸ਼ਾਮਿਲ ਹਨ। TDE ਕਾਰਜ ਜੋ ਕਿ ਪਾਠ ਸੰਪਾਦਨ ਦੀ ਸਹੂਲਤ ਉਪਲੱਬਧ ਕਰਵਾਉਦੀਆਂ ਹਨ, ਇਸ ਨੂੰ ਇਸਤੇਮਾਲ ਕਰਦੀਆਂ ਹਨ। +Comment[pl]=Usługa edytora tekstowego pozwala programom na przeglądanie i edycję tekstów. Programy TDE, które udostępniają funkcje edycyjne, powinny używać tej usługi. +Comment[pt]=O serviço de edição de texto oferece às aplicações um visualizador e editor de texto. As aplicações do TDE que oferecem funcionalidade de edição de texto devem usar este serviço. +Comment[pt_BR]=O serviço de edição de texto fornece aplicações com um visualizador e um editor de textos. Aplicações do TDE que fornecem facilidades de edição de texto devem usar este serviço. +Comment[ro]=Serviciul de editare text asigură aplicaţiilor un vizualizor de text şi un editor. Aplicaţiile TDE care oferă capabilităţi de editare de text ar trebui să utilizeze acest serviciu. +Comment[ru]=Сервис текстового редактора для приложений, в которых требуется просмотр и редактирование текста. Его должны использовать приложения TDE, где требуется редактирование текста. +Comment[rw]=Serivise ya muhinduzi y'umwandiko itanga amaporogaramu afite mugaragaza na muhinduzi y'umwandiko. Amaporogaramu TDE atanga uburyo bwo guhindura umwandiko agomba gukoresha iyi serivise. +Comment[se]=Čállinprográmmabálvalus fállá teakstačájeheami ja -doaimmaheaheami. TDE-prográmmat, mat fállet teakstadoaimmahanvejolašvuođaid, galggašedje geavahit dán bálvalusa. +Comment[sk]=Služba textového editora poskytuje aplikáciám prehliadač a editor textových súborov. Aplikácie TDE, ktoré podporujú úpravu textu, by mali používať túto službu. +Comment[sl]=Storitev urejevalnika besedila omogoča programom dostop do pregledovalnika in urejevalnika besedil. Programi za TDE, ki omogočajo urejanje besedila, naj bi uporabljali to storitev. +Comment[sq]=Servisi i tekst editorit i pajis aplikacionet me vështruesin dhe editorin e tekstit. Aplikacionet e TDE-së që na pajisin me shërbime të editimit të tekstit duhet ta përdorin këtë servis. +Comment[sr]= Сервис уређивача текста обезбеђује програмима преглед и измене текстова. TDE програми који обезбеђују могућност обраде текста требало би да користе овај сервис. +Comment[sr@Latn]= Servis uređivača teksta obezbeđuje programima pregled i izmene tekstova. TDE programi koji obezbeđuju mogućnost obrade teksta trebalo bi da koriste ovaj servis. +Comment[ss]=Lusito lwekuhleal umbhalo luniketa ticelo letinesibuki sembhalo kanye nesihleli. Ticelo te KDe letiniketa tinsita tekuhlelwa kwembhalo kufanele tisebentise lolusito. +Comment[sv]=Texteditortjänsten ger program en textvisare och editor. TDE-program som tillhandahåller textredigeringsfunktioner bör använda denna tjänst. +Comment[ta]=உரை மற்றும் தொகுப்பாளருடனான பயன்பாடுகளை உரை தொகுப்பாளர் சேவை வழங்குகிறது. உரை தொகுக்கும் வசதிகளை வழங்கும் கேடிஇ பயன்பாடுகள் இச்சேவையைப் பயன்படுத்த வேண்டும். +Comment[te]=కార్యక్రమాలకు వాచకం సరిచేయు సేవ ఒక వాచకం విక్షణ మరియు సరిచెయుటకు సహాయపడును. కెడిఈ కార్యక్రమాలు వాచకం సరిచెయు సౌకర్యాలు వున్నట్టైతె దిని సేవ ను ఉపయొగించొకొవలెను +Comment[tg]=Хидмати таҳриргари матн барномаҳоро бо намоишгар ва таҳриргари матн таъмин мекунад. Барномаҳои TDE дорои таҳриргари матн бояд ин хидмат истифода барад. +Comment[th]=บริการตัวแก้ไขข้อความ จะจัดเตรียมตัวดูข้อความและตัวแก้ไขข้อความให้กับแอพพลิเคชัน แอพพลิเคชันของ TDE ที่เตรียมความสามารถในการแก้ไขข้อความมาให้ ควรที่จะใช้บริการนี้ +Comment[tt]=Mäten üzgärtü xezmäte törle yazılımnarnı mäten kürsätkeçe/üzgärtkeçe belän tä'min itä. Mäten üzgärtüçe TDE-yazılımnar bu xezmätne qullanırğa tieş. +Comment[uk]=Служба "Текстовий редактор" постачає програми з переглядачем та редактором тексту. Програми TDE, які надають можливість редагування тексту, повинні користуватись цією службою. +Comment[uz]=Matn tarhrirchi xizmati dasturlarni matn koʻruvchi va tahrirchi bilan taʼminlaydi. Matn tahrirlash imkoniyatini yaratuvchi TDE dasturlari shu xizmatni ishlatishi kerak. +Comment[uz@cyrillic]=Матн тарҳрирчи хизмати дастурларни матн кўрувчи ва таҳрирчи билан таъминлайди. Матн таҳрирлаш имкониятини яратувчи TDE дастурлари шу хизматни ишлатиши керак. +Comment[ven]=Tshumelo ya musengulusi wa manwalwa i diswa apulifikhesheni dzirena na vhavhoni vha manwalwa na musengulusi. Apulifikhesheni ya TDE ine ya disa zwishumiswa zwa u sengulusa manwalwa i fanela u shumisa tshumelo ino. +Comment[vi]=Dịch vụ soạn thảo văn bản cung cấp cho ứng dụng một bộ xem và soạn thảo văn bản. Các ứng dụng TDE mà cung cấp khả năng soạn thảo văn bản nên dùng dịch vụ này. +Comment[xh]=Inkonzo yomhleli wombhalo onika izicelo ngombonisi wombhalo nomhleli Izicelo ze TDE ezinikezela ngohlelo lombhalo ekufuneka isebenzise lenkonzo. +Comment[zh_CN]=文本编辑器服务提供了文本查看器和编辑器的应用程序。提供文本编辑功能的 TDE 应用程序都应该使用此服务。 +Comment[zh_HK]=文字編輯服務為各種程式提供一個檢視和編輯文字的介面。任何提供文字編輯功能的 TDE 程式都應該使用這項服務。 +Comment[zh_TW]=文字編輯服務提供程式一個文字檢視器以及編輯器。提供文字編輯功能的 TDE 程式擁該使用這項服務。 +Comment[zu]=Umsebenzi womlungisi wombhalo onikeza imiyaleli ngombukisi wombhalo kanye nomhleli.Abayaleli abanikeza izisebenzi zokulungisa umbhalo okumele zisebenzise lomsebenzi. +ServiceTypeToConfigure=KTextEditor/Document +MimeTypeOfInterest=text/plain +defaultImplementation=katepart +storeInFile=default_components +valueSection=KTextEditor +valueName=embeddedEditor +configurationType=component diff --git a/interfaces/tdetexteditor/markinterface.cpp b/interfaces/tdetexteditor/markinterface.cpp new file mode 100644 index 000000000..024db35c4 --- /dev/null +++ b/interfaces/tdetexteditor/markinterface.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "markinterface.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivateMarkInterface +{ + public: + PrivateMarkInterface() {} + ~PrivateMarkInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int MarkInterface::globalMarkInterfaceNumber = 0; + +MarkInterface::MarkInterface() +{ + globalMarkInterfaceNumber++; + myMarkInterfaceNumber = globalMarkInterfaceNumber++; + + d = new PrivateMarkInterface(); +} + +MarkInterface::~MarkInterface() +{ + delete d; +} + +unsigned int MarkInterface::markInterfaceNumber () const +{ + return myMarkInterfaceNumber; +} + +void MarkInterface::setMarkInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("MarkInterface#"+suffix); +} + +MarkInterface *KTextEditor::markInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + +int MarkInterface::reservedMarkersCount() +{ + return 7; +} diff --git a/interfaces/tdetexteditor/markinterface.h b/interfaces/tdetexteditor/markinterface.h new file mode 100644 index 000000000..64e948572 --- /dev/null +++ b/interfaces/tdetexteditor/markinterface.h @@ -0,0 +1,171 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_markinterface_h__ +#define __tdetexteditor_markinterface_h__ + +#include + +#include + +class TQCString; + +namespace KTextEditor +{ + +class Mark +{ + public: + uint line; + uint type; +}; + +/** +* This is an interface to enable marks to be made in the iconborder of the Document class. +*/ +class KTEXTEDITOR_EXPORT MarkInterface +{ + friend class PrivateMarkInterface; + + public: + MarkInterface (); + virtual ~MarkInterface (); + + unsigned int markInterfaceNumber () const; + + protected: + void setMarkInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + /** + * @return a uint representing the marks set in @p line OR'ed togeather. + */ + virtual uint mark (uint line) = 0; + + /** + * Adds a mark of type @p markType to @p line. + * Has no effect if the line allready contains a mark of that type. + */ + virtual void setMark (uint line, uint markType) = 0; + /** + * Clears all marks set in @p line. + */ + virtual void clearMark (uint line) = 0; + + virtual void addMark (uint line, uint markType) = 0; + /** + * Removes any mark of type @p markType from @p line. + */ + virtual void removeMark (uint line, uint markType) = 0; + + /** + * @return a list of all marks in the document + */ + virtual TQPtrList marks () = 0; + /** + * Clears all marks in the document. + */ + virtual void clearMarks () = 0; + + /** + * get the number of predefined marker types we have so far. + * @note If you change this you have to make sure katepart supports the new size! + * @return number of reserved marker types + * @since 3.3 + */ + static int reservedMarkersCount(); + + /** + * Pre-defined mark types. + * + * To create a non-standard mark type, use MarkInterfaceExtension. + * To add a new standard mark type, edit this interface to document the type. + */ + enum MarkTypes + { + /** Bookmark */ + markType01= 0x1, + /** Breakpoint active */ + markType02= 0x2, + /** Breakpoint reached */ + markType03= 0x4, + /** Breakpoint disabled */ + markType04= 0x8, + /** Execution mark */ + markType05= 0x10, + /** Warning */ + markType06= 0x20, + /** Error */ + markType07= 0x40, + + markType08= 0x80, + markType09= 0x100, + markType10= 0x200, + markType11= 0x400, + markType12= 0x800, + markType13= 0x1000, + markType14= 0x2000, + markType15= 0x4000, + markType16= 0x8000, + markType17= 0x10000, + markType18= 0x20000, + markType19= 0x40000, + markType20= 0x80000, + markType21= 0x100000, + markType22= 0x200000, + markType23= 0x400000, + markType24= 0x800000, + markType25= 0x1000000, + markType26= 0x2000000, + markType27= 0x4000000, + markType28= 0x8000000, + markType29= 0x10000000, + markType30= 0x20000000, + markType31= 0x40000000, + markType32= 0x80000000, + /* reserved marks */ + Bookmark = markType01, + BreakpointActive = markType02, + BreakpointReached = markType03, + BreakpointDisabled = markType04, + Execution = markType05, + Warning = markType06, + Error = markType07 + }; + + // + // signals !!! + // + public: + virtual void marksChanged () = 0; + + private: + class PrivateMarkInterface *d; + static unsigned int globalMarkInterfaceNumber; + unsigned int myMarkInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT MarkInterface *markInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/markinterfaceextension.cpp b/interfaces/tdetexteditor/markinterfaceextension.cpp new file mode 100644 index 000000000..86538abfc --- /dev/null +++ b/interfaces/tdetexteditor/markinterfaceextension.cpp @@ -0,0 +1,69 @@ +/* This file is part of the KDE libraries + Copyright (C) 2002 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "markinterfaceextension.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivateMarkInterfaceExtension +{ + public: + PrivateMarkInterfaceExtension() {} + ~PrivateMarkInterfaceExtension() {} +}; + +} + +using namespace KTextEditor; + +unsigned int MarkInterfaceExtension::globalMarkInterfaceExtensionNumber = 0; + +MarkInterfaceExtension::MarkInterfaceExtension() +{ + globalMarkInterfaceExtensionNumber++; + myMarkInterfaceExtensionNumber = globalMarkInterfaceExtensionNumber++; + + d = new PrivateMarkInterfaceExtension(); +} + +MarkInterfaceExtension::~MarkInterfaceExtension() +{ + delete d; +} + +unsigned int MarkInterfaceExtension::markInterfaceExtensionNumber () const +{ + return myMarkInterfaceExtensionNumber; +} + +void MarkInterfaceExtension::setMarkInterfaceExtensionDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("MarkInterfaceExtension#"+suffix); +} + +MarkInterfaceExtension *KTextEditor::markInterfaceExtension (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/markinterfaceextension.h b/interfaces/tdetexteditor/markinterfaceextension.h new file mode 100644 index 000000000..7aef736db --- /dev/null +++ b/interfaces/tdetexteditor/markinterfaceextension.h @@ -0,0 +1,83 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_markinterface_extension_h__ +#define __tdetexteditor_markinterface_extension_h__ + +#include +#include +#include +#include "markinterface.h" + +class TQCString; + +namespace KTextEditor +{ + + +/** +* This is an interface for custom extensions of the MarkInterface. +* It allows the developer to set pixmaps for custom marks and to indicate which +* marks are settable by the user, for example (in kate), as actions in the iconborder's popup menu. +*/ +class KTEXTEDITOR_EXPORT MarkInterfaceExtension +{ + friend class PrivateMarkInterfaceExtension; + + public: + MarkInterfaceExtension (); + virtual ~MarkInterfaceExtension (); + + unsigned int markInterfaceExtensionNumber () const; + + protected: + void setMarkInterfaceExtensionDCOPSuffix (const TQCString &suffix); + + public: + virtual void setPixmap(MarkInterface::MarkTypes, const TQPixmap &)=0; + virtual void setDescription(MarkInterface::MarkTypes, const TQString &)=0; + virtual void setMarksUserChangable(uint markMask)=0; + + enum MarkChangeAction { + MarkAdded=0, + MarkRemoved=1 + }; + // + // slots !!! + // + public: + + // + // signals !!! + // + public: + virtual void markChanged (KTextEditor::Mark mark, + KTextEditor::MarkInterfaceExtension::MarkChangeAction action) = 0; + + private: + class PrivateMarkInterfaceExtension *d; + static unsigned int globalMarkInterfaceExtensionNumber; + unsigned int myMarkInterfaceExtensionNumber; +}; + +KTEXTEDITOR_EXPORT MarkInterfaceExtension *markInterfaceExtension (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/plugin.h b/interfaces/tdetexteditor/plugin.h new file mode 100644 index 000000000..68416bf78 --- /dev/null +++ b/interfaces/tdetexteditor/plugin.h @@ -0,0 +1,88 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_plugin_h__ +#define __tdetexteditor_plugin_h__ + +#include + +#include + +namespace KTextEditor +{ + +class Document; +class View; + +/** + * Basic KTextEditor plugin class. + * This plugin will be bound to a Document. + */ +class KTEXTEDITOR_EXPORT Plugin : public TQObject +{ + friend class PrivatePlugin; + + Q_OBJECT + + public: + Plugin ( Document *document = 0, const char *name = 0 ); + virtual ~Plugin (); + + unsigned int pluginNumber () const; + + Document *document () const; + + private: + class PrivatePlugin *d; + static unsigned int globalPluginNumber; + unsigned int myPluginNumber; +}; + +KTEXTEDITOR_EXPORT Plugin *createPlugin ( const char* libname, Document *document = 0, const char *name = 0 ); + +/** + * View plugin class. + * This plugin will be bound to a View + */ +class KTEXTEDITOR_EXPORT PluginViewInterface +{ + friend class PrivatePluginViewInterface; + + public: + PluginViewInterface (); + virtual ~PluginViewInterface (); + + unsigned int pluginViewInterfaceNumber () const; + + /* + * will be called from the part to bound the plugin to a view + */ + virtual void addView (View *) = 0; + virtual void removeView (View *) = 0; + + private: + class PrivatePluginViewInterface *d; + static unsigned int globalPluginViewInterfaceNumber; + unsigned int myPluginViewInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT PluginViewInterface *pluginViewInterface (Plugin *plugin); + +} + +#endif diff --git a/interfaces/tdetexteditor/popupmenuinterface.cpp b/interfaces/tdetexteditor/popupmenuinterface.cpp new file mode 100644 index 000000000..350fa138b --- /dev/null +++ b/interfaces/tdetexteditor/popupmenuinterface.cpp @@ -0,0 +1,69 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "popupmenuinterface.h" +#include "view.h" + +namespace KTextEditor +{ + +class PrivatePopupMenuInterface +{ + public: + PrivatePopupMenuInterface() {} + ~PrivatePopupMenuInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int PopupMenuInterface::globalPopupMenuInterfaceNumber = 0; + +PopupMenuInterface::PopupMenuInterface() +{ + globalPopupMenuInterfaceNumber++; + myPopupMenuInterfaceNumber = globalPopupMenuInterfaceNumber++; + + d = new PrivatePopupMenuInterface(); +} + +PopupMenuInterface::~PopupMenuInterface() +{ + delete d; +} + +unsigned int PopupMenuInterface::popupMenuInterfaceNumber () const +{ + return myPopupMenuInterfaceNumber; +} + +void PopupMenuInterface::setPopupMenuInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("PopupMenuInterface#"+suffix); +} + +PopupMenuInterface *KTextEditor::popupMenuInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} diff --git a/interfaces/tdetexteditor/popupmenuinterface.h b/interfaces/tdetexteditor/popupmenuinterface.h new file mode 100644 index 000000000..3ca833709 --- /dev/null +++ b/interfaces/tdetexteditor/popupmenuinterface.h @@ -0,0 +1,66 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_popupmenuinterface_h__ +#define __tdetexteditor_popupmenuinterface_h__ + +#include + +class TQCString; +class TQPopupMenu; + +namespace KTextEditor +{ + +/** +* This is an interface to provide custom popup menus for a View. +*/ +class KTEXTEDITOR_EXPORT PopupMenuInterface +{ + friend class PrivatePopupMenuInterface; + + public: + PopupMenuInterface (); + virtual ~PopupMenuInterface (); + + unsigned int popupMenuInterfaceNumber () const; + + protected: + void setPopupMenuInterfaceDCOPSuffix (const TQCString &suffix); + + // + // normal methodes + // + public: + /** + Install a Popup Menu. The Popup Menu will be activated on + a right mouse button press event. + */ + virtual void installPopup (TQPopupMenu *rmb_Menu) = 0; + + private: + class PrivatePopupMenuInterface *d; + static unsigned int globalPopupMenuInterfaceNumber; + unsigned int myPopupMenuInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT PopupMenuInterface *popupMenuInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/printdcopinterface.cpp b/interfaces/tdetexteditor/printdcopinterface.cpp new file mode 100644 index 000000000..3b9eddfe9 --- /dev/null +++ b/interfaces/tdetexteditor/printdcopinterface.cpp @@ -0,0 +1,30 @@ +#include "printdcopinterface.h" +#include "printinterface.h" + +#include +using namespace KTextEditor; + +PrintDCOPInterface::PrintDCOPInterface( PrintInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +PrintDCOPInterface::~PrintDCOPInterface() +{ + +} + +uint PrintDCOPInterface::printInterfaceNumber () +{ + return m_parent->printInterfaceNumber(); +} +bool PrintDCOPInterface::printDialog () +{ + return m_parent->printDialog(); +} +bool PrintDCOPInterface::print () +{ + return m_parent->print(); +} + diff --git a/interfaces/tdetexteditor/printdcopinterface.h b/interfaces/tdetexteditor/printdcopinterface.h new file mode 100644 index 000000000..e41e6da5d --- /dev/null +++ b/interfaces/tdetexteditor/printdcopinterface.h @@ -0,0 +1,46 @@ +#ifndef Print_DCOP_INTERFACE_H +#define Print_DCOP_INTERFACE_H + +#include +#include +#include +#include +//#include "editdcopinterface.moc" +namespace KTextEditor +{ + class PrintInterface; + /** + This is the main interface to the PrintInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to PrintInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT PrintDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent PrintInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + PrintDCOPInterface( PrintInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~PrintDCOPInterface(); + k_dcop: + uint printInterfaceNumber () ; + bool printDialog (); + bool print (); + + private: + PrintInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/printinterface.cpp b/interfaces/tdetexteditor/printinterface.cpp new file mode 100644 index 000000000..5a4011eb4 --- /dev/null +++ b/interfaces/tdetexteditor/printinterface.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "printinterface.h" +#include "printdcopinterface.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivatePrintInterface +{ + public: + PrivatePrintInterface() {interface=0;} + ~PrivatePrintInterface() {} + PrintDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int PrintInterface::globalPrintInterfaceNumber = 0; + +PrintInterface::PrintInterface() +{ + globalPrintInterfaceNumber++; + myPrintInterfaceNumber = globalPrintInterfaceNumber++; + + d = new PrivatePrintInterface(); + TQString name = "PrintInterface#" + TQString::number(myPrintInterfaceNumber); + d->interface = new PrintDCOPInterface(this, name.latin1()); +} + +PrintInterface::~PrintInterface() +{ + delete d->interface; + delete d; +} + +unsigned int PrintInterface::printInterfaceNumber () const +{ + return myPrintInterfaceNumber; +} + +void PrintInterface::setPrintInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("PrintInterface#"+suffix); +} + +PrintInterface *KTextEditor::printInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/printinterface.h b/interfaces/tdetexteditor/printinterface.h new file mode 100644 index 000000000..cca453d6c --- /dev/null +++ b/interfaces/tdetexteditor/printinterface.h @@ -0,0 +1,63 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_printinterface_h__ +#define __tdetexteditor_printinterface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface to printing functions of a Document. +*/ +class KTEXTEDITOR_EXPORT PrintInterface +{ + friend class PrivatePrintInterface; + + public: + PrintInterface (); + virtual ~PrintInterface (); + + unsigned int printInterfaceNumber () const; + + protected: + void setPrintInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + virtual bool printDialog () = 0; + virtual bool print () = 0; + + private: + class PrivatePrintInterface *d; + static unsigned int globalPrintInterfaceNumber; + unsigned int myPrintInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT PrintInterface *printInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/searchdcopinterface.cpp b/interfaces/tdetexteditor/searchdcopinterface.cpp new file mode 100644 index 000000000..ce29e4927 --- /dev/null +++ b/interfaces/tdetexteditor/searchdcopinterface.cpp @@ -0,0 +1,95 @@ +#include "searchdcopinterface.h" +#include "searchinterface.h" + +#include +#include + +using namespace KTextEditor; + +SearchDCOPInterface::SearchDCOPInterface( SearchInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; + m_currentcol = 0; + m_currentrow = 0; + m_currentmatchlen = 0; +} + +SearchDCOPInterface::~SearchDCOPInterface() +{ + +} + +bool SearchDCOPInterface::findFirstString( TQString text, bool caseSensitive) +{ + return m_parent->searchText(0, 0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive); +} +bool SearchDCOPInterface::findNextString( TQString text, bool caseSensitive) +{ + return m_parent->searchText(m_currentrow, m_currentcol+1, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive); +} + +bool SearchDCOPInterface::findPreviousString( TQString text, bool caseSensitive) +{ + if( m_currentcol == 0) + m_currentrow--; + else + m_currentcol--; + return m_parent->searchText(m_currentrow, m_currentcol, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true); +} + +bool SearchDCOPInterface::findLastString( TQString text, bool caseSensitive) +{ + return m_parent->searchText(0,0, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive, true); +} + +bool SearchDCOPInterface::findStringAt( uint row, uint col, TQString text, bool caseSensitive) +{ + return m_parent->searchText(row,col, text, &m_currentrow, &m_currentcol, &m_currentmatchlen, caseSensitive); + +} + +bool SearchDCOPInterface::findFirstRegExp( TQString regexp) +{ + return m_parent->searchText( 0,0, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen); +} + +bool SearchDCOPInterface::findNextRegExp( TQString regexp) +{ + return m_parent->searchText( m_currentrow, m_currentcol+1, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen); +} + +bool SearchDCOPInterface::findPreviousRegExp( TQString regexp) +{ + if( m_currentcol == 0) + m_currentrow--; + else + m_currentcol--; + return m_parent->searchText( m_currentrow, m_currentcol, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true); + +} + +bool SearchDCOPInterface::findLastRegExp(TQString regexp) +{ + return m_parent->searchText( 0,0, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, true); +} + +bool SearchDCOPInterface::findRegExpAt( uint row, uint col, TQString regexp) +{ + return m_parent->searchText( row, col, TQRegExp(regexp), &m_currentrow, &m_currentcol, &m_currentmatchlen, false); +} + +uint SearchDCOPInterface::currentMatchLine() +{ + return m_currentrow; +} +uint SearchDCOPInterface::currentMatchCol() +{ + return m_currentcol; +} +uint SearchDCOPInterface::currentMatchLength() +{ + return m_currentmatchlen; +} + + diff --git a/interfaces/tdetexteditor/searchdcopinterface.h b/interfaces/tdetexteditor/searchdcopinterface.h new file mode 100644 index 000000000..d4f558a26 --- /dev/null +++ b/interfaces/tdetexteditor/searchdcopinterface.h @@ -0,0 +1,59 @@ +#ifndef SEARCH_DCOP_INTERFACE_H +#define SEARCH_DCOP_INTERFACE_H + +#include +#include +#include +#include + +namespace KTextEditor +{ + class SearchInterface; + /** + This is the main interface to the SearchInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to SearchInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT SearchDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent SearchInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + SearchDCOPInterface( SearchInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + **/ + virtual ~SearchDCOPInterface(); + k_dcop: + bool findFirstString(TQString text, bool caseSensitive); + bool findNextString(TQString text, bool caseSensitive); + bool findPreviousString( TQString text, bool caseSensitive); + bool findLastString(TQString text, bool caseSensitive); + bool findStringAt( uint row, uint col, TQString text, bool caseSensitive); + + bool findFirstRegExp( TQString regexp); + bool findNextRegExp( TQString regexp); + bool findPreviousRegExp( TQString regexp); + bool findLastRegExp( TQString regexp); + bool findRegExpAt( uint row, uint col, TQString regexp); + + uint currentMatchLine(); + uint currentMatchCol(); + uint currentMatchLength(); + + private: + SearchInterface *m_parent; + uint m_currentcol; + uint m_currentrow; + uint m_currentmatchlen; + }; +} +#endif diff --git a/interfaces/tdetexteditor/searchinterface.cpp b/interfaces/tdetexteditor/searchinterface.cpp new file mode 100644 index 000000000..6ea021e0d --- /dev/null +++ b/interfaces/tdetexteditor/searchinterface.cpp @@ -0,0 +1,55 @@ +#include "searchinterface.h" +#include "searchdcopinterface.h" +#include "document.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateSearchInterface + { + public: + PrivateSearchInterface() + { + interface = 0; + } + ~PrivateSearchInterface(){} + // Data Members + SearchDCOPInterface *interface; + }; + +} + +unsigned int SearchInterface::globalSearchInterfaceNumber = 0; + +SearchInterface::SearchInterface() +{ + d = new PrivateSearchInterface(); + globalSearchInterfaceNumber++; + mySearchInterfaceNumber=globalSearchInterfaceNumber; + TQString name = "SearchInterface#" + TQString::number(mySearchInterfaceNumber); + d->interface = new SearchDCOPInterface(this, name.latin1()); +} +SearchInterface::~SearchInterface() +{ + delete d->interface; + delete d; +} + +unsigned int SearchInterface::searchInterfaceNumber () const +{ + return mySearchInterfaceNumber; +} + +void SearchInterface::setSearchInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("SearchInterface#"+suffix); +} + +SearchInterface *KTextEditor::searchInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/searchinterface.h b/interfaces/tdetexteditor/searchinterface.h new file mode 100644 index 000000000..f16c76dd1 --- /dev/null +++ b/interfaces/tdetexteditor/searchinterface.h @@ -0,0 +1,65 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_searchinterface_h__ +#define __tdetexteditor_searchinterface_h__ + +#include + +class TQRegExp; +class TQString; +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface to allow searching of a Document. +*/ +class KTEXTEDITOR_EXPORT SearchInterface +{ + friend class PrivateSearchInterface; + + public: + SearchInterface(); + virtual ~SearchInterface(); + + unsigned int searchInterfaceNumber () const; + + protected: + void setSearchInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + virtual bool searchText (unsigned int startLine, unsigned int startCol, const TQString &text, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool casesensitive = true, bool backwards = false) = 0; + virtual bool searchText (unsigned int startLine, unsigned int startCol, const TQRegExp ®exp, unsigned int *foundAtLine, unsigned int *foundAtCol, unsigned int *matchLen, bool backwards = false) = 0; + + private: + class PrivateSearchInterface *d; + static unsigned int globalSearchInterfaceNumber; + unsigned int mySearchInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT SearchInterface *searchInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/selectiondcopinterface.cpp b/interfaces/tdetexteditor/selectiondcopinterface.cpp new file mode 100644 index 000000000..f341297e0 --- /dev/null +++ b/interfaces/tdetexteditor/selectiondcopinterface.cpp @@ -0,0 +1,64 @@ +#include "selectiondcopinterface.h" +#include "selectioninterface.h" + +#include +using namespace KTextEditor; + +SelectionDCOPInterface::SelectionDCOPInterface( SelectionInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +SelectionDCOPInterface::~SelectionDCOPInterface() +{ + +} + + /** + * @return set the selection from line_start,col_start to line_end,col_end + */ + bool SelectionDCOPInterface::setSelection ( uint startLine, uint startCol, uint endLine, uint endCol ) + { + return m_parent->setSelection ( startLine, startCol, endLine, endCol ); + } + + /** + * removes the current Selection (not Text) + */ + bool SelectionDCOPInterface::clearSelection () + { + return m_parent->clearSelection(); + } + + /** + * @return true if there is a selection + */ + bool SelectionDCOPInterface::hasSelection () + { + return m_parent->hasSelection(); + } + + /** + * @return a TQString for the selected text + */ + TQString SelectionDCOPInterface::selection () + { + return m_parent->selection(); + } + + /** + * removes the selected Text + */ + bool SelectionDCOPInterface::removeSelectedText () + { + return m_parent->removeSelectedText(); + } + + /** + * select the whole text + */ + bool SelectionDCOPInterface::selectAll () + { + return m_parent->selectAll(); + } diff --git a/interfaces/tdetexteditor/selectiondcopinterface.h b/interfaces/tdetexteditor/selectiondcopinterface.h new file mode 100644 index 000000000..aa2973540 --- /dev/null +++ b/interfaces/tdetexteditor/selectiondcopinterface.h @@ -0,0 +1,72 @@ +#ifndef SELECTION_DCOP_INTERFACE_H +#define SELECTION_DCOP_INTERFACE_H + +#include +#include +#include +#include + +namespace KTextEditor +{ + class SelectionInterface; + /** + This is the main interface to the SelectionInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to SelectionInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT SelectionDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent SelectionInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + SelectionDCOPInterface( SelectionInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + **/ + virtual ~SelectionDCOPInterface(); + k_dcop: + /** + * @return set the selection from line_start,col_start to line_end,col_end + */ + bool setSelection ( uint startLine, uint startCol, uint endLine, uint endCol ); + + /** + * removes the current Selection (not Text) + */ + bool clearSelection (); + + /** + * @return true if there is a selection + */ + bool hasSelection (); + + /** + * @return a TQString for the selected text + */ + TQString selection (); + + /** + * removes the selected Text + */ + bool removeSelectedText (); + + /** + * select the whole text + */ + bool selectAll (); + + private: + SelectionInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/selectionextdcopinterface.h b/interfaces/tdetexteditor/selectionextdcopinterface.h new file mode 100644 index 000000000..5c3e32baf --- /dev/null +++ b/interfaces/tdetexteditor/selectionextdcopinterface.h @@ -0,0 +1,57 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Anders Lund + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + $Id$ +*/ + +#ifndef _SELECTION_EXT_DCOP_INTERFACE_H_ +#define _SELECTION_EXT_DCOP_INTERFACE_H_ + +#include "selectioninterfaceext.h" + +#include +#include +#include + +namespace KTextEditor { +/** + DCOP interface for the SelectionInterfaceExt. + @author Anders Lund +*/ +class KTEXTEDITOR_EXPORT SelectionExtDCOPInterface : virtual public DCOPObject +{ + K_DCOP + public: + SelectionExtDCOPInterface( SelectionInterfaceExt *parent, const char *name ); + virtual ~SelectionExtDCOPInterface(); + k_dcop: + /** The selection start line number */ + int selStartLine(); + /** The selection start col */ + int selStartCol(); + /** The selection end line */ + int selEndLine(); + /** The selection end col */ + int selEndCol(); + private: + SelectionInterfaceExt *m_parent; +}; + +} // namespace KTextEditor + +#endif // _SELECTION_EXT_DCOP_INTERFACE_H_ diff --git a/interfaces/tdetexteditor/selectioninterface.cpp b/interfaces/tdetexteditor/selectioninterface.cpp new file mode 100644 index 000000000..0a8dc6b00 --- /dev/null +++ b/interfaces/tdetexteditor/selectioninterface.cpp @@ -0,0 +1,65 @@ +#include "selectioninterface.h" +#include "selectiondcopinterface.h" +#include "document.h" +#include "view.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateSelectionInterface + { + public: + PrivateSelectionInterface() + { + interface = 0; + } + ~PrivateSelectionInterface(){} + // Data Members + SelectionDCOPInterface *interface; + }; + +} + +unsigned int SelectionInterface::globalSelectionInterfaceNumber = 0; + +SelectionInterface::SelectionInterface() +{ + d = new PrivateSelectionInterface(); + globalSelectionInterfaceNumber++; + mySelectionInterfaceNumber = globalSelectionInterfaceNumber; + TQString name = "SelectionInterface#" + TQString::number(mySelectionInterfaceNumber); + d->interface = new SelectionDCOPInterface(this, name.latin1()); +} +SelectionInterface::~SelectionInterface() +{ + delete d->interface; + delete d; +} + +unsigned int SelectionInterface::selectionInterfaceNumber () const +{ + return mySelectionInterfaceNumber; +} + +void SelectionInterface::setSelectionInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("SelectionInterface#"+suffix); +} + +SelectionInterface *KTextEditor::selectionInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + +SelectionInterface *KTextEditor::selectionInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} + diff --git a/interfaces/tdetexteditor/selectioninterface.h b/interfaces/tdetexteditor/selectioninterface.h new file mode 100644 index 000000000..03f50de33 --- /dev/null +++ b/interfaces/tdetexteditor/selectioninterface.h @@ -0,0 +1,100 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_selectioninterface_h__ +#define __tdetexteditor_selectioninterface_h__ + +#include + +#include + +namespace KTextEditor +{ + +/** +* This is an interface to text selection for the Document class. +*/ +class KTEXTEDITOR_EXPORT SelectionInterface +{ + friend class PrivateSelectionInterface; + + public: + SelectionInterface(); + virtual ~SelectionInterface(); + + unsigned int selectionInterfaceNumber () const; + + protected: + void setSelectionInterfaceDCOPSuffix (const TQCString &suffix); + + /* + * slots !!! + */ + public: + /** + * @return set the selection from line_start,col_start to line_end,col_end + */ + virtual bool setSelection ( unsigned int startLine, unsigned int startCol, unsigned int endLine, unsigned int endCol ) = 0; + + /** + * removes the current Selection (not Text) + */ + virtual bool clearSelection () = 0; + + /** + * @return true if there is a selection + */ + virtual bool hasSelection () const = 0; + + /** + * @return a TQString for the selected text + */ + virtual TQString selection () const = 0; + + /** + * removes the selected Text + */ + virtual bool removeSelectedText () = 0; + + /** + * select the whole text + */ + virtual bool selectAll () = 0; + + // + // signals !!! + // + public: + virtual void selectionChanged () = 0; + + private: + class PrivateSelectionInterface *d; + static unsigned int globalSelectionInterfaceNumber; + unsigned int mySelectionInterfaceNumber; +}; + +class Document; +class View; + +KTEXTEDITOR_EXPORT SelectionInterface *selectionInterface (Document *doc); +KTEXTEDITOR_EXPORT SelectionInterface *selectionInterface (View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/selectioninterfaceext.cpp b/interfaces/tdetexteditor/selectioninterfaceext.cpp new file mode 100644 index 000000000..3034f33a5 --- /dev/null +++ b/interfaces/tdetexteditor/selectioninterfaceext.cpp @@ -0,0 +1,115 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Anders Lund + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + $Id$ +*/ + +#include "selectioninterfaceext.h" +#include "selectionextdcopinterface.h" +#include "document.h" +#include "view.h" +#include + +using namespace KTextEditor; + +//BEGIN KTextEditor::SelectionInterfaceExt +class KTextEditor::PrivateSelectionInterfaceExt { + public: + PrivateSelectionInterfaceExt() : interface( 0 ) {} + ~PrivateSelectionInterfaceExt() {} + + SelectionExtDCOPInterface *interface; +}; + +unsigned int SelectionInterfaceExt::globalSelectionInterfaceExtNumber = 0; + +SelectionInterfaceExt::SelectionInterfaceExt() + : d ( new PrivateSelectionInterfaceExt ) +{ + globalSelectionInterfaceExtNumber++; + mySelectionInterfaceExtNumber = globalSelectionInterfaceExtNumber; + TQString name = "SelectionInterfaceExt#" + TQString::number(mySelectionInterfaceExtNumber); + d->interface = new SelectionExtDCOPInterface(this, name.latin1()); +} + +SelectionInterfaceExt::~SelectionInterfaceExt() +{ + delete d->interface; + delete d; +} + +unsigned int SelectionInterfaceExt::selectionInterfaceExtNumber () const +{ + return mySelectionInterfaceExtNumber; +} + +void SelectionInterfaceExt::setSelectionInterfaceExtDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("SelectionInterfaceExt#"+suffix); +} + +SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + +SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} + +//END KTextEditor::SelectionInterfaceExt + +//BEGIN KTextEditor::SelectionExtDCOPInterface +SelectionExtDCOPInterface::SelectionExtDCOPInterface( + SelectionInterfaceExt *parent, const char* name ) + : DCOPObject( name ), + m_parent( parent ) +{ +} + +SelectionExtDCOPInterface::~SelectionExtDCOPInterface() +{ +} + +int SelectionExtDCOPInterface::selStartLine() +{ + return m_parent->selStartLine(); +} + +int SelectionExtDCOPInterface::selStartCol() +{ + return m_parent->selStartCol(); +} + +int SelectionExtDCOPInterface::selEndLine() +{ + return m_parent->selEndLine(); +} + +int SelectionExtDCOPInterface::selEndCol() +{ + return m_parent->selEndCol(); +} +//END KTextEditor::SelectionExtDCOPInterface diff --git a/interfaces/tdetexteditor/selectioninterfaceext.h b/interfaces/tdetexteditor/selectioninterfaceext.h new file mode 100644 index 000000000..8f57fb7e9 --- /dev/null +++ b/interfaces/tdetexteditor/selectioninterfaceext.h @@ -0,0 +1,74 @@ +/* This file is part of the KDE project + Copyright (C) 2002 Anders Lund + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + $Id$ +*/ + +#ifndef __tdetexteditor_selectioninterface_ext_h__ +#define __tdetexteditor_selectioninterface_ext_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** + Provide access to seleciton positions. + This is an interface for the Document class. + Mainly here for dcop and the sake of scripting. + @author Anders Lund +*/ +class KTEXTEDITOR_EXPORT SelectionInterfaceExt +{ + friend class PrivateSelectionInterfaceExt; + + public: + SelectionInterfaceExt(); + virtual ~SelectionInterfaceExt(); + + unsigned int selectionInterfaceExtNumber () const; + + protected: + void setSelectionInterfaceExtDCOPSuffix (const TQCString &suffix); + + public: + /** The selection start line number */ + virtual int selStartLine()=0; + /** The selection start col */ + virtual int selStartCol()=0; + /** The selection end line */ + virtual int selEndLine()=0; + /** The selection end col */ + virtual int selEndCol()=0; + + private: + class PrivateSelectionInterfaceExt *d; + static unsigned int globalSelectionInterfaceExtNumber; + unsigned int mySelectionInterfaceExtNumber; +}; + +class Document; +class View; + +KTEXTEDITOR_EXPORT SelectionInterfaceExt *selectionInterfaceExt (Document *doc); +KTEXTEDITOR_EXPORT SelectionInterfaceExt *selectionInterfaceExt (View *view); + +} // namespace KTextEditor +#endif diff --git a/interfaces/tdetexteditor/sessionconfiginterface.cpp b/interfaces/tdetexteditor/sessionconfiginterface.cpp new file mode 100644 index 000000000..def7bf0a5 --- /dev/null +++ b/interfaces/tdetexteditor/sessionconfiginterface.cpp @@ -0,0 +1,88 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "sessionconfiginterface.h" + +#include "document.h" +#include "view.h" +#include "plugin.h" + +namespace KTextEditor +{ + +class PrivateSessionConfigInterface +{ + public: + PrivateSessionConfigInterface() {} + ~PrivateSessionConfigInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int SessionConfigInterface::globalSessionConfigInterfaceNumber = 0; + +SessionConfigInterface::SessionConfigInterface() +{ + globalSessionConfigInterfaceNumber++; + mySessionConfigInterfaceNumber = globalSessionConfigInterfaceNumber++; + + d = new PrivateSessionConfigInterface(); +} + +SessionConfigInterface::~SessionConfigInterface() +{ + delete d; +} + +unsigned int SessionConfigInterface::configInterfaceNumber () const +{ + return mySessionConfigInterfaceNumber; +} + +void SessionConfigInterface::setSessionConfigInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("SessionConfigInterface#"+suffix); +} + +SessionConfigInterface *KTextEditor::sessionConfigInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} + +SessionConfigInterface *KTextEditor::sessionConfigInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} + +SessionConfigInterface *KTextEditor::sessionConfigInterface (Plugin *plugin) +{ + if (!plugin) + return 0; + + return dynamic_cast(plugin); +} diff --git a/interfaces/tdetexteditor/sessionconfiginterface.h b/interfaces/tdetexteditor/sessionconfiginterface.h new file mode 100644 index 000000000..f92502b36 --- /dev/null +++ b/interfaces/tdetexteditor/sessionconfiginterface.h @@ -0,0 +1,71 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_sessionconfiginterface_h__ +#define __tdetexteditor_sessionconfiginterface_h__ + +#include + +class TQCString; +class TDEConfig; + +namespace KTextEditor +{ + +/** +* This is an interface to session-specific configuration of the +* Document, Plugin and PluginViewInterface classes. +*/ +class KTEXTEDITOR_EXPORT SessionConfigInterface +{ + friend class PrivateSessionConfigInterface; + + public: + SessionConfigInterface(); + virtual ~SessionConfigInterface(); + + unsigned int configInterfaceNumber () const; + + protected: + void setSessionConfigInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + /** + * Read/Write session config of only this document/view/plugin + * In case of the document, that means for example it should reload the file, + * restore all marks, ... + */ + virtual void readSessionConfig (TDEConfig *) = 0; + virtual void writeSessionConfig (TDEConfig *) = 0; + + private: + class PrivateSessionConfigInterface *d; + static unsigned int globalSessionConfigInterfaceNumber; + unsigned int mySessionConfigInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class Document *doc); +KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class View *view); +KTEXTEDITOR_EXPORT SessionConfigInterface *sessionConfigInterface (class Plugin *plugin); + +} + +#endif diff --git a/interfaces/tdetexteditor/tdetexteditor.cpp b/interfaces/tdetexteditor/tdetexteditor.cpp new file mode 100644 index 000000000..354361ed2 --- /dev/null +++ b/interfaces/tdetexteditor/tdetexteditor.cpp @@ -0,0 +1,242 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "document.h" +#include "view.h" +#include "plugin.h" +#include "editor.h" + +#include +#include +#include + +#include "document.moc" +#include "view.moc" +#include "plugin.moc" +#include "editor.moc" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateDocument + { + public: + PrivateDocument () + { + } + + ~PrivateDocument() + { + } + }; + + class PrivateView + { + public: + PrivateView () + { + } + + ~PrivateView() + { + } + }; + + class PrivatePlugin + { + public: + PrivatePlugin () + { + } + + ~PrivatePlugin () + { + } + + class Document *m_doc; + }; + + class PrivatePluginViewInterface + { + public: + PrivatePluginViewInterface () + { + } + + ~PrivatePluginViewInterface () + { + } + }; + + class PrivateEditor + { + public: + PrivateEditor () + { + } + + ~PrivateEditor() + { + } + }; +} + +unsigned int Document::globalDocumentNumber = 0; +unsigned int View::globalViewNumber = 0; +unsigned int Plugin::globalPluginNumber = 0; +unsigned int PluginViewInterface::globalPluginViewInterfaceNumber = 0; +unsigned int Editor::globalEditorNumber = 0; + +Document::Document( TQObject *parent, const char *name ) : KTextEditor::Editor (parent, name ) +{ + globalDocumentNumber++; + myDocumentNumber = globalDocumentNumber; + myDocumentListPosition = -1; // Don't care +} + +Document::~Document() +{ +} + +unsigned int Document::documentNumber () const +{ + return myDocumentNumber; +} + +long Document::documentListPosition () const +{ + return myDocumentListPosition; +} + +void Document::setDocumentListPosition (long pos) +{ + myDocumentListPosition = pos; +} + +TQCString Document::documentDCOPSuffix () const +{ + TQCString num; + num.setNum (documentNumber()); + + return num; +} + +View::View( Document *, TQWidget *parent, const char *name ) : TQWidget( parent, name ) +{ + globalViewNumber++; + myViewNumber = globalViewNumber; +} + +View::~View() +{ +} + +unsigned int View::viewNumber () const +{ + return myViewNumber; +} + +TQCString View::viewDCOPSuffix () const +{ + TQCString num1, num2; + num1.setNum (viewNumber()); + num2.setNum (document()->documentNumber()); + + return num2 + "-" + num1; +} + +Plugin::Plugin( Document *document, const char *name ) : TQObject (document, name ) +{ + globalPluginNumber++; + myPluginNumber = globalPluginNumber; + d = new PrivatePlugin (); + d->m_doc = document; +} + +Plugin::~Plugin() +{ + delete d; +} + +unsigned int Plugin::pluginNumber () const +{ + return myPluginNumber; +} + +Document *Plugin::document () const +{ + return d->m_doc; +} + +PluginViewInterface::PluginViewInterface() +{ + globalPluginViewInterfaceNumber++; + myPluginViewInterfaceNumber = globalPluginViewInterfaceNumber; +} + +PluginViewInterface::~PluginViewInterface() +{ +} + +unsigned int PluginViewInterface::pluginViewInterfaceNumber () const +{ + return myPluginViewInterfaceNumber; +} + +Editor::Editor( TQObject *parent, const char *name ) : KParts::ReadWritePart( parent, name ) +{ + globalEditorNumber++; + myEditorNumber = globalEditorNumber; +} + +Editor::~Editor() +{ +} + +unsigned int Editor::editorNumber () const +{ + return myEditorNumber; +} + +Editor *KTextEditor::createEditor ( const char* libname, TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name ) +{ + return KParts::ComponentFactory::createPartInstanceFromLibrary( libname, parentWidget, widgetName, parent, name ); +} + +Document *KTextEditor::createDocument ( const char* libname, TQObject *parent, const char *name ) +{ + return KParts::ComponentFactory::createPartInstanceFromLibrary( libname, 0, 0, parent, name ); +} + +Plugin *KTextEditor::createPlugin ( const char* libname, Document *document, const char *name ) +{ + return KParts::ComponentFactory::createInstanceFromLibrary( libname, document, name ); +} + +PluginViewInterface *KTextEditor::pluginViewInterface (Plugin *plugin) +{ + if (!plugin) + return 0; + + return dynamic_cast(plugin); +} + diff --git a/interfaces/tdetexteditor/tdetexteditor.desktop b/interfaces/tdetexteditor/tdetexteditor.desktop new file mode 100644 index 000000000..17556bdf6 --- /dev/null +++ b/interfaces/tdetexteditor/tdetexteditor.desktop @@ -0,0 +1,86 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=KTextEditor/Document +X-TDE-Derived=KParts/ReadWritePart +Comment=Embeddable Text Editor Component (with Doc/View Separation) +Comment[af]=Inlegbare Teks Redigeerder Komponent (met Dok/Besigtig Seperasie) +Comment[ar]=مكوّن تحرير النصوص القابل للدمج )مع Doc/View Separation( +Comment[az]=Hopdurula Bilən Mətn Editor Komponenti (Doc/Nümayiş Ayrımlı) +Comment[be]=Унутраны тэкставы рэдактар (з падзелам Дакумент/Прагляд) +Comment[bg]=Текстов редактор (с разделение между Doc/View) +Comment[bn]=অভ্যন্তরীণ টেক্সট সম্পাদক কম্পোনেন্ট (পৃথক ডক/ভিউ সহ) +Comment[bs]=Umetljiva komponenta za obradu teksta (sa odvojenim Doc/View) +Comment[ca]=Component encastable de l'editor de text (amb separació Doc/Vista) +Comment[cs]=Pohltitelná komponenta textového editoru (s oddělením Doc/View) +Comment[csb]=Dzéł editora tekstu (do òbsôdzaniô, z paradygmatã Dokùment/Wëzdrzatk) +Comment[cy]=Cydran Golygydd Testun Mewnadeiladwy (wrth Wahanu Dogfen/Golwg) +Comment[da]=Teksteditorkomponent som kan indlejres (med dok./visning-adskillelse) +Comment[de]=Einbettungsfähige Editorkomponente (mit Text/Ansicht-Aufteilung) +Comment[el]=Ενσωματώσιμο στοιχείο επεξεργαστή κειμένου (με διαχωρισμό Doc/View) +Comment[eo]=Enkorpigebla redaktilo (kun apartigo de dokumento kaj rigardo) +Comment[es]=Componente incrustable de editor de textos (con separación Doc/Vista) +Comment[et]=Põimitav tekstiredaktori komponent (dokument/vaade eraldamisega) +Comment[eu]=Testu-editorearen kapsulatutako osagaia (Dok/Ikusi bereizketarekin) +Comment[fa]=مولفۀ ویرایشگر متن نهفته )با سند/نمای مجزا( +Comment[fi]=Upotettava tekstimuokkauskomponentti (Asiakirja/Näkymä-jaolla) +Comment[fr]=Composant d'édition de texte intégrable (avec séparation doc / vue) +Comment[fy]=Yn te sluten tekstbewurkerkomponint (mei skieding fan tekst/werjefte) +Comment[ga]=Comhpháirt eagarthóireacht téacs inleabaithe (le deighilt idir cáipéis agus amharc) +Comment[gl]=Compoñente incrustábel de Edición de Texto (cunha Separación Doc/Vista) +Comment[he]=רכיב עורך טקסט בר הטבעה (עם הפרדה בין מסמך לתצוגה) +Comment[hi]=अंतर्निहित किया जा सकने वाला पाठ संपादक (डाक/व्यू सेपरेशन के साथ) +Comment[hr]=Ugradiva komponenta obrade teksta (s Doc/View razdvajanjem) +Comment[hsb]=Komponenta za integrowane wobdźěłanje teksta +Comment[hu]=Beágyazható szövegszerkesztő (dokumentum/nézet modellel) +Comment[id]=Komponen Penyuntingan Teks Tersisipkan (dengan Pemisahan Doc/View) +Comment[is]=Ívafinn textaritill (með skjal/sýn aðskilnaði) +Comment[it]=Componente integrabile per l'elaborazione di testi (con separazione documento/vista) +Comment[ja]=埋め込み可能なテキストエディタコンポーネント (Doc/View 分離) +Comment[ka]=ტექსტის რედაქტირების ჩადგმადი კომპონენტი (დოკუმენტი/ჩვენება მოდელის მხარდაჭერით) +Comment[kk]=Ендірілетін мәтін өңдеу компоненті (Құжат/көрініс үлгіні қолдайтын) +Comment[km]=សមាសភាគ​កម្មវិធីនិពន្ធ​អត្ថបទដែល​អាចបង្កប់ (ដោយ​ប្រើ​ការ​បំបែក Doc/View) +Comment[ko]=끼워넣는 글월 편집기 구성 요소 (Doc/View 나눔) +Comment[lb]=Abettbar Texteditor-Komponent (mat Dokument/Usiicht Trennung) +Comment[lt]=Įdedamas tekstų redaktoriaus komponentas (su Doc/View atskyrimu) +Comment[lv]=Iegulstama tekstu redaktora komponente (ar Dok/Skatīt atdalīšanu) +Comment[mk]=Вгнездлива компонента за уредување на текст (со Док/Приказ раздвојување) +Comment[mn]=Суулгах боломж бүхий засварлагчийн бүрдэл хэсэг(Teкст/Харах-тусгаарлалттай) +Comment[ms]=Komponen Penyunting Teks Boleh Selit (Dokumentasi/Pelihat berasingan) +Comment[mt]=Komponent integrat editur tat-test (b'separazzjoni dokument/wiri) +Comment[nb]=Innebyggbar tekstredigeringskomponent (med Doc/View-skille) +Comment[nds]=Inbettbor Texteditor-Komponent (mit Dokment/Ansicht-Trennen) +Comment[ne]=सम्मिलित पाठ सम्पादक अवयव (डक/दृश्य विभाजनसँग) +Comment[nl]=Ingebed teksteditorcomponent (met scheiding van tekst/weergave) +Comment[nn]=Inkluderbart komponent for tekstvising (med Doc/View-deling) +Comment[nso]=Seripa seo se Robatsegago sa Mofetosi wa Sengwalwana (le Karogano ya Doc/Bona) +Comment[pa]=ਸ਼ਾਮਿਲ ਹੋਣਯੋਗ ਪਾਠ ਸੰਪਾਦਕ ਭਾਗ (Doc/ਦਰਿਸ਼ ਵੱਖ ਕਰਨ ਨਾਲ) +Comment[pl]=Składnik edytora tekstu (do osadzania, z paradygmatem Dokument/Widok) +Comment[pt]=Componente Incorporado do Editor de Texto (com Separação entre Documentos) +Comment[pt_BR]=Componente de edição de textos integrado (com separação de Documentação/Visualização) +Comment[ro]=Componentă de editare text (cu separare Doc/Vizualizare) +Comment[ru]=Встраиваемый элемент редактора текста (с поддержкой модели документ/вид) +Comment[rw]=Inyangingo Muhinduzi y'Umwandiko Ishyirwamo (ifite itandukanya Inyandiko/Ukugaragaza) +Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (Doc/View-sirremiin) +Comment[sk]=Vložiteľný komponent textového editora (s oddelením Doc/View) +Comment[sl]=Vgradljiva komponenta urejevalnika besedil (z ločevanjem pogleda in dokumenta) +Comment[sq]=Komponenta e ngulshme e Tekst Editorit (me ndarje Dokument/Vështrues) +Comment[sr]=Уградива компонента за уређивање текста (са „документ/приказ“ одвајањем) +Comment[sr@Latn]=Ugradiva komponenta za uređivanje teksta (sa „dokument/prikaz“ odvajanjem) +Comment[ss]=Incenye yesihleli sembhalo lenamatselekako (ne Doc/Bona kwehlukana) +Comment[sv]=Inbäddningsbar texteditor (med dok/vyseparation) +Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் பகுதி (ஆவண/காட்சி பிரிவுகளுடன்) +Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన వున్నది) +Comment[tg]=Қисми таҳриргари матни дарунсохт (бо вазифаи намоиши санад) +Comment[th]=คอมโปเนนท์แก้ไขข้อความที่ฝังได้ (โดยแยก เอกสาร/แสดงผล) +Comment[tr]=Gömülebilir Metin Düzenleyici Bileşeni (Doc/View ayrımı dahil) +Comment[tt]=Mäten Üzgärtüçe Quşılma-Komponent (İstälek/Küreneş ayıru belän) +Comment[uk]=Компонент редактора текстів, який можна вбудовувати (з розділенням документ/вигляд) +Comment[uz]=Ichiga oʻrnatib boʻladigan matn tahrirchi komponenti (hujjat/koʻrinish imkoniyati bilan) +Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган матн таҳрирчи компоненти (ҳужжат/кўриниш имконияти билан) +Comment[ven]=Khomphonente ya musengulusi ya manwalwa (ina Doc/u khethekana ha u vhona) +Comment[vi]=Thành phần Soạn thảo Văn bản có nhúng được (có khả năng phân cách tài liệu/khung xem) +Comment[xh]=Inxenye Yomhleli Wombhalo Olungiselelweyo (ngo Xwebhu/Ulwahlulo Lwemboniselo) +Comment[zh_CN]=可嵌入的文本编辑器部件(带 文档/查看 分离) +Comment[zh_HK]=可嵌入的文字編輯器元件 (Doc/View 分開) +Comment[zh_TW]=可嵌入的文字編輯器元件 (Doc/View 分開) +Comment[zu]=IIunga Lomlungisi Wombhalo (Ngokuhlukana kwe-Doc/Umbukiso) diff --git a/interfaces/tdetexteditor/tdetexteditoreditor.desktop b/interfaces/tdetexteditor/tdetexteditoreditor.desktop new file mode 100644 index 000000000..6048da92b --- /dev/null +++ b/interfaces/tdetexteditor/tdetexteditoreditor.desktop @@ -0,0 +1,86 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=KTextEditor/Editor +X-TDE-Derived=KParts/ReadWritePart +Comment=Embeddable Text Editor Component (without Doc/View Separation) +Comment[af]=Inlegbare Teks Redigeerder Komponent (sonder om te Dok/Besigtig Seperasie) +Comment[ar]=مكوّن تحرير النصوص القابل للدمج )مع Doc/View Separation( +Comment[az]=Hopdurula Bilən Mətn Editor Komponenti (Doc/Nümayiş Ayrımsız) +Comment[be]=Унутраны тэкставы рэдактар (без падзелу Дакумент/Прагляд) +Comment[bg]=Текстов редактор (без разделение между Doc/View) +Comment[bn]=অভ্যন্তরীণ টেক্সট সম্পাদক কম্পোনেন্ট (পৃথক ডক/ভিউ ছাড়া) +Comment[bs]=Umetljiva komponenta za obradu teksta (bez odvojenog Doc/View) +Comment[ca]=Component encastable de l'editor de text (sense separació Doc/Vista) +Comment[cs]=Pohltitelná komponenta textového editoru (bez oddělení Doc/View) +Comment[csb]=Dzéł editora tekstu (do òbsôdzaniô, bez paradygmatu Dokùment/Wëzdrzatk) +Comment[cy]=Cydran Golygydd Testun Mewnadeiladwy (heb Wahanu Dogfen/Golwg) +Comment[da]=Teksteditorkomponent som kan indlejres (uden dok./visning-adskillelse) +Comment[de]=Einbettungsfähige Editorkomponente (ohne Text/Ansicht-Aufteilung) +Comment[el]=Ενσωματώσιμο στοιχείο επεξεργαστή κειμένου (χωρίς διαχωρισμό Doc/View) +Comment[eo]=Enkorpigebla redaktilo (sen apartigo de dokumento kaj rigardo) +Comment[es]=Componente incrustable de editor de textos (sin separación Doc/Vista) +Comment[et]=Põimitav tekstiredaktori komponent +Comment[eu]=Testu-editorearen kapsulatutako osagaia (Dok/Ikusi bereizketarik gabe) +Comment[fa]=مولفۀ ویرایشگر متن نهفته ) بدون سند/نمای مجزا( +Comment[fi]=Upotettava tekstimuokkauskomponentti (ilman Asiakirja/Näkymä-jakoa) +Comment[fr]=Composant d'édition de texte intégrable (sans séparation doc / vue) +Comment[fy]=Yn te sluten tekstbewurkerkomponint (sûnder skieding fan tekst/werjefte) +Comment[ga]=Comhpháirt eagarthóireacht téacs inleabaithe (gan deighilt idir cáipéis agus amharc) +Comment[gl]=Compoñente incrustábel de Edición de Texto (sen Separación Doc/Vista) +Comment[he]=רכיב עורך טקסט בר הטבעה (בלי הפרדה בין מסמך לתצוגה) +Comment[hi]=अंतर्निहित किया जा सकने वाला पाठ संपादक (डाक/व्यू सेपरेशन के बगैर) +Comment[hr]=Ugradiva komponenta obrade teksta (bez Doc/View razdvajanja) +Comment[hsb]=Integrujomna komponenta za wobdźěłanje tekstow (bjez doc/view-separacije) +Comment[hu]=Beágyazható szövegszerkesztő (dokumentum/nézet modell nélkül) +Comment[id]=Komponen Penyuntingan Teks Tersisipkan (tanpa Pemisahan Doc/View) +Comment[is]=Ívafinn textaritill (án skjal/sýn aðskilnaðar) +Comment[it]=Componente integrabile per l'elaborazione di testi (senza separazione documento/vista) +Comment[ja]=埋め込み可能なテキストエディタコンポーネント (Doc/View 分離なし) +Comment[ka]=ტექსტის რედაქტირების ჩადგმადი კომპონენტი (დოკუმენტი/ჩვენება მოდელის მხარდაჭერის გარეშე) +Comment[kk]=Ендірілетін мәтін өңдеу компоненті (Құжат/көрініс үлгіні қолдамайтын) +Comment[km]=សមាសភាគ​កម្មវិធីនិពន្ធ​អត្ថបទ​ដែល​អាច​បង្កប់ (ដោយ​គ្មាន​ការបំបែក Doc/View) +Comment[ko]=끼워넣는 글월 편집기 구성 요소 (Doc/View 나누지 않음) +Comment[lb]=Abettbar Texteditor-Komponent (ouni Dokument/Usiicht Trennung) +Comment[lt]=Įdedamas tekstų redaktoriaus komponentas (be Doc/View atskyrimo) +Comment[lv]=Iegulstama tekstu redaktora komponente (bez Dok/Skatīt atdalīšanas) +Comment[mk]=Вгнездлива компонента за уредување на текст (без Док/Приказ раздвојување) +Comment[mn]=Суулгах боломж бүхий засварлагчийн бүрдэл хэсэг(Teкст/Харах-тусгаарлалтгүй) +Comment[ms]=Komponen Penyunting Teks Boleh Selit (Dokumentasi/Pelihat tidak berasingan) +Comment[mt]=Komponent integrat editur tat-test (mingħajr separazzjoni dokument/wiri) +Comment[nb]=Innebyggbar tekstredigeringskomponent (uten Doc/View skille) +Comment[nds]=Inbettbor Texteditor-Komponent (ahn Dokment/Ansicht-Trennen) +Comment[ne]=सम्मिलित पाठ सम्पादक अवयव (डक/दृश्य विभाजनवाहेक) +Comment[nl]=Ingebed teksteditorcomponent (zonder scheiding van tekst/weergave) +Comment[nn]=Inkluderbart komponent for tekstvising (utan Doc/View-deling) +Comment[nso]=Seripa seo se Robatsegago sa Mofetosi wa Sengwalwana (kantle le Karogano ya Doc/Bona) +Comment[pa]=ਸ਼ਾਮਿਲ ਹੋਣਯੋਗ ਪਾਠ ਸੰਪਾਦਕ ਭਾਗ (Doc/ਦਰਿਸ਼ ਵੱਖ ਕਰਨ ਬਿਨਾਂ) +Comment[pl]=Składnik edytora tekstu (do osadzania, bez paradygmatu Dokument/Widok) +Comment[pt]=Componente Incorporado do Editor de Texto (sem Separação entre Documentos) +Comment[pt_BR]=Componente de edição de textos integrado (sem separação de Documentação/Visualização) +Comment[ro]=Componentă de editare text (fără separare Doc/Vizualizare) +Comment[ru]=Встраиваемый элемент редактора текста (без поддержки модели документ/вид) +Comment[rw]=Inyangingo Muhinduzi y'Umwandiko Ishyirwamo (nta tandukanya Inyandiko/Ukugaragaza) +Comment[se]=Vuojuhanláhkái čállinprográmmaoassi (almmá Doc/View-sirrema) +Comment[sk]=Vložiteľný komponent textového editora (bez oddelenia Doc/View) +Comment[sl]=Vgradljiva komponenta urejevalnika besedil (brez ločevanja pogleda in dokumenta) +Comment[sq]=Komponenta e ngulshme e Tekst Editorit (pa ndarje Dokument/Vështrues) +Comment[sr]=Уградива компонента за уређивање текста (без „документ/приказ“ одвајања) +Comment[sr@Latn]=Ugradiva komponenta za uređivanje teksta (bez „dokument/prikaz“ odvajanja) +Comment[ss]=Incenye yesihleli sembhalo lenamatselekako (ngaphandle kwe Doc/Bona kwehlukana) +Comment[sv]=Inbäddningsbar texteditor (utan dok/vyseparation) +Comment[ta]=உட்பொதிந்த உரை தொகுப்பாளர் கூறு (ஆவண/காட்சி பிரிவுகளற்ற) +Comment[te]=పొదగబడె వాచకం సరిచేయు అంశం (పత్ర/వీక్షణ విభజన లేకుండా) +Comment[tg]=Қисми таҳриргари матни дарунсохт (бе вазифаи намоиши санад) +Comment[th]=คอมโปเนนท์แก้ไขข้อความที่ฝังได้ (โดยไม่แยก เอกสาร/แสดงผล) +Comment[tr]=Gömülebilir Metin Düzenleyici Bileşeni (Doc/View ayrımı yok) +Comment[tt]=Mäten Üzgärtüçe Quşılma-Komponent (İstälek/Küreneş ayıru belän tügel) +Comment[uk]=Компонент редактора текстів, який можна вбудовувати (без розділення документ/вигляд) +Comment[uz]=Ichiga oʻrnatib boʻladigan matn tahrirchi komponenti (hujjat/koʻrinish imkoniyatsiz) +Comment[uz@cyrillic]=Ичига ўрнатиб бўладиган матн таҳрирчи компоненти (ҳужжат/кўриниш имкониятсиз) +Comment[ven]=Khomphonente ya musengulusi wa manwalwa (i sina Doc/U khethekana hau vhona) +Comment[vi]=Thành phần Soạn thảo Văn bản có nhúng được (không có khả năng phân cách tài liệu/khung xem) +Comment[xh]=Ingxenye Yomhleli Wombhalo Olungiselekayo (ngaphandle Koxwebhu/Ulwahlulo Lwemboniselo) +Comment[zh_CN]=可嵌入的文本编辑器部件(不带 文档/查看 分离) +Comment[zh_HK]=可嵌入的文字編輯器元件 (Doc/View 不分開) +Comment[zh_TW]=可嵌入的文字編輯器元件 (Doc/View 不分開) +Comment[zu]=Ilunga Lomlungisi Wombhalo (ngaphandle Kokuhlukana kwe-Doc/Umbukiso) diff --git a/interfaces/tdetexteditor/tdetexteditorplugin.desktop b/interfaces/tdetexteditor/tdetexteditorplugin.desktop new file mode 100644 index 000000000..b2e180a93 --- /dev/null +++ b/interfaces/tdetexteditor/tdetexteditorplugin.desktop @@ -0,0 +1,87 @@ +[Desktop Entry] +Type=ServiceType +X-TDE-ServiceType=KTextEditor/Plugin +X-TDE-Derived= +Comment=KTextEditor Plugin +Comment[af]=KTextEditor Inprop Module +Comment[ar]=مساعد برنامج KTextEditor +Comment[az]=KTextEditor Əlavəsi +Comment[be]=Модуль KTextEditor +Comment[bg]=Приставка KTextEditor +Comment[bn]=কে-টেক্সট-এডিটর প্লাগ-ইন +Comment[br]=Lugent KTextEditor +Comment[bs]=Dodatak za KTextEditor +Comment[ca]=Connector del KTextEditor +Comment[cs]=Modul textového editoru +Comment[csb]=Plugins editora tekstu +Comment[cy]=Atodyn KTextEditor +Comment[da]=KTextEditor-plugin +Comment[de]=KTextEditor-Erweiterung +Comment[el]=Πρόσθετο KTextEditor +Comment[eo]=Ktekstredaktila kromaĵeto +Comment[es]=Plugin de KTextEditor +Comment[et]=KTextEditori plugin +Comment[eu]=KTextEditor plugin-a +Comment[fa]=وصلۀ KTextEditor +Comment[fi]=KTextEditor-lisäosa +Comment[fr]=Module externe KTextEditor +Comment[fy]=KTextFerwurker-plugin +Comment[ga]=Breiseán KTextEditor +Comment[gl]=Plugin KTextEditor +Comment[he]=תוסף KTextEditor +Comment[hi]=के-टेक्स्ट-एडिटर प्लगइन +Comment[hr]=KTextEditor dodatak +Comment[hu]=KTextEditor-bővítőmodul +Comment[id]=Plugin KTextEditor +Comment[is]=KTextEditor-íforrit +Comment[it]=Plugin KTextEditor +Comment[ja]=KTextEditor プラグイン +Comment[ka]=KTextEditor მოდული +Comment[kk]=KTextEditor модулі +Comment[km]=កម្មវិធី​ជំនួយ​ខាង​ក្នុង KTextEditor +Comment[ko]=K글월편집기 플러그인 +Comment[lb]=KTextEditor-Plugin +Comment[lt]=KTextEditor priedas +Comment[lv]=KTextEditor spraudnis +Comment[mk]=KTextEditor приклучок +Comment[mn]=Текст засварлагч +Comment[ms]=Plugmasuk KTextEditor +Comment[mt]=Plagin KTextEditor +Comment[nb]=KTextEditor-programtillegg +Comment[nds]=KTextEditor-Plugin +Comment[ne]=KTextEditor प्लगइन +Comment[nl]=KTextEditor-plugin +Comment[nn]=TDE-skriveprogramtillegg +Comment[nso]=Tsenyo ya Mofetosi wa Sengwalwana sa K +Comment[pa]=ਕੇ ਪਾਠਸੰਪਾਦਕ ਪਲੱਗਿੰਨ +Comment[pl]=Wtyczka edytora tekstu +Comment[pt]='Plugin' do KTextEditor +Comment[pt_BR]=Plug-in do Editor de Texto +Comment[ro]=Modul editor de text +Comment[ru]=Модуль KTextEditor +Comment[rw]=Icomeka KMuhinduziUmwandiko +Comment[se]=TDE-čállinprográmma lassemoduvla +Comment[sk]=Modul KTextEditor +Comment[sl]=Vstavek KTextEditor +Comment[sq]=Shtojca KTextEditor +Comment[sr]=KTextEditor прикључак +Comment[sr@Latn]=KTextEditor priključak +Comment[ss]=I-plugini ye KTextEditor +Comment[sv]=Insticksprogram för texteditor +Comment[ta]=கேஉரைதொகுப்பி சொருகுப்பொருள் +Comment[te]=కెటెక్స్ట్ ఎడిటర్ ప్లగిన్ +Comment[tg]=Пуркунандаи KTextEditor +Comment[th]=ปลักอิน KTextEditor +Comment[tr]=KTextEditor Eklentisi +Comment[tt]=KTextEditor Östämäse +Comment[uk]=Втулок KTextEditor +Comment[uz]=KTextEditor plagini +Comment[uz@cyrillic]=KTextEditor плагини +Comment[ven]=Pulagini ya musengulusi wa manwalwa a K +Comment[vi]=Bộ cầm phít Soạn thảo Văn bản +Comment[wa]=Tchôke-divins KTextEditor +Comment[xh]=KTextEditor ye Plagi efakiweyo +Comment[zh_CN]=KTextEditor 插件 +Comment[zh_HK]=KTextEditor 外掛程式 +Comment[zh_TW]=KTextEditor 外掛程式 +Comment[zu]= Ukungena ngaphakathi kwe-KTextEditor diff --git a/interfaces/tdetexteditor/templateinterface.cpp b/interfaces/tdetexteditor/templateinterface.cpp new file mode 100644 index 000000000..ecc34c7e2 --- /dev/null +++ b/interfaces/tdetexteditor/templateinterface.cpp @@ -0,0 +1,197 @@ +/* This file is part of the KDE libraries + Copyright (C) 2004 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "templateinterface.h" +#include "document.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace KTextEditor; + +unsigned int TemplateInterface::globalTemplateInterfaceNumber = 0; + +TemplateInterface::TemplateInterface() +{ + myTemplateInterfaceNumber = globalTemplateInterfaceNumber++; +} + +TemplateInterface::~TemplateInterface() +{} + +uint TemplateInterface::templateInterfaceNumber () const +{ + return myTemplateInterfaceNumber; +} + +void TemplateInterface::setTemplateInterfaceDCOPSuffix ( const TQCString &suffix ) +{} + +#define INITKABC do { \ + if (addrBook==0) { \ + addrBook=KABC::StdAddressBook::self(); \ + userAddress=addrBook->whoAmI(); \ + if (userAddress.isEmpty()) { \ + if ( KMessageBox::questionYesNo(parentWindow, \ + i18n( "This template uses personal data that is stored in the TDE addressbook, but you have not selected a personal entry. You can still use the template without one, but you will have to type personal data. Would you like to select one now?" ), \ + "Personal data requested", \ + KStdGuiItem::yes(), KStdGuiItem::no(), "select personal data entry") == KMessageBox::Yes ) { \ + userAddress = KABC::AddresseeDialog::getAddressee(parentWindow); \ + if ( ! userAddress.isEmpty() ) \ + KABC::StdAddressBook::self()->setWhoAmI( userAddress ); \ + }\ + /*return false;//no, why??*/ \ + } \ + } \ +} while(false) + +bool TemplateInterface::expandMacros( TQMap &map, TQWidget *parentWindow ) +{ + KABC::StdAddressBook *addrBook = 0; + KABC::Addressee userAddress; + TQDateTime datetime = TQDateTime::currentDateTime(); + TQDate date = TQT_TQDATE_OBJECT(datetime.date()); + TQTime time = TQT_TQTIME_OBJECT(datetime.time()); + + TQMap::Iterator it; + for ( it = map.begin(); it != map.end(); ++it ) + { + TQString placeholder = it.key(); + if ( map[ placeholder ].isEmpty() ) + { + if ( placeholder == "index" ) map[ placeholder ] = "i"; + else if ( placeholder == "loginname" ) + {} + else if ( placeholder == "firstname" ) + { + INITKABC; + if ( !userAddress.isEmpty() ) + map[ placeholder ] = userAddress.givenName(); + } + else if ( placeholder == "lastname" ) + { + INITKABC; + if ( !userAddress.isEmpty() ) + map[ placeholder ] = userAddress.familyName(); + } + else if ( placeholder == "fullname" ) + { + INITKABC; + if ( !userAddress.isEmpty() ) + map[ placeholder ] = userAddress.assembledName(); + } + else if ( placeholder == "email" ) + { + INITKABC; + if ( !userAddress.isEmpty() ) + map[ placeholder ] = userAddress.preferredEmail(); + } + else if ( placeholder == "date" ) + { + map[ placeholder ] = TDEGlobal::locale() ->formatDate( date, true ); + } + else if ( placeholder == "time" ) + { + map[ placeholder ] = TDEGlobal::locale() ->formatTime( time, true, false ); + } + else if ( placeholder == "year" ) + { + map[ placeholder ] = TDEGlobal::locale() ->calendar() ->yearString( date, false ); + } + else if ( placeholder == "month" ) + { + map[ placeholder ] = TQString::number( TDEGlobal::locale() ->calendar() ->month( date ) ); + } + else if ( placeholder == "day" ) + { + map[ placeholder ] = TQString::number( TDEGlobal::locale() ->calendar() ->day( date ) ); + } + else if ( placeholder == "hostname" ) + { + char hostname[ 256 ]; + hostname[ 0 ] = 0; + gethostname( hostname, 255 ); + hostname[ 255 ] = 0; + map[ placeholder ] = TQString::fromLocal8Bit( hostname ); + } + else if ( placeholder == "cursor" ) + { + map[ placeholder ] = "|"; + } + else map[ placeholder ] = placeholder; + } + } + return true; +} + +bool TemplateInterface::insertTemplateText ( uint line, uint column, const TQString &templateString, const TQMap &initialValues, TQWidget *parentWindow ) +{ + TQMap enhancedInitValues( initialValues ); + + TQRegExp rx( "[$%]\\{([^}\\s]+)\\}" ); + rx.setMinimal( true ); + int pos = 0; + int opos = 0; + + while ( pos >= 0 ) + { + pos = rx.search( templateString, pos ); + + if ( pos > -1 ) + { + if ( ( pos - opos ) > 0 ) + { + if ( templateString[ pos - 1 ] == '\\' ) + { + pos = opos = pos + 1; + continue; + } + } + TQString placeholder = rx.cap( 1 ); + if ( ! enhancedInitValues.contains( placeholder ) ) + enhancedInitValues[ placeholder ] = ""; + + pos += rx.matchedLength(); + opos = pos; + } + } + + return expandMacros( enhancedInitValues, parentWindow ) + && insertTemplateTextImplementation( line, column, templateString, enhancedInitValues, parentWindow ); +} + + + +TemplateInterface *KTextEditor::templateInterface ( KTextEditor::Document *doc ) +{ + if ( !doc ) + return 0; + + return dynamic_cast( doc ); +} + diff --git a/interfaces/tdetexteditor/templateinterface.h b/interfaces/tdetexteditor/templateinterface.h new file mode 100644 index 000000000..6ffc40e73 --- /dev/null +++ b/interfaces/tdetexteditor/templateinterface.h @@ -0,0 +1,131 @@ +/* This file is part of the KDE libraries + Copyright (C) 2004 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_templateinterface_h__ +#define __tdetexteditor_templateinterface_h__ + +#include +#include +#include + +#include + +namespace KTextEditor +{ + +class Document; + +/** + * This is an interface for inserting template strings with user editable + * fields into a document. + */ +class KTEXTEDITOR_EXPORT TemplateInterface //should be named AbstractTemplateInterface, but for consistency with the other classes it is not (for the 3.x release series) +{ + friend class PrivateTemplateInterface; + + public: + TemplateInterface(); + virtual ~TemplateInterface(); + + /** + * Parses @p templateString for macros in the form [$%]{NAME} and finds + * the value corresponding to NAME if any. The NAME string may contain + * any non-whitespace character execpt '}' + * @param initialValues a map with the keys for the macros to expand. + * keys with a value are ignored. + * @param parentWindow is used if dialogs have to be shown + * @return true if all macros was sucessfully expanded + * @see insertTemplateText for a list of supported macros + */ + static bool expandMacros( TQMap &initialValues, TQWidget *parentWindow ); + + uint templateInterfaceNumber () const; + + protected: + void setTemplateInterfaceDCOPSuffix (const TQCString &suffix); + + public: + + /** + * Inserts an interactive ediable template text at line "line", column "col". + * @p parentWindow is used if dialogs have to be shown + * @return true if inserting the string succeeded + * + * Use insertTemplateText(numLines(), ...) to append text at end of document + * Template strings look like + * "for( int ${index}=0;${index}<10;${index}++) { ${cursor} };" + * or "%{date}" + * + * This syntax is somewhat similiar to the one found in the Eclipse editor. + * + * There are certain common placeholders (macros), which get assigned a + * default initialValue, If the second parameter does not a given value. + * For all others the initial value is the name of the placeholder. + * + * Placeholder names may only consist of a-zA-Z0-9_ + * Common placeholders and values are + * + * - index: "i" + * - loginname: The current users's loginname + * - firstname: The current user's first name retrieved from kabc + * - lastname: The current user's last name retrieved from kabc + * - fullname: The current user's first and last name retrieved from kabc + * - email: The current user's primary email adress retrieved from kabc + * - date: current date + * - time: current time + * - year: current year + * - month: current month + * - day: current day + * - hostname: hostname of the computer + * - cursor: at this position the cursor will be after editing of the + * template has finished, this has to be taken care of by the actual + * implementation. The placeholder gets a value of "|" assigned. + * + * If a macro is started with a % (persent sign) like "%{date}" it isn't added + * to the list editable strings ( for example TAB key navigation) if a value + * differing from the macro name is found. + * + * If the editor supports some kind of smart indentation, the inserted code + * should be layouted by the indenter. + */ + bool insertTemplateText ( uint line, uint column, const TQString &templateString, const TQMap &initialValues, TQWidget *parentWindow=0); + +protected: + /** + * You must implement this, it is called by insertTemplateText, after all + * default values are inserted. If you are implementing this interface, + * this method should work as described in the documentation for + * insertTemplateText above. + * @return true if any text was inserted. + */ + virtual bool insertTemplateTextImplementation ( uint line, uint column, const TQString &templateString, const TQMap &initialValues, TQWidget *parentWindow=0 )=0; + + /** + * only for the interface itself - REAL PRIVATE + */ + private: + class PrivateTemplateInterface *d; + static uint globalTemplateInterfaceNumber; + uint myTemplateInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT TemplateInterface *templateInterface (Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/texthintinterface.cpp b/interfaces/tdetexteditor/texthintinterface.cpp new file mode 100644 index 000000000..f6aa4f0b3 --- /dev/null +++ b/interfaces/tdetexteditor/texthintinterface.cpp @@ -0,0 +1,66 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include "texthintinterface.h" +#include "view.h" + +using namespace KTextEditor; + +namespace KTextEditor +{ + class PrivateTextHintInterface + { + public: + PrivateTextHintInterface() {} + ~PrivateTextHintInterface(){} + + }; + +unsigned int TextHintInterface::globalTextHintInterfaceNumber = 0; + +TextHintInterface::TextHintInterface() +{ + globalTextHintInterfaceNumber++; + myTextHintInterfaceNumber = globalTextHintInterfaceNumber++; + + d = new PrivateTextHintInterface(); +} + +TextHintInterface::~TextHintInterface() +{ + delete d; +} + +unsigned int TextHintInterface::textHintInterfaceNumber () const +{ + return myTextHintInterfaceNumber; +} + + +TextHintInterface *textHintInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} + + +} + diff --git a/interfaces/tdetexteditor/texthintinterface.h b/interfaces/tdetexteditor/texthintinterface.h new file mode 100644 index 000000000..4e6a5e12c --- /dev/null +++ b/interfaces/tdetexteditor/texthintinterface.h @@ -0,0 +1,79 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_texthintinterface_h__ +#define __tdetexteditor_texthintinterface_h__ + +#include +#include + +#include + +namespace KTextEditor +{ + +/** + * This is an interface for the KTextEditor::View class. + + */ +class KTEXTEDITOR_EXPORT TextHintInterface +{ + friend class PrivateTextHintInterface; +public: + TextHintInterface(); + virtual ~TextHintInterface(); + + /** + * enable Texthints. If they are enabled a signal needTextHint is emitted, if the mouse + * changed the position and a new character is beneath the mouse cursor. The signal is delayed + * for a certain time, specifiedin the timeout parameter. + */ + virtual void enableTextHints(int timeout)=0; + + /** + * Disable texthints. Per default they are disabled. + */ + virtual void disableTextHints()=0; + + /** + * This method returns a number, unique during one application run + * + */ + unsigned int textHintInterfaceNumber () const; + + + //signals + + /** + * emit this signal, if a tooltip text is needed for displaying. + * I you don't want a tooltip to be displayd set text to an emtpy string in a connected slot, + * otherwise set text to the string you want the editor to display + */ + virtual void needTextHint(int line, int col, TQString &text)=0; + + private: + class PrivateTextHintInterface *d; + static unsigned int globalTextHintInterfaceNumber; + unsigned int myTextHintInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT TextHintInterface *textHintInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/undodcopinterface.cpp b/interfaces/tdetexteditor/undodcopinterface.cpp new file mode 100644 index 000000000..69eb2ebd5 --- /dev/null +++ b/interfaces/tdetexteditor/undodcopinterface.cpp @@ -0,0 +1,57 @@ +#include "undodcopinterface.h" +#include "undointerface.h" + +#include +using namespace KTextEditor; + +UndoDCOPInterface::UndoDCOPInterface( UndoInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +UndoDCOPInterface::~UndoDCOPInterface() +{ + +} + +uint UndoDCOPInterface::undoInterfaceNumber () +{ + return m_parent->undoInterfaceNumber(); +} +void UndoDCOPInterface::undo () +{ + m_parent->undo(); +} +void UndoDCOPInterface::redo () +{ + m_parent->redo(); +} +void UndoDCOPInterface::clearUndo () +{ + m_parent->clearUndo(); +} +void UndoDCOPInterface::clearRedo () +{ + m_parent->clearRedo(); +} +uint UndoDCOPInterface::undoCount () +{ + return m_parent->undoCount(); +} +uint UndoDCOPInterface::redoCount () +{ + return m_parent->redoCount(); +} +uint UndoDCOPInterface::undoSteps () +{ + return m_parent->undoSteps(); +} +void UndoDCOPInterface::setUndoSteps ( uint steps ) +{ + m_parent->setUndoSteps(steps); +} +void UndoDCOPInterface::undoChanged () +{ + m_parent->undoChanged(); +} diff --git a/interfaces/tdetexteditor/undodcopinterface.h b/interfaces/tdetexteditor/undodcopinterface.h new file mode 100644 index 000000000..b1a217036 --- /dev/null +++ b/interfaces/tdetexteditor/undodcopinterface.h @@ -0,0 +1,54 @@ +#ifndef Undo_DCOP_INTERFACE_H +#define Undo_DCOP_INTERFACE_H + +#include +#include +#include +#include +//#include "editdcopinterface.moc" +namespace KTextEditor +{ + class UndoInterface; + /** + This is the main interface to the UndoInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to UndoInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT UndoDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent UndoInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + UndoDCOPInterface( UndoInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~UndoDCOPInterface(); + k_dcop: + uint undoInterfaceNumber (); + void undo (); + void redo () ; + void clearUndo () ; + void clearRedo () ; + uint undoCount () ; + uint redoCount (); + uint undoSteps () ; + void setUndoSteps ( uint steps ); + void undoChanged (); + + + private: + UndoInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/undointerface.cpp b/interfaces/tdetexteditor/undointerface.cpp new file mode 100644 index 000000000..30a1dd292 --- /dev/null +++ b/interfaces/tdetexteditor/undointerface.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "undointerface.h" +#include "undodcopinterface.h" +#include "document.h" + +namespace KTextEditor +{ + +class PrivateUndoInterface +{ + public: + PrivateUndoInterface() {interface = 0;} + ~PrivateUndoInterface() {} + UndoDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int UndoInterface::globalUndoInterfaceNumber = 0; + +UndoInterface::UndoInterface() +{ + globalUndoInterfaceNumber++; + myUndoInterfaceNumber = globalUndoInterfaceNumber++; + + d = new PrivateUndoInterface(); + TQString name = "UndoInterface#" + TQString::number(myUndoInterfaceNumber); + d->interface = new UndoDCOPInterface(this, name.latin1()); +} + +UndoInterface::~UndoInterface() +{ + delete d->interface; + delete d; +} + +unsigned int UndoInterface::undoInterfaceNumber () const +{ + return myUndoInterfaceNumber; +} + +void UndoInterface::setUndoInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("UndoInterface#"+suffix); +} + +UndoInterface *KTextEditor::undoInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/undointerface.h b/interfaces/tdetexteditor/undointerface.h new file mode 100644 index 000000000..33162e43a --- /dev/null +++ b/interfaces/tdetexteditor/undointerface.h @@ -0,0 +1,84 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_undointerface_h__ +#define __tdetexteditor_undointerface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface to undo functionality of a Document. +*/ +class KTEXTEDITOR_EXPORT UndoInterface +{ + friend class PrivateUndoInterface; + + public: + UndoInterface (); + virtual ~UndoInterface (); + + unsigned int undoInterfaceNumber () const; + + protected: + void setUndoInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + virtual void undo () = 0; + + virtual void redo () = 0; + + virtual void clearUndo () = 0; + + virtual void clearRedo () = 0; + + virtual unsigned int undoCount () const = 0; + + virtual unsigned int redoCount () const = 0; + + /** + returns the maximum of undo steps possible, 0 means no limit ! + */ + virtual unsigned int undoSteps () const = 0; + + virtual void setUndoSteps ( unsigned int steps ) = 0; + + // + // signals !!! + // + public: + virtual void undoChanged () = 0; + + private: + class PrivateUndoInterface *d; + static unsigned int globalUndoInterfaceNumber; + unsigned int myUndoInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT UndoInterface *undoInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/tdetexteditor/variableinterface.cpp b/interfaces/tdetexteditor/variableinterface.cpp new file mode 100644 index 000000000..616e0beab --- /dev/null +++ b/interfaces/tdetexteditor/variableinterface.cpp @@ -0,0 +1,48 @@ +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) 2004, Anders Lund +*/ + +#include "variableinterface.h" +#include "document.h" + +using namespace KTextEditor; + +unsigned int VariableInterface::globalVariableInterfaceNumber = 0; + +VariableInterface::VariableInterface() +{ + globalVariableInterfaceNumber++; + myVariableInterfaceNumber = globalVariableInterfaceNumber++; +} + +VariableInterface::~VariableInterface() +{ +} + +unsigned int VariableInterface::variableInterfaceNumber() +{ + return myVariableInterfaceNumber; +} + +VariableInterface *KTextEditor::variableInterface( Document *doc ) +{ + if ( ! doc ) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/variableinterface.h b/interfaces/tdetexteditor/variableinterface.h new file mode 100644 index 000000000..31310a43c --- /dev/null +++ b/interfaces/tdetexteditor/variableinterface.h @@ -0,0 +1,72 @@ +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) 2004, Anders Lund +*/ +#ifndef _KTEXTEDITOR_VARIABLE_INTERFACE_H_ +#define _KTEXTEDITOR_VARIABLE_INTERFACE_H_ + +#include + +class TQString; + +namespace KTextEditor { + +/** + * This interface is designed to provide access to "document variables", + * for example variables defined in files like "kate: variable value;" + * or the emacs style "-*- variable: value -*-". + * + * The purpose is to allow KTE plugins to use variables. + * A document implementing this interface should return values for variable + * that it does not otherwise know how to use, since they could be of interrest + * to plugins. A document implementing this interface must emit the variableChanged() + * signal whenever a variable is set that it will return a value for. + * + * @short KTextEditor interface to Document Variables + */ +class KTEXTEDITOR_EXPORT VariableInterface +{ + public: + VariableInterface(); + virtual ~VariableInterface(); + + unsigned int variableInterfaceNumber(); + + /** + * @return the value of the variable @p name, or an empty string if the + * variable is not set or has no value. + */ + virtual TQString variable( const TQString &name ) const = 0; + + // + // signals!! + // + public: + /** + * Signal: emitted when a variable is set + */ + virtual void variableChanged( const TQString &variable, const TQString &value ) = 0; + + private: + static unsigned int globalVariableInterfaceNumber; + unsigned int myVariableInterfaceNumber; +}; + + +KTEXTEDITOR_EXPORT VariableInterface *variableInterface( class Document * ); +} // namespace KTextEditor +#endif //_KTEXTEDITOR_VARIABLE_INTERFACE_H_ diff --git a/interfaces/tdetexteditor/view.h b/interfaces/tdetexteditor/view.h new file mode 100644 index 000000000..0a807d6b3 --- /dev/null +++ b/interfaces/tdetexteditor/view.h @@ -0,0 +1,68 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_view_h__ +#define __tdetexteditor_view_h__ + +#include +#include + +namespace KTextEditor +{ + +/** + * The View class represents a single view of a Document . + */ + +class KTEXTEDITOR_EXPORT View : public TQWidget, public KXMLGUIClient +{ + friend class PrivateView; + + Q_OBJECT + + public: + /** + * Create a new view to the given document. The document must be non-null. + */ + View ( class Document *, TQWidget *parent, const char *name = 0 ); + virtual ~View (); + + /** + * Returns the number of this view + */ + unsigned int viewNumber () const; + + /** + * Returns the DCOP suffix to allow identification of this view's DCOP interface. + */ + TQCString viewDCOPSuffix () const; + + /** + * Acess the parent Document. + */ + virtual class Document *document () const = 0; + + private: + class PrivateView *d; + static unsigned int globalViewNumber; + unsigned int myViewNumber; +}; + +} + +#endif diff --git a/interfaces/tdetexteditor/viewcursordcopinterface.cpp b/interfaces/tdetexteditor/viewcursordcopinterface.cpp new file mode 100644 index 000000000..f26385414 --- /dev/null +++ b/interfaces/tdetexteditor/viewcursordcopinterface.cpp @@ -0,0 +1,68 @@ +#include "viewcursordcopinterface.h" +#include "viewcursorinterface.h" + +#include + +#include +using namespace KTextEditor; + +ViewCursorDCOPInterface::ViewCursorDCOPInterface( ViewCursorInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +ViewCursorDCOPInterface::~ViewCursorDCOPInterface() +{ + +} + +uint ViewCursorDCOPInterface::viewCursorInterfaceNumber () +{ + return m_parent->viewCursorInterfaceNumber (); +} + +::TQPoint ViewCursorDCOPInterface::cursorCoordinates () +{ + return m_parent->cursorCoordinates (); +} + +void ViewCursorDCOPInterface::cursorPosition (uint line, uint col) +{ + m_parent->cursorPosition (&line, &col); +} + +void ViewCursorDCOPInterface::cursorPositionReal (uint line, uint col) +{ + m_parent->cursorPositionReal (&line, &col); +} + +bool ViewCursorDCOPInterface::setCursorPosition (uint line, uint col) +{ + return m_parent->setCursorPosition ( line, col); +} + +bool ViewCursorDCOPInterface::setCursorPositionReal (uint line, uint col) +{ + return m_parent->setCursorPositionReal ( line, col); +} + +uint ViewCursorDCOPInterface::cursorLine () +{ + return m_parent->cursorLine (); +} + +uint ViewCursorDCOPInterface::cursorColumn () +{ + return m_parent->cursorColumn (); +} + +uint ViewCursorDCOPInterface::cursorColumnReal () +{ + return m_parent->cursorColumnReal (); +} + +void ViewCursorDCOPInterface::cursorPositionChanged () +{ + m_parent->cursorPositionChanged (); +} diff --git a/interfaces/tdetexteditor/viewcursordcopinterface.h b/interfaces/tdetexteditor/viewcursordcopinterface.h new file mode 100644 index 000000000..4bae0b520 --- /dev/null +++ b/interfaces/tdetexteditor/viewcursordcopinterface.h @@ -0,0 +1,74 @@ +#ifndef ViewCursor_DCOP_INTERFACE_H +#define ViewCursor_DCOP_INTERFACE_H + +#include +#include +#include +#include +//#include "editdcopinterface.moc" +namespace KTextEditor +{ + class ViewCursorInterface; + /** + This is the main interface to the ViewCursorInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to ViewCursorInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT ViewCursorDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent ViewCursorInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + ViewCursorDCOPInterface( ViewCursorInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~ViewCursorDCOPInterface(); + k_dcop: + + uint viewCursorInterfaceNumber (); + /** + * Get the current cursor coordinates in pixels. + */ + class TQPoint cursorCoordinates (); + + /** + * Get the cursor position + */ + void cursorPosition (uint line, uint col); + + /** + * Get the cursor position, calculated with 1 character per tab + */ + void cursorPositionReal (uint line, uint col); + + /** + * Set the cursor position + */ + bool setCursorPosition (uint line, uint col); + + /** + * Set the cursor position, use 1 character per tab + */ + bool setCursorPositionReal (uint line, uint col); + + uint cursorLine (); + uint cursorColumn (); + uint cursorColumnReal (); + void cursorPositionChanged (); + + private: + ViewCursorInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/viewcursorinterface.cpp b/interfaces/tdetexteditor/viewcursorinterface.cpp new file mode 100644 index 000000000..58cea6289 --- /dev/null +++ b/interfaces/tdetexteditor/viewcursorinterface.cpp @@ -0,0 +1,74 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "viewcursorinterface.h" +#include "viewcursordcopinterface.h" +#include "view.h" + +namespace KTextEditor +{ + +class PrivateViewCursorInterface +{ + public: + PrivateViewCursorInterface() {interface=0;} + ~PrivateViewCursorInterface() {} + ViewCursorDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int ViewCursorInterface::globalViewCursorInterfaceNumber = 0; + +ViewCursorInterface::ViewCursorInterface() +{ + globalViewCursorInterfaceNumber++; + myViewCursorInterfaceNumber = globalViewCursorInterfaceNumber++; + + d = new PrivateViewCursorInterface(); + TQString name = "ViewCursorInterface#" + TQString::number(myViewCursorInterfaceNumber); + d->interface = new ViewCursorDCOPInterface(this, name.latin1()); +} + +ViewCursorInterface::~ViewCursorInterface() +{ + delete d->interface; + delete d; +} + +unsigned int ViewCursorInterface::viewCursorInterfaceNumber () const +{ + return myViewCursorInterfaceNumber; +} + +void ViewCursorInterface::setViewCursorInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("ViewCursorInterface#"+suffix); +} + +ViewCursorInterface *KTextEditor::viewCursorInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} diff --git a/interfaces/tdetexteditor/viewcursorinterface.h b/interfaces/tdetexteditor/viewcursorinterface.h new file mode 100644 index 000000000..2fe7241e4 --- /dev/null +++ b/interfaces/tdetexteditor/viewcursorinterface.h @@ -0,0 +1,95 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_viewcursorinterface_h__ +#define __tdetexteditor_viewcursorinterface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface to access the text cursor of a View class. +*/ +class KTEXTEDITOR_EXPORT ViewCursorInterface +{ + friend class PrivateViewCursorInterface; + + public: + ViewCursorInterface (); + virtual ~ViewCursorInterface (); + + unsigned int viewCursorInterfaceNumber () const; + + protected: + void setViewCursorInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + /** + * Get the current cursor coordinates in pixels. + */ + virtual class TQPoint cursorCoordinates () = 0; + + /** + * Get the cursor position + */ + virtual void cursorPosition (unsigned int *line, unsigned int *col) = 0; + + /** + * Get the cursor position, calculated with 1 character per tab + */ + virtual void cursorPositionReal (unsigned int *line, unsigned int *col) = 0; + + /** + * Set the cursor position + */ + virtual bool setCursorPosition (unsigned int line, unsigned int col) = 0; + + /** + * Set the cursor position, use 1 character per tab + */ + virtual bool setCursorPositionReal (unsigned int line, unsigned int col) = 0; + + virtual unsigned int cursorLine () = 0; + virtual unsigned int cursorColumn () = 0; + virtual unsigned int cursorColumnReal () = 0; + + // + // signals !!! + // + public: + virtual void cursorPositionChanged () = 0; + + private: + class PrivateViewCursorInterface *d; + static unsigned int globalViewCursorInterfaceNumber; + unsigned int myViewCursorInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT ViewCursorInterface *viewCursorInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/viewstatusmsgdcopinterface.cpp b/interfaces/tdetexteditor/viewstatusmsgdcopinterface.cpp new file mode 100644 index 000000000..d38b9b938 --- /dev/null +++ b/interfaces/tdetexteditor/viewstatusmsgdcopinterface.cpp @@ -0,0 +1,29 @@ +#include "viewstatusmsgdcopinterface.h" +#include "viewstatusmsginterface.h" + +#include + +#include +using namespace KTextEditor; + +ViewStatusMsgDCOPInterface::ViewStatusMsgDCOPInterface( ViewStatusMsgInterface *Parent, const char *name) + : DCOPObject(name) +{ + m_parent = Parent; +} + +ViewStatusMsgDCOPInterface::~ViewStatusMsgDCOPInterface() +{ + +} + +uint ViewStatusMsgDCOPInterface::viewStatusMsgInterfaceNumber () +{ + return m_parent->viewStatusMsgInterfaceNumber (); +} + +void ViewStatusMsgDCOPInterface::viewStatusMsg (TQString msg) +{ + m_parent->viewStatusMsg(msg); +} + diff --git a/interfaces/tdetexteditor/viewstatusmsgdcopinterface.h b/interfaces/tdetexteditor/viewstatusmsgdcopinterface.h new file mode 100644 index 000000000..b4c5cf72e --- /dev/null +++ b/interfaces/tdetexteditor/viewstatusmsgdcopinterface.h @@ -0,0 +1,45 @@ +#ifndef ViewStatusMsg_DCOP_INTERFACE_H +#define ViewStatusMsg_DCOP_INTERFACE_H + +#include +#include +#include +#include +//#include "editdcopinterface.moc" +namespace KTextEditor +{ + class ViewStatusMsgInterface; + /** + This is the main interface to the ViewStatusMsgInterface of KTextEdit. + This will provide a consistant dcop interface to all KDE applications that use it. + @short DCOP interface to ViewStatusMsgInterface. + @author Ian Reinhart Geiser + */ + class KTEXTEDITOR_EXPORT ViewStatusMsgDCOPInterface : virtual public DCOPObject + { + K_DCOP + + public: + /** + Construct a new interface object for the text editor. + @param Parent the parent ViewStatusMsgInterface object + that will provide us with the functions for the interface. + @param name the QObject's name + */ + ViewStatusMsgDCOPInterface( ViewStatusMsgInterface *Parent, const char *name ); + /** + Destructor + Cleans up the object. + */ + virtual ~ViewStatusMsgDCOPInterface(); + k_dcop: + uint viewStatusMsgInterfaceNumber (); + void viewStatusMsg (class TQString msg) ; + + private: + ViewStatusMsgInterface *m_parent; + }; +} +#endif + + diff --git a/interfaces/tdetexteditor/viewstatusmsginterface.cpp b/interfaces/tdetexteditor/viewstatusmsginterface.cpp new file mode 100644 index 000000000..af8870c80 --- /dev/null +++ b/interfaces/tdetexteditor/viewstatusmsginterface.cpp @@ -0,0 +1,76 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "viewstatusmsginterface.h" +#include "viewstatusmsgdcopinterface.h" +#include "view.h" + +#include + +namespace KTextEditor +{ + +class PrivateViewStatusMsgInterface +{ + public: + PrivateViewStatusMsgInterface() {interface=0;} + ~PrivateViewStatusMsgInterface() {} + ViewStatusMsgDCOPInterface *interface; +}; + +} + +using namespace KTextEditor; + +unsigned int ViewStatusMsgInterface::globalViewStatusMsgInterfaceNumber = 0; + +ViewStatusMsgInterface::ViewStatusMsgInterface() +{ + globalViewStatusMsgInterfaceNumber++; + myViewStatusMsgInterfaceNumber = globalViewStatusMsgInterfaceNumber++; + + d = new PrivateViewStatusMsgInterface(); + ::TQString name = "ViewStatusMsgInterface#" + ::TQString::number(myViewStatusMsgInterfaceNumber); + d->interface = new ViewStatusMsgDCOPInterface(this, name.latin1()); +} + +ViewStatusMsgInterface::~ViewStatusMsgInterface() +{ + delete d->interface; + delete d; +} + +unsigned int ViewStatusMsgInterface::viewStatusMsgInterfaceNumber () const +{ + return myViewStatusMsgInterfaceNumber; +} + +void ViewStatusMsgInterface::setViewStatusMsgInterfaceDCOPSuffix (const TQCString &suffix) +{ + d->interface->setObjId ("ViewStatusMsgInterface#"+suffix); +} + +ViewStatusMsgInterface *KTextEditor::viewStatusMsgInterface (View *view) +{ + if (!view) + return 0; + + return dynamic_cast(view); +} diff --git a/interfaces/tdetexteditor/viewstatusmsginterface.h b/interfaces/tdetexteditor/viewstatusmsginterface.h new file mode 100644 index 000000000..3516f8758 --- /dev/null +++ b/interfaces/tdetexteditor/viewstatusmsginterface.h @@ -0,0 +1,63 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_viewstatusmsginterface_h__ +#define __tdetexteditor_viewstatusmsginterface_h__ + +#include + +class TQString; +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface for retrieving status bar messages from the Document class. +*/ +class KTEXTEDITOR_EXPORT ViewStatusMsgInterface +{ + friend class PrivateViewStatusMsgInterface; + + public: + ViewStatusMsgInterface(); + virtual ~ViewStatusMsgInterface(); + + unsigned int viewStatusMsgInterfaceNumber () const; + + protected: + void setViewStatusMsgInterfaceDCOPSuffix (const TQCString &suffix); + + // + // signals !!! + // + public: + virtual void viewStatusMsg (const class TQString &msg) = 0; + + + private: + class PrivateViewStatusMsgInterface *d; + static unsigned int globalViewStatusMsgInterfaceNumber; + unsigned int myViewStatusMsgInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT ViewStatusMsgInterface *viewStatusMsgInterface (class View *view); + +} + +#endif diff --git a/interfaces/tdetexteditor/wordwrapinterface.cpp b/interfaces/tdetexteditor/wordwrapinterface.cpp new file mode 100644 index 000000000..6be76120b --- /dev/null +++ b/interfaces/tdetexteditor/wordwrapinterface.cpp @@ -0,0 +1,70 @@ +/* This file is part of the KDE libraries + Copyright (C) 2001 Christoph Cullmann + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "wordwrapinterface.h" +#include "document.h" + + +namespace KTextEditor +{ + +class PrivateWordWrapInterface +{ + public: + PrivateWordWrapInterface() {} + ~PrivateWordWrapInterface() {} +}; + +} + +using namespace KTextEditor; + +unsigned int WordWrapInterface::globalWordWrapInterfaceNumber = 0; + +WordWrapInterface::WordWrapInterface() +{ + globalWordWrapInterfaceNumber++; + myWordWrapInterfaceNumber = globalWordWrapInterfaceNumber++; + + d = new PrivateWordWrapInterface(); +} + +WordWrapInterface::~WordWrapInterface() +{ + delete d; +} + +unsigned int WordWrapInterface::wordWrapInterfaceNumber () const +{ + return myWordWrapInterfaceNumber; +} + +void WordWrapInterface::setWordWrapInterfaceDCOPSuffix (const TQCString &/*suffix*/) +{ + //d->interface->setObjId ("WordWrapInterface#"+suffix); +} + +WordWrapInterface *KTextEditor::wordWrapInterface (Document *doc) +{ + if (!doc) + return 0; + + return dynamic_cast(doc); +} diff --git a/interfaces/tdetexteditor/wordwrapinterface.h b/interfaces/tdetexteditor/wordwrapinterface.h new file mode 100644 index 000000000..55cc2ded9 --- /dev/null +++ b/interfaces/tdetexteditor/wordwrapinterface.h @@ -0,0 +1,66 @@ +/* This file is part of the KDE project + Copyright (C) 2001 Christoph Cullmann (cullmann@kde.org) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __tdetexteditor_wordwrapinterface_h__ +#define __tdetexteditor_wordwrapinterface_h__ + +#include + +class TQCString; + +namespace KTextEditor +{ + +/** +* This is an interface to control fixed-column word-wrapping of a Document. +*/ +class KTEXTEDITOR_EXPORT WordWrapInterface +{ + friend class PrivateWordWrapInterface; + + public: + WordWrapInterface (); + virtual ~WordWrapInterface (); + + unsigned int wordWrapInterfaceNumber () const; + + protected: + void setWordWrapInterfaceDCOPSuffix (const TQCString &suffix); + + // + // slots !!! + // + public: + virtual void setWordWrap (bool) = 0; + virtual bool wordWrap () = 0; + + virtual void setWordWrapAt (unsigned int ) = 0; + virtual unsigned int wordWrapAt () = 0; + + private: + class PrivateWordWrapInterface *d; + static unsigned int globalWordWrapInterfaceNumber; + unsigned int myWordWrapInterfaceNumber; +}; + +KTEXTEDITOR_EXPORT WordWrapInterface *wordWrapInterface (class Document *doc); + +} + +#endif diff --git a/interfaces/terminal/Makefile.am b/interfaces/terminal/Makefile.am index 70bb091ef..3e2f8e4df 100644 --- a/interfaces/terminal/Makefile.am +++ b/interfaces/terminal/Makefile.am @@ -1,2 +1,2 @@ -ktexteditorinclude_HEADERS = kde_terminal_interface.h -ktexteditorincludedir = $(includedir) +tdetexteditorinclude_HEADERS = kde_terminal_interface.h +tdetexteditorincludedir = $(includedir) diff --git a/interfaces/terminal/test/main.cc b/interfaces/terminal/test/main.cc index e1dacc6dc..399b6451c 100644 --- a/interfaces/terminal/test/main.cc +++ b/interfaces/terminal/test/main.cc @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include -- cgit v1.2.1