Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/TulipFontDialog.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 
00022 #ifndef TULIPFONTDIALOG_H
00023 #define TULIPFONTDIALOG_H
00024 
00025 #include <QDialog>
00026 
00027 #include <tulip/tulipconf.h>
00028 #include <tulip/TulipFont.h>
00029 
00030 namespace Ui {
00031 class TulipFontDialog;
00032 }
00033 
00034 namespace tlp {
00035 
00036 class TLP_QT_SCOPE TulipFontDialog : public QDialog {
00037   Q_OBJECT
00038 
00039   Ui::TulipFontDialog* _ui;
00040   TulipFont previousFont;
00041   int ok;
00042 
00043 public:
00044   explicit TulipFontDialog(QWidget *parent = NULL);
00045   ~TulipFontDialog();
00046   TulipFont font() const;
00047   int fontSize() const;
00048   void done(int res) {
00049     ok = res;
00050     QDialog::done(res);
00051   }
00052   TulipFont getSelectedFont() const {
00053     return ok == QDialog::Accepted ? font() : previousFont;
00054   }
00055 
00056 
00057   static TulipFont getFont(QWidget* parent = NULL,const TulipFont& selectedFont=TulipFont());
00058 
00059 public slots:
00060   void selectFont(const TulipFont&);
00061 
00062 protected slots:
00063   void fontChanged();
00064 };
00065 
00066 }
00067 
00068 #endif // TULIPFONTDIALOG_H
00069 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties