Add libwx-perl
[pkg-perl] / deb-src / libwx-perl / libwx-perl-0.96 / ext / docview / XS / DocManager.xs
1 #############################################################################
2 ## Name:        ext/docview/XS/DocManager.xs
3 ## Purpose:     XS for wxDocument ( Document / View Framework )
4 ## Author:      Simon Flack
5 ## Modified by:
6 ## Created:     11/09/2002
7 ## RCS-ID:      $Id: DocManager.xs 2453 2008-08-31 11:09:40Z mbarbon $
8 ## Copyright:   (c) 2002-2008 Mattia Barbon
9 ## Licence:     This program is free software; you can redistribute it and/or
10 ##              modify it under the same terms as Perl itself
11 #############################################################################
12
13
14 MODULE=Wx PACKAGE=Wx::DocManager
15
16 wxDocManager*
17 wxDocManager::new( flags = wxDEFAULT_DOCMAN_FLAGS, initialize = true )
18     long flags
19     bool initialize
20   CODE:
21     RETVAL=new wxPliDocManager(CLASS, flags, initialize);
22   OUTPUT:
23     RETVAL
24
25 bool
26 wxDocManager::Clear( force )
27     bool force
28
29 bool
30 wxDocManager::Initialize()
31
32 wxFileHistory*
33 wxDocManager::OnCreateFileHistory()
34
35 wxFileHistory*
36 wxDocManager::GetFileHistory()
37
38 void
39 wxDocManager::SetMaxDocsOpen(n)
40     int n
41
42 int
43 wxDocManager::GetMaxDocsOpen()
44
45 SV*
46 wxDocManager::GetDocuments()
47   CODE:
48     AV* arrDocs = wxPli_objlist_2_av( aTHX_ THIS->GetDocuments() );
49     RETVAL = newRV_noinc( (SV*)arrDocs  );
50   OUTPUT: RETVAL
51
52 SV*
53 wxDocManager::GetTemplates()
54   CODE:
55     AV* arrDocs = wxPli_objlist_2_av( aTHX_ THIS->GetTemplates() );
56     RETVAL = newRV_noinc( (SV*)arrDocs  );
57   OUTPUT: RETVAL
58
59 wxString
60 wxDocManager::GetLastDirectory()
61
62 void
63 wxDocManager::SetLastDirectory( dir )
64     wxString dir
65
66 void
67 wxDocManager::OnFileClose( event )
68     wxCommandEvent* event
69   CODE:
70     THIS->OnFileClose( *event );
71
72 void
73 wxDocManager::OnFileCloseAll( event )
74     wxCommandEvent* event
75   CODE:
76     THIS->OnFileCloseAll( *event );
77
78 void
79 wxDocManager::OnFileNew( event )
80     wxCommandEvent* event
81   CODE:
82     THIS->OnFileNew( *event );
83
84 void
85 wxDocManager::OnFileOpen( event )
86     wxCommandEvent* event
87   CODE:
88     THIS->OnFileOpen( *event );
89
90 void
91 wxDocManager::OnFileRevert( event )
92     wxCommandEvent* event
93   CODE:
94     THIS->OnFileRevert( *event );
95
96 void
97 wxDocManager::OnFileSave( event )
98     wxCommandEvent* event
99   CODE:
100     THIS->OnFileSave( *event );
101
102 void
103 wxDocManager::OnFileSaveAs( event )
104     wxCommandEvent* event
105   CODE:
106     THIS->OnFileSaveAs( *event );
107
108 void
109 wxDocManager::OnPrint( event )
110     wxCommandEvent* event
111   CODE:
112     THIS->OnPrint( *event );
113
114 #if WXPERL_W_VERSION_LE( 2, 5, 2 )
115
116 void
117 wxDocManager::OnPrintSetup( event )
118     wxCommandEvent* event
119   CODE:
120     THIS->OnPrintSetup( *event );
121
122 #endif
123
124 void
125 wxDocManager::OnPreview( event )
126     wxCommandEvent* event
127   CODE:
128     THIS->OnPreview( *event );
129
130 void
131 wxDocManager::OnUndo( event )
132     wxCommandEvent* event
133   CODE:
134     THIS->OnUndo( *event );
135
136 void
137 wxDocManager::OnRedo( event )
138     wxCommandEvent* event
139   CODE:
140     THIS->OnRedo( *event );
141
142 void
143 wxDocManager::OnUpdateFileOpen( event )
144     wxUpdateUIEvent* event
145   CODE:
146     THIS->OnUpdateFileOpen( *event );
147
148 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
149
150 void
151 wxDocManager::OnUpdateFileClose( event )
152     wxUpdateUIEvent* event
153   CODE:
154     THIS->OnUpdateFileClose( *event );
155
156 void
157 wxDocManager::OnUpdateFileRevert( event )
158     wxUpdateUIEvent* event
159   CODE:
160     THIS->OnUpdateFileRevert( *event );
161
162 #endif
163
164 void
165 wxDocManager::OnUpdateFileNew( event )
166     wxUpdateUIEvent* event
167   CODE:
168     THIS->OnUpdateFileNew( *event );
169
170 void
171 wxDocManager::OnUpdateFileSave( event )
172     wxUpdateUIEvent* event
173   CODE:
174     THIS->OnUpdateFileSave( *event );
175
176 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
177
178 void
179 wxDocManager::OnUpdateFileSaveAs( event )
180     wxUpdateUIEvent* event
181   CODE:
182     THIS->OnUpdateFileSaveAs( *event );
183
184 #endif
185
186 void
187 wxDocManager::OnUpdateUndo( event )
188     wxUpdateUIEvent* event
189   CODE:
190     THIS->OnUpdateUndo( *event );
191
192 void
193 wxDocManager::OnUpdateRedo( event )
194     wxUpdateUIEvent* event
195   CODE:
196     THIS->OnUpdateRedo( *event );
197
198 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
199
200 void
201 wxDocManager::OnUpdatePrint( event )
202     wxUpdateUIEvent* event
203   CODE:
204     THIS->OnUpdatePrint( *event );
205
206 #endif
207
208 #if WXPERL_W_VERSION_LE( 2, 5, 2 )
209
210 void
211 wxDocManager::OnUpdatePrintSetup( event )
212     wxUpdateUIEvent* event
213   CODE:
214     THIS->OnUpdatePrintSetup( *event );
215
216 #endif
217
218 #if WXPERL_W_VERSION_LT( 2, 9, 0 )
219
220 void
221 wxDocManager::OnUpdatePreview( event )
222     wxUpdateUIEvent* event
223   CODE:
224     THIS->OnUpdatePreview( *event );
225
226 #endif
227
228 wxView *
229 wxDocManager::GetCurrentView()
230
231 wxDocument *
232 wxDocManager::CreateDocument( path, flags = 0 )
233     wxString path
234     long flags
235
236
237 wxView *
238 wxDocManager::CreateView( doc, flags = 0 )
239     wxDocument* doc
240     long flags
241
242 void
243 wxDocManager::DeleteTemplate( temp, flags = 0 )
244     wxDocTemplate* temp
245     long flags
246
247 bool
248 wxDocManager::FlushDoc( doc )
249     wxDocument* doc
250
251 wxDocument *
252 wxDocManager::GetCurrentDocument()
253
254 #if WXPERL_W_VERSION_GE( 2, 9, 0 )
255
256 wxString
257 wxDocManager::MakeNewDocumentName()
258
259 #else
260
261 bool
262 wxDocManager::MakeDefaultName( name )
263     wxString name
264
265 #endif
266
267 wxString
268 wxDocManager::MakeFrameTitle( doc )
269     wxDocument* doc
270
271 wxDocTemplate *
272 wxDocManager::MatchTemplate( path )
273     wxString path
274
275 void
276 wxDocManager::AddFileToHistory( file )
277     wxString file
278
279 void
280 wxDocManager::RemoveFileFromHistory( i )
281     int i
282
283
284 wxString
285 wxDocManager::GetHistoryFile( i )
286     int i
287
288 void
289 wxDocManager::FileHistoryUseMenu( menu )
290     wxMenu* menu
291
292 void
293 wxDocManager::FileHistoryRemoveMenu( menu )
294     wxMenu* menu
295
296
297 #if wxUSE_CONFIG
298
299 ## Need wxConfigBase& in typemap
300
301 void
302 wxDocManager::FileHistoryLoad( config )
303     wxConfigBase* config
304   C_ARGS: *config
305
306 void
307 wxDocManager::FileHistorySave( config )
308     wxConfigBase* config
309   C_ARGS: *config
310
311 #endif
312
313 void
314 wxDocManager::FileHistoryAddFilesToMenu( ... )
315   CASE: items == 1
316     CODE:
317       THIS->FileHistoryAddFilesToMenu();
318   CASE: items == 2
319     INPUT:
320       wxMenu* menu = NO_INIT
321     CODE:
322       THIS->FileHistoryAddFilesToMenu( menu );
323   CASE:
324     CODE:
325       croak( "Usage: Wx::FileHistory::AddfilesToMenu(THIS [, menu ] )" );
326
327 #if WXPERL_W_VERSION_GE( 2, 5, 1 )
328
329 size_t
330 wxDocManager::GetHistoryFilesCount()
331
332 #else
333
334 int
335 wxDocManager::GetNoHistoryFiles()
336         
337 #endif
338
339 wxDocTemplate *
340 wxDocManager::FindTemplateForPath( path )
341     wxString path
342
343 wxDocTemplate *
344 wxDocManager::SelectDocumentPath( templates, noTemplates, path, flags, save = false)
345     AV* templates
346     int noTemplates
347     wxString path
348     long flags
349     bool save
350   PREINIT:
351     int tmpl_n;
352     int i;
353     wxDocTemplate **pltemplates;
354     wxDocTemplate *thistemplate;
355   CODE:
356     tmpl_n = av_len(templates) + 1;
357     pltemplates = new wxDocTemplate *[ tmpl_n ];
358     for(i = 0; i < tmpl_n; i++)
359     {
360       SV** pltemplate = av_fetch( (AV*) templates, i, 0 );
361       wxDocTemplate* thistemplate = (wxDocTemplate *)
362                       wxPli_sv_2_object( aTHX_ *pltemplate, "Wx::DocTemplate" );
363       pltemplates[i] = thistemplate;
364     }
365     RETVAL = THIS->SelectDocumentPath(pltemplates, noTemplates, path, flags, save);
366     delete[] pltemplates;
367   OUTPUT:
368     RETVAL
369
370 wxDocTemplate *
371 wxDocManager::SelectDocumentType( templates, noTemplates, sort = false)
372     AV* templates
373     int noTemplates
374     bool sort
375   PREINIT:
376     int tmpl_n;
377     int i;
378     wxDocTemplate **pltemplates;
379     wxDocTemplate *thistemplate;
380   CODE:
381     tmpl_n = av_len(templates) + 1;
382     pltemplates = new wxDocTemplate *[ tmpl_n ];
383     for(i = 0; i < tmpl_n; i++)
384     {
385       SV** pltemplate = av_fetch( (AV*) templates, i, 0 );
386       wxDocTemplate* thistemplate = (wxDocTemplate *)
387                       wxPli_sv_2_object( aTHX_ *pltemplate, "Wx::DocTemplate" );
388       pltemplates[i] = thistemplate;
389     }
390     RETVAL = THIS->SelectDocumentType(pltemplates, noTemplates, sort);
391     delete[] pltemplates;
392   OUTPUT:
393     RETVAL
394
395
396
397 wxDocTemplate *
398 wxDocManager::SelectViewType( templates, noTemplates, sort = false)
399     AV* templates
400     int noTemplates
401     bool sort
402   PREINIT:
403     int tmpl_n;
404     int i;
405     wxDocTemplate **pltemplates;
406     wxDocTemplate *thistemplate;
407   CODE:
408     tmpl_n = av_len(templates) + 1;
409     pltemplates = new wxDocTemplate *[ tmpl_n ];
410     for(i = 0; i < tmpl_n; i++)
411     {
412       SV** pltemplate = av_fetch( (AV*) templates, i, 0 );
413       wxDocTemplate* thistemplate = (wxDocTemplate *)
414                       wxPli_sv_2_object( aTHX_ *pltemplate, "Wx::DocTemplate" );
415       pltemplates[i] = thistemplate;
416     }
417     RETVAL = THIS->SelectViewType(pltemplates, noTemplates, sort);
418     delete[] pltemplates;
419   OUTPUT:
420     RETVAL
421
422 void
423 wxDocManager::AssociateTemplate( temp )
424     wxDocTemplate* temp
425
426 void
427 wxDocManager::DisassociateTemplate( temp )
428     wxDocTemplate* temp
429
430 void
431 wxDocManager::AddDocument( doc )
432     wxDocument* doc
433
434 void
435 wxDocManager::RemoveDocument( doc )
436     wxDocument* doc
437
438 bool
439 wxDocManager::CloseDocuments( force = true )
440     bool force
441
442 #if WXPERL_W_VERSION_GE( 2, 5, 1 )
443
444 void
445 wxDocManager::ActivateView( view, activate = true )
446     wxView* view
447     bool activate
448
449 #else
450
451 void
452 wxDocManager::ActivateView( view, activate = true, deleting = false )
453     wxView* view
454     bool activate
455     bool deleting
456
457 #endif