[2] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
[846] | 3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
[561] | 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
[2] | 6 | **
|
---|
| 7 | ** This file is part of the examples of the Qt Toolkit.
|
---|
| 8 | **
|
---|
[846] | 9 | ** $QT_BEGIN_LICENSE:BSD$
|
---|
| 10 | ** You may use this file under the terms of the BSD license as follows:
|
---|
[2] | 11 | **
|
---|
[846] | 12 | ** "Redistribution and use in source and binary forms, with or without
|
---|
| 13 | ** modification, are permitted provided that the following conditions are
|
---|
| 14 | ** met:
|
---|
| 15 | ** * Redistributions of source code must retain the above copyright
|
---|
| 16 | ** notice, this list of conditions and the following disclaimer.
|
---|
| 17 | ** * Redistributions in binary form must reproduce the above copyright
|
---|
| 18 | ** notice, this list of conditions and the following disclaimer in
|
---|
| 19 | ** the documentation and/or other materials provided with the
|
---|
| 20 | ** distribution.
|
---|
| 21 | ** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
|
---|
| 22 | ** the names of its contributors may be used to endorse or promote
|
---|
| 23 | ** products derived from this software without specific prior written
|
---|
| 24 | ** permission.
|
---|
[2] | 25 | **
|
---|
[846] | 26 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
---|
| 27 | ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
---|
| 28 | ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
---|
| 29 | ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
---|
| 30 | ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
---|
| 31 | ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
---|
| 32 | ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 33 | ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 34 | ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 35 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
---|
| 36 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
---|
[2] | 37 | ** $QT_END_LICENSE$
|
---|
| 38 | **
|
---|
| 39 | ****************************************************************************/
|
---|
| 40 |
|
---|
| 41 | #ifndef WINDOW_H
|
---|
| 42 | #define WINDOW_H
|
---|
| 43 |
|
---|
| 44 | #include <QSystemTrayIcon>
|
---|
| 45 | #include <QDialog>
|
---|
| 46 |
|
---|
| 47 | QT_BEGIN_NAMESPACE
|
---|
| 48 | class QAction;
|
---|
| 49 | class QCheckBox;
|
---|
| 50 | class QComboBox;
|
---|
| 51 | class QGroupBox;
|
---|
| 52 | class QLabel;
|
---|
| 53 | class QLineEdit;
|
---|
| 54 | class QMenu;
|
---|
| 55 | class QPushButton;
|
---|
| 56 | class QSpinBox;
|
---|
| 57 | class QTextEdit;
|
---|
| 58 | QT_END_NAMESPACE
|
---|
| 59 |
|
---|
| 60 | //! [0]
|
---|
| 61 | class Window : public QDialog
|
---|
| 62 | {
|
---|
| 63 | Q_OBJECT
|
---|
| 64 |
|
---|
| 65 | public:
|
---|
| 66 | Window();
|
---|
| 67 |
|
---|
| 68 | void setVisible(bool visible);
|
---|
| 69 |
|
---|
| 70 | protected:
|
---|
| 71 | void closeEvent(QCloseEvent *event);
|
---|
| 72 |
|
---|
| 73 | private slots:
|
---|
| 74 | void setIcon(int index);
|
---|
| 75 | void iconActivated(QSystemTrayIcon::ActivationReason reason);
|
---|
| 76 | void showMessage();
|
---|
| 77 | void messageClicked();
|
---|
| 78 |
|
---|
| 79 | private:
|
---|
| 80 | void createIconGroupBox();
|
---|
| 81 | void createMessageGroupBox();
|
---|
| 82 | void createActions();
|
---|
| 83 | void createTrayIcon();
|
---|
| 84 |
|
---|
| 85 | QGroupBox *iconGroupBox;
|
---|
| 86 | QLabel *iconLabel;
|
---|
| 87 | QComboBox *iconComboBox;
|
---|
| 88 | QCheckBox *showIconCheckBox;
|
---|
| 89 |
|
---|
| 90 | QGroupBox *messageGroupBox;
|
---|
| 91 | QLabel *typeLabel;
|
---|
| 92 | QLabel *durationLabel;
|
---|
| 93 | QLabel *durationWarningLabel;
|
---|
| 94 | QLabel *titleLabel;
|
---|
| 95 | QLabel *bodyLabel;
|
---|
| 96 | QComboBox *typeComboBox;
|
---|
| 97 | QSpinBox *durationSpinBox;
|
---|
| 98 | QLineEdit *titleEdit;
|
---|
| 99 | QTextEdit *bodyEdit;
|
---|
| 100 | QPushButton *showMessageButton;
|
---|
| 101 |
|
---|
| 102 | QAction *minimizeAction;
|
---|
| 103 | QAction *maximizeAction;
|
---|
| 104 | QAction *restoreAction;
|
---|
| 105 | QAction *quitAction;
|
---|
| 106 |
|
---|
| 107 | QSystemTrayIcon *trayIcon;
|
---|
| 108 | QMenu *trayIconMenu;
|
---|
| 109 | };
|
---|
| 110 | //! [0]
|
---|
| 111 |
|
---|
| 112 | #endif
|
---|