as_reportpanel.h

changeset 1
d64aaa7d146f
child 3
c1941114ca88
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/as_reportpanel.h	Fri Nov 28 11:21:08 2008 +0100
     1.3 @@ -0,0 +1,113 @@
     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_reportpanel.h: ISO C++ interface
    1.33 +//
    1.34 +
    1.35 +#ifndef REPORTPANEL_H
    1.36 +#define REPORTPANEL_H
    1.37 +
    1.38 +#include <qvariant.h>
    1.39 +#include <qdialog.h>
    1.40 +#include <qdatetime.h>
    1.41 +
    1.42 +
    1.43 +class TiTable;
    1.44 +class Preferences;
    1.45 +class QVBoxLayout;
    1.46 +class QHBoxLayout;
    1.47 +class QGridLayout;
    1.48 +class QPushButton;
    1.49 +class QTextEdit;
    1.50 +class QToolButton;
    1.51 +class QButtonGroup;
    1.52 +class QPopupMenu;
    1.53 +class QPrinter;
    1.54 +
    1.55 +namespace AS {
    1.56 +
    1.57 +class Reportpanel : public QDialog
    1.58 +{
    1.59 +    Q_OBJECT
    1.60 +
    1.61 +public:
    1.62 +    Reportpanel(TiTable *, Preferences *, QWidget *pParent = 0,
    1.63 +                const char *kszName = 0, bool bModal = true, WFlags Flags = 0);
    1.64 +//    ~Reportpanel(void); // No need to destroy widgets, because qt does it for us
    1.65 +
    1.66 +public:
    1.67 +    QButtonGroup *m_pWeekmonthgroup;
    1.68 +    QToolButton  *m_pWeeklybutt;
    1.69 +    QToolButton  *m_pMonthlybutt;
    1.70 +    QTextEdit    *m_pBrowser;
    1.71 +    QPushButton  *m_pSavebutt;
    1.72 +    QPushButton  *m_pDismissbutt;
    1.73 +    QPushButton  *m_pPrintbutt;
    1.74 +
    1.75 +protected:
    1.76 +    QVBoxLayout *m_pFormlay;
    1.77 +    QVBoxLayout *m_pGrouplay;
    1.78 +    QHBoxLayout *m_pToolay;
    1.79 +    QHBoxLayout *m_pPushlay;
    1.80 +    QHBoxLayout *m_pWeekmonthlay;
    1.81 +    QPopupMenu  *m_pWeekpop;
    1.82 +    QPopupMenu  *m_pMonthpop;
    1.83 +
    1.84 +private:
    1.85 +    int          m_nWeeks;
    1.86 +    int          m_nMonths;
    1.87 +    TiTable     *m_pReptable;
    1.88 +    Preferences *m_pReprefs;
    1.89 +#ifndef QT_NO_PRINTER
    1.90 +    QPrinter    *m_pPrinter;
    1.91 +#endif
    1.92 +
    1.93 +public slots:
    1.94 +    int exec(void);
    1.95 +
    1.96 +protected slots:
    1.97 +    virtual void saveReport(void);
    1.98 +    virtual void printReport(void);
    1.99 +    virtual void textChange(void);
   1.100 +    virtual void reportWeeks(int nMenuid = -1);
   1.101 +    virtual void reportMonths(int nMenuid = -1);
   1.102 +
   1.103 +private:
   1.104 +    void writeHeader(int);
   1.105 +    void writeHeader(int, int);
   1.106 +    void writeHeader(QString);
   1.107 +    void writeHeader(QString, QString);
   1.108 +    void writeFooter(void);
   1.109 +    QString getWeektotals(QDate Refer = QDate::currentDate(), int nWeeks = 1);
   1.110 +    QString getWeekdetails(QDate Refer = QDate::currentDate(), int nWeeks = 1);
   1.111 +    QString getMonthtotals(QDate Refer = QDate::currentDate(), int nMonths = 1);
   1.112 +    QString getMonthdetails(QDate Refer = QDate::currentDate(), int nMonths = 1);
   1.113 +};
   1.114 +} // namespace AS
   1.115 +
   1.116 +#endif // REPORTPANEL_H

mercurial