[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
src/klftools/klfflowlayout.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  *   file klfflowlayout.h
00003  *   This file is part of the KLatexFormula Project.
00004  *   Copyright (C) 2011 by Philippe Faist
00005  *   philippe.faist at bluewin.ch
00006  *                                                                         *
00007  *   This program is free software; you can redistribute it and/or modify  *
00008  *   it under the terms of the GNU General Public License as published by  *
00009  *   the Free Software Foundation; either version 2 of the License, or     *
00010  *   (at your option) any later version.                                   *
00011  *                                                                         *
00012  *   This program is distributed in the hope that it will be useful,       *
00013  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00014  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00015  *   GNU General Public License for more details.                          *
00016  *                                                                         *
00017  *   You should have received a copy of the GNU General Public License     *
00018  *   along with this program; if not, write to the                         *
00019  *   Free Software Foundation, Inc.,                                       *
00020  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00021  ***************************************************************************/
00022 /* $Id$ */
00023 
00024 #ifndef KLFFLOWLAYOUT_H
00025 #define KLFFLOWLAYOUT_H
00026 
00027 #include <QLayout>
00028 #include <QWidget>
00029 #include <QLayoutItem>
00030 
00031 
00032 struct KLFFlowLayoutPrivate;
00033 
00034 
00038 class KLFFlowLayout : public QLayout
00039 {
00040   Q_OBJECT
00041 
00042   Q_ENUMS(Flush)
00043   Q_PROPERTY(Flush flush READ flush WRITE setFlush) ;
00044   Q_PROPERTY(int horizontalSpacing READ horizontalSpacing WRITE setHorizontalSpacing) ;
00045   Q_PROPERTY(int verticalSpacing READ verticalSpacing WRITE setVerticalSpacing) ;
00046 
00047 public:
00049   enum Flush {
00050     NoFlush = 0, 
00051     FlushSparse, 
00052     FlushBegin, 
00053     FlushEnd 
00054   };
00055 
00056   KLFFlowLayout(QWidget *parent, int margin = -1, int hspacing = -1, int vspacing = -1);
00057   virtual ~KLFFlowLayout();
00058 
00061   virtual void addItem(QLayoutItem *item)
00062   { addItem(item, 0, 0); }
00063   virtual void addItem(QLayoutItem *item, int hstretch, int vstretch);
00064   virtual void addLayout(QLayout *l, int hstretch = 0, int vstretch = 0);
00065   virtual void addWidget(QWidget *w, int hstretch = 0, int vstretch = 0, Qt::Alignment align = 0);
00066   int horizontalSpacing() const;
00067   int verticalSpacing() const;
00068   Flush flush() const;
00069   virtual int count() const;
00070   virtual QLayoutItem *itemAt(int index) const;
00071   virtual QLayoutItem *takeAt(int index);
00072   virtual Qt::Orientations expandingDirections() const;
00073   virtual bool hasHeightForWidth() const;
00074   virtual int heightForWidth(int width) const;
00075   virtual QSize minimumSize() const;
00076   virtual QSize maximumSize() const;
00077   virtual QSize sizeHint() const;
00078 
00079   void setGeometry(const QRect &rect);
00080 
00081   virtual void invalidate();
00082 
00083   virtual bool event(QEvent *event);
00084   virtual bool eventFilter(QObject *obj, QEvent *event);
00085   
00086 public slots:
00087   void clearAll(bool deleteItems = true);
00088   void setHorizontalSpacing(int spacing);
00089   void setVerticalSpacing(int spacing);
00090   void setFlush(Flush f);
00091 
00092 private:
00093 
00094   KLFFlowLayoutPrivate *d;
00095 };
00096 
00097 
00098 
00099 
00100 
00101 
00102 
00103 #endif

Generated by doxygen 1.7.6.1. The KLatexFormula website is hosted on sourceforge.net