1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/as_panel.h Fri Nov 28 11:21:08 2008 +0100 1.3 @@ -0,0 +1,167 @@ 1.4 +// 1.5 +// OSSP asgui - Accounting system graphical user interface 1.6 +// Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) 1.7 +// Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com> 1.8 +// Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com> 1.9 +// Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH 1.10 +// 1.11 +// This file is part of OSSP asgui, an accounting system graphical user 1.12 +// interface which can be found at http://www.ossp.org/pkg/tool/asgui/. 1.13 +// 1.14 +// Permission to use, copy, modify, and distribute this software for 1.15 +// any purpose with or without fee is hereby granted, provided that 1.16 +// the above copyright notice and this permission notice appear in all 1.17 +// copies. 1.18 +// 1.19 +// THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 1.20 +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.21 +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1.22 +// IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 1.23 +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.24 +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 1.25 +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 1.26 +// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 1.27 +// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1.28 +// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 1.29 +// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 1.30 +// SUCH DAMAGE. 1.31 +// 1.32 +// as_panel.h: ISO C++ interface 1.33 +// 1.34 + 1.35 +#ifndef PREFPANEL_H 1.36 +#define PREFPANEL_H 1.37 + 1.38 +#include <qvariant.h> 1.39 +#include <qdialog.h> 1.40 +#include <qbuttongroup.h> 1.41 +#include <qlabel.h> 1.42 +#include <qlineedit.h> 1.43 +#include <qpushbutton.h> 1.44 +#include <qtoolbutton.h> 1.45 +#include <qcolordialog.h> 1.46 +#include <qradiobutton.h> 1.47 +#include <qcheckbox.h> 1.48 +#include <qtabwidget.h> 1.49 +#include <qwidget.h> 1.50 +#include <qlayout.h> 1.51 +#include <qtooltip.h> 1.52 +#include <qwhatsthis.h> 1.53 +#include <qstylefactory.h> 1.54 +#include <qlayout.h> 1.55 + 1.56 +#include "as_gui.h" // For usage of style_t 1.57 + 1.58 + 1.59 +class Prefpanel : public QDialog 1.60 +{ 1.61 + Q_OBJECT 1.62 + 1.63 +public: 1.64 + Prefpanel(QWidget *pParent = 0, const char *kszName = 0, bool bModal = true, WFlags Flags = 0); 1.65 +// ~Prefpanel(void); // No need to destroy widgets, because qt does it for us 1.66 + 1.67 +private: 1.68 + Preferences *m_pPanprefs; 1.69 + QColor *m_pLight, *m_pDark; 1.70 + QColorGroup *m_pOrigcolours, *m_pAltcolours; 1.71 + 1.72 +public: 1.73 + QGroupBox *m_pGenbox, *m_pRembox, *m_pShadebox, *m_pThemebox; 1.74 + QVBoxLayout *m_pStylelay, *m_pReportlay, *m_pSwitchlay; 1.75 + QVBoxLayout *m_pVlayout, *m_pBinlayout; 1.76 + QHBoxLayout *m_pBoolayout, *m_pGenlayout, *m_pRemlayout; 1.77 + QVBoxLayout *m_pShadeboxlay, *m_pThemeboxlay; 1.78 + QHBoxLayout *m_pGenboxlay, *m_pRemboxlay, *m_pColourlayout; 1.79 + QGridLayout *m_pGeninner, *m_pReminner, *m_pShadelayout; 1.80 + 1.81 + QWidget *m_pBoolpage, *m_pGeneralpage, *m_pRemotepage, *m_pColourpage; 1.82 + 1.83 + QHBoxLayout *m_pButtlay; 1.84 + QPushButton *m_pOkaybutton; 1.85 + QPushButton *m_pApplybutton; 1.86 + QPushButton *m_pCancelbutton; 1.87 + QTabWidget *m_pTabselect; 1.88 + 1.89 + QLabel *m_pAcctlabel, *m_pEventlabel; 1.90 + QLabel *m_pUserlabel, *m_pHomelabel; 1.91 + QLabel *m_pCorbalabel, *m_pSoaplabel; 1.92 + QLineEdit *m_pAcctline, *m_pEventline; 1.93 + QLineEdit *m_pUserline, *m_pHomeline; 1.94 + QLineEdit *m_pCorbaline, *m_pSoapline; 1.95 + QCheckBox *m_pCorbacheck, *m_pSoapcheck; 1.96 + 1.97 + QLabel *m_pLightlab, *m_pDarklab, *m_pRevertlab; 1.98 + QToolButton *m_pLightbutt, *m_pDarkbutt, *m_pRevertbutt; 1.99 + 1.100 + QButtonGroup *m_pStylegroup, *m_pReportgroup, *m_pSwitchgroup; 1.101 + QCheckBox *m_pBackupcheck, *m_pExtendcheck; 1.102 + QCheckBox *m_pDetailcheck, *m_pSigncheck; 1.103 + 1.104 +public: 1.105 + // Accessor get methods 1.106 + QString getStyle(void) {return (m_pStylegroup->selected()->text());}; 1.107 + QString getAccounts(void) {return (m_pAcctline->text());}; 1.108 + QString getEvents(void) {return (m_pEventline->text());}; 1.109 + QString getUser(void) {return (m_pUserline->text());}; 1.110 + QString getHome(void) {return (m_pHomeline->text());}; 1.111 + QString getCorbahost(void) {return (m_pCorbaline->text());}; 1.112 + QString getSoaphost(void) {return (m_pSoapline->text());}; 1.113 + bool getCorbaon(void) {return (m_pCorbacheck->isChecked());}; 1.114 + bool getSoapon(void) {return (m_pSoapcheck->isChecked());}; 1.115 + bool getBackon(void) {return (m_pBackupcheck->isChecked());}; 1.116 + bool getExtendon(void) {return (m_pExtendcheck->isChecked());}; 1.117 + bool getDetailon(void) {return (m_pDetailcheck->isChecked());}; 1.118 + bool getSignaton(void) {return (m_pSigncheck->isChecked());}; 1.119 + QColor *getLight(void) {return m_pLight;}; 1.120 + QColor *getDark(void) {return m_pDark;}; 1.121 + QColor *getRevlight(void) {return (QColor *)&m_pOrigcolours->foreground();}; 1.122 + QColor *getRevdark(void) {return (QColor *)&m_pOrigcolours->background();}; 1.123 + QColor *getAltlight(void) {return (QColor *)&m_pAltcolours->foreground();}; 1.124 + QColor *getAltdark(void) {return (QColor *)&m_pAltcolours->background();}; 1.125 + 1.126 + // Accessor set methods 1.127 + void setAccounts(const QString &kInstr) {m_pAcctline->setText(kInstr);}; 1.128 + void setEvents(const QString &kInstr) {m_pEventline->setText(kInstr);}; 1.129 + void setUser(const QString &kInstr) {m_pUserline->setText(kInstr);}; 1.130 + void setHome(const QString &kInstr) {m_pHomeline->setText(kInstr);}; 1.131 + void setCorbahost(const QString &kInstr) {m_pCorbaline->setText(kInstr);}; 1.132 + void setSoaphost(const QString &kInstr) {m_pSoapline->setText(kInstr);}; 1.133 + void setBackon(const bool &kbEnable = true) {m_pBackupcheck->setChecked(kbEnable);}; 1.134 + void setExtendon(const bool &kbEnable = true) {m_pExtendcheck->setChecked(kbEnable);}; 1.135 + void setDetailon(const bool &kbEnable = true) {m_pDetailcheck->setChecked(kbEnable);}; 1.136 + void setSignaton(const bool &kbEnable = true) {m_pSigncheck->setChecked(kbEnable);}; 1.137 + void lockCorba(const bool &kbLock = true) {m_pCorbacheck->setEnabled(!kbLock);}; 1.138 + void lockSoap(const bool &kbLock = true) {m_pSoapcheck->setEnabled(!kbLock);}; 1.139 + void setLight(const QColor *pLight) {m_pLight = (QColor *)pLight;}; 1.140 + void setDark(const QColor *pDark) {m_pDark = (QColor *)pDark;}; 1.141 + void setOrigcolour(QColorGroup *pGroup) {m_pOrigcolours = pGroup;}; 1.142 + void setAltcolour(QColorGroup *pGroup) {m_pAltcolours = pGroup;}; 1.143 + void setCorbaon(const bool &kbEnable = true) { 1.144 + m_pCorbaline->setEnabled(kbEnable); 1.145 + m_pCorbacheck->setChecked(kbEnable); 1.146 + }; 1.147 + void setSoapon(const bool &kbEnable = true) { 1.148 + m_pSoapline->setEnabled(kbEnable); 1.149 + m_pSoapcheck->setChecked(kbEnable); 1.150 + }; 1.151 + void setStyle(const char *pkszStyle) { 1.152 + for (int nIter = 0; nIter < m_pStylegroup->count(); nIter++) 1.153 + if (m_pStylegroup->find(nIter)->text() == pkszStyle) 1.154 + m_pStylegroup->setButton(nIter); 1.155 + }; 1.156 + 1.157 +protected slots: 1.158 + virtual void polish(void); 1.159 + virtual void textChange(void); 1.160 + virtual void shadeLight(void); 1.161 + virtual void shadeDark(void); 1.162 + virtual void shadeRevert(void); 1.163 + void enableCorba(bool bOn) {m_pCorbaline->setEnabled(bOn);}; 1.164 + void enableSoap(bool bOn) {m_pSoapline->setEnabled(bOn);}; 1.165 + 1.166 +signals: 1.167 + void applied(void); 1.168 +}; 1.169 + 1.170 +#endif // PREFPANEL_H