Commit 8b41489e authored by Pino Toscano's avatar Pino Toscano

porting

svn path=/branches/work/kde4/playground/graphics/okular/; revision=522251
parent db09e1aa
...@@ -18,10 +18,10 @@ class okular_dcop : virtual public DCOPObject ...@@ -18,10 +18,10 @@ class okular_dcop : virtual public DCOPObject
K_DCOP K_DCOP
k_dcop: k_dcop:
virtual ASYNC goToPage( uint page ) = 0; virtual ASYNC goToPage( uint page ) = 0;
virtual ASYNC openDocument( KURL doc ) = 0; virtual ASYNC openDocument( KUrl doc ) = 0;
virtual uint pages() = 0; virtual uint pages() = 0;
virtual uint currentPage() = 0; virtual uint currentPage() = 0;
virtual KURL currentDocument() = 0; virtual KUrl currentDocument() = 0;
virtual void slotPreferences() = 0; virtual void slotPreferences() = 0;
virtual void slotFind() = 0; virtual void slotFind() = 0;
virtual void slotPrintPreview() = 0; virtual void slotPrintPreview() = 0;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <qtimer.h> #include <qtimer.h>
class QTextEdit; class QTextEdit;
class KURLLabel; class KUrlLabel;
class GSLogWindow : public QVBox class GSLogWindow : public QVBox
{ {
Q_OBJECT Q_OBJECT
......
...@@ -26,13 +26,13 @@ ...@@ -26,13 +26,13 @@
#include <qpainter.h> #include <qpainter.h>
#include <qlayout.h> #include <qlayout.h>
#include <qlabel.h> #include <qlabel.h>
#include <qvbox.h> #include <kvbox.h>
#include <qtoolbox.h> #include <qtoolbox.h>
#include <qpushbutton.h> #include <qpushbutton.h>
#include <dcopobject.h> #include <dcopobject.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <kapplication.h> #include <kapplication.h>
#include <klistviewsearchline.h> #include <k3listviewsearchline.h>
#include <kaction.h> #include <kaction.h>
#include <kdirwatch.h> #include <kdirwatch.h>
#include <kinstance.h> #include <kinstance.h>
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
#include <kstdaction.h> #include <kstdaction.h>
#include <kdeversion.h> #include <kdeversion.h>
#include <kparts/genericfactory.h> #include <kparts/genericfactory.h>
#include <kurldrag.h> #include <k3urldrag.h>
#include <kfiledialog.h> #include <kfiledialog.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kfinddialog.h> #include <kfinddialog.h>
#include <knuminput.h> #include <knuminput.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kio/netaccess.h> #include <kio/netaccess.h>
#include <kpopupmenu.h> #include <k3popupmenu.h>
#include <kxmlguiclient.h> #include <kxmlguiclient.h>
#include <kxmlguifactory.h> #include <kxmlguifactory.h>
#include <ktrader.h> #include <ktrader.h>
...@@ -105,7 +105,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, ...@@ -105,7 +105,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) ); connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) );
connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( slotShowPresentation() ) ); connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( slotShowPresentation() ) );
connect( m_document, SIGNAL( linkEndPresentation() ), this, SLOT( slotHidePresentation() ) ); connect( m_document, SIGNAL( linkEndPresentation() ), this, SLOT( slotHidePresentation() ) );
connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( openURLFromDocument(const KURL &) ) ); connect( m_document, SIGNAL( openURL(const KUrl &) ), this, SLOT( openURLFromDocument(const KUrl &) ) );
connect( m_document, SIGNAL( close() ), this, SLOT( close() ) ); connect( m_document, SIGNAL( close() ), this, SLOT( close() ) );
if (parent && parent->metaObject()->slotNames(true).contains("slotQuit()")) if (parent && parent->metaObject()->slotNames(true).contains("slotQuit()"))
...@@ -151,12 +151,12 @@ Part::Part(QWidget *parentWidget, const char *widgetName, ...@@ -151,12 +151,12 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
enableTOC( false ); enableTOC( false );
// [left toolbox: Thumbnails and Bookmarks] | [] // [left toolbox: Thumbnails and Bookmarks] | []
QVBox * thumbsBox = new ThumbnailsBox( m_toolBox ); KVBox * thumbsBox = new ThumbnailsBox( m_toolBox );
thumbsBox->setSpacing( 4 ); thumbsBox->setSpacing( 4 );
m_searchWidget = new SearchWidget( thumbsBox, m_document ); m_searchWidget = new SearchWidget( thumbsBox, m_document );
m_thumbnailList = new ThumbnailList( thumbsBox, m_document ); m_thumbnailList = new ThumbnailList( thumbsBox, m_document );
// ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList ); // ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList );
connect( m_thumbnailList, SIGNAL( urlDropped( const KURL& ) ), SLOT( openURLFromDocument( const KURL & )) ); connect( m_thumbnailList, SIGNAL( urlDropped( const KUrl& ) ), SLOT( openURLFromDocument( const KUrl & )) );
connect( m_thumbnailList, SIGNAL( rightClick(const KPDFPage *, const QPoint &) ), this, SLOT( slotShowMenu(const KPDFPage *, const QPoint &) ) ); connect( m_thumbnailList, SIGNAL( rightClick(const KPDFPage *, const QPoint &) ), this, SLOT( slotShowMenu(const KPDFPage *, const QPoint &) ) );
// shrink the bottom controller toolbar (too hackish..) // shrink the bottom controller toolbar (too hackish..)
thumbsBox->setStretchFactor( m_searchWidget, 100 ); thumbsBox->setStretchFactor( m_searchWidget, 100 );
...@@ -189,7 +189,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName, ...@@ -189,7 +189,7 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// rightLayout->addWidget( rtb ); // rightLayout->addWidget( rtb );
m_pageView = new PageView( m_splitter, m_document ); m_pageView = new PageView( m_splitter, m_document );
m_pageView->setFocus(); //usability setting m_pageView->setFocus(); //usability setting
connect( m_pageView, SIGNAL( urlDropped( const KURL& ) ), SLOT( openURLFromDocument( const KURL & ))); connect( m_pageView, SIGNAL( urlDropped( const KUrl& ) ), SLOT( openURLFromDocument( const KUrl & )));
connect( m_pageView, SIGNAL( rightClick(const KPDFPage *, const QPoint &) ), this, SLOT( slotShowMenu(const KPDFPage *, const QPoint &) ) ); connect( m_pageView, SIGNAL( rightClick(const KPDFPage *, const QPoint &) ), this, SLOT( slotShowMenu(const KPDFPage *, const QPoint &) ) );
connect( m_document, SIGNAL(error(QString&,int )),m_pageView,SLOT(errorMessage(QString&,int ))); connect( m_document, SIGNAL(error(QString&,int )),m_pageView,SLOT(errorMessage(QString&,int )));
connect( m_document, SIGNAL(warning(QString&,int )),m_pageView,SLOT(warningMessage(QString&,int ))); connect( m_document, SIGNAL(warning(QString&,int )),m_pageView,SLOT(warningMessage(QString&,int )));
...@@ -323,7 +323,7 @@ Part::~Part() ...@@ -323,7 +323,7 @@ Part::~Part()
delete m_document; delete m_document;
} }
void Part::openURLFromDocument(const KURL &url) void Part::openURLFromDocument(const KUrl &url)
{ {
m_bExtension->openURLNotify(); m_bExtension->openURLNotify();
m_bExtension->setLocationBarURL(url.prettyURL()); m_bExtension->setLocationBarURL(url.prettyURL());
...@@ -438,7 +438,7 @@ void Part::goToPage(uint i) ...@@ -438,7 +438,7 @@ void Part::goToPage(uint i)
m_document->setViewportPage( i - 1 ); m_document->setViewportPage( i - 1 );
} }
void Part::openDocument(KURL doc) void Part::openDocument(KUrl doc)
{ {
openURL(doc); openURL(doc);
} }
...@@ -453,7 +453,7 @@ uint Part::currentPage() ...@@ -453,7 +453,7 @@ uint Part::currentPage()
return m_document->pages() ? m_document->currentPage() + 1 : 0; return m_document->pages() ? m_document->currentPage() + 1 : 0;
} }
KURL Part::currentDocument() KUrl Part::currentDocument()
{ {
return m_document->currentDocument(); return m_document->currentDocument();
} }
...@@ -471,7 +471,7 @@ KAboutData* Part::createAboutData() ...@@ -471,7 +471,7 @@ KAboutData* Part::createAboutData()
bool Part::slotImportPSFile() bool Part::slotImportPSFile()
{ {
KURL url = KFileDialog::getOpenURL( QString::null, "application/postscript" ); KUrl url = KFileDialog::getOpenURL( QString::null, "application/postscript" );
KTempFile tf( QString::null, ".pdf" ); KTempFile tf( QString::null, ".pdf" );
if ( tf.status() == 0 && url.isLocalFile()) if ( tf.status() == 0 && url.isLocalFile())
...@@ -543,7 +543,7 @@ bool Part::openFile() ...@@ -543,7 +543,7 @@ bool Part::openFile()
return true; return true;
} }
bool Part::openURL(const KURL &url) bool Part::openURL(const KUrl &url)
{ {
// note: this can be the right place to check the file for gz or bz2 extension // note: this can be the right place to check the file for gz or bz2 extension
// if it matches then: download it (if not local) extract to a temp file using // if it matches then: download it (if not local) extract to a temp file using
...@@ -799,7 +799,7 @@ void Part::slotFindNext() ...@@ -799,7 +799,7 @@ void Part::slotFindNext()
void Part::slotSaveFileAs() void Part::slotSaveFileAs()
{ {
KURL saveURL = KFileDialog::getSaveURL( url().isLocalFile() ? url().url() : url().fileName(), QString::null, widget() ); KUrl saveURL = KFileDialog::getSaveURL( url().isLocalFile() ? url().url() : url().fileName(), QString::null, widget() );
if ( saveURL.isValid() && !saveURL.isEmpty() ) if ( saveURL.isValid() && !saveURL.isEmpty() )
{ {
if ( KIO::NetAccess::exists( saveURL, false, widget() ) ) if ( KIO::NetAccess::exists( saveURL, false, widget() ) )
...@@ -1054,7 +1054,7 @@ void Part::doPrint(KPrinter &printer) ...@@ -1054,7 +1054,7 @@ void Part::doPrint(KPrinter &printer)
} }
} }
void Part::restoreDocument(const KURL &url, int page) void Part::restoreDocument(const KUrl &url, int page)
{ {
if (openURL(url)) goToPage(page); if (openURL(url)) goToPage(page);
} }
......
...@@ -27,7 +27,7 @@ class QWidget; ...@@ -27,7 +27,7 @@ class QWidget;
class QSplitter; class QSplitter;
class QToolBox; class QToolBox;
class KURL; class KUrl;
class KAction; class KAction;
class KConfig; class KConfig;
class KDirWatch; class KDirWatch;
...@@ -76,10 +76,10 @@ public: ...@@ -76,10 +76,10 @@ public:
static KAboutData* createAboutData(); static KAboutData* createAboutData();
ASYNC goToPage(uint page); ASYNC goToPage(uint page);
ASYNC openDocument(KURL doc); ASYNC openDocument(KUrl doc);
uint pages(); uint pages();
uint currentPage(); uint currentPage();
KURL currentDocument(); KUrl currentDocument();
signals: signals:
void enablePrintAction(bool enable); void enablePrintAction(bool enable);
...@@ -87,7 +87,7 @@ signals: ...@@ -87,7 +87,7 @@ signals:
protected: protected:
// reimplemented from KParts::ReadOnlyPart // reimplemented from KParts::ReadOnlyPart
bool openFile(); bool openFile();
bool openURL(const KURL &url); bool openURL(const KUrl &url);
bool closeURL(); bool closeURL();
// filter that watches for splitter size changes // filter that watches for splitter size changes
bool eventFilter( QObject * watched, QEvent * e ); bool eventFilter( QObject * watched, QEvent * e );
...@@ -95,7 +95,7 @@ protected: ...@@ -95,7 +95,7 @@ protected:
protected slots: protected slots:
// connected to actions // connected to actions
void openURLFromDocument(const KURL &url); void openURLFromDocument(const KUrl &url);
void slotGoToPage(); void slotGoToPage();
void slotPreviousPage(); void slotPreviousPage();
void slotNextPage(); void slotNextPage();
...@@ -127,7 +127,7 @@ protected slots: ...@@ -127,7 +127,7 @@ protected slots:
public slots: public slots:
// connected to Shell action (and browserExtension), not local one // connected to Shell action (and browserExtension), not local one
void slotPrint(); void slotPrint();
void restoreDocument(const KURL &url, int page); void restoreDocument(const KUrl &url, int page);
void saveDocumentRestoreInfo(KConfig* config); void saveDocumentRestoreInfo(KConfig* config);
void slotFileDirty( const QString& ); void slotFileDirty( const QString& );
void slotDoFileDirty(); void slotDoFileDirty();
......
...@@ -116,8 +116,8 @@ public: ...@@ -116,8 +116,8 @@ public:
// actions // actions
KSelectAction * aOrientation; KSelectAction * aOrientation;
KSelectAction * aPaperSizes; KSelectAction * aPaperSizes;
KToggleAction * aMouseNormal; KAction * aMouseNormal;
KToggleAction * aMouseSelect; KAction * aMouseSelect;
KToggleAction * aToggleAnnotator; KToggleAction * aToggleAnnotator;
KSelectAction * aZoom; KSelectAction * aZoom;
KToggleAction * aZoomFitWidth; KToggleAction * aZoomFitWidth;
...@@ -263,15 +263,17 @@ void PageView::setupActions( KActionCollection * ac ) ...@@ -263,15 +263,17 @@ void PageView::setupActions( KActionCollection * ac )
d->aViewContinuous->setChecked( KpdfSettings::viewContinuous() ); d->aViewContinuous->setChecked( KpdfSettings::viewContinuous() );
// Mouse-Mode actions // Mouse-Mode actions
d->aMouseNormal = new KRadioAction( i18n("&Browse Tool"), "mouse", 0, this, SLOT( slotSetMouseNormal() ), ac, "mouse_drag" ); QActionGroup * actGroup = new QActionGroup( this );
d->aMouseNormal->setExclusiveGroup( "MouseType" ); actGroup->setExclusive( true );
d->aMouseNormal = new KAction( i18n("&Browse Tool"), "mouse", 0, this, SLOT( slotSetMouseNormal() ), ac, "mouse_drag" );
d->aMouseNormal->setActionGroup( actGroup );
d->aMouseNormal->setChecked( true ); d->aMouseNormal->setChecked( true );
KToggleAction * mz = new KRadioAction( i18n("&Zoom Tool"), "viewmag", 0, this, SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" ); KAction * mz = new KAction( i18n("&Zoom Tool"), "viewmag", 0, this, SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" );
mz->setExclusiveGroup( "MouseType" ); mz->setActionGroup( actGroup );
d->aMouseSelect = new KRadioAction( i18n("&Select Tool"), "frame_edit", 0, this, SLOT( slotSetMouseSelect() ), ac, "mouse_select" ); d->aMouseSelect = new KAction( i18n("&Select Tool"), "frame_edit", 0, this, SLOT( slotSetMouseSelect() ), ac, "mouse_select" );
d->aMouseSelect->setExclusiveGroup( "MouseType" ); d->aMouseSelect->setActionGroup( actGroup );
d->aToggleAnnotator = new KToggleAction( i18n("&Review"), "pencil", 0, ac, "mouse_toggle_annotate" ); d->aToggleAnnotator = new KToggleAction( i18n("&Review"), "pencil", 0, ac, "mouse_toggle_annotate" );
connect( d->aToggleAnnotator, SIGNAL( toggled( bool ) ), SLOT( slotToggleAnnotator( bool ) ) ); connect( d->aToggleAnnotator, SIGNAL( toggled( bool ) ), SLOT( slotToggleAnnotator( bool ) ) );
...@@ -633,7 +635,7 @@ if ( d->document->handleEvent( pe ) ) ...@@ -633,7 +635,7 @@ if ( d->document->handleEvent( pe ) )
if ( d->mouseTextSelecting ) if ( d->mouseTextSelecting )
{ {
QRect blendRect; QRect blendRect;
QLinkedList<QRect>::iterator it=d->mouseTextSelectionRect->begin(), QList<QRect>::iterator it=d->mouseTextSelectionRect->begin(),
end=d->mouseTextSelectionRect->end(); end=d->mouseTextSelectionRect->end();
XRenderColor col; XRenderColor col;
float alpha=0.2f; float alpha=0.2f;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <qlayout.h> #include <qlayout.h>
#include <qlabel.h> #include <qlabel.h>
#include <klocale.h> #include <klocale.h>
#include <klistview.h> #include <k3listview.h>
#include <ksqueezedtextlabel.h> #include <ksqueezedtextlabel.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
...@@ -78,7 +78,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc) ...@@ -78,7 +78,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
QFrame *page2 = addPage(i18n("Fonts")); QFrame *page2 = addPage(i18n("Fonts"));
page2Layout = new QVBoxLayout(page2, 0, KDialog::spacingHint()); page2Layout = new QVBoxLayout(page2, 0, KDialog::spacingHint());
// add a klistview with 4 columns // add a klistview with 4 columns
KListView *lv = new KListView(page2); K3ListView *lv = new K3ListView(page2);
lv->addColumn( i18n("Name") ); lv->addColumn( i18n("Name") );
lv->addColumn( i18n("Type") ); lv->addColumn( i18n("Type") );
lv->addColumn( i18n("Embedded") ); lv->addColumn( i18n("Embedded") );
...@@ -87,7 +87,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc) ...@@ -87,7 +87,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
// populate the klistview // populate the klistview
for ( QDomNode node = fonts->documentElement().firstChild(); !node.isNull(); node = node.nextSibling() ) { for ( QDomNode node = fonts->documentElement().firstChild(); !node.isNull(); node = node.nextSibling() ) {
QDomElement e = node.toElement(); QDomElement e = node.toElement();
new KListViewItem( lv, e.attribute( "Name" ), e.attribute( "Type" ), new K3ListViewItem( lv, e.attribute( "Name" ), e.attribute( "Type" ),
e.attribute( "Embedded" ), e.attribute( "File" ) ); e.attribute( "Embedded" ), e.attribute( "File" ) );
} }
} }
...@@ -95,9 +95,9 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc) ...@@ -95,9 +95,9 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
// current width: left columnt + right column + dialog borders // current width: left columnt + right column + dialog borders
int width = layout->minimumSize().width() + valMaxWidth + 2 * marginHint() + spacingHint() + 30; int width = layout->minimumSize().width() + valMaxWidth + 2 * marginHint() + spacingHint() + 30;
if ( page2Layout ) if ( page2Layout )
width = QMAX( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 ); width = qMax( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 );
// stay inside the 2/3 of the screen width // stay inside the 2/3 of the screen width
QRect screenContainer = KGlobalSettings::desktopGeometry( this ); QRect screenContainer = KGlobalSettings::desktopGeometry( this );
width = QMIN( width, 2*screenContainer.width()/3 ); width = qMin( width, 2*screenContainer.width()/3 );
resize(width, 1); resize(width, 1);
} }
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include <klocale.h> #include <klocale.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <klineedit.h> #include <klineedit.h>
#include <ktoolbarbutton.h>
// local includes // local includes
#include "searchwidget.h" #include "searchwidget.h"
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#include <qlayout.h> #include <qlayout.h>
#include <qtimer.h> #include <qtimer.h>
#include <ktoolbar.h> #include <ktoolbar.h>
#include <klistview.h> #include <k3listview.h>
#include <klistviewsearchline.h> #include <k3listviewsearchline.h>
#include <kaction.h> #include <kaction.h>
#include <kactionclasses.h> #include <kactionclasses.h>
#include <klocale.h> #include <klocale.h>
...@@ -35,13 +35,13 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document ) ...@@ -35,13 +35,13 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
QVBoxLayout * vLayout = new QVBoxLayout( this, 0, 4 ); QVBoxLayout * vLayout = new QVBoxLayout( this, 0, 4 );
m_toolBar1 = new KToolBar( this, "reviewSearchBar" ); m_toolBar1 = new KToolBar( this, "reviewSearchBar" );
vLayout->addWidget( m_toolBar1 ); vLayout->addWidget( m_toolBar1 );
m_listView = new KListView( this ); m_listView = new K3ListView( this );
vLayout->addWidget( m_listView ); vLayout->addWidget( m_listView );
m_toolBar2 = new KToolBar( this, "reviewOptsBar" ); m_toolBar2 = new KToolBar( this, "reviewOptsBar" );
vLayout->addWidget( m_toolBar2 ); vLayout->addWidget( m_toolBar2 );
// setup 1-UPPER toolbar and searchLine // setup 1-UPPER toolbar and searchLine
m_searchLine = new KListViewSearchLine( m_toolBar1, m_listView ); m_searchLine = new K3ListViewSearchLine( m_toolBar1, m_listView );
m_toolBar1->setIconDimensions( 16 ); m_toolBar1->setIconDimensions( 16 );
m_toolBar1->setMovable( false ); m_toolBar1->setMovable( false );
// - add Clear button // - add Clear button
...@@ -79,7 +79,7 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document ) ...@@ -79,7 +79,7 @@ Reviews::Reviews( QWidget * parent, KPDFDocument * document )
m_listView->addColumn( i18n("Annotation") ); m_listView->addColumn( i18n("Annotation") );
m_listView->header()->hide(); m_listView->header()->hide();
m_listView->setTreeStepSize( 16 ); m_listView->setTreeStepSize( 16 );
m_listView->setResizeMode( KListView::AllColumns ); m_listView->setResizeMode( K3ListView::AllColumns );
} }
//BEGIN DocumentObserver Notifies -> requestListViewUpdate //BEGIN DocumentObserver Notifies -> requestListViewUpdate
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
class KPDFDocument; class KPDFDocument;
class KPDFPage; class KPDFPage;
class KToolBar; class KToolBar;
class KListView; class K3ListView;
class KListViewSearchLine; class K3ListViewSearchLine;
class QTimer; class QTimer;
/** /**
...@@ -51,8 +51,8 @@ class Reviews : public QWidget, public DocumentObserver ...@@ -51,8 +51,8 @@ class Reviews : public QWidget, public DocumentObserver
// data fields (GUI) // data fields (GUI)
KToolBar * m_toolBar1; KToolBar * m_toolBar1;
KToolBar * m_toolBar2; KToolBar * m_toolBar2;
KListView * m_listView; K3ListView * m_listView;
KListViewSearchLine * m_searchLine; K3ListViewSearchLine * m_searchLine;
// internal storage // internal storage
KPDFDocument * m_document; KPDFDocument * m_document;
QVector< KPDFPage * > m_pages; QVector< KPDFPage * > m_pages;
......
...@@ -22,19 +22,19 @@ ...@@ -22,19 +22,19 @@
// they're slow when converted to page number. drop the 2nd column idea. // they're slow when converted to page number. drop the 2nd column idea.
// to enable set TocPageColumn=true in [Nav Panel] // to enable set TocPageColumn=true in [Nav Panel]
class TOCItem : public KListViewItem class TOCItem : public K3ListViewItem
{ {
public: public:
TOCItem( KListView *parent, TOCItem *after, const QDomElement & e ) TOCItem( K3ListView *parent, TOCItem *after, const QDomElement & e )
: KListViewItem( parent, after, e.tagName() ), m_element( e ) : K3ListViewItem( parent, after, e.tagName() ), m_element( e )
{ {
if ( KpdfSettings::tocPageColumn() && e.hasAttribute( "Page" ) ) if ( KpdfSettings::tocPageColumn() && e.hasAttribute( "Page" ) )
setText( 1, e.attribute( "Page" ) ); setText( 1, e.attribute( "Page" ) );
setMultiLinesEnabled( true ); setMultiLinesEnabled( true );
} }
TOCItem( KListViewItem *parent, TOCItem *after, const QDomElement & e ) TOCItem( K3ListViewItem *parent, TOCItem *after, const QDomElement & e )
: KListViewItem( parent, after, e.tagName() ), m_element( e ) : K3ListViewItem( parent, after, e.tagName() ), m_element( e )
{ {
if ( KpdfSettings::tocPageColumn() && e.hasAttribute( "Page" ) ) if ( KpdfSettings::tocPageColumn() && e.hasAttribute( "Page" ) )
setText( 1, e.attribute( "Page" ) ); setText( 1, e.attribute( "Page" ) );
...@@ -50,7 +50,7 @@ class TOCItem : public KListViewItem ...@@ -50,7 +50,7 @@ class TOCItem : public KListViewItem
QDomElement m_element; QDomElement m_element;
}; };
TOC::TOC(QWidget *parent, KPDFDocument *document) : KListView(parent), m_document(document) TOC::TOC(QWidget *parent, KPDFDocument *document) : K3ListView(parent), m_document(document)
{ {
addColumn( i18n("Topic") ); addColumn( i18n("Topic") );
if (KpdfSettings::tocPageColumn()) if (KpdfSettings::tocPageColumn())
...@@ -96,7 +96,7 @@ void TOC::notifySetup( const QVector< KPDFPage * > & /*pages*/, bool documentCha ...@@ -96,7 +96,7 @@ void TOC::notifySetup( const QVector< KPDFPage * > & /*pages*/, bool documentCha
emit hasTOC( true ); emit hasTOC( true );
} }
void TOC::addChildren( const QDomNode & parentNode, KListViewItem * parentItem ) void TOC::addChildren( const QDomNode & parentNode, K3ListViewItem * parentItem )
{ {
// keep track of the current listViewItem // keep track of the current listViewItem
TOCItem * currentItem = 0; TOCItem * currentItem = 0;
......
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
#define _KPDF_TOC_H_ #define _KPDF_TOC_H_
#include <qdom.h> #include <qdom.h>
#include <klistview.h> #include <k3listview.h>
#include "core/document.h" #include "core/document.h"
#include "core/observer.h" #include "core/observer.h"
class KPDFDocument; class KPDFDocument;
class TOC : public KListView, public DocumentObserver class TOC : public K3ListView, public DocumentObserver
{ {
Q_OBJECT Q_OBJECT
public: public:
...@@ -35,7 +35,7 @@ Q_OBJECT ...@@ -35,7 +35,7 @@ Q_OBJECT
void slotExecuted(Q3ListViewItem *i); void slotExecuted(Q3ListViewItem *i);
private: private:
void addChildren( const QDomNode & parentNode, KListViewItem * parentItem = 0 ); void addChildren( const QDomNode & parentNode, K3ListViewItem * parentItem = 0 );
DocumentViewport getViewport( const QDomElement &e ) const; DocumentViewport getViewport( const QDomElement &e ) const;
KPDFDocument *m_document; KPDFDocument *m_document;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment