user_note_body.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_USER_NOTES_MODEL_USER_NOTE_BODY_H_
  5. #define COMPONENTS_USER_NOTES_MODEL_USER_NOTE_BODY_H_
  6. #include <string>
  7. namespace user_notes {
  8. // Model class for a note body.
  9. class UserNoteBody {
  10. public:
  11. enum BodyType { PLAIN_TEXT = 0, RICH_TEXT, IMAGE };
  12. explicit UserNoteBody(const std::u16string& plain_text_value);
  13. ~UserNoteBody();
  14. UserNoteBody(const UserNoteBody&) = delete;
  15. UserNoteBody& operator=(const UserNoteBody&) = delete;
  16. BodyType type() const { return type_; }
  17. const std::u16string& plain_text_value() const { return plain_text_value_; }
  18. private:
  19. // The type of body this note has. Currently only plain text is supported.
  20. BodyType type_ = BodyType::PLAIN_TEXT;
  21. // The note body in plain text
  22. std::u16string plain_text_value_;
  23. };
  24. } // namespace user_notes
  25. #endif // COMPONENTS_USER_NOTES_MODEL_USER_NOTE_BODY_H_