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

« back to all changes in this revision

Viewing changes to deprecated/management/profile-editor/src/Configuration.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 CONFIGURATION_H
2
 
#define CONFIGURATION_H
3
 
 
4
 
#define DEFAULT_COMMENT_COLOUR 31, 31, 210
5
 
#define DEFAULT_INCLUDE_COLOUR 56, 136, 31
6
 
#define DEFAULT_CAP_COLOUR 229, 33, 204
7
 
#define DEFAULT_PATH_COLOUR 1, 1, 1
8
 
#define DEFAULT_PERM_COLOUR 160, 32, 240
9
 
 
10
 
class wxConfig;
11
 
 
12
 
/**
13
 
 * The configuration details class
14
 
 */
15
 
class Configuration
16
 
{
17
 
public:
18
 
        static void Initialize();
19
 
        static wxString BestGuessProfileDirectory();
20
 
        static wxString BestGuessParserCommand();
21
 
        static bool CommitChanges();
22
 
 
23
 
        static wxString GetProfileDirectory() { return mProfileDirectory; }
24
 
        static wxString GetEditorExecutable() { return mProfileEditorExecutable; }
25
 
        static wxString GetTemplateText() { return mTemplateText; }
26
 
        static wxString GetParserCommand() { return mParserCommand; }
27
 
        static wxColour GetCommentColour() { return mCommentColour; }
28
 
        static wxColour GetIncludeColour() { return mIncludeColour; }
29
 
        static wxColour GetCapColour()  { return mCapColour; }
30
 
        static wxColour GetPathColour() { return mPathColour; }
31
 
        static wxColour GetPermColour() { return mPermColour; }
32
 
        static wxFont GetCapabilityFont() { return mCapabilityFont; }
33
 
        static wxFont GetCommentFont() { return mCommentFont; }
34
 
        static wxFont GetIncludeFont() { return mIncludeFont; }
35
 
        static wxFont GetPathFont() { return mPathFont; }
36
 
        static wxFont GetPermFont() { return mPermsFont; }
37
 
        static wxSize GetWindowSize() { return wxSize(mWindowWidth, mWindowHeight); }
38
 
        static wxPoint GetWindowPos() { return wxPoint(mWindowX, mWindowY); }
39
 
        static void WriteWindowSettings(const wxPoint &pos, const wxSize& size);
40
 
 
41
 
        static void SetProfileDirectory(const wxString& profileDirectory) 
42
 
                                        { mProfileDirectory = profileDirectory; }
43
 
        static void SetEditorExecutable(const wxString& executable) { mProfileEditorExecutable = executable; }
44
 
        static void SetParserCommand(const wxString& parserCommand) { mParserCommand = parserCommand; }
45
 
        static void SetTemplateText(const wxString& templateText) { mTemplateText = templateText; }
46
 
        static void SetCommentColour(const wxColour& commentColour) { mCommentColour = commentColour; }
47
 
        static void SetIncludeColour(const wxColour& includeColour) { mIncludeColour = includeColour; }
48
 
        static void SetCapColour(const wxColour& capColour) { mCapColour = capColour; }
49
 
        static void SetPathColour(const wxColour& pathColour) { mPathColour = pathColour; }
50
 
        static void SetPermColour(const wxColour& permColour) { mPermColour = permColour; }
51
 
        static void SetCapabilityFont(const wxFont& capabilityFont) { mCapabilityFont = capabilityFont; }
52
 
        static void SetCommentFont(const wxFont& commentFont) { mCommentFont = commentFont; }
53
 
        static void SetIncludeFont(const wxFont& includeFont) { mIncludeFont = includeFont; }
54
 
        static void SetPathFont(const wxFont& pathFont) { mPathFont = pathFont; }
55
 
        static void SetPermFont(const wxFont& permsFont) { mPermsFont = permsFont; }
56
 
 
57
 
private:
58
 
        static void             _WriteColour(const wxString& key, const wxColour& colour);
59
 
        static wxColour         _ReadColour(const wxString& key, const wxColour& defaultColour);
60
 
        static void             _ReadFont(const wxString& key, wxFont& font);
61
 
        static wxString         mProfileDirectory;
62
 
        static wxString         mProfileEditorExecutable;
63
 
        static wxString         mParserCommand;
64
 
        static wxString         mTemplateText;
65
 
        static wxColour         mCommentColour;
66
 
        static wxColour         mIncludeColour;
67
 
        static wxColour         mCapColour;
68
 
        static wxColour         mPathColour;
69
 
        static wxColour         mPermColour;
70
 
        static wxFont           mCapabilityFont;
71
 
        static wxFont           mCommentFont;
72
 
        static wxFont           mIncludeFont;
73
 
        static wxFont           mPathFont;
74
 
        static wxFont           mPermsFont;
75
 
        static int              mWindowX; // These are just the settings from the 
76
 
        static int              mWindowY; // config file, they are *NOT* updated 
77
 
        static int              mWindowWidth; // in any size events
78
 
        static int              mWindowHeight;
79
 
 
80
 
};
81
 
 
82
 
 
83
 
#endif
84