1 /*
2     Copyright © 2018-2019 by The qTox Project Contributors
3 
4     This file is part of qTox, a Qt-based graphical interface for Tox.
5 
6     qTox is libre software: you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation, either version 3 of the License, or
9     (at your option) any later version.
10 
11     qTox is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with qTox.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef TOX_FILE_PAUSE_H
21 #define TOX_FILE_PAUSE_H
22 
23 class ToxFilePause
24 {
25 public:
localPause()26     void localPause()
27     {
28         localPauseState = true;
29     }
30 
localResume()31     void localResume()
32     {
33         localPauseState = false;
34     }
35 
localPauseToggle()36     void localPauseToggle()
37     {
38         localPauseState = !localPauseState;
39     }
40 
remotePause()41     void remotePause()
42     {
43         remotePauseState = true;
44     }
45 
remoteResume()46     void remoteResume()
47     {
48         remotePauseState = false;
49     }
50 
remotePauseToggle()51     void remotePauseToggle()
52     {
53         remotePauseState = !remotePauseState;
54     }
55 
localPaused()56     bool localPaused() const
57     {
58         return localPauseState;
59     }
60 
remotePaused()61     bool remotePaused() const
62     {
63         return remotePauseState;
64     }
65 
paused()66     bool paused() const
67     {
68         return localPauseState || remotePauseState;
69     }
70 
71 private:
72     bool localPauseState = false;
73     bool remotePauseState = false;
74 };
75 
76 #endif // TOX_FILE_PAUSE_H
77