/***************************************************************************
-* Copyright (C) 2004 by Kita Developers *
-* ikemo@users.sourceforge.jp *
-* *
-* This program is free software; you can redistribute it and/or modify *
-* it under the terms of the GNU General Public License as published by *
-* the Free Software Foundation; either version 2 of the License, or *
-* (at your option) any later version. *
-***************************************************************************/
-
-#include <kpopupmenu.h>
-#include <klocale.h>
-#include <khtml_events.h>
-#include <kdebug.h>
+ * Copyright (C) 2004 by Kita Developers *
+ * ikemo@users.sourceforge.jp *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
-#include <dom/html_element.h>
-#include <dom/html_misc.h>
+#include "previewpart.h"
#include <qcursor.h>
-#include <qapplication.h>
-#include <qclipboard.h>
-#include <qmessagebox.h>
-#include <qregexp.h>
-#include "previewpart.h"
+#include <khtml_events.h>
+
+#include <dom/html_misc.h>
-#include "thread/domtree.h"
#include "thread/respopup.h"
#include "kitaui/htmlview.h"
#include "libkita/kitaconfig.h"
#include "libkita/datmanager.h"
-#include "libkita/boardmanager.h"
-#include "libkita/datinfo.h"
#include "libkita/kita_misc.h"
#include "libkita/signalcollection.h"
#include "libkita/config_xt.h"
-#include "libkita/abone.h"
-
-/*-------------------------------------------*/
-
/*-------------------------------------*/
/* Don't forget to call setup() later. */
/* for convenience */ /* private */
void KitaPreviewPart::showPopup( const KURL& url, const QString& innerHTML )
{
- showPopupCore( url, innerHTML, QCursor::pos() );
-}
-
-/* show popup window */ /* private */
-void KitaPreviewPart::showPopupCore( const KURL& url, const QString& innerHTML, QPoint point )
-{
slotDeletePopup();
m_multiPopup = FALSE;
m_popup->setText( innerHTML );
m_popup->adjustSize();
- m_popup->adjustPos( point );
+ m_popup->adjustPos( QCursor::pos() );
m_popup->show();
}
/* Is it multi-popup mode now ? */ /* private */
bool KitaPreviewPart::isMultiPopupMode()
{
- if ( !m_popup ) m_multiPopup = FALSE;
- else if ( m_popup->isHidden() ) m_multiPopup = FALSE;
+ if ( !m_popup ) {
+ m_multiPopup = FALSE;
+ } else if ( m_popup->isHidden() ) {
+ m_multiPopup = FALSE;
+ }
return m_multiPopup;
}
/* private */
void KitaPreviewPart::hidePopup()
{
- if ( m_popup ) m_popup->hide();
+ if ( m_popup ) {
+ m_popup->hide();
+ }
+
m_multiPopup = FALSE;
}
void KitaPreviewPart::slotLeave()
{
if ( isMultiPopupMode() ) return ;
- if ( view() ->isHorizontalSliderPressed() ) return ;
- if ( view() ->isVerticalSliderPressed () ) return ;
+ if ( view()->isHorizontalSliderPressed() ) return ;
+ if ( view()->isVerticalSliderPressed () ) return ;
hidePopup();
}
/* private slot */
void KitaPreviewPart::slotVSliderReleased()
{
- QScrollBar * bar = view() ->verticalScrollBar();
+ QScrollBar* bar = view()->verticalScrollBar();
QRect rt = bar->sliderRect();
hidePopup();
/* private slot */
void KitaPreviewPart::slotHSliderReleased()
{
- QScrollBar * bar = view() ->horizontalScrollBar();
+ QScrollBar* bar = view()->horizontalScrollBar();
QRect rt = bar->sliderRect();
hidePopup();
/***************************************************************************
-* Copyright (C) 2004 by Kita Developers *
-* ikemo@users.sourceforge.jp *
-* *
-* 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. *
-***************************************************************************/
+ * Copyright (C) 2004 by Kita Developers *
+ * ikemo@users.sourceforge.jp *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
#ifndef PREVIEWPART_H
#define PREVIEWPART_H
#include <khtml_part.h>
-#include <qframe.h>
-#include <qevent.h>
-
-/* mode */
-enum {
- /* This part is not initialized. This part works as just KHTMLPart */
- PREVIEWPART_MODE_KHTML,
-
- /* on main window */
- PREVIEWPART_MODE_MAINPART,
-
- /* on popup */
- PREVIEWPART_MODE_POPUP
-};
/* ID of user defined event */
#define EVENT_GotoAnchor ( QEvent::User + 100 )
-class KitaDomTree;
-class KURL;
-
namespace Kita
{
class ResPopup;
}
-namespace DOM
-{
- class Node;
-}
-
-
-/*-------------------------------------------------------------*/
-
class KitaPreviewPart : public KHTMLPart
{
Q_OBJECT
bool m_multiPopup;
bool m_kitaIsActive;
-
public:
KitaPreviewPart( QWidget* parent, const char* name = 0 );
/* res popup */
void showPopup( const KURL& url, const QString& innerHTML );
- void showPopupCore( const KURL& url, const QString& innerHTML, QPoint point );
bool startMultiPopup();
bool isMultiPopupMode();
void hidePopup();
/* mouse event */
virtual void khtmlMousePressEvent( khtml::MousePressEvent* e );
-
private slots:
/* res popup */
void slotKitaIsActive();
void slotOnURL( const QString& url );
-
signals:
void openURLRequestExt( const KURL& url, const KParts::URLArgs& args = KParts::URLArgs(),
void mousePressed(); /* to KitaThreadView */
/* res popup */
- void hideChildPopup();
void isKitaActive();
};