From 167ec17df581b4b82fa8adf31a1468c376ecaa22 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:08:35 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- acinclude.m4 | 26 +++--- po/hu.pot | 4 +- src/kchmviewwindowmgr.cpp | 2 +- src/kde-qt.h | 2 +- src/kde/Makefile.am | 4 +- src/kde/kchmviewwindow_khtmlpart.cpp | 163 --------------------------------- src/kde/kchmviewwindow_khtmlpart.h | 118 ------------------------ src/kde/kchmviewwindow_tdehtmlpart.cpp | 163 +++++++++++++++++++++++++++++++++ src/kde/kchmviewwindow_tdehtmlpart.h | 118 ++++++++++++++++++++++++ 9 files changed, 300 insertions(+), 300 deletions(-) delete mode 100644 src/kde/kchmviewwindow_khtmlpart.cpp delete mode 100644 src/kde/kchmviewwindow_khtmlpart.h create mode 100644 src/kde/kchmviewwindow_tdehtmlpart.cpp create mode 100644 src/kde/kchmviewwindow_tdehtmlpart.h diff --git a/acinclude.m4 b/acinclude.m4 index 095df10..0e48fb3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -2075,16 +2075,16 @@ if test $kde_qtver = 3; then AC_SUBST(LIB_SMB, "-lsmb") AC_SUBST(LIB_KAB, "-lkab") AC_SUBST(LIB_KABC, "-lkabc") - AC_SUBST(LIB_KHTML, "-lkhtml") - AC_SUBST(LIB_KSPELL, "-lkspell") - AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KHTML, "-ltdehtml") + AC_SUBST(LIB_KSPELL, "-ltdespell") + AC_SUBST(LIB_KPARTS, "-ltdeparts") AC_SUBST(LIB_TDEPRINT, "-ltdeprint") - AC_SUBST(LIB_KUTILS, "-lkutils") + AC_SUBST(LIB_KUTILS, "-ltdeutils") AC_SUBST(LIB_TDEPIM, "-ltdepim") - AC_SUBST(LIB_KIMPROXY, "-lkimproxy") + AC_SUBST(LIB_KIMPROXY, "-ltdeimproxy") AC_SUBST(LIB_KNEWSTUFF, "-lknewstuff") - AC_SUBST(LIB_KDNSSD, "-lkdnssd") - AC_SUBST(LIB_KUNITTEST, "-lkunittest") + AC_SUBST(LIB_KDNSSD, "-ltdednssd") + AC_SUBST(LIB_KUNITTEST, "-ltdeunittest") # these are for backward compatibility AC_SUBST(LIB_KSYCOCA, "-lkio") AC_SUBST(LIB_KFILE, "-lkio") @@ -2092,13 +2092,13 @@ elif test $kde_qtver = 2; then AC_SUBST(LIB_TDECORE, "-ltdecore") AC_SUBST(LIB_TDEUI, "-ltdeui") AC_SUBST(LIB_KIO, "-lkio") - AC_SUBST(LIB_KSYCOCA, "-lksycoca") + AC_SUBST(LIB_KSYCOCA, "-ltdesycoca") AC_SUBST(LIB_SMB, "-lsmb") AC_SUBST(LIB_KFILE, "-lkfile") AC_SUBST(LIB_KAB, "-lkab") - AC_SUBST(LIB_KHTML, "-lkhtml") - AC_SUBST(LIB_KSPELL, "-lkspell") - AC_SUBST(LIB_KPARTS, "-lkparts") + AC_SUBST(LIB_KHTML, "-ltdehtml") + AC_SUBST(LIB_KSPELL, "-ltdespell") + AC_SUBST(LIB_KPARTS, "-ltdeparts") AC_SUBST(LIB_TDEPRINT, "-ltdeprint") else AC_SUBST(LIB_TDECORE, "-ltdecore -lXext $(LIB_QT)") @@ -2547,7 +2547,7 @@ AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir) test "x$jpeg_incdir" = xNO && jpeg_incdir= dnl if headers _and_ libraries are missing, this is no error, and we -dnl continue with a warning (the user will get no jpeg support in khtml) +dnl continue with a warning (the user will get no jpeg support in tdehtml) dnl if only one is missing, it means a configuration error, but we still dnl only warn if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then @@ -3489,7 +3489,7 @@ LIBTOOL_SHELL="/bin/sh ./libtool" KDE_PLUGIN="-avoid-version -module -no-undefined \$(KDE_NO_UNDEFINED) \$(KDE_RPATH) \$(KDE_MT_LDFLAGS)" AC_SUBST(KDE_PLUGIN) -# This hack ensures that libtool creates shared libs for kunittest plugins. By default check_LTLIBRARIES makes static libs. +# This hack ensures that libtool creates shared libs for tdeunittest plugins. By default check_LTLIBRARIES makes static libs. KDE_CHECK_PLUGIN="\$(KDE_PLUGIN) -rpath \$(libdir)" AC_SUBST(KDE_CHECK_PLUGIN) diff --git a/po/hu.pot b/po/hu.pot index 82e4476..39eb45d 100644 --- a/po/hu.pot +++ b/po/hu.pot @@ -494,7 +494,7 @@ msgstr "Az alapoldalra ugráshoz kattintson erre a gombra." msgid "&Recent files" msgstr "&Legutóbbi fájlok" -#: kchmmainwindow.cpp:507 kchmviewwindow_khtmlpart.cpp:163 +#: kchmmainwindow.cpp:507 kchmviewwindow_tdehtmlpart.cpp:163 msgid "&Select all" msgstr "&Minden kijelölése" @@ -689,7 +689,7 @@ msgid "" "For example, search for 'C' will give the same result as searching for 'C++'." msgstr "" -#: kchmviewwindow_khtmlpart.cpp:161 +#: kchmviewwindow_tdehtmlpart.cpp:161 msgid "Editor" msgstr "Szerkesztő" diff --git a/src/kchmviewwindowmgr.cpp b/src/kchmviewwindowmgr.cpp index a59aa5a..5be3640 100644 --- a/src/kchmviewwindowmgr.cpp +++ b/src/kchmviewwindowmgr.cpp @@ -30,7 +30,7 @@ #include "kchmviewwindow_qtextbrowser.h" #if defined (USE_KDE) - #include "kde/kchmviewwindow_khtmlpart.h" + #include "kde/kchmviewwindow_tdehtmlpart.h" #endif diff --git a/src/kde-qt.h b/src/kde-qt.h index ac6b5d2..0d65253 100644 --- a/src/kde-qt.h +++ b/src/kde-qt.h @@ -37,7 +37,7 @@ #include #include #include - #include + #include #include #include #include diff --git a/src/kde/Makefile.am b/src/kde/Makefile.am index e095be6..8524867 100644 --- a/src/kde/Makefile.am +++ b/src/kde/Makefile.am @@ -1,6 +1,6 @@ lib_LIBRARIES=libkdeextra.a -libkdeextra_a_SOURCES = kchmdcopiface.cpp kchmdcopiface.skel kchmviewwindow_khtmlpart.cpp -noinst_HEADERS = kchmdcopiface.h kchmviewwindow_khtmlpart.h +libkdeextra_a_SOURCES = kchmdcopiface.cpp kchmdcopiface.skel kchmviewwindow_tdehtmlpart.cpp +noinst_HEADERS = kchmdcopiface.h kchmviewwindow_tdehtmlpart.h INCLUDES = $(QT_INCLUDES) $(CHM_INCLUDES) $(KDE_INCLUDES) $(LIBCHMFILE_INCLUDES) diff --git a/src/kde/kchmviewwindow_khtmlpart.cpp b/src/kde/kchmviewwindow_khtmlpart.cpp deleted file mode 100644 index a2f02e1..0000000 --- a/src/kde/kchmviewwindow_khtmlpart.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#include - -#include -#include - -#include "kde-qt.h" -#include "kchmmainwindow.h" -#include "kchmconfig.h" -#include "kchmviewwindow_khtmlpart.h" - -#include "kchmviewwindow_khtmlpart.moc" - - -TQWidget * KCHMViewWindow_KHTMLPart::getTQWidget() -{ - return view(); -} - -KCHMViewWindow_KHTMLPart::KCHMViewWindow_KHTMLPart( TQTabWidget * parent ) - : KHTMLPart ( parent ), KCHMViewWindow ( parent ) -{ - m_zoomfactor = 0; - m_currentEncoding = 0; - m_searchForward = true; - - invalidate(); - - connect( browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), - this, TQT_SLOT ( onOpenURLRequest( const KURL &, const KParts::URLArgs & )) ); - - connect( this, TQT_SIGNAL ( popupMenu ( const TQString &, const TQPoint &) ), - this, TQT_SLOT ( onPopupMenu ( const TQString &, const TQPoint &) ) ); -} - - -KCHMViewWindow_KHTMLPart::~KCHMViewWindow_KHTMLPart() -{ -} - -bool KCHMViewWindow_KHTMLPart::openPage (const TQString& url) -{ - // Set or change the encoding - if ( m_currentEncoding != ::mainWindow->chmFile()->currentEncoding() ) - { - m_currentEncoding = ::mainWindow->chmFile()->currentEncoding(); - setEncoding ( m_currentEncoding->qtcodec, TRUE ); - } - - TQString fullurl = "ms-its:" + ::mainWindow->getOpenedFileName() + "::" + url; - openURL ( KURL(fullurl) ); - - return true; -} - -void KCHMViewWindow_KHTMLPart::setZoomFactor( int zoom ) -{ - m_zoomfactor = zoom; - - // Default ZoomFactor is 100, any increase or decrease should modify this value. - KHTMLPart::setZoomFactor ( 100 + (m_zoomfactor * 10) ); -} - -void KCHMViewWindow_KHTMLPart::invalidate( ) -{ - m_zoomfactor = 0; - m_searchForward = true; - m_searchText = TQString(); - - setJScriptEnabled ( appConfig.m_kdeEnableJS ); - setJavaEnabled ( appConfig.m_kdeEnableJava ); - setMetaRefreshEnabled ( appConfig.m_kdeEnableRefresh ); - setPluginsEnabled ( appConfig.m_kdeEnablePlugins ); - - KCHMViewWindow::invalidate( ); -} - -int KCHMViewWindow_KHTMLPart::getScrollbarPosition( ) -{ - return view()->contentsY (); -} - -void KCHMViewWindow_KHTMLPart::setScrollbarPosition( int pos ) -{ - view()->scrollBy (0, pos); -} - -void KCHMViewWindow_KHTMLPart::addZoomFactor( int value ) -{ - setZoomFactor( m_zoomfactor + value); -} - -bool KCHMViewWindow_KHTMLPart::printCurrentPage() -{ - view()->print(); - return true; -} - -void KCHMViewWindow_KHTMLPart::searchWord( const TQString & word, bool forward, bool ) -{ - if ( word != m_searchText || forward != m_searchForward ) - { - m_searchText = word; - m_searchForward = forward; - - findText ( word, forward ? 0 : KFindDialog::FindBackwards, ::mainWindow, 0 ); - } - - findTextNext (); -} - -void KCHMViewWindow_KHTMLPart::onOpenURLRequest( const KURL & url, const KParts::URLArgs & ) -{ - bool sourcechange = true; - emit signalLinkClicked ( url.prettyURL(), sourcechange ); -} - -void KCHMViewWindow_KHTMLPart::slotLinkClicked( const TQString & newlink ) -{ - bool notused; - emit signalLinkClicked (newlink, notused); -} - - -void KCHMViewWindow_KHTMLPart::clipSelectAll() -{ - selectAll (); -} - -void KCHMViewWindow_KHTMLPart::clipCopy() -{ - TQString text = selectedText(); - - if ( !text.isEmpty() ) - TQApplication::clipboard()->setText( text ); -} - -void KCHMViewWindow_KHTMLPart::onPopupMenu ( const TQString &url, const TQPoint & point ) -{ - KTQPopupMenu * menu = getContextMenu( url, view() ); - menu->exec( point ); -} - diff --git a/src/kde/kchmviewwindow_khtmlpart.h b/src/kde/kchmviewwindow_khtmlpart.h deleted file mode 100644 index b840b44..0000000 --- a/src/kde/kchmviewwindow_khtmlpart.h +++ /dev/null @@ -1,118 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com * - * Please do not use email address above for bug reports; see * - * the README file * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ - -#ifndef KCHMVIEWWINDOW_KHTMLPART_H -#define KCHMVIEWWINDOW_KHTMLPART_H - -#include "kde-qt.h" - -#include "kchmviewwindow.h" -#include "kchmsourcefactory.h" -#include "libchmtextencoding.h" - -#ifdef Q_MOC_RUN -#define USE_KDE -#endif // Q_MOC_RUN - -/** -@author Georgy Yunaev -*/ -/* - * For TQt-only version, we cannot compile KCHMViewWindow_KHTMLPart. However, - * we cannot just exclude it, because it would not generate a MOC file for a KDE - * version. Therefore we declare it, and compile the .moc file, but do not provide - * the class methods. - */ -#if defined (USE_KDE) -class KCHMViewWindow_KHTMLPart : public KHTMLPart, public KCHMViewWindow -{ -Q_OBJECT - -public: - KCHMViewWindow_KHTMLPart( TQTabWidget * parent ); - ~KCHMViewWindow_KHTMLPart(); - - //! Open a page from current chm archive - virtual bool openPage (const TQString& url); - - //! Invalidate current view, doing all the cleanups etc. - virtual void invalidate(); - - //! Return current ZoomFactor. - virtual int getZoomFactor() const { return m_zoomfactor; } - - //! Sets ZoomFactor. The value returned by getZoomFactor(), given to this function, should give the same result. - virtual void setZoomFactor (int zoom); - - //! Relatively changes ZoomFactor. Most common values are -1 and 1. - virtual void addZoomFactor (int value); - - //! Popups the print dialog, and prints the current page on the printer. - virtual bool printCurrentPage(); - - //! Initiates the find-in-page search, if succeed, cursor moved to the first entry - virtual void searchWord( const TQString & word, bool forward = true, bool casesensitive = false ); - - //! Select the content of the whole page - virtual void clipSelectAll(); - - //! Copies the selected content to the clipboard - virtual void clipCopy(); - - /*! - * Return current scrollbar position in view window. Saved on program exit. - * There is no restriction on returned value, except that giving this value to - * setScrollbarPosition() should move the scrollbar in the same position. - */ - virtual int getScrollbarPosition(); - - //! Sets the scrollbar position. - virtual void setScrollbarPosition(int pos); - - virtual TQObject * getTQObject() { return this; } - virtual TQWidget * getTQWidget(); - -signals: - /*! - * Emitted when the user clicked on the link, before the page changed. - * If signalLinkClicked() sets follow_link to false, the current page should NOT change. - * Otherwise it should be changed to the new link value. - */ - void signalLinkClicked ( const TQString & newlink, bool& follow_link ); - -private slots: - virtual void slotLinkClicked ( const TQString & newlink); - virtual void onOpenURLRequest( const KURL &, const KParts::URLArgs & ); - virtual void onPopupMenu ( const TQString & url, const TQPoint & point ); - -private: - void setSource ( const TQString & name ); - - int m_zoomfactor; - bool m_searchForward; - TQString m_searchText; - - const LCHMTextEncoding * m_currentEncoding; -}; - -#endif /* USE_KDE */ - -#endif /* KCHMVIEWWINDOW_KHTMLPART_H */ diff --git a/src/kde/kchmviewwindow_tdehtmlpart.cpp b/src/kde/kchmviewwindow_tdehtmlpart.cpp new file mode 100644 index 0000000..4ad2538 --- /dev/null +++ b/src/kde/kchmviewwindow_tdehtmlpart.cpp @@ -0,0 +1,163 @@ +/*************************************************************************** + * Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com * + * Please do not use email address above for bug reports; see * + * the README file * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#include + +#include +#include + +#include "kde-qt.h" +#include "kchmmainwindow.h" +#include "kchmconfig.h" +#include "kchmviewwindow_tdehtmlpart.h" + +#include "kchmviewwindow_tdehtmlpart.moc" + + +TQWidget * KCHMViewWindow_KHTMLPart::getTQWidget() +{ + return view(); +} + +KCHMViewWindow_KHTMLPart::KCHMViewWindow_KHTMLPart( TQTabWidget * parent ) + : KHTMLPart ( parent ), KCHMViewWindow ( parent ) +{ + m_zoomfactor = 0; + m_currentEncoding = 0; + m_searchForward = true; + + invalidate(); + + connect( browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), + this, TQT_SLOT ( onOpenURLRequest( const KURL &, const KParts::URLArgs & )) ); + + connect( this, TQT_SIGNAL ( popupMenu ( const TQString &, const TQPoint &) ), + this, TQT_SLOT ( onPopupMenu ( const TQString &, const TQPoint &) ) ); +} + + +KCHMViewWindow_KHTMLPart::~KCHMViewWindow_KHTMLPart() +{ +} + +bool KCHMViewWindow_KHTMLPart::openPage (const TQString& url) +{ + // Set or change the encoding + if ( m_currentEncoding != ::mainWindow->chmFile()->currentEncoding() ) + { + m_currentEncoding = ::mainWindow->chmFile()->currentEncoding(); + setEncoding ( m_currentEncoding->qtcodec, TRUE ); + } + + TQString fullurl = "ms-its:" + ::mainWindow->getOpenedFileName() + "::" + url; + openURL ( KURL(fullurl) ); + + return true; +} + +void KCHMViewWindow_KHTMLPart::setZoomFactor( int zoom ) +{ + m_zoomfactor = zoom; + + // Default ZoomFactor is 100, any increase or decrease should modify this value. + KHTMLPart::setZoomFactor ( 100 + (m_zoomfactor * 10) ); +} + +void KCHMViewWindow_KHTMLPart::invalidate( ) +{ + m_zoomfactor = 0; + m_searchForward = true; + m_searchText = TQString(); + + setJScriptEnabled ( appConfig.m_kdeEnableJS ); + setJavaEnabled ( appConfig.m_kdeEnableJava ); + setMetaRefreshEnabled ( appConfig.m_kdeEnableRefresh ); + setPluginsEnabled ( appConfig.m_kdeEnablePlugins ); + + KCHMViewWindow::invalidate( ); +} + +int KCHMViewWindow_KHTMLPart::getScrollbarPosition( ) +{ + return view()->contentsY (); +} + +void KCHMViewWindow_KHTMLPart::setScrollbarPosition( int pos ) +{ + view()->scrollBy (0, pos); +} + +void KCHMViewWindow_KHTMLPart::addZoomFactor( int value ) +{ + setZoomFactor( m_zoomfactor + value); +} + +bool KCHMViewWindow_KHTMLPart::printCurrentPage() +{ + view()->print(); + return true; +} + +void KCHMViewWindow_KHTMLPart::searchWord( const TQString & word, bool forward, bool ) +{ + if ( word != m_searchText || forward != m_searchForward ) + { + m_searchText = word; + m_searchForward = forward; + + findText ( word, forward ? 0 : KFindDialog::FindBackwards, ::mainWindow, 0 ); + } + + findTextNext (); +} + +void KCHMViewWindow_KHTMLPart::onOpenURLRequest( const KURL & url, const KParts::URLArgs & ) +{ + bool sourcechange = true; + emit signalLinkClicked ( url.prettyURL(), sourcechange ); +} + +void KCHMViewWindow_KHTMLPart::slotLinkClicked( const TQString & newlink ) +{ + bool notused; + emit signalLinkClicked (newlink, notused); +} + + +void KCHMViewWindow_KHTMLPart::clipSelectAll() +{ + selectAll (); +} + +void KCHMViewWindow_KHTMLPart::clipCopy() +{ + TQString text = selectedText(); + + if ( !text.isEmpty() ) + TQApplication::clipboard()->setText( text ); +} + +void KCHMViewWindow_KHTMLPart::onPopupMenu ( const TQString &url, const TQPoint & point ) +{ + KTQPopupMenu * menu = getContextMenu( url, view() ); + menu->exec( point ); +} + diff --git a/src/kde/kchmviewwindow_tdehtmlpart.h b/src/kde/kchmviewwindow_tdehtmlpart.h new file mode 100644 index 0000000..b840b44 --- /dev/null +++ b/src/kde/kchmviewwindow_tdehtmlpart.h @@ -0,0 +1,118 @@ +/*************************************************************************** + * Copyright (C) 2004-2007 by Georgy Yunaev, gyunaev@ulduzsoft.com * + * Please do not use email address above for bug reports; see * + * the README file * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ + +#ifndef KCHMVIEWWINDOW_KHTMLPART_H +#define KCHMVIEWWINDOW_KHTMLPART_H + +#include "kde-qt.h" + +#include "kchmviewwindow.h" +#include "kchmsourcefactory.h" +#include "libchmtextencoding.h" + +#ifdef Q_MOC_RUN +#define USE_KDE +#endif // Q_MOC_RUN + +/** +@author Georgy Yunaev +*/ +/* + * For TQt-only version, we cannot compile KCHMViewWindow_KHTMLPart. However, + * we cannot just exclude it, because it would not generate a MOC file for a KDE + * version. Therefore we declare it, and compile the .moc file, but do not provide + * the class methods. + */ +#if defined (USE_KDE) +class KCHMViewWindow_KHTMLPart : public KHTMLPart, public KCHMViewWindow +{ +Q_OBJECT + +public: + KCHMViewWindow_KHTMLPart( TQTabWidget * parent ); + ~KCHMViewWindow_KHTMLPart(); + + //! Open a page from current chm archive + virtual bool openPage (const TQString& url); + + //! Invalidate current view, doing all the cleanups etc. + virtual void invalidate(); + + //! Return current ZoomFactor. + virtual int getZoomFactor() const { return m_zoomfactor; } + + //! Sets ZoomFactor. The value returned by getZoomFactor(), given to this function, should give the same result. + virtual void setZoomFactor (int zoom); + + //! Relatively changes ZoomFactor. Most common values are -1 and 1. + virtual void addZoomFactor (int value); + + //! Popups the print dialog, and prints the current page on the printer. + virtual bool printCurrentPage(); + + //! Initiates the find-in-page search, if succeed, cursor moved to the first entry + virtual void searchWord( const TQString & word, bool forward = true, bool casesensitive = false ); + + //! Select the content of the whole page + virtual void clipSelectAll(); + + //! Copies the selected content to the clipboard + virtual void clipCopy(); + + /*! + * Return current scrollbar position in view window. Saved on program exit. + * There is no restriction on returned value, except that giving this value to + * setScrollbarPosition() should move the scrollbar in the same position. + */ + virtual int getScrollbarPosition(); + + //! Sets the scrollbar position. + virtual void setScrollbarPosition(int pos); + + virtual TQObject * getTQObject() { return this; } + virtual TQWidget * getTQWidget(); + +signals: + /*! + * Emitted when the user clicked on the link, before the page changed. + * If signalLinkClicked() sets follow_link to false, the current page should NOT change. + * Otherwise it should be changed to the new link value. + */ + void signalLinkClicked ( const TQString & newlink, bool& follow_link ); + +private slots: + virtual void slotLinkClicked ( const TQString & newlink); + virtual void onOpenURLRequest( const KURL &, const KParts::URLArgs & ); + virtual void onPopupMenu ( const TQString & url, const TQPoint & point ); + +private: + void setSource ( const TQString & name ); + + int m_zoomfactor; + bool m_searchForward; + TQString m_searchText; + + const LCHMTextEncoding * m_currentEncoding; +}; + +#endif /* USE_KDE */ + +#endif /* KCHMVIEWWINDOW_KHTMLPART_H */ -- cgit v1.2.3