source: trunk/Lucide/plugins/lupoppler/lupichoice.cpp

Last change on this file was 654, checked in by Gregg Young, 3 years ago

Initial code to get Choice fields working. Currently turned off.

  • Property svn:executable set to *
File size: 9.0 KB
Line 
1/* ***** BEGIN LICENSE BLOCK *****
2 * Version: CDDL 1.0/LGPL 2.1
3 *
4 * The contents of this file are subject to the COMMON DEVELOPMENT AND
5 * DISTRIBUTION LICENSE (CDDL) Version 1.0 (the "License"); you may not use
6 * this file except in compliance with the License. You may obtain a copy of
7 * the License at http://www.sun.com/cddl/
8 *
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
12 * License.
13 *
14 * The Initial Developer of the Original Code is
15 * Dmitriy Kuminov, netlabs.org.
16 * Portions created by the Initial Developer are Copyright (C) 2006
17 * the Initial Developer. All Rights Reserved.
18 *
19 * Contributor(s):
20 *
21 * Alternatively, the contents of this file may be used under the terms of
22 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
23 * in which case the provisions of the LGPL are applicable instead of those
24 * above. If you wish to allow use of your version of this file only under the
25 * terms of the LGPL, and not to allow others to use your version of this file
26 * under the terms of the CDDL, indicate your decision by deleting the
27 * provisions above and replace them with the notice and other provisions
28 * required by the LGPL. If you do not delete the provisions above, a recipient
29 * may use your version of this file under the terms of any one of the CDDL
30 * or the LGPL.
31 *
32 * ***** END LICENSE BLOCK ***** */
33
34
35
36/*
37 *  This file was generated by the SOM Compiler and Emitter Framework.
38 *  Generated using template emitter:
39 *      SOM Emitter emitxtm: 2.23.1.9
40 */
41
42#ifndef SOM_Module_lupichoice_Source
43#define SOM_Module_lupichoice_Source
44#endif
45#define LuPopplerInputChoice_Class_Source
46
47#include "lupichoice.xih"
48#include "cpconv.h"
49
50SOM_Scope void SOMLINK init_widgetChoice(LuPopplerInputChoice *somSelf,
51                                          Environment *ev, somInitCtrl* ctrl,
52                                         LuPopplerDocument* aDoc,
53                                         long aPagenum, Page* aPage,
54                                         FormWidgetChoice* aFormWidgetChoice)
55{
56    LuPopplerInputChoiceData *somThis = NULL; /* set in BeginInitializer */
57    somInitCtrl globalCtrl;
58    somBooleanVector myMask;
59    LuPopplerInputChoice_BeginInitializer_init_widgetChoice;
60
61    LuPopplerInputChoice_Init_LuPopplerInputField_init_widget(somSelf, ev, ctrl,
62                                                              aDoc, aPagenum, aPage,
63                                                              aFormWidgetChoice);
64    LuPopplerInputChoice_Init_LuInputChoice_somDefaultInit(somSelf, ctrl);
65
66    /* local LuPopplerInputField initialization code */
67
68    somThis->widget = aFormWidgetChoice;
69}
70
71
72SOM_Scope void SOMLINK somDestruct(LuPopplerInputChoice *somSelf,
73                                   octet doFree, som3DestructCtrl* ctrl)
74{
75    LuPopplerInputChoiceData *somThis; /* set in BeginDestructor */
76    somDestructCtrl globalCtrl;
77    somBooleanVector myMask;
78    LuPopplerInputChoice_BeginDestructor;
79
80    /* local LuPopplerInputField deinitialization code */
81
82    LuPopplerInputChoice_EndDestructor;
83}
84
85SOM_Scope long  SOMLINK getCount(LuPopplerInputChoice *somSelf,
86                                  Environment *ev)
87{
88    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
89    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","getCount");
90
91    return somThis->widget->getNumChoices();
92      //(LuPopplerInputChoice_parent_LuInputChoice_getCount(somSelf,
93                                                             //  ev));
94}
95
96SOM_Scope string  SOMLINK getChoice(LuPopplerInputChoice *somSelf,
97                                     Environment *ev, long aNumber)
98{
99    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
100    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","getChoice");
101
102    delete[] somThis->mChoiceText;
103    somThis->mChoiceText = NULL;
104
105    GooString *gooStr = somThis->widget->getChoice(aNumber);
106    if (gooStr)
107      somThis->mChoiceText =  gooStr->getCString();
108            //uniUtf16BEToUtf8( gooStr->getCString(), gooStr->getLength(),
109            //                  NULL, NULL );
110    return somThis->mChoiceText;
111      //(LuPopplerInputChoice_parent_LuInputChoice_getChoice(somSelf,
112                                //                                ev,
113                                //                                aNumber));
114}
115
116SOM_Scope void  SOMLINK select(LuPopplerInputChoice *somSelf,
117                                Environment *ev, long aNumber)
118{
119    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
120    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","select");
121
122    LuPopplerInputChoice_parent_LuInputChoice_select(somSelf,
123                                                     ev, aNumber);
124}
125
126SOM_Scope void  SOMLINK toggle(LuPopplerInputChoice *somSelf,
127                                Environment *ev, long aNumber)
128{
129    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
130    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","toggle");
131
132    LuPopplerInputChoice_parent_LuInputChoice_toggle(somSelf,
133                                                     ev, aNumber);
134}
135
136SOM_Scope void  SOMLINK deselectAll(LuPopplerInputChoice *somSelf,
137                                     Environment *ev)
138{
139    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
140    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","deselectAll");
141
142    LuPopplerInputChoice_parent_LuInputChoice_deselectAll(somSelf,
143                                                          ev);
144}
145
146SOM_Scope void  SOMLINK setChoiceText(LuPopplerInputChoice *somSelf,
147                                       Environment *ev, string aText)
148{
149    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
150    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","setChoiceText");
151
152    LuPopplerInputChoice_parent_LuInputChoice_setChoiceText(somSelf,
153                                                            ev,
154                                                            aText);
155}
156
157SOM_Scope string  SOMLINK getChoiceText(LuPopplerInputChoice *somSelf,
158                                         Environment *ev)
159{
160    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
161    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","getChoiceText");
162
163    return (LuPopplerInputChoice_parent_LuInputChoice_getChoiceText(somSelf,
164                                                                    ev));
165}
166
167SOM_Scope boolean  SOMLINK isSelected(LuPopplerInputChoice *somSelf,
168                                       Environment *ev, long aNumber)
169{
170    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
171    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","isSelected");
172
173    return (LuPopplerInputChoice_parent_LuInputChoice_isSelected(somSelf,
174                                                                 ev,
175                                                                 aNumber));
176}
177
178SOM_Scope boolean  SOMLINK isComboBox(LuPopplerInputChoice *somSelf,
179                                       Environment *ev)
180{
181    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
182    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","isComboBox");
183
184    return (LuPopplerInputChoice_parent_LuInputChoice_isComboBox(somSelf,
185                                                                 ev));
186}
187
188SOM_Scope boolean  SOMLINK isEditable(LuPopplerInputChoice *somSelf,
189                                       Environment *ev)
190{
191    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
192    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","isEditable");
193
194    return (LuPopplerInputChoice_parent_LuInputChoice_isEditable(somSelf,
195                                                                 ev));
196}
197
198SOM_Scope boolean  SOMLINK isMultiSelectable(LuPopplerInputChoice *somSelf,
199                                              Environment *ev)
200{
201    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
202    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","isMultiSelectable");
203
204    return (LuPopplerInputChoice_parent_LuInputChoice_isMultiSelectable(somSelf,
205                                                                        ev));
206}
207
208SOM_Scope boolean  SOMLINK isSpellCheckable(LuPopplerInputChoice *somSelf,
209                                             Environment *ev)
210{
211    LuPopplerInputChoiceData *somThis = LuPopplerInputChoiceGetData(somSelf);
212    LuPopplerInputChoiceMethodDebug("LuPopplerInputChoice","isSpellCheckable");
213
214    return (LuPopplerInputChoice_parent_LuInputChoice_isSpellCheckable(somSelf,
215                                                                       ev));
216}
217
Note: See TracBrowser for help on using the repository browser.