KeyboardApplet.hpp 823 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef TEMPLATE_KEYBOARDAPPLET_HPP
  2. #define TEMPLATE_KEYBOARDAPPLET_HPP
  3. #include <3ds.h>
  4. #include <cpp3ds/System/String.hpp>
  5. #include <vector>
  6. namespace Template {
  7. class KeyboardApplet {
  8. public:
  9. enum InputType {
  10. Text,
  11. Number,
  12. URL,
  13. };
  14. KeyboardApplet(InputType type = Text, int maxTextLength = -1);
  15. ~KeyboardApplet();
  16. operator SwkbdState*();
  17. void addDictWord(const std::string &typedWord, const std::string &resultWord);
  18. cpp3ds::String getInput();
  19. SwkbdButton getButton() { return m_button; }
  20. std::basic_string<cpp3ds::Uint8> error;
  21. private:
  22. InputType m_type;
  23. SwkbdState m_swkbdState;
  24. SwkbdStatusData m_swkbdStatus;
  25. SwkbdLearningData *m_swkbdLearning;
  26. SwkbdButton m_button;
  27. std::vector<SwkbdDictWord> m_dictWords;
  28. };
  29. } // namespace Template
  30. #endif //TEMPLATE_KEYBOARDAPPLET_HPP