ctkFittedTextBrowser_p.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkFittedTextBrowser_p_h
  15. #define __ctkFittedTextBrowser_p_h
  16. // CTK includes
  17. #include "ctkFittedTextBrowser.h"
  18. //-----------------------------------------------------------------------------
  19. /// \ingroup Widgets
  20. class CTK_WIDGETS_EXPORT ctkFittedTextBrowserPrivate
  21. {
  22. Q_DECLARE_PUBLIC(ctkFittedTextBrowser);
  23. protected:
  24. ctkFittedTextBrowser* const q_ptr;
  25. public:
  26. ctkFittedTextBrowserPrivate(ctkFittedTextBrowser& object);
  27. virtual ~ctkFittedTextBrowserPrivate();
  28. // Update collapsed/expanded text in the widget.
  29. void updateCollapsedText();
  30. // Get collapsed/expanded text in html format from plain text.
  31. QString collapsedTextFromPlainText() const;
  32. // Get collapsed/expanded text in html format from html.
  33. QString collapsedTextFromHtml() const;
  34. // Get more/less link in html format
  35. QString collapseLinkText() const;
  36. bool Collapsed;
  37. QString ShowDetailsText;
  38. QString HideDetailsText;
  39. // Stores the text that the user originally set.
  40. QString CollapsibleText;
  41. enum CollapsibleTextSetMethod
  42. {
  43. Text,
  44. PlainText,
  45. Html
  46. };
  47. // Stores what method the user called to set text
  48. CollapsibleTextSetMethod CollapsibleTextSetter;
  49. };
  50. #endif