| /* PC GO Screen Shooter |
| Copyright 2007-2014 PC GO Ld. |
| |
| Original are from Qt Demos |
| |
| This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
| This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
| */ |
| |
| #ifndef _SCREENSHOT_H |
| #define _SCREENSHOT_H |
| |
| #include <QtGui/QPixmap> |
| #include <QtGui/QWidget> |
| |
| QT_BEGIN_NAMESPACE |
| class QCheckBox; |
| class QGridLayout; |
| class QGroupBox; |
| class QFrame; |
| class QHBoxLayout; |
| class QLabel; |
| class QLineEdit; |
| class QPoint; |
| class QPushButton; |
| class QSettings; |
| class QSpacerItem; |
| class QSpinBox; |
| class QVBoxLayout; |
| QT_END_NAMESPACE |
| |
| //! [0] |
| class ScreenShot : public QWidget { |
| Q_OBJECT |
| |
| public: |
| ScreenShot(); |
| QPoint center(); |
| QSpinBox *delaySpinBox; |
| |
| public slots: |
| void NewScreenShot(); |
| |
| protected: |
| void resizeEvent(QResizeEvent *event); |
| |
| private slots: |
| void SaveScreenShot(); |
| void ShootScreen(); |
| void UpdateCheckBox_HideWindow(); |
| void UpdateFilenameEdit(bool); |
| |
| private: |
| void InitOptions(); |
| void CreateButtonsLayout(); |
| QPushButton *CreateButton(const QString &text, QWidget *receiver, const char *member); |
| void UpdateScreenShotLabel(); |
| QString GetSaveFileNameByTime(); |
| QString config_dir(); |
| |
| QSettings *config; |
| |
| QPixmap originalPixmap; |
| |
| QLabel *screenshotLabel; |
| QGroupBox *optionsGroupBox; |
| QLabel *filename_label; |
| QLineEdit *filename_edit_box; |
| QCheckBox *name_as_time; |
| QLabel *path_label; |
| QLineEdit *path_edit_box; |
| QFrame *line1; |
| QFrame *line2; |
| QLabel *delaySpinBoxLabel; |
| QSpacerItem *spacer1; |
| QCheckBox *hideThisWindowCheckBox; |
| QSpacerItem *spacer2; |
| QPushButton *newScreenshotButton; |
| QPushButton *saveScreenshotButton; |
| QPushButton *quitScreenshotButton; |
| |
| QVBoxLayout *mainLayout; |
| QGridLayout *optionsGroupBoxLayout; |
| QVBoxLayout *LabelsLayout; |
| QHBoxLayout *FilenameLayout; |
| QHBoxLayout *PathLayout; |
| QHBoxLayout *buttonsLayout; |
| }; |
| //! [0] |
| |
| #endif |