Debian Codegraph @

CodeLite/clGotoEntry.h

raw
1 #ifndef CLGOTOENTRY_H
2 #define CLGOTOENTRY_H
3
4 #include "codelite_exports.h"
5 #include <vector>
6 #if wxUSE_GUI
7 #include <wx/bitmap.h>
8 #endif
9 #include <wx/string.h>
10
11 class WXDLLIMPEXP_CL clGotoEntry
12 {
13 private:
14 wxString m_desc;
15 wxString m_keyboardShortcut;
16 int m_resourceID;
17 #if wxUSE_GUI
18 wxBitmap m_bitmap;
19 #endif
20 size_t m_flags;
21
22 public:
23 enum eFlags {
24 kItemNormal = (1 << 0),
25 kItemRadio = (1 << 1),
26 kItemCheck = (1 << 2),
27 kItemStateChecked = (1 << 3),
28 };
29
30 public:
31 typedef std::vector<clGotoEntry> Vec_t;
32
33 public:
34 clGotoEntry(const wxString& desc, const wxString& shortcut, int id);
35 clGotoEntry();
36
37 void SetDesc(const wxString& desc) { this->m_desc = desc; }
38 void SetKeyboardShortcut(const wxString& keyboardShortcut) { this->m_keyboardShortcut = keyboardShortcut; }
39 void SetResourceID(int resourceID) { this->m_resourceID = resourceID; }
40 const wxString& GetDesc() const { return m_desc; }
41 const wxString& GetKeyboardShortcut() const { return m_keyboardShortcut; }
42 int GetResourceID() const { return m_resourceID; }
43 #if wxUSE_GUI
44 const wxBitmap& GetBitmap() const { return m_bitmap; }
45 void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
46 #endif
47 void SetFlags(size_t flags) { this->m_flags = flags; }
48 size_t GetFlags() const { return m_flags; }
49 bool IsChecked() const { return m_flags & kItemStateChecked; }
50 void SetChecked(bool b) { b ? m_flags |= kItemStateChecked : m_flags &= ~kItemStateChecked; }
51 bool IsCheckable() const { return m_flags & kItemCheck; }
52 void SetCheckable(bool b) { b ? m_flags |= kItemCheck : m_flags &= ~kItemCheck; }
53 };
54 #endif // CLGOTOENTRY_H