1 /* 2 * Copyright (C) 1997 Michael Roth <mroth@wirlweb.de> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU Library 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 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 */ 19 20 #ifndef __KSEPARATOR_H__ 21 #define __KSEPARATOR_H__ 22 23 #include <qframe.h> 24 25 /** 26 * Standard horizontal or vertical separator. 27 * 28 * @author Michael Roth <mroth@wirlweb.de> 29 * @version $Id: kseparator.h,v 1.14 2004/09/09 15:23:53 faure Exp $ 30 */ 31 class KSeparator : public QFrame 32 { 33 Q_OBJECT 34 Q_PROPERTY( int orientation READ orientation WRITE setOrientation ) 35 public: 36 /** 37 * Constructor. 38 * @param parent parent object. 39 * @param name name of the new object. 40 * @param f extra QWidget flags. 41 **/ 42 KSeparator( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); 43 44 /** 45 * Constructor. 46 * @param orientation Set the orientation of the separator. 47 * Possible values are HLine or Horizontal and VLine or Vertical. 48 * @param parent parent object. 49 * @param name name of the new object. 50 * @param f extra QWidget flags. 51 **/ 52 KSeparator( int orientation, QWidget* parent = 0, const char* name = 0, 53 WFlags f = 0 ); 54 55 /** 56 * Returns the orientation of the separator. 57 * @return int Possible values are VLine and HLine. 58 **/ 59 int orientation() const; 60 61 /** 62 * Set the orientation of the separator to @p orient 63 * 64 * @param orient Possible values are VLine and HLine. 65 */ 66 void setOrientation( int orient ); 67 68 /** 69 * The recommended height (width) for a horizontal (vertical) separator. 70 **/ 71 virtual QSize sizeHint() const; 72 73 protected: 74 /** 75 * @param p pointer to painter 76 */ 77 virtual void drawFrame( QPainter *p ); 78 protected: 79 virtual void virtual_hook( int id, void* data ); 80 private: 81 class KSeparatorPrivate* d; 82 }; 83 84 85 #endif // __KSEPARATOR_H__ 86