Sayonara Player
GlobalMessage.h
1 /* GlobalMessage.h */
2 
3 /* Copyright (C) 2011-2017 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef GLOBALMESSAGE_H
22 #define GLOBALMESSAGE_H
23 
24 #include <QString>
25 
27 
32 namespace GlobalMessage
33 {
34  enum class Answer : unsigned char
35  {
36  Yes=0,
37  No,
38  Ok,
39  Cancel,
40  Undefined
41  };
42 
43  enum class QuestionType : unsigned char
44  {
45  YesNo=0,
46  OkCancel
47  };
48 
49 
50  GlobalMessage::Answer info(
51  const QString& info,
52  const QString& sender_name=QString());
53 
54  GlobalMessage::Answer warning(
55  const QString& warning,
56  const QString& sender_name=QString());
57 
58  GlobalMessage::Answer error(
59  const QString& error,
60  const QString& sender_name=QString());
61 
62  GlobalMessage::Answer question(
63  const QString& question,
64  const QString& sender_name=QString(),
65  QuestionType type=GlobalMessage::QuestionType::YesNo);
66 
73 }
74 
75 #endif // GLOBALMESSAGE_H
The GlobalMessage class.
Definition: GlobalMessage.h:32
bool register_receiver(GlobalMessageReceiverInterface *receiver)
register a receiver here, so it is called whenever a message has to be written
The GlobalMessageReceiverInterface class implement this class in order to have the possibility to sho...
Definition: GlobalMessageReceiverInterface.h:33