wmi

git clone git://oldgit.suckless.org/wmi/
Log | Files | Refs | LICENSE

prompt.h (692B)


      1 // Copyright (c) 2003 - 2009 Anselm R Garbe <anselm@garbe.us>
      2 // See LICENSE for license details.
      3 
      4 #ifndef __PROMPT_H
      5 #define __PROMPT_H
      6 
      7 #include <set>
      8 #include <string>
      9 #include "wmi.h"
     10 
     11 class Binder;
     12 
     13 typedef set<string> Sstring;
     14 typedef string (Binder::*QueryNamesForPrefix)
     15             (string prefix, Sstring *nameSet);
     16 
     17 /**
     18  * Represents a prompt in input mode. A prompt may also contain a
     19  * query method pointer for dynamic menu support.
     20  */
     21 class Prompt {
     22 
     23 public:
     24 
     25     Prompt(string prompt, QueryNamesForPrefix toQuery);
     26 
     27     string prompt() const;
     28 
     29     QueryNamesForPrefix toQuery() const;
     30 
     31 private:
     32 
     33     string prompt_;
     34     QueryNamesForPrefix toQuery_;
     35 };
     36 
     37 #endif // __PROMPT_H