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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Scintilla source code edit control
 
2
/** @file ScintillaBase.h
 
3
 ** Defines an enhanced subclass of Editor with calltips, autocomplete and context menu.
 
4
 **/
 
5
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
 
6
// The License.txt file describes the conditions under which this software may be distributed.
 
7
 
 
8
#ifndef SCINTILLABASE_H
 
9
#define SCINTILLABASE_H
 
10
 
 
11
#define APPARMOR_OPEN_INCLUDE_MENU_ITEM 4891
 
12
#define APPARMOR_INSERT_INCLUDE_MENU_ITEM 4892
 
13
#define APPARMOR_SEARCH_PHRASE_IN_ALL_PROFILES 4893
 
14
/**
 
15
 */
 
16
class ScintillaBase : public Editor {
 
17
        // Private so ScintillaBase objects can not be copied
 
18
        ScintillaBase(const ScintillaBase &) : Editor() {}
 
19
        ScintillaBase &operator=(const ScintillaBase &) { return *this; }
 
20
 
 
21
protected:
 
22
        /** Enumeration of commands and child windows. */
 
23
        enum {
 
24
                idCallTip=1,
 
25
                idAutoComplete=2,
 
26
                idcmdUndo=10,
 
27
                idcmdRedo=11,
 
28
                idcmdCut=12,
 
29
                idcmdCopy=13,
 
30
                idcmdPaste=14,
 
31
                idcmdDelete=15,
 
32
                idcmdSelectAll=16,
 
33
        };
 
34
 
 
35
        bool displayPopupMenu;
 
36
        Menu popup;
 
37
        AutoComplete ac;
 
38
 
 
39
        CallTip ct;
 
40
 
 
41
        int listType;                   ///< 0 is an autocomplete list
 
42
        SString listSelected;   ///< Receives listbox selected string
 
43
        int maxListWidth;               /// Maximum width of list, in average character widths
 
44
 
 
45
        bool performingStyle;   ///< Prevent reentrance
 
46
 
 
47
#ifdef SCI_LEXER
 
48
        int lexLanguage;
 
49
        const LexerModule *lexCurrent;
 
50
        PropSet props;
 
51
        enum {numWordLists=KEYWORDSET_MAX+1};
 
52
        WordList *keyWordLists[numWordLists+1];
 
53
        void SetLexer(uptr_t wParam);
 
54
        void SetLexerLanguage(const char *languageName);
 
55
        void Colourise(int start, int end);
 
56
#endif
 
57
 
 
58
        ScintillaBase();
 
59
        virtual ~ScintillaBase();
 
60
        virtual void Initialise() = 0;
 
61
        virtual void Finalise() = 0;
 
62
 
 
63
        virtual void RefreshColourPalette(Palette &pal, bool want);
 
64
 
 
65
        virtual void AddCharUTF(char *s, unsigned int len, bool treatAsDBCS=false);
 
66
        void Command(int cmdId);
 
67
        virtual void CancelModes();
 
68
        virtual int KeyCommand(unsigned int iMessage);
 
69
 
 
70
        void AutoCompleteStart(int lenEntered, const char *list);
 
71
        void AutoCompleteCancel();
 
72
        void AutoCompleteMove(int delta);
 
73
        int AutoCompleteGetCurrent();
 
74
        void AutoCompleteCharacterAdded(char ch);
 
75
        void AutoCompleteCharacterDeleted();
 
76
        void AutoCompleteCompleted();
 
77
        void AutoCompleteMoveToCurrentWord();
 
78
        static void AutoCompleteDoubleClick(void* p);
 
79
 
 
80
        void CallTipClick();
 
81
        void CallTipShow(Point pt, const char *defn);
 
82
        virtual void CreateCallTipWindow(PRectangle rc) = 0;
 
83
 
 
84
        virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
 
85
        void ContextMenu(Point pt);
 
86
 
 
87
        virtual void ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
 
88
 
 
89
        virtual void NotifyStyleToNeeded(int endStyleNeeded);
 
90
public:
 
91
        // Public so scintilla_send_message can use it
 
92
        virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
 
93
};
 
94
 
 
95
#endif