tdebase
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.

konq_tabs.h 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* This file is part of the KDE project
  2. Copyright (C) 2002-2003 Konqueror Developers
  3. 2002-2003 Douglas Hanley <douglash@caltech.edu>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (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
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  15. MA 02110-1301, USA.
  16. */
  17. #ifndef __konq_tabs_h__
  18. #define __konq_tabs_h__
  19. #include "konq_frame.h"
  20. #include <ktabwidget.h>
  21. class TQPixmap;
  22. class TQPopupMenu;
  23. class TQToolButton;
  24. class KonqView;
  25. class KonqViewManager;
  26. class KonqFrameBase;
  27. class KonqFrame;
  28. class KonqFrameContainerBase;
  29. class KonqFrameContainer;
  30. class TDEConfig;
  31. class KSeparator;
  32. class KProgress;
  33. class TDEAction;
  34. class KonqFrameTabs : public KTabWidget, public KonqFrameContainerBase
  35. {
  36. Q_OBJECT
  37. friend class KonqFrame; //for emitting ctrlTabPressed() only, aleXXX
  38. public:
  39. KonqFrameTabs(TQWidget* parent, KonqFrameContainerBase* parentContainer,
  40. KonqViewManager* viewManager, const char * name = 0);
  41. virtual ~KonqFrameTabs();
  42. virtual void listViews( ChildViewList *viewList );
  43. virtual void saveConfig( TDEConfig* config, const TQString &prefix, bool saveURLs,
  44. KonqFrameBase* docContainer, int id = 0, int depth = 0 );
  45. virtual void copyHistory( KonqFrameBase *other );
  46. virtual void printFrameInfo( const TQString& spaces );
  47. TQPtrList<KonqFrameBase>* childFrameList() { return m_pChildFrameList; }
  48. virtual void setTitle( const TQString &title, TQWidget* sender );
  49. virtual void setTabIcon( const KURL &url, TQWidget* sender );
  50. virtual TQWidget* widget() { return this; }
  51. virtual TQCString frameType() { return TQCString("Tabs"); }
  52. void activateChild();
  53. /**
  54. * Call this after inserting a new frame into the splitter.
  55. */
  56. void insertChildFrame( KonqFrameBase * frame, int index = -1);
  57. /**
  58. * Call this before deleting one of our children.
  59. */
  60. void removeChildFrame( KonqFrameBase * frame );
  61. //inherited
  62. virtual void reparentFrame(TQWidget * parent,
  63. const TQPoint & p, bool showIt=FALSE );
  64. void moveTabBackward(int index);
  65. void moveTabForward(int index);
  66. public slots:
  67. void slotCurrentChanged(TQWidget* newPage);
  68. void setAlwaysTabbedMode(bool enable);
  69. signals:
  70. void ctrlTabPressed();
  71. void removeTabPopup();
  72. protected:
  73. void refreshSubPopupMenuTab();
  74. void hideTabBar();
  75. TQPtrList<KonqFrameBase>* m_pChildFrameList;
  76. private slots:
  77. void slotContextMenu( const TQPoint& );
  78. void slotContextMenu( TQWidget*, const TQPoint& );
  79. void slotCloseRequest( TQWidget* );
  80. void slotMovedTab( int, int );
  81. void slotMouseMiddleClick();
  82. void slotMouseMiddleClick( TQWidget* );
  83. void slotTestCanDecode(const TQDragMoveEvent *e, bool &accept /* result */);
  84. void slotReceivedDropEvent( TQDropEvent* );
  85. void slotInitiateDrag( TQWidget * );
  86. void slotReceivedDropEvent( TQWidget *, TQDropEvent * );
  87. void slotSubPopupMenuTabActivated( int );
  88. private:
  89. KonqViewManager* m_pViewManager;
  90. TQPopupMenu* m_pPopupMenu;
  91. TQPopupMenu* m_pSubPopupMenuTab;
  92. TQToolButton* m_rightWidget;
  93. TQToolButton* m_leftWidget;
  94. bool m_permanentCloseButtons;
  95. bool m_alwaysTabBar;
  96. bool m_MouseMiddleClickClosesTab;
  97. int m_closeOtherTabsId;
  98. };
  99. #endif