ListBoxQt.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // This defines the specialisation of QListBox that handles the Scintilla
  2. // double-click callback.
  3. //
  4. // Copyright (c) 2017 Riverbank Computing Limited <info@riverbankcomputing.com>
  5. //
  6. // This file is part of QScintilla.
  7. //
  8. // This file may be used under the terms of the GNU General Public License
  9. // version 3.0 as published by the Free Software Foundation and appearing in
  10. // the file LICENSE included in the packaging of this file. Please review the
  11. // following information to ensure the GNU General Public License version 3.0
  12. // requirements will be met: http://www.gnu.org/copyleft/gpl.html.
  13. //
  14. // If you do not wish to use this file under the terms of the GPL version 3.0
  15. // then you may purchase a commercial license. For more information contact
  16. // info@riverbankcomputing.com.
  17. //
  18. // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
  19. // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  20. #include <qmap.h>
  21. #include <qpixmap.h>
  22. #include <qstring.h>
  23. #include "SciNamespace.h"
  24. #include "include/Platform.h"
  25. class QsciSciListBox;
  26. // This is an internal class but it is referenced by a public class so it has
  27. // to have a Qsci prefix rather than being put in the Scintilla namespace
  28. // which would mean exposing the SCI_NAMESPACE mechanism).
  29. class QsciListBoxQt : public QSCI_SCI_NAMESPACE(ListBox)
  30. {
  31. public:
  32. QsciListBoxQt();
  33. QSCI_SCI_NAMESPACE(CallBackAction) cb_action;
  34. void *cb_data;
  35. virtual void SetFont(QSCI_SCI_NAMESPACE(Font) &font);
  36. virtual void Create(QSCI_SCI_NAMESPACE(Window) &parent, int,
  37. QSCI_SCI_NAMESPACE(Point), int, bool unicodeMode, int);
  38. virtual void SetAverageCharWidth(int);
  39. virtual void SetVisibleRows(int);
  40. virtual int GetVisibleRows() const;
  41. virtual QSCI_SCI_NAMESPACE(PRectangle) GetDesiredRect();
  42. virtual int CaretFromEdge();
  43. virtual void Clear();
  44. virtual void Append(char *s, int type = -1);
  45. virtual int Length();
  46. virtual void Select(int n);
  47. virtual int GetSelection();
  48. virtual int Find(const char *prefix);
  49. virtual void GetValue(int n, char *value, int len);
  50. virtual void Sort();
  51. virtual void RegisterImage(int type, const char *xpm_data);
  52. virtual void RegisterRGBAImage(int type, int width, int height,
  53. const unsigned char *pixelsImage);
  54. virtual void ClearRegisteredImages();
  55. virtual void SetDoubleClickAction(
  56. QSCI_SCI_NAMESPACE(CallBackAction) action, void *data);
  57. virtual void SetList(const char *list, char separator, char typesep);
  58. private:
  59. QsciSciListBox *slb;
  60. int visible_rows;
  61. bool utf8;
  62. typedef QMap<int, QPixmap> xpmMap;
  63. xpmMap xset;
  64. };