| 1 |
// @file ScintillaEdit.h |
| 2 |
// Extended version of ScintillaEditBase with a method for each API |
| 3 |
// Copyright (c) 2011 Archaeopteryx Software, Inc. d/b/a Wingware |
| 4 |
|
| 5 |
#ifndef SCINTILLAEDIT_H |
| 6 |
#define SCINTILLAEDIT_H |
| 7 |
|
| 8 |
#include <QPair> |
| 9 |
|
| 10 |
#include "ScintillaEditBase.h" |
| 11 |
#include "ScintillaDocument.h" |
| 12 |
|
| 13 |
#ifndef EXPORT_IMPORT_API |
| 14 |
#ifdef WIN32 |
| 15 |
#ifdef MAKING_LIBRARY |
| 16 |
#define EXPORT_IMPORT_API __declspec(dllexport) |
| 17 |
#else |
| 18 |
// Defining dllimport upsets moc |
| 19 |
#define EXPORT_IMPORT_API __declspec(dllimport) |
| 20 |
//#define EXPORT_IMPORT_API |
| 21 |
#endif |
| 22 |
#else |
| 23 |
#define EXPORT_IMPORT_API |
| 24 |
#endif |
| 25 |
#endif |
| 26 |
|
| 27 |
class EXPORT_IMPORT_API ScintillaEdit : public ScintillaEditBase { |
| 28 |
Q_OBJECT |
| 29 |
|
| 30 |
public: |
| 31 |
ScintillaEdit(QWidget *parent = 0); |
| 32 |
virtual ~ScintillaEdit(); |
| 33 |
|
| 34 |
QByteArray TextReturner(int message, uptr_t wParam) const; |
| 35 |
|
| 36 |
QPair<int, int>find_text(int flags, const char *text, int cpMin, int cpMax); |
| 37 |
QByteArray get_text_range(int start, int end); |
| 38 |
ScintillaDocument *get_doc(); |
| 39 |
void set_doc(ScintillaDocument *pdoc_); |
| 40 |
|
| 41 |
// Same as previous two methods but with Qt style names |
| 42 |
QPair<int, int>findText(int flags, const char *text, int cpMin, int cpMax) { |
| 43 |
return find_text(flags, text, cpMin, cpMax); |
| 44 |
} |
| 45 |
|
| 46 |
QByteArray textRange(int start, int end) { |
| 47 |
return get_text_range(start, end); |
| 48 |
} |
| 49 |
|
| 50 |
// Exposing the FORMATRANGE api with both underscore & qt style names |
| 51 |
long format_range(bool draw, QPaintDevice* target, QPaintDevice* measure, |
| 52 |
const QRect& print_rect, const QRect& page_rect, |
| 53 |
long range_start, long range_end); |
| 54 |
long formatRange(bool draw, QPaintDevice* target, QPaintDevice* measure, |
| 55 |
const QRect& print_rect, const QRect& page_rect, |
| 56 |
long range_start, long range_end) { |
| 57 |
return format_range(draw, target, measure, print_rect, page_rect, |
| 58 |
range_start, range_end); |
| 59 |
} |
| 60 |
|
| 61 |
/* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ |
| 62 |
/* --Autogenerated -- end of section automatically generated from Scintilla.iface */ |
| 63 |
|
| 64 |
}; |
| 65 |
|
| 66 |
#if defined(__GNUC__) |
| 67 |
#pragma GCC diagnostic ignored "-Wmissing-field-initializers" |
| 68 |
#if !defined(__clang__) && (__GNUC__ >= 8) |
| 69 |
#pragma GCC diagnostic ignored "-Wcast-function-type" |
| 70 |
#endif |
| 71 |
#endif |
| 72 |
|
| 73 |
#endif /* SCINTILLAEDIT_H */ |