Wed, 07 Jan 2009 18:49:25 +0100
Bump copyright year number.
1 //
2 // OSSP asgui - Accounting system graphical user interface
3 // Copyright (c) 2002-2009 The OSSP Project (http://www.ossp.org/)
4 // Copyright (c) 2002-2009 Ralf S. Engelschall <rse@engelschall.com>
5 // Copyright (c) 2002-2009 Michael Schloh von Bennewitz <michael@schloh.com>
6 // Copyright (c) 2002-2009 Cable & Wireless Telecommunications Services GmbH
7 //
8 // This file is part of OSSP asgui, an accounting system graphical user
9 // interface which can be found at http://asgui.europalab.com/.
10 //
11 // Permission to use, copy, modify, and distribute this software for
12 // any purpose with or without fee is hereby granted, provided that
13 // the above copyright notice and this permission notice appear in all
14 // copies.
15 //
16 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
17 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 // IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
20 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 // USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 // OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 // SUCH DAMAGE.
28 //
29 // as_panel.h: ISO C++ interface
30 //
32 #define QT3_SUPPORT
34 #ifndef PREFPANEL_H
35 #define PREFPANEL_H
37 #include <qvariant.h>
38 #include <qdialog.h>
39 #include <q3buttongroup.h>
40 #include <qlabel.h>
41 #include <qlineedit.h>
42 #include <qpushbutton.h>
43 #include <qtoolbutton.h>
44 #include <qcolordialog.h>
45 #include <qradiobutton.h>
46 #include <qcheckbox.h>
47 #include <qtabwidget.h>
48 #include <qwidget.h>
49 #include <qlayout.h>
50 #include <qtooltip.h>
51 #include <q3whatsthis.h>
52 #include <qstylefactory.h>
53 #include <qlayout.h>
55 //Added by qt3to4:
56 #include <Q3HBoxLayout>
57 #include <Q3GridLayout>
58 #include <Q3VBoxLayout>
60 #include "as_gui.h" // For usage of style_t
63 class Prefpanel : public QDialog
64 {
65 Q_OBJECT
67 public:
68 Prefpanel(QWidget *pParent = 0, const char *kszName = 0, bool bModal = true, Qt::WFlags Flags = 0);
69 // ~Prefpanel(void); // No need to destroy widgets, because qt does it for us
71 private:
72 Preferences *m_pPanprefs;
73 QColor *m_pLight, *m_pDark;
74 QColorGroup *m_pOrigcolours, *m_pAltcolours;
76 public:
77 Q3GroupBox *m_pGenbox, *m_pRembox, *m_pShadebox, *m_pThemebox;
78 Q3VBoxLayout *m_pStylelay, *m_pReportlay, *m_pSwitchlay;
79 Q3VBoxLayout *m_pVlayout, *m_pBinlayout;
80 Q3HBoxLayout *m_pBoolayout, *m_pGenlayout, *m_pRemlayout;
81 Q3VBoxLayout *m_pShadeboxlay, *m_pThemeboxlay;
82 Q3HBoxLayout *m_pGenboxlay, *m_pRemboxlay, *m_pColourlayout;
83 Q3GridLayout *m_pGeninner, *m_pReminner, *m_pShadelayout;
85 QWidget *m_pBoolpage, *m_pGeneralpage, *m_pRemotepage, *m_pColourpage;
87 Q3HBoxLayout *m_pButtlay;
88 QPushButton *m_pOkaybutton;
89 QPushButton *m_pApplybutton;
90 QPushButton *m_pCancelbutton;
91 QTabWidget *m_pTabselect;
93 QLabel *m_pAcctlabel, *m_pEventlabel;
94 QLabel *m_pUserlabel, *m_pHomelabel;
95 QLabel *m_pCorbalabel, *m_pSoaplabel;
96 QLineEdit *m_pAcctline, *m_pEventline;
97 QLineEdit *m_pUserline, *m_pHomeline;
98 QLineEdit *m_pCorbaline, *m_pSoapline;
99 QCheckBox *m_pCorbacheck, *m_pSoapcheck;
101 QLabel *m_pLightlab, *m_pDarklab, *m_pRevertlab;
102 QToolButton *m_pLightbutt, *m_pDarkbutt, *m_pRevertbutt;
104 Q3ButtonGroup *m_pStylegroup, *m_pReportgroup, *m_pSwitchgroup;
105 QCheckBox *m_pBackupcheck, *m_pExtendcheck;
106 QCheckBox *m_pDetailcheck, *m_pSigncheck;
108 public:
109 // Accessor get methods
110 QString getStyle(void) {return (m_pStylegroup->selected()->text());};
111 QString getAccounts(void) {return (m_pAcctline->text());};
112 QString getEvents(void) {return (m_pEventline->text());};
113 QString getUser(void) {return (m_pUserline->text());};
114 QString getHome(void) {return (m_pHomeline->text());};
115 QString getCorbahost(void) {return (m_pCorbaline->text());};
116 QString getSoaphost(void) {return (m_pSoapline->text());};
117 bool getCorbaon(void) {return (m_pCorbacheck->isChecked());};
118 bool getSoapon(void) {return (m_pSoapcheck->isChecked());};
119 bool getBackon(void) {return (m_pBackupcheck->isChecked());};
120 bool getExtendon(void) {return (m_pExtendcheck->isChecked());};
121 bool getDetailon(void) {return (m_pDetailcheck->isChecked());};
122 bool getSignaton(void) {return (m_pSigncheck->isChecked());};
123 QColor *getLight(void) {return m_pLight;};
124 QColor *getDark(void) {return m_pDark;};
125 QColor *getRevlight(void) {return (QColor *)&m_pOrigcolours->foreground();};
126 QColor *getRevdark(void) {return (QColor *)&m_pOrigcolours->background();};
127 QColor *getAltlight(void) {return (QColor *)&m_pAltcolours->foreground();};
128 QColor *getAltdark(void) {return (QColor *)&m_pAltcolours->background();};
130 // Accessor set methods
131 void setAccounts(const QString &kInstr) {m_pAcctline->setText(kInstr);};
132 void setEvents(const QString &kInstr) {m_pEventline->setText(kInstr);};
133 void setUser(const QString &kInstr) {m_pUserline->setText(kInstr);};
134 void setHome(const QString &kInstr) {m_pHomeline->setText(kInstr);};
135 void setCorbahost(const QString &kInstr) {m_pCorbaline->setText(kInstr);};
136 void setSoaphost(const QString &kInstr) {m_pSoapline->setText(kInstr);};
137 void setBackon(const bool &kbEnable = true) {m_pBackupcheck->setChecked(kbEnable);};
138 void setExtendon(const bool &kbEnable = true) {m_pExtendcheck->setChecked(kbEnable);};
139 void setDetailon(const bool &kbEnable = true) {m_pDetailcheck->setChecked(kbEnable);};
140 void setSignaton(const bool &kbEnable = true) {m_pSigncheck->setChecked(kbEnable);};
141 void lockCorba(const bool &kbLock = true) {m_pCorbacheck->setEnabled(!kbLock);};
142 void lockSoap(const bool &kbLock = true) {m_pSoapcheck->setEnabled(!kbLock);};
143 void setLight(const QColor *pLight) {m_pLight = (QColor *)pLight;};
144 void setDark(const QColor *pDark) {m_pDark = (QColor *)pDark;};
145 void setOrigcolour(QColorGroup *pGroup) {m_pOrigcolours = pGroup;};
146 void setAltcolour(QColorGroup *pGroup) {m_pAltcolours = pGroup;};
147 void setCorbaon(const bool &kbEnable = true) {
148 m_pCorbaline->setEnabled(kbEnable);
149 m_pCorbacheck->setChecked(kbEnable);
150 };
151 void setSoapon(const bool &kbEnable = true) {
152 m_pSoapline->setEnabled(kbEnable);
153 m_pSoapcheck->setChecked(kbEnable);
154 };
155 void setStyle(const char *pkszStyle) {
156 for (int nIter = 0; nIter < m_pStylegroup->count(); nIter++)
157 if (m_pStylegroup->find(nIter)->text() == pkszStyle)
158 m_pStylegroup->setButton(nIter);
159 };
161 protected slots:
162 virtual void polish(void);
163 virtual void textChange(void);
164 virtual void shadeLight(void);
165 virtual void shadeDark(void);
166 virtual void shadeRevert(void);
167 void enableCorba(bool bOn) {m_pCorbaline->setEnabled(bOn);};
168 void enableSoap(bool bOn) {m_pSoapline->setEnabled(bOn);};
170 signals:
171 void applied(void);
172 };
174 #endif // PREFPANEL_H