Tulip  5.0.0
Large graphs analysis and drawing
TulipFontDialog.h
1 /*
2  *
3  * This file is part of Tulip (www.tulip-software.org)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 
22 #ifndef TULIPFONTDIALOG_H
23 #define TULIPFONTDIALOG_H
24 
25 #include <QDialog>
26 
27 #include <tulip/tulipconf.h>
28 #include <tulip/TulipFont.h>
29 
30 namespace Ui {
31 class TulipFontDialog;
32 }
33 
34 namespace tlp {
35 
36 class TLP_QT_SCOPE TulipFontDialog : public QDialog {
37  Q_OBJECT
38 
39  Ui::TulipFontDialog* _ui;
40  TulipFont previousFont;
41  int ok;
42 
43 public:
44  explicit TulipFontDialog(QWidget *parent = NULL);
45  ~TulipFontDialog();
46  TulipFont font() const;
47  int fontSize() const;
48  void done(int res) {
49  ok = res;
50  QDialog::done(res);
51  }
52  TulipFont getSelectedFont() const {
53  return ok == QDialog::Accepted ? font() : previousFont;
54  }
55 
56 
57  static TulipFont getFont(QWidget* parent = NULL,const TulipFont& selectedFont=TulipFont());
58 
59 public slots:
60  void selectFont(const TulipFont&);
61 
62 protected slots:
63  void fontChanged();
64 };
65 
66 }
67 
68 #endif // TULIPFONTDIALOG_H
69 ///@endcond