]> git.vomp.tv Git - vompclient.git/blob - message.h
Rename Command class to Control
[vompclient.git] / message.h
1 /*
2     Copyright 2004-2020 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free 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 2 of the License, or
9     (at your option) any later version.
10
11     VOMP 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 VOMP.  If not, see <https://www.gnu.org/licenses/>.
18 */
19
20 #ifndef MESSAGE_H
21 #define MESSAGE_H
22
23 #include <stdio.h>
24
25 //class Message;
26 #include "defines.h"
27
28 // Usage of messages is more dubious now that the single master mutex lock
29 // protects all gui actions. Reason(s) for usage:
30 // 1. View A wants something to be done by View B *after* View A has been deleted
31 // 2. A thread wants its object/view deleting *after* the thread has exited
32
33 // Put a justification line after call to Message* m = new  Message() line
34 // So that the sources can be grepped for proper message usage
35
36 class Message
37 {
38   public:
39
40     enum PreDefinedTarget
41     {
42       NA = 0,
43       CONTROL,
44       BOXSTACK,
45       MOUSE_RECEIVER
46     };
47
48     Message();
49
50     void* from{};
51     PreDefinedTarget p_to{NA}; // If this is set 'to' is ignored
52     void* to{};
53     ULONG message{};
54     ULONG parameter{};
55     ULONG tag{};     // use this for identifying which object / question is being replied to
56     void* data{};    // Use this for anything. Int, pointer, pointer to memory to be freed by the recipient, etc.
57
58     const static ULONG QUESTION_YES = 1;
59     const static ULONG CLOSE_ME = 2;
60     const static ULONG PLAY_SELECTED_RECORDING = 3;
61     const static ULONG DELETE_SELECTED_RECORDING = 4;
62     const static ULONG SCREENSHOT = 5;
63     const static ULONG CHANNEL_CHANGE = 6;
64     const static ULONG RESUME_SELECTED_RECORDING = 7;
65     const static ULONG INPUT_EVENT = 8;
66     const static ULONG STOP_PLAYBACK = 9;
67     const static ULONG SERVER_SELECTED = 10;
68     const static ULONG VDR_CONNECTED = 11;
69     const static ULONG ADD_VIEW = 12;
70     const static ULONG REDRAW_LANG = 14;
71     const static ULONG EPG = 16;
72     const static ULONG CHANGED_OPTIONS = 18;
73     const static ULONG CONNECTION_LOST = 19;
74     const static ULONG MOVE_RECORDING = 20;
75     const static ULONG PLAYER_EVENT = 22;
76     const static ULONG AUDIO_CHANGE_CHANNEL = 23;
77     const static ULONG CHILD_CLOSE = 24;
78     const static ULONG MOUSE_MOVE = 25;
79     const static ULONG MOUSE_LBDOWN = 26;
80     const static ULONG CHANGE_LANGUAGE = 27;
81     const static ULONG LAST_VIEW_CLOSE = 28;
82     const static ULONG CHANGED_REMOTECONTROL = 29;
83     const static ULONG DELETE_SELECTED_TIMER = 30;
84     const static ULONG CHANGED_DEVICEOPTIONS = 31;
85     const static ULONG TELETEXTUPDATE = 32;
86     const static ULONG TELETEXTUPDATEFIRSTLINE = 33;
87     const static ULONG SUBTITLE_CHANGE_CHANNEL = 34;
88     const static ULONG MOUSE_SCROLL = 35;
89     const static ULONG NEW_PICTURE = 36;
90     const static ULONG NEW_PICTURE_STATIC = 37;
91     const static ULONG REDRAW = 38;
92     const static ULONG SHUTDOWN = 39;
93
94 };
95
96 #endif