1 /* 2 3 Firewall Builder 4 5 Copyright (C) 2008 NetCitadel, LLC 6 7 Author: alek@codeminders.com 8 9 $Id$ 10 11 This program is free software which we release under the GNU General Public 12 License. You may redistribute and/or modify this program under the terms 13 of that license as published by the Free Software Foundation; either 14 version 2 of the License, or (at your option) any later version. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 GNU General Public License for more details. 20 21 To get a copy of the GNU General Public License, write to the Free Software 22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 23 24 */ 25 26 #ifndef __FAKEWIZARD_H__ 27 #define __FAKEWIZARD_H__ 28 29 #include <vector> 30 #include <qpushbutton.h> 31 #include <qstackedwidget.h> 32 #include <qlabel.h> 33 #include <qstring.h> 34 35 class FakeWizard 36 { 37 protected: 38 QWidget *mainWidget; 39 QStackedWidget *stackedWidget; 40 QPushButton *nextButton; 41 QPushButton *backButton; 42 QPushButton *finishButton; 43 QPushButton *cancelButton; 44 QLabel *titleLabel; 45 46 int m_currentPage; 47 int m_pageCount; 48 49 std::vector<bool> nextEnabled; 50 std::vector<bool> backEnabled; 51 std::vector<bool> appropriates; 52 std::vector<bool> finishEnabled; 53 std::vector<QString> pageTitles; 54 55 int nextRelevant(const int page) const; 56 int previousRelevant(const int page) const; 57 58 public : 59 60 FakeWizard(); 61 virtual ~FakeWizard(); 62 63 void setControlWidgets(QWidget *_mainWidget, 64 QStackedWidget *_stackedWidget, 65 QPushButton *_nextButton, 66 QPushButton *_finishButton, 67 QPushButton *_backButton, 68 QPushButton *_cancelButton, 69 QLabel *_titleLabel = NULL); 70 71 int pageCount() const; 72 int currentPage() const; 73 void showPage(const int page); 74 void setCurrentPage(const int page); 75 void setNextEnabled(const int page, const bool enabled); 76 void setBackEnabled(const int page, const bool enabled); 77 void setAppropriate(const int page, const bool value); 78 void setFinishEnabled(const int page, const bool enabled); 79 void setTitle(const int page, const QString title); 80 appropriate(const int)81 virtual bool appropriate(const int) const 82 { return true; } 83 84 /*virtual void backClicked(); 85 virtual void nextClicked();*/ 86 }; 87 88 #endif 89