as_panel.h

Wed, 07 Jan 2009 18:49:25 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 07 Jan 2009 18:49:25 +0100
changeset 12
ceb4ba3d2d00
parent 3
c1941114ca88
child 15
0e0eb7c91312
permissions
-rw-r--r--

Bump copyright year number.

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

mercurial