All Classes Namespaces Functions Variables Enumerations Properties Pages
actioncommands.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2012-2020 Matthew Chiawen Chang
5 
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; version 2 of the License.
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 */
16 
17 #ifndef COMMANDCENTER_H
18 #define COMMANDCENTER_H
19 
20 #include <QObject>
21 #include "pencilerror.h"
22 #include "filetype.h"
23 
24 class Editor;
25 class QWidget;
26 class ExportMovieDialog;
27 
28 
29 class ActionCommands : public QObject
30 {
31  Q_OBJECT
32 
33 public:
34  explicit ActionCommands(QWidget* parent);
35  virtual ~ActionCommands();
36 
37  void setCore(Editor* e) { mEditor = e; }
38 
39  // file
40  Status importMovieVideo();
41  Status importSound(FileType type);
42  Status exportMovie(bool isGif = false);
43  Status exportImageSequence();
44  Status exportImage();
45  Status exportGif();
46 
47  // edit
48  void flipSelectionX();
49  void flipSelectionY();
50  void selectAll();
51  void deselectAll();
52 
53  // view
54  void ZoomIn();
55  void ZoomOut();
56  void rotateClockwise();
57  void rotateCounterClockwise();
58 
59  // Animation
60  void PlayStop();
61  void GotoNextFrame();
62  void GotoPrevFrame();
63  void GotoNextKeyFrame();
64  void GotoPrevKeyFrame();
65  Status addNewKey();
66 
69  void removeKey();
70  void duplicateLayer();
71  void duplicateKey();
72  void moveFrameForward();
73  void moveFrameBackward();
74  void removeSelectedFrames();
75  void reverseSelectedFrames();
76  void addExposureToSelectedFrames();
77  void subtractExposureFromSelectedFrames();
78 
79  // Layer
80  Status addNewBitmapLayer();
81  Status addNewVectorLayer();
82  Status addNewCameraLayer();
83  Status addNewSoundLayer();
84  Status deleteCurrentLayer();
85  void changeKeyframeLineColor();
86  void changeallKeyframeLineColor();
87 
88  void setLayerVisibilityIndex(int index);
89 
90  // Help
91  void help();
92  void quickGuide();
93  void website();
94  void forum();
95  void discord();
96  void reportbug();
97  void checkForUpdates();
98  void openTemporaryDirectory();
99  void about();
100 
101 private:
102  void showSoundClipWarningIfNeeded();
103 
104  void exposeSelectedFrames(int offset);
105 
106  Status convertSoundToWav(const QString& filePath);
107 
108  Editor* mEditor = nullptr;
109  QWidget* mParent = nullptr;
110 
111  bool mSuppressSoundWarning = false;
112 };
113 
114 #endif // COMMANDCENTER_H
Q_OBJECTQ_OBJECT
Status insertKeyFrameAtCurrentPosition()
Will insert a keyframe at the current position and push connected frames to the right.
Definition: editor.h:55
QObject * parent() const const