You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
4.4 KiB
119 lines
4.4 KiB
15 years ago
|
/***************************************************************************
|
||
|
* 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"
|
||
|
|
||
14 years ago
|
#ifdef Q_MOC_RUN
|
||
|
#define USE_KDE
|
||
|
#endif // Q_MOC_RUN
|
||
15 years ago
|
|
||
|
/**
|
||
|
@author Georgy Yunaev
|
||
|
*/
|
||
|
/*
|
||
14 years ago
|
* For TQt-only version, we cannot compile KCHMViewWindow_KHTMLPart. However,
|
||
12 years ago
|
* we cannot just exclude it, because it would not generate a MOC file for a KDE
|
||
12 years ago
|
* version. Therefore we declare it, and compile the .moc file, but do not provide
|
||
15 years ago
|
* the class methods.
|
||
|
*/
|
||
|
#if defined (USE_KDE)
|
||
|
class KCHMViewWindow_KHTMLPart : public KHTMLPart, public KCHMViewWindow
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
13 years ago
|
KCHMViewWindow_KHTMLPart( TQTabWidget * parent );
|
||
15 years ago
|
~KCHMViewWindow_KHTMLPart();
|
||
|
|
||
|
//! Open a page from current chm archive
|
||
14 years ago
|
virtual bool openPage (const TQString& url);
|
||
15 years ago
|
|
||
|
//! Invalidate current view, doing all the cleanups etc.
|
||
13 years ago
|
virtual void invalidate();
|
||
15 years ago
|
|
||
|
//! 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();
|
||
|
|
||
13 years ago
|
//! Initiates the find-in-page search, if succeed, cursor moved to the first entry
|
||
14 years ago
|
virtual void searchWord( const TQString & word, bool forward = true, bool casesensitive = false );
|
||
15 years ago
|
|
||
|
//! 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);
|
||
|
|
||
14 years ago
|
virtual TQObject * getTQObject() { return this; }
|
||
|
virtual TQWidget * getTQWidget();
|
||
15 years ago
|
|
||
|
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.
|
||
|
*/
|
||
14 years ago
|
void signalLinkClicked ( const TQString & newlink, bool& follow_link );
|
||
15 years ago
|
|
||
|
private slots:
|
||
14 years ago
|
virtual void slotLinkClicked ( const TQString & newlink);
|
||
15 years ago
|
virtual void onOpenURLRequest( const KURL &, const KParts::URLArgs & );
|
||
14 years ago
|
virtual void onPopupMenu ( const TQString & url, const TQPoint & point );
|
||
15 years ago
|
|
||
|
private:
|
||
14 years ago
|
void setSource ( const TQString & name );
|
||
15 years ago
|
|
||
|
int m_zoomfactor;
|
||
|
bool m_searchForward;
|
||
14 years ago
|
TQString m_searchText;
|
||
15 years ago
|
|
||
|
const LCHMTextEncoding * m_currentEncoding;
|
||
|
};
|
||
|
|
||
|
#endif /* USE_KDE */
|
||
|
|
||
|
#endif /* KCHMVIEWWINDOW_KHTMLPART_H */
|