NCL Composer  0.1.5
 All Classes Functions Variables Pages
PreferencesDialog.h
1 /* Copyright (c) 2011 Telemidia/PUC-Rio.
2  * All rights reserved. This program and the accompanying materials
3  * are made available under the terms of the Eclipse Public License v1.0
4  * which accompanies this distribution, and is available at
5  * http://www.eclipse.org/legal/epl-v10.html
6  *
7  * Contributors:
8  * Telemidia/PUC-Rio - initial API and implementation
9  */
10 #ifndef PREFERENCES_H
11 #define PREFERENCES_H
12 
13 #include <QDir>
14 #include <QDebug>
15 #include <QPluginLoader>
16 #include <QDialog>
17 #include <QAbstractButton>
18 #include <QListWidgetItem>
19 
20 #include <core/extensions/IPluginFactory.h>
21 using namespace composer::extension;
22 
23 #include <core/modules/PluginControl.h>
24 using namespace composer::core;
25 
26 #include "IPreferencesPage.h"
27 
28 namespace Ui {
29  class PreferencesDialog;
30 }
31 
32 namespace composer {
33  namespace gui {
34 
35 class PreferencesDialog : public QDialog
36 {
37  Q_OBJECT
38 
39 public:
40  explicit PreferencesDialog(QWidget *parent = 0);
42 
43  void addPreferencePage(IPluginFactory *);
44  void addPreferencePage(IPreferencesPage *page);
48  void addPreferencePage(QIcon icon, QString name, QWidget *widget);
49 
50 private:
51  Ui::PreferencesDialog *ui;
52  QListWidgetItem *currentItem;
53  QWidget *currentPage;
54 
55  void loadPreferencesPages();
56  QMap <QString, QWidget *> pages;
57 
58 private slots:
59  void changeActivePage();
60  void applyCurrentValues();
61  void buttonClicked(QAbstractButton*);
62 
63 /*public Q_SLOTS:
64  void show();
65  void selectFirst(); */
66 };
67 
68 }} //end namespace
69 
70 #endif // PREFERENCES_H