TDE base libraries and programs
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.

KonqViewIface.cc 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* This file is part of the KDE project
  2. Copyright (C) 2000 Simon Hausmann <hausmann@kde.org>
  3. Copyright (C) 2000 David Faure <faure@kde.org>
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public
  6. License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; see the file COPYING. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #include "KonqViewIface.h"
  18. #include "konq_view.h"
  19. #include <tdeapplication.h>
  20. #include <dcopclient.h>
  21. #include <kdebug.h>
  22. KonqViewIface::KonqViewIface( KonqView * view, const TQCString& name )
  23. : DCOPObject( name ), m_pView ( view )
  24. {
  25. }
  26. KonqViewIface::~KonqViewIface()
  27. {
  28. }
  29. void KonqViewIface::openURL( TQString url, const TQString & locationBarURL, const TQString & nameFilter )
  30. {
  31. KURL u(url);
  32. m_pView->openURL( u, locationBarURL, nameFilter );
  33. }
  34. bool KonqViewIface::changeViewMode( const TQString &serviceType,
  35. const TQString &serviceName )
  36. {
  37. return m_pView->changeViewMode( serviceType, serviceName );
  38. }
  39. void KonqViewIface::lockHistory()
  40. {
  41. m_pView->lockHistory();
  42. }
  43. void KonqViewIface::stop()
  44. {
  45. m_pView->stop();
  46. }
  47. TQString KonqViewIface::url()
  48. {
  49. return m_pView->url().url();
  50. }
  51. TQString KonqViewIface::locationBarURL()
  52. {
  53. return m_pView->locationBarURL();
  54. }
  55. TQString KonqViewIface::serviceType()
  56. {
  57. return m_pView->serviceType();
  58. }
  59. TQStringList KonqViewIface::serviceTypes()
  60. {
  61. return m_pView->serviceTypes();
  62. }
  63. DCOPRef KonqViewIface::part()
  64. {
  65. DCOPRef res;
  66. KParts::ReadOnlyPart *part = m_pView->part();
  67. if ( !part )
  68. return res;
  69. TQVariant dcopProperty = part->property( "dcopObjectId" );
  70. if ( dcopProperty.type() != TQVariant::CString )
  71. return res;
  72. res.setRef( kapp->dcopClient()->appId(), dcopProperty.toCString() );
  73. return res;
  74. }
  75. void KonqViewIface::enablePopupMenu( bool b )
  76. {
  77. m_pView->enablePopupMenu( b );
  78. }
  79. uint KonqViewIface::historyLength()const
  80. {
  81. return m_pView->historyLength();
  82. }
  83. bool KonqViewIface::allowHTML() const
  84. {
  85. return m_pView->allowHTML();
  86. }
  87. void KonqViewIface::goForward()
  88. {
  89. m_pView->go(-1);
  90. }
  91. void KonqViewIface::goBack()
  92. {
  93. m_pView->go(+1);
  94. }
  95. bool KonqViewIface::isPopupMenuEnabled() const
  96. {
  97. return m_pView->isPopupMenuEnabled();
  98. }
  99. bool KonqViewIface::canGoBack()const
  100. {
  101. return m_pView->canGoBack();
  102. }
  103. bool KonqViewIface::canGoForward()const
  104. {
  105. return m_pView->canGoForward();
  106. }
  107. void KonqViewIface::reload()
  108. {
  109. return m_pView->mainWindow()->slotReload( m_pView );
  110. }