~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to deprecated/management/profile-editor/src/Preferences.h

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-08-10 18:12:34 UTC
  • mto: This revision was merged to the branch mainline in revision 9.
  • Revision ID: james.westby@ubuntu.com-20110810181234-b6obckg60cp99crg
Tags: upstream-2.7.0~beta1+bzr1774
ImportĀ upstreamĀ versionĀ 2.7.0~beta1+bzr1774

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef PREFERENCES_H
2
 
#define PREFERENCES_H
3
 
 
4
 
#include <wx/notebook.h>
5
 
 
6
 
#define CONFIG_NAME "AppArmorProfileEditor"
7
 
#define DEFAULT_COMMENT_COLOUR_R 31
8
 
#define DEFAULT_COMMENT_COLOUR_G 31
9
 
#define DEFAULT_COMMENT_COLOUR_B 210
10
 
#define DEFAULT_INCLUDE_COLOUR_R 56
11
 
#define DEFAULT_INCLUDE_COLOUR_G 136
12
 
#define DEFAULT_INCLUDE_COLOUR_B 31
13
 
#define DEFAULT_CAP_COLOUR_R 229
14
 
#define DEFAULT_CAP_COLOUR_G 33
15
 
#define DEFAULT_CAP_COLOUR_B 204
16
 
#define DEFAULT_PATH_COLOUR_R 1
17
 
#define DEFAULT_PATH_COLOUR_G 1
18
 
#define DEFAULT_PATH_COLOUR_B 1
19
 
#define DEFAULT_PERM_COLOUR_R 160
20
 
#define DEFAULT_PERM_COLOUR_G 32
21
 
#define DEFAULT_PERM_COLOUR_B 240
22
 
 
23
 
enum
24
 
{
25
 
        ID_COMMENT_COLOUR_BUTTON,
26
 
        ID_PERMS_COLOUR_BUTTON,
27
 
        ID_INCLUDES_COLOUR_BUTTON,
28
 
        ID_CAPABILITIES_COLOUR_BUTTON,
29
 
        ID_PATHS_COLOUR_BUTTON,
30
 
        ID_COMMENT_FONT_BUTTON,
31
 
        ID_PERMS_FONT_BUTTON,
32
 
        ID_INCLUDES_FONT_BUTTON,
33
 
        ID_CAPABILITIES_FONT_BUTTON,
34
 
        ID_PATHS_FONT_BUTTON,
35
 
        ID_PREFERENCES_NOTEBOOK,
36
 
};
37
 
 
38
 
/**
39
 
 * The preferences dialog
40
 
 */
41
 
class PreferencesDialog: public wxDialog
42
 
{    
43
 
        DECLARE_DYNAMIC_CLASS( PreferencesDialog )
44
 
        DECLARE_EVENT_TABLE()
45
 
 
46
 
        public:
47
 
 
48
 
                PreferencesDialog();
49
 
                PreferencesDialog(wxWindow* parent, 
50
 
                                wxWindowID id, 
51
 
                                const wxString& caption = _("Preferences"), 
52
 
                                const wxPoint& pos = wxDefaultPosition, 
53
 
                                const wxSize& size = wxSize(400, 300), 
54
 
                                long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX);
55
 
                bool Create(wxWindow* parent, 
56
 
                                wxWindowID, 
57
 
                                const wxString& caption = _("Preferences"), 
58
 
                                const wxPoint& pos = wxDefaultPosition, 
59
 
                                const wxSize& size = wxSize(400, 300), 
60
 
                                long style = wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX );
61
 
                void CreateControls();
62
 
                wxString BestGuessProfileDirectory ();
63
 
                wxString BestGuessParserCommand ();
64
 
                
65
 
                // Event handlers
66
 
                void OnColourButton(wxCommandEvent &event);
67
 
                void OnFontButton (wxCommandEvent &event);
68
 
 
69
 
                // Various accessor functions so we can save the data
70
 
                wxColour GetCommentButtonColour(void) { return mpCommentsButton->GetBackgroundColour(); }
71
 
                wxColour GetIncludeButtonColour(void) { return mpIncludesButton->GetBackgroundColour(); }
72
 
                wxColour GetCapabilityButtonColour(void) { return mpCapabilitiesButton->GetBackgroundColour(); }
73
 
                wxColour GetPathButtonColour(void) { return mpPathsButton->GetBackgroundColour(); }
74
 
                wxColour GetPermButtonColour(void) { return mpPermsButton->GetBackgroundColour(); }
75
 
                wxFont GetCommentButtonFont(void) { return mpCommentsFontButton->GetFont(); }
76
 
                wxFont GetIncludeButtonFont(void) { return mpIncludesFontButton->GetFont(); }
77
 
                wxFont GetPathButtonFont(void) { return mpPathsFontButton->GetFont(); }
78
 
                wxFont GetCapabilityButtonFont(void) { return mpCapabilitiesFontButton->GetFont(); }
79
 
                wxFont GetPermButtonFont(void) { return mpPermsFontButton->GetFont(); }
80
 
                wxString GetProfileDir(void) { return mpProfileDir->GetValue(); }
81
 
                wxString GetParser(void) { return mpParserCommand->GetValue(); }
82
 
                wxString GetTemplateText(void) { return mpTemplateTextCtrl->GetText(); }
83
 
        private:
84
 
                wxNotebook*     mpPrefsNotebook;
85
 
                wxTextCtrl*     mpProfileDir;
86
 
                wxTextCtrl*     mpParserCommand;
87
 
                ProfileTextCtrl* mpTemplateTextCtrl;
88
 
                wxButton*       mpCommentsButton;
89
 
                wxButton*       mpIncludesButton;
90
 
                wxButton*       mpPermsButton;
91
 
                wxButton*       mpCapabilitiesButton;
92
 
                wxButton*       mpPathsButton;
93
 
                wxButton*       mpCommentsFontButton;
94
 
                wxButton*       mpIncludesFontButton;
95
 
                wxButton*       mpCapabilitiesFontButton;
96
 
                wxButton*       mpPathsFontButton;
97
 
                wxButton*       mpPermsFontButton;
98
 
};
99
 
 
100
 
#endif
101
 
 
102