QGpGuiTools/Settings.h
Go to the documentation of this file.
00001 /***************************************************************************
00002 **
00003 **  This file is part of QGpGuiTools.
00004 **
00005 **  This library is free software; you can redistribute it and/or
00006 **  modify it under the terms of the GNU Lesser General Public
00007 **  License as published by the Free Software Foundation; either
00008 **  version 2.1 of the License, or (at your option) any later version.
00009 **
00010 **  This file is distributed in the hope that it will be useful, but WITHOUT
00011 **  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 **  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
00013 **  License for more details.
00014 **
00015 **  You should have received a copy of the GNU Lesser General Public
00016 **  License along with this library; if not, write to the Free Software
00017 **  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00018 **
00019 **  See http://www.geopsy.org for more information.
00020 **
00021 **  Created : 2004-04-28
00022 **  Authors :
00023 **    Marc Wathelet
00024 **    Marc Wathelet (ULg, Liège, Belgium)
00025 **    Marc Wathelet (LGIT, Grenoble, France)
00026 **
00027 ***************************************************************************/
00028 
00029 #ifndef SETTINGS_H
00030 #define SETTINGS_H
00031 
00032 #include <QtGui>
00033 #include <QGpCoreTools.h>
00034 
00035 #include "QGpGuiToolsDLLExport.h"
00036 
00037 namespace QGpGuiTools {
00038 
00039 class PrintRange;
00040 
00041 class QGPGUITOOLS_EXPORT Settings
00042 {
00043 public:
00044   static QString getPath(QString name);
00045   static void setPath(QString name, QDir dirPath);
00046 
00047   static QStringList getDirHistory(const QString & caption);
00048   static void setDirHistory(const QString & caption, QDir newPath);
00049 
00050   static QStringList getHistory(const QString & name);
00051   static void setHistory(const QString & name, QString newString, int maxCount=20);
00052 
00053   static QString getFilter(QString name);
00054   static void setFilter(QString name, QString filter);
00055 
00056   static void getRect(QWidget * w, QString name);
00057   static void setRect(QWidget * w, QString name);
00058 
00059   static void getSize(QWidget * w, QString name);
00060   static void setSize(QWidget * w, QString name);
00061 
00062   static void setActiveTab(QTabWidget * w, QString name);
00063   static void activeTab(QTabWidget * w, QString name);
00064 
00065   static void setSplitter(QSplitter * w, QString name);
00066   static void splitter(QSplitter * w, QString name);
00067 
00068   static void setColumnWidth(QTableView * w, QString name);
00069   static void columnWidth(QTableView * w, QString name);
00070 
00071   static void setColumnWidth(QTreeView * w, QString name);
00072   static void columnWidth(QTreeView * w, QString name);
00073 
00074   static void getWidget(QWidget * d, QString name=QString::null, bool rect=true);
00075   static void setWidget(QWidget *d, QString name=QString::null, bool rect=true);
00076 
00077   static QString getText(QWidget * parent, const QString & caption,
00078                          const QString & label, QLineEdit::EchoMode mode=QLineEdit::Normal,
00079                          const QString & text=QString::null, bool * ok=0);
00080 
00081   static bool printSetup(QPrinter& p);
00082 private:
00083   static void getWidget(QSettings& reg, const QObjectList& list);
00084   static void setWidget(QSettings& reg, const QObjectList& list);
00085 
00086   static QStringList getHistory(QSettings& reg, const QString & name);
00087   static void setHistory(QSettings& reg, const QString & name, QString newString, int maxCount);
00088 };
00089 
00090 } // namespace QGpGuiTools
00091 
00092 #endif // SETTINGS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines