kakoune

Fork of kakoune, an acceptable text editor
git clone git://git.laack.co/kakoune.git
Log | Files | Refs

scope.hh (1251B)


      1 #ifndef scope_hh_INCLUDED
      2 #define scope_hh_INCLUDED
      3 
      4 #include "unique_ptr.hh"
      5 #include "utils.hh"
      6 
      7 namespace Kakoune
      8 {
      9 
     10 class AliasRegistry;
     11 class FaceRegistry;
     12 class Highlighters;
     13 class HookManager;
     14 class KeymapManager;
     15 class OptionManager;
     16 class OptionsRegistry;
     17 
     18 class Scope
     19 {
     20 public:
     21     Scope(Scope& parent);
     22     ~Scope();
     23 
     24     OptionManager&       options();
     25     const OptionManager& options() const;
     26     HookManager&         hooks();
     27     const HookManager&   hooks() const;
     28     KeymapManager&       keymaps();
     29     const KeymapManager& keymaps() const;
     30     AliasRegistry&       aliases();
     31     const AliasRegistry& aliases() const;
     32     FaceRegistry&        faces();
     33     const FaceRegistry&  faces() const;
     34     Highlighters&        highlighters();
     35     const Highlighters&  highlighters() const;
     36 
     37     void reparent(Scope& parent);
     38 
     39 private:
     40     friend class GlobalScope;
     41     Scope();
     42     struct Data;
     43     UniquePtr<Data> m_data;
     44 };
     45 
     46 class GlobalScope : public Scope, public Singleton<GlobalScope>
     47 {
     48 public:
     49     GlobalScope();
     50     ~GlobalScope();
     51 
     52     OptionsRegistry& option_registry();
     53     const OptionsRegistry& option_registry() const;
     54 
     55 private:
     56     struct GlobalData;
     57     UniquePtr<GlobalData> m_global_data;
     58 };
     59 
     60 }
     61 
     62 #endif // scope_hh_INCLUDED