source: trunk/Lucide/plugins/lupoppler/lupitext.cpp @ 492

Last change on this file since 492 was 492, checked in by dmik, 10 years ago

Name spelling.

  • Property svn:executable set to *
File size: 6.4 KB
Line 
1
2/*
3 *  This file was generated by the SOM Compiler.
4 *  Generated using:
5 *     SOM incremental update: 2.24
6 */
7
8
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 * Dmitriy 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"
56#include "cpconv.h"
57
58
59SOM_Scope void SOMLINK init_widgetText(LuPopplerInputText *somSelf,
60                                        Environment *ev, somInitCtrl* ctrl,
61                                       LuPopplerDocument* aDoc,
62                                       long aPagenum, Page* aPage,
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,
71                                                            aDoc, aPagenum, aPage,
72                                                            aFormWidgetText);
73    LuPopplerInputText_Init_LuInputText_somDefaultInit(somSelf, ctrl);
74
75    /* local LuPopplerInputField initialization code */
76
77    somThis->widget = aFormWidgetText;
78    somThis->contents = NULL;
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
92    delete[] somThis->contents;
93
94    LuPopplerInputText_EndDestructor;
95}
96
97
98SOM_Scope string  SOMLINK getContents(LuPopplerInputText *somSelf,
99                                       Environment *ev)
100{
101    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
102
103    delete[] somThis->contents;
104    somThis->contents = NULL;
105
106    GooString *gooStr = somThis->widget->getContent();
107    if ( gooStr )
108        somThis->contents =
109            uniUtf16BEToUtf8( gooStr->getCString(), gooStr->getLength(),
110                              NULL, NULL );
111
112    return somThis->contents;
113}
114
115SOM_Scope void  SOMLINK setContents(LuPopplerInputText *somSelf,
116                                     Environment *ev, string aContents)
117{
118    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
119
120    size_t len = 0;
121    char *str = uniUtf8ToUtf16BE( aContents, NULL, NULL, &len );
122    GooString *contents = new GooString( str, len );
123    delete[] str;
124    somThis->widget->setContent( contents );
125    delete contents;
126}
127
128SOM_Scope boolean  SOMLINK isMultiLine(LuPopplerInputText *somSelf,
129                                        Environment *ev)
130{
131    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
132
133    return somThis->widget->isMultiline();
134}
135
136SOM_Scope boolean  SOMLINK isPassword(LuPopplerInputText *somSelf,
137                                       Environment *ev)
138{
139    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
140
141    return somThis->widget->isPassword();
142}
143
144SOM_Scope boolean  SOMLINK isFileName(LuPopplerInputText *somSelf,
145                                       Environment *ev)
146{
147    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
148
149    return somThis->widget->isFileSelect();
150}
151
152SOM_Scope boolean  SOMLINK isSpellCheckable(LuPopplerInputText *somSelf,
153                                             Environment *ev)
154{
155    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
156
157    return !somThis->widget->noSpellCheck();
158}
159
160SOM_Scope boolean  SOMLINK isScrollable(LuPopplerInputText *somSelf,
161                                         Environment *ev)
162{
163    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
164
165    return !somThis->widget->noScroll();
166}
167
168SOM_Scope boolean  SOMLINK isComb(LuPopplerInputText *somSelf,
169                                   Environment *ev)
170{
171    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
172
173    return somThis->widget->isComb();
174}
175
176SOM_Scope boolean  SOMLINK isRichText(LuPopplerInputText *somSelf,
177                                       Environment *ev)
178{
179    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
180
181    return somThis->widget->isRichText();
182}
183
184SOM_Scope long  SOMLINK getMaximumLength(LuPopplerInputText *somSelf,
185                                          Environment *ev)
186{
187    LuPopplerInputTextData *somThis = LuPopplerInputTextGetData(somSelf);
188
189    return somThis->widget->getMaxLen();
190}
191
Note: See TracBrowser for help on using the repository browser.