source: branches/kmk/Lucide/plugins/lupoppler/lupitext.cpp @ 338

Last change on this file since 338 was 338, checked in by dmik, 12 years ago

branches/kmk: Poppler plugin: Take and return text field contents in UTF-8.

  • Property svn:executable set to *
File size: 6.3 KB
RevLine 
[323]1
2/*
3 *  This file was generated by the SOM Compiler.
4 *  Generated using:
5 *     SOM incremental update: 2.24
6 */
7
8
[320]9/* ***** BEGIN LICENSE BLOCK *****
10 * Version: CDDL 1.0/LGPL 2.1
11 *
12 * The contents of this file are subject to the COMMON DEVELOPMENT AND
13 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
14 * this file except in compliance with the License. You may obtain a copy of
15 * the License at http://www.sun.com/cddl/
16 *
17 * Software distributed under the License is distributed on an "AS IS" basis,
18 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
19 * for the specific language governing rights and limitations under the
20 * License.
21 *
22 * The Initial Developer of the Original Code is
23 * Dmitry A. Kuminov, netlabs.org.
24 * Portions created by the Initial Developer are Copyright (C) 2006
25 * the Initial Developer. All Rights Reserved.
26 *
27 * Contributor(s):
28 *
29 * Alternatively, the contents of this file may be used under the terms of
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the LGPL are applicable instead of those
32 * above. If you wish to allow use of your version of this file only under the
33 * terms of the LGPL, and not to allow others to use your version of this file
34 * under the terms of the CDDL, indicate your decision by deleting the
35 * provisions above and replace them with the notice and other provisions
36 * required by the LGPL. If you do not delete the provisions above, a recipient
37 * may use your version of this file under the terms of any one of the CDDL
38 * or the LGPL.
39 *
40 * ***** END LICENSE BLOCK ***** */
41
42
43
44/*
45 *  This file was generated by the SOM Compiler and Emitter Framework.
46 *  Generated using template emitter:
47 *      SOM Emitter emitxtm: 2.23.1.9
48 */
49
50#ifndef SOM_Module_lupitext_Source
51#define SOM_Module_lupitext_Source
52#endif
53#define LuPopplerInputText_Class_Source
54
55#include "lupitext.xih"
[338]56#include "cpconv.h"
[320]57
58
[323]59SOM_Scope void SOMLINK init_widgetText(LuPopplerInputText *somSelf,
60                                        Environment *ev, somInitCtrl* ctrl,
[324]61                                       LuPopplerDocument* aDoc,
62                                       long aPagenum, Page* aPage,
[323]63                                       FormWidgetText* aFormWidgetText)
64{
65    LuPopplerInputTextData *somThis; /* set in BeginInitializer */
66    somInitCtrl globalCtrl;
67    somBooleanVector myMask;
68    LuPopplerInputText_BeginInitializer_init_widgetText;
69
70    LuPopplerInputText_Init_LuPopplerInputField_init_widget(somSelf, ev, ctrl,
[324]71                                                            aDoc, aPagenum, aPage,
[323]72                                                            aFormWidgetText);
[326]73    LuPopplerInputText_Init_LuInputText_somDefaultInit(somSelf, ctrl);
[323]74
75    /* local LuPopplerInputField initialization code */
76
77    somThis->widget = aFormWidgetText;
[338]78    somThis->contents = NULL;
[323]79}
80
81
82SOM_Scope void SOMLINK somDestruct(LuPopplerInputText *somSelf,
83                                   octet doFree, som3DestructCtrl* ctrl)
84{
85    LuPopplerInputTextData *somThis; /* set in BeginDestructor */
86    somDestructCtrl globalCtrl;
87    somBooleanVector myMask;
88    LuPopplerInputText_BeginDestructor;
89
90    /* local LuPopplerInputField deinitialization code */
91
[338]92    delete[] somThis->contents;
93
[323]94    LuPopplerInputText_EndDestructor;
95}
96
97
[320]98SOM_Scope string  SOMLINK getContents(LuPopplerInputText *somSelf,
99                                       Environment *ev)
100{
101    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
102
[338]103    delete[] somThis->contents;
104
105    GooString *gooStr = somThis->widget->getContent();
106    somThis->contents = uniUtf16BEToUtf8( gooStr->getCString(), gooStr->getLength(),
107                                          NULL, NULL );
108    return somThis->contents;
[320]109}
110
111SOM_Scope void  SOMLINK setContents(LuPopplerInputText *somSelf,
112                                     Environment *ev, string aContents)
113{
114    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
115
[338]116    size_t len = 0;
117    char *str = uniUtf8ToUtf16BE( aContents, NULL, NULL, &len );
118    GooString *contents = new GooString( str, len );
119    delete[] str;
120    somThis->widget->setContent( contents );
[323]121    delete contents;
[320]122}
123
124SOM_Scope boolean  SOMLINK isMultiLine(LuPopplerInputText *somSelf,
125                                        Environment *ev)
126{
127    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
128
[323]129    return somThis->widget->isMultiline();
[320]130}
131
132SOM_Scope boolean  SOMLINK isPassword(LuPopplerInputText *somSelf,
133                                       Environment *ev)
134{
135    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
136
[323]137    return somThis->widget->isPassword();
[320]138}
139
140SOM_Scope boolean  SOMLINK isFileName(LuPopplerInputText *somSelf,
141                                       Environment *ev)
142{
143    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
144
[323]145    return somThis->widget->isFileSelect();
[320]146}
147
148SOM_Scope boolean  SOMLINK isSpellCheckable(LuPopplerInputText *somSelf,
149                                             Environment *ev)
150{
151    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
152
[323]153    return !somThis->widget->noSpellCheck();
[320]154}
155
156SOM_Scope boolean  SOMLINK isScrollable(LuPopplerInputText *somSelf,
157                                         Environment *ev)
158{
159    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
160
[323]161    return !somThis->widget->noScroll();
[320]162}
163
164SOM_Scope boolean  SOMLINK isComb(LuPopplerInputText *somSelf,
165                                   Environment *ev)
166{
167    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
168
[323]169    return somThis->widget->isComb();
[320]170}
171
172SOM_Scope boolean  SOMLINK isRichText(LuPopplerInputText *somSelf,
173                                       Environment *ev)
174{
175    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
176
[323]177    return somThis->widget->isRichText();
[320]178}
179
180SOM_Scope long  SOMLINK getMaximumLength(LuPopplerInputText *somSelf,
181                                          Environment *ev)
182{
183    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
184
[323]185    return somThis->widget->getMaxLen();
[320]186}
187
Note: See TracBrowser for help on using the repository browser.