1 // -*- mode: c++ -*-
2 //
3 // This file is part of libyacurs.
4 // Copyright (C) 2013  Rafael Ostertag
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 as
8 // published by the Free Software Foundation, either version 3 of the
9 // License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program.  If not, see
18 // <http://www.gnu.org/licenses/>.
19 //
20 //
21 // $Id$
22 
23 #ifndef YACURSTYPES_H
24 #define YACURSTYPES_H 1
25 
26 #include <signal.h>
27 
28 namespace YACURS {
29 // Forward declaration because we want to be independent.
30 class Event;
31 
32 /// Type of the function pointer that will be called upon an
33 /// event.
34 typedef void (*fptr_t)(Event&);
35 
36 enum SORT_ORDER { ASCENDING, DESCENDING, UNSORTED };
37 
38 /**
39  * State of dialog.
40  */
41 enum DIALOG_STATE {
42     /// Dialog was confirmed
43     DIALOG_OK,
44     DIALOG_YES,
45     /// Dialog was cancelled
46     DIALOG_CANCEL,
47     DIALOG_NO
48 };
49 
50 enum DIALOG_TYPE { OK_ONLY, YES_ONLY, OKCANCEL, YESNO, YESNOCANCEL };
51 
52 enum DIALOG_SIZE { AUTOMATIC, FULLSIZE };
53 
54 /**
55  * File types allowed for selection in FileDialog.
56  */
57 enum FILEDIALOG_SELECTION_TYPE { ANY, DIRECTORY, FILE };
58 
59 namespace INTERNAL {
60 #ifdef SA_SIGINFO
61 
62 typedef void (*sig_handler)(int, siginfo_t*, void*);
63 #else
64 
65 typedef void (*sig_handler)(int);
66 #endif
67 }  // namespace INTERNAL
68 }  // namespace YACURS
69 
70 #endif  // YACURSTYPES_H
71