Smb4K – Samba (SMB) share advanced browser
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.

169 lines
4.5KB

  1. /***************************************************************************
  2. smb4kpreviewdialog.h - The preview dialog of Smb4K
  3. -------------------
  4. begin : Fre Jul 4 2003
  5. copyright : (C) 2003-2007 by Alexander Reinholdt
  6. email : dustpuppy@users.berlios.de
  7. ***************************************************************************/
  8. /***************************************************************************
  9. * This program is free software; you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation; either version 2 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. * This program is distributed in the hope that it will be useful, but *
  15. * WITHOUT ANY WARRANTY; without even the implied warranty of *
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
  17. * General Public License for more details. *
  18. * *
  19. * You should have received a copy of the GNU General Public License *
  20. * along with this program; if not, write to the *
  21. * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
  22. * MA 02110-1301 USA *
  23. ***************************************************************************/
  24. #ifndef SMB4KPREVIEWDIALOG_H
  25. #define SMB4KPREVIEWDIALOG_H
  26. #ifdef HAVE_CONFIG_H
  27. #include <config.h>
  28. #endif
  29. // TQt includes
  30. #include <tqvaluelist.h>
  31. // KDE includes
  32. #include <kdialogbase.h>
  33. #include <kiconview.h>
  34. #include <ktoolbar.h>
  35. #include <kcombobox.h>
  36. // application specific includes
  37. #include "../core/smb4kpreviewitem.h"
  38. // forward declarations
  39. class Smb4KShareItem;
  40. /**
  41. * This is the preview dialog of Smb4K. You can preview remote
  42. * shares with it.
  43. *
  44. * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
  45. */
  46. class Smb4KPreviewDialog : public KDialogBase
  47. {
  48. Q_OBJECT
  49. TQ_OBJECT
  50. public:
  51. /**
  52. * This is the constructor of the preview dialog.
  53. *
  54. * @param item The Smb4KShareItem object.
  55. *
  56. * @param parent The parent of this widget
  57. *
  58. * @param name The name of this widget
  59. */
  60. Smb4KPreviewDialog( Smb4KShareItem *item, TQWidget *parent = 0, const char *name = 0 );
  61. /**
  62. * The destructor.
  63. */
  64. ~Smb4KPreviewDialog();
  65. /**
  66. * This function returns TRUE if the preview dialog has been
  67. * initialized correctly and FALSE otherwise.
  68. *
  69. * @returns TRUE if the dialog was initialized correctly.
  70. */
  71. bool isInitialized() { return m_initialized; }
  72. protected slots:
  73. /**
  74. * This slot receives the results of the attempt to generate
  75. * a preview.
  76. *
  77. * @param item The Smb4KPreviewItem for which a preview
  78. * was generated.
  79. */
  80. void slotReceivedData( Smb4KPreviewItem *item );
  81. /**
  82. * Is called, if one icon view item is clicked.
  83. */
  84. void slotItemExecuted( TQIconViewItem *item );
  85. /**
  86. * Is called, if a tool bar button is clicked.
  87. */
  88. void slotButtonClicked( int id );
  89. /**
  90. * Is called, if an item in the combo box is activated.
  91. */
  92. void slotItemActivated( const TQString &item );
  93. /**
  94. * Reimplemented from KDialogBase. Saves the dialog size and
  95. * then executes KDialogBase::slotClose().
  96. */
  97. void slotClose();
  98. private:
  99. /**
  100. * Enumeration for the buttons.
  101. */
  102. enum ButtonID{ Reload, Up, Back, Forward, Combo, None };
  103. /**
  104. * The current button id
  105. */
  106. int m_button_id;
  107. /**
  108. * Sets up the file view.
  109. */
  110. void setupView();
  111. /**
  112. * The icon view.
  113. */
  114. KIconView *m_view;
  115. /**
  116. * The toolbar.
  117. */
  118. KToolBar *m_toolbar;
  119. /**
  120. * The combo box.
  121. */
  122. KComboBox *m_combo;
  123. /**
  124. * The private Smb4KHostItem object
  125. */
  126. Smb4KPreviewItem *m_item;
  127. /**
  128. * This list holds the history of the session.
  129. */
  130. TQStringList m_history;
  131. /**
  132. * This iterator points to the current item in the history.
  133. */
  134. TQStringList::Iterator m_current_item;
  135. /**
  136. * TRUE if the dialog was successfully initilized and
  137. * FALSE otherwise.
  138. */
  139. bool m_initialized;
  140. };
  141. #endif