1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
/* ====================================================================
* Copyright (c) 2003-2008 Martin Hauner
* http://subcommander.tigris.org
*
* Subcommander is licensed as described in the file doc/COPYING, which
* you should have received as part of this distribution.
* ====================================================================
*/
#ifndef _SC_LAYOUTSETTINGS_H
#define _SC_LAYOUTSETTINGS_H
// qt
#include <QtCore/QRect>
#include <QtCore/QString>
#include <QtCore/QByteArray>
class QHeaderView;
class Q3Header;
/**
* Interface for storing layout related information.
*/
class LayoutSettings
{
public:
virtual ~LayoutSettings(){}
/** Get an @c int value for @a key. */
virtual int getValue( const QString& key, int val ) = 0;
/** Store @a value under @a key. */
virtual void setValue( const QString& key, int value ) = 0;
/** Get the @c QSize for @a key. If @a key is unknown return @a def. */
virtual QSize getSize( const QString& key, const QSize& size ) = 0;
/** Store @a size under @a key. */
virtual void setSize( const QString& key, const QSize& size ) = 0;
/** Get the @c QRect for @a key. If @a key is unknown return @a def. */
virtual QRect getRect( const QString& key, const QRect& def ) = 0;
/** Store @a rect under @a key. */
virtual void setRect( const QString& key, const QRect& rect ) = 0;
/** Get a @c QByteArray for @a key. If @a key is unknown return @a def.
* Typically used for QWidget::saveGeometry/restoreGeometry. */
virtual QByteArray getByteArray( const QString& key, const QByteArray& def ) = 0;
/** Store a @c QByteArray for @a key.
* Typically used for QWidget::saveGeometry/restoreGeometry. */
virtual void setByteArray( const QString& key, const QByteArray& bytearray ) = 0;
/** @obsolete Set QHeader layout (column size and position) for @a key. */
virtual void getHeaderColumns( const QString& key, Q3Header* ) = 0;
/** @obsolete Store QHeader layout (column size and position) under @a key. */
virtual void setHeaderColumns( const QString& key, const Q3Header* ) = 0;
#if 0
/** Set the column information in @c QHeaderView for @a key. */
virtual void getHeaderColumns( const QString& key, QHeaderView* ) = 0;
/** Store the column information of @c QHeader as @a key. */
virtual void setHeaderColumns( const QString& key, const QHeaderView* ) = 0;
#endif
};
#endif // _SC_LAYOUTSETTINGS_H
|