TDE core libraries
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.

kdirlistertest.h 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /* This file is part of the KDE desktop environment
  2. Copyright (C) 2001, 2002 Michael Brade <brade@kde.org>
  3. This library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public
  5. License as published by the Free Software Foundation; either
  6. version 2 of the License, or (at your option) any later version.
  7. This library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public License
  12. along with this library; see the file COPYING.LIB. If not, write to
  13. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  14. Boston, MA 02110-1301, USA.
  15. */
  16. #ifndef _KDIRLISTERTEST_H_
  17. #define _KDIRLISTERTEST_H_
  18. #include <tqwidget.h>
  19. #include <tqstring.h>
  20. #include <kurl.h>
  21. #include <tdefileitem.h>
  22. #include <iostream>
  23. using namespace std;
  24. class PrintSignals : public TQObject
  25. {
  26. Q_OBJECT
  27. public:
  28. PrintSignals() : TQObject() { }
  29. public slots:
  30. void started( const KURL &url )
  31. {
  32. cout << "*** started( " << url.url().local8Bit() << " )" << endl;
  33. }
  34. void canceled() { cout << "canceled()" << endl; }
  35. void canceled( const KURL& url )
  36. {
  37. cout << "*** canceled( " << url.prettyURL().local8Bit() << " )" << endl;
  38. }
  39. void completed() { cout << "*** completed()" << endl; }
  40. void completed( const KURL& url )
  41. {
  42. cout << "*** completed( " << url.prettyURL().local8Bit() << " )" << endl;
  43. }
  44. void redirection( const KURL& url )
  45. {
  46. cout << "*** redirection( " << url.prettyURL().local8Bit() << " )" << endl;
  47. }
  48. void redirection( const KURL& src, const KURL& dest )
  49. {
  50. cout << "*** redirection( " << src.prettyURL().local8Bit() << ", "
  51. << dest.prettyURL().local8Bit() << " )" << endl;
  52. }
  53. void clear() { cout << "*** clear()" << endl; }
  54. void newItems( const KFileItemList& items )
  55. {
  56. cout << "*** newItems: " << endl;
  57. for ( KFileItemListIterator it( items ) ; it.current() ; ++it )
  58. cout << it.current() << " " << it.current()->name().local8Bit() << endl;
  59. }
  60. void deleteItem( KFileItem* item )
  61. {
  62. cout << "*** deleteItem: " << item->url().prettyURL().local8Bit() << endl;
  63. }
  64. void itemsFilteredByMime( const KFileItemList& )
  65. {
  66. cout << "*** itemsFilteredByMime: " << endl;
  67. // TODO
  68. }
  69. void refreshItems( const KFileItemList& )
  70. {
  71. cout << "*** refreshItems: " << endl;
  72. // TODO
  73. }
  74. void infoMessage( const TQString& msg )
  75. { cout << "*** infoMessage: " << msg.local8Bit() << endl; }
  76. void percent( int percent )
  77. { cout << "*** percent: " << percent << endl; }
  78. void totalSize( TDEIO::filesize_t size )
  79. { cout << "*** totalSize: " << (long)size << endl; }
  80. void processedSize( TDEIO::filesize_t size )
  81. { cout << "*** processedSize: " << (long)size << endl; }
  82. void speed( int bytes_per_second )
  83. { cout << "*** speed: " << bytes_per_second << endl; }
  84. };
  85. class KDirListerTest : public TQWidget
  86. {
  87. Q_OBJECT
  88. public:
  89. KDirListerTest( TQWidget *parent=0, const char *name=0 );
  90. ~KDirListerTest();
  91. public slots:
  92. void startRoot();
  93. void startHome();
  94. void startTar();
  95. void test();
  96. void completed();
  97. private:
  98. KDirLister *lister;
  99. PrintSignals *debug;
  100. };
  101. #endif