1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
/*
* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; version 2 of the
* License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef _STUB_CODEEDITOR_H_
#define _STUB_CODEEDITOR_H_
#include "stub_view.h"
namespace mforms {
namespace stub {
class CodeEditorImpl : public ViewImpl
{
protected:
CodeEditorImpl(::mforms::CodeEditor *self)
: ViewImpl(self)
{
}
static bool __stdcall create(CodeEditor* self)
{
return true;
}
static void __stdcall set_text(CodeEditor* self, const std::string& text)
{
}
static const std::string __stdcall get_text(CodeEditor* self, bool selection_only)
{
return "";
}
static void __stdcall get_selection(CodeEditor* self, int &start, int &length)
{
}
static void __stdcall set_selection(CodeEditor* self, int start, int length)
{
}
static bool __stdcall get_range_of_line(CodeEditor* self, int line, int &start, int &length)
{
return true;
}
static void __stdcall set_language(CodeEditor* self, SyntaxHighlighterLanguage language)
{
}
static void __stdcall set_read_only(CodeEditor* self, bool flag)
{
}
static void __stdcall show_markup(CodeEditor* self, LineMarkup markup, int line)
{
}
static void __stdcall remove_markup(CodeEditor* self, LineMarkup markup, int line)
{
}
static int __stdcall line_count(CodeEditor* self)
{
return 0;
}
static void __stdcall set_font(CodeEditor* self, const std::string &fontDescription)
{
}
public:
static void init()
{
::mforms::ControlFactory *f = ::mforms::ControlFactory::get_instance();
f->_code_editor_impl.create = &CodeEditorImpl::create;
f->_code_editor_impl.get_range_of_line = &CodeEditorImpl::get_range_of_line;
f->_code_editor_impl.get_selection = &CodeEditorImpl::get_selection;
f->_code_editor_impl.get_text = &CodeEditorImpl::get_text;
f->_code_editor_impl.get_selection = &CodeEditorImpl::get_selection;
f->_code_editor_impl.get_text = &CodeEditorImpl::get_text;
f->_code_editor_impl.line_count = &CodeEditorImpl::line_count;
f->_code_editor_impl.remove_markup = &CodeEditorImpl::remove_markup;
f->_code_editor_impl.set_font = &CodeEditorImpl::set_font;
f->_code_editor_impl.set_language = &CodeEditorImpl::set_language;
f->_code_editor_impl.set_read_only = &CodeEditorImpl::set_read_only;
f->_code_editor_impl.set_selection = &CodeEditorImpl::set_selection;
f->_code_editor_impl.set_text = &CodeEditorImpl::set_text;
f->_code_editor_impl.show_markup = &CodeEditorImpl::show_markup;
}
};
}
}
#endif
|