Open Source Snapmatic picture and Savegame viewer/editor for GTA V https://gta5view.syping.de/

SnapmaticWidget.h 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*****************************************************************************
  2. * gta5view Grand Theft Auto V Profile Viewer
  3. * Copyright (C) 2016-2017 Syping
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. *****************************************************************************/
  18. #ifndef SNAPMATICWIDGET_H
  19. #define SNAPMATICWIDGET_H
  20. #include "SnapmaticPicture.h"
  21. #include "ProfileDatabase.h"
  22. #include "DatabaseThread.h"
  23. #include "ProfileWidget.h"
  24. #include "CrewDatabase.h"
  25. #include <QContextMenuEvent>
  26. #include <QMouseEvent>
  27. #include <QWidget>
  28. #include <QColor>
  29. namespace Ui {
  30. class SnapmaticWidget;
  31. }
  32. class SnapmaticWidget : public ProfileWidget
  33. {
  34. Q_OBJECT
  35. public:
  36. SnapmaticWidget(ProfileDatabase *profileDB, CrewDatabase *crewDB, DatabaseThread *threadDB, QString profileName, QWidget *parent = 0);
  37. void setSnapmaticPicture(SnapmaticPicture *picture);
  38. void setSelectionMode(bool selectionMode);
  39. void setSelected(bool isSelected);
  40. bool deletePicture();
  41. bool makePictureVisible();
  42. bool makePictureHidden();
  43. SnapmaticPicture *getPicture();
  44. QString getPicturePath();
  45. QString getWidgetType();
  46. bool isSelected();
  47. bool isHidden();
  48. void retranslate();
  49. ~SnapmaticWidget();
  50. private slots:
  51. void on_cmdView_clicked();
  52. void on_cmdCopy_clicked();
  53. void on_cmdExport_clicked();
  54. void on_cmdDelete_clicked();
  55. void on_cbSelected_stateChanged(int arg1);
  56. void adjustTextColor();
  57. void pictureSelected();
  58. void selectAllWidgets();
  59. void deselectAllWidgets();
  60. void dialogNextPictureRequested();
  61. void dialogPreviousPictureRequested();
  62. void makePictureVisibleSlot();
  63. void makePictureHiddenSlot();
  64. void editSnapmaticProperties();
  65. void editSnapmaticRawJson();
  66. void editSnapmaticImage();
  67. void openMapViewer();
  68. void snapmaticUpdated();
  69. void customSignal(QString signal);
  70. protected:
  71. void mouseDoubleClickEvent(QMouseEvent *ev);
  72. void mouseReleaseEvent(QMouseEvent *ev);
  73. void mousePressEvent(QMouseEvent *ev);
  74. void contextMenuEvent(QContextMenuEvent *ev);
  75. private:
  76. ProfileDatabase *profileDB;
  77. CrewDatabase *crewDB;
  78. DatabaseThread *threadDB;
  79. QString profileName;
  80. Ui::SnapmaticWidget *ui;
  81. SnapmaticPicture *smpic;
  82. QColor highlightHiddenColor;
  83. signals:
  84. void pictureDeleted();
  85. void widgetSelected();
  86. void widgetDeselected();
  87. void allWidgetsSelected();
  88. void allWidgetsDeselected();
  89. void nextPictureRequested(QWidget *dialog);
  90. void previousPictureRequested(QWidget *dialog);
  91. void contextMenuTriggered(QContextMenuEvent *ev);
  92. };
  93. #endif // SNAPMATICWIDGET_H