summaryrefslogtreecommitdiff
path: root/include/svx/sdr/overlay/overlaymanager.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/svx/sdr/overlay/overlaymanager.hxx')
-rw-r--r--include/svx/sdr/overlay/overlaymanager.hxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/svx/sdr/overlay/overlaymanager.hxx b/include/svx/sdr/overlay/overlaymanager.hxx
index d25613a1fa80..09c8505ef819 100644
--- a/include/svx/sdr/overlay/overlaymanager.hxx
+++ b/include/svx/sdr/overlay/overlaymanager.hxx
@@ -99,7 +99,7 @@ namespace sdr
const drawinglayer::geometry::ViewInformation2D getCurrentViewInformation2D() const;
// complete redraw
- virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = 0) const;
+ virtual void completeRedraw(const vcl::Region& rRegion, OutputDevice* pPreRenderDevice = nullptr) const;
// flush. Do buffered updates.
virtual void flush();
ss='add' style='width: 3.2%;'/> -rw-r--r--sfx2/inc/configmgr.hxx73
-rw-r--r--sfx2/inc/dinfedt.hxx120
-rw-r--r--sfx2/inc/docvor.hxx183
-rw-r--r--sfx2/inc/frmload.hxx221
-rw-r--r--sfx2/inc/idpool.hxx97
-rw-r--r--sfx2/inc/imgmgr.hxx155
-rw-r--r--sfx2/inc/inettbc.hxx163
-rw-r--r--sfx2/inc/mieclip.hxx130
-rw-r--r--sfx2/inc/minfitem.hxx115
-rw-r--r--sfx2/inc/msgnodei.hxx269
-rw-r--r--sfx2/inc/orgmgr.hxx133
-rw-r--r--sfx2/inc/progind.hxx127
-rw-r--r--sfx2/inc/resmgr.hxx109
-rw-r--r--sfx2/inc/sfxbasic.hxx76
-rw-r--r--sfx2/inc/sfxhelp.hxx311
-rw-r--r--sfx2/inc/sfxresid.hxx92
-rw-r--r--sfx2/inc/stbitem.hxx143
-rw-r--r--sfx2/inc/tplpitem.hxx92
-rw-r--r--sfx2/inc/viewfac.hxx102
-rw-r--r--sfx2/prj/d.lst148
-rw-r--r--sfx2/sdi/appslots.sdi375
-rw-r--r--sfx2/sdi/docslots.sdi408
-rw-r--r--sfx2/sdi/frmslots.sdi696
-rw-r--r--sfx2/sdi/makefile.mk105
-rw-r--r--sfx2/sdi/mdislots.sdi404
-rw-r--r--sfx2/sdi/sfx.sdi9267
-rw-r--r--sfx2/sdi/sfxslots.sdi119
-rw-r--r--sfx2/sdi/viwslots.sdi154
-rw-r--r--sfx2/source/appl/app.cxx1859
-rw-r--r--sfx2/source/appl/app.hrc189
-rw-r--r--sfx2/source/appl/app.src3406
-rw-r--r--sfx2/source/appl/appbas.cxx1373
-rw-r--r--sfx2/source/appl/appcfg.cxx1849
-rw-r--r--sfx2/source/appl/appchild.cxx451
-rw-r--r--sfx2/source/appl/appdata.cxx602
-rw-r--r--sfx2/source/appl/appdde.cxx744
-rw-r--r--sfx2/source/appl/appinit.cxx905
-rw-r--r--sfx2/source/appl/appmain.cxx632
-rw-r--r--sfx2/source/appl/appmisc.cxx1170
-rw-r--r--sfx2/source/appl/appopen.cxx1402
-rw-r--r--sfx2/source/appl/appquit.cxx375
-rw-r--r--sfx2/source/appl/appreg.cxx274
-rw-r--r--sfx2/source/appl/appserv.cxx1066
-rw-r--r--sfx2/source/appl/appuno.cxx1239
-rw-r--r--sfx2/source/appl/childwin.cxx679
-rw-r--r--sfx2/source/appl/makefile.mk158
-rw-r--r--sfx2/source/appl/module.cxx470
-rw-r--r--sfx2/source/appl/sfx.src526
-rw-r--r--sfx2/source/appl/sfxdll.cxx108
-rw-r--r--sfx2/source/appl/sfxhelp.cxx1277
-rw-r--r--sfx2/source/appl/workwin.cxx3148
-rw-r--r--sfx2/source/bastyp/bastyp.hrc114
-rw-r--r--sfx2/source/bastyp/bastyp.src433
-rw-r--r--sfx2/source/bastyp/bitset.cxx428
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx3215
-rw-r--r--sfx2/source/bastyp/fltfnc.src186
-rw-r--r--sfx2/source/bastyp/frmhtml.cxx880
-rw-r--r--sfx2/source/bastyp/frmhtmlw.cxx582
-rw-r--r--sfx2/source/bastyp/helper.cxx673
-rw-r--r--sfx2/source/bastyp/makefile.mk117
-rw-r--r--sfx2/source/bastyp/mieclip.cxx190
-rw-r--r--sfx2/source/bastyp/minarray.cxx766
-rw-r--r--sfx2/source/bastyp/misc.cxx141
-rw-r--r--sfx2/source/bastyp/progress.cxx849
-rw-r--r--sfx2/source/bastyp/sfxhtml.cxx762
-rw-r--r--sfx2/source/bastyp/sfxresid.cxx90
-rw-r--r--sfx2/source/config/config.hrc124
-rw-r--r--sfx2/source/config/config.src291
-rw-r--r--sfx2/source/config/evntconf.cxx714
-rw-r--r--sfx2/source/config/makefile.mk115
-rw-r--r--sfx2/source/control/bindings.cxx3022
-rw-r--r--sfx2/source/control/ctrlitem.cxx480
-rw-r--r--sfx2/source/control/dispatch.cxx3493
-rw-r--r--sfx2/source/control/macrconf.cxx947
-rw-r--r--sfx2/source/control/macro.cxx858
-rw-r--r--sfx2/source/control/makefile.mk120
-rw-r--r--sfx2/source/control/minfitem.cxx136
-rw-r--r--sfx2/source/control/msg.cxx101
-rw-r--r--sfx2/source/control/msgpool.cxx627
-rw-r--r--sfx2/source/control/objface.cxx1427
-rw-r--r--sfx2/source/control/request.cxx576
-rw-r--r--sfx2/source/control/shell.cxx1524
-rw-r--r--sfx2/source/control/srchitem.cxx306
-rw-r--r--sfx2/source/control/statcach.cxx577
-rw-r--r--sfx2/source/control/unoctitm.cxx560
-rw-r--r--sfx2/source/dialog/about.cxx421
-rw-r--r--sfx2/source/dialog/acccfg.cxx854
-rw-r--r--sfx2/source/dialog/basedlgs.cxx1041
-rw-r--r--sfx2/source/dialog/cfg.cxx1376
-rw-r--r--sfx2/source/dialog/cfg.hrc110
-rw-r--r--sfx2/source/dialog/cfg.src1918
-rw-r--r--sfx2/source/dialog/dialog.hrc184
-rw-r--r--sfx2/source/dialog/dialog.src1028
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx962
-rw-r--r--sfx2/source/dialog/dinfdlg.hrc121
-rw-r--r--sfx2/source/dialog/dinfdlg.src1026
-rw-r--r--sfx2/source/dialog/dinfedt.cxx99
-rw-r--r--sfx2/source/dialog/dinfedt.hrc72
-rw-r--r--sfx2/source/dialog/dinfedt.src174
-rw-r--r--sfx2/source/dialog/dockwin.cxx1542
-rw-r--r--sfx2/source/dialog/intro.cxx119
-rw-r--r--sfx2/source/dialog/macropg.cxx698
-rw-r--r--sfx2/source/dialog/macropg.hrc80
-rw-r--r--sfx2/source/dialog/macropg.src502
-rw-r--r--sfx2/source/dialog/mailmodel.cxx364
-rw-r--r--sfx2/source/dialog/mailwindow.src545
-rw-r--r--sfx2/source/dialog/makefile.mk140
-rw-r--r--sfx2/source/dialog/mgetempl.cxx709
-rw-r--r--sfx2/source/dialog/mgetempl.hrc72
-rw-r--r--sfx2/source/dialog/mgetempl.src283
-rw-r--r--sfx2/source/dialog/navigat.cxx134
-rw-r--r--sfx2/source/dialog/newstyle.cxx134
-rw-r--r--sfx2/source/dialog/newstyle.hrc65
-rw-r--r--sfx2/source/dialog/newstyle.src177
-rw-r--r--sfx2/source/dialog/partwnd.cxx293
-rw-r--r--sfx2/source/dialog/passwd.cxx226
-rw-r--r--sfx2/source/dialog/passwd.hrc83
-rw-r--r--sfx2/source/dialog/passwd.src269
-rw-r--r--sfx2/source/dialog/sfxurl.cxx72
-rw-r--r--sfx2/source/dialog/splitwin.cxx1337
-rw-r--r--sfx2/source/dialog/styfitem.cxx175
-rw-r--r--sfx2/source/dialog/styledlg.cxx260
-rw-r--r--sfx2/source/dialog/tabdlg.cxx1494
-rw-r--r--sfx2/source/dialog/templdlg.cxx2644
-rw-r--r--sfx2/source/dialog/templdlg.hrc86
-rw-r--r--sfx2/source/dialog/templdlg.src435
-rw-r--r--sfx2/source/dialog/tplcitem.cxx187
-rw-r--r--sfx2/source/dialog/tplpitem.cxx123
-rw-r--r--sfx2/source/dialog/versdlg.cxx351
-rw-r--r--sfx2/source/dialog/versdlg.hrc82
-rw-r--r--sfx2/source/dialog/versdlg.src581
-rw-r--r--sfx2/source/doc/doc.hrc178
-rw-r--r--sfx2/source/doc/doc.src2066
-rw-r--r--sfx2/source/doc/docfac.cxx701
-rw-r--r--sfx2/source/doc/docfile.cxx3091
-rw-r--r--sfx2/source/doc/docfilt.cxx322
-rw-r--r--sfx2/source/doc/docinf.cxx1521
-rw-r--r--sfx2/source/doc/doctdlg.cxx262
-rw-r--r--sfx2/source/doc/doctdlg.hrc76
-rw-r--r--sfx2/source/doc/doctdlg.src298
-rw-r--r--sfx2/source/doc/doctempl.cxx2484
-rw-r--r--sfx2/source/doc/docvor.cxx1997
-rw-r--r--sfx2/source/doc/docvor.hrc90
-rw-r--r--sfx2/source/doc/docvor.src775
-rw-r--r--sfx2/source/doc/frmdescr.cxx1067
-rw-r--r--sfx2/source/doc/makefile.mk120
-rw-r--r--sfx2/source/doc/new.cxx695
-rw-r--r--sfx2/source/doc/new.hrc84
-rw-r--r--sfx2/source/doc/new.src439
-rw-r--r--sfx2/source/doc/objcont.cxx1669
-rw-r--r--sfx2/source/doc/objitem.cxx116
-rw-r--r--sfx2/source/doc/objmisc.cxx1452
-rw-r--r--sfx2/source/doc/objserv.cxx1173
-rw-r--r--sfx2/source/doc/objstor.cxx2044
-rw-r--r--sfx2/source/doc/objuno.cxx911
-rw-r--r--sfx2/source/doc/objxtor.cxx762
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx1483
-rw-r--r--sfx2/source/explorer/makefile.mk112
-rw-r--r--sfx2/source/explorer/nochaos.cxx247
-rw-r--r--sfx2/source/inc/acccfg.hxx150
-rw-r--r--sfx2/source/inc/appbas.hxx80
-rw-r--r--sfx2/source/inc/appdata.hxx301
-rw-r--r--sfx2/source/inc/cfg.hxx435
-rw-r--r--sfx2/source/inc/eventdlg.hxx109
-rw-r--r--sfx2/source/inc/fltfnc.hxx69
-rw-r--r--sfx2/source/inc/helper.hxx111
-rw-r--r--sfx2/source/inc/helpid.hrc344
-rw-r--r--sfx2/source/inc/hexplwnd.hxx173
-rw-r--r--sfx2/source/inc/intro.hxx93
-rw-r--r--sfx2/source/inc/mnucfga.hxx87
-rw-r--r--sfx2/source/inc/nfltdlg.hxx108
-rw-r--r--sfx2/source/inc/nochaos.hxx74
-rw-r--r--sfx2/source/inc/objmnctl.hxx90
-rw-r--r--sfx2/source/inc/objshimp.hxx237
-rw-r--r--sfx2/source/inc/openflag.hxx75
-rw-r--r--sfx2/source/inc/partwnd.hxx169
-rw-r--r--sfx2/source/inc/preview.hxx107
-rw-r--r--sfx2/source/inc/referers.hxx70
-rw-r--r--sfx2/source/inc/sfxlocal.hrc87
-rw-r--r--sfx2/source/inc/sfxtypes.hxx271
-rw-r--r--sfx2/source/inc/slotserv.hxx118
-rw-r--r--sfx2/source/inc/speakerdlg.hxx101
-rw-r--r--sfx2/source/inc/splitwin.hxx165
-rw-r--r--sfx2/source/inc/statcach.hxx220
-rw-r--r--sfx2/source/inc/templdgi.hxx377
-rw-r--r--sfx2/source/inc/tplcitem.hxx78
-rw-r--r--sfx2/source/inc/tplcomp.hxx313
-rw-r--r--sfx2/source/inc/versdlg.hxx144
-rw-r--r--sfx2/source/inc/virtmenu.hxx186
-rw-r--r--sfx2/source/inc/workwin.hxx400
-rw-r--r--sfx2/source/inet/inettbc.cxx1053
-rw-r--r--sfx2/source/inet/makefile.mk98
-rw-r--r--sfx2/source/menu/makefile.mk106
-rw-r--r--sfx2/source/menu/menu.hrc103
-rw-r--r--sfx2/source/menu/menu.src344
-rw-r--r--sfx2/source/menu/mnuitem.cxx460
-rw-r--r--sfx2/source/menu/mnumgr.cxx1426
-rw-r--r--sfx2/source/menu/objmnctl.cxx186
-rw-r--r--sfx2/source/menu/virtmenu.cxx1015
-rw-r--r--sfx2/source/notify/hintpost.cxx245
-rw-r--r--sfx2/source/notify/makefile.mk91
-rw-r--r--sfx2/source/statbar/makefile.mk100
-rw-r--r--sfx2/source/statbar/stbitem.cxx357
-rw-r--r--sfx2/source/toolbox/imgmgr.cxx1150
-rw-r--r--sfx2/source/toolbox/makefile.mk110
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx880
-rw-r--r--sfx2/source/view/frame.cxx2181
-rw-r--r--sfx2/source/view/frmload.cxx436
-rw-r--r--sfx2/source/view/impframe.cxx271
-rw-r--r--sfx2/source/view/impframe.hxx221
-rw-r--r--sfx2/source/view/makefile.mk116
-rw-r--r--sfx2/source/view/orgmgr.cxx824
-rw-r--r--sfx2/source/view/printer.cxx556
-rw-r--r--sfx2/source/view/prnmon.cxx401
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx614
-rw-r--r--sfx2/source/view/topfrm.cxx1111
-rw-r--r--sfx2/source/view/view.hrc196
-rw-r--r--sfx2/source/view/view.hxx61
-rw-r--r--sfx2/source/view/view.src1265
-rw-r--r--sfx2/source/view/viewfac.cxx103
-rw-r--r--sfx2/source/view/viewfrm.cxx3489
-rw-r--r--sfx2/source/view/viewimp.hxx115
-rw-r--r--sfx2/source/view/viewprn.cxx870
-rw-r--r--sfx2/source/view/viewsh.cxx1723
-rw-r--r--sfx2/util/hidother.src232
-rw-r--r--sfx2/util/make_tco.btm1
-rw-r--r--sfx2/util/makefile.mk482
-rw-r--r--sfx2/util/makefile.pmk65
-rw-r--r--sfx2/util/mkdemo.pl7
-rw-r--r--sfx2/win/res/expdesk.icobin0 -> 4990 bytes-rw-r--r--sfx2/win/res/expexp.icobin0 -> 2758 bytes-rw-r--r--sfx2/win/res/expfld.icobin0 -> 2758 bytes-rw-r--r--sfx2/win/res/expftp.icobin0 -> 2758 bytes-rw-r--r--sfx2/win/res/exptrash.icobin0 -> 2758 bytes-rw-r--r--sfx2/win/res/expwork.icobin0 -> 2758 bytes-rw-r--r--sfx2/win/res/frameset.icobin0 -> 2758 bytes-rw-r--r--sfx2/win/res/search.icobin0 -> 2758 bytes
241 files changed, 142717 insertions, 0 deletions
diff --git a/sfx2/inc/about.hxx b/sfx2/inc/about.hxx
new file mode 100644
index 000000000000..5f2076b5e776
--- /dev/null
+++ b/sfx2/inc/about.hxx
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: about.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _ABOUT_HXX
+#define _ABOUT_HXX
+
+// include ---------------------------------------------------------------
+
+#ifndef _RESARY_HXX //autogen
+#include <vcl/resary.hxx>
+#endif
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _ACCEL_HXX //autogen
+#include <vcl/accel.hxx>
+#endif
+#ifndef _LIST_HXX //autogen
+#include <tools/list.hxx>
+#endif
+#ifndef _STDCTRL_HXX //autogen
+#include <svtools/stdctrl.hxx>
+#endif
+#include "basedlgs.hxx" // SfxModalDialog
+
+DECLARE_LIST( AccelList, Accelerator* )
+
+// class AboutDialog -----------------------------------------------------
+
+class AboutDialog : public SfxModalDialog
+{
+private:
+ OKButton aOKButton;
+ Image aAppLogo;
+
+ FixedInfo aVersionText;
+ FixedInfo aCopyrightText;
+
+ ResStringArray aDeveloperAry;
+ String aDevVersionStr;
+ String aAccelStr;
+
+ AccelList aAccelList;
+
+ AutoTimer aTimer;
+ long nOff;
+ long nEnd;
+
+ BOOL bNormal;
+
+protected:
+ virtual BOOL Close();
+ virtual void Paint( const Rectangle& );
+
+public:
+ AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr );
+ ~AboutDialog();
+
+ DECL_LINK( TimerHdl, Timer * );
+ DECL_LINK( AccelSelectHdl, Accelerator * );
+};
+
+#endif // #ifndef _ABOUT_HXX
+
+
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
new file mode 100644
index 000000000000..b240d8ec734a
--- /dev/null
+++ b/sfx2/inc/arrdecl.hxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: arrdecl.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_ARRDECL_HXX
+#define _SFX_ARRDECL_HXX
+
+#include <tools/list.hxx>
+
+#ifndef _SVARRAY_HXX
+#include <svtools/svarray.hxx>
+#endif
+#include "minarray.hxx"
+
+struct CntUpdateResult;
+
+SV_DECL_PTRARR_DEL(CntUpdateResults_Impl, CntUpdateResult*, 4, 4);
+
+class SfxObjectShell;
+SV_DECL_PTRARR( SfxObjectShellArr_Impl, SfxObjectShell*, 4, 4 );
+
+class SfxViewFrame;
+SV_DECL_PTRARR( SfxViewFrameArr_Impl, SfxViewFrame*, 4, 4 );
+
+class SfxViewShell;
+SV_DECL_PTRARR( SfxViewShellArr_Impl, SfxViewShell*, 4, 4 );
+
+class SfxObjectFactory;
+SV_DECL_PTRARR( SfxObjectFactoryArr_Impl, SfxObjectFactory*, 3, 3 );
+
+struct SfxTbxCtrlFactory;
+SV_DECL_PTRARR_DEL( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory*, 8, 4 );
+
+struct SfxStbCtrlFactory;
+SV_DECL_PTRARR_DEL( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory*, 8, 4 );
+
+struct SfxMenuCtrlFactory;
+SV_DECL_PTRARR_DEL( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory*, 2, 2 );
+
+struct SfxChildWinFactory;
+SV_DECL_PTRARR_DEL( SfxChildWinFactArr_Impl, SfxChildWinFactory*, 2, 2 );
+
+class SfxModule;
+SV_DECL_PTRARR( SfxModuleArr_Impl, SfxModule*, 2, 2 );
+
+class AsynchronLink;
+SV_DECL_PTRARR_DEL( AsynchronLinkArr_Impl, AsynchronLink*, 2, 2 );
+
+class SfxFilter;
+DECL_PTRARRAY( SfxFilterArr_Impl, SfxFilter*, 4, 4 );
+
+class SfxFrame;
+typedef SfxFrame* SfxFramePtr;
+SV_DECL_PTRARR( SfxFrameArr_Impl, SfxFramePtr, 4, 4 );
+
+DECLARE_LIST( SfxFilterList_Impl, SfxFilter* );
+
+struct SfxExternalLib_Impl;
+typedef SfxExternalLib_Impl* SfxExternalLibPtr;
+SV_DECL_PTRARR_DEL( SfxExternalLibArr_Impl, SfxExternalLibPtr, 2, 2 );
+
+//class XEventListenerRef;
+//typedef XEventListenerRef* XEventListenerPtr;
+//SV_DECL_PTRARR_DEL( XEventListenerArr_Impl, XEventListenerPtr, 4, 4 );
+
+//class XFrameRef;
+//typedef XFrameRef* XFramePtr;
+//SV_DECL_PTRARR_DEL( XFrameArr_Impl, XFramePtr, 4, 4 );
+
+class SfxSlot;
+typedef SfxSlot* SfxSlotPtr;
+SV_DECL_PTRARR( SfxSlotArr_Impl, SfxSlotPtr, 20, 20 );
+
+#endif
diff --git a/sfx2/inc/basmgr.hxx b/sfx2/inc/basmgr.hxx
new file mode 100644
index 000000000000..495608c0f0bb
--- /dev/null
+++ b/sfx2/inc/basmgr.hxx
@@ -0,0 +1,170 @@
+/*************************************************************************
+ *
+ * $RCSfile: basmgr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFX_BASMGR_HXX
+#define _SFX_BASMGR_HXX
+
+#ifndef _BASMGR_HXX_
+#include <basic/basmgr.hxx>
+#endif
+
+class SfxBasicManager : public BasicManager
+{
+private:
+ BasicLibs* pLibs;
+ BasicErrorManager* pErrorMgr;
+
+ String aName;
+ String aStorageName;
+ BOOL bBasMgrModified;
+
+ void Init();
+
+protected:
+ BOOL ImpStoreLibary( StarBASIC* pLib, SvStorage& rStorage ) const;
+ BOOL ImpLoadLibary( BasicLibInfo* pLibInfo ) const;
+ BOOL ImpLoadLibary( BasicLibInfo* pLibInfo, SvStorage* pCurStorage, BOOL bInfosOnly = FALSE ) const;
+ void ImpCreateStdLib( StarBASIC* pParentFromStdLib );
+ void ImpMgrNotLoaded( const String& rStorageName );
+ BasicLibInfo* CreateLibInfo();
+ void LoadBasicManager( SvStorage& rStorage, BOOL bLoadBasics = TRUE );
+ void LoadOldBasicManager( SvStorage& rStorage );
+ BOOL ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const;
+ void ImplGetPassword( USHORT nLib ) const;
+ BOOL ImplEncryptStream( SvStream& rStream ) const;
+ BasicLibInfo* FindLibInfo( StarBASIC* pBasic ) const;
+ void CheckModules( StarBASIC* pBasic, BOOL bReference ) const;
+ void SetFlagToAllLibs( short nFlag, BOOL bSet ) const;
+ SfxBasicManager(); // Nur zum anpassen von Pfaden bei 'Speichern unter'.
+
+public:
+ TYPEINFO();
+ SfxBasicManager( SvStorage& rStorage, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL );
+ SfxBasicManager( StarBASIC* pStdLib, String* pLibPath = NULL );
+ ~SfxBasicManager();
+
+ void SetStorageName( const String& rName ) { aStorageName = rName; }
+ String GetStorageName() const { return aStorageName; }
+ void SetName( const String& rName ) { aName = rName; }
+ String GetName() const { return aName; }
+
+
+ static BOOL HasBasicManager( const SvStorage& rStorage );
+ static BOOL CopyBasicData( SvStorage* pFrom, const String& rSourceURL, SvStorage* pTo);
+ void Merge( SvStorage& rFromStorage );
+
+ USHORT GetLibCount() const;
+ StarBASIC* GetStdLib() const;
+ StarBASIC* GetLib( USHORT nLib ) const;
+ StarBASIC* GetLib( const String& rName ) const;
+ USHORT GetLibId( const String& rName ) const;
+ USHORT GetLibId( StarBASIC* pLib ) const;
+ BOOL HasLib( const String& rName ) const;
+
+ void Store( SvStorage& rStorage );
+ void Store( SvStorage& rStorage, BOOL bStoreLibs );
+
+ BOOL SetLibName( USHORT nLib, const String& rName );
+ String GetLibName( USHORT nLib );
+
+ BOOL SetLibStorageName( USHORT nLib, const String& rName );
+ String GetLibStorageName( USHORT nLib );
+ String GetRelLibStorageName( USHORT nLib );
+
+ BOOL IsLibLoaded( USHORT nLib ) const;
+ BOOL LoadLib( USHORT nLib );
+ BOOL UnloadLib( USHORT nLib );
+ BOOL StoreLib( USHORT nLib ) const;
+ BOOL RemoveLib( USHORT nLib );
+ BOOL RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage );
+
+ BOOL IsReference( USHORT nLib );
+ BOOL IsExtern( USHORT nLib );
+
+ StarBASIC* CreateLib( const String& rLibName );
+ StarBASIC* AddLib( SvStorage& rStorage, const String& rLibName, BOOL bReference );
+ void AddLib( StarBASIC* pLib );
+ BOOL MoveLib( USHORT nLib, USHORT nNewPos );
+
+ BOOL HasPassword( USHORT nLib ) const;
+ String GetPassword( USHORT nLib ) const;
+ void SetPassword( USHORT nLib, const String& rNewPassword );
+
+ // Der BasicManager gibt die Basics auch raus, wenn das Passwort nicht
+ // geprueft wurde, da man auch ohne Passwort mit der Lib arbeiten kann.
+ // Es ist Sache der App, was Sie dem Anwender ohne Passwort nicht gestattet,
+ // also z.B. das Betrachten der Source oder das Anzeigen/Loeschen von Modulen.
+ BOOL IsPasswordVerified( USHORT nLib ) const;
+ void SetPasswordVerified( USHORT nLib );
+
+
+ // Modify-Flag wird nur beim Speichern zurueckgesetzt.
+ BOOL IsModified() const;
+ BOOL IsBasicModified() const;
+ BOOL IsManagerModified() const { return bBasMgrModified; }
+
+ BOOL HasErrors();
+ void ClearErrors();
+ BasicError* GetFirstError();
+ BasicError* GetNextError();
+};
+
+#endif //_SFX_BASMGR_HXX
diff --git a/sfx2/inc/bitset.hxx b/sfx2/inc/bitset.hxx
new file mode 100644
index 000000000000..90e60ee8d87a
--- /dev/null
+++ b/sfx2/inc/bitset.hxx
@@ -0,0 +1,293 @@
+/*************************************************************************
+ *
+ * $RCSfile: bitset.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXBITSET_HXX
+#define _SFXBITSET_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+class Range;
+
+class BitSet
+{
+private:
+ void CopyFrom( const BitSet& rSet );
+ USHORT nBlocks;
+ USHORT nCount;
+ ULONG* pBitmap;
+public:
+ BitSet operator<<( USHORT nOffset ) const;
+ BitSet operator>>( USHORT nOffset ) const;
+ static USHORT CountBits( ULONG nBits );
+ BOOL operator!() const;
+ BitSet();
+ BitSet( const BitSet& rOrig );
+ BitSet( USHORT* pArray, USHORT nSize );
+ ~BitSet();
+ BitSet( const Range& rRange );
+ USHORT Count() const;
+ BitSet& operator=( const BitSet& rOrig );
+ BitSet& operator=( USHORT nBit );
+ BitSet operator|( const BitSet& rSet ) const;
+ BitSet operator|( USHORT nBit ) const;
+ BitSet& operator|=( const BitSet& rSet );
+ BitSet& operator|=( USHORT nBit );
+ BitSet operator-( const BitSet& rSet ) const;
+ BitSet operator-( USHORT nId ) const;
+ BitSet& operator-=( const BitSet& rSet );
+ BitSet& operator-=( USHORT nBit );
+ BitSet operator&( const BitSet& rSet ) const;
+ BitSet& operator&=( const BitSet& rSet );
+ BitSet operator^( const BitSet& rSet ) const;
+ BitSet operator^( USHORT nBit ) const;
+ BitSet& operator^=( const BitSet& rSet );
+ BitSet& operator^=( USHORT nBit );
+ BOOL IsRealSubSet( const BitSet& rSet ) const;
+ BOOL IsSubSet( const BitSet& rSet ) const;
+ BOOL IsRealSuperSet( const BitSet& rSet ) const;
+ BOOL Contains( USHORT nBit ) const;
+ BOOL IsSuperSet( const BitSet& rSet ) const;
+ BOOL operator==( const BitSet& rSet ) const;
+ BOOL operator==( USHORT nBit ) const;
+ BOOL operator!=( const BitSet& rSet ) const;
+ BOOL operator!=( USHORT nBit ) const;
+
+};
+//--------------------------------------------------------------------
+
+// returns TRUE if the set is empty
+
+
+
+inline BOOL BitSet::operator!() const
+{
+ return nCount == 0;
+}
+//--------------------------------------------------------------------
+
+// returns the number of bits in the bitset
+
+inline USHORT BitSet::Count() const
+{
+ return nCount;
+}
+//--------------------------------------------------------------------
+
+// creates the union of two bitset
+
+inline BitSet BitSet::operator|( const BitSet& rSet ) const
+{
+ return BitSet(*this) |= rSet;
+}
+//--------------------------------------------------------------------
+
+// creates the union of a bitset with a single bit
+
+inline BitSet BitSet::operator|( USHORT nBit ) const
+{
+ return BitSet(*this) |= nBit;
+}
+//--------------------------------------------------------------------
+
+// creates the asymetric difference
+
+inline BitSet BitSet::operator-( const BitSet& rSet ) const
+{
+ return BitSet();
+}
+//--------------------------------------------------------------------
+
+// creates the asymetric difference with a single bit
+
+
+inline BitSet BitSet::operator-( USHORT nId ) const
+{
+ return BitSet();
+}
+//--------------------------------------------------------------------
+
+// removes the bits contained in rSet
+
+inline BitSet& BitSet::operator-=( const BitSet& rSet )
+{
+ return *this;
+}
+//--------------------------------------------------------------------
+
+
+// creates the intersection with another bitset
+
+inline BitSet BitSet::operator&( const BitSet& rSet ) const
+{
+ return BitSet();
+}
+//--------------------------------------------------------------------
+
+// intersects with another bitset
+
+inline BitSet& BitSet::operator&=( const BitSet& rSet )
+{
+ return *this;
+}
+//--------------------------------------------------------------------
+
+// creates the symetric difference with another bitset
+
+inline BitSet BitSet::operator^( const BitSet& rSet ) const
+{
+ return BitSet();
+}
+//--------------------------------------------------------------------
+
+// creates the symetric difference with a single bit
+
+inline BitSet BitSet::operator^( USHORT nBit ) const
+{
+ return BitSet();
+}
+//--------------------------------------------------------------------
+
+// builds the symetric difference with another bitset
+
+inline BitSet& BitSet::operator^=( const BitSet& rSet )
+{
+ return *this;
+}
+//--------------------------------------------------------------------
+#ifdef BITSET_READY
+// builds the symetric difference with a single bit
+
+inline BitSet& BitSet::operator^=( USHORT nBit )
+{
+ // crash!!!
+ return BitSet();
+}
+#endif
+//--------------------------------------------------------------------
+
+// determines if the other bitset is a real superset
+
+inline BOOL BitSet::IsRealSubSet( const BitSet& rSet ) const
+{
+ return FALSE;
+}
+//--------------------------------------------------------------------
+
+// detsermines if the other bitset is a superset or equal
+
+inline BOOL BitSet::IsSubSet( const BitSet& rSet ) const
+{
+ return FALSE;
+}
+//--------------------------------------------------------------------
+
+// determines if the other bitset is a real subset
+
+inline BOOL BitSet::IsRealSuperSet( const BitSet& rSet ) const
+{
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+// determines if the other bitset is a subset or equal
+
+inline BOOL BitSet::IsSuperSet( const BitSet& rSet ) const
+{
+ return FALSE;
+}
+//--------------------------------------------------------------------
+
+// determines if the bit is the only one in the bitset
+
+inline BOOL BitSet::operator==( USHORT nBit ) const
+{
+ return FALSE;
+}
+//--------------------------------------------------------------------
+
+// determines if the bitsets aren't equal
+
+inline BOOL BitSet::operator!=( const BitSet& rSet ) const
+{
+ return !( *this == rSet );
+}
+//--------------------------------------------------------------------
+
+// determines if the bitset doesn't contain only this bit
+
+inline BOOL BitSet::operator!=( USHORT nBit ) const
+{
+ return !( *this == nBit );
+}
+//--------------------------------------------------------------------
+
+class IndexBitSet : BitSet
+{
+public:
+ USHORT GetFreeIndex();
+ void ReleaseIndex(USHORT i){*this-=i;}
+};
+
+
+#endif
+
diff --git a/sfx2/inc/configmgr.hxx b/sfx2/inc/configmgr.hxx
new file mode 100644
index 000000000000..fa1f38ee5f5f
--- /dev/null
+++ b/sfx2/inc/configmgr.hxx
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * $RCSfile: configmgr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFX_CONFIGMGR_HXX_
+#define _SFX_CONFIGMGR_HXX_
+
+namespace utl{
+ class ConfigManager;
+}
+
+/* -----------------------------05.09.00 16:42--------------------------------
+ appdata.cxx
+ ---------------------------------------------------------------------------*/
+utl::ConfigManager* GetUtlConfigManager();
+#endif
diff --git a/sfx2/inc/dinfedt.hxx b/sfx2/inc/dinfedt.hxx
new file mode 100644
index 000000000000..514462f5a681
--- /dev/null
+++ b/sfx2/inc/dinfedt.hxx
@@ -0,0 +1,120 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfedt.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_DINFEDT_HXX
+#define _SFX_DINFEDT_HXX
+
+// include ---------------------------------------------------------------
+
+#ifndef _SV_EDIT_HXX //autogen wg. Edit
+#include <vcl/edit.hxx>
+#endif
+#ifndef _SV_DIALOG_HXX //autogen wg. ModalDialog
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _SV_GROUP_HXX //autogen wg. GroupBox
+#include <vcl/group.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX //autogen wg. OKButton
+#include <vcl/button.hxx>
+#endif
+
+// class InfoEdit_Impl ---------------------------------------------------
+
+class InfoEdit_Impl : public Edit
+{
+public:
+ InfoEdit_Impl( Window* pParent, const ResId& rResId ) :
+ Edit( pParent, rResId ) {}
+
+ virtual void KeyInput( const KeyEvent& rKEvent );
+};
+
+// class SfxDocInfoEditDlg -----------------------------------------------
+
+class SfxDocInfoEditDlg : public ModalDialog
+{
+private:
+ InfoEdit_Impl aInfo1ED;
+ InfoEdit_Impl aInfo2ED;
+ InfoEdit_Impl aInfo3ED;
+ InfoEdit_Impl aInfo4ED;
+ GroupBox aInfoGB;
+ OKButton aOkBT;
+ CancelButton aCancelBT;
+ HelpButton aHelpBtn;
+
+public:
+ SfxDocInfoEditDlg( Window* pParent );
+
+ void SetText1( const String &rStr) { aInfo1ED.SetText( rStr ); }
+ void SetText2( const String &rStr) { aInfo2ED.SetText( rStr ); }
+ void SetText3( const String &rStr) { aInfo3ED.SetText( rStr ); }
+ void SetText4( const String &rStr) { aInfo4ED.SetText( rStr ); }
+
+ String GetText1() const { return aInfo1ED.GetText(); }
+ String GetText2() const { return aInfo2ED.GetText(); }
+ String GetText3() const { return aInfo3ED.GetText(); }
+ String GetText4() const { return aInfo4ED.GetText(); }
+};
+
+
+#endif
+
diff --git a/sfx2/inc/docvor.hxx b/sfx2/inc/docvor.hxx
new file mode 100644
index 000000000000..2334628397cd
--- /dev/null
+++ b/sfx2/inc/docvor.hxx
@@ -0,0 +1,183 @@
+/*************************************************************************
+ *
+ * $RCSfile: docvor.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:22 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXDOCVOR_HXX
+#define _SFXDOCVOR_HXX
+
+
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _SVTREEBOX_HXX //autogen
+#include <svtools/svtreebx.hxx>
+#endif
+
+#include "objsh.hxx"
+#include "orgmgr.hxx"
+
+//=========================================================================
+
+class SfxDocumentTemplates;
+class Path;
+
+//=========================================================================
+#ifndef _SFX_HXX
+
+class SfxOrganizeDlg_Impl;
+
+class SfxOrganizeListBox_Impl: public SvTreeListBox
+{
+friend class SfxOrganizeDlg_Impl;
+
+ SfxOrganizeMgr *pMgr;
+ Image aOpenedFolderBmp;
+ Image aClosedFolderBmp;
+ Image aOpenedDocBmp;
+ Image aClosedDocBmp;
+ SfxOrganizeDlg_Impl *pDlg;
+ static BOOL bDropMoveOk;
+
+protected:
+ virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection & );
+ virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const String& rNewText );
+ virtual BOOL NotifyQueryDrop(SvLBoxEntry *);
+ virtual BOOL NotifyMoving(SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent, ULONG &);
+ virtual BOOL NotifyCopying(SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent, ULONG &);
+ virtual void RequestingChilds( SvLBoxEntry* pParent );
+ virtual long ExpandingHdl();
+#if SUPD < 306
+ virtual BOOL Drop( const DropEvent& rEvt );
+ virtual BOOL QueryDrop( const DropEvent& rEvt );
+#else
+ virtual BOOL Drop( DropEvent& rEvt );
+ virtual BOOL QueryDrop( DropEvent& rEvt );
+#endif
+ virtual DragDropMode NotifyBeginDrag(SvLBoxEntry *);
+ virtual BOOL Select( SvLBoxEntry* pEntry, BOOL bSelect=TRUE );
+ virtual void Command( const CommandEvent& rCEvt );
+
+public:
+ enum DataEnum {
+ VIEW_TEMPLATES,
+ VIEW_FILES
+ } eViewType;
+ SfxOrganizeListBox_Impl(SfxOrganizeDlg_Impl *pDlg,
+ Window *pParent, WinBits, DataEnum);
+
+ DataEnum GetViewType() const { return eViewType; }
+ void SetViewType(DataEnum eType) { eViewType = eType; }
+
+ void SetMgr(SfxOrganizeMgr *pM) { pMgr = pM; }
+ void Reset();
+ void SetBitmaps(const Image &rOFolderBitmap,
+ const Image &rCFolderBitmap,
+ const Image &rODocBitmap,
+ const Image &rCDocBitmap) {
+ aOpenedFolderBmp = rOFolderBitmap;
+ aClosedFolderBmp = rCFolderBitmap;
+ aOpenedDocBmp = rODocBitmap;
+ aClosedDocBmp = rCDocBitmap;
+ }
+ const Image &GetClosedBmp(USHORT nLevel) const;
+ const Image &GetOpenedBmp(USHORT nLevel) const;
+
+private:
+ BOOL IsStandard_Impl( SvLBoxEntry *) const;
+ BOOL MoveOrCopyTemplates(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy);
+ BOOL MoveOrCopyContents(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy);
+ inline USHORT GetDocLevel() const;
+ SfxObjectShellRef GetObjectShell(const Path &);
+ BOOL IsUniqName_Impl(const String &rText, SvLBoxEntry* pParent, SvLBoxEntry *pEntry = 0) const;
+ USHORT GetLevelCount_Impl(SvLBoxEntry* pParent) const;
+};
+
+#endif
+//=========================================================================
+
+class SfxTemplateOrganizeDlg : public ModalDialog
+{
+friend class SfxOrganizeListBox_Impl;
+
+ class SfxOrganizeDlg_Impl *pImp;
+
+public:
+ SfxTemplateOrganizeDlg(Window * pParent, SfxDocumentTemplates* = 0);
+ ~SfxTemplateOrganizeDlg();
+
+#define RET_EDIT_STYLE 100
+
+ virtual short Execute();
+};
+
+#endif
diff --git a/sfx2/inc/frmload.hxx b/sfx2/inc/frmload.hxx
new file mode 100644
index 000000000000..d65b5909707a
--- /dev/null
+++ b/sfx2/inc/frmload.hxx
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: frmload.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFX_FRMLOAD_HXX
+#define _SFX_FRMLOAD_HXX
+
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HDL_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XFRAMELOADER_HPP_
+#include <com/sun/star/frame/XFrameLoader.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XEXTENDEDFILTERDETECTION_HPP_
+#include <com/sun/star/frame/XExtendedFilterDetection.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_EXCEPTION_HPP_
+#include <com/sun/star/uno/Exception.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE3_HXX_
+#include <cppuhelper/implbase3.hxx>
+#endif
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <cppuhelper/factory.hxx>
+#include <tools/link.hxx>
+#include <tools/string.hxx>
+
+class SfxObjectFactory;
+class SfxFilterMatcher;
+class LoadEnvironment_Impl;
+namespace com
+{
+ namespace sun
+ {
+ namespace star
+ {
+ namespace uno
+ {
+ class Any;
+ }
+ namespace lang
+ {
+ class XMultiServiceFactory;
+ }
+ namespace frame
+ {
+ class XFrame;
+ }
+ namespace beans
+ {
+ struct PropertyValue;
+ }
+ }
+ }
+}
+
+#include "sfxuno.hxx"
+
+#define REFERENCE ::com::sun::star::uno::Reference
+#define SEQUENCE ::com::sun::star::uno::Sequence
+#define RUNTIME_EXCEPTION ::com::sun::star::uno::RuntimeException
+
+class SfxFilterDetect_Impl : public ::cppu::WeakImplHelper3< ::com::sun::star::frame::XExtendedFilterDetection,
+ ::com::sun::star::lang::XInitialization, ::com::sun::star::lang::XServiceInfo >
+{
+ String aFilterName;
+public:
+ SFX_DECL_XSERVICEINFO
+ SfxFilterDetect_Impl( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ virtual ::rtl::OUString SAL_CALL detect( const ::rtl::OUString& sURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgumentlist ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+};
+
+class SfxFrameLoader : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XFrameLoader, ::com::sun::star::lang::XInitialization >
+{
+ REFERENCE < ::com::sun::star::frame::XFrame > xFrame;
+ REFERENCE < ::com::sun::star::frame::XLoadEventListener > xListener;
+ LoadEnvironment_Impl* pLoader;
+ SfxFilterMatcher* pMatcher;
+ String aFilterName;
+
+ DECL_LINK( LoadDone_Impl, void* );
+
+public:
+ SfxFrameLoader( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+ virtual ~SfxFrameLoader();
+
+ void SetFilterName( const ::rtl::OUString& rFilterName )
+ { aFilterName = rFilterName; }
+ String GetFilterName() const
+ { return aFilterName; }
+
+ // XLoader
+ virtual void SAL_CALL load( const REFERENCE < ::com::sun::star::frame::XFrame >& aFrame,
+ const ::rtl::OUString& aURL,
+ const SEQUENCE < ::com::sun::star::beans::PropertyValue >& aArgs,
+ const REFERENCE < ::com::sun::star::frame::XLoadEventListener >& aListener) throw( RUNTIME_EXCEPTION );
+ virtual void SAL_CALL cancel() throw( RUNTIME_EXCEPTION );
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
+ throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+protected:
+ virtual SfxObjectFactory& GetFactory()=0;
+};
+
+class SfxFrameLoader_Impl : public SfxFrameLoader, public ::com::sun::star::lang::XServiceInfo
+{
+public:
+ SFX_DECL_XINTERFACE
+ SFX_DECL_XSERVICEINFO
+ SfxFrameLoader_Impl( const REFERENCE < ::com::sun::star::lang::XMultiServiceFactory >& xFactory );
+protected:
+ virtual SfxObjectFactory& GetFactory();
+};
+
+class SfxFrameLoaderFactory : public ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XSingleServiceFactory >
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
+ ::rtl::OUString aImplementationName;
+ ::cppu::ComponentInstantiation pCreateFunction;
+
+public:
+ SfxFrameLoaderFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rServiceManager,
+ ::cppu::ComponentInstantiation pCreateFunction_, const ::rtl::OUString& rImplementationName_ )
+ : xSMgr( rServiceManager )
+ , aImplementationName( rImplementationName_ )
+ , pCreateFunction( pCreateFunction_ )
+ {}
+
+ // XSingleServiceFactory
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance(void)
+ throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>& Arguments)
+ throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
+ sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException);
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw(::com::sun::star::uno::RuntimeException);
+};
+
+#endif
diff --git a/sfx2/inc/idpool.hxx b/sfx2/inc/idpool.hxx
new file mode 100644
index 000000000000..b24db8ed9436
--- /dev/null
+++ b/sfx2/inc/idpool.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: idpool.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXIDPOOL_HXX
+#define _SFXIDPOOL_HXX
+
+#include <limits.h> // USHRT_MAX
+#include "bitset.hxx"
+
+// class IdPool ----------------------------------------------------------
+
+class IdPool: private BitSet
+{
+private:
+ USHORT nNextFree;
+ USHORT nRange;
+ USHORT nOffset;
+public:
+ BOOL Lock( const BitSet& rLockSet );
+ BOOL IsLocked( USHORT nId ) const;
+ IdPool( USHORT nMin = 1, USHORT nMax = USHRT_MAX );
+ USHORT Get();
+ BOOL Put( USHORT nId );
+ BOOL Lock( const Range& rRange );
+ BOOL Lock( USHORT nId );
+
+};
+
+//------------------------------------------------------------------------
+
+// returns TRUE if the id is locked
+
+inline BOOL IdPool::IsLocked( USHORT nId ) const
+{
+ return ( this->Contains(nId-nOffset) );
+}
+
+
+#endif
+
diff --git a/sfx2/inc/imgmgr.hxx b/sfx2/inc/imgmgr.hxx
new file mode 100644
index 000000000000..fddeb020b2ce
--- /dev/null
+++ b/sfx2/inc/imgmgr.hxx
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: imgmgr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXIMGMGR_HXX
+#define _SFXIMGMGR_HXX
+
+#include "cfgitem.hxx"
+
+#include <imgdef.hxx>
+
+
+#ifndef _GEN_HXX //autogen
+#include <tools/gen.hxx>
+#endif
+#ifndef _IMAGE_HXX //autogen
+#include <vcl/image.hxx>
+#endif
+
+class ToolBox;
+
+class SfxModule;
+class SfxToolBoxManager;
+class SfxBitmapList_Impl;
+class SfxToolBoxArr_Impl;
+
+class SfxImageManager: public SfxConfigItem
+{
+ SfxBitmapList_Impl* pUserDefList;
+ ImageList* pImageList;
+ ImageList* pUserImageList;
+ ImageList* pOffImageList;
+ SfxSymbolSet eSymbolSet;
+ BOOL bImageDefault;
+ SfxToolBoxArr_Impl* pToolBoxList;
+ USHORT nOutStyle;
+
+protected:
+
+ virtual int Load(SvStream&);
+ virtual BOOL Store(SvStream&);
+ virtual void UseDefault();
+ virtual String GetName() const;
+
+#if __PRIVATE
+ void MakeDefaultImageList_Impl();
+ void MakeLists_Impl( SfxSymbolSet );
+#endif
+
+public:
+ SfxImageManager();
+ ~SfxImageManager();
+
+ // Allgemeine Properties
+ void SetSymbolSet(SfxSymbolSet);
+ void SetOutStyle(USHORT);
+
+ SfxSymbolSet GetSymbolSet() const
+ { return eSymbolSet; }
+ USHORT GetOutStyle() const
+ { return nOutStyle; }
+ Size GetImageSize() const
+ {return pImageList->GetImageSize(); }
+ Color GetMaskColor() const;
+
+ // Image(s) aus einem Modul oder der OFA-Liste
+ Image GetImage(USHORT nId, SfxModule* pMod = 0) const;
+ void SetImages( ToolBox& rToolBox, SfxModule* );
+ void LockImage(USHORT nNewId, ToolBox *pBox);
+
+ // Zugriff auf die Userdef-Liste
+ void ReplaceImage(USHORT nId, Bitmap* pBmp=0);
+ void AddImage(USHORT nId, const Image& rImage);
+
+ // Umkonfigurieren
+ void StartCustomize();
+ void EndCustomize();
+ Image SeekImage(USHORT nId, SfxModule* pModule = 0) const;
+
+ // Toolbox-Registrierung/Abmeldung
+ void RegisterToolBox(ToolBox*, USHORT nFlags=0xFFFF );
+ void RegisterToolBox(ToolBox*, SfxModule*, USHORT nFlags=0xFFFF );
+ void ReleaseToolBox(ToolBox*);
+ void RegisterToolBoxManager(SfxToolBoxManager*, USHORT nFlags=0xFFFF );
+ void ReleaseToolBoxManager(SfxToolBoxManager*);
+
+#if __PRIVATE
+ void ExchangeItemImage_Impl(USHORT nId, const Image& rImage);
+ BOOL IsUserDef_Impl(USHORT nId) const;
+ const Bitmap& GetUserDefBitmap_Impl(USHORT nId) const;
+ Image GetAndLockImage_Impl(USHORT nId, SfxModule* pMod = 0);
+ Image GetImageFromModule_Impl( USHORT nId, SfxModule *pMod );
+#endif
+
+};
+
+#define SFX_IMAGEMANAGER() SfxGetpApp()->GetImageManager()
+
+#endif
diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx
new file mode 100644
index 000000000000..446912b8c831
--- /dev/null
+++ b/sfx2/inc/inettbc.hxx
@@ -0,0 +1,163 @@
+/*************************************************************************
+ *
+ * $RCSfile: inettbc.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFX_INETTBC_HXX
+#define _SFX_INETTBC_HXX
+
+// includes *****************************************************************
+#include <tools/string.hxx>
+#include <tools/urlobj.hxx>
+
+#ifndef _COMBOBOX_HXX //autogen
+#include <vcl/combobox.hxx>
+#endif
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+struct SfxPickEntry_Impl;
+class SfxURLBox : public ComboBox
+{
+friend class SfxMatchContext_Impl;
+friend class SfxURLBox_Impl;
+ Link aOpenHdl;
+ String aBaseURL;
+ INetProtocol eSmartProtocol;
+ SfxMatchContext_Impl* pCtx;
+ SfxURLBox_Impl* pImp;
+ BOOL bAutoCompleteMode;
+ BOOL bOnlyDirectories;
+ BOOL bModified;
+ BOOL bTryAutoComplete: 1,
+ bCtrlClick: 1;
+
+ BOOL ProcessKey( const KeyCode& rCode );
+ void TryAutoComplete( BOOL bForward, BOOL bForce );
+ void UpdatePicklistForSmartProtocol_Impl();
+ DECL_LINK( AutoCompleteHdl_Impl, void* );
+
+protected:
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void Select();
+ virtual void Modify();
+ virtual BOOL QueryDrop( DropEvent &rEvt );
+ virtual BOOL Drop( const DropEvent &rEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+
+public:
+ SfxURLBox( Window* pParent, INetProtocol eSmart = INET_PROT_NOT_VALID );
+
+ void OpenURL( SfxPickEntry_Impl* pEntry, const String& rName, BOOL nMod ) const;
+ void SetBaseURL( const String& rURL ) { aBaseURL = rURL; }
+ const String& GetBaseURL() const { return aBaseURL; }
+ void SetOpenHdl( const Link& rLink ) { aOpenHdl = rLink; }
+ const Link& GetOpenHdl() const { return aOpenHdl; }
+ void SetOnlyDirectories( BOOL bDir = TRUE );
+ INetProtocol GetSmartProtocol() const { return eSmartProtocol; }
+ void SetSmartProtocol( INetProtocol eProt );
+ BOOL IsCtrlOpen()
+ { return bCtrlClick; }
+};
+
+#if __PRIVATE
+
+#include "tbxctrl.hxx"
+class SfxURLToolBoxControl_Impl : public SfxToolBoxControl
+{
+private:
+ SfxStatusForwarder aURLForwarder;
+ SfxURLBox* GetURLBox() const;
+ DECL_LINK( OpenHdl, void* );
+ DECL_LINK( SelectHdl, void* );
+public:
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SfxURLToolBoxControl_Impl( USHORT nId,
+ ToolBox& rBox,
+ SfxBindings& rBindings );
+
+ virtual Window* CreateItemWindow( Window* pParent );
+ virtual void StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+class SfxCancelToolBoxControl_Impl : public SfxToolBoxControl
+{
+public:
+
+ SFX_DECL_TOOLBOX_CONTROL();
+
+ SfxCancelToolBoxControl_Impl(
+ USHORT nId,
+ ToolBox& rBox,
+ SfxBindings& rBindings );
+
+ virtual SfxPopupWindowType GetPopupWindowType() const;
+ virtual SfxPopupWindow* CreatePopupWindow();
+ virtual void StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+#endif
+
+#endif
+
diff --git a/sfx2/inc/mieclip.hxx b/sfx2/inc/mieclip.hxx
new file mode 100644
index 000000000000..435dc0fc1526
--- /dev/null
+++ b/sfx2/inc/mieclip.hxx
@@ -0,0 +1,130 @@
+/*************************************************************************
+ *
+ * $RCSfile: mieclip.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MIECLIP_HXX
+#define _MIECLIP_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+class SvStream;
+class SotDataObject;
+class SvData;
+
+class MSE40HTMLClipFormatObj
+{
+ SvStream* pStrm;
+ String sBaseURL;
+
+public:
+ MSE40HTMLClipFormatObj() : pStrm(0) {}
+ ~MSE40HTMLClipFormatObj();
+
+ BOOL GetData( SotDataObject& );
+ BOOL GetData( SvData& );
+
+ const SvStream* GetStream() const { return pStrm; }
+ SvStream* GetStream() { return pStrm; }
+ const String& GetBaseURL() const { return sBaseURL; }
+};
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+/*
+ $Log: not supported by cvs2svn $
+ Revision 1.8 2000/09/17 16:47:07 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.7 2000/09/06 14:49:36 willem.vandorp
+ Header and footer replaced.
+
+ Revision 1.6 1999/12/16 19:32:37 er
+ #60614# add: GetData with SvData
+
+ Revision 1.5 1999/07/23 08:34:06 hr
+ #65293#: misplaced comment
+
+ Revision 1.4 1999/01/18 13:35:50 JP
+ Task #59398#: unnoetiges RegisterClipb... gegen IDS ausgetauscht
+
+
+ Rev 1.3 18 Jan 1999 14:35:50 JP
+ Task #59398#: unnoetiges RegisterClipb... gegen IDS ausgetauscht
+
+ Rev 1.2 22 Jun 1998 21:20:36 JP
+ SvDataObject gegen SorDataObject ausgetauscht
+
+ Rev 1.1 23 Feb 1998 17:05:14 TJ
+ include
+
+ Rev 1.0 18 Feb 1998 17:28:26 OK
+ NEW: MSE40HTMLClipFormatObj
+
+*/
+
+#endif //_MIECLIP_HXX
+
diff --git a/sfx2/inc/minfitem.hxx b/sfx2/inc/minfitem.hxx
new file mode 100644
index 000000000000..36c52eee0353
--- /dev/null
+++ b/sfx2/inc/minfitem.hxx
@@ -0,0 +1,115 @@
+/*************************************************************************
+ *
+ * $RCSfile: minfitem.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_MINFITEM_HXX
+#define _SFX_MINFITEM_HXX
+
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _SFXPOOLITEM_HXX //autogen
+#include <svtools/poolitem.hxx>
+#endif
+class BasicManager;
+
+class SfxMacroInfoItem: public SfxPoolItem
+{
+ const BasicManager* pBasicManager;
+ String aLibName;
+ String aModuleName;
+ String aMethodName;
+ String aCommentText;
+
+public:
+ TYPEINFO();
+ SfxMacroInfoItem( USHORT nWhich,
+ const BasicManager* pMgr,
+ const String &rLibName,
+ const String &rModuleName,
+ const String &rMethodName,
+ const String &rComment);
+
+ SfxMacroInfoItem( const SfxMacroInfoItem& );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ String GetComment() const
+ { return aCommentText; }
+ void SetComment( const String& r )
+ { aCommentText = r; }
+ String GetMethod() const
+ { return aMethodName; }
+ void SetMethod( const String& r )
+ { aMethodName = r; }
+ String GetModule() const
+ { return aModuleName; }
+ void SetModule( const String& r )
+ { aModuleName = r; }
+ String GetLib() const
+ { return aLibName; }
+ void SetLib( const String& r )
+ { aLibName = r; }
+ const BasicManager* GetBasicManager() const
+ { return pBasicManager; }
+ String GetQualifiedName() const;
+};
+
+#endif
diff --git a/sfx2/inc/msgnodei.hxx b/sfx2/inc/msgnodei.hxx
new file mode 100644
index 000000000000..6912eb5b9a7e
--- /dev/null
+++ b/sfx2/inc/msgnodei.hxx
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: msgnodei.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:23 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MSGNODEI_HXX
+#define _MSGNODEI_HXX
+
+
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _SFXPOOLITEM_HXX //autogen
+#include <svtools/poolitem.hxx>
+#endif
+#ifndef _LIST_HXX //autogen
+#include <tools/list.hxx>
+#endif
+struct SfxMsgAttachFile {
+ String aFile;
+ String aName;
+
+ int operator==( const SfxMsgAttachFile& rRec ) const
+ {
+ if( aName == rRec.aName && aFile == rRec.aFile )
+ return TRUE;
+ return FALSE;
+ }
+
+ SfxMsgAttachFile( const String& rFile, const String& rName)
+ : aName( rName ), aFile( rFile ) {}
+
+ SfxMsgAttachFile( const SfxMsgAttachFile& rRec )
+ : aName( rRec.aName), aFile( rRec.aFile ) {}
+};
+
+enum SfxMsgReceiverRole
+{
+ MSG_RECEIVER_TO = 0,
+ MSG_RECEIVER_CC,
+ MSG_RECEIVER_BCC,
+ MSG_RECEIVER_NEWSGROUP
+};
+
+struct SfxMsgReceiver {
+ String aName;
+ SfxMsgReceiverRole eRole;
+
+ int operator==( const SfxMsgReceiver& rRec ) const
+ {
+ if( aName == rRec.aName && eRole == rRec.eRole )
+ return TRUE;
+ return FALSE;
+ }
+
+ SfxMsgReceiver( const String& rName, SfxMsgReceiverRole _eRole )
+ : aName( rName ), eRole( _eRole ) {}
+
+ SfxMsgReceiver( const SfxMsgReceiver& rRec )
+ : aName( rRec.aName), eRole( rRec.eRole ) {}
+};
+
+// ------------------------------------------------------------------------
+
+class SfxMsgReceiverList_Impl : public List
+{
+ ULONG nRef;
+ ~SfxMsgReceiverList_Impl();
+ SfxMsgReceiverList_Impl& operator=( const SfxMsgReceiverList_Impl&); //n.i.
+public:
+ SfxMsgReceiverList_Impl();
+ SfxMsgReceiverList_Impl(const SfxMsgReceiverList_Impl&);
+
+ void Load( SvStream& );
+ void Store( SvStream& ) const;
+ void IncRef() { nRef++; }
+ void DecRef() { nRef--; if( !nRef ) delete this; }
+ ULONG GetRefCount() const { return nRef; }
+ int operator==( const SfxMsgReceiverList_Impl& ) const;
+};
+
+class SfxMsgReceiverListItem : public SfxPoolItem
+{
+ void Disconnect();
+protected:
+ SfxMsgReceiverList_Impl* pImp;
+public:
+ TYPEINFO();
+
+ SfxMsgReceiverListItem();
+ SfxMsgReceiverListItem( USHORT nWhich );
+ SfxMsgReceiverListItem( USHORT nWhich, SvStream& rStream );
+ SfxMsgReceiverListItem( const SfxMsgReceiverListItem& rItem );
+ ~SfxMsgReceiverListItem();
+
+#if SUPD<355
+ virtual int IsPoolable() const;
+#endif
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ XubString &rText ) const;
+
+ USHORT Count() const;
+ SfxMsgReceiver* GetObject( USHORT nPos );
+ void Remove( USHORT nPos );
+ void Add( const SfxMsgReceiver& );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
+ virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
+};
+
+
+// ------------------------------------------------------------------------
+
+class SfxMsgAttachFileList_Impl : public List
+{
+ ULONG nRef;
+ ~SfxMsgAttachFileList_Impl();
+ SfxMsgAttachFileList_Impl& operator=( const SfxMsgAttachFileList_Impl&); //n.i.
+
+public:
+ SfxMsgAttachFileList_Impl();
+ SfxMsgAttachFileList_Impl(const SfxMsgAttachFileList_Impl&);
+
+ int operator==( const SfxMsgAttachFileList_Impl& rRec ) const;
+ SfxMsgAttachFile* GetReceiver(ULONG nPos) { return (SfxMsgAttachFile*)List::GetObject(nPos); }
+ void Load( SvStream& );
+ void Store( SvStream& ) const;
+ void IncRef() { nRef++; }
+ void DecRef() { nRef--; if( !nRef ) delete this; }
+ ULONG GetRefCount() const { return nRef; }
+};
+
+class SfxMsgAttachFileListItem : public SfxPoolItem
+{
+protected:
+ SfxMsgAttachFileList_Impl* pImp;
+ void Disconnect();
+public:
+ TYPEINFO();
+
+ SfxMsgAttachFileListItem();
+ SfxMsgAttachFileListItem( USHORT nWhich );
+ SfxMsgAttachFileListItem( USHORT nWhich, SvStream& rStream );
+ SfxMsgAttachFileListItem( const SfxMsgAttachFileListItem& rItem );
+ ~SfxMsgAttachFileListItem();
+
+#if SUPD<355
+ virtual int IsPoolable() const;
+#endif
+
+ virtual int operator==( const SfxPoolItem& ) const;
+
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ XubString &rText ) const;
+
+ USHORT Count() const;
+ SfxMsgAttachFile* GetObject( USHORT nPos );
+ void Remove( USHORT nPos );
+ void Add( const SfxMsgAttachFile& );
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create( SvStream &, USHORT nVersion ) const;
+ virtual SvStream& Store( SvStream &, USHORT nItemVersion ) const;
+};
+
+
+//=========================================================================
+
+enum SfxMsgPriority
+{
+ MSG_PRIORITY_LOW = 0,
+ MSG_PRIORITY_NORMAL,
+ MSG_PRIORITY_URGENT
+};
+#define SFXMSGPRIORITYCOUNT 3
+
+class SfxMsgPriorityItem : public SfxEnumItem
+{
+public:
+ TYPEINFO();
+
+ SfxMsgPriorityItem( USHORT nWhich, SfxMsgPriority = MSG_PRIORITY_NORMAL);
+
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool=0 ) const;
+ virtual SfxPoolItem* Create( SvStream&, USHORT ) const;
+ virtual SvStream& Store( SvStream&, USHORT ) const;
+ virtual SfxItemPresentation GetPresentation( SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ String &rText ) const;
+ virtual USHORT GetValueCount() const;
+ virtual String GetValueTextByPos( USHORT nPos ) const;
+
+ inline SfxMsgPriorityItem& operator=(const SfxMsgPriorityItem& rPrio)
+ {
+ SetValue( rPrio.GetValue() );
+ return *this;
+ }
+};
+
+
+#endif
diff --git a/sfx2/inc/orgmgr.hxx b/sfx2/inc/orgmgr.hxx
new file mode 100644
index 000000000000..697f5394a652
--- /dev/null
+++ b/sfx2/inc/orgmgr.hxx
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: orgmgr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_ORGMGR_HXX
+#define _SFX_ORGMGR_HXX
+
+#ifndef _SVARRAY_HXX //autogen
+#include <svtools/svarray.hxx>
+#endif
+
+class SfxDocumentTemplates;
+class SfxOrganizeListBox_Impl;
+class SfxObjectShell;
+struct _FileListEntry;
+
+//=========================================================================
+
+SV_DECL_PTRARR_SORT(_SfxObjectList, _FileListEntry*, 1, 4)
+
+class SfxObjectList: public _SfxObjectList
+{
+public:
+ SfxObjectList();
+ ~SfxObjectList();
+
+ const String& GetBaseName( USHORT nId ) const;
+ const String& GetFileName( USHORT nId ) const;
+};
+
+//=========================================================================
+
+class SfxOrganizeMgr
+{
+private:
+ SfxObjectList* pDocList;
+ SfxDocumentTemplates* pTemplates;
+ SfxOrganizeListBox_Impl* pLeftBox;
+ SfxOrganizeListBox_Impl* pRightBox;
+ BOOL bDeleteTemplates :1;
+ BOOL bModified :1;
+
+ SfxOrganizeListBox_Impl* GetOther( SfxOrganizeListBox_Impl* );
+
+public:
+ SfxOrganizeMgr( SfxOrganizeListBox_Impl* pLeft,
+ SfxOrganizeListBox_Impl* pRight,
+ SfxDocumentTemplates* pTempl = NULL );
+ ~SfxOrganizeMgr();
+
+ BOOL Copy( USHORT nTargetRegion, USHORT nTargetIdx, USHORT nSourceRegion, USHORT nSourceIdx );
+ BOOL Move( USHORT nTargetRegion, USHORT nTargetIdx, USHORT nSourceRegion, USHORT nSourceIdx );
+ BOOL Delete( SfxOrganizeListBox_Impl* pCaller, USHORT nRegion, USHORT nIdx );
+ BOOL InsertDir( SfxOrganizeListBox_Impl* pCaller, const String& rName, USHORT nRegion );
+ BOOL SetName( const String& rName, USHORT nRegion, USHORT nIdx = USHRT_MAX );
+ BOOL CopyTo( USHORT nRegion, USHORT nIdx, const String& rName ) const;
+ BOOL CopyFrom( SfxOrganizeListBox_Impl* pCaller, USHORT nRegion, USHORT nIdx, String& rName );
+
+ BOOL Rescan();
+ BOOL InsertFile( SfxOrganizeListBox_Impl* pCaller, const String& rFileName );
+
+ BOOL IsModified() const { return bModified ? TRUE : FALSE; }
+
+ const SfxDocumentTemplates* GetTemplates() const { return pTemplates; }
+ SfxObjectList& GetObjectList() { return *pDocList; }
+ const SfxObjectList& GetObjectList() const { return *pDocList; }
+
+ SfxObjectShellRef CreateObjectShell( USHORT nIdx );
+ SfxObjectShellRef CreateObjectShell( USHORT nRegion, USHORT nIdx );
+ BOOL DeleteObjectShell( USHORT );
+ BOOL DeleteObjectShell( USHORT, USHORT );
+ void SaveAll( Window* pParent );
+};
+
+#endif // #ifndef _SFX_ORGMGR_HXX
+
+
diff --git a/sfx2/inc/progind.hxx b/sfx2/inc/progind.hxx
new file mode 100644
index 000000000000..fe08683a68a9
--- /dev/null
+++ b/sfx2/inc/progind.hxx
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: progind.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_PROGIND_HXX
+#define _SFX_PROGIND_HXX
+
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORFACTORY_HPP_
+#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HPP_
+#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+#include <vcl/window.hxx>
+#include <vcl/fixed.hxx>
+#include <svtools/prgsbar.hxx>
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+
+#include "sfxuno.hxx"
+
+class SfxStatusInd_Impl : public cppu::WeakImplHelper1< ::com::sun::star::task::XStatusIndicator >
+{
+ long nValue;
+ long nRange;
+ sal_uInt16 nProgressCount;
+
+friend class SfxPopupStatusIndicator;
+ SfxPopupStatusIndicator* pWindow;
+
+public:
+
+ SfxStatusInd_Impl();
+
+ // XStatusIndicator
+ virtual void SAL_CALL start(const ::rtl::OUString& aText, sal_Int32 nRange) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL end(void) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setText(const ::rtl::OUString& aText) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setValue(sal_Int32 nValue) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL reset() throw ( ::com::sun::star::uno::RuntimeException );
+};
+
+class SfxPopupStatusIndicator : public Window
+{
+friend class SfxStatusInd_Impl;
+ FixedText aTextBar;
+ ProgressBar aProgressBar;
+ SfxStatusInd_Impl* pInterface;
+
+public:
+ SfxPopupStatusIndicator( Window* pParent );
+ ~SfxPopupStatusIndicator();
+
+ virtual void MakeVisible( sal_Bool bVisible );
+ virtual void Resize();
+ virtual void Paint( const Rectangle& rRect );
+ Size CalcWindowSizePixel();
+ ::com::sun::star::task::XStatusIndicator* GetInterface()
+ { return pInterface; }
+};
+
+
+#endif
+
diff --git a/sfx2/inc/resmgr.hxx b/sfx2/inc/resmgr.hxx
new file mode 100644
index 000000000000..5f6cfe401130
--- /dev/null
+++ b/sfx2/inc/resmgr.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: resmgr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_RESMGR_HXX
+#define _SFX_RESMGR_HXX
+
+#include "app.hxx"
+#include "minarray.hxx"
+
+class SfxMessageDescription;
+class SfxMessageTable;
+class Bitmap;
+
+DECL_PTRARRAY(SfxResMgrArr, ResMgr *, 1, 1);
+
+// INCLUDE ---------------------------------------------------------------
+
+class SfxResourceManager
+{
+ SfxResMgrArr aResMgrArr;
+ SfxResMgrArr aResMgrBmpArr;
+ USHORT nEnterCount;
+ SfxMessageTable* pMessageTable;
+
+private:
+ void ClearMsgTable_Impl();
+ SfxMessageDescription* MakeDesc_Impl(USHORT);
+
+public:
+ SfxResourceManager();
+ ~SfxResourceManager();
+
+ USHORT RegisterResource( const char *pFileName);
+ void ReleaseResource( USHORT nRegisterId );
+
+ USHORT RegisterBitmap(const char *pMono, const char *pColor);
+
+ USHORT RegisterBitmap( const char *pSingleFile );
+ void ReleaseBitmap( USHORT nRegisterId );
+
+ Bitmap GetAllBitmap( USHORT nBmpsPerRow );
+
+ void Enter();
+ void Leave();
+ SfxMessageDescription* CreateDescription( USHORT nId );
+};
+
+
+#define SFX_RESMANAGER() SFX_APP()->GetResourceManager()
+
+#endif
+
diff --git a/sfx2/inc/sfxbasic.hxx b/sfx2/inc/sfxbasic.hxx
new file mode 100644
index 000000000000..4ec7d082a2a3
--- /dev/null
+++ b/sfx2/inc/sfxbasic.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxbasic.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXBASIC_HXX
+#define _SFXBASIC_HXX
+
+class BasicManager;
+class SbMethod;
+
+//------------------------------------------------------------------
+
+SbMethod* SfxQueryMacro( BasicManager* pMgr, const String& rMacro );
+
+ErrCode SfxCallMacro( BasicManager* pMgr, const String& rMacro,
+ SbxArray *pArgs = 0, SbxValue *pRet = 0 );
+
+
+#endif
+
diff --git a/sfx2/inc/sfxhelp.hxx b/sfx2/inc/sfxhelp.hxx
new file mode 100644
index 000000000000..f8ebb69422d0
--- /dev/null
+++ b/sfx2/inc/sfxhelp.hxx
@@ -0,0 +1,311 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxhelp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_HELP_HXX
+#define _SFX_HELP_HXX
+
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _HELP_HXX //autogen
+#include <vcl/help.hxx>
+#endif
+#include <childwin.hxx>
+#include <dockwin.hxx>
+
+#include <docfac.hxx>
+#include <viewfac.hxx>
+#include <objsh.hxx>
+#include <viewsh.hxx>
+
+class HelpPI;
+class SHelpInfo;
+struct SpecialLinkInfo;
+class Library;
+class SfxPrinter;
+class DirEntry;
+class SvStringsDtor;
+
+struct HelpFileInfo
+{
+ String aFileName;
+ String aTitle;
+};
+
+
+class SfxHelpPIWrapper : public SfxChildWindow
+{
+public:
+ SfxHelpPIWrapper(Window *pParent, USHORT nId,
+ SfxBindings *pBindings, SfxChildWinInfo *pInfo);
+
+ SFX_DECL_CHILDWINDOW(SfxHelpPIWrapper);
+
+ virtual BOOL QueryClose();
+};
+
+class SfxHelpTipsWrapper : public SfxChildWindow
+{
+public:
+ SfxHelpTipsWrapper(Window *pParent, USHORT nId,
+ SfxBindings *pBindings, SfxChildWinInfo *pInfo);
+
+ SFX_DECL_CHILDWINDOW(SfxHelpTipsWrapper);
+};
+
+
+
+class SfxHelpTipsWindow : public SfxDockingWindow
+{
+private:
+ HelpPI* mpHelpPI;
+ PushButton maCloseButton;
+ Window maTipWindow;
+ CheckBox maCheckBox;
+
+protected:
+ DECL_LINK( CloseButtonHdl, Button* );
+ DECL_LINK( ShowTip, void* );
+ DECL_LINK( CheckBoxHdl, CheckBox* );
+
+public:
+ SfxHelpTipsWindow( SfxBindings* pBindimgs, SfxChildWindow* pChildWin, Window* pParent );
+ ~SfxHelpTipsWindow();
+
+ virtual void FillInfo( SfxChildWinInfo& ) const;
+ virtual void Resize();
+};
+
+
+
+class SfxHelpPI : public SfxDockingWindow
+{
+ HelpPI* pHelpPI;
+ Window* pInnerWindow;
+
+ Timer aTopicJustRequestedTimer;
+
+ ULONG nTip;
+ CheckBox aTipBox;
+
+ BOOL bInShowMe;
+
+protected:
+ virtual void Resize();
+ virtual void Paint( const Rectangle& );
+
+public:
+ SfxHelpPI( SfxBindings* pBindimgs, SfxChildWindow* pChildWin,
+ Window* pParent, USHORT nScale );
+ ~SfxHelpPI();
+
+ void LoadTopic( const String& rFileName, ULONG nId );
+ void LoadTopic( ULONG nId );
+ void LoadTopic( const String& rKeyword );
+ void ResetTopic();
+
+ BOOL Close();
+
+ BOOL IsConstructed() const { return ( pHelpPI != 0 ); }
+ String GetExtraInfo() const;
+
+ HelpPI* GetHelpPI() const { return pHelpPI; }
+
+ virtual void FillInfo( SfxChildWinInfo& ) const;
+
+ void SetTip( ULONG nId );
+ ULONG GetTip() const { return nTip; }
+ void SetTipText( const String& rText );
+
+ BOOL IsInShowMe() const { return bInShowMe; }
+
+ // Nach F1 fuer einige ms nicht aufgrund von FocusChanged ein anderes Topic laden...
+ BOOL IsTopicJustRequested() const { return aTopicJustRequestedTimer.IsActive(); }
+ void SetTopicJustRequested( BOOL bOn ) { if( bOn )
+ aTopicJustRequestedTimer.Start();
+ else
+ aTopicJustRequestedTimer.Stop(); }
+
+#if __PRIVATE
+ DECL_LINK( TopicChangedHdl_Impl, void* );
+ DECL_LINK( SpecialLinkHdl, SpecialLinkInfo* );
+ DECL_LINK( TipBoxHdl, CheckBox* );
+ DECL_LINK( PIToolboxHdl, ToolBox* );
+#endif
+};
+
+
+
+class SfxHelp
+{
+public:
+ static BOOL ShowHelp( ULONG nId, BOOL bShowInHelpAgent, const char* pFileName = 0, BOOL bQuiet = FALSE );
+ static BOOL ShowHelp( const String& rKeyword, BOOL bShowInHelpAgent, const char* pFileName = 0 );
+ static void ShowHint( ULONG nId );
+ static void SetCustomHelpFile( const String& rName );
+ static USHORT GetHelpFileInfoCount();
+ static HelpFileInfo* GetHelpFileInfo( USHORT n );
+};
+
+USHORT ImplSetLanguageGroup( Config& rConfig, const String& rGroupName, BOOL bSearchLanguage );
+
+
+
+#if __PRIVATE
+
+SV_DECL_VARARR_SORT( SortedULONGs, ULONG, 0, 4 );
+//SV_DECL_PTRARR_DEL( HelpTextCaches, HelpTextCache*, 0, 4 );
+
+
+class SfxHelp_Impl : public Help, public SfxListener
+{
+ friend class SfxHelp;
+
+ String aCustomHelpFile;
+ String aCurHelpFile; // Kurzer Name ohne Pfad
+
+ SHelpInfo* pHelpInfo; // Fr GetHelpText()
+
+// HelpTextCache* pHelpCache;
+// HelpTextCaches aHelpCaches;
+
+ Timer aDialogDetector;
+
+ SortedULONGs* pPIStarterList;
+
+ ULONG nLastDialog;
+ BOOL bForcedFloatingPI;
+
+ List* pHelpFileInfos;
+
+private:
+ BOOL ImplStart( ULONG nHelpId, BOOL bCheckHelpFile, BOOL bChangeHelpFile, BOOL bHelpAgent );
+ virtual BOOL Start( ULONG nHelpId );
+#ifndef ENABLEUNICODE
+ virtual BOOL Start( const String& rKeyWord );
+#else
+ virtual BOOL Start( const UniString& rKeyWord );
+#endif
+ void SetCurrentHelpFile( ULONG nId );
+ String GetCurrentHelpFile() const { return aCurHelpFile; }
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+
+
+ inline SortedULONGs* GetPIStarterList();
+ void CreatePIStarterList();
+
+
+ DECL_LINK( DialogDetectHdl, Timer* );
+
+protected:
+ void AssertValidHelpDocInfo();
+
+public:
+
+ SfxHelp_Impl();
+ ~SfxHelp_Impl();
+
+ static String GetHelpPath();
+ static String GetHelpFileName( ULONG nId );
+ BOOL CheckHelpFile( BOOL bPrompt ) const;
+ static BOOL CheckHelpFile( const String& rFilename, BOOL bPrompt );
+
+ static Window* SearchFocusWindowParent();
+ void CheckPIPosition();
+
+ void SetHelpFile( const String &rHelpFileName, BOOL bAdjustExt = TRUE );
+ const String& GetCurHelpFile() const { return aCurHelpFile; }
+
+ XubString GetHelpText( ULONG nHelpId );
+
+ void GetHelpURLs( const String& rRootURL, SvStringsDtor& rLst );
+ void GetBookmarks( SvStringsDtor& rLst );
+ void AddBookmark( const String& rName, const String& rURL );
+ void RemoveBookmark( const String& rName );
+ void RenameBookmark( const String& rOldTitle, const String& rNewTitle );
+
+ void SlotExecutedOrFocusChanged( ULONG nId, BOOL bSlot, BOOL bAutoStart );
+ void EnableTip( ULONG nTip, BOOL bEnable );
+
+ void ResetPIStarterList();
+
+ void HelpAgentClosed();
+
+ void StartHelpPI( ULONG nHelpId, BOOL bSlot, BOOL bTip = FALSE );
+
+ USHORT GetHelpFileInfoCount();
+ HelpFileInfo* GetHelpFileInfo( USHORT n );
+
+ static String GetConfigDir( BOOL bGetSharedConfig );
+ static String GetHelpAgentConfig();
+};
+
+inline SortedULONGs* SfxHelp_Impl::GetPIStarterList()
+{
+ if ( !pPIStarterList )
+ CreatePIStarterList();
+ return pPIStarterList;
+}
+
+#endif // _PRIVATE
+
+#endif // #ifndef _SFX_HELP_HXX
+
diff --git a/sfx2/inc/sfxresid.hxx b/sfx2/inc/sfxresid.hxx
new file mode 100644
index 000000000000..f362dc87cdde
--- /dev/null
+++ b/sfx2/inc/sfxresid.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxresid.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_SFXRESID_HXX
+#define _SFX_SFXRESID_HXX
+
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+
+#ifndef _RESID_HXX //autogen
+#include <vcl/resid.hxx>
+#endif
+
+class SfxResId: public ResId
+{
+public:
+ SfxResId( USHORT nId );
+};
+
+//============================================================================
+class SfxSimpleResId
+{
+ String m_sText;
+
+public:
+ SfxSimpleResId(USHORT nID);
+
+ String getText() const { return m_sText; }
+
+ operator String() const { return getText(); }
+};
+
+
+#endif
diff --git a/sfx2/inc/stbitem.hxx b/sfx2/inc/stbitem.hxx
new file mode 100644
index 000000000000..f0e1c60298bb
--- /dev/null
+++ b/sfx2/inc/stbitem.hxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: stbitem.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:24 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXSTBITEM_HXX
+#define _SFXSTBITEM_HXX
+
+#ifndef _SFXCTRLITEM_HXX
+#include "ctrlitem.hxx"
+#endif
+
+class SvStream;
+class SvStream;
+class SfxModule;
+
+//------------------------------------------------------------------
+
+class StatusBar;
+class SfxStatusBarControl;
+class SfxBindings;
+
+typedef SfxStatusBarControl* (*SfxStatusBarControlCtor)( USHORT nId, StatusBar &rStb, SfxBindings & );
+
+struct SfxStbCtrlFactory
+{
+ SfxStatusBarControlCtor pCtor;
+ TypeId nTypeId;
+ USHORT nSlotId;
+
+ SfxStbCtrlFactory( SfxStatusBarControlCtor pTheCtor,
+ TypeId nTheTypeId, USHORT nTheSlotId ):
+ pCtor(pTheCtor),
+ nTypeId(nTheTypeId),
+ nSlotId(nTheSlotId)
+ {}
+};
+
+//------------------------------------------------------------------
+
+class CommandEvent;
+class MouseEvent;
+class UserDrawEvent;
+
+class SfxStatusBarControl: public SfxControllerItem
+{
+friend class SfxStatusBar_Impl;
+
+ StatusBar* pBar;
+
+protected:
+ virtual void StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual BOOL MouseButtonDown( const MouseEvent & );
+ virtual BOOL MouseMove( const MouseEvent & );
+ virtual BOOL MouseButtonUp( const MouseEvent & );
+ virtual void Paint( const UserDrawEvent &rUDEvt );
+
+public:
+ SfxStatusBarControl( USHORT nId, StatusBar& rBar, SfxBindings & );
+ virtual ~SfxStatusBarControl();
+
+ StatusBar& GetStatusBar() const { return *pBar; }
+ void CaptureMouse();
+ void ReleaseMouse();
+
+ static SfxStatusBarControl* CreateControl( USHORT nId, StatusBar *pBar, SfxBindings&, SfxModule* );
+};
+
+//------------------------------------------------------------------
+
+#define SFX_DECL_STATUSBAR_CONTROL() \
+ static SfxStatusBarControl* CreateImpl( USHORT nId, StatusBar &rStb, SfxBindings &rBindings ); \
+ static void RegisterControl(USHORT nSlotId = 0, SfxModule *pMod=NULL)
+
+#define SFX_IMPL_STATUSBAR_CONTROL(Class, nItemClass) \
+ SfxStatusBarControl* __EXPORT Class::CreateImpl( USHORT nId, StatusBar &rStb, SfxBindings &rBindings ) \
+ { return new Class(nId, rStb, rBindings); } \
+ void Class::RegisterControl(USHORT nSlotId, SfxModule *pMod) \
+ { SFX_APP()->RegisterStatusBarControl( pMod, new SfxStbCtrlFactory( \
+ Class::CreateImpl, TYPE(nItemClass), nSlotId ) ); }
+
+
+#endif
+
diff --git a/sfx2/inc/tplpitem.hxx b/sfx2/inc/tplpitem.hxx
new file mode 100644
index 000000000000..1595e3b597f6
--- /dev/null
+++ b/sfx2/inc/tplpitem.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: tplpitem.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_TPLPITEM_HXX
+#define _SFX_TPLPITEM_HXX
+
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _RTTI_HXX //autogen
+#include <tools/rtti.hxx>
+#endif
+#ifndef _SFXFLAGITEM_HXX //autogen
+#include <svtools/flagitem.hxx>
+#endif
+
+class SfxTemplateItem: public SfxFlagItem
+{
+ String aStyle;
+public:
+ TYPEINFO();
+ SfxTemplateItem( USHORT nWhich,
+ const String &rStyle,
+ USHORT nMask = 0xffff );
+ SfxTemplateItem( const SfxTemplateItem& );
+
+ const String& GetStyleName() const { return aStyle; }
+
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual BYTE GetFlagCount() const;
+};
+
+#endif
diff --git a/sfx2/inc/viewfac.hxx b/sfx2/inc/viewfac.hxx
new file mode 100644
index 000000000000..e5234f1330b6
--- /dev/null
+++ b/sfx2/inc/viewfac.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: viewfac.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:25 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _VIEWFAC_HXX
+#define _VIEWFAC_HXX
+
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _RESID_HXX //autogen
+#include <vcl/resid.hxx>
+#endif
+
+class SfxViewFrame;
+class SfxViewShell;
+class Window;
+
+typedef SfxViewShell* (*SfxViewCtor)(SfxViewFrame*, SfxViewShell*);
+typedef void (*SfxViewInit)();
+
+// CLASS -----------------------------------------------------------------
+class SfxViewFactory
+{
+public:
+ SfxViewFactory( SfxViewCtor fnC, SfxViewInit fnI,
+ USHORT nOrdinal, const ResId& aDescrResId );
+ ~SfxViewFactory();
+
+ SfxViewShell *CreateInstance(SfxViewFrame *pViewFrame, SfxViewShell *pOldSh);
+ void InitFactory();
+
+ String GetDescription() const
+ { return String( aDescription ); }
+ USHORT GetOrdinal() const { return nOrd; }
+
+private:
+ SfxViewCtor fnCreate;
+ SfxViewInit fnInit;
+ USHORT nOrd;
+ ResId aDescription;
+};
+
+#endif
+
diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst
new file mode 100644
index 000000000000..0cec2284377d
--- /dev/null
+++ b/sfx2/prj/d.lst
@@ -0,0 +1,148 @@
+mkdir: %_DEST%\inc\sfx2
+mkdir: %_DEST%\inc\enus
+mkdir: %_DEST%\inc\fren
+mkdir: %_DEST%\inc\dtch
+mkdir: %_DEST%\inc\ital
+mkdir: %_DEST%\inc\swed
+mkdir: %_DEST%\inc\port
+mkdir: %_DEST%\inc\dan
+mkdir: %_DEST%\inc\span
+mkdir: %_DEST%\inc\chinsim
+mkdir: %_DEST%\inc\japn
+mkdir: %_DEST%\inc\russ
+mkdir: %_DEST%\inc\pol
+
+touch: ..\%__SRC%\misc\sfx2.hid %_DEST%\bin%_EXT%\sfx2.hid
+
+..\%__SRC%\inc\sfxslots.ilb %_DEST%\inc%_EXT%\sfxslots.ilb
+..\%__SRC%\inc\sfxslots.ilb* %_DEST%\inc%_EXT%\sfxslots.ilb*
+..\%__SRC%\lib\sfx.lib %_DEST%\lib%_EXT%\sfx.lib
+..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so
+..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
+..\%__SRC%\slb\sfx.lib %_DEST%\lib%_EXT%\xsfx.lib
+..\%__SRC%\obj\appctor.obj %_DEST%\lib%_EXT%\xsfxapp.obj
+..\%__SRC%\lib\isfx.lib %_DEST%\lib%_EXT%\isfx.lib
+..\%__SRC%\lib\debug.lib %_DEST%\lib%_EXT%\sfxdebug.lib
+..\%__SRC%\bin\sfx?????.sym %_DEST%\bin%_EXT%\sfx?????.sym
+..\%__SRC%\bin\sfx?????.dll %_DEST%\bin%_EXT%\sfx?????.dll
+..\%__SRC%\bin\sfx???[0-9][0-9].dll %_DEST%\bin%_EXT%\sfx?????.dll
+..\%__SRC%\bin\sfx?????.res %_DEST%\bin%_EXT%\sfx?????.res
+..\%__SRC%\bin\sfx?????.sym %_DEST%\bin%_EXT%\sfx?????.sym
+..\%__SRC%\misc\sfx?????.map %_DEST%\bin%_EXT%\sfx?????.map
+..\%__SRC%\bin\elc?????.dll %_DEST%\bin%_EXT%\elc?????.dll
+..\%__SRC%\srs\sfx.srs %_DEST%\res%_EXT%\sfx.srs
+..\%__SRC%\srs\sfxslots.srs %_DEST%\res%_EXT%\sfxslots.srs
+..\%__SRC%\res\sfx.srs %_DEST%\res%_EXT%\sfx.srs
+..\util\svdbt.dll %_DEST%\bin%_EXT%\svdbt.dll
+..\%__SRC%\misc\sfx2.csv %_DEST%\inc%_EXT%\sfx2.csv
+..\%__SRC%\inc\macropg.hxx %_DEST%\inc%_EXT%\macropg.hxx
+..\%__SRC%\bin\odk?????.dll %_DEST%\odk\bin%_EXT%\odk?????.dll
+..\%__SRC%\bin\cli?????.dll %_DEST%\odk\bin%_EXT%\cli?????.dll
+
+hedabu: ..\inc\inettbc.hxx %_DEST%\inc%_EXT%\sfx2\inettbc.hxx
+hedabu: ..\inc\accmgr.hxx %_DEST%\inc%_EXT%\sfx2\accmgr.hxx
+hedabu: ..\inc\app.hxx %_DEST%\inc%_EXT%\sfx2\app.hxx
+hedabu: ..\inc\basedlgs.hxx %_DEST%\inc%_EXT%\sfx2\basedlgs.hxx
+hedabu: ..\inc\bindings.hxx %_DEST%\inc%_EXT%\sfx2\bindings.hxx
+hedabu: ..\inc\clientsh.hxx %_DEST%\inc%_EXT%\sfx2\clientsh.hxx
+hedabu: ..\inc\cfgitem.hxx %_DEST%\inc%_EXT%\sfx2\cfgitem.hxx
+hedabu: ..\inc\configmgr.hxx %_DEST%\inc%_EXT%\sfx2\configmgr.hxx
+hedabu: ..\inc\chalign.hxx %_DEST%\inc%_EXT%\sfx2\chalign.hxx
+hedabu: ..\inc\childwin.hxx %_DEST%\inc%_EXT%\sfx2\childwin.hxx
+hedabu: ..\inc\ctrlitem.hxx %_DEST%\inc%_EXT%\sfx2\ctrlitem.hxx
+hedabu: ..\inc\dispatch.hxx %_DEST%\inc%_EXT%\sfx2\dispatch.hxx
+hedabu: ..\inc\dinfdlg.hxx %_DEST%\inc%_EXT%\sfx2\dinfdlg.hxx
+hedabu: ..\inc\dinfedt.hxx %_DEST%\inc%_EXT%\sfx2\dinfedt.hxx
+hedabu: ..\inc\docinf.hxx %_DEST%\inc%_EXT%\sfx2\docinf.hxx
+hedabu: ..\inc\docfac.hxx %_DEST%\inc%_EXT%\sfx2\docfac.hxx
+hedabu: ..\inc\docfile.hxx %_DEST%\inc%_EXT%\sfx2\docfile.hxx
+hedabu: ..\inc\docfilt.hxx %_DEST%\inc%_EXT%\sfx2\docfilt.hxx
+hedabu: ..\inc\dockwin.hxx %_DEST%\inc%_EXT%\sfx2\dockwin.hxx
+hedabu: ..\inc\doctempl.hxx %_DEST%\inc%_EXT%\sfx2\doctempl.hxx
+hedabu: ..\inc\doctdlg.hxx %_DEST%\inc%_EXT%\sfx2\doctdlg.hxx
+hedabu: ..\inc\event.hxx %_DEST%\inc%_EXT%\sfx2\event.hxx
+hedabu: ..\inc\evntconf.hxx %_DEST%\inc%_EXT%\sfx2\evntconf.hxx
+hedabu: ..\inc\exchobj.hxx %_DEST%\inc%_EXT%\sfx2\exchobj.hxx
+hedabu: ..\inc\expfile.hxx %_DEST%\inc%_EXT%\sfx2\expfile.hxx
+hedabu: ..\inc\explorer.hxx %_DEST%\inc%_EXT%\sfx2\explorer.hxx
+hedabu: ..\inc\exptypes.hxx %_DEST%\inc%_EXT%\sfx2\exptypes.hxx
+hedabu: ..\inc\fcontnr.hxx %_DEST%\inc%_EXT%\sfx2\fcontnr.hxx
+hedabu: ..\inc\frame.hxx %_DEST%\inc%_EXT%\sfx2\frame.hxx
+hedabu: ..\inc\frameobj.hxx %_DEST%\inc%_EXT%\sfx2\frameobj.hxx
+hedabu: ..\inc\frmdescr.hxx %_DEST%\inc%_EXT%\sfx2\frmdescr.hxx
+hedabu: ..\inc\frmhtml.hxx %_DEST%\inc%_EXT%\sfx2\frmhtml.hxx
+hedabu: ..\inc\frmhtmlw.hxx %_DEST%\inc%_EXT%\sfx2\frmhtmlw.hxx
+hedabu: ..\inc\frmload.hxx %_DEST%\inc%_EXT%\sfx2\frmload.hxx
+hedabu: ..\inc\genlink.hxx %_DEST%\inc%_EXT%\sfx2\genlink.hxx
+hedabu: ..\inc\hintpost.hxx %_DEST%\inc%_EXT%\sfx2\hintpost.hxx
+hedabu: ..\inc\interno.hxx %_DEST%\inc%_EXT%\sfx2\interno.hxx
+hedabu: ..\inc\inimgr.hxx %_DEST%\inc%_EXT%\sfx2\inimgr.hxx
+hedabu: ..\inc\imgmgr.hxx %_DEST%\inc%_EXT%\sfx2\imgmgr.hxx
+hedabu: ..\inc\imgdef.hxx %_DEST%\inc%_EXT%\sfx2\imgdef.hxx
+hedabu: ..\inc\interno.hxx %_DEST%\inc%_EXT%\sfx2\interno.hxx
+hedabu: ..\inc\ipfrm.hxx %_DEST%\inc%_EXT%\sfx2\ipfrm.hxx
+hedabu: ..\inc\linkhdl.hxx %_DEST%\inc%_EXT%\sfx2\linkhdl.hxx
+hedabu: ..\inc\macrconf.hxx %_DEST%\inc%_EXT%\sfx2\macrconf.hxx
+hedabu: ..\inc\macropg.hxx %_DEST%\inc%_EXT%\sfx2\macropg.hxx
+hedabu: ..\inc\mailitem.hxx %_DEST%\inc%_EXT%\sfx2\mailitem.hxx
+hedabu: ..\inc\topfrm.hxx %_DEST%\inc%_EXT%\sfx2\topfrm.hxx
+hedabu: ..\inc\mfldmgr.hxx %_DEST%\inc%_EXT%\sfx2\mfldmgr.hxx
+hedabu: ..\inc\mgetempl.hxx %_DEST%\inc%_EXT%\sfx2\mgetempl.hxx
+hedabu: ..\inc\mieclip.hxx %_DEST%\inc%_EXT%\sfx2\mieclip.hxx
+hedabu: ..\inc\minarray.hxx %_DEST%\inc%_EXT%\sfx2\minarray.hxx
+hedabu: ..\inc\minfitem.hxx %_DEST%\inc%_EXT%\sfx2\minfitem.hxx
+hedabu: ..\inc\minfstack.hxx %_DEST%\inc%_EXT%\sfx2\minfstack.hxx
+hedabu: ..\inc\minstack.hxx %_DEST%\inc%_EXT%\sfx2\minstack.hxx
+hedabu: ..\inc\mnuitem.hxx %_DEST%\inc%_EXT%\sfx2\mnuitem.hxx
+hedabu: ..\inc\module.hxx %_DEST%\inc%_EXT%\sfx2\module.hxx
+hedabu: ..\inc\msg.hxx %_DEST%\inc%_EXT%\sfx2\msg.hxx
+hedabu: ..\inc\mnumgr.hxx %_DEST%\inc%_EXT%\sfx2\mnumgr.hxx
+hedabu: ..\inc\newstyle.hxx %_DEST%\inc%_EXT%\sfx2\newstyle.hxx
+hedabu: ..\inc\new.hxx %_DEST%\inc%_EXT%\sfx2\new.hxx
+hedabu: ..\inc\navigat.hxx %_DEST%\inc%_EXT%\sfx2\navigat.hxx
+hedabu: ..\inc\msgdescr.hxx %_DEST%\inc%_EXT%\sfx2\msgdescr.hxx
+hedabu: ..\inc\msgpool.hxx %_DEST%\inc%_EXT%\sfx2\msgpool.hxx
+hedabu: ..\inc\passwd.hxx %_DEST%\inc%_EXT%\sfx2\passwd.hxx
+hedabu: ..\inc\prnmon.hxx %_DEST%\inc%_EXT%\sfx2\prnmon.hxx
+hedabu: ..\inc\objface.hxx %_DEST%\inc%_EXT%\sfx2\objface.hxx
+hedabu: ..\inc\objitem.hxx %_DEST%\inc%_EXT%\sfx2\objitem.hxx
+hedabu: ..\inc\objsh.hxx %_DEST%\inc%_EXT%\sfx2\objsh.hxx
+hedabu: ..\inc\printer.hxx %_DEST%\inc%_EXT%\sfx2\printer.hxx
+hedabu: ..\inc\progress.hxx %_DEST%\inc%_EXT%\sfx2\progress.hxx
+hedabu: ..\inc\request.hxx %_DEST%\inc%_EXT%\sfx2\request.hxx
+hedabu: ..\inc\saveopt.hxx %_DEST%\inc%_EXT%\sfx2\saveopt.hxx
+hedabu: ..\inc\sfx.hrc %_DEST%\inc%_EXT%\sfx2\sfx.hrc
+hedabu: ..\inc\sfxdefs.hxx %_DEST%\inc%_EXT%\sfx2\sfxdefs.hxx
+hedabu: ..\inc\sfxdir.hxx %_DEST%\inc%_EXT%\sfx2\sfxdir.hxx
+hedabu: ..\inc\sfxhelp.hxx %_DEST%\inc%_EXT%\sfx2\sfxhelp.hxx
+hedabu: ..\inc\sfxhtml.hxx %_DEST%\inc%_EXT%\sfx2\sfxhtml.hxx
+hedabu: ..\inc\sfxsids.hrc %_DEST%\inc%_EXT%\sfx2\sfxsids.hrc
+hedabu: ..\inc\shell.hxx %_DEST%\inc%_EXT%\sfx2\shell.hxx
+hedabu: ..\inc\stbitem.hxx %_DEST%\inc%_EXT%\sfx2\stbitem.hxx
+hedabu: ..\inc\stbmgr.hxx %_DEST%\inc%_EXT%\sfx2\stbmgr.hxx
+hedabu: ..\inc\styfitem.hxx %_DEST%\inc%_EXT%\sfx2\styfitem.hxx
+hedabu: ..\inc\styledlg.hxx %_DEST%\inc%_EXT%\sfx2\styledlg.hxx
+hedabu: ..\inc\tabdlg.hxx %_DEST%\inc%_EXT%\sfx2\tabdlg.hxx
+hedabu: ..\inc\tbxctrl.hxx %_DEST%\inc%_EXT%\sfx2\tbxctrl.hxx
+hedabu: ..\inc\tbxmgr.hxx %_DEST%\inc%_EXT%\sfx2\tbxmgr.hxx
+hedabu: ..\inc\templdlg.hxx %_DEST%\inc%_EXT%\sfx2\templdlg.hxx
+hedabu: ..\inc\tplpitem.hxx %_DEST%\inc%_EXT%\sfx2\tplpitem.hxx
+hedabu: ..\inc\viewfrm.hxx %_DEST%\inc%_EXT%\sfx2\viewfrm.hxx
+hedabu: ..\inc\viewsh.hxx %_DEST%\inc%_EXT%\sfx2\viewsh.hxx
+hedabu: ..\inc\viewfac.hxx %_DEST%\inc%_EXT%\sfx2\viewfac.hxx
+hedabu: ..\inc\iodlg.hxx %_DEST%\inc%_EXT%\sfx2\iodlg.hxx
+hedabu: ..\inc\appuno.hxx %_DEST%\inc%_EXT%\sfx2\appuno.hxx
+hedabu: ..\inc\sfxuno.hxx %_DEST%\inc%_EXT%\sfx2\sfxuno.hxx
+hedabu: ..\inc\sfxbasemodel.hxx %_DEST%\inc%_EXT%\sfx2\sfxbasemodel.hxx
+hedabu: ..\inc\sfxbasecontroller.hxx %_DEST%\inc%_EXT%\sfx2\sfxbasecontroller.hxx
+hedabu: ..\inc\unoctitm.hxx %_DEST%\inc%_EXT%\sfx2\unoctitm.hxx
+hedabu: ..\inc\objuno.hxx %_DEST%\inc%_EXT%\sfx2\objuno.hxx
+hedabu: ..\inc\viewuno.hxx %_DEST%\inc%_EXT%\sfx2\viewuno.hxx
+hedabu: ..\inc\misccfg.hxx %_DEST%\inc%_EXT%\sfx2\misccfg.hxx
+hedabu: ..\inc\srchitem.hxx %_DEST%\inc%_EXT%\sfx2\srchitem.hxx
+hedabu: ..\inc\fontitem.hxx %_DEST%\inc%_EXT%\sfx2\fontitem.hxx
+hedabu: ..\inc\xmlmetae.hxx %_DEST%\inc%_EXT%\sfx2\xmlmetae.hxx
+hedabu: ..\inc\xmlmetai.hxx %_DEST%\inc%_EXT%\sfx2\xmlmetai.hxx
+hedabu: ..\inc\cntids.hrc %_DEST%\inc%_EXT%\sfx2\cntids.hrc
+hedabu: ..\inc\basmgr.hxx %_DEST%\inc%_EXT%\sfx2\basmgr.hxx
+
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
new file mode 100644
index 000000000000..d51cb9a994d0
--- /dev/null
+++ b/sfx2/sdi/appslots.sdi
@@ -0,0 +1,375 @@
+/*************************************************************************
+#*
+#* $RCSfile: appslots.sdi,v $
+#*
+#* Description shell SfxApplication
+#*
+#* Creation date MI 01/31/1995
+#* last change $Author: hr $ $Date: 2000-09-18 16:52:25 $
+#* $Revision: 1.1.1.1 $
+#*
+#* Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
+#*
+#************************************************************************/
+
+interface Module : Object
+[
+ Automation = FALSE;
+]
+{
+}
+
+interface Application : Module
+
+/* [Beschreibung]
+
+ Dieses ist die Funktionalit"at jeder SFx-Applikation. Ein solches Objekt
+ existiert genau einmal pro Applikation. Angesprochen wird es beispiels-
+ weise "uber 'StarWriter'.
+
+
+ [Anmerkungen]
+
+ Die von OLE-Automation gewnschten (optional) Methoden Repeat und Undo
+ sind von uns hier nicht sinnvoll implementierbar, da Repeat, Undo
+ und Redo Dokument-spezifisch sind.
+*/
+
+
+[
+ Automation = FALSE ;
+]
+{
+ //---------------------------------------------------------------------
+ SID_AUTOPILOTMENU // ole(no) api(final/play/rec)
+ [
+ ]
+
+ //---------------------------------------------------------------------
+ SID_FORMATMENU // ole(no) api(no)
+ [
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HELPMENU // ole(no) api(no)
+ [
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICKLIST // ole(no) api(no)
+ [
+ ]
+
+ //---------------------------------------------------------------------
+ SID_MDIWINDOWLIST // ole(no) api(no)
+ [
+ ]
+
+ //---------------------------------------------------------------------
+ SID_ABOUT // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_FOCUSURLBOX // ole(no) api(final/play/rec)
+ [
+ ExecMethod = INetExecute_Impl ;
+ StateMethod = INetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_SETOPTIONS
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_QUITAPP // ole(req) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HELPINDEX // ole(no) api(final/todo)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HELPONHELP // ole(no) api(final/todo)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_EXTENDEDHELP // ole(no) api(final/play/norec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HELPBALLOONS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HELPTIPS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CURRENTTIME // ole(no) api(final/play/norec)
+ [
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CURRENTDATE // ole(no) api(final/play/norec)
+ [
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_LOADCONFIG // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_SAVECONFIG // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CONFIG // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_TOOLBOXOPTIONS // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CONFIGSTATUSBAR // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CONFIGMENU // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CONFIGACCEL // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CONFIGEVENT // ole(no) api(final/play)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_ORGANIZER // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_ATTR_UNDO_COUNT // ole(no) api(final/play)
+ [
+ ExecMethod = PropExec_Impl ;
+ StateMethod = PropState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK1 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK2 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK3 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK4 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK5 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK6 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK7 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK8 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PICK9 // ole(no) api(no)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BASICSTOP // ole(no) api(final/play/norec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BASICBREAK // ole(no) api(final/play/norec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BROWSE_STOP // ole(no) api()
+ [
+ ExecMethod = INetExecute_Impl ;
+ StateMethod = INetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CLEARMEMCACHE
+ [
+ ExecMethod = INetExecute_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_LOAD_LIBRARY
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_UNLOAD_LIBRARY
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_ADD_LIBRARY
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_REMOVE_LIBRARY
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CRASH
+ [
+ ExecMethod = MiscExec_Impl ;
+ ]
+}
+
+ //=========================================================================
+
+shell SfxApplication
+
+/* [Beschreibung]
+
+ Dieses ist die Funktionalit"at jeder SFx-Applikation. Ein solches Objekt
+ existiert genau einmal pro Applikation. Angesprochen wird es beispiels-
+ weise "uber 'StarWriter'.
+
+
+ [Anmerkungen]
+
+ Die von OLE-Automation gewnschten (optional) Methoden Repeat und Undo
+ sind von uns hier nicht sinnvoll implementierbar, da Repeat, Undo
+ und Redo Dokument-spezifisch sind.
+*/
+
+{
+ import Application [Automation];
+ import Documents "Documents";
+
+ SID_NEWDOCDIRECT // ole(no) api(no)
+ [
+ ExecMethod = NewDocDirectExec_Impl ;
+ StateMethod = CreateDocState_Impl ;
+ ]
+
+ SID_CLOSEDOCS
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+/*
+ SID_NEWFRAMESET
+ [
+ ExecMethod = NewFramesetExec_Impl ;
+ StateMethod = CreateDocState_Impl ;
+ ]
+*/
+}
+
+shell SfxModule
+{
+ import Module;
+}
+
+// eof ------------------------------------------------------------------------
+
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi
new file mode 100644
index 000000000000..844ebcc92643
--- /dev/null
+++ b/sfx2/sdi/docslots.sdi
@@ -0,0 +1,408 @@
+/*=========================================================================
+ shell SfxObjectShell
+
+ (C) 1994-1995 StarDivision GmbH, Hamburg, Germany
+ $Author: hr $ $Date: 2000-09-18 16:52:25 $ $Revision: 1.1.1.1 $
+ $Logfile: T:/sfx2/sdi/docslots.sdv $ $Workfile: DOCSLOTS.SDI $
+=========================================================================*/
+
+
+
+
+interface Documents : Collection
+[
+ uuid = "61753B60-1114-101D-B8ED-3273768855A7" ;
+]
+{
+ //---------------------------------------------------------------------
+ SID_NEWDOC // ole(opt) api(final/play/rec)
+ [
+ ExecMethod = NewDocExec_Impl ;
+ StateMethod = CreateDocState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_OPENDOC // ole(no) api(final/play/rec)
+ [
+ ExecMethod = OpenDocExec_Impl ;
+ StateMethod = CreateDocState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_OPENURL // ole(no) api(no)
+ [
+ ExecMethod = OpenDocExec_Impl ;
+ StateMethod = CreateDocState_Impl ;
+ ]
+
+ SID_CURRENT_URL // ole(no) api(no)
+ [
+ StateMethod = CreateDocState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_OPENTEMPLATE // ole(no) api(final/play/rec)
+ [
+ ExecMethod = OpenDocExec_Impl ;
+ StateMethod = CreateDocState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_CLOSEDOCS // ole(req) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SAVEDOCS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+}
+
+ //=========================================================================
+
+interface DocumentInfo : Object
+[
+ uuid = "11A1EDE0-1308-101D-B8ED-3273768855A7"
+]
+{
+ //---------------------------------------------------------------------
+ SID_DOCINFO // ole(no) api(final/play)
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ BOOL Load SID_DOCINFO_LOAD ( String FileName SID_FILE_NAME ) ;
+ //---------------------------------------------------------------------
+ BOOL Save SID_DOCINFO_SAVE () ;
+}
+
+ //=========================================================================
+
+interface Document : Object
+[
+ Automation = FALSE ;
+]
+{
+ //---------------------------------------------------------------------
+ String Name // ole(no) api(final/play/norec)
+ [Readonly;]
+ //---------------------------------------------------------------------
+ SbxObject UNO SID_UNO // ole(no) api(final/play/norec)
+ [Readonly;]
+ //---------------------------------------------------------------------
+ SID_DOCTITLE // ole(opt) api(final/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOCPATH // ole(req) api(final/play/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOCFULLNAME // ole(req) api(final/play/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_CLOSEDOC // ole(req) api(final/play/rec)
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_CLOSING // ole(no) api(final/play/norec)
+ [
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ACTIVATE // ole(no) api(final/play/norec)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_CREATEDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_OPENDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_PREPARECLOSEDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_CLOSEDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_SAVEDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_SAVEASDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+
+ SID_ON_SAVEDOCDONE // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_ON_SAVEASDOCDONE // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_ACTIVATEDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_DEACTIVATEDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_ON_PRINTDOC // ole(no) api(final/play)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SfxObjectItem Module SID_ACTIVEMODULE
+ [
+ StateMethod = StateProps_Impl ;
+ ]
+}
+
+interface OfficeDocument : Document
+[
+ Automation = FALSE
+]
+{
+ //---------------------------------------------------------------------
+ SbxObject DocumentInfo // ole(no) api(final/plac/norec)
+ [
+ Readonly ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOCINFO_AUTHOR // ole(opt) api(todo)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOCINFO_COMMENTS // ole(opt) api(todo)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOCINFO_KEYWORDS // ole(opt) api(todo)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOC_READONLY // ole(opt) api(final/play/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOC_SAVED // ole(req) api(final/play/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOC_MODIFIED // ole(no) api(final/noplay/norec)
+ [
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_MODIFIED // ole(no) api(final/noplay/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SAVEDOC // ole(req) api(final/play/rec)
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SAVEASDOC // ole(req) api(final/play/rec)
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SAVEASURL // ole(no) api()
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOCTEMPLATE // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ExecFile_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PRINTDOC //ole(req) api(final/play/norec)
+ [
+ ExecMethod = PrintExec_Impl ;
+ StateMethod = NoState ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PRINTOUT // ole(opt) api(final/play/norec)
+ [
+ ExecMethod = PrintExec_Impl ;
+ StateMethod = PrintState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_DOC_LOADING // ole(no) api(final/play/norec)
+ [
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_IMG_LOADING // ole(no) api(final/play/norec)
+ [
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PLAYMACRO // ole(no) api(final/play/norec)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ SID_VERSION
+ [
+ ExecMethod = ExecFile_Impl;
+ StateMethod = GetState_Impl;
+ ]
+}
+
+ //=========================================================================
+
+shell SfxObjectShell
+
+/* [Beschreibung]
+
+ Funktionalit"at aller 'Dokumente' in SFx-Applikationen. Angesprochen
+ werden diese Objekte entweder als 'ActiveDocument' oder mit dem
+ Namen des Dokuments (i.d.R. der Dateiname) ohne Pfad in eckigen
+ Klammern (z.B. als '[unbenannt1]' oder '[brief6.sdw]').
+*/
+
+
+
+
+{
+ import OfficeDocument [Automation];
+ import DocumentInfo ".DocumentInfo";
+ //---------------------------------------------------------------------
+ SID_THISDOCUMENT // ole(no) api(no)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_THISWINDOW // ole(no) api(no)
+ [
+ ExecMethod = ExecProps_Impl ;
+ StateMethod = StateProps_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_FILE_NAME // ole(no) api(final/play/rec)
+ [
+ StateMethod = GetState_Impl ;
+ ]
+ SID_DOCINFO_TITLE // ole(no) api(final/play/rec)
+ [
+ StateMethod = GetState_Impl ;
+ ]
+} ;
+
+/*-------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.82 2000/07/26 19:10:04 mba
+ LoadLibrary only in App
+
+ Revision 1.81 2000/03/09 15:34:31 mba
+ #70338#: use SID_CURRENT_URL / CurrentURL
+
+ Revision 1.80 1999/10/06 15:19:52 mba
+ #68854#: Events nach Speichern
+
+ Revision 1.79 1998/06/23 10:30:40 MBA
+ SID_VERSION
+
+
+ Rev 1.78 23 Jun 1998 12:30:40 MBA
+ SID_VERSION
+
+ Rev 1.77 12 Jun 1998 15:56:06 MI
+ UNO-Objekt Zugriff
+
+ Rev 1.76 13 Nov 1997 12:50:08 MBA
+ Save an DocInfo ohne Parameter
+
+ Rev 1.75 28 Oct 1997 15:33:24 MBA
+ Bugfix #45146#: Author, Comments und Keywords implementiert
+
+ Rev 1.74 04 Sep 1997 13:20:06 MBA
+ OfficeDocument eingefuehrt
+
+ Rev 1.72 28 Aug 1997 12:20:44 MBA
+ Neue Interface-Namen
+
+ Rev 1.71 05 Aug 1997 17:36:36 MI
+ #42439# Module-Property war kaputt-gespielt
+
+ Rev 1.70 08 Jul 1997 19:34:36 MI
+ Flags bei ObjShells: InCloseEvent+HiddenLocked (#40060#)
+
+ Rev 1.69 03 Jul 1997 16:45:28 MBA
+ SID_MODIFIED
+
+ Rev 1.68 01 Jul 1997 12:45:54 MBA
+ LOAD/UNLOAD/ADD/REMOVE-Library
+
+ Rev 1.67 01 Jul 1997 12:38:32 MI
+ Modified-Property setzbar
+
+ Rev 1.66 12 May 1997 13:53:30 MBA
+ Seitenansicht raus
+
+-------------------------------------------------------------------------*/
+
+
+
+
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
new file mode 100644
index 000000000000..353a418aa2a9
--- /dev/null
+++ b/sfx2/sdi/frmslots.sdi
@@ -0,0 +1,696 @@
+/*=========================================================================
+ shell SfxViewFrame
+
+ (C) 1994-1995 StarDivision GmbH, Hamburg, Germany
+ $Author: hr $ $Date: 2000-09-18 16:52:25 $ $Revision: 1.1.1.1 $
+ $Logfile: T:/sfx2/sdi/frmslots.sdv $ $Workfile: FRMSLOTS.SDI $
+=========================================================================*/
+
+interface Window : Object
+[
+ Automation = FALSE ;
+]
+{
+ SID_CUSTOMIZETOOLBOX // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //----------------------------------------------------------------------
+ SID_HYPERLINK_INSERT
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //----------------------------------------------------------------------
+ SID_HYPERLINK_DIALOG
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //----------------------------------------------------------------------
+ SID_NAVIGATOR // status(final|play)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_SHOW_BROWSER // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_NEXTWINDOW
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PREVWINDOW
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BROWSER // ole(no) api()
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_PARTWIN // ole(no) api()
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_MAIL_CHILDWIN // ole(no) api()
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ SID_TIPWINDOW
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SEARCH_DLG // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HELP_PI // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ SID_TOGGLECOMMONTASKBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ SID_TOGGLENAVBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ SID_TOGGLEMACROBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ SID_TOGGLEOPTIONBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_TOGGLEFUNCTIONBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_TOGGLEOBJECTBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_TOGGLETOOLBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ToolboxExec_Impl ;
+ StateMethod = ToolboxState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_TOGGLESTATUSBAR // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ SID_STYLE_DESIGNER // ole(no) api(final/play/rec)
+ [
+ ReadOnlyDoc = FALSE ;
+ ExecMethod = ChildWindowExecute ;
+ StateMethod = ChildWindowState ;
+ ]
+
+ // Window.Document
+ SID_DOCUMENT
+ [
+ StateMethod = PropState_Impl;
+ ]
+
+ // Window.GetTopWindow
+ SID_TOPWINDOW
+ [
+ StateMethod = PropState_Impl;
+ ]
+
+ // Window.ParentWindow
+ SID_PARENTFRAME
+ [
+ StateMethod = PropState_Impl;
+ ]
+
+ // Window.IsTopWindow
+ SID_ISTOP
+ [
+ StateMethod = PropState_Impl;
+ ]
+
+ // Window.GetActiveFrameWindow
+ SfxObjectItem ActiveFrameWindow SID_ACTIVEWINDOW
+ [
+ StateMethod = PropState_Impl;
+ ]
+
+ // Window.GetFrameCount
+ SID_FRAMECOUNT
+ [
+ StateMethod = PropState_Impl;
+ ]
+
+ // Window.GetFrameWindow( "Name" )
+ SID_FILLFRAME
+ [
+ ExecMethod = ExecView_Impl;
+ ]
+
+ // Nur f"ur Gestalter: Slot mu\s vorhanden sein
+ SID_STYLE_NEW
+ [
+ Export = FALSE;
+ ]
+
+ // Nur f"ur Gestalter: Slot mu\s vorhanden sein
+ SID_STYLE_DRAGHIERARCHIE
+ [
+ Export = FALSE;
+ ]
+
+ SID_CLEARHISTORY // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ExecHistory_Impl ;
+ StateMethod = StateHistory_Impl ;
+ ]
+
+ SID_UNDO // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ExecHistory_Impl ;
+ StateMethod = StateHistory_Impl ;
+ ]
+
+ SID_REDO // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ExecHistory_Impl ;
+ StateMethod = StateHistory_Impl ;
+ ]
+
+ SID_REPEAT // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ExecHistory_Impl ;
+ StateMethod = StateHistory_Impl ;
+ ]
+
+ // Basic-only property Window.Selection
+ SbxObject Selection SID_SELECTION // ole(no) api(final/play/rec)
+ [
+ ]
+
+ // Basic-only property: Window.View
+ SbxObject View SID_VIEW
+ [
+ ]
+
+ // Stringlist mit den Verben( SFX only )
+ SID_OBJECT // ole(no) api(no)
+ [
+ StateMethod = GetState_Impl ;
+ ]
+
+ // F"ur slots.sdc-Macros eingebaut
+ SfxStringItem ConvertString SID_CONVERTSTRING
+ (
+ SfxStringItem Which SID_CONVERTSTRING
+ )
+ [
+ ExecMethod = ExecView_Impl ;
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Synchron;
+ Container = TRUE,
+ PlugComm = FALSE,
+ Export = TRUE,
+ Hidden = TRUE,
+ IsCollection = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+ ]
+/*
+ SfxStringItem GetHelpText SID_HELP_STRING
+ (
+ SfxUInt16Item Which SID_CONFIGITEMID
+ )
+ [
+ ExecMethod = ExecView_Impl ;
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Synchron;
+ Container = TRUE,
+ PlugComm = FALSE,
+ Export = TRUE,
+ Hidden = TRUE,
+ IsCollection = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+ ]
+
+ SfxStringItem GetFunctionName SID_METHODNAME
+ (
+ SfxUInt16Item Which SID_CONFIGITEMID
+ )
+ [
+ ExecMethod = ExecView_Impl ;
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Synchron;
+ Container = TRUE,
+ PlugComm = FALSE,
+ Export = TRUE,
+ Hidden = TRUE,
+ IsCollection = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+ ]
+
+ SfxBoolItem IsToolboxConfig SID_CONFIGITEMID
+ (
+ SfxUInt16Item Which SID_CONFIGITEMID
+ )
+ [
+ ExecMethod = ExecView_Impl ;
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Synchron;
+ Container = TRUE,
+ PlugComm = FALSE,
+ Export = TRUE,
+ Hidden = TRUE,
+ IsCollection = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+ ]
+*/
+}
+
+interface BrowseWindow : Window
+[
+ Automation = FALSE ;
+]
+{
+ SID_ACTIVATE // ole(no) api(final/play/rec)
+ [
+ // Implementierung in Subklassen
+ ]
+
+ SID_NEWWINDOW // ole(no) api(play/rec)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+
+ SID_EDITDOC // ole(?opt) api(play/rec)
+ [
+ ExecMethod = ExecReload_Impl ;
+ StateMethod = StateReload_Impl ;
+ ]
+
+ SID_RELOAD // ole(?opt) api(play/rec)
+ [
+ ExecMethod = ExecReload_Impl ;
+ StateMethod = StateReload_Impl ;
+ ]
+
+ SID_VIEWSHELL // ole(no) api(no)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+
+ SID_VIEWSHELL0 // ole(no) api(no)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+
+ SID_VIEWSHELL1 // ole(no) api(no)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+
+ SID_VIEWSHELL2 // ole(no) api(no)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+
+ SID_VIEWSHELL3 // ole(no) api(no)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+
+ SID_VIEWSHELL4 // ole(no) api(no)
+ [
+ ExecMethod = ExecView_Impl ;
+ StateMethod = StateView_Impl ;
+ ]
+}
+
+interface TopWindow : BrowseWindow
+[
+ Automation = FALSE ;
+]
+{
+ SID_WIN_FULLSCREEN // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ SID_FRAMETITLE // ole(no) api(play/rec)
+ [
+ StateMethod = StateView_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_WIN_POSSIZE // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------{
+ SID_OPTIMIZEWIN // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------{
+ SID_WIN_MINIMIZED // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------{
+ SID_WIN_MAXIMIZED // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------{
+ SID_RESTOREWIN // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CLOSEWIN // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BROWSE_FORWARD // ole(no) api()
+ [
+ ExecMethod = INetExecute_Impl ;
+ StateMethod = INetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BROWSE_BACKWARD // ole(no) api()
+ [
+ ExecMethod = INetExecute_Impl ;
+ StateMethod = INetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_BROWSE_HOME // ole(no) api()
+ [
+ ExecMethod = INetExecute_Impl ;
+ StateMethod = INetState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CREATELINK // ole(no) api()
+ [
+ ExecMethod = INetExecute_Impl ;
+ StateMethod = INetState_Impl ;
+ ]
+}
+
+ //=========================================================================
+
+shell SfxViewFrame
+
+/* [Beschreibung]
+
+ Funktionalit"at jedes Fensters, in dem spezifische Views (Ansichten)
+ eines Dokuments dargestellt werden. Angesprochen werden diese Objekte
+ entweder als 'ActiveWindow' oder mit dem Namen des Dokuments (i.d.R.
+ der Dateiname) ohne Pfad aber mit der Nummer des Fensters, alles in eckigen Klammern (z.B. als
+ '[unbenannt1:1]' oder '[brief6.sdw:4]'). Im Ggs. zur Anzeige in der
+ Caption-Bar (solange nur ein Fenster f"ur das betreffende Dokument
+ existiert) darf die Nummer niemals ausgelassen werden. Die Numerierung
+ beginnt bei 1 und ist f"ur die Existenz des Fensters stabil.
+
+
+ [Anmerkung]
+
+ Im StarWriter ist das Verhalten einiger dieser Funktionen nicht definiert,
+ da dieser seinen eigenen History-Mechanismus hat.
+*/
+
+
+{
+ import BrowseWindow [Automation];
+}
+
+/*-------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.48 2000/09/12 10:42:32 mba
+ ChildWindow slot all in SfxViewFrame
+
+ Revision 1.47 2000/09/01 17:32:04 mba
+ some slots moved from appslots
+
+ Revision 1.46 1998/07/29 09:42:28 MI
+ #53054# Bookmarks auch ohne alten Explorer ablegbar
+
+
+ Rev 1.45 29 Jul 1998 11:42:28 MI
+ #53054# Bookmarks auch ohne alten Explorer ablegbar
+
+ Rev 1.44 16 Jan 1998 11:34:08 MBA
+ Topframe und Taskframe zusammengefasst
+
+ Rev 1.43 13 Nov 1997 12:51:56 MBA
+ Property Name gehoert in base class
+
+ Rev 1.42 28 Aug 1997 12:22:30 MBA
+ Neue Interface-Namen; BrowseWindow
+
+ Rev 1.40 28 May 1997 15:14:42 TLX
+ DOCFRAME war doppelt
+
+ Rev 1.39 13 May 1997 17:52:40 MBA
+ SID_VIEW fuer OLE-Automation
+
+ Rev 1.38 09 May 1997 18:15:16 MBA
+ Neue Slots fuer Frames-Handling ( BASIC, C-API )
+
+ Rev 1.37 06 Apr 1997 12:38:48 NF
+ syntax
+
+ Rev 1.36 05 Apr 1997 20:51:16 NF
+ Syntax
+
+ Rev 1.35 06 Mar 1997 12:38:06 MBA
+ Slots fuer Bmp-Listen
+
+ Rev 1.34 04 Mar 1997 12:37:54 MI
+ SID_TOPWINDOW
+
+ Rev 1.33 23 Feb 1997 21:20:50 MBA
+ SID_RELOAD, SID_EDITDOC raus
+
+ Rev 1.32 18 Dec 1996 15:57:42 MI
+ SID_LASTVERSIONDOC
+
+ Rev 1.31 09 Dec 1996 12:04:50 MBA
+ Helptext,Configname raus
+
+ Rev 1.30 06 Dec 1996 10:44:34 MI
+ Document-Property (SID_DOCUMENT)
+
+ Rev 1.29 28 Nov 1996 09:58:58 MBA
+ Voruebergehend: SID_CONVERTSTRING
+
+ Rev 1.28 06 Nov 1996 10:55:50 TLX
+ Gestalter Defaults
+
+ Rev 1.27 24 Oct 1996 13:49:36 MI
+ #32691# (OLE)-Object-Menu auch in plugins enablen
+
+ Rev 1.26 22 Oct 1996 20:10:16 HJS
+ merge 22.10.96
+
+ Rev 1.25 08 Oct 1996 14:30:36 HJS
+ merge 08.10.96
+
+ Rev 1.24 24 Sep 1996 16:37:54 MBA
+ SID_FRAME_TITLE in newslots.idl
+
+ Rev 1.23 12 Sep 1996 17:32:28 TLX
+ FRAMETITLE
+
+ Rev 1.22 12 Sep 1996 15:44:50 MBA
+
+
+ Rev 1.21 11 Sep 1996 13:09:58 TLX
+ LASTVERSION und EDITDOC in den ViewFrame
+
+ Rev 1.20 09 Sep 1996 16:42:40 MBA
+ Neue Slotfiles
+
+ Rev 1.19 30 Aug 1996 13:42:26 HJS
+ eu...
+
+ Rev 1.18 27 Aug 1996 18:55:42 MBA
+ SID_VIEWSHELL etc. an ViewFrame
+
+ Rev 1.17 30 Jul 1996 15:41:02 MI
+ fix #29879# Undo/Redo waren beim asynch laden enabled
+
+ Rev 1.16 16 Jul 1996 13:14:04 TLX
+ PlugComm eingetragen
+
+ Rev 1.15 12 Jul 1996 13:51:30 MI
+ fix #29412# Redo/Repeat waren Method+R/W-Prop daher GPF aus BASIC
+
+ Rev 1.14 08 Jul 1996 16:50:16 HJS
+ uebersetzung
+
+ Rev 1.13 30 Mar 1996 21:13:40 MI
+ Selection-Object jetzt per Property (effizienter)
+
+ Rev 1.12 20 Feb 1996 17:29:38 MI
+ Selection-Property
+
+ Rev 1.11 12 Dec 1995 18:50:54 MI
+ Ableitung von _Object
+
+ Rev 1.10 05 Dec 1995 10:46:30 MI
+ Fix #22800 Rechtschreibfehler
+
+ Rev 1.9 05 Dec 1995 09:36:16 MI
+ interne Interfaces nicht exportieren
+
+ Rev 1.8 28 Nov 1995 17:34:16 MI
+ neue Tags
+
+ Rev 1.7 23 Nov 1995 17:29:56 MI
+ neue IDL
+
+ Rev 1.6 18 Oct 1995 09:00:48 MI
+ Properties und Methoden duerfen nicht den gleichen Namen haben
+
+ Rev 1.5 17 Oct 1995 16:14:52 KL
+ Ueberarbeitung nach MS-Standard
+
+ Rev 1.4 11 Oct 1995 18:16:02 MI
+ undo: MS-kompatible Namen
+
+ Rev 1.3 06 Oct 1995 15:51:08 MI
+ HelpTexts scharfgeschaltet
+
+ Rev 1.2 29 Aug 1995 14:06:52 MI
+ Checkliste eingebaut
+
+-------------------------------------------------------------------------*/
+
+
+
+
+
diff --git a/sfx2/sdi/makefile.mk b/sfx2/sdi/makefile.mk
new file mode 100644
index 000000000000..2e489d83cd7c
--- /dev/null
+++ b/sfx2/sdi/makefile.mk
@@ -0,0 +1,105 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:25 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..
+
+PRJNAME=sfx2
+TARGET=sfxslots
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+SDINAME=$(TARGET)
+SDIEXPORT=newslots
+SIDHRCNAME=sfx.hrc
+
+# --- Files --------------------------------------------------------
+
+SVSDIDEPEND= \
+ $(PRJ)$/inc$/sfxsids.hrc \
+ sfx.sdi \
+ appslots.sdi \
+ sfxslots.sdi \
+ options.sdi \
+ progress.sdi \
+ docslots.sdi \
+ ipfslots.sdi \
+ mdislots.sdi \
+ viwslots.sdi \
+ pinslots.sdi \
+ frsslots.sdi \
+ object.sdi \
+ frmslots.sdi \
+ genslots.sdi \
+ newslots.sdi
+
+SRCFILES = \
+ sfxslots.src
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/sdi/mdislots.sdi b/sfx2/sdi/mdislots.sdi
new file mode 100644
index 000000000000..e177b74ce674
--- /dev/null
+++ b/sfx2/sdi/mdislots.sdi
@@ -0,0 +1,404 @@
+/*=========================================================================
+ shell SfxMDIFrame
+
+ (C) 1994-1995 StarDivision GmbH, Hamburg, Germany
+ $Author: hr $ $Date: 2000-09-18 16:52:25 $ $Revision: 1.1.1.1 $
+ $Logfile: T:/sfx2/sdi/mdislots.sdv $ $Workfile: MDISLOTS.SDI $
+=========================================================================*/
+
+
+
+
+interface Windows : Collection
+[
+ uuid = "7ADC8720-1114-101D-B8ED-3273768855A7" ;
+]
+{
+ //---------------------------------------------------------------------
+ SID_CASCADEWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_TILEWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_HORIZONTALWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_VERTICALWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_ARRANGEICONS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_CLOSEWINS // ole(opt) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SID_MINIMIZEWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = MiscExec_Impl ;
+ StateMethod = MiscState_Impl ;
+ ]
+}
+
+
+interface Task : Object
+[
+ uuid = "FC02CBE1-8D8A-11d1-89CC-00A0249D57BE" ;
+
+]
+{
+ //-----------------------------------------------------------------
+ SfxVoidItem CloseActiveWindow SID_CLOSEWIN ()
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_FLOATING_TASK
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_INSERT_TASKFRAME
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_TASK_ALWAYSVISIBLE
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SfxBoolItem Tile SID_TILEDOCKWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SfxBoolItem ArrangeHorizontal SID_HORIZONTALDOCKWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+
+ //---------------------------------------------------------------------
+ SfxBoolItem ArrangeVertical SID_VERTICALDOCKWINS // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+
+ SID_ACTIVEWINDOW
+ [
+ StateMethod = State_Impl;
+ ]
+
+ SID_CLOSETASK
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+
+ SID_NEXTWINDOW
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+
+ SID_PREVWINDOW
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = State_Impl ;
+ ]
+}
+
+interface TaskPartWindow : TopWindow
+[
+ uuid = "A5EEDEF0-9CA3-11D1-AA41-00A0249D57BE";
+]
+{
+ // Window.Task
+ SID_TASK
+ [
+ StateMethod = GetState_Impl;
+ ]
+}
+
+ //=========================================================================
+
+shell SfxTopViewFrame : SfxViewFrame
+
+/* [Beschreibung]
+
+ Funktionalit"at jedes MDI-Fensters, in dem spezifische Views (Ansichten)
+ eines Dokuments dargestellt werden. Angesprochen werden diese Objekte
+ entweder als 'ActiveWindow' oder mit dem Namen des Dokuments (i.d.R.
+ der Dateiname) ohne Pfad aber mit der Nummer des Fensters, alles in eckigen Klammern (z.B. als
+ '[unbenannt1:1]' oder '[brief6.sdw:4]'). Im Ggs. zur Anzeige in der
+ Caption-Bar (solange nur ein Fenster f"ur das betreffende Dokument
+ existiert) darf die Nummer niemals ausgelassen werden. Die Numerierung
+ beginnt bei 1 und ist f"ur die Existenz des Fensters stabil.
+*/
+{
+ import TaskPartWindow [Automation];
+
+ // Slot ist schon in base interface, Exec/State-Methoden sind spezifisch
+ SID_ACTIVATE // ole(no) api(final/play/rec)
+ [
+ ExecMethod = Exec_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+
+ // Mu\s einfach nur drin sein, damit nicht disabled
+ SID_TOPDOC
+ [
+ ]
+}
+
+shell SfxExternalTopViewFrame_Impl : SfxViewFrame
+
+/* [Beschreibung]
+
+ Funktionalit"at jedes MDI-Fensters, in dem spezifische Views (Ansichten)
+ eines Dokuments dargestellt werden. Angesprochen werden diese Objekte
+ entweder als 'ActiveWindow' oder mit dem Namen des Dokuments (i.d.R.
+ der Dateiname) ohne Pfad aber mit der Nummer des Fensters, alles in eckigen Klammern (z.B. als
+ '[unbenannt1:1]' oder '[brief6.sdw:4]'). Im Ggs. zur Anzeige in der
+ Caption-Bar (solange nur ein Fenster f"ur das betreffende Dokument
+ existiert) darf die Nummer niemals ausgelassen werden. Die Numerierung
+ beginnt bei 1 und ist f"ur die Existenz des Fensters stabil.
+*/
+{
+ import TopWindow [Automation];
+
+ // Slot ist schon in base interface, Exec/State-Methoden sind spezifisch
+ SID_ACTIVATE // ole(no) api(final/play/rec)
+ [
+// ExecMethod = Exec_Impl ;
+// StateMethod = GetState_Impl ;
+ ]
+
+ // Mu\s einfach nur drin sein, damit nicht disabled
+ SID_TOPDOC
+ [
+ ]
+}
+
+shell SfxTask
+{
+ import Task [Automation];
+}
+
+/*-------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.66 1999/02/09 16:36:54 MBA
+ Fix #61564#: ArrangeSlots ohne Toggle
+
+
+ Rev 1.65 09 Feb 1999 17:36:54 MBA
+ Fix #61564#: ArrangeSlots ohne Toggle
+
+ Rev 1.64 20 Jan 1999 11:09:00 MBA
+ Fix #58947#: eigene Slots fuer Task-Arrange
+
+ Rev 1.63 18 Dec 1998 18:06:08 MBA
+ Fix #58947#: Next/PrevWindow
+
+ Rev 1.62 18 May 1998 13:31:48 MBA
+ ExternalTopViewFrame
+
+ Rev 1.61 04 Feb 1998 11:11:14 MBA
+ Import korrigiert
+
+ Rev 1.60 04 Feb 1998 10:45:20 MBA
+ Interface TaskPartWindow, neue TaskSlots
+
+ Rev 1.59 29 Jan 1998 10:07:20 MBA
+ SID_INSERT_FRAME jetzt SID_INSERT_TASKFRAME
+
+ Rev 1.58 26 Jan 1998 11:11:14 MBA
+ Neuer Slot SID_INSERT_FRAME
+
+ Rev 1.57 21 Jan 1998 09:53:22 MBA
+ Neue TaskSlots
+
+ Rev 1.56 19 Jan 1998 15:17:34 MBA
+ SID_SPLIT_TASK...
+
+ Rev 1.55 16 Jan 1998 11:33:50 MBA
+ SfxTopViewFrame, SfxTask
+
+ Rev 1.54 13 Nov 1997 12:49:32 MBA
+ Property Name gehoert in base class
+
+ Rev 1.53 28 Aug 1997 12:23:34 MBA
+ Neue Interface-Namen
+
+ Rev 1.52 04 Jun 1997 12:16:30 PB
+ rmv: alte Slots
+
+ Rev 1.51 23 Feb 1997 21:20:02 MBA
+ SID_RELOAD, SID_EDITDOC
+
+ Rev 1.50 19 Feb 1997 16:42:08 MBA
+ SID_TOPDOC
+
+ Rev 1.49 09 Dec 1996 12:06:30 MBA
+ Helptext,Configname raus
+
+ Rev 1.48 24 Oct 1996 13:49:34 MI
+ #32691# (OLE)-Object-Menu auch in plugins enablen
+
+ Rev 1.47 22 Oct 1996 20:10:18 HJS
+ merge 22.10.96
+
+ Rev 1.46 16 Oct 1996 15:14:50 MBA
+ SID_EDIT_FRAMESET entfernt
+
+ Rev 1.45 08 Oct 1996 14:30:38 HJS
+ merge 08.10.96
+
+ Rev 1.44 12 Sep 1996 18:19:56 TLX
+ State_Impl -> StateView_Impl
+
+ Rev 1.43 12 Sep 1996 18:13:06 TLX
+ NEWWINDOW in Window
+
+ Rev 1.42 12 Sep 1996 15:44:42 MBA
+
+
+ Rev 1.41 11 Sep 1996 13:10:10 TLX
+ LASTVERSION und EDITDOC in den ViewFrame
+
+ Rev 1.40 09 Sep 1996 16:42:48 MBA
+ Neue Slotfiles
+
+ Rev 1.39 05 Sep 1996 12:49:10 WP
+ Mergefehler
+
+ Rev 1.38 30 Aug 1996 13:41:40 HJS
+ eu...
+
+ Rev 1.38 30 Aug 1996 13:39:40 HJS
+
+ Rev 1.37 27 Aug 1996 18:55:30 MBA
+ SID_VIEWSHELL etc. an ViewFrame
+
+ Rev 1.36 19 Aug 1996 11:48:38 TLX
+ Neuer SuperCache Mode
+
+ Rev 1.35 12 Aug 1996 15:36:08 MBA
+ SID_EDIT_FRAMESETS kein ReadOnlyDoc-Slot
+
+ Rev 1.34 03 Aug 1996 09:13:12 EL
+ SID_CREATELINK_INSELECTED
+
+ Rev 1.33 30 Jul 1996 15:05:28 MI
+ fix #29621# Ablegen von Bookmarks bei unbenanntem Doc
+
+ Rev 1.32 24 Jun 1996 18:07:34 MI
+ fix #28983# 'bearbeiten' falsch geschrieben
+
+ Rev 1.31 21 Jun 1996 14:16:36 MBA
+ SID_RESTOREWIN
+
+ Rev 1.30 14 Jun 1996 16:02:14 MBA
+ ConfigName fuer SID_EDIT_FRAMESET
+
+ Rev 1.29 06 Jun 1996 18:01:28 MBA
+ New SID_EDIT_FRAMESET
+
+ Rev 1.28 28 May 1996 16:36:56 MBA
+ Neue INET-Slots
+
+ Rev 1.27 11 Mar 1996 10:32:08 MI
+ SID_EDITDOC
+
+ Rev 1.26 09 Mar 1996 17:21:24 MI
+ kein OpenUrl am ViewFrame
+
+ Rev 1.25 28 Feb 1996 21:34:52 MI
+ SID_OPENURL
+
+ Rev 1.24 17 Jan 1996 10:43:06 MI
+ Windows.Close mit Returnwert (Grosskunden)
+
+ Rev 1.23 11 Jan 1996 18:46:30 MI
+ fix #24226# Groessenaenderungen relativ Recorden
+
+ Rev 1.22 15 Dec 1995 19:06:32 MI
+ Area etc. Absolut recorden
+
+ Rev 1.21 13 Dec 1995 14:32:14 MI
+ Name-Property explizit
+
+ Rev 1.20 12 Dec 1995 18:50:32 MI
+ Windows ohne Coll...
+
+ Rev 1.19 07 Dec 1995 12:58:18 MI
+ Area
+
+ Rev 1.18 06 Dec 1995 21:56:50 MI
+ Windows
+
+ Rev 1.17 05 Dec 1995 09:36:10 MI
+ interne Interfaces nicht exportieren
+
+ Rev 1.16 04 Dec 1995 19:09:36 MI
+ Minimized/Maximized
+
+ Rev 1.15 03 Dec 1995 11:54:04 MI
+ interface Window
+
+ Rev 1.14 30 Nov 1995 10:34:20 MI
+ SwitchViewShell nicht exportiert
+
+ Rev 1.13 28 Nov 1995 17:34:18 MI
+ neue Tags
+
+ Rev 1.12 23 Nov 1995 17:30:14 MI
+ neue IDL
+
+ Rev 1.11 17 Oct 1995 16:14:54 KL
+ Ueberarbeitung nach MS-Standard
+
+ Rev 1.10 06 Oct 1995 15:51:16 MI
+ HelpTexts scharfgeschaltet
+
+ Rev 1.9 29 Aug 1995 14:07:36 MI
+ Checkliste eingebaut
+
+-------------------------------------------------------------------------*/
+
+
+
+
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
new file mode 100644
index 000000000000..b34a3c309db4
--- /dev/null
+++ b/sfx2/sdi/sfx.sdi
@@ -0,0 +1,9267 @@
+//--------------------------------------------------------------------------
+SfxVoidItem AboutDialog SID_ABOUT
+()
+[
+ UnoName = "About";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem AddBookmark SID_CREATELINK
+(SfxStringItem URL SID_BOOKMARK_URL,SfxStringItem Title SID_BOOKMARK_TITLE)
+[
+ UnoName = "AddBookmark";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BrowseBackward SID_BROWSE_BACKWARD
+(SfxUInt16Item nSteps SID_BROWSE_BACKWARD)
+[
+ UnoName = "BrowseBackward";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BrowseForward SID_BROWSE_FORWARD
+(SfxUInt16Item nSteps SID_BROWSE_FORWARD)
+[
+ UnoName = "BrowseForward";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CancelDownloads SID_BROWSE_STOP
+()
+[
+ UnoName = "Cancel";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxBoolItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Close SID_CLOSEWIN
+()
+[
+ UnoName = "CloseFrame";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Copy SID_COPY
+()
+[
+ UnoName = "Copy";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CrashApp SID_CRASH
+(SfxBoolItem Direct SID_CRASH)
+[
+ UnoName = "Crash";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateBookmark SID_EXPLORER_CREATEBOOKMARK
+()
+[
+ UnoName = "CreateBookmark";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateDatabase SID_EXPLORER_CREATEDATABASE
+()
+[
+ UnoName = "CreateDatabase";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateFolder SID_EXPLORER_CREATEFOLDER
+()
+[
+ UnoName = "CreateFolder";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateFtpServer SID_EXPLORER_CREATEFTPSERVER
+()
+[
+ UnoName = "CreateFtpServer";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateGallery SID_EXPLORER_CREATEGALLERY
+()
+[
+ UnoName = "CreateGallery";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateIMapAccount SID_EXPLORER_CREATEIMAPACCOUNT
+()
+[
+ UnoName = "CreateIMapAccount";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateLink SID_EXPLORER_CREATELINK
+()
+[
+ UnoName = "CreateLink";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateLink_InSelected SID_CREATELINK_INSELECTED
+(SfxStringItem URL SID_BOOKMARK_URL,SfxStringItem Title SID_BOOKMARK_TITLE)
+[
+ UnoName = "CreateLinkInSelected";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateNewsServer SID_EXPLORER_CREATENEWS
+()
+[
+ UnoName = "CreateNewsServer";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateOuttray SID_EXPLORER_CREATEOUTTRAY
+()
+[
+ UnoName = "CreateOuttray";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreatePOP3Account SID_EXPLORER_CREATEPOP3ACCOUNT
+()
+[
+ UnoName = "CreatePOP3Account";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateSearchFolder SID_EXPLORER_CREATESEARCHFOLDER
+()
+[
+ UnoName = "CreateSearchFolder";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateWorkplace SID_EXPLORER_CREATEWORKPLACE
+()
+[
+ UnoName = "CreateWorkplace";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem CurrentURL SID_CURRENT_URL
+
+[
+ UnoName = "CurrentURL";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Cut SID_CUT
+()
+[
+ UnoName = "Cut";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Delete SID_DELETE
+()
+[
+ UnoName = "Delete";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem IsDesktop SID_EXPLORER_ISDESKTOP
+
+[
+ UnoName = "DesktopFolder";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ExplorerDetails SID_EXPLORER_DETAILS
+
+[
+ UnoName = "Details";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ExplorerDocinfo SID_EXPLORER_DOCINFO
+
+[
+ UnoName = "DocInfo";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ReloadForEdit SID_EDITDOC
+(SfxBoolItem Editable SID_EDITDOC)
+[
+ UnoName = "EditDoc";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem FocusBeamer SID_FOCUS_BEAMER
+
+[
+ UnoName = "FocusBeamer";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem FocusExplorer SID_FOCUS_EXPLORER
+
+[
+ UnoName = "FocusExplorer";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem GroupView SID_GROUPVIEW
+()
+[
+ UnoName = "GroupView";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ImportBmkFile SID_EXPLORER_IMPORTBOOKMARKS
+()
+[
+ UnoName = "ImportBookmarks";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem MakeExplorerRoot SID_EXPLORER_MAKEROOT
+()
+[
+ UnoName = "MakeRoot";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem ModifiedStatus SID_DOC_MODIFIED
+
+[
+ UnoName = "Modified";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem MultiQuickSearch SID_EXPLORER_MULTIQUICKSEARCH
+
+[
+ UnoName = "MultiQuickSearch";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem NextWindow SID_NEXTWINDOW
+()
+[
+ UnoName = "NextWindow";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OpenUrl SID_OPENURL
+
+[
+ UnoName = "OpenURL";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Options SID_OPTIONS
+()
+[
+ UnoName = "Options";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Paste SID_PASTE
+()
+[
+ UnoName = "Paste";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem PGPDecode SID_PGP_DECODE
+()
+[
+ UnoName = "PGPDecode";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem PGPEncode SID_PGP_ENCODE
+(SfxBoolItem Encrypt FN_PARAM_1,SfxBoolItem Sign FN_PARAM_2)
+[
+ UnoName = "PGPEncode";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ExplorerPreview SID_EXPLORER_PREVIEW
+
+[
+ UnoName = "Preview";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem PreviousWindow SID_PREVWINDOW
+()
+[
+ UnoName = "PreviousWindow";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SwitchToPrevLevel SID_EXPLORER_PREVLEVEL
+()
+[
+ UnoName = "PrevLevel";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Print SID_PRINTDOC
+(SfxInt16Item from SID_PRINT_FIRST_PAGE,SfxInt16Item to SID_PRINT_LAST_PAGE,SfxInt16Item copies SID_PRINT_COPIES,SfxBoolItem silent SID_SILENT)
+[
+ UnoName = "Print";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem PrintDefault SID_PRINTDOCDIRECT
+()
+[
+ UnoName = "PrintDefault";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem PrinterSetup SID_SETUPPRINTER
+()
+[
+ UnoName = "PrinterSetup";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Properties SID_PROPERTIES
+()
+[
+ UnoName = "Properties";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxDocumentInfoItem DocInfo SID_DOCINFO
+
+[
+ UnoName = "Properties";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem RedoAction SID_REDO
+[
+ SfxVoidItem Redo();
+
+ UnoName = "Redo";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Reload SID_RELOAD
+()
+[
+ UnoName = "Reload";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxBoolItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem RepeatAction SID_REPEAT
+[
+ SfxVoidItem Repeat();
+
+ UnoName = "Repeat";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Save SID_SAVEDOC
+(SfxStringItem VersionComment SID_VERSION,SfxStringItem Author SID_DOCINFO_AUTHOR)
+[
+ UnoName = "Save";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SaveAs SID_SAVEASDOC
+(SfxStringItem FileName SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem PassWord SID_DOC_READONLY,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS)
+[
+ UnoName = "SaveAs";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SaveAsTemplate SID_DOCTEMPLATE
+(SfxStringItem TemplateRegion SID_TEMPLATE_REGIONNAME,SfxStringItem TemplateName SID_TEMPLATE_NAME)
+[
+ UnoName = "SaveAsTemplate";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ScrollBodyPageDown SID_MAIL_SCROLLBODY_PAGEDOWN
+()
+[
+ UnoName = "ScrollMailBodyPageDown";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ExecuteSearch FID_SEARCH_NOW
+(SvxSearchItem SearchItem SID_SEARCH_ITEM)
+[
+ UnoName = "Search";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SearchDialog SID_SEARCH_DLG
+
+[
+ UnoName = "SearchDialog";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ExplorerSearch SID_EXPLORER_SEARCH_DLG
+
+[
+ UnoName = "SearchFolder";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item SearchOptions SID_SEARCH_OPTIONS
+
+[
+ UnoName = "SearchOptions";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SearchOriginal SID_EXPLORER_SEARCHORIGINAL
+()
+[
+ UnoName = "SearchOriginal";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SvxSearchItem _Search SID_SEARCH_ITEM
+
+[
+ UnoName = "SearchProperties";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SelectAll SID_SELECTALL
+()
+[
+ UnoName = "SelectAll";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem ExplorerSelectionSize SID_EXPLORER_SELECTIONSIZE
+
+[
+ UnoName = "SelectionSize";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SetAsBookmarkDir SID_EXPLORER_MAKEBMKDIR
+()
+[
+ UnoName = "SetAsBookmarkDir";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GalleryBackground SID_GALLERY_BG_BRUSH
+(SfxStringItem ImageFile SID_FILE_NAME)
+[
+ UnoName = "SetBackgroundImage";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INSERT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem FramesetSource SID_SOURCEVIEW
+
+[
+ UnoName = "SourceView";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ExplorerSymbols SID_EXPLORER_ICONS
+
+[
+ UnoName = "Symbols";
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SyncExplorer SID_SYNCEXPLORER
+()
+[
+ UnoName = "SyncExplorer";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem UndoAction SID_UNDO
+[
+ SfxVoidItem Undo();
+
+ UnoName = "Undo";
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoUpBlockSel SID_CURSORPAGEUP_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoUpSel SID_CURSORUP_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnSaveAs SID_ON_SAVEASDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoLeftBlock SID_CURSORPAGELEFT
+(SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoDownBlockSel SID_CURSORPAGEDOWN_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpDownload SID_HELP_DOWNLOAD
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item EditStyle SID_STYLE_EDIT
+(SfxStringItem Param SID_STYLE_EDIT,SfxUInt16Item Family SID_STYLE_FAMILY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToStartSel SID_CURSORTOPOFFILE_SEL
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadStatusBar SID_CONFIGSTATUSBAR
+(SfxStringItem FileName SID_CFGFILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoRightSel SID_CURSORRIGHT_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnDeactivate SID_ON_DEACTIVATEDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ActiveModule SID_ACTIVEMODULE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem FileName SID_FILE_NAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Tile SID_TILEWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoRight SID_CURSORRIGHT
+(SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StyleCatalog SID_STYLE_CATALOG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem FrameContent SID_FRAME_CONTENT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry8 SID_PICK8
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CursorEndOfScreen SID_CURSORENDOFSCREEN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToStartOfRowSel SID_CURSORHOME_SEL
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem InternetSearch SID_INTERNET_SEARCH
+(SfxStringItem SearchString SID_INTERNET_SEARCH)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToEndOfDataSel SID_CURSORENDOFFILE_SEL
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ObjectBarVisible SID_TOGGLEOBJECTBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToEndOfData SID_CURSORENDOFFILE
+(SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem FloatingTask SID_FLOATING_TASK
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item DeleteStyle SID_STYLE_DELETE
+(SfxStringItem Param SID_STYLE_DELETE,SfxUInt16Item Family SID_STYLE_FAMILY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoLeft SID_CURSORLEFT
+(SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnSaveDone SID_ON_SAVEDOCDONE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem EditFrameSet SID_EDIT_FRAMESET
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToStart SID_CURSORTOPOFFILE
+(SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item FrameSpacing SID_FRAMESPACING
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem PartWindow SID_PARTWIN
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem WindowList SID_MDIWINDOWLIST
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem CurrentTime SID_CURRENTTIME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem FrameTitle SID_FRAMETITLE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Document SID_DOCUMENT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Path SID_DOCPATH
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem DocumentManager SID_DOCMANAGER
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Title SID_DOCTITLE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToStartOfRow SID_CURSORHOME
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem NewWindow SID_NEWWINDOW
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Comments SID_DOCINFO_COMMENTS
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Optimize SID_OPTIMIZEWIN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Open SID_DOCINFO_TITLE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SendFax FN_FAX
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SbxDeleted SID_BASICIDE_SBXDELETED
+(SbxItem Sbx SID_BASICIDE_ARG_SBX)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Quit SID_QUITAPP
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem OpenUrl SID_EXECUTE
+(SfxStringItem Comand SID_EXECUTE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ToolsMacroEdit SID_EDITMACRO
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem SplitHorizontal SID_SPLIT_HORIZONTAL
+(SfxStringItem Frame SID_FRAMETITLE)
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem IsLoading SID_DOC_LOADING
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxInt32Item CompareDocuments SID_DOCUMENT_COMPARE
+(SfxStringItem FileName SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem FilterFlags SID_FILE_FILTEROPTIONS,SfxInt16Item Version SID_VERSION)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem _SwitchViewShell1 SID_VIEWSHELL1
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem DeleteFrame SID_DELETE_FRAME
+(SfxStringItem Frame SID_FRAMETITLE)
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ReleaseObject SID_DELETE_BASICOBJECT
+(SfxObjectItem Object SID_DELETE_BASICOBJECT)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToEndOfRowSel SID_CURSOREND_SEL
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Close SID_CLOSETASK
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem FormatMenu SID_FORMATMENU
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem HyperlinkDialog SID_HYPERLINK_DIALOG
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CursorTopOfScreen SID_CURSORTOPOFSCREEN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ConfigureToolboxVisible SID_CUSTOMIZETOOLBOX
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoUp SID_CURSORUP
+(SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem StartApplication SID_START_APP
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Caption SID_CAPTION
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoUpBlock SID_CURSORPAGEUP
+(SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Author SID_DOCINFO_AUTHOR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ReadOnly SID_DOC_READONLY
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem DesktopMode SID_DESKTOPMODE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem UnloadLibrary SID_UNLOAD_LIBRARY
+(SfxStringItem LibraryName SID_UNLOAD_LIBRARY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem PrivateUse SID_OFFICE_PRIVATE_USE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem LibLoaded SID_BASICIDE_LIBLOADED
+(SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Selection SID_SELECTION
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SearchOriginal SID_SEARCHORIGINAL
+(SfxStringItem FileName SID_FILE_NAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem FileDocument SID_SAVEDOCTOBOOKMARK
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SaveAll SID_SAVEDOCS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem StarWriter SID_STARWRITER
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem SelectionTextExt SID_SELECTION_TEXT_EXT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Task SID_TASK
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem SelectionText SID_SELECTION_TEXT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Recording SID_RECORDMACRO
+[
+ SfxVoidItem StopRecording();
+
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxInt32Item MergeDocuments SID_DOCUMENT_MERGE
+(SfxStringItem FileName SID_FILE_NAME,SfxInt16Item Version SID_VERSION)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem FullName SID_PROGFILENAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem PrintPreview SID_PRINTPREVIEW
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SaveConfiguration SID_SAVECONFIG
+(SfxStringItem FileName SID_CFGFILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SaveAsUrl SID_SAVEASURL
+(SfxStringItem FileName SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem PassWord SID_DOC_READONLY,SfxStringItem FilterOptions SID_FILE_FILTEROPTIONS)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Repaint SID_REPAINT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem StatusBarVisible SID_TOGGLESTATUSBAR
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StartMenu SID_STARTMENU
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem JumpToMark SID_JUMPTOMARK
+(SfxStringItem Bookmark ID_VAL_DUMMY0)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem StarDraw SID_STARDRAW
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem RemoveLibrary SID_REMOVE_LIBRARY
+(SfxStringItem LibraryName SID_REMOVE_LIBRARY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem InternetUpdate SID_INTERNET_UPDATE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = TRUE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem StatusBar SID_STATUSBARTEXT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem IsTopWindow SID_ISTOP
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadConfiguration SID_LOADCONFIG
+(SfxStringItem FileName SID_CFGFILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem MailWindow SID_MAIL_CHILDWIN
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem MailReadDialog SID_MAIL_INBOX
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem OpenTemplate SID_OPENTEMPLATE
+(SfxStringItem Region SID_TEMPLATE_REGIONNAME,SfxStringItem Name SID_TEMPLATE_NAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Printer SID_PRINTER_NAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem SplitParentVertical SID_SPLIT_PARENT_VERTICAL
+(SfxStringItem Frame SID_FRAMETITLE)
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem LoadLibrary SID_LOAD_LIBRARY
+(SfxStringItem LibraryName SID_LOAD_LIBRARY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem SplitParentHorizontal SID_SPLIT_PARENT_HORIZONTAL
+(SfxStringItem Frame SID_FRAMETITLE)
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnSave SID_ON_SAVEDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Visible SID_WIN_VISIBLE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnPrepareClose SID_ON_PREPARECLOSEDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnOpen SID_ON_OPENDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem PlayMacro SID_PLAYMACRO
+(SfxStringItem Statement SID_STATEMENT,SfxBoolItem Asynchron SID_ASYNCHRON)
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem CommercialUse SID_OFFICE_COMMERCIAL_USE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnStart SID_ON_STARTAPP
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BasicStepOut SID_BASICSTEPOUT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnQuit SID_ON_CLOSEAPP
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OldPALK SID_OLD_PALK
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OfficeVersionId SID_OFFICE_VERSION_ID
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SetOptions SID_SETOPTIONS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnCreate SID_ON_CREATEDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnClose SID_ON_CLOSEDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SetPALK SID_OFFICE_PALK
+(SfxStringItem PALK SID_OFFICE_PALK)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Beamer SID_BROWSER
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem SendMail SID_MAIL_SENDDOC
+(SfxStringItem Recipient SID_MAIL_RECIPIENT,SfxStringItem Subject SID_MAIL_SUBJECT,SfxStringItem MailText SID_MAIL_TEXT,SfxUInt16Item Priority SID_MAIL_PRIORITY,SfxBoolItem AttachedDoc SID_MAIL_ATTACH,SfxStringItem AttachFiles SID_MAIL_ATTACH_FILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry9 SID_PICK9
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem DefaultFilePath SID_DEFAULTFILEPATH
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem IsPrinting SID_PRINTOUT
+[
+ SfxVoidItem PrintOut(SfxInt16Item from SID_PRINT_FIRST_PAGE,SfxInt16Item to SID_PRINT_LAST_PAGE,SfxInt16Item copies SID_PRINT_COPIES,SfxBoolItem silent SID_SILENT);
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem SplitVertical SID_SPLIT_VERTICAL
+(SfxStringItem Frame SID_FRAMETITLE)
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CreateMacro SID_BASICIDE_CREATEMACRO
+(SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Add SID_NEWDOC
+(SfxStringItem Region SID_TEMPLATE_REGIONNAME,SfxStringItem Name SID_TEMPLATE_NAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry2 SID_PICK2
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry1 SID_PICK1
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem NewFrameSet SID_NEWFRAMESET
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ParentWindow SID_PARENTFRAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry7 SID_PICK7
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry6 SID_PICK6
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ModifyFrame SID_MODIFY_FRAME
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry3 SID_PICK3
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ArrangeVertical SID_VERTICALWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Modified SID_MODIFIED
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+TbxImageItem ZoomToolBox SID_ZOOM_TOOLBOX
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem VersionVisible SID_VERSION_VISIBLE
+(SfxBoolItem Show SID_VERSION_VISIBLE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxBoolItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ZoomIn SID_ZOOM_IN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem HelperDialog SID_HELP_PI
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem _SwitchViewShell0 SID_VIEWSHELL0
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item SwitchViewShell SID_VIEWSHELL
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpZoomIn SID_HELP_ZOOMIN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpZoomOut SID_HELP_ZOOMOUT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ActiveHelp SID_HELPBALLOONS
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpMenu SID_HELPMENU
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt32Item UpdateVersion SID_UPDATE_VERSION
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadToolBox SID_TOOLBOXOPTIONS
+(SfxStringItem FileName SID_CFGFILE,SfxUInt16Item ObjectBarId SID_CONFIGITEMID)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem TopWindow SID_TOPWINDOW
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem GetActiveTask SID_TOPDOC
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Zooming SID_ZOOM
+(SfxUInt32Item ZoomScale ID_VAL_ZOOM)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpAnnotate SID_HELP_ANNOTATE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpBookmark SID_HELP_BOOKMARK
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ArrangeVertical SID_VERTICALDOCKWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ZoomPrevious SID_ZOOM_PREV
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Open SID_OPENDOC
+(SfxStringItem FileName SID_FILE_NAME,SfxStringItem FilterName SID_FILTER_NAME,SfxStringItem OpenFlags SID_OPTIONS,SfxStringItem FilterFlags SID_FILE_FILTEROPTIONS,SfxInt16Item Version SID_VERSION,SfxStringItem Referer SID_REFERER)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Help SID_HELP
+(SfxStringItem helpfile SID_HELP_FILENAME,SfxInt32Item helpcontextID SID_HELP_CONTEXTID,SfxStringItem helpstring SID_HELP_STRING)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpIndex SID_HELP_INDEX
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem _SwitchViewShell4 SID_VIEWSHELL4
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem _SwitchViewShell3 SID_VIEWSHELL3
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem _SwitchViewShell2 SID_VIEWSHELL2
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxRectangleItem Area SID_WIN_POSSIZE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Minimized SID_WIN_MINIMIZED
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem AddDirect SID_NEWDOCDIRECT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Maximized SID_WIN_MAXIMIZED
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxTemplateItem ParaStyle SID_STYLE_FAMILY2
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxTemplateItem CharStyle SID_STYLE_FAMILY1
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item ActualStyleFamily SID_STYLE_FAMILY
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadBasic SID_BASICLOAD
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_INSERT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem HelpTip SID_HELPTIPS
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxTemplateItem TemplateFamily5 SID_STYLE_FAMILY5
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxTemplateItem PageStyle SID_STYLE_FAMILY4
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem IsLoadingImages SID_IMG_LOADING
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem DesignerDialog SID_STYLE_DESIGNER
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Interactive SID_INTERACTIVEMODE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ExtendedHelp SID_EXTENDEDHELP
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem InternetOnline SID_INTERNET_ONLINE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = TRUE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpIndex SID_HELPINDEX
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem TipsDialog SID_TIPWINDOW
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem InsertFile SID_INSERTDOC
+(SfxStringItem Name SID_INSERTDOC,SfxStringItem Filter FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_INSERT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem DragHierarchy SID_STYLE_DRAGHIERARCHIE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Title SID_TITLE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ArrangeHorizontal SID_HORIZONTALDOCKWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Tile SID_TILEDOCKWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem OptionBarVisible SID_TOGGLEOPTIONBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem NavigationBarVisible SID_TOGGLENAVBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem MacroBarVisible SID_TOGGLEMACROBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem FunctionBarVisible SID_TOGGLEFUNCTIONBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem StyleWatercanMode SID_STYLE_WATERCAN
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_FORMAT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StyleUpdateByExample SID_STYLE_UPDATE_BY_EXAMPLE
+(SfxStringItem Param SID_STYLE_UPDATE_BY_EXAMPLE,SfxUInt16Item Family SID_STYLE_FAMILY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ArrangeHorizontal SID_HORIZONTALWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item NewStyle SID_STYLE_NEW
+(SfxStringItem Param SID_STYLE_NEW,SfxUInt16Item Family SID_STYLE_FAMILY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ThisDocument SID_THISDOCUMENT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem TaskBarVisible SID_TASKBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem AlwaysVisible SID_TASK_ALWAYSVISIBLE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ShowPopups SID_SHOWPOPUPS
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BrowseHome SID_BROWSE_HOME
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem AddWatch SID_BASICIDE_ADDWATCH
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem GetFrameWindow SID_FILLFRAME
+(SfxStringItem WindowName SID_FILLFRAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BasicStop SID_BASICSTOP
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxTemplateItem FrameStyle SID_STYLE_FAMILY3
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem VersionDialog SID_VERSION
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Cascade SID_CASCADEWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry5 SID_PICK5
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem CheckKey SID_CHECK_KEY
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem BrowseView SID_BROWSER_MODE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem BeamerTaskSensitive SID_BROWSER_TASK
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt32Item BuildVersion SID_BUILD_VERSION
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Saved SID_DOC_SAVED
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem UpdateModuleSource SID_BASICIDE_UPDATEMODULESOURCE
+(SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem MailNotifyReset SID_MAIL_NOTIFY_RESET
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = TRUE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Restore SID_RESTOREWIN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ToggleBreakPoint SID_BASICIDE_TOGGLEBRKPNT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem UpdateAllModuleSources SID_BASICIDE_UPDATEALLMODULESOURCES
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Close SID_CLOSEDOC
+(SfxBoolItem saveChanges SID_CLOSEDOC_SAVE,SfxStringItem fileName SID_CLOSEDOC_FILENAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ThisWindow SID_THISWINDOW
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BasicStepOver SID_BASICSTEPOVER
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SaveBasicAs SID_BASICSAVEAS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BasicStepInto SID_BASICSTEPINTO
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StartRegistrationDialog SID_ONLINE_REGISTRATION_DLG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem FullName SID_DOCFULLNAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem FocusUrlBox SID_FOCUSURLBOX
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem RunBasic SID_BASICRUN
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadEvents SID_CONFIGEVENT
+(SfxStringItem FileName SID_CFGFILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxTemplateItem StyleApplyState SID_STYLE_APPLY
+[
+ SfxUInt16Item StyleApply(SfxStringItem Template SID_STYLE_APPLY,SfxUInt16Item Family SID_STYLE_FAMILY);
+
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem ObjectMenue SID_OBJECT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem LicenceKey SID_OFFICE_PLK
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadMenu SID_CONFIGMENU
+(SfxStringItem FileName SID_CFGFILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem StatusGetDate SID_BASICIDE_STAT_DATE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StyleNewByExample SID_STYLE_NEW_BY_EXAMPLE
+(SfxStringItem Param SID_STYLE_NEW_BY_EXAMPLE,SfxUInt16Item Family SID_STYLE_FAMILY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem NewModule SID_BASICIDE_NEWMODULE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Closing SID_CLOSING
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item FrameCount SID_FRAMECOUNT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem NameChangedOnTab SID_BASICIDE_NAMECHANGEDONTAB
+(SfxUInt16Item TabId SID_BASICIDE_ARG_TABID,SfxStringItem NewName SID_BASICIDE_ARG_MODULENAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ClearMemCache SID_CLEARMEMCACHE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem PickList SID_PICKLIST
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Minimize SID_MINIMIZEWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ClearDiskCache SID_CLEARDISKCACHE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Navigator SID_NAVIGATOR
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ActiveTask SID_ACTIVETASK
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem LoadAccel SID_CONFIGACCEL
+(SfxStringItem FileName SID_CFGFILE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item MailReceipt SID_MAIL_NOTIFY
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Close SID_CLOSEDOCS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem _PickEntry4 SID_PICK4
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_INTERN;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Close SID_CLOSEWINS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem Explorer SID_EXPLORER
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem CompileBasic SID_BASICCOMPILE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem CustomerNumber SID_OFFICE_CUSTOMERNUMBER
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_SPECIAL;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem InsertHyperlink SID_HYPERLINK_INSERT
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem AutoPilotMenu SID_AUTOPILOTMENU
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem MacroDialog SID_BASICCHOOSER
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BasicIDEAppear SID_BASICIDE_APPEAR
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BreakPointsChanged SID_BASICIDE_BRKPNTSCHANGED
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem HelpChooseFile SID_HELP_HELPFILEBOX
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StoreAllModuleSources SID_BASICIDE_STOREALLMODULESOURCES
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BasicBreak SID_BASICBREAK
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem CommonTaskBarVisible SID_TOGGLECOMMONTASKBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ActiveDocument SID_ACTIVEDOCUMENT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_DOCUMENT;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem ActiveWindow SID_ACTIVEWINDOW
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem InsertWindow SID_INSERT_TASKFRAME
+(SfxObjectItem Frame SID_INSERT_TASKFRAME,SfxBoolItem Copy SID_COPY)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item MetricUnit SID_ATTR_METRIC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem InsertObjectFloatingFrame SID_INSERT_FLOATINGFRAME
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_INSERT;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem Activate SID_ACTIVATE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxUInt16Item UndoCount SID_ATTR_UNDO_COUNT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem AutoHide SID_AUTOHIDE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoLeftBlockSel SID_CURSORPAGELEFT_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem AddLibrary SID_ADD_LIBRARY
+(SfxStringItem LibraryFileName SID_FILE_NAME,SfxUInt16Item Mode SID_ADD_LIBRARY,SfxBoolItem Replace SID_REMOVE_LIBRARY,SfxStringItem LibraryName SID_LOAD_LIBRARY,SfxStringItem LibraryExternalName SID_DOCTITLE)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ArrangeIcons SID_ARRANGEICONS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ChooseMacro SID_BASICIDE_CHOOSEMACRO
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ToolBarVisible SID_TOGGLETOOLBAR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem RenameCurrent SID_BASICIDE_RENAMECURRENT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SbxInserted SID_BASICIDE_SBXINSERTED
+(SbxItem Sbx SID_BASICIDE_ARG_SBX)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem SbxRenamed SID_BASICIDE_SBXRENAMED
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ObjectCatalog SID_BASICIDE_OBJCAT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem RemoveWatch SID_BASICIDE_REMOVEWATCH
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem ShowBrowser SID_SHOW_BROWSER
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_CONTROLS;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem StatusGetTitle SID_BASICIDE_STAT_TITLE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem LateInitDone SID_LATEINIT_DONE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Path SID_PROGPATH
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem StarCalc SID_STARCALC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ShowSbx SID_BASICIDE_SHOWSBX
+(SbxItem Sbx SID_BASICIDE_ARG_SBX)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem StatusGetPosition SID_BASICIDE_STAT_POS
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ZoomNext SID_ZOOM_NEXT
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem LibRemoved SID_BASICIDE_LIBREMOVED
+(SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem MatchGroup SID_BASICIDE_MATCHGROUP
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem DeleteCurrent SID_BASICIDE_DELETECURRENT
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem EditMacro SID_BASICIDE_EDITMACRO
+(SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HideCurPage SID_BASICIDE_HIDECURPAGE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem FullScreen SID_WIN_FULLSCREEN
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ModuleDialog SID_BASICIDE_MODULEDLG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem NewDialog SID_BASICIDE_NEWDIALOG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem LibSelect SID_BASICIDE_LIBSELECTED
+(SfxStringItem LibName SID_BASICIDE_ARG_LIBNAME)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem LibSelector SID_BASICIDE_LIBSELECTOR
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxBoolItem PlugInsActive SID_PLUGINS_ACTIVE
+
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EDIT;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoToEndOfRow SID_CURSOREND
+(SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoDown SID_CURSORDOWN
+(SfxInt16Item By SID_CURSORDOWN)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Context SID_CONTEXT
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ZoomPlus SID_ZOOM_OUT
+()
+[
+ /* flags: */
+ AutoUpdate = TRUE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpOnHelp SID_HELPONHELP
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnPrint SID_ON_PRINTDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem CurrentDate SID_CURRENTDATE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = TRUE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = TRUE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ClearHistory SID_CLEARHISTORY
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Volatile,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem StoreModuleSource SID_BASICIDE_STOREMODULESOURCE
+(SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_MACRO;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem ConfigureDialog SID_CONFIG
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_OPTIONS;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Organizer SID_ORGANIZER
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_TEMPLATE;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem RunStarWriter SID_STARTSW
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem BookmarkMenu SID_BOOKMARKS
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* status: */
+ SlotType = SfxStringItem
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_APPLICATION;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnSaveAsDone SID_ON_SAVEASDOCDONE
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxObjectItem NewObject SID_CREATE_BASICOBJECT
+(SfxStringItem ClassName SID_CREATE_BASICOBJECT)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = TRUE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoDownSel SID_CURSORDOWN_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem HelpSearch SID_HELP_SEARCH
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = TRUE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Asynchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_EXPLORER;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem FrameName SID_FRAME_NAME
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = TRUE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = TRUE,
+ GroupId = GID_VIEW;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem Keywords SID_DOCINFO_KEYWORDS
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxStringItem OnActivate SID_ON_ACTIVATEDOC
+
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ Readonly = FALSE,
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = ;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoDownBlock SID_CURSORPAGEDOWN
+(SfxInt16Item By FN_PARAM_1,SfxBoolItem Sel FN_PARAM_2)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem GoLeftSel SID_CURSORLEFT_SEL
+(SfxInt16Item By FN_PARAM_1)
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = TRUE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_NAVIGATOR;
+]
+
+//--------------------------------------------------------------------------
+SfxVoidItem Backspace SID_BACKSPACE
+()
+[
+ /* flags: */
+ AutoUpdate = FALSE,
+ Cachable = Cachable,
+ FastCall = FALSE,
+ HasCoreId = FALSE,
+ HasDialog = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ Synchron;
+
+ /* config: */
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ StatusBarConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_EDIT;
+]
+
diff --git a/sfx2/sdi/sfxslots.sdi b/sfx2/sdi/sfxslots.sdi
new file mode 100644
index 000000000000..3eee3ed5ff8c
--- /dev/null
+++ b/sfx2/sdi/sfxslots.sdi
@@ -0,0 +1,119 @@
+/*=========================================================================
+ module StarApplicationFrame
+
+ (C) 1994-1995 StarDivision GmbH, Hamburg, Germany
+ $Author: hr $ $Date: 2000-09-18 16:52:26 $ $Revision: 1.1.1.1 $
+ $Logfile: T:/sfx2/sdi/sfxslots.sdv $ $Workfile: SFXSLOTS.SDI $
+=========================================================================*/
+
+module
+"384E40E0-1F22-101C-9961-04021C007002"
+"5A30E000-1F22-101C-9961-04021C007002"
+StarApplicationFrame
+[
+HelpText( "StarDivision Application Framework" ),
+SlotIdFile( "sfx.hrc" )
+TypeLibFile( "sfxslots.tlb" )
+]
+{
+ item void SfxVoidItem;
+ item BOOL SfxBoolItem;
+ item INT32 SfxUInt16Item;
+ item INT16 SfxInt16Item;
+ item INT32 SfxUInt32Item;
+ item INT32 SfxInt32Item;
+ item String SfxStringItem;
+ item INT16 SfxByteItem;
+
+ item INT16 SfxEnumItem;
+ item INT16 SfxAllEnumItem;
+
+ item SbxObject SfxObjectItem;
+
+ item String SfxTemplateItem; //! Dummy
+ item String SfxMacroInfoItem; //! Dummy
+
+ item BOOL SfxBoolItem;
+
+ struct Point
+ {
+ INT32 X MID_X;
+ INT32 Y MID_Y;
+ };
+ item Point SfxPointItem;
+
+ struct Rectangle
+ {
+ INT32 Left MID_LEFT;
+ INT32 Top MID_TOP;
+ INT32 Width MID_WIDTH;
+ INT32 Height MID_HEIGHT;
+ };
+ item Rectangle SfxRectangleItem;
+
+ struct DocInfo
+ {
+ String Author MID_DOCINFO_AUTHOR;
+ String CreationDate MID_DOCINFO_CREATIONDATE;
+ String CreationTime MID_DOCINFO_CREATIONTIME;
+ String Description MID_DOCINFO_DESCRIPTION;
+ String FileName MID_DOCINFO_FILENAME;
+ String Revision MID_DOCINFO_REVISION;
+ String EditTime MID_DOCINFO_EDITTIME;
+ String KeyWords MID_DOCINFO_KEYWORDS;
+ String ModificationAuthor MID_DOCINFO_MODIFICATIONAUTHOR;
+ String ModificationDate MID_DOCINFO_MODIFICATIONDATE;
+ String ModificationTime MID_DOCINFO_MODIFICATIONTIME;
+ String Subject MID_DOCINFO_SUBJECT;
+ String Template MID_DOCINFO_TEMPLATE;
+ String Title MID_DOCINFO_TITLE;
+ String Field1Title MID_DOCINFO_FIELD1TITLE;
+ String Field2Title MID_DOCINFO_FIELD2TITLE;
+ String Field3Title MID_DOCINFO_FIELD3TITLE;
+ String Field4Title MID_DOCINFO_FIELD4TITLE;
+ String Field1 MID_DOCINFO_FIELD1;
+ String Field2 MID_DOCINFO_FIELD2;
+ String Field3 MID_DOCINFO_FIELD3;
+ String Field4 MID_DOCINFO_FIELD4;
+ };
+ item DocInfo SfxDocumentInfoItem;
+
+ item String SbxItem;
+
+ item INT16 TbxImageItem;
+
+ struct SvxSearch
+ {
+ BOOL Backward MID_SEARCH_BACKWARD;
+ BOOL InSelection MID_SEARCH_INSELECTION;
+ BOOL CaseSensitive MID_SEARCH_CASESENSITIVE;
+ BOOL RegExp MID_SEARCH_REGEXPR;
+ BOOL WordOnly MID_SEARCH_WORDONLY;
+ UINT16 Mode MID_SEARCH_MODE;
+ UINT16 Order MID_SEARCH_ORDER;
+ BOOL AllTables MID_SEARCH_ALLTABLES;
+ BOOL Similarity MID_SEARCH_LEV_ON;
+ BOOL Relaxed MID_SEARCH_LEV_RELAXED;
+ UINT16 Other MID_SEARCH_LEV_OTHER;
+ UINT16 Shorter MID_SEARCH_LEV_SHORTER;
+ UINT16 Longer MID_SEARCH_LEV_LONGER;
+ BOOL Pattern MID_SEARCH_PATTERN;
+ };
+ item SvxSearch SvxSearchItem;
+
+
+ include "newslots.sdi"
+ include "sfx.sdi"
+ include "object.sdi"
+ include "progress.sdi"
+ include "options.sdi"
+ include "docslots.sdi"
+ include "frmslots.sdi"
+ include "viwslots.sdi"
+ include "pinslots.sdi"
+ include "mdislots.sdi"
+ include "ipfslots.sdi"
+ include "appslots.sdi"
+ include "frsslots.sdi"
+}
+
diff --git a/sfx2/sdi/viwslots.sdi b/sfx2/sdi/viwslots.sdi
new file mode 100644
index 000000000000..57a749f793ff
--- /dev/null
+++ b/sfx2/sdi/viwslots.sdi
@@ -0,0 +1,154 @@
+ //=========================================================================
+ // interface View
+ // shell SfxViewShell
+ //
+ // (C) 1996 StarDivision GmbH, Hamburg, Germany
+ // $Author: hr $ $Date: 2000-09-18 16:52:26 $ $Revision: 1.1.1.1 $
+ // $Logfile: T:/sfx2/sdi/viwslots.sdv $ $Workfile: viwslots.sdi $
+ //-------------------------------------------------------------------------
+interface View : Object
+[
+ Automation = FALSE ;
+]
+{
+ //---------------------------------------------------------------------
+ SbxObject UNO SID_UNO // ole(no) api(final/play/norec)
+ [Readonly;]
+ //---------------------------------------------------------------------
+ SID_MAIL_SENDDOC // ole(no) api(todo)
+ [
+ ExecMethod = ExecMisc_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PRINTDOC // ole(no) api(play/rec)
+ [
+ ExecMethod = ExecPrint_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PRINTDOCDIRECT // ole(no) api(final/play/rec)
+ [
+ ExecMethod = ExecPrint_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SETUPPRINTER // ole(no) api(play/rec)
+ [
+ ExecMethod = ExecPrint_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PRINTER_NAME // ole(no) api(play/norec)
+ [
+ ExecMethod = ExecPrint_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_STYLE_CATALOG // ole(no) api(play/rec)
+ [
+ ExecMethod = ExecMisc_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_PLUGINS_ACTIVE // ole(no) api(play/rec)
+ [
+ ExecMethod = ExecMisc_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SELECTION_TEXT // ole(no) api(play/norec)
+ [
+ StateMethod = GetState_Impl ;
+ ]
+ //---------------------------------------------------------------------
+ SID_SELECTION_TEXT_EXT // ole(no) api(play/norec)
+ [
+ StateMethod = GetState_Impl ;
+ ]
+
+ SID_STYLE_FAMILY
+ [
+ ExecMethod = ExecMisc_Impl ;
+ StateMethod = GetState_Impl ;
+ ]
+}
+
+ //=========================================================================
+
+shell SfxViewShell
+
+/*
+ Funktionalit"at jeder View (Ansicht) eines SFx-Dokuments. Angesprochen
+ werden diese Objekte entweder als 'ActiveWindow' oder mit dem Namen
+ des Dokuments (i.d.R. der Dateiname) ohne Pfad aber mit der Nummer
+ des Fensters, alles in eckigen Klammern (z.B. als '[unbenannt1:1]'
+ oder '[brief6.sdw:4]'). Im Ggs. zur Anzeige in der Caption-Bar (solange
+ nur ein Fenster f"ur das betreffende Dokument existiert) darf die
+ Nummer niemals ausgelassen werden. Die Numerierung beginnt bei 1 und
+ ist f"ur die Existenz des Fensters stabil.
+
+ Falls es Konflikte mit anderen "uber den Namen des Fensters
+ angesprochenen Objekten gibt (z.B. dem Window selbst oder
+ Selektionsmodi), kann der Name der spezifischen View zus"atzlich
+ qualifiziert werden (z.B. '[demo.sdd:2].Outliner').
+*/
+
+
+{
+ import View [Automation];
+}
+
+
+/*-------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.36 1998/10/26 14:49:02 MBA
+ Fix #58128#: SID_STYLE_FAMILY
+
+
+ Rev 1.35 26 Oct 1998 15:49:02 MBA
+ Fix #58128#: SID_STYLE_FAMILY
+
+ Rev 1.34 12 Jun 1998 15:56:08 MI
+ UNO-Objekt Zugriff
+
+ Rev 1.33 28 Aug 1997 12:24:20 MBA
+ Neue Interface-Namen
+
+ Rev 1.32 09 Dec 1996 12:07:46 MBA
+ Helptext,Configname raus
+
+ Rev 1.31 13 Nov 1996 12:45:24 MI
+ MUSS/SFx/345-346: SIDs aufgeraeumt
+
+ Rev 1.30 22 Oct 1996 20:10:20 HJS
+ merge 22.10.96
+
+ Rev 1.29 08 Oct 1996 14:30:42 HJS
+ merge 08.10.96
+
+ Rev 1.28 12 Sep 1996 15:44:34 MBA
+
+
+ Rev 1.27 09 Sep 1996 16:42:30 MBA
+ Neue Slotfiles
+
+ Rev 1.26 30 Aug 1996 13:41:46 HJS
+ eu...
+
+ Rev 1.25 16 Jul 1996 17:22:32 MBA
+ SID_PLUGINSACTIVE kein ReadOnlyDoc
+
+ Rev 1.24 11 Jul 1996 10:39:16 MI
+ SID_SELECTION_TEXT
+
+ Rev 1.23 08 Jul 1996 16:50:04 HJS
+ uebersetzung
+
+-------------------------------------------------------------------------*/
+
+
+
+
+
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
new file mode 100644
index 000000000000..a89b7d050796
--- /dev/null
+++ b/sfx2/source/appl/app.cxx
@@ -0,0 +1,1859 @@
+/*************************************************************************
+ *
+ * $RCSfile: app.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#if defined UNX
+#include <limits.h>
+#else // UNX
+#include <stdlib.h>
+#define PATH_MAX _MAX_PATH
+#endif // UNX
+
+#include "app.hxx"
+#include "frame.hxx"
+
+#ifndef _VOS_PROCESS_HXX_
+#include <vos/process.hxx>
+#endif
+#ifndef _TOOLS_SIMPLERESMGR_HXX_
+#include <tools/simplerm.hxx>
+#endif
+#ifndef _CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _DRAG_HXX //autogen
+#include <vcl/drag.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _FILELIST_HXX //autogen
+#include <so3/filelist.hxx>
+#endif
+#ifndef _URLBMK_HXX //autogen
+#include <svtools/urlbmk.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _EXTATTR_HXX //autogen
+#include <svtools/extattr.hxx>
+#endif
+#ifndef _INET_WRAPPER_HXX
+#include <inet/wrapper.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#include <svtools/svdde.hxx>
+#include <tools/tempfile.hxx>
+#pragma hdrstop
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HPP_
+#include <com/sun/star/frame/FrameActionEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTION_HPP_
+#include <com/sun/star/frame/FrameAction.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP_
+#include <com/sun/star/loader/XImplementationLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LOADER_CANNOTACTIVATEFACTORYEXCEPTION_HPP_
+#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_MOZILLA_XPLUGININSTANCE_HPP_
+#include <com/sun/star/mozilla/XPluginInstance.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XTASKSSUPPLIER_HPP_
+#include <com/sun/star/frame/XTasksSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATION_HPP_
+#include <com/sun/star/container/XEnumeration.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
+#include <unotools/processfactory.hxx>
+#endif
+
+#include <basic/basmgr.hxx>
+
+#include <appuno.hxx>
+#include "sfxhelp.hxx"
+#include "request.hxx"
+#include "sfxtypes.hxx"
+#include "sfxresid.hxx"
+#include "arrdecl.hxx"
+#include "progress.hxx"
+#include "objsh.hxx"
+#include "docfac.hxx"
+#include "docfile.hxx"
+#include "docfilt.hxx"
+#include "cfgmgr.hxx"
+#include "fltfnc.hxx"
+#include "nfltdlg.hxx"
+#include "iodlg.hxx"
+#include "new.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "viewsh.hxx"
+#include "genlink.hxx"
+#include "accmgr.hxx"
+#include "tbxmgr.hxx"
+#include "mnumgr.hxx"
+#include "topfrm.hxx"
+#include "newhdl.hxx"
+#include "appdata.hxx"
+#include "openflag.hxx"
+#include "app.hrc"
+#include "interno.hxx"
+#include "ipenv.hxx"
+#include "saveopt.hxx"
+#include "intfrm.hxx"
+#include "virtmenu.hxx"
+#include "module.hxx"
+#include "sfxdir.hxx"
+#include "event.hxx"
+#include "oregdlg.hxx"
+#include "appimp.hxx"
+
+#ifdef DBG_UTIL
+#include "tbxctrl.hxx"
+#include "stbitem.hxx"
+#include "mnuitem.hxx"
+#endif
+
+#if defined( WIN ) || defined( WNT ) || defined( OS2 )
+#define DDE_AVAILABLE
+#endif
+
+// Static member
+SfxApplication* SfxApplication::pApp = NULL;
+
+SfxApplication* SfxApplication::GetOrCreate()
+{
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+#if 0 // SFX on demand
+ if ( !pApp )
+ {
+ SfxApplication *pNew = new SfxApplication;
+ pNew->StartUpScreen( NULL );
+ SetApp( pNew );
+ }
+#endif
+ return pApp;
+}
+
+void SfxApplication::SetApp( SfxApplication* pSfxApp )
+{
+ static ::osl::Mutex aProtector;
+ ::osl::MutexGuard aGuard( aProtector );
+
+ DBG_ASSERT( !pApp, "SfxApplication already created!" );
+ if ( pApp )
+ DELETEZ( pApp );
+
+ pApp = pSfxApp;
+
+ // at the moment a bug may occur when Initialize_Impl returns FALSE, but this is only temporary because all code that may cause such a
+ // fault will be moved outside the SFX
+ pApp->Initialize_Impl();
+}
+
+SfxApplication::SfxApplication()
+ : _nFeatures( ULONG_MAX )
+ , pImp( 0 )
+ , pAppData_Impl( 0 )
+ , pMenuMgr( 0 )
+ , pAcceleratorMgr( 0 )
+ , pStatusBarMgr( 0 )
+ , pAppDispat( 0 )
+ , bDispatcherLocked( sal_False )
+ , pResMgr( 0 )
+ , pAppIniMgr( 0 )
+ , pCfgMgr( 0 )
+ , pSlotPool( 0 )
+ , pInterfaces( 0 )
+ , bInInit( sal_False )
+ , bInExit( sal_False )
+ , bDowning( sal_True )
+ , bCreatedExternal( sal_False )
+ , pOptions( 0 )
+ , pViewFrame( 0 )
+ , pImageMgr( 0 )
+ , nInterfaces( 0 )
+{
+ pImp = new SfxApplication_Impl;
+ pImp->bConfigLoaded = sal_False;
+ pImp->pEmptyMenu = 0;
+ pImp->nDocNo = 0;
+ pImp->pIntro = 0;
+ pImp->pTbxCtrlFac = 0;
+ pImp->pStbCtrlFac = 0;
+ pImp->pViewFrames = 0;
+ pImp->pObjShells = 0;
+ pImp->bAutoSaveNow = sal_False;
+ pImp->pTemplateDlg = 0;
+ pImp->pBasicMgr = 0;
+ pImp->pBasicTestWin = 0;
+ pImp->pSfxResManager = 0;
+ pImp->pSimpleResManager = 0;
+ pImp->nWarnLevel = 0;
+ pImp->pAutoSaveTimer = 0;
+ pAppIniMgr = CreateIniManager();
+ pAppData_Impl = new SfxAppData_Impl( this );
+ pAppData_Impl->StartListening( *pAppIniMgr );
+ pAppData_Impl->UpdateApplicationSettings( pAppIniMgr->IsDontHideDisabledEntries() );
+ pApp->PreInit();
+
+#ifdef DDE_AVAILABLE
+#ifdef PRODUCT
+ InitializeDde();
+#else
+ if( !InitializeDde() )
+ {
+ ByteString aStr( "Kein DDE-Service moeglich. Fehler: " );
+ if( GetDdeService() )
+ aStr += ByteString::CreateFromInt32(GetDdeService()->GetError());
+ else
+ aStr += '?';
+ DBG_ASSERT( sal_False, aStr.GetBuffer() )
+ }
+#endif
+#endif
+}
+
+SfxApplication::~SfxApplication()
+{
+ if ( !bDowning )
+ Deinitialize();
+ Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
+ delete pImp;
+ delete pAppData_Impl;
+ SfxIniManager::Close();
+ pApp = 0;
+}
+
+//====================================================================
+
+class SfxResourceTimer : public Timer
+{
+ sal_uInt16 *pnWarnLevel;
+public:
+ SfxResourceTimer(sal_uInt16 *pn, sal_uInt32 nTimeOut) : pnWarnLevel(pn)
+ { SetTimeout(nTimeOut); Start(); }
+ virtual void Timeout() { --*pnWarnLevel; delete this; }
+};
+
+//--------------------------------------------------------------------
+
+//====================================================================
+
+void SfxApplication::LockDispatcher
+(
+ sal_Bool bLock /* sal_True
+ schaltet alle SfxDispatcher ein
+
+ sal_False
+ schaltet alle SfxDispatcher aus */
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode werden alle Dispatcher der Applikation global
+ blockiert (bLock==sal_True) bzw. grundsaetzlich freigegeben
+ (bLock==sal_False).
+
+ Unabhaengig von diesem zentralen Schalter kann jeder Dispatcher
+ einzeln gelockt sein:
+
+ Dispatcher X global => gesamt
+
+ gelockt gelockt => gelockt
+ freigegeben gelockt => gelockt
+ gelockt freigegeben => gelockt
+ freigegeben freigegeben => freigegeben
+
+ Wenn der aktive Dispatcher gelockt ist, werden keine Requests mehr
+ dispatcht.
+
+ [Querverweise]
+ <SfxDispatcher::Lock(sal_Bool)> */
+
+{
+ bDispatcherLocked = bLock;
+ if ( !bLock )
+ {
+ GetDispatcher().InvalidateBindings_Impl( pAppData_Impl->bInvalidateOnUnlock );
+ pAppData_Impl->bInvalidateOnUnlock = sal_False;
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectShell* SfxApplication::GetActiveObjectShell() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert einen Zeiger auf die aktive <SfxObjectShell>-
+ Instanz oder einen 0-Pointer, falls keine SfxObjectShell-Instanz
+ aktiv ist.
+*/
+
+{
+ if ( pViewFrame )
+ return pViewFrame->GetObjectShell();
+ return 0;
+}
+
+//--------------------------------------------------------------------
+#if SUPD<594
+sal_uInt32 SfxApplication::InsertEventHdl
+(
+ const GenLink& rLink /* Link, der auf ein StarView-UserEvent
+ gerufen werden soll. */
+)
+
+/* [Beschreibung]
+
+ Diese Methode fuegt einen Handler fuer ein StarView-UserEnvent
+ ein und liefert die Id fuer das Event zurueck.
+
+ PostAppEvent() mit dieser Id ruft daher den eingefuegen Handler.
+
+ Somit koennen verschiedenen, sich gegenseitig unbekannte Programmteile
+ in derselben Applikation koexistieren und UserEvents verschicken.
+*/
+
+{
+ return ( pImp->pEventHdl->Insert( new GenLink(rLink) ) ) + DYNAMIC_USERID_OFFSET;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RemoveEventHdl
+(
+ sal_uInt32 nId /* Id des StarView-UserEvents, das entfernt
+ werden soll. */
+)
+
+/* [Beschreibung]
+
+ Diese Methode entfernt den unter der Id nId eingefuegten Handler
+ fuer StarView-UserEvents. Die Id wird damit zur Wiederverwendung
+ freigegeben, darf also nicht mehr verwendet werden, bis sie durch
+ ein erneutes <SfxApplication::InsertEventHdl()> wieder
+ zurueckgegeben wurde.
+
+ */
+
+{
+ delete (GenLink*) pImp->pEventHdl->Remove( nId - DYNAMIC_USERID_OFFSET );
+}
+#endif
+
+//--------------------------------------------------------------------
+
+#if SUPD<594
+void SfxApplication::UserEvent
+(
+ sal_uInt32 nEvent /* Id des StarView-UserEvents */,
+
+ void* pEventData /* Event-Daten abhaengig von der Event-Id */
+)
+
+/* [Beschreibung]
+
+ StarView-Handler zum Ausfuehrend eines UserEvents.
+
+ In SFx-Applikationen muessen die Event-Ids durch die Methode
+ <SfxApplication::InsertEventHdl()> ermittelt werden. Sollte eine
+ Subklasse von SfxApplication diese Methode ueberladen, mu"s die
+ Basisimplementierung gerufen werden.
+
+ */
+
+{
+ // z.b. ein Channel-Agent kann so Directories updaten
+ if ( SID_RELOAD == nEvent && pEventData )
+ {
+ String aString = S2U( (const char*) pEventData );
+ SFX_APP()->Broadcast( SfxDirEntryHint( 0, aString ) );
+ return;
+ }
+
+ if ( nEvent >= DYNAMIC_USERID_OFFSET )
+ {
+ GenLink* pLink = (GenLink*) pImp->pEventHdl->Get( nEvent-DYNAMIC_USERID_OFFSET );
+ if ( pLink )
+ {
+ pLink->Call( (SfxHint*) pEventData );
+ return;
+ }
+ }
+
+ if ( nEvent == ULONG_MAX )
+ {
+ if ( pEventData )
+ DELETEZ(pAppData_Impl->pProgress);
+ else
+ {
+ pAppData_Impl->pProgress = new SfxProgress(0, String(SfxResId(RID_PLUGIN)), 0, sal_True);
+ pAppData_Impl->pProgress->Lock();
+ }
+ }
+ else
+ DBG_ERROR( "unregistered user event occured" );
+}
+#endif
+
+//--------------------------------------------------------------------
+
+sal_Bool IsTemplate_Impl( const String& aPath )
+{
+ INetURLObject aObj( aPath, INET_PROT_FILE );
+ if ( aObj.getExtension().CompareIgnoreCaseToAscii( "vor" ) == COMPARE_EQUAL )
+ return sal_True;
+
+ SvEaMgr aMgr( aPath );
+ String aType;
+
+ if ( aMgr.GetFileType(aType) )
+ {
+ const SfxFilter* pFilter = SFX_APP()->GetFilterMatcher().GetFilter4EA( aType );
+ if( pFilter && pFilter->IsOwnTemplateFormat() )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+void SfxApplication::HandleAppEvent( const ApplicationEvent& rAppEvent )
+{
+ if ( rAppEvent.IsOpenEvent() )
+ {
+ // die Parameter enthalten die zu "offnenden Dateien
+ for(sal_uInt16 i=0;i<rAppEvent.GetParamCount();i++)
+ {
+ // Dateiname rausholen
+ String aName( rAppEvent.GetParam(i) );
+ if ( COMPARE_EQUAL == aName.CompareToAscii("/userid:",8) )
+ continue;
+#ifdef WNT
+ FATToVFat_Impl( aName );
+#endif
+ SfxStringItem aFileName( SID_FILE_NAME, aName );
+
+#ifdef APPEVENT_DBG
+ aStream << "Open: " << (const char *)aFileName.GetValue();
+#endif
+ // Art, Existens und Groesse
+ INetURLObject aURL( aFileName.GetValue(), INET_PROT_FILE );
+ sal_Bool bIsFileURL = INET_PROT_FILE == aURL.GetProtocol();
+
+ // ist ein oeffnen grundsaetzlich moeglich
+ if ( TRUE ) // (pb)
+ {
+ // ist es eine Vorlage?
+ if ( bIsFileURL && IsTemplate_Impl( aURL.GetMainURL() ) )
+ {
+#ifdef APPEVENT_DBG
+ aStream << " Neues Dokument aus Vorlage angelegt\n";
+#endif
+ // neue Datei aus der Vorlage erzeugen
+ pAppDispat->Execute( SID_NEWDOC, SFX_CALLMODE_SYNCHRON, &aFileName, 0L );
+ }
+ else
+ {
+#ifdef APPEVENT_DBG
+ aStream << " Neues Dokument geoeffnet\n";
+#endif
+ // ::com::sun::star::util::URL "offnen
+ if ( !DocAlreadyLoaded( aFileName.GetValue(), sal_True, sal_True, sal_False ) )
+ {
+ SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, sal_False );
+ SfxStringItem aTargetName( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") );
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:OpenEvent") );
+ pAppDispat->Execute( SID_OPENDOC,
+ SFX_CALLMODE_SYNCHRON, &aTargetName,
+ &aFileName, &aNewView, &aReferer, 0L );
+ }
+ }
+ }
+ else
+ {
+ // ACHTUNG: keine Fehlermeldung bei '.' (unterdr"uckt OpenClients)
+ HACK(Fehlermeldung fehlt);
+#ifdef APPEVENT_DBG
+ aStream << " FEHLER\n";
+#endif
+ }
+ }
+ }
+ else if(rAppEvent.IsPrintEvent() )
+ {
+ // "uber die Parameter iterieren (zu druckende Dateien + Druckername)
+ SfxStringItem aPrinterName(SID_PRINTER_NAME, String());
+ for (sal_uInt16 i=0;i<rAppEvent.GetParamCount();i++)
+ {
+ // Druckername?
+ String aArg(rAppEvent.GetParam(i));
+ if(aArg.Len()>1 && *aArg.GetBuffer()=='@')
+ {
+ aPrinterName.SetValue( aArg.Copy(1) );
+ continue;
+ }
+
+ // Datei "offnen -- immer neue ::com::sun::star::sdbcx::View erzeugen
+ SfxStringItem aTargetName( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") );
+ SfxStringItem aFileName( SID_FILE_NAME, aArg );
+ SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, sal_True);
+ SfxBoolItem aHidden(SID_HIDDEN, sal_True);
+ SfxBoolItem aSilent(SID_SILENT, sal_True);
+ const SfxPoolItem *pRet = pAppDispat->Execute( SID_OPENDOC,
+ SFX_CALLMODE_SYNCHRON, &aTargetName,
+ &aFileName, &aNewView, &aHidden, &aSilent, 0L );
+ if ( !pRet )
+ continue;
+
+ // die neue ::com::sun::star::sdbcx::View des Dokuments ermitteln
+ const SfxViewFrameItem *pFrameItem =
+ PTR_CAST(SfxViewFrameItem, pRet);
+ if ( pFrameItem && pFrameItem->GetFrame() )
+ {
+ // "uber die ::com::sun::star::sdbcx::View drucken
+ SfxViewFrame *pFrame = pFrameItem->GetFrame();
+ SfxBoolItem aSilent( SID_SILENT, sal_True );
+ pFrame->GetDispatcher()->Execute( SID_PRINTDOC,
+ SFX_CALLMODE_SYNCHRON,
+ &aPrinterName, &aSilent, 0L );
+ pFrame->GetFrame()->DoClose();
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+long SfxAppFocusChanged_Impl( void* pObj, void* pArg )
+{
+ SfxApplication *pApp = SFX_APP();
+ if ( pApp && !pApp->IsDowning() )
+ {
+ Help* pHelp = Application::GetHelp();
+ Window* pFocusWindow = Application::GetFocusWindow();
+ if ( pHelp && pFocusWindow )
+ {
+ sal_uInt32 nId = pFocusWindow->GetHelpId();
+ while ( !nId && pFocusWindow )
+ {
+ pFocusWindow = pFocusWindow->GetParent();
+ nId = pFocusWindow ? pFocusWindow->GetHelpId() : 0;
+ }
+ ((SfxHelp_Impl*)pHelp)->SlotExecutedOrFocusChanged(
+ nId, sal_False, pApp->GetOptions().IsAutoHelpAgent() );
+ }
+ }
+
+ return 0;
+}
+
+void SfxApplication::FocusChanged()
+{
+ static AsynchronLink *pFocusCallback = new AsynchronLink( Link( 0, SfxAppFocusChanged_Impl ) );
+ pFocusCallback->Call( this, sal_True );
+}
+
+//--------------------------------------------------------------------
+
+FASTBOOL SfxApplication::KeyInput( const KeyEvent &rKeyEvent )
+
+/* [Beschreibung]
+
+ Diese Methode fuehrt das ::com::sun::star::awt::KeyEvent 'rKeyEvent' ueber die an der
+ Applikation konfigurieren Tasten (Applikations-Accelerator) aus.
+
+ In der Regel sollten konfigurierbare Tasten ueber die Methode
+ <SfxViewShell::KeyInput(const ::com::sun::star::awt::KeyEvent&)> der aktiven SfxViewShell
+ ausgefuehrt werden.
+
+
+ [Rueckgabewert]
+
+ FASTBOOL sal_True
+ die Taste ist konfiguriert, der betreffende
+ Handler wurde gerufen
+
+ sal_False
+ die Taste ist nicht konfiguriert, es konnte
+ also kein Handler gerufen werden */
+
+{
+ const KeyCode& rKeyCode = rKeyEvent.GetKeyCode();
+ if ( rKeyCode.IsMod2() && rKeyCode.IsMod1() )
+ {
+ switch ( rKeyCode.GetCode() )
+ {
+ case KEY_D :
+ {
+ // ehemals ChaosDump
+ break;
+ }
+ }
+ }
+
+ if ( pViewFrame && pAcceleratorMgr->Call(rKeyEvent, pViewFrame->GetBindings() ) )
+ return sal_True;
+ return sal_False;
+}
+
+//--------------------------------------------------------------------
+
+const String& SfxApplication::GetLastDir_Impl() const
+
+/* [Beschreibung]
+
+ Interne Methode, mit der im SFx das zuletzt mit der Methode
+ <SfxApplication::SetLastDir_Impl()> gesetzte Verzeichnis
+ zurueckgegeben wird.
+
+ Dieses ist i.d.R. das zuletzt durch den SfxFileDialog
+ angesprochene Verzeichnis.
+
+ [Querverweis]
+ <SfxApplication::SetLastDir_Impl()>
+*/
+
+{
+ return pAppData_Impl->aLastDir;
+}
+
+const String& SfxApplication::GetLastSaveDirectory() const
+
+/* [Beschreibung]
+
+ Wie <SfxApplication::GetLastDir_Impl()>, nur extern
+
+ [Querverweis]
+ <SfxApplication::GetLastDir_Impl()>
+*/
+
+{
+ return GetLastDir_Impl();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetLastDir_Impl
+(
+ const String& rNewDir /* kompletter Verzeichnis-Pfad als String */
+ )
+
+/* [Beschreibung]
+
+ Interne Methode, mit der ein Verzeichnis-Pfad gesetzt wird, der
+ zuletzt (z.B. durch den SfxFileDialog) angesprochen wurde.
+
+ [Querverweis]
+ <SfxApplication::GetLastDir_Impl()>
+*/
+
+{
+ pAppData_Impl->aLastDir = rNewDir;
+}
+
+//--------------------------------------------------------------------
+
+const String& SfxApplication::GetLastFilter_Impl() const
+{
+ return pAppData_Impl->aLastFilter;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetLastFilter_Impl( const String &rNewFilter )
+{
+ pAppData_Impl->aLastFilter = rNewFilter;
+}
+
+//--------------------------------------------------------------------
+#if SUPD<606
+SfxDispatcher& SfxApplication::GetDispatcher()
+{
+ return pViewFrame? *pViewFrame->GetDispatcher(): *pAppDispat;
+}
+
+SfxBindings& SfxApplication::GetBindings() const
+{
+ DBG_ASSERT( pViewFrame, "No ViewFrame available!" );
+ return pViewFrame? pViewFrame->GetBindings(): SfxViewFrame::GetFirst( 0, 0, sal_False )->GetBindings();
+}
+#endif
+
+SfxDispatcher* SfxApplication::GetDispatcher_Impl()
+{
+ return pViewFrame? pViewFrame->GetDispatcher(): pAppDispat;
+}
+
+//--------------------------------------------------------------------
+void SfxApplication::SetViewFrame( SfxViewFrame *pFrame )
+{
+ if( pFrame && !pFrame->IsSetViewFrameAllowed_Impl() )
+ return;
+
+ if ( pFrame != pViewFrame )
+ {
+ SfxInPlaceFrame *pOld = PTR_CAST( SfxInPlaceFrame, pViewFrame );
+ SfxInPlaceFrame *pNew = PTR_CAST( SfxInPlaceFrame, pFrame );
+ FASTBOOL bTaskActivate = !pNew;
+ SfxViewFrame *pContainer = pViewFrame;
+ while ( pContainer && pContainer->GetParentViewFrame_Impl() )
+ pContainer = pContainer->GetParentViewFrame_Impl();
+
+ BOOL bDocWinActivate = pContainer && pFrame &&
+ ( pContainer->GetTopViewFrame() == pFrame || pFrame->GetTopViewFrame() == pContainer );
+
+ if ( bTaskActivate )
+ {
+ if ( pViewFrame )
+ {
+ // BeamerConfig sichern
+ pViewFrame->GetFrame()->Deactivate_Impl();
+
+ // DeactivateEvent f"ur den alten ViewFrame verschicken
+ NotifyEvent( SfxEventHint( SFX_EVENT_DEACTIVATEDOC, pViewFrame->GetObjectShell() ) );
+
+ // Ggf. auch InPlaceDeactivate
+ // Daf"ur den aktiven ContainerFrame suchen
+ if ( pOld )
+ {
+ // Falls aktiver IPClient, diesen deaktivieren
+ SvInPlaceClient *pCli = pContainer->GetViewShell() ? pContainer->GetViewShell()->GetIPClient() : NULL;
+ if ( pCli && pCli->GetProtocol().IsUIActive() )
+ {
+ if ( bDocWinActivate )
+ {
+ pCli->GetIPObj()->GetIPEnv()->DoShowUITools( sal_False );
+ pCli->GetProtocol().DocWinActivate( sal_False );
+ }
+ else
+ pCli->GetProtocol().TopWinActivate( sal_False );
+ }
+ }
+ }
+ }
+
+ SfxViewFrame *pOldContainerFrame = pViewFrame;
+ if( pOldContainerFrame )
+ {
+ // Wenn der alte Frame ein IPFrame ist, mu\s dessen ContainerDokument aktiviert werden,
+ // der IPFrame wurde schon im Top/DocWinDeactivate
+ if ( pOld )
+ pOldContainerFrame = pOld->GetParentViewFrame_Impl();
+
+ if ( bTaskActivate && pOldContainerFrame != pViewFrame )
+ NotifyEvent( SfxEventHint( SFX_EVENT_DEACTIVATEDOC, pOldContainerFrame->GetObjectShell() ) );
+
+ pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame );
+ }
+
+ pViewFrame = pFrame;
+
+ // Jetzt ist der ViewFrame gesetzt, das TopWindow kann abgefragt werden
+ Application::SetDefDialogParent( pViewFrame ? GetWorkWindow_Impl(pViewFrame)->GetTopWindow() : NULL );
+
+ const SfxObjectShell* pSh = pViewFrame ? pViewFrame->GetObjectShell() : 0;
+ if ( !pSh )
+ {
+ // Wenn es ein Dokument gibt, wird die BaseURL im Activate gesetzt
+ INetURLObject aObject( GetIniManager()->Get( SFX_KEY_WORK_PATH ), INET_PROT_FILE );
+ aObject.setFinalSlash();
+ INetURLObject::SetBaseURL( aObject.GetMainURL() );
+ }
+
+ // Activate mit sal_True auch wenn die zu aktivierenden Bindings gerade
+ // keinen Dispatcher haben
+ if ( pViewFrame && bTaskActivate )
+ pViewFrame->GetObjectShell()->PostActivateEvent_Impl();
+
+ if( pViewFrame )
+ pViewFrame->DoActivate(
+ bTaskActivate ||
+ pViewFrame->GetBindings().GetDispatcher_Impl() !=
+ pViewFrame->GetDispatcher(), pOldContainerFrame );
+
+ if( pOldContainerFrame && pOldContainerFrame->GetProgress() )
+ pOldContainerFrame->GetProgress()->Suspend();
+
+ // Beim Browsen kann es passieren, da\s gerade keine ViewShell da ist
+ if ( pViewFrame && !pViewFrame->GetViewShell() )
+ return;
+
+ if ( pViewFrame )
+ {
+ if ( pNew )
+ {
+ pNew->GetEnv_Impl()->ActivateConfig();
+ }
+ else
+ {
+ SfxObjectShell *pObjSh = pViewFrame->GetObjectShell();
+ if ( pObjSh->GetConfigManager())
+ {
+ pObjSh->GetConfigManager()->ActivateTask( pViewFrame );
+ pObjSh->GetConfigManager()->SetParent(pAppData_Impl->pAppCfg);
+ pObjSh->GetConfigManager()->Activate(pCfgMgr);
+ }
+ else
+ {
+ pAppData_Impl->pAppCfg->ActivateTask( pViewFrame );
+ pAppData_Impl->pAppCfg->Activate(pCfgMgr);
+ }
+
+ SfxDispatcher* pDisp = pViewFrame->GetDispatcher();
+ pDisp->Flush();
+ pDisp->Update_Impl(sal_True);
+
+ SfxProgress *pProgress = pViewFrame->GetProgress();
+ if ( !pProgress )
+ pProgress = pAppData_Impl->pProgress;
+ if ( pProgress )
+ {
+ if( pProgress->IsSuspended() )
+ pProgress->Resume();
+ else
+ pProgress->SetState( pProgress->GetState() );
+ }
+
+ // Falls aktiver IPClient, diesen aktivieren
+ SvInPlaceClient *pCli = pViewFrame->GetViewShell()->GetIPClient();
+ if ( pCli && pCli->GetProtocol().IsUIActive() )
+ {
+ if ( bDocWinActivate )
+ {
+ pCli->GetIPObj()->GetIPEnv()->DoShowUITools( sal_True );
+ pCli->GetProtocol().DocWinActivate( sal_True );
+ }
+ else
+ pCli->GetProtocol().TopWinActivate( sal_True );
+ }
+ }
+ }
+ else
+ {
+ pCfgMgr->ActivateTask( NULL );
+ pAppData_Impl->pAppCfg->Activate( pCfgMgr );
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+
+sal_uInt32 SfxApplication::DetectFilter( const String &rFileName,
+ const SfxFilter **ppFilter,
+ sal_uInt16 nFilterClass )
+{
+ SfxMedium aSfxMedium(rFileName,(STREAM_READ | STREAM_SHARE_DENYNONE),sal_False);
+
+ return DetectFilter(aSfxMedium, ppFilter, nFilterClass );
+}
+
+//-------------------------------------------------------------------------
+
+sal_uInt32 SfxApplication::DetectFilter(
+ SfxMedium& rMedium,const SfxFilter **ppFilter, sal_uInt16 nFilterClass )
+{
+ const SfxFilter *pFilter=0;
+ SvEaMgr aMgr( rMedium.GetName() );
+ String aType;
+ if ( !SfxObjectFactory::HasObjectFactories() )
+ return 1; HACK(Error-Code verwenden) ;
+
+ SfxFilterMatcher rMatcher( SfxObjectFactory::GetDefaultFactory().GetFilterContainer() );
+ if( aMgr.GetFileType( aType ))
+ pFilter = rMatcher.GetFilter4EA( aType );
+
+ if( !pFilter)
+ {
+ if ( !rMedium.IsRemote() && rMedium.IsStorage() )
+ {
+ SvStorageRef aStor = rMedium.GetStorage();
+ if ( !aStor.Is() )
+ return ERRCODE_IO_GENERAL;
+ pFilter = rMatcher.GetFilter4ClipBoardId(aStor->GetFormat());
+ }
+ else
+ {
+ // Finden anhand der Extension
+ pFilter = rMatcher.GetFilter4Extension(
+ rMedium.GetURLObject().GetName() );
+ if ( pFilter && pFilter->UsesStorage() )
+ pFilter = 0;
+ }
+ }
+
+ if(pFilter)
+ *ppFilter=pFilter;
+
+ return pFilter? 0: 1; HACK(Error-Code verwenden)
+}
+
+
+
+//--------------------------------------------------------------------
+
+ErrCode SfxApplication::FileOpenDialog_Impl
+(
+ sal_uInt32 nFlags,
+ const SfxObjectFactory& rFact,
+ SvStringsDtor*& rpURLList,
+ String& rFilter,
+ SfxItemSet *& rpSet,
+ sal_Bool* pConvert
+)
+{
+ const SfxFilter* pFilt = GetFilterMatcher().GetDefaultFilter();
+ if( pFilt )
+ rFilter = pFilt->GetName();
+
+ SfxViewFrame *pFrame = SfxViewFrame::Current();
+ while ( pFrame->GetParentViewFrame_Impl() )
+ pFrame = pFrame->GetParentViewFrame_Impl();
+
+ SfxFileDialog* pDlg =
+ GetISfxModule( pFrame )->CreateDocFileDialog( nFlags ? nFlags : WB_OPEN | WB_3DLOOK, rFact );
+ const short nRet = pDlg->Execute();
+ if ( nRet == RET_OK )
+ {
+ rFilter = pDlg->GetCurFilter();
+ rpSet = new SfxAllItemSet( *pDlg->GetItemSet() );
+ if ( SFXWB_INSERT == (nFlags & SFXWB_INSERT) )
+ rpSet->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
+ sal_Bool bActivate = sal_False;
+ rFilter = pDlg->GetCurFilter();
+ rpURLList = pDlg->GetPathList();
+ delete pDlg;
+ return ERRCODE_NONE;
+ }
+ else
+ {
+ delete pDlg;
+ return ERRCODE_ABORT;
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxNewFileDialog* SfxApplication::CreateNewDialog()
+{
+ return new SfxNewFileDialog(GetTopWindow(), SFXWB_DOCINFO | SFXWB_PREVIEW );
+}
+
+//--------------------------------------------------------------------
+
+const SfxFilter* SfxApplication::GetFilter
+(
+ const SfxObjectFactory &rFact,
+ const String &rFilterName
+ ) const
+{
+ DBG_ASSERT( rFilterName.Search( ':' ) == STRING_NOTFOUND,
+ "SfxApplication::GetFilter erwartet unqualifizierte Namen" );
+ return rFact.GetFilterContainer()->GetFilter4FilterName(rFilterName);
+}
+
+//--------------------------------------------------------------------
+
+short SfxApplication::QuerySave_Impl( SfxObjectShell& rDoc, sal_Bool bAutoSave )
+{
+ if ( !rDoc.IsModified() )
+ return RET_NO;
+
+ String aMsg( SfxResId( STR_ISMODIFIED ) );
+ aMsg.SearchAndReplaceAscii( "%1", rDoc.GetTitle() );
+
+ SfxFrame *pFrame = SfxViewFrame::GetFirst(&rDoc)->GetFrame();
+ pFrame->Appear();
+
+ WinBits nBits = WB_YES_NO_CANCEL;
+ nBits |= bAutoSave ? WB_DEF_YES : WB_DEF_NO;
+ QueryBox aBox( &pFrame->GetWindow(), nBits, aMsg );
+
+ if ( bAutoSave )
+ aBox.SetText( String( SfxResId( STR_AUTOSAVE ) ) );
+
+ return aBox.Execute();
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool Drop1_Impl( sal_uInt16 nSID, const String &rFile, sal_Bool bHidden,
+ SfxExecuteItem *&rpExecItem, SfxExecuteItem *&rpPrintItem )
+{
+ // Parameter bestimmen
+ SfxStringItem aFileNameItem(SID_FILE_NAME, rFile);
+ SfxBoolItem aHiddenItem(SID_HIDDEN, bHidden);
+ SfxStringItem aRefererItem(SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ SfxExecuteItem* pOld = rpExecItem;
+ if( !rpPrintItem )
+ rpExecItem = new SfxExecuteItem(
+ SID_SUBREQUEST, nSID, SFX_CALLMODE_SYNCHRON,
+ &aFileNameItem, &aHiddenItem, &aRefererItem,
+ (SfxPoolItem*)rpExecItem, 0L );
+ else
+ rpExecItem = new SfxExecuteItem(
+ SID_SUBREQUEST, nSID, SFX_CALLMODE_SYNCHRON,
+ &aFileNameItem, &aHiddenItem, &aRefererItem, rpPrintItem,
+ (SfxPoolItem*)rpExecItem, 0L );
+ delete pOld;
+ return sal_True;
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxApplication::Drop_Impl( sal_uInt16 nSID, DropEvent& rEvt )
+
+/* [Beschreibung]
+
+ F"uhrt 'nSID' mit den Files aus, die im DragServer stehen.
+*/
+
+{
+ // Actions bestimmen
+ sal_uInt16 n2ndSID = 0; // nach SID_OPENDOC auszuf"uhren
+ sal_Bool bHidden = sal_False; // unsichtbar "offnen
+ switch ( nSID )
+ {
+ case SID_OPENDOC:
+ case SID_OPENURL:
+ break;
+
+ case SID_PRINTDOC:
+ case SID_PRINTDOCDIRECT:
+ n2ndSID = SID_PRINTDOCDIRECT;
+ bHidden = sal_True;
+ break;
+
+ case SID_NEWDOC:
+ case SID_NEWDOCDIRECT:
+ nSID = SID_NEWDOC;
+ break;
+
+ default:
+ // unbekannte SID
+ return sal_False;
+ }
+
+ // "uber die Items im DragServer iterieren
+ const sal_uInt16 nCount = DragServer::GetItemCount();
+ sal_Bool bSuccess = sal_False;
+
+ SfxExecuteItem* pExecItem = 0;
+ SfxExecuteItem* pPrintItem = n2ndSID ? new SfxExecuteItem(
+ SID_AFTEROPENEVENT, n2ndSID, SFX_CALLMODE_SYNCHRON ) : 0;
+
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ // Format erkennen
+ String aFile;
+ INetBookmark aBmk;
+ if ( DragServer::HasFormat(i, FORMAT_FILE_LIST) )
+ {
+ // SvData basteln
+ SvData aData( FORMAT_FILE_LIST );
+ SvDataObjectRef xDataObj = SvDataObject::PasteDragServer( rEvt );
+ xDataObj->GetData( &aData );
+
+ // Daten holen
+ FileList aFileList;
+ FileList* pFileList = &aFileList;
+ aData.GetData( (SvDataCopyStream**)&pFileList, pFileList->Type() );
+ for ( sal_uInt16 n = (sal_uInt16)aFileList.Count(); n--; )
+ Drop1_Impl( nSID, aFileList.GetFile(n), bHidden,
+ pExecItem, pPrintItem );
+ }
+ else if ( DragServer::HasFormat(i, FORMAT_FILE) )
+ {
+ String aFile = DragServer::PasteFile(i);
+ Drop1_Impl( nSID, aFile, bHidden, pExecItem, pPrintItem );
+ }
+ else if ( aBmk.PasteDragServer(i) )
+ {
+ // Format via ::com::sun::star::text::Bookmark rausholen
+ Drop1_Impl( nSID, aBmk.GetURL(), bHidden, pExecItem, pPrintItem );
+ }
+ }
+
+ if( pExecItem )
+ {
+ // Fuer Mac muss erstes Execute Asyncron kommen
+ pExecItem->SetCallMode( SFX_CALLMODE_ASYNCHRON );
+ pViewFrame->GetDispatcher()->Execute( *pExecItem );
+ delete pExecItem;
+ }
+
+
+ // scheinbar annehmen, sonst kommt zweites Drop im falschen Window
+ return DROP_COPY == rEvt.GetAction();
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxApplication::QueryDrop_Impl( sal_uInt16 nSID, DropEvent& rEvt )
+
+/* [Beschreibung]
+
+ QueryDrop-Handler; wird in der Regel aus dem QueryDrop() an den
+ Windows gerufen;
+ er returned sal_True, wenn FORMAT_FILE im DragServer vorliegt.
+*/
+{
+ if ( nSID == SID_OPENDOC || nSID == SID_OPENURL ||
+ nSID == SID_PRINTDOC || nSID == SID_PRINTDOCDIRECT ||
+ nSID == SID_NEWDOC || nSID == SID_NEWDOCDIRECT )
+ {
+ const sal_uInt16 nCount = DragServer::GetItemCount();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ {
+ if ( INetBookmark::DragServerHasFormat( i ) ||
+ DragServer::HasFormat(i, FORMAT_FILE) ||
+ DragServer::HasFormat(i, FORMAT_FILE_LIST) )
+ {
+ // if ( rEvt.IsDefaultAction() )
+ {
+ rEvt.SetAction( DROP_COPY );
+ return sal_True;
+ }
+ if ( rEvt.GetAction() == DROP_COPY )
+ return sal_True;
+ }
+ }
+ }
+ return sal_False;
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxApplication::Drop( DropEvent& rEvt )
+
+/* [Beschreibung]
+
+ Dieser Drop-Handler kann von den Applikationen, die i.d.R. keine
+ Ableitug vom SfxApplicationWindow haben, "uberladen werden. Er wird in
+ der Regel aus dem Drop() an den Windows gerufen.
+
+ In der Basisimplementierung wird versucht, alle Elemente im DragServer
+ als Datei zu oeffnen, indem sie als Event ueber den Dispatcher verschickt
+ werden.
+*/
+
+{
+ return Drop_Impl( SID_OPENDOC, rEvt );
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxApplication::QueryDrop( DropEvent& rEvt )
+
+/* [Beschreibung]
+
+ Dieser QueryDrop-Handler kann von den Applikationen, die i.d.R. keine
+ Ableitug vom SfxApplicationWindow haben, "uberladen werden. Er wird in
+ der Regel aus dem QueryDrop() an den Windows gerufen.
+
+ Die Basisimplementierung returned sal_True, wenn FORMAT_FILE im DragServer
+ vorliegt.
+*/
+
+{
+ return QueryDrop_Impl( SID_OPENDOC, rEvt );
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxApplication::IsInException() const
+{
+ return pAppData_Impl->bInException;
+}
+
+//--------------------------------------------------------------------
+
+sal_uInt16 SfxApplication::Exception( sal_uInt16 nError )
+{
+ if ( pAppData_Impl->bInException )
+ Application::Abort( pImp->aDoubleExceptionString );
+
+ pAppData_Impl->bInException = sal_True;
+
+ if( SfxNewHdl::Get() )
+ {
+ SfxNewHdl::Get()->FlushWarnMem();
+ SfxNewHdl::Get()->FlushExceptMem();
+ }
+
+#ifndef TF_UCB
+ // Flush all CHAOS data.
+ CntSystem::Flush();
+#endif
+
+ INetURLObject aSaveObj( pAppIniMgr->Get( SFX_KEY_BACKUP_PATH ), INET_PROT_FILE );
+ if ( Application::IsInExecute() )
+ {
+ // save all modified documents and close all documents
+ SfxObjectShell *pIter, *pNext;
+ sal_uInt16 n = 0;
+ for(pIter = SfxObjectShell::GetFirst(); pIter; pIter = pNext)
+ {
+ pNext = SfxObjectShell::GetNext(*pIter);
+ if( pIter->IsModified() && pIter->GetName().CompareToAscii("BasicIDE") != COMPARE_EQUAL && !pIter->IsLoading() )
+ {
+ //try
+ {
+ // backup unsaved document
+ SFX_ITEMSET_ARG( pIter->GetMedium()->GetItemSet(), pPassItem, SfxStringItem, SID_PASSWORD, sal_False );
+ SfxRequest aReq(SID_SAVEASDOC, SFX_CALLMODE_SYNCHRON, pIter->GetPool());
+
+ sal_Bool bHadName = pIter->HasName();
+ INetURLObject aOldURL = pIter->GetMedium()->GetURLObject();
+ String aOldName = pIter->GetTitle();
+
+ const SfxFilter *pFilter = pIter->GetMedium()->GetFilter();
+ const SfxFilter *pOrigFilter = pFilter;
+ if ( !pFilter || ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) || !( pFilter->GetFilterFlags() & SFX_FILTER_EXPORT ) )
+ // packed files must be saved with default format, but remember original filter !
+ pFilter = pIter->GetFactory().GetFilter(0);
+
+ String aSaveName, aSavePath = aSaveObj.GetMainURL();
+ String aFilterName;
+ if ( pFilter )
+ {
+ aFilterName = pFilter->GetName();
+ TempFile aTempFile( &aSavePath );
+ aSaveName = aTempFile.GetName();
+ }
+ else
+ {
+ String aExt( DEFINE_CONST_UNICODE( ".sav" ) );
+ TempFile aTempFile( DEFINE_CONST_UNICODE( "exc" ), &aExt, &aSavePath );
+ aSaveName = aTempFile.GetName();
+ }
+
+ aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aSaveName ) );
+ aReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilterName ) );
+ if ( pPassItem )
+ aReq.AppendItem( *pPassItem );
+
+ pIter->ExecuteSlot(aReq);
+
+ String aEntry( aSaveName );
+ aEntry += DEFINE_CONST_UNICODE(";");
+ aEntry += pOrigFilter ? pOrigFilter->GetName() : aFilterName;
+ aEntry += DEFINE_CONST_UNICODE(";");
+
+ if ( bHadName && INET_PROT_FILE == aOldURL.GetProtocol() )
+ {
+ aEntry += DEFINE_CONST_UNICODE("url;"),
+ aEntry += aOldURL.GetMainURL();
+ }
+ else
+ {
+ aEntry += DEFINE_CONST_UNICODE("title;"),
+ aEntry += aOldName;
+ }
+
+ pAppIniMgr->Set( aEntry, SFX_GROUP_WORKINGSET_IMPL, DEFINE_CONST_UNICODE("Recover"), n++ );
+ }
+ /*catch ( ::Exception & )
+ {
+ }*/
+ }
+ }
+
+ pAppIniMgr->Flush();
+
+ if ( ( nError & EXC_MAJORTYPE ) != EXC_DISPLAY && ( nError & EXC_MAJORTYPE ) != EXC_REMOTE )
+ {
+ Window *pTopWindow = GetTopWindow(); // GCC needs temporary
+ WarningBox( pTopWindow, SfxResId(STR_RECOVER_PREPARED) ).Execute();
+ }
+ }
+ else
+ pAppIniMgr->Flush();
+
+ sal_Bool bSendMail = (sal_uInt16) pAppIniMgr->ReadKey( DEFINE_CONST_UNICODE("Common"), DEFINE_CONST_UNICODE("SendCrashMail") ).ToInt32();
+ if ( !pAppData_Impl->bBean && bSendMail )
+ {
+ String aInfo = System::GetSummarySystemInfos();
+ if ( aInfo.Len() )
+ {
+ TempFile aTempFile( aSaveObj.GetMainURL() );
+ String aFileName = aTempFile.GetName();
+ SvFileStream aStr( aFileName, STREAM_STD_READWRITE );
+ aStr.WriteByteString(aInfo);
+ aStr << "\n<Build>\n";
+ aStr << BUILD;
+ aStr << '\n';
+ aStr << "</Build>\n";
+ aStr << "\n<Plattform>\n";
+#ifdef WNT
+ ByteString aPlattform( "wntmsci3" );
+#elif defined ( C50 )
+# if defined ( SPARC )
+ ByteString aPlattform( "unxsols2" );
+# elif defined ( INTEL )
+ ByteString aPlattform( "unxsoli2" );
+# endif
+#elif GLIBC == 2
+ ByteString aPlattform( "unxlngi2" );
+#elif defined ( SPARC ) && defined ( GCC )
+ ByteString aPlattform( "unxsogs" );
+#endif
+#ifndef DBG_UTIL
+ aPlattform += ".pro";
+#endif
+ aStr << aPlattform.GetBuffer();
+ aStr << '\n';
+ aStr << "</Plattform>\n";
+ aStr << "\n<OfficeLanguage>\n";
+ aStr.WriteByteString( ByteString(Application::GetAppInternational().GetLanguage()) );
+ aStr << '\n';
+ aStr << "</OfficeLanguage>\n";
+ aStr << "\n<ExceptionType>\n";
+ aStr << nError;
+ aStr << '\n';
+ aStr << "</ExceptionType>\n";
+ aStr.Close();
+
+ pAppIniMgr->WriteKey( pAppIniMgr->GetGroupName( SFX_GROUP_WORKINGSET_IMPL ),
+ DEFINE_CONST_UNICODE("Info"), aFileName );
+ pAppIniMgr->Flush();
+ }
+ }
+
+ switch( nError & EXC_MAJORTYPE )
+ {
+ case EXC_USER:
+ if( nError == EXC_OUTOFMEMORY )
+ Application::Abort( pImp->aMemExceptionString );
+ break;
+
+ case EXC_RSCNOTLOADED:
+ Application::Abort( pImp->aResExceptionString );
+ break;
+
+ case EXC_SYSOBJNOTCREATED:
+ Application::Abort( pImp->aSysResExceptionString );
+ break;
+ }
+
+ pAppData_Impl->bInException = sal_False;
+ return 0;
+}
+
+//---------------------------------------------------------------------
+
+ResMgr* SfxApplication::CreateResManager( const char *pPrefix )
+{
+ DBG_ASSERT( pAppIniMgr, "call CreateIniManger() before!" )
+
+ String aMgrName = String::CreateFromAscii( pPrefix );
+ aMgrName += String::CreateFromInt32(SOLARUPD); // aktuelle Versionsnummer
+ return ResMgr::CreateResMgr(U2S(aMgrName));
+}
+
+//---------------------------------------------------------------------
+
+SimpleResMgr* SfxApplication::CreateSimpleResManager()
+{
+ SimpleResMgr *pRet;
+ ::rtl::OUString sAppName;
+
+ if ( ::vos::OStartupInfo().getExecutableFile(sAppName) != ::vos::OStartupInfo::E_None )
+ {
+ sAppName = ::rtl::OUString();
+ }
+
+ LanguageType nType = Application::GetAppInternational().GetLanguage();
+ if ( nType == LANGUAGE_SYSTEM )
+ nType = System::GetLanguage();
+
+ String sTemp( sAppName );
+ pRet = new SimpleResMgr( CREATEVERSIONRESMGR_NAME(sfx),
+ nType, &sTemp, 0 );
+
+ return pRet;
+}
+
+//--------------------------------------------------------------------
+
+ResMgr* SfxApplication::GetSfxResManager()
+{
+ if ( !pImp->pSfxResManager )
+ {
+ pImp->pSfxResManager = CreateResManager("sfx");
+#if 0 // SFX on demand
+ if ( !Resource::GetResManager() )
+ Resource::SetResManager( pImp->pSfxResManager );
+#endif
+ }
+
+ return pImp->pSfxResManager;
+}
+
+//--------------------------------------------------------------------
+
+ResMgr* SfxApplication::GetLabelResManager() const
+{
+ return pAppData_Impl->pLabelResMgr;
+}
+
+//--------------------------------------------------------------------
+
+SimpleResMgr* SfxApplication::GetSimpleResManager()
+{
+ if ( !pImp->pSimpleResManager )
+ {
+ pImp->pSimpleResManager = CreateSimpleResManager();
+ }
+ return pImp->pSimpleResManager;
+}
+
+//------------------------------------------------------------------------
+
+void SfxApplication::SetProgress_Impl
+(
+ SfxProgress *pProgress /* zu startender <SfxProgress> oder 0, falls
+ der Progress zurueckgesetzt werden soll */
+)
+
+/* [Beschreibung]
+
+ Interne Methode zum setzen oder zuruecksetzen des Progress-Modes
+ fuer die gesamte Applikation.
+*/
+
+{
+ DBG_ASSERT( ( !pAppData_Impl->pProgress && pProgress ) ||
+ ( pAppData_Impl->pProgress && !pProgress ),
+ "Progress acitivation/deacitivation mismatch" );
+
+ if ( pAppData_Impl->pProgress && pProgress )
+ {
+ pAppData_Impl->pProgress->Suspend();
+ pAppData_Impl->pProgress->UnLock();
+ delete pAppData_Impl->pProgress;
+ }
+
+ pAppData_Impl->pProgress = pProgress;
+}
+
+//------------------------------------------------------------------------
+
+sal_uInt16 SfxApplication::GetFreeIndex()
+{
+ return pAppData_Impl->aIndexBitSet.GetFreeIndex()+1;
+}
+
+//------------------------------------------------------------------------
+
+void SfxApplication::ReleaseIndex(sal_uInt16 i)
+{
+ pAppData_Impl->aIndexBitSet.ReleaseIndex(i-1);
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::EnterAsynchronCall_Impl()
+{
+ ++pAppData_Impl->nAsynchronCalls;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::LeaveAsynchronCall_Impl()
+{
+ --pAppData_Impl->nAsynchronCalls;
+}
+
+//--------------------------------------------------------------------
+
+FASTBOOL SfxApplication::IsInAsynchronCall_Impl() const
+{
+ return pAppData_Impl->nAsynchronCalls > 0;
+}
+
+//--------------------------------------------------------------------
+
+Window* SfxApplication::GetTopWindow() const
+{
+ SfxWorkWindow* pWork = GetWorkWindow_Impl( SfxViewFrame::Current() );
+ return pWork ? pWork->GetWindow() : NULL;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetTopWindow( WorkWindow *pWindow )
+{
+/*
+ sal_Bool bMode = sal_True;
+ if ( !pWindow || pWindow == GetAppWindow() )
+ bMode = sal_False;
+
+ SfxPlugInFrame* pPlug = PTR_CAST( SfxPlugInFrame,
+ GetViewFrame()->GetTopViewFrame() );
+ if ( pPlug )
+ pPlug->GetEnv_Impl()->SetPresentationMode( bMode, pWindow );
+ else
+ GetAppWindow()->SetPresentationMode( bMode, pWindow );
+*/
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::StartPresentationMode
+(
+ WorkWindow* pWindow, // Presentations-Top-Window
+ sal_uInt16 nFlags /* 0 oder arithmetische Veroderung von:
+ PRESENTATION_HIDEALLAPPS
+ PRESENTATION_LIVEMODE */
+)
+
+/* [Beschreibung]
+
+ Wie SV, nur da\s zust"atzlich der Live-Modus ein und ausgeschaltet
+ werden kann.
+*/
+
+{
+// SfxApplicationWindow::Get()->SetPresentationMode( sal_True, pWindow );
+// Application::StartPresentationMode( pWindow, nFlags );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::EndPresentationMode()
+
+/* [Beschreibung]
+
+ Wie SV, nur da\s zust"atzlich der Live-Modus ber"ucksichtigt wird.
+*/
+
+{
+// Application::EndPresentationMode();
+// SfxApplicationWindow::Get()->SetPresentationMode( sal_False, NULL );
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxApplication::IsPresentationMode( sal_uInt16 nFlags )
+
+/* [Beschreibung]
+
+ Pr"uft, ob der Presentationsmodus aktiv ist. Falls Flags angegeben sind,
+ ob auch diese mit dem Modus "ubereinstimmen.
+
+
+ [Beispiel]
+
+ SfxApplication::StartPresentation( pWin, PRESENTATION_LIVAMODE );
+ DBG_ASSERT( sal_True == SfxApplication::IsPresentation(PRESENTATION_LIVAMODE) );
+*/
+
+{
+ return FALSE /*!!! (pb) Application::IsPresentationMode()*/;
+}
+
+sal_Bool SfxApplication::IsPlugin()
+{
+/* Reference < XPluginInstance > xPlugin ( pImp->xFrame, UNO_QUERY );
+ return xPlugin.is();*/
+
+ // Set default return value if method failed.
+ sal_Bool bReturn = sal_False;
+ // Get Desktop to get a list of all current tasks on it.
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTasksSupplier > xDesktop( ::utl::getProcessServiceFactory()->createInstance( OUSTRING(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop")) ), ::com::sun::star::uno::UNO_QUERY );
+ DBG_ASSERT( !(xDesktop.is()==sal_False), "SfxFrame::IsPlugin_Impl()Can't get reference to desktop service!\n" );
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > xList = xDesktop->getTasks()->createEnumeration();
+ while( xList->hasMoreElements() == sal_True )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTask > xTask;
+ xList->nextElement() >>= xTask;
+ ::com::sun::star::uno::Reference< ::com::sun::star::mozilla::XPluginInstance > xPlugIn( xTask, ::com::sun::star::uno::UNO_QUERY );
+ if( xPlugIn.is() == sal_True )
+ {
+ bReturn = sal_True;
+ break;
+ }
+ }
+ return bReturn;
+}
+
+//--------------------------------------------------------------------
+
+const Accelerator& SfxApplication::GetAccelerator_Impl() const
+{
+ return *GetAcceleratorManager()->GetAccel();
+}
+
+//--------------------------------------------------------------------
+
+SvVerbList* SfxApplication::GetVerbList_Impl() const
+{
+ if ( !pAppData_Impl->pVerbs )
+ {
+ // globale Verb-List anlegen
+ pAppData_Impl->pVerbs = new SvVerbList;
+ pAppData_Impl->pVerbs->Append( SvVerb( 0, String( SfxResId( STR_EDITOBJECT ) ) ) );
+ pAppData_Impl->pVerbs->Append( SvVerb( 1, String( SfxResId( STR_OPENOBJECT ) ) ) );
+ pAppData_Impl->pVerbs->Append( SvVerb( 2, DEFINE_CONST_UNICODE(STARAPP_VERB), sal_True, sal_False ) );
+ }
+
+ return pAppData_Impl->pVerbs;
+}
+
+//--------------------------------------------------------------------
+
+/* [Beschreibung]
+
+*/
+
+String SfxApplication::LocalizeDBName
+(
+ SfxDBNameConvert eConvert,
+ const String& rList,
+ char aDel
+) const
+{
+/* String aActName;
+ String aResult;
+ String aNationalName = SfxResId(STR_ADDRESS_NAME);
+ String aIniName( "Address" );
+ sal_uInt16 nCnt = rList.GetTokenCount( aDel );
+
+ for( sal_uInt16 i=0 ; i<nCnt ; i++ )
+ {
+ aActName = rList.GetToken( i, aDel );
+
+ if( eConvert == INI2NATIONAL )
+ {
+ if( aActName == aIniName )
+ aResult += aNationalName;
+ else
+ aResult += aActName;
+ }
+ else
+ {
+ if( aActName == aNationalName )
+ aResult += aIniName;
+ else
+ aResult += aActName;
+ }
+
+ aResult += aDel;
+ }
+
+ aResult.EraseTrailingChars( aDel );
+
+ return aResult;*/
+
+ return rList;
+}
+
+//--------------------------------------------------------------------
+
+IMPL_STATIC_LINK( SfxApplication, CookieAlertHdl_Impl, void*, EMPTYARG )
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetUserEMailAddress( const String &rEMail )
+{
+ pAppData_Impl->aUserEMailAddr = rEMail;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxApplication::SetDefFocusWindow( Window *pWin )
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird das Window gesetzt, auf das beim n"achsten
+ <SfxApplication::GrabFocus()> der Focus gesetzt werden soll.
+
+ Ein 'SetDefFocusWindow()' wirkt f"ur genau einen einzigen Aufruf von
+ 'SfxApplication::GrabFocus()'.
+
+ Damit kann z.B. das in verschiedenen Situationen von Windows kommende
+ Focus-Setzen auf MDIWindows verhindert werden.
+*/
+
+{
+ pAppData_Impl->pDefFocusWin = pWin;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxApplication::GrabFocus( Window *pAlternate )
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird der Focus auf das zuvor mit der Methode
+ <SfxApplicaton::SetDefFocusWindow()> gesetzte Window gegrabt. Ist
+ keins mehr gesetzt oder wurde es bereits verwendet, wird der Focus
+ auf 'pAlternate' gesetzt. Ein 'SetDefFocusWindow()' wirkt f"ur genau
+ ein einziges 'SfxApplication::GrabFocus()'.
+*/
+
+{
+ Window *pWin = pAppData_Impl->pDefFocusWin
+ ? pAppData_Impl->pDefFocusWin
+ : pAlternate;
+ pWin->GrabFocus();
+ pAppData_Impl->pDefFocusWin = 0;
+}
+
+//-------------------------------------------------------------------------
+
+SfxFrame* SfxApplication::GetTargetFrame( const SfxItemSet* pSet,
+ sal_Bool& rbOwner )
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird <GetTargetFrame_Impl(const SfxItemSet*, sal_Bool&)>
+ exportiert.
+*/
+
+{
+ return GetTargetFrame_Impl( pSet, rbOwner );
+}
+
+SfxStatusBarManager* SfxApplication::GetStatusBarManager() const
+{
+ return GetWorkWindow_Impl(SfxViewFrame::Current())->GetStatusBarManager_Impl();
+}
+
+SfxViewFrame* SfxApplication::GetViewFrame()
+{
+ return pViewFrame;
+}
+
+UniqueIndex* SfxApplication::GetEventHandler_Impl()
+{
+ return pImp->pEventHdl;
+}
+
+SfxTbxCtrlFactArr_Impl& SfxApplication::GetTbxCtrlFactories_Impl() const
+{
+ return *pImp->pTbxCtrlFac;
+}
+
+SfxStbCtrlFactArr_Impl& SfxApplication::GetStbCtrlFactories_Impl() const
+{
+ return *pImp->pStbCtrlFac;
+}
+
+SfxMenuCtrlFactArr_Impl& SfxApplication::GetMenuCtrlFactories_Impl() const
+{
+ return *pImp->pMenuCtrlFac;
+}
+
+SfxViewFrameArr_Impl& SfxApplication::GetViewFrames_Impl() const
+{
+ return *pImp->pViewFrames;
+}
+
+SfxViewShellArr_Impl& SfxApplication::GetViewShells_Impl() const
+{
+ return *pImp->pViewShells;
+}
+
+SfxObjectShellArr_Impl& SfxApplication::GetObjectShells_Impl() const
+{
+ return *pImp->pObjShells;
+}
+
+
diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc
new file mode 100644
index 000000000000..fc5d528d3cfd
--- /dev/null
+++ b/sfx2/source/appl/app.hrc
@@ -0,0 +1,189 @@
+/*************************************************************************
+ *
+ * $RCSfile: app.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_APP_HRC
+#define _SFX_APP_HRC
+
+#include "sfx.hrc"
+
+// #defines *****************************************************************
+
+#define ACC_IBM (RID_SFX_APP_START+2)
+#define MSG_ERR_WRITE_CFG (RID_SFX_APP_START+2)
+#define MSG_ERR_READ_CFG (RID_SFX_APP_START+3)
+#define MSG_ERR_OPEN_CFG (RID_SFX_APP_START+4)
+#define MSG_ERR_FILETYPE_CFG (RID_SFX_APP_START+5)
+#define MSG_ERR_VERSION_CFG (RID_SFX_APP_START+6)
+
+#define MSG_ISPRINTING_QUERYABORT (RID_SFX_APP_START+9)
+#define MSG_CANT_QUIT (RID_SFX_APP_START+10)
+#define STR_ISMODIFIED (RID_SFX_APP_START+11)
+#define STR_AUTOSAVE (RID_SFX_APP_START+12)
+#define STR_MAIL (RID_SFX_APP_START+13)
+#define MSG_ERR_WRITE_SBL (RID_SFX_APP_START+14)
+#define MSG_IS_SERVER (RID_SFX_APP_START+15)
+
+#define STR_RESEXCEPTION (RID_SFX_APP_START+21)
+#define STR_SYSRESEXCEPTION (RID_SFX_APP_START+22)
+#define STR_DOUBLEEXCEPTION (RID_SFX_APP_START+23)
+#define STR_RESWARNING (RID_SFX_APP_START+24)
+#define STR_ERR_NOTEMPLATE (RID_SFX_APP_START+27)
+#define STR_RECOVER_TITLE (RID_SFX_APP_START+28)
+#define STR_RECOVER_QUERY (RID_SFX_APP_START+29)
+#define STR_RECOVER_PREPARED (RID_SFX_APP_START+30)
+#define MSG_ERR_SOINIT (RID_SFX_APP_START+31)
+
+#define MSG_IOERR_FILE_NOT_FOUND (RID_SFX_APP_START+32)
+#define MSG_IOERR_PATH_NOT_FOUND (RID_SFX_APP_START+33)
+#define MSG_IOERR_TOO_MANY_OPEN_FILES (RID_SFX_APP_START+34)
+#define MSG_IOERR_ACCESS_DENIED (RID_SFX_APP_START+35)
+#define MSG_IOERR_INVALID_ACCESS (RID_SFX_APP_START+36)
+#define MSG_IOERR_INVALID_HANDLE (RID_SFX_APP_START+37)
+#define MSG_IOERR_CANNOT_MAKE (RID_SFX_APP_START+38)
+#define MSG_IOERR_SHARING (RID_SFX_APP_START+39)
+#define MSG_IOERR_INVALID_PARAMETER (RID_SFX_APP_START+40)
+#define MSG_IOERR_GENERAL (RID_SFX_APP_START+41)
+
+#define RID_FULLSCREENTOOLBOX (RID_SFX_APP_START+42)
+#define RID_RECORDINGTOOLBOX (RID_SFX_APP_START+43)
+#define RID_ENVTOOLBOX (RID_SFX_APP_START+44)
+
+#define STR_EVENT_STARTAPP (RID_SFX_APP_START+50)
+#define STR_EVENT_CLOSEAPP (RID_SFX_APP_START+51)
+#define STR_EVENT_CREATEDOC (RID_SFX_APP_START+52)
+#define STR_EVENT_OPENDOC (RID_SFX_APP_START+53)
+#define STR_EVENT_CLOSEDOC (RID_SFX_APP_START+54)
+#define STR_EVENT_SAVEDOC (RID_SFX_APP_START+55)
+#define STR_EVENT_SAVEASDOC (RID_SFX_APP_START+56)
+#define STR_EVENT_ACTIVATEDOC (RID_SFX_APP_START+57)
+#define STR_EVENT_DEACTIVATEDOC (RID_SFX_APP_START+58)
+#define STR_EVENT_ONERROR (RID_SFX_APP_START+78)
+#define STR_EVENT_PREPARECLOSEDOC (RID_SFX_APP_START+89)
+#define STR_EVENT_NEWMESSAGE (RID_SFX_APP_START+90)
+#define STR_EVENT_SAVEDOCDONE (RID_SFX_APP_START+95)
+#define STR_EVENT_SAVEASDOCDONE (RID_SFX_APP_START+96)
+
+#define STR_QUITAPP (RID_SFX_APP_START+59)
+#define STR_EXITANDRETURN (RID_SFX_APP_START+60)
+#define STR_ERR_NOFILE (RID_SFX_APP_START+61)
+#define STR_EXTHELPSTATUS (RID_SFX_APP_START+62)
+
+#define STR_EVENT_PRINTDOC (RID_SFX_APP_START+64)
+#define STR_ADDRESS_NAME (RID_SFX_APP_START+65)
+
+#define RID_MAIL_INBOX (RID_SFX_APP_START+66)
+#define RID_DELETE_MAIL_QBX (RID_SFX_APP_START+67)
+
+#define RID_STR_HLPFILENOTEXIST (RID_SFX_APP_START+68)
+#define RID_STR_HLPAPPNOTSTARTED (RID_SFX_APP_START+69)
+
+#define STR_NOMODUL (RID_SFX_APP_START+73)
+#define STR_NOOFFICE (RID_SFX_APP_START+74)
+#define STR_NODOUBLE (RID_SFX_APP_START+75)
+#define STR_NOPRINTER (RID_SFX_APP_START+76)
+
+#define MSG_SIGNAL (RID_SFX_APP_START+77)
+
+#define RID_STR_HELP (RID_SFX_APP_START+79)
+#define RID_STR_NOAUTOSTARTHELPAGENT (RID_SFX_APP_START+80)
+#define RID_HELPBAR (RID_SFX_APP_START+81)
+#define RID_SPECIALCONFIG_ERROR (RID_SFX_APP_START+82)
+
+#define RID_IMAGE_RES (RID_SFX_APP_START+83)
+
+#define STR_MEMINFO_HEADER (RID_SFX_APP_START+84)
+#define STR_MEMINFO_FOOTER (RID_SFX_APP_START+85)
+#define STR_MEMINFO_OBJINFO (RID_SFX_APP_START+86)
+
+#define RID_PLUGIN (RID_SFX_APP_START+87)
+
+#define RID_WARN_POST_MAILTO (RID_SFX_APP_START+88)
+
+#define RID_STR_NOWELCOMESCREEN (RID_SFX_APP_START+91)
+
+#define STR_EDITOBJECT (RID_SFX_APP_START+92)
+#define STR_OPENOBJECT (RID_SFX_APP_START+93)
+#define STR_CORRUPT_INSTALLATION (RID_SFX_APP_START+94)
+#define IDS_SBERR_STOREREF (RID_SFX_APP_START+97)
+
+#define RID_IMAGE_USER1 1
+#define RID_IMAGE_USER2 2
+#define RID_IMAGE_USER3 3
+#define RID_IMAGE_USER4 4
+#define RID_IMAGE_BADDATA 5
+#define RID_IMAGE_BINARY 6
+#define RID_IMAGE_DELAYED 7
+#define RID_IMAGE_EMBED 8
+#define RID_IMAGE_IMAGE 9
+#define RID_IMAGE_INDEX 10
+#define RID_IMAGE_MENU 11
+#define RID_IMAGE_MOVIE 12
+#define RID_IMAGE_NOTFOUND 13
+#define RID_IMAGE_SOUND 14
+#define RID_IMAGE_TELNET 15
+#define RID_IMAGE_TEXT 16
+#define RID_IMAGE_UNKNOWN 17
+#define RID_IMAGE_UNSECURE 18
+#define RID_IMAGE_SPECIAL 19
+
+#endif // #ifndef _SFX_APP_HRC
+
+// ******************************************************************* EOF
+
diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src
new file mode 100644
index 000000000000..a31d7a2efee9
--- /dev/null
+++ b/sfx2/source/appl/app.src
@@ -0,0 +1,3406 @@
+/*************************************************************************
+ *
+ * $RCSfile: app.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+ // include ------------------------------------------------------------------
+
+#include "sfx.hrc"
+#include "app.hrc"
+#include "helpid.hrc"
+
+InfoBox RID_DOCALREADYLOADED_DLG
+{
+ Message = "Das Dokument war bereits geladen und wurde aktiviert." ;
+ Message [ ENGLISH ] = "Document was already open." ;
+ Message [ norwegian ] = "Dokumentet er allerede pent." ;
+ Message [ italian ] = "Documento gi aperto ed attivato." ;
+ Message [ portuguese_brazilian ] = "O documento j est aberto." ;
+ Message [ portuguese ] = "O documento j se encontra aberto e foi activado." ;
+ Message [ finnish ] = "Asiakirja on jo avoinna." ;
+ Message [ danish ] = "Dokumentet var allerede indlst og blev aktiveret." ;
+ Message [ french ] = "Document dj charg et activ." ;
+ Message [ swedish ] = "Dokumentet var redan laddat och har aktiverats." ;
+ Message [ dutch ] = "Document is reeds geladen en geactiveerd." ;
+ Message [ spanish ] = "El documento ya est cargado y activado." ;
+ Message [ english_us ] = "Document already open." ;
+ Message[ chinese_simplified ] = "Ѿװļڼ״̬";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Dokument zosta ju zaadowany i uaktywniony.";
+ Message[ japanese ] = "޷Ă͂łɓǂݍ܂걸èނɂȂĂ܂B";
+ Message[ chinese_traditional ] = "wg˸oɮרóBEAC";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Document is reeds geladen en geactiveerd.";
+ Message[ chinese_simplified ] = "Ѿװļڼ״̬";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ̹ ֽϴ.";
+ Message[ turkish ] = "Belge zaten ykl ve ak.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox RID_CANTLOADDOC_DLG
+{
+ Message = "Das Dokument kann nicht geladen werden." ;
+ Message [ ENGLISH ] = "Cannot open document." ;
+ Message [ norwegian ] = "Kan ikke pne dokument." ;
+ Message [ italian ] = "Impossibile aprire il documento." ;
+ Message [ portuguese_brazilian ] = "No consigo abrir o documento." ;
+ Message [ portuguese ] = "Impossvel abrir o documento." ;
+ Message [ finnish ] = "Asiakirjaa ei voi avata." ;
+ Message [ danish ] = "Det er ikke muligt at indlse dokumentet." ;
+ Message [ french ] = "Impossible de charger le document." ;
+ Message [ swedish ] = "Dokumentet kan inte laddas." ;
+ Message [ dutch ] = "Het document kan niet worden geopend." ;
+ Message [ spanish ] = "No es posible cargar el documento." ;
+ Message [ english_us ] = "Cannot open document." ;
+ Message[ chinese_simplified ] = "޷װĵ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Dokument nie moe by zaadowany.";
+ Message[ japanese ] = "޷Ă͓ǂݍ݂ł܂B";
+ Message[ chinese_traditional ] = "Lk˸oɮסC";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Het document kan niet worden geopend.";
+ Message[ chinese_simplified ] = "޷װĵ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ϴ.";
+ Message[ turkish ] = "Belge yklenemiyor.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_READ_CFG
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Fehler beim Lesen der Konfiguration." ;
+ Message [ ENGLISH ] = "Error reading configuration file." ;
+ Message [ norwegian ] = "Feil ved lesing av konfigurasjonsfil." ;
+ Message [ italian ] = "Errore durante la lettura del file di configurazione." ;
+ Message [ portuguese_brazilian ] = "Erro ao ler o arquivo de configurao." ;
+ Message [ portuguese ] = "Erro durante a leitura do ficheiro de configurao." ;
+ Message [ finnish ] = "Virhe asetustiedostoa luettaessa." ;
+ Message [ danish ] = "Fejl under lsning af konfiguration." ;
+ Message [ french ] = "Erreur de lecture de la configuration." ;
+ Message [ swedish ] = "Fel vid lsning av konfiguration." ;
+ Message [ dutch ] = "Fout bij het lezen van het configuratiebestand." ;
+ Message [ spanish ] = "Error al leer el archivo de configuracin." ;
+ Message [ english_us ] = "Error reading configuration file." ;
+ Message[ chinese_simplified ] = "ڶȡļʱ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Bd przy odczycie konfiguracji.";
+ Message[ japanese ] = "ݒǂݎۂ̴װ";
+ Message[ chinese_traditional ] = "bŪtmɮ׮ɵoͿ~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Fout bij het lezen van het configuratiebestand.";
+ Message[ chinese_simplified ] = "ڶȡļʱ";
+ Message[ greek ] = " ";
+ Message[ korean ] = " б .";
+ Message[ turkish ] = "Konfigrasyon dosyas okunurken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_WRITE_CFG
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Fehler beim Schreiben der Konfiguration." ;
+ Message [ ENGLISH ] = "Error writing configuration file." ;
+ Message [ norwegian ] = "Feil ved skriving av konfigurasjonsfil." ;
+ Message [ italian ] = "Errore durante la scrittura del file di configurazione." ;
+ Message [ portuguese_brazilian ] = "Erro ao gravar o arquivo de configurao." ;
+ Message [ portuguese ] = "Erro ao gravar o ficheiro de configurao." ;
+ Message [ finnish ] = "Virhe asetustiedostoa kirjoitettaessa." ;
+ Message [ danish ] = "Fejl under skrivning af konfiguration." ;
+ Message [ french ] = "Erreur lors de l'criture du fichier de configuration." ;
+ Message [ swedish ] = "Fel vid skrivning av konfigurationsfil." ;
+ Message [ dutch ] = "Fout bij het schrijven van het configuratiebestand." ;
+ Message [ spanish ] = "Error al escribir el archivo de configuracin." ;
+ Message [ english_us ] = "Error writing configuration file." ;
+ Message[ chinese_simplified ] = "дļʱ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Bd przy zapisie konfiguracji.";
+ Message[ japanese ] = "ݒ̓ǂݍ݂̍ۂ̴װ";
+ Message[ chinese_traditional ] = "bgJtmɮ׮ɵoX~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Fout bij het schrijven van het configuratiebestand.";
+ Message[ chinese_simplified ] = "дļʱ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " .";
+ Message[ turkish ] = "Konfigrasyon dosyasna yazlrken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_OPEN_CFG
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Fehler beim ffnen der Konfiguration." ;
+ Message [ ENGLISH ] = "Error opening configuration file." ;
+ Message [ norwegian ] = "Feil ved pning av konfigurasjonsfil." ;
+ Message [ italian ] = "Errore durante l'apertura del file di configurazione." ;
+ Message [ portuguese_brazilian ] = "Erro ao abrir o arquivo de configurao." ;
+ Message [ portuguese ] = "Erro ao abrir o ficheiro de configurao." ;
+ Message [ finnish ] = "Virhe asetustiedostoa avattaessa." ;
+ Message [ danish ] = "Fejl ved bning af konfiguration." ;
+ Message [ french ] = "Erreur lors de l'ouverture du fichier de configuration." ;
+ Message [ swedish ] = "Fel vid ppning av konfiguration." ;
+ Message [ dutch ] = "Fout bij het openen van het configuratiebestand." ;
+ Message [ spanish ] = "Error al abrir el archivo de configuracin." ;
+ Message [ english_us ] = "Error opening configuration file." ;
+ Message[ chinese_simplified ] = "ڴļʱ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Bd przy otwieraniu konfiguracji.";
+ Message[ japanese ] = "ݒJۂ̴װ";
+ Message[ chinese_traditional ] = "b}ҰtmɮɵoͿ~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Fout bij het openen van het configuratiebestand.";
+ Message[ chinese_simplified ] = "ڴļʱ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " .";
+ Message[ turkish ] = "Konfigrasyon dosyas alrken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_FILETYPE_CFG
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Datei ist keine Konfigurationsdatei." ;
+ Message [ ENGLISH ] = "File is not a configuration file." ;
+ Message [ norwegian ] = "Filen er ikke en konfigurasjonsfil." ;
+ Message [ italian ] = "Il file non un file di configurazione." ;
+ Message [ portuguese_brazilian ] = "O arquivo no um arquivo de configurao." ;
+ Message [ portuguese ] = "Este ficheiro no um ficheiro de configurao." ;
+ Message [ finnish ] = "Tiedosto ei ole asetustiedosto." ;
+ Message [ danish ] = "Filen er ikke en konfigurationsfil." ;
+ Message [ french ] = "Ce fichier n'est pas un fichier de configuration." ;
+ Message [ swedish ] = "Filen r inte en konfigurationsfil." ;
+ Message [ dutch ] = "Dit bestand is geen configuratiebestand." ;
+ Message [ spanish ] = "El archivo no es un archivo de configuracin." ;
+ Message [ english_us ] = "File is not a configuration file." ;
+ Message[ chinese_simplified ] = "ļļ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Ten plik nie jest plikiem konfiguracyjnym.";
+ Message[ japanese ] = "̧ق͐ݒ̧قł͂܂B";
+ Message[ chinese_traditional ] = "ɮפOtmɮסC";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Dit bestand is geen configuratiebestand.";
+ Message[ chinese_simplified ] = "ļļ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ƴմϴ.";
+ Message[ turkish ] = "Dosya, konfigrasyon dosyas deil.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_VERSION_CFG
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Konfigurationsdatei hat falsche Version." ;
+ Message [ ENGLISH ] = "Configuration file has wrong version." ;
+ Message [ norwegian ] = "Konfigurasjonsfilen har feil versjon." ;
+ Message [ italian ] = "Il file di configurazione di versione errata." ;
+ Message [ portuguese_brazilian ] = "Verso errada do arquivo de configurao." ;
+ Message [ portuguese ] = "Verso errada do ficheiro de configurao." ;
+ Message [ finnish ] = "Asetustiedoston versio on vr." ;
+ Message [ danish ] = "Konfigurationsfilen indeholder forkert version." ;
+ Message [ french ] = "Version incorrecte du fichier de configuration." ;
+ Message [ swedish ] = "Konfigurationsfil har fel version." ;
+ Message [ dutch ] = "Verkeerde versie van configuratiebestand." ;
+ Message [ spanish ] = "El archivo de configuracin tiene una versin falsa." ;
+ Message [ english_us ] = "Configuration file contains the wrong version." ;
+ Message[ chinese_simplified ] = "ļ汾";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Plik konfiguracji zawiera nieprawidow wersj.";
+ Message[ japanese ] = "ݒ̧ق Ȃްޮ݂łB";
+ Message[ chinese_traditional ] = "tmɮת~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Verkeerde versie van configuratiebestand.";
+ Message[ chinese_simplified ] = "ļ汾";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ߸ ϰ ֽϴ.";
+ Message[ turkish ] = "Konfigrasyon dosyasnn srm yanl.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_WRITE_SBL
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Fehler beim Schreiben der BASIC-Bibliothek in\n'@'." ;
+ Message [ ENGLISH ] = "Error writing BASIC library to file\n'@'." ;
+ Message [ norwegian ] = "Feil oppstod ved skriving av BASIC bibliotek til fil\n'@'." ;
+ Message [ italian ] = "Errore durante la scrittura della libreria BASIC nel file\n'@'." ;
+ Message [ portuguese_brazilian ] = "Erro ao gravar a biblioteca BASICA no arquivo\n'@'." ;
+ Message [ portuguese ] = "Erro ao gravar a biblioteca BASIC em \n'@'." ;
+ Message [ finnish ] = "Virhe kirjoitettaessa BASIC-kirjastoa tiedostoon\n'@'." ;
+ Message [ danish ] = "Fejl under skrivning af BASIC-biblioteket til \n'@'." ;
+ Message [ french ] = "Erreur lors de l'criture de la bibliothque BASIC dans \n'@'." ;
+ Message [ swedish ] = "Fel vid skrivning av BASIC-bibliotek i\n'@'." ;
+ Message [ dutch ] = "Fout bij het schrijven van de BASIC-bibliotheek in\n'@'." ;
+ Message [ spanish ] = "Error al escribir la biblioteca BASIC en\n'@'." ;
+ Message [ english_us ] = "Error recording BASIC library in\n'@'." ;
+ Message[ chinese_simplified ] = "BASIC д\n'@' ʱ";
+ Message[ russian ] = " BASIC \n'@'.";
+ Message[ polish ] = "Bd przy zapisie biblioteki BASIC w in\n'@'.";
+ Message[ japanese ] = "\n'@'łBASIC ײ؂̓ǂݍ݂̍ۂ̴װ";
+ Message[ chinese_traditional ] = "BASIC wbgJ\n'@' ɵoͿ~C";
+ Message[ arabic ] = " BASIC \n'@'.";
+ Message[ dutch ] = "Fout bij het schrijven van de BASIC-bibliotheek in\n'@'.";
+ Message[ chinese_simplified ] = "BASIC д\n'@' ʱ";
+ Message[ greek ] = " BASIC \n'@'.";
+ Message[ korean ] = "BASIC ̺귯\n'@' .";
+ Message[ turkish ] = "BASIC kitapl, \n'@' iine kaydedilirken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_SIGNAL
+{
+ BUTTONS = WB_YES_NO ;
+ DEFBUTTON = WB_DEF_YES ;
+ Message = "Es ist ein unerwarter Anwendungsfehler aufgetreten!\nSie knnen jetzt auf eigene Gefahr hin versuchen,\nalle offenen Dokumente zu sichern!\n\nSoll versucht werden, Ihre Arbeit zu sichern, bevor die Applikation beendet wird?" ;
+ Message [ ENGLISH ] = "-" ;
+ Message [ dutch ] = "Er is een onverwachte programmafout opgetreden!\nU kunt nu op eigen risico proberen,\nalle geopende documenten op te slaan!\n\nWilt u proberen uw werk op te slaan voordat de applicatie wordt beindigd?" ;
+ Message [ swedish ] = "Ett ovntat programfel har uppsttt!\nDu kan nu p eget bevg frska\nspara alla ppna dokument!\n\nVill Du frska spara alla ndringar i dokumenten innan programmet avslutas?" ;
+ Message [ danish ] = "Der opstod en uventet programfejl\nDu kan p eget ansvar prve p at\ngemme alle bne dokumenter!\n\nVil du prve p at gemme dine dokumenter, fr programmet afsluttes?" ;
+ Message [ italian ] = "Nell'applicazione si verificato un errore inatteso!\nAdesso potete provare, a proprio rischio, di\nsalvare tutti i documenti aperti!\n\nVolete che si provi a salvare il lavoro prima di chiudere l'applicazione?" ;
+ Message [ spanish ] = "Se ha producido un error inesperado de la aplicacin!\nUsted puede ahora, a riesgo propio, intentar\nsalvar todos los documentos abiertos!\n\nDesea guardar su trabajo antes de cerrar la aplicacin?" ;
+ Message [ french ] = "Erreur d'application inattendue !\nVous pouvez tout de mme essayer de \nsauvegarder tous les documents ouverts !\n\nSauvegarder votre travail avant de fermer l'application ?" ;
+ Message [ english_us ] = "An unexpected program error has occurred.\n\nDo you want to try to save your changes in all nopen documents before the program is terminated?" ;
+ Message [ portuguese ] = "Surgiu um erro de programa inesperado!\n\nPoder agora, sob o seu prprio risco, \ntentar guardar todos os documentos abertos.\nTentar guardar o seu trabalho antes que a aplicao seja fechada?" ;
+ Message [ portuguese_brazilian ] = "Es ist ein unerwarter Anwendungsfehler aufgetreten!\nSie knnen jetzt auf eigene Gefahr hin versuchen,\nalle offenen Dokumente zu sichern!\n\nSoll versucht werden, Ihre Arbeit zu sichern, bevor die Applikation beendet wird?" ;
+ Message[ chinese_simplified ] = "һij\nڿԳԱб򿪵ļ\nҪڹرӦó֮ǰеļ";
+ Message[ russian ] = " !\n ,\n !\n\n ?";
+ Message[ polish ] = "Wystpi nieoczekiwany bd w programie!\nNa wasn odpowiedzialno moesz sprbowa \nzapisa wszystkie otwarte dokumenty!\n\nCzy sprbowa zapisa twoj prac przed zamkniciem aplikacji?";
+ Message[ japanese ] = "\\Ȃ۸ װ܂B\nؽ͂܂\nJĂ޷Ăׂ͂ĕۑĂ݂ĂB\n\nع݂IOɁAƒ޷ĂۑĂ݂܂H";
+ Message[ chinese_traditional ] = "oͤF@ӷN~{~I\nz{biHիOsҦQ}ҪɮסI\nznboε{exsҦɮסH";
+ Message[ arabic ] = " !\n ɡ \n !\n\n ߡ ޿";
+ Message[ dutch ] = "Er is een onverwachte programmafout opgetreden!\nU kunt nu op eigen risico proberen,\nalle geopende documenten op te slaan!\n\nWilt u proberen uw werk op te slaan voordat de applicatie wordt beindigd?";
+ Message[ chinese_simplified ] = "һij\nڿԳԱб򿪵ļ\nҪڹرӦó֮ǰеļ";
+ Message[ greek ] = " !\n\n ( ) ;";
+ Message[ korean ] = "ġ α׷ ߻߽ϴ.\n\n õ ֽϴ. α׷ ϱ ۾ õ ðڽϱ?";
+ Message[ turkish ] = "Beklenmeyen bir program hatas olutu!\nu an ak olan tm belgeleri\nkaydetmeyi deneyebilirsiniz!\n\nUygulama kapatlmadan nce belgeleriniz kaydedilmeye allsn m?";
+ Message[ language_user1 ] = " ";
+};
+
+Resource SID_UNKNOWN
+{
+ String 1 "-" ;
+};
+
+Resource BMP_SFX_COLOR
+{
+ ExtraData =
+ {
+ SID_NEWDOC; // 043
+ SID_OPENDOC; // 044
+ SID_CLOSEDOC; // 045
+ SID_RELOAD; // 046
+ SID_SAVEASDOC; // 047
+ SID_PRINTDOC; // 051
+ SID_SETUPPRINTER; // 053
+ SID_QUITAPP; // 054
+ SID_UNDO; // 055
+ SID_REDO; // 056
+ SID_REPEAT; // 057
+ SID_CUT; // 058
+ SID_COPY; // 059
+ SID_PASTE; // 060
+ SID_DELETE; // 061
+ SID_SELECTALL; // 062
+ SID_SAVEDOC; // 063 vormals 046
+ SID_EXITANDRETURN; // 064 vormals 054
+ SID_RECORDMACRO; // 095
+ SID_EDITMACRO; // 096
+ SID_HELPMENU; // 098
+ SID_CONFIG; // 123
+ SID_CONFIGTOOLBOX; // 124
+ 0;
+ };
+ Bitmap BMP_SFX_SMALL { File = "sco.bmp" ; };
+ Bitmap BMP_SFX_LARGE { File = "lco.bmp" ; };
+};
+
+Resource BMP_SFX_MONO
+{
+ ExtraData =
+ {
+ SID_NEWDOC; // 043
+ SID_OPENDOC; // 044
+ SID_CLOSEDOC; // 045
+ SID_RELOAD; // 046
+ SID_SAVEASDOC; // 047
+ SID_PRINTDOC; // 051
+ SID_SETUPPRINTER; // 053
+ SID_QUITAPP; // 054
+ SID_UNDO; // 055
+ SID_REDO; // 056
+ SID_REPEAT; // 057
+ SID_CUT; // 058
+ SID_COPY; // 059
+ SID_PASTE; // 060
+ SID_DELETE; // 061
+ SID_SELECTALL; // 062
+ SID_SAVEDOC; // 063 vormals 046
+ SID_EXITANDRETURN; // 064 vormals 054
+ SID_RECORDMACRO; // 095
+ SID_EDITMACRO; // 096
+ SID_HELPMENU; // 098
+ SID_CONFIG; // 123
+ SID_CONFIGTOOLBOX; // 124
+ 0;
+ };
+ Bitmap BMP_SFX_SMALL { File = "smo.bmp" ; };
+ Bitmap BMP_SFX_LARGE { File = "lmo.bmp" ; };
+};
+
+WarningBox STR_RECOVER_PREPARED
+{
+ Message = "Es ist ein nicht behebbarer Fehler aufgetreten.\n\nAlle modifizierten Dateien wurden jedoch\ngesichert und knnen voraussichtlich beim nchsten\nProgrammstart wiederhergestellt werden." ;
+ Message [ ENGLISH ] = "An unrecoverable error has occured.\n\nAll modified files are saved and can\nprobably be recovered on application restart." ;
+ Message [ portuguese ] = "Surgiu um erro irrecupervel. Contudo, todos os ficheiros \nmodificados foram guardados e podero provavelmente \nser recuperados ao reiniciar o programa." ;
+ Message [ english_us ] = "An unrecoverable error has occurred.\n\nAll modified files have been saved and can\nprobably be recovered at program restart." ;
+ Message [ portuguese_brazilian ] = "Es ist ein nicht behebbarer Fehler aufgetreten.\n\nAlle modifizierten Dateien wurden jedoch\ngesichert und knnen voraussichtlich beim nchsten\nProgrammstart wiederhergestellt werden." ;
+ Message [ swedish ] = "Ett icke reparerbart fel har upptrtt.\n\nAlla ndrade filer sparades\noch kan frmodligen terupprttas\nvid nsta programstart." ;
+ Message [ danish ] = "Der opstod en irreparabel fejl.\n\nAlle ndrede filer er dog\nblevet gemt og kan sandsynligvis gendannes\nved nste programstart." ;
+ Message [ italian ] = "Si verificato un errore irrimediabile.\n\nTutti i file modificati sono stati \nsalvati e probabilmente verranno recuperati \nal prossimo avvio del programma." ;
+ Message [ spanish ] = "Ha ocurrido un error irreparable.\n\nSin embargo se guardaron todos los cambios realizados\nen los archivos y quizs podrn recuperarse\nal iniciar de nuevo el programa." ;
+ Message [ french ] = "Une erreur fatale est survenue.\n\nTous les fichiers dits ont t sauvegards\net devraient tre restaurs au\nredmarrage du programme." ;
+ Message [ dutch ] = "Er is een niet-corrigeerbare fout opgetreden.\n\nAlle gemodificeerde bestanden werden echter\nopgeslagen en kunnen waarschijnlijk bij de volgende\nprogrammastart opnieuw gemaakt worden." ;
+ Message[ chinese_simplified ] = "ǷdzǸIJһ޷ųĴ\nղ޸ĹļѾ档\nһʱܿ»ָЩļ";
+ Message[ russian ] = " .\n\n \n \n .";
+ Message[ polish ] = "Wystpi nieodwracalny bd.\n\nWszystkie zmodyfikowane pliki zostay jednak\nzabezpieczone i zostan prawdopodobnie przywrcone przy nastpnym rozpoczciu programu.\n.";
+ Message[ japanese ] = "łȂװ܂B\n\nύX̧قׂ̂ĂۑĂ܂\n۸тJnۂɂ͕͂łB";
+ Message[ chinese_traditional ] = "uOD`pMzާ@޵oF@ӵLkư~C\nzeקLɮפwgxsC\nbU@Ұʵ{ɫܥi୫s_oɮסC";
+ Message[ arabic ] = " .\n\n ǡ \n \n .";
+ Message[ dutch ] = "Er is een niet-corrigeerbare fout opgetreden.\n\nAlle gemodificeerde bestanden werden echter\nopgeslagen en kunnen waarschijnlijk bij de volgende\nprogrammastart opnieuw gemaakt worden.";
+ Message[ chinese_simplified ] = "ǷdzǸIJһ޷ųĴ\nղ޸ĹļѾ档\nһʱܿ»ָЩļ";
+ Message[ greek ] = " .\n\n \n \n .";
+ Message[ korean ] = " Ұ ߻߽ϴ.\n\n׷ \nǾǷ Ƹ \nα׷ Դϴ.";
+ Message[ turkish ] = "Dzeltilemeyen bir hata olutu.\n\nDeitirilen tm dosyalar\nkaydedildi ve muhtemelen uygulama yeniden balatldnda\nkurtarlabilecek.";
+ Message[ language_user1 ] = " ";
+};
+
+WarningBox RID_WARN_POST_MAILTO
+{
+ BUTTONS = WB_OK_CANCEL ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Ein Formular soll per E-Mail versendet werden.\nDadurch wird dem Empfnger Ihre E-Mail-Adresse bekannt." ;
+ Message [ english ] = "A form is to be posted by email.\nThe receiver will get your email-address." ;
+ Message [ portuguese ] = "O formulrio ser enviado por e-mail.\nO seu endereo electrnico ser fornecido ao destinatrio." ;
+ Message [ english_us ] = "A form is to be sent by e-mail.\nThis means that the receiver will get to see your e-mail address." ;
+ Message [ portuguese_brazilian ] = "Ein Formular soll per E-Mail versendet werden.\nDadurch wird dem Empfnger Ihre E-Mail-Adresse bekannt." ;
+ Message [ swedish ] = "Ett formulr skall skickas per e-post.\nDrigenom fr mottagaren reda p Din e-postadress." ;
+ Message [ danish ] = "Du vil sende en formular via e-mail.\nBemrk at modtageren herved fr din e-mail-adresse." ;
+ Message [ italian ] = "Un formulario deve essere inviato via eMail.\nIn tal modo il destinatario verr a conoscenza dell'indirizzo eMail dell'utente." ;
+ Message [ spanish ] = "Se debe enviar un formulario por correo electrnico.\nCon ello se dar a conocer al destinatario su direccin electrnica." ;
+ Message [ french ] = "Vous voulez envoyer un formulaire par e-mail.\nVous communiquerez ainsi votre adresse e-mail au destinataire." ;
+ Message [ dutch ] = "Een formulier moet per e-mail gestuurd worden.\nDaardoor wordt uw e-mail adres door de ontvanger bekend." ;
+ Message[ chinese_simplified ] = "Ӧýʼķ\nĵʼַҲʹݸռˡ";
+ Message[ russian ] = " .\n . .";
+ Message[ polish ] = "Formularz ma zosta wysany jako e-mail.\nPrzez to adresat otrzyma twj adres e-mail.";
+ Message[ japanese ] = "pE-mailőM܂B\nʂĎM҂հްE-mailڽm邱ƂɂȂ܂B";
+ Message[ chinese_traditional ] = "ӳzLqllHoC\no˱zqlla}]NǻF̡C";
+ Message[ arabic ] = " .\n .";
+ Message[ dutch ] = "Een formulier moet per e-mail gestuurd worden.\nDaardoor wordt uw e-mail adres door de ontvanger bekend.";
+ Message[ chinese_simplified ] = "Ӧýʼķ\nĵʼַҲʹݸռˡ";
+ Message[ greek ] = " e-mail.\n ";
+ Message[ korean ] = " ڿ Դϴ .\n ޴ ڿ ּҰ Դϴ.";
+ Message[ turkish ] = "E-posta ile form gnderilecek.\nBu ekilde alc e-posta adresinizi de grecektir.";
+ Message[ language_user1 ] = " ";
+};
+
+String STR_RECOVER_TITLE
+{
+ Text = "Datei-Wiederherstellung" ;
+ Text [ ENGLISH ] = "File Recovery" ;
+ Text [ english_us ] = "File Recovery" ;
+ Text [ portuguese_brazilian ] = "Datei-Wiederherstellung" ;
+ Text [ swedish ] = "Filterstllande" ;
+ Text [ danish ] = "Fil-gendannelse" ;
+ Text [ italian ] = "Recupero file" ;
+ Text [ spanish ] = "Recuperar archivo" ;
+ Text [ french ] = "Restauration de fichier" ;
+ Text [ dutch ] = "Herstel bestand" ;
+ Text [ portuguese ] = "Restaurar ficheiro" ;
+ Text[ chinese_simplified ] = "޸ļ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Odtwarzanie plikw";
+ Text[ japanese ] = "̧ق̕";
+ Text[ chinese_traditional ] = "״_ɮ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Herstel bestand";
+ Text[ chinese_simplified ] = "޸ļ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Dosya kurtarma";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_RECOVER_QUERY
+{
+ Text = "Soll die Datei \"$1\" wiederhergestellt werden?" ;
+ Text [ ENGLISH ] = "Recover file $1?" ;
+ Text [ portuguese ] = "Deseja restaurar o ficheiro \"$1\"?" ;
+ Text [ english_us ] = "Should the file \"$1\" be restored?" ;
+ Text [ portuguese_brazilian ] = "Soll die Datei \"$1\" wiederhergestellt werden?" ;
+ Text [ swedish ] = "Skall filen \"$1\" terskapas?" ;
+ Text [ danish ] = "Skal filen \"$1\" gendannes?" ;
+ Text [ italian ] = "Recuperare il file \"$1\"?" ;
+ Text [ spanish ] = "Desea restaurar el archivo \"$1\"?" ;
+ Text [ french ] = "Le fichier \"$1\" doit-il tre restaur ?" ;
+ Text [ dutch ] = "Wilt u dat het bestand \"$1\" hersteld wordt?" ;
+ Text[ chinese_simplified ] = "Ҫ޸ļ \"$1\" ";
+ Text[ russian ] = " \"$1\"?";
+ Text[ polish ] = "Odtworzy plik \"$1\"?";
+ Text[ japanese ] = "̧\"$1\"𕜌܂H";
+ Text[ chinese_traditional ] = "zn״_oɮ";
+ Text[ arabic ] = " \"$1\"";
+ Text[ dutch ] = "Wilt u dat het bestand \"$1\" hersteld wordt?";
+ Text[ chinese_simplified ] = "Ҫ޸ļ \"$1\" ";
+ Text[ greek ] = " \"$1\";";
+ Text[ korean ] = " \"$1\" ؾ մϱ?";
+ Text[ turkish ] = "\"$1\" dosyas geri getirilsin mi?";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_INTERN
+{
+ Text = "Intern" ;
+ Text [ ENGLISH ] = "Internal" ;
+ Text [ norwegian ] = "Intern" ;
+ Text [ italian ] = "Interno" ;
+ Text [ portuguese_brazilian ] = "Aplicativo" ;
+ Text [ portuguese ] = "Interno" ;
+ Text [ finnish ] = "Sisinen" ;
+ Text [ danish ] = "Intern" ;
+ Text [ french ] = "Interne" ;
+ Text [ swedish ] = "Internt" ;
+ Text [ dutch ] = "Intern" ;
+ Text [ spanish ] = "Interno" ;
+ Text [ english_us ] = "Internal" ;
+ Text[ chinese_simplified ] = "ڲ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wewntrzny";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Intern";
+ Text[ chinese_simplified ] = "ڲ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_APPLICATION
+{
+ Text = "Applikation" ;
+ Text [ ENGLISH ] = "Application" ;
+ Text [ norwegian ] = "Applikasjon" ;
+ Text [ italian ] = "Applicazione" ;
+ Text [ portuguese_brazilian ] = "Interna" ;
+ Text [ portuguese ] = "Aplicao" ;
+ Text [ finnish ] = "Sovellus" ;
+ Text [ danish ] = "Applikation" ;
+ Text [ french ] = "Application" ;
+ Text [ swedish ] = "Tillmpning" ;
+ Text [ dutch ] = "Applicatie" ;
+ Text [ spanish ] = "Aplicacin" ;
+ Text [ english_us ] = "Application" ;
+ Text[ chinese_simplified ] = "Ӧó";
+ Text[ russian ] = "";
+ Text[ polish ] = "Aplikacja";
+ Text[ japanese ] = "ع";
+ Text[ chinese_traditional ] = "ε{";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Applicatie";
+ Text[ chinese_simplified ] = "Ӧó";
+ Text[ greek ] = "";
+ Text[ korean ] = "α׷";
+ Text[ turkish ] = "Uygulama";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_VIEW
+{
+ Text = "Ansicht" ;
+ Text [ ENGLISH ] = "View" ;
+ Text [ norwegian ] = "View" ;
+ Text [ italian ] = "Visualizza" ;
+ Text [ portuguese_brazilian ] = "Ver" ;
+ Text [ portuguese ] = "Visualizar" ;
+ Text [ finnish ] = "Nyt" ;
+ Text [ danish ] = "Vis" ;
+ Text [ french ] = "Affichage" ;
+ Text [ swedish ] = "Vy" ;
+ Text [ dutch ] = "Beeld" ;
+ Text [ spanish ] = "Ver" ;
+ Text [ english_us ] = "View" ;
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Widok";
+ Text[ japanese ] = "\\";
+ Text[ chinese_traditional ] = "˵";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Beeld";
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Grnm";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_DOCUMENT
+{
+ Text = "Dokumente" ;
+ Text [ ENGLISH ] = "Documents" ;
+ Text [ norwegian ] = "Documents" ;
+ Text [ italian ] = "Documenti" ;
+ Text [ portuguese_brazilian ] = "Documentos" ;
+ Text [ portuguese ] = "Documentos" ;
+ Text [ finnish ] = "Asiakirjat" ;
+ Text [ danish ] = "Dokumenter" ;
+ Text [ french ] = "Documents" ;
+ Text [ swedish ] = "Dokument" ;
+ Text [ dutch ] = "Documenten" ;
+ Text [ spanish ] = "Documentos" ;
+ Text [ english_us ] = "Documents" ;
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Dokumenty";
+ Text[ japanese ] = "޷";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Documenten";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Belge";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_EDIT
+{
+ Text = "Bearbeiten" ;
+ Text [ ENGLISH ] = "Editing" ;
+ Text [ norwegian ] = "Redigering" ;
+ Text [ italian ] = "Modifica" ;
+ Text [ portuguese_brazilian ] = "Editando" ;
+ Text [ portuguese ] = "Editar" ;
+ Text [ finnish ] = "Muokkaus" ;
+ Text [ danish ] = "Rediger" ;
+ Text [ french ] = "Edition" ;
+ Text [ swedish ] = "Redigera" ;
+ Text [ dutch ] = "Bewerken" ;
+ Text [ spanish ] = "Editar" ;
+ Text [ english_us ] = "Edit" ;
+ Text[ chinese_simplified ] = "༭";
+ Text[ russian ] = "";
+ Text[ polish ] = "Edytuj";
+ Text[ japanese ] = "ҏW";
+ Text[ chinese_traditional ] = "s";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Bewerken";
+ Text[ chinese_simplified ] = "༭";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Dzenle";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_MACRO
+{
+ Text = "BASIC" ;
+ Text [ ENGLISH ] = "BASIC" ;
+ Text [ english_us ] = "BASIC" ;
+ Text [ italian ] = "BASIC" ;
+ Text [ spanish ] = "BASIC" ;
+ Text [ french ] = "BASIC" ;
+ Text [ dutch ] = "BASIC" ;
+ Text [ swedish ] = "BASIC" ;
+ Text [ danish ] = "BASIC" ;
+ Text [ portuguese ] = "BASIC" ;
+ Text [ portuguese_brazilian ] = "BASIC" ;
+ Text[ chinese_simplified ] = "BASIC";
+ Text[ russian ] = "BASIC";
+ Text[ polish ] = "BASIC";
+ Text[ japanese ] = "BASIC";
+ Text[ chinese_traditional ] = "BASIC";
+ Text[ arabic ] = "BASIC";
+ Text[ dutch ] = "BASIC";
+ Text[ chinese_simplified ] = "BASIC";
+ Text[ greek ] = "BASIC";
+ Text[ korean ] = "BASIC";
+ Text[ turkish ] = "BASIC";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_OPTIONS
+{
+ Text = "Extras" ;
+ Text [ ENGLISH ] = "Options" ;
+ Text [ norwegian ] = "Options" ;
+ Text [ italian ] = "Varie" ;
+ Text [ portuguese_brazilian ] = "Opes" ;
+ Text [ portuguese ] = "Ferramentas" ;
+ Text [ finnish ] = "Mritykset" ;
+ Text [ danish ] = "Funktioner" ;
+ Text [ french ] = "Options" ;
+ Text [ swedish ] = "Verktyg" ;
+ Text [ dutch ] = "Extra" ;
+ Text [ spanish ] = "Opciones" ;
+ Text [ english_us ] = "Options" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Narzdzia";
+ Text[ japanese ] = "ڍאݒ";
+ Text[ chinese_traditional ] = "䥦";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Extra";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ɼ";
+ Text[ turkish ] = "Aralar";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_MATH
+{
+ Text = "Math" ;
+ Text [ ENGLISH ] = "Formula" ;
+ Text [ norwegian ] = "Formel" ;
+ Text [ italian ] = "Math" ;
+ Text [ portuguese_brazilian ] = "Frmula" ;
+ Text [ portuguese ] = "Math" ;
+ Text [ finnish ] = "Kaava" ;
+ Text [ danish ] = "Math" ;
+ Text [ french ] = "Formule" ;
+ Text [ swedish ] = "Math" ;
+ Text [ dutch ] = "Math" ;
+ Text [ spanish ] = "Math" ;
+ Text [ english_us ] = "Math" ;
+ Text[ chinese_simplified ] = "ѧ";
+ Text[ russian ] = "Math";
+ Text[ polish ] = "Math";
+ Text[ japanese ] = "w";
+ Text[ chinese_traditional ] = "ƾ";
+ Text[ arabic ] = "Math";
+ Text[ dutch ] = "Math";
+ Text[ chinese_simplified ] = "ѧ";
+ Text[ greek ] = "Math";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Math";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_NAVIGATOR
+{
+ Text = "Navigieren" ;
+ Text [ english ] = "Navigator" ;
+ Text [ english_us ] = "Navigate" ;
+ Text [ italian ] = "Naviga" ;
+ Text [ spanish ] = "Navegar" ;
+ Text [ french ] = "Navigation" ;
+ Text [ dutch ] = "Navigeren" ;
+ Text [ swedish ] = "Navigera" ;
+ Text [ danish ] = "Naviger" ;
+ Text [ portuguese ] = "Navegar" ;
+ Text [ portuguese_brazilian ] = "Navigieren" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Nawigacja";
+ Text[ japanese ] = "޹ް";
+ Text[ chinese_traditional ] = "s";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Navigeren";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ž";
+ Text[ turkish ] = "Dola";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_INSERT
+{
+ Text = "Einfgen" ;
+ Text [ english ] = "Insert" ;
+ Text [ dutch ] = "Invoegen" ;
+ Text [ english_us ] = "Insert" ;
+ Text [ italian ] = "Inserisci" ;
+ Text [ spanish ] = "Insertar" ;
+ Text [ french ] = "Insrer" ;
+ Text [ swedish ] = "Infoga" ;
+ Text [ danish ] = "Indst" ;
+ Text [ portuguese ] = "Inserir" ;
+ Text [ portuguese_brazilian ] = "Einfgen" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wstaw";
+ Text[ japanese ] = "}";
+ Text[ chinese_traditional ] = "J";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Invoegen";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Ekle";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_FORMAT
+{
+ Text = "Format" ;
+ Text [ english ] = "Format" ;
+ Text [ dutch ] = "Formaat" ;
+ Text [ english_us ] = "Format" ;
+ Text [ italian ] = "Formato" ;
+ Text [ spanish ] = "Formato" ;
+ Text [ french ] = "Format" ;
+ Text [ swedish ] = "Format" ;
+ Text [ danish ] = "Format" ;
+ Text [ portuguese ] = "Formato" ;
+ Text [ portuguese_brazilian ] = "Format" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Format";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "榡";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Formaat";
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Format";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_TEMPLATE
+{
+ Text = "Vorlagen" ;
+ Text [ english ] = "Template" ;
+ Text [ english_us ] = "Templates" ;
+ Text [ italian ] = "Modelli" ;
+ Text [ spanish ] = "Plantillas" ;
+ Text [ french ] = "Modles" ;
+ Text [ dutch ] = "Sjablonen" ;
+ Text [ swedish ] = "Mallar" ;
+ Text [ danish ] = "Skabeloner" ;
+ Text [ portuguese ] = "Modelos" ;
+ Text [ portuguese_brazilian ] = "Vorlagen" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Szablony";
+ Text[ japanese ] = "ڰ";
+ Text[ chinese_traditional ] = "˦";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Sjablonen";
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ greek ] = "";
+ Text[ korean ] = "øƮ";
+ Text[ turkish ] = "ablon";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_TEXT
+{
+ Text = "Text" ;
+ Text [ english ] = "Text" ;
+ Text [ english_us ] = "Text" ;
+ Text [ italian ] = "Testo" ;
+ Text [ spanish ] = "Texto" ;
+ Text [ french ] = "Texte" ;
+ Text [ dutch ] = "Tekst" ;
+ Text [ swedish ] = "Text" ;
+ Text [ danish ] = "Tekst" ;
+ Text [ portuguese ] = "Texto" ;
+ Text [ portuguese_brazilian ] = "Text" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Tekst";
+ Text[ japanese ] = "÷";
+ Text[ chinese_traditional ] = "r";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Tekst";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ؽƮ";
+ Text[ turkish ] = "Metin";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_FRAME
+{
+ Text = "Rahmen" ;
+ Text [ english ] = "Frame" ;
+ Text [ dutch ] = "Kader" ;
+ Text [ english_us ] = "Frame" ;
+ Text [ italian ] = "Cornice" ;
+ Text [ spanish ] = "Marco" ;
+ Text [ french ] = "Cadre" ;
+ Text [ swedish ] = "Ram" ;
+ Text [ danish ] = "Ramme" ;
+ Text [ portuguese ] = "Moldura" ;
+ Text [ portuguese_brazilian ] = "Rahmen" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Ramka";
+ Text[ japanese ] = "g";
+ Text[ chinese_traditional ] = "T";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Kader";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "ereve";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_GRAPHIC
+{
+ Text = "Grafik" ;
+ Text [ english ] = "Graphic" ;
+ Text [ english_us ] = "Graphic" ;
+ Text [ italian ] = "Immagine" ;
+ Text [ spanish ] = "Imagen" ;
+ Text [ french ] = "Image" ;
+ Text [ dutch ] = "Afbeelding" ;
+ Text [ swedish ] = "Grafik" ;
+ Text [ danish ] = "Grafik" ;
+ Text [ portuguese ] = "Imagem" ;
+ Text [ portuguese_brazilian ] = "Grafik" ;
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Grafika";
+ Text[ japanese ] = "̨";
+ Text[ chinese_traditional ] = "ϧ";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Afbeelding";
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ greek ] = "";
+ Text[ korean ] = "׷";
+ Text[ turkish ] = "Grafik";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_TABLE
+{
+ Text = "Tabelle" ;
+ Text [ english ] = "Table" ;
+ Text [ english_us ] = "Table" ;
+ Text [ italian ] = "Tabella" ;
+ Text [ spanish ] = "Tabla" ;
+ Text [ french ] = "Table" ;
+ Text [ dutch ] = "Tabel" ;
+ Text [ swedish ] = "Tabell" ;
+ Text [ danish ] = "Tabel" ;
+ Text [ portuguese ] = "Tabela" ;
+ Text [ portuguese_brazilian ] = "Tabelle" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Tabela";
+ Text[ japanese ] = "ð";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Tabel";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̺";
+ Text[ turkish ] = "Tablo";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_ENUMERATION
+{
+ Text = "Nummerierung" ;
+ Text [ english ] = "Enumeration" ;
+ Text [ dutch ] = "Nummering" ;
+ Text [ english_us ] = "Numbering" ;
+ Text [ italian ] = "Numerazione" ;
+ Text [ spanish ] = "Numeracin" ;
+ Text [ french ] = "Numrotation" ;
+ Text [ swedish ] = "Numrering" ;
+ Text [ danish ] = "Nummerering" ;
+ Text [ portuguese ] = "Numerao" ;
+ Text [ portuguese_brazilian ] = "Numerierung" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Numeracja";
+ Text[ japanese ] = "ԍt";
+ Text[ chinese_traditional ] = "s";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Nummering";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ȣ";
+ Text[ turkish ] = "Numaralama";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_DATA
+{
+ Text = "Daten" ;
+ Text [ english ] = "Data" ;
+ Text [ dutch ] = "Gegevens" ;
+ Text [ english_us ] = "Data" ;
+ Text [ italian ] = "Dati" ;
+ Text [ spanish ] = "Datos" ;
+ Text [ french ] = "Donnes" ;
+ Text [ swedish ] = "Data" ;
+ Text [ danish ] = "Data" ;
+ Text [ portuguese ] = "Dados" ;
+ Text [ portuguese_brazilian ] = "Daten" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Dane";
+ Text[ japanese ] = "ް";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Gegevens";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Veri";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_SPECIAL
+{
+ Text = "Sonderfunktionen" ;
+ Text [ english ] = "Special" ;
+ Text [ english_us ] = "Special Functions" ;
+ Text [ italian ] = "Funzioni speciali" ;
+ Text [ spanish ] = "Funciones especiales" ;
+ Text [ french ] = "Fonctions spciales" ;
+ Text [ dutch ] = "Speciale functies" ;
+ Text [ swedish ] = "Specialfunktioner" ;
+ Text [ danish ] = "Specialfunktioner" ;
+ Text [ portuguese ] = "Funes especiais" ;
+ Text [ portuguese_brazilian ] = "Sonderfunktionen" ;
+ Text[ chinese_simplified ] = "⹦";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Funkcje specjalne";
+ Text[ japanese ] = "@\\";
+ Text[ chinese_traditional ] = "S\\";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Speciale functies";
+ Text[ chinese_simplified ] = "⹦";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Ư Լ";
+ Text[ turkish ] = "zel ilevler";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_IMAGE
+{
+ Text = "Image" ;
+ Text [ english ] = "Image" ;
+ Text [ dutch ] = "Image" ;
+ Text [ english_us ] = "Image" ;
+ Text [ italian ] = "Image" ;
+ Text [ spanish ] = "Imagen" ;
+ Text [ french ] = "Image" ;
+ Text [ swedish ] = "Bild" ;
+ Text [ danish ] = "Billede" ;
+ Text [ portuguese ] = "Imagem" ;
+ Text [ portuguese_brazilian ] = "Image" ;
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Obraz";
+ Text[ japanese ] = "Ұ";
+ Text[ chinese_traditional ] = "v";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Image";
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ greek ] = "";
+ Text[ korean ] = "̹";
+ Text[ turkish ] = "Resim";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_CHART
+{
+ Text = "Chart" ;
+ Text [ english ] = "Chart" ;
+ Text [ dutch ] = "Chart" ;
+ Text [ english_us ] = "Chart" ;
+ Text [ italian ] = "Diagramma" ;
+ Text [ spanish ] = "Diagrama" ;
+ Text [ french ] = "Diagramme" ;
+ Text [ swedish ] = "Chart" ;
+ Text [ danish ] = "Diagram" ;
+ Text [ portuguese ] = "Chart" ;
+ Text [ portuguese_brazilian ] = "Chart" ;
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wykres";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "Ϫ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Chart";
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ʈ";
+ Text[ turkish ] = "ema";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_EXPLORER
+{
+ Text = "Explorer" ;
+ Text [ english ] = "Explorer" ;
+ Text [ english_us ] = "Explorer" ;
+ Text [ italian ] = "Explorer" ;
+ Text [ spanish ] = "Explorador" ;
+ Text [ french ] = "Explorer" ;
+ Text [ dutch ] = "Explorer" ;
+ Text [ swedish ] = "Explorer" ;
+ Text [ danish ] = "Explorer" ;
+ Text [ portuguese ] = "Explorer" ;
+ Text [ portuguese_brazilian ] = "Explorer" ;
+ Text[ chinese_simplified ] = "Դ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Eksplorator";
+ Text[ japanese ] = "۰";
+ Text[ language_user1 ] = " ";
+ Text[ chinese_traditional ] = "ɮ`";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Explorer";
+ Text[ chinese_simplified ] = "Դ";
+ Text[ greek ] = "Explorer";
+ Text[ korean ] = "ͽ÷η";
+ Text[ turkish ] = "Explorer";
+};
+
+String GID_CONNECTOR
+{
+ Text = "Verbinder" ;
+ Text [ english ] = "Connector" ;
+ Text [ portuguese ] = "Conectores" ;
+ Text [ english_us ] = "Connector" ;
+ Text [ portuguese_brazilian ] = "Verbinder" ;
+ Text [ swedish ] = "Frbindelse" ;
+ Text [ danish ] = "Forbindelse" ;
+ Text [ italian ] = "Connettore" ;
+ Text [ spanish ] = "Conector" ;
+ Text [ french ] = "Connecteur" ;
+ Text [ dutch ] = "Verbinding" ;
+ Text[ chinese_simplified ] = "ӷ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "cznik";
+ Text[ japanese ] = "ȸ";
+ Text[ chinese_traditional ] = "s";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Verbinding";
+ Text[ chinese_simplified ] = "ӷ";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ŀ";
+ Text[ turkish ] = "Balayc";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_MODIFY
+{
+ Text = "ndern" ;
+ Text [ english ] = "Modify" ;
+ Text [ portuguese ] = "Alterar" ;
+ Text [ english_us ] = "Modify" ;
+ Text [ portuguese_brazilian ] = "ndern" ;
+ Text [ swedish ] = "ndra" ;
+ Text [ danish ] = "Modificer" ;
+ Text [ italian ] = "Modifica" ;
+ Text [ spanish ] = "Modificar" ;
+ Text [ french ] = "Modifier" ;
+ Text [ dutch ] = "Wijzigen" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Modyfikuj";
+ Text[ japanese ] = "ύX";
+ Text[ chinese_traditional ] = "ק";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Wijzigen";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Deitir";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_DRAWING
+{
+ Text = "Zeichnen" ;
+ Text [ english ] = "Drawing" ;
+ Text [ portuguese ] = "Desenhar" ;
+ Text [ english_us ] = "Drawing" ;
+ Text [ portuguese_brazilian ] = "Zeichnen" ;
+ Text [ swedish ] = "Rita" ;
+ Text [ danish ] = "Tegn" ;
+ Text [ italian ] = "Disegna" ;
+ Text [ spanish ] = "Dibujar" ;
+ Text [ french ] = "Dessiner" ;
+ Text [ dutch ] = "Tekenen" ;
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Rysowanie";
+ Text[ japanese ] = "`";
+ Text[ chinese_traditional ] = "ø";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Tekenen";
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ greek ] = "";
+ Text[ korean ] = "׸";
+ Text[ turkish ] = "izim";
+ Text[ language_user1 ] = " ";
+};
+
+String GID_CONTROLS
+{
+ Text = "Kontrollelemente" ;
+ Text [ english ] = "Controls" ;
+ Text [ portuguese ] = "Controlos" ;
+ Text [ english_us ] = "Controls" ;
+ Text [ italian ] = "Elementi di controllo" ;
+ Text [ spanish ] = "Elementos de control" ;
+ Text [ french ] = "lments de contrle" ;
+ Text [ dutch ] = "Controle-elementen" ;
+ Text [ portuguese_brazilian ] = "Kontrollelemente" ;
+ Text [ swedish ] = "Kontrollelement" ;
+ Text [ danish ] = "Kontrolelementer" ;
+ Text[ chinese_simplified ] = "ؼ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Formanty";
+ Text[ japanese ] = "۰";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Controle-elementen";
+ Text[ chinese_simplified ] = "ؼ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Ʈ";
+ Text[ turkish ] = "Kumanda eleri";
+ Text[ language_user1 ] = " ";
+};
+
+TabDialog SID_OPTIONS
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 244 , 155 ) ;
+ Text = "Optionen" ;
+ Text [ English ] = "Options" ;
+ Text [ norwegian ] = "Options" ;
+ Text [ italian ] = "Opzioni" ;
+ Text [ portuguese_brazilian ] = "Opes" ;
+ Text [ portuguese ] = "Opes" ;
+ Text [ finnish ] = "Mritykset" ;
+ Text [ danish ] = "Indstillinger" ;
+ Text [ french ] = "Options" ;
+ Text [ swedish ] = "Alternativ" ;
+ Text [ dutch ] = "Opties" ;
+ Text [ spanish ] = "Opciones" ;
+ Text [ english_us ] = "Options" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ TabControl 1
+ {
+ SVLook = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 15 ) ;
+ Size = MAP_APPFONT ( 221 , 130 ) ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = RID_SFXPAGE_GENERAL ;
+ Text = "Allgemeines" ;
+ Text [ English ] = "General" ;
+ Text [ norwegian ] = "Generell" ;
+ Text [ italian ] = "Generale" ;
+ Text [ portuguese_brazilian ] = "Geral" ;
+ Text [ portuguese ] = "Geral" ;
+ Text [ finnish ] = "Yleiset" ;
+ Text [ danish ] = "Generelt" ;
+ Text [ french ] = "En gnral" ;
+ Text [ swedish ] = "Allmnt" ;
+ Text [ dutch ] = "Algemeen" ;
+ Text [ spanish ] = "General" ;
+ Text [ english_us ] = "General" ;
+ PageResID = 256 ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Oglne";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "@";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Algemeen";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ϲ";
+ Text[ turkish ] = "Genel";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SFXPAGE_SAVE ;
+ Text = "Speichern" ;
+ Text [ English ] = "Save" ;
+ Text [ norwegian ] = "Save" ;
+ Text [ italian ] = "Salva" ;
+ Text [ portuguese_brazilian ] = "Gravar" ;
+ Text [ portuguese ] = "Guardar" ;
+ Text [ finnish ] = "Tallennus" ;
+ Text [ danish ] = "Gem" ;
+ Text [ french ] = "Enregistrer" ;
+ Text [ swedish ] = "Spara" ;
+ Text [ dutch ] = "Opslaan" ;
+ Text [ spanish ] = "Guardar" ;
+ Text [ english_us ] = "Save" ;
+ PageResID = 257 ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zapisz";
+ Text[ japanese ] = "ۑ";
+ Text[ chinese_traditional ] = "xs";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Opslaan";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Kaydet";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SFXPAGE_PATH ;
+ Text = "Pfade" ;
+ Text [ English ] = "Path" ;
+ Text [ norwegian ] = "Bane" ;
+ Text [ italian ] = "Percorsi" ;
+ Text [ portuguese_brazilian ] = "Caminho" ;
+ Text [ portuguese ] = "Atalhos" ;
+ Text [ finnish ] = "Polku" ;
+ Text [ danish ] = "Stier" ;
+ Text [ french ] = "Chemins" ;
+ Text [ swedish ] = "Skvgar" ;
+ Text [ dutch ] = "Pad" ;
+ Text [ spanish ] = "Rutas" ;
+ Text [ english_us ] = "Paths" ;
+ PageResID = 258 ;
+ Text[ chinese_simplified ] = "·";
+ Text[ russian ] = "";
+ Text[ polish ] = "cieki";
+ Text[ japanese ] = "߽";
+ Text[ chinese_traditional ] = "|";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Pad";
+ Text[ chinese_simplified ] = "·";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Veri yolu";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = RID_SFXPAGE_SPELL ;
+ Text = "Rechtschreibprfung" ;
+ Text [ English ] = "Spellchecker" ;
+ Text [ norwegian ] = "Spellchecker" ;
+ Text [ italian ] = "Controllo ortografico" ;
+ Text [ portuguese_brazilian ] = "Corretor Ortogrfico" ;
+ Text [ portuguese ] = "Verificar ortografia" ;
+ Text [ finnish ] = "Korjausluku" ;
+ Text [ danish ] = "Stavekontrol" ;
+ Text [ french ] = "Vrification orthographique" ;
+ Text [ swedish ] = "Rttstavningskontroll" ;
+ Text [ dutch ] = "Spellingcontrole" ;
+ Text [ spanish ] = "Revisin ortogrfica" ;
+ Text [ english_us ] = "Spellcheck" ;
+ PageResID = 259 ;
+ Text[ chinese_simplified ] = "ַ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Sprawdzanie pisowni";
+ Text[ japanese ] = "͍Z";
+ Text[ chinese_traditional ] = "r";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Spellingcontrole";
+ Text[ chinese_simplified ] = "ַ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Yazm denetimi";
+ Text[ language_user1 ] = " ";
+ };
+ };
+ };
+ Text[ chinese_simplified ] = "ѡ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Opcje";
+ Text[ japanese ] = "߼";
+ Text[ chinese_traditional ] = "ﶵ";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Opties";
+ Text[ chinese_simplified ] = "ѡ";
+ Text[ greek ] = "";
+ Text[ korean ] = "ɼ";
+ Text[ turkish ] = "Seenekler";
+ Text[ language_user1 ] = " ";
+};
+
+InfoBox MSG_CANT_QUIT
+{
+ Message = "Die Anwendung kann zur Zeit nicht beendet werden.\nBitte warten Sie das Ende aller Druckauftrge und/oder\nOLE-Aktivierungen ab und schlieen Sie alle Dialoge." ;
+ Message [ English ] = "Can't quit the application at this moment.\nPlease wait until all print jobs and/or\nOLE-activations are terminated and close\nall dialogs." ;
+ Message [ norwegian ] = "Kan ikke avslutte applikasjonen for yeblikket.\nPlease wait until all print jobs and/or\nOLE-activations are terminated and close\nall dialogs." ;
+ Message [ italian ] = "Impossibile uscire dall'applicazione in questo momento.\nAttendendete la concluisione della stampa e/o\n tutte le attivazioni OLE, quindi chiudete\ntutti i dialoghi." ;
+ Message [ portuguese_brazilian ] = "No consigo sair do aplicativo neste momento.\nPlease wait until all print jobs and/or\nOLE-activations are terminated and close\nall dialogs." ;
+ Message [ portuguese ] = "De momento impossvel sair desta aplicao.\nAguarde a impresso de todos os documentos\n e/ou o fim das activaes OLE e feche todos os dilogos." ;
+ Message [ french ] = "Impossible de quitter l'application maintenant.\nVeuillez attendre la fin des activits d'impression et/ou des activations OLE\net fermez tous les dialogues." ;
+ Message [ dutch ] = "De applicatie kan op dit moment niet worden beindigd.\nWacht tot alle drukopdrachten en/of\nOLE-activiteiten zijn beindigd en \nsluit alle dialogen." ;
+ Message [ spanish ] = "La aplicacin no se puede cerrar por el momento. \nPor favor espere hasta que finalice la impresin de\n todos los documentos y/o activaciones OLE\ny cierre todos los dilogos." ;
+ Message [ danish ] = "Det er for tiden ikke muligt at afslutte programmet.\nVent venligst til alle udskriftsjob og/eller \nOLE-handlinger er afslutte og luk s alle dialoger." ;
+ Message [ swedish ] = "Programmet kan inte avslutas fr tillfllet.\nVnta tills alla utskriftsuppdrag och/eller\nOLE-aktiveringar r utfrda och stng alla dialoger." ;
+ Message [ finnish ] = "Can't quit the application at this moment.\nPlease wait until all print jobs and/or\nOLE-activations are terminated and close\nall dialogs." ;
+ Message [ english_us ] = "The application cannot be terminated at the moment.\nPlease wait until all print jobs and/or\nOLE actions have finished and close all dialogs." ;
+ Message[ chinese_simplified ] = "޷Ӧó\nԵֱдӡOLE״̬\nȻٹرжԻ";
+ Message[ russian ] = " .\n, , /\n OLE .";
+ Message[ polish ] = "Aplikacji nie mona zakoczy.\nProsz zaczeka na koniec zada wydruku i/lub\nakcji OLE i zamkn wszystkie aplikacje.";
+ Message[ japanese ] = "۸т܏Ił܂B\nׂĂ̈ޮ /܂ \nOLE ̏I܂ő҂ ׂĂ޲۸ނ‚ĉB";
+ Message[ chinese_traditional ] = "{bLkoε{C\nеԩҦCLȩOLEEAwgM\nMAҦܤC";
+ Message[ arabic ] = " .\n ɡ /\n OLE .";
+ Message[ dutch ] = "De applicatie kan op dit moment niet worden beindigd.\nWacht tot alle drukopdrachten en/of\nOLE-activiteiten zijn beindigd en \nsluit alle dialogen.";
+ Message[ chinese_simplified ] = "޷Ӧó\nԵֱдӡOLE״̬\nȻٹرжԻ";
+ Message[ greek ] = " .\n /\n OLE .";
+ Message[ korean ] = " α׷ ϴ.\nμ ۾ ׸/Ǵ \nOLE Ȱȭ ٷȴٰ ȭڸ ʽÿ.";
+ Message[ turkish ] = "u an uygulamadan klamyor.\nTm yazdrma ilerinin ve/veya\nOLE ilemlerinin bitmesini bekleyip tm diyaloglar kapatnz.";
+ Message[ language_user1 ] = " ";
+};
+
+QueryBox MSG_IS_SERVER
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ Message = "Die Applikation ist noch als Objekt- oder Druck-Server aktiv.\nSoll sie trotzdem geschlossen werden?" ;
+ Message [ English ] = "This application is an active object- or printserver.\nTerminata nevertheless?" ;
+ Message [ norwegian ] = "Denne applikasjonen er en aktiv server.\nAvslutt likevel?" ;
+ Message [ italian ] = "Questa applicazione un server attivo.\nTerminare in ogni caso?" ;
+ Message [ portuguese_brazilian ] = "Este aplicativo um ativo no servidor.\nTerminar assim mesmo?" ;
+ Message [ portuguese ] = "Esta aplicao est ainda activa como servidor de objecto ou da impressora.\nMesmo assim, finalizar?" ;
+ Message [ finnish ] = "Tm sovellus on aktiivinen lhdesovellus.\nLopetetaanko silti?" ;
+ Message [ danish ] = "Denne applikation er stadig aktiv som objekt- eller printserver.\nSkal der lukkes alligevel?" ;
+ Message [ french ] = "Cette application est encore active en tant que serveur d'objets ou d'imprimante.\nInterrompre malgr tout ?" ;
+ Message [ swedish ] = "Tillmpningen r fortfarande aktiv antingen som objekt- eller skrivarserver.\nVill Du trots det stnga den?" ;
+ Message [ dutch ] = "Deze toepassing is nog actief als object- of afdrukserver.\nToch afsluiten ?" ;
+ Message [ spanish ] = "Esta aplicacin est an activa como servidor de objeto o de impresin.\nDesea finalizarla?" ;
+ Message [ english_us ] = "This application is as object or print server active.\nDo you want to terminate anyway?" ;
+ Message[ chinese_simplified ] = "ӦóΪӡڼ״̬\nҪر?";
+ Message[ russian ] = " .\n ?";
+ Message[ polish ] = "Aplikacja jest jeszcze aktywna jako obiekt lub serwer wydruku.\nCzy j mimo to zamkn?";
+ Message[ japanese ] = "ع݂ ܂޼ުĂ܂ ްƂıèނłB\n‚Ă낵ł?";
+ Message[ chinese_traditional ] = "oε{@ΦCLAٳBEAC\nz٬OnH";
+ Message[ arabic ] = " .\n ߿";
+ Message[ dutch ] = "Deze toepassing is nog actief als object- of afdrukserver.\nToch afsluiten ?";
+ Message[ chinese_simplified ] = "ӦóΪӡڼ״̬\nҪر?";
+ Message[ greek ] = " .\n ;";
+ Message[ korean ] = "üǴ μ α׷ ȰȭǾ ֽϴ.\n Ͻðڽϱ?";
+ Message[ turkish ] = "Uygulama u an nesne ya da yazdrma sunucusu olarak alyor.\nYine de kapatlsn m?";
+ Message[ language_user1 ] = " ";
+};
+
+String STR_NODOUBLE
+{
+ TEXT = "StarOffice kann nicht mehrfach gestartet werden." ;
+ TEXT [ English ] = "StarOffice cannot be started multiply." ;
+ Text [ english_us ] = "StarOffice cannot be started more than once." ;
+ Text [ portuguese_brazilian ] = "StarOffice Applikationen knnen nicht mehrfach\ngestartet werden." ;
+ Text [ swedish ] = "StarOffice kan inte startas flera gnger samtidigt." ;
+ Text [ danish ] = "Det er ikke muligt at starte StarOffice flere gange." ;
+ Text [ italian ] = "StarOffice non pu essere avviato pi volte" ;
+ Text [ spanish ] = "StarOffice no se puede iniciar ms de una vez." ;
+ Text [ french ] = "Impossible de lancer plusieurs applications de \nStarOffice la fois." ;
+ Text [ dutch ] = "StarOffice kan maar n keer tegelijk worden gestart." ;
+ Text [ portuguese ] = "O StarOffice no pode ser inicializado mais do que uma vez." ;
+ Text[ chinese_simplified ] = "޷ͬʱ StarOffice ";
+ Text[ russian ] = " StarOffice .";
+ Text[ polish ] = "StarOffice nie mona kilkakrotnie uruchomi.";
+ Text[ japanese ] = "StarOffice Ăł܂B";
+ Text[ chinese_traditional ] = "LkPɦhҰStarOfficeC";
+ Text[ arabic ] = " StarOffice .";
+ Text[ dutch ] = "StarOffice kan maar n keer tegelijk worden gestart.";
+ Text[ chinese_simplified ] = "޷ͬʱ StarOffice ";
+ Text[ greek ] = " StarOffice .";
+ Text[ korean ] = "StarOffice ѹ̻ ۵ մϴ .";
+ Text[ turkish ] = "StarOffice iin birden fazla oturum alamaz.";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_NOPRINTER
+{
+ TEXT = "Einige StarOffice-Funktionen knnen ohne Druckertreiber nicht korrekt arbeiten.\nBitte installieren Sie einen Druckertreiber." ;
+ TEXT [ English ] = "Some StarOffice functions are not available without printer driver.\nPlease install a priter driver." ;
+ Text [ english_us ] = "Some StarOffice functions will not work properly without a printer driver.\nPlease install a printer driver." ;
+ Text [ swedish ] = "Ngra StarOffice-funktioner kan inte arbeta korrekt utan en skrivardrivrutin.\nVar vnlig och installera en skrivardrivrutin." ;
+ Text [ danish ] = "Enkelte StarOffice-funktioner kanl ikke arbejde korrekt uden en printerdriver.\nInstaller venligst en printerdriver." ;
+ Text [ italian ] = "Alcune funzioni StarOffice non funzionano correttamente senza il driver stampante.\nInstallatene uno." ;
+ Text [ spanish ] = "Algunas funciones de StarOffice no pueden trabajar correctamente sin un controlador para la impresora.\nPor favor instale uno." ;
+ Text [ french ] = "Certaines fonctions StarOffice ne peuvent pas travailler correctement sans pilote d'imprimante.\nVeuillez installer un pilote d'imprimante." ;
+ Text [ dutch ] = "Enkele StarOffice-functies kunnen zonder printerdriver niet correct werken.\nInstalleer een printerdriver." ;
+ Text [ portuguese_brazilian ] = "Einige StarOffice-Funktionen knnen ohne Druckertreiber nicht korrekt arbeiten.\nBitte installieren Sie einen Druckertreiber." ;
+ Text [ portuguese ] = "Algumas das funes do StarOffice no podem funcionar correctamente sem um controlador de impressora.\nFaa a respectiva instalao." ;
+ Text[ chinese_simplified ] = "ΪûаװӡһЩStarOfficeܿܲת\nװһӡ";
+ Text[ russian ] = " StarOffice .\n, , .";
+ Text[ polish ] = "Niektre funkcje w StarOffice nie mog poprawnie pracowa bez sterownika drukarki.\nZainstaluj sterownik drukarki.";
+ Text[ japanese ] = "StarOffice ̂‚̋@\\ ײނȂŐN܂B\n ײނݽİقĂB";
+ Text[ chinese_traditional ] = "Sw˦CLXʵ{M@StarOffice\\Bण|`C\nбzwˤ@ӦCLXʵ{C";
+ Text[ arabic ] = " StarOffice .\n .";
+ Text[ dutch ] = "Enkele StarOffice-functies kunnen zonder printerdriver niet correct werken.\nInstalleer een printerdriver.";
+ Text[ chinese_simplified ] = "ΪûаװӡһЩStarOfficeܿܲת\nװһӡ";
+ Text[ greek ] = " StarOffice .\n .";
+ Text[ korean ] = " StarOffice ̹ ̴ ۵ ʽϴ.\n ̹ ġ Ͻʽÿ.";
+ Text[ turkish ] = "Baz StarOffice ilevleri yazc srcs olmadan doru alamaz.\nBir yazc srcs kurun.";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_NOMODUL
+{
+ TEXT = "Applikationsmodule knnen nicht als Applikationen\ngestartet werden, wenn der StarDesktop aktiv ist." ;
+ TEXT [ English ] = "Application modules may not be started\nif StarDesktop is active." ;
+ Text [ english_us ] = "Application modules may not be started\n when StarOffice Desktop is active." ;
+ Text [ italian ] = "Se lo StarOffice Desktop attivo i moduli applicativi\n non possono essere avviati come apllicazioni." ;
+ Text [ spanish ] = "Los mdulos de aplicacin no pueden ser\niniciados como aplicaciones si el escritorio (StarOffice Desktop) est activo." ;
+ Text [ french ] = "Impossible de dmarrer les modules d'application comme applications,\n si le StarOffice Desktop est actif." ;
+ Text [ dutch ] = "Applicatiemodules kunnen niet als applicaties\nworden gestart als StarDesktop actief is." ;
+ Text [ swedish ] = "Tillmpningsmoduler kan inte startas som\ntillmpningar nr StarOffice Desktop r aktiv." ;
+ Text [ danish ] = "Det er ikke muligt at starte applikationsmoduler som applikationer,\nr StarOffice Desktop er aktiv." ;
+ Text [ portuguese_brazilian ] = "Applikationsmodule knnen nicht als Applikationen\ngestartet werden, wenn der StarOffice Desktop aktiv ist." ;
+ Text [ portuguese ] = "Impossvel iniciar os mdulos como aplicaes quando o StarOffice Desktop se encontra activo." ;
+ Text[ chinese_simplified ] = "StarOffice Desktopڼ״̬\nӦóģ鲻ܹӦóС";
+ Text[ russian ] = " ,\n StarDeskto.";
+ Text[ polish ] = "Moduy aplikacji nie mog zosta uruchomione jako aplikacje\n, jeli jest wczony pulpit StarOffice Desktop.";
+ Text[ japanese ] = "StarOffice Desktop èނ̂Ƃ́Aع݂Ƃıع Ӽޭق\nJnł܂B";
+ Text[ chinese_traditional ] = "bStarOffice DesktopB_EA\nMε{ǪҶ@ε{ҰʹBC";
+ Text[ arabic ] = " ʡ\n StarOffice Desktop .";
+ Text[ dutch ] = "Applicatiemodules kunnen niet als applicaties\nworden gestart als StarDesktop actief is.";
+ Text[ chinese_simplified ] = "StarOffice Desktopڼ״̬\nӦóģ鲻ܹӦóС";
+ Text[ greek ] = " \n StarOffice Desktop.";
+ Text[ korean ] = "StarOffice ũ ž Ȱȭ Ǿ.\n α׷ ɼ ϴ.";
+ Text[ turkish ] = "Uygulama modlleri, StarOffice masast etkinken uygulama olarak\naltrlamaz.";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_NOOFFICE
+{
+ TEXT = "Der StarDesktop kann nicht gestartet werden,\nwenn das StarWriter Applikationsmodul als\nApplikation gestartet wurde." ;
+ TEXT [ English ] = "StarDesktop may not be started if StarWriter\napplication module is active in application mode\n" ;
+ Text [ english_us ] = "StarOffice Desktop cannot be started if the StarOffice Writer\napplication module has been started\nas an application." ;
+ Text [ italian ] = "Se il modulo di applicazione StarOffice Writer stato avviato\ncome applicazione non possibile\navviare lo StarOffice Desktop." ;
+ Text [ spanish ] = "No se pude iniciar el escritorio\nsi se ha iniciado StarOffice Writer\ncomo aplicacin." ;
+ Text [ french ] = "Impossible de lancer le StarOffice Desktop,\nsi le module d'application StarOffice Writer a t lanc\ncomme application." ;
+ Text [ dutch ] = "StarOffice Desktop kan niet worden gestart\nals een StarOffice Writer applicatiemodule als\napplicatie werd gestart." ;
+ Text [ swedish ] = "StarOffice Desktop kan inte startas\nnr StarOffice Writer-tillmpningsmodulen\nhar startats som tillmpning." ;
+ Text [ danish ] = "Det er ikke muligt at starte StarOffice Desktop,\nnr StarOffice Writer applikationsmodulet er blevet startet \nsom applikation." ;
+ Text [ portuguese_brazilian ] = "Der StarOffice Desktop kann nicht gestartet werden,\nwenn das StarOffice Writer Applikationsmodul als\nApplikation gestartet wurde." ;
+ Text [ portuguese ] = "Impossvel iniciar o StarOffice Desktop quando o mdulo da\naplicao StarOffice Writer iniciado\ncomo aplicao." ;
+ Text[ chinese_simplified ] = "StarOffice WriterӦóģ鱻\nӦóʱ޷StarOffice Desktop ";
+ Text[ russian ] = " StarOffice Desktop ,\n StarOffice Writer \n.";
+ Text[ polish ] = "Pulpitu StarOffice Desktop nie mona uruchomi, \njeli modu aplikacji StarOffice Writer \nzosta uruchomiony jako aplikacja.";
+ Text[ japanese ] = "StarOffice Writer ع Ӽޭق\nع݂ƂĊJnĂ鎞́A\nStarOffice Desktop͊Jnł܂B";
+ Text[ chinese_traditional ] = "bStarOffice Writerε{ҶQ@\nε{ҰʹBɵLkҰStarOffice DesktopC";
+ Text[ arabic ] = " StarOffice Desktop\n StarOffice Writer \n.";
+ Text[ dutch ] = "StarOffice Desktop kan niet worden gestart\nals een StarOffice Writer applicatiemodule als\napplicatie werd gestart.";
+ Text[ chinese_simplified ] = "StarOffice WriterӦóģ鱻\nӦóʱ޷StarOffice Desktop ";
+ Text[ greek ] = " StarOffice Desktop\n \n StarOffice Writer .";
+ Text[ korean ] = "StarOffice Writer α׷ \n α׷μ ۵Ǿٸ,\n StarOffice ũ ž ɼ ϴ.";
+ Text[ turkish ] = "StarOffice masast, StarOffice Writer uygulama modul\nuygulama olarak altrlmsa balatlamaz.";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_ISMODIFIED
+{
+ TEXT[ language_user1 ] = "PB: waren frueher zwei String";
+ TEXT = "Sollen nderungen in %1 gespeichert werden?" ;
+ TEXT [ English ] = "Should the changes to %1 be saved?" ;
+ TEXT [ norwegian ] = "Lagre endringer som " ;
+ TEXT [ italian ] = "Volete salvare le modifiche apportate a %1?" ;
+ TEXT [ portuguese_brazilian ] = "Gravar modificaes como " ;
+ TEXT [ portuguese ] = "Guardar modificaes em %1?" ;
+ TEXT [ finnish ] = "Tallenetaanko muutokset" ;
+ TEXT [ danish ] = "Skal ndringer gemmes i %1?" ;
+ TEXT [ french ] = "Souhaitez-vous enregistrer les modifications apportes %1 ?" ;
+ TEXT [ swedish ] = "Skall ndringar sparas i %1?" ;
+ TEXT [ dutch ] = "Wijzigingen opslaan in %1?" ;
+ TEXT [ spanish ] = "Desea guardar las modificaciones en %1?" ;
+ TEXT [ english_us ] = "Do you want to save the changes to %1?" ;
+ TEXT[ chinese_simplified ] = "Ҫ̸ %1 ";
+ TEXT[ russian ] = " %1 ?";
+ TEXT[ polish ] = "Zapisa modyfikacje w %1 ?";
+ TEXT[ japanese ] = "ύX %1 ɕۑ܂H";
+ TEXT[ chinese_traditional ] = "xsܧ %1 H";
+ TEXT[ arabic ] = " %1";
+ TEXT[ dutch ] = "Wijzigingen opslaan in %1?";
+ TEXT[ chinese_simplified ] = "Ҫ̸ %1 ";
+ TEXT[ greek ] = " %1;";
+ TEXT[ korean ] = "%1 Ͻðڽϱ?";
+ TEXT[ turkish ] = "%1 iinde yaplan deiiklikler kaydedilsin mi?";
+};
+
+String STR_AUTOSAVE
+{
+ TEXT = "Automatisch speichern" ;
+ TEXT [ English ] = "Automatic save" ;
+ TEXT [ norwegian ] = "Automatisk lagring" ;
+ TEXT [ italian ] = "Salva automaticamente" ;
+ TEXT [ portuguese_brazilian ] = "Gravao Automtica" ;
+ TEXT [ portuguese ] = "Guardar automaticamente" ;
+ TEXT [ finnish ] = "Automaattitallennus" ;
+ TEXT [ danish ] = "Gem automatisk" ;
+ TEXT [ french ] = "Enregistrement automatique" ;
+ TEXT [ swedish ] = "Spara automatiskt" ;
+ TEXT [ dutch ] = "Automatisch opslaan" ;
+ TEXT [ spanish ] = "Guardar automticamente" ;
+ TEXT [ english_us ] = "AutoSave" ;
+ TEXT[ chinese_simplified ] = "Զ";
+ TEXT[ russian ] = " ";
+ TEXT[ polish ] = "Zapisz automatycznie";
+ TEXT[ japanese ] = "Iɕۑ";
+ TEXT[ chinese_traditional ] = "۰xs";
+ TEXT[ arabic ] = " ";
+ TEXT[ dutch ] = "Automatisch opslaan";
+ TEXT[ chinese_simplified ] = "Զ";
+ TEXT[ greek ] = " ";
+ TEXT[ korean ] = "ڵ ";
+ TEXT[ turkish ] = "Otomatik kayt";
+ TEXT[ language_user1 ] = " ";
+};
+
+String STR_RESWARNING
+{
+ TEXT = "Die Systemresourcen werden knapp. Bitte beenden Sie andere Applikationen oder schlieen Sie einige Fenster, bevor Sie weiterarbeiten." ;
+ TEXT [ English ] = "Not enough resources. Please quit other applications or close some windows before continuing." ;
+ TEXT [ norwegian ] = "Ikke nok ressurser. Avslutt andre applikasjoner eller lukk noen vinduer fr du fortsetter." ;
+ TEXT [ italian ] = "Risorse insufficienti. Uscire dalle altre applicazioni o chiudere alcune finestre prima di continuare." ;
+ TEXT [ portuguese_brazilian ] = "No h recursos suficientes. Sai de outros aplicativos ou feche algumas janelas antes de continuar." ;
+ TEXT [ portuguese ] = "Recursos do sistema insuficientes. Por favor, saia dos outros programas ou feche algumas janelas antes de continuar." ;
+ TEXT [ finnish ] = "Resurssit eivt riit. Lopeta muita sovelluksia tai sulje ikkunoita ennen kuin jatkat." ;
+ TEXT [ danish ] = "Begrnsede systemressourcer. Afslut venligst andre applikationer eller luk nogle vinduer, fr du fortstter." ;
+ TEXT [ french ] = "Ressources insuffisantes. Veuillez quitter les autres applications ou fermer certaines fentres avant de continuer." ;
+ TEXT [ swedish ] = "Inte tillrckligt med resurser. Stng andra program eller stng ngra fnster innan Du fortstter." ;
+ TEXT [ dutch ] = "Onvoldoende systeemgeheugen beschikbaar. Sluit andere toepassingen af.of sluit een aantal vensters voordat u uw werkvoortzet." ;
+ TEXT [ spanish ] = "No hay suficientes recursos del sistema. Por favor, elimine otras aplicaciones o cierre algunas ventanas antes de continuar." ;
+ TEXT [ english_us ] = "Limited system resources. Please quit other applications or close some windows before continuing." ;
+ TEXT[ chinese_simplified ] = "ϵͳԴ㡣رij߹رһЩӴȻ³ִ";
+ TEXT[ russian ] = " . , , , .";
+ TEXT[ polish ] = "Zasoby systemu s ograniczone. Przed kontynuacj pracy zakocz kilka aplikacji lub zamknij kilka okien.";
+ TEXT[ japanese ] = " ؿ肬łBƂ𑱂Oɤ̱ع݂I邩 ‚̳޳‚ĉB";
+ TEXT[ chinese_traditional ] = "tθ귽C䥦{Ϊ@ǵMM᭫sհROC";
+ TEXT[ arabic ] = " . С .";
+ TEXT[ dutch ] = "Onvoldoende systeemgeheugen beschikbaar. Sluit andere toepassingen af.of sluit een aantal vensters voordat u uw werkvoortzet.";
+ TEXT[ chinese_simplified ] = "ϵͳԴ㡣رij߹رһЩӴȻ³ִ";
+ TEXT[ greek ] = " . .";
+ TEXT[ korean ] = "ý ڿ մϴ . Ͻñ ٸ α׷ ϰų ִ â ʽÿ.";
+ TEXT[ turkish ] = "Sistem kaynaklar azalyor. almaya devam etmeden nce dier uygulamalar ya da bir ka pencere kapatn.";
+ TEXT[ language_user1 ] = " ";
+};
+String STR_RESEXCEPTION
+{
+ TEXT = "Wichtige Programmteile nicht gefunden. Bitte berprfen Sie Ihre Installation." ;
+ TEXT [ ENGLISH ] = "There are files missing. Please check application setup." ;
+ TEXT [ norwegian ] = "Filer mangler. Kontroller applikasjonsoppsett." ;
+ TEXT [ italian ] = "Mancano alcuni file. Verificare la configurazione dell'applicazione." ;
+ TEXT [ portuguese_brazilian ] = "Faltam arquivos. Verifique a configurao do aplicativo." ;
+ TEXT [ portuguese ] = "Faltam alguns ficheiros importantes. Por favor, verifique a configurao do programa." ;
+ TEXT [ finnish ] = "Tiedostoja puuttuu. Tarkista sovelluksen asetukset." ;
+ TEXT [ danish ] = "Vigtige programdele blev ikke fundet. Kontroller venligst din installation." ;
+ TEXT [ french ] = "Certains fichiers sont manquants. Veuillez vrifier le paramtrage de l'application." ;
+ TEXT [ swedish ] = "Viktiga programdelar hittades inte. Kontrollera Din installation." ;
+ TEXT [ dutch ] = "Er ontbreken belangrijke programmaonderdelen. Controleer of de installatie juist is doorgevoerd." ;
+ TEXT [ spanish ] = "No se encuentran archivos importantes del programa. Compruebe la instalacin." ;
+ TEXT [ english_us ] = "There are files missing. Please check application setup." ;
+ TEXT[ chinese_simplified ] = "ûҵҪij򲿼İװ";
+ TEXT[ russian ] = " . , , .";
+ TEXT[ polish ] = "Wane czci programu nie zostay znalezione.Sprawd instalacj aplikacji.";
+ TEXT[ japanese ] = "dv۸т̈ꕔ‚܂BݽİقĉB";
+ TEXT[ chinese_traditional ] = "S쥲n{CˬdzwˡC";
+ TEXT[ arabic ] = " . .";
+ TEXT[ dutch ] = "Er ontbreken belangrijke programmaonderdelen. Controleer of de installatie juist is doorgevoerd.";
+ TEXT[ chinese_simplified ] = "ûҵҪij򲿼İװ";
+ TEXT[ greek ] = " . .";
+ TEXT[ korean ] = " ֽϴ. ȮϽʽÿ.";
+ TEXT[ turkish ] = "nemli program eleri bulunamad. Kurulumunuzu kontrol edin.";
+ TEXT[ language_user1 ] = " ";
+};
+
+String STR_DOUBLEEXCEPTION
+{
+ Text = "Whrend der Alarmdatensicherung ist ein weiterer Systemfehler aufgetreten.\nDie Daten sind evtl. unvollstndig gesichert.";
+ Text[English] = "Within the emergency save a second system error has occured.\The data may be saved incompletely.";
+ TEXT[ italian ] = "Durante il backup di sicurezza si verificato un altro errore di sistema.\nI dati salvati potrebbero essere incompleti.";
+ TEXT[ portuguese_brazilian ] = "Whrend der Alarmdatensicherung ist ein weiterer Systemfehler aufgetreten.\nDie Daten sind evtl. unvollstndig gesichert.";
+ TEXT[ portuguese ] = "Surgiu mais um erro no sistema enquanto se executava o backup de segurana.\nProvavelmente, foi impossvel guardar os dados de forma completa.";
+ TEXT[ danish ] = "Der opstod en yderligere systemfejl ved alarmdatasikringen.\nAlle data er muligvis ikke gemt fuldstndigt.";
+ TEXT[ french ] = "Au cours de la sauvegarde, une nouvelle erreur systme s'est produite.\nIl n'est par certain que toutes les donnes aient pas pu tre enregistres correctement.";
+ TEXT[ swedish ] = "Ytterligare ett systemfel uppstod nr alarmdata sparades.\nEventuellt har inte alla data sparats fullstndigt.";
+ TEXT[ dutch ] = "Tijdens het opslaan van alarmgegevens is nog een systeemfout opgetreden.\nDe gegevens werden evtl. niet compleet opgeslagen.";
+ TEXT[ spanish ] = "Ha ocurrido otro error en el sistema mientras se guardaban los datos.\nEs posible que no se hayan guardado completamente.";
+ TEXT[ english_us ] = "Another error occurred during the save recovery.\nPossibly, the data could not be entirely saved.";
+ TEXT[ chinese_simplified ] = "޸ʱһ\nݴ̺пܲ";
+ TEXT[ russian ] = " .\n .";
+ TEXT[ polish ] = "Podczas alarmowego zabezpieczenia danych wystpi dalszy bd w systemie.\nDane s event. niekompletnie zabezpieczone.";
+ TEXT[ japanese ] = "x̧ٕی̍ۂɑ̼Ѵװ܂B\nް͂炭SɕۑĂ܂B";
+ TEXT[ chinese_traditional ] = "b״_xsɵoͤF@ӿ~C\nxsܦiणC";
+ TEXT[ arabic ] = " .\n .";
+ TEXT[ dutch ] = "Tijdens het opslaan van alarmgegevens is nog een systeemfout opgetreden.\nDe gegevens werden evtl. niet compleet opgeslagen.";
+ TEXT[ chinese_simplified ] = "޸ʱһ\nݴ̺пܲ";
+ TEXT[ greek ] = " .\n .";
+ TEXT[ korean ] = " ϴ ٸ ߻߽ϴ.\nƸ, Ͱ ʾ Դϴ.";
+ TEXT[ turkish ] = "Alarm verileri kayd srasnda baka bir sistem hatas olutu.\nVeriler tam olarak kaydedilmemi olabilir.";
+ TEXT[ language_user1 ] = " ";
+};
+
+String STR_SYSRESEXCEPTION
+{
+ TEXT = "Die Systemresourcen sind verbraucht. Bitte starten Sie die Anwendung neu." ;
+ TEXT [ English ] = "Not enough system resources. Please restart the application." ;
+ Text [ english_us ] = "System resources exhausted. Please restart the application." ;
+ Text [ italian ] = "Le risorse del sistema sono esaurite. Riavviare l'applicazione." ;
+ Text [ spanish ] = "Los recursos del sistema se han acabado. Por favor reinicie la aplicacin." ;
+ Text [ french ] = "Les ressources du systme sont puises. Veuillez relancer l'application ." ;
+ Text [ dutch ] = "De systeemresources zijn verbruikt. Start de applicatie opnieuw." ;
+ Text [ swedish ] = "Inte tillrckligt med systemresurser. Starta om programmet." ;
+ Text [ danish ] = "Systemressourcerne er opbrugt. Genstart venligst denne applikation." ;
+ Text [ portuguese_brazilian ] = "Die Systemresourcen sind verbraucht. Bitte starten Sie die Anwendung neu." ;
+ Text [ portuguese ] = "Recursos do sistema esgotados. Reinicie a aplicao." ;
+ Text[ chinese_simplified ] = "ϵͳԴѾꡣӦó";
+ Text[ russian ] = " . .";
+ Text[ polish ] = "Zasoby systemu s zuyte. Rozpocznij aplikacj ponownie.";
+ Text[ japanese ] = " ؿςłB۸тVĂĉB";
+ Text[ chinese_traditional ] = "tθ귽wgΧCбzsҰε{C";
+ Text[ arabic ] = " . .";
+ Text[ dutch ] = "De systeemresources zijn verbruikt. Start de applicatie opnieuw.";
+ Text[ chinese_simplified ] = "ϵͳԴѾꡣӦó";
+ Text[ greek ] = " . .";
+ Text[ korean ] = "ý ڿ ҸǾϴ. α׷ ٽ Ͻʽÿ.";
+ Text[ turkish ] = "Sistem kaynaklar tkendi. Uygulamay yeniden balatnz.";
+ Text[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERR_SOINIT
+{
+ Message = "Fehler beim Initialisieren des Objekt-Systems." ;
+ Message [ ENGLISH ] = "Error initializing object-system." ;
+ Message [ norwegian ] = "Feil ved start av objekt-system." ;
+ Message [ italian ] = "Errore durante l'inizializzazione del sistema oggetto." ;
+ Message [ portuguese_brazilian ] = "Erro ao inicializar o objeto-systema." ;
+ Message [ portuguese ] = "Erro ao inicializar o sistema de objectos." ;
+ Message [ finnish ] = "Virhe objektijrjestelm alustettaessa." ;
+ Message [ danish ] = "Fejl ved initialisering af objekt-systemet." ;
+ Message [ french ] = "Erreur lors de l'initialisation du systme d'objets." ;
+ Message [ swedish ] = "Fel vid initiering av objektsystem." ;
+ Message [ dutch ] = "Fout bij de initialisatie van het objectsysteem." ;
+ Message [ spanish ] = "Error al inicializar el sistema objeto." ;
+ Message [ english_us ] = "Error initializing object-system." ;
+ Message[ chinese_simplified ] = "ڳʼϵͳʱ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Bd inicjalizacji systemu obiektw.";
+ Message[ japanese ] = "޼ު т̏̍ۂ̴װ";
+ Message[ chinese_traditional ] = "blƪtήɵoͿ~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Fout bij de initialisatie van het objectsysteem.";
+ Message[ chinese_simplified ] = "ڳʼϵͳʱ";
+ Message[ greek ] = " .";
+ Message[ korean ] = "ü ý ʱȭ .";
+ Message[ turkish ] = "Nesne sistemi balatlrken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_FILE_NOT_FOUND
+{
+ Text = "Die Datei $(FILE) existiert nicht." ;
+ Text [ English ] = "The file $(FILE) doesn't exist." ;
+ Text [ norwegian ] = "Filen $(FIL) finnes ikke." ;
+ Text [ italian ] = "Il file $(FILE) non esiste." ;
+ Text [ portuguese_brazilian ] = "O arquivo $(FILE) no existe." ;
+ Text [ portuguese ] = "O ficheiro $(FILE) no existe." ;
+ Text [ finnish ] = "Tiedostoa $(FILE) ei ole." ;
+ Text [ danish ] = "Filen $(FILE) eksisterer ikke." ;
+ Text [ french ] = "Le fichier $(FILE) n'existe pas." ;
+ Text [ swedish ] = "Filen $(FILE) finns inte." ;
+ Text [ dutch ] = "Bestand $(FILE) bestaat niet." ;
+ Text [ spanish ] = "No existe el archivo $(FILE)." ;
+ Text [ english_us ] = "The file $(FILE) doesn't exist." ;
+ Text[ chinese_simplified ] = "ļ$(FILE)ڡ";
+ Text[ russian ] = " $(FILE) .";
+ Text[ polish ] = "Plik $(FILE) nie istnieje.";
+ Text[ japanese ] = "̧$(FILE)͂܂B";
+ Text[ chinese_traditional ] = "ɮ$(FILE)sbC";
+ Text[ arabic ] = " $(FILE) .";
+ Text[ dutch ] = "Bestand $(FILE) bestaat niet.";
+ Text[ chinese_simplified ] = "ļ$(FILE)ڡ";
+ Text[ greek ] = " $(FILE) .";
+ Text[ korean ] = " $(FILE) ʽϴ.";
+ Text[ turkish ] = "$(FILE) dosyas mevcut deil.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_PATH_NOT_FOUND
+{
+ Text = "Der Pfad zu der Datei $(FILE) existiert nicht." ;
+ Text [ English ] = "The path to file $(FILE) doesn't exist." ;
+ Text [ norwegian ] = "Banen til filen $(FIL) finnes ikke." ;
+ Text [ italian ] = "Il percorso per il file $(FILE) non esiste." ;
+ Text [ portuguese_brazilian ] = "O caminho do arquivo $(FILE) no existe." ;
+ Text [ portuguese ] = "O atalho para o ficheiro $(FILE) no existe." ;
+ Text [ finnish ] = "Polkua tiedostoon $(FILE) ei ole." ;
+ Text [ danish ] = "Stien til filen $(FILE) eksisterer ikke." ;
+ Text [ french ] = "Chemin au fichier $(FILE) inexistant." ;
+ Text [ swedish ] = "Skvgen till filen $(FILE) existerar inte." ;
+ Text [ dutch ] = "Pad naar bestand $(FILE) bestaat niet." ;
+ Text [ spanish ] = "No existe la ruta de acceso al archivo $(FILE)." ;
+ Text [ english_us ] = "The path to file $(FILE) doesn't exist." ;
+ Text[ chinese_simplified ] = "ָļ $(FILE) ·ڡ";
+ Text[ russian ] = " $(FILE) .";
+ Text[ polish ] = "cieka do pliku $(FILE) nie istnieje.";
+ Text[ japanese ] = "̧$(FILE)ւ߽͂܂B";
+ Text[ chinese_traditional ] = "Vɮ $(FILE) |sbC";
+ Text[ arabic ] = " $(FILE) .";
+ Text[ dutch ] = "Pad naar bestand $(FILE) bestaat niet.";
+ Text[ chinese_simplified ] = "ָļ $(FILE) ·ڡ";
+ Text[ greek ] = " $(FILE) .";
+ Text[ korean ] = " $(FILE) ΰ ʽϴ.";
+ Text[ turkish ] = "$(FILE) dosyasnn veri yolu mevcut deil.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_TOO_MANY_OPEN_FILES
+{
+ Text = "Die Datei $(FILE) konnte nicht geffnet werden,\nda zur Zeit zu viele Dateien offen sind.\nSchlieen Sie einige Dateien und versuchen Sie es erneut." ;
+ Text [ English ] = "The file $(FILE) could not be opened,\nbecause there are no more file handles available.\nPlease close some files and try again." ;
+ Text [ norwegian ] = "Filen $(FILE) kan ikke pnes,\ndet er ikke flere filhndtak tilgjengelig.\nLukk noen filer og prv igjen." ;
+ Text [ italian ] = "Impossibile aprire il file $(FILE),\nin quando vi sono troppi file aperti.\nChiudete i file e riprovate." ;
+ Text [ portuguese_brazilian ] = "O arquivo $(FILE) no pode ser aberto\npor que no existem mais alas de arquivo disponveis.\nFeche alguns arquivos e tent" ;
+ Text [ portuguese ] = "Foi impossvel abrir o ficheiro $(FILE), j que de\nmomento se encontram demasiados ficheiros abertos.\nFeche alguns destes ficheiros e tente novamente." ;
+ Text [ finnish ] = "Tiedostoa $(FILE) ei voi avata,\nkoska tiedostokahvoja ei ole vapaana.\nSulje tiedostoja ja yrit uudelleen." ;
+ Text [ danish ] = "Det var ikke muligt at bne filen $(FILE),\nda der for tiden er for mange bne filer.\nLuk nogle filer og prv igen." ;
+ Text [ french ] = "Impossible d'ouvrir le fichier $(FILE)\n cause d'un trop grand nombre de fichiers ouverts\n.Fermez en quelques-uns avant de ressayer." ;
+ Text [ swedish ] = "Filen $(FILE) kunde inte ppnas\np grund av att fr mnga filer r ppna fr tillfllet.\nStng ngra filer och frsk igen." ;
+ Text [ dutch ] = "Bestand $(FILE) kon niet worden geopend \nomdat er teveel bestanden gelijktijdig geopend zijn.\nSluit enkele bestanden en probeert u het opnieuw." ;
+ Text [ spanish ] = "No se pudo abrir el archivo $(FILE)\nya que hay muchos archivos abiertos.\nCierre algunos archivos e intntelo otra vez." ;
+ Text [ english_us ] = "The file $(FILE) could not be opened,\nbecause too many files are open.\nPlease close some files and try again." ;
+ Text[ chinese_simplified ] = "޷ļ$(FILE) \nΪѾ̫ļ\nرһЩļȻ³ԡ";
+ Text[ russian ] = " $(FILE) ,\n.. .\n .";
+ Text[ polish ] = "Plik $(FILE) nie mg zosta otwarty,\nponiewa w tym czasie byo otwarte za duo plikw.\nZamknij kilka plikw i sprbuj je otworzy ponownie.";
+ Text[ japanese ] = "\n܂̧قJ߂ŁA̧$(FILE)͊J܂B\n‚̧ق‚ ēx݂ĂB";
+ Text[ chinese_traditional ] = "Lk}ɮ$(FILE) M\n]wg}ҤӦhɮסC\n@ɮסMMbsաC";
+ Text[ arabic ] = " $(FILE) \n .\n ʡ .";
+ Text[ dutch ] = "Bestand $(FILE) kon niet worden geopend \nomdat er teveel bestanden gelijktijdig geopend zijn.\nSluit enkele bestanden en probeert u het opnieuw.";
+ Text[ chinese_simplified ] = "޷ļ$(FILE) \nΪѾ̫ļ\nرһЩļȻ³ԡ";
+ Text[ greek ] = " $(FILE),\n .\n .";
+ Text[ korean ] = " ʹ ֱ \n$(FILE) ߽ϴ. \n ݰ õϽʽÿ.";
+ Text[ turkish ] = "$(FILE) dosyas, u an ok fazla dosya ak olduu\niin alamyor.\nBirka dosyay kapatp yeniden deneyin.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_ACCESS_DENIED
+{
+ Text = "Auf die Datei $(FILE) konnte wegen fehlender Zugriffsrechte nicht zugegriffen werden." ;
+ Text [ English ] = "The file $(FILE) could not be accessed because of missing access rights." ;
+ Text [ norwegian ] = "The file $(FILE) could not be accessed because of missing access rights." ;
+ Text [ italian ] = "Non stato possibile accedere al file $(FILE) per mancanza dei diritti." ;
+ Text [ portuguese_brazilian ] = "The file $(FILE) could not be accessed because of missing access rights." ;
+ Text [ portuguese ] = "Impossvel o acesso ao ficheiro $(FILE) devido a direitos de acesso inexistentes." ;
+ Text [ finnish ] = "Tiedostoa $(FILE) ei voi avata, koska kyttoikeudet puuttuvat." ;
+ Text [ danish ] = "Det var ikke muligt at bne filen $(FILE) pga. manglende adgangsrettigheder." ;
+ Text [ french ] = "Le fichier $(FILE) n'a pas pu tre ouvert du fait de droits d'accs manquants." ;
+ Text [ swedish ] = "Filen $(FILE) kunde inte ppnas eftersom tkomstrttigheter saknas." ;
+ Text [ dutch ] = "Bestand $(FILE) kon niet worden geopend omdat toegangsrechten ontbreken." ;
+ Text [ spanish ] = "No se pudo se abrir el archivo $(FILE) por falta de derechos." ;
+ Text [ english_us ] = "The file $(FILE) could not be opened due to missing access rights." ;
+ Text[ chinese_simplified ] = "ΪûжȡȨȡļ$(FILE)";
+ Text[ russian ] = "- , $(FILE) .";
+ Text[ polish ] = "Brak dostpu do pliku $(FILE) z powodu brakujcych praw dostpu.";
+ Text[ japanese ] = "̧ $(FILE)ɂ Ȃ̂űł܂B";
+ Text[ chinese_traditional ] = "]SŪvQӵLkŪɮ$(FILE)C";
+ Text[ arabic ] = " $(FILE) .";
+ Text[ dutch ] = "Bestand $(FILE) kon niet worden geopend omdat toegangsrechten ontbreken.";
+ Text[ chinese_simplified ] = "ΪûжȡȨȡļ$(FILE)";
+ Text[ greek ] = " $(FILE) , .";
+ Text[ korean ] = " $(FILE) ʽϴ.";
+ Text[ turkish ] = "$(FILE) dosyas, eriim haklarnn olmamas nedeniyle alamad.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_INVALID_ACCESS
+{
+ Text = "Auf Datei $(FILE) konnte nicht zugegriffen werden." ;
+ Text [ English ] = "The file $(FILE) could not be accessed." ;
+ Text [ norwegian ] = "The file $(FILE) could not be accessed." ;
+ Text [ italian ] = "Non stato possibile accedere al file $(FILE)." ;
+ Text [ portuguese_brazilian ] = "The file $(FILE) could not be accessed." ;
+ Text [ portuguese ] = "Impossvel o acesso ao ficheiro $(FILE)." ;
+ Text [ finnish ] = "Tiedostoa $(FILE) ei voi avata, koska kyttoikeudet eivt kelpaa." ;
+ Text [ danish ] = "Det var ikke muligt at f adgang til filen $(FILE)." ;
+ Text [ french ] = "Le fichier $(FILE) n'a pas pu tre ouvert du fait de droits d'accs incorrects." ;
+ Text [ swedish ] = "Det var inte mjligt att f tkomst till filen $(FILE)." ;
+ Text [ dutch ] = "Bestand $(FILE) kon niet worden geopend." ;
+ Text [ spanish ] = "No se pudo acceder al archivo $(FILE)." ;
+ Text [ english_us ] = "The file $(FILE) could not be accessed." ;
+ Text[ chinese_simplified ] = "޷ȡļ $(FILE) ";
+ Text[ russian ] = " $(FILE) .";
+ Text[ polish ] = "Brak dostpu do pliku $(FILE).";
+ Text[ japanese ] = "̧$(FILE)ɂͱł܂B";
+ Text[ chinese_traditional ] = "LkŪɮ $(FILE) C";
+ Text[ arabic ] = " $(FILE).";
+ Text[ dutch ] = "Bestand $(FILE) kon niet worden geopend.";
+ Text[ chinese_simplified ] = "޷ȡļ $(FILE) ";
+ Text[ greek ] = " $(FILE).";
+ Text[ korean ] = " $(FILE) ٵ ʽϴ.";
+ Text[ turkish ] = "$(FILE) dosyasna eriilemedi.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_INVALID_HANDLE
+{
+ Text = "Die Datei $(FILE) konnte wegen einer ungltiger Dateidescriptors nicht geffnet werden." ;
+ Text [ English ] = "The file $(FILE) could not be opened because of an invalid file handle." ;
+ Text [ norwegian ] = "+++The file $(FILE) could not be opened because of an invalid file handle." ;
+ Text [ italian ] = "Impossibile aprire il file $(FILE) in quando l'handle di file non valido." ;
+ Text [ portuguese_brazilian ] = "O arquivo $(FILE) no pode ser aberto devido a uma ala de arquivo invlida." ;
+ Text [ portuguese ] = "Foi impossvel abrir o ficheiro $(FILE) devido a uma guia de ficheiro incorrecta." ;
+ Text [ finnish ] = "Tiedostoa $(FILE) ei voi avata, koska tiedostokahva on virheellinen." ;
+ Text [ danish ] = "Det var ikke muligt at bne filen $(FILE) pga. en ugyldig filhandle." ;
+ Text [ french ] = "Le fichier $(FILE) n'a pas pu tre ouvert suite une erreur de numrisation." ;
+ Text [ swedish ] = "Filen $(FILE) kunde inte ppnas p grund av en ogiltig Fildescriptor." ;
+ Text [ dutch ] = "Bestand $(FILE) kon niet worden geopend als gevolg van ongeldige filedescriptor." ;
+ Text [ spanish ] = "No se pudo abrir el archivo $(FILE) debido a un controlador de archivos no vlido." ;
+ Text [ english_us ] = "The file $(FILE) could not be opened due to an invalid file handle." ;
+ Text[ chinese_simplified ] = "Чļʶֵ޷ļ $(FILE) ";
+ Text[ russian ] = "- , $(FILE) .";
+ Text[ polish ] = "Pliku $(FILE) nie mona byo otworzy z powodu nieprawidowego dojcia.";
+ Text[ japanese ] = "̧$(FILE)ً̧͖Lq̂߂ɊJ܂B";
+ Text[ chinese_traditional ] = "]LĪɮ׼ѭȦӵLk}ɮ$(FILE) C";
+ Text[ arabic ] = " $(FILE) .";
+ Text[ dutch ] = "Bestand $(FILE) kon niet worden geopend als gevolg van ongeldige filedescriptor.";
+ Text[ chinese_simplified ] = "Чļʶֵ޷ļ $(FILE) ";
+ Text[ greek ] = " $(FILE) .";
+ Text[ korean ] = "߸ ڵ $(FILE) ʽϴ.";
+ Text[ turkish ] = "$(FILE) dosyas geersiz bir dosya tutamac nedeniyle alamad.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_CANNOT_MAKE
+{
+ Text = "Die Datei $(FILE) konnte nicht angelegt werden." ;
+ Text [ English ] = "The file $(FILE) could not be created." ;
+ Text [ norwegian ] = "+++The file $(FILE) could not be created." ;
+ Text [ italian ] = "Impossibile creare il file $(FILE)." ;
+ Text [ portuguese_brazilian ] = "O arquivo $(FILE) no pode ser criado." ;
+ Text [ portuguese ] = "Foi impossvel criar o ficheiro $(FILE)." ;
+ Text [ finnish ] = "Tiedostoa $(FILE) ei voi luoda." ;
+ Text [ danish ] = "Det var ikke muligt at oprette filen $(FILE)." ;
+ Text [ french ] = "Le fichier $(FILE) n'a pas pu tre cr." ;
+ Text [ swedish ] = "Filen $(FILE) kunde inte skapas." ;
+ Text [ dutch ] = "Bestand $(FILE) kon niet worden gemaakt." ;
+ Text [ spanish ] = "No se pudo crear el archivo $(FILE)." ;
+ Text [ english_us ] = "The file $(FILE) could not be created." ;
+ Text[ chinese_simplified ] = "޷ļ $(FILE)";
+ Text[ russian ] = " $(FILE).";
+ Text[ polish ] = "Pliku $(FILE) nie mona byo utworzy.";
+ Text[ japanese ] = "̧$(FILE)͍쐬ł܂łB";
+ Text[ chinese_traditional ] = "Lk}ҷs$(FILE)C";
+ Text[ arabic ] = " $(FILE).";
+ Text[ dutch ] = "Bestand $(FILE) kon niet worden gemaakt.";
+ Text[ chinese_simplified ] = "޷ļ $(FILE)";
+ Text[ greek ] = " $(FILE).";
+ Text[ korean ] = " $(FILE) ʽϴ.";
+ Text[ turkish ] = "$(FILE) dosyas oluturulamad.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_SHARING
+{
+ Text = "Fehler beim gemeinsamen Zugriff auf die Datei $(FILE)." ;
+ Text [ English ] = "Sharing violation while accessing $(FILE)." ;
+ Text [ norwegian ] = "+++Sharing violation while accessing $(FILE)." ;
+ Text [ italian ] = "Violazione di condivisione durante l'accesso al $(FILE)." ;
+ Text [ portuguese_brazilian ] = "Violao de compartilhamento durante o acesso do $(FILE)." ;
+ Text [ portuguese ] = "Erro durante o acesso compartilhado ao ficheiro $(FILE)." ;
+ Text [ finnish ] = "Yhteiskyttvirhe tiedostossa $(FILE)." ;
+ Text [ danish ] = "Fejl under flles adgang til filen $(FILE)." ;
+ Text [ french ] = "Violation du partage pendant l'accs au $(FILE)." ;
+ Text [ swedish ] = "Fel vid gemensam tkomst till filen $(FILE)." ;
+ Text [ dutch ] = "Fout bij gelijktijdige toegang tot $(FILE)." ;
+ Text [ spanish ] = "Error durante el acceso compartido al archivo $(FILE)." ;
+ Text [ english_us ] = "Error by shared access to $(FILE)." ;
+ Text[ chinese_simplified ] = "ͬʱȡļ $(FILE) ʱ";
+ Text[ russian ] = " $(FILE).";
+ Text[ polish ] = "Brak wsplnego dostpu do pliku $(FILE).";
+ Text[ japanese ] = "̧$(FILE)ւ̋L̍ۂ̴װ";
+ Text[ chinese_traditional ] = "bPŪɮ$(FILE) ɵoͿ~C";
+ Text[ arabic ] = " $(FILE).";
+ Text[ dutch ] = "Fout bij gelijktijdige toegang tot $(FILE).";
+ Text[ chinese_simplified ] = "ͬʱȡļ $(FILE) ʱ";
+ Text[ greek ] = " $(FILE).";
+ Text[ korean ] = "$(FILE) ٿ .";
+ Text[ turkish ] = "$(FILE) dosyasna paylalan eriimde hata olutu.";
+ Text[ language_user1 ] = " ";
+};
+
+String MSG_IOERR_INVALID_PARAMETER
+{
+ Text = "" ;
+ Text [ English ] = "" ;
+ Text [ norwegian ] = "" ;
+ Text [ italian ] = "" ;
+ Text [ portuguese_brazilian ] = "" ;
+ Text [ portuguese ] = "" ;
+ Text [ finnish ] = "" ;
+ Text [ danish ] = "" ;
+ Text [ french ] = "" ;
+ Text [ swedish ] = "" ;
+ Text [ dutch ] = "" ;
+ Text [ spanish ] = "" ;
+ Text [ english_us ] = "" ;
+};
+
+String MSG_IOERR_GENERAL
+{
+ Text = "Allgemeiner Ein-/Ausgabefehler beim Zugriff auf $(FILE)." ;
+ Text [ English ] = "General I/O Error accessing $(FILE)." ;
+ Text [ norwegian ] = "" ;
+ Text [ italian ] = "Errore generale di I/O nell'accesso a $(FILE)." ;
+ Text [ portuguese_brazilian ] = "Allgemeiner Ein-/Ausgabefehler beim Zugriff auf $(FILE)." ;
+ Text [ french ] = "Erreur d'entre/sortie gnrale lors de l'accs au fichier $(FILE)." ;
+ Text [ swedish ] = "Allmnt input/outputfel vid tkomst av $(FILE)." ;
+ Text [ dutch ] = "Algemene in-/uitvoerfout bij toegang op $(FILE)." ;
+ Text [ spanish ] = "Error general de entrada/salida al acceder a $(FILE)." ;
+ Text [ english_us ] = "General I/O error accessing $(FILE)." ;
+ Text [ dutch ] = "Algemene in-/uitvoerfout bij toegang op $(FILE)." ;
+ Text [ italian ] = "Errore generale di I/O nell'accesso a $(FILE)." ;
+ Text [ french ] = "Erreur d'entre/sortie gnrale lors de l'accs au fichier $(FILE)." ;
+ Text [ danish ] = "Generel I/O fejl ved adgang til $(FILE)." ;
+ Text [ portuguese ] = "Erro geral de acesso/sada ao tentar entrar em $(FILE)." ;
+ Text[ chinese_simplified ] = "ڶȡ$(FILE)ʱһһ/";
+ Text[ russian ] = " $(FILE).";
+ Text[ polish ] = "Oglny bd dostpu We/Wy podczas dostpu do $(FILE).";
+ Text[ japanese ] = "$(FILE)ւ̱̍ۂ̈ʓII/OװB";
+ Text[ chinese_traditional ] = "bŪ$(FILE)ɵoͤ@Ӥ@몺J/X~C";
+ Text[ arabic ] = " $(FILE).";
+ Text[ dutch ] = "Algemene in-/uitvoerfout bij toegang op $(FILE).";
+ Text[ chinese_simplified ] = "ڶȡ$(FILE)ʱһһ/";
+ Text[ greek ] = " / $(FILE).";
+ Text[ korean ] = " $(FILE) Ϲ .";
+ Text[ turkish ] = "$(FILE) dosyasna eriimde genel girdi/kt hatas olutu..";
+ Text[ language_user1 ] = " ";
+};
+
+String RID_FULLSCREENTOOLBOX
+{
+ Text = "" ;
+ /*
+ Text = "Gesamtbild";
+ Text [ENGLISH] = "Full screen";
+ Text [norwegian] = "Fullt skjermbilde";
+ Text [italian] = "Schermo intero";
+ Text [portuguese_brazilian] = "Tela completa";
+ Text [portuguese] = "Ecr inteiro";
+ Text [finnish] = "Koko nytt";
+ Text [danish] = "Helskrm";
+ Text [french] = "Plein cran";
+ Text [swedish] = "Helskrm";
+ Text [dutch] = "Volledig scherm";
+ Text [spanish] = "Pantalla completa";
+ Text [english_us] = "Full screen";
+*/
+};
+
+ToolBox RID_FULLSCREENTOOLBOX
+{
+ HelpId = HID_FULLSCREENTOOLBOX ;
+ ButtonType = BUTTON_SYMBOL ;
+ LineSpacing = TRUE ;
+ Border = TRUE ;
+ Scroll = TRUE ;
+ SVLook = TRUE ;
+ Moveable = TRUE ;
+ Sizeable = TRUE ;
+ Closeable = TRUE ;
+ Zoomable = TRUE ;
+ Customize = TRUE ;
+ FloatingMode = TRUE ;
+ Hide = TRUE ;
+ _FloatingPosMapMode = MAP_APPFONT ;
+ _FloatingPosX = -50 ;
+ _FloatingPosY = -70 ;
+ FloatingLines = 1 ;
+ HideWhenDeactivate = TRUE ;
+ Align = BOXALIGN_TOP ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_WIN_FULLSCREEN ;
+ };
+ };
+};
+
+String RID_RECORDINGTOOLBOX
+{
+ Text = "" ;
+ /*
+ Text = "Makro Aufzeichnung";
+ Text [ENGLISH] = "Macro Recorder";
+ Text [english_us] = "Macro Recorder";
+*/
+};
+
+ToolBox RID_RECORDINGTOOLBOX
+{
+ HelpId = HID_RECORDINGTOOLBOX ;
+ ButtonType = BUTTON_SYMBOL ;
+ LineSpacing = TRUE ;
+ Border = TRUE ;
+ Scroll = TRUE ;
+ SVLook = TRUE ;
+ Moveable = TRUE ;
+ Sizeable = TRUE ;
+ Closeable = FALSE ;
+ Zoomable = TRUE ;
+ Customize = FALSE ;
+ FloatingMode = TRUE ;
+ Hide = TRUE ;
+ _FloatingPosMapMode = MAP_APPFONT ;
+ _FloatingPosX = -50 ;
+ _FloatingPosY = -70 ;
+ FloatingLines = 1 ;
+ HideWhenDeactivate = TRUE ;
+ Align = BOXALIGN_TOP ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_RECORDMACRO ;
+ };
+ };
+};
+
+String STR_EVENT_NEWMESSAGE
+{
+ Text = "Nachricht eingetroffen" ;
+ Text [ ENGLISH ] = "Message arrived" ;
+ Text [ english_us ] = "Message received" ;
+ Text [ portuguese_brazilian ] = "Nachricht eingetroffen" ;
+ Text [ swedish ] = "Meddelande har kommit" ;
+ Text [ danish ] = "Modtaget meddelelse" ;
+ Text [ italian ] = "Messaggio arrivato" ;
+ Text [ spanish ] = "Mensaje recibido" ;
+ Text [ french ] = "Message reu" ;
+ Text [ dutch ] = "Bericht ontvangen" ;
+ Text [ portuguese ] = "Mensagem recebida" ;
+ Text[ chinese_simplified ] = "µĵʼ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nadesza wiadomo";
+ Text[ japanese ] = "үނ̎M";
+ Text[ chinese_traditional ] = "sqll";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Bericht ontvangen";
+ Text[ chinese_simplified ] = "µĵʼ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "޼ ŵǾϴ.";
+ Text[ turkish ] = "leti alnd";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_STARTAPP
+{
+ Text = "Programmstart" ;
+ Text [ ENGLISH ] = "Start Application" ;
+ Text [ norwegian ] = "Start Applikasjon" ;
+ Text [ italian ] = "Avvia applicazione" ;
+ Text [ portuguese_brazilian ] = "Incio Aplicativo" ;
+ Text [ portuguese ] = "Iniciar programa" ;
+ Text [ finnish ] = "Start Application" ;
+ Text [ danish ] = "Programstart" ;
+ Text [ french ] = "Lancer l'application" ;
+ Text [ swedish ] = "Programstart" ;
+ Text [ dutch ] = "Programma starten" ;
+ Text [ spanish ] = "Iniciar aplicacin" ;
+ Text [ ENGLISH_US ] = "Start Application" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Pocztek programu";
+ Text[ japanese ] = "۸т̊Jn";
+ Text[ chinese_traditional ] = "Ұʵ{";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Programma starten";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = " ";
+ Text[ korean ] = "α׷ ";
+ Text[ turkish ] = "Program altr";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_ONERROR
+{
+ Text = "Javascript-Laufzeitfehler" ;
+ Text [ ENGLISH ] = "Javascript runtime error" ;
+ Text [ english_us ] = "JavaScript runtime error" ;
+ Text [ portuguese_brazilian ] = "Programm- / Ausfhrungsfehler" ;
+ Text [ swedish ] = "Javascript runtime error" ;
+ Text [ danish ] = "JavaScript-runtimefejl" ;
+ Text [ italian ] = "Errore di runtime JavaScript" ;
+ Text [ spanish ] = "Error de ejecucin Javascript" ;
+ Text [ french ] = "Runtime error JavaScript" ;
+ Text [ dutch ] = "Javascript runtime error" ;
+ Text [ portuguese ] = "Erro na execuo de JavaScript" ;
+ Text[ chinese_simplified ] = "Javascript-ʱ";
+ Text[ russian ] = " Javascript";
+ Text[ polish ] = "Bd czasu przeb. w Javascript";
+ Text[ japanese ] = "JavaScript runtime װ\\̎";
+ Text[ chinese_traditional ] = "Javascript Bɶ~";
+ Text[ arabic ] = " JavaScript ";
+ Text[ dutch ] = "Javascript runtime error";
+ Text[ chinese_simplified ] = "Javascript-ʱ";
+ Text[ greek ] = " . JavaScript";
+ Text[ korean ] = "JavaScript Ÿ ";
+ Text[ turkish ] = "Javascript yrtm sresi hatas";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_CLOSEAPP
+{
+ Text = "Programmende" ;
+ Text [ ENGLISH ] = "Close Application" ;
+ Text [ norwegian ] = "Lukk Applikasjon" ;
+ Text [ italian ] = "Chiudi applicazione" ;
+ Text [ portuguese_brazilian ] = "Fechar Aplicativo" ;
+ Text [ portuguese ] = "Sair do programa" ;
+ Text [ finnish ] = "Close Application" ;
+ Text [ danish ] = "Luk programmet" ;
+ Text [ french ] = "Fermer l'application" ;
+ Text [ swedish ] = "Programslut" ;
+ Text [ dutch ] = "Programma beindigen" ;
+ Text [ spanish ] = "Cerrar aplicacin" ;
+ Text [ ENGLISH_US ] = "Close Application" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Koniec programu";
+ Text[ japanese ] = "۸яI";
+ Text[ chinese_traditional ] = "{";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Programma beindigen";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = " ";
+ Text[ korean ] = "α׷ ݱ";
+ Text[ turkish ] = "Programdan k";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_CREATEDOC
+{
+ Text = "Dokument erzeugen" ;
+ Text [ ENGLISH ] = "Create Document" ;
+ Text [ norwegian ] = "Lag Dokument" ;
+ Text [ italian ] = "Crea documento" ;
+ Text [ portuguese_brazilian ] = "Criar Documento" ;
+ Text [ portuguese ] = "Criar documento" ;
+ Text [ finnish ] = "Create Document" ;
+ Text [ danish ] = "Opret dokument" ;
+ Text [ french ] = "Crer le document" ;
+ Text [ swedish ] = "Skapa dokument" ;
+ Text [ dutch ] = "Document maken" ;
+ Text [ spanish ] = "Crear documento" ;
+ Text [ ENGLISH_US ] = "Create Document" ;
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Utwrz dokument";
+ Text[ japanese ] = "޷Ă̍쐬";
+ Text[ chinese_traditional ] = "إߤ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document maken";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Belge olutur";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_CLOSEDOC
+{
+ Text = "Dokument wird geschlossen" ;
+ Text [ ENGLISH ] = "Document closes" ;
+ Text [ ENGLISH_US ] = "Close Document" ;
+ Text [ portuguese_brazilian ] = "Close Document" ;
+ Text [ swedish ] = "Dokumentet stngs" ;
+ Text [ danish ] = "Programmet lukkes" ;
+ Text [ italian ] = "Il documento viene chiuso" ;
+ Text [ spanish ] = "El documento se va a cerrar" ;
+ Text [ french ] = "Le document va tre ferm" ;
+ Text [ dutch ] = "Document sluiten" ;
+ Text [ portuguese ] = "Fechar documento" ;
+ Text[ chinese_simplified ] = "ڹرĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zamknij dokument";
+ Text[ japanese ] = "޷Â鎞";
+ Text[ chinese_traditional ] = "{b";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document sluiten";
+ Text[ chinese_simplified ] = "ڹرĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ݱ";
+ Text[ turkish ] = "Belgeyi kapat";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_PREPARECLOSEDOC
+{
+ Text = "Dokument schlieen" ;
+ Text [ ENGLISH ] = "Close Document" ;
+ Text [ norwegian ] = "Close Document" ;
+ Text [ italian ] = "Chiudi documento" ;
+ Text [ portuguese_brazilian ] = "Close Document" ;
+ Text [ portuguese ] = "Fechar documento" ;
+ Text [ french ] = "Fermer le document" ;
+ Text [ dutch ] = "Document sluiten" ;
+ Text [ spanish ] = "Cerrar documento" ;
+ Text [ danish ] = "Luk dokument" ;
+ Text [ swedish ] = "Stng dokument" ;
+ Text [ finnish ] = "Close Document" ;
+ Text [ ENGLISH_US ] = "Close Document" ;
+ Text[ chinese_simplified ] = "رĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zamknij dokument";
+ Text[ japanese ] = "޷Â";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document sluiten";
+ Text[ chinese_simplified ] = "رĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ݱ";
+ Text[ turkish ] = "Belgeyi kapat";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_OPENDOC
+{
+ Text = "Dokument ffnen" ;
+ Text [ ENGLISH ] = "Open Document" ;
+ Text [ norwegian ] = "pne Dokument" ;
+ Text [ italian ] = "Apri documento" ;
+ Text [ portuguese_brazilian ] = "Abrir Documento" ;
+ Text [ portuguese ] = "Abrir documento" ;
+ Text [ finnish ] = "Open Document" ;
+ Text [ danish ] = "bn dokument" ;
+ Text [ french ] = "Ouvrir un document" ;
+ Text [ swedish ] = "ppna dokument" ;
+ Text [ dutch ] = "Document openen" ;
+ Text [ spanish ] = "Abrir documento" ;
+ Text [ ENGLISH_US ] = "Open Document" ;
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Otwrz dokument";
+ Text[ japanese ] = "޷ĂJ";
+ Text[ chinese_traditional ] = "}Ҥ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document openen";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Belge a";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_SAVEDOC
+{
+ Text = "Dokument sichern" ;
+ Text [ ENGLISH ] = "Save Document" ;
+ Text [ norwegian ] = "Save Document" ;
+ Text [ italian ] = "Salva documento" ;
+ Text [ portuguese_brazilian ] = "Save Document" ;
+ Text [ portuguese ] = "Guardar documento" ;
+ Text [ french ] = "Sauvegarder le document" ;
+ Text [ dutch ] = "Document opslaan" ;
+ Text [ spanish ] = "Guardar documento" ;
+ Text [ danish ] = "Gem dokument" ;
+ Text [ swedish ] = "Spara dokument" ;
+ Text [ finnish ] = "Save Document" ;
+ Text [ ENGLISH_US ] = "Save Document" ;
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz dokument";
+ Text[ japanese ] = "޷Ă̕ۑ";
+ Text[ chinese_traditional ] = "Os";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document opslaan";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Belgeyi kaydet";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_SAVEASDOC
+{
+ Text = "Dokument sichern als" ;
+ Text [ ENGLISH ] = "Save Document As" ;
+ Text [ norwegian ] = "Save Document As" ;
+ Text [ italian ] = "Salva documento con nome" ;
+ Text [ portuguese_brazilian ] = "Save Document As" ;
+ Text [ portuguese ] = "Guardar como" ;
+ Text [ french ] = "Sauvegarder le document sous" ;
+ Text [ dutch ] = "Document opslaan als" ;
+ Text [ spanish ] = "Guardar documento como" ;
+ Text [ danish ] = "Gem dokument som" ;
+ Text [ swedish ] = "Spara dokument som" ;
+ Text [ finnish ] = "Save Document As" ;
+ Text [ ENGLISH_US ] = "Save Document As" ;
+ Text[ chinese_simplified ] = "ĵΪ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz dokument jako";
+ Text[ japanese ] = "޷ĂɖOtĕۑ鎞";
+ Text[ chinese_traditional ] = "ts";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document opslaan als";
+ Text[ chinese_simplified ] = "ĵΪ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ٸ̸ ";
+ Text[ turkish ] = "Belgeyi farkl kaydet";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_SAVEDOCDONE
+{
+ Text = "Dokument wurde gesichert" ;
+ Text [ ENGLISH ] = "Document was saved" ;
+ Text [ ENGLISH_US ] = "Document has been saved" ;
+ Text[ portuguese ] = "O documento foi guardado";
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ dutch ] = "Document is opgeslagen";
+ Text[ french ] = "Le document a bien t enregistr";
+ Text[ spanish ] = "El documento se guard";
+ Text[ italian ] = "Il documento stato salvato";
+ Text[ danish ] = "Dokumentet er blevet gemt";
+ Text[ swedish ] = "Dokument har sparats";
+ Text[ polish ] = "Dokument zapisany";
+ Text[ portuguese_brazilian ] = "Document was saved";
+ Text[ japanese ] = "޷Ăۑꂽ";
+ Text[ korean ] = " Ǿϴ.";
+ Text[ chinese_simplified ] = "ĵѾ";
+ Text[ chinese_traditional ] = "wgxs";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "Belge kaydedildi";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_SAVEASDOCDONE
+{
+ Text = "Dokument wurde gesichert als" ;
+ Text [ ENGLISH ] = "Document was saved as" ;
+ Text [ ENGLISH_US ] = "Document has been saved as" ;
+ Text[ portuguese ] = "O documento foi guardado como";
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ dutch ] = "Document is opgeslagen als";
+ Text[ french ] = "Le document a t enregistr en tant que";
+ Text[ spanish ] = "El documento se guard como";
+ Text[ italian ] = "Il documento stato salvato con il nome";
+ Text[ danish ] = "Dokumentet er blevet gemt som";
+ Text[ swedish ] = "Dokument har sparats som";
+ Text[ polish ] = "Dokument zapisany jako";
+ Text[ portuguese_brazilian ] = "Document was saved as";
+ Text[ japanese ] = "޷ĂɖOtĕۑ";
+ Text[ korean ] = " ̸ Ǿϴ";
+ Text[ chinese_simplified ] = "ĵѾΪ";
+ Text[ chinese_traditional ] = "wgxs";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "Belge farkl kaydedildi";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_ACTIVATEDOC
+{
+ Text = "Dokument aktivieren" ;
+ Text [ ENGLISH ] = "Activate Document" ;
+ Text [ norwegian ] = "Activate Document" ;
+ Text [ italian ] = "Attiva documento" ;
+ Text [ portuguese_brazilian ] = "Activate Document" ;
+ Text [ portuguese ] = "Activar documento" ;
+ Text [ french ] = "Activer document" ;
+ Text [ dutch ] = "Document activeren" ;
+ Text [ spanish ] = "Activar documento" ;
+ Text [ danish ] = "Aktiver dokument" ;
+ Text [ swedish ] = "Aktivera dokument" ;
+ Text [ finnish ] = "Activate Document" ;
+ Text [ ENGLISH_US ] = "Activate Document" ;
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Uaktywnij dokument";
+ Text[ japanese ] = "޷Ăèނɂ";
+ Text[ chinese_traditional ] = "E";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document activeren";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " Ȱȭ";
+ Text[ turkish ] = "Belgeyi etkinletir";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_DEACTIVATEDOC
+{
+ Text = "Dokument deaktivieren" ;
+ Text [ ENGLISH ] = "Deactivate Document" ;
+ Text [ norwegian ] = "Deactivate Document" ;
+ Text [ italian ] = "Disattiva documento" ;
+ Text [ portuguese_brazilian ] = "Deactivate Document" ;
+ Text [ portuguese ] = "Desactivar documento" ;
+ Text [ french ] = "Dsactiver le document" ;
+ Text [ dutch ] = "Document deactiveren" ;
+ Text [ spanish ] = "Desactivar documento" ;
+ Text [ danish ] = "Deaktiver dokument" ;
+ Text [ swedish ] = "Deaktivera dokument" ;
+ Text [ finnish ] = "Deactivate Document" ;
+ Text [ ENGLISH_US ] = "Deactivate Document" ;
+ Text[ chinese_simplified ] = "ʧĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Dezaktywuj dokument";
+ Text[ japanese ] = "޷Ăèނɂ";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document deactiveren";
+ Text[ chinese_simplified ] = "ʧĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " Ȱȭ";
+ Text[ turkish ] = "Belgeyi devreden kart";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EVENT_PRINTDOC
+{
+ Text = "Dokument drucken" ;
+ Text [ ENGLISH ] = "Print Document" ;
+ Text [ english_us ] = "Print Document" ;
+ Text [ italian ] = "Stampa documento" ;
+ Text [ spanish ] = "Imprimir documento" ;
+ Text [ french ] = "Imprimer le document" ;
+ Text [ dutch ] = "Document afdrukken" ;
+ Text [ swedish ] = "Skriv ut dokument" ;
+ Text [ danish ] = "Udskriv dokument" ;
+ Text [ portuguese_brazilian ] = "Dokument drucken" ;
+ Text [ portuguese ] = "Imprimir documento" ;
+ Text[ chinese_simplified ] = "ӡĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Drukuj dokument";
+ Text[ japanese ] = "޷Ă̈";
+ Text[ chinese_traditional ] = "CL";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document afdrukken";
+ Text[ chinese_simplified ] = "ӡĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " μ";
+ Text[ turkish ] = "Belgeyi yazdr";
+ Text[ language_user1 ] = " ";
+};
+
+
+String STR_ERR_NOTEMPLATE
+{
+ Text = "Die Vorlage hat ein falsches Format" ;
+ Text [ ENGLISH ] = "Chosen template has wrong format" ;
+ Text [ dutch ] = "De geselecteerde sjabloon heeft een verkeerd formaat" ;
+ Text [ english_us ] = "The selected template has an incorrect format" ;
+ Text [ italian ] = "Il modello ha un formato errato" ;
+ Text [ spanish ] = "La plantilla tiene un formato incorrecto" ;
+ Text [ french ] = "Le format du modle est incorrect" ;
+ Text [ swedish ] = "Mallen har ett felaktigt format" ;
+ Text [ danish ] = "Skabelonen har et forkert format" ;
+ Text [ portuguese_brazilian ] = "Die Vorlage hat ein falsches Format" ;
+ Text [ portuguese ] = "O modelo seleccionado tem um formato errado" ;
+ Text[ chinese_simplified ] = "ʽʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Szablon ma nieprawidowy format";
+ Text[ japanese ] = "ڰĂ͏܂";
+ Text[ chinese_traditional ] = "˦榡~C";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "De geselecteerde sjabloon heeft een verkeerd formaat";
+ Text[ chinese_simplified ] = "ʽʽ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "õ øƮ ߸ ֽϴ.";
+ Text[ turkish ] = "Seilen ablonun format yanl";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_ERR_NOFILE
+{
+ Text = "Die Datei $ kann nicht geffnet werden." ;
+ Text [ ENGLISH ] = "Can't open file $." ;
+ Text [ dutch ] = "Het bestand $ kan niet worden geopend." ;
+ Text [ english_us ] = "Can't open file $." ;
+ Text [ italian ] = "Non possibile aprire il file $." ;
+ Text [ spanish ] = "El archivo $ no se puede abrir." ;
+ Text [ french ] = "Impossible d'ouvrir le fichier $ ." ;
+ Text [ swedish ] = "Filen $ kan inte ppnas." ;
+ Text [ danish ] = "Det er ikke muligt at bne filen $." ;
+ Text [ portuguese_brazilian ] = "Die Datei $ kann nicht geffnet werden." ;
+ Text [ portuguese ] = "Foi impossvel abrir o ficheiro $." ;
+ Text[ chinese_simplified ] = "޷ļ $ ";
+ Text[ russian ] = " $ .";
+ Text[ polish ] = "Plik $ nie moe zosta otworzony.";
+ Text[ japanese ] = "̧$͊JƂł܂B";
+ Text[ chinese_traditional ] = "Lk}ɮ $ C";
+ Text[ arabic ] = " $.";
+ Text[ dutch ] = "Het bestand $ kan niet worden geopend.";
+ Text[ chinese_simplified ] = "޷ļ $ ";
+ Text[ greek ] = " $.";
+ Text[ korean ] = " $ ϴ.";
+ Text[ turkish ] = "$ dosyas alamyor.";
+ Text[ language_user1 ] = " ";
+};
+
+
+String STR_QUITAPP
+{
+ Text = "~Beenden" ;
+ Text [ ENGLISH ] = "E~xit" ;
+ Text [ english_us ] = "E~xit" ;
+ Text [ italian ] = "~Esci" ;
+ Text [ spanish ] = "~Terminar" ;
+ Text [ french ] = "~Quitter" ;
+ Text [ dutch ] = "~Beindigen" ;
+ Text [ swedish ] = "A~vsluta" ;
+ Text [ danish ] = "Afslut" ;
+ Text [ portuguese_brazilian ] = "~Beenden" ;
+ Text [ portuguese ] = "~Sair" ;
+ Text[ chinese_simplified ] = "(~X)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Za~kocz";
+ Text[ japanese ] = "I(~X)";
+ Text[ chinese_traditional ] = "(~X)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Beindigen";
+ Text[ chinese_simplified ] = "(~X)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~X)";
+ Text[ turkish ] = "~k";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EXITANDRETURN
+{
+ Text = "~Beenden & zurck zu " ;
+ Text [ ENGLISH ] = "E~xit & return to " ;
+ Text [ dutch ] = "~Beindigen & terug naar " ;
+ Text [ english_us ] = "E~xit & return to " ;
+ Text [ italian ] = "~Esci e ritorna a " ;
+ Text [ spanish ] = "~Terminar y regresar a " ;
+ Text [ french ] = "~Quitter & retourner " ;
+ Text [ swedish ] = "~Avsluta och tillbaka till " ;
+ Text [ danish ] = "Afslut og g tilbage til " ;
+ Text [ portuguese_brazilian ] = "~Beenden & zurck zu " ;
+ Text [ portuguese ] = "~Sair & Regressar a " ;
+ Text[ chinese_simplified ] = "ͷ(~X)";
+ Text[ russian ] = " & ";
+ Text[ polish ] = "Zakocz & Powr do ";
+ Text[ japanese ] = "I&߂(~X)";
+ Text[ chinese_traditional ] = "M^(~X)";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "~Beindigen & terug naar ";
+ Text[ chinese_simplified ] = "ͷ(~X)";
+ Text[ greek ] = "~ ";
+ Text[ korean ] = " & ư (~X)";
+ Text[ turkish ] = "~k ve dn: ";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EXTHELPSTATUS
+{
+ Text = "Whlen Sie einen Befehl oder klicken Sie, um ein Thema auszuwhlen." ;
+ Text [ English ] = "Select a command or click for a overview." ;
+ Text [ english_us ] = "Select a command or click to select a theme." ;
+ Text [ italian ] = "Scegliete un comando o cliccate per scegliere un argomento." ;
+ Text [ spanish ] = "Seleccione un comando o pulse para seleccionar un tema." ;
+ Text [ french ] = "Slectionnez une commande ou cliquez pour choisir une rubrique." ;
+ Text [ dutch ] = "Kies een optie of klik om een onderwerp te kiezen." ;
+ Text [ swedish ] = "Vlj ett kommando eller klicka fr att vlja ett tema." ;
+ Text [ danish ] = "Vlg en kommando eller klik for udvlge et emne." ;
+ Text [ portuguese_brazilian ] = "Whlen Sie einen Befehl oder klicken Sie, um ein Thema auszuwhlen." ;
+ Text [ portuguese ] = "Seleccione um comando ou clique para escolher um tema." ;
+ Text[ chinese_simplified ] = "ѡ߰һѡһ⡣";
+ Text[ russian ] = " .";
+ Text[ polish ] = "Wybierz polecenie lub kliknij, by wybra temat.";
+ Text[ japanese ] = "ނIԂ ܂ðςI邽߂ɸدĉB";
+ Text[ chinese_traditional ] = "бzܩΪ̫@өROMܤ@ӥDDC";
+ Text[ arabic ] = " ѡ ѡ .";
+ Text[ dutch ] = "Kies een optie of klik om een onderwerp te kiezen.";
+ Text[ chinese_simplified ] = "ѡ߰һѡһ⡣";
+ Text[ greek ] = " .";
+ Text[ korean ] = "ɾ ϰų õ ŬϽʽÿ.";
+ Text[ turkish ] = "Bir komut sein ya da bir konu semek iin tklayn.";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_MAIL
+{
+ Text = "Post" ;
+ Text [ English ] = "Mail" ;
+ Text [ norwegian ] = "Mail" ;
+ Text [ italian ] = "Posta" ;
+ Text [ portuguese_brazilian ] = "Correio" ;
+ Text [ portuguese ] = "Correio" ;
+ Text [ finnish ] = "Shkposti" ;
+ Text [ danish ] = "Post" ;
+ Text [ french ] = "Courrier" ;
+ Text [ swedish ] = "Post" ;
+ Text [ dutch ] = "Post" ;
+ Text [ spanish ] = "Correo" ;
+ Text [ english_us ] = "Mail" ;
+ Text[ chinese_simplified ] = "ʼ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Poczta";
+ Text[ japanese ] = "Ұ";
+ Text[ chinese_traditional ] = "qll";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Post";
+ Text[ chinese_simplified ] = "ʼ";
+ Text[ greek ] = "";
+ Text[ korean ] = "ڿ";
+ Text[ turkish ] = "Posta";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_ADDRESS_NAME
+{
+ TEXT = "Adressen" ;
+ Text [ English ] = "Address" ;
+ Text [ english_us ] = "Addresses" ;
+ Text [ dutch ] = "Adressen" ;
+ Text [ italian ] = "Indirizzi" ;
+ Text [ spanish ] = "Direcciones" ;
+ Text [ french ] = "Adresses" ;
+ Text [ swedish ] = "Adresser" ;
+ Text [ danish ] = "Adresser" ;
+ Text [ portuguese_brazilian ] = "Adressen" ;
+ Text [ portuguese ] = "Endereos" ;
+ Text[ chinese_simplified ] = "ַ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Adresy";
+ Text[ japanese ] = "ڽ";
+ Text[ chinese_traditional ] = "a}";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Adressen";
+ Text[ chinese_simplified ] = "ַ";
+ Text[ greek ] = "";
+ Text[ korean ] = "ּ";
+ Text[ turkish ] = "Adres";
+ Text[ language_user1 ] = " ";
+};
+
+String RID_STR_HELP
+{
+ TEXT = "Hilfe" ;
+ TEXT [ english ] = "help" ;
+ Text [ portuguese ] = "Ajuda" ;
+ Text [ english_us ] = "Help" ;
+ Text [ portuguese_brazilian ] = "Hilfe" ;
+ Text [ swedish ] = "Hjlp" ;
+ Text [ danish ] = "Hjlp" ;
+ Text [ italian ] = "Guida" ;
+ Text [ spanish ] = "Ayuda" ;
+ Text [ french ] = "Aide" ;
+ Text [ dutch ] = "Help" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Pomoc";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Help";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Yardm";
+ Text[ language_user1 ] = " ";
+};
+
+String RID_STR_NOAUTOSTARTHELPAGENT
+{
+ TEXT = "Bei 'XX' nicht automatisch starten" ;
+ TEXT [ English ] = "Bei 'XX' nicht automatisch starten" ;
+ Text [ english_us ] = "No automatic start at 'XX'" ;
+ Text [ portuguese_brazilian ] = "Bei ''XX'' nicht automatisch starten" ;
+ Text [ swedish ] = "Ingen automatisk start vid 'XX'" ;
+ Text [ danish ] = "Start ikke automatisk ved ''XX''" ;
+ Text [ italian ] = "Non avviare automaticamente con 'XX'" ;
+ Text [ spanish ] = "No iniciar automticamente con 'XX'" ;
+ Text [ french ] = "Ne pas lancer automatiquement pour la fonction 'XX'" ;
+ Text [ dutch ] = "Bij 'XX' niet automatisch starten" ;
+ Text [ portuguese ] = "No iniciar 'XX' automaticamente." ;
+ Text[ chinese_simplified ] = " 'XX' ʱԶС";
+ Text[ russian ] = " 'XX'";
+ Text[ polish ] = "Przy 'XX' nie startuj automatycznie";
+ Text[ japanese ] = "'XX'ŎIɊJnȂB";
+ Text[ chinese_traditional ] = "b 'XX' ɤ۰ʹBC";
+ Text[ arabic ] = " 'XX'";
+ Text[ dutch ] = "Bij 'XX' niet automatisch starten";
+ Text[ chinese_simplified ] = " 'XX' ʱԶС";
+ Text[ greek ] = " 'XX'";
+ Text[ korean ] = "'XX' ڵ ȵ˴ϴ.";
+ Text[ turkish ] = "'XX' olduunda otomatik balatma yaplmasn";
+ Text[ language_user1 ] = " ";
+};
+
+String RID_STR_NOWELCOMESCREEN
+{
+ TEXT = "Tipps nicht mehr anzeigen" ;
+ TEXT [ English ] = "Tips nicht mehr anzeigen" ;
+ Text [ english_us ] = "Don't display tips" ;
+ Text [ portuguese_brazilian ] = "Tips nicht mehr anzeigen" ;
+ Text [ swedish ] = "Visa inte tips mer" ;
+ Text [ danish ] = "Vis ikke flere tip" ;
+ Text [ italian ] = "Non mostrare pi i suggerimenti" ;
+ Text [ spanish ] = "No mostrar ms las sugerencias" ;
+ Text [ french ] = "Ne plus afficher les astuces" ;
+ Text [ dutch ] = "Tips niet meer weergeven" ;
+ Text [ portuguese ] = "No mostrar sugestes" ;
+ Text[ chinese_simplified ] = "ʾʾ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nie wywietlaj porad";
+ Text[ japanese ] = "Ă\\Ȃ";
+ Text[ chinese_traditional ] = "nAܴ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Tips niet meer weergeven";
+ Text[ chinese_simplified ] = "ʾʾ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ǥ ";
+ Text[ turkish ] = "neri grntleme";
+ Text[ language_user1 ] = " ";
+};
+
+String RID_HELPBAR
+{
+ TEXT = "Hilfe-Leiste" ;
+ TEXT [ English ] = "Hilfe-Leiste" ;
+ Text [ portuguese ] = "Barra da Ajuda" ;
+ Text [ english_us ] = "Help Bar" ;
+ Text [ portuguese_brazilian ] = "Hilfe-Leiste" ;
+ Text [ swedish ] = "Hjlplist" ;
+ Text [ danish ] = "Hjlp-linje" ;
+ Text [ italian ] = "Barra della Guida" ;
+ Text [ spanish ] = "Barra de ayuda" ;
+ Text [ french ] = "Barre de l'aide" ;
+ Text [ dutch ] = "Helpbalk" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Pasek pomocy";
+ Text[ japanese ] = " ް";
+ Text[ chinese_traditional ] = "C";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Helpbalk";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Yardm ubuu";
+ Text[ language_user1 ] = " ";
+};
+
+ToolBox RID_HELPBAR
+{
+ HelpId = HID_HELPBAR ;
+ Hide = TRUE ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_INDEX ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_HELPFILEBOX ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_ZOOMOUT;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_ZOOMIN;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_SEARCH ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_BOOKMARK ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_ANNOTATE ;
+ };
+ /*
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HELP_DOWNLOAD ;
+ };
+*/
+ };
+};
+
+String RID_STR_HLPFILENOTEXIST
+{
+ TEXT = "Es ist zu diesem Thema keine Hilfe installiert." ;
+ TEXT [ english ] = "Es ist zu diesem Thema keine Hilfe installiert." ;
+ Text [ english_us ] = "The help file for this topic is not installed." ;
+ Text [ portuguese_brazilian ] = "Die Hilfedatei 'XX' existiert nicht" ;
+ Text [ swedish ] = "Det finns ingen hjlp installerad fr detta mne." ;
+ Text [ danish ] = "Der er ikke installeret Hjlp til dette emne." ;
+ Text [ italian ] = "La Guida relativa a questo argomento non stata installata." ;
+ Text [ spanish ] = "El archivo de ayuda para este tema no ha sido instalado." ;
+ Text [ french ] = "Vous n'avez pas install l'aide correspondant ce sujet." ;
+ Text [ dutch ] = "Bij dit onderwerp werd geen Help genstalleerd." ;
+ Text [ portuguese ] = "O ficheiro de ajuda para este tpico no est instalado." ;
+ Text[ chinese_simplified ] = "ûаװйļ";
+ Text[ russian ] = " .";
+ Text[ polish ] = "Dla tego tematu nie zainstalowano pliku pomocy.";
+ Text[ japanese ] = "ðςɊւ߂ͲݽİقĂ܂B";
+ Text[ chinese_traditional ] = "SwoӥDDɮסC";
+ Text[ arabic ] = " .";
+ Text[ dutch ] = "Bij dit onderwerp werd geen Help genstalleerd.";
+ Text[ chinese_simplified ] = "ûаװйļ";
+ Text[ greek ] = " .";
+ Text[ korean ] = " ġ ʾҽϴ.";
+ Text[ turkish ] = "Bu konu ile ilgili yardm kurulmad.";
+ Text[ language_user1 ] = " ";
+};
+
+String RID_STR_HLPAPPNOTSTARTED
+{
+ TEXT = "Die Hilfeapplikation konnte nicht gestartet werden" ;
+ TEXT [ english ] = "The help application could not be started" ;
+ Text [ dutch ] = "De Help-applicatie kon niet worden opgestart" ;
+ Text [ english_us ] = "The help system could not be started" ;
+ Text [ italian ] = "Non stato possibile avviare l'applicazione ausiliaria" ;
+ Text [ spanish ] = "No se pudo iniciar la aplicacin de ayuda." ;
+ Text [ french ] = "Impossible de lancer l'application d'aide" ;
+ Text [ swedish ] = "Hjlptillmpningen kunde inte startas" ;
+ Text [ danish ] = "Det var ikke muligt at starte Hjlp-applikationen" ;
+ Text [ portuguese ] = "Foi impossvel iniciar o sistema de ajuda." ;
+ Text [ portuguese_brazilian ] = "Die Hilfeapplikation konnte nicht gestartet werden" ;
+ Text[ chinese_simplified ] = "޷Ӧó";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Systemu pomocy nie mona byo uruchomi";
+ Text[ japanese ] = "߱ع݂Jnł܂ł";
+ Text[ chinese_traditional ] = "LkҰʻε{C";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "De Help-applicatie kon niet worden opgestart";
+ Text[ chinese_simplified ] = "޷Ӧó";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ý ۵ ʾҽϴ.";
+ Text[ turkish ] = "Yardm uygulamas balatlamad";
+ Text[ language_user1 ] = " ";
+};
+
+ //----------------------------------------------------------------------------
+
+String RID_ENVTOOLBOX
+{
+ TEXT = "Funktionsleiste" ;
+ TEXT [ english ] = "Function bar" ;
+ Text [ dutch ] = "Werkbalk" ;
+ Text [ english_us ] = "Function Bar" ;
+ Text [ italian ] = "Barra delle funzioni" ;
+ Text [ spanish ] = "Barra de funciones" ;
+ Text [ french ] = "Barre de fonctions" ;
+ Text [ swedish ] = "Funktionslist" ;
+ Text [ danish ] = "Funktionslinje" ;
+ Text [ portuguese_brazilian ] = "Funktionsleiste" ;
+ Text [ portuguese ] = "Barra de funes" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Pasek funkcji";
+ Text[ japanese ] = "̧ݸ ް";
+ Text[ chinese_traditional ] = "uC";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Werkbalk";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "lev ubuu";
+ Text[ language_user1 ] = " ";
+};
+
+ToolBox RID_ENVTOOLBOX
+{
+ HelpId = RID_ENVTOOLBOX ;
+ ButtonType = BUTTON_SYMBOL ;
+ LineSpacing = TRUE ;
+ Border = TRUE ;
+ Scroll = TRUE ;
+ SVLook = TRUE ;
+ Dockable = TRUE ;
+ Moveable = TRUE ;
+ Sizeable = TRUE ;
+ Closeable = TRUE ;
+ Zoomable = TRUE ;
+ Customize = TRUE ;
+ FloatingMode = FALSE ;
+ Hide = TRUE ;
+ HideWhenDeactivate = TRUE ;
+ Align = BOXALIGN_TOP ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ Identifier = SID_TOPDOC ;
+ };
+/* ToolBoxItem
+ {
+ Identifier = SID_OPENURL ;
+ };*/
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+/* ToolBoxItem
+ {
+ Identifier = SID_BROWSE_BACKWARD ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_BROWSE_FORWARD ;
+ };*/
+ ToolBoxItem
+ {
+ Identifier = SID_BROWSE_STOP ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+/* ToolBoxItem
+ {
+ Identifier = SID_RELOAD ;
+ };*/
+ ToolBoxItem
+ {
+ Identifier = SID_EDITDOC ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_NEWDOC ;
+ Hide = TRUE;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_OPENDOC ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_SAVEDOC ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_SAVEASDOC ;
+ Hide = TRUE;
+ };
+/* ToolBoxItem
+ {
+ Identifier = SID_MAIL_SEND ;
+ };*/
+ ToolBoxItem
+ {
+ Identifier = SID_PRINTDOCDIRECT ;
+ };
+ ToolBoxItem
+ {
+ Identifier = FN_FAX ;
+ Hide = TRUE;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_CUT ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_COPY ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_PASTE ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_UNDO ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_REDO ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_NAVIGATOR ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_STYLE_DESIGNER ;
+ };
+ ToolBoxItem
+ {
+ Identifier = SID_HYPERLINK_DIALOG ;
+ };
+/* ToolBoxItem
+ {
+ Identifier = SID_HELP_PI ;
+ };*/
+ ToolBoxItem
+ {
+ Identifier = SID_WIN_FULLSCREEN ;
+ Hide = TRUE;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };
+/* ToolBoxItem
+ {
+ Identifier = SID_INTERNET_ONLINE ;
+ };
+ ToolBoxItem
+ {
+ Type = TOOLBOXITEM_SEPARATOR ;
+ };*/
+ ToolBoxItem
+ {
+ Identifier = SID_CLOSEDOC;
+ Hide = TRUE;
+ };
+ };
+};
+
+ // Image-Listen ----------------------------------------------------------
+
+#define IMAGE_ID_LIST\
+ IdList = {\
+ SID_OPENURL;\
+ SID_BROWSE_BACKWARD;\
+ SID_BROWSE_FORWARD;\
+ SID_BROWSE_STOP;\
+ SID_BROWSE_HOME;\
+ SID_RELOAD;\
+ SID_EDITDOC;\
+ SID_SAVEDOC;\
+ SID_SAVEDOCTOBOOKMARK;\
+ SID_CREATELINK;\
+ SID_MAIL_SEND;\
+ SID_PRINTDOCDIRECT;\
+ SID_CUT;\
+ SID_COPY;\
+ SID_UNDO;\
+ SID_REDO;\
+ SID_EXPLORER;\
+ SID_BROWSER;\
+ SID_NAVIGATOR;\
+ SID_STYLE_DESIGNER;\
+ SID_AUTOMAIL;\
+ SID_AUTOBROWSE;\
+ SID_EXPLORER_CREATEFOLDER;\
+ SID_EXPLORER_CREATEBOOKMARK;\
+ SID_EXPLORER_CREATEWORKPLACE;\
+ SID_EXPLORER_CREATELINK;\
+ SID_EXPLORER_CREATEMAILINTRAY;\
+ SID_EXPLORER_CREATENEWSSERVER;\
+ SID_EXPLORER_CREATEFTPSERVER;\
+ SID_EXPLORER_CREATEDATABASE;\
+ SID_EXPLORER_CREATEGALLERY;\
+ SID_PROPERTIES;\
+ SID_EXPLORER_MAKEROOT;\
+ SID_EXPLORER_MAKEBMKDIR;\
+ SID_EXPLORER_PREVLEVEL;\
+ SID_EXPLORER_IMPORTBOOKMARKS;\
+ SID_EDIT_FRAMESET;\
+ SID_SPLIT_HORIZONTAL;\
+ SID_SPLIT_VERTICAL;\
+ SID_SPLIT_PARENT_HORIZONTAL;\
+ SID_SPLIT_PARENT_VERTICAL;\
+ SID_MODIFY_FRAME;\
+ SID_EXPLORER_SEARCHORIGINAL;\
+ SID_EXPLORER_DETAILS;\
+ SID_EXPLORER_ICONS;\
+ };\
+ IdCount = {\
+ 45;\
+ };
+
+#ifndef IMAGE_STDBTN_COLOR
+#define IMAGE_STDBTN_COLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; }
+#endif
+
+ImageList RID_DEFAULTIMAGELIST_SC
+{
+ ImageBitmap = Bitmap { FILE = "sc_out.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+ IMAGE_ID_LIST
+};
+
+ImageList RID_DEFAULTIMAGELIST_LC
+{
+ ImageBitmap = Bitmap { FILE = "lc_out.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+ IMAGE_ID_LIST
+};
+
+String RID_SPECIALCONFIG_ERROR
+{
+ Text[ language_user1 ] = " "; \
+ Text = "In der Spezialkonfiguration wurde ein Fehler festgestellt.\nBitte wenden Sie sich an Ihren Administrator!" ;
+ Text [ English ] = "An error has occurred in the special configuration.\nPlease contact your administrator!" ;
+ Text [ portuguese ] = "Foi detectado um erro na configurao especial. Queira contactar o seu Administrador!" ;
+ Text [ english_us ] = "An error has occurred in the special configuration.\nPlease contact your administrator." ;
+ Text [ portuguese_brazilian ] = "In der Spezialkonfiguration wurde ein Fehler festgestellt. Bitte wenden Sie sich an Ihren Administrator!" ;
+ Text [ swedish ] = "Ett fel har upptckts i specialkonfigurationen.\nKontakta Din administratr!" ;
+ Text [ danish ] = "Der blev opdaget en fejl i specialkonfigurationen.\nHenvend dig venligst til din administrator!" ;
+ Text [ italian ] = "Nella configurazione speciale stato trovato un errore.\nRivolgetevi al vostro amministratore!" ;
+ Text [ spanish ] = "En la configuracin especial se ha detectado un error.\nPngase por favor en contacto con su administrador." ;
+ Text [ french ] = "Une erreur a t dtecte dans la configuration spciale.\nVeuillez consulter l'administrateur !" ;
+ Text [ dutch ] = "In de speciale configuratie is een fout opgetreden. Wendt u zich s.v.p. aan uw administrator!" ;
+ Text[ chinese_simplified ] = "һļڷһ\nĹԱϵ";
+ Text[ russian ] = " .\n, !";
+ Text[ polish ] = "W konfiguracji specjalnej stwierdzono bd.\nZwr si do swojego administratora!";
+ Text[ japanese ] = "ȐݒŴװ܂B\nƽڰɘAĂB";
+ Text[ chinese_traditional ] = "b@ӯStmɮפo{@ӿ~CЩM޲zpT";
+ Text[ arabic ] = " .\n !";
+ Text[ dutch ] = "In de speciale configuratie is een fout opgetreden. Wendt u zich s.v.p. aan uw administrator!";
+ Text[ chinese_simplified ] = "һļڷһ\nĹԱϵ";
+ Text[ greek ] = " .\n !";
+ Text[ korean ] = "Ư ߻Ǿϴ. ڿ Ͻñ ٶϴ !";
+ Text[ turkish ] = "zel konfigrasyonda bir hata bulundu.\nLtfen sistem yneticinize bavurun!";
+};
+
+
+String STR_MEMINFO_HEADER
+{
+ Text = "In der Applikation existieren derzeit $(TOTAL) Dokumente. Davon sind $(VISIBLE) Dokumente sichtbar. Im Memory Cache befinden sich $(CACHE) Dokumente.<BR><BR><b>Dokumente:</b><BR><table width=100%><tr><td >Sicht.</td><td>Cached</td><td>Exp.</td><td>Dirty</td><td>Exec</td><td>Forb</td><td>Dokumenttyp</td><td>URL</td><td>PreRedirect URL</td><td>Poststring</td></tr>" ;
+};
+
+String STR_MEMINFO_FOOTER
+{
+ Text = "</table>" ;
+};
+
+String STR_MEMINFO_OBJINFO
+{
+ Text = "<tr><td >$(VISIBLE)</td><td>$(CACHED)</td><td>$(EXPIRE)</td><td>$(JSDIRTY)</td><td>$(JSEXEC)</td><td>$(FORBID)</td><td>$(FACTORY)</td><td>$(URL)</td><td>$(ORIGURL)</td><td>$(POSTSTRING)</td></tr>" ;
+};
+
+String RID_PLUGIN
+{
+ Text = "PlugIn Aktivierung" ;
+ Text [ English ] = "PlugIn activation" ;
+ Text [ portuguese ] = "Activar PlugIn" ;
+ Text [ english_us ] = "Enable plug-ins" ;
+ Text [ portuguese_brazilian ] = "PlugIn Aktivierung" ;
+ Text [ swedish ] = "Aktivera PlugIn" ;
+ Text [ danish ] = "Aktiver PlugIns" ;
+ Text [ italian ] = "Attivazione PlugIn " ;
+ Text [ spanish ] = "Activar Plug-in" ;
+ Text [ french ] = "Activer Plug-In" ;
+ Text [ dutch ] = "PlugIn-activering" ;
+ Text[ chinese_simplified ] = " Plug-In";
+ Text[ russian ] = " Plug-In";
+ Text[ polish ] = "Wcz PlugIn";
+ Text[ japanese ] = "׸޲݂èނɂ";
+ Text[ chinese_traditional ] = "E Plug-In";
+ Text[ arabic ] = " Plug-In";
+ Text[ dutch ] = "PlugIn-activering";
+ Text[ chinese_simplified ] = " Plug-In";
+ Text[ greek ] = " PlugIn";
+ Text[ korean ] = "÷ ";
+ Text[ turkish ] = "Plug-In'leri etkinletir";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_EDITOBJECT
+{
+ Text = "~Bearbeiten";
+ Text [ English ] = "~Edit";
+ Text [ English_us ] = "~Edit";
+ Text[ portuguese ] = "~Editar";
+ Text[ russian ] = "";
+ Text[ dutch ] = "~Bewerken";
+ Text[ french ] = "~diter";
+ Text[ spanish ] = "~Editar";
+ Text[ italian ] = "~Modifica";
+ Text[ danish ] = "Rediger";
+ Text[ swedish ] = "~Redigera";
+ Text[ polish ] = "~Edytuj";
+ Text[ portuguese_brazilian ] = "~Edit";
+ Text[ japanese ] = "ҏW(~E)";
+ Text[ chinese_simplified ] = "༭(~E)";
+ Text[ chinese_traditional ] = "s(~E)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Bewerken";
+ Text[ chinese_simplified ] = "༭(~E)";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~E)";
+ Text[ turkish ] = "~Dzenle";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_OPENOBJECT
+{
+ Text = "~ffnen";
+ Text [ English ] = "~Open";
+ Text [ English_us ] = "~Open";
+ Text[ portuguese ] = "~Abrir";
+ Text[ russian ] = "";
+ Text[ dutch ] = "~Openen";
+ Text[ french ] = "~Ouvrir";
+ Text[ spanish ] = "~Abrir";
+ Text[ italian ] = "~Apri";
+ Text[ danish ] = "bn";
+ Text[ swedish ] = "~ppna";
+ Text[ polish ] = "Otwrz";
+ Text[ portuguese_brazilian ] = "~Open";
+ Text[ japanese ] = "J(~O)";
+ Text[ chinese_simplified ] = "(~O)";
+ Text[ chinese_traditional ] = "}ҷs(~O)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Openen";
+ Text[ chinese_simplified ] = "(~O)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~O)";
+ Text[ turkish ] = "~A";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_CORRUPT_INSTALLATION
+{
+ Text = "Wichtige Programmteile konnten nicht korrekt initialisiert werden.\nBitte starten sie Setup mit der Option /repair.";
+ Text [ English ] = "Important program components could not be initialized correctly. Please start the setup program with the option /repair.";
+ Text [ English_us ] = "Important program components could not be initialized correctly.\nPlease start the setup program with the option /Repair.";
+ Text[ portuguese ] = "Foi impossvel iniciar a importao dos componentes do programa correctamente.\nInicie o programa de instalao (Setup) com a opo /repair.";
+ Text[ greek ] = " .\n /repair..";
+ Text[ dutch ] = "Belangrijke programmaonderdelen konden niet correct worden genitialiseerd.\nStart het setup programma met de optie /Repareren.";
+ Text[ french ] = "Certains composants importants du programme n'ont pas pu tre initialiss. Veuillez activer le programme d'installation (Setup) et y activer l'option de rparation (Repair).";
+ Text[ spanish ] = "Algunos componentes importantes del programa no se pudieron instalar.\nInicie por favor el programa de instalacin con la opcin /repair.";
+ Text[ swedish ] = "Viktiga programdelar kunde inte initialiseras korrekt.\nVar vnlig och starta setupen med alternativet /repair.";
+ Text[ russian ] = " .\n, , /repair.";
+ Text[ italian ] = "Impossibile inizializzare importanti componenti del programma.\nAvviate il setup con l'opzione /Riparazione.";
+ Text[ danish ] = "Det var ikke muligt at initialisere vigtige programdele korrekt.\nStart venligst installationsprogrammet (Setup) med alternativet / reparation.";
+ Text[ polish ] = "Wane czci programu nie mogy zosta prawidowo zainstalowane.\nProsz uruchomi program instalacyjny uywajc opcji / repair";
+ Text[ portuguese_brazilian ] = "Important program components could not be initialized correctly. Please start the setup program with the option /repair.";
+ Text[ japanese ] = "؂۸т̕ɏ܂łB\nı߂߼/CŊJnĉB";
+ Text[ korean ] = "α׷ ߿ κ ʱȭ ߽ϴ. \nɼ/ Setup Ͻʽÿ.";
+ Text[ chinese_simplified ] = "޷ȷʼҪij̲\nװִѡ޲";
+ Text[ chinese_traditional ] = "Lk̪lƭn{CбzҰʦw˵{A`ﶵC";
+ Text[ arabic ] = " .\n /repair.";
+ Text[ turkish ] = "nemli program eleri doru bir ekilde balatlamad.\nKurulumu /repair seenei ile balatn.";
+};
+
+String IDS_SBERR_STOREREF
+{
+ Text = "Referenz wird nicht gespeichert: ";
+ Text [ italian ] = "Il riferimento non viene salvato: ";
+ Text [ portuguese_brazilian ] = "reference will not be saved: ";
+ Text [ portuguese ] = "A referncia no ser guardada: ";
+ Text [ danish ] = "Referencen bliver ikke gemt: ";
+ Text [ french ] = "Impossible d'enregistrer la rfrence : ";
+ Text [ swedish ] = "Referens sparas inte: ";
+ Text [ dutch ] = "Verwijzing wordt niet opgeslagen: ";
+ Text [ spanish ] = "No se guardar la referencia: ";
+ Text [ english_us ] = "Reference will not be saved: ";
+ Text[ chinese_simplified ] = "ᱣ ";
+ Text[ language_user1 ] = " ";
+ Text[ russian ] = " : ";
+ Text[ polish ] = "Odwoanie nie zostao zapisane: ";
+ Text[ japanese ] = "QƂ͕ۑ܂: ";
+ Text[ chinese_traditional ] = "xsѷӡG ";
+ Text[ arabic ] = " :";
+ Text[ dutch ] = "Verwijzing wordt niet opgeslagen: ";
+ Text[ chinese_simplified ] = "ᱣ ";
+ Text[ greek ] = " : ";
+ Text[ korean ] = " Դϴ: ";
+ Text[ turkish ] = "Referans kaydedilmeyecek: ";
+};
+
+ // ********************************************************************** EOF
+
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
new file mode 100644
index 000000000000..d429fb1d745f
--- /dev/null
+++ b/sfx2/source/appl/appbas.cxx
@@ -0,0 +1,1373 @@
+/*************************************************************************
+ *
+ * $RCSfile: appbas.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
+#include <com/sun/star/frame/XDesktop.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
+#include <unotools/processfactory.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+
+#ifndef _BASRDLL_HXX //autogen
+#include <basic/basrdll.hxx>
+#endif
+#ifndef _URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _SFXMACITEM_HXX //autogen
+#include <svtools/macitem.hxx>
+#endif
+#ifndef __SBX_SBX_FACTORY_HXX //autogen
+#include <svtools/sbxfac.hxx>
+#endif
+#ifndef _SBXCLASS_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#ifndef _SV_GRADIENT_HXX
+#include <vcl/gradient.hxx>
+#endif
+#ifndef _SFXRECTITEM_HXX //autogen
+#include <svtools/rectitem.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SB_SBMOD_HXX //autogen
+#include <basic/sbmod.hxx>
+#endif
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SB_SBMETH_HXX //autogen
+#include <basic/sbmeth.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SVTDEMO_HXX //autogen
+#include <svtools/svtdemo.hxx>
+#endif
+#ifndef _REGCODE_HXX
+//#include <tools/regcode.hxx>
+#endif
+#ifndef _SB_SBUNO_HXX
+#include <basic/sbuno.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "appuno.hxx"
+#include "module.hxx"
+#include "arrdecl.hxx"
+#include "app.hxx"
+#include "sfxtypes.hxx"
+#include "sfxresid.hxx"
+#include "msg.hxx"
+#include "msgpool.hxx"
+#include "progress.hxx"
+#include "objsh.hxx"
+#include "objitem.hxx"
+#include "viewfrm.hxx"
+#include "viewsh.hxx"
+#include "dispatch.hxx"
+#include "tplpitem.hxx"
+#include "minfitem.hxx"
+#include "app.hrc"
+#include "saveopt.hxx"
+#include "evntconf.hxx"
+#include "macrconf.hxx"
+#include "request.hxx"
+#include "docinf.hxx"
+#include "dinfdlg.hxx"
+#include "appdata.hxx"
+#include "appbas.hxx"
+#include "sfxhelp.hxx"
+#include "stbmgr.hxx"
+#include "appimp.hxx"
+#include "basmgr.hxx"
+#include "helper.hxx"
+
+#define ITEMID_SEARCH SID_SEARCH_ITEM
+
+#include "srchitem.hxx"
+#ifndef _VOS_SOCKET_HXX_ //autogen
+#include <vos/socket.hxx>
+#endif
+
+#define SFX_TYPEMAP
+#define Selection
+#include "sfxslots.hxx"
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+
+// #ifndef STR_VERSION_ID
+// #define STR_VERSION_ID 1
+// #endif
+// #ifndef STR_VERSION_TYPE
+// #define STR_VERSION_TYPE 1
+// #endif
+
+//=========================================================================
+/*ASDBG
+const SfxConstant __FAR_DATA aConstants[] =
+{
+ SFX_USHORT_CONSTANT( "AlignBottom", ALIGN_BOTTOM ),
+ SFX_USHORT_CONSTANT( "AlignTop", ALIGN_TOP ),
+ SFX_USHORT_CONSTANT( "CharSetANSI", CHARSET_ANSI ),
+ SFX_USHORT_CONSTANT( "CharSetDontKnow", CHARSET_DONTKNOW ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC437", CHARSET_IBMPC_437 ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC850", CHARSET_IBMPC_850 ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC860", CHARSET_IBMPC_860 ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC861", CHARSET_IBMPC_861 ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC863", CHARSET_IBMPC_863 ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC865", CHARSET_IBMPC_865 ),
+ SFX_USHORT_CONSTANT( "CharSetIBMPC", CHARSET_IBMPC ),
+ SFX_USHORT_CONSTANT( "CharSetMac", CHARSET_MAC ),
+ SFX_USHORT_CONSTANT( "CharSetSymbol", CHARSET_SYMBOL ),
+ SFX_USHORT_CONSTANT( "CharSetSystem", RTL_TEXTENCODING_UTF8 ),
+ SFX_USHORT_CONSTANT( "FamilyDecorative", FAMILY_DECORATIVE ),
+ SFX_USHORT_CONSTANT( "FamilyDontknow", FAMILY_DONTKNOW ),
+ SFX_USHORT_CONSTANT( "FamilyModern", FAMILY_MODERN ),
+ SFX_USHORT_CONSTANT( "FamilyRoman", FAMILY_ROMAN ),
+ SFX_USHORT_CONSTANT( "FamilyScript", FAMILY_SCRIPT ),
+ SFX_USHORT_CONSTANT( "FamilySwiss", FAMILY_SWISS ),
+ SFX_USHORT_CONSTANT( "FamilySystem", FAMILY_SYSTEM ),
+ SFX_USHORT_CONSTANT( "GradientAxial", GRADIENT_AXIAL ),
+ SFX_USHORT_CONSTANT( "GradientElliptical", GRADIENT_ELLIPTICAL ),
+ SFX_USHORT_CONSTANT( "GradientLinear", GRADIENT_LINEAR ),
+ SFX_USHORT_CONSTANT( "GradientRadial", GRADIENT_RADIAL ),
+ SFX_USHORT_CONSTANT( "GradientRect", GRADIENT_RECT ),
+ SFX_USHORT_CONSTANT( "GradientSquare", GRADIENT_SQUARE ),
+ SFX_USHORT_CONSTANT( "ItalicNone", ITALIC_NONE ),
+ SFX_USHORT_CONSTANT( "ItalicOblique", ITALIC_OBLIQUE ),
+ SFX_USHORT_CONSTANT( "StrikeThroughDouble", STRIKEOUT_DOUBLE ),
+ SFX_USHORT_CONSTANT( "StrikeThroughNone", STRIKEOUT_NONE ),
+ SFX_USHORT_CONSTANT( "StrikeThroughSingle", STRIKEOUT_SINGLE ),
+ SFX_USHORT_CONSTANT( "UnderlineDotted", UNDERLINE_DOTTED ),
+ SFX_USHORT_CONSTANT( "UnderlineDouble", UNDERLINE_DOUBLE ),
+ SFX_USHORT_CONSTANT( "UnderlineNone", UNDERLINE_NONE ),
+ SFX_USHORT_CONSTANT( "UnderlineSingle", UNDERLINE_SINGLE ),
+ SFX_USHORT_CONSTANT( "UnitFoot", FUNIT_FOOT ),
+ SFX_USHORT_CONSTANT( "UnitInch", FUNIT_INCH ),
+ SFX_USHORT_CONSTANT( "UnitMile", FUNIT_MILE ),
+ SFX_USHORT_CONSTANT( "UnitPercent", FUNIT_PERCENT ),
+ SFX_USHORT_CONSTANT( "UnitPoint", FUNIT_POINT ),
+ SFX_USHORT_CONSTANT( "UnitTwip", FUNIT_TWIP ),
+ SFX_USHORT_CONSTANT( "Unit_cm", FUNIT_CM ),
+ SFX_USHORT_CONSTANT( "Unit_m", FUNIT_M ),
+ SFX_USHORT_CONSTANT( "Unit_mm", FUNIT_MM ),
+ SFX_USHORT_CONSTANT( "WeightBlack", WEIGHT_BLACK ),
+ SFX_USHORT_CONSTANT( "WeightBold", WEIGHT_BOLD ),
+ SFX_USHORT_CONSTANT( "WeightDontKnow", WEIGHT_DONTKNOW ),
+ SFX_USHORT_CONSTANT( "WeightLight", WEIGHT_LIGHT ),
+ SFX_USHORT_CONSTANT( "WeightMedium", WEIGHT_MEDIUM ),
+ SFX_USHORT_CONSTANT( "WeightNormal", WEIGHT_NORMAL ),
+ SFX_USHORT_CONSTANT( "WeightSemibold", WEIGHT_SEMIBOLD ),
+ SFX_USHORT_CONSTANT( "WeightSemilight", WEIGHT_SEMILIGHT ),
+ SFX_USHORT_CONSTANT( "WeightThin", WEIGHT_THIN ),
+ SFX_USHORT_CONSTANT( "WeightUltrabold", WEIGHT_ULTRABOLD ),
+ SFX_USHORT_CONSTANT( "WeightUltralight", WEIGHT_ULTRALIGHT )
+};
+*/
+//========================================================================
+
+StarBASIC* SfxApplication::GetBasic_Impl() const
+{
+ return pImp->pBasicMgr ? pImp->pBasicMgr->GetLib(0) : NULL;
+}
+
+//------------------------------------------------------------------------
+String lcl_GetVersionString(ResMgr* pImpResMgr)
+{
+ ResId aVerId( RID_BUILDVERSION, pImpResMgr );
+ ResMgr *pResMgr = pImpResMgr->IsAvailable(
+ aVerId.SetRT( RSC_STRING ) )
+ ? pImpResMgr
+ : 0;
+ aVerId.SetResMgr( pResMgr );
+ if ( !Resource::GetResManager()->IsAvailable( aVerId ) )
+ DBG_ERROR( "No RID_BUILD_VERSION in label-resource-dll" );
+ String aVersion( aVerId );
+ aVersion.Erase( 0, aVersion.Search( ':' ) + 1 );
+ aVersion.Erase( aVersion.Search( ')' ) );
+ return aVersion;
+}
+
+//------------------------------------------------------------------------
+/*(mba)
+SbxObject* SfxSbxObjectFactory_Impl::CreateObject( const String &rType )
+{
+ if ( COMPARE_EQUAL == rType.CompareIgnoreCaseToAscii( "DocumentInfo" ) )
+ return new SfxDocumentInfoObject_Impl;
+ if ( COMPARE_EQUAL == rType.CompareIgnoreCaseToAscii( "Progress" ) )
+ return SfxProgress::CreateObject_Impl();
+ return 0;
+}*/
+
+//=========================================================================
+/*
+SfxSelectionObject::SfxSelectionObject
+(
+ SfxViewFrame *pFrame // ein Frame als Parent
+)
+
+// [Beschreibung]
+
+// interner Ctor f"ur Default-Behandlung
+
+
+: SfxShellSubObject( pFrame, SFX_TYPELIB_INFO(Selection), "Selection" ),
+ _pFrame( pFrame )
+{
+ SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE ); // unsichtbar
+}
+
+//-------------------------------------------------------------------------
+
+SfxSelectionObject::SfxSelectionObject
+(
+ SfxViewFrame *pFrame, // ein Frame als Parent
+ const String& rClassName,
+ const SfxTypeLibImpl &rTypeLibInfo
+)
+
+: SfxShellSubObject( pFrame, rClassName, rTypeLibInfo, "Selection" ),
+ _pFrame( pFrame )
+{
+ SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE ); // unsichtbar
+}
+
+//-------------------------------------------------------------------------
+
+SvDispatch* SfxSelectionObject::GetAggObject( sal_uInt16 nIdx )
+
+{
+ // selbst?
+ if ( 0 == nIdx )
+ return SfxShellSubObject::GetAggObject( 0 );
+
+ // die oberhalb der ::com::sun::star::sdbcx::View auf dem Dispatcher befindlichen Shells indizieren
+ SfxDispatcher *pDispat = _pFrame->GetDispatcher();
+ SfxShell *pSh = pDispat->GetShell( nIdx-1 );
+ if ( !pSh || pSh->ISA(SfxObjectShell) )
+ return 0;
+ return (SvDispatch*) pSh->GetSbxObject();
+}
+
+//-------------------------------------------------------------------------
+
+SbxVariable* SfxSelectionObject::Find
+(
+ const String& rName,
+ SbxClassType t
+)
+{
+ // einige Member selbst bedienen
+ String aName( rName.ToLowerAscii() );
+ if ( aName == "name" || aName == "classname" )
+ return SfxShellSubObject::Find( rName, t );
+
+ // nur die oberhalb der ::com::sun::star::sdbcx::View auf dem Dispatcher liegenden Shells durchsuchen
+ SfxDispatcher *pDispat = _pFrame->GetDispatcher();
+ pDispat->Flush();
+ SfxShell *pSh;
+ for ( sal_uInt16 n = 0;
+ ( pSh = pDispat->GetShell( n ) ) && !pSh->ISA(SfxViewFrame);
+ ++n )
+ {
+ SbxObject *pObj = pSh->GetSbxObject();
+ if ( pObj )
+ {
+ if ( ( t == SbxCLASS_DONTCARE || t == SbxCLASS_OBJECT ) &&
+ pObj->GetName() == rName )
+ return pObj;
+ else
+ {
+ SbxVariable *pRes = pObj->Find( rName, t );
+ if ( pRes )
+ return pRes;
+ }
+ }
+ }
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+SbxVariable* SfxSelectionObject::FindUserData
+(
+ sal_uInt32 nId
+)
+{
+ // nur die oberhalb der ::com::sun::star::sdbcx::View auf dem Dispatcher liegenden Shells durchsuchen
+ SfxDispatcher *pDispat = _pFrame->GetDispatcher();
+ SfxShell *pSh;
+ for ( sal_uInt16 n = 0;
+ ( pSh = pDispat->GetShell( n ) ) && !pSh->ISA(SfxViewFrame);
+ ++n )
+ {
+ SbxObject *pObj = pSh->GetSbxObject();
+ if ( pObj )
+ {
+ SbxVariable *pRes = pObj->FindUserData( nId );
+ if ( pRes )
+ return pRes;
+ }
+ }
+
+ return 0;
+}
+
+//=========================================================================
+
+class SfxConstants_Impl: public SbxObject
+{
+ const char* _pPrefix;
+ const SfxConstant* _pConsts;
+ sal_uInt16 _nCount;
+
+public:
+ SfxConstants_Impl( const char *pPrefix,
+ const SfxConstant *pConsts,
+ sal_uInt16 n );
+ SbxVariable* Find( const String& rName, SbxClassType t );
+};
+
+//-------------------------------------------------------------------------
+
+SfxConstants_Impl::SfxConstants_Impl
+(
+ const char* pPrefix,
+ const SfxConstant* pConsts,
+ sal_uInt16 nCount
+)
+: SbxObject( "Constants" ),
+ _pPrefix( pPrefix ),
+ _pConsts( pConsts ),
+ _nCount( nCount )
+{
+ SetFlag( SBX_EXTSEARCH | SBX_DONTSTORE ); // unsichtbar
+ SetName( String( (long) this ) ); // random
+}
+
+//-------------------------------------------------------------------------
+
+SbxVariable* SfxConstants_Impl::Find
+(
+ const String& rName,
+ SbxClassType t
+)
+{
+ // stimmt Typ und Prefix?
+ String aPrefix;
+ if ( _pPrefix )
+ aPrefix += _pPrefix;
+ if ( ( SbxCLASS_DONTCARE != t && SbxCLASS_PROPERTY != t ) ||
+ ( aPrefix.Len() && aPrefix.Len() != rName.Match( _pPrefix ) ) )
+ return 0;
+
+ // schon drin?
+ SbxVariable* pRes = SbxObject::Find( rName, t );
+ if( pRes )
+ return pRes;
+
+ // sonst suchen
+ String aSearched( rName );
+ aSearched.ToLowerAscii();
+ for ( sal_uInt16 n = 0; n < _nCount; ++n )
+ {
+ // gefunden?
+ const SfxConstant &rConst = _pConsts[n];
+ String aName( aPrefix );
+ aName += rConst.pName;
+ if ( aSearched == aName.ToLowerAscii() )
+ {
+ // on-demand erzeugen
+ SbxVariable *pVar = Make( aName, SbxCLASS_PROPERTY, rConst.eType );
+ switch ( rConst.eType )
+ {
+ case SbxUSHORT:
+ pVar->PutUShort( (sal_uInt16)(int) rConst.pData );
+ break;
+
+ case SbxCHAR:
+ pVar->PutChar( (char)(int) rConst.pData );
+ break;
+
+ case SbxBYTE:
+ pVar->PutByte( (sal_Int8)(int) rConst.pData );
+ break;
+
+ case SbxBOOL:
+ pVar->PutBool( (sal_Bool)(int) rConst.pData );
+ break;
+
+ case SbxINTEGER:
+ pVar->PutInteger( (short)(int) rConst.pData );
+ break;
+
+ case SbxLONG:
+ pVar->PutLong( (long) rConst.pData );
+ break;
+
+ case SbxUINT:
+ pVar->PutUShort( (sal_uInt16)(int) rConst.pData );
+ break;
+
+ case SbxULONG:
+ pVar->PutULong( (sal_uInt32) rConst.pData );
+ break;
+
+ case SbxLPSTR:
+ pVar->PutString( (char*) rConst.pData );
+ break;
+
+ default:
+ DBG_ERROR( "type of constant not supported" );
+ }
+
+ pVar->ResetFlag( SBX_WRITE );
+ pVar->SetFlag( SBX_CONST );
+ pVar->SetFlag( SBX_FIXED );
+ return pVar;
+ }
+ }
+
+ return 0;
+}
+*/
+//=========================================================================
+sal_uInt16 SfxApplication::SaveBasicManager() const
+{
+ // MT: #47347# AppBasicDir ist jetzt ein PATH!
+ // Ncht den vom BasicManager, falls inzwischen der Pfad geaendert wurde !?
+ // So wird natuerlich auch das erste Dir genommen, wenn der BasicManager
+ // vorher im zweiten gefunden wurde...
+ String aBasicPath( GetIniManager()->Get( SFX_KEY_BASIC_PATH ) );
+ INetURLObject aAppBasicObj( aBasicPath.GetToken(0), INET_PROT_FILE );
+ aAppBasicObj.insertName( Application::GetAppName() );
+ aAppBasicObj.setExtension( DEFINE_CONST_UNICODE( "sbl" ) );
+ String aAppBasicPath( aAppBasicObj.PathToFileName() );
+ SvStorageRef aStor = new SvStorage( aAppBasicPath );
+ if ( aStor->GetError() == 0 )
+ {
+ String aBaseURL = INetURLObject::GetBaseURL();
+ INetURLObject::SetBaseURL( aAppBasicObj.GetMainURL() );
+ pImp->pBasicMgr->Store( *aStor, NULL );
+ INetURLObject::SetBaseURL( aBaseURL );
+ }
+ if ( aStor->GetError() != 0 )
+ {
+ ErrorBox aBox(GetTopWindow(), SfxResId(MSG_ERR_WRITE_SBL));
+ String aMsg( SearchAndReplace( aBox.GetMessText(), 0x0040, aAppBasicPath ) ); // 40h = '@'
+ aBox.SetMessText( aMsg );
+ aBox.Execute();
+ }
+
+ return (sal_uInt16)aStor->GetError();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RegisterBasicConstants
+(
+ const char* pPrefix, // Prefix vor Konstanten-Namen
+ const SfxConstant* pConsts, // Array von <SfxConstant> Instanzen
+ sal_uInt16 nCount // Anahl der Kontanten in pConsts
+)
+
+/* [Beschreibung]
+
+ Diese Methode meldet Konstanten beim BASIC an. Sie sollte on-demand
+ (in GetSbxObject() der Applikation) gerufen werden. Das Array mu\s
+ alphabetisch nach den Namen sortiert sein!
+
+ Durch den Prefix kann Speicher gespart und das Suchen beschleunigt
+ werden. Im StarOffice soll der Prefix "so" verwendet werden.
+
+
+ [Beispiel]
+
+ const SfxConstant __FAR_DATA aConstants[] =
+ {
+ SFX_BOOL_CONSTANT( "False", sal_False ),
+ SFX_BOOL_CONSTANT( "True", sal_True ),
+ };
+
+ ...
+ SFX_APP()->RegisterBasicConstants( 0, aConstants, 2 );
+ ...
+
+*/
+
+{
+// DBG_ASSERT( pImp->pBasicMgr, "no basic available" );
+
+// pImp->pBasicMgr->GetLib(0)->Insert(
+// new SfxConstants_Impl( pPrefix, pConsts, nCount ) );
+}
+
+//--------------------------------------------------------------------
+
+SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject,
+ const char *pName, sal_uInt32 nSID, SbxDataType eType, SbxClassType eClassType )
+{
+ SbxVariable *pVar = pBas->Make( String::CreateFromAscii(pName), eClassType, eType ); //SbxCLASS_PROPERTY
+ pVar->SetUserData( nSID );
+ pVar->SetFlag( SBX_DONTSTORE );
+ pObject->StartListening( pVar->GetBroadcaster() );
+ return pVar;
+}
+
+//--------------------------------------------------------------------
+
+BasicManager* SfxApplication::GetBasicManager()
+{
+// DBG_ASSERT( pAppData_Impl->nBasicCallLevel != 0,
+// "unnecessary call to GetBasicManager() - inefficient!" );
+ if ( pAppData_Impl->nBasicCallLevel == 0 )
+ // sicherheitshalber
+ EnterBasicCall();
+
+ if ( !pImp->pBasicMgr )
+ {
+ // Directory bestimmen
+ SfxIniManager* pIniMgr = GetIniManager();
+ String aAppBasicDir( pIniMgr->Get( SFX_KEY_BASIC_PATH ) );
+ if ( !aAppBasicDir.Len() )
+ {
+ aAppBasicDir = pIniMgr->GetProgramPath();
+ pIniMgr->Set( aAppBasicDir, SFX_KEY_BASIC_PATH );
+ }
+
+ // #58293# soffice.new nur im ::com::sun::star::sdbcx::User-Dir suchen => erstes Verzeichnis
+ String aAppFirstBasicDir = aAppBasicDir.GetToken(0);
+ sal_Bool bBasicUpdated = sal_False;
+
+ // Basic erzeugen und laden
+ // MT: #47347# AppBasicDir ist jetzt ein PATH!
+ INetURLObject aAppBasic( Application::GetAppFileName(), INET_PROT_FILE );
+ aAppBasic.setExtension( DEFINE_CONST_UNICODE( "sbl" ) );
+ String aAppBasicFile, aNewBasicFile;
+ // Direkt nach der Installation gibt es ggf. _nur_ eine SOFFICE.NEW
+ if ( !SfxContentHelper::Find( aAppBasicDir, aAppBasic.getName(), aAppBasicFile ) )
+ {
+ INetURLObject aNewBasic = aAppBasic;
+ aNewBasic.setExtension( DEFINE_CONST_UNICODE( "new" ) );
+ if ( SfxContentHelper::Find( aAppFirstBasicDir, aNewBasic.getName(), aNewBasicFile ) )
+ {
+ aAppBasic = INetURLObject( aNewBasicFile );
+ aAppBasic.setExtension( DEFINE_CONST_UNICODE( "sbl" ) );
+ SfxContentHelper::MoveTo( aNewBasicFile, aAppBasic.GetMainURL() );
+ }
+ }
+ else
+ aAppBasic = INetURLObject( aAppBasicFile );
+ SvStorageRef aStor;
+ if ( SfxContentHelper::Exists( aAppBasic.GetMainURL() ) )
+ aStor = new SvStorage( aAppBasic.PathToFileName(), STREAM_READ | STREAM_SHARE_DENYWRITE );
+ if ( aStor.Is() && 0 == aStor->GetError() )
+ {
+ SfxErrorContext aErrContext( ERRCTX_SFX_LOADBASIC, Application::GetAppName() );
+ String aOldBaseURL = INetURLObject::GetBaseURL();
+ INetURLObject::SetBaseURL( aAppBasic.GetMainURL() );
+ pImp->pBasicMgr = new SfxBasicManager( *aStor, NULL, &aAppBasicDir );
+ pImp->pBasicMgr->SetStorageName( aAppBasic.PathToFileName() );
+
+ // ggf. nach einem Channel-Update den BasicManager aktualisieren
+ INetURLObject aNewBasic = aAppBasic;
+ aNewBasic.setExtension( DEFINE_CONST_UNICODE( "new" ) );
+ if ( SfxContentHelper::Find( aAppFirstBasicDir, aNewBasic.getName(), aNewBasicFile ) )
+ {
+ aNewBasic = INetURLObject( aNewBasicFile );
+ SvStorageRef xTmpStor = new SvStorage( aNewBasic.PathToFileName(), STREAM_READ | STREAM_SHARE_DENYWRITE );
+ pImp->pBasicMgr->Merge( *xTmpStor );
+ bBasicUpdated = sal_True;
+ xTmpStor.Clear(); // Sonst kein Kill() moeglich
+ SfxContentHelper::Kill( aNewBasicFile ); // SOFFICE.NEW loeschen
+ }
+ INetURLObject::SetBaseURL( aOldBaseURL );
+ if ( pImp->pBasicMgr->HasErrors() )
+ {
+ // handle errors
+ BasicError *pErr = pImp->pBasicMgr->GetFirstError();
+ while ( pErr )
+ {
+ // show message to user
+ if ( ERRCODE_BUTTON_CANCEL ==
+ ErrorHandler::HandleError( pErr->GetErrorId() ) )
+ {
+ // user wants to break loading of BASIC-manager
+ delete pImp->pBasicMgr;
+ aStor.Clear();
+ break;
+ }
+ pErr = pImp->pBasicMgr->GetNextError();
+ }
+ }
+ }
+ if ( !aStor.Is() || 0 != aStor->GetError() )
+ {
+ pImp->pBasicMgr = new SfxBasicManager( new StarBASIC, &aAppBasicDir );
+
+ // Als Destination das erste Dir im Pfad:
+ String aFileName( aAppBasic.getName() );
+ aAppBasic = INetURLObject( aAppBasicDir.GetToken(0), INET_PROT_FILE );
+ aAppBasic.insertName( aFileName );
+ pImp->pBasicMgr->SetStorageName( aAppBasic.PathToFileName() );
+ }
+
+ aStor.Clear();
+ if ( bBasicUpdated )
+ SaveBasicManager();
+
+ // globale Variablen
+ StarBASIC *pBas = pImp->pBasicMgr->GetLib(0);
+ sal_Bool bBasicWasModified = pBas->IsModified();
+/*
+ MakeVariable( pBas, pAppObj, "ActiveModule", SID_ACTIVEMODULE|0x20000 );
+ MakeVariable( pBas, pAppObj, "ActiveDocument", SID_ACTIVEDOCUMENT|0x20000 );
+ MakeVariable( pBas, pAppObj, "ActiveWindow", SID_ACTIVEWINDOW|0x20000 );
+ MakeVariable( pBas, pAppObj, "ActiveTask", SID_ACTIVETASK|0x20000 );
+ MakeVariable( pBas, pAppObj, "Application", SID_APPLICATION );
+ MakeVariable( pBas, pAppObj, "Selection", SID_SELECTION|0x20000 );
+ MakeVariable( pBas, pAppObj, "Documents", SID_DOCUMENTS|0x40000 );
+ MakeVariable( pBas, pAppObj, "Windows", SID_WINDOWS|0x40000 );
+ MakeVariable( pBas, pAppObj, "StarWriter", SID_STARWRITER|0x20000 );
+ MakeVariable( pBas, pAppObj, "StarDraw", SID_STARDRAW|0x20000 );
+ MakeVariable( pBas, pAppObj, "StarCalc", SID_STARCALC|0x20000 );
+ MakeVariable( pBas, pAppObj, "LanguageId", SID_LANGUAGEID, SbxUSHORT );
+ MakeVariable( pBas, pAppObj, "CountryId", SID_COUNTRYID, SbxUSHORT );
+ // MI: wenn der drin ist, findet BASIC die Datenbank-Wizard Makros
+ // nicht mehr - warum auch immer
+ MakeVariable( pBas, pAppObj, "ThisDocument", SID_THISDOCUMENT|0x20000 );
+ MakeVariable( pBas, pAppObj, "ThisWindow", SID_THISWINDOW|0x20000 );
+ MakeVariable( pBas, pAppObj, "ThisComponent", 0x20000 );
+ MakeVariable( pBas, pAppObj, "SubstPathVars", SID_SUBSTPATHVARS,SbxSTRING, SbxCLASS_METHOD );
+*/
+ // ::com::sun::star::frame::Desktop
+ Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr = ::utl::getProcessServiceFactory();
+ Any aDesktop;
+ Reference< XDesktop > xDesktop( xSMgr->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
+ aDesktop <<= xDesktop ;
+ SbxObjectRef xUnoObj = GetSbUnoObject( DEFINE_CONST_UNICODE("StarDesktop"), aDesktop );
+ xUnoObj->SetFlag( SBX_DONTSTORE );
+ pBas->Insert( xUnoObj );
+ //pBas->setRoot( xDesktop );
+
+ // Konstanten
+//ASDBG RegisterBasicConstants( "so", aConstants, sizeof(aConstants)/sizeof(SfxConstant) );
+
+ // Durch MakeVariable wird das Basic modifiziert.
+ if ( !bBasicWasModified )
+ pBas->SetModified( sal_False );
+ }
+ return pImp->pBasicMgr;
+}
+
+//--------------------------------------------------------------------
+
+StarBASIC* SfxApplication::GetBasic()
+{
+ return GetBasicManager()->GetLib(0);
+}
+
+//--------------------------------------------------------------------
+
+FASTBOOL SfxApplication::IsInBasicCall() const
+{
+ return 0 != pAppData_Impl->nBasicCallLevel;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::EnterBasicCall()
+{
+ if ( 1 == ++pAppData_Impl->nBasicCallLevel )
+ {
+ DBG_TRACE( "SfxShellObject: BASIC-on-demand" );
+
+ // das kann l"anger dauern, da Progress nicht geht, wenigstens Sanduhr
+//(mba)/task SfxWaitCursor aWait;
+
+ // zuerst das BASIC laden
+ GetBasic();
+/*
+ // als erstes SfxShellObject das SbxObject der SfxApplication erzeugen
+ SbxObject *pSbx = GetSbxObject();
+ DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject for SfxApplication" );
+
+ // die SbxObjects aller Module erzeugen
+ SfxModuleArr_Impl& rArr = GetModules_Impl();
+ for ( sal_uInt16 n = 0; n < rArr.Count(); ++n )
+ {
+ SfxModule *pMod = rArr.GetObject(n);
+ if ( pMod->IsLoaded() )
+ {
+ pSbx = pMod->GetSbxObject();
+ DBG_ASSERT( pSbx, "SfxModule: can't create SbxObject" );
+ }
+ }
+
+ // die SbxObjects aller Tasks erzeugen
+ for ( SfxTask *pTask = SfxTask::GetFirst(); pTask; pTask = SfxTask::GetNext( *pTask ) )
+ pTask->GetSbxObject();
+
+ // die SbxObjects aller SfxObjectShells erzeugen (ggf. Frame-los!)
+ for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst( NULL, sal_False );
+ pObjSh;
+ pObjSh = SfxObjectShell::GetNext(*pObjSh, NULL, sal_False) )
+ {
+ // kein IP-Object oder wenn doch dann initialisiert?
+ SvStorageRef aStorage;
+ if ( !pObjSh->IsHandsOff() )
+ aStorage = pObjSh->GetStorage();
+ if ( !pObjSh->GetInPlaceObject() || aStorage.Is() )
+ {
+ DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for %s",
+ pObjSh->SfxShell::GetName().GetBuffer() ) );
+ pSbx = pObjSh->GetSbxObject();
+ DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" );
+ }
+ }
+
+ // die SbxObjects der SfxShells auf den Stacks der Frames erzeugen
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(0,0,sal_False);
+ pFrame;
+ pFrame = SfxViewFrame::GetNext(*pFrame,0,0,sal_False) )
+ {
+ // den Dispatcher des Frames rausholen
+ SfxDispatcher *pDispat = pFrame->GetDispatcher();
+ pDispat->Flush();
+
+ // "uber alle SfxShells auf dem Stack des Dispatchers iterieren
+ // Frame selbst wird ausgespart, da er indirekt angezogen wird,
+ // sofern er ein Dokument enth"alt.
+ for ( sal_uInt16 nStackIdx = pDispat->GetShellLevel(*pFrame);
+ 0 != nStackIdx;
+ --nStackIdx )
+ {
+ DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for level %u", nStackIdx-1 ); )
+ pSbx = pDispat->GetShell(nStackIdx - 1)->GetSbxObject();
+ DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" );
+ }
+
+ if ( !pFrame->GetObjectShell() )
+ {
+ DBG( DbgOutf( "SfxShellObject: BASIC-on-demand for empty frame" ); )
+ pSbx = pFrame->GetSbxObject();
+ DBG_ASSERT( pSbx, "SfxShellObject: can't create SbxObject" );
+ }
+ }
+*/
+ // Factories anmelden
+// SbxBase::AddFactory( new SfxSbxObjectFactory_Impl );
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::LeaveBasicCall()
+{
+ --pAppData_Impl->nBasicCallLevel;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::EventExec_Impl( SfxRequest &rReq, SfxObjectShell *pObjSh )
+{
+ // SID nur einmal holen
+ sal_uInt16 nSID = rReq.GetSlot();
+
+ SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, nSID, sal_False);
+ if ( pItem )
+ {
+ String aArg( pItem->GetValue() );
+ GetEventConfig()->ConfigureEvent( nSID, aArg, pObjSh );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxApplication::EventState_Impl
+(
+ sal_uInt16 nSID,
+ SfxItemSet& rSet,
+ SfxObjectShell* pObjSh
+)
+{
+ // Config auslesen
+ SfxMacroConfig *pMC = GetMacroConfig();
+ SfxEventConfiguration *pEC = GetEventConfig();
+ const SvxMacro* pMacro = pEC->GetMacroForEventId( nSID, pObjSh );
+
+ // "Library.Modul.Method" zusammensetzen
+ String aRet;
+ if ( pMacro )
+ aRet = pMacro->GetMacName();
+ rSet.Put( SfxStringItem( nSID, aRet ) );
+}
+
+//-------------------------------------------------------------------------
+void SfxApplication::PropExec_Impl( SfxRequest &rReq )
+{
+ SfxIniManager *pIniMgr = GetIniManager();
+
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ sal_uInt16 nSID = rReq.GetSlot();
+ switch ( nSID )
+ {
+ case SID_CREATE_BASICOBJECT:
+ {
+ SFX_REQUEST_ARG(rReq, pItem, SfxStringItem, nSID, sal_False);
+ if ( pItem )
+ {
+ SbxObject* pObject = SbxBase::CreateObject( pItem->GetValue() );
+ pObject->AddRef();
+//(mba) rReq.SetReturnValue( SfxObjectItem( 0, pObject ) );
+ rReq.Done();
+ }
+ break;
+ }
+
+ case SID_DELETE_BASICOBJECT:
+ {
+ SFX_REQUEST_ARG(rReq, pItem, SfxObjectItem, nSID, sal_False);
+ if ( pItem )
+ {
+//(mba) SbxObject* pObject = pItem->GetObject();
+//(mba) pObject->ReleaseRef();
+ }
+ break;
+ }
+
+ case SID_WIN_POSSIZE:
+ {
+ break;
+ }
+
+ case SID_DEFAULTFILEPATH:
+ {
+ SFX_REQUEST_ARG(rReq, pPathItem, SfxStringItem, nSID, sal_False);
+ pIniMgr->Set(pPathItem->GetValue(), SFX_KEY_WORK_PATH );
+ break;
+ }
+
+ case SID_INTERACTIVEMODE:
+ {
+ break;
+ }
+
+ case SID_ATTR_UNDO_COUNT:
+ {
+ SFX_REQUEST_ARG(rReq, pCountItem, SfxUInt16Item, nSID, sal_False);
+ GetOptions().SetUndoCount( pCountItem->GetValue() );
+ break;
+ }
+
+#if 0
+ case SID_ATTR_METRIC:
+ {
+ SFX_REQUEST_ARG(rReq, pMetricItem, SfxUInt16Item, nSID, sal_False);
+ GetOptions().SetMetric( (FieldUnit) pMetricItem->GetValue() );
+ break;
+ }
+#endif
+
+ case SID_WIN_VISIBLE:
+ {
+ break;
+ }
+
+ case SID_ON_STARTAPP:
+ case SID_ON_CLOSEAPP:
+ case SID_ON_CREATEDOC:
+ case SID_ON_OPENDOC:
+ case SID_ON_PREPARECLOSEDOC:
+ case SID_ON_CLOSEDOC:
+ case SID_ON_SAVEDOC:
+ case SID_ON_SAVEASDOC:
+ case SID_ON_ACTIVATEDOC:
+ case SID_ON_DEACTIVATEDOC:
+ case SID_ON_PRINTDOC:
+ case SID_ON_SAVEDOCDONE:
+ case SID_ON_SAVEASDOCDONE:
+ EventExec_Impl( rReq, 0 );
+ break;
+
+ case SID_STATUSBARTEXT:
+ {
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False);
+ String aText = pStringItem->GetValue();
+ if ( aText.Len() )
+ GetpApp()->ShowStatusText( aText );
+ else
+ GetpApp()->HideStatusText();
+ break;
+ }
+
+ case SID_HELP:
+ {
+ break;
+ }
+
+ case SID_PLAYMACRO:
+ PlayMacro_Impl( rReq, GetBasic() );
+ break;
+
+ case SID_OFFICE_PALK:
+ {
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False);
+ if ( pStringItem )
+ {
+ String aPALK = pStringItem->GetValue();
+ sal_Bool bCheck = SvDemo::CheckPALK(aPALK, String());
+ rReq.SetReturnValue(SfxBoolItem(nSID, bCheck ));
+ if( aPALK.Len() && bCheck )
+ SvDemo::SetAuthorizedState(Application::GetAppName(), aPALK );
+ }
+ else
+ SbxBase::SetError( SbxERR_WRONG_ARGS );
+ break;
+ }
+
+ case SID_OFFICE_PRIVATE_USE:
+ case SID_OFFICE_COMMERCIAL_USE:
+ {
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False);
+
+ if ( pStringItem )
+ {
+ String aValue = pIniMgr->Get( SFX_KEY_USINGOFFICE );
+
+ if ( !aValue.Len() || aValue.Len() != 2 )
+ aValue = DEFINE_CONST_UNICODE("00");
+
+ sal_uInt16 nPos = SID_OFFICE_PRIVATE_USE == nSID ? 0 : 1;
+ String aNew = pStringItem->GetValue().Copy( 0, 1 );
+ aValue.Replace( nPos, aNew.Len(), aNew );
+ pIniMgr->Set( aValue, SFX_KEY_USINGOFFICE );
+ }
+ break;
+ }
+
+ case SID_OFFICE_CUSTOMERNUMBER:
+ {
+ SFX_REQUEST_ARG(rReq, pStringItem, SfxStringItem, nSID, sal_False);
+
+ if ( pStringItem )
+ pIniMgr->Set( pStringItem->GetValue(),
+ SFX_KEY_CUSTOMERNUMBER );
+ break;
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+void SfxApplication::PropState_Impl( SfxItemSet &rSet )
+{
+ SfxViewFrame *pFrame = SfxViewFrame::Current();
+ SfxIniManager *pIniMgr = GetIniManager();
+
+ SfxWhichIter aIter(rSet);
+ for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
+ {
+ switch ( nSID )
+ {
+ case SID_THISDOCUMENT:
+ {
+ rSet.Put( SfxObjectItem( SID_THISDOCUMENT, pAppData_Impl->pThisDocument ? pAppData_Impl->pThisDocument : SfxObjectShell::Current() ) );
+ break;
+ }
+
+ case SID_THISWINDOW:
+ {
+ rSet.Put( SfxObjectItem( SID_THISWINDOW, pAppData_Impl->pThisDocument ? SfxViewFrame::GetFirst( pAppData_Impl->pThisDocument ) : SfxViewFrame::Current() ) );
+ break;
+ }
+ case SID_PROGNAME:
+ rSet.Put( SfxStringItem( SID_PROGNAME, GetName() ) );
+ break;
+
+ case SID_ACTIVEDOCUMENT:
+ rSet.Put( SfxObjectItem( SID_ACTIVEDOCUMENT, SfxObjectShell::Current() ) );
+ break;
+
+ case SID_APPLICATION:
+ rSet.Put( SfxObjectItem( SID_APPLICATION, this ) );
+ break;
+
+ case SID_STARWRITER:
+ {
+ SfxModule *pMod = (*(SfxModule**) GetAppData(SHL_WRITER))->Load();
+ if ( pMod ) HACK(muss vom Modul selbst gemacht werden)
+ pMod->SetName( DEFINE_CONST_UNICODE("StarWriter") );
+ rSet.Put( SfxObjectItem( nSID, pMod ) );
+ break;
+ }
+
+ case SID_STARDRAW:
+ {
+ SfxModule *pMod = (*(SfxModule**) GetAppData(SHL_DRAW))->Load();
+ if ( pMod ) HACK(muss vom Modul selbst gemacht werden)
+ pMod->SetName( DEFINE_CONST_UNICODE("StarDraw") );
+ rSet.Put( SfxObjectItem( nSID, pMod ) );
+ break;
+ }
+
+ case SID_STARCALC:
+ {
+ SfxModule *pMod = (*(SfxModule**) GetAppData(SHL_CALC))->Load();
+ if ( pMod ) HACK(muss vom Modul selbst gemacht werden)
+ pMod->SetName( DEFINE_CONST_UNICODE("StarCalc") );
+ rSet.Put( SfxObjectItem( nSID, pMod ) );
+ break;
+ }
+
+ case SID_ACTIVEMODULE:
+ {
+ SfxShell *pSh = GetActiveModule();
+ if ( !pSh )
+ pSh = this;
+ rSet.Put( SfxObjectItem( SID_ACTIVEMODULE, pSh ) );
+ break;
+ }
+
+ case SID_ACTIVEWINDOW:
+ rSet.Put( SfxObjectItem( SID_ACTIVEWINDOW, pFrame ) );
+ break;
+
+ case SID_SELECTION:
+ break;
+
+ case SID_WIN_POSSIZE:
+ {
+ break;
+ }
+
+ case SID_CAPTION:
+ break;
+
+ case SID_DEFAULTFILEPATH:
+ rSet.Put( SfxStringItem( SID_DEFAULTFILEPATH, pIniMgr->Get(SFX_KEY_WORK_PATH) ) );
+ break;
+
+ case SID_PROGFILENAME:
+ rSet.Put( SfxStringItem( SID_PROGFILENAME, Application::GetAppFileName() ) );
+ break;
+
+ case SID_PROGPATH:
+ rSet.Put( SfxStringItem( SID_PROGPATH, pIniMgr->GetProgramPath() ) );
+ break;
+
+ case SID_INTERACTIVEMODE:
+ rSet.Put( SfxBoolItem( SID_INTERACTIVEMODE, !IsDispatcherLocked() ) );
+ break;
+
+ case SID_ATTR_UNDO_COUNT:
+ rSet.Put( SfxUInt16Item( SID_ATTR_UNDO_COUNT, GetOptions().GetUndoCount() ) );
+ break;
+
+#if 0
+ case SID_ATTR_METRIC:
+ rSet.Put( SfxByteItem( SID_ATTR_METRIC, (sal_Int8) GetOptions().GetMetric() ) );
+ break;
+#endif
+
+ case SID_WIN_VISIBLE:
+ break;
+
+ case SID_ON_STARTAPP:
+ case SID_ON_CLOSEAPP:
+ case SID_ON_CREATEDOC:
+ case SID_ON_OPENDOC:
+ case SID_ON_PREPARECLOSEDOC:
+ case SID_ON_CLOSEDOC:
+ case SID_ON_SAVEDOC:
+ case SID_ON_SAVEASDOC:
+ case SID_ON_ACTIVATEDOC:
+ case SID_ON_DEACTIVATEDOC:
+ case SID_ON_PRINTDOC:
+ case SID_ON_SAVEDOCDONE:
+ case SID_ON_SAVEASDOCDONE:
+ EventState_Impl( nSID, rSet, 0 );
+
+ case SID_UPDATE_VERSION:
+ rSet.Put( SfxUInt32Item( SID_UPDATE_VERSION, SUPD ) );
+ break;
+
+ case SID_BUILD_VERSION:
+ {
+ String aVersion = lcl_GetVersionString(pAppData_Impl->pLabelResMgr);
+ rSet.Put( SfxUInt32Item( SID_BUILD_VERSION, (sal_uInt32) aVersion.ToInt32() ) );
+ break;
+ }
+
+ case SID_STATUSBARTEXT:
+ {
+ rSet.Put( SfxStringItem( SID_STATUSBARTEXT, GetStatusBarManager()->GetStatusBar()->GetText() ) );
+ break;
+ }
+ case SID_OFFICE_VERSION_ID:
+ {
+ String sVersionString;
+ ResId aVerId( STR_VERSION_ID, pAppData_Impl->pLabelResMgr );
+ if(pAppData_Impl->pLabelResMgr->IsAvailable( aVerId.SetRT( RSC_STRING ) ))
+ sVersionString += String(aVerId);
+ else
+ sVersionString += DEFINE_CONST_UNICODE("50"); // wenn man keine Iso-Dll haben sollte und vorher nicht abgeraucht ist
+ String sOS(S2U(getenv("OS")));
+ String sProc(S2U(getenv("CPU")));
+
+ sal_uInt16 nSystem = SYSTEM_ID;
+ if(nSystem < 10)
+ sVersionString += 0x0030 ; // '0' = 30h
+ sVersionString += String::CreateFromInt32( nSystem );
+ String sBuildVersion = lcl_GetVersionString(pAppData_Impl->pLabelResMgr);
+ sal_uInt16 nLen = sBuildVersion.Len();
+ if(nLen > 4)
+ {
+ DBG_ERROR("Buildversion laenger als 4 Zeichen ?")
+ sBuildVersion.Erase(4, nLen - 4);
+ }
+ else if(nLen < 4)
+ {
+ DBG_ERROR("Buildversion kuerzer als 4 Zeichen ?")
+
+ while(5 > nLen++)
+ sBuildVersion.Insert(DEFINE_CONST_UNICODE("0"), 0);
+ }
+ sVersionString += sBuildVersion;
+ String sResStr(S2U(ResMgr::GetLang()));
+ if( sResStr.Len() < 2)
+ sResStr.Insert(DEFINE_CONST_UNICODE("0"), 0);
+ sVersionString += sResStr;
+
+ aVerId = ResId( STR_VERSION_TYPE, pAppData_Impl->pLabelResMgr );
+ if(pAppData_Impl->pLabelResMgr->IsAvailable( aVerId.SetRT( RSC_STRING ) ))
+ sVersionString += String(aVerId);
+ else
+ sVersionString += DEFINE_CONST_UNICODE("99"); // wenn man keine Iso-Dll haben sollte
+
+ sal_uInt16 nDemoKind = GetDemoKind();
+ switch(nDemoKind)
+ {
+ case SFX_DEMOKIND_FULL : sVersionString += '1'; break;
+ case SFX_DEMOKIND_TRYBUY: sVersionString += '2'; break;
+ case SFX_DEMOKIND_DEMO : sVersionString += '3'; break;
+ default: sVersionString += '0';
+ }
+
+ sVersionString += Application::IsRemoteServer() ? '1' : '0';
+ rSet.Put(SfxStringItem(nSID, sVersionString));
+
+ }
+ break;
+
+ case SID_OFFICE_PLK:
+ {
+ String sPLK(SvDemo::GetPLK());
+ rSet.Put(SfxStringItem(nSID, sPLK));
+ }
+ break;
+
+ case SID_OLD_PALK:
+ {
+ rSet.Put(SfxStringItem(nSID, SvDemo::GetOldPALK()));
+ }
+ break;
+
+ case SID_OFFICE_PRIVATE_USE:
+ case SID_OFFICE_COMMERCIAL_USE:
+ {
+ String aUsing = pIniMgr->Get( SFX_KEY_USINGOFFICE );
+
+ if ( !aUsing.Len() || aUsing.Len() != 2 )
+ aUsing = DEFINE_CONST_UNICODE("00");
+
+ sal_uInt16 nPos = SID_OFFICE_PRIVATE_USE == nSID ? 0 : 1;
+ String aRet = aUsing.Copy( nPos, 1 );
+ rSet.Put( SfxStringItem( nSID, aRet ) );
+ break;
+ }
+
+ case SID_OFFICE_CUSTOMERNUMBER:
+ {
+ String aCustomerNumber = pIniMgr->Get(SFX_KEY_CUSTOMERNUMBER);
+ rSet.Put( SfxStringItem( nSID, aCustomerNumber ) );
+ break;
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+void SfxApplication::MacroExec_Impl( SfxRequest& rReq )
+{
+ DBG_MEMTEST();
+ if ( SfxMacroConfig::IsMacroSlot( rReq.GetSlot() ) )
+ {
+ // SlotId referenzieren, damit nicht im Execute der Slot abgeschossen
+ // werden kann
+ GetMacroConfig()->RegisterSlotId(rReq.GetSlot());
+ SFX_REQUEST_ARG(rReq, pArgs, SfxStringItem,
+ rReq.GetSlot(), sal_False);
+ String aArgs;
+ if( pArgs ) aArgs = pArgs->GetValue();
+ if ( GetMacroConfig()->ExecuteMacro(rReq.GetSlot(), aArgs ) )
+ rReq.Done();
+ GetMacroConfig()->ReleaseSlotId(rReq.GetSlot());
+ }
+}
+
+//--------------------------------------------------------------------
+void SfxApplication::MacroState_Impl( SfxItemSet& rSet )
+{
+ DBG_MEMTEST();
+
+ // Gestrichen, da zu teuer! Ausserdem waere ein EnterBasicCall noetig
+/*
+ const sal_uInt16 *pRanges = rSet.GetRanges();
+ DBG_ASSERT(pRanges && *pRanges, "Set ohne Bereich");
+ while ( *pRanges )
+ {
+ for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
+ {
+ sal_Bool bOK = sal_False;
+ if ( SfxMacroConfig::IsMacroSlot( nWhich ) )
+ bOK = GetMacroConfig()->CheckMacro(nWhich);
+
+ if ( !bOK )
+ rSet.DisableItem(nWhich);
+ }
+
+ ++pRanges;
+ }
+ */
+}
+
+//-------------------------------------------------------------------------
+
+void SfxApplication::PlayMacro_Impl( SfxRequest &rReq, StarBASIC *pBasic )
+{
+ EnterBasicCall();
+ sal_Bool bOK = sal_False;
+
+ // Makro und asynch-Flag
+ SFX_REQUEST_ARG(rReq,pMacro,SfxStringItem,SID_STATEMENT,sal_False);
+ SFX_REQUEST_ARG(rReq,pAsynch,SfxBoolItem,SID_ASYNCHRON,sal_False);
+
+ if ( pAsynch && pAsynch->GetValue() )
+ {
+ // asynchron ausf"uhren
+ GetDispatcher().Execute( SID_PLAYMACRO, SFX_CALLMODE_ASYNCHRON,
+ pMacro, 0L );
+ rReq.Done();
+ }
+ else if ( pMacro )
+ {
+ // Statement aufbereiten
+ DBG_ASSERT( pBasic, "no BASIC found" ) ;
+ String aStatement( '[' );
+ aStatement += pMacro->GetValue();
+ aStatement += ']';
+
+ // P"aventiv den Request abschlie\sen, da er ggf. zerst"ort wird
+ rReq.Done();
+ rReq.ReleaseArgs();
+
+ // Statement ausf"uhren
+ SbxVariable* pRet = pBasic->Execute( aStatement );
+ bOK = 0 == SbxBase::GetError();
+ SbxBase::ResetError();
+ }
+
+ LeaveBasicCall();
+ rReq.SetReturnValue(SfxBoolItem(0,bOK));
+}
+
+
diff --git a/sfx2/source/appl/appcfg.cxx b/sfx2/source/appl/appcfg.cxx
new file mode 100644
index 000000000000..5e363b4cd146
--- /dev/null
+++ b/sfx2/source/appl/appcfg.cxx
@@ -0,0 +1,1849 @@
+/*************************************************************************
+ *
+ * $RCSfile: appcfg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifndef _SV_CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _SV_SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _AEITEM_HXX //autogen
+#include <svtools/aeitem.hxx>
+#endif
+#ifndef _SFXSLSTITM_HXX //autogen
+#include <svtools/slstitm.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSZITEM_HXX
+#include <svtools/szitem.hxx>
+#endif
+#ifndef _UNDO_HXX //autogen
+#include <svtools/undo.hxx>
+#endif
+#ifndef _SFXINIPROP_HXX
+#include <svtools/iniprop.hxx>
+#endif
+
+#ifndef _INET_WRAPPER_HXX
+#include <inet/wrapper.hxx>
+#endif
+#ifndef _INET_CONFIG_HXX
+#include <inet/inetcfg.hxx>
+#endif
+
+#define _SVSTDARR_STRINGS
+#include <svtools/svstdarr.hxx>
+
+#ifndef _SVTOOLS_TTPROPS_HXX // handmade
+#include <svtools/ttprops.hxx>
+#endif
+#ifndef _SFXSIDS_HRC // handmade
+#include <sfxsids.hrc>
+#endif
+#ifndef _SOT_EXCHANGE_HXX //autogen
+#include <sot/exchange.hxx>
+#endif
+
+#pragma hdrstop
+
+#include <svtools/agprop.hxx>
+#include <sj2/sjapplet.hxx>
+
+#ifndef _SFXISETHINT_HXX
+#include <svtools/isethint.hxx>
+#endif
+
+#include <tools/urlobj.hxx>
+#include <tools/wldcrd.hxx>
+
+#include "viewfrm.hxx"
+#include "sfxhelp.hxx"
+#include "sfxtypes.hxx"
+#include "dispatch.hxx"
+#include "objsh.hxx"
+#include "objshimp.hxx"
+#include "saveopt.hxx"
+#include "viewsh.hxx"
+#include "request.hxx"
+#include "evntconf.hxx"
+#include "cfgmgr.hxx"
+#include "docinf.hxx"
+#include "appdata.hxx"
+#include "picklist.hxx"
+#include "tbxconf.hxx"
+#include "workwin.hxx"
+#include <misccfg.hxx>
+#include <macrconf.hxx>
+#include "appimp.hxx"
+#include "helper.hxx" // SfxContentHelper::...
+
+//-------------------------------------------------------------------------
+
+const USHORT* SfxApplication::GetOptionsRanges() const
+{
+ static USHORT pRange[] =
+ {
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0, 0,
+ 0,
+ };
+
+ if (0 == pRange[0])
+ {
+ SfxItemPool &rPool = GetPool();
+ pRange[ 0] = SID_OPTIONS_START;
+ pRange[ 1] = SID_OPTIONS_FIRSTFREE-1;
+ pRange[ 2] = SID_HELPBALLOONS;
+ pRange[ 3] = SID_HELPTIPS;
+ pRange[ 4] = SID_SECURE_URL;
+ pRange[ 5] = SID_SECURE_URL;
+ pRange[ 6] = SID_BASIC_ENABLED;
+ pRange[ 7] = SID_BASIC_ENABLED;
+ pRange[ 8] = SID_AUTO_ADJUSTICONS;
+ pRange[ 9] = SID_ICONGRID;
+ pRange[ 10 ] = SID_RESTORE_EXPAND_STATE;
+ pRange[ 11 ] = SID_RESTORE_EXPAND_STATE;
+ }
+ return pRange;
+}
+
+// -----------------------------------------------------------------------
+
+String GetJavaIniEntry_Impl( SfxIniKey eKey, SfxIniManager* pIniMgr )
+{
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( INET_PROT_FILE );
+ aObj.SetSmartURL( Config::GetConfigName( pIniMgr->Get( SFX_KEY_USERCONFIG_PATH ),
+ DEFINE_CONST_UNICODE("java") ) );
+ String aIniEntry;
+ String aIniPath = aObj.getName();
+ if ( pIniMgr->SearchFile( aIniPath ) )
+ {
+ Config aJavaCfg( aIniPath );
+ aJavaCfg.SetGroup( "Java" );
+ String aIniKey = pIniMgr->GetKeyName( eKey );
+ aIniEntry = (String)S2U(aJavaCfg.ReadKey( U2S(aIniKey) ));
+ }
+ return aIniEntry;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SetJavaIniEntry_Impl( SfxIniKey eKey, const String& rValue, SfxIniManager* pIniMgr )
+{
+ String aIniFile =
+ Config::GetConfigName( pIniMgr->Get( SFX_KEY_USERCONFIG_PATH ), DEFINE_CONST_UNICODE("java") );
+ if ( !SfxContentHelper::Exists( aIniFile ) )
+ {
+ INetURLObject aObj( aIniFile, INET_PROT_FILE );
+ String aIniFileName = aObj.getName();
+ aObj.SetSmartURL( pIniMgr->Get( SFX_KEY_CONFIG_DIR ) );
+ aObj.insertName( aIniFileName );
+ String aShareFile = aObj.PathToFileName();
+
+ if ( !SfxContentHelper::Exists( aShareFile ) ||
+ !SfxContentHelper::CopyTo( aShareFile, aIniFile ) )
+ return FALSE;
+ }
+ Config aJavaCfg( aIniFile );
+ aJavaCfg.SetGroup( "Java" );
+ String aIniKey = pIniMgr->GetKeyName( eKey );
+ aJavaCfg.WriteKey( U2S(aIniKey), U2S(rValue) );
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::GetOptions( SfxItemSet& rSet )
+{
+ BOOL bRet = FALSE;
+ SfxIniManager *pIni = GetIniManager();
+ SfxItemPool &rPool = GetPool();
+ SfxToolBoxConfig *pTbxCfg = SfxToolBoxConfig::GetOrCreate();
+ String aTRUEStr = 0x0031; // ^= '1'
+
+ const USHORT *pRanges = rSet.GetRanges();
+ while ( *pRanges )
+ {
+ for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
+ {
+ switch(nWhich)
+ {
+ case SID_ATTR_BUTTON_OUTSTYLE3D :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_OUTSTYLE3D ),
+ pTbxCfg->GetOutStyle() != TOOLBOX_STYLE_FLAT)))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_BUTTON_BIGSIZE :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ),
+ pTbxCfg->GetSymbolSet() == SFX_SYMBOLS_LARGE_COLOR)))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_BACKUP :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ),
+ pOptions->IsBackup())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_AUTOSAVE :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ),
+ pOptions->IsAutoSave())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_AUTOSAVEPROMPT :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ),
+ pOptions->IsAutoSavePrompt())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_AUTOSAVEMINUTE :
+ if(rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ),
+ pOptions->GetAutoSaveTime())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_DOCINFO :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ),
+ pOptions->IsDocInfoSave())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_INDEP_METAFILE :
+ {
+ SfxDocumentInfo *pDocInf = SfxObjectShell::Current() ? &SfxObjectShell::Current()->GetDocInfo() : 0;
+ BOOL bIndepGraph = pDocInf ? pDocInf->IsPortableGraphics() : pOptions->IsIndepGrfFmt();
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_INDEP_METAFILE ),
+ bIndepGraph)))
+ bRet = TRUE;
+ break;
+ }
+ case SID_OPT_SAVEGRAPHICSCOMPRESSED :
+ {
+ SfxDocumentInfo *pDocInf = SfxObjectShell::Current() ? &SfxObjectShell::Current()->GetDocInfo() : 0;
+ BOOL bComprGraph = pDocInf ? pDocInf->IsSaveGraphicsCompressed() : pOptions->IsSaveGraphicsCompressed();
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_OPT_SAVEGRAPHICSCOMPRESSED ),
+ bComprGraph ) ) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_OPT_SAVEORIGINALGRAPHICS :
+ {
+ SfxDocumentInfo *pDocInf = SfxObjectShell::Current() ? &SfxObjectShell::Current()->GetDocInfo() : 0;
+ BOOL bOrigGraph = pDocInf ? pDocInf->IsSaveOriginalGraphics() : pOptions->IsSaveOriginalGraphics();
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_OPT_SAVEORIGINALGRAPHICS ),
+ bOrigGraph ) ) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_ATTR_WORKINGSET :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ),
+ pOptions->IsSaveWorkingSet())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_SAVEDOCWINS :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCWINS ),
+ pOptions->IsSaveDocWins())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_SAVEDOCVIEW :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ),
+ pOptions->IsSaveDocView())))
+ bRet = TRUE;
+ break;
+ case SID_ATTR_METRIC :
+ if(rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_METRIC ),
+ pOptions->GetMetric() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_DOCMANAGER :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_DOCMANAGER ),
+ pOptions->GetDocumentManagerConfig() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_HELPBALLOONS :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ),
+ pOptions->IsHelpBalloons() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_HELPTIPS :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ),
+ pOptions->IsHelpTips() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_ATTR_AUTOHELPAGENT :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_AUTOHELPAGENT ),
+ pOptions->IsAutoHelpAgent() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_ATTR_WELCOMESCREEN :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_WELCOMESCREEN ),
+ pOptions->IsWelcomeScreen() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_ATTR_UNDO_COUNT :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_ATTR_UNDO_COUNT ),
+ pOptions->GetUndoCount() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_HOMEPAGE :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_HOMEPAGE ),
+ pIni->Get(SFX_KEY_INET_HOME) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MEMCACHE :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_MEMCACHE ),
+ pIni->Get(SFX_KEY_INET_MEMCACHE).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_DISKCACHE :
+ if(rSet.Put( SfxUInt32Item ( rPool.GetWhich( SID_INET_DISKCACHE ),
+ pIni->Get(SFX_KEY_INET_DISKCACHE).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_EXPIRATION :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_EXPIRATION ),
+ pIni->Get(SFX_KEY_INET_CACHEEXPIRATION).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_CACHEJS :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_INET_CACHEJS),
+ pIni->Get(SFX_KEY_INET_CACHEJS).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_CACHEEXPIRED :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_INET_CACHEEXPIRED),
+ pIni->Get(SFX_KEY_INET_CACHEEXPIRED).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_CACHEABORTED :
+ if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_INET_CACHEABORTED),
+ pIni->Get(SFX_KEY_INET_CACHEABORTED).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_REVEAL_MAILADDR :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_INET_REVEAL_MAILADDR),
+ (BOOL)(USHORT)pIni->Get(SFX_KEY_INET_REVEAL_MAILADDR).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_SAVEREL_INET :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ),
+ pOptions->IsSaveRelINet() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_SAVEREL_FSYS :
+ if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ),
+ pOptions->IsSaveRelFSys() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_SMTPSERVER :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_SMTPSERVER),
+ pIni->Get(SFX_KEY_INET_SMTPSERVER) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_POPSERVER :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_POPSERVER),
+ pIni->Get(SFX_KEY_INET_POPSERVER) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_NNTPSERVER :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_NNTPSERVER),
+ pIni->Get(SFX_KEY_INET_NNTPSERVER) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MAXNEWS :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_MAXNEWS),
+ pIni->Get(SFX_KEY_INET_MAXNEWS).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MAXHTTPCONS :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_MAXHTTPCONS),
+ pIni->Get(SFX_KEY_INET_MAXHTTPCONS).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MAXFTPCONS :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_MAXFTPCONS),
+ pIni->Get(SFX_KEY_INET_MAXFTPCONS).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_SMTPGATEWAY :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_SMTPGATEWAY),
+ pIni->Get(SFX_KEY_INET_MAILGATEWAY) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MAILUSERNAME :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_MAILUSERNAME),
+ pIni->Get(SFX_KEY_INET_MAILUSERNAME) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_ATTR_ALLOWFOLDERWEBVIEW :
+ if(rSet.Put( SfxStringItem( rPool.GetWhich(SID_ATTR_ALLOWFOLDERWEBVIEW),
+ pIni->Get(SFX_KEY_ALLOWFOLDERWEBVIEW) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MAILPASSWORD :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_MAILPASSWORD),
+ SfxStringDecode( pIni->Get(SFX_KEY_INET_MAILPASSWORD) ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_MAILTEXTFORMAT :
+ {
+ String aTextFormat = pIni->Get( SFX_KEY_INET_MAILTEXTFORMAT );
+ BYTE nTextFormat = (BYTE)(USHORT)aTextFormat.ToInt32();
+ if(rSet.Put( SfxByteItem( rPool.GetWhich( SID_INET_MAILTEXTFORMAT ),
+ nTextFormat ) ) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_BASIC_ENABLED :
+ if ( rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ),
+ pIni->Get(SFX_KEY_BASIC_ENABLE).ToInt32()) ) )
+ bRet = TRUE;
+ break;
+
+ case SID_INET_JAVA_ENABLE:
+ {
+ String aIniEntry = GetJavaIniEntry_Impl( SFX_KEY_JAVA_ENABLE, pIni );
+ if ( rSet.Put( SfxBoolItem(
+ rPool.GetWhich( SID_INET_JAVA_ENABLE ), ( aIniEntry == aTRUEStr ) ) ) )
+ bRet = TRUE;
+ break;
+ }
+
+ case SID_INET_EXE_APPLETS :
+ {
+ String aIniEntry = GetJavaIniEntry_Impl( SFX_KEY_INET_EXE_APPLETS, pIni );
+ if ( rSet.Put( SfxBoolItem(
+ rPool.GetWhich( SID_INET_EXE_APPLETS ), ( aIniEntry == aTRUEStr ) ) ) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_INET_JAVA_ACCESSTYPE:
+ {
+ SjNetAccess eAccess = NET_HOST;
+ String aNetAccess = GetJavaIniEntry_Impl( SFX_KEY_JAVA_NETACCESS, pIni );
+ if ( aNetAccess.Len() )
+ {
+ if ( aNetAccess.CompareIgnoreCaseToAscii( "UNRESTRICTED" ) == COMPARE_EQUAL )
+ eAccess = NET_UNRESTRICTED;
+ else if ( aNetAccess.CompareIgnoreCaseToAscii( "NONE" ) == COMPARE_EQUAL )
+ eAccess = NET_NONE;
+ }
+
+ if ( rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_INET_JAVA_ACCESSTYPE ), (USHORT)eAccess ) ) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_INET_JAVA_SECURITY:
+ {
+ String aIniEntry = GetJavaIniEntry_Impl( SFX_KEY_JAVA_SECURITY, pIni );
+ if ( rSet.Put( SfxBoolItem(
+ rPool.GetWhich( SID_INET_JAVA_SECURITY ), ( aIniEntry.CompareToAscii("0") != COMPARE_EQUAL ) ) ) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_INET_JAVA_CLASSPATH :
+ {
+ String aIniEntry = GetJavaIniEntry_Impl( SFX_KEY_JAVA_USERCLASSPATH, pIni );
+ if ( rSet.Put( SfxStringItem( rPool.GetWhich( SID_INET_JAVA_CLASSPATH ), aIniEntry ) ) )
+ bRet = TRUE;
+ break;
+ }
+
+ case SID_INET_EXE_PLUGIN :
+ if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_INET_EXE_PLUGIN ),
+ ( pIni->Get( SFX_KEY_INET_EXE_PLUGIN ) == aTRUEStr ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_USERAGENT :
+ if ( rSet.Put( SfxStringItem( rPool.GetWhich(SID_INET_USERAGENT ),
+ pIni->Get( SFX_KEY_INET_USERAGENT ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_NONCACHED_SERVER :
+ if ( rSet.Put( SfxStringItem( rPool.GetWhich( SID_INET_NONCACHED_SERVER ),
+ pIni->Get( SFX_KEY_INET_NONCACHED_SERVER ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_DNS_SERVER :
+ if ( rSet.Put( SfxStringItem( rPool.GetWhich(SID_INET_DNS_SERVER),
+ pIni->Get(SFX_KEY_INET_DNS ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_DNS_AUTO :
+ if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_INET_DNS_AUTO ),
+ !pIni->Get(SFX_KEY_INET_DNS).Len() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_CHANNELS_ONOFF :
+ if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_INET_CHANNELS_ONOFF ),
+ ( pIni->Get( SFX_KEY_INET_CHANNELS ) == aTRUEStr ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_COOKIESHANDLE :
+ if ( rSet.Put( SfxUInt16Item ( rPool.GetWhich(SID_INET_COOKIESHANDLE),
+ pIni->Get(SFX_KEY_INET_COOKIES).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_ATTR_SMARTBEAMER :
+ if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SMARTBEAMER ),
+ pAppData_Impl->bSmartBeamer ) ) )
+ bRet = TRUE;
+ break;
+ case SID_OPT_EXTBRW_ON :
+ if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_OPT_EXTBRW_ON ),
+ ( pIni->Get( SFX_KEY_EXTBRW_ON ) == aTRUEStr ) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_OPT_EXTBRW_ON_EXCEPTION :
+ {
+ List aList;
+ USHORT nCount = pIni->Get(SFX_KEY_EXTBRW_ON_EXCEPTION).ToInt32();
+ USHORT n;
+ for ( n = 0; n < nCount; ++n )
+ aList.Insert( new String( pIni->Get(SFX_KEY_EXTBRW_ON_EXCEPTION, n) ), LIST_APPEND );
+ if ( rSet.Put( SfxStringListItem( rPool.GetWhich(SID_OPT_EXTBRW_ON_EXCEPTION),
+ &aList ) ) )
+ bRet = TRUE;
+ for ( n = 0; n < nCount; ++n )
+ delete (String*)aList.GetObject(n);
+ aList.Clear();
+ break;
+ }
+ case SID_OPT_EXTBRW_OFF_EXCEPTION :
+ {
+ List aList;
+ USHORT nCount = pIni->Get(SFX_KEY_EXTBRW_OFF_EXCEPTION).ToInt32();
+ USHORT n;
+ for ( n = 0; n < nCount; ++n )
+ aList.Insert( new String( pIni->Get(SFX_KEY_EXTBRW_OFF_EXCEPTION, n) ), LIST_APPEND );
+ if ( rSet.Put( SfxStringListItem( rPool.GetWhich(SID_OPT_EXTBRW_OFF_EXCEPTION),
+ &aList ) ) )
+ bRet = TRUE;
+ for ( n = 0; n < nCount; ++n )
+ delete (String*)aList.GetObject(n);
+ aList.Clear();
+ break;
+ }
+ case SID_SECURE_URL :
+ {
+ List aList;
+ USHORT nCount = pIni->Get( SFX_KEY_SECURE_URL ).ToInt32();
+ USHORT n;
+ for ( n = 0; n < nCount; ++n )
+ aList.Insert( new String( pIni->Get(SFX_KEY_SECURE_URL, n) ), LIST_APPEND );
+ if ( rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL),
+ &aList ) ) )
+ bRet = TRUE;
+ for ( n = 0; n < nCount; ++n )
+ delete (String*)aList.GetObject(n);
+ aList.Clear();
+ break;
+ }
+ case SID_ICONGRID :
+ {
+ String aIconGrid( pIni->Get(SFX_KEY_ICONGRID) );
+ if ( rSet.Put( SfxSizeItem( rPool.GetWhich( SID_ICONGRID ),
+ Size( aIconGrid.GetToken(0).ToInt32(), aIconGrid.GetToken(1).ToInt32() ) ) ) )
+ bRet = TRUE;
+ break;
+ }
+
+ case SID_AUTO_ADJUSTICONS :
+ {
+ String aIconGrid( pIni->Get(SFX_KEY_ICONGRID) );
+ if ( rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_AUTO_ADJUSTICONS ),
+ (UINT16)aIconGrid.GetToken(2).ToInt32() )) )
+ bRet = TRUE;
+ break;
+ }
+ case SID_RESTORE_EXPAND_STATE :
+ {
+ String aRestoreExpand( pIni->Get( SFX_KEY_AUTOOPEN ));
+ BOOL bRestoreExpand = TRUE;
+ if( aRestoreExpand.Len() )
+ bRestoreExpand = ((USHORT)aRestoreExpand.ToInt32()) > 0 ? TRUE : FALSE;
+ if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_RESTORE_EXPAND_STATE ),
+ bRestoreExpand )))
+ bRet = TRUE;
+ break;
+ }
+ case SID_ENABLE_METAFILEPRINT :
+ if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ),
+ (BOOL)(USHORT)pIni->Get(SFX_KEY_METAFILEPRINT ).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_PROXY_TYPE :
+ if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_PROXY_TYPE ),
+ pIni->Get(SFX_KEY_INET_PROXYTYPE).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_FTP_PROXY_NAME :
+ if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_FTP_PROXY_NAME ),
+ pIni->Get(SFX_KEY_INET_FTPPROXYNAME) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_FTP_PROXY_PORT :
+ if ( rSet.Put( SfxInt32Item ( rPool.GetWhich(SID_INET_FTP_PROXY_PORT ),
+ pIni->Get(SFX_KEY_INET_FTPPROXYPORT).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_HTTP_PROXY_NAME :
+ if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_HTTP_PROXY_NAME ),
+ pIni->Get(SFX_KEY_INET_HTTPPROXYNAME) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_HTTP_PROXY_PORT :
+ if ( rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_HTTP_PROXY_PORT ),
+ pIni->Get(SFX_KEY_INET_HTTPPROXYPORT).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_SOCKS_PROXY_NAME :
+ if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_SOCKS_PROXY_NAME ),
+ pIni->Get(SFX_KEY_INET_SOCKSPROXYNAME) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_SOCKS_PROXY_PORT :
+ if ( rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_SOCKS_PROXY_PORT ),
+ pIni->Get(SFX_KEY_INET_SOCKSPROXYPORT).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_SECURITY_PROXY_NAME :
+ if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_SECURITY_PROXY_NAME ),
+ pIni->Get(SFX_KEY_INET_SECURITYPROXYNAME) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_SECURITY_PROXY_PORT :
+ if ( rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_SECURITY_PROXY_PORT ),
+ pIni->Get(SFX_KEY_INET_SECURITYPROXYPORT).ToInt32() ) ) )
+ bRet = TRUE;
+ break;
+ case SID_INET_NOPROXY :
+ if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_NOPROXY),
+ pIni->Get(SFX_KEY_INET_NOPROXY) ) ) )
+ bRet = TRUE;
+ break;
+ case SID_ATTR_PATHNAME :
+ case SID_ATTR_PATHGROUP :
+ {
+ SfxAllEnumItem aNames(rPool.GetWhich(SID_ATTR_PATHGROUP));
+ SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME));
+ pIni->Fill(SFX_GROUP_DIR, aNames, aValues);
+ if ( rSet.Put(aNames) || rSet.Put(aValues) )
+ bRet = TRUE;
+ break;
+ }
+ default:
+ DBG_WARNING( "W1:Wrong ID while getting Options!" );
+ break;
+ }
+#ifdef DBG_UTIL
+ if ( !bRet )
+ DBG_ERROR( "Putting options failed!" );
+#endif
+ }
+ }
+
+ return bRet;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* pReferer ) const
+{
+ // unkritisches Protokoll?
+ INetProtocol eProt = rURL.GetProtocol();
+ if ( INET_PROT_MACRO != eProt && INET_PROT_SLOT != eProt )
+ return TRUE;
+ if ( rURL.GetMainURL().CompareIgnoreCaseToAscii( "macro://#", 9 ) == COMPARE_EQUAL )
+ return TRUE;
+
+ if ( rURL.GetMainURL().CompareToAscii("slot:5500") == COMPARE_EQUAL )
+ return TRUE;
+
+ // StarBasic-Modus abholen
+ SfxIniManager *pIni = GetIniManager();
+ USHORT nStarBasicMode = pIni->Get(SFX_KEY_BASIC_ENABLE).ToInt32();
+
+ // StarBasic gar nicht erlaubt?
+ if ( 0 == nStarBasicMode )
+ return FALSE;
+
+ // StarBasic immer erlaubt?
+ if ( 2 == nStarBasicMode )
+ return TRUE;
+
+ // trusted referer?
+ BOOL bTrusted = FALSE;
+ if ( pReferer && pReferer->Len() )
+ {
+ // secure-URLs noch nicht geladen?
+ if ( !pAppData_Impl->pSecureURLs )
+ {
+ pAppData_Impl->pSecureURLs = new SvStrings;
+ USHORT nCount = pIni->Get(SFX_KEY_SECURE_URL).ToInt32();
+ USHORT nPos = 0;
+ for ( USHORT n = 0; n < nCount; ++n )
+ {
+ String aURL = pIni->Get(SFX_KEY_SECURE_URL, n);
+ if ( aURL.Len() )
+ pAppData_Impl->pSecureURLs->Insert( new String( aURL ), nPos++ );
+ }
+ }
+
+ // suchen
+ for ( USHORT n = 0; !bTrusted && n < pAppData_Impl->pSecureURLs->Count(); ++n )
+ {
+ const String* pSecureURL = pAppData_Impl->pSecureURLs->GetObject(n);
+ String aSecureURL( *pSecureURL );
+ aSecureURL += DEFINE_CONST_UNICODE('*');
+ bTrusted = WildCard( aSecureURL ).Matches( *pReferer );
+ }
+ }
+
+ // gemaess Liste
+ return bTrusted;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::UseExternBrowser() const
+{
+ if ( pAppData_Impl->bUseExternBrowser == 2 )
+ {
+ // Noch nicht initialisiert
+ SfxIniManager* pIni = GetIniManager();
+ pAppData_Impl->bUseExternBrowser = ((BOOL) (USHORT) pIni->Get(SFX_KEY_EXTBRW_ON).ToInt32() ) &&
+ ( pIni->IsInternetExplorerAvailable() || pIni->Get( SFX_KEY_EXTBRW_FILE ).Len() );
+ }
+
+ return pAppData_Impl->bUseExternBrowser;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::ShouldUseExternalBrowser( const INetURLObject& rURL ) const
+{
+ SfxIniManager* pIni = GetIniManager();
+ if( !pIni->IsInternetExplorerAvailable() && !pIni->Get( SFX_KEY_EXTBRW_FILE ).Len() )
+ // Wenn es keinen externen Browser gibt
+ return FALSE;
+
+ // Welche Liste ?
+ SvStrings*& rpList = UseExternBrowser() ? pAppData_Impl->pExtBrwOnExceptionList
+ : pAppData_Impl->pExtBrwOffExceptionList;
+
+ // ExceptionList noch nicht geladen?
+ if ( !rpList )
+ {
+ rpList = new SvStrings;
+ USHORT nKey = pAppData_Impl->bUseExternBrowser ? SFX_KEY_EXTBRW_ON_EXCEPTION : SFX_KEY_EXTBRW_OFF_EXCEPTION;
+ USHORT nCount = pIni->Get( nKey ).ToInt32();
+ for ( USHORT i = 0; i < nCount; ++i )
+ rpList->Insert( new String( pIni->Get( nKey, i ) ), i );
+ }
+
+ BOOL bIn = FALSE;
+ String aURL( rURL.GetMainURL().ToLowerAscii() );
+ USHORT nCount = rpList->Count();
+ String aName = rURL.GetMainURL();
+
+ for ( USHORT n = 0; !bIn && n<nCount; ++n )
+ {
+ String aURL = rpList->GetObject(n)->ToLowerAscii();
+ aURL += DEFINE_CONST_UNICODE('*');
+ bIn = WildCard( aURL ).Matches( aName );
+ }
+
+ return pAppData_Impl->bUseExternBrowser ? !bIn : bIn;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
+{
+ SfxIniManager *pIni = GetIniManager();
+ pIni->EnterLock();
+ const SfxPoolItem *pItem = 0;
+ SfxItemPool &rPool = GetPool();
+ BOOL bResetSession = FALSE;
+ BOOL bProxiesModified = FALSE;
+
+ SfxToolBoxConfig *pTbxCfg = SfxToolBoxConfig::GetOrCreate();
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), TRUE, &pItem) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ USHORT nOutStyle =
+ ( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT;
+ pTbxCfg->SetOutStyle( nOutStyle );
+ }
+
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), TRUE, &pItem) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL bBigSize = ( (const SfxBoolItem*)pItem )->GetValue();
+ pTbxCfg->SetSymbolSet( bBigSize ? SFX_SYMBOLS_LARGE_COLOR : SFX_SYMBOLS_SMALL_COLOR );
+ GetWorkWindow_Impl( SfxViewFrame::Current() )->UpdateObjectBars_Impl();
+ }
+
+ // Backup
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), TRUE, &pItem) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() );
+ }
+
+ // AutoSave
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() );
+ }
+
+ // AutoSave-Propt
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // AutoSave-Time
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ pOptions->SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue());
+ }
+
+ // DocInfo
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // portable Grafiken
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_INDEP_METAFILE), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL b = ((const SfxBoolItem *)pItem)->GetValue();
+ pOptions->SetIndepGrfFmt(b);
+ }
+
+ // Grafiken komprimiert speichern
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_OPT_SAVEGRAPHICSCOMPRESSED), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL b = ((const SfxBoolItem *)pItem)->GetValue();
+ pOptions->SetSaveGraphicsCompressed(b);
+ }
+
+ // Grafiken im Original speichern
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_OPT_SAVEORIGINALGRAPHICS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL b = ((const SfxBoolItem *)pItem)->GetValue();
+ pOptions->SetSaveOriginalGraphics(b);
+ }
+
+ // offende Dokumente merken
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // offene Fenster speichern
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCWINS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetSaveDocWins(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // Fenster-Einstellung speichern
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // Metric
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ pOptions->SetMetric((FieldUnit)((const SfxUInt16Item*)pItem)->GetValue());
+ }
+
+ // Docmanager
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_DOCMANAGER), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pOptions->SetDocumentManagerConfig(((const SfxStringItem *)pItem)->GetValue());
+ }
+
+ // HelpBalloons
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetHelpBalloons(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // HelpTips
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetHelpTips(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // AutoHelpAgent
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetAutoHelpAgent( ((const SfxBoolItem *)pItem)->GetValue() );
+ }
+
+ // AutoHelpAgent-Reset
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_AUTOHELPAGENT_RESET ), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL bReset = ((const SfxBoolItem *)pItem)->GetValue();
+ Help* pHelp = Application::GetHelp();
+ if ( bReset && pHelp )
+ ((SfxHelp_Impl*)pHelp)->ResetPIStarterList();
+ }
+
+ // WelcomeScreen
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() );
+ }
+
+ // WelcomeScreen
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL bReset = ((const SfxBoolItem *)pItem)->GetValue();
+ if ( bReset )
+ {
+ Config aConfig( SfxHelp_Impl::GetHelpAgentConfig() );
+ ImplSetLanguageGroup( aConfig, DEFINE_CONST_UNICODE( "WelcomeScreen" ), TRUE );
+ USHORT nTips = aConfig.GetKeyCount();
+ ByteString aOn = ByteString::CreateFromInt32( 1 );
+ for ( USHORT nTip = 0; nTip < nTips; nTip++ )
+ aConfig.WriteKey( aConfig.GetKeyName( nTip ), aOn );
+ }
+ }
+
+ // SaveRelINet
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // SaveRelFSys
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ pOptions->SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue());
+ }
+
+ // Undo-Count
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ USHORT nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
+ pOptions->SetUndoCount( nUndoCount );
+
+ // um alle Undo-Manager zu erwischen: "uber alle Frames iterieren
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
+ pFrame;
+ pFrame = SfxViewFrame::GetNext(*pFrame) )
+ {
+ // den Dispatcher des Frames rausholen
+ SfxDispatcher *pDispat = pFrame->GetDispatcher();
+ pDispat->Flush();
+
+ // "uber alle SfxShells auf dem Stack des Dispatchers iterieren
+ USHORT nIdx = 0;
+ for ( SfxShell *pSh = pDispat->GetShell(nIdx);
+ pSh;
+ ++nIdx, pSh = pDispat->GetShell(nIdx) )
+ {
+ SfxUndoManager *pUndoMgr = pSh->GetUndoManager();
+ if ( pUndoMgr )
+ pUndoMgr->SetMaxUndoActionCount( nUndoCount );
+ }
+ }
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_HOMEPAGE), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_HOME);
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_MEMCACHE), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
+ USHORT nCount = ( (const SfxUInt16Item *)pItem )->GetValue();
+ pIni->Set( String::CreateFromInt32( nCount ), SFX_KEY_INET_MEMCACHE );
+ SfxPickList_Impl::Get()->GetMemCache().ClearToLimit( nCount );
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_DISKCACHE), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxUInt32Item), "UInt32Item expected" );
+ String aValue = String::CreateFromInt32( ( (const SfxUInt32Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_DISKCACHE );
+ bResetSession = TRUE;
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_EXPIRATION), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_CACHEEXPIRATION );
+ bResetSession = TRUE;
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_CACHEJS), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxBoolItem), "BoolItem expected" );
+ INT32 nFlag = (USHORT)( (const SfxBoolItem*)pItem )->GetValue();
+ pIni->Set( String::CreateFromInt32( nFlag ), SFX_KEY_INET_CACHEJS );
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_CACHEEXPIRED), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxBoolItem), "BoolItem expected" );
+ INT32 nFlag = (USHORT)( (const SfxBoolItem*)pItem )->GetValue();
+ pIni->Set( String::CreateFromInt32( nFlag ), SFX_KEY_INET_CACHEEXPIRED );
+ // Ist auch eine Einstellung fuer die Session
+ bResetSession = TRUE;
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_CACHEABORTED), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxBoolItem), "BoolItem expected" );
+ INT32 nFlag = (USHORT)( (const SfxBoolItem*)pItem )->GetValue();
+ pIni->Set( String::CreateFromInt32( nFlag ), SFX_KEY_INET_CACHEABORTED );
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_REVEAL_MAILADDR), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxBoolItem), "BoolItem expected" );
+ INT32 nFlag = (USHORT)( (const SfxBoolItem*)pItem )->GetValue();
+ pIni->Set( String::CreateFromInt32( nFlag ), SFX_KEY_INET_REVEAL_MAILADDR );
+ bResetSession = TRUE;
+ }
+
+ // SMTP-Server
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_SMTPSERVER), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_SMTPSERVER);
+ bResetSession = TRUE;
+ }
+
+ // POP-Server
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_POPSERVER), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_POPSERVER);
+ bResetSession = TRUE;
+ }
+
+ // NNTP-Server
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_NNTPSERVER), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_NNTPSERVER);
+ bResetSession = TRUE;
+ }
+
+ // MaxNewsMessages
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_MAXNEWS), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_MAXNEWS );
+ bResetSession = TRUE;
+ }
+
+ // MaxHttpCons
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_MAXHTTPCONS), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_MAXHTTPCONS );
+ bResetSession = TRUE;
+ }
+
+ // MaxFtpCons
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_MAXFTPCONS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_MAXFTPCONS);
+ bResetSession = TRUE;
+ }
+
+ // Mail-Gateway zum SMTP
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_SMTPGATEWAY), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_MAILGATEWAY);
+ }
+
+ // Mail-Username
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_MAILUSERNAME), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_MAILUSERNAME);
+ }
+
+ // Mail-Password
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_MAILPASSWORD), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ String aPassword( ((const SfxStringItem *)pItem)->GetValue() );
+ pIni->Set( SfxStringEncode( aPassword ), SFX_KEY_INET_MAILPASSWORD );
+ }
+
+ // Mail-Text-Format
+ if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_MAILTEXTFORMAT ), TRUE, &pItem ) )
+ {
+ DBG_ASSERT( pItem->ISA(SfxByteItem), "ByteItem expected" );
+ INT32 nFlag = (USHORT)( (const SfxByteItem*)pItem )->GetValue();
+ pIni->Set( String::CreateFromInt32( nFlag ), SFX_KEY_INET_MAILTEXTFORMAT );
+ }
+
+ // Proxy-Type
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_PROXYTYPE );
+ bResetSession = TRUE;
+ bProxiesModified = TRUE;
+ }
+
+ // NoProxy
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_NOPROXY);
+ bResetSession = TRUE;
+ bProxiesModified = TRUE;
+ }
+
+ // StarBasic Enable
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected");
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_BASIC_ENABLE );
+ }
+
+ // Java Enable
+ if ( SFX_ITEM_SET == rSet.GetItemState( SID_INET_JAVA_ENABLE, TRUE, &pItem ) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ BOOL bJava = ( (const SfxBoolItem*)pItem )->GetValue();
+ String aVal = bJava ? 0x0031 : 0x0030; // ^= '1' or '0'
+ BOOL bSet = SetJavaIniEntry_Impl( SFX_KEY_JAVA_ENABLE, aVal, pIni );
+ bResetSession = TRUE;
+ }
+ // Applets Enable
+ if ( SFX_ITEM_SET == rSet.GetItemState( SID_INET_EXE_APPLETS, TRUE, &pItem ) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ BOOL bApplets = ( (const SfxBoolItem*)pItem )->GetValue();
+ String aVal = bApplets ? 0x0031 : 0x0030; // ^= '1' or '0'
+ BOOL bSet = SetJavaIniEntry_Impl( SFX_KEY_INET_EXE_APPLETS, aVal, pIni );
+ bResetSession = TRUE;
+ }
+
+ // Java AccessType
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_JAVA_ACCESSTYPE), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
+ SjNetAccess eAccess = (SjNetAccess) ((const SfxUInt16Item *)pItem)->GetValue();
+ String aVal;
+ if ( eAccess == NET_HOST )
+ aVal = DEFINE_CONST_UNICODE("HOST");
+ else if ( eAccess == NET_UNRESTRICTED )
+ aVal = DEFINE_CONST_UNICODE("UNRESTRICTED");
+ else
+ aVal = DEFINE_CONST_UNICODE("NONE");
+ BOOL bSet = SetJavaIniEntry_Impl( SFX_KEY_JAVA_NETACCESS, aVal, pIni );
+ bResetSession = TRUE;
+ }
+
+ // Java Security
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_JAVA_SECURITY, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ BOOL bSecurity = ((const SfxBoolItem *)pItem)->GetValue();
+ String aVal = bSecurity ? 0x0031 : 0x0030; // ^= '1' or '0'
+ BOOL bSet = SetJavaIniEntry_Impl( SFX_KEY_JAVA_SECURITY, aVal, pIni );
+ bResetSession = TRUE;
+ }
+
+ // Java ClassPath
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_JAVA_CLASSPATH, TRUE, &pItem))
+ {
+ DBG_ASSERT( pItem->ISA(SfxStringItem), "SfxStringItem expected" );
+ String aVal = ( (const SfxStringItem *)pItem )->GetValue();
+ BOOL bSet = SetJavaIniEntry_Impl( SFX_KEY_JAVA_USERCLASSPATH, aVal, pIni );
+ bResetSession = TRUE;
+ }
+
+ // Execute PlugIns
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ BOOL bExe = ( (const SfxBoolItem *)pItem )->GetValue();
+ pIni->Set( bExe ? 0x0031 : 0x0030 /* ^= '1' or '0' */, SFX_KEY_INET_EXE_PLUGIN );
+ bResetSession = TRUE;
+ }
+
+ // DNS Server
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_DNS_AUTO), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL bIsAuto = ((const SfxBoolItem *)pItem)->GetValue();
+ if( bIsAuto )
+ pIni->Set( String(), SFX_KEY_INET_DNS );
+ else
+ {
+ String aDNS;
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_DNS_SERVER), TRUE, &pItem) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "SfxStringItem expected");
+ aDNS = ((const SfxStringItem *)pItem)->GetValue();
+ }
+ pIni->Set( aDNS, SFX_KEY_INET_DNS );
+ }
+ bResetSession = TRUE;
+ }
+
+ // Noncahed Server
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NONCACHED_SERVER, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_NONCACHED_SERVER);
+ bResetSession = TRUE;
+ }
+
+ // UserAgent
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_USERAGENT, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
+ pIni->Set(((const SfxStringItem *)pItem)->GetValue(), SFX_KEY_INET_USERAGENT);
+ bResetSession = TRUE;
+ }
+
+ // Proxies
+ for ( USHORT nOfs = 0;
+ nOfs <= SID_INET_SECURITY_PROXY_PORT - SID_INET_HTTP_PROXY_NAME;
+ nOfs += 2 )
+ {
+ if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME + nOfs ), TRUE, &pItem ) )
+ {
+ DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
+ String aVal( ((const SfxStringItem *)pItem)->GetValue() );
+ pIni->Set( aVal, SFX_KEY_INET_HTTPPROXYNAME+nOfs );
+ bResetSession = TRUE;
+ bProxiesModified = TRUE;
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT + nOfs ), TRUE, &pItem ) )
+ {
+ DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
+ String aValue = String::CreateFromInt32( ( (const SfxInt32Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_HTTPPROXYPORT + nOfs );
+ bResetSession = TRUE;
+ bProxiesModified = TRUE;
+ }
+ }
+
+ // Channels
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_CHANNELS_ONOFF, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ BOOL bExe = ((const SfxBoolItem *)pItem)->GetValue();
+ pIni->Set( bExe ? 0x0031 : 0x0030 /* ^= '1' or '0' */, SFX_KEY_INET_CHANNELS );
+ }
+
+ // Cookies
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_COOKIESHANDLE, TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxUInt16Item expected");
+ String aValue = String::CreateFromInt32( ( (const SfxUInt16Item*)pItem )->GetValue() );
+ pIni->Set( aValue, SFX_KEY_INET_COOKIES );
+ }
+
+ // Secure-Referers
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, TRUE, &pItem))
+ {
+ DELETEZ(pAppData_Impl->pSecureURLs);
+
+ DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
+ const List *pList = ((SfxStringListItem*)pItem)->GetList();
+ pIni->Set( String::CreateFromInt32( pList->Count() ), SFX_KEY_SECURE_URL );
+ for ( USHORT n = 0; n < pList->Count(); ++n )
+ pIni->Set( *(const String*)(pList->GetObject(n)), SFX_KEY_SECURE_URL, n );
+ }
+
+ // ExternBrowser
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_OPT_EXTBRW_ON, TRUE, &pItem) )
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
+ BOOL bOn = ((const SfxBoolItem *)pItem)->GetValue();
+ pIni->Set( bOn ? 0x0031 : 0x0030 /* ^= '1' or '0' */, SFX_KEY_EXTBRW_ON );
+ pAppData_Impl->bUseExternBrowser = bOn &&
+ ( pIni->IsInternetExplorerAvailable() || pIni->Get( SFX_KEY_EXTBRW_FILE ).Len() );
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_OPT_EXTBRW_ON_EXCEPTION, TRUE, &pItem))
+ {
+ DELETEZ(pAppData_Impl->pExtBrwOnExceptionList);
+ DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
+ const List* pList = ((SfxStringListItem*)pItem)->GetList();
+ ULONG n, nCount = pIni->Get( SFX_KEY_EXTBRW_ON_EXCEPTION ).ToInt32();
+ for ( n = 0; n < nCount; ++n )
+ pIni->Delete( SFX_KEY_EXTBRW_ON_EXCEPTION, n );
+ nCount = pList->Count();
+ pIni->Set( String::CreateFromInt32( nCount ), SFX_KEY_EXTBRW_ON_EXCEPTION );
+ for ( n = 0; n < nCount; ++n )
+ pIni->Set( *(const String*)(pList->GetObject(n)), SFX_KEY_EXTBRW_ON_EXCEPTION, n );
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_OPT_EXTBRW_OFF_EXCEPTION, TRUE, &pItem))
+ {
+ DELETEZ(pAppData_Impl->pExtBrwOffExceptionList);
+ DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
+ const List* pList = ((SfxStringListItem*)pItem)->GetList();
+ ULONG n, nCount = pIni->Get( SFX_KEY_EXTBRW_OFF_EXCEPTION ).ToInt32();
+ for ( n = 0; n < nCount; ++n )
+ pIni->Delete( SFX_KEY_EXTBRW_OFF_EXCEPTION, n );
+ nCount = pList->Count();
+ pIni->Set( String::CreateFromInt32( nCount ), SFX_KEY_EXTBRW_OFF_EXCEPTION );
+ for ( n = 0; n < nCount; ++n )
+ pIni->Set( *(const String*)(pList->GetObject(n)), SFX_KEY_EXTBRW_OFF_EXCEPTION, n );
+ }
+
+ // EnableMetafilePrint
+ if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ), TRUE, &pItem ) )
+ {
+ DBG_ASSERT( pItem->ISA(SfxBoolItem), "BoolItem expected" );
+ BOOL bPrint = (( const SfxBoolItem*)pItem )->GetValue();
+ pIni->Set( bPrint ? 0x0031 : 0x0030 /* ^= '1' or '0' */, SFX_KEY_METAFILEPRINT );
+ }
+
+ // Web-View
+ if( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_ALLOWFOLDERWEBVIEW), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxStringItem), "SfxStringItem expected");
+ pIni->Set(((const SfxStringItem*)pItem)->GetValue(), SFX_KEY_ALLOWFOLDERWEBVIEW);
+ }
+
+ // Explorer
+ String aIconGrid( pIni->Get(SFX_KEY_ICONGRID) );
+ Size aGrid( aIconGrid.GetToken(0).ToInt32(), aIconGrid.GetToken(1).ToInt32() );
+ UINT16 nMode = (UINT16)aIconGrid.GetToken(2).ToInt32();
+ BOOL bSet = FALSE;
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_AUTO_ADJUSTICONS, TRUE, &pItem) )
+ {
+ const SfxUInt16Item *pUInt16Item = (const SfxUInt16Item*) pItem;
+ nMode = pUInt16Item->GetValue();
+ bSet = TRUE;
+ }
+ if ( SFX_ITEM_SET == rSet.GetItemState(SID_ICONGRID, TRUE, &pItem) )
+ {
+ const SfxSizeItem *pSizeItem = (const SfxSizeItem*) pItem;
+ aGrid = pSizeItem->GetValue();
+ bSet = TRUE;
+ }
+ if ( bSet )
+ {
+ aIconGrid = String::CreateFromInt32( aGrid.Width() );
+ aIconGrid += DEFINE_CONST_UNICODE( ";" );
+ aIconGrid += String::CreateFromInt32( aGrid.Height() );
+ aIconGrid += DEFINE_CONST_UNICODE( ";" );
+ aIconGrid += String::CreateFromInt32( nMode );
+ pIni->Set( aIconGrid, SFX_KEY_ICONGRID );
+ }
+
+ if ( SFX_ITEM_SET == rSet.GetItemState( SID_RESTORE_EXPAND_STATE, TRUE, &pItem ) )
+ {
+ DBG_ASSERT( pItem->ISA(SfxBoolItem), "BoolItem expected" );
+ BOOL bRestoreExpand = ( (const SfxBoolItem*)pItem )->GetValue();
+ pIni->Set( bRestoreExpand ? 0x0031 : 0x0030 /* ^= '1' or '0' */, SFX_KEY_AUTOOPEN );
+ }
+
+ if ( bResetSession )
+ {
+ NAMESPACE_INET(INetWrapper) aWrapper;
+ ::vos::ORef< ::inet::INetConfig > xINetConfig;
+ if ( aWrapper.getINetConfig( xINetConfig ) )
+ {
+ xINetConfig->setDomainNameServer( pIni->Get( SFX_KEY_INET_DNS ) );
+ xINetConfig->setUserAgent( pIni->Get( SFX_KEY_INET_USERAGENT ) );
+
+ if ( bProxiesModified )
+ {
+ ::inet::INetProxyConfig aProxyCfg (xINetConfig->getProxyConfig());
+ USHORT bProxy = (USHORT)(pIni->Get (SFX_KEY_INET_PROXYTYPE).ToInt32());
+ if (bProxy)
+ aProxyCfg.setNoProxyList(pIni->Get (SFX_KEY_INET_NOPROXY));
+ else
+ aProxyCfg.setNoProxyList(DEFINE_CONST_UNICODE("*:*"));
+
+ aProxyCfg.setHttpProxy (
+ pIni->Get (SFX_KEY_INET_HTTPPROXYNAME),
+ pIni->Get (SFX_KEY_INET_HTTPPROXYPORT).ToInt32());
+
+ aProxyCfg.setFtpProxy (
+ pIni->Get (SFX_KEY_INET_FTPPROXYNAME),
+ pIni->Get (SFX_KEY_INET_FTPPROXYPORT).ToInt32());
+
+ aProxyCfg.setSecureSocketProxy (
+ pIni->Get (SFX_KEY_INET_SECURITYPROXYNAME),
+ pIni->Get (SFX_KEY_INET_SECURITYPROXYPORT).ToInt32());
+
+ aProxyCfg.setSocksProxy (
+ pIni->Get (SFX_KEY_INET_SOCKSPROXYNAME),
+ pIni->Get (SFX_KEY_INET_SOCKSPROXYPORT).ToInt32());
+
+ xINetConfig->setProxyConfig (aProxyCfg);
+ }
+ }
+ }
+
+ // AutoSave starten oder anhalten
+ UpdateAutoSave_Impl();
+
+ // INet Session neu aufsetzen
+ if ( bResetSession )
+ {
+ try
+ {
+ SjApplet2::settingsChanged();
+ }
+ catch ( ... )
+ {
+ DBG_ERRORFILE( "SjApplet2::settingsChanged() throws an exception" );
+ }
+ }
+
+ // geaenderte Daten speichern
+ pIni->LeaveLock();
+ pIni->Flush();
+ SaveConfiguration();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetOptions(const SfxItemSet &rSet)
+{
+ // Daten werden in DocInfo und IniManager gespeichert
+ SfxDocumentInfo *pDocInf = SfxObjectShell::Current()
+ ? &SfxObjectShell::Current()->GetDocInfo()
+ : 0;
+ const SfxPoolItem *pItem = 0;
+ SfxItemPool &rPool = GetPool();
+
+ SfxAllItemSet aSendSet( rSet );
+
+ // portable Grafiken
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_INDEP_METAFILE), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL b = ((const SfxBoolItem *)pItem)->GetValue();
+ if ( pDocInf )
+ pDocInf->SetPortableGraphics(b);
+ }
+
+ // Grafiken komprimiert speichern
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_OPT_SAVEGRAPHICSCOMPRESSED), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL b = ((const SfxBoolItem *)pItem)->GetValue();
+ if ( pDocInf )
+ pDocInf->SetSaveGraphicsCompressed(b);
+ }
+
+ // Grafiken im Original speichern
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_OPT_SAVEORIGINALGRAPHICS), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
+ BOOL b = ((const SfxBoolItem *)pItem)->GetValue();
+ if ( pDocInf )
+ pDocInf->SetSaveOriginalGraphics(b);
+ }
+
+ // PathName
+ if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), TRUE, &pItem))
+ {
+ DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected");
+ GetAppIniManager()->Set(SFX_GROUP_DIR, *(const SfxAllEnumItem *)pItem);
+ aSendSet.ClearItem( rPool.GetWhich( SID_ATTR_PATHNAME ) );
+ }
+
+ SetOptions_Impl( rSet );
+
+ // Undo-Count
+ Broadcast( SfxItemSetHint( rSet ) );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::UpdateAutoSave_Impl()
+{
+ pImp->pAutoSaveTimer->Stop();
+
+ // AutoSave soll ab jetzt neu anlaufen
+ if ( pOptions->IsAutoSave() )
+ {
+ pImp->pAutoSaveTimer->SetTimeout( pOptions->GetAutoSaveTime() * 60000 );
+ pImp->pAutoSaveTimer->Start();
+ }
+}
+
+//--------------------------------------------------------------------
+
+
+Timer* SfxApplication::GetAutoSaveTimer_Impl()
+{
+ return pImp->pAutoSaveTimer;
+}
+
+//--------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, AutoSaveHdl_Impl, Timer*, pTimer )
+{
+ FASTBOOL bAutoSave = pOptions->IsAutoSave() &&
+ !bDispatcherLocked && !Application::IsInModalMode() &&
+ !Application::IsUICaptured() && Application::GetLastInputInterval() > 300;
+ if ( bAutoSave )
+ {
+ SfxViewShell *pVSh = pViewFrame ? pViewFrame->GetViewShell() : 0;
+ bAutoSave = pVSh && pVSh->GetWindow() &&
+ !pVSh->GetWindow()->IsMouseCaptured() ;
+ }
+
+ if ( bAutoSave )
+ {
+ SaveAll_Impl( pOptions->IsAutoSavePrompt(), TRUE );
+ pImp->bAutoSaveNow = FALSE;
+ pImp->pAutoSaveTimer->SetTimeout( pOptions->GetAutoSaveTime() * 60000 );
+ pImp->pAutoSaveTimer->Start();
+ }
+ else if ( pOptions->IsAutoSave() )
+ {
+ // Wenn wir gelockt sind, dann in 5 Sekunden nochmal probieren
+ pImp->bAutoSaveNow = TRUE;
+ pImp->pAutoSaveTimer->SetTimeout( 5000 );
+ pImp->pAutoSaveTimer->Start();
+
+#ifndef PRODUCT
+ Sound::Beep();
+#endif
+ }
+
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+// alle Dokumente speichern
+
+BOOL SfxApplication::SaveAll_Impl(BOOL bPrompt, BOOL bAutoSave)
+{
+ BOOL bFunc = TRUE;
+ short nRet;
+
+ for ( SfxObjectShell *pDoc = SfxObjectShell::GetFirst();
+ pDoc;
+ pDoc = SfxObjectShell::GetNext(*pDoc) )
+ {
+ if( SFX_CREATE_MODE_STANDARD == pDoc->GetCreateMode() &&
+ SfxViewFrame::GetFirst(pDoc) )
+ {
+ if ( pDoc->GetProgress() == 0 )
+ {
+ if (!pDoc->IsModified() ||
+ bAutoSave && pDoc->GetModifyTime()<pImp->aAutoSaveTime)
+ continue;
+
+ if ( bPrompt || (bAutoSave && !pDoc->HasName()) )
+ nRet = QuerySave_Impl( *pDoc, bAutoSave );
+ else
+ nRet = RET_YES;
+
+ if ( nRet == RET_YES )
+ {
+ SfxRequest aReq( SID_SAVEDOC, 0, pDoc->GetPool() );
+ const SfxPoolItem *pPoolItem = pDoc->ExecuteSlot( aReq );
+ if ( !pPoolItem || !pPoolItem->ISA(SfxBoolItem) ||
+ !( (const SfxBoolItem*) pPoolItem )->GetValue() )
+ bFunc = FALSE; // kein Abbruch mehr!
+ }
+ else if ( nRet == RET_CANCEL )
+ {
+ bFunc = FALSE; // kein Abbruch mehr!
+ break;
+ }
+ else if ( nRet == RET_NO )
+ {
+ }
+ }
+ }
+ }
+ pImp->aAutoSaveTime=Time();
+ return bFunc;
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroConfig* SfxApplication::GetMacroConfig() const
+{
+ return SfxMacroConfig::GetOrCreate();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RegisterEvent(USHORT nId, const String& rEventName)
+{
+ if (!pAppData_Impl->pEventConfig)
+ pAppData_Impl->pEventConfig = new SfxEventConfiguration;
+ pAppData_Impl->pEventConfig->RegisterEvent(nId, rEventName);
+}
+
+//--------------------------------------------------------------------
+
+SfxEventConfiguration* SfxApplication::GetEventConfig() const
+{
+ return pAppData_Impl->pEventConfig;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SaveConfiguration() const
+{
+ if ( !bDowning )
+ {
+ // bei bDowning koennten falsche Sachen gespeichert werden bishin
+ // zu Abstuerzen
+ if (!pAppData_Impl->pAppCfg->SaveConfig())
+ HandleConfigError_Impl((USHORT)pCfgMgr->GetErrorCode());
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxConfigManager* SfxApplication::GetAppConfigManager_Impl() const
+{
+ return pAppData_Impl->pAppCfg;
+}
+//--------------------------------------------------------------------
+
+void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, FASTBOOL bSynchron )
+{
+ DBG_ASSERT(pAppData_Impl->pEventConfig,"Keine Events angemeldet!");
+
+ SfxObjectShell *pDoc = rEventHint.GetObjShell();
+ if ( !pDoc || !pDoc->IsPreview() )
+ pAppData_Impl->pEventConfig->ExecuteEvent( rEventHint.GetEventId(), pDoc, bSynchron, rEventHint.GetArgs() );
+ Broadcast(rEventHint);
+ if ( pDoc )
+ pDoc->Broadcast( rEventHint );
+}
+
+//-------------------------------------------------------------------------
+/* ASOBSOLETE
+static void CorrectUpdateNumber_Impl(String& rName)
+{
+ String aUPD( SOLARUPD );
+ USHORT nLen = aUPD.Len();
+ USHORT nCount,nPos=0;
+ do
+ {
+ nCount=0;
+ xub_StrLen nNameLength = rName.Len();
+ for ( USHORT i=nPos; i<nNameLength; i++ )
+ {
+ if ( rName.GetChar(i).CompareToAscii('?') == COMPARE_EQUAL )
+ {
+ if ( nCount == 0 )
+ nPos=i;
+ nCount++;
+ }
+ else if ( nCount == nLen )
+ break;
+ else
+ nCount=0;
+ }
+ if ( nCount == nLen )
+ {
+ rName.Replace( aUPD, nPos );
+ nPos += nCount;
+ }
+ }
+ while ( nCount );
+}
+*/
+
+void SfxApplicationClass::Property( ApplicationProperty& rProp )
+{
+ SfxApplication* pApp = SFX_APP();
+ SfxIniManager* pIni = pApp->GetIniManager();
+
+ // AppIniManger?
+ SfxAppIniManagerProperty* pAppIniMgr = PTR_CAST(SfxAppIniManagerProperty, &rProp);
+ if ( pAppIniMgr )
+ {
+ pAppIniMgr->SetIniManager( pIni );
+ return;
+ }
+
+ TTProperties* pTTProperties = PTR_CAST( TTProperties, &rProp );
+ if ( pTTProperties )
+ {
+ pTTProperties->nPropertyVersion = TT_PROPERTIES_VERSION;
+ switch ( pTTProperties->nActualPR )
+ {
+ case TT_PR_SLOTS:
+ {
+ pTTProperties->nSidOpenUrl = SID_OPENURL;
+ pTTProperties->nSidFileName = SID_FILE_NAME;
+ pTTProperties->nSidNewDocDirect = SID_NEWDOCDIRECT;
+ pTTProperties->nSidCopy = SID_COPY;
+ pTTProperties->nSidPaste = SID_PASTE;
+ pTTProperties->nSidSourceView = SID_SOURCEVIEW;
+ pTTProperties->nSidSelectAll = SID_SELECTALL;
+ pTTProperties->nSidReferer = SID_REFERER;
+ pTTProperties->nActualPR = 0;
+ }
+ break;
+ case TT_PR_DISPATCHER:
+ {
+ SfxDispatcher* pDispatcher = SfxViewFrame::Current()->GetDispatcher();
+ if ( !pDispatcher )
+ pTTProperties->nActualPR = TT_PR_ERR_NODISPATCHER;
+ else
+ {
+ pDispatcher->SetExecuteMode(EXECUTEMODE_DIALOGASYNCHRON);
+ if ( pDispatcher->ExecuteFunction(
+ pTTProperties->mnSID, pTTProperties->mppArgs, pTTProperties->mnMode )
+ == EXECUTE_NO )
+ pTTProperties->nActualPR = TT_PR_ERR_NOEXECUTE;
+ else
+ pTTProperties->nActualPR = 0;
+ }
+ }
+ break;
+ case TT_PR_IMG:
+ {
+ SvDataMemberObjectRef aDataObject = new SvDataMemberObject();
+ SvData* pDataBmp = new SvData( FORMAT_BITMAP );
+ pDataBmp->SetData( pTTProperties->mpBmp );
+ aDataObject->Append( pDataBmp );
+ aDataObject->CopyClipboard();
+ pTTProperties->nActualPR = 0;
+ }
+ break;
+ default:
+ {
+ pTTProperties->nPropertyVersion = 0;
+ }
+ }
+ return;
+ }
+}
+
+IMPL_OBJHINT( SfxStringHint, String )
+
+OfaMiscCfg* SfxApplication::GetMiscConfig()
+{
+ if ( !pAppData_Impl->pMiscConfig )
+ {
+ pAppData_Impl->pMiscConfig = new OfaMiscCfg;
+ pAppData_Impl->pMiscConfig->Initialize();
+ }
+
+ return pAppData_Impl->pMiscConfig;
+}
+
+
diff --git a/sfx2/source/appl/appchild.cxx b/sfx2/source/appl/appchild.cxx
new file mode 100644
index 000000000000..66a97c433ce8
--- /dev/null
+++ b/sfx2/source/appl/appchild.cxx
@@ -0,0 +1,451 @@
+/*************************************************************************
+ *
+ * $RCSfile: appchild.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+
+#include "app.hxx"
+#include "appdata.hxx"
+#include "workwin.hxx"
+#include "childwin.hxx"
+#include "arrdecl.hxx"
+#include "templdlg.hxx"
+#include "sfxhelp.hxx"
+#include "ipfrm.hxx"
+#include "ipenv.hxx"
+#include "request.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "module.hxx"
+#include "sfxsids.hrc"
+
+//=========================================================================
+
+ResId SfxApplication::GetCurrentObjectBar( USHORT nPosId ) const
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann die ResId der an der angegebenen Positions-Nummer
+ aktuell stehenden Symbol-Leiste erfragt werden. Als Positions-Nummern
+ k"onnen verwendet werden:
+
+ SFX_OBJECTBAR_APPLICATION
+ SFX_OBJECTBAR_OBJECT
+ SFX_OBJECTBAR_TOOLS
+ SFX_OBJECTBAR_MACRO
+ SFX_OBJECTBAR_FULLSCREEN
+ SFX_OBJECTBAR_RECORDING
+ SFX_OBJECTBAR_OPTIONS
+ SFX_OBJECTBAR_USERDEF1
+ SFX_OBJECTBAR_USERDEF2
+ SFX_OBJECTBAR_USERDEF3
+
+ Ist an der Position keine Symbol-Leiste vorhanden, dann wird eine ResId
+ mit einer Id von 0 und ohne ResManager zur"uckgegeben.
+
+
+ [Anmerkung]
+
+ Da intern keine fertige ResId verf"ugbar ist, mu\s leider eine Instanz
+ returnt werden.
+*/
+
+{
+ ResId aResId(0, 0);
+ SfxWorkWindow* pWork = GetWorkWindow_Impl(SfxViewFrame::Current());
+ if ( pWork )
+ pWork->GetObjectBar_Impl(nPosId, aResId);
+ return aResId;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RegisterChildWindow( SfxModule *pMod, SfxChildWinFactory *pFact )
+{
+ if ( pMod )
+ {
+ pMod->RegisterChildWindow( pFact );
+ return;
+ }
+
+ if (!pAppData_Impl->pFactArr)
+ pAppData_Impl->pFactArr = new SfxChildWinFactArr_Impl;
+
+//#ifdef DBG_UTIL
+ for (USHORT nFactory=0; nFactory<pAppData_Impl->pFactArr->Count(); ++nFactory)
+ {
+ if (pFact->nId == (*pAppData_Impl->pFactArr)[nFactory]->nId)
+ {
+ pAppData_Impl->pFactArr->Remove( nFactory );
+// DBG_ERROR("ChildWindow mehrfach registriert!");
+// return;
+ }
+ }
+//#endif
+
+ pAppData_Impl->pFactArr->C40_INSERT(
+ SfxChildWinFactory, pFact, pAppData_Impl->pFactArr->Count() );
+}
+
+void SfxApplication::RegisterChildWindowContext( SfxModule *pMod, USHORT nId,
+ SfxChildWinContextFactory *pFact)
+{
+ SfxChildWinFactArr_Impl *pFactories;
+ SfxChildWinFactory *pF = NULL;
+ if ( pMod )
+ {
+ // Modul "ubergeben, ChildwindowFactory dort suchen
+ pFactories = pMod->GetChildWinFactories_Impl();
+ if ( pFactories )
+ {
+ USHORT nCount = pFactories->Count();
+ for (USHORT nFactory=0; nFactory<nCount; ++nFactory)
+ {
+ SfxChildWinFactory *pFac = (*pFactories)[nFactory];
+ if ( nId == pFac->nId )
+ {
+ // Factory gefunden, Context dort registrieren
+ pF = pFac;
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !pF )
+ {
+ // Factory an der Application suchen
+ DBG_ASSERT( pAppData_Impl, "Keine AppDaten!" );
+ DBG_ASSERT( pAppData_Impl->pFactArr, "Keine Factories!" );
+
+ pFactories = pAppData_Impl->pFactArr;
+ USHORT nCount = pFactories->Count();
+ for (USHORT nFactory=0; nFactory<nCount; ++nFactory)
+ {
+ SfxChildWinFactory *pFac = (*pFactories)[nFactory];
+ if ( nId == pFac->nId )
+ {
+ if ( pMod )
+ {
+ // Wenn der Context von einem Modul registriert wurde,
+ // mu\s die ChildwindowFactory auch dort zur Verf"ugung
+ // stehen, sonst m"u\ste sich die Contextfactory im DLL-Exit
+ // wieder abmelden !
+ pF = new SfxChildWinFactory( pFac->pCtor, pFac->nId,
+ pFac->nPos );
+ pMod->RegisterChildWindow( pF );
+ }
+ else
+ pF = pFac;
+ break;
+ }
+ }
+ }
+
+ if ( pF )
+ {
+ if ( !pF->pArr )
+ pF->pArr = new SfxChildWinContextArr_Impl;
+ pF->pArr->C40_INSERT( SfxChildWinContextFactory, pFact, pF->pArr->Count() );
+ return;
+ }
+
+ DBG_ERROR( "Kein ChildWindow fuer diesen Context!" );
+}
+
+//--------------------------------------------------------------------
+
+SfxChildWinFactArr_Impl& SfxApplication::GetChildWinFactories_Impl() const
+{
+ return ( *(pAppData_Impl->pFactArr));
+}
+
+//--------------------------------------------------------------------
+#if SUPD<604
+void SfxApplication::SetChildWindow(USHORT nId, BOOL bOn)
+{
+ if ( pViewFrame )
+ pViewFrame->SetChildWindow( nId, bOn );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::ToggleChildWindow(USHORT nId)
+{
+
+ if ( pViewFrame )
+ pViewFrame->ToggleChildWindow( nId );
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::HasChildWindow( USHORT nId )
+{
+ if ( pViewFrame )
+ return pViewFrame->HasChildWindow(nId);
+ else
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::KnowsChildWindow( USHORT nId )
+{
+ if ( pViewFrame )
+ return pViewFrame->KnowsChildWindow(nId);
+ else
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::ShowChildWindow( USHORT nId, BOOL bVisible )
+{
+ if ( pViewFrame )
+ pViewFrame->ShowChildWindow(nId, bVisible);
+}
+
+//--------------------------------------------------------------------
+
+SfxChildWindow* SfxApplication::GetChildWindow(USHORT nId)
+{
+ if ( pViewFrame )
+ return pViewFrame->GetChildWindow(nId);
+ else
+ return NULL;
+}
+
+#endif
+
+//--------------------------------------------------------------------
+
+SfxTemplateDialog* SfxApplication::GetTemplateDialog()
+{
+ if ( pViewFrame )
+ {
+ SfxChildWindow *pChild = pViewFrame->GetChildWindow(SfxTemplateDialogWrapper::GetChildWindowId());
+ return pChild ? (SfxTemplateDialog*) pChild->GetWindow() : 0;
+ }
+
+ return NULL;
+}
+
+//--------------------------------------------------------------------
+
+SfxHelpPI* SfxApplication::GetHelpPI()
+{
+ if ( pViewFrame )
+ {
+ SfxChildWindow *pChild = pViewFrame->GetChildWindow(SfxHelpPIWrapper::GetChildWindowId());
+ return pChild ? (SfxHelpPI*) pChild->GetWindow() : 0;
+ }
+
+ return NULL;
+}
+
+//--------------------------------------------------------------------
+
+SfxWorkWindow* SfxApplication::GetWorkWindow_Impl(const SfxViewFrame *pFrame) const
+{
+ SfxInPlaceFrame *pIPFrame = PTR_CAST(SfxInPlaceFrame,pFrame);
+ if ( pIPFrame )
+ return pIPFrame->GetEnv_Impl()->GetWorkWindow();
+ else
+ {
+ if ( pFrame )
+ return pFrame->GetFrame()->GetWorkWindow_Impl();
+ else if ( pViewFrame )
+ {
+ SfxInPlaceFrame *pIPFrame = PTR_CAST(SfxInPlaceFrame,pViewFrame);
+ if ( pIPFrame )
+ return pViewFrame->GetParentViewFrame_Impl()->GetFrame()->GetWorkWindow_Impl();
+// return pIPFrame->GetEnv_Impl()->GetWorkWindow();
+ else
+ return pViewFrame->GetFrame()->GetWorkWindow_Impl();
+ }
+ else
+ return NULL;
+ }
+}
+
+//--------------------------------------------------------------------
+#if SUPD<604
+void SfxApplication::ChildWindowExecute( SfxRequest &rReq )
+
+/* [Beschreibung]
+
+ Diese Methode kann in der Execute-Methode f"ur das ein- und ausschalten
+ von Child-Windows eingesetzt werden, um dieses inkl. API-Anbindung zu
+ implementieren.
+
+ Einfach in der IDL als 'ExecuteMethod' eintragen.
+*/
+
+{
+ // Parameter auswerten
+ USHORT nSID = rReq.GetSlot();
+
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSID, FALSE);
+ BOOL bShow = FALSE;
+ BOOL bHasChild = HasChildWindow(nSID);
+ bShow = pShowItem ? pShowItem->GetValue() : !bHasChild;
+
+ if ( bShow && ( nSID == SID_HELP_PI ) )
+ {
+ // Nur starten wenn Hilfe installiert...
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*)Application::GetHelp();
+ if ( !pHelp || !pHelp->CheckHelpFile( TRUE ) )
+ return;
+ }
+
+ // ausf"uhren
+ if ( !pShowItem || bShow != bHasChild )
+ {
+ // Vor dem Toggle ausf"uhren, denn hartes Anschalten hat Vorrang
+ // vor weichem Anschalten
+ if ( nSID == SID_BROWSER )
+ SfxFrame::BeamerSwitched_Impl( bShow );
+
+ ToggleChildWindow( nSID );
+
+ if ( bShow && nSID == SID_BROWSER )
+ {
+ // Beamer soll sichtbar sein, da explizit eingeschaltet
+ SfxChildWindow* pChild = SFX_APP()->GetChildWindow( SID_BROWSER );
+ if ( pChild )
+ {
+// SfxExplorerHorizDockWnd_Impl* pBeamer = (SfxExplorerHorizDockWnd_Impl*) pChild->GetWindow();
+// pBeamer->AutoShow_Impl( TRUE );
+ }
+ }
+ }
+
+ GetBindings().Invalidate( nSID );
+ GetDispatcher().Update_Impl( TRUE );
+
+ if ( bShow && ( nSID == SID_HELP_PI ) )
+ GetpApp()->FocusChanged(); // Hilfe passend zum FocusWindow...
+
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( nSID, bShow ) );
+
+ rReq.Done();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::ChildWindowState( SfxItemSet& rState )
+
+/* [Beschreibung]
+
+ Diese Methode kann in der Status-Methode f"ur das Ein- und Ausschalt-
+ Zustand von Child-Windows eingesetzt werden, um dieses zu implementieren.
+
+ Einfach in der IDL als 'StateMethod' eintragen.
+*/
+
+{
+ SfxWhichIter aIter( rState );
+ for ( USHORT nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
+ {
+ if ( nSID == SID_CUSTOMIZETOOLBOX )
+ {
+ if ( pViewFrame &&
+ pViewFrame->GetFrame()->HasComponent() &&
+ pViewFrame->GetViewShell()->GetMenuBar_Impl() )
+ rState.DisableItem(nSID);
+ }
+ else if ( nSID == SID_HYPERLINK_DIALOG )
+ {
+ const SfxPoolItem* pDummy = NULL;
+ SfxItemState eState = GetDispatcher().QueryState( SID_HYPERLINK_SETLINK, pDummy );
+ if ( SFX_ITEM_DISABLED == eState )
+ rState.DisableItem(nSID);
+ else
+ {
+ if ( KnowsChildWindow(nSID) )
+ rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID)) );
+ else
+ rState.DisableItem(nSID);
+ }
+ }
+ else if ( nSID == SID_MAIL_CHILDWIN )
+//! (pb) temporary till the implementation is finished
+ rState.DisableItem(nSID);
+ else if ( nSID == SID_HELP_PI )
+//! (pb) what about help?
+ rState.DisableItem(nSID);
+ else if ( KnowsChildWindow(nSID) )
+ rState.Put( SfxBoolItem( nSID, HasChildWindow(nSID) ) );
+ else
+ rState.DisableItem(nSID);
+ }
+}
+
+#endif
diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
new file mode 100644
index 000000000000..916de4d3a74d
--- /dev/null
+++ b/sfx2/source/appl/appdata.cxx
@@ -0,0 +1,602 @@
+/*************************************************************************
+ *
+ * $RCSfile: appdata.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _CACHESTR_HXX //autogen
+#include <tools/cachestr.hxx>
+#endif
+#ifndef _SV_CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _INIMAN_HXX
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _INETSTRM_HXX //autogen
+#include <svtools/inetstrm.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+
+#define _SVSTDARR_STRINGS
+#include <svtools/svstdarr.hxx>
+#include <vos/mutex.hxx>
+#pragma hdrstop
+
+#include <vcl/menu.hxx>
+
+#include "viewfrm.hxx"
+#include "appdata.hxx"
+#include "bitset.hxx"
+#include "dispatch.hxx"
+#include "event.hxx"
+#include "sfxtypes.hxx"
+#include "sfxdir.hxx"
+#include "doctempl.hxx"
+
+#ifndef _LOGINERR_HXX
+#include <svtools/loginerr.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _DATETIMEITEM_HXX //autogen
+#include <svtools/dateitem.hxx>
+#endif
+#ifndef _SV_MENU_HXX
+#include <vcl/menu.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <vcl/wrkwin.hxx>
+#endif
+
+#include "dataurl.hxx"
+#include "arrdecl.hxx"
+#include "docfac.hxx"
+#include "picklist.hxx"
+#include "docfile.hxx"
+#include "request.hxx"
+#include "referers.hxx"
+#include "app.hrc"
+#include "sfxresid.hxx"
+#include "objshimp.hxx"
+#include "inimgr.hxx"
+#include "ucbhelp.hxx"
+#include "appuno.hxx"
+
+class SfxModelCollection;
+class SvVerbList;
+class SfxProgress;
+class SfxConfigManager;
+class SfxChildWinFactArr_Impl;
+class SfxToolBoxConfig;
+class SfxMacro;
+class SfxDdeDocTopics_Impl;
+class DdeService;
+class SfxEventConfiguration;
+class SfxMacroConfig;
+class SvFactory;
+class SfxItemPool;
+class SfxInitLinkList;
+class NotesData;
+class SfxFilterMatcher;
+class DemoData_Impl;
+class SfxExplorer;
+class SfxMenuBarManager;
+class StopButtonTimer_Impl;
+class SvUShorts;
+class SfxNodeData_Impl;
+class SfxSIDList_Impl;
+struct SfxFrameObjectFactoryPtr;
+struct SfxPluginObjectFactoryPtr;
+class ISfxTemplateCommon;
+class SfxAnchorJobList_Impl;
+class SfxFilterMatcher;
+
+#ifdef _USE_NAMESPACE
+using namespace ::vos;
+#endif
+
+extern int put_GlobalOffline( int bOffline );
+
+class SfxIniDefaultManager
+{};
+
+//--------------------------------------------------------------------
+// SfxAppData_Impl
+//--------------------------------------------------------------------
+
+SfxAppData_Impl::SfxAppData_Impl( SfxApplication* pApp ) :
+ pAppCfg (0),
+ pProgress(0),
+ pPool(0),
+ pFactArr(0),
+ pMacro(0),
+ pODKLib(0),
+ nConfigManagerAvailable(-1),
+ pDdeService( 0 ),
+ pDocTopics( 0 ),
+ pEventConfig(0),
+ pSfxApplicationObjectFactory(0),
+ nAsynchronCalls(0),
+ pVerbs(0),
+ nBasicCallLevel(0),
+ nRescheduleLocks(0),
+ nInReschedule(0),
+ pDemoData(0),
+ pInitLinkList(0),
+ pMatcher( 0 ),
+ pExplorer(0),
+ pSfxPlugInObjectShellFactory( 0 ),
+ pDefFocusWin( 0 ),
+ pAppManager( 0 ),
+ pSfxFrameObjectFactoryPtr( 0 ),
+ pIniDefMgr( 0 ),
+ pPlugService( 0 ),
+ pStopButtonTimer( 0 ),
+ pCancelMgr( 0 ),
+ nDocModalMode(0),
+ pDisabledSlotList( 0 ),
+ pFilterIni( 0 ),
+ pISfxModule( 0 ),
+ pSfxPluginObjectFactoryPtr( 0 ),
+ pNodeData_Impl( 0 ),
+ pSIDList_Impl( 0 ),
+ pTemplateCommon( 0 ),
+ pActiveInplaceWindow( 0 ),
+ pAnchorJobList( 0 ),
+ pLabelResMgr( 0 ),
+ nDemoKind( 0 ),
+ pTopFrames( new SfxFrameArr_Impl ),
+ pTrash(0),
+ pSecureURLs(0),
+ nAutoTabPageId(0),
+ pDataLockBytesFactory( 0 ),
+ nExecutingSID( 0 ),
+ pImageLockBytesFactory( 0 ),
+ pInfoLockBytesFactory( 0 ),
+ pNewMenu( 0 ),
+ pBookmarkMenu( 0 ),
+ pAutoPilotMenu( 0 ),
+ pStartMenu( 0 ),
+ pAppDispatch(NULL),
+ pTriggerTopic(0),
+ pDdeService2(0),
+ pExtBrwOnExceptionList(NULL),
+ pExtBrwOffExceptionList(NULL),
+ pMiscConfig(0),
+ pThisDocument(0),
+ bMultiQuickSearch( 2 ),
+ bShowFsysExtension( 2 ),
+ bUseExternBrowser(2), // Zugriff auf INIMAN jetzt noch nicht m"oglich
+ bAccelEnabled(sal_False),
+ bIBMTitle(sal_False),
+ bOLEResize(sal_False),
+ bDirectAliveCount(sal_False),
+ bInQuit(sal_False),
+ bStbWasVisible(sal_False),
+ bSessionFailed(sal_False),
+ bInvalidateOnUnlock(sal_False),
+ bBean( sal_False ),
+ bMinimized( sal_False ),
+ bInvisible( sal_False ),
+ bInException( sal_False ),
+ bLateInit_BrowseRegistrationPage(sal_False),
+ nAppEvent( 0 ),
+ pTemplates( 0 )
+{
+ StartListening( *pApp );
+}
+
+SfxAppData_Impl::~SfxAppData_Impl()
+{
+#ifdef DBG_UTIL
+ delete pTopFrames;
+ delete pCancelMgr;
+ delete pFilterIni;
+ delete pSecureURLs;
+#endif
+}
+
+IMPL_STATIC_LINK( SfxAppData_Impl, CreateDataLockBytesFactory, void*, EMPTYARG)
+{
+ pThis->GetDocumentTemplates();
+// pThis->pDataLockBytesFactory = new DataLockByteFactory_Impl;
+// pThis->pImageLockBytesFactory = new ImageLockByteFactory_Impl;
+// pThis->pInfoLockBytesFactory = new InfoLockByteFactory_Impl;
+ return 0;
+}
+
+/*
+ImageLockByteFactory_Impl::ImageLockByteFactory_Impl()
+ : SvLockBytesFactory( DEFINE_CONST_UNICODE("private:image/*") )
+{
+}
+
+struct ImageMap_Impl
+{
+ const char* pName;
+ sal_uInt16 nResId;
+};
+
+static ImageMap_Impl aImageMap[] =
+{
+ "sfx", RID_IMAGE_SPECIAL,
+ "tlx", RID_IMAGE_USER1,
+ "pb", RID_IMAGE_USER2,
+ "mi", RID_IMAGE_USER3,
+ "mba", RID_IMAGE_USER4,
+ "internal-icon-baddata", RID_IMAGE_BADDATA,
+ "internal-gopher-binary", RID_IMAGE_BINARY,
+ "internal-icon-delayed", RID_IMAGE_DELAYED,
+ "internal-icon-embed", RID_IMAGE_EMBED,
+ "internal-gopher-image", RID_IMAGE_IMAGE,
+ "internal-gopher-index", RID_IMAGE_INDEX,
+ "internal-gopher-menu", RID_IMAGE_MENU,
+ "internal-gopher-movie", RID_IMAGE_MOVIE,
+ "internal-icon-notfound", RID_IMAGE_NOTFOUND,
+ "internal-gopher-sound", RID_IMAGE_SOUND,
+ "internal-gopher-telnet", RID_IMAGE_TELNET,
+ "internal-gopher-text", RID_IMAGE_TEXT,
+ "internal-gopher-unknown", RID_IMAGE_UNKNOWN,
+ "internal-icon-insecure", RID_IMAGE_UNSECURE
+};
+*/
+
+class BinaryGlobalLoader : public Resource
+{
+public:
+ BinaryGlobalLoader( SvStream& rStrm, sal_uInt16 nId );
+};
+
+class BinaryResLoader : public Resource
+{
+public:
+ BinaryResLoader( SvStream& rStrm, const ResId& rId );
+};
+
+BinaryGlobalLoader::BinaryGlobalLoader( SvStream& rStrm, sal_uInt16 nId )
+ : Resource( SfxResId( RID_IMAGE_RES ) )
+{
+ BinaryResLoader( rStrm, ResId(nId ) );
+ FreeResource();
+}
+
+BinaryResLoader::BinaryResLoader( SvStream& rStrm, const ResId& rId )
+ : Resource ( rId )
+{
+ char* pStr;
+ sal_uInt16 nStrLen;
+ sal_uInt16 nBytesLeft;
+
+ nStrLen = *((sal_uInt16*)GetClassRes());
+ IncrementRes( sizeof( short ) );
+
+ nBytesLeft = GetRemainSizeRes();
+
+ while( nBytesLeft )
+ {
+ sal_uInt16 nOut = Min( nStrLen, nBytesLeft );
+ sal_uInt16 nInc = Min( (sal_uInt16)(nStrLen+2), nBytesLeft );
+
+ pStr = (char*)GetClassRes();
+ rStrm.Write( pStr, nOut );
+ IncrementRes( nInc );
+ nBytesLeft = (nInc != nBytesLeft) ? GetRemainSizeRes() : 0;
+ }
+}
+/*
+SvLockBytesRef ImageLockByteFactory_Impl::CreateLockBytes(
+ const String& rName, String& rMime )
+{
+ SvLockBytesRef xRet;
+ String aImage( rName, GetWildcard().Len() - 1,
+ rName.Len() - GetWildcard().Len() + 1 );
+ for( sal_uInt16 nPos = sizeof( aImageMap ) / sizeof( ImageMap_Impl ); nPos-- ; )
+ if( aImage == aImageMap[ nPos ].pName )
+ {
+ SvCacheStream* pStream = new SvCacheStream;
+ BinaryGlobalLoader aLoader(
+ *pStream, aImageMap[ nPos ].nResId );
+ xRet = new SvLockBytes( pStream );
+ if( aImage == "sfx" )
+ rMime = "text/html";
+ else
+ rMime = "image/gif";
+ return xRet;
+ }
+ return xRet;
+}
+
+DataLockByteFactory_Impl::DataLockByteFactory_Impl()
+ : SvLockBytesFactory( "data:*" )
+{
+}
+
+
+SvLockBytesRef DataLockByteFactory_Impl::CreateLockBytes(
+ const String& rName, String& rMime )
+{
+#ifndef DBG_MI
+ String aPath( rName, rName.Search( ':' ) + 1, STRING_LEN );
+ String aType = aPath.GetToken( 0, ',' );
+ sal_uInt16 nTok = aType.GetTokenCount( ';' );
+ sal_Bool b64 = sal_False;
+ if( nTok > 1 )
+ {
+ String aLast = aType.GetToken( nTok - 1, ';');
+ if( aLast == "base64" )
+ b64 = sal_True;
+ }
+ rMime = aType.GetToken( 0, ';' );
+ sal_uInt16 nContent = aPath.Search( ',' );
+ String aContent;
+ SvCacheStream* pCache = new SvCacheStream;
+ if( nContent != STRING_NOTFOUND )
+ {
+ aContent = String( aPath, nContent + 1, STRING_LEN );
+ if( b64 )
+ {
+ SvMemoryStream aTmp;
+ aTmp << aContent.GetBuffer();
+ aTmp.Seek( 0L);
+ INetIStream::Decode64( aTmp, *pCache );
+ }
+ else
+ {
+ INetURLObject::Unescape( aContent );
+ *pCache << aContent.GetBuffer();
+ }
+ pCache->Seek( 0L );
+ }
+ SvLockBytesRef xRef = new SvLockBytes( pCache, sal_True );
+#else
+ SvLockBytesRef xRef;
+#endif
+ return xRef;
+}
+
+
+InfoLockByteFactory_Impl::InfoLockByteFactory_Impl()
+ : SvLockBytesFactory( "private:info/*" )
+{
+}
+*/
+String MakeAnchor_Impl( const String& rURL )
+{
+ String aRet( DEFINE_CONST_UNICODE("<a target=\"_blank\" href=\"") );
+ aRet += rURL;
+ aRet += DEFINE_CONST_UNICODE("\">");
+ aRet += rURL;
+ aRet += DEFINE_CONST_UNICODE("</a>");
+ return aRet;
+}
+
+
+void PrepareLine_Impl( SfxObjectShell* pSh, String& aCur )
+{
+ aCur.SearchAndReplaceAscii(
+ "$(FACTORY)", S2U(pSh->GetFactory().GetShortName()) );
+ SfxMedium* pMed = pSh->GetMedium();
+ String aString;
+ if(pMed)
+ aString = MakeAnchor_Impl( pMed->GetName());
+ else
+ aString = String();
+ aCur.SearchAndReplaceAscii( "$(URL)", aString);
+ String aURL;
+ if( pMed ) aURL = pMed->GetPreRedirectedURL();
+ if( aURL == pMed->GetName() ) aURL.Erase();
+ aCur.SearchAndReplaceAscii(
+ "$(ORIGURL)", MakeAnchor_Impl( aURL ) );
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pSh );
+ aCur.SearchAndReplaceAscii(
+ "$(VISIBLE)", ( pFrame && pFrame->IsVisible() ) ? '+' : '-' );
+
+ String aJSDirty;
+ String aJSExec;
+ aCur.SearchAndReplaceAscii( "$(JSEXEC)", aJSExec );
+ aCur.SearchAndReplaceAscii( "$(JSDIRTY)", aJSDirty );
+ aCur.SearchAndReplaceAscii( "$(FORBID)", pSh->Get_Impl()->bForbidCaching ? 0x002B : 0x002D ); // 2Bh = '+', 2Dh = '-'
+
+ MemCache_Impl& rCache = SfxPickList_Impl::Get()->GetMemCache();
+ sal_uInt16 nPos;
+ for( nPos = (sal_uInt16)rCache.Count(); nPos--; )
+ if( pSh == *rCache.GetObject( nPos ) )
+ break;
+
+ aCur.SearchAndReplaceAscii( "$(CACHED)", nPos == USHRT_MAX ? 0x002D : 0x002B ); // 2Bh = '+', 2Dh = '-'
+
+ aCur.SearchAndReplaceAscii(
+ "$(EXPIRE)", pMed && pMed->IsExpired() ? 0x002B : 0x002D ); // 2Bh = '+', 2Dh = '-'
+ String aPost;
+ if( pMed )
+ {
+ SFX_ITEMSET_ARG(
+ pMed->GetItemSet(), pPostItem, SfxStringItem, SID_POSTSTRING,
+ sal_False );
+ if( pPostItem ) aPost = pPostItem->GetValue();
+ }
+ aCur.SearchAndReplaceAscii( "$(POSTSTRING)", aPost);
+}
+
+/*
+SvLockBytesRef InfoLockByteFactory_Impl::CreateLockBytes(
+ const String& rName, String& rMime )
+{
+ SvLockBytesRef xRef;
+ String aPath( rName, rName.Search( '/' ) + 1, STRING_LEN );
+
+ if( aPath == "docs" )
+ {
+ rMime = "text/html";
+ SvCacheStream* pStream = new SvCacheStream;
+ *pStream << "<html><body>";
+ String aStr( SfxResId( STR_MEMINFO_HEADER ) );
+
+ aStr.SearchAndReplace( "$(TOTAL)", SfxObjectShell::Count() );
+ sal_uInt16 nVisCount = 0;
+ SfxObjectShell* pSh;
+ for( pSh = SfxObjectShell::GetFirst( 0, sal_True );
+ pSh; pSh = SfxObjectShell::GetNext( *pSh, 0, sal_True ) )
+ nVisCount++;
+ aStr.SearchAndReplace( "$(VISIBLE)", nVisCount );
+ aStr.SearchAndReplace(
+ "$(CACHE)", SfxPickList_Impl::Get()->GetMemCache().Count() );
+ *pStream << aStr.GetBuffer();
+
+ String aLine( SfxResId( STR_MEMINFO_OBJINFO ) );
+ String aCur;
+ for( pSh = SfxObjectShell::GetFirst( 0, sal_False );
+ pSh; pSh = SfxObjectShell::GetNext( *pSh, 0, sal_False ) )
+ {
+ aCur = aLine;
+ PrepareLine_Impl( pSh, aCur );
+ *pStream << aCur.GetBuffer();
+ }
+ *pStream << "</body></html>";
+ xRef = new SvLockBytes( pStream, sal_True );
+ }
+ return xRef;
+}
+*/
+//--------------------------------------------------------------------
+
+void SfxAppData_Impl::Notify( SfxBroadcaster &rBC, const SfxHint &rHint )
+{
+ // FileSystem?
+ const SfxDirEntryHint* pDirEntryHint = PTR_CAST(SfxDirEntryHint, &rHint);
+ if ( pDirEntryHint )
+ UCB_Helper::ExecuteCommand( pDirEntryHint->GetObject(), WID_UPDATE );
+
+ // aus INet?
+#if 0//(mba)
+ INetHint *pINetHint = PTR_CAST(INetHint, &rHint);
+ sal_Bool bInvalidateStop = pINetHint &&
+ pINetHint->GetId() != INET_WRITE_STATUS &&
+ pINetHint->GetId() != INET_READ_STATUS;
+ if ( !bInvalidateStop )
+ {
+ // vom CancelManager?
+ SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
+ bInvalidateStop = pSimpleHint &&
+ ( pSimpleHint->GetId() & SFX_HINT_CANCELLABLE );
+ }
+
+ // k"onnte etwas stoppbar geworden sein (oder nicht mehr)
+ if ( bInvalidateStop )
+ {
+ SfxViewFrame *pFrame = SfxViewFrame::Current();
+
+ // Da viele Notifies aus anderen Threads als dem Main thread kommen ( Chaos! )
+ IMutex &rMutex = Application::GetSolarMutex();
+ if ( pFrame && rMutex.tryToAcquire() )
+ {
+ SfxBindings &rBind = pFrame->GetBindings();
+ if( rBind.IsInUpdate() )
+ {
+ DBG_WARNING( "W1:Cancelable whrend StatusUpdate angelegt!" );
+ }
+ else
+ {
+ rBind.Invalidate( SID_BROWSE_STOP );
+ rBind.Update( SID_BROWSE_STOP );
+ rBind.Invalidate( SID_BROWSE_STOP );// geht sonst nicht aus
+ }
+
+ rMutex.release();
+ }
+ }
+#endif
+
+ const SfxIniManagerHint* pIniManHint = PTR_CAST(SfxIniManagerHint, &rHint);
+ if ( pIniManHint && pIniManHint->GetIniKey() == SFX_KEY_DONTHIDE_DISABLEDENTRIES )
+ {
+ sal_Bool bDontHide = (sal_Bool)(sal_uInt16)pIniManHint->GetNewValue().ToInt32();
+ UpdateApplicationSettings( bDontHide );
+ }
+}
+
+//------------------------------------------------------------------------
+
+void SfxAppData_Impl::UpdateApplicationSettings( sal_Bool bDontHide )
+{
+ AllSettings aAllSet = Application::GetSettings();
+ StyleSettings aStyleSet = aAllSet.GetStyleSettings();
+ sal_uInt32 nStyleOptions = aStyleSet.GetOptions();
+ if ( bDontHide )
+ nStyleOptions &= ~STYLE_OPTION_HIDEDISABLED;
+ else
+ nStyleOptions |= STYLE_OPTION_HIDEDISABLED;
+ aStyleSet.SetOptions( nStyleOptions );
+ aAllSet.SetStyleSettings( aStyleSet );
+ Application::SetSettings( aAllSet );
+}
+
+SfxDocumentTemplates* SfxAppData_Impl::GetDocumentTemplates()
+{
+ if ( !pTemplates )
+ {
+ pTemplates = new SfxDocumentTemplates;
+ pTemplates->Construct();
+ }
+
+ return pTemplates;
+}
+
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
new file mode 100644
index 000000000000..5c8b4ebfc655
--- /dev/null
+++ b/sfx2/source/appl/appdde.cxx
@@ -0,0 +1,744 @@
+/*************************************************************************
+ *
+ * $RCSfile: appdde.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SFXRECTITEM_HXX //autogen
+#include <svtools/rectitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SVDDE_HXX //autogen
+#include <svtools/svdde.hxx>
+#endif
+#ifndef _LNKBASE_HXX //autogen
+#include <so3/lnkbase.hxx>
+#endif
+#ifndef _LINKMGR_HXX //autogen
+#include <so3/linkmgr.hxx>
+#endif
+#include <tools/urlobj.hxx>
+#pragma hdrstop
+
+#include "app.hxx"
+#include "appdata.hxx"
+#include "objsh.hxx"
+#include "viewfrm.hxx"
+#include "topfrm.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "sfxsids.hrc"
+#include "inimgr.hxx"
+#include "helper.hxx"
+
+//========================================================================
+
+String SfxDdeServiceName_Impl( const String& sIn )
+{
+ ByteString sTemp = U2S( sIn );
+ ByteString sReturn;
+
+ for ( sal_uInt16 n = sTemp.Len(); n; --n )
+ if ( sTemp.Copy( n-1, 1 ).IsAlphaNumericAscii() )
+ sReturn += sTemp.GetChar(n-1);
+
+ return S2U( sReturn );
+}
+
+
+class ImplDdeService : public DdeService
+{
+public:
+ ImplDdeService( const String& rNm )
+ : DdeService( rNm )
+ {}
+ virtual BOOL MakeTopic( const String& );
+
+ virtual String Topics();
+// virtual String Formats();
+// virtual String SysItems();
+// virtual String Status();
+
+ virtual BOOL SysTopicExecute( const String* pStr );
+};
+
+class SfxDdeTriggerTopic_Impl : public DdeTopic
+{
+public:
+ SfxDdeTriggerTopic_Impl()
+ : DdeTopic( DEFINE_CONST_UNICODE("TRIGGER") )
+ {}
+
+ virtual BOOL Execute( const String* );
+};
+
+class SfxDdeDocTopic_Impl : public DdeTopic
+{
+public:
+ SfxObjectShell* pSh;
+ DdeData aData;
+ SvData aSvData;
+
+ SfxDdeDocTopic_Impl( SfxObjectShell* pShell )
+ : DdeTopic( pShell->GetTitle(SFX_TITLE_FULLNAME) ), pSh( pShell )
+ {}
+
+ virtual DdeData* Get( ULONG );
+ virtual BOOL Put( const DdeData* );
+ virtual BOOL Execute( const String* );
+ virtual BOOL StartAdviseLoop();
+ virtual BOOL MakeItem( const String& rItem );
+
+// wird benoetigt?
+// virtual void Connect( long n );
+// virtual void Disconnect( long n );
+// virtual void StopAdviseLoop();
+
+};
+
+
+SV_DECL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl * const, 4, 4 )
+SV_IMPL_PTRARR( SfxDdeDocTopics_Impl, SfxDdeDocTopic_Impl * const )
+
+//========================================================================
+
+BOOL SfxAppEvent_Impl( ApplicationEvent &rAppEvent,
+ const String &rCmd, const String &rEvent )
+
+/* [Beschreibung]
+
+ Pr"uft, ob 'rCmd' das Event 'rEvent' ist (ohne '(') und baut
+ aus diesem dann ein <ApplicationEvent> zusammen, das per
+ <Application::AppEvent()> ausgef"uhrt werden kann. Ist 'rCmd' das
+ angegegeben Event 'rEvent', dann wird TRUE zur"uckgegeben, sonst FALSE.
+
+
+ [Beispiel]
+
+ rCmd = "Open(\"d:\doc\doc.sdw\")"
+ rEvent = "Open"
+*/
+
+{
+ String aEvent( rEvent );
+ aEvent += 0x0028 ;// "(" = 28h
+ if ( rCmd.CompareIgnoreCaseToAscii( aEvent, aEvent.Len() ) == COMPARE_EQUAL )
+ {
+ String aData( rCmd );
+ aData.Erase( 0, aEvent.Len() );
+ if ( aData.Len() > 2 )
+ {
+ // in das ApplicationEvent-Format wandeln
+ aData.Erase( aData.Len()-1, 1 );
+ for ( USHORT n = 0; n < aData.Len(); ++n )
+ {
+ if ( aData.GetChar(n) == 0x0022 ) // " = 22h
+ for ( ; aData.GetChar(++n) != 0x0022 ; )
+ /* empty loop */ ;
+ else if ( aData.GetChar(n) == 0x0020 ) // SPACE = 20h
+ aData.SetChar(n, '\n');
+ }
+ aData.EraseAllChars( 0x0022 );
+ ApplicationAddress aAddr;
+ rAppEvent = ApplicationEvent( String(), aAddr, U2S(rEvent), aData );
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+long SfxApplication::DdeExecute
+(
+ const String& rCmd // in unserer BASIC-Syntax formuliert
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxApplication-Subklasse gerichtete DDE-Kommandos
+ zu empfangen.
+
+ Die Basisimplementierung versteht die API-Funktionalit"at der
+ betreffenden SfxApplication-Subklasse in BASIC-Syntax. R"uckgabewerte
+ k"onnen dabei leider nicht "ubertragen werden.
+*/
+
+{
+ // Print oder Open-Event?
+ ApplicationEvent aAppEvent;
+ if ( SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Print") ) ||
+ SfxAppEvent_Impl( aAppEvent, rCmd, DEFINE_CONST_UNICODE("Open") ) )
+ GetpApp()->AppEvent( aAppEvent );
+ else
+ {
+ // alle anderen per BASIC
+ EnterBasicCall();
+ StarBASIC* pBasic = GetBasic();
+ DBG_ASSERT( pBasic, "Wo ist mein Basic???" );
+ SbxVariable* pRet = pBasic->Execute( rCmd );
+ LeaveBasicCall();
+ if( !pRet )
+ {
+ SbxBase::ResetError();
+ return 0;
+ }
+ }
+ return 1;
+}
+
+//--------------------------------------------------------------------
+
+long SfxApplication::DdeGetData
+(
+ const String& rItem, // das anzusprechende Item
+ SvData& rData // in: Format, out: angeforderte Daten
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxApplication-Subklasse gerichtete DDE-Daten-Anforderungen
+ zu empfangen.
+
+ Die Basisimplementierung liefert keine Daten und gibt 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+long SfxApplication::DdeSetData
+(
+ const String& rItem, // das anzusprechende Item
+ const SvData& rData // Daten-Format und Daten selbst
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxApplication-Subklasse gerichtete DDE-Daten
+ zu empfangen.
+
+ Die Basisimplementierung nimmt keine Daten entgegen und liefert 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+SvPseudoObject* SfxApplication::DdeCreateHotLink
+(
+ const String& rItem // das zu erzeugende Item
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seiner SfxApplication-Subklasse einen DDE-Hotlink einzurichten
+
+ Die Basisimplementierung erzeugt keinen und liefert 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//========================================================================
+
+long SfxObjectShell::DdeExecute
+(
+ const String& rCmd // in unserer BASIC-Syntax formuliert
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxObjectShell-Subklasse gerichtete DDE-Kommandos
+ zu empfangen.
+
+ Die Basisimplementierung f"uhrt nichts aus und liefert 0 zur"uck.
+*/
+
+{
+ StarBASIC* pBasic = GetBasic();
+ DBG_ASSERT( pBasic, "Wo ist mein Basic???" ) ;
+ SbxVariable* pRet = pBasic->Execute( rCmd );
+ if( !pRet )
+ {
+ SbxBase::ResetError();
+ return 0;
+ }
+
+ return 1;
+}
+
+//--------------------------------------------------------------------
+
+long SfxObjectShell::DdeGetData
+(
+ const String& rItem, // das anzusprechende Item
+ SvData& rData // in: Format, out: angeforderte Daten
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxObjectShell-Subklasse gerichtete DDE-Daten-Anforderungen
+ zu empfangen.
+
+ Die Basisimplementierung liefert keine Daten und gibt 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+long SfxObjectShell::DdeSetData
+(
+ const String& rItem, // das anzusprechende Item
+ const SvData& rData // Daten-Format und Daten selbst
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxObjectShell-Subklasse gerichtete DDE-Daten
+ zu empfangen.
+
+ Die Basisimplementierung nimmt keine Daten entgegen und liefert 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+SvPseudoObject* SfxObjectShell::DdeCreateHotLink
+(
+ const String& rItem // das zu erzeugende Item
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seiner SfxObjectShell-Subklasse einen DDE-Hotlink einzurichten
+
+ Die Basisimplementierung erzeugt keinen und liefert 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//========================================================================
+
+long SfxViewFrame::DdeExecute
+(
+ const String& rCmd // in unserer BASIC-Syntax formuliert
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxViewFrame-Subklasse gerichtete DDE-Kommandos
+ zu empfangen.
+
+ Die Basisimplementierung versteht die API-Funktionalit"at des
+ betreffenden SfxViewFrame, der darin dargestellten SfxViewShell und
+ der betreffenden SfxObjectShell-Subklasse in BASIC-Syntax.
+ R"uckgabewerte k"onnen dabei leider nicht "ubertragen werden.
+*/
+
+{
+ if ( GetObjectShell() )
+ return GetObjectShell()->DdeExecute( rCmd );
+
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+long SfxViewFrame::DdeGetData
+(
+ const String& rItem, // das anzusprechende Item
+ SvData& rData // in: Format, out: angeforderte Daten
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxViewFrame-Subklasse gerichtete DDE-Daten-Anforderungen
+ zu empfangen.
+
+ Die Basisimplementierung liefert keine Daten und gibt 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+long SfxViewFrame::DdeSetData
+(
+ const String& rItem, // das anzusprechende Item
+ const SvData& rData // Daten-Format und Daten selbst
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seine SfxViewFrame-Subklasse gerichtete DDE-Daten
+ zu empfangen.
+
+ Die Basisimplementierung nimmt keine Daten entgegen und liefert 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+SvPseudoObject* SfxViewFrame::DdeCreateHotLink
+(
+ const String& rItem // das zu erzeugende Item
+)
+
+/* [Beschreibung]
+
+ Diese Methode kann vom Applikationsentwickler "uberladen werden,
+ um an seiner SfxViewFrame-Subklasse einen DDE-Hotlink einzurichten
+
+ Die Basisimplementierung erzeugt keinen und liefert 0 zur"uck.
+*/
+
+{
+ return 0;
+}
+
+
+//========================================================================
+
+BOOL SfxApplication::InitializeDde()
+{
+ DBG_ASSERT( !pAppData_Impl->pDdeService,
+ "Dde kann nicht mehrfach initialisiert werden" )
+
+ pAppData_Impl->pDdeService = new ImplDdeService( Application::GetAppName() );
+ int nError = pAppData_Impl->pDdeService->GetError();
+ if( !nError )
+ {
+ pAppData_Impl->pDocTopics = new SfxDdeDocTopics_Impl;
+
+ // wir wollen auf jedenfall RTF unterstuetzen!
+ pAppData_Impl->pDdeService->AddFormat( FORMAT_RTF );
+
+ // Config-Pfad als Topic wegen Mehrfachstart
+ INetURLObject aOfficeLockFile( GetIniManager()->Get( SFX_KEY_USERCONFIG_PATH ), INET_PROT_FILE );
+ aOfficeLockFile.insertName( DEFINE_CONST_UNICODE( "soffice.lck" ) );
+ String aService( SfxDdeServiceName_Impl( aOfficeLockFile.PathToFileName() ) );
+ aService.ToUpperAscii();
+ pAppData_Impl->pDdeService2 = new ImplDdeService( aService );
+ pAppData_Impl->pTriggerTopic = new SfxDdeTriggerTopic_Impl;
+ pAppData_Impl->pDdeService2->AddTopic( *pAppData_Impl->pTriggerTopic );
+ }
+ return !nError;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
+{
+ DBG_ASSERT( pAppData_Impl->pDocTopics, "es gibt gar keinen Dde-Service" )
+ //OV: Im Serverbetrieb ist DDE abgeklemmt!
+ if( !pAppData_Impl->pDocTopics )
+ return;
+
+ // doppeltes Eintragen verhindern
+ String sShellNm;
+ BOOL bFnd = FALSE;
+ for( USHORT n = pAppData_Impl->pDocTopics->Count(); n; )
+ if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh )
+ {
+ // JP 18.03.96 - Bug 26470
+ // falls das Document unbenannt wurde, ist trotzdem ein
+ // neues Topics anzulegen!
+ if( !bFnd )
+ {
+ bFnd = TRUE;
+ (sShellNm = pSh->GetTitle(SFX_TITLE_FULLNAME)).ToLowerAscii();
+ }
+ String sNm( (*pAppData_Impl->pDocTopics)[ n ]->GetName() );
+ if( sShellNm == sNm.ToLowerAscii() )
+ return ;
+ }
+
+ const SfxDdeDocTopic_Impl* pTopic = new SfxDdeDocTopic_Impl( pSh );
+ pAppData_Impl->pDocTopics->Insert( pTopic,
+ pAppData_Impl->pDocTopics->Count() );
+ pAppData_Impl->pDdeService->AddTopic( *pTopic );
+}
+
+void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh )
+{
+ DBG_ASSERT( pAppData_Impl->pDocTopics, "es gibt gar keinen Dde-Service" )
+ //OV: Im Serverbetrieb ist DDE abgeklemmt!
+ if( !pAppData_Impl->pDocTopics )
+ return;
+
+ SfxDdeDocTopic_Impl* pTopic;
+ for( USHORT n = pAppData_Impl->pDocTopics->Count(); n; )
+ if( ( pTopic = (*pAppData_Impl->pDocTopics)[ --n ])->pSh == pSh )
+ {
+ pAppData_Impl->pDdeService->RemoveTopic( *pTopic );
+ pAppData_Impl->pDocTopics->DeleteAndDestroy( n );
+ }
+}
+
+const DdeService* SfxApplication::GetDdeService() const
+{
+ return pAppData_Impl->pDdeService;
+}
+
+DdeService* SfxApplication::GetDdeService()
+{
+ return pAppData_Impl->pDdeService;
+}
+
+//--------------------------------------------------------------------
+
+BOOL ImplDdeService::MakeTopic( const String& rNm )
+{
+ // Workaround gegen Event nach unserem Main() unter OS/2
+ // passierte wenn man beim Beenden aus dem OffMgr die App neu startet
+ if ( !Application::IsInExecute() )
+ return FALSE;
+
+ // das Topic rNm wird gesucht, haben wir es ?
+ // erstmal nur ueber die ObjectShells laufen und die mit dem
+ // Namen heraussuchen:
+ BOOL bRet = FALSE;
+ String sNm( rNm );
+ sNm.ToLowerAscii();
+ TypeId aType( TYPE(SfxObjectShell) );
+ SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
+ while( pShell )
+ {
+ String sTmp( pShell->GetTitle(SFX_TITLE_FULLNAME) );
+ sTmp.ToLowerAscii();
+ if( sTmp == sNm ) // die wollen wir haben
+ {
+ SFX_APP()->AddDdeTopic( pShell );
+ bRet = TRUE;
+ break;
+ }
+ pShell = SfxObjectShell::GetNext( *pShell, &aType );
+ }
+
+ if( !bRet )
+ {
+ INetURLObject aWorkPath( SFX_INIMANAGER()->Get( SFX_KEY_WORK_PATH ), INET_PROT_FILE );
+ INetURLObject aFile;
+ if ( aWorkPath.GetNewAbsURL( rNm, &aFile ) &&
+ SfxContentHelper::IsDocument( aFile.GetMainURL() ) )
+ {
+ // File vorhanden
+
+ // dann versuche die Datei zu laden:
+ SfxStringItem aName( SID_FILE_NAME, aFile.GetMainURL() );
+ SfxBoolItem aNewView(SID_OPEN_NEW_VIEW, TRUE);
+// SfxBoolItem aHidden(SID_HIDDEN, TRUE);
+ // minimiert!
+ SfxUInt16Item aViewStat( SID_VIEW_ZOOM_MODE, 0 );
+ SfxRectangleItem aRectItem( SID_VIEW_POS_SIZE, Rectangle() );
+
+ SfxBoolItem aSilent(SID_SILENT, TRUE);
+ SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl();
+ const SfxPoolItem* pRet = pDispatcher->Execute( SID_OPENDOC,
+ SFX_CALLMODE_SYNCHRON,
+ &aName, &aNewView,
+ &aViewStat,&aRectItem/*aHidden*/,
+ &aSilent, 0L );
+
+ if( pRet && pRet->ISA( SfxViewFrameItem ) &&
+ ((SfxViewFrameItem*)pRet)->GetFrame() &&
+ 0 != ( pShell = ((SfxViewFrameItem*)pRet)
+ ->GetFrame()->GetObjectShell() ) )
+ {
+ SFX_APP()->AddDdeTopic( pShell );
+ bRet = TRUE;
+ }
+ }
+ }
+ return bRet;
+}
+
+String ImplDdeService::Topics()
+{
+ String sRet;
+ if( GetSysTopic() )
+ sRet += GetSysTopic()->GetName();
+
+ TypeId aType( TYPE(SfxObjectShell) );
+ SfxObjectShell* pShell = SfxObjectShell::GetFirst( &aType );
+ while( pShell )
+ {
+ if( SfxViewFrame::GetFirst( pShell, TYPE(SfxTopViewFrame) ))
+ {
+ if( sRet.Len() )
+ sRet += '\t';
+ sRet += pShell->GetTitle(SFX_TITLE_FULLNAME);
+ }
+ pShell = SfxObjectShell::GetNext( *pShell, &aType );
+ }
+ if( sRet.Len() )
+ sRet += DEFINE_CONST_UNICODE("\r\n");
+ return sRet;
+}
+
+BOOL ImplDdeService::SysTopicExecute( const String* pStr )
+{
+ return (BOOL)SFX_APP()->DdeExecute( *pStr );
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxDdeTriggerTopic_Impl::Execute( const String* pStr )
+{
+// Application::GetAppWindow()->ToTop(TOTOP_RESTOREWHENMIN);
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+DdeData* SfxDdeDocTopic_Impl::Get( ULONG nFormat )
+{
+ aSvData = SvData( nFormat );
+ long nRet = pSh->DdeGetData( GetCurItem(), aSvData );
+ if( nRet && aSvData.HasData() )
+ {
+ const char * pGetData;
+ long nLen = aSvData.GetMemorySize();
+ aSvData.GetData( (void**)&pGetData, TRANSFER_REFERENCE );
+ aData = DdeData( pGetData, nLen, nFormat );
+ return &aData;
+ }
+ return 0;
+}
+
+BOOL SfxDdeDocTopic_Impl::Put( const DdeData* pData )
+{
+ aSvData = SvData( pData->GetFormat() );
+ aSvData.SetData( (void*)(const void*)*pData,
+ (long)*pData, TRANSFER_REFERENCE );
+
+ long nRet = aSvData.HasData() ? pSh->DdeSetData( GetCurItem(), aSvData ) : 0;
+
+ return 0 != nRet;
+}
+
+BOOL SfxDdeDocTopic_Impl::Execute( const String* pStr )
+{
+ long nRet = pStr ? pSh->DdeExecute( *pStr ) : 0;
+ return 0 != nRet;
+}
+
+BOOL SfxDdeDocTopic_Impl::MakeItem( const String& rItem )
+{
+ AddItem( DdeItem( rItem ) );
+ return TRUE;
+}
+
+BOOL SfxDdeDocTopic_Impl::StartAdviseLoop()
+{
+ SvPseudoObject* pNewObj = pSh->DdeCreateHotLink( GetCurItem() );
+ if( !pNewObj )
+ return FALSE;
+
+ // dann richten wir auch einen entsprechenden SvBaseLink ein
+ String sNm, sTmp( Application::GetAppName() );
+ ::MakeLnkName( sNm, &sTmp, pSh->GetTitle(SFX_TITLE_FULLNAME), GetCurItem() );
+ new SvBaseLink( sNm, OBJECT_DDE_EXTERN, pNewObj );
+ return TRUE;
+}
+
+
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
new file mode 100644
index 000000000000..77f01d362be2
--- /dev/null
+++ b/sfx2/source/appl/appinit.cxx
@@ -0,0 +1,905 @@
+/*************************************************************************
+ *
+ * $RCSfile: appinit.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "app.hxx"
+
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XTERMINATELISTENER_HPP_
+#include <com/sun/star/frame/XTerminateListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
+#include <com/sun/star/frame/XDesktop.hpp>
+#endif
+
+#include <svtools/svtools.hrc>
+
+#ifndef _SV_CONFIG_HXX
+#include <vcl/config.hxx>
+#endif
+#ifndef _SOERR_HXX //autogen
+#include <so3/soerr.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _INETBND_HXX //autogen
+#include <so3/inetbnd.hxx>
+#endif
+#ifndef _INET_WRAPPER_HXX
+#include <inet/wrapper.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+#include <svtools/inethist.hxx>
+#ifndef _COM_SUN_STAR_INSTALLATION_XPROTOCOLHANDLERCHECK_HPP_
+#include <com/sun/star/installation/XProtocolHandlerCheck.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSTALLATION_PROTOCOLS_HPP_
+#include <com/sun/star/installation/protocols.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSTALLATION_PROTDLGRES_HPP_
+#include <com/sun/star/installation/ProtDlgRes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSTALLATION_XINSTALLATIONCHECK_HPP_
+#include <com/sun/star/installation/XInstallationCheck.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP_
+#include <com/sun/star/loader/XImplementationLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LOADER_CANNOTACTIVATEFACTORYEXCEPTION_HPP_
+#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERMANAGER_HPP_
+#include <com/sun/star/ucb/XContentProviderManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XPARAMETERIZEDCONTENTPROVIDER_HPP_
+#include <com/sun/star/ucb/XParameterizedContentProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_INSTALLATION_PROTDLGRES_HPP_
+#include <com/sun/star/installation/ProtDlgRes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BRIDGE_XUNOURLRESOLVER_HPP_
+#include <com/sun/star/bridge/XUnoUrlResolver.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XDIALOG_HPP_
+#include <com/sun/star/awt/XDialog.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
+#include <unotools/processfactory.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "unoctitm.hxx"
+#include "appimp.hxx"
+#include "accmgr.hxx"
+#include "app.hrc"
+#include "appdata.hxx"
+#include "arrdecl.hxx"
+#include "cfgmgr.hxx"
+#include "dispatch.hxx"
+#include "docfac.hxx"
+#include "evntconf.hxx"
+#include "frameobj.hxx"
+#include "fsetobsh.hxx"
+#include "fsetview.hxx"
+#include "imgmgr.hxx"
+#include "interno.hxx"
+#include "intro.hxx"
+#include "macrconf.hxx"
+#include "mnumgr.hxx"
+#include "msgpool.hxx"
+#include "newhdl.hxx"
+#include "picklist.hxx"
+#include "plugobj.hxx"
+#include "progress.hxx"
+#include "saveopt.hxx"
+#include "sfxhelp.hxx"
+#include "sfxresid.hxx"
+#include "sfxtypes.hxx"
+#include "stbmgr.hxx"
+#include "tbxconf.hxx"
+#include "viewsh.hxx"
+#include "eacopier.hxx"
+#include "nochaos.hxx"
+#include "ucbhelp.hxx"
+#include "fcontnr.hxx"
+#include "helper.hxx" // SfxContentHelper::Kill()
+
+#ifdef UNX
+#define stricmp(a,b) strcmp(a,b)
+#endif
+
+#ifdef MAC
+int svstricmp( const char* pStr1, const char* pStr2);
+#define stricmp svstricmp
+#endif
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star;
+
+void doFirstTimeInit();
+
+class SfxTerminateListener_Impl : public ::cppu::WeakImplHelper1< XTerminateListener >
+{
+public:
+ virtual void SAL_CALL queryTermination( const EventObject& aEvent ) throw( TerminationVetoException, RuntimeException );
+ virtual void SAL_CALL notifyTermination( const EventObject& aEvent ) throw( RuntimeException );
+ virtual void SAL_CALL disposing( const EventObject& Source ) throw( RuntimeException );
+};
+
+void SAL_CALL SfxTerminateListener_Impl::disposing( const EventObject& Source ) throw( RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SFX_APP()->Deinitialize();
+}
+
+void SAL_CALL SfxTerminateListener_Impl::queryTermination( const EventObject& aEvent ) throw(TerminationVetoException, RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ if ( !SFX_APP()->QueryExit_Impl() )
+ throw TerminationVetoException();
+}
+
+void SAL_CALL SfxTerminateListener_Impl::notifyTermination( const EventObject& aEvent ) throw(RuntimeException )
+{
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SfxApplication* pApp = SFX_APP();
+ SfxPickList_Impl::Get()->ClearMemCache();
+ pApp->Get_Impl()->aLateInitTimer.Stop();
+ pApp->Broadcast( SfxSimpleHint( SFX_HINT_DEINITIALIZING ) );
+ pApp->Get_Impl()->pAppDispatch->ReleaseAll();
+ pApp->Get_Impl()->pAppDispatch->release();
+ pApp->NotifyEvent(SfxEventHint( SFX_EVENT_CLOSEAPP) );
+ Application::Quit();
+}
+
+//====================================================================
+
+static bool configureUcb(String const & rUcbUrl)
+{
+ Reference< XMultiServiceFactory >
+ xFactory(utl::getProcessServiceFactory());
+ if (!xFactory.is())
+ {
+ DBG_ERROR("configureUcb: No XMultiServiceFactory");
+ return false;
+ }
+
+ // Create (local) UCB configured as specified in the registry (it should
+ // be configured to have no content providers, otherwise the rUcbUrl
+ // (i.e., the '-ucb=...' command line argument) will be ignored:
+ Reference< ucb::XContentProviderManager > xUcb;
+ Sequence< Any > aArgs(1);
+ aArgs[0] <<= sal_True;
+ try
+ {
+ xUcb
+ = Reference< ucb::XContentProviderManager >(
+ xFactory->
+ createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.UniversalContentBroker")),
+ aArgs),
+ UNO_QUERY);
+ }
+ catch (RuntimeException const &) { throw; }
+ catch (Exception const &) {}
+ if (!xUcb.is())
+ {
+ DBG_ERROR("configureUcb(): No UniversalContentBroker service");
+ return false;
+ }
+
+ // If there's already any content providers registered, ignore rUcbUrl:
+ if (xUcb->queryContentProviders().getLength() != 0)
+ {
+ DBG_WARNING(
+ "configureUcb(): Configured UCB and -ucb command line arg");
+ return true;
+ }
+
+ // Modify rUcbUrl with user supplied information until connecting to this
+ // URL succeeds:
+ Reference< bridge::XUnoUrlResolver > xResolver;
+ try
+ {
+ xResolver
+ = Reference< bridge::XUnoUrlResolver >(
+ xFactory->
+ createInstance(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.bridge.UnoUrlResolver"))),
+ UNO_QUERY);
+ }
+ catch (RuntimeException const &) { throw; }
+ catch (Exception const &) {}
+ if (!xResolver.is())
+ {
+ DBG_ERROR("configureUcb(): No UnoUrlResolver service");
+ return false;
+ }
+ String aTheUcbUrl(rUcbUrl);
+ Reference< awt::XDialog > xDialog;
+ Reference< beans::XPropertySet > xPropertySet;
+ for (;;)
+ {
+ bool bSuccess = false;
+ try
+ {
+ bSuccess = xResolver->resolve(aTheUcbUrl).is() != false;
+ }
+ catch (connection::NoConnectException const &) {}
+ catch (connection::ConnectionSetupException const &) {}
+ catch (IllegalArgumentException const &) {}
+ if (bSuccess)
+ break;
+
+ // Get the login dialog:
+ if (!xDialog.is())
+ {
+ try
+ {
+ xDialog
+ = Reference< awt::XDialog >(
+ xFactory->
+ createInstance(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.framework."
+ "LoginDialog"))),
+ UNO_QUERY);
+ }
+ catch (RuntimeException const &) { throw; }
+ catch (Exception const &) {}
+ xPropertySet
+ = Reference< beans::XPropertySet >(xDialog, UNO_QUERY);
+ if (!(xDialog.is() && xPropertySet.is()))
+ {
+ DBG_ERROR("configureUcb(): No LoginDialog service");
+ return false;
+ }
+ }
+
+ // Identify the authentication data within the URL:
+ enum Parameter
+ {
+ PARAM_NONE = 0,
+ PARAM_HOST = 2,
+ PARAM_PORT = 4,
+ PARAM_USER = 6,
+ PARAM_PASSWORD = 8,
+ PARAM_TICKET = 9
+ };
+ struct Occurence
+ {
+ xub_StrLen m_nStart;
+ xub_StrLen m_nValue;
+ xub_StrLen m_nEnd;
+ Parameter m_eParam;
+ };
+ Occurence aParams[4];
+ int nParamCount = 0;
+ xub_StrLen nEnd = aTheUcbUrl.Len();
+ xub_StrLen nPos = 0;
+ while (nPos != nEnd && aTheUcbUrl.GetChar(nPos++) != ':');
+ // skip <scheme> part...
+ while (nPos != nEnd && aTheUcbUrl.GetChar(nPos) != ',')
+ ++nPos; // skip 'name' of <connection> part...
+ xub_StrLen nInsert = nPos;
+ if (nPos != nEnd && aTheUcbUrl.GetChar(nPos) == ',')
+ ++nPos;
+ while (nPos != nEnd && aTheUcbUrl.GetChar(nPos) != ';')
+ {
+ xub_StrLen nStart = nPos;
+ while (nPos != nEnd
+ && aTheUcbUrl.GetChar(nPos) != '='
+ && aTheUcbUrl.GetChar(nPos) != ','
+ && aTheUcbUrl.GetChar(nPos) != ';')
+ ++nPos;
+ if (nPos != nEnd && aTheUcbUrl.GetChar(nPos) == '=')
+ {
+ String aName(aTheUcbUrl, nStart, nPos - nStart);
+ Parameter eParam
+ = aName.EqualsIgnoreCaseAscii("host") ? PARAM_HOST :
+ aName.EqualsIgnoreCaseAscii("port") ? PARAM_PORT :
+ aName.EqualsIgnoreCaseAscii("user") ? PARAM_USER :
+ aName.EqualsIgnoreCaseAscii("password") ?
+ PARAM_PASSWORD :
+ aName.EqualsIgnoreCaseAscii("ticket") ? PARAM_TICKET :
+ PARAM_NONE;
+ if (int(eParam) != int(PARAM_NONE))
+ // work around compiler bug...
+ {
+ bool bNew = true;
+ for (int i = 0; i != nParamCount; ++i)
+ if ((aParams[i].m_eParam & ~1) == (eParam & ~1))
+ // treat 'password' and 'ticket' the same...
+ {
+ bNew = false;
+ break;
+ }
+ if (bNew)
+ {
+ aParams[nParamCount].m_eParam = eParam;
+ aParams[nParamCount].m_nStart = nStart - 1;
+ aParams[nParamCount].m_nValue = ++nPos;
+ while (nPos != nEnd
+ && aTheUcbUrl.GetChar(nPos) != ','
+ && aTheUcbUrl.GetChar(nPos) != ';')
+ ++nPos;
+ aParams[nParamCount].m_nEnd = nPos;
+ ++nParamCount;
+ }
+ }
+ }
+ while (nPos != nEnd
+ && aTheUcbUrl.GetChar(nPos) != ','
+ && aTheUcbUrl.GetChar(nPos) != ';')
+ ++nPos;
+ if (nPos != nEnd && aTheUcbUrl.GetChar(nPos) == ',')
+ ++nPos;
+ }
+
+ // Copy the authentication data from the URL to the dialog:
+ try
+ {
+ String aHostPort;
+ for (int i = 0; i < nParamCount; ++i)
+ {
+ String aValue(INetURLObject::decode(
+ aTheUcbUrl.Copy(aParams[i].m_nValue,
+ aParams[i].m_nEnd
+ - aParams[i].m_nValue),
+ '%', INetURLObject::DECODE_WITH_CHARSET));
+ if (aValue.Len() != 0)
+ switch (aParams[i].m_eParam)
+ {
+ case PARAM_HOST:
+ aHostPort.Insert(aValue, 0);
+ break;
+
+ case PARAM_PORT:
+ aHostPort.Append(':');
+ aHostPort.Append(aValue);
+ break;
+
+ case PARAM_USER:
+ xPropertySet->
+ setPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "UserName")),
+ makeAny(rtl::OUString(aValue)));
+ break;
+
+ case PARAM_PASSWORD:
+ xPropertySet->
+ setPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Password")),
+ makeAny(rtl::OUString(aValue)));
+ break;
+ }
+ }
+ if (aHostPort.Len() != 0)
+ xPropertySet->
+ setPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Server")),
+ makeAny(rtl::OUString(aHostPort)));
+ }
+ catch (beans::UnknownPropertyException const &) {}
+ catch (beans::PropertyVetoException const &) {}
+ catch (IllegalArgumentException const &) {}
+ catch (WrappedTargetException const &) {}
+
+ if (xDialog->execute() == 0)
+ return false;
+
+ // Copy the authentication data back from the dialog into the URL:
+ rtl::OUString aHost;
+ rtl::OUString aUser;
+ rtl::OUString aPassword;
+ bSuccess = false;
+ try
+ {
+ bSuccess
+ = (xPropertySet->
+ getPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Server")))
+ >>= aHost)
+ && (xPropertySet->
+ getPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "UserName")))
+ >>= aUser)
+ && (xPropertySet->
+ getPropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Password")))
+ >>= aPassword);
+ }
+ catch (beans::UnknownPropertyException const &) {}
+ catch (WrappedTargetException const &) {}
+ if (!bSuccess)
+ {
+ DBG_ERROR("configureUcb(): Bad LoginDialog service");
+ return false;
+ }
+ sal_Int32 nColon = aHost.indexOf(':');
+ if (nColon == -1)
+ nColon = aHost.getLength();
+ while (nParamCount-- > 0)
+ aTheUcbUrl.Erase(aParams[nParamCount].m_nStart,
+ aParams[nParamCount].m_nEnd
+ - aParams[nParamCount].m_nStart);
+ if (aPassword.getLength() != 0)
+ {
+ aTheUcbUrl.InsertAscii(",password=", nInsert);
+ aTheUcbUrl.Insert(INetURLObject::encode(
+ aPassword,
+ INetURLObject::PART_UNO_PARAM_VALUE,
+ '%',
+ INetURLObject::ENCODE_ALL),
+ nInsert + RTL_CONSTASCII_LENGTH(",password="));
+ }
+ if (aUser.getLength() != 0)
+ {
+ aTheUcbUrl.InsertAscii(",user=", nInsert);
+ aTheUcbUrl.Insert(INetURLObject::encode(
+ aUser,
+ INetURLObject::PART_UNO_PARAM_VALUE,
+ '%',
+ INetURLObject::ENCODE_ALL),
+ nInsert + RTL_CONSTASCII_LENGTH(",user="));
+ }
+ if (aHost.getLength() - nColon > 1)
+ {
+ aTheUcbUrl.InsertAscii(",port=", nInsert);
+ aTheUcbUrl.Insert(INetURLObject::encode(
+ aHost.copy(nColon + 1),
+ INetURLObject::PART_UNO_PARAM_VALUE,
+ '%',
+ INetURLObject::ENCODE_ALL),
+ nInsert + RTL_CONSTASCII_LENGTH(",port="));
+ }
+ if (nColon > 0)
+ {
+ aTheUcbUrl.InsertAscii(",host=", nInsert);
+ aTheUcbUrl.Insert(INetURLObject::encode(
+ aHost.copy(0, nColon),
+ INetURLObject::PART_UNO_PARAM_VALUE,
+ '%',
+ INetURLObject::ENCODE_ALL),
+ nInsert + RTL_CONSTASCII_LENGTH(",host="));
+ }
+ }
+
+ // Get the (local) RemoteAccessUCP:
+ Reference< ucb::XParameterizedContentProvider > xRemoteAccessUcp;
+ try
+ {
+ xRemoteAccessUcp
+ = Reference< ucb::XParameterizedContentProvider >(
+ xFactory->
+ createInstance(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb."
+ "RemoteAccessContentProvider"))),
+ UNO_QUERY);
+ }
+ catch (RuntimeException const &) { throw; }
+ catch (Exception const &) {}
+ if (!xRemoteAccessUcp.is())
+ {
+ DBG_ERROR("configureUcb(): No RemoteAccessContentProvider service");
+ return false;
+ }
+
+ // Create an instance of the RemoteAccessUCP specialized on the
+ // (template, url) pair:
+ rtl::OUString aTemplate(RTL_CONSTASCII_USTRINGPARAM(".*"));
+ Reference< ucb::XContentProvider > xInstance;
+ try
+ {
+ xInstance
+ = xRemoteAccessUcp->registerInstance(aTemplate, aTheUcbUrl, false);
+ }
+ catch (IllegalArgumentException const &)
+ {
+ DBG_ERROR("configureUcb(): Can't registerInstance()");
+ return false;
+ }
+ if (!xInstance.is())
+ {
+ DBG_ERROR("configureUcb(): Bad registerInstance()");
+ return false;
+ }
+
+ // Register the specialized RemoteAccessUCP instance at the (local) UCB:
+ try
+ {
+ xUcb->registerContentProvider(xInstance, aTemplate, false);
+ }
+ catch (ucb::DuplicateProviderException const &)
+ {
+ DBG_ERROR("configureUcb(): Bad registerContentProvider()");
+ try
+ {
+ xRemoteAccessUcp->deregisterInstance(aTemplate, aTheUcbUrl);
+ }
+ catch (lang::IllegalArgumentException const &) {}
+ return false;
+ }
+ catch (uno::RuntimeException const &)
+ {
+ DBG_ERROR("configureUcb(): Bad registerContentProvider()");
+ try
+ {
+ xRemoteAccessUcp->deregisterInstance(aTemplate, aTheUcbUrl);
+ }
+ catch (lang::IllegalArgumentException const &) {}
+ throw;
+ }
+
+ return true;
+}
+
+//====================================================================
+
+FASTBOOL SfxApplication::Initialize_Impl()
+{
+#ifdef TLX_VALIDATE
+ StgIo::SetErrorLink( LINK( this, SfxStorageErrHdl, Error ) );
+#endif
+
+//! FSysEnableSysErrorBox( FALSE ); (pb) replaceable?
+
+ Reference < XDesktop > xDesktop ( ::utl::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
+ xDesktop->addTerminateListener( new SfxTerminateListener_Impl() );
+
+ if( !CheckTryBuy_Impl() )
+ {
+ exit(-1);
+ return FALSE;;
+ }
+
+ Application::EnableAutoHelpId();
+
+ InsertLateInitHdl( STATIC_LINK( pAppData_Impl, SfxAppData_Impl, CreateDataLockBytesFactory ) );
+
+ pAppData_Impl->pAppDispatch = new SfxStatusDispatcher;
+ pAppData_Impl->pAppDispatch->acquire();
+
+ // SV-Look
+ Help::EnableContextHelp();
+ Help::EnableExtHelp();
+ Help::EnableQuickHelp();
+
+ // falls der IniManager nicht schon durch CreateResManager erzeugt wurde
+ if ( !pAppIniMgr )
+ pAppIniMgr = CreateIniManager();
+
+ // StarObjects initialisieren
+ if ( !SvFactory::Init() )
+ ErrorBox( 0, SfxResId(MSG_ERR_SOINIT) ).Execute();
+
+ // Factory f"ur das SfxFrameObject anlegen; da der Pointer in den AppDaten
+ // liegt, dieser aber nicht exportierbar ist, mu\s ein exportierbarer
+ // Wrapper angelegt werden
+ pAppData_Impl->pSfxFrameObjectFactoryPtr = new SfxFrameObjectFactoryPtr;
+ pAppData_Impl->pSfxFrameObjectFactoryPtr->pSfxFrameObjectFactory = SfxFrameObject::ClassFactory();
+ SvBindStatusCallback::SetProgressCallback( STATIC_LINK( 0, SfxProgress, DefaultBindingProgress ) );
+ INetURLHistory::GetOrCreate()->SetLocation( GetIniManager()->Get( SFX_KEY_USERCONFIG_PATH ) );
+
+ // merken, falls Applikation normal gestartet wurde
+ if ( pAppData_Impl->bDirectAliveCount )
+ SvFactory::IncAliveCount();
+
+ pImp->pEventHdl = new UniqueIndex( 1, 4, 4 );
+ InitializeDisplayName_Impl();
+
+#ifdef DBG_UTIL
+ // Der SimplerErrorHandler dient Debugzwecken. In der Product werden
+ // nichtgehandelte Fehler durch Errorcode 1 an SFX gegeben.
+ new SimpleErrorHandler;
+#endif
+ new SfxErrorHandler(RID_ERRHDL, ERRCODE_AREA_TOOLS, ERRCODE_AREA_LIB1);
+ new SfxErrorHandler(
+ RID_SO_ERROR_HANDLER, ERRCODE_AREA_SO, ERRCODE_AREA_SO_END);
+ new SfxErrorHandler(
+ (RID_SJ_START +1), ERRCODE_AREA_JAVA, ERRCODE_AREA_JAVA_END);
+ new SfxErrorHandler(
+ RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END );
+
+ // diverse Pointer
+ pImp->pAutoSaveTimer = new Timer;
+ String aPickSize = GetIniManager()->Get( SFX_KEY_PICKLIST );
+ int nPickSize = !aPickSize.Len() ? 4 : (int) aPickSize.ToInt32();
+ SfxPickList_Impl::GetOrCreate( Min(9, nPickSize) );
+
+ /////////////////////////////////////////////////////////////////
+
+ DBG_ASSERT( !pAppDispat, "AppDispatcher already exists" );
+ pAppDispat = new SfxDispatcher((SfxDispatcher*)0);
+ pSlotPool = new SfxSlotPool;
+ pImp->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl;
+ pImp->pStbCtrlFac = new SfxStbCtrlFactArr_Impl;
+ pImp->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl;
+ pImp->pViewFrames = new SfxViewFrameArr_Impl;
+ pImp->pViewShells = new SfxViewShellArr_Impl;
+ pImp->pObjShells = new SfxObjectShellArr_Impl;
+ nInterfaces = SFX_INTERFACE_APP+8;
+ pInterfaces = new SfxInterface*[nInterfaces];
+ memset( pInterfaces, 0, sizeof(SfxInterface*) * nInterfaces );
+
+ pAppData_Impl->pAppCfg = new SfxConfigManager;
+ pAppData_Impl->pAppCfg->Activate( pCfgMgr );
+
+ pAcceleratorMgr = new SfxAcceleratorManager;
+
+ pImageMgr = new SfxImageManager;
+ pOptions = new SfxOptions;
+
+ SfxNewHdl* pNewHdl = SfxNewHdl::GetOrCreate();
+ InsertLateInitHdl( LINK(pNewHdl, SfxNewHdl, InitMem_Impl) );
+ InsertLateInitHdl( LINK(this, SfxApplication,SpecialService_Impl) );
+
+ // Die Strings muessen leider zur Laufzeit gehalten werden, da wir bei
+ // einer ::com::sun::star::uno::Exception keine Resourcen mehr laden duerfen.
+ pImp->aMemExceptionString = pNewHdl->GetMemExceptionString();
+ pImp->aResWarningString = String( SfxResId( STR_RESWARNING ) );
+ pImp->aResExceptionString = String( SfxResId( STR_RESEXCEPTION ) );
+ pImp->aSysResExceptionString = String( SfxResId( STR_SYSRESEXCEPTION ) );
+
+ Registrations_Impl();
+
+ RegisterEvent(SFX_EVENT_STARTAPP, String(SfxResId(STR_EVENT_STARTAPP)));
+ RegisterEvent(SFX_EVENT_CLOSEAPP, String(SfxResId(STR_EVENT_CLOSEAPP)));
+ RegisterEvent(SFX_EVENT_CREATEDOC,String(SfxResId(STR_EVENT_CREATEDOC)));
+ RegisterEvent(SFX_EVENT_OPENDOC, String(SfxResId(STR_EVENT_OPENDOC)));
+ RegisterEvent(SFX_EVENT_SAVEASDOC, String(SfxResId(STR_EVENT_SAVEASDOC)));
+ RegisterEvent(SFX_EVENT_SAVEASDOCDONE, String(SfxResId(STR_EVENT_SAVEASDOCDONE)));
+ RegisterEvent(SFX_EVENT_SAVEDOC, String(SfxResId(STR_EVENT_SAVEDOC)));
+ RegisterEvent(SFX_EVENT_SAVEDOCDONE, String(SfxResId(STR_EVENT_SAVEDOCDONE)));
+ RegisterEvent(SFX_EVENT_PREPARECLOSEDOC, String(SfxResId(STR_EVENT_PREPARECLOSEDOC)));
+ RegisterEvent(SFX_EVENT_CLOSEDOC, String(SfxResId(STR_EVENT_CLOSEDOC)));
+ RegisterEvent(SFX_EVENT_ACTIVATEDOC, String(SfxResId(STR_EVENT_ACTIVATEDOC)));
+ RegisterEvent(SFX_EVENT_DEACTIVATEDOC, String(SfxResId(STR_EVENT_DEACTIVATEDOC)));
+ RegisterEvent(SFX_EVENT_PRINTDOC, String(SfxResId(STR_EVENT_PRINTDOC)));
+ RegisterEvent(SFX_EVENT_ONERROR, String(SfxResId(STR_EVENT_ONERROR)));
+ RegisterEvent(SFX_EVENT_NEWMESSAGE, String(SfxResId(STR_EVENT_NEWMESSAGE)));
+
+ // Filtercontainer fuer ::com::sun::star::sdbcx::User Overrides registrieren
+ SfxFilterContainer* pDefaults = new SfxFilterContainer( DEFINE_CONST_UNICODE(SFX_FCONTNR_REDIRECTS) );
+ SfxFilterMatcher& rMatcher = GetFilterMatcher();
+ rMatcher.AddContainer( pDefaults );
+ pDefaults->LoadFilters(
+ DEFINE_CONST_UNICODE(SFX_FCONTNR_REDIRECTS), sal_False,
+ SFX_FILTER_REDIRECT | SFX_FILTER_IMPORT | SFX_FILTER_ALIEN |
+ SFX_FILTER_NOTINFILEDLG | SFX_FILTER_NOTINCHOOSER );
+
+ if( _nFeatures & SFX_FEATURE_SCALC &&
+ _nFeatures & SFX_FEATURE_SIMPRESS &&
+ _nFeatures & SFX_FEATURE_SDRAW &&
+ _nFeatures & SFX_FEATURE_SIMAGE &&
+ _nFeatures & SFX_FEATURE_SCHART &&
+ _nFeatures & SFX_FEATURE_SMATH &&
+ _nFeatures & SFX_FEATURE_SWRITER )
+ {
+ // Office Filter registrieren
+ SfxFilterContainer* pContainer =
+ new SfxFilterContainer( DEFINE_CONST_UNICODE("soffice4") );
+ pContainer->AddFilter( new SfxOfficeFilter( pContainer ), 0 );
+ rMatcher.AddContainer( pContainer );
+ }
+
+ // Subklasse initialisieren
+ bDowning = sal_False;
+ bInInit = sal_True;
+ Init();
+
+ // get CHAOS item pool...
+ pAppData_Impl->pPool = NoChaos::GetItemPool();
+ SetPool( pAppData_Impl->pPool );
+
+ // If '-ucb=...' was specified on the command line, configure the UCB now:
+ if (pAppData_Impl->aUcbUrl.Len() != 0
+ && !configureUcb(pAppData_Impl->aUcbUrl))
+ {
+ exit(-1);
+ return FALSE;
+ }
+
+// SfxFrameSetObjectShell::RegisterFactory(0);
+// SfxFrameSetView_Impl::RegisterFactory(0);
+// SfxFrameSetSourceView_Impl::RegisterFactory(1);
+
+// rMatcher.AddContainer( new SfxExecutableFilterContainer() );
+// rMatcher.AddContainer( new SfxExternalAppFilterContainer() );
+// rMatcher.AddContainer( new SfxPluginFilterContainer() );
+
+ InsertLateInitHdl( LINK(this, SfxApplication,LateInitOLEReg_Impl) );
+ InsertLateInitHdl( LINK(this, SfxApplication,LateInitCHAOSReg_Impl) );
+ InsertLateInitHdl( LINK(this, SfxApplication,LateInitNewMenu_Impl) );
+ InsertLateInitHdl( LINK(this, SfxApplication,LateInitWizMenu_Impl) );
+ InsertLateInitHdl( LINK(this, SfxApplication,AutoStart_Impl) );
+
+ bInInit = sal_False;
+ if ( bDowning )
+ return sal_False;
+
+ // App-Dispatcher aufbauen
+ pAppDispat->Push(*this);
+ pAppDispat->DoActivate_Impl( sal_True );
+
+ // if not done in Init(), load the configuration
+ if ( !pImp->bConfigLoaded )
+ LoadConfig();
+ pImp->pAutoSaveTimer->SetTimeout( pOptions->GetAutoSaveTime() * 60000 );
+ pImp->pAutoSaveTimer->SetTimeoutHdl( LINK( pApp, SfxApplication, AutoSaveHdl_Impl ) );
+
+ // App-StartEvent
+ NotifyEvent(SfxEventHint(SFX_EVENT_STARTAPP), sal_False);
+
+//(dv) if ( !pAppData_Impl->bBean )
+//(mba) doFirstTimeInit();
+
+ Application::PostUserEvent( LINK( this, SfxApplication, OpenClients_Impl ) );
+
+ DELETEZ(pImp->pIntro);
+
+ // start LateInit
+ SfxAppData_Impl *pAppData = Get_Impl();
+ pAppData->aLateInitTimer.SetTimeout( 250 );
+ pAppData->aLateInitTimer.SetTimeoutHdl( LINK( this, SfxApplication, LateInitTimerHdl_Impl ) );
+ pAppData->aLateInitTimer.Start();
+
+/*! (pb) no help at this time
+ Application::PostUserEvent( LINK( this, SfxApplication, StartWelcomeScreenHdl_Impl ) );
+*/
+ return sal_True;
+}
+
+IMPL_LINK( SfxApplication, SpecialService_Impl, void*, pVoid )
+{
+ if ( pAppData_Impl->bBean )
+ return 0;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::installation::XInstallationCheck > xInst( xMgr->createInstance( DEFINE_CONST_UNICODE("com.sun.star.installation.FontCheck") ), ::com::sun::star::uno::UNO_QUERY );
+ if ( xInst.is() )
+ xInst->checkWithDialog( sal_False );
+
+ String aWizard = GetIniManager()->Get( DEFINE_CONST_UNICODE("Common"), 0, 0, DEFINE_CONST_UNICODE("RunWizard") );
+ sal_Bool bRunWizard = (sal_Bool) (sal_uInt16) aWizard.ToInt32();
+ if ( bRunWizard )
+ {
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ SfxStringItem aMacro( SID_FILE_NAME, DEFINE_CONST_UNICODE("macro://#InternetSetup.Run.Main()") );
+//(mba) pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aMacro, &aReferer, 0L );
+ GetIniManager()->DeleteKey( DEFINE_CONST_UNICODE("Common"), DEFINE_CONST_UNICODE("RunWizard") );
+ GetIniManager()->Flush();
+ }
+ else if ( !pAppData_Impl->bBean )
+ {
+ // StarOffice registration
+ INetURLObject aORegObj( GetIniManager()->Get( SFX_KEY_USERCONFIG_PATH ), INET_PROT_FILE );
+ aORegObj.insertName( DEFINE_CONST_UNICODE( "oreg.ini" ) );
+ Config aCfg( aORegObj.PathToFileName() );
+ aCfg.SetGroup( "reg" );
+ sal_uInt16 nRegKey = (sal_uInt16) aCfg.ReadKey( "registration", "0" ).ToInt32();
+ if( nRegKey == 0 )
+ GetAppDispatcher_Impl()->Execute(SID_ONLINE_REGISTRATION_DLG, SFX_CALLMODE_ASYNCHRON);
+ }
+
+ return 0;
+}
+
+IMPL_LINK( SfxApplication, AutoStart_Impl, void*, pVoid )
+{
+ // Autostart-Code
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ String aName = SFX_INIMANAGER()->Get( SFX_KEY_AUTOSTART_DIR );
+ if ( aName.Len() )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aFiles =
+ SfxContentHelper::GetFolderContents( aName, sal_False );
+ const ::rtl::OUString* pFiles = aFiles.getConstArray();
+ UINT32 nCount = aFiles.getLength();
+ for ( UINT32 i = 0; i < nCount; i++ )
+ {
+ String aURL( pFiles[i] );
+ if ( aURL.Len() )
+ {
+ SfxStringItem aItem( SID_FILE_NAME, aURL );
+ GetAppDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aItem, &aReferer, 0L );
+ }
+ }
+ }
+
+ return 0L;
+}
+
+
diff --git a/sfx2/source/appl/appmain.cxx b/sfx2/source/appl/appmain.cxx
new file mode 100644
index 000000000000..9e416ee53a0b
--- /dev/null
+++ b/sfx2/source/appl/appmain.cxx
@@ -0,0 +1,632 @@
+/*************************************************************************
+ *
+ * $RCSfile: appmain.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+//#define TF_NEWDESKTOP
+
+#define _SDINTERN_HXX
+
+#pragma hdrstop
+
+#ifndef _PVER_HXX //autogen
+#include <svtools/pver.hxx>
+#endif
+#ifndef _URLOBJ_HXX //autogen
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _CSTITEM_HXX //autogen
+#include <svtools/cstitem.hxx>
+#endif
+#ifndef _SV_CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#include <svtools/itempool.hxx>
+#include <svtools/urihelper.hxx>
+
+#include "appimp.hxx"
+#include "sfxtypes.hxx"
+#include "appdata.hxx"
+#include "docfac.hxx"
+#include "app.hxx"
+#include "arrdecl.hxx"
+#include "dispatch.hxx"
+#include "sfxresid.hxx"
+#include "interno.hxx"
+#include "fcontnr.hxx"
+#include "viewsh.hxx"
+#include "picklist.hxx"
+#include "intro.hxx"
+#include "msgpool.hxx"
+#include "cfgmgr.hxx"
+#include "accmgr.hxx"
+#include "mnumgr.hxx"
+#include "stbmgr.hxx"
+#include "imgmgr.hxx"
+#include "saveopt.hxx"
+#include "eacopier.hxx"
+#include "appuno.hxx"
+#include "objuno.hxx"
+#include "urltrans.hxx"
+#include "app.hrc"
+#include "docfile.hxx"
+#include "inimgr.hxx"
+
+#ifdef WNT
+#include <tools/svwin.h>
+#endif
+
+#ifdef UNX
+#define stricmp(a,b) strcmp(a,b)
+#endif
+
+
+//===================================================================
+
+/*DBG_NAME(SfxAppMainIntro);
+DBG_NAME(SfxAppMainSO_Init);
+DBG_NAME(SfxAppMainAppRes);
+DBG_NAME(SfxAppMainInit0);
+DBG_NAME(SfxAppMainCreateAppWin);
+DBG_NAME(SfxAppMainInit1);
+DBG_NAME(SfxAppMainCfgMgr);
+DBG_NAME(SfxAppMainInitController);
+DBG_NAME(SfxAppMainInitException);
+DBG_NAME(SfxAppMainRegisterIF);
+DBG_NAME(SfxAppMainInit);
+DBG_NAME(SfxAppMainLoadBasMgr);
+DBG_NAME(SfxAppMainSbxInit);*/
+DBG_NAME(SfxAppMainNewMenu);
+DBG_NAME(SfxAppMainBmkMenu);
+DBG_NAME(SfxAppMainWizMenu);
+DBG_NAME(SfxAppMainOLEReg);
+DBG_NAME(SfxAppMainCHAOSReg);
+/*DBG_NAME(SfxAppMainInitDispatcher);
+DBG_NAME(SfxAppMainLoadConfig);
+DBG_NAME(SfxAppMainInitAppWin);
+DBG_NAME(SfxAppMainAppEvents);*/
+
+//===================================================================
+
+#define SFX_TEMPNAMEBASE_DIR "soffice.tmp"
+#define SFX_KEY_TEMPNAMEBASE "Temp-Dir"
+
+//===================================================================
+
+#pragma code_seg("STATICS")
+static SfxVoidItem aStaticDefault(1);
+#pragma code_seg()
+
+static SfxPoolItem* aStaticDefaults[1] =
+{
+ &aStaticDefault
+};
+
+#ifdef TF_POOLABLE
+static SfxItemInfo __READONLY_DATA aItemInfos[] =
+{
+ { 0, 0 }
+};
+#endif
+
+static SfxEA_Copier* pEA_Copier = 0;
+
+//===================================================================
+
+typedef Link* LinkPtr;
+SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4);
+
+TYPEINIT1(SfxSysChangeHint, SfxHint);
+TYPEINIT2(SfxApplication,SfxShell,SfxBroadcaster);
+
+//--------------------------------------------------------------------
+
+BOOL SfxApplication::HasFeature( ULONG nFeature ) const
+
+/** [Description]
+
+ Determines if 'nFeature' is supported by this running application.
+ If more than one feature is given (by arithmetic 'or') and at least
+ one of them is supported, it will return TRUE.
+
+ The supported features are set in the ctor of SfxApplication.
+*/
+
+{
+ return 0 != ( nFeature & _nFeatures );
+}
+
+//--------------------------------------------------------------------
+void SfxApplication::Init
+(
+)
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode wird vom SFx aus Application:a:Main() gerufen,
+ bevor Execute() ausgef"uhrt wird und
+ - das Intro bereits angezeigt ist,
+ - das Applikationsfenster exisitiert, aber noch hidden ist,
+ - die Bindings bereits existieren (Controller sind anmeldbar),
+ - der Ini- und Config-Manager bereits existiert,
+ - die Standard-Controller bereits exisitieren,
+ - die SFx-Shells ihre Interfaces bereits registriert haben.
+
+ [Querverweise]
+ <SfxApplication::Exit()>
+ <SfxApplication::OpenClients()>
+*/
+{
+#ifdef DDE_AVAILABLE
+#ifdef PRODUCT
+ InitializeDde();
+#else
+ if( !InitializeDde() )
+ {
+ ByteString aStr( "Kein DDE-Service moeglich. Fehler: " );
+ if( GetDdeService() )
+ aStr += GetDdeService()->GetError();
+ else
+ aStr += '?';
+ DBG_ASSERT( sal_False, aStr.GetBuffer() )
+ }
+#endif
+#endif
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::Exit()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode wird vom SFx aus Application::Main() gerufen,
+ nachdem Execute() beendet ist und
+ - die Konfiguration (SfxConfigManager) bereits gespeichert wurde,
+ - die Fensterpostionen etc. in den SfxIniManager geschrieben wurden,
+ - das Applikationsfenster noch existiert, aber hidden ist
+ - s"amtliche Dokumente und deren Views bereits geschlossen sind.
+ - Dispatcher, Bindings etc. bereits zerst"ort sind
+
+ [Querverweise]
+ <SfxApplication::Init(int,char*[])>
+*/
+
+{
+}
+
+//---------------------------------------------------------------------------
+
+void SfxApplication::PreInit( )
+{
+ // in Tools das kopieren von EAs ermoeglichen
+ if ( !pEA_Copier )
+ pEA_Copier = new SfxEA_Copier;
+}
+
+USHORT SfxApplication::ParseCommandLine_Impl()
+{
+ USHORT nEvents = 0; // return value ( event mask )
+
+ BOOL bPrintEvent = FALSE;
+ BOOL bOpenEvent = TRUE;
+ USHORT nCount = Application::GetCommandLineParamCount();
+ for( USHORT i=0; i < nCount; i++ )
+ {
+ String aArg = Application::GetCommandLineParam( i );
+
+ if ( aArg.EqualsIgnoreCaseAscii("-minimized") == sal_True )
+ pAppData_Impl->bMinimized = TRUE;
+ if ( aArg.EqualsIgnoreCaseAscii("-invisible") == sal_True )
+ pAppData_Impl->bInvisible = TRUE;
+ if ( aArg.EqualsIgnoreCaseAscii("-embedding") == sal_True )
+ pAppData_Impl->nAppEvent |= DISPATCH_SERVER;
+ if ( aArg.EqualsIgnoreCaseAscii("-bean") == sal_True )
+ {
+ pAppData_Impl->bBean = TRUE;
+ pAppData_Impl->bInvisible = TRUE;
+ }
+ if ( aArg.EqualsIgnoreCaseAscii("-plugin") == sal_True )
+ {
+ pAppData_Impl->bBean = TRUE;
+ pAppData_Impl->bInvisible = TRUE;
+ pAppData_Impl->bIBMTitle = TRUE;
+ }
+ if ( aArg.CompareIgnoreCaseToAscii("-ucb=",
+ RTL_CONSTASCII_LENGTH("-ucb="))
+ == COMPARE_EQUAL )
+ pAppData_Impl->aUcbUrl
+ = aArg.Copy(RTL_CONSTASCII_LENGTH("-ucb="));
+
+ const xub_Unicode* pArg = aArg.GetBuffer();
+ // Erstmal nur mit -, da unter Unix Dateinmane auch mit Slasch anfangen koennen
+ if ( (*pArg == '-') /* || (*pArg == '/') */ )
+ {
+ pArg++;
+
+ // Ein Schalter
+ if ( (*pArg == 'p') || (*pArg == 'P') )
+ {
+ bPrintEvent = TRUE;
+ bOpenEvent = FALSE; // Ab hier keine OpenEvents mehr
+ }
+ }
+ else
+ {
+ // Dies wird als Dateiname interpretiert
+ if ( bOpenEvent )
+ {
+ // Open Event anhaengen
+ if ( pAppData_Impl->aOpenList.Len() )
+ pAppData_Impl->aOpenList += APPEVENT_PARAM_DELIMITER;
+ pAppData_Impl->aOpenList += aArg;
+ }
+ else if ( bPrintEvent )
+ {
+ // Print Event anhaengen
+ if( pAppData_Impl->aPrintList.Len() )
+ pAppData_Impl->aPrintList += APPEVENT_PARAM_DELIMITER;
+ pAppData_Impl->aPrintList += aArg;
+ }
+ }
+ }
+
+ if ( pAppData_Impl->aOpenList.Len() )
+ nEvents |= DISPATCH_OPEN;
+
+ if ( pAppData_Impl->aPrintList.Len() )
+ nEvents |= DISPATCH_PRINT;
+
+ return nEvents;
+}
+
+//---------------------------------------------------------------------------
+void SfxApplication::StartUpScreen( const char* pLabelPrefix )
+{
+ // Label-DLL mit diversen Resourcen fuer OEM-Ver. etc. (Intro, Titel, About)
+ pAppData_Impl->bBean = FALSE;
+ pAppData_Impl->nAppEvent = ParseCommandLine_Impl();
+ if ( pLabelPrefix )
+ {
+ // versuchen, die Label-DLL zu erzeugen
+ pAppData_Impl->pLabelResMgr = CreateResManager( pLabelPrefix );
+
+ // keine separate Label-DLL vorhanden?
+ if ( !pAppData_Impl->pLabelResMgr )
+ // dann den ResMgr vom Executable verwenden
+ pAppData_Impl->pLabelResMgr = new ResMgr;
+
+ // Intro nur anzeigen, wenn normaler Start (kein Print/Server etc.)
+ if ( !pAppData_Impl->bInvisible && !pAppData_Impl->bMinimized &&
+ pAppData_Impl->nAppEvent != DISPATCH_PRINT && pAppData_Impl->nAppEvent != DISPATCH_SERVER )
+ {
+ // und es nicht ausgeschaltet ist
+ String aIntroIni = pAppIniMgr->Get(SFX_KEY_SHOW_INTRO);
+ ULONG nDisplayTime = ULONG(aIntroIni.ToInt32());
+
+ if ( 2 == nDisplayTime || aIntroIni.Len() < 1 )
+ {
+ // 2 oder 'kein Ini-Eintrag' bedeutet
+ // Einstellungen aus dem System holen
+ AllSettings aSettings = Application::GetSettings();
+ Application::MergeSystemSettings( aSettings );
+ nDisplayTime = aSettings.GetStyleSettings().GetLogoDisplayTime();
+ }
+
+ if ( nDisplayTime != LOGO_DISPLAYTIME_NOLOGO )
+ {
+ USHORT nResId = RID_DEFAULTINTRO;
+ if ( Application::IsRemoteServer() )
+ nResId = RID_DEFAULTINTRO_PORTAL;
+ // die ggf. im System eingestellte Zeit wird hier nicht ber"ucksichtigt
+ pImp->pIntro = new IntroWindow_Impl(
+ Bitmap( ResId( nResId, pAppData_Impl->pLabelResMgr ) ) );
+ }
+ }
+ }
+ else
+ {
+ pAppData_Impl->bBean = TRUE;
+ pAppData_Impl->bInvisible = TRUE;
+ }
+
+ // merken, falls Applikation normal gestartet wurde
+ if ( 0 == pAppData_Impl->nAppEvent || DISPATCH_OPEN == pAppData_Impl->nAppEvent )
+ pAppData_Impl->bDirectAliveCount = TRUE;
+}
+
+void SfxApplication::Main( )
+{
+}
+
+//--------------------------------------------------------------------
+#if defined( MAC )
+ void InstallAppleScriptHdl();
+#endif
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, LateInitNewMenu_Impl, void*, pvoid)
+{
+ DBG_PROFSTART(SfxAppMainNewMenu);
+ pAppData_Impl->GetPopupMenu( SID_NEWDOCDIRECT );
+ DBG_PROFSTOP(SfxAppMainNewMenu);
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, LateInitBmkMenu_Impl, void*, pvoid)
+{
+ DBG_PROFSTART(SfxAppMainBmkMenu);
+ pAppData_Impl->GetPopupMenu( SID_BOOKMARKS);
+ DBG_PROFSTOP(SfxAppMainBmkMenu);
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, LateInitWizMenu_Impl, void*, pvoid)
+{
+ DBG_PROFSTART(SfxAppMainWizMenu);
+ pAppData_Impl->GetPopupMenu( SID_AUTOPILOTMENU );
+ DBG_PROFSTOP(SfxAppMainWizMenu);
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, LateInitOLEReg_Impl, void*, pvoid)
+{
+#if 0
+ // OLE-Registrierung nur wenn Default-Factory OLE-f"ahig ist
+ DBG_PROFSTART(SfxAppMainOLEReg);
+ if ( GetObjFacArray_Impl().Count() )
+ if ( SvGlobalName() != *GetObjFacArray_Impl()[0] )
+ {
+ // StarOffice-Manager hat keine Doc-Factories
+ WriteRegistration( GetObjFacArray_Impl()[0],
+ HACK(MM will den folgenden Parameter rausnehmen)
+ "So'n Sch..., war wohl doch wichtig! (MM oder MI fragen)" );
+ SfxShellObject *pShObj = GetShellObj_Impl();
+ if ( pShObj && pShObj->GetSvFactory() )
+ WriteRegistration( ( /*not const*/ SvFactory*) pShObj->GetSvFactory(),
+ HACK(MM will den folgenden Parameter rausnehmen)
+ "So'n Sch..., war wohl doch wichtig! (MM oder MI fragen)" );
+ }
+ DBG_PROFSTOP(SfxAppMainOLEReg);
+ #endif
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, LateInitCHAOSReg_Impl, void*, pvoid)
+{
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxApplication::InsertLateInitHdl(const Link& rLink)
+{
+ if ( Application::IsInExecute() )
+ Application::PostUserEvent( rLink );
+ else
+ {
+ if ( !pAppData_Impl->pInitLinkList )
+ pAppData_Impl->pInitLinkList = new SfxInitLinkList;
+
+ Link *pLink = new Link;
+ *pLink = rLink;
+ USHORT nCount = ( USHORT ) pAppData_Impl->pInitLinkList->Count();
+ pAppData_Impl->pInitLinkList->Insert(pLink, nCount);
+ }
+}
+
+void SfxApplication::ForcePendingInitFactories()
+{
+ List& rList = Get_Impl()->aPendingInitFactories;
+ USHORT nPos = (USHORT) rList.Count();
+#if LATEINIT
+ DBG_ASSERT( !nPos, "Filter nicht im LateInit" );
+#endif
+ while( nPos = rList.Count() )
+ {
+ SfxObjectFactory* pFac = (SfxObjectFactory*)rList.Remove( --nPos );
+ pFac->DoInitFactory();
+ }
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, LateInitTimerHdl_Impl, void*, pvoid)
+{
+ // Ersten Link aus der Liste holen und ausf"uhren
+ Link *pLink = (*pAppData_Impl->pInitLinkList)[0];
+ pLink->Call(0);
+
+ // Link entfernen
+ pAppData_Impl->pInitLinkList->Remove(0);
+ delete pLink;
+
+ // Timer wieder starten, wenn noch weitere Links da sind
+ if ( pAppData_Impl->pInitLinkList->Count() )
+ pAppData_Impl->aLateInitTimer.Start();
+ else
+ {
+ // LateInit ist fertig
+ DELETEZ (pAppData_Impl->pInitLinkList);
+ pAppIniMgr->ResetLock();
+ }
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, StartWelcomeScreenHdl_Impl, void*, EMPTYARG )
+{
+ // User-Event kommt zu schnell, also 0,5s warten, wenn er nicht sowieso schon da ist.
+ static Timer* pTimer = NULL;
+ if ( !pTimer && !SFX_APP()->GetHelpPI() )
+ {
+ pTimer = new Timer;
+ pTimer->SetTimeout( 500 );
+ pTimer->SetTimeoutHdl( LINK( this, SfxApplication, StartWelcomeScreenHdl_Impl ) );
+ pTimer->Start();
+ return 0;
+ }
+
+ delete pTimer;
+ pTimer = NULL;
+
+ if ( GetOptions().IsWelcomeScreen() )
+ {
+/*
+ ULONG nId = 0;
+ Config aConfig( SfxHelp_Impl::GetHelpAgentConfig() );
+ ImplSetLanguageGroup( aConfig, String::CreateFromAscii("WelcomeScreen"), TRUE );
+ USHORT nTips = aConfig.GetKeyCount();
+ for ( USHORT nTip = 0; nTip < nTips; nTip++ )
+ {
+ if ( (BOOL)(USHORT)(aConfig.ReadKey( nTip ).ToInt32()) )
+ {
+ nId = aConfig.GetKeyName( nTip ).ToInt32();
+ break;
+ }
+ }
+
+ if ( nId )
+ {
+ SetChildWindow( SID_TIPWINDOW, TRUE );
+
+ // Das muss irgendwie in den ctor des Fensters
+ String aHFile( "tips.svh" );
+ SfxHelp::ShowHelp( nId, TRUE, aHFile, TRUE );
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ {
+ pHelpPI->SetWelcomeMode( TRUE );
+ aConfig.WriteKey( nId, (USHORT)0 ); // gleich als gelesen flaggen
+ }
+ }
+ */
+ }
+ return 1;
+}
+
+//-------------------------------------------------------------------------
+
+SfxFilterMatcher& SfxApplication::GetFilterMatcher()
+{
+ if( !pAppData_Impl->pMatcher )
+ {
+ pAppData_Impl->pMatcher = new SfxFilterMatcher( TRUE );
+ URIHelper::SetMaybeFileHdl( STATIC_LINK(
+ pAppData_Impl->pMatcher, SfxFilterMatcher, MaybeFileHdl_Impl ) );
+ }
+ return *pAppData_Impl->pMatcher;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxApplication::IsStandalone() const
+{
+ // Wenn ohne UI gestartet, nat"urlich niemals integrierter Desktop
+ if ( pAppData_Impl->bBean )
+ return TRUE;
+
+ String aExt = SFX_INIMANAGER()->Get( String::CreateFromAscii( "Common"), 0, 0, String::CreateFromAscii("FullScreenDesktop") );
+ if ( aExt.Len() )
+ {
+ // INI-Eintrag auswerten
+ return !( (BOOL) (USHORT) aExt.ToInt32() );
+ }
+ else
+ {
+ // Defaults: bei AppServer kein integrierter Desktop, bei FatOffice
+ // unter WNT integriert, ansonsten nicht
+ if ( Application::IsRemoteServer() )
+ return TRUE;
+#ifdef WNT
+ return FALSE;
+#else
+ return TRUE;
+#endif
+ }
+}
+
+//========================================================================
+
+String& SfxApplication::GetSaveAsTargetURLHack()
+{
+ return pAppData_Impl->aSaveAsTarget;
+}
+
+
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
new file mode 100644
index 000000000000..24916015b673
--- /dev/null
+++ b/sfx2/source/appl/appmisc.cxx
@@ -0,0 +1,1170 @@
+/*************************************************************************
+ *
+ * $RCSfile: appmisc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ //==================================================================
+// class SfxApplication: Interface, Array-Impls und allerlei anderes
+//
+// Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+// $Author: hr $ $Date: 2000-09-18 16:52:26 $ $Revision: 1.1.1.1 $
+// $Logfile: T:/sfx2/source/appl/appmisc.cxv $ $Workfile: APPMISC.CXX $
+//------------------------------------------------------------------
+
+#ifndef _SV_STATUS_HXX
+#include <vcl/status.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _VOS_PROCESS_HXX //autogen
+#include <vos/process.hxx>
+#endif
+#ifndef _XCEPTION_HXX_
+#include <vos/xception.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _LIBCALL_HXX //autogen
+#include <svtools/libcall.hxx>
+#endif
+#ifndef _FILTER_HXX //autogen
+#include <svtools/filter.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_REGISTRY_INVALIDREGISTRYEXCEPTION_HPP_
+#include <com/sun/star/registry/InvalidRegistryException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#include <vcl/config.hxx>
+#include <tools/rcid.h>
+#include <vos/mutex.hxx>
+#include <svtools/pver.hxx>
+#pragma hdrstop
+#ifndef _UTL_CONFIGMGR_HXX_
+#include <unotools/configmgr.hxx>
+#endif
+#include "sfxresid.hxx"
+#include "app.hxx"
+#include "picklist.hxx"
+#include "appdata.hxx"
+#include "arrdecl.hxx"
+#include "cfgmgr.hxx"
+#include "cfgitem.hxx"
+#include "tbxctrl.hxx"
+#include "tbxconf.hxx"
+#include "stbitem.hxx"
+#include "accitem.hxx"
+#include "mnuitem.hxx"
+#include "docfac.hxx"
+#include "docfile.hxx"
+#include "docfilt.hxx"
+#include "request.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "workwin.hxx"
+#include "iodlg.hxx"
+#include "intro.hxx"
+#include "about.hxx"
+#include "fcontnr.hxx"
+#include "saveopt.hxx"
+#include "sfxlocal.hrc"
+#include "sfx.hrc"
+#include "app.hrc"
+#include "templdlg.hxx"
+#include "module.hxx"
+#include "msgpool.hxx"
+#include "topfrm.hxx"
+#include "openflag.hxx"
+#include "viewsh.hxx"
+#include "appimp.hxx"
+#include "bmkmenu.hxx"
+#include "objface.hxx"
+#include "helper.hxx" // SfxContentHelper::Kill()
+
+using namespace vos;
+
+//===================================================================
+
+SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* );
+SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* );
+SV_IMPL_PTRARR( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory* );
+SV_IMPL_PTRARR( SfxChildWinFactArr_Impl, SfxChildWinFactory* );
+SV_IMPL_PTRARR( SfxModuleArr_Impl, SfxModule* );
+
+//===================================================================
+
+#define SfxApplication
+#include "sfxslots.hxx"
+
+class SfxSpecialConfigError_Impl
+{
+ String aError;
+
+public:
+
+ SfxSpecialConfigError_Impl( const String& rStr );
+ DECL_LINK( TimerHdl, Timer*);
+};
+
+
+SfxSpecialConfigError_Impl::SfxSpecialConfigError_Impl( const String& rStr ) :
+ aError( rStr )
+{
+ Timer *pTimer = new Timer;
+ pTimer->SetTimeoutHdl( LINK(this, SfxSpecialConfigError_Impl, TimerHdl) );
+ pTimer->SetTimeout( 0 );
+ pTimer->Start();
+}
+
+IMPL_LINK( SfxSpecialConfigError_Impl, TimerHdl, Timer*, pTimer )
+{
+ delete pTimer;
+ ErrorBox( 0, WinBits( WB_OK ) , aError ).Execute();
+ delete this;
+ SFX_APP()->GetAppDispatcher_Impl()->Execute( SID_QUITAPP );
+ return 0L;
+}
+
+//====================================================================
+
+
+SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(0))
+{
+ SFX_CHILDWINDOW_REGISTRATION( SID_CUSTOMIZETOOLBOX );
+
+ // Menu ist auf dem Macintosh sowieso sichtbar
+// SFX_OBJECTBAR_REGISTRATION(
+// SFX_OBJECTBAR_FULLSCREEN | SFX_VISIBILITY_FULLSCREEN,
+// SfxResId(RID_FULLSCREENTOOLBOX) );
+ SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_APPLICATION |
+ SFX_VISIBILITY_DESKTOP | SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_CLIENT,
+ SfxResId(RID_ENVTOOLBOX) );
+
+ SFX_STATUSBAR_REGISTRATION(SfxResId(SFX_ITEMTYPE_STATBAR));
+}
+
+//--------------------------------------------------------------------
+
+
+void SfxApplicationClass::ActivateExtHelp()
+{
+ SFX_APP()->GetBindings().Invalidate( SID_EXTENDEDHELP );
+ ShowStatusText(String());
+}
+
+//-------------------------------------------------------------------------
+
+
+void SfxApplicationClass::DeactivateExtHelp()
+{
+ SFX_APP()->GetBindings().Invalidate( SID_EXTENDEDHELP );
+ HideStatusText();
+}
+
+//-------------------------------------------------------------------------
+
+SfxViewFrame* SfxApplication::CreateViewFrame(
+ SfxObjectShell& rDoc, sal_uInt16 nViewId, sal_Bool bHidden )
+{
+ SfxItemSet *pSet = rDoc.GetMedium()->GetItemSet();
+ if ( nViewId )
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
+ if ( bHidden )
+ pSet->Put( SfxBoolItem( SID_HIDDEN, sal_True ) );
+
+ SfxFrame *pFrame = SfxTopFrame::Create( &rDoc, 0, bHidden );
+ return pFrame->GetCurrentViewFrame();
+}
+
+void SfxApplication::InitializeDisplayName_Impl()
+{
+ SfxAppData_Impl* pAppData_Impl = Get_Impl();
+ if ( !pAppData_Impl->pLabelResMgr )
+ return;
+
+ String aTitle = Application::GetDisplayName();
+ if ( !aTitle.Len() )
+ {
+ OClearableGuard aGuard( OMutex::getGlobalMutex() );
+
+ // create version string
+/*!!! (pb) don't show a version number at the moment
+ USHORT nProductVersion = ProductVersion::GetVersion().ToInt32();
+ String aVersion( String::CreateFromInt32( nProductVersion / 10 ) );
+ aVersion += 0x002E ; // 2Eh ^= '.'
+ aVersion += ( String::CreateFromInt32( nProductVersion % 10 ) );
+*/
+ // load application title
+ aTitle = String( ResId( RID_APPTITLE, pAppData_Impl->pLabelResMgr ) );
+ // merge version into title
+ aTitle.SearchAndReplaceAscii( "$(VER)", String() /*aVersion*/ );
+
+ aGuard.clear();
+
+#ifndef PRODUCT
+ aTitle += DEFINE_CONST_UNICODE(" [");
+ ResId aVerId( RID_BUILDVERSION, pAppData_Impl->pLabelResMgr );
+ ResMgr* pResMgr = pAppData_Impl->pLabelResMgr->IsAvailable( aVerId.SetRT( RSC_STRING ) )
+ ? pAppData_Impl->pLabelResMgr
+ : NULL;
+ aVerId.SetResMgr( pResMgr );
+ aTitle += String( aVerId );
+ aTitle += 0x005D ; // 5Dh ^= ']'
+#endif
+ if ( GetDemoKind() == SFX_DEMOKIND_DEMO )
+ aTitle += DEFINE_CONST_UNICODE(" (Demo Version)");
+
+ Application::SetDisplayName( aTitle );
+ }
+}
+
+//--------------------------------------------------------------------
+
+IMPL_LINK( SfxApplication, OpenClients_Impl, void*, pvoid )
+{
+ OpenClients();
+ return 0;
+}
+
+void SfxApplication::OpenClients()
+
+/* [Beschreibung]
+
+ Diese virtuelle Hook-Methode gibt dem Applikationsentwickler
+ Gelegenheit, bei bereits sichtbarem Applikationsfenster unmittelbar
+ vor Application::Execute() z.B. initiale Fenster (insbesondere
+ das initiale Dokumentfenster) zu "offnen.
+
+ Die Basisklasse sollte nicht gerufen werden.
+*/
+{
+ if ( !( pAppData_Impl->nAppEvent & DISPATCH_SERVER ) )
+ {
+ // Crash-Recovery
+ SfxIniManager *pIni = GetIniManager();
+ sal_Bool bSendMail = (sal_uInt16) pIni->ReadKey( DEFINE_CONST_UNICODE("Common"), DEFINE_CONST_UNICODE("SendCrashMail") ).ToInt32();
+ String aFileName = pIni->ReadKey( pIni->GetGroupName( SFX_GROUP_WORKINGSET_IMPL ), DEFINE_CONST_UNICODE("Info") );
+ if ( bSendMail && aFileName.Len() )
+ {
+ SvFileStream aStr( aFileName, STREAM_STD_READ );
+ if ( !aStr.GetError() )
+ {
+ aStr.Seek( STREAM_SEEK_TO_END );
+ sal_uInt32 nLen = aStr.Tell();
+ aStr.Seek( STREAM_SEEK_TO_BEGIN );
+ char *pBuffer = new char[nLen+1];
+ aStr.Read( pBuffer, nLen );
+ pBuffer[nLen] = 0;
+ String aBodyText( pBuffer, nLen );
+ delete pBuffer;
+
+ SfxStringItem aTarget( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") );
+ SfxStringItem aBody( SID_POSTSTRING, aBodyText );
+ SfxStringItem aMail( SID_FILE_NAME, DEFINE_CONST_UNICODE("mailto:staroffice-bugs@staroffice.de") );
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ SfxBoolItem aSend( SID_MAIL_SEND, sal_False );
+
+ pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_SLOT, &aReferer, &aBody, &aMail, &aSend, &aTarget, 0L );
+ pIni->DeleteKey( pIni->GetGroupName( SFX_GROUP_WORKINGSET_IMPL ), DEFINE_CONST_UNICODE("Info") );
+ aStr.Close();
+ SfxContentHelper::Kill( aFileName );
+ }
+ }
+
+ sal_Bool bCancel = sal_False;
+ for ( sal_uInt16 n = 0; sal_True; ++n )
+ {
+ String aEntry( pIni->Get( SFX_GROUP_WORKINGSET_IMPL, DEFINE_CONST_UNICODE("Recover"), n ) );
+ if ( !aEntry.GetTokenCount() )
+ break;
+
+ sal_Bool bIsURL = ( aEntry.GetToken( 2 ).CompareToAscii("url") == COMPARE_EQUAL );
+ String aRealFileName( aEntry.GetToken( 3 ) );
+ String aTempFileName( aEntry.GetToken( 0 ) );
+ sal_uInt16 nRet;
+ if ( bCancel )
+ nRet = RET_NO;
+ else
+ {
+ String aMsg( SfxResId( STR_RECOVER_QUERY ) );
+ aMsg.SearchAndReplaceAscii( "$1", aRealFileName );
+ MessBox aBox( NULL, WB_YES_NO_CANCEL | WB_DEF_YES | WB_3DLOOK,
+ String( SfxResId( STR_RECOVER_TITLE ) ), aMsg );
+ nRet = aBox.Execute();
+ }
+
+ switch ( nRet )
+ {
+ case RET_YES: // recover a file
+ {
+ SfxStringItem aTargetName( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") );
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ SfxStringItem aTempFileItem( SID_FILE_NAME, aTempFileName );
+ SfxStringItem aFilterItem( SID_FILTER_NAME, aEntry.GetToken( 1 ) );
+ SfxBoolItem aReadOnlyItem( SID_DOC_READONLY, sal_False );
+ if ( !bIsURL )
+ aRealFileName.Erase();
+ SfxStringItem aSalvageItem( SID_DOC_SALVAGE, aRealFileName );
+ if ( bIsURL )
+ {
+ SfxStringItem aRealURLItem( SID_ORIGURL, aRealFileName );
+ pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON,
+ &aTempFileItem, &aFilterItem, &aSalvageItem, &aTargetName,
+ &aRealURLItem, &aReadOnlyItem, &aReferer, 0L );
+ }
+ else
+ {
+ SfxBoolItem aAsTemplateItem( SID_TEMPLATE, !bIsURL );
+ pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON,
+ &aTempFileItem, &aFilterItem, &aSalvageItem, &aTargetName,
+ &aAsTemplateItem, &aReadOnlyItem, &aReferer, 0L );
+ }
+ }
+
+ case RET_NO: // skip this file
+ // remove ini-entry
+ pIni->Delete( SFX_GROUP_WORKINGSET_IMPL, DEFINE_CONST_UNICODE("Recover"), n );
+ if ( nRet == RET_NO )
+ SfxContentHelper::Kill( aTempFileName );
+ break;
+
+ case RET_CANCEL: // cancel recovering
+ // remove ini-entry
+ pIni->Delete( SFX_GROUP_WORKINGSET_IMPL, DEFINE_CONST_UNICODE("Recover"), n );
+ SfxContentHelper::Kill( aTempFileName );
+ bCancel = sal_True; // and all following
+ break;
+ }
+ }
+ }
+
+ String aEmptyStr;
+ if ( pAppData_Impl->aOpenList.Len() )
+ {
+ ApplicationEvent* pAppEvt = new ApplicationEvent( aEmptyStr, aEmptyStr,
+ APPEVENT_OPEN_STRING,
+ pAppData_Impl->aOpenList );
+ GetpApp()->AppEvent( *pAppEvt );
+ delete pAppEvt;
+ }
+
+ if ( pAppData_Impl->aPrintList.Len() )
+ {
+ ApplicationEvent* pAppEvt = new ApplicationEvent( aEmptyStr, aEmptyStr,
+ APPEVENT_PRINT_STRING,
+ pAppData_Impl->aPrintList );
+ GetpApp()->AppEvent( *pAppEvt );
+ delete pAppEvt;
+ }
+
+ if ( SfxObjectShell::GetFirst() || ( pAppData_Impl->nAppEvent & DISPATCH_SERVER ) )
+ return;
+
+ if( pAppData_Impl->bBean )
+ return;
+
+//(mba/task): neu zu implementieren
+// if ( pOptions->IsSaveWorkingSet() )
+// SfxTaskManager::RestoreWorkingSet();
+// else
+ {
+ SfxAllItemSet aSet( GetPool() );
+
+ // Dateiname
+ String aName = SFX_INIMANAGER()->ReadKey( DEFINE_CONST_UNICODE("Common"), DEFINE_CONST_UNICODE("StartDocument") );
+ if ( !aName.Len() )
+ aName = String( DEFINE_CONST_UNICODE("private:factory/swriter" ) );
+ SfxStringItem aNameItem( SID_FILE_NAME, aName );
+ aSet.Put( aNameItem, aNameItem.Which() );
+ aSet.Put( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
+
+ // Referer
+ aSet.Put( SfxStringItem( SID_REFERER, DEFINE_CONST_UNICODE( "private/user" ) ) );
+ pAppDispat->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, aSet );
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::FillStatusBar( StatusBar& rBar )
+
+/* [Beschreibung]
+
+ Diese virtuelle Factory-Methode wird vom SFx gerufen, um die
+ StatusBar f"ur das Applikationsfenster zu erzeugen. Im Ggs. zu
+ den anderen Standard-Controllern Menu, Accelerator und ToolBoxen
+ kann die Status-Zeile nur mit dieser Factory erzeugt werden,
+ da in der SV-Resource keine StatusBar-Items angegeben werden k"oennen.
+*/
+
+{
+// rBar.InsertItem( SID_MAIL_NOTIFY, 18, SIB_IN|SIB_USERDRAW );
+ rBar.InsertItem( SID_EXPLORER_SELECTIONSIZE, 200, SIB_IN|SIB_LEFT|SIB_AUTOSIZE );
+// rBar.InsertItem( SID_CURRENTTIME, rBar.GetTextSize(
+// String("::") + GetAppInternational().GetTime( ::com::sun::star::util::Time() ) ).Width() );
+// rBar.InsertItem( SID_CURRENTDATE, rBar.GetTextSize(
+// String("::") + GetAppInternational().GetDate( Date() ) ).Width() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::IntroSlide()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode wird vom SFx gerufen, um die bei einem
+ Mehrbild-Intro das n"achte Bild anzuzeigen. Sie sollte w"ahrend
+ des Startups mehrmals gerufen werden, wenn l"angere Initialisierungen
+ ausgef"uhrt werden.
+*/
+
+{
+ if ( pImp->pIntro )
+ pImp->pIntro->Slide();
+}
+
+//--------------------------------------------------------------------
+
+SfxFileDialog* SfxApplication::CreateDocFileDialog
+(
+ sal_uInt32 nFlags, // arithmetische Veroderung der u.g. Sfx-Winbits
+ const SfxObjectFactory& rFact, /* <SfxObjectFactory>, deren Filter angezeigt
+ werden sollten */
+ const SfxItemSet* pSet // to forward on FileDialog
+)
+
+/* [Beschreibung]
+
+ Diese virtuelle Factory-Methode wird vom SFx gerufen, um den
+ f"ur Dokumente den Dialog zum "Offnen und Speichern unter einem
+ neuen Namen zu erzeugen.
+
+ Die Default-Implementierung erzeugt abh"angig von nFlags einen Dialog
+ mit
+ - WB_SAVEAS: SFXWB_PASSWORD
+ - WB_OPEN: SFXWB_READONLY
+*/
+
+{
+ SfxItemSet aSet( GetPool(),
+ SID_DOC_READONLY, SID_DOC_READONLY,
+ SID_HAS_PASSWORD, SID_HAS_PASSWORD,
+ SID_PASSWORD, SID_PASSWORD,
+ SID_LOAD_LAYOUT, SID_LOAD_LAYOUT,
+ SID_FILE_FILTEROPTIONS, SID_FILE_FILTEROPTIONS,
+ SID_FILE_NAME, SID_FILE_NAME,
+ 0 );
+ if ( pSet )
+ aSet.Put( *pSet );
+ if ( WB_SAVEAS == (nFlags & WB_SAVEAS) )
+ nFlags |= SFXWB_PASSWORD;
+ else
+ {
+ if ( SFXWB_INSERT != ( nFlags & SFXWB_INSERT ) )
+ nFlags |= SFXWB_READONLY;
+ }
+ return new SfxFileDialog( NULL, nFlags, rFact, aSet );
+}
+
+//--------------------------------------------------------------------
+
+PrinterDialog* SfxApplication::CreatePrinterDialog()
+
+/* [Beschreibung]
+
+ Diese virtuelle Factory-Methode wird vom SFx gerufen, um einen
+ Applikations-spezifischen PrinterDialog zu erzeugen.
+
+ Die Default-Implementierung liefert einen 0-Pointer zur"uck.
+*/
+
+{
+ return 0;
+}
+//--------------------------------------------------------------------
+
+ModalDialog* SfxApplication::CreateAboutDialog()
+
+/* [Beschreibung]
+
+ Diese virtuelle Factory-Methode wird vom SFx gerufen, um einen
+ Modul-spezifischen AboutDialog zu erzeugen.
+
+ Die Default-Implementierung erzeugt einen AboutDialog aus
+ der Resource 'ModalDialog RID_DEFAULTABOUT' und verwendet
+ zus"atzlich einen String RID_BUILDVERSION, f"ur die Update-Version
+ der Applikation. Letztere wird angezeigt, sobald der Anwender
+ eine spezielle, im Dialog definierte, Sequenz von Zeichen
+ eingibt (z.B. 'Ctrl' 's' 'f' 'x').
+*/
+
+{
+ // Buildversion suchen
+ ResId aVerId( RID_BUILDVERSION, pAppData_Impl->pLabelResMgr );
+ ResMgr *pResMgr = pAppData_Impl->pLabelResMgr->IsAvailable(
+ aVerId.SetRT( RSC_STRING ) )
+ ? pAppData_Impl->pLabelResMgr
+ : 0;
+ aVerId.SetResMgr( pResMgr );
+ if ( !Resource::GetResManager()->IsAvailable( aVerId ) )
+ DBG_ERROR( "No RID_BUILD_VERSION in label-resource-dll" );
+ String aVersion( '[' );
+ ( aVersion += String( aVerId ) ) += ']';
+
+ // About-Dialog suchen
+ ResId aDialogResId( RID_DEFAULTABOUT, pAppData_Impl->pLabelResMgr );
+ pResMgr = pAppData_Impl->pLabelResMgr->IsAvailable(
+ aDialogResId.SetRT( RSC_MODALDIALOG ) )
+ ? pAppData_Impl->pLabelResMgr
+ : 0;
+ aDialogResId.SetResMgr( pResMgr );
+ if ( !Resource::GetResManager()->IsAvailable( aDialogResId ) )
+ DBG_ERROR( "No RID_DEFAULTABOUT in label-resource-dll" );
+
+ // About-Dialog anzeigen
+ AboutDialog* pDlg = new AboutDialog( 0, aDialogResId, aVersion );
+ return pDlg;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::HandleConfigError_Impl
+(
+ sal_uInt16 nErrorCode
+
+) const
+
+/* [Beschreibung]
+
+ Hilfsroutine zum Anzeigen einer ErrorBox mit einer von nErrorCode
+ abh"angigen Fehlermeldung.
+*/
+
+{
+ sal_uInt16 nResId = 0;
+ switch(nErrorCode)
+ {
+ case SfxConfigManager::ERR_READ:
+ nResId = MSG_ERR_READ_CFG;
+ break;
+ case SfxConfigManager::ERR_WRITE:
+ nResId = MSG_ERR_WRITE_CFG;
+ break;
+ case SfxConfigManager::ERR_OPEN:
+ nResId = MSG_ERR_OPEN_CFG;
+ break;
+ case SfxConfigManager::ERR_FILETYPE:
+ nResId = MSG_ERR_FILETYPE_CFG;
+ break;
+ case SfxConfigManager::ERR_VERSION:
+ nResId = MSG_ERR_VERSION_CFG;
+ break;
+ }
+ DBG_ASSERT(nResId != 0, "unbekannte Fehlerkonstante aus Konfiguration");
+ if(nResId)
+ {
+ ErrorBox aErrorBox(NULL, SfxResId(nResId));
+ aErrorBox.Execute();
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::LoadConfig()
+
+/* [Beschreibung]
+
+ Interne Routine zum Einlesen der Konfiguration aus SfxIniManager
+ und SfxConfigManager.
+*/
+
+{
+ if ( pImp->bConfigLoaded )
+ return;
+/*
+ sal_Bool bUpdateMode;
+ WorkWindow* pAppWin = Application::GetAppWindow();
+ if ( pAppWin->IsVisible() )
+ {
+ bUpdateMode = pAppWin->IsUpdateMode();
+ pAppWin->SetUpdateMode(sal_False);
+ }
+*/
+ if (!pCfgMgr->LoadConfig())
+ HandleConfigError_Impl((sal_uInt16)pCfgMgr->GetErrorCode());
+
+/*
+ if ( pAppWin->IsVisible() )
+ {
+ pAppWin->SetUpdateMode( bUpdateMode );
+ SfxWorkWindow *pWork = GetWorkWindow_Impl();
+ pWork->ArrangeChilds_Impl();
+ pWork->ShowChilds_Impl();
+ pAppWin->Invalidate();
+ }
+*/
+ pImp->bConfigLoaded = sal_True;
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::StoreConfig()
+
+/* [Beschreibung]
+
+ Interne Routine zum Speichern der Konfiguration in SfxIniManager
+ und SfxConfigManager.
+*/
+
+{
+ // Workingset schreiben?
+// if ( pOptions->IsSaveWorkingSet() )
+// SfxTaskManager::SaveWorkingSet();
+//(mba/task): Implementierung fehlt
+
+ if (!pAppData_Impl->pAppCfg->StoreConfig())
+ HandleConfigError_Impl((sal_uInt16)pCfgMgr->GetErrorCode());
+ else
+ SaveConfiguration();
+
+ utl::ConfigManager::GetConfigManager()->StoreConfigItems();
+}
+
+//--------------------------------------------------------------------
+#ifdef WNT
+extern String GetUserID();
+#endif
+
+SfxIniManager* SfxApplication::CreateIniManager()
+{
+ SfxIniManager *pIniMgr = NULL;
+ try
+ {
+ pIniMgr = SfxIniManager::Get();
+ if ( pIniMgr )
+ {
+ pIniMgr->EnterLock();
+
+ // Dialog-Mnemonics/Scaling
+ LanguageType eLang = Application::GetAppInternational().GetLanguage();
+ Application::EnableAutoMnemonic( pIniMgr->Get( SFX_KEY_INTERNATIONAL_AUTOMNEMONIC,(sal_uInt16) eLang ).CompareToAscii("1") == COMPARE_EQUAL );
+ Application::SetDialogScaleX( (short)
+ pIniMgr->Get( SFX_KEY_INTERNATIONAL_DIALOGSCALEX,
+ (sal_uInt16) eLang ).ToInt32() );
+ return pIniMgr;
+ }
+ }
+ catch ( ::com::sun::star::registry::InvalidRegistryException& )
+ {
+ pIniMgr = NULL;
+ }
+
+ // If some configurtation files are missing or corrupt
+ // try to start setup. If starting failed show a errorbox and exit application with an error code.
+ INetURLObject aSetupObj( Application::GetAppFileName(), INET_PROT_FILE );
+ #if defined(UNX)
+ aSetupObj.setName( DEFINE_CONST_UNICODE("setup") );
+ #endif
+ #if defined(WIN) || defined(WNT) || defined(OS2)
+ aSetupObj.setName( DEFINE_CONST_UNICODE("setup.exe") );
+ #endif
+ #if defined(MAC)
+ aSetupObj.setName( DEFINE_CONST_UNICODE("Setup") );
+ #endif
+
+ // We must use different messages for fat office and portal.
+ // A fat office can be repaired by user himself ...
+ // but portal problems must fixed by an admin!
+ String aMsg;
+ if( Application::IsRemoteServer())
+ {
+ aMsg += DEFINE_CONST_UNICODE("Your user account is not configured correctly.\n");
+ aMsg += DEFINE_CONST_UNICODE("Please contact your StarPortal administator.\n");
+ }
+ else
+ {
+ aMsg += DEFINE_CONST_UNICODE("Configuration files could not be found.\n");
+ aMsg += DEFINE_CONST_UNICODE("Can't start neither StarOffice nor Setup.\n");
+ aMsg += DEFINE_CONST_UNICODE("Please try to start setup by yourself.");
+ }
+
+ String aImageName( aSetupObj.PathToFileName() );
+ VOS_NAMESPACE(OProcess,vos) aProcess( aImageName.GetBuffer(), DEFINE_CONST_UNICODE("/officemode") );
+ if ( 0 != aProcess.execute( VOS_NAMESPACE(OProcess,vos)::TOption_Detached ) )
+ Application::Abort( aMsg );
+ exit(-1);
+/*
+ INetURLObject aSetupObj( Application::GetAppFileName(), INET_PROT_FILE );
+#if defined(UNX)
+ aSetupObj.setName( DEFINE_CONST_UNICODE("setup") );
+#endif
+#if defined(WIN) || defined(WNT) || defined(OS2)
+ aSetupObj.setName( DEFINE_CONST_UNICODE("setup.exe") );
+#endif
+#if defined(MAC)
+ aSetupObj.setName( DEFINE_CONST_UNICODE("Setup") );
+#endif
+ String aMsg = DEFINE_CONST_UNICODE("Configuration files could not be found.\n");
+ aMsg += DEFINE_CONST_UNICODE("Can't start neither StarOffice nor Setup.\n");
+ aMsg += DEFINE_CONST_UNICODE("Please try to start setup by yourself.");
+ String aImageName( aSetupObj.PathToFileName() );
+ VOS_NAMESPACE(OProcess,vos) aProcess( aImageName.GetBuffer(), DEFINE_CONST_UNICODE("/officemode") );
+ if ( 0 != aProcess.execute( VOS_NAMESPACE(OProcess,vos)::TOption_Detached ) )
+ Application::Abort( aMsg );
+ exit(0);*/
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+SfxIniManager* SfxApplication::GetIniManager() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert den Ini-Manager der Dokument-Factory
+ des aktiven Dokuments, insofern ein Dokument aktiv ist.
+ Ansonsten liefert sie den Ini-Manager der Applikation.
+
+ W"ahrend 'Application:Execute()' ist der R"uckgabewert
+ immer ein g"ultiger Pointer, ansonsten kann es auch ein
+ 0-Pointer sein.
+*/
+
+{
+ return pViewFrame ? pViewFrame->GetIniManager() : pAppIniMgr;
+}
+
+//------------------------------------------------------------------------
+
+SfxProgress* SfxApplication::GetProgress() const
+
+/* [Beschreibung]
+
+ Liefert den f"ur die gesamte Applikation laufenden SfxProgress
+ oder 0, falls keiner f"ur die gesamte Applikation l"auft.
+
+
+ [Querverweise]
+
+ <SfxProgress::GetActiveProgress(SfxViewFrame*)>
+ <SfxViewFrame::GetProgress()const>
+*/
+
+{
+ return pAppData_Impl->pProgress;
+}
+
+//------------------------------------------------------------------------
+
+void SfxApplication::ToolboxExec_Impl( SfxRequest &rReq )
+{
+ // Object-Bar-Id ermitteln
+ sal_uInt16 nSID = rReq.GetSlot(), nTbxID;
+ switch ( nSID )
+ {
+ case SID_TOGGLEFUNCTIONBAR: nTbxID = SFX_OBJECTBAR_APPLICATION; break;
+ case SID_TOGGLEOBJECTBAR: nTbxID = SFX_OBJECTBAR_OBJECT; break;
+ case SID_TOGGLETOOLBAR: nTbxID = SFX_OBJECTBAR_TOOLS; break;
+ case SID_TOGGLEMACROBAR: nTbxID = SFX_OBJECTBAR_MACRO; break;
+ case SID_TOGGLEOPTIONBAR: nTbxID = SFX_OBJECTBAR_OPTIONS; break;
+ case SID_TOGGLECOMMONTASKBAR: nTbxID = SFX_OBJECTBAR_COMMONTASK; break;
+ case SID_TOGGLENAVBAR: nTbxID = SFX_OBJECTBAR_NAVIGATION; break;
+ //case SID_TOGGLERECORDINGBAR: nTbxID = SFX_OBJECTBAR_RECORDING; break;
+ //case SID_TOGGLEFULLSCREENBAR: nTbxID = SFX_OBJECTBAR_FULLSCREEN; break;
+ default:
+ DBG_ERROR( "invalid ObjectBar`s SID" );
+ }
+
+ // Parameter auswerten
+ SfxToolBoxConfig *pTbxConfig = SfxToolBoxConfig::GetOrCreate();
+ SFX_REQUEST_ARG(rReq, pShowItem, SfxBoolItem, nSID, sal_False);
+ sal_Bool bShow = pShowItem ? pShowItem->GetValue() : !pTbxConfig->IsToolBoxPositionVisible(nTbxID);
+
+ // ausfuehren
+ pTbxConfig->SetToolBoxPositionVisible(nTbxID, bShow);
+ GetBindings().Invalidate( nSID );
+
+ SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
+ while ( pViewFrame )
+ {
+ // update all "final" dispatchers
+ if ( !pViewFrame->GetActiveChildFrame_Impl() )
+ pViewFrame->GetDispatcher()->Update_Impl(sal_True);
+ pViewFrame = SfxViewFrame::GetNext(*pViewFrame);
+ }
+
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( nSID, bShow ) );
+ rReq.Done();
+}
+
+//------------------------------------------------------------------------
+
+
+void SfxApplication::ToolboxState_Impl( SfxItemSet &rSet )
+{
+ SfxWhichIter aIter(rSet);
+ for ( sal_uInt16 nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
+ {
+ SfxToolBoxConfig *pTbxConfig = SfxToolBoxConfig::GetOrCreate();
+ switch ( nSID )
+ {
+ case SID_TOGGLEFUNCTIONBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_APPLICATION)));
+ break;
+
+ case SID_TOGGLEOBJECTBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_OBJECT)));
+ break;
+
+ case SID_TOGGLEOPTIONBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_OPTIONS)));
+ break;
+
+ case SID_TOGGLETOOLBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_TOOLS)));
+ break;
+
+ case SID_TOGGLEMACROBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_MACRO)));
+ break;
+
+ case SID_TOGGLECOMMONTASKBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_COMMONTASK)));
+ break;
+
+ case SID_TOGGLENAVBAR:
+ rSet.Put( SfxBoolItem( nSID, pTbxConfig->
+ IsToolBoxPositionVisible(SFX_OBJECTBAR_NAVIGATION)));
+ break;
+
+ default:
+ DBG_ERROR( "invalid ObjectBar`s SID" );
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+
+
+VclFileDialog* SfxApplicationClass::CreateFileDialog( Window* pParent, sal_uInt32 nWinBits )
+{
+ return new SfxFileDialog( pParent, nWinBits );
+}
+
+SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
+{
+ sal_Bool bError = sal_False;
+ SvUShorts* pList = pAppData_Impl->pDisabledSlotList;
+ if ( !pList )
+ {
+ // Gibt es eine Slotdatei ?
+ INetURLObject aObj( GetIniManager()->Get( SFX_KEY_CONFIG_DIR ), INET_PROT_FILE );
+ aObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) );
+ SvFileStream aStrm( aObj.GetMainURL(), STREAM_STD_READ );
+
+ // Speziell f"ur AK: wenn in der INI "Slots=AK" steht, slots.cfg
+ // ignorieren und weitermachen
+ String aSlotEntry = GetIniManager()->Get( SFX_KEY_SLOTLIST );
+ if ( aSlotEntry.CompareIgnoreCaseToAscii( "AK" ) == COMPARE_EQUAL )
+ return NULL;
+
+ sal_uInt16 nSlotEntry = (sal_uInt16) aSlotEntry.ToInt32();
+ if ( nSlotEntry )
+ {
+ // Gibt es einen "Slotlist"-Eintrag ??
+ if ( aStrm.GetError() )
+ {
+ bError = sal_True;
+ }
+ else
+ {
+ // SlotDatei einlesen
+ String aTitle;
+ aStrm.ReadByteString(aTitle);
+ if ( aTitle.CompareToAscii("SfxSlotFile" ) == COMPARE_EQUAL )
+ {
+ sal_uInt16 nCount;
+ aStrm >> nCount;
+ pList = pAppData_Impl->pDisabledSlotList =
+ new SvUShorts( nCount < 255 ? (sal_Int8) nCount : 255, 255 );
+
+ sal_uInt16 nSlot;
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ aStrm >> nSlot;
+ pList->Insert( nSlot, n );
+ }
+
+ aStrm.ReadByteString(aTitle);
+ if ( aTitle.CompareToAscii("END" ) != COMPARE_EQUAL || aStrm.GetError() )
+ {
+ // Lesen schief gegangen
+ DELETEZ( pList );
+ bError = sal_True;
+ }
+ }
+ else
+ {
+ // Streamerkennung fehlgeschlagen
+ bError = sal_True;
+ }
+ }
+ }
+ else
+ {
+ // Wenn kein Slotlist-Eintrag, dann darf auch keine SlotDatei
+ // vorhanden sein
+ if ( !aStrm.GetError() )
+ bError = sal_True;
+ }
+ }
+ else if ( pList == (SvUShorts*) -1L )
+ {
+ return NULL;
+ }
+
+ if ( !pList )
+ pAppData_Impl->pDisabledSlotList = (SvUShorts*) -1L;
+
+ if ( bError )
+ {
+ // Wenn ein Sloteintrag vorhanden ist, aber keine oder eine fehlerhafte
+ // SlotDatei, oder aber eine Slotdatei, aber kein Sloteintrag, dann
+ // gilt dies als fehlerhafte Konfiguration
+ new SfxSpecialConfigError_Impl(
+ String( SfxResId( RID_SPECIALCONFIG_ERROR ) ) );
+ }
+
+ return pList;
+}
+
+
+Config* SfxApplication::GetFilterIni()
+{
+ if( !pAppData_Impl->pFilterIni )
+ {
+ String aIniFile( DEFINE_CONST_UNICODE( FILTER_INI ) );
+ if ( GetIniManager()->SearchFile( aIniFile, SFX_KEY_MODULES_PATH ) )
+ pAppData_Impl->pFilterIni = new Config( aIniFile );
+ else
+ // da fr"uher immer ein pointer != NULL returniert wurde, m"ussen
+ // wir das jetzt wohl auch tun
+ pAppData_Impl->pFilterIni = new Config();
+ }
+ return pAppData_Impl->pFilterIni;
+}
+
+
+SfxModule* SfxApplication::GetActiveModule( SfxViewFrame *pFrame ) const
+{
+ if ( !pFrame )
+ pFrame = SfxViewFrame::Current();
+ SfxObjectShell* pSh = 0;
+ if( pFrame ) pSh = pFrame->GetObjectShell();
+ return pSh ? pSh->GetModule() : 0;
+}
+
+class AppISfxModule : public ISfxModule
+{
+ SfxApplication* pApp;
+public:
+ AppISfxModule( SfxApplication* pAppP ) : pApp( pAppP ) {}
+
+ virtual SfxFileDialog* CreateDocFileDialog(
+ sal_uInt32 nBits, const SfxObjectFactory& rFact, const SfxItemSet* pSet = NULL ) {
+ return pApp->CreateDocFileDialog( nBits, rFact, pSet );
+ }
+ virtual ModalDialog* CreateAboutDialog() {
+ return pApp->CreateAboutDialog();
+ }
+ virtual ResMgr* GetResMgr() {
+ return Resource::GetResManager();
+ }
+};
+
+ISfxModule* SfxApplication::GetISfxModule( SfxViewFrame *pFrame )
+{
+ SfxModule* pModule = GetActiveModule( pFrame );
+ if( pModule )
+ return pModule;
+ ISfxModule*& rpI = pAppData_Impl->pISfxModule;
+ if( !rpI ) rpI = new AppISfxModule( this );
+ return rpI;
+}
+
+
+SfxSlotPool& SfxApplication::GetSlotPool( SfxViewFrame *pFrame ) const
+{
+ SfxModule *pMod = GetActiveModule( pFrame );
+ if ( pMod && pMod->GetSlotPool() )
+ return *pMod->GetSlotPool();
+ else
+ return *pSlotPool;
+}
+
+
+SfxAcceleratorManager* SfxApplication::GetAcceleratorManager() const
+{
+ // Accelerator immer mit ContainerBindings
+ SfxViewFrame *pFrame = pViewFrame;
+ if ( !pFrame )
+ return pAcceleratorMgr;
+
+ while ( pFrame->GetParentViewFrame_Impl() )
+ pFrame = pFrame->GetParentViewFrame_Impl();
+
+ SfxViewShell* pSh = 0;
+ if( pFrame )
+ pSh = pFrame->GetViewShell();
+ if ( pSh )
+ {
+ SfxAcceleratorManager *pMgr = pSh->GetAccMgr_Impl();
+ if ( pMgr )
+ return pMgr;
+ }
+
+ return pAcceleratorMgr;
+}
+
+ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon()
+{
+ if( pAppData_Impl->pTemplateCommon )
+ return pAppData_Impl->pTemplateCommon;
+ return NULL;
+}
+
+
+ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBindings )
+{
+ if( pAppData_Impl->pTemplateCommon )
+ return pAppData_Impl->pTemplateCommon;
+ SfxChildWindow *pChild = rBindings.GetWorkWindow_Impl()->GetChildWindow_Impl(
+ SfxTemplateDialogWrapper::GetChildWindowId() );
+ if ( pChild )
+ return ((SfxTemplateDialog*) pChild->GetWindow())->GetISfxTemplateCommon();
+ return 0;
+}
+
+PopupMenu* SfxAppData_Impl::GetPopupMenu( sal_uInt16 nSID, sal_Bool bBig, sal_Bool bNew )
+{
+ String aPath;
+ SfxBmkMenu** ppMenu;
+ sal_uInt16 nKey;
+ switch( nSID )
+ {
+ case SID_NEWDOCDIRECT:
+ ppMenu = &pNewMenu; nKey = SFX_KEY_NEW_DIR; break;
+ case SID_BOOKMARKS:
+ ppMenu = &pBookmarkMenu; nKey = SFX_KEY_BOOKMARK_DIR; break;
+ case SID_AUTOPILOTMENU:
+ ppMenu = &pAutoPilotMenu; nKey = SFX_KEY_AUTOPILOT_DIR; break;
+ case SID_STARTMENU:
+ ppMenu = &pStartMenu; nKey = SFX_KEY_STARTMENU_DIR; break;
+ default:
+ ppMenu = 0;
+ }
+
+ if( ppMenu && ( !*ppMenu || bNew ) )
+ {
+ INetURLObject aObj( SFX_INIMANAGER()->Get( nKey ), INET_PROT_FILE );
+ String aURL = aObj.GetMainURL();
+ if ( *ppMenu )
+ delete *ppMenu;
+ *ppMenu = new SfxBmkMenu( aURL, aURL );
+ (*ppMenu)->Initialize();
+ }
+ return ppMenu ? *ppMenu : NULL;
+}
+
+SfxMenuBarManager* SfxApplication::GetMenuBarManager() const
+{
+ SfxViewFrame *pFrame = SfxViewFrame::Current();
+ if ( pFrame )
+ return pFrame->GetViewShell()->GetMenuBar_Impl();
+ else
+ return 0;
+}
+
+
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
new file mode 100644
index 000000000000..04ac70847e49
--- /dev/null
+++ b/sfx2/source/appl/appopen.cxx
@@ -0,0 +1,1402 @@
+/*************************************************************************
+ *
+ * $RCSfile: appopen.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:26 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
+#include <com/sun/star/frame/XDispatch.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
+#include <com/sun/star/util/URL.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
+#include <com/sun/star/util/XURLTransformer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
+#include <com/sun/star/frame/XStatusListener.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
+#include <cppuhelper/implbase1.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SFXDOCTEMPL_HXX //autogen
+#include <doctempl.hxx>
+#endif
+#ifndef _EXTATTR_HXX
+#include <svtools/extattr.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+
+#include <svtools/ehdl.hxx>
+#include <svtools/sbxobj.hxx>
+#include <svtools/urihelper.hxx>
+#include <unotools/processfactory.hxx>
+
+#pragma hdrstop
+
+#include "app.hxx"
+#include "appdata.hxx"
+#include "bindings.hxx"
+#include "cfgmgr.hxx"
+#include "dispatch.hxx"
+#include "docfile.hxx"
+#include "docinf.hxx"
+#include "fcontnr.hxx"
+#include "fsetobsh.hxx"
+#include "loadenv.hxx"
+#include "new.hxx"
+#include "objitem.hxx"
+#include "objsh.hxx"
+#include "objshimp.hxx"
+#include "openflag.hxx"
+#include "passwd.hxx"
+#include "picklist.hxx"
+#include "referers.hxx"
+#include "request.hxx"
+#include "sfxresid.hxx"
+#include "viewsh.hxx"
+#include "app.hrc"
+#include "topfrm.hxx"
+#include "appimp.hxx"
+#include "iodlg.hxx"
+#include "sfxuno.hxx"
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+using namespace ::com::sun::star::util;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::lang;
+using namespace ::cppu;
+
+//=========================================================================
+
+class SfxOpenDocStatusListener_Impl : public WeakImplHelper1< XStatusListener >
+{
+public:
+ BOOL bFinished;
+ BOOL bSuccess;
+ virtual void SAL_CALL statusChanged( const FeatureStateEvent& Event ) throw(RuntimeException);
+ virtual void SAL_CALL disposing( const EventObject& Source ) throw(RuntimeException);
+ SfxOpenDocStatusListener_Impl()
+ : bFinished( FALSE )
+ , bSuccess( FALSE )
+ {}
+
+};
+
+void SAL_CALL SfxOpenDocStatusListener_Impl::statusChanged( const FeatureStateEvent& Event ) throw(RuntimeException)
+{
+ bSuccess = Event.IsEnabled;
+ bFinished = TRUE;
+}
+
+void SAL_CALL SfxOpenDocStatusListener_Impl::disposing( const EventObject& Source ) throw(RuntimeException)
+{
+}
+
+SfxObjectShellRef SfxApplication::DocAlreadyLoaded
+(
+ const String& rName, // Name des Dokuments mit Pfad
+ BOOL bSilent, // TRUE: nicht nach neuer Sicht fragen
+ BOOL bActivate, // soll bestehende Sicht aktiviert werden
+ BOOL bForbidVisible,
+ const String* pPostStr
+)
+
+/* [Beschreibung]
+
+ Stellt fest, ob ein Dokument mit dem Namen 'rName' bereits geladen
+ ist und liefert einen Pointer darauf zu"uck.
+
+ Ist das Dokument noch nicht geladen, wird ein 0-Pointer zur"uckgeliefert.
+*/
+
+{
+ // zu suchenden Namen als URL aufbereiten
+ INetURLObject aUrlToFind( rName, INET_PROT_FILE );
+ String aPostString;
+ if ( pPostStr )
+ aPostString = *pPostStr;
+
+ // noch offen?
+ SfxObjectShellRef xDoc;
+
+ if ( !aUrlToFind.HasError() )
+ {
+ // erst im Cache suchen
+ MemCache_Impl &rCache = SfxPickList_Impl::Get()->GetMemCache();
+ xDoc = rCache.Find( aUrlToFind, aPostString );
+
+ // dann bei den normal geoeffneten Docs
+ if ( !xDoc.Is() )
+ {
+ xDoc = SfxObjectShell::GetFirst( 0, FALSE ); // auch hidden Docs
+ while( xDoc.Is() )
+ {
+ if ( xDoc->GetMedium() &&
+ xDoc->GetCreateMode() == SFX_CREATE_MODE_STANDARD &&
+ !xDoc->IsAbortingImport() && !xDoc->IsLoading() )
+ {
+ // Vergleiche anhand der URLs
+ INetURLObject aUrl( xDoc->GetMedium()->GetName(), INET_PROT_FILE );
+ if ( !aUrl.HasError() && aUrl == aUrlToFind &&
+ (!bForbidVisible ||
+ !SfxViewFrame::GetFirst( xDoc, 0, TRUE )) &&
+ !xDoc->IsLoading())
+ {
+ SFX_ITEMSET_ARG(
+ xDoc->GetMedium()->GetItemSet(), pPostItem, SfxStringItem,
+ SID_POSTSTRING, FALSE );
+ SFX_ITEMSET_ARG(
+ xDoc->GetMedium()->GetItemSet(), pPost2Item,
+ SfxRefItem, SID_POSTLOCKBYTES, FALSE );
+ if( !pPost2Item && ( !pPostItem && (aPostString.Len()<1) ||
+ pPostItem && pPostItem->GetValue() == aPostString ))
+ break;
+ }
+ }
+ xDoc = SfxObjectShell::GetNext( *xDoc, 0, FALSE );
+ }
+ }
+ }
+
+ // gefunden?
+ if ( xDoc.Is() && bActivate )
+ {
+ DBG_ASSERT(
+ !bForbidVisible, "Unsichtbares kann nicht aktiviert werden" );
+
+ SfxTopViewFrame *pFrame;
+ for( pFrame = (SfxTopViewFrame*)
+ SfxViewFrame::GetFirst( xDoc, TYPE(SfxTopViewFrame) );
+ pFrame && !pFrame->IsVisible();
+ pFrame = (SfxTopViewFrame*)
+ SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) );
+ if ( pFrame )
+ {
+ SfxViewFrame *pCur = SfxViewFrame::Current();
+ if ( !bSilent && pFrame == pCur )
+ InfoBox( 0, SfxResId(RID_DOCALREADYLOADED_DLG)).Execute();
+ if ( bActivate )
+ {
+ pFrame->MakeActive_Impl( TRUE );
+ }
+ }
+ }
+ return xDoc;
+}
+
+//====================================================================
+
+void SetTemplate_Impl( SvStorage *pStorage,
+ const String &rFileName,
+ const String &rLongName,
+ SfxObjectShell *pDoc)
+{
+ // DocInfo von pDoc 'plattmachen'
+ SfxDocumentInfo &rInfo = pDoc->GetDocInfo();
+ rInfo.Clear();
+
+ // DocInfo vom Template laden
+ SvStorageRef xTemplStor = new SvStorage( rFileName, STREAM_STD_READ );
+ SfxDocumentInfo aTemplInfo;
+
+ if ( aTemplInfo.Load( xTemplStor ) )
+ rInfo.SetTemplateDate( aTemplInfo.GetChanged().GetTime() );
+
+ // Template in DocInfo von pDoc eintragen
+ INetURLObject aObj( rFileName, INET_PROT_FILE );
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ {
+ String aFoundName;
+ if( SFX_APP()->Get_Impl()->GetDocumentTemplates()->GetFull( String(), rLongName, aFoundName ) )
+ {
+ rInfo.SetTemplateFileName( aObj.GetMainURL() );
+ rInfo.SetTemplateName( rLongName );
+
+ // wenn schon eine Config da ist, mu\s sie aus dem Template sein
+ BOOL bHasConfig = (pDoc->GetConfigManager() != 0);
+ rInfo.SetTemplateConfig( bHasConfig );
+ pDoc->SetTemplateConfig( bHasConfig );
+ }
+ }
+
+ // DocInfo in Stream schreiben
+ pDoc->FlushDocInfo();
+}
+
+//--------------------------------------------------------------------
+
+ULONG CheckPasswd_Impl
+(
+ Window *pWin, // Parent des Dialogs
+ SfxItemPool &rPool, // Pool, falls ein Set erzeugt werden mus
+ SfxMedium *pFile // das Medium, dessen Passwort gfs. erfragt werden soll
+)
+
+/* [Beschreibung]
+
+ Zu einem Medium das Passwort erfragen; funktioniert nur, wenn es sich
+ um einen Storage handelt.
+ Wenn in der Documentinfo das Passwort-Flag gesetzt ist, wird
+ das Passwort vom Benutzer per Dialog erfragt und an dem Set
+ des Mediums gesetzt; das Set wird, wenn nicht vorhanden, erzeugt.
+
+*/
+
+{
+ ULONG nRet=0;
+ if( ( !pFile->GetFilter() || pFile->GetFilter()->UsesStorage() ) &&
+ pFile->ProvidesData_Impl() && pFile->IsStorage())
+ {
+ SvStorageRef aRef = pFile->GetStorage();
+ if(aRef.Is())
+ {
+ SfxDocumentInfo *pInfo = new SfxDocumentInfo;
+ if(pInfo->Load(aRef) && pInfo->IsPasswd())
+ {
+ SfxPasswordDialog *pDlg = new SfxPasswordDialog(pWin);
+ String aTitle( pDlg->GetText() );
+ aTitle += String::CreateFromAscii(" [");
+ aTitle += INetURLObject( pFile->GetOrigURL() ).GetName();
+ aTitle += String::CreateFromAscii("]");
+ pDlg->SetText( aTitle );
+ if(RET_OK == pDlg->Execute())
+ {
+ SfxItemSet *pSet = pFile->GetItemSet();
+ if(!pSet)
+ {
+ pSet =
+ new SfxItemSet(rPool,
+ SID_PASSWORD, SID_PASSWORD, 0 );
+ pFile->SetItemSet(pSet);
+ }
+ pSet->Put(SfxStringItem(SID_PASSWORD, pDlg->GetPassword()));
+ }
+ else
+ nRet=ERRCODE_IO_ABORT;
+ delete pDlg;
+ }
+ delete pInfo;
+ }
+ }
+ return nRet;
+}
+
+//--------------------------------------------------------------------
+
+
+SfxObjectShell* FindNoName_Impl( TypeId aDocType )
+
+/* [Beschreibung]
+
+ Findet die erste unbenannte und unver"anderte SfxObjectShell vom
+ angegeben Typ, f"ur das ein SfxMDIFrame exist
+*/
+
+{
+ // suchen
+ for ( SfxObjectShell *pFirst = SfxObjectShell::GetFirst();
+ pFirst;
+ pFirst = SfxObjectShell::GetNext(*pFirst) )
+ {
+ // passend?
+ SfxTopViewFrame *pTopFrame = (SfxTopViewFrame*)
+ SfxViewFrame::GetFirst(pFirst, TYPE(SfxTopViewFrame));
+ if ( pTopFrame && !pFirst->HasName() && !pFirst->IsModified() &&
+ pFirst->Type() == aDocType )
+ {
+ // => gefundenen zur"uckgeben
+ return (pFirst->GetFlags() &
+ SFXOBJECTSHELL_DONTREPLACE ) ? 0 : pFirst;
+ }
+ }
+
+ // keins gefunden => 0 zur"uckgeben
+ return 0;
+}
+
+ULONG SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const String &rFileName,
+ const String &rLongName, BOOL bCopy, SfxItemSet* pSet )
+{
+ BOOL bWithInfo = ( rLongName.Len() != 0 );
+ const SfxFilter* pFilter = NULL;
+ SfxMedium aMedium( rFileName, ( STREAM_READ | STREAM_SHARE_DENYNONE ), FALSE );
+
+ if ( aMedium.IsStorage() )
+ aMedium.GetStorage();
+ else
+ aMedium.GetInStream();
+
+ if ( aMedium.GetError() )
+ {
+ delete pSet;
+ return aMedium.GetErrorCode();
+ }
+
+ ULONG nErr = GetFilterMatcher().GuessFilter( aMedium,&pFilter,SFX_FILTER_TEMPLATE, 0 );
+ if ( 0 != nErr)
+ {
+ delete pSet;
+ return ERRCODE_SFX_NOTATEMPLATE;
+ }
+
+ if( !pFilter || !pFilter->IsAllowedAsTemplate() )
+ {
+ delete pSet;
+ return ERRCODE_SFX_NOTATEMPLATE;
+ }
+
+ if ( pFilter->GetFilterFlags() & SFX_FILTER_STARONEFILTER )
+ {
+ DBG_ASSERT( !xDoc.Is(), "Sorry, not implemented!" );
+ delete pSet;
+ SfxStringItem aName( SID_FILE_NAME, rFileName );
+ SfxStringItem aReferer( SID_REFERER, String::CreateFromAscii("private:user") );
+ SfxStringItem aFlags( SID_OPTIONS, String::CreateFromAscii("T") );
+ SfxBoolItem aHidden( SID_VIEW, FALSE );
+ const SfxPoolItem *pRet = GetDispatcher().Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aName, &aHidden, &aReferer, &aFlags, 0L );
+ const SfxObjectItem *pObj = PTR_CAST( SfxObjectItem, pRet );
+ xDoc = PTR_CAST( SfxObjectShell, pObj->GetShell() );
+ if ( !xDoc.Is() )
+ return ERRCODE_SFX_DOLOADFAILED;
+ xDoc->OwnerLock( FALSE ); // lock was set by hidden load
+ }
+ else
+ {
+ if ( !xDoc.Is() )
+ xDoc = ((SfxFactoryFilterContainer*)pFilter->GetFilterContainer())->GetFactory().CreateObject();
+
+ SfxMedium *pMedium = new SfxMedium( rFileName, STREAM_STD_READ, FALSE, TRUE, pFilter, pSet );
+ if(!xDoc->DoLoad(pMedium))
+ {
+ ErrCode nErr = xDoc->GetErrorCode();
+ xDoc->DoClose();
+ xDoc.Clear();
+ return nErr;
+ }
+ }
+
+ if( bCopy )
+ {
+ SvStorageRef aTmpStor = new SvStorage(String());
+ if( 0 != aTmpStor->GetError())
+ {
+ xDoc->DoClose();
+ xDoc.Clear();
+ return aTmpStor->GetErrorCode();
+ }
+ xDoc->GetStorage()->CopyTo( &aTmpStor );
+ xDoc->DoHandsOff();
+ if ( !xDoc->DoSaveCompleted( aTmpStor ) )
+ {
+ xDoc->DoClose();
+ xDoc.Clear();
+ return aTmpStor->GetErrorCode();
+ }
+
+ if ( bWithInfo )
+ SetTemplate_Impl( aTmpStor, rFileName, rLongName, xDoc );
+ }
+ else if ( bWithInfo )
+ SetTemplate_Impl( xDoc->GetStorage(), rFileName, rLongName, xDoc );
+
+ if ( bWithInfo )
+ xDoc->Broadcast( SfxDocumentInfoHint( &xDoc->GetDocInfo() ) );
+
+ xDoc->SetNoName();
+ xDoc->InvalidateName();
+ xDoc->SetModified(FALSE);
+ xDoc->ResetError();
+ return xDoc->GetErrorCode();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::LoadEa_Impl(SfxMedium &rMedium, SfxObjectShell& rObj)
+{
+ if ( !rMedium.ProvidesData_Impl() || !rMedium.IsStorage() )
+ return;
+ const SfxFilter *pFilter = rMedium.GetFilter();
+ if ( !pFilter || !pFilter->IsOwnFormat() )
+ return;
+ SvStorage *pStor = rMedium.GetStorage();
+ if ( !pStor )
+ return;
+ SvStream *pStream = pStor->GetTargetSvStream();
+ if ( pStream && pStream->IsA() == ID_FILESTREAM )
+ {
+ SvEaMgr aEaMgr(*(SvFileStream *)pStream);
+ String aBuffer;
+ // Langnamen merken f"ur Titel und erneutes Setzen
+ // beim Speichern
+ if ( aEaMgr.GetLongName(aBuffer) )
+ rMedium.SetLongName(aBuffer);
+ if ( aEaMgr.GetComment(aBuffer) )
+ {
+ SfxDocumentInfo *pInfo = &rObj.GetDocInfo();
+ // Kommentar aus der WPS mit DocInfo abgleichen
+ pInfo->SetComment(aBuffer);
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxMedium* SfxApplication::InsertDocumentDialog
+(
+ ULONG nFlags,
+ const SfxObjectFactory& rFact
+)
+{
+ SfxMedium *pMedium;
+ while(1)
+ {
+ pMedium = 0;
+ SvStringsDtor* pURLList = NULL;
+ String aFilter;
+ SfxItemSet* pSet;
+ ErrCode nErr = FileOpenDialog_Impl( nFlags | SFXWB_INSERT | WB_3DLOOK, rFact, pURLList, aFilter, pSet );
+ if( !nErr )
+ {
+ DBG_ASSERT( pURLList, "invalid URLList" );
+ DBG_ASSERT( pURLList->Count() == 1, "invalid URLList count" );
+ String aURL = *(pURLList->GetObject(0));
+ pMedium = new SfxMedium(
+ aURL, SFX_STREAM_READONLY, FALSE, TRUE,
+ GetFilterMatcher().GetFilter( aFilter ), pSet );
+
+ LoadEnvironment_ImplRef xLoader = new LoadEnvironment_Impl( pMedium );
+ SfxFilterMatcher aMatcher( rFact.GetFilterContainer() );
+ xLoader->SetFilterMatcher( &aMatcher );
+ xLoader->Start();
+ while( xLoader->GetState() != LoadEnvironment_Impl::DONE )
+ Application::Yield();
+ pMedium = xLoader->GetMedium();
+
+ if( pMedium )
+ if( CheckPasswd_Impl( 0, SFX_APP()->GetPool(), pMedium ) ==
+ ERRCODE_ABORT )
+ {
+ DELETEZ( pMedium );
+ }
+ }
+ delete pURLList;
+ break;
+ }
+ return pMedium;
+}
+
+
+//--------------------------------------------------------------------
+
+void SfxApplication::NewFramesetExec_Impl( SfxRequest& rReq )
+{
+ DBG_MEMTEST();
+/*
+ // Factory-RegNo kann per Parameter angegeben sein
+ SfxErrorContext aEc(ERRCTX_SFX_NEWDOCDIRECT);
+
+ SfxFrameSetObjectShell *pDoc =
+ new SfxFrameSetObjectShell( SFX_CREATE_MODE_STANDARD );
+ SfxObjectShellRef xDoc(pDoc);
+ pDoc->Initialize( String() );
+ xDoc->SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
+
+ SFX_REQUEST_ARG(rReq, pFrameItem, SfxFrameItem,
+ SID_DOCFRAME, FALSE);
+ if ( pFrameItem && pFrameItem->GetFrame() )
+ pFrameItem->GetFrame()->InsertDocument( pDoc );
+ else
+ CreateView_Impl( rReq, pDoc, TRUE );
+
+ GetAppDispatcher_Impl()->Execute( SID_EDIT_FRAMESET );
+ */
+}
+
+//--------------------------------------------------------------------
+SfxObjectShellLock SfxApplication::NewDoc_Impl( const String& rFact, const SfxItemSet *pSet )
+{
+ SfxObjectShellLock xDoc;
+ const SfxObjectFactory* pFactory = 0;
+ String aFact( rFact );
+ String aPrefix = String::CreateFromAscii( "private:factory/" );
+ if ( aPrefix.Len() == aFact.Match( aPrefix ) )
+ aFact.Erase( 0, aPrefix.Len() );
+ USHORT nPos = aFact.Search( '?' );
+ String aParam;
+ if ( nPos != STRING_NOTFOUND )
+ {
+ aParam = aFact.Copy( nPos, aFact.Len() );
+ aFact.Erase( nPos, aFact.Len() );
+ aParam.Erase(0,1);
+ }
+
+ WildCard aSearchedFac( aFact.EraseAllChars('4').ToUpperAscii() );
+ for( USHORT n = SfxObjectFactory::GetObjectFactoryCount_Impl(); !pFactory && n--; )
+ {
+ pFactory = &SfxObjectFactory::GetObjectFactory_Impl( n );
+ if( !aSearchedFac.Matches( String::CreateFromAscii( pFactory->GetShortName() ).ToUpperAscii() ) )
+ pFactory = 0;
+ }
+
+ if( !pFactory )
+ pFactory = &SfxObjectFactory::GetDefaultFactory();
+
+ // Objekt erzeugen
+ USHORT nSlotId = pFactory->GetCreateNewSlotId();
+ if ( pSet )
+ {
+ SFX_ITEMSET_ARG( pSet, pFrmItem, SfxFrameItem, SID_DOCFRAME, FALSE);
+ if ( pFrmItem && pFrmItem->GetFrame() && !pFrmItem->GetFrame()->IsTop() )
+ // In SubFrames ohne Dialog laden
+ nSlotId = 0;
+ SFX_ITEMSET_ARG( pSet, pSilentItem, SfxBoolItem, SID_SILENT, FALSE);
+ if ( pSilentItem && pSilentItem->GetValue() )
+ nSlotId = 0;
+ }
+
+ if ( nSlotId )
+ {
+ const SfxFrameItem* pFrmItem = NULL;
+ if ( pSet )
+ pFrmItem = (const SfxFrameItem*) SfxRequest::GetItem( pSet, SID_DOCFRAME, FALSE, TYPE(SfxFrameItem) );
+ SfxBoolItem aItem( SID_NEWDOCDIRECT, TRUE );
+ if ( pFrmItem && pFrmItem->GetFrame() && !pFrmItem->GetFrame()->GetCurrentDocument() )
+ GetDispatcher().Execute( nSlotId, SFX_CALLMODE_SYNCHRON, &aItem, pFrmItem, 0L );
+ else
+ GetDispatcher().Execute( nSlotId, SFX_CALLMODE_ASYNCHRON, &aItem, pFrmItem, 0L );
+ }
+ else
+ {
+ xDoc = pFactory->CreateObject();
+ aParam = INetURLObject::decode( aParam, '%', INetURLObject::DECODE_WITH_CHARSET );
+ if( xDoc.Is() )
+ xDoc->DoInitNew_Impl( aParam );
+ }
+
+ return xDoc;
+}
+
+void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
+{
+ DBG_MEMTEST();
+
+ SFX_REQUEST_ARG(rReq, pHidden, SfxBoolItem, SID_HIDDEN, FALSE);
+//(mba)/task
+/*
+ if ( !pHidden || !pHidden->GetValue() )
+ Application::GetAppWindow()->EnterWait();
+*/
+ SfxObjectShellLock xDoc;
+ BOOL bNewView = TRUE;
+
+ // Factory-RegNo kann per Parameter angegeben sein
+ SfxErrorContext aEc(ERRCTX_SFX_NEWDOCDIRECT);
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ const SfxObjectFactory* pFactory = 0;
+ String aFactory;
+ rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) );
+ SFX_REQUEST_ARG( rReq, pFactoryName, SfxStringItem, SID_NEWDOCDIRECT, FALSE );
+ if( pFactoryName )
+ aFactory = pFactoryName->GetValue();
+
+ SFX_REQUEST_ARG( rReq, pFileFlagsItem, SfxStringItem, SID_OPTIONS, FALSE);
+ if ( pFileFlagsItem )
+ {
+ // Werte auf einzelne Items verteilen
+ String aFileFlags = pFileFlagsItem->GetValue();
+ aFileFlags.ToUpperAscii();
+ if ( STRING_NOTFOUND != aFileFlags.Search( 0x0054 ) ) // T = 54h
+ rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) );
+ if ( STRING_NOTFOUND != aFileFlags.Search( 0x0048 ) ) // H = 48h
+ rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) );
+ if ( STRING_NOTFOUND != aFileFlags.Search( 0x0052 ) ) // R = 52h
+ rReq.AppendItem( SfxBoolItem( SID_DOC_READONLY, TRUE ) );
+ if ( STRING_NOTFOUND != aFileFlags.Search( 0x0042 ) ) // B = 42h
+ rReq.AppendItem( SfxBoolItem( SID_PREVIEW, TRUE ) );
+ if ( STRING_NOTFOUND != aFileFlags.Search( 0x0053 ) ) // S = 53h
+ rReq.AppendItem( SfxBoolItem( SID_SILENT, TRUE ) );
+ }
+
+ xDoc = NewDoc_Impl( aFactory, rReq.GetArgs() );
+ if ( xDoc.Is() )
+ {
+ SFX_REQUEST_ARG(rReq, pReadonly, SfxBoolItem, SID_DOC_READONLY, FALSE);
+ if ( pReadonly )
+ xDoc->GetMedium()->GetItemSet()->Put( *pReadonly );
+
+ SFX_REQUEST_ARG(rReq, pPreview, SfxBoolItem, SID_PREVIEW, FALSE);
+ if ( pPreview )
+ xDoc->GetMedium()->GetItemSet()->Put( *pPreview );
+
+ SFX_REQUEST_ARG(rReq, pFlags, SfxStringItem, SID_OPTIONS, FALSE);
+ if ( pFlags )
+ xDoc->GetMedium()->GetItemSet()->Put( *pFlags );
+
+ SfxStringItem aPath( SID_TARGETPATH, String() );
+ SFX_REQUEST_ARG(rReq, pReferer, SfxStringItem, SID_REFERER, FALSE);
+ SFX_REQUEST_ARG(rReq, pPath, SfxStringItem, SID_TARGETPATH, FALSE);
+ if ( pReferer )
+ {
+ // Wenn eine Factory-URL aus einem Bookmark stammt, wird kein Targetpath gesetzt;
+ // stammt sie aus dem Neu - oder Startmenue, k"onnte der Request von einem Contextmenu
+ // kommen. Daher wird der "ubergebene Targetpath "ubernommen.
+ // Ist dieser allerdings selbst wieder Start - oder Neumen"u, wird das beim Speichern
+ // "ubergangen ( ->objstor.cxx )
+ xDoc->GetMedium()->GetItemSet()->Put( *pReferer, SID_REFERER );
+ INetURLObject aURLObj;
+ aURLObj.SetSmartURL( pReferer->GetValue() );
+
+ BOOL bBookmark=TRUE;
+ if( aURLObj.GetProtocol() == INET_PROT_FILE )
+ {
+ SfxIniManager* pMgr = GetIniManager();
+ SfxIniKey aKey[] =
+ {
+ SFX_KEY_NEW_DIR,
+ SFX_KEY_STARTMENU_DIR,
+// SFX_KEY_TEMPLATE_PATH,
+ 0
+ };
+ USHORT nPathLevel = aURLObj.getSegmentCount();
+ USHORT nIndex = 0;
+ while ( aKey[ nIndex ] )
+ {
+ INetURLObject aNewPathObj( pMgr->Get( aKey[ nIndex ] ), INET_PROT_FILE );
+ USHORT nNewLevel = aNewPathObj.getSegmentCount();
+ int nOffset = nPathLevel;
+ nOffset -= nNewLevel;
+ if ( nOffset >= 0 )
+ {
+ INetURLObject aTempObj = aURLObj;
+ for ( ; nOffset > 0; nOffset-- )
+ aTempObj.removeSegment();
+ if ( aTempObj == aNewPathObj )
+ {
+ bBookmark = FALSE;
+ break;
+ }
+ }
+ ++nIndex;
+ }
+ }
+
+ if ( !bBookmark && pPath )
+ aPath.SetValue( pPath->GetValue() );
+ }
+
+ xDoc->GetMedium()->GetItemSet()->Put( aPath, SID_TARGETPATH );
+ }
+
+ // View erzeugen
+ SfxViewFrame* pViewFrame = 0;
+ if ( xDoc.Is() )
+ {
+ SFX_REQUEST_ARG(rReq, pHidden, SfxBoolItem, SID_HIDDEN, FALSE);
+ if ( pHidden )
+ xDoc->GetMedium()->GetItemSet()->Put( *pHidden, SID_HIDDEN );
+
+ SFX_REQUEST_ARG(rReq, pViewId, SfxUInt16Item, SID_VIEW_ID, FALSE);
+ if ( pViewId )
+ xDoc->GetMedium()->GetItemSet()->Put( *pViewId, SID_VIEW_ID );
+
+ xDoc->SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
+// xDoc->Get_Impl()->nLoadedFlags = SFX_LOADED_ALL;
+ const SfxItemSet* pInternalArgs = rReq.GetInternalArgs_Impl();
+ if( pInternalArgs )
+ xDoc->GetMedium()->GetItemSet()->Put( *pInternalArgs );
+ BOOL bOwnsFrame = FALSE;
+ SfxFrame* pFrame = GetTargetFrame_Impl( rReq.GetArgs(), bOwnsFrame );
+
+ if ( pFrame->PrepareClose_Impl( TRUE, TRUE ) == TRUE )
+ {
+ if ( pHidden && pHidden->GetValue() )
+ {
+ xDoc->RestoreNoDelete();
+ xDoc->OwnerLock( TRUE );
+ }
+ pFrame->InsertDocument( xDoc );
+ pViewFrame = pFrame->GetCurrentViewFrame();
+ }
+ else if ( pFrame->PrepareClose_Impl( TRUE, TRUE ) == RET_NEWTASK )
+ {
+ pFrame = SfxTopFrame::Create();
+ bOwnsFrame = TRUE;
+ DBG_ERROR( "NYI!" );
+ xDoc.Clear();
+ }
+ else
+ xDoc.Clear();
+/*
+ SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem,
+ SID_TARGETNAME, FALSE);
+ String aTargetName;
+ if( pTargetItem ) pTargetItem->GetValue();
+ if ( aTargetName.Len() &&
+ aTargetName.CompareIgnoreCaseToAscii("_blank") != COMPARE_EQUAL &&
+ aTargetName.CompareIgnoreCaseToAscii("_top") != COMPARE_EQUAL )
+ pFrame->SetFrameName( aTargetName );
+*/
+ rReq.SetReturnValue( SfxFrameItem( 0, pFrame ) );
+ }
+
+//(mba)/task
+/*
+ if ( !pHidden || !pHidden->GetValue() )
+ Application::GetAppWindow()->LeaveWait();
+ */
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
+{
+ DBG_MEMTEST();
+
+ // keine Parameter vom BASIC nur Factory angegeben?
+ SFX_REQUEST_ARG(rReq, pTemplNameItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE);
+ SFX_REQUEST_ARG(rReq, pTemplFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE);
+ SFX_REQUEST_ARG(rReq, pTemplRegionNameItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, FALSE);
+
+ SfxObjectShellLock xDoc;
+ BOOL bNewView = TRUE;
+
+ String aTemplateRegion, aTemplateName, aTemplateFileName;
+ BOOL bDirect = FALSE; // "uber FileName anstelle Region/Template
+ SfxErrorContext aEc(ERRCTX_SFX_NEWDOC);
+ if ( !pTemplNameItem && !pTemplFileNameItem )
+ {
+ SfxNewFileDialog *pDlg = CreateNewDialog();
+ if ( RET_OK == pDlg->Execute() )
+ {
+ if ( pDlg->IsTemplate() )
+ {
+ aTemplateName = pDlg->GetTemplateName();
+ aTemplateRegion = pDlg->GetTemplateRegion();
+ aTemplateFileName = pDlg->GetTemplateFileName();
+ rReq.AppendItem( SfxStringItem( SID_TEMPLATE_NAME, aTemplateName) );
+ rReq.AppendItem( SfxStringItem( SID_TEMPLATE_REGIONNAME, aTemplateRegion) );
+ rReq.AppendItem( SfxStringItem( SID_FILE_NAME, aTemplateFileName) );
+ delete pDlg;
+ }
+ else
+ {
+ delete pDlg;
+ bDirect = TRUE;
+ return;
+ }
+ }
+ else
+ {
+ delete pDlg;
+ return;
+ }
+ }
+ else
+ {
+ // Template-Name
+ if ( pTemplNameItem )
+ aTemplateName = pTemplNameItem->GetValue();
+
+ // Template-Region
+ if ( pTemplRegionNameItem )
+ aTemplateRegion = pTemplRegionNameItem->GetValue();
+
+ // Template-File-Name
+ if ( pTemplFileNameItem )
+ {
+ aTemplateFileName = pTemplFileNameItem->GetValue();
+ bDirect = TRUE;
+ }
+ }
+
+ INetURLObject aObj( aTemplateName, INET_PROT_FILE );
+ SfxErrorContext aEC( ERRCTX_SFX_LOADTEMPLATE, aObj.PathToFileName() );
+//! (pb) MaxLen? DirEntry(aTemplateName).GetFull( FSYS_STYLE_HOST,FALSE,20));
+
+ ULONG lErr = 0;
+ SfxItemSet* pSet = new SfxAllItemSet( GetPool() );
+ pSet->Put( SfxBoolItem( SID_TEMPLATE, TRUE ) );
+ if ( !bDirect )
+ {
+ SfxDocumentTemplates aTmpFac;
+ aTmpFac.Construct();
+ if( !aTemplateFileName.Len() )
+ aTmpFac.GetFull( aTemplateRegion, aTemplateName, aTemplateFileName );
+
+ if( !aTemplateFileName.Len() )
+ lErr = ERRCODE_SFX_TEMPLATENOTFOUND;
+ }
+
+ if ( lErr != ERRCODE_NONE )
+ {
+ ULONG lFatalErr = ERRCODE_TOERROR(lErr);
+ if ( lFatalErr )
+ ErrorHandler::HandleError(lErr);
+ }
+ else
+ {
+ const SfxPoolItem *pRet=0;
+ SfxCallMode eMode = rReq.IsSynchronCall() ? SFX_CALLMODE_SYNCHRON : SFX_CALLMODE_ASYNCHRON;
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ SfxStringItem aTarget( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") );
+ if ( aTemplateFileName.Len() )
+ {
+ INetURLObject aObj( aTemplateFileName, INET_PROT_FILE );
+ SfxStringItem aName( SID_FILE_NAME, aObj.GetMainURL() );
+ SfxStringItem aTemplName( SID_TEMPLATE_NAME, aTemplateName );
+ SfxStringItem aTemplRegionName( SID_TEMPLATE_REGIONNAME, aTemplateRegion );
+ pRet = GetDispatcher().Execute( SID_OPENDOC, eMode, &aName, &aTarget, &aReferer, &aTemplName, &aTemplRegionName, 0L );
+ }
+ else
+ {
+ SfxStringItem aName( SID_FILE_NAME, DEFINE_CONST_UNICODE("private:factory") );
+ pRet = GetDispatcher().Execute( SID_OPENDOC, eMode, &aName, &aTarget, &aReferer, 0L );
+ }
+
+ if ( pRet )
+ rReq.SetReturnValue( *pRet );
+ }
+}
+
+
+//-------------------------------------------------------------------------
+
+SfxFrame* SfxApplication::GetTargetFrame_Impl( const SfxItemSet* pSet, BOOL& rbOwner )
+{
+ SFX_ITEMSET_ARG(pSet, pViewItem, SfxBoolItem, SID_VIEW, FALSE);
+
+ if ( pViewItem && !pViewItem->GetValue() )
+ // ohne View laden
+ return NULL;
+
+ SFX_ITEMSET_ARG(pSet, pFrmItem, SfxFrameItem, SID_DOCFRAME, FALSE);
+ SFX_ITEMSET_ARG(pSet, pTargetItem, SfxStringItem, SID_TARGETNAME, FALSE);
+ SFX_ITEMSET_ARG(pSet, pBoolItem, SfxBoolItem, SID_ONLYSUBFRAMES, FALSE);
+ SFX_ITEMSET_ARG(pSet, pRefererItem, SfxStringItem, SID_REFERER, FALSE);
+ SFX_ITEMSET_ARG(pSet, pBrowsingItem, SfxUInt16Item, SID_BROWSEMODE, FALSE);
+ SFX_ITEMSET_ARG(pSet, pPreviewItem, SfxBoolItem, SID_PREVIEW, FALSE);
+
+ // Frame als Parameter mitgegeben?
+ SfxFrame *pFrame = NULL;
+ if ( pFrmItem )
+ pFrame = pFrmItem->GetFrame();
+ SfxFrame *pSource = pFrame;
+ SfxFrame *pStart = pFrame;
+
+ if ( pPreviewItem && pPreviewItem->GetValue() )
+ {
+ DBG_ASSERT( pFrame, "Preview without frame!" );
+ return pFrame;
+ }
+
+ String aTargetName;
+ if ( pRefererItem && ( !pBrowsingItem || pBrowsingItem->GetValue() == BROWSE_NORMAL ) )
+ {
+ INetURLObject aURLObj;
+ aURLObj.SetSmartURL( pRefererItem->GetValue() );
+ if ( aURLObj.GetProtocol() == INET_PROT_FILE && ( !pFrame || pFrame->IsTop() ) )
+ {
+ SfxIniManager* pIniMgr = GetIniManager();
+ INetURLObject aStartMenuObj( pIniMgr->Get( SFX_KEY_STARTMENU_DIR ), INET_PROT_FILE );
+ INetURLObject aQuickStartObj( pIniMgr->Get( SFX_KEY_QUICKSTART_DIR ), INET_PROT_FILE );
+ if ( aURLObj == aStartMenuObj || aURLObj == aQuickStartObj )
+ {
+ aTargetName = String::CreateFromAscii( "_blank" );
+ pTargetItem = NULL;
+ }
+ }
+ }
+
+ if ( pTargetItem && pTargetItem->GetValue().Len() )
+ {
+ // Wenn ein TargetItem mitgegeben wurde, aber kein Frame, den
+ // Current ViewFrame nehmen
+ SfxViewFrame* pCurViewFrame = SfxViewFrame::Current();
+ if ( !pCurViewFrame )
+ pCurViewFrame = SfxViewFrame::GetFirst();
+
+ if ( !pFrame && pCurViewFrame )
+ {
+ pFrame = pCurViewFrame->GetFrame();
+ pStart = pFrame;
+ }
+
+ if ( pFrame )
+ {
+ aTargetName = pTargetItem->GetValue();
+
+ // Wenn kein TargetName, dann den vom Current Document
+ SfxObjectShell* pCur = SfxObjectShell::Current();
+ if( !aTargetName.Len() && pCur )
+ aTargetName = pCur->GetDocInfo().GetDefaultTarget();
+ }
+ }
+ else if ( pFrame && (pFrame->GetFrameName().CompareToAscii("mail-body") == COMPARE_EQUAL) )
+ {
+ // Hack for MailDocument in Office 5.2
+ aTargetName = String::CreateFromAscii("_blank");
+ }
+
+ BOOL bNewTask =
+ aTargetName.CompareToAscii("_blank") == COMPARE_EQUAL ||
+ aTargetName.CompareToAscii("_null") == COMPARE_EQUAL;
+
+ if ( pFrame )
+ {
+ if ( pBoolItem && pBoolItem->GetValue() )
+ {
+ DBG_ASSERT( aTargetName.Len(), "OnlySubFrames, aber kein Name!" );
+ pFrame = pFrame->SearchChildrenForName_Impl( aTargetName );
+ }
+ else
+ {
+ if ( !bNewTask || pFrame->GetFrameName().Len() || pFrame->GetCurrentDocument() || pFrame->GetParentFrame() )
+ // Auch bei leerem TargetName suchen wg. SmartSelf
+ // _blank nur suchen, wenn pFrame nicht schon _blank ist!
+ pFrame = pFrame->SearchFrame( aTargetName );
+ }
+ }
+
+ BOOL bName = ( pFrame == NULL );
+ if ( pFrame && ( !pBrowsingItem || pBrowsingItem->GetValue() == BROWSE_NORMAL ) )
+ {
+ // Es wurde ein Frame gefunden; dessen Doc darf nicht ersetzt werden,
+ // wenn es der Desktop ist oder wenn es embedded ist
+ // Ausnahme: neuerdings k"onnen wir auch innerhalb des Desktops browsen, wenn dieser ein Frameset ist
+ SfxObjectShell* pCur = pFrame->GetCurrentDocument();
+ if( pCur &&
+ ( ( pCur->GetFlags() & SFXOBJECTSHELL_DONTREPLACE ) ||
+ pCur->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) )
+ {
+ pFrame = 0;
+ pSource = 0;
+ pStart = 0;
+ }
+ }
+
+ // Kein Frame gefunden -> Neuen Frame nehmen
+ if ( !pFrame )
+ {
+ SFX_ITEMSET_ARG( pSet, pHiddenItem, SfxBoolItem, SID_HIDDEN, FALSE);
+ BOOL bHidden = pHiddenItem && pHiddenItem->GetValue();
+ pFrame = SfxTopFrame::Create( NULL, 0, bHidden );
+ rbOwner = TRUE;
+ if ( !bNewTask && bName )
+ pFrame->SetFrameName( aTargetName );
+ }
+ else
+ rbOwner = FALSE;
+
+ return pFrame;
+}
+
+//---------------------------------------------------------------------------
+
+void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
+{
+ DBG_MEMTEST();
+
+ USHORT nSID = rReq.GetSlot();
+ SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ if ( !pFileNameItem )
+ {
+ // FileDialog ausf"uhren
+ SvStringsDtor* pURLList = NULL;
+ String aFilter;
+ void* pDummy = 0; // wegen GCC und C272
+ SfxItemSet* pSet;
+ ULONG nErr = FileOpenDialog_Impl(
+ WB_OPEN | SFXWB_MULTISELECTION | SFXWB_SHOWVERSIONS, *(SfxObjectFactory*)pDummy, pURLList, aFilter, pSet );
+ if ( nErr == ERRCODE_ABORT )
+ {
+ delete pURLList;
+ return;
+ }
+
+ rReq.SetArgs( *(SfxAllItemSet*)pSet );
+ rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, String::CreateFromAscii("_blank") ) );
+ delete pSet;
+
+ if ( pURLList->Count() > 1 )
+ {
+ rReq.AppendItem( SfxStringItem( SID_REFERER, String::CreateFromAscii(SFX_REFERER_USER) ) );
+
+ for ( USHORT i = 0; i < pURLList->Count(); ++i )
+ {
+ String aURL = *(pURLList->GetObject(i));
+ rReq.RemoveItem( SID_FILE_NAME );
+ rReq.AppendItem( SfxStringItem( SID_FILE_NAME, aURL ) );
+
+ // synchron ausf"uhren, damit beim Reschedulen nicht schon das n"achste Dokument
+ // geladen wird
+ GetDispatcher().Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, *rReq.GetArgs() );
+ }
+ delete pURLList;
+ return;
+ }
+ else
+ {
+ String aURL;
+ if ( pURLList->Count() == 1 )
+ aURL = *(pURLList->GetObject(0));
+ rReq.AppendItem( SfxStringItem( SID_FILE_NAME, aURL ) );
+ delete pURLList;
+ }
+
+ rReq.AppendItem( SfxStringItem( SID_REFERER, String::CreateFromAscii(SFX_REFERER_USER) ) );
+ }
+
+ if ( SID_OPENURL == nSID )
+ {
+ // SID_OPENURL does the same as SID_OPENDOC!
+ rReq.SetSlot( SID_OPENDOC );
+ nSID = SID_OPENDOC;
+ }
+ else if ( nSID == SID_OPENTEMPLATE )
+ {
+ rReq.AppendItem( SfxBoolItem( SID_TEMPLATE, TRUE ) );
+ }
+
+ SFX_REQUEST_ARG(rReq, pFrmItem, SfxFrameItem, SID_DOCFRAME, FALSE);
+ SfxFrame *pFrame = NULL;
+ if ( pFrmItem )
+ pFrame = pFrmItem->GetFrame();
+ else if ( SfxViewFrame::Current() )
+ pFrame = SfxViewFrame::Current()->GetFrame();
+
+ // check if caller has set a callback
+ SFX_REQUEST_ARG(rReq, pLinkItem, SfxLinkItem, SID_DONELINK, FALSE );
+
+ // check if caller wants to create a view
+ BOOL bCreateView = TRUE;
+ SFX_REQUEST_ARG( rReq, pCreateViewItem, SfxBoolItem, SID_VIEW, FALSE );
+ if ( pCreateViewItem && !pCreateViewItem->GetValue() )
+ bCreateView = FALSE;
+
+ // we can't load without a view - switch to hidden view
+ if ( !bCreateView )
+ rReq.AppendItem( SfxBoolItem( SID_HIDDEN, TRUE ) );
+
+ // check if the view must be hidden
+ BOOL bHidden = FALSE;
+ SFX_REQUEST_ARG(rReq, pHidItem, SfxBoolItem, SID_HIDDEN, FALSE);
+ if ( pHidItem )
+ bHidden = pHidItem->GetValue();
+
+ // convert items to properties for framework API calls
+ Sequence < PropertyValue > aArgs;
+ TransformItems( SID_OPENDOC, *rReq.GetArgs(), aArgs );
+
+ Reference < XController > xController;
+ if ( pFrame || pLinkItem || !rReq.IsSynchronCall() )
+ {
+ // extract target name
+ ::rtl::OUString aTarget;
+ SFX_REQUEST_ARG(rReq, pTargetItem, SfxStringItem, SID_TARGETNAME, FALSE);
+ if ( pTargetItem )
+ aTarget = pTargetItem->GetValue();
+ else
+ {
+ SFX_REQUEST_ARG( rReq, pNewViewItem, SfxBoolItem, SID_OPEN_NEW_VIEW, FALSE );
+ if ( pNewViewItem && pNewViewItem->GetValue() )
+ aTarget = String::CreateFromAscii("_blank" );
+ }
+
+ if ( bHidden )
+ aTarget = String::CreateFromAscii("_blank");
+
+ // if a frame is given, it must be used for the starting point of the targetting mechanism
+ // this code is also used if asynchron loading is possible, because loadComponent always is synchron
+ Reference < XFrame > xFrame;
+ if ( pFrame )
+ xFrame = pFrame->GetFrameInterface();
+ else
+ xFrame = Reference < XFrame >( ::utl::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
+
+ // make URL ready
+ URL aURL;
+ SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ String aFileName = pFileNameItem->GetValue();
+
+ INetURLObject aObj;
+ SfxObjectShell* pCur = pFrame ? pFrame->GetCurrentDocument() : 0;
+ if ( !pCur )
+ pCur = SfxObjectShell::Current();
+ if( aFileName.Len() && aFileName.GetChar(0) == '#' ) // Mark without URL
+ {
+ SfxViewFrame *pView = pFrame ? pFrame->GetCurrentViewFrame() : 0;
+ if ( !pView )
+ pView = SfxViewFrame::Current();
+ pView->GetViewShell()->JumpToMark( aFileName.Copy(1) );
+ rReq.SetReturnValue( SfxViewFrameItem( 0, pView ) );
+ return;
+ }
+
+ aURL.Complete = aFileName;
+ Reference < XURLTransformer > xTrans( ::utl::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ xTrans->parseStrict( aURL );
+
+ // load document using dispatch framework
+ if( !pLinkItem && rReq.IsSynchronCall() )
+ {
+ // if loading must be done synchron, we must wait for completion to get a return value
+ // find frame by myself; I must konw the exact frame to get the controller for the return value from it
+ if( aTarget.getLength() )
+ xFrame = xFrame->findFrame( aTarget, FrameSearchFlag::ALL );
+
+ // targeting has been resolved, so target name must not be used in queryDispatch
+ Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );
+ Reference < XDispatch > xDisp = xProv.is() ? xProv->queryDispatch( aURL, ::rtl::OUString(), 0 ) : Reference < XDispatch >();
+ if ( xDisp.is() )
+ {
+ // create listener for notification of load success or fail
+ SfxOpenDocStatusListener_Impl* pListener = new SfxOpenDocStatusListener_Impl();
+ pListener->acquire();
+ xDisp->addStatusListener( pListener, aURL );
+ xDisp->dispatch( aURL, aArgs );
+
+ // stay on the stack until result has been notified
+ while ( !pListener->bFinished )
+ Application::Yield();
+
+ if ( pListener->bSuccess )
+ // successful loading, get loaded controller
+ xController = xFrame->getController();
+
+ xDisp->removeStatusListener( pListener, aURL );
+ pListener->release();
+ }
+
+ if ( !xController.is() && aTarget.compareToAscii( "_blank" ) == COMPARE_EQUAL )
+ // a blank frame would have been created in findFrame; in this case I am the owner and I must delete it
+ xFrame->dispose();
+ }
+ else
+ {
+ // otherwise we just dispatch and that's it
+ Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY );
+ Reference < XDispatch > xDisp = xProv.is() ? xProv->queryDispatch( aURL, aTarget, FrameSearchFlag::ALL ) : Reference < XDispatch >();;
+ if ( xDisp.is() )
+ xDisp->dispatch( aURL, aArgs );
+ }
+ }
+ else
+ {
+ // synchron loading without a given frame
+ SFX_REQUEST_ARG( rReq, pFileNameItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ Reference < XComponentLoader > xDesktop( ::utl::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY );
+ Reference < XModel > xModel( xDesktop->loadComponentFromURL( pFileNameItem->GetValue(), ::rtl::OUString::createFromAscii("_blank"), 0, aArgs ), UNO_QUERY );
+ if ( xModel.is() )
+ xController = xModel->getCurrentController();
+ }
+
+ if ( xController.is() )
+ {
+ // try to find the SfxFrame for the controller
+ SfxFrame* pFrame = NULL;
+ for ( SfxViewShell* pShell = SfxViewShell::GetFirst( 0, FALSE ); pShell; pShell = SfxViewShell::GetNext( *pShell, 0, FALSE ) )
+ {
+ if ( pShell->GetController() == xController )
+ {
+ pFrame = pShell->GetViewFrame()->GetFrame();
+ break;
+ }
+ }
+
+ if ( pFrame )
+ {
+ SfxObjectShell* pSh = pFrame->GetCurrentDocument();
+ DBG_ASSERT( pSh, "Controller without ObjectShell ?!" );
+
+ if ( bCreateView )
+ rReq.SetReturnValue( SfxViewFrameItem( 0, pFrame->GetCurrentViewFrame() ) );
+ else
+ rReq.SetReturnValue( SfxObjectItem( 0, pSh ) );
+
+ SFX_REQUEST_ARG(rReq, pExecItem, SfxExecuteItem, SID_AFTEROPENEVENT, FALSE );
+ if( pExecItem )
+ pFrame->GetDispatcher_Impl()->Execute( *pExecItem );
+
+ if( ( bHidden || !bCreateView ) )
+ {
+ pSh->RestoreNoDelete();
+ // Locking is now done in LoadEnvironment_Impl, otherwise it would be too late!
+// pSh->OwnerLock( TRUE );
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame *SfxApplication::CreateView_Impl
+(
+ SfxRequest& rReq,
+ SfxObjectShell* pDoc,
+ FASTBOOL bNewView, // neue View erzwingen
+ FASTBOOL bHidden
+)
+{
+ SfxViewFrame* pFrame = CreateView_Impl( rReq.GetArgs(), pDoc, bNewView, bHidden );
+ rReq.SetReturnValue( SfxViewFrameItem( pFrame ) );
+ return pFrame;
+}
+
+SfxViewFrame *SfxApplication::CreateView_Impl
+(
+ const SfxItemSet* pSet,
+ SfxObjectShell* pDoc,
+ FASTBOOL bNewView, // neue View erzwingen
+ FASTBOOL bHidden
+)
+{
+ DBG_MEMTEST();
+
+ SfxFrame* pFrame = SfxTopFrame::Create( pDoc, 0, bHidden, pSet );
+ return pFrame->GetCurrentViewFrame();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::CreateDocState_Impl(SfxItemSet &rSet)
+{
+ DBG_MEMTEST();
+ const USHORT *pRanges = rSet.GetRanges();
+ DBG_ASSERT(pRanges, "Set ohne Bereich");
+ while(*pRanges)
+ {
+ for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
+ {
+ switch(nWhich)
+ {
+ case SID_CURRENT_URL:
+ {
+ SfxViewFrame *pFrame = pViewFrame;
+ if ( pFrame )
+ {
+ // Bei internem InPlace den ContainerFrame nehmen
+ if ( pFrame->GetParentViewFrame_Impl() )
+ pFrame = pFrame->GetParentViewFrame_Impl();
+
+ // URL des aktiven Frames anzeigen; wenn es ein Frame
+ // in einem als Frameset implementierten Dokument ist, dann
+ // die URL des Framesets anzeigen ( Explorer, Mail ).
+ if ( pFrame->GetParentViewFrame() )
+ {
+ if ( pFrame->GetParentViewFrame()->GetViewShell()->
+ IsImplementedAsFrameset_Impl() )
+ pFrame = pFrame->GetParentViewFrame();
+ }
+
+ rSet.Put( SfxStringItem( nWhich, pFrame->GetActualPresentationURL_Impl() ) );
+ }
+ else
+ rSet.Put( SfxStringItem( nWhich, String() ) );
+ break;
+ }
+ }
+ }
+ ++pRanges;
+ }
+}
+
+
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
new file mode 100644
index 000000000000..d4b2335653be
--- /dev/null
+++ b/sfx2/source/appl/appquit.cxx
@@ -0,0 +1,375 @@
+/*************************************************************************
+ *
+ * $RCSfile: appquit.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+
+#ifdef WIN
+#define _TL_LANG_SPECIAL
+#endif
+
+#ifndef _SVDDE_HXX //autogen
+#include <svtools/svdde.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+
+#ifndef _SFXENUMITEM_HXX
+#include <svtools/eitem.hxx>
+#endif
+
+#include <svtools/inethist.hxx>
+
+#pragma hdrstop
+
+#ifndef _UTL_CONFIGMGR_HXX_
+#include <unotools/configmgr.hxx>
+#endif
+
+#include "app.hrc"
+#include "app.hxx"
+#include "unoctitm.hxx"
+#include "appdata.hxx"
+#include "viewsh.hxx"
+#include "dispatch.hxx"
+#include "printer.hxx"
+#include "picklist.hxx"
+#include "plugobj.hxx"
+#include "arrdecl.hxx"
+#include "sfxresid.hxx"
+#include "newhdl.hxx"
+#include "cfgmgr.hxx"
+#include "accmgr.hxx"
+#include "event.hxx"
+#include "macrconf.hxx"
+#include "mnumgr.hxx"
+#include "imgmgr.hxx"
+#include "templdlg.hxx"
+#include "tbxconf.hxx"
+#include "saveopt.hxx"
+#include "msgpool.hxx"
+#include "frameobj.hxx"
+#include "docfile.hxx"
+#include "sfxtypes.hxx"
+#include "explorer.hxx"
+#include "appimp.hxx"
+#include "sfxlocal.hrc"
+#include "dataurl.hxx"
+#include "fcontnr.hxx"
+#include "nochaos.hxx"
+#include "ucbhelp.hxx"
+#include "appuno.hxx"
+#include "doctempl.hxx"
+#include "viewfrm.hxx"
+#include "bmkmenu.hxx"
+
+#ifndef PRODUCT
+DECLARE_LIST( SfxFrameWindowFactoryArray_Impl, SfxFrameWindowFactory* )
+SV_DECL_PTRARR(SfxInitLinkList, Link*, 2, 2);
+#endif
+
+//===================================================================
+/*
+void SfxApplication::Quit()
+{
+ QueryExit_Impl();
+}
+*/
+//--------------------------------------------------------------------
+BOOL SfxApplicationClass::QueryExit()
+{
+ const SfxBoolItem *pRet = (const SfxBoolItem*) SFX_APP()->GetAppDispatcher_Impl()->Execute( SID_QUITAPP, SFX_CALLMODE_SYNCHRON );
+ return pRet ? pRet->GetValue() : FALSE;
+}
+
+BOOL SfxApplication::QueryExit_Impl()
+
+/* [Beschreibung]
+
+ Liefert FALSE, wenn entweder ein modaler Dialog offen ist, oder
+ der Printer einer SfxViewShell einen laufenden Druckjob hat.
+
+ [Anmerkung]
+
+ Wenn diese aus StarView stammende virtuelle Methode vom Applikations-
+ entwickler "uberladen wird, mu"s diese SfxApplication::QueryExit() rufen
+ und falls diese FALSE zur"uckgibt, ebenfalls FALSE zur"uckgeben.
+*/
+
+{
+ StoreConfig();
+ pAppData_Impl->bInQuit = TRUE;
+ BOOL bQuit = TRUE;
+
+ // laufen noch Drucker?
+ BOOL bPrinting = FALSE;
+ for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
+ !bPrinting && pViewSh;
+ pViewSh = SfxViewShell::GetNext(*pViewSh) )
+ {
+ SfxPrinter *pPrinter = pViewSh->GetPrinter();
+ bPrinting = pPrinter && pPrinter->IsPrinting();
+ }
+
+ if ( bPrinting )
+ {
+ // Benutzer fragen, ob abgebrochen werden soll
+ if ( RET_OK == QueryBox( 0, SfxResId( MSG_ISPRINTING_QUERYABORT ) ).Execute() )
+ {
+ // alle Jobs canceln
+ for ( SfxViewShell *pViewSh = SfxViewShell::GetFirst();
+ !bPrinting && pViewSh;
+ pViewSh = SfxViewShell::GetNext(*pViewSh) )
+ {
+ SfxPrinter *pPrinter = pViewSh->GetPrinter();
+ if ( pPrinter && pPrinter->IsPrinting() )
+ pPrinter->AbortJob();
+ }
+
+ // da das Canceln asynchron ist, Quit erstmal wieder verlassen
+ GetDispatcher().Execute( SID_QUITAPP, SFX_CALLMODE_ASYNCHRON );
+ DBG_TRACE( "QueryExit => FALSE (printing)" );
+ pAppData_Impl->bInQuit = FALSE;
+ return FALSE;
+ }
+ }
+
+ // alles canceln was zu canceln ist
+ GetCancelManager()->Cancel(TRUE);
+
+ // direkte Benutzung is beendet
+ if ( pAppData_Impl->bDirectAliveCount )
+ {
+ SvFactory::DecAliveCount();
+ pAppData_Impl->bDirectAliveCount = FALSE;
+ }
+
+ // vor Parasiten wie BasicIDESh etc. sch"utzen
+ pAppDispat->Flush();
+
+ // alle "normal" bearbeiteten Dokumente schlie\sen
+ MemCache_Impl &rCache = SfxPickList_Impl::Get()->GetMemCache();
+ rCache.ClearObjects();
+
+ SfxObjectShell *pLastDocSh = SfxObjectShell::GetFirst();
+ if ( bQuit )
+ {
+ // Jetzt zur Sicherheit auch hidden Frames abr"aumen
+ SfxViewFrame::CloseHiddenFrames_Impl();
+
+ pLastDocSh = SfxObjectShell::GetFirst();
+ // nur dann auch die externen beseitigen
+ SvFactory::CloseExtConObj( TRUE );
+
+ // Alle externen Verbindungen zu eigenen Objekten terminieren
+ SvFactory::CloseExtConObj( FALSE );
+ }
+
+ // will trotzdem noch jemand, den man nicht abschiessen kann, die App haben?
+ if ( !bQuit || SvFactory::GetAliveCount() )
+ {
+ // nicht wirklich beenden, nur minimieren
+ pAppData_Impl->bOLEResize = TRUE;
+ InfoBox aInfoBox( NULL, SfxResId(MSG_CANT_QUIT) );
+ aInfoBox.Execute();
+ pAppData_Impl->bInQuit = FALSE;
+ DBG_TRACE( "QueryExit => FALSE (in use)" );
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxApplication::Deinitialize()
+{
+ if ( bDowning )
+ return;
+
+ // Falls man nochmal beim Runterfahren in ein Reschedule l"auft
+ pAppData_Impl->EndListening( *pAppIniMgr );
+ pAppData_Impl->EndListening( *this );
+ if ( pAppData_Impl->pCancelMgr )
+ pAppData_Impl->EndListening( *pAppData_Impl->pCancelMgr );
+
+ // Falls noch mal zwischendurch eine Task ( BasicIDE! ) angelegt wurde ...
+ do
+ {
+ SfxObjectShell* pFirst = SfxObjectShell::GetFirst();
+ if ( pFirst )
+ pFirst->DoClose();
+ else
+ break;
+ }
+ while ( sal_True );
+
+ //!Wait();
+ StarBASIC::Stop();
+
+ // Pickliste (nicht in StoreConfig wegen letztem Doc)
+ SfxPickList_Impl::Get()->SavePicklist();
+
+ // ggf. BASIC speichern
+ if ( pImp->pBasicMgr && pImp->pBasicMgr->IsModified() )
+ SaveBasicManager();
+
+ bDowning = TRUE; // wegen Timer aus DecAliveCount und QueryExit
+ // free Windows and Controllers
+ DELETEZ( pAppData_Impl->pExplorer );
+
+ DELETEZ( pAppData_Impl->pTemplates );
+
+#ifdef TF_OFFLINEREADING
+ delete pAppData_Impl->pOfflineURLMgr;
+#endif
+ delete pAppData_Impl->pStopButtonTimer;
+#if SUPD>603
+ utl::ConfigManager::RemoveConfigManager();
+#endif
+//(dv) DELETEZ( pAppData_Impl->pAnchorJobList );
+ SvFactory::ClearDemandObjects();
+ DELETEZ(pImp->pTemplateDlg);
+ SetViewFrame(0);
+ bDowning = FALSE;
+ DBG_ASSERT( !SfxViewFrame::GetFirst(),
+ "existing SfxViewFrame after Execute" );
+ DBG_ASSERT( !SfxObjectShell::GetFirst(),
+ "existing SfxObjectShell after Execute" );
+ pAppDispat->Pop( *this, SFX_SHELL_POP_UNTIL );
+ pAppDispat->Flush();
+ bDowning = TRUE;
+ pAppDispat->DoDeactivate_Impl( TRUE );
+
+ INetURLHistory::Delete();
+
+ // call derived application-exit
+ bInExit = TRUE;
+ Exit();
+
+ // Controller u."a. freigeben
+ // dabei sollten auch restliche Komponenten ( Beamer! ) verschwinden
+ DELETEZ(pMenuMgr);
+ DELETEZ(pAcceleratorMgr);
+ DELETEZ( pImp->pBasicMgr );
+
+ SvFactory::ClearDemandObjects();
+ bInExit = FALSE;
+
+ DBG_ASSERT( pViewFrame == 0, "active foreign ViewFrame" );
+
+ DELETEZ(pInterfaces);
+ DELETEZ(pImageMgr);
+ DELETEZ(pOptions);
+
+ // free administration managers
+ DELETEZ(pImp->pAutoSaveTimer);
+ DELETEZ(pAppDispat);
+ DELETEZ(pImp->pSfxResManager);
+
+ DELETEZ( pAppData_Impl->pNewMenu );
+ DELETEZ( pAppData_Impl->pAutoPilotMenu );
+
+ // ab hier d"urfen keine SvObjects mehr existieren
+ DELETEX(pAppData_Impl->pMatcher);
+ DELETEX(pAppData_Impl->pDataLockBytesFactory);
+ DELETEX(pAppData_Impl->pImageLockBytesFactory);
+ DELETEX(pAppData_Impl->pSfxFrameObjectFactoryPtr);
+ DELETEX(pAppData_Impl->pSfxPluginObjectFactoryPtr);
+ SvFactory::DeInit();
+
+ SfxPickList_Impl::Delete();
+ delete GetDdeService();
+ delete pAppData_Impl->pLabelResMgr;
+
+#ifndef PRODUCT
+ DELETEX(pSlotPool);
+ SfxToolBoxConfig::Release();
+ DELETEX(pAppData_Impl->pEventConfig);
+ SfxMacroConfig::Release_Impl();
+ DELETEX(pAppData_Impl->pVerbs);
+ DELETEX(pAppData_Impl->pFactArr);
+ DELETEX(pAppData_Impl->pInitLinkList);
+#endif
+
+ pAppIniMgr->LeaveLock();
+ DELETEZ(pCfgMgr);
+
+#ifndef PRODUCT
+ DELETEX(pImp->pTbxCtrlFac);
+ DELETEX(pImp->pStbCtrlFac);
+ DELETEX(pImp->pMenuCtrlFac);
+ DELETEX(pImp->pEventHdl);
+ SfxNewHdl::Delete();
+ DELETEX(pImp->pAutoSaveTimer);
+ DELETEX(pImp->pViewFrames);
+ DELETEX(pImp->pViewShells);
+ DELETEX(pImp->pObjShells);
+#endif
+
+ NoChaos::ReleaseItemPool();
+ pAppData_Impl->pPool = NULL;
+}
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
new file mode 100644
index 000000000000..61a010c7ef76
--- /dev/null
+++ b/sfx2/source/appl/appreg.cxx
@@ -0,0 +1,274 @@
+/*************************************************************************
+ *
+ * $RCSfile: appreg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ //==================================================================
+// class SfxApplication: Register...
+//
+// Copyright 2000 Sun Microsystems, Inc.
+// $Author: hr $ $Date: 2000-09-18 16:52:27 $ $Revision: 1.1.1.1 $
+// $Logfile: T:/sfx2/source/appl/appreg.cxv $ $Workfile: appreg.CXX $
+//------------------------------------------------------------------
+
+#ifndef _SV_CONFIG_HXX
+#include <vcl/config.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "appdata.hxx"
+#include "arrdecl.hxx"
+#include "intfrm.hxx"
+#include "ipfrm.hxx"
+#include "fsetobsh.hxx"
+#include "fsetview.hxx"
+#include "tbxcust.hxx"
+#include "sfxhelp.hxx"
+#include "templdlg.hxx"
+#include "objmnctl.hxx"
+#include "inettbc.hxx"
+#include "stbitem.hxx"
+#include "tbedctrl.hxx"
+#include "navigat.hxx"
+#include "module.hxx"
+#include "topfrm.hxx"
+#include "appimp.hxx"
+#include "mailchildwin.hxx"
+#include "sfxsids.hrc"
+
+//===================================================================
+
+void SfxApplication::Registrations_Impl()
+{
+ // Interfaces
+ SfxApplication::RegisterInterface();
+ SfxModule::RegisterInterface();
+ SfxViewFrame::RegisterInterface();
+ SfxInternalFrame::RegisterInterface();
+ SfxInPlaceFrame::RegisterInterface();
+ SfxTopViewFrame::RegisterInterface();
+ SfxObjectShell::RegisterInterface();
+ SfxViewShell::RegisterInterface();
+// SfxFrameSetObjectShell::RegisterInterface();
+// SfxFrameSetViewShell::RegisterInterface();
+// SfxFrameSetView_Impl::RegisterInterface();
+// SfxFrameSetSourceView_Impl::RegisterInterface();
+
+ // ChildWindows
+ SfxNavigatorWrapper::RegisterChildWindow();
+ SfxToolboxCustomWindow::RegisterChildWindow();
+ SfxMailChildWinWrapper_Impl::RegisterChildWindow();
+
+/*! (pb) no help at this time
+ SfxHelpPIWrapper::RegisterChildWindow();
+ SfxHelpTipsWrapper::RegisterChildWindow();
+*/
+ SfxTemplateDialogWrapper::RegisterChildWindow(TRUE);
+
+ // Controller
+ SfxObjectVerbsControl::RegisterControl(SID_OBJECT);
+ SfxMenuControl::RegisterControl(SID_QUITAPP);
+ SfxMenuControl::RegisterControl(SID_SAVEASDOC);
+ SfxMenuControl::RegisterControl(SID_SAVEDOC);
+ SfxMenuControl::RegisterControl(SID_OPENDOC);
+ SfxMenuControl::RegisterControl(SID_CLOSEDOC);
+ SfxMenuControl::RegisterControl(SID_OBJECTMENU0);
+ SfxMenuControl::RegisterControl(SID_OBJECTMENU1);
+ SfxMenuControl::RegisterControl(SID_OBJECTMENU2);
+ SfxMenuControl::RegisterControl(SID_OBJECTMENU3);
+ SfxMenuControl::RegisterControl(SID_UNDO);
+ SfxMenuControl::RegisterControl(SID_REDO);
+ SfxMenuControl::RegisterControl(SID_REPEAT);
+ SfxMenuControl::RegisterControl(SID_MAIL_SENDDOC);
+ SfxAppMenuControl_Impl::RegisterControl( SID_NEWDOCDIRECT );
+ SfxAppMenuControl_Impl::RegisterControl( SID_BOOKMARKS );
+ SfxAppMenuControl_Impl::RegisterControl( SID_AUTOPILOTMENU );
+ SfxToolBoxControl::RegisterControl(SID_UNDO);
+ SfxToolBoxControl::RegisterControl(SID_REDO);
+ SfxToolBoxControl::RegisterControl(SID_REPEAT);
+ SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
+ SfxCancelToolBoxControl_Impl::RegisterControl(SID_BROWSE_STOP);
+ SfxAppToolBoxControl_Impl::RegisterControl( SID_NEWDOCDIRECT );
+ SfxAppToolBoxControl_Impl::RegisterControl( SID_BOOKMARKS );
+ SfxAppToolBoxControl_Impl::RegisterControl( SID_AUTOPILOTMENU );
+ SfxDragToolBoxControl_Impl::RegisterControl( SID_TOPDOC );
+ SfxFrameEditToolBoxControl_Impl::RegisterControl(SID_FRAME_NAME);
+ SfxFrameEditToolBoxControl_Impl::RegisterControl(SID_FRAME_CONTENT);
+ SfxFrameSpacingControl_Impl::RegisterControl(SID_FRAMESPACING);
+ SfxHistoryToolBoxControl_Impl::RegisterControl( SID_BROWSE_FORWARD );
+ SfxHistoryToolBoxControl_Impl::RegisterControl( SID_BROWSE_BACKWARD );
+ SfxReloadToolBoxControl_Impl::RegisterControl( SID_RELOAD );
+};
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RegisterToolBoxControl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
+{
+ if ( pMod )
+ {
+ pMod->RegisterToolBoxControl( pFact );
+ return;
+ }
+
+#ifdef DBG_UTIL
+ for ( USHORT n=0; n<pImp->pTbxCtrlFac->Count(); n++ )
+ {
+ SfxTbxCtrlFactory *pF = (*pImp->pTbxCtrlFac)[n];
+ if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ {
+ DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
+ }
+ }
+#endif
+
+ pImp->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pImp->pTbxCtrlFac->Count() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RegisterStatusBarControl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
+{
+ if ( pMod )
+ {
+ pMod->RegisterStatusBarControl( pFact );
+ return;
+ }
+
+#ifdef DBG_UTIL
+ for ( USHORT n=0; n<pImp->pStbCtrlFac->Count(); n++ )
+ {
+ SfxStbCtrlFactory *pF = (*pImp->pStbCtrlFac)[n];
+ if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ {
+ DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
+ }
+ }
+#endif
+
+ pImp->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pImp->pStbCtrlFac->Count() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::RegisterMenuControl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
+{
+ if ( pMod )
+ {
+ pMod->RegisterMenuControl( pFact );
+ return;
+ }
+
+#ifdef DBG_UTIL
+ for ( USHORT n=0; n<pImp->pMenuCtrlFac->Count(); n++ )
+ {
+ SfxMenuCtrlFactory *pF = (*pImp->pMenuCtrlFac)[n];
+ if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ {
+ DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
+ }
+ }
+#endif
+
+ pImp->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pImp->pMenuCtrlFac->Count() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::SetInterfaceByIdImpl( SfxInterfaceId eId,
+ SfxInterface* pIF )
+{
+ if ( (USHORT) eId >= nInterfaces )
+ {
+ USHORT nNewInterfaces = eId + 4;
+ SfxInterface **pNewInterfaces = new SfxInterface*[nNewInterfaces];
+ memcpy( pNewInterfaces, pInterfaces,
+ sizeof(SfxInterface*) * nInterfaces );
+ memset( pNewInterfaces+nInterfaces, 0,
+ sizeof(SfxInterface*) * (nNewInterfaces-nInterfaces) );
+ delete pInterfaces;
+ nInterfaces = nNewInterfaces;
+ pInterfaces = pNewInterfaces;
+ }
+
+ DBG_ASSERT( 0 == pInterfaces[ USHORT(eId) ],
+ "interface registered more than once" );
+#if defined(DBG_UTIL) && defined(MSC)
+ USHORT nId = USHORT(eId);
+ if ( 0 != pInterfaces[ nId ] )
+ {
+ ByteString aMsg( pIF->GetClassName() );
+ aMsg += " registers over ";
+ aMsg += pInterfaces[ nId ]->GetClassName();
+ DbgTrace( aMsg.GetBuffer() );
+ }
+#endif
+
+ pInterfaces[ USHORT(eId) ] = pIF;
+}
+
+const SfxObjectFactory& SfxApplication::GetDefaultFactory() const
+{
+ return SfxObjectFactory::GetDefaultFactory();
+}
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
new file mode 100644
index 000000000000..a21c70ec1fb0
--- /dev/null
+++ b/sfx2/source/appl/appserv.cxx
@@ -0,0 +1,1066 @@
+/*************************************************************************
+ *
+ * $RCSfile: appserv.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XTASK_HPP_
+#include <com/sun/star/frame/XTask.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
+#include <com/sun/star/frame/XDesktop.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XTASKSSUPPLIER_HPP_
+#include <com/sun/star/frame/XTasksSupplier.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
+#include <unotools/processfactory.hxx>
+#endif
+
+#ifndef _SV_CONFIG_HXX
+#include <vcl/config.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SV_SYSTEM_HXX
+#include <vcl/system.hxx>
+#endif
+#ifndef _SFXCANCEL_HXX //autogen
+#include <svtools/cancel.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _BASRDLL_HXX
+#include <basic/basrdll.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "appimp.hxx"
+#include "referers.hxx"
+#include "app.hxx"
+#include "request.hxx"
+#include "dispatch.hxx"
+#include "bindings.hxx"
+#include "msg.hxx"
+#include "objface.hxx"
+#include "objitem.hxx"
+#include "objsh.hxx"
+#include "hintpost.hxx"
+#include "stbmgr.hxx"
+#include "viewsh.hxx"
+#include "docfac.hxx"
+#include "docfile.hxx"
+#include "docfilt.hxx"
+#include "docvor.hxx"
+#include "cfg.hxx"
+#include "new.hxx"
+#include "docinf.hxx"
+#include "templdlg.hxx"
+#include "inimgr.hxx"
+#include "sfxtypes.hxx"
+#include "sfxbasic.hxx"
+#include "tabdlg.hxx"
+#include "arrdecl.hxx"
+#include "fltfnc.hxx"
+#include "iodlg.hxx"
+#include "picklist.hxx"
+#include "sfx.hrc"
+#include "app.hrc"
+#include "tbxcust.hxx"
+#include "passwd.hxx"
+#include "interno.hxx"
+#include "ipenv.hxx"
+#include "sfxresid.hxx"
+#include "arrdecl.hxx"
+#include "childwin.hxx"
+#include "appdata.hxx"
+#include "tbxconf.hxx"
+#include "macrconf.hxx"
+#include "minfitem.hxx"
+#include "event.hxx"
+#include "cfgmgr.hxx"
+#include "saveopt.hxx"
+#include "accmgr.hxx"
+#include "mnumgr.hxx"
+#include "intfrm.hxx"
+#include "urlframe.hxx"
+#include "module.hxx"
+#include "topfrm.hxx"
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::container;
+
+#define SFX_KEY_MULTIQUICKSEARCH "ExplorerMultiQuickSearch"
+
+//-------------------------------------------------------------------------
+long QuitAgain_Impl( void* pObj, void* pArg )
+{
+ SfxApplication* pApp = (SfxApplication*)pObj;
+ Timer* pTimer = (Timer*)pArg;
+ delete pTimer;
+ pApp->GetDispatcher().Execute( SID_QUITAPP, SFX_CALLMODE_ASYNCHRON );
+ return 0;
+}
+
+struct ApplicationType
+{
+ String aPathName;
+ String aParams;
+ String aDomainName;
+};
+
+BOOL SfxApplication::InitOfficeAppType_Impl( USHORT nAppId, ApplicationType& rType, BOOL bEmbed )
+{
+ if ( nAppId < SID_START_BEGIN || nAppId > SID_START_END )
+ return FALSE;
+ // App in Config suchen
+ String aAppName = String( SfxResId( nAppId ) );
+ SfxIniManager* pIni = SFX_INIMANAGER();
+ DBG_ASSERT( pIni, "Kein IniManager?!" );
+ String aFullName;
+ while ( pIni && !aFullName.Len() )
+ {
+ aFullName = pIni->ReadKey( DEFINE_CONST_UNICODE("OfficeApplications"), aAppName );
+ if ( !aFullName.Len() )
+ pIni = pIni->GetSubManager();
+ }
+
+ if ( !aFullName.Len() )
+ {
+ // not found, but new try
+ INetURLObject aTryObj( Application::GetAppFileName(), INET_PROT_FILE );
+ aTryObj.setBase( aAppName );
+ aFullName = aTryObj.PathToFileName();
+ }
+
+ rType.aPathName = aFullName;
+ if ( bEmbed )
+ rType.aParams = DEFINE_CONST_UNICODE( "/embedding" );
+ INetURLObject aObj( aFullName, INET_PROT_FILE );
+ rType.aDomainName = aObj.getBase();
+ return TRUE;
+}
+
+FASTBOOL SfxApplication::PostOfficeAppEvent( USHORT nAppId, const String& rEvent, const String& rParam )
+{
+
+//(mba)/task SfxWaitCursor aWait;
+
+ ApplicationType aType;
+ if( !InitOfficeAppType_Impl( nAppId, aType ) )
+ return FALSE;
+
+ // Event posten, ggf. App mit . auf Kommandozeile starten
+ ApplicationAddress aAppAdr;
+ String aAppParam( rParam.Len() ? DEFINE_CONST_UNICODE(".") : String() );
+ SvFactory::IncAliveCount(); // Quit verhindern
+ BOOL bOk = FALSE; //! (pb) OldSV: Application::PostAppEvent( aType.aPathName, aAppAdr, rEvent, rParam, TRUE, &aAppParam );
+ SvFactory::DecAliveCount();
+ return bOk;
+}
+
+void SfxApplication::BasicLibExec_Impl( SfxRequest &rReq, BasicManager *pMgr )
+{
+ // Zuerst den LibName holen
+ BOOL bRet = FALSE;
+ USHORT nItemId = rReq.GetSlot();
+ SFX_REQUEST_ARG( rReq, pNameItem, SfxStringItem, nItemId == SID_ADD_LIBRARY ? SID_FILE_NAME : rReq.GetSlot(), FALSE );
+
+ String aFileName; // F"ur AddLibrary
+ String aLibName;
+ if ( pNameItem )
+ {
+ if ( nItemId == SID_ADD_LIBRARY )
+ {
+ // Bei AddLibrary ist der LibName optional, er kann mit dem
+ // FileName identisch sein
+ INetURLObject aObj( pNameItem->GetValue(), INET_PROT_FILE );
+ aFileName = aObj.GetMainURL();
+
+ // Nach optionalem LibName suchen
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_LOAD_LIBRARY, FALSE );
+ if ( pItem )
+ aLibName = pItem->GetValue();
+ else
+ aLibName = aObj.GetBase();
+ }
+ else
+ aLibName = pNameItem->GetValue();
+ }
+
+ if ( aLibName.Len() )
+ {
+ // Die Library zum "ubergebenen Namen suchen
+ const International &rInter = Application::GetAppInternational();
+ USHORT nLibCount = pMgr->GetLibCount();
+ StarBASIC *pLib = NULL;
+ USHORT nLib;
+ for ( nLib = 0; nLib < nLibCount; ++nLib )
+ {
+ if ( COMPARE_EQUAL == rInter.Compare( pMgr->GetLibName( nLib ), aLibName, INTN_COMPARE_IGNORECASE ) )
+ {
+ pLib = pMgr->GetLib( nLib );
+ break;
+ }
+ }
+
+ switch ( rReq.GetSlot() )
+ {
+ case SID_LOAD_LIBRARY:
+ {
+ // Wenn eine Library gefunden wurde, die noch nicht
+ // geladen ist
+ if( nLib<nLibCount && !pLib )
+ bRet = pMgr->LoadLib( nLib );
+ break;
+ }
+
+ case SID_UNLOAD_LIBRARY:
+ {
+ // Wenn eine Library gefunden wurde, die geladen ist
+ if( pLib )
+ bRet = pMgr->UnloadLib( nLib );
+ break;
+ }
+
+ case SID_REMOVE_LIBRARY:
+ {
+ // Wenn eine Library gefunden wurde
+ // Lib wird nur physikalisch gel"oscht, wenn sie im
+ // Storage des BasicMgr liegt
+ if ( nLib<nLibCount )
+ bRet = pMgr->RemoveLib( nLib,
+ !pMgr->IsReference(nLib) && !pMgr->IsExtern(nLib) );
+ break;
+ }
+
+ case SID_ADD_LIBRARY:
+ {
+ // Library laden
+ SvStorageRef aStor = new SvStorage( aFileName, STREAM_STD_READ );
+ if ( aStor->GetError() )
+ break;
+
+ // Weitere Parameter: Art des Ladens der Library
+ // ( einbinden, per Referenz oder extern ) und Replace
+ BOOL bReplace = TRUE;
+ BOOL bReference = FALSE;
+ BOOL bExternal = FALSE;
+
+ SFX_REQUEST_ARG( rReq, pRefItem, SfxUInt16Item, SID_ADD_LIBRARY, FALSE );
+ if ( pRefItem )
+ {
+ bReference = pRefItem->GetValue() == SFX_BASICLIB_ADDMODE_REFERENCE;
+ bExternal = pRefItem->GetValue() == SFX_BASICLIB_ADDMODE_EXTERNAL;
+ if ( pMgr != GetBasicManager() )
+ bExternal = FALSE;
+ }
+
+ SFX_REQUEST_ARG( rReq, pReplaceItem, SfxBoolItem, SID_REMOVE_LIBRARY, FALSE );
+ if ( pReplaceItem )
+ bReplace = pReplaceItem->GetValue();
+
+ if ( nLib<nLibCount )
+ {
+ // Es gibt schon eine Library dieses Namens
+ if ( bReplace && ( pMgr->GetLib( nLib ) == pMgr->GetStdLib() ) )
+ // die Standard-Lib kann nicht ersetzt werden
+ break;
+
+ if ( bReplace )
+ // Library soll eine vorhandene ersetzen
+ pMgr->RemoveLib( nLib );
+
+ else if ( bReference )
+ // Referenz nicht moeglich, wenn Lib mit
+ // Namen schon existiert, ausser bei Replace.
+ break;
+ }
+
+ // Library einf"ugen
+ StarBASIC *pLib = pMgr->AddLib( *aStor, aLibName, bReference );
+ if ( pLib )
+ {
+ nLib = pMgr->GetLibId( pLib );
+
+ // Einf"ugen extern
+ if ( bExternal )
+ {
+ INetURLObject aAppBasic( pMgr->GetStorageName(), INET_PROT_FILE );
+ String aExt = aAppBasic.GetExtension();
+
+ // Optionaler Parameter fuer Name der sbl-Datei
+ String aDest;
+ SFX_REQUEST_ARG( rReq, pDestItem, SfxStringItem, SID_DOCTITLE, FALSE );
+ if ( pDestItem && pDestItem->GetValue().Len() )
+ aDest = pDestItem->GetValue();
+ else
+ {
+ INetURLObject aOld( aFileName, INET_PROT_FILE );
+ aDest = aOld.GetName();
+ }
+
+ INetURLObject aNew( SFX_INIMANAGER()->Get( SFX_KEY_BASIC_PATH ).GetToken( 0, ';' ), INET_PROT_FILE );
+ aNew.SetExtension( aExt );
+ pMgr->SetLibStorageName( nLib, aNew.GetFull() );
+ SaveBasicManager();
+ }
+
+ bRet = TRUE;
+ }
+ }
+ }
+ }
+
+ rReq.SetReturnValue( SfxBoolItem( 0, bRet ) );
+}
+
+void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
+{
+ DBG_MEMTEST();
+ FASTBOOL bDone = FALSE;
+ switch ( rReq.GetSlot() )
+ {
+ case SID_LOAD_LIBRARY:
+ case SID_UNLOAD_LIBRARY:
+ case SID_REMOVE_LIBRARY:
+ case SID_ADD_LIBRARY:
+ {
+ // Diese Funktionen sind nur f"ur Aufrufe aus dem Basic gedacht
+ if ( IsInBasicCall() )
+ BasicLibExec_Impl( rReq, GetBasicManager() );
+ break;
+ }
+
+ case SID_NEXTWINDOW :
+ case SID_PREVWINDOW :
+ {
+ SfxWorkWindow *pWork = GetWorkWindow_Impl();
+ pWork->ActivateNextChild_Impl( rReq.GetSlot() == SID_NEXTWINDOW ? TRUE :FALSE );
+ rReq.Done();
+ break;
+ }
+
+ case SID_SETOPTIONS:
+ {
+ if( rReq.GetArgs() )
+ SetOptions_Impl( *rReq.GetArgs() );
+ break;
+ }
+
+ case SID_QUITAPP:
+ case SID_EXITANDRETURN:
+ {
+ if ( pAppData_Impl->bInQuit )
+ return;
+
+ // aus verschachtelten Requests nach 100ms nochmal probieren
+ if( Application::GetDispatchLevel() > 1 )
+ {
+ Timer *pTimer = new Timer;
+ pTimer->SetTimeout( 100 );
+ pTimer->SetTimeoutHdl( Link( this, QuitAgain_Impl ) );
+ pTimer->Start();
+ DBG_TRACE1( "QueryExit => FALSE (DispatchLevel == %u)", Application::GetDispatchLevel() );
+ return;
+ }
+
+ // prepare documents for closing
+ Reference < XDesktop > xDesktop ( ::utl::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
+ BOOL bQuit = xDesktop->terminate();
+
+ // Returnwert setzten, ggf. terminieren
+ rReq.SetReturnValue(SfxBoolItem(rReq.GetSlot(), bQuit));
+ return;
+ }
+
+ case SID_PICK1:
+ case SID_PICK2:
+ case SID_PICK3:
+ case SID_PICK4:
+ case SID_PICK5:
+ case SID_PICK6:
+ case SID_PICK7:
+ case SID_PICK8:
+ case SID_PICK9:
+ {
+ USHORT nPickNo = rReq.GetSlot()-SID_PICK1;
+ if ( nPickNo >= SfxPickList_Impl::Get()->GetAllowedMenuSize() )
+ break;
+
+ rReq.SetSlot( SID_OPENDOC );
+ SfxPickEntry_Impl *pPick = SfxPickList_Impl::Get()->GetMenuPickEntry( nPickNo );
+ rReq.AppendItem(SfxStringItem(SID_FILE_NAME, pPick->aName ));
+ rReq.AppendItem( SfxStringItem( SID_REFERER, DEFINE_CONST_UNICODE(SFX_REFERER_USER) ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
+ rReq.AppendItem( SfxBoolItem( SID_DOC_READONLY, FALSE ) );
+ String aFilter(pPick->aFilter);
+ USHORT nPos=aFilter.Search('|');
+ if( nPos != STRING_NOTFOUND )
+ {
+ String aOptions(aFilter.Copy( nPos ).GetBuffer()+1);
+ aFilter.Erase( nPos );
+ rReq.AppendItem(
+ SfxStringItem(SID_FILE_FILTEROPTIONS, aOptions));
+ }
+
+ rReq.AppendItem(SfxStringItem(SID_FILTER_NAME, aFilter));
+ ExecuteSlot( rReq );
+ return;
+ }
+
+ case SID_CONFIG:
+ case SID_TOOLBOXOPTIONS:
+ case SID_CONFIGSTATUSBAR:
+ case SID_CONFIGMENU:
+ case SID_CONFIGACCEL:
+ case SID_CONFIGEVENT:
+ {
+ Window *pParent = GetTopWindow();
+ const SfxStringItem *pStringItem=0;
+ const SfxUInt16Item *pItem=0;
+ USHORT nId=0;
+
+ // Versuche, einen "ubergebenen ConfigNamen zu holen
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ if ( pArgs && pArgs->GetItemState(SID_CFGFILE) >= SFX_ITEM_AVAILABLE )
+ {
+ const SfxPoolItem *pSfxItem = &pArgs->Get(SID_CFGFILE);
+ DBG_ASSERT(pSfxItem->ISA(SfxStringItem),"Fehlerhafte Parameter!");
+ pStringItem = (const SfxStringItem*) pSfxItem;
+
+ }
+
+ // Versuche, eine "ubergebene ConfigID zu holen
+ if (pArgs && pArgs->GetItemState(SID_CONFIGITEMID) >= SFX_ITEM_AVAILABLE)
+ {
+ const SfxPoolItem *pSfxItem = &pArgs->Get(SID_CONFIGITEMID);
+ DBG_ASSERT(pSfxItem->ISA(SfxUInt16Item),"Fehlerhafte Parameter!");
+ pItem = (const SfxUInt16Item*) pSfxItem;
+ nId = pItem->GetValue();
+ bDone = TRUE;
+ }
+ else
+ {
+ switch ( rReq.GetSlot() )
+ {
+ case SID_CONFIGSTATUSBAR:
+ if ( GetStatusBarManager() )
+ nId = GetStatusBarManager()->GetType();
+ break;
+ case SID_CONFIGMENU:
+ nId = GetMenuBarManager()->GetType();
+ break;
+ case SID_CONFIGACCEL:
+ nId = GetAcceleratorManager()->GetType();
+ break;
+ case SID_TOOLBOXOPTIONS:
+ nId = SfxToolBoxConfig::GetOrCreate()->GetType();
+ break;
+ default:
+ break;
+ }
+ }
+
+ if ( pStringItem && nId )
+ {
+ // Ausf"uhren ohne Dialog
+ SfxConfigManager *pCfgMgr = new SfxConfigManager(pStringItem->GetValue());
+ pAppData_Impl->pAppCfg->CopyItem(nId, pCfgMgr);
+ GetDispatcher().Update_Impl(TRUE);
+ if ( nId == GetMenuBarManager()->GetType() || nId == SID_CONFIG )
+ GetMenuBarManager()->ReconfigureObjectMenus();
+ }
+ else
+ {
+ SfxItemSet aSet( GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM );
+ SfxConfigDialog *pDlg = new SfxConfigDialog( pParent, &aSet );
+
+ switch ( rReq.GetSlot() )
+ {
+ case SID_CONFIG:
+ {
+ // Soll ein Macro vorselektiert werden ?
+ if (pArgs && pArgs->GetItemState(SID_MACROINFO) >= SFX_ITEM_AVAILABLE)
+ {
+ const SfxPoolItem *pSfxItem = &pArgs->Get(SID_MACROINFO);
+ DBG_ASSERT(pSfxItem->ISA(SfxMacroInfoItem),"Fehlerhafte Parameter!");
+ const SfxMacroInfoItem *pMItem = (const SfxMacroInfoItem*) pSfxItem;
+ if (pMItem)
+ pDlg->ActivateMacroConfig(pMItem);
+ }
+ break;
+ }
+
+ case SID_TOOLBOXOPTIONS:
+ {
+ if ( nId )
+ // Es soll eine Objektleiste vorselektiert werden
+ pDlg->ActivateToolBoxConfig(nId);
+ }
+ }
+
+ const short nRet = pDlg->Execute();
+ GetDispatcher().Update_Impl(TRUE);
+
+ if (nRet)
+ bDone = TRUE;
+
+ if (nRet == 3)
+ {
+ pViewFrame->SetChildWindow( SfxToolboxCustomWindow::GetChildWindowId(), TRUE );
+ Invalidate(rReq.GetSlot());
+ }
+ delete pDlg;
+ }
+ break;
+ }
+
+ case SID_SAVECONFIG:
+ {
+ SfxConfigManager *pMgr = 0;
+ BOOL bCreated = TRUE;
+ String aCfgName;
+
+ // Versuche, einen "ubergebenen ConfigNamen zu holen
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ if ( !rReq.IsAPI() || pArgs )
+ {
+ if ( !pArgs )
+ {
+ // Kein Parameter, kein API, also Dialog
+ aCfgName = SfxConfigDialog::FileDialog_Impl(
+ GetTopWindow(), WB_SAVEAS | WB_STDMODAL | WB_3DLOOK, String() );
+ }
+ else
+ {
+ // Name "uber Parameter
+ const SfxPoolItem *pSfxItem = &pArgs->Get( SID_CFGFILE );
+ DBG_ASSERT( pSfxItem && pSfxItem->ISA(SfxStringItem), "Fehlerhafte Parameter!" );
+ const SfxStringItem *pStringItem = (const SfxStringItem*) pSfxItem;
+ if ( pStringItem )
+ {
+ aCfgName = pStringItem->GetValue();
+ INetURLObject aObj( pStringItem->GetValue(), INET_PROT_FILE );
+ if ( aObj.HasError() )
+ {
+ // Wenn relativ, ConfigDir verwenden
+ aObj.SetSmartURL( SFX_INIMANAGER()->Get( SFX_KEY_USERCONFIG_PATH) );
+ aObj.insertName( pStringItem->GetValue() );
+ aCfgName = aObj.PathToFileName();
+ }
+ }
+ }
+ }
+ else
+ {
+ pAppData_Impl->pAppCfg->Backup();
+ }
+
+ if ( aCfgName.Len() )
+ {
+ // ConfigManager anlegen
+//(mba)/task SfxWaitCursor aWait;
+ BOOL bCreated = FALSE;
+ pMgr = SfxConfigDialog::MakeCfgMgr_Impl( aCfgName, bCreated );
+
+ // Wenn es nicht der globale ConfigManager ist, kopieren
+ if ( pMgr && pAppData_Impl->pAppCfg != pMgr )
+ pMgr->CopyItems( pAppData_Impl->pAppCfg );
+
+ // Dann abspeichern
+ if ( !pMgr->SaveConfig() )
+ HandleConfigError_Impl( (USHORT)pMgr->GetErrorCode() );
+ if ( bCreated )
+ delete pMgr;
+ }
+
+ bDone = TRUE;
+ break;
+ }
+
+ case SID_LOADCONFIG:
+ {
+ SfxConfigManager *pMgr = 0;
+ BOOL bCreated = TRUE;
+ String aCfgName;
+
+ // Versuche, einen "ubergebenen ConfigNamen zu holen
+ const SfxItemSet *pArgs = rReq.GetArgs();
+ if ( !rReq.IsAPI() || pArgs )
+ {
+ if ( !pArgs )
+ {
+ // Kein Parameter, kein API, also Dialog
+ aCfgName = SfxConfigDialog::FileDialog_Impl(
+ GetTopWindow(), WB_OPEN | WB_STDMODAL | WB_3DLOOK, String() );
+ }
+ else
+ {
+ // Name "uber Parameter
+ const SfxPoolItem *pSfxItem = &pArgs->Get( SID_CFGFILE );
+ DBG_ASSERT( pSfxItem && pSfxItem->ISA(SfxStringItem), "Fehlerhafte Parameter!" );
+ const SfxStringItem *pStringItem = (const SfxStringItem*) pSfxItem;
+ if ( pStringItem )
+ {
+ aCfgName = pStringItem->GetValue();
+ INetURLObject aObj( pStringItem->GetValue(), INET_PROT_FILE );
+ if ( aObj.HasError() )
+ {
+ // Wenn relativ, ConfigDir verwenden
+ aObj.SetSmartURL( SFX_INIMANAGER()->Get( SFX_KEY_USERCONFIG_PATH) );
+ aObj.insertName( pStringItem->GetValue() );
+ aCfgName = aObj.PathToFileName();
+ }
+ }
+ }
+ }
+ else
+ {
+ // Aus dem aktuellen Backup laden
+ pAppData_Impl->pAppCfg->Restore();
+ }
+
+ if ( aCfgName.Len() )
+ {
+ // ConfigManager anlegen
+//(mba)/task SfxWaitCursor aWait;
+ BOOL bCreated = FALSE;
+ pMgr = SfxConfigDialog::MakeCfgMgr_Impl( aCfgName, bCreated );
+
+ // Wenn es nicht der globale ConfigManager ist, kopieren
+ if ( pMgr && pAppData_Impl->pAppCfg != pMgr )
+ pAppData_Impl->pAppCfg->CopyItems( pMgr );
+
+ if ( bCreated )
+ delete pMgr;
+ }
+
+ GetDispatcher().Update_Impl(TRUE);
+ bDone = TRUE;
+ break;
+ }
+
+ case SID_CLOSEDOCS:
+ case SID_CLOSEWINS:
+ {
+
+ Reference < XTasksSupplier > xDesktop ( ::utl::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
+ Reference< XIndexAccess > xTasks( xDesktop->getTasks(), UNO_QUERY );
+ if ( !xTasks.is() )
+ break;
+
+ sal_Int32 n=0;
+ do
+ {
+ if ( xTasks->getCount() <= n )
+ break;
+
+ Any aAny = xTasks->getByIndex(n);
+ Reference < XTask > xTask;
+ aAny >>= xTask;
+ if ( !xTask->close() )
+ n++;
+ }
+ while( sal_True );
+
+ BOOL bOk = ( n == 0);
+ rReq.SetReturnValue( SfxBoolItem( 0, bOk ) );
+ bDone = TRUE;
+ break;
+ }
+
+ case SID_SAVEDOCS:
+ {
+ BOOL bOK = TRUE;
+ BOOL bDone = TRUE;
+ for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst();
+ pObjSh;
+ pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
+ {
+ SfxRequest aReq( SID_SAVEDOC, 0, pObjSh->GetPool() );
+ if ( pObjSh->IsModified() )
+ {
+ pObjSh->ExecuteSlot( aReq );
+ SfxBoolItem *pItem = PTR_CAST( SfxBoolItem, aReq.GetReturnValue() );
+ bDone = aReq.IsDone();
+ if ( !pItem || !pItem->GetValue() )
+ bOK = FALSE;
+ }
+ }
+
+ rReq.SetReturnValue( SfxBoolItem( 0, bOK ) );
+ rReq.Done();
+ break;
+ }
+
+/*! (pb) what about help?
+ case SID_HELPINDEX:
+ {
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ {
+ pHelp->Start( HELP_INDEX );
+ bDone = TRUE;
+ }
+ break;
+ }
+
+ case SID_EXTENDEDHELP:
+ {
+ // Parameter auswerten
+ SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_EXTENDEDHELP, FALSE);
+ FASTBOOL bOn = pOnItem
+ ? ((SfxBoolItem*)pOnItem)->GetValue()
+ : !Help::IsExtHelpActive();
+
+ // ausf"uhren
+ if ( bOn )
+ Help::StartExtHelp();
+ else
+ Help::EndExtHelp();
+ bDone = TRUE;
+
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( SID_EXTENDEDHELP, bOn) );
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_HELPBALLOONS:
+ {
+ // Parameter auswerten
+ SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPBALLOONS, FALSE);
+ FASTBOOL bOn = pOnItem
+ ? ((SfxBoolItem*)pOnItem)->GetValue()
+ : !Help::IsBalloonHelpEnabled();
+
+ // ausf"uhren
+ if ( bOn )
+ Help::EnableBalloonHelp();
+ else
+ Help::DisableBalloonHelp();
+ GetOptions().SetHelpBalloons(bOn);
+ bDone = TRUE;
+
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( SID_HELPBALLOONS, bOn) );
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_HELPTIPS:
+ {
+ // Parameter aus werten
+ SFX_REQUEST_ARG(rReq, pOnItem, SfxBoolItem, SID_HELPTIPS, FALSE);
+ FASTBOOL bOn = pOnItem
+ ? ((SfxBoolItem*)pOnItem)->GetValue()
+ : !Help::IsQuickHelpEnabled();
+
+ // ausf"uhren
+ if ( bOn )
+ Help::EnableQuickHelp();
+ else
+ Help::DisableQuickHelp();
+ GetOptions().SetHelpTips(bOn);
+ Invalidate(SID_HELPTIPS);
+ bDone = TRUE;
+
+ // ggf. recorden
+ if ( !rReq.IsAPI() )
+ rReq.AppendItem( SfxBoolItem( SID_HELPTIPS, bOn) );
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_HELPONHELP:
+ {
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ {
+ pHelp->Start( HELP_HELPONHELP );
+ bDone = TRUE;
+ }
+ break;
+ }
+(pb) what about help? */
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_ABOUT:
+ {
+ ModalDialog *pDlg = CreateAboutDialog();
+ pDlg->Execute();
+ delete pDlg;
+ bDone = TRUE;
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_ORGANIZER:
+ {
+ SfxTemplateOrganizeDlg *pDlg =
+ new SfxTemplateOrganizeDlg(GetTopWindow());
+ pDlg->Execute();
+ delete pDlg;
+ bDone = TRUE;
+ break;
+ }
+
+ case SID_BASICSTOP:
+ StarBASIC::Stop();
+ break;
+
+ case SID_BASICBREAK :
+ BASIC_DLL()->BasicBreak();
+ break;
+
+ case SID_CRASH :
+ {
+ Exception( EXC_SYSTEM );
+ abort();
+ }
+
+ default:
+ break;
+ }
+
+ if ( bDone )
+ rReq.Done();
+}
+
+//--------------------------------------------------------------------
+
+void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
+{
+ DBG_MEMTEST();
+
+ int bSearchedMDI = FALSE;
+ int bFoundNormMDI = FALSE;
+ int bFoundMiniMDI = FALSE;
+ int bFoundNonDesktopMDI = FALSE;
+
+ const USHORT *pRanges = rSet.GetRanges();
+ DBG_ASSERT(pRanges && *pRanges, "Set ohne Bereich");
+ while ( *pRanges )
+ {
+ for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
+ {
+ switch(nWhich)
+ {
+ case SID_EXITANDRETURN:
+ case SID_QUITAPP:
+ {
+ if ( pAppData_Impl->nDocModalMode )
+ rSet.DisableItem(nWhich);
+ else
+ {
+ SfxObjectShell *pDoc = pViewFrame ? pViewFrame->GetObjectShell() : 0;
+ SfxInPlaceObject *pIPObj = pDoc ? pDoc->GetInPlaceObject() : 0;
+ if (pIPObj && pIPObj->GetProtocol().IsEmbed() &&
+ !pIPObj->GetClient()->Owner())
+ {
+ String aEntry(SfxResId(STR_EXITANDRETURN));
+ aEntry += pIPObj->GetDocumentName();
+ rSet.Put(SfxStringItem(nWhich, aEntry));
+ }
+ else
+ rSet.Put(SfxStringItem(nWhich, String(SfxResId(STR_QUITAPP))));
+ }
+ break;
+ }
+
+ case SID_BASICSTOP:
+ if ( !StarBASIC::IsRunning() )
+ rSet.DisableItem(nWhich);
+ break;
+
+ case SID_PICK1:
+ case SID_PICK2:
+ case SID_PICK3:
+ case SID_PICK4:
+ case SID_PICK5:
+ case SID_PICK6:
+ case SID_PICK7:
+ case SID_PICK8:
+ case SID_PICK9: {
+ if ( ( nWhich - SID_PICK1 ) <
+ (USHORT)SfxPickList_Impl::Get()->GetAllowedMenuSize() )
+ rSet.Put( SfxStringItem( nWhich,
+ SfxPickList_Impl::Get()->GetMenuPickEntry(nWhich - SID_PICK1)->aTitle ) );
+ break;
+ }
+
+ case SID_CURRENTTIME:
+ {
+ rSet.Put( SfxStringItem( nWhich, Application::GetAppInternational().GetTime( Time(), FALSE ) ) );
+ break;
+ }
+ case SID_CURRENTDATE:
+ {
+ rSet.Put( SfxStringItem( nWhich, Application::GetAppInternational().GetDate( Date() ) ) );
+ break;
+ }
+
+ case SID_CONFIGTOOLBOX:
+ break;
+
+ case SID_HELPTIPS:
+ {
+/*! (pb) what about help?
+ rSet.Put( SfxBoolItem( SID_HELPTIPS, Help::IsQuickHelpEnabled() ) );
+*/
+ rSet.DisableItem( SID_HELPTIPS );
+ }
+ break;
+ case SID_HELPBALLOONS:
+ {
+/*! (pb) what about help?
+ short nHelpMode = ImplGetHelpMode();
+ if ( ( nHelpMode & HELPTEXTMODE_NORESHELPTEXT ) && !( nHelpMode & HELPTEXTMODE_EXTERN ) )
+ {
+ rSet.DisableItem( SID_HELPBALLOONS );
+ }
+ else
+ rSet.Put( SfxBoolItem( SID_HELPBALLOONS, Help::IsBalloonHelpEnabled() ) );
+*/
+ rSet.DisableItem( SID_HELPBALLOONS );
+ }
+ break;
+ case SID_EXTENDEDHELP:
+ {
+/*! (pb) what about help?
+ BOOL bExtHelp = Help::IsExtHelpActive();
+ // Wenn weder aus Resource noch aus Hilfesystem:
+ short nHelpMode = ImplGetHelpMode();
+ if ( ( nHelpMode & HELPTEXTMODE_NORESHELPTEXT ) &&
+ !( nHelpMode & HELPTEXTMODE_EXTERN ) )
+ bExtHelp = FALSE;
+ rSet.Put( SfxBoolItem( SID_EXTENDEDHELP, bExtHelp ) );
+*/
+ }
+ break;
+
+ case SID_CLOSEDOCS:
+ case SID_CLOSEWINS:
+ {
+ Reference < XTasksSupplier > xDesktop ( ::utl::getProcessServiceFactory()->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.Desktop") ), UNO_QUERY );
+ Reference< XIndexAccess > xTasks( xDesktop->getTasks(), UNO_QUERY );
+ if ( !xTasks.is() || !xTasks->getCount() )
+ rSet.DisableItem(nWhich);
+ break;
+ }
+
+ case SID_SAVEDOCS:
+ {
+ BOOL bModified = FALSE;
+ for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst();
+ pObjSh;
+ pObjSh = SfxObjectShell::GetNext( *pObjSh ) )
+ {
+ if ( pObjSh->IsModified() )
+ {
+ bModified = TRUE;
+ break;
+ }
+ }
+
+ if ( !bModified )
+ rSet.DisableItem( nWhich );
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+
+ ++pRanges;
+ }
+}
+
+
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
new file mode 100644
index 000000000000..2a20f16c6db7
--- /dev/null
+++ b/sfx2/source/appl/appuno.cxx
@@ -0,0 +1,1239 @@
+/*************************************************************************
+ *
+ * $RCSfile: appuno.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXRECTITEM_HXX //autogen
+#include <svtools/rectitem.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _WLDCRD_HXX //autogen
+#include <tools/wldcrd.hxx>
+#endif
+#ifndef _SV_CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _INET_CONFIG_HXX //autogen
+#include <inet/inetcfg.hxx>
+#endif
+#ifndef __SBX_SBXMETHOD_HXX
+#include <svtools/sbxmeth.hxx>
+#endif
+#ifndef _SB_SBMETH_HXX
+#include <basic/sbmeth.hxx>
+#endif
+#ifndef _SBX_SBXOBJECT_HXX
+#include <svtools/sbxobj.hxx>
+#endif
+#ifndef _SB_SBERRORS_HXX
+#include <basic/sberrors.hxx>
+#endif
+#ifndef _BASMGR_HXX
+#include <basic/basmgr.hxx>
+#endif
+
+#include <svtools/ownlist.hxx>
+#include <svtools/lckbitem.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/intitem.hxx>
+#include <svtools/eitem.hxx>
+
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HPP_
+#include <com/sun/star/frame/FrameActionEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTION_HPP_
+#include <com/sun/star/frame/FrameAction.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINER_HPP_
+#include <com/sun/star/container/XContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XINDEXCONTAINER_HPP_
+#include <com/sun/star/container/XIndexContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEREPLACE_HPP_
+#include <com/sun/star/container/XNameReplace.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XCONTAINERLISTENER_HPP_
+#include <com/sun/star/container/XContainerListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XSET_HPP_
+#include <com/sun/star/container/XSet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_CONTAINEREVENT_HPP_
+#include <com/sun/star/container/ContainerEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_
+#include <com/sun/star/container/XIndexReplace.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
+#include <com/sun/star/container/XNameContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XTOPWINDOW_HPP_
+#include <com/sun/star/awt/XTopWindow.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_
+#include <com/sun/star/awt/XWindow.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_
+#include <com/sun/star/awt/PosSize.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REGISTRY_REGISTRYVALUETYPE_HPP_
+#include <com/sun/star/registry/RegistryValueType.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
+#include <unotools/processfactory.hxx>
+#endif
+#ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_
+#include <com/sun/star/awt/PosSize.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_XBUTTON_HPP_
+#include <com/sun/star/awt/XButton.hpp>
+#endif
+
+#include <tools/cachestr.hxx>
+#include <osl/mutex.hxx>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::registry;
+using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::io;
+using namespace ::rtl;
+
+#pragma hdrstop
+
+#include "appuno.hxx"
+#include "urltrans.hxx"
+#include "sfxtypes.hxx"
+#include "sfxuno.hxx"
+#include "appdata.hxx"
+#include "app.hxx"
+#include "inimgr.hxx"
+#include "sfxsids.hrc"
+#include "msg.hxx"
+#include "msgpool.hxx"
+#include "request.hxx"
+#include "module.hxx"
+#include "downloadcontroller.hxx"
+#include "ucbhelp.hxx"
+#include "fcontnr.hxx"
+#include "frmload.hxx"
+#include "frame.hxx"
+#include "sfxbasic.hxx"
+
+#define FRAMELOADER_SERVICENAME "com.sun.star.frame.FrameLoader"
+
+void TestFunc( ::com::sun::star::util::URL aUrl );
+
+void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, SfxAllItemSet& rSet, const SfxSlot* pSlot )
+{
+ if ( !pSlot )
+ pSlot = SFX_SLOTPOOL().GetSlot( nSlotId );
+
+ if ( nSlotId == SID_OPENURL )
+ nSlotId = SID_OPENDOC;
+
+ sal_uInt16 nCount = rArgs.getLength();
+ const ::com::sun::star::beans::PropertyValue* pPropsVal = rArgs.getConstArray();
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n];
+ String aName = rProp.Name ;
+
+ sal_uInt16 nArgs;
+ for ( nArgs=0; nArgs<pSlot->nArgDefCount; nArgs++ )
+ {
+ const SfxFormalArgument* pArg = pSlot->pFirstArgDef + nArgs;
+ if ( aName.CompareToAscii(pArg->pName) == COMPARE_EQUAL )
+ {
+ SfxPoolItem* pItem = pArg->CreateItem();
+ pItem->SetWhich( pArg->nSlotId );
+ if ( pItem->PutValue( rProp.Value ) )
+ rSet.Put( *pItem );
+ delete pItem;
+ break;
+ }
+ }
+
+ if ( nArgs >= pSlot->nArgDefCount && nSlotId == SID_OPENDOC )
+ {
+ static const String sTemplateRegionName = String::CreateFromAscii( "TemplateRegionName" );
+ static const String sTemplateName = String::CreateFromAscii( "TemplateName" );
+ static const String sAsTemplate = String::CreateFromAscii( "AsTemplate" );
+ static const String sOpenNewView = String::CreateFromAscii( "OpenNewView" );
+ static const String sViewId = String::CreateFromAscii( "ViewId" );
+ static const String sPluginMode = String::CreateFromAscii( "PluginMode" );
+ static const String sReadOnly = String::CreateFromAscii( "ReadOnly" );
+ static const String sPostString = String::CreateFromAscii( "PostString" );
+ static const String sFrameName = String::CreateFromAscii( "FrameName" );
+ static const String sContentType = String::CreateFromAscii( "ContentType" );
+ static const String sPostData = String::CreateFromAscii( "PostData" );
+ static const String sPosSize = String::CreateFromAscii( "PosSize" );
+ static const String sCharacterSet = String::CreateFromAscii( "CharacterSet" );
+ static const String sInputStream = String::CreateFromAscii( "InputStream" );
+ static const String sHidden = String::CreateFromAscii( "Hidden" );
+ static const String sPreview = String::CreateFromAscii( "Preview" );
+
+ if ( aName == sInputStream && rProp.Value.getValueType() == ::getCppuType( (Reference < XInputStream >*)0 ) )
+ rSet.Put( SfxUsrAnyItem( SID_INPUTSTREAM, rProp.Value ) );
+
+ // AsTemplate-Property?
+ if ( aName == sAsTemplate && rProp.Value.getValueType() == ::getBooleanCppuType() )
+ rSet.Put( SfxBoolItem( SID_TEMPLATE, *((sal_Bool*)rProp.Value.getValue()) ) );
+
+ // OpenNewView-Parameter ?
+ else if ( aName == sOpenNewView && rProp.Value.getValueType() == ::getBooleanCppuType() )
+
+ rSet.Put( SfxBoolItem( SID_OPEN_NEW_VIEW, *((sal_Bool*)rProp.Value.getValue()) ) );
+
+ // ViewId-Parameter ?
+ else if ( aName == sViewId && rProp.Value.getValueType() == ::getCppuType((const sal_Int16*)0) )
+ rSet.Put( SfxUInt16Item( SID_VIEW_ID, *((sal_Int16*)rProp.Value.getValue()) ) );
+
+ // PluginMode-Parameter ?
+ else if ( aName == sPluginMode && rProp.Value.getValueType() == ::getCppuType((const sal_Int16*)0) )
+ rSet.Put( SfxUInt16Item( SID_PLUGIN_MODE, *((sal_Int16*)rProp.Value.getValue()) ) );
+
+ // ReadOnly-Property?
+ else if ( aName == sReadOnly && rProp.Value.getValueType() == ::getBooleanCppuType() )
+ rSet.Put( SfxBoolItem( SID_DOC_READONLY, *((sal_Bool*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sHidden && rProp.Value.getValueType() == ::getBooleanCppuType() )
+ rSet.Put( SfxBoolItem( SID_HIDDEN, *((sal_Bool*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sPreview && rProp.Value.getValueType() == ::getBooleanCppuType() )
+ rSet.Put( SfxBoolItem( SID_PREVIEW, *((sal_Bool*)rProp.Value.getValue()) ) );
+
+ // PostString-Property?
+ else if ( aName == sPostString && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ rSet.Put( SfxStringItem( SID_POSTSTRING, *((::rtl::OUString*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sFrameName && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ rSet.Put( SfxStringItem( SID_TARGETNAME, *((::rtl::OUString*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sContentType && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ rSet.Put( SfxStringItem( SID_CONTENTTYPE, *((::rtl::OUString*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sTemplateName && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ rSet.Put( SfxStringItem( SID_TEMPLATE_NAME, *((::rtl::OUString*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sTemplateRegionName && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ rSet.Put( SfxStringItem( SID_TEMPLATE_REGIONNAME, *((::rtl::OUString*)rProp.Value.getValue()) ) );
+
+ else if ( aName == sPostData && rProp.Value.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence<sal_Int8>*)0) )
+ {
+ SvCacheStream* pStream = new SvCacheStream;
+ ::com::sun::star::uno::Sequence<sal_Int8> aSequ = *((::com::sun::star::uno::Sequence<sal_Int8>*) rProp.Value.getValue());
+ pStream->Write( (void*) aSequ.getConstArray(), aSequ.getLength() );
+ SfxRefItem aItem( SID_POSTLOCKBYTES, new SvLockBytes( pStream, sal_True ) );
+ rSet.Put( aItem );
+ }
+
+ // PosSize-Property?
+ else if ( aName == sPosSize && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ {
+ String aPar = *((::rtl::OUString*)rProp.Value.getValue());
+ Size aSize;
+ Point aPos;
+ if ( SfxIniManager::GetPosSize( aPar, aPos, aSize ) )
+ rSet.Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle( aPos, aSize ) ) );
+ }
+
+ // CharacterSet-Property?
+ else if ( aName == sCharacterSet && rProp.Value.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ rSet.Put( SfxStringItem( SID_CHARSET, *((::rtl::OUString*)rProp.Value.getValue()) ) );
+ }
+ }
+}
+
+void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& rSet, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& rArgs, const SfxSlot* pSlot )
+{
+ if ( !pSlot )
+ pSlot = SFX_SLOTPOOL().GetSlot( nSlotId );
+
+ if ( nSlotId == SID_OPENURL )
+ nSlotId = SID_OPENDOC;
+
+ sal_uInt16 nArgs;
+ sal_uInt16 nItems=0;
+ for ( nArgs=0; nArgs<pSlot->nArgDefCount; nArgs++ )
+ {
+ const SfxFormalArgument* pArg = pSlot->pFirstArgDef + nArgs;
+ if ( rSet.GetItemState( pArg->nSlotId ) == SFX_ITEM_SET )
+ nItems++;
+ }
+
+ if ( nSlotId == SID_OPENDOC || nSlotId == SID_OPENURL )
+ {
+ if ( rSet.GetItemState( SID_INPUTSTREAM ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_TEMPLATE ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_OPEN_NEW_VIEW ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_VIEW_ID ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_PLUGIN_MODE ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_DOC_READONLY ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_POSTSTRING ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_CONTENTTYPE ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_VIEW_POS_SIZE ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_POSTLOCKBYTES ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_CHARSET ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_TARGETNAME ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_TEMPLATE_NAME ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_HIDDEN ) == SFX_ITEM_SET )
+ nItems++;
+ if ( rSet.GetItemState( SID_PREVIEW ) == SFX_ITEM_SET )
+ nItems++;
+ }
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> aSequ( nItems );
+ ::com::sun::star::beans::PropertyValue *pValue = aSequ.getArray();
+ for ( nArgs=0, nItems=0; nArgs<pSlot->nArgDefCount; nArgs++ )
+ {
+ const SfxFormalArgument* pArg = pSlot->pFirstArgDef + nArgs;
+ SFX_ITEMSET_ARG( &rSet, pItem, SfxPoolItem, pArg->nSlotId, sal_False );
+ if ( pItem )
+ {
+ pValue[nItems].Name = String( String::CreateFromAscii( pArg->pName ) ) ;
+ pItem->QueryValue( pValue[nItems++].Value );
+ }
+ }
+
+ if ( nSlotId == SID_OPENDOC || nSlotId == SID_OPENURL )
+ {
+ static const String sTemplateRegionName = String::CreateFromAscii( "TemplateRegionName" );
+ static const String sTemplateName = String::CreateFromAscii( "TemplateName" );
+ static const String sAsTemplate = String::CreateFromAscii( "AsTemplate" );
+ static const String sOpenNewView = String::CreateFromAscii( "OpenNewView" );
+ static const String sViewId = String::CreateFromAscii( "ViewId" );
+ static const String sPluginMode = String::CreateFromAscii( "PluginMode" );
+ static const String sReadOnly = String::CreateFromAscii( "ReadOnly" );
+ static const String sPostString = String::CreateFromAscii( "PostString" );
+ static const String sFrameName = String::CreateFromAscii( "FrameName" );
+ static const String sContentType = String::CreateFromAscii( "ContentType" );
+ static const String sPostData = String::CreateFromAscii( "PostData" );
+ static const String sPosSize = String::CreateFromAscii( "PosSize" );
+ static const String sCharacterSet = String::CreateFromAscii( "CharacterSet" );
+ static const String sInputStream = String::CreateFromAscii( "InputStream" );
+ static const String sHidden = String::CreateFromAscii( "Hidden" );
+ static const String sPreview = String::CreateFromAscii( "Preview" );
+
+ const SfxPoolItem *pItem=0;
+ if ( rSet.GetItemState( SID_INPUTSTREAM, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sInputStream;
+ pValue[nItems++].Value = ( ((SfxUsrAnyItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_TEMPLATE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sAsTemplate;
+ pValue[nItems++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_OPEN_NEW_VIEW, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sOpenNewView;
+ pValue[nItems++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_VIEW_ID, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sViewId;
+ pValue[nItems++].Value <<= ( (sal_uInt16) ((SfxUInt16Item*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_PLUGIN_MODE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sPluginMode;
+ pValue[nItems++].Value <<= ( (sal_uInt16) ((SfxUInt16Item*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_DOC_READONLY, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sReadOnly;
+ pValue[nItems++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_HIDDEN, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sHidden;
+ pValue[nItems++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_PREVIEW, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sPreview;
+ pValue[nItems++].Value <<= ( ((SfxBoolItem*)pItem)->GetValue() );
+ }
+ if ( rSet.GetItemState( SID_POSTSTRING, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sPostString;
+ pValue[nItems++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_TARGETNAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sFrameName;
+ pValue[nItems++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_CONTENTTYPE, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sContentType;
+ pValue[nItems++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_TEMPLATE_NAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sTemplateName;
+ pValue[nItems++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ if ( rSet.GetItemState( SID_TEMPLATE_REGIONNAME, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sTemplateRegionName;
+ pValue[nItems++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+
+ SFX_ITEMSET_ARG( &rSet, pRectItem, SfxRectangleItem, SID_VIEW_POS_SIZE, sal_False );
+ if ( pRectItem )
+ {
+ pValue[nItems].Name = sPosSize;
+ Rectangle aRect = pRectItem->GetValue();
+ pValue[nItems++].Value <<= ( ::rtl::OUString(SfxIniManager::GetString( aRect.TopLeft(), aRect.GetSize() ) ) );
+ }
+
+ SFX_ITEMSET_ARG( &rSet, pRefItem, SfxRefItem, SID_POSTLOCKBYTES, sal_False );
+ if ( pRefItem )
+ {
+ // Mit TLX-Spezialhack fuer die Pointercasts
+ pValue[nItems].Name = sPostData;
+ SvLockBytes* pBytes = new SvLockBytes;
+ int nDiff = (char*)pBytes - (char*)(SvRefBase*)pBytes;
+ SvLockBytes* pLB = (SvLockBytes*)(
+ (char*)(SvRefBase*)&((SfxRefItem*)pRefItem )->GetValue() + nDiff );
+ delete pBytes;
+ SfxLockBytesItem aLock( SID_POSTLOCKBYTES, pLB );
+ aLock.QueryValue( pValue[nItems++].Value );
+ }
+
+ if ( rSet.GetItemState( SID_CHARSET, sal_False, &pItem ) == SFX_ITEM_SET )
+ {
+ pValue[nItems].Name = sCharacterSet;
+ pValue[nItems++].Value <<= ( ::rtl::OUString(((SfxStringItem*)pItem)->GetValue()) );
+ }
+ }
+
+ rArgs = aSequ;
+}
+
+SV_IMPL_PTRARR( SfxComponentKeyArr_Impl, SfxComponentKeyPtr_Impl );
+
+// Implementation of XInterface, XTypeProvider, XServiceInfo, helper- and static-methods
+SFX_IMPL_XINTERFACE_1( SfxComponentFactory, OWeakObject, ::com::sun::star::lang::XMultiServiceFactory )
+SFX_IMPL_XTYPEPROVIDER_1( SfxComponentFactory, ::com::sun::star::lang::XMultiServiceFactory )
+SFX_IMPL_XSERVICEINFO( SfxComponentFactory, "com.sun.star.frame.FrameLoaderFactory", "com.sun.star.comp.sfx2.FrameLoaderFactory" )
+SFX_IMPL_ONEINSTANCEFACTORY( SfxComponentFactory )
+
+SfxComponentFactory::SfxComponentFactory( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > const &)
+{
+}
+
+SfxComponentFactory::~SfxComponentFactory()
+{
+}
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SfxComponentFactory::getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException )
+{
+ return ::com::sun::star::uno::Sequence < ::rtl::OUString >();
+}
+
+void SfxComponentFactory::Init_Impl()
+{
+// TRY
+ {
+ Reference< XPropertySet > xMan( ::utl::getProcessServiceFactory(), UNO_QUERY );
+ Any aAny = xMan->getPropertyValue( DEFINE_CONST_UNICODE("Registry") );
+ aAny >>= xRegistry;
+ if ( xRegistry.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRootKey = xRegistry->getRootKey();
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey = xRootKey->openKey( DEFINE_CONST_UNICODE("/Loader") );
+ if ( xKey.is() && xKey->getValueType() == ::com::sun::star::registry::RegistryValueType_ASCIILIST )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames = xKey->getAsciiListValue();
+ const ::rtl::OUString* pStr = aNames.getConstArray();
+ for ( sal_uInt32 n=0; n<aNames.getLength(); n++ )
+ {
+ ::rtl::OUString aKeyStr = DEFINE_CONST_UNICODE("/IMPLEMENTATIONS/");
+ aKeyStr += pStr[n];
+
+ SfxComponentKey_Impl *pEntry = new SfxComponentKey_Impl;
+ pEntry->aImplName = pStr[n];
+ ::rtl::OUString aTempStr = aKeyStr;
+ aTempStr += DEFINE_CONST_UNICODE("/Loader/Pattern");
+ xKey = xRootKey->openKey(aTempStr);
+ if ( xKey.is() )
+ {
+ ::com::sun::star::registry::RegistryValueType aType = xKey->getValueType();
+ switch ( aType )
+ {
+ case ::com::sun::star::registry::RegistryValueType_ASCII :
+ {
+ pEntry->aPatterns.Insert( new String( xKey->getAsciiValue() ), pEntry->aPatterns.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_STRING :
+ {
+ pEntry->aPatterns.Insert( new String( xKey->getStringValue() ), pEntry->aPatterns.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_ASCIILIST :
+ {
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > aKey = xKey->getAsciiListValue();
+ long nLen = aKey.getLength();
+ const ::rtl::OUString* pUStrings = aKey.getConstArray();
+ for ( long n=0; n<nLen; n++ )
+ pEntry->aPatterns.Insert( new String( pUStrings[n] ), pEntry->aPatterns.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_STRINGLIST :
+ {
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > aKey = xKey->getStringListValue();
+ long nLen = aKey.getLength();
+ const ::rtl::OUString* pUStrings = aKey.getConstArray();
+ for ( long n=0; n<nLen; n++ )
+ pEntry->aPatterns.Insert( new String( pUStrings[n] ), pEntry->aPatterns.Count() ) ;
+ break;
+ }
+ }
+ }
+
+ aTempStr = aKeyStr;
+ aTempStr += DEFINE_CONST_UNICODE("/Loader/Extension");
+ xKey = xRootKey->openKey(aTempStr);
+ if ( xKey.is() )
+ {
+ ::com::sun::star::registry::RegistryValueType aType = xKey->getValueType();
+ switch ( aType )
+ {
+ case ::com::sun::star::registry::RegistryValueType_ASCII :
+ {
+ pEntry->aExtensions.Insert( new String( xKey->getAsciiValue() ), pEntry->aExtensions.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_STRING :
+ {
+ pEntry->aExtensions.Insert( new String( xKey->getStringValue() ), pEntry->aExtensions.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_ASCIILIST :
+ {
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > aKey = xKey->getAsciiListValue();
+ long nLen = aKey.getLength();
+ const ::rtl::OUString* pUStrings = aKey.getConstArray();
+ for ( long n=0; n<nLen; n++ )
+ pEntry->aExtensions.Insert( new String( pUStrings[n] ), pEntry->aExtensions.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_STRINGLIST :
+ {
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > aKey = xKey->getStringListValue();
+ long nLen = aKey.getLength();
+ const ::rtl::OUString* pUStrings = aKey.getConstArray();
+ for ( long n=0; n<nLen; n++ )
+ pEntry->aExtensions.Insert( new String( pUStrings[n] ), pEntry->aExtensions.Count() ) ;
+ break;
+ }
+ }
+ }
+
+ aTempStr = aKeyStr;
+ aTempStr += DEFINE_CONST_UNICODE("/Loader/MimeType");
+ xKey = xRootKey->openKey(aTempStr);
+ if ( xKey.is() )
+ {
+ ::com::sun::star::registry::RegistryValueType aType = xKey->getValueType();
+ switch ( aType )
+ {
+ case ::com::sun::star::registry::RegistryValueType_ASCII :
+ {
+ pEntry->aMimeTypes.Insert( new String( xKey->getAsciiValue() ), pEntry->aMimeTypes.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_STRING :
+ {
+ pEntry->aMimeTypes.Insert( new String( xKey->getStringValue() ), pEntry->aMimeTypes.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_ASCIILIST :
+ {
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > aKey = xKey->getAsciiListValue();
+ long nLen = aKey.getLength();
+ const ::rtl::OUString* pUStrings = aKey.getConstArray();
+ for ( long n=0; n<nLen; n++ )
+ pEntry->aMimeTypes.Insert( new String( pUStrings[n] ), pEntry->aMimeTypes.Count() ) ;
+ break;
+ }
+ case ::com::sun::star::registry::RegistryValueType_STRINGLIST :
+ {
+ ::com::sun::star::uno::Sequence < ::rtl::OUString > aKey = xKey->getStringListValue();
+ long nLen = aKey.getLength();
+ const ::rtl::OUString* pUStrings = aKey.getConstArray();
+ for ( long n=0; n<nLen; n++ )
+ pEntry->aMimeTypes.Insert( new String( pUStrings[n] ), pEntry->aMimeTypes.Count() ) ;
+ break;
+ }
+ }
+ }
+
+ aKeyArr.Insert( pEntry, n );
+ }
+ }
+ }
+ }
+/*
+ CATCH ( OUnoException, e )
+ {
+ }
+ END_CATCH;
+*/
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxComponentFactory::createInstance( const ::rtl::OUString& aURL ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+ return CreateInstance_Impl( aURL, NULL );
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxComponentFactory::createInstanceWithArguments( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aSequ;
+ if ( Arguments.getLength() )
+ {
+ const ::com::sun::star::uno::Any aAny = Arguments.getConstArray()[0];
+ if ( aAny.getValueType() == ::getCppuType((const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >*)0) )
+ aAny >>= aSequ ;
+ }
+
+ return CreateInstance_Impl( aURL, &aSequ );
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxComponentFactory::CreateInstance_Impl( const ::rtl::OUString& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >* pArguments )
+{
+ if ( !xRegistry.is() )
+ {
+ Init_Impl();
+ }
+
+ String aName( aURL );
+ Any aAny( UCB_Helper::GetProperty( aName, WID_FLAG_IS_FOLDER ) );
+ BOOL bIsFolder = FALSE;
+ if ( ( aAny >>= bIsFolder ) && bIsFolder )
+ {
+ Reference< XFrameLoader > xLoader;
+#ifdef WNT
+ SfxIniManager* pIni = SfxIniManager::Get();
+ if( !Application::IsRemoteServer() && pIni->IsInternetExplorerAvailable() )
+ xLoader = Reference< XFrameLoader >( createInstance( DEFINE_CONST_UNICODE("private:iexplorer") ), ::com::sun::star::uno::UNO_QUERY );
+ if ( !xLoader.is() )
+#endif
+ xLoader = Reference< XFrameLoader >( createInstance( DEFINE_CONST_UNICODE(".component:Text") ), ::com::sun::star::uno::UNO_QUERY );
+ return xLoader;
+ }
+
+ if ( xRegistry.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ sal_uInt16 nCount = aKeyArr.Count();
+ sal_uInt16 n;
+ for ( n=0; n<nCount; n++ )
+ {
+ SfxComponentKey_Impl* pEntry = aKeyArr[n];
+ sal_uInt16 nLen = pEntry->aPatterns.Count();
+ for ( sal_uInt16 n=0; n<nLen; n++ )
+ {
+ if ( WildCard( *pEntry->aPatterns[n] ).Matches( aName ) )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > xLoader( xMan->createInstance( pEntry->aImplName ), ::com::sun::star::uno::UNO_QUERY );
+ if ( xLoader.is() )
+ return xLoader;
+ }
+ }
+ }
+
+ INetURLObject aObject( aName );
+ String aExt( aObject.GetExtension() );
+ if ( aExt.Len() )
+ {
+ for ( n=0; n<nCount; n++ )
+ {
+ SfxComponentKey_Impl* pEntry = aKeyArr[n];
+ sal_uInt16 nLen = pEntry->aExtensions.Count();
+ for ( long n=0; n<nLen; n++ )
+ {
+ if ( *pEntry->aExtensions[n] == aExt )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > xLoader( xMan->createInstance( pEntry->aImplName ), ::com::sun::star::uno::UNO_QUERY );
+ if ( xLoader.is() )
+ return xLoader;
+ }
+ }
+ }
+ }
+ }
+
+ return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ();
+}
+
+#if 0 // (mba)
+#ifdef SOLAR_JAVA
+SFX_IMPL_XINTERFACE_1( SfxJavaLoader, OWeakObject, ::com::sun::star::frame::XFrameLoader )
+SFX_IMPL_XTYPEPROVIDER_1( SfxJavaLoader, ::com::sun::star::frame::XFrameLoader )
+SFX_IMPL_XSERVICEINFO( SfxJavaLoader, FRAMELOADER_SERVICENAME, "com.sun.star.comp.sfx2.JavaLoader" )
+SFX_IMPL_SINGLEFACTORY( SfxJavaLoader )
+
+void SAL_CALL SfxJavaLoader::load(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & rFrame, const ::rtl::OUString& rURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLoadEventListener > & rListener) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ xFrame = rFrame;
+ xListener = rListener;
+ aURL.Complete = rURL;
+ aArgs = rArgs;
+
+ SfxURLTransformer aTrans ( ::utl::getProcessServiceFactory() );
+ aTrans.parseStrict( aURL );
+
+ String aName( aURL.Path );
+ aName.Erase( 0,5 ); // java/
+
+ SvCommandList aList;
+ String aParam( aURL.Arguments );
+ aParam += ' ';
+ if ( aParam.Len() )
+ {
+ const char* pStr = aParam.GetBuffer();
+ const char* pStart = pStr;
+ sal_Bool bEscaped = sal_False, bSeparated = sal_True;
+
+ while ( *pStr )
+ {
+ if ( *pStr != ' ' || bEscaped )
+ {
+ if ( *pStr == '"' )
+ {
+ if ( *(pStr+1) != '"' )
+ bEscaped = ! bEscaped;
+ else
+ pStr++;
+ }
+
+ bSeparated = sal_False;
+ }
+ else
+ {
+ if ( !bSeparated )
+ {
+ String aPar( pStart, pStr-pStart );
+ pStart = pStr+1;
+ bSeparated = sal_True;
+
+ if ( aPar.GetTokenCount( '=' ) > 1 )
+ {
+ String aName = aPar.GetToken( 0, '=' );
+ aPar.Erase( 0, aName.Len() + 1 );
+ aList.Append( aName, aPar );
+ }
+ else
+ aList.Append( aPar, "" );
+ }
+ }
+
+ pStr++;
+ }
+ }
+
+ pApp = new JavaApplication;
+ pApp->Init(aName, aList, this);
+// pApp = new JavaApplication( aName, aList, this );
+}
+
+// -----------------------------------------------------------------------
+
+void SAL_CALL SfxJavaLoader::cancel(void) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ if ( pApp )
+ pApp->cancel();
+ xListener = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLoadEventListener > ();
+ xFrame = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > ();
+}
+
+// -----------------------------------------------------------------------
+
+void SfxJavaLoader::status( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xObject, short nObjectType )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xComp;
+
+ if ( ( nObjectType == OBJECTTYPE_AWTCOMPONENT || nObjectType == OBJECTTYPE_AWTAPPLET ) && xObject.is() )
+ xComp = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > ( xObject, ::com::sun::star::uno::UNO_QUERY );
+
+ if ( xComp.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xCtrl( xComp, ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer( xFrame->getContainerWindow(), ::com::sun::star::uno::UNO_QUERY );
+#if SUPD > 582
+ xCtrl->createPeer( Application::GetVCLToolkit(), xPeer );
+#endif
+ xComp->setPosSize( 0, 0, 100, 100, PosSize_POSSIZE );
+ xFrame->setComponent( xComp, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > () );
+ }
+
+ LoadFinished( xComp.is() );
+}
+
+void SfxJavaLoader::abort( const String & rReason )
+{
+ DELETEZ( pApp );
+ LoadFinished( sal_False );
+}
+
+void SfxJavaLoader::LoadFinished( sal_Bool bOK )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > xRef( this );
+ DELETEZ( pApp );
+
+ if ( bOK )
+ xListener->loadFinished( this );
+ else
+ xListener->loadCancelled( this );
+}
+
+#endif
+#endif // (mba)
+/*
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxLoaderFactory::createInstance(const ::rtl::OUString& ServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+}
+
+SFX_IMPL_UNO_OBJECT_1( SfxLoaderFactory, "LoaderFactory", ::com::sun::star::lang::XMultiServiceFactory );
+
+SfxLoaderFactory::SfxLoaderFactory()
+{
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxLoaderFactory::createInstanceWithArguments(const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+ return xRet;
+}
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SfxLoaderFactory::getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException )
+{
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aRet(9);
+ ::rtl::OUString *pArr = aRet.getArray();
+ pArr[0] = "ftp:";
+ pArr[1] = "http:";
+ pArr[2] = "https:";
+ pArr[3] = "file:";
+ pArr[4] = "news:";
+ pArr[5] = "staroffice.private:";
+ pArr[6] = "imap:";
+ pArr[7] = "pop3:";
+ pArr[8] = "vim:";
+
+ return aRet;
+}
+*/
+SFX_IMPL_XINTERFACE_1( DownloaderLoader, OWeakObject, ::com::sun::star::frame::XFrameLoader )
+SFX_IMPL_XTYPEPROVIDER_1( DownloaderLoader, ::com::sun::star::frame::XFrameLoader )
+SFX_IMPL_XSERVICEINFO( DownloaderLoader, FRAMELOADER_SERVICENAME, "com.sun.star.comp.sfx2.DownloaderLoader" )
+SFX_IMPL_SINGLEFACTORY( DownloaderLoader )
+
+// -----------------------------------------------------------------------
+void SAL_CALL DownloaderLoader::load ( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & rFrame ,
+ const ::rtl::OUString& rURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLoadEventListener > & rListener ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > aRef = rFrame->getContainerWindow () ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() ) ;
+
+ DownloadController* pController = new DownloadController(xMgr) ;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xController = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > ( pController ) ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > xControl ( xMgr->createInstance (DEFINE_CONST_UNICODE("com.sun.star.awt.XProgressMonitor") ), ::com::sun::star::uno::UNO_QUERY ) ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow ( xControl , ::com::sun::star::uno::UNO_QUERY ) ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer ( aRef , ::com::sun::star::uno::UNO_QUERY ) ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XButton > xButton ( xControl , ::com::sun::star::uno::UNO_QUERY ) ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener > xActionListener ( xController , ::com::sun::star::uno::UNO_QUERY ) ;
+
+ DBG_ASSERT ( xControl.is() , "DownloaderLoader::load(..)\nXProgressMonitor has no valid interface ::com::sun::star::awt::XControl!\n" ) ;
+ DBG_ASSERT ( xWindow.is() , "DownloaderLoader::load(..)\nXProgressMonitor has no valid interface ::com::sun::star::awt::XWindow!\n" ) ;
+ DBG_ASSERT ( xPeer.is() , "DownloaderLoader::load(..)\nXFrame->getContainerWindow() has no valid interface ::com::sun::star::awt::XWindowPeer!\n" ) ;
+ DBG_ASSERT ( xButton.is() , "DownloaderLoader::load(..)\nXProgressMonitor has no valid interface ::com::sun::star::awt::XButton!\n" ) ;
+ DBG_ASSERT ( xActionListener.is(), "DownloaderLoader::load(..)\nDownloadController has no valid interface ::com::sun::star::awt::XActionListener!\n" ) ;
+
+ // dont't forget to create peer BEFORE call "setComponent" at FRAME !!!
+ // (else frame calls this method without valid toolkit and parent!!! => CRASH )
+ xControl->createPeer ( xPeer->getToolkit(), xPeer ) ;
+
+ // try to start download
+ String aTempURL = rURL ;
+ sal_Bool bOK = pController->StartDownload ( aTempURL ) ;
+ if ( bOK)
+ {
+ rFrame->setComponent ( xWindow, xController );
+ xController->attachFrame ( rFrame );
+ xButton->addActionListener ( xActionListener );
+ xButton->setActionCommand ( DEFINE_CONST_UNICODE("BreakDownload") );
+
+ if ( rListener.is() )
+ rListener->loadFinished (this) ;
+ }
+ else if (rListener.is() )
+ // no download - no download monitor !
+ rListener->loadCancelled( this ) ;
+}
+
+// -----------------------------------------------------------------------
+DownloaderLoader::DownloaderLoader( com::sun::star::uno::Reference < class com::sun::star::lang::XMultiServiceFactory > const &)
+{
+}
+
+// -----------------------------------------------------------------------
+DownloaderLoader::~DownloaderLoader()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SAL_CALL DownloaderLoader::cancel(void) throw ( ::com::sun::star::uno::RuntimeException )
+{
+}
+
+SFX_IMPL_XINTERFACE_1( SfxMacroLoader, OWeakObject, ::com::sun::star::frame::XFrameLoader )
+SFX_IMPL_XTYPEPROVIDER_1( SfxMacroLoader, ::com::sun::star::frame::XFrameLoader )
+SFX_IMPL_XSERVICEINFO( SfxMacroLoader, FRAMELOADER_SERVICENAME, "com.sun.star.comp.sfx2.SfxMacroLoader" )
+SFX_IMPL_SINGLEFACTORY( SfxMacroLoader )
+
+// -----------------------------------------------------------------------
+void SAL_CALL SfxMacroLoader::load ( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & rFrame ,
+ const ::rtl::OUString& rURL,
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs ,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLoadEventListener > & rListener ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ SfxApplication* pApp = SFX_APP();
+ pApp->EnterBasicCall();
+
+ // macro:-::com::sun::star::util::URL analysiern
+ // 'macro://#lib.mod.proc(args)' => Macro via App-BASIC-Mgr
+ // 'macro:#lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr
+ // 'macro:obj.method(args)' => Object via App-BASIC-Mgr
+ String aMacro( rURL );
+ sal_uInt16 nHashPos = aMacro.Search( '#' );
+ sal_uInt16 nArgsPos = aMacro.Search( '(' );
+ BasicManager *pBasMgr = 0;
+ ErrCode nErr = ERRCODE_NONE;
+
+ // wird Macro angesprochen (also KEIN Object)?
+ if ( STRING_NOTFOUND != nHashPos && nHashPos < nArgsPos )
+ {
+ // BasManager ermitteln
+ String aBasMgrName( INetURLObject::decode(aMacro.Copy( 6, nHashPos-6 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
+ if ( aBasMgrName.EqualsAscii("//") )
+ pBasMgr = pApp->GetBasicManager();
+ else if ( !aBasMgrName.Len() )
+ pBasMgr = SfxObjectShell::Current()->GetBasicManager();
+ else
+ for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst();
+ pObjSh && !pBasMgr;
+ pObjSh = SfxObjectShell::GetNext(*pObjSh) )
+ if ( aBasMgrName == pObjSh->GetTitle(SFX_TITLE_APINAME) )
+ pBasMgr = pObjSh->GetBasicManager();
+ if ( pBasMgr )
+ {
+ // Funktion suchen
+ String aQualifiedMethod( INetURLObject::decode(aMacro.Copy( nHashPos+1 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
+ String aArgs;
+ if ( STRING_NOTFOUND != nArgsPos )
+ {
+ aArgs = aQualifiedMethod.Copy( nArgsPos - nHashPos - 1 );
+ aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 );
+ }
+
+ SbxMethod *pMethod = SfxQueryMacro( pBasMgr, aQualifiedMethod );
+
+ // falls gefunden Funktion ueber ihren Parent ausfuehren
+ if ( pMethod )
+ {
+ String aQuotedArgs;
+ if ( aArgs.Len()<2 || aArgs.GetBuffer()[1] == '\"')
+ aQuotedArgs = aArgs;
+ else
+ {
+ // Klammern entfernen
+ aArgs.Erase(0,1);
+ aArgs.Erase( aArgs.Len()-1,1);
+
+ aQuotedArgs = '(';
+
+ // Alle Parameter mit T"uddelchen
+ sal_uInt16 nCount = aArgs.GetTokenCount(',');
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ aQuotedArgs += '\"';
+ aQuotedArgs += aArgs.GetToken( n, ',' );
+ aQuotedArgs += '\"';
+ if ( n<nCount-1 )
+ aQuotedArgs += ',';
+ }
+
+ aQuotedArgs += ')';
+ }
+
+ String aCall( '[' );
+ aCall += pMethod->GetName();
+ aCall += aQuotedArgs;
+ aCall += ']';
+ pMethod->GetParent()->Execute( aCall );
+ nErr = SbxBase::GetError();
+ }
+ else
+ nErr = ERRCODE_BASIC_PROC_UNDEFINED;
+ }
+ else
+ nErr = ERRCODE_IO_NOTEXISTS;
+ }
+ else
+ {
+ // (optional Objekt-qualifizierte) Basic-Funktion ausfuehren
+ String aCall( '[' );
+ aCall += INetURLObject::decode(aMacro.Copy(6), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET);
+ aCall += ']';
+ pApp->GetBasicManager()->GetLib(0)->Execute( aCall );
+ nErr = SbxBase::GetError();
+ }
+
+ pApp->LeaveBasicCall();
+ SbxBase::ResetError();
+ if ( rListener.is() )
+ {
+ if( nErr == ERRCODE_NONE )
+ rListener->loadFinished (this) ;
+ else
+ rListener->loadCancelled( this ) ;
+ }
+}
+
+// -----------------------------------------------------------------------
+SfxMacroLoader::SfxMacroLoader( com::sun::star::uno::Reference < class com::sun::star::lang::XMultiServiceFactory > const &)
+{
+}
+
+// -----------------------------------------------------------------------
+SfxMacroLoader::~SfxMacroLoader()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SAL_CALL SfxMacroLoader::cancel(void) throw ( ::com::sun::star::uno::RuntimeException )
+{
+}
+
+
+
+// -----------------------------------------------------------------------
+
+extern "C" {
+
+void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvironmentTypeName ,
+ uno_Environment** ppEnvironment )
+{
+ *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
+}
+
+sal_Bool SAL_CALL component_writeInfo( void* pServiceManager ,
+ void* pRegistryKey )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey( reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( pRegistryKey ) ) ;
+
+ // Eigentliche Implementierung und ihre Services registrieren
+ ::rtl::OUString aImpl;
+ ::rtl::OUString aTempStr;
+ ::rtl::OUString aKeyStr;
+ Reference< XRegistryKey > xNewKey;
+ Reference< XRegistryKey > xLoaderKey;
+
+ aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ aImpl += DownloaderLoader::impl_getStaticImplementationName();
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
+ xNewKey = xKey->createKey( aTempStr );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.FrameLoader") );
+
+ aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ aImpl += SfxFrameLoader_Impl::impl_getStaticImplementationName();
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
+ xNewKey = xKey->createKey( aTempStr );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.FrameLoader") );
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/Loader"));
+ xNewKey = xKey->createKey( aTempStr );
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/Loader"));
+ xLoaderKey = xKey->createKey( aTempStr );
+ xNewKey = xLoaderKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pattern")) );
+ xNewKey->setAsciiValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:factory/*" )) );
+
+ aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ aImpl += SfxFilterDetect_Impl::impl_getStaticImplementationName();
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
+ xNewKey = xKey->createKey( aTempStr );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.ExtendedFilterDetect") );
+
+ aImpl = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
+ aImpl += SfxMacroLoader::impl_getStaticImplementationName();
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES"));
+ xNewKey = xKey->createKey( aTempStr );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii("com.sun.star.frame.FrameLoader") );
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/Loader"));
+ xNewKey = xKey->createKey( aTempStr );
+
+ aTempStr = aImpl;
+ aTempStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/Loader"));
+ xLoaderKey = xKey->createKey( aTempStr );
+ xNewKey = xLoaderKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pattern")) );
+ xNewKey->setAsciiValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("macro:*" )) );
+
+ return True;
+}
+
+void* SAL_CALL component_getFactory( const sal_Char* pImplementationName ,
+ void* pServiceManager ,
+ void* pRegistryKey )
+{
+ // Set default return value for this operation - if it failed.
+ void* pReturn = NULL ;
+
+ if (
+ ( pImplementationName != NULL ) &&
+ ( pServiceManager != NULL )
+ )
+ {
+ // Define variables which are used in following macros.
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xFactory ;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager( reinterpret_cast< ::com::sun::star::lang::XMultiServiceFactory* >( pServiceManager ) ) ;
+
+ //=============================================================================
+ // Add new macro line to handle new service.
+ //
+ // !!! ATTENTION !!!
+ // Write no ";" at end of line and dont forget "else" ! (see macro)
+ //=============================================================================
+ IF_NAME_CREATECOMPONENTFACTORY( DownloaderLoader )
+ IF_NAME_CREATECOMPONENTFACTORY( SfxFrameLoader_Impl )
+ IF_NAME_CREATECOMPONENTFACTORY( SfxFilterDetect_Impl )
+ IF_NAME_CREATECOMPONENTFACTORY( SfxMacroLoader )
+
+ // Factory is valid - service was found.
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pReturn = xFactory.get();
+ }
+ }
+
+ // Return with result of this operation.
+ return pReturn ;
+}
+} // extern "C"
+
+
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
new file mode 100644
index 000000000000..99ae007dae5b
--- /dev/null
+++ b/sfx2/source/appl/childwin.cxx
@@ -0,0 +1,679 @@
+/*************************************************************************
+ *
+ * $RCSfile: childwin.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _TOOLBOX_HXX //autogen
+#include <vcl/toolbox.hxx>
+#endif
+#ifndef _RCID_H
+#include <vcl/rcid.h>
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+
+#pragma hdrstop
+
+#include "childwin.hxx"
+#include "app.hxx"
+#include "arrdecl.hxx"
+#include "bindings.hxx"
+#include "module.hxx"
+#include "dockwin.hxx"
+#include "dispatch.hxx"
+#include "appdata.hxx"
+#include <workwin.hxx>
+
+static const sal_uInt16 nVersion = 1;
+
+DBG_NAME(SfxChildWindow)
+
+SV_IMPL_PTRARR( SfxChildWinContextArr_Impl, SfxChildWinContextFactory* );
+
+struct SfxChildWindow_Impl
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame;
+ SfxChildWinFactory* pFact;
+ sal_Bool bHideNotDelete;
+ sal_Bool bVisible;
+ sal_Bool bHideAtToggle;
+ SfxModule* pContextModule;
+ SfxWorkWindow* pWorkWin;
+};
+
+//=========================================================================
+SfxChildWindow::SfxChildWindow(Window *pParentWindow, sal_uInt16 nId)
+ : pParent(pParentWindow)
+ , eChildAlignment(SFX_ALIGN_NOALIGNMENT)
+ , nType(nId)
+ , pWindow(0L)
+{
+ pImp = new SfxChildWindow_Impl;
+ pImp->pFact = 0L;
+ pImp->bHideNotDelete = sal_False;
+ pImp->bHideAtToggle = sal_False;
+ pImp->bVisible = sal_True;
+ pImp->pContextModule = NULL;
+ pImp->pWorkWin = NULL;
+
+ pContext = 0L;
+ DBG_CTOR(SfxChildWindow,0);
+}
+
+//-------------------------------------------------------------------------
+SfxChildWindow::~SfxChildWindow()
+{
+ DBG_DTOR(SfxChildWindow,0);
+ if ( pContext )
+ delete pContext;
+ delete pWindow;
+ delete pImp;
+}
+
+//-------------------------------------------------------------------------
+SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId,
+ Window *pParent, SfxBindings* pBindings, SfxChildWinInfo& rInfo)
+{
+ SfxChildWindow *pChild=0;
+ SfxChildWinFactory* pFact=0;
+ sal_uInt16 nOldMode = Application::GetSystemWindowMode();
+
+ // Zuerst ChildWindow im SDT suchen; "Uberlagerungen m"ussen mit einem
+ // ChildWindowContext realisiert werden
+ SfxApplication *pApp = SFX_APP();
+ SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl();
+ for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ {
+ pFact = rFactories[nFactory];
+ if ( pFact->nId == nId )
+ {
+ SfxChildWinInfo& rFactInfo = pFact->aInfo;
+ if ( rInfo.bVisible )
+ {
+ if ( pBindings )
+ pBindings->ENTERREGISTRATIONS();
+ rFactInfo.nFlags |= rInfo.nFlags & SFX_CHILDWIN_FORCEDOCK;
+ SfxChildWinInfo aInfo = rFactInfo;
+ Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_NOAUTOMODE );
+ pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo );
+ Application::SetSystemWindowMode( nOldMode );
+ rFactInfo.nFlags &= ~(rInfo.nFlags & SFX_CHILDWIN_FORCEDOCK );
+ if ( pBindings )
+ pBindings->LEAVEREGISTRATIONS();
+ }
+
+ break;
+ }
+ }
+
+ SfxDispatcher *pDisp = pBindings->GetDispatcher_Impl();
+ SfxModule *pMod = pDisp ? pApp->GetActiveModule( pDisp->GetFrame() ) :0;
+ if ( !pChild && pMod )
+ {
+ SfxChildWinFactArr_Impl *pFactories = pMod->GetChildWinFactories_Impl();
+ if ( pFactories )
+ {
+ SfxChildWinFactArr_Impl &rFactories = *pFactories;
+ for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ {
+ pFact = rFactories[nFactory];
+ if ( pFact->nId == nId )
+ {
+ SfxChildWinInfo& rFactInfo = pFact->aInfo;
+ if ( rInfo.bVisible )
+ {
+ if ( pBindings )
+ pBindings->ENTERREGISTRATIONS();
+ rFactInfo.nFlags |= rInfo.nFlags & SFX_CHILDWIN_FORCEDOCK;
+ SfxChildWinInfo aInfo = rFactInfo;
+ Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_NOAUTOMODE );
+ pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo );
+ Application::SetSystemWindowMode( nOldMode );
+ rFactInfo.nFlags &= ~(rInfo.nFlags & SFX_CHILDWIN_FORCEDOCK );
+ if ( pBindings )
+ pBindings->LEAVEREGISTRATIONS();
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ if ( pChild )
+ pChild->SetFactory_Impl( pFact );
+
+ DBG_ASSERT(pFact && (pChild || !rInfo.bVisible), "ChildWindow-Typ nicht registriert!");
+
+ if ( pChild && !pChild->pWindow )
+ {
+ DELETEZ(pChild);
+ DBG_WARNING("ChildWindow hat kein Fenster!");
+ }
+
+ return pChild;
+}
+
+//-------------------------------------------------------------------------
+void SfxChildWindow::SaveStatus(const SfxChildWinInfo& rInfo)
+{
+// if ( SFX_APP()->Get_Impl()->bBean )
+// return;
+
+ SfxIniManager *pIniMgr = SFX_INIMANAGER();
+ char cToken = pIniMgr->GetToken();;
+ String aWinData('V');
+ aWinData += String::CreateFromInt32( nVersion );
+ aWinData += cToken;
+ aWinData += String( pIniMgr->GetString( rInfo.aPos, rInfo.aSize ) );
+ aWinData += cToken;
+ aWinData += rInfo.bVisible ? 'V' : 'H';
+ aWinData += cToken;
+ aWinData += String::CreateFromInt32(rInfo.nFlags);
+ if ( rInfo.aExtraString.Len() )
+ {
+ aWinData += cToken;
+ aWinData += rInfo.aExtraString;
+ }
+ pIniMgr->Set( aWinData, SFX_KEY_WINDOW, GetType() );
+ pImp->pFact->aInfo = rInfo;
+}
+
+//-------------------------------------------------------------------------
+void SfxChildWindow::SetAlignment(SfxChildAlignment eAlign)
+{
+ DBG_CHKTHIS(SfxChildWindow,0);
+
+ eChildAlignment = eAlign;
+}
+
+//-------------------------------------------------------------------------
+void SfxChildWindow::SetPosSizePixel(const Point& rPoint, Size& rSize)
+{
+ DBG_CHKTHIS(SfxChildWindow,0);
+
+ pWindow->SetPosSizePixel(rPoint, rSize);
+}
+
+//-------------------------------------------------------------------------
+SfxChildWinInfo SfxChildWindow::GetInfo() const
+{
+ DBG_CHKTHIS(SfxChildWindow,0);
+
+ SfxChildWinInfo aInfo;
+ aInfo.aPos = pWindow->GetPosPixel();
+ aInfo.aSize = pWindow->GetSizePixel();
+ aInfo.bVisible = pImp->bVisible;
+ aInfo.nFlags = 0;
+ return aInfo;
+}
+
+//-------------------------------------------------------------------------
+sal_uInt16 SfxChildWindow::GetPosition()
+{
+ return pImp->pFact->nPos;
+}
+
+//-------------------------------------------------------------------------
+void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWinInfo& rInfo )
+{
+ // Konfiguration aus Ini-Manager laden
+ SfxIniManager *pAppIniMgr = SFX_APP()->GetAppIniManager();
+ String aWinData( pAppIniMgr->Get( SFX_KEY_WINDOW, nId ) );
+
+ if ( /*!SFX_APP()->Get_Impl()->bBean && */ aWinData.Len() )
+ {
+ // Nach Versionskennung suchen
+ if ( aWinData.GetChar((sal_uInt16)0) != 0x0056 ) // 'V' = 56h
+ // Keine Versionskennung, daher nicht verwenden
+ return;
+
+ // 'V' l"oschen
+ aWinData.Erase(0,1);
+
+ // Version lesen
+ char cToken = pAppIniMgr->GetToken();
+ sal_uInt16 nPos = aWinData.Search( cToken );
+ sal_uInt16 nVersion = (sal_uInt16) aWinData.Copy( 0, nPos+1 ).ToInt32();
+ aWinData.Erase(0,nPos+1);
+
+ // Gr"o\se und Position laden
+ Point aPos;
+ Size aSize;
+ if ( pAppIniMgr->GetPosSize(
+ aWinData.Copy( 0 , aWinData.Search( cToken ) ),
+ aPos, aSize ) )
+ {
+ rInfo.aPos = aPos;
+ rInfo.aSize = aSize;
+ }
+ aWinData.Erase(0,aWinData.Search(cToken));
+
+ // Sichtbarkeit laden: ist als ein char codiert
+ rInfo.bVisible = (aWinData.Copy(1,1) == 0x0056); // 'V' = 56h
+ aWinData.Erase(1,1);
+
+ nPos = aWinData.Search( pAppIniMgr->GetToken(), 2 );
+ if (nPos != STRING_NOTFOUND)
+ {
+ // es gibt noch Extra-Information
+ rInfo.nFlags = aWinData.Copy( 2 , nPos-2 ).ToInt32();
+ aWinData.Erase(2,nPos-2);
+ rInfo.aExtraString = aWinData.Copy( 3 );
+ aWinData.Erase(3);
+ }
+ else
+ {
+ // Zeile ist nach Flags zu Ende
+ rInfo.nFlags = aWinData.Copy( 2 ).ToInt32();
+ aWinData.Erase(2);
+ }
+ }
+
+// if ( SFX_APP()->Get_Impl()->bBean )
+// {
+// if ( rInfo.bVisible != 42 )
+// rInfo.bVisible = sal_False;
+// }
+}
+
+void SfxChildWindow::CreateContext( sal_uInt16 nContextId, SfxBindings& rBindings )
+{
+ SfxChildWindowContext *pCon = NULL;
+ SfxChildWindow *pChild=0;
+ SfxChildWinFactory* pFact=0;
+ SfxApplication *pApp = SFX_APP();
+ SfxDispatcher *pDisp = rBindings.GetDispatcher_Impl();
+ SfxModule *pMod = pDisp ? pApp->GetActiveModule( pDisp->GetFrame() ) :0;
+ if ( pMod )
+ {
+ SfxChildWinFactArr_Impl *pFactories = pMod->GetChildWinFactories_Impl();
+ if ( pFactories )
+ {
+ SfxChildWinFactArr_Impl &rFactories = *pFactories;
+ for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ {
+ pFact = rFactories[nFactory];
+ if ( pFact->nId == GetType() )
+ {
+ DBG_ASSERT( pFact->pArr, "Kein Kontext angemeldet!" );
+ if ( !pFact->pArr )
+ break;
+
+ SfxChildWinContextFactory *pConFact=0;
+ for ( sal_uInt16 n=0; n<pFact->pArr->Count(); ++n )
+ {
+ pConFact = (*pFact->pArr)[n];
+ rBindings.ENTERREGISTRATIONS();
+ if ( pConFact->nContextId == nContextId )
+ {
+ SfxChildWinInfo aInfo = pFact->aInfo;
+ pCon = pConFact->pCtor( GetWindow(), &rBindings, &aInfo );
+ pCon->nContextId = pConFact->nContextId;
+ pImp->pContextModule = pMod;
+ }
+ rBindings.LEAVEREGISTRATIONS();
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ if ( !pCon )
+ {
+ SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl();
+ for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ {
+ pFact = rFactories[nFactory];
+ if ( pFact->nId == GetType() )
+ {
+ DBG_ASSERT( pFact->pArr, "Kein Kontext angemeldet!" );
+ if ( !pFact->pArr )
+ break;
+
+ SfxChildWinContextFactory *pConFact=0;
+ for ( sal_uInt16 n=0; n<pFact->pArr->Count(); ++n )
+ {
+ pConFact = (*pFact->pArr)[n];
+ rBindings.ENTERREGISTRATIONS();
+ if ( pConFact->nContextId == nContextId )
+ {
+ SfxChildWinInfo aInfo = pFact->aInfo;
+ pCon = pConFact->pCtor( GetWindow(), &rBindings, &aInfo );
+ pCon->nContextId = pConFact->nContextId;
+ pImp->pContextModule = NULL;
+ }
+ rBindings.LEAVEREGISTRATIONS();
+ }
+ break;
+ }
+ }
+ }
+
+ if ( !pCon )
+ {
+ DBG_ERROR( "Kein geeigneter Context gefunden!" );
+ return;
+ }
+
+ if ( pContext )
+ delete( pContext );
+ pContext = pCon;
+ pContext->GetWindow()->SetSizePixel( pWindow->GetOutputSizePixel() );
+ pContext->GetWindow()->Show();
+}
+
+SfxChildWindowContext::SfxChildWindowContext( sal_uInt16 nId )
+ : pWindow( NULL )
+ , nContextId( nId )
+{
+}
+
+SfxChildWindowContext::~SfxChildWindowContext()
+{
+ delete pWindow;
+}
+
+FloatingWindow* SfxChildWindowContext::GetFloatingWindow() const
+{
+ Window *pParent = pWindow->GetParent();
+ if ( pParent->GetType() == RSC_DOCKINGWINDOW || pParent->GetType() == RSC_TOOLBOX )
+ {
+ return ((DockingWindow*)pParent)->GetFloatingWindow();
+ }
+ else if ( pParent->GetType() == RSC_FLOATINGWINDOW )
+ {
+ return (FloatingWindow*) pParent;
+ }
+ else
+ {
+ DBG_ERROR("Kein FloatingWindow-Context!");
+ return NULL;
+ }
+}
+
+SfxChildAlignment SfxChildWindowContext::GetAlignment() const
+{
+ Window *pParent = pWindow->GetParent();
+ if ( pParent->GetType() == RSC_DOCKINGWINDOW )
+ {
+ return ((SfxDockingWindow*)pParent)->GetAlignment();
+ }
+ else if ( pParent->GetType() == RSC_TOOLBOX )
+ {
+ HACK(noch nicht verwendet und noch nicht implementiert);
+ return SFX_ALIGN_NOALIGNMENT;
+ }
+ else
+ return SFX_ALIGN_NOALIGNMENT;
+}
+
+void SfxChildWindowContext::Resizing( Size& rSize )
+{
+}
+
+sal_Bool SfxChildWindowContext::Close()
+{
+ return sal_True;
+}
+
+void SfxChildWindow::SetFactory_Impl( SfxChildWinFactory *pF )
+{
+ pImp->pFact = pF;
+}
+
+void SfxChildWindow::SetHideNotDelete( sal_Bool bOn )
+{
+ pImp->bHideNotDelete = bOn;
+}
+
+sal_Bool SfxChildWindow::IsHideNotDelete() const
+{
+ return pImp->bHideNotDelete;
+}
+
+void SfxChildWindow::SetHideAtToggle( sal_Bool bOn )
+{
+ pImp->bHideAtToggle = bOn;
+}
+
+sal_Bool SfxChildWindow::IsHideAtToggle() const
+{
+ return pImp->bHideAtToggle;
+}
+
+sal_Bool SfxChildWinInfo::GetExtraData_Impl
+(
+ SfxChildAlignment *pAlign,
+ SfxChildAlignment *pLastAlign,
+ Size *pSize,
+ sal_uInt16 *pLine,
+ sal_uInt16 *pPos
+) const
+{
+ // ung"ultig?
+ if ( !aExtraString.Len() )
+ return sal_False;
+ String aStr;
+ sal_uInt16 nPos = aExtraString.SearchAscii("AL:");
+ if ( nPos == STRING_NOTFOUND )
+ return sal_False;
+
+ // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
+ // er nicht vorhanden ist, liegt eine "altere Version vor
+ if ( nPos != STRING_NOTFOUND )
+ {
+ sal_uInt16 n1 = aExtraString.Search('(', nPos);
+ if ( n1 != STRING_NOTFOUND )
+ {
+ sal_uInt16 n2 = aExtraString.Search(')', n1);
+ if ( n2 != STRING_NOTFOUND )
+ {
+ // Alignment-String herausschneiden
+ aStr = aExtraString.Copy(nPos, n2 - nPos + 1);
+ aStr.Erase(nPos, n1-nPos+1);
+ }
+ }
+ }
+
+ // Zuerst das Alignment extrahieren
+ if ( !aStr.Len() )
+ return sal_False;
+ if ( pAlign )
+ *pAlign = (SfxChildAlignment) (sal_uInt16) aStr.ToInt32();
+
+ // Dann das LastAlignment
+ nPos = aStr.Search(',');
+ if ( nPos == STRING_NOTFOUND )
+ return sal_False;
+ aStr.Erase(0, nPos+1);
+ if ( pLastAlign )
+ *pLastAlign = (SfxChildAlignment) (sal_uInt16) aStr.ToInt32();
+
+ // Dann die Splitting-Informationen
+ nPos = aStr.Search(',');
+ if ( nPos == STRING_NOTFOUND )
+ // Dockt nicht in einem Splitwindow
+ return sal_True;
+ aStr.Erase(0, nPos+1);
+ SfxIniManager *pAppIniMgr = SFX_APP()->GetAppIniManager();
+ Point aPos;
+ Size aSize;
+ if ( pAppIniMgr->GetPosSize( aStr, aPos, aSize ) )
+ {
+ if ( pSize )
+ *pSize = aSize;
+ if ( pLine )
+ *pLine = (sal_uInt16) aPos.X();
+ if ( pPos )
+ *pPos = (sal_uInt16) aPos.Y();
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+sal_Bool SfxChildWindow::IsVisible() const
+{
+ return pImp->bVisible;
+}
+
+void SfxChildWindow::SetVisible_Impl( sal_Bool bVis )
+{
+ pImp->bVisible = bVis;
+}
+
+void SfxChildWindow::Hide()
+{
+ switch ( pWindow->GetType() )
+ {
+ case RSC_DOCKINGWINDOW :
+ ((DockingWindow*)pWindow)->Hide();
+ break;
+ case RSC_TOOLBOX :
+ ((ToolBox*)pWindow)->Hide();
+ break;
+ default:
+ pWindow->Hide();
+ break;
+ }
+}
+
+
+
+void SfxChildWindow::Show()
+{
+ switch ( pWindow->GetType() )
+ {
+ case RSC_DOCKINGWINDOW :
+ ((DockingWindow*)pWindow)->Show();
+ break;
+ case RSC_TOOLBOX :
+ ((ToolBox*)pWindow)->Show();
+ break;
+ default:
+ pWindow->Show();
+ break;
+ }
+}
+
+Window* SfxChildWindow::GetContextWindow( SfxModule *pModule ) const
+{
+ return pModule == pImp->pContextModule && pContext ? pContext->GetWindow(): 0;
+}
+
+void SfxChildWindow::SetWorkWindow_Impl( SfxWorkWindow* pWin )
+{
+ pImp->pWorkWin = pWin;
+ if ( pWindow->HasChildPathFocus() )
+ pImp->pWorkWin->SetActiveChild_Impl( pWindow );
+}
+
+SfxWorkWindow* SfxChildWindow::GetWorkWindow_Impl() const
+{
+ return pImp->pWorkWin;
+}
+
+void SfxChildWindow::Activate_Impl()
+{
+ if(pImp->pWorkWin!=NULL) //@#60568#
+ pImp->pWorkWin->SetActiveChild_Impl( pWindow );
+}
+
+void SfxChildWindow::Deactivate_Impl()
+{
+// pImp->pWorkWin->SetActiveChild_Impl( NULL );
+}
+
+sal_Bool SfxChildWindow::QueryClose()
+{
+ if ( pImp->xFrame.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xCtrl = pImp->xFrame->getController();
+ if ( xCtrl.is() )
+ xCtrl->suspend( sal_True );
+ }
+
+ return sal_True;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxChildWindow::GetFrame()
+{
+ return pImp->xFrame;
+}
+
+void SfxChildWindow::SetFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & rFrame )
+{
+ pImp->xFrame = rFrame;
+}
+
+sal_Bool SfxChildWindow::CanGetFocus() const
+{
+ return !(pImp->pFact->aInfo.nFlags & SFX_CHILDWIN_CANTGETFOCUS);
+}
+
diff --git a/sfx2/source/appl/makefile.mk b/sfx2/source/appl/makefile.mk
new file mode 100644
index 000000000000..900d0349df37
--- /dev/null
+++ b/sfx2/source/appl/makefile.mk
@@ -0,0 +1,158 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=appl
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+IMGLST_SRS=$(SRS)$/appl.srs
+BMP_IN=$(PRJ)$/win/res
+
+# w.g. compilerbugs
+.IF "$(GUI)"=="WNT"
+CFLAGS+=-Od
+.ENDIF
+
+# --- Files --------------------------------------------------------
+
+SRS1NAME=appl
+SRC1FILES = \
+ app.src sfx.src image.src
+
+SRS2NAME=sfx
+SRC2FILES = \
+ sfx.src
+
+OBJFILES = \
+ $(OBJ)$/appctor.obj
+
+SLOFILES = \
+ $(SLO)$/rmacceptor.obj\
+ $(SLO)$/appuno.obj \
+ $(SLO)$/applicat.obj \
+ $(SLO)$/appmail.obj \
+ $(SLO)$/appmain.obj \
+ $(SLO)$/appopen.obj \
+ $(SLO)$/appinit.obj \
+ $(SLO)$/appmisc.obj \
+ $(SLO)$/appdemo.obj \
+ $(SLO)$/appreg.obj \
+ $(SLO)$/appcfg.obj \
+ $(SLO)$/appquit.obj \
+ $(SLO)$/appchild.obj \
+ $(SLO)$/appserv.obj \
+ $(SLO)$/appdata.obj \
+ $(SLO)$/app.obj \
+ $(SLO)$/appbas.obj \
+ $(SLO)$/appdde.obj \
+ $(SLO)$/workwin.obj \
+ $(SLO)$/sfxhelp.obj \
+ $(SLO)$/sfxhelp2.obj \
+ $(SLO)$/childwin.obj \
+ $(SLO)$/sfxdemo.obj \
+ $(SLO)$/sfxdll.obj \
+ $(SLO)$/module.obj \
+ $(SLO)$/picklist.obj \
+ $(SLO)$/exchobj.obj \
+ $(SLO)$/appsys.obj \
+ $(SLO)$/loadenv.obj \
+ $(SLO)$/frstinit.obj \
+ $(SLO)$/basmgr.obj \
+ $(SLO)$/oinstanceprovider.obj \
+ $(SLO)$/opipeconnection.obj \
+ $(SLO)$/opluginframefactory.obj
+
+EXCEPTIONSFILES=\
+ $(SLO)$/appmain.obj \
+ $(SLO)$/appmisc.obj \
+ $(SLO)$/frstinit.obj \
+ $(SLO)$/appinit.obj \
+ $(SLO)$/applicat.obj \
+ $(SLO)$/picklist.obj \
+ $(SLO)$/rmacceptor.obj \
+ $(SLO)$/appcfg.obj \
+
+.IF "$(GUI)" == "MAC"
+SLOFILES +=\
+ $(SLO)$/appctor.obj \
+ $(SLO)$/appmac.obj
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+SLOFILES +=\
+ $(SLO)$/appctor.obj
+.ENDIF
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
new file mode 100644
index 000000000000..e136dc18addb
--- /dev/null
+++ b/sfx2/source/appl/module.cxx
@@ -0,0 +1,470 @@
+/*************************************************************************
+ *
+ * $RCSfile: module.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+//#include <tools/solar.h>
+
+#include <cstdarg>
+#include "module.hxx"
+#include "app.hxx"
+#include "arrdecl.hxx"
+#include "sfxresid.hxx"
+#include "msgpool.hxx"
+#include "tbxctrl.hxx"
+#include "stbitem.hxx"
+#include "mnuitem.hxx"
+#include "childwin.hxx"
+#include "mnumgr.hxx"
+#include "docfac.hxx"
+#include "accmgr.hxx"
+#include "objface.hxx"
+#include "viewfrm.hxx"
+
+#define SfxModule
+#include <sfxslots.hxx>
+
+static SfxModuleArr_Impl* pModules=0;
+
+class SfxModule_Impl
+{
+public:
+
+ SfxSlotPool* pSlotPool;
+ SfxTbxCtrlFactArr_Impl* pTbxCtrlFac;
+ SfxStbCtrlFactArr_Impl* pStbCtrlFac;
+ SfxMenuCtrlFactArr_Impl* pMenuCtrlFac;
+ SfxChildWinFactArr_Impl* pFactArr;
+ ImageList* pImgList;
+ SfxSymbolSet eSet;
+
+ SfxModule_Impl();
+ ~SfxModule_Impl();
+};
+
+SfxModule_Impl::SfxModule_Impl()
+ : pSlotPool(0)
+{
+}
+
+SfxModule_Impl::~SfxModule_Impl()
+{
+ delete pSlotPool;
+ delete pTbxCtrlFac;
+ delete pStbCtrlFac;
+ delete pMenuCtrlFac;
+ delete pFactArr;
+ delete pImgList;
+}
+
+TYPEINIT1(SfxModule, SfxShell);
+
+//=========================================================================
+
+SFX_IMPL_INTERFACE(SfxModule,SfxShell,SfxResId(0))
+{
+}
+
+//====================================================================
+
+SfxFileDialog* SfxModule::CreateDocFileDialog
+(
+ ULONG nFlags, // arithmetische Veroderung der u.g. Sfx-Winbits
+ const SfxObjectFactory& rFact, /* <SfxObjectFactory>, deren Filter angezeigt
+ werden sollten */
+ const SfxItemSet* pSet // to forward on FileDialog
+)
+{
+ return SFX_APP()->CreateDocFileDialog( nFlags, rFact, pSet );
+}
+
+//====================================================================
+
+ModalDialog* SfxModule::CreateAboutDialog()
+{
+ return SFX_APP()->CreateAboutDialog();
+}
+
+//====================================================================
+
+BOOL SfxModule::QueryUnload()
+{
+ return TRUE;
+}
+
+//====================================================================
+
+SfxModule* SfxModule::Load()
+
+/* [Description]
+
+ This methode must be overrided in subclasses to load the real module.
+ In your dummy subclass you implement it as follows ('...' is the name
+ of your library, e.g. 'Sd'):
+
+ SfxModule* ...ModuleDummy::Load()
+ {
+ return LoadLib...() ? ..._MOD() : 0;
+ }
+
+ In your real subclass you implement it as follows:
+
+ SfxModule* ...Module::Load()
+ {
+ return this;
+ }
+
+ The code must be behind the invocation of SFX_...OBJECTFACTORY_LIB,
+ which defines the function LoadLib...().
+*/
+
+{
+ return 0;
+}
+
+//====================================================================
+
+void SfxModule::Free()
+
+/* [Description]
+
+ This methode must be overrided in subclasses to free the real module.
+ In your real subclass you implement it as follows ('...' is the name
+ of your library, e.g. 'Sd'):
+
+ void ...Module::Free()
+ {
+ FreeLib...();
+ }
+
+ The code must be behind the invocation of SFX_...OBJECTFACTORY_LIB,
+ which defines the function LoadLib...().
+*/
+
+{
+}
+
+
+//====================================================================
+
+ResMgr* SfxModule::GetResMgr()
+{
+ return pResMgr;
+}
+
+//====================================================================
+/*
+SfxModule::SfxModule( ResMgr* pMgrP, BOOL bDummyP,
+ SfxObjectFactory* pFactoryP )
+ : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L)
+{
+ Construct_Impl();
+ if ( pFactoryP )
+ pFactoryP->SetModule_Impl( this );
+}
+*/
+SfxModule::SfxModule( ResMgr* pMgrP, BOOL bDummyP,
+ SfxObjectFactory* pFactoryP, ... )
+ : pResMgr( pMgrP ), bDummy( bDummyP ), pImpl(0L)
+{
+ Construct_Impl();
+ va_list pVarArgs;
+ va_start( pVarArgs, pFactoryP );
+ for ( SfxObjectFactory *pArg = pFactoryP; pArg;
+ pArg = va_arg( pVarArgs, SfxObjectFactory* ) )
+ pArg->SetModule_Impl( this );
+ va_end(pVarArgs);
+}
+
+void SfxModule::Construct_Impl()
+{
+ if( !bDummy )
+ {
+ SfxApplication *pApp = SFX_APP();
+ SfxModuleArr_Impl& rArr = GetModules_Impl();
+ SfxModule* pPtr = (SfxModule*)this;
+ rArr.C40_INSERT( SfxModule, pPtr, rArr.Count() );
+ pImpl = new SfxModule_Impl;
+ pImpl->pSlotPool = new SfxSlotPool( &pApp->GetAppSlotPool_Impl(), pResMgr );
+
+ pImpl->pTbxCtrlFac=0;
+ pImpl->pStbCtrlFac=0;
+ pImpl->pMenuCtrlFac=0;
+ pImpl->pFactArr=0;
+ pImpl->pImgList=0;
+
+ SetPool( &pApp->GetPool() );
+ }
+}
+
+//====================================================================
+
+SfxModule::~SfxModule()
+{
+ if( !bDummy )
+ {
+ if ( SFX_APP()->Get_Impl() )
+ {
+ // Das Modul wird noch vor dem DeInitialize zerst"ort, also auis dem Array entfernen
+ SfxModuleArr_Impl& rArr = GetModules_Impl();
+ for( USHORT nPos = rArr.Count(); nPos--; )
+ {
+ if( rArr[ nPos ] == this )
+ {
+ rArr.Remove( nPos );
+ break;
+ }
+ }
+ delete pImpl;
+ }
+
+ delete pResMgr;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxSlotPool* SfxModule::GetSlotPool() const
+{
+ return pImpl->pSlotPool;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
+{
+ DBG_ASSERT( pImpl, "Kein echtes Modul!" );
+
+ if (!pImpl->pFactArr)
+ pImpl->pFactArr = new SfxChildWinFactArr_Impl;
+
+//#ifdef DBG_UTIL
+ for (USHORT nFactory=0; nFactory<pImpl->pFactArr->Count(); ++nFactory)
+ {
+ if (pFact->nId == (*pImpl->pFactArr)[nFactory]->nId)
+ {
+ pImpl->pFactArr->Remove( nFactory );
+ DBG_ERROR("ChildWindow mehrfach registriert!");
+ return;
+ }
+ }
+//#endif
+
+ pImpl->pFactArr->C40_INSERT(
+ SfxChildWinFactory, pFact, pImpl->pFactArr->Count() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModule::RegisterChildWindowContext( USHORT nId,
+ SfxChildWinContextFactory *pFact)
+{
+ DBG_ASSERT( pImpl, "Kein echtes Modul!" );
+
+ USHORT nCount = pImpl->pFactArr->Count();
+ for (USHORT nFactory=0; nFactory<nCount; ++nFactory)
+ {
+ SfxChildWinFactory *pF = (*pImpl->pFactArr)[nFactory];
+ if ( nId == pF->nId )
+ {
+ if ( !pF->pArr )
+ pF->pArr = new SfxChildWinContextArr_Impl;
+ pF->pArr->C40_INSERT( SfxChildWinContextFactory, pFact, pF->pArr->Count() );
+ return;
+ }
+ }
+
+ DBG_ERROR( "Kein ChildWindow fuer diesen Context!" );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact )
+{
+ if (!pImpl->pTbxCtrlFac)
+ pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl;
+
+#ifdef DBG_UTIL
+ for ( USHORT n=0; n<pImpl->pTbxCtrlFac->Count(); n++ )
+ {
+ SfxTbxCtrlFactory *pF = (*pImpl->pTbxCtrlFac)[n];
+ if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ {
+ DBG_WARNING("TbxController-Registrierung ist nicht eindeutig!");
+ }
+ }
+#endif
+
+ pImpl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pImpl->pTbxCtrlFac->Count() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
+{
+ if (!pImpl->pStbCtrlFac)
+ pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl;
+
+#ifdef DBG_UTIL
+ for ( USHORT n=0; n<pImpl->pStbCtrlFac->Count(); n++ )
+ {
+ SfxStbCtrlFactory *pF = (*pImpl->pStbCtrlFac)[n];
+ if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ {
+ DBG_WARNING("StbController-Registrierung ist nicht eindeutig!");
+ }
+ }
+#endif
+
+ pImpl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pImpl->pStbCtrlFac->Count() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
+{
+ if (!pImpl->pMenuCtrlFac)
+ pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl;
+
+#ifdef DBG_UTIL
+ for ( USHORT n=0; n<pImpl->pMenuCtrlFac->Count(); n++ )
+ {
+ SfxMenuCtrlFactory *pF = (*pImpl->pMenuCtrlFac)[n];
+ if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
+ (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
+ {
+ DBG_WARNING("MenuController-Registrierung ist nicht eindeutig!");
+ }
+ }
+#endif
+
+ pImpl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pImpl->pMenuCtrlFac->Count() );
+}
+
+//-------------------------------------------------------------------------
+
+SfxTbxCtrlFactArr_Impl* SfxModule::GetTbxCtrlFactories_Impl() const
+{
+ return pImpl->pTbxCtrlFac;
+}
+
+//-------------------------------------------------------------------------
+
+SfxStbCtrlFactArr_Impl* SfxModule::GetStbCtrlFactories_Impl() const
+{
+ return pImpl->pStbCtrlFac;
+}
+
+//-------------------------------------------------------------------------
+
+SfxMenuCtrlFactArr_Impl* SfxModule::GetMenuCtrlFactories_Impl() const
+{
+ return pImpl->pMenuCtrlFac;
+}
+
+//-------------------------------------------------------------------------
+
+SfxChildWinFactArr_Impl* SfxModule::GetChildWinFactories_Impl() const
+{
+ return pImpl->pFactArr;
+}
+
+ImageList* SfxModule::GetImageList_Impl( SfxSymbolSet eSet )
+{
+ if ( !pImpl->pImgList || pImpl->eSet != eSet )
+ {
+ pImpl->eSet = eSet;
+ delete pImpl->pImgList;
+ pImpl->pImgList = new ImageList(
+ ResId( eSet == SFX_SYMBOLS_SMALL_COLOR ?
+ RID_DEFAULTIMAGELIST_SC : RID_DEFAULTIMAGELIST_LC,
+ GetResMgr() ) );
+ }
+
+ return pImpl->pImgList;
+}
+/* ASDBG
+Reflection* SfxModule::GetReflection( UsrUik aUIK )
+{
+ return NULL;
+}
+*/
+SfxTabPage* SfxModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemSet& rSet )
+{
+ return NULL;
+}
+
+SfxModuleArr_Impl& SfxModule::GetModules_Impl()
+{
+ if( !pModules )
+ pModules = new SfxModuleArr_Impl;
+ return *pModules;
+};
+
+void SfxModule::Invalidate( USHORT nId )
+{
+ for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst(); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame ) )
+ if ( pFrame->GetObjectShell()->GetModule() == this )
+ Invalidate_Impl( pFrame->GetBindings(), nId );
+}
+
diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src
new file mode 100644
index 000000000000..dbcb92ac8ce7
--- /dev/null
+++ b/sfx2/source/appl/sfx.src
@@ -0,0 +1,526 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfx.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "sfx.hrc"
+
+String STR_NONAME
+{
+ Text = "unbenannt" ;
+ Text [ ENGLISH ] = "noname" ;
+ Text [ norwegian ] = "noname" ;
+ Text [ italian ] = "Senza nome" ;
+ Text [ portuguese_brazilian ] = "Sem nome" ;
+ Text [ portuguese ] = "Sem nome" ;
+ Text [ finnish ] = "nimetn" ;
+ Text [ danish ] = "ikke-navngivet" ;
+ Text [ french ] = "Sans nom" ;
+ Text [ swedish ] = "namnls" ;
+ Text [ dutch ] = "naamloos" ;
+ Text [ spanish ] = "Sin nombre" ;
+ Text [ english_us ] = "Untitled" ;
+ Text[ chinese_simplified ] = "δ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Bez nazwy";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "RW";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Adsz";
+};
+
+String STR_NONE
+{
+ Text = "- Keine -" ;
+ Text [ ENGLISH ] = "- None -" ;
+ Text [ norwegian ] = "- Ingen -" ;
+ Text [ italian ] = "- Senza -" ;
+ Text [ portuguese_brazilian ] = "- Nenhum -" ;
+ Text [ portuguese ] = "- Nenhum -" ;
+ Text [ finnish ] = "- Ei ole -" ;
+ Text [ danish ] = "- Ingen -" ;
+ Text [ french ] = "- Aucun(e) -" ;
+ Text [ swedish ] = "- Inga -" ;
+ Text [ dutch ] = "- Geen -" ;
+ Text [ spanish ] = "- Ninguno -" ;
+ Text [ english_us ] = "- None -" ;
+ Text[ chinese_simplified ] = "- -";
+ Text[ russian ] = "- -";
+ Text[ polish ] = "- Brak -";
+ Text[ japanese ] = "-Ȃ-";
+ Text[ chinese_traditional ] = "- L -";
+ Text[ arabic ] = "- -";
+ Text[ greek ] = "- -";
+ Text[ korean ] = "- -";
+ Text[ turkish ] = "- Yok -";
+};
+
+String STR_CLOSE
+{
+ Text = "Schlieen" ;
+ Text [ ENGLISH ] = "Close" ;
+ Text [ norwegian ] = "Lukk" ;
+ Text [ italian ] = "Chiudi" ;
+ Text [ portuguese_brazilian ] = "Fechar" ;
+ Text [ portuguese ] = "Fechar" ;
+ Text [ finnish ] = "Sulje" ;
+ Text [ danish ] = "Luk" ;
+ Text [ french ] = "Fermer" ;
+ Text [ swedish ] = "Stng" ;
+ Text [ dutch ] = "Sluiten" ;
+ Text [ spanish ] = "Cerrar" ;
+ Text [ english_us ] = "Close" ;
+ Text[ chinese_simplified ] = "ر";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zamknij";
+ Text[ japanese ] = "‚";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ݱ";
+ Text[ turkish ] = "Kapat";
+};
+
+String STR_STYLE_FILTER_AUTO
+{
+ TEXT = "Automatisch" ;
+ TEXT [ English ] = "Automatic" ;
+ TEXT [ norwegian ] = "Automatic" ;
+ TEXT [ italian ] = "Automatico" ;
+ TEXT [ portuguese_brazilian ] = "Automtico" ;
+ TEXT [ portuguese ] = "Automtico" ;
+ TEXT [ finnish ] = "Automaattinen" ;
+ TEXT [ danish ] = "Automatisk" ;
+ TEXT [ french ] = "Automatique" ;
+ TEXT [ swedish ] = "Automatisk" ;
+ TEXT [ dutch ] = "Automatisch" ;
+ TEXT [ spanish ] = "Automtico" ;
+ TEXT [ english_us ] = "Automatic" ;
+ TEXT[ chinese_simplified ] = "Զ";
+ TEXT[ russian ] = "";
+ TEXT[ polish ] = "Automatycznie";
+ TEXT[ japanese ] = "";
+ TEXT[ chinese_traditional ] = "۰";
+ TEXT[ arabic ] = "";
+ TEXT[ greek ] = "";
+ TEXT[ korean ] = "ڵ";
+ TEXT[ turkish ] = "Otomatik";
+};
+
+String STR_STYLE_FILTER_USED
+{
+ TEXT = "Verwendete Vorlagen" ;
+ TEXT [ English ] = "Used styles" ;
+ TEXT [ norwegian ] = "Brukte stiler" ;
+ TEXT [ italian ] = "Modelli usati" ;
+ TEXT [ portuguese_brazilian ] = "Estilos usados" ;
+ TEXT [ portuguese ] = "Estilos usados" ;
+ TEXT [ finnish ] = "Kytetyt tyylit" ;
+ TEXT [ danish ] = "Anvendte typografier" ;
+ TEXT [ french ] = "Styles utiliss" ;
+ TEXT [ swedish ] = "Anvnda mallar" ;
+ TEXT [ dutch ] = "Gebruikte opmaakprofielen" ;
+ TEXT [ spanish ] = "Estilos utilizados" ;
+ TEXT [ english_us ] = "Applied Styles" ;
+ TEXT[ chinese_simplified ] = "ʹõʽ";
+ TEXT[ russian ] = " ";
+ TEXT[ polish ] = "Uywane style";
+ TEXT[ japanese ] = "gp";
+ TEXT[ chinese_traditional ] = "ϥΪ˦";
+ TEXT[ arabic ] = " ";
+ TEXT[ greek ] = " ";
+ TEXT[ korean ] = " Ǿϴ.";
+ TEXT[ turkish ] = "Kullanlan biimler";
+};
+
+
+
+String STR_STYLE_FILTER_USERDEF
+{
+ TEXT = "Benutzervorlagen" ;
+ TEXT [ English ] = "User styles" ;
+ TEXT [ norwegian ] = "Brukerstiler" ;
+ TEXT [ italian ] = "Modelli utente" ;
+ TEXT [ portuguese_brazilian ] = "Estilos do usurio" ;
+ TEXT [ portuguese ] = "Estilos do utilizador" ;
+ TEXT [ finnish ] = "Kyttjn tyylit" ;
+ TEXT [ danish ] = "Brugertypografier" ;
+ TEXT [ french ] = "Styles personnaliss" ;
+ TEXT [ swedish ] = "Anvndardefinierade formatmallar" ;
+ TEXT [ dutch ] = "Eigen opmaakprofielen" ;
+ TEXT [ spanish ] = "Estilos del usuario" ;
+ TEXT [ english_us ] = "Custom Styles" ;
+ TEXT[ chinese_simplified ] = "ûʽ";
+ TEXT[ russian ] = " ";
+ TEXT[ polish ] = "Style uytkownika";
+ TEXT[ japanese ] = "հް`̽";
+ TEXT[ chinese_traditional ] = "ۭq˦";
+ TEXT[ arabic ] = " ";
+ TEXT[ greek ] = " ";
+ TEXT[ korean ] = " ";
+ TEXT[ turkish ] = "Kullanc tanml biimler";
+};
+
+String STR_STYLE_FILTER_ALL
+{
+ TEXT = "Alle Vorlagen" ;
+ TEXT [ English ] = "All styles" ;
+ TEXT [ norwegian ] = "Alle stiler" ;
+ TEXT [ italian ] = "Tutti i modelli" ;
+ TEXT [ portuguese_brazilian ] = "Todos os estilos" ;
+ TEXT [ portuguese ] = "Estilos todos" ;
+ TEXT [ finnish ] = "Kaikki tyylit" ;
+ TEXT [ danish ] = "Alle typografier" ;
+ TEXT [ french ] = "Tous les styles" ;
+ TEXT [ swedish ] = "Alla mallar" ;
+ TEXT [ dutch ] = "Alle opmaakprofielen" ;
+ TEXT [ spanish ] = "Todos los estilos" ;
+ TEXT [ english_us ] = "All Styles" ;
+ TEXT[ chinese_simplified ] = "ȫʽ";
+ TEXT[ russian ] = " ";
+ TEXT[ polish ] = "Wszystkie style";
+ TEXT[ japanese ] = "ׂĂ̽";
+ TEXT[ chinese_traditional ] = "˦";
+ TEXT[ arabic ] = " ";
+ TEXT[ greek ] = " ";
+ TEXT[ korean ] = " ";
+ TEXT[ turkish ] = "Tm biimler";
+};
+
+String STR_STANDARD
+{
+ Text = "Standard" ;
+ Text [ English ] = "Standard" ;
+ Text [ english_us ] = "Standard" ;
+ Text[ portuguese ] = "Padro";
+ Text[ russian ] = "";
+ Text[ greek ] = "";
+ Text[ dutch ] = "Standaard";
+ Text[ french ] = "Par dfaut";
+ Text[ spanish ] = "Predeterminado";
+ Text[ italian ] = "Standard";
+ Text[ danish ] = "Standard";
+ Text[ swedish ] = "Standard";
+ Text[ polish ] = "Domylnie";
+ Text[ portuguese_brazilian ] = "Standard";
+ Text[ japanese ] = "W";
+ Text[ korean ] = "ǥ";
+ Text[ chinese_simplified ] = "׼";
+ Text[ chinese_traditional ] = "Э";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "Standart";
+};
+
+String STR_FILTERNAME_ALL
+{
+ TEXT = "<Alle>" ;
+ TEXT [ ENGLISH ] = "<All>" ;
+ TEXT [ norwegian ] = "<Alle>" ;
+ TEXT [ italian ] = "<tutto>" ;
+ TEXT [ portuguese_brazilian ] = "<Tudo>" ;
+ TEXT [ portuguese ] = "<Todos>" ;
+ TEXT [ finnish ] = "<All>" ;
+ TEXT [ danish ] = "<Alle>" ;
+ TEXT [ french ] = "<Tout>" ;
+ TEXT [ swedish ] = "<Alla>" ;
+ TEXT [ dutch ] = "<Alle>" ;
+ TEXT [ spanish ] = "<Todos>" ;
+ TEXT [ english_us ] = "<All>" ;
+ TEXT[ chinese_simplified ] = "<ȫ>";
+ TEXT[ russian ] = "<>";
+ TEXT[ polish ] = "<Wszystkie>";
+ TEXT[ japanese ] = "<ׂ>";
+ TEXT[ chinese_traditional ] = "<>";
+ TEXT[ arabic ] = "<>";
+ TEXT[ greek ] = "<>";
+ TEXT[ korean ] = "<>";
+ TEXT[ turkish ] = "<Tm>";
+};
+
+String STR_HUMAN_APPNAME
+{
+ TEXT = "StarOffice" ;
+};
+
+String STR_BYTES
+{
+ Text = "Bytes" ;
+ Text [ ENGLISH ] = "Bytes" ;
+ Text [ english_us ] = "Bytes" ;
+ Text [ portuguese_brazilian ] = "Bytes" ;
+ Text [ swedish ] = "Byte" ;
+ Text [ danish ] = "Bytes" ;
+ Text [ italian ] = "Byte" ;
+ Text [ spanish ] = "Bytes" ;
+ Text [ french ] = "Octet(s)" ;
+ Text [ dutch ] = "Bytes" ;
+ Text [ portuguese ] = "Bytes" ;
+ Text[ chinese_simplified ] = "ֽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Bajty";
+ Text[ japanese ] = "޲";
+ Text[ chinese_traditional ] = "Bytes";
+ Text[ arabic ] = "";
+ Text[ greek ] = "Bytes";
+ Text[ korean ] = "Ʈ";
+ Text[ turkish ] = "Byte";
+};
+
+String STR_KB
+{
+ Text = "KB" ;
+ Text [ ENGLISH ] = "KB" ;
+ Text [ portuguese ] = "KB" ;
+ Text [ english_us ] = "KB" ;
+ Text [ portuguese_brazilian ] = "KB" ;
+ Text [ swedish ] = "kB" ;
+ Text [ danish ] = "kB" ;
+ Text [ italian ] = "KB" ;
+ Text [ spanish ] = "KB" ;
+ Text [ french ] = "Ko" ;
+ Text [ dutch ] = "KB" ;
+ Text[ chinese_simplified ] = "ǧֽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "KB";
+ Text[ japanese ] = "޲";
+ Text[ chinese_traditional ] = "KB";
+ Text[ arabic ] = "";
+ Text[ greek ] = "KB";
+ Text[ korean ] = "KB";
+ Text[ turkish ] = "KB";
+};
+
+String STR_MB
+{
+ Text = "MB" ;
+ Text [ ENGLISH ] = "MB" ;
+ Text [ portuguese ] = "MB" ;
+ Text [ english_us ] = "MB" ;
+ Text [ portuguese_brazilian ] = "MB" ;
+ Text [ swedish ] = "MB" ;
+ Text [ danish ] = "MB" ;
+ Text [ italian ] = "MB" ;
+ Text [ spanish ] = "MB" ;
+ Text [ french ] = "Mo" ;
+ Text [ dutch ] = "MB" ;
+ Text[ chinese_simplified ] = "ֽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "MB";
+ Text[ japanese ] = "MB";
+ Text[ chinese_traditional ] = "MB";
+ Text[ arabic ] = "";
+ Text[ greek ] = "MB";
+ Text[ korean ] = "MB";
+ Text[ turkish ] = "MB";
+};
+
+
+String STR_GB
+{
+ Text = "GB" ;
+ Text [ ENGLISH ] = "GB" ;
+ Text [ portuguese ] = "GB" ;
+ Text [ english_us ] = "GB" ;
+ Text [ portuguese_brazilian ] = "GB" ;
+ Text [ swedish ] = "GB" ;
+ Text [ danish ] = "GB" ;
+ Text [ italian ] = "GB" ;
+ Text [ spanish ] = "GB" ;
+ Text [ french ] = "Go" ;
+ Text [ dutch ] = "GB" ;
+ Text[ chinese_simplified ] = "ǧ";
+ Text[ russian ] = "";
+ Text[ polish ] = "GB";
+ Text[ japanese ] = "GB";
+ Text[ chinese_traditional ] = "GB";
+ Text[ arabic ] = "";
+ Text[ greek ] = "GB";
+ Text[ korean ] = "GB";
+ Text[ turkish ] = "GB";
+};
+
+String STR_UNDO
+{
+ /* ### ACHTUNG: Neuer Text in Resource? Rckgngig: : Rckgngig: */
+ Text = "Rckgngig: " ;
+ Text [ English ] = "Undo " ;
+ Text [ norwegian ] = "Angre " ;
+ Text [ italian ] = "Annulla " ;
+ Text [ portuguese_brazilian ] = "Desfazer " ;
+ Text [ portuguese ] = "Desfazer: " ;
+ Text [ finnish ] = "Kumoa " ;
+ Text [ danish ] = "Fortryd: " ;
+ Text [ french ] = "Annuler : " ;
+ Text [ swedish ] = "ngra: " ;
+ Text [ dutch ] = "Ongedaan: " ;
+ Text [ spanish ] = "Deshacer: " ;
+ Text [ english_us ] = "Undo: " ;
+ Text[ chinese_simplified ] = " ";
+ Text[ russian ] = ": ";
+ Text[ polish ] = "Cofnij: ";
+ Text[ japanese ] = "ɖ߂: ";
+ Text[ chinese_traditional ] = "MROG ";
+ Text[ arabic ] = ": ";
+ Text[ greek ] = ": ";
+ Text[ korean ] = ": ";
+ Text[ turkish ] = "Geri al: ";
+};
+
+String STR_REDO
+{
+ Text = "Wiederherstellen: " ;
+ Text [ English ] = "Redo: " ;
+ Text [ english_us ] = "Re~do: " ;
+ Text [ portuguese ] = "Refazer: " ;
+ Text [ portuguese_brazilian ] = "Refazer " ;
+ Text [ swedish ] = "terstll: " ;
+ Text [ danish ] = "Gendan: " ;
+ Text [ italian ] = "Ripristina: " ;
+ Text [ spanish ] = "Restaurar: " ;
+ Text [ french ] = "Restaurer : " ;
+ Text [ dutch ] = "Herstellen: " ;
+ Text[ chinese_simplified ] = "ָ (~D)";
+ Text[ russian ] = ": ";
+ Text[ polish ] = "Ponw: ";
+ Text[ japanese ] = "蒼: (~D)";
+ Text[ chinese_traditional ] = "_MRO (~D)";
+ Text[ arabic ] = ": ";
+ Text[ greek ] = ": ";
+ Text[ korean ] = "ٽ : (~D)";
+ Text[ turkish ] = "~Yinele: ";
+};
+
+String STR_REPEAT
+{
+ Text = "Letzter ~Befehl: " ;
+ Text [ English ] = "~Repeat: " ;
+ Text [ english_us ] = "~Repeat: " ;
+ Text [ portuguese ] = "~Repetir: " ;
+ Text [ portuguese_brazilian ] = "Repetir " ;
+ Text [ swedish ] = "Senaste ~kommando: " ;
+ Text [ danish ] = "Sidste ~kommado: " ;
+ Text [ italian ] = "Ultimo ~comando: " ;
+ Text [ spanish ] = "~ltimo comando: " ;
+ Text [ french ] = "~Rpter : " ;
+ Text [ dutch ] = "~Herhalen: " ;
+ Text[ chinese_simplified ] = "һ(~R)";
+ Text[ russian ] = ": ";
+ Text[ polish ] = "Ostatnie polecenie: ";
+ Text[ japanese ] = "JԂ:(~R) ";
+ Text[ chinese_traditional ] = "W@өRO(~R)";
+ Text[ arabic ] = " : ";
+ Text[ greek ] = ": ";
+ Text[ korean ] = "ݺ: (~R)";
+ Text[ turkish ] = "Son ~komutu yinele: ";
+};
+
+String RID_STR_NEW_TASK
+{
+ Text = "Neue Task";
+ Text [ english ] = "New task";
+ Text[ english_us ] = "New task";
+ Text[ portuguese ] = "Nova tarefa";
+ Text[ russian ] = " ";
+ Text[ dutch ] = "Nieuwe taak";
+ Text[ french ] = "Nouvelle tche";
+ Text[ spanish ] = "Nueva tarea";
+ Text[ italian ] = "Nuovo compito";
+ Text[ danish ] = "Ny opgave";
+ Text[ swedish ] = "Ny aktivitet";
+ Text[ polish ] = "Nowe zadanie";
+ Text[ portuguese_brazilian ] = "New task";
+ Text[ japanese ] = "V޳";
+ Text[ chinese_simplified ] = "Ӵ";
+ Text[ chinese_traditional ] = "sWf";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ο ۾";
+ Text[ turkish ] = "Yeni grev";
+};
+QueryBox MSG_QUERY_LASTVERSION
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ /* ### ACHTUNG: Neuer Text in Resource? Alle nderungen aufheben? : Alle nderungen aufheben? */
+ Message = "Alle nderungen aufheben?" ;
+ Message [ English ] = "Cancel all changes?" ;
+ Message [ norwegian ] = "Slett alle endringer?" ;
+ Message [ italian ] = "Volete annullare tutte le modifiche?" ;
+ Message [ portuguese_brazilian ] = "Cancelar todas as modificaes?" ;
+ Message [ portuguese ] = "Cancelar todas as modificaes?" ;
+ Message [ finnish ] = "Kumotaanko kaikki muutokset?" ;
+ Message [ danish ] = "Vil du annullere alle ndringer?" ;
+ Message [ french ] = "Annuler toutes les modifications ?" ;
+ Message [ swedish ] = "ngra alla ndringar?" ;
+ Message [ dutch ] = "Alle wijzigingen ongedaan maken?" ;
+ Message [ spanish ] = "Cancelar todos los cambios?" ;
+ Message [ english_us ] = "Cancel all changes?" ;
+ Message[ chinese_simplified ] = "Ҫȡ?";
+ Message[ russian ] = " ?";
+ Message[ polish ] = "Usun wszystkie zmiany?";
+ Message[ japanese ] = "ׂĂ̕ύX܂?";
+ Message[ chinese_traditional ] = "ҦܧH";
+ Message[ greek ] = " ;";
+ Message[ korean ] = " Ͻðڽϱ?";
+ Message[ arabic ] = " ʿ";
+ Message[ turkish ] = "Tm deiiklikleri iptal et?";
+};
+
diff --git a/sfx2/source/appl/sfxdll.cxx b/sfx2/source/appl/sfxdll.cxx
new file mode 100644
index 000000000000..a03f8c3c6b2e
--- /dev/null
+++ b/sfx2/source/appl/sfxdll.cxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxdll.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef WIN
+#ifndef _SVWIN_H
+#include <svwin.h>
+#endif
+#endif
+
+#pragma hdrstop
+
+#ifdef WIN
+#include "segmentc.hxx"
+
+// Statische DLL-Verwaltungs-Variablen
+static HINSTANCE hDLLInst = 0;
+
+SEG_EOFGLOBALS()
+
+//==========================================================================
+#pragma SEG_SEGCLASS(DLLINIT_SEG,DLLINITEXIT_CODE)
+
+extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+{
+#ifndef WNT
+ if ( nHeap )
+ UnlockData( 0 );
+#endif
+
+ hDLLInst = hDLL;
+
+ return TRUE;
+}
+
+
+//--------------------------------------------------------------------------
+#pragma SEG_SEGCLASS(DLLEXIT_SEG,DLLINITEXIT_CODE)
+
+extern "C" int CALLBACK WEP( int )
+{
+ return 1;
+}
+
+
+
+//==========================================================================
+
+#endif
+
+
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
new file mode 100644
index 000000000000..30d21f2e4def
--- /dev/null
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -0,0 +1,1277 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxhelp.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:27 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_CLIP_HXX //autogen
+#include <vcl/clip.hxx>
+#endif
+#ifndef _SV_CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXITEMSET_HXX //autogen
+#include <svtools/itemset.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _SB_SBMETH_HXX //autogen
+#include <basic/sbmeth.hxx>
+#endif
+#ifndef _SB_SBMOD_HXX //autogen
+#include <basic/sbmod.hxx>
+#endif
+
+#ifndef _SV_SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+
+#include <automation/automation.hxx>
+#pragma hdrstop
+
+#include <saveopt.hxx> // Welcome-Screen Optionen
+
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+
+#ifdef WNT
+#pragma optimize ( "", off )
+#endif
+
+#include <helpid.hrc>
+#include <app.hxx>
+#include <sfx.hrc>
+#include <sfxhelp.hxx>
+#include <sfxhelp2.hxx>
+#include <docfac.hxx>
+#include <openflag.hxx>
+#include <bindings.hxx>
+#include <dispatch.hxx>
+#include <genlink.hxx>
+#include <viewsh.hxx>
+#include <sfxresid.hxx>
+#include <printer.hxx>
+#include <request.hxx>
+#include <docfile.hxx>
+#include <app.hrc>
+#include <msgpool.hxx>
+#include <appdata.hxx>
+#include "objshimp.hxx"
+#include "macrconf.hxx"
+#include "viewfrm.hxx"
+#include "objface.hxx"
+
+#ifdef MAC
+#define HELP_APP_NAME "StarHelp 4.0"
+#elif defined UNX
+#define HELP_APP_NAME "shelp"
+#else
+#define HELP_APP_NAME "SHELP.EXE"
+#endif
+
+static const char __FAR_DATA zsHelpAgentConfig[] = "hlpagent.ini";
+static const char __FAR_DATA zsHelpAgentConfig_Tips[] = "Tips";
+
+static const USHORT nBorder = 10; // So war's im Writer - aber warum ???
+
+SV_IMPL_VARARR_SORT( SortedULONGs, ULONG );
+//SV_IMPL_PTRARR( HelpTextCaches, HelpTextCache* );
+
+USHORT ImplSetLanguageGroup( Config& rConfig, const String& rGroupName, BOOL bSearchLanguage )
+{
+ USHORT nFound = 0;
+
+ // Nach Prioritaeten die richtige Language-Section suchen...
+ LanguageType eLanguage = Application::GetSettings().GetInternational().GetLanguage();
+ for ( USHORT nPrio = 0; nPrio <= 4; nPrio++ )
+ {
+ const char* pLang = ResMgr::GetLang( eLanguage, nPrio );
+ if ( pLang )
+ {
+ String aGroup( rGroupName );
+ aGroup += '-';
+ aGroup += String::CreateFromAscii(pLang);
+ if ( !bSearchLanguage || rConfig.HasGroup( U2S(aGroup) ) )
+ {
+ rConfig.SetGroup( U2S(aGroup) );
+ nFound = nPrio+1;
+ break;
+ }
+ // Falls keine gefunden wird, dann die genaueste einstellen
+ if ( nPrio == 0 )
+ rConfig.SetGroup( U2S(aGroup) );
+ }
+ }
+ return nFound;
+}
+
+//=========================================================================
+SFX_IMPL_DOCKINGWINDOW(SfxHelpPIWrapper, SID_HELP_PI);
+SFX_IMPL_DOCKINGWINDOW(SfxHelpTipsWrapper, SID_TIPWINDOW);
+
+static Point CalcFloaterPos( Window *pPI, Rectangle& rFloaterRect, const Rectangle& rDialogRect )
+{
+ Point aPos = rFloaterRect.TopLeft();
+ if ( rFloaterRect.IsOver( rDialogRect ) )
+ {
+ Size aScreenSize = pPI->GetDesktopRectPixel().GetSize();
+ Size aFloaterSz = rFloaterRect.GetSize();
+ long nMinWidth = aScreenSize.Width() / 5;
+// long nMinHeight = aScreenSize.Height() / 5;
+
+ // Minimalgroessen nur, wenn nicht vorher schon kleiner, weil der
+ // Anwender es wollte:
+ if ( aFloaterSz.Width() < nMinWidth )
+ nMinWidth = aFloaterSz.Width();
+// if ( aFloaterSz.Height() < nMinHeight )
+// nMinHeight= aFloaterSz.Height();
+
+
+ long nTopDiff = -(rFloaterRect.Top() - rDialogRect.Top());
+ long nBottomDiff = rFloaterRect.Bottom() - rDialogRect.Bottom();
+ long nLeftDiff = -(rFloaterRect.Left() - rDialogRect.Left());
+ long nRightDiff = rFloaterRect.Right() - rDialogRect.Right();
+
+ BOOL bRight = ( rDialogRect.Right() + rFloaterRect.GetWidth() ) < aScreenSize.Width();
+ BOOL bLeft = ( rDialogRect.Left() - rFloaterRect.GetWidth() ) > 0;
+ BOOL bTop = ( rDialogRect.Top() - rFloaterRect.GetHeight() ) > 0;
+ BOOL bBottom = ( rDialogRect.Bottom() + rFloaterRect.GetHeight() ) < aScreenSize.Height();
+
+ if ( bLeft || bRight )
+ aPos.X() = ( bRight && ( !bLeft || ( nLeftDiff < nRightDiff ) ) )
+ ? rDialogRect.Right()
+ : rDialogRect.Left() - rFloaterRect.GetWidth();
+ else if ( bTop || bBottom )
+ aPos.Y() = ( bTop && ( !bBottom || ( nBottomDiff < nTopDiff ) ) )
+ ? rDialogRect.Top() - rFloaterRect.GetHeight()
+ : rDialogRect.Bottom();
+ else
+ {
+ // Rechts oder links daneben, wo mehr Platz ist...
+ long nLeftSpace = rDialogRect.Left();
+ long nRightSpace = aScreenSize.Width() - rDialogRect.Right();
+ if ( nLeftSpace > nRightSpace )
+ {
+ aPos.X() = 0;
+ long nWidth = nLeftSpace;
+ if ( nWidth < nMinWidth )
+ nWidth = nMinWidth;
+ rFloaterRect.Right() = rFloaterRect.Left() + nWidth;
+
+ }
+ else
+ {
+ long nWidth = nRightSpace;
+ if ( nWidth < nMinWidth )
+ nWidth = nMinWidth;
+ aPos.X() = aScreenSize.Width() - nWidth;
+ rFloaterRect.Right() = rFloaterRect.Left() + nWidth;
+ }
+ }
+ }
+ rFloaterRect.SetPos( aPos );
+ return aPos;
+}
+
+
+//=========================================================================
+
+SfxHelpPIWrapper::SfxHelpPIWrapper(Window *pParent,
+ USHORT nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo) :
+ SfxChildWindow(pParent, nId)
+{
+ // Skalierung des HelpPI initialisieren
+ USHORT nScale = 100;
+ if ( pInfo->aExtraString.Len() )
+ {
+ USHORT nPos = pInfo->aExtraString.Search(0x0023); // '#' = 23h
+ if ( nPos != STRING_NOTFOUND )
+ {
+ String aScale = pInfo->aExtraString.Copy(nPos+1);
+ pInfo->aExtraString.Erase(nPos+1);
+ pInfo->aExtraString.Erase(nPos,1);
+ nScale = (USHORT) aScale.ToInt32();
+ }
+ else
+ {
+ // Es ist noch ein alter Eintrag (FloatingWindow); das Alignment
+ // wird dann in Initialize nicht ver"andert.
+ pInfo->aExtraString.Erase();
+ }
+ }
+
+ // Versuche, das Helferlein zu laden
+ SfxHelpPI *pSfxHelpPI = new SfxHelpPI(pBindings, this, pParent, nScale);
+
+ pWindow = pSfxHelpPI;
+ eChildAlignment = SFX_ALIGN_NOALIGNMENT;
+
+ if ( !pInfo->aSize.Width() )
+ {
+ // initial zentriert hochkommen
+ Size aSz( 400, 250 );
+ pSfxHelpPI->SetSizePixel( aSz );
+
+ if ( SFX_APP()->GetDemoKind() == SFX_DEMOKIND_TRYBUY )
+ {
+ Rectangle aRect = Rectangle( Point(), pParent->GetOutputSizePixel() );
+ Point aPoint = aRect.BottomRight();
+ aPoint.X() -= ( aSz.Width() + 10 );
+ aPoint.Y() -= ( aSz.Height() + 10 );
+ pSfxHelpPI->SetFloatingPos( aPoint );
+ }
+ }
+
+ pSfxHelpPI->Initialize(pInfo);
+ pSfxHelpPI->ResetTopic();
+}
+
+BOOL SfxHelpPIWrapper::QueryClose()
+{
+ BOOL bCanClose = TRUE;
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ {
+// HelpPI* pH = pHelpPI->GetHelpPI();
+// if ( pH && pH->HasDialog() )
+// bCanClose = FALSE;
+ }
+ return bCanClose;
+}
+
+void SfxHelpPI::ResetTopic()
+{
+ // initial antriggern
+ ULONG nHelpId = 0L;
+ SfxDispatcher* pDispatcher = SFX_APP()->GetDispatcher_Impl();
+ SfxShell *pShell;
+ for ( USHORT nShellLevel = 0;
+ !nHelpId && 0 != ( pShell = pDispatcher->GetShell(nShellLevel) );
+ ++nShellLevel )
+ nHelpId = pShell->GetHelpId();
+ LoadTopic( nHelpId );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxHelpPI::FillInfo(SfxChildWinInfo& rInfo ) const
+{
+ SfxDockingWindow::FillInfo( rInfo );
+ rInfo.aExtraString += '#';
+// rInfo.aExtraString += String( pHelpPI->GetCurScale() );
+}
+
+//-------------------------------------------------------------------------
+
+SfxHelpPI::SfxHelpPI(SfxBindings* pBindinx, SfxChildWindow* pCW, Window* pParent, USHORT nScale )
+ : SfxDockingWindow( pBindinx, pCW, pParent,
+ WB_CLOSEABLE | WB_DOCKABLE | WB_CLIPCHILDREN | WB_MOVEABLE | WB_SIZEABLE | WB_DIALOGCONTROL | WB_3DLOOK ),
+ pInnerWindow( NULL ),
+ aTipBox( this, WB_3DLOOK )
+{
+ AlwaysEnableInput( TRUE, TRUE );
+ Enable( TRUE, TRUE );
+ bInShowMe = FALSE;
+ nTip = 0;
+
+ aTopicJustRequestedTimer.SetTimeout( 200 );
+
+ pInnerWindow = new Window( this, WB_DIALOGCONTROL );
+
+// pHelpPI = new HelpPI( pInnerWindow, TRUE );
+// pHelpPI->SetSpecialLinkHdl( LINK( this, SfxHelpPI, SpecialLinkHdl ) );
+// pHelpPI->SetToolboxHdl( LINK( this, SfxHelpPI, PIToolboxHdl ) );
+
+ SetText( DEFINE_CONST_UNICODE("Help Agent") );
+
+ SetSizePixel( LogicToPixel( Size( 150, 70 ), MapMode( MAP_SYSFONT ) ) );
+ pInnerWindow->SetSizePixel( LogicToPixel ( Size( 147, 67 ), MapMode( MAP_SYSFONT ) ) );
+ pInnerWindow->SetPosPixel( LogicToPixel ( Point( 3, 3 ), MapMode( MAP_SYSFONT ) ) );
+
+ pInnerWindow->Show();
+
+ SetUniqueId( SID_HELP_PI );
+ SetMinOutputSizePixel( Size( 200, 100 ) );
+// if ( nScale )
+// pHelpPI->ChangeScale( nScale );
+// else
+ {
+ const long nDPI = LogicToPixel(Point(1, 1), MapMode(MAP_INCH)).X();
+// if(nDPI < 90 && GetDesktopRectPixel().GetWidth() > 1000)
+// pHelpPI->ChangeScale( 150 );
+ }
+
+// pHelpPI->GetTopicChangedHdl() = LINK( this, SfxHelpPI, TopicChangedHdl_Impl );
+ LoadTopic( HELP_INDEX );
+}
+
+BOOL SfxHelpPI::Close()
+{
+// return pHelpPI->HasDialog() ? FALSE : SfxDockingWindow::Close();
+ return TRUE;
+}
+
+void SfxHelpPI::SetTip( ULONG nTp )
+{
+ nTip = nTp;
+ if ( nTip )
+ {
+ Resize(); // Falls keine Aenderung von aussen kommt...
+ aTipBox.SetHelpId( HID_HELPAGENT_TIP_BOX );
+ aTipBox.SetClickHdl( LINK( this, SfxHelpPI, TipBoxHdl ) );
+ aTipBox.Show();
+ }
+ else
+ {
+ aTipBox.Hide();
+ Resize();
+ }
+}
+
+void SfxHelpPI::SetTipText( const String& rTip )
+{
+ String aText( SfxResId( RID_STR_NOAUTOSTARTHELPAGENT ) );
+ aText.SearchAndReplace( DEFINE_CONST_UNICODE("XX"), rTip );
+ aTipBox.SetText( aText );
+}
+
+IMPL_LINK( SfxHelpPI, PIToolboxHdl, ToolBox* , pToolBox )
+{
+ // Wird z.Zt nur fuer 'Volle Hilfe' gerufen
+ if ( pToolBox )
+ {
+ // Link kommt von ToolBox, im Hdl darf diese aber nicht durch das
+ // Abschalten des HelpPI zerstoert werden
+ // => Diesen Link nochmal als UserEvent rufen...
+ Application::PostUserEvent( LINK( this, SfxHelpPI, PIToolboxHdl ) );
+ }
+ else
+ {
+ Help* pHelp = Application::GetHelp();
+ }
+
+ return 1;
+}
+#if 0
+IMPL_LINK( SfxHelpPI, SpecialLinkHdl, SpecialLinkInfo* , pInfo )
+{
+ bInShowMe = TRUE;
+ if ( pInfo->aURL.Len() )
+ {
+ SfxStringItem aDoc( SID_FILE_NAME, pInfo->aURL );
+ SfxStringItem aRef( SID_REFERER, DEFINE_CONST_UNICODE("private:help") );
+ SFX_APP()->GetDispatcher_Impl()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON, &aDoc, &aRef, 0L );
+ }
+ bInShowMe = FALSE;
+ delete pInfo; // Dieser Link wird asynchron gerufen, deshalb wurden die Daten mit new angelegt...
+ return 0L;
+}
+#endif
+
+IMPL_LINK( SfxHelpPI, TopicChangedHdl_Impl, void* , pVoid )
+{
+ if ( nTip && !aTipBox.GetText().Len() )
+ {
+// String aTitle( pHelpPI->GetTitle( nTip ) );
+ // Tip-Text erst hier, da der HelpAgent asynchron starten soll...
+// SetTipText( aTitle );
+ }
+
+ return 0L;
+}
+
+IMPL_LINK( SfxHelpPI, TipBoxHdl, CheckBox* , pBox )
+{
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ ((SfxHelp_Impl*)pHelp)->EnableTip( nTip, !pBox->IsChecked() );
+
+ return 0L;
+}
+
+//-------------------------------------------------------------------------
+
+SfxHelpPI::~SfxHelpPI()
+{
+// delete pHelpPI;
+ delete pInnerWindow;
+
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
+ if ( pHelp )
+ pHelp->HelpAgentClosed();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxHelpPI::Paint( const Rectangle& rRect)
+{
+}
+
+//-------------------------------------------------------------------------
+
+void SfxHelpPI::Resize()
+{
+ Size aSize( GetOutputSizePixel() );
+ Point aPos( pInnerWindow->GetPosPixel() );
+ aSize.Width() -= 2 * aPos.X();
+ aSize.Height() -= 2 * aPos.Y();
+
+ if ( nTip )
+ {
+ Size aTextSize( aTipBox.GetTextWidth( String() ), aTipBox.GetTextHeight());
+ if ( aSize.Height() > ( aTextSize.Height() + aPos.X() ) )
+ {
+ aSize.Height() -= aTextSize.Height() + aPos.X();
+ aTipBox.SetPosSizePixel( Point( aPos.X(), aPos.Y()+aPos.X()+aSize.Height() ),
+ Size( aSize.Width(), aTextSize.Height() ) );
+ aTipBox.Show();
+ }
+ else
+ aTipBox.Hide();
+ }
+
+ pInnerWindow->SetSizePixel( aSize );
+// pHelpPI->Resize();
+ SfxDockingWindow::Resize();
+ Invalidate();
+}
+
+//-------------------------------------------------------------------------
+
+String SfxHelpPI::GetExtraInfo() const
+{
+ return String();
+// return pHelpPI->GetCurScale();
+}
+
+void SfxHelpPI::LoadTopic( const String& rFileName, ULONG nId)
+{
+// pHelpPI->LoadTopic( rFileName, nId );
+}
+
+void SfxHelpPI::LoadTopic( ULONG nId )
+{
+ // at the moment no implementation
+}
+
+void SfxHelpPI::LoadTopic( const String& rKeyword )
+{
+ SfxObjectShell* pShell = SfxObjectShell::Current();
+ if ( pShell )
+ {
+ INetURLObject aAbsName( SfxHelp_Impl::GetHelpPath() );
+ aAbsName.insertName( pShell->GetFactory().GetHelpFile() );
+ aAbsName.setExtension( DEFINE_CONST_UNICODE("svh") );
+ String aFileName = aAbsName.GetMainURL();
+// pHelpPI->LoadTopic( aFileName, rKeyword );
+ }
+}
+
+SfxHelp_Impl::SfxHelp_Impl()
+{
+ nLastDialog = 0;
+ pHelpInfo = 0;
+// pHelpCache = 0;
+ pPIStarterList = 0;
+ pHelpFileInfos = 0;
+
+ aDialogDetector.SetTimeout( 10 );
+ aDialogDetector.SetTimeoutHdl( LINK( this, SfxHelp_Impl, DialogDetectHdl ) );
+}
+
+SfxHelp_Impl::~SfxHelp_Impl()
+{
+ aDialogDetector.Stop();
+
+// delete pHelpInfo;
+ delete pPIStarterList;
+
+ if ( pHelpFileInfos )
+ {
+ for ( USHORT n = pHelpFileInfos->Count(); n; )
+ {
+ HelpFileInfo* pInf = (HelpFileInfo*)pHelpFileInfos->GetObject( --n );
+ delete pInf;
+ }
+ delete pHelpFileInfos;
+ }
+
+ // HelpCache wird durch PTRARR_DEL geloescht.
+}
+
+USHORT SfxHelp_Impl::GetHelpFileInfoCount()
+{
+ // at the moment no implementation
+ if ( !pHelpFileInfos )
+ pHelpFileInfos = new List;
+ return pHelpFileInfos->Count();
+}
+
+HelpFileInfo* SfxHelp_Impl::GetHelpFileInfo( USHORT n )
+{
+ // GetHelpFileInfoCount() rufen, weil die Liste ggf. erst erzeugt wird
+ if ( n < GetHelpFileInfoCount() )
+ return (HelpFileInfo*) pHelpFileInfos->GetObject( n );
+ return NULL;
+
+}
+
+void SfxHelp_Impl::HelpAgentClosed()
+{
+ nLastDialog = 0;
+}
+
+String SfxHelp_Impl::GetHelpFileName( ULONG nHelpId )
+{
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
+ if ( pHelp && pHelp->aCustomHelpFile.Len() )
+ return pHelp->aCustomHelpFile;
+
+ String aHelpFileName;
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxViewFrame *pViewFrame = pSfxApp->GetViewFrame();
+ if ( pViewFrame )
+ {
+ // Wenn es ein Slot ist, kann es sein, da\s internes InPlace vorliegt
+ // und eine Container-SlotId gefragt ist
+ if (nHelpId >= (ULONG) SID_SFX_START && nHelpId <= (ULONG) SHRT_MAX)
+ {
+ if ( pViewFrame->GetParentViewFrame_Impl() )
+ {
+ // Ist es ein ContainerSlot ?
+ const SfxSlot* pSlot =
+ pSfxApp->GetSlotPool(pViewFrame).GetSlot( (USHORT) nHelpId );
+ if ( !pSlot || pSlot->IsMode( SFX_SLOT_CONTAINER ) )
+ pViewFrame = pViewFrame->GetParentViewFrame_Impl();
+ }
+ }
+
+ if( pViewFrame->GetObjectShell() )
+ aHelpFileName = pViewFrame->GetHelpFile_Impl();
+ }
+
+ if ( !aHelpFileName.Len() )
+ aHelpFileName = DEFINE_CONST_UNICODE(SFX_DESKTOP_HELPFILE_NAME);
+
+ return aHelpFileName;
+}
+
+void SfxHelp_Impl::SetCurrentHelpFile( ULONG nHelpId )
+{
+ String aString = GetHelpFileName( nHelpId );
+ if ( GetCurrentHelpFile() != aString )
+ SetHelpFile( aString );
+}
+
+Window* SfxHelp_Impl::SearchFocusWindowParent()
+{
+ RESOURCE_TYPE nType;
+ Window* pFocusParent = Application::GetFocusWindow();
+ while ( pFocusParent &&
+ ( ( nType = pFocusParent->GetType() ) != WINDOW_MODELESSDIALOG ) &&
+ ( nType != WINDOW_MODALDIALOG ) &&
+ ( nType != WINDOW_TABDIALOG ) &&
+ ( nType != WINDOW_PATHDIALOG ) &&
+ ( nType != WINDOW_FILEDIALOG ) &&
+ ( nType != WINDOW_PRINTERSETUPDIALOG ) &&
+// ( nType != WINDOW_FLOATINGWINDOW ) &&
+// ( nType != WINDOW_DOCKINGWINDOW ) &&
+ ( nType != WINDOW_PRINTDIALOG ) )
+ {
+ pFocusParent = pFocusParent->GetParent();
+ }
+ return pFocusParent;
+}
+
+void SfxHelp_Impl::CheckPIPosition()
+{
+ Window* pDialog = SearchFocusWindowParent();
+ if( ( nLastDialog != (ULONG)pDialog ) &&
+ ( !pDialog || ( ! pDialog->GetText().EqualsAscii("HelpWindow") ) ) )
+ {
+ BOOL bAccepted = TRUE;
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+
+ if ( pDialog && pHelpPI )
+ {
+// if ( pHelpPI->IsWindowOrChild( pDialog, TRUE ) && !pHelpPI->GetHelpPI()->HasDialogFocus() )
+// return;
+
+ if ( !pDialog->IsVisible() )
+ {
+ aDialogDetector.Start();
+ bAccepted = FALSE;
+ }
+ else if ( pDialog == pHelpPI->GetFloatingWindow() )
+ {
+ bAccepted = FALSE;
+ }
+ else if ( pHelpPI && pHelpPI->IsFloatingMode() )
+ {
+ // Dialog schon fertig?
+ Size aDlgSize = pDialog->GetSizePixel();
+ Point aDlgPos = pDialog->GetPosPixel();
+ // Sind Position und Groesse schon eingestellt?
+ if ( aDlgSize.Width() && ( aDlgPos.X() || aDlgPos.Y() ) )
+ {
+ Rectangle aDlgRect( aDlgPos, aDlgSize );
+ Rectangle aPIRect( pHelpPI->GetPosPixel(), pHelpPI->GetSizePixel() );
+ /* Point aPos = */ CalcFloaterPos( pHelpPI, aPIRect, aDlgRect );
+ pHelpPI->SetPosSizePixel( aPIRect.TopLeft(), aPIRect.GetSize() );
+ pHelpPI->GetFloatingWindow()->ToTop();
+ }
+ else
+ {
+ aDialogDetector.Start();
+ bAccepted = FALSE;
+ }
+ }
+ }
+
+ if ( bAccepted )
+ nLastDialog = (ULONG)pDialog;
+ }
+}
+
+IMPL_LINK( SfxHelp_Impl, DialogDetectHdl, Timer* , EMPTYARG )
+{
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI && pHelpPI->IsFloatingMode() )
+ CheckPIPosition();
+ return 1;
+}
+
+BOOL SfxHelp_Impl::Start( ULONG nHelpId )
+{
+ return ImplStart( nHelpId, TRUE, TRUE, TRUE );
+}
+
+BOOL SfxHelp_Impl::ImplStart( ULONG nHelpId, BOOL bCheckHelpFile, BOOL bChangeHelpFile, BOOL bHelpAgent )
+{
+/*! (pb) what about help?
+ static BOOL bInHelpRequest = FALSE;
+ if ( bInHelpRequest || !nHelpId || ( nHelpId == SID_EXTENDEDHELP ) )
+ {
+ if ( bInHelpRequest )
+ Sound::Beep();
+ return FALSE;
+ }
+
+
+ if ( Help::IsRightHelp() )
+ {
+ if( ImplGetHelpMode() & HELPTEXTMODE_NOHELPAGENT )
+ return FALSE;
+
+ if ( ( nHelpId == HELP_INDEX ) || !CheckHelpFile( TRUE ) )
+ return FALSE;
+
+ bInHelpRequest = TRUE;
+ SetCurrentHelpFile( nHelpId );
+ StartHelpPI( nHelpId, FALSE, FALSE );
+ bInHelpRequest = FALSE;
+ return TRUE;
+ }
+
+ bInHelpRequest = TRUE;
+
+ if( ImplGetHelpMode() & HELPTEXTMODE_NOCONTEXTHELP )
+ {
+ if( nHelpId < 20000 || nHelpId > 20006 )
+ nHelpId = HELP_INDEX;
+ }
+
+ if ( bChangeHelpFile )
+ SetCurrentHelpFile( nHelpId );
+
+ BOOL bDone = FALSE;
+ if ( !bCheckHelpFile || CheckHelpFile( TRUE ) )
+ {
+ SfxViewFrame* pFrame = SfxViewFrame::Current();
+ if ( !bHelpAgent || ( nHelpId == HELP_INDEX ) )
+// !Application::IsInModalMode() &&
+// Application::GetAppWindow()->IsEnabled() &&
+// !SearchFocusWindowParent() && // kein Dialog aktiv
+// ( !pFrame || !pFrame->GetObjectShell()->IsInModalMode() ) )
+ {
+ SfxHelpViewShell* pViewShell = GetHelpViewShell( TRUE );
+ if ( pViewShell )
+ bDone = pViewShell->ShowHelp( GetHelpFile(), nHelpId );
+ }
+ else
+ {
+ StartHelpPI( nHelpId, TRUE, FALSE );
+ SfxHelpPI* pHelpPI= SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ {
+ if ( !pHelpPI->IsFloatingMode() )
+ {
+ pHelpPI->SetFloatingMode( TRUE );
+ bForcedFloatingPI = TRUE;
+ }
+ if ( pHelpPI->GetFloatingWindow() )
+ pHelpPI->GetFloatingWindow()->ToTop();
+ CheckPIPosition();
+ bDone = TRUE;
+ }
+ }
+ }
+ bInHelpRequest = FALSE;
+ return bDone;
+*/
+ return FALSE;
+}
+
+
+BOOL SfxHelp_Impl::Start( const XubString& rKeyword )
+{
+ BOOL bDone = FALSE;
+ SetCurrentHelpFile( HELP_INDEX );
+ if ( CheckHelpFile( TRUE ) )
+ {
+ }
+ return bDone;
+}
+
+void SfxHelp_Impl::SlotExecutedOrFocusChanged( ULONG nId, BOOL bSlot, BOOL bAutoStart )
+{
+ BOOL bAutoStarted = FALSE;
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ {
+// if ( !bSlot && pHelpPI->IsWindowOrChild( Application::GetFocusWindow(), TRUE ) && !pHelpPI->GetHelpPI()->HasDialogFocus() )
+ if ( !bSlot && pHelpPI->IsWindowOrChild( Application::GetFocusWindow(), TRUE ) )
+ return; // Wenn Navigation im HelpPI, dann nicht triggern...
+ // Nicht auf Focus reagieren, wenn gerade mit F1 angetriggert
+ if ( pHelpPI->IsTopicJustRequested() )
+ return;
+
+ if ( !bSlot || !pHelpPI->IsInShowMe() )
+ pHelpPI->LoadTopic( nId );
+ }
+ else if ( bAutoStart && GetPIStarterList()->Seek_Entry( nId, 0 ) )
+ {
+ SetCurrentHelpFile( nId );
+ StartHelpPI( nId, bSlot, TRUE );
+ bAutoStarted = TRUE;
+ }
+
+ if ( !bSlot && ( pHelpPI || bAutoStarted ) )
+ CheckPIPosition();
+}
+
+
+XubString SfxHelp_Impl::GetHelpText( ULONG nHelpId )
+{
+#if defined DBG_UTIL && ( defined WNT || defined OS2 || defined UNX )
+ static int bTraceHelpIds = 2;
+ if ( bTraceHelpIds == 2 )
+ {
+ char *pHELP = getenv( "HELP" );
+ if( pHELP && !strcmp( pHELP, "MP" ) )
+ bTraceHelpIds = 1;
+ else
+ bTraceHelpIds = 0;
+ }
+ if ( bTraceHelpIds )
+ {
+ ByteString aTraceStr( "HELPID: " );
+ aTraceStr += ByteString::CreateFromInt32( nHelpId );
+ DBG_TRACE( aTraceStr.GetBuffer() );
+ }
+#endif
+
+ // at the moment no implementation
+ return XubString();
+}
+
+void SfxHelp_Impl::GetHelpURLs( const String& rRootURL, SvStringsDtor& rLst )
+{
+ AssertValidHelpDocInfo();
+ // pHelpInfo->GetHelpURLs( rRootURL, rLst );
+}
+
+void SfxHelp_Impl::GetBookmarks( SvStringsDtor& rLst )
+{
+ AssertValidHelpDocInfo();
+// pHelpInfo->GetBookmarks( rLst );
+}
+
+void SfxHelp_Impl::AddBookmark( const String& rName, const String& rURL )
+{
+ AssertValidHelpDocInfo();
+// pHelpInfo->AddBookmark( rName, rURL );
+}
+
+void SfxHelp_Impl::RemoveBookmark( const String& rName )
+{
+ AssertValidHelpDocInfo();
+// pHelpInfo->RemoveBookmark( rName );
+}
+
+void SfxHelp_Impl::RenameBookmark( const String& rOldTitle, const String& rNewTitle )
+{
+ AssertValidHelpDocInfo();
+// pHelpInfo->RenameBookmark( rOldTitle, rNewTitle );
+}
+
+
+BOOL SfxHelp_Impl::CheckHelpFile( BOOL bPrompt ) const
+{
+ return SfxHelp_Impl::CheckHelpFile( GetHelpFile(), bPrompt );
+}
+
+BOOL SfxHelp_Impl::CheckHelpFile( const String& rFileName, BOOL bPrompt )
+{
+ // at the moment no implementation
+ BOOL bOK = FALSE;
+ if ( !bOK && bPrompt )
+ {
+ Window* pParent = Application::GetFocusWindow();
+ String aErrorStr( SfxResId( RID_STR_HLPFILENOTEXIST ) );
+ InfoBox( pParent, aErrorStr ).Execute();
+ }
+
+ return bOK;
+}
+
+void SfxHelp_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ SfxSimpleHint *pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ if ( pHint && ( pHint->GetId() & SFX_HINT_DYING ) )
+ {
+ // z.Zt. lausche ich nur am HelpDoc...
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxHelp_Impl::SetHelpFile( const String &rFileName, BOOL bAdjustExt )
+{
+ INetURLObject aAbsName( GetHelpPath() );
+ aAbsName.insertName( rFileName );
+
+ if ( bAdjustExt )
+ aAbsName.setExtension( DEFINE_CONST_UNICODE("svh") );
+
+ String aFileName = aAbsName.PathToFileName();
+// InfoBox( 0, aFileName ).Execute();
+ Help::SetHelpFile( aFileName );
+ aCurHelpFile = rFileName;
+}
+
+void SfxHelp_Impl::AssertValidHelpDocInfo()
+{
+// if ( !pHelpInfo || ( pHelpInfo->GetRequestedFileName() != GetHelpFile() ) )
+ {
+// delete pHelpInfo;
+// pHelpInfo = new SHelpInfo( GetHelpFile(), FALSE ); // vielleicht doch cachable?
+ }
+}
+
+String SfxHelp_Impl::GetHelpPath()
+{
+ SfxIniManager* pIni = SFX_INIMANAGER()->Find( SFX_KEY_HELP_DIR );
+ if ( !pIni )
+ pIni = SFX_INIMANAGER();
+ String aHelpDir = pIni->Get( SFX_KEY_HELP_DIR );
+
+ if ( aHelpDir.Len() )
+ {
+ String aPath;
+ INetURLObject aHelpRoot( aHelpDir, INET_PROT_FILE );
+
+ // Nach Prioritaeten das richtige Language-Dir suchen...
+ LanguageType eLanguage = Application::GetSettings().GetInternational().GetLanguage();
+ for ( USHORT nPrio = 0; nPrio <= 4; nPrio++ )
+ {
+ const char* pLang = ResMgr::GetLang( eLanguage, nPrio );
+ if ( pLang )
+ {
+ INetURLObject aTemp = aHelpRoot;
+ aTemp.insertName( String::CreateFromAscii( pLang ) );
+ if ( 0 /*! Exists??? */ )
+ {
+ return aTemp.GetMainURL();
+ }
+ }
+ }
+ return aPath;
+ }
+ else
+ {
+ INetURLObject aObj( Application::GetAppFileName(), INET_PROT_FILE );
+ return aObj.GetMainURL();
+ }
+}
+
+void SfxHelp_Impl::CreatePIStarterList()
+{
+ // Config:
+ // [Tips]
+ // Slot=0/1
+
+ DBG_ASSERT( !pPIStarterList, "PIStarterList existiert schon!" );
+ pPIStarterList = new SortedULONGs;
+ Config aConfig( GetHelpAgentConfig() );
+ ImplSetLanguageGroup( aConfig, String::CreateFromAscii(zsHelpAgentConfig_Tips), TRUE );
+ USHORT nTips = aConfig.GetKeyCount();
+ for ( USHORT nTip = 0; nTip < nTips; nTip++ )
+ {
+ if ( (BOOL)(USHORT)aConfig.ReadKey( nTip ).ToInt32() )
+ {
+ ULONG nId = aConfig.GetKeyName( nTip ).ToInt32();
+ if ( nId )
+ pPIStarterList->Insert( nId );
+ }
+ }
+}
+
+void SfxHelp_Impl::StartHelpPI( ULONG nHelpId, BOOL bSlot, BOOL bTip )
+{
+/*! (pb) what about help?
+ if( ImplGetHelpMode() & HELPTEXTMODE_NOHELPAGENT )
+ return;
+
+ BOOL bValidHelpFile = CheckHelpFile( FALSE );
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( !pHelpPI && bValidHelpFile )
+ {
+ SFX_APP()->SetChildWindow( SID_HELP_PI, TRUE );
+ pHelpPI = SFX_APP()->GetHelpPI();
+ CheckPIPosition();
+ }
+ else if ( pHelpPI && !bValidHelpFile )
+ {
+ SFX_APP()->SetChildWindow( SID_HELP_PI, FALSE );
+ pHelpPI = NULL;
+ }
+
+ if ( pHelpPI )
+ {
+ if ( bTip )
+ {
+ pHelpPI->SetTip( nHelpId );
+ if ( !bSlot )
+ {
+ // Start ueber Focus => Text des Controls...
+ Window* pWin = Application::GetFocusWindow();
+ if ( pWin && pWin->GetText().Len() )
+ {
+ String aText( pWin->GetText() );
+ aText.EraseAllChars( '~' );
+ pHelpPI->SetTipText( aText );
+ }
+ }
+ }
+ pHelpPI->LoadTopic( nHelpId );
+ pHelpPI->SetTopicJustRequested( TRUE );
+ }
+*/
+}
+
+void SfxHelp_Impl::EnableTip( ULONG nTip, BOOL bEnable )
+{
+ Config aConfig( GetHelpAgentConfig() );
+ ImplSetLanguageGroup( aConfig, String::CreateFromAscii(zsHelpAgentConfig_Tips), TRUE );
+ aConfig.WriteKey( ByteString::CreateFromInt32( nTip ),
+ ByteString::CreateFromInt32( (USHORT)bEnable ) );
+ if ( !bEnable )
+ {
+ USHORT nPos;
+ if ( GetPIStarterList()->Seek_Entry( nTip, &nPos ) )
+ GetPIStarterList()->Remove( nPos );
+ }
+ else
+ GetPIStarterList()->Insert( nTip );
+}
+
+void SfxHelp_Impl::ResetPIStarterList()
+{
+ delete pPIStarterList;
+ pPIStarterList = 0;
+
+ Config aConfig( GetHelpAgentConfig() );
+ ImplSetLanguageGroup( aConfig, String::CreateFromAscii(zsHelpAgentConfig_Tips), TRUE );
+ USHORT nTips = aConfig.GetKeyCount();
+ ByteString aOn = ByteString::CreateFromInt32( 1 );
+ for ( USHORT nTip = 0; nTip < nTips; nTip++ )
+ aConfig.WriteKey( aConfig.GetKeyName( nTip ), aOn );
+}
+
+String SfxHelp_Impl::GetConfigDir( BOOL bGetSharedConfig )
+{
+ ULONG nKey = bGetSharedConfig ? SFX_KEY_CONFIG_DIR : SFX_KEY_USERCONFIG_PATH;
+ SfxIniManager* pIni = SFX_INIMANAGER()->Find( nKey );
+ if ( !pIni )
+ pIni = SFX_INIMANAGER();
+ return pIni->Get( nKey );
+}
+
+String SfxHelp_Impl::GetHelpAgentConfig()
+{
+ INetURLObject aObj( GetConfigDir( FALSE ), INET_PROT_FILE );
+ aObj.insertName( String::CreateFromAscii( zsHelpAgentConfig ) );
+ return aObj.PathToFileName();
+}
+
+
+void SfxHelp::SetCustomHelpFile( const String& rName )
+{
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
+ pHelp->aCustomHelpFile = rName;
+}
+
+void SfxHelp::ShowHint( ULONG nId )
+{
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
+ if ( pHelp )
+ {
+ pHelp->SlotExecutedOrFocusChanged( nId, TRUE, TRUE );
+ // Falls sofort eine Slot-Id folgt, diese unterdruecken
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ pHelpPI->SetTopicJustRequested( TRUE );
+ }
+}
+
+BOOL SfxHelp::ShowHelp( ULONG nId, BOOL bShowInHelpAgent, const char* pFileName, BOOL bQuiet )
+{
+ // at the moment no implementation
+ return FALSE;
+}
+
+BOOL SfxHelp::ShowHelp( const String& rKeyword, BOOL bShowInHelpAgent, const char* pFileName )
+{
+ // at the moment no implementation
+ BOOL bDone = FALSE;
+ return bDone;
+}
+
+USHORT SfxHelp::GetHelpFileInfoCount()
+{
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
+ return pHelp ? pHelp->GetHelpFileInfoCount() : 0;
+}
+
+HelpFileInfo* SfxHelp::GetHelpFileInfo( USHORT n )
+{
+ SfxHelp_Impl* pHelp = (SfxHelp_Impl*) Application::GetHelp();
+ return pHelp ? pHelp->GetHelpFileInfo( n ) : NULL;
+}
+
+// class SfxHelpTipsWrapper ----------------------------------------------
+
+SfxHelpTipsWrapper::SfxHelpTipsWrapper(Window *pParent,
+ USHORT nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo) :
+ SfxChildWindow(pParent, nId)
+{
+ // Skalierung des HelpPI initialisieren
+ USHORT nScale = 100;
+ if ( pInfo->aExtraString.Len() )
+ {
+ USHORT nPos = pInfo->aExtraString.Search(0x0023); // '#' = 23h
+ if ( nPos != STRING_NOTFOUND )
+ {
+ String aScale = pInfo->aExtraString.Erase(nPos+1);
+ pInfo->aExtraString.Erase(nPos,1);
+ nScale = (USHORT) aScale.ToInt32();
+ }
+ else
+ {
+ // Es ist noch ein alter Eintrag (FloatingWindow); das Alignment
+ // wird dann in Initialize nicht ver"andert.
+ pInfo->aExtraString.Erase();
+ }
+ }
+
+ // Versuche, das TipWindow zu laden
+ SfxHelpTipsWindow* pDockWindow = new SfxHelpTipsWindow( pBindings, this, pParent );
+ pWindow = pDockWindow;
+
+ eChildAlignment = SFX_ALIGN_BOTTOM;
+ if ( !pInfo->aSize.Width() )
+ {
+ Size aSz( 400, 150 );
+ pWindow->SetSizePixel( aSz );
+ }
+
+ pDockWindow->Initialize( pInfo );
+}
+
+SfxHelpTipsWindow::SfxHelpTipsWindow( SfxBindings* pBindings, SfxChildWindow* pChildWin, Window* pParent )
+ : SfxDockingWindow( pBindings, pChildWin, pParent,
+ WB_CLOSEABLE | WB_DOCKABLE | WB_CLIPCHILDREN | WB_MOVEABLE | WB_SIZEABLE | WB_DIALOGCONTROL | WB_3DLOOK ),
+
+ maCloseButton( this, 0 ),
+ maCheckBox( this, 0 ),
+ maTipWindow( this, WB_BORDER )
+{
+ mpHelpPI = NULL;
+
+ maCloseButton.SetSymbol( SYMBOL_CLOSE );
+ maCloseButton.SetClickHdl( LINK( this, SfxHelpTipsWindow, CloseButtonHdl ) );
+
+ maCheckBox.SetClickHdl( LINK( this, SfxHelpTipsWindow, CheckBoxHdl ) );
+ maCheckBox.SetHelpId( HID_HELPAGENT_TIP_BOX );
+ maCheckBox.SetText( String( SfxResId( RID_STR_NOWELCOMESCREEN ) ) );
+
+ PostUserEvent( LINK( this, SfxHelpTipsWindow, ShowTip ) );
+
+#ifdef DEBUG
+ maTipWindow.SetBackground( Wallpaper( COL_GREEN ) );
+#endif
+
+ maCloseButton.Show();
+ maTipWindow.Show();
+ maCheckBox.Show();
+}
+
+SfxHelpTipsWindow::~SfxHelpTipsWindow()
+{
+// delete mpHelpPI;
+}
+
+void SfxHelpTipsWindow::FillInfo( SfxChildWinInfo& rInfo ) const
+{
+ SfxDockingWindow::FillInfo( rInfo );
+ rInfo.bVisible = FALSE; // Visibility wird ueber Config gesteuert
+}
+
+void SfxHelpTipsWindow::Resize()
+{
+ Size aOutSz( GetOutputSizePixel() );
+ const long nButtonSize = 16;
+ const long nSpace = 2;
+ Size aCheckBoxSz = maCheckBox.CalcMinimumSize();
+ aCheckBoxSz.Width() += 4; // FocusRect
+ long nWindowPos = IsFloatingMode() ? 0 : (nButtonSize+2*nSpace);
+ maCloseButton.Show( !IsFloatingMode() );
+
+ maCloseButton.SetPosSizePixel( nSpace, nSpace, nButtonSize, nButtonSize );
+ maCheckBox.SetPosSizePixel( nWindowPos, aOutSz.Height() - aCheckBoxSz.Height() - nSpace,
+ aCheckBoxSz.Width(), aCheckBoxSz.Height() );
+ maTipWindow.SetPosSizePixel( nWindowPos, 0,
+ aOutSz.Width() - nWindowPos, aOutSz.Height() - aCheckBoxSz.Height() - 2*nSpace );
+
+// if ( mpHelpPI )
+// mpHelpPI->Resize();
+}
+
+IMPL_LINK( SfxHelpTipsWindow, ShowTip, void*, EMPTYARG )
+{
+ ULONG nId = 0;
+ Config aConfig( SfxHelp_Impl::GetHelpAgentConfig() );
+ ImplSetLanguageGroup( aConfig, DEFINE_CONST_UNICODE("WelcomeScreen"), TRUE );
+ USHORT nTips = aConfig.GetKeyCount();
+ for ( USHORT nTip = 0; nTip < nTips; nTip++ )
+ {
+ if ( (BOOL)(USHORT)aConfig.ReadKey( nTip ).ToInt32() )
+ {
+ nId = aConfig.GetKeyName( nTip ).ToInt32();
+ break;
+ }
+ }
+
+ if ( nId )
+ {
+ // at the moment no implementation
+ }
+
+ return 0;
+}
+
+IMPL_LINK( SfxHelpTipsWindow, CloseButtonHdl, Button*, EMPTYARG )
+{
+ Close();
+ return 0;
+}
+
+IMPL_LINK( SfxHelpTipsWindow, CheckBoxHdl, CheckBox*, EMPTYARG )
+{
+ SFX_APP()->GetOptions().SetWelcomeScreen( !maCheckBox.IsChecked() );
+ return 0;
+}
+
+
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
new file mode 100644
index 000000000000..edfd1544c114
--- /dev/null
+++ b/sfx2/source/appl/workwin.cxx
@@ -0,0 +1,3148 @@
+/*************************************************************************
+ *
+ * $RCSfile: workwin.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "workwin.hxx"
+#include "topfrm.hxx"
+#include "clientsh.hxx"
+#include "arrdecl.hxx"
+#include "viewfrm.hxx"
+#include "module.hxx"
+#include "dispatch.hxx"
+#include "tbxmgr.hxx"
+#include "tbxchild.hxx"
+#include "tbxconf.hxx"
+#include "imgmgr.hxx"
+#include "dockwin.hxx"
+#include "viewsh.hxx"
+#include "ipenv.hxx"
+#include "splitwin.hxx"
+#include "msgpool.hxx"
+#include "sfxhelp.hxx"
+#include "stbmgr.hxx"
+
+DBG_NAME(SfxWorkWindow);
+
+SV_IMPL_OBJARR( SfxObjectBarArr_Impl, SfxObjectBar_Impl );
+
+//====================================================================
+// Sortiert die Children nach ihrem Alignment
+// Reihenfolge entspricht der im enum SfxChildAlignment (->CHILDWIN.HXX).
+//
+
+// Hilfe, um die "Anderungen am Alignment kompatibal zu machen!
+
+BOOL IsAppWorkWinToolbox_Impl( USHORT nPos )
+{
+ switch ( nPos )
+ {
+ case SFX_OBJECTBAR_APPLICATION :
+ case SFX_OBJECTBAR_MACRO:
+ case SFX_OBJECTBAR_FULLSCREEN:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+USHORT TbxMatch( USHORT nPos )
+{
+ switch ( nPos )
+ {
+ case SFX_OBJECTBAR_APPLICATION :
+ return 0;
+ break;
+ case SFX_OBJECTBAR_OPTIONS:
+ return 1;
+ break;
+ case SFX_OBJECTBAR_MACRO:
+ return 2;
+ break;
+ case SFX_OBJECTBAR_OBJECT:
+ return 3;
+ break;
+ case SFX_OBJECTBAR_TOOLS:
+ return 4;
+ break;
+ case SFX_OBJECTBAR_FULLSCREEN:
+ case SFX_OBJECTBAR_COMMONTASK:
+ case SFX_OBJECTBAR_RECORDING:
+ return nPos+1;
+ break;
+ default:
+ return nPos;
+ break;
+ }
+}
+
+USHORT ChildAlignValue(SfxChildAlignment eAlign)
+{
+ USHORT ret = 17;
+
+ switch (eAlign)
+ {
+ case SFX_ALIGN_HIGHESTTOP:
+ ret = 1;
+ break;
+ case SFX_ALIGN_LOWESTBOTTOM:
+ ret = 2;
+ break;
+ case SFX_ALIGN_FIRSTLEFT:
+ ret = 3;
+ break;
+ case SFX_ALIGN_LASTRIGHT:
+ ret = 4;
+ break;
+ case SFX_ALIGN_LEFT:
+ ret = 5;
+ break;
+ case SFX_ALIGN_RIGHT:
+ ret = 6;
+ break;
+ case SFX_ALIGN_FIRSTRIGHT:
+ ret = 7;
+ break;
+ case SFX_ALIGN_LASTLEFT:
+ ret = 8;
+ break;
+ case SFX_ALIGN_TOP:
+ ret = 9;
+ break;
+ case SFX_ALIGN_BOTTOM:
+ ret = 10;
+ break;
+ case SFX_ALIGN_TOOLBOXTOP:
+ ret = 11;
+ break;
+ case SFX_ALIGN_TOOLBOXBOTTOM:
+ ret = 12;
+ break;
+ case SFX_ALIGN_LOWESTTOP:
+ ret = 13;
+ break;
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ ret = 14;
+ break;
+ case SFX_ALIGN_TOOLBOXLEFT:
+ ret = 15;
+ break;
+ case SFX_ALIGN_TOOLBOXRIGHT:
+ ret = 16;
+ break;
+ }
+
+ return ret;
+}
+
+USHORT ChildTravelValue( SfxChildAlignment eAlign )
+{
+ USHORT ret = 17;
+
+ switch (eAlign)
+ {
+ case SFX_ALIGN_FIRSTLEFT:
+ ret = 1;
+ break;
+ case SFX_ALIGN_LEFT:
+ ret = 2;
+ break;
+ case SFX_ALIGN_LASTLEFT:
+ ret = 3;
+ break;
+ case SFX_ALIGN_TOOLBOXLEFT:
+ ret = 4;
+ break;
+ case SFX_ALIGN_HIGHESTTOP:
+ ret = 5;
+ break;
+ case SFX_ALIGN_TOP:
+ ret = 6;
+ break;
+ case SFX_ALIGN_TOOLBOXTOP:
+ ret = 7;
+ break;
+ case SFX_ALIGN_LOWESTTOP:
+ ret = 8;
+ break;
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ ret = 9;
+ break;
+ case SFX_ALIGN_TOOLBOXBOTTOM:
+ ret = 10;
+ break;
+ case SFX_ALIGN_BOTTOM:
+ ret = 11;
+ break;
+ case SFX_ALIGN_LOWESTBOTTOM:
+ ret = 12;
+ break;
+ case SFX_ALIGN_TOOLBOXRIGHT:
+ ret = 13;
+ break;
+ case SFX_ALIGN_FIRSTRIGHT:
+ ret = 14;
+ break;
+ case SFX_ALIGN_RIGHT:
+ ret = 15;
+ break;
+ case SFX_ALIGN_LASTRIGHT:
+ ret = 16;
+ break;
+ }
+
+ return ret;
+}
+
+void SfxWorkWindow::Sort_Impl()
+{
+ aSortedList.Remove(0, aSortedList.Count());
+ for (USHORT i=0; i<pChilds->Count(); i++)
+ {
+ SfxChild_Impl *pCli = (*pChilds)[i];
+ if (pCli)
+ {
+ USHORT k;
+ for (k=0; k<aSortedList.Count(); k++)
+// if ( (*pChilds)[aSortedList[k]]->eAlign > pCli->eAlign )
+ if (ChildAlignValue((*pChilds)[aSortedList[k]]->eAlign) >
+ ChildAlignValue(pCli->eAlign))
+ break;
+ aSortedList.Insert (i,k);
+ }
+ }
+
+ bSorted = TRUE;
+}
+
+
+//====================================================================
+// ctor f"ur workwin eines Frames
+
+SfxFrameWorkWin_Impl::SfxFrameWorkWin_Impl( Window *pWin, SfxFrame *pFrm )
+ : SfxWorkWindow(
+ pWin,
+ pFrm->GetCurrentViewFrame()->GetBindings(),
+ pFrm->GetParentFrame() ? pFrm->GetParentFrame()->GetWorkWindow_Impl() : NULL )
+ , pFrame( pFrm )
+{
+ pConfigShell = pFrm->GetCurrentViewFrame();
+
+ // Die ben"otigten SplitWindows (je eins f"ur jede Seite) werden erzeugt
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ // Die SplitWindows sind direkte ChildWindows des WorkWindows und enthalten
+ // die angedockten Fenster.
+
+ SfxChildAlignment eAlign =
+ ( n == SFX_SPLITWINDOWS_LEFT ? SFX_ALIGN_LEFT :
+ n == SFX_SPLITWINDOWS_RIGHT ? SFX_ALIGN_RIGHT :
+ n == SFX_SPLITWINDOWS_TOP ? SFX_ALIGN_TOP :
+ SFX_ALIGN_BOTTOM );
+ SfxSplitWindow *pWin = new SfxSplitWindow(pWorkWin, eAlign, this, pParent==0 );
+ pSplit[n] = pWin;
+ }
+
+ nOrigMode = SFX_VISIBILITY_CLIENT;
+ nUpdateMode = SFX_VISIBILITY_STANDARD;
+}
+
+//====================================================================
+// ctor f"ur workwin eines InPlaceObjects.
+
+SfxIPWorkWin_Impl::SfxIPWorkWin_Impl( WorkWindow *pWin, SfxBindings& rB,
+ SfxInPlaceEnv_Impl *pE) :
+ SfxWorkWindow(pWin, rB),
+ pEnv(pE)
+{
+ // Die ben"otigten SplitWindows (je eins f"ur jede Seite) werden erzeugt
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ // Die SplitWindows sind direkte ChildWindows des WorkWindows und enthalten
+ // die angedockten Fenster.
+
+ SfxChildAlignment eAlign =
+ ( n == SFX_SPLITWINDOWS_LEFT ? SFX_ALIGN_LEFT :
+ n == SFX_SPLITWINDOWS_RIGHT ? SFX_ALIGN_RIGHT :
+ n == SFX_SPLITWINDOWS_TOP ? SFX_ALIGN_TOP :
+ SFX_ALIGN_BOTTOM );
+ SfxSplitWindow *pWin = new SfxSplitWindow(pWorkWin, eAlign, this, FALSE);
+ pSplit[n] = pWin;
+ }
+
+ nOrigMode = SFX_VISIBILITY_SERVER;
+ nUpdateMode = SFX_VISIBILITY_SERVER;
+ if ( !pParent )
+ aStatBar.bOn = sal_True;
+}
+
+//====================================================================
+// ctor der Basisklasse
+
+SfxWorkWindow::SfxWorkWindow( Window *pWin, SfxBindings& rB, SfxWorkWindow* pParentWorkwin ) :
+ pWorkWin (pWin),
+ pParent( pParentWorkwin ),
+ bSorted( TRUE ),
+ pBindings(&rB),
+ bDockingAllowed(TRUE),
+ bAllChildsVisible(TRUE),
+ nChilds( 0 ),
+ nOrigMode( 0 ),
+ pConfigShell( 0 ),
+ pActiveChild( 0 )
+{
+ DBG_CTOR(SfxWorkWindow, 0);
+ DBG_ASSERT (pBindings, "Keine Bindings!");
+
+ pBindings->SetWorkWindow_Impl( this );
+
+ pChildWins = new SfxChildWindows_Impl;
+ pChilds = new SfxChildList_Impl;
+
+ // F"ur die ObjectBars wird ein fester Platz in der ChildList reserviert,
+ // damit sie immer in einer definierten Reihenfolge kommen.
+ SfxChild_Impl* pChild=0;
+ for (USHORT n=0; n < SFX_OBJECTBAR_MAX; ++n)
+ pChilds->Insert(0,pChild);
+}
+
+//====================================================================
+// dtor
+
+SfxWorkWindow::~SfxWorkWindow()
+{
+ DBG_DTOR(SfxWorkWindow, 0);
+
+ // Hilfsstruktur f"ur Child-Windows l"oschen
+ DBG_ASSERT( pChilds->Count() == 0, "dangling childs" );
+ delete pChilds;
+ delete pChildWins;
+}
+
+SystemWindow* SfxWorkWindow::GetTopWindow() const
+{
+ Window* pRet = pWorkWin;
+ while ( pRet && !pRet->IsSystemWindow() )
+ pRet = pRet->GetParent();
+ return (SystemWindow*) pRet;
+}
+
+void SfxWorkWindow::ChangeWindow_Impl( Window *pNew )
+{
+ Window *pOld = pWorkWin;
+ pWorkWin = pNew;
+ for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos )
+ {
+ SfxChild_Impl *pCli = (*pChilds)[nPos];
+ if ( pCli && pCli->pWin && pCli->pWin->GetParent() == pOld )
+ {
+ pCli->pWin->SetParent( pNew );
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+// Hilfsmethode zum Freigeben der Childlisten. Wenn danach nicht der dtor
+// aufgerufen wird, sondern weiter gearbeitet wird, mu\s wie im ctor von
+// SfxWorkWindow noch Platz f"ur die Objectbars und SplitWindows reserviert
+// werden.
+
+void SfxWorkWindow::DeleteControllers_Impl()
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+
+ // SplitWindows locken (d.h. Resize-Reaktion an den
+ // DockingWindows unterdr"ucken)
+ USHORT n;
+ for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ SfxSplitWindow *p = pSplit[n];
+ if (p->GetWindowCount())
+ p->Lock();
+ }
+
+ // Child-Windows l"oschen
+ USHORT nCount = pChildWins->Count();
+ for ( n=0; n<nCount; n++ )
+ {
+ SfxChildWin_Impl* pCW = (*pChildWins)[n];
+ SfxChildWindow *pChild = pCW->pWin;
+ if (pChild)
+ {
+ pChild->Hide();
+
+ // Wenn das ChildWindow ein direktes Childfenster ist und nicht
+ // in einem SplitWindow liegt, am WorkWindow abmelden.
+ // Nach TH ist eine Abmeldung am Splitwindow nicht erforderlich,
+ // wenn dieses auch gleich mit zerst"ort wird (s.u.).
+ if (pCW->pCli)
+ ReleaseChild_Impl(*pChild->GetWindow());
+ pCW->pWin = 0;
+ delete pChild;
+ }
+ delete pCW->pControl;
+ delete pCW;
+ }
+
+ pChildWins->Remove((USHORT)0, nCount);
+
+ // SplitWindows l"oschen
+ for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ SfxSplitWindow *p = pSplit[n];
+ if (p->GetWindowCount())
+ ReleaseChild_Impl(*p);
+ delete p;
+ }
+
+ // StatusBar l"oschen
+ if ( aStatBar.pStatusBar )
+ {
+ StatusBar *pBar = aStatBar.pStatusBar->GetStatusBar();
+ aStatBar.pStatusBar->StoreConfig();
+ ReleaseChild_Impl( *pBar );
+ DELETEZ( aStatBar.pStatusBar );
+ delete pBar;
+ }
+
+ // ObjectBars l"oschen( zuletzt, damit pChilds nicht tote Pointer enh"alt )
+ for (n=0; n<SFX_OBJECTBAR_MAX; n++)
+ {
+ delete (*pChilds)[TbxMatch(n)];
+
+ // Nicht jede Position mu\s belegt sein
+ SfxToolBoxManager *pTbx = aObjBars[n].pTbx;
+ if (pTbx)
+ {
+ // Release siehe unten
+ pTbx->StoreConfig();
+ delete(pTbx);
+ }
+ }
+
+ // ObjectBars werden alle auf einmal released, da sie einen
+ // festen zusammenh"angenden Bereich im Array pChilds belegen
+ pChilds->Remove(0, SFX_OBJECTBAR_MAX);
+ nChilds = 0;
+}
+
+//====================================================================
+// Virtuelle Methode zum Anordnen der Childfenster.
+
+void SfxWorkWindow::ArrangeChilds_Impl()
+{
+ aClientArea = GetTopRect_Impl();
+ if ( nChilds )
+ Arrange_Impl (aClientArea);
+}
+
+//====================================================================
+// Virtuelle Methode zum Anordnen der Childfenster. Bei InPlaceObjects
+// steht daf"ur als Fl"ache das Rectangle zur Verf"ugung, das am
+// InPlaceClient als TopOuterRect abgefragt werden kann. Diese wird
+// durch den von Arrange_Impl() errechneten SvBorder verringert.
+
+void SfxIPWorkWin_Impl::ArrangeChilds_Impl()
+{
+ aClientArea = GetTopRect_Impl();
+
+ SvBorder aBorder;
+ if ( nChilds )
+ aBorder = Arrange_Impl( aClientArea );
+
+ // Wenn das zugeh"orige Objekt noch die UI-Kontrolle hat, mu\s der
+ // AppBorder gesetzt werden; wenn hier allerdings die UITools entfernt
+ // werden, tut das demn"achst der Container.
+ // (->SfxContainerEnv_Impl::UIToolsShown())
+
+ if ( pEnv->IsShowUITools() )
+ pEnv->GetContainerEnv()->SetTopToolSpacePixel(aBorder);
+ ArrangeAutoHideWindows( NULL );
+}
+
+//====================================================================
+// Virtuelle Methode zum Anordnen der Childfenster. Bei einer Task
+// steht daf"ur als Fl"ache die OutputSize des TaskWindows zur Verf"ugung.
+// Sie wird durch den von Arrange_Impl() errechneten SvBorder verringert.
+
+void SfxFrameWorkWin_Impl::ArrangeChilds_Impl()
+{
+ if ( pFrame->IsClosing_Impl() )
+ return;
+
+ aClientArea = GetTopRect_Impl();
+
+ SvBorder aBorder;
+ if ( nChilds )
+ aBorder = Arrange_Impl (aClientArea);
+
+ // Wenn das aktuelle Dokument der Applikation einen IPClient enth"alt, mu\s
+ // dem dazugeh"origen Objekt durch SetTopToolFramePixel der zur Verf"ugung
+ // stehende Platz zugeteilt werden. Das Objekt zeigt dann seine UITools an
+ // und setzt den App-Border(->SfxInPlaceEnv_Impl::ArrangeChilds_Impl()).
+ // Anderenfalls wird hier direkt der AppBorder gesetzt, um evtl. den Border
+ // zu "uberschreiben, den bisher ein Objekt aus einem anderen Dokument
+ // gesetzt hatte.
+ // Das Objekt setzt, wenn es seine UI-Tools wegnimmt, den SetAppBorder nicht,
+ // damit kein ObjectBar-Zappeln entsteht.
+ // (->SfxInPlaceEnv_Impl::ArrangeChilds_Impl())
+ SfxInPlaceClient *pClient = 0;
+ SfxViewFrame *pF = pFrame->GetCurrentViewFrame();
+ if ( pF && pF->GetViewShell() )
+ pClient = pF->GetViewShell()->GetIPClient();
+
+ if ( pClient )
+ pClient->GetEnv()->SetTopToolFramePixel( aBorder );
+ else
+ pFrame->SetToolSpaceBorderPixel_Impl( aBorder );
+
+ ArrangeAutoHideWindows( NULL );
+}
+
+//--------------------------------------------------------------------
+
+SvBorder SfxWorkWindow::Arrange_Impl(Rectangle &rRect)
+
+/* [Beschreibung]
+
+ Diese Methode ordnet alle sichtbaren ChildFenster so an, da\s die angedockten
+ Fenster nach der Sorierreihenfolge von au\sen nach innen aneinander
+ gesetzt werden. Wenn ein an sich sichtbares Fenster nicht mehr in die
+ noch freie ClientArea pa\st, wird es auf "nicht sichtbar" gesetzt.
+
+*/
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+
+ Rectangle aTmp( rRect );
+
+ if (!bSorted)
+ Sort_Impl();
+
+ SvBorder aBorder;
+ Point aPos;
+ Size aSize;
+
+ for ( USHORT n=0; n<aSortedList.Count(); ++n )
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]];
+ if ( !pCli->pWin )
+ continue;
+
+ // Zun"achst nehmen wir an, da\s das Fenster Platz hat
+ pCli->nVisible |= CHILD_FITS_IN;
+
+ // Nicht sichtbare Fenster "uberspringen
+ if (pCli->nVisible != CHILD_VISIBLE)
+ continue;
+
+ if ( pCli->bResize )
+ aSize = pCli->aSize;
+ else
+ aSize = pCli->pWin->GetSizePixel();
+
+ SvBorder aTemp = aBorder;
+ BOOL bAllowHiding = TRUE;
+ switch ( pCli->eAlign )
+ {
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_TOOLBOXTOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ bAllowHiding = FALSE;
+ aBorder.Top() += aSize.Height();
+ aPos = aTmp.TopLeft();
+ aTmp.Top() += aSize.Height();
+ aSize.Width() = aTmp.GetWidth();
+ break;
+
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_TOOLBOXBOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ aBorder.Bottom() += aSize.Height();
+ aPos = aTmp.BottomLeft();
+ aPos.Y() -= (aSize.Height()-1);
+ aTmp.Bottom() -= aSize.Height();
+ aSize.Width() = aTmp.GetWidth();
+ break;
+
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_TOOLBOXLEFT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ bAllowHiding = FALSE;
+ aBorder.Left() += aSize.Width();
+ aPos = aTmp.TopLeft();
+ aTmp.Left() += aSize.Width();
+ aSize.Height() = aTmp.GetHeight();
+ break;
+
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_TOOLBOXRIGHT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ aBorder.Right() += aSize.Width();
+ aPos = aTmp.TopRight();
+ aPos.X() -= (aSize.Width()-1);
+ aTmp.Right() -= aSize.Width();
+ aSize.Height() = aTmp.GetHeight();
+ break;
+
+ default:
+ pCli->aSize = pCli->pWin->GetSizePixel();
+ pCli->bResize = FALSE;
+ continue;
+ break;
+ }
+
+ pCli->pWin->SetPosSizePixel( aPos, aSize );
+ pCli->bResize = FALSE;
+ pCli->aSize = aSize;
+ if( bAllowHiding && !RequestTopToolSpacePixel_Impl( aBorder ) )
+ {
+ pCli->nVisible ^= CHILD_FITS_IN;
+ aBorder = aTemp;
+ }
+ }
+
+ if ( rRect.GetWidth() >= aBorder.Left() + aBorder.Right() )
+ {
+ rRect.Left() += aBorder.Left();
+ rRect.Right() -= aBorder.Right();
+ }
+ else
+ {
+ aBorder.Left() = rRect.Left();
+ aBorder.Right() = rRect.Right();
+ rRect.Right() = rRect.Left() = aTmp.Left();
+ }
+
+ if ( rRect.GetHeight() >= aBorder.Top() + aBorder.Bottom() )
+ {
+ rRect.Top() += aBorder.Top();
+ rRect.Bottom() -= aBorder.Bottom();
+ }
+ else
+ {
+ aBorder.Top() = rRect.Top();
+ aBorder.Bottom() = rRect.Bottom();
+ rRect.Top() = rRect.Bottom() = aTmp.Top();
+ }
+
+ return IsDockingAllowed() ? aBorder : SvBorder();
+}
+
+//--------------------------------------------------------------------
+// Close-Handler: die Konfiguration der ChildWindows wird gespeichert.
+//
+
+void SfxWorkWindow::Close_Impl()
+{
+ for (USHORT n=0; n<pChildWins->Count(); n++)
+ {
+ SfxChildWin_Impl *pCW = (*pChildWins)[n];
+ SfxChildWindow *pChild = pCW->pWin;
+ if (pChild)
+ {
+ BOOL bTask = ( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) != 0;
+ pCW->aInfo = pChild->GetInfo();
+ if ( bTask )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+ SaveStatus_Impl(pChild, pCW->aInfo);
+ }
+ }
+}
+
+BOOL SfxWorkWindow::PrepareClose_Impl()
+{
+ for (USHORT n=0; n<pChildWins->Count(); n++)
+ {
+ SfxChildWin_Impl *pCW = (*pChildWins)[n];
+ SfxChildWindow *pChild = pCW->pWin;
+ if ( pChild && !pChild->QueryClose() )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+SfxChild_Impl* SfxWorkWindow::RegisterChild_Impl( Window& rWindow,
+ SfxChildAlignment eAlign, BOOL bCanGetFocus )
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+ DBG_ASSERT( pChilds->Count() < 255, "too many childs" );
+ DBG_ASSERT( SfxChildAlignValid(eAlign), "invalid align" );
+ DBG_ASSERT( !FindChild_Impl(rWindow), "child registered more than once" );
+
+
+ if ( rWindow.GetParent() != pWorkWin )
+ rWindow.SetParent( pWorkWin );
+
+ SfxChild_Impl *pChild = new SfxChild_Impl(rWindow, rWindow.GetSizePixel(),
+ eAlign, rWindow.IsVisible());
+ pChild->bCanGetFocus = bCanGetFocus;
+
+ pChilds->Insert(pChilds->Count(), pChild);
+ bSorted = FALSE;
+ nChilds++;
+ return (*pChilds)[pChilds->Count()-1];
+}
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::AlignChild_Impl( Window& rWindow,
+ const Size& rNewSize,
+ SfxChildAlignment eAlign )
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+ DBG_ASSERT( pChilds, "aligning unregistered child" );
+ DBG_ASSERT( SfxChildAlignValid(eAlign), "invalid align" );
+
+ SfxChild_Impl *pChild = FindChild_Impl(rWindow);
+ if ( pChild )
+ {
+ if (pChild->eAlign != eAlign)
+ bSorted = FALSE;
+
+ pChild->eAlign = eAlign;
+ pChild->aSize = rNewSize;
+ pChild->bResize = TRUE;
+ }
+ else
+ DBG_ERROR( "aligning unregistered child" );
+}
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::ReleaseChild_Impl( Window& rWindow )
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+ DBG_ASSERT( pChilds, "releasing unregistered child" );
+
+ SfxChild_Impl *pChild = 0;
+ USHORT nCount = pChilds->Count();
+ USHORT nPos;
+ for ( nPos = 0; nPos < nCount; ++nPos )
+ {
+ pChild = (*pChilds)[nPos];
+ if ( pChild )
+ if ( pChild->pWin == &rWindow )
+ break;
+ }
+
+ if ( nPos < nCount )
+ {
+ bSorted = FALSE;
+ nChilds--;
+ pChilds->Remove(nPos);
+ delete pChild;
+ }
+ else
+ DBG_ERROR( "releasing unregistered child" );
+}
+
+//--------------------------------------------------------------------
+
+SfxChild_Impl* SfxWorkWindow::FindChild_Impl( const Window& rWindow ) const
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+
+ SfxChild_Impl *pChild = 0;
+ USHORT nCount = pChilds->Count();
+ for ( USHORT nPos = 0; nPos < nCount; ++nPos )
+ {
+ pChild = (*pChilds)[nPos];
+ if ( pChild )
+ if ( pChild->pWin == &rWindow )
+ return pChild;
+ }
+
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::ShowChilds_Impl()
+{
+ DBG_CHKTHIS(SfxWorkWindow, 0);
+
+ SfxChild_Impl *pCli = 0;
+ for ( USHORT nPos = 0; nPos < pChilds->Count(); ++nPos )
+ {
+ pCli = (*pChilds)[nPos];
+ if (pCli && pCli->pWin)
+ {
+ if ( CHILD_VISIBLE == (pCli->nVisible & CHILD_VISIBLE) )
+ {
+ switch ( pCli->pWin->GetType() )
+ {
+ case RSC_DOCKINGWINDOW :
+ ((DockingWindow*)pCli->pWin)->Show();
+ break;
+ case RSC_TOOLBOX :
+ ((ToolBox*)pCli->pWin)->Show();
+ break;
+ case RSC_SPLITWINDOW :
+ ((SplitWindow*)pCli->pWin)->Show();
+ break;
+ default:
+ pCli->pWin->Show();
+ break;
+ }
+ }
+ else
+ {
+ switch ( pCli->pWin->GetType() )
+ {
+ case RSC_DOCKINGWINDOW :
+ case RSC_TOOLBOX :
+ ((DockingWindow*)pCli->pWin)->Hide();
+ break;
+ default:
+ pCli->pWin->Hide();
+ break;
+ }
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::HideChilds_Impl()
+{
+ SfxChild_Impl *pChild = 0;
+ for ( USHORT nPos = pChilds->Count(); nPos > 0; --nPos )
+ {
+ pChild = (*pChilds)[nPos-1];
+ if (pChild && pChild->pWin)
+ {
+ switch ( pChild->pWin->GetType() )
+ {
+ case RSC_DOCKINGWINDOW :
+ case RSC_TOOLBOX :
+ ((DockingWindow*)pChild->pWin)->Hide();
+ break;
+ default:
+ pChild->pWin->Hide();
+ break;
+ }
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+
+void SfxWorkWindow::ResetObjectBars_Impl()
+{
+ USHORT n;
+ for ( n = 0; n < SFX_OBJECTBAR_MAX; ++n )
+ {
+ aObjBars[n].nId = 0;
+ aObjBarLists[n].aArr.Remove(0, aObjBarLists[n].aArr.Count() );
+ aObjBarLists[n].nAct = 0;
+ }
+
+ for ( n = 0; n < pChildWins->Count(); ++n )
+ (*pChildWins)[n]->nId = 0;
+
+// if ( pParent )
+// pParent->ResetObjectBars_Impl();
+}
+
+void SfxWorkWindow::NextObjectBar_Impl( USHORT nPos )
+{
+ USHORT nCount = aObjBarLists[nPos].aArr.Count();
+ if ( nCount > 1 )
+ {
+ if ( ++(aObjBarLists[nPos].nAct) == nCount )
+ aObjBarLists[nPos].nAct = 0;
+
+ aObjBars[nPos] = aObjBarLists[nPos].Actual();
+ UpdateObjectBars_Impl();
+ }
+}
+
+USHORT SfxWorkWindow::HasNextObjectBar_Impl( USHORT nPos, String *pStr )
+{
+ USHORT nCount = aObjBarLists[nPos].aArr.Count();
+ if ( nCount > 1 )
+ {
+ USHORT nAct = aObjBarLists[nPos].nAct;
+ if ( ++nAct == nCount )
+ nAct = 0;
+ const SfxObjectBar_Impl& rObjbar = aObjBarLists[nPos].aArr[nAct];
+ if ( pStr )
+ *pStr = rObjbar.aName;
+ return rObjbar.nId;
+ }
+
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+void SfxWorkWindow::SetObjectBar_Impl( USHORT nPos, const ResId& rResId,
+ SfxInterface* pIFace, const String *pName)
+{
+ DBG_ASSERT( (nPos & SFX_POSITION_MASK) < SFX_OBJECTBAR_MAX,
+ "object bar position overflow" );
+
+ USHORT nRealPos = nPos & SFX_POSITION_MASK;
+ if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) )
+ {
+ pParent->SetObjectBar_Impl( nPos, rResId, pIFace, pName );
+ return;
+ }
+
+ SfxObjectBar_Impl& rObjBar = aObjBars[nRealPos];
+ rObjBar.pIFace = pIFace;
+ rObjBar.nId = rResId.GetId();
+ rObjBar.pResMgr = rResId.GetResMgr();
+ rObjBar.nMode = (nPos & SFX_VISIBILITY_MASK);
+ if (pName)
+ rObjBar.aName = *pName;
+ else
+ rObjBar.aName.Erase();
+
+ SfxObjectBarArr_Impl& rArr = aObjBarLists[nRealPos].aArr;
+ for ( USHORT n=0; n<rArr.Count(); n++ )
+ {
+ if ( rArr[n].nId == rObjBar.nId )
+ {
+ aObjBarLists[nRealPos].nAct = n;
+ return;
+ }
+ }
+
+ rArr.Insert( rObjBar, 0 );
+}
+
+//------------------------------------------------------------------------
+
+FASTBOOL SfxWorkWindow::KnowsObjectBar_Impl( USHORT nPos ) const
+
+/* [Beschreibung]
+
+ Stellt fest, ob an der betreffenden Position "uberhaupt eine
+ Objektleiste zur Verf"ugung stehen w"urde. Ist unabh"agig davon,
+ ob diese tats"achlich ein- oder ausgeschaltet ist.
+*/
+
+{
+ USHORT nRealPos = nPos & SFX_POSITION_MASK;
+ if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) )
+ return pParent->KnowsObjectBar_Impl( nPos );
+
+ return 0 != aObjBars[nPos & SFX_POSITION_MASK].nId;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxWorkWindow::IsVisible_Impl( USHORT nMode ) const
+{
+ switch( nUpdateMode )
+ {
+ case SFX_VISIBILITY_STANDARD:
+ return TRUE;
+ case SFX_VISIBILITY_UNVISIBLE:
+ return FALSE;
+ case SFX_VISIBILITY_PLUGSERVER:
+ case SFX_VISIBILITY_PLUGCLIENT:
+ case SFX_VISIBILITY_CLIENT:
+ case SFX_VISIBILITY_SERVER:
+ return !!(nMode & nUpdateMode);
+ default:
+ return !!(nMode & nOrigMode ) ||
+ nOrigMode == SFX_VISIBILITY_STANDARD;
+ }
+}
+
+Window* SfxWorkWindow::GetObjectBar_Impl( USHORT nPos, ResId& rResId )
+{
+ USHORT nRealPos = nPos & SFX_POSITION_MASK;
+ DBG_ASSERT( nRealPos < SFX_OBJECTBAR_MAX,
+ "object bar position overflow" );
+
+ if ( pParent && IsAppWorkWinToolbox_Impl( nRealPos ) )
+ return pParent->GetObjectBar_Impl( nPos, rResId );
+
+ rResId = ResId(aObjBars[nPos & SFX_POSITION_MASK].nId);
+ rResId.SetResMgr(aObjBars[nPos & SFX_POSITION_MASK].pResMgr);
+
+ return &aObjBars[nPos].pTbx->GetToolBox();
+}
+
+//------------------------------------------------------------------------
+void SfxFrameWorkWin_Impl::UpdateObjectBars_Impl()
+{
+ SfxWorkWindow *pWork = pParent;
+ while ( pWork )
+ {
+ pWork->SfxWorkWindow::UpdateObjectBars_Impl();
+ pWork = pWork->GetParent_Impl();
+ }
+
+ SfxWorkWindow::UpdateObjectBars_Impl();
+
+// if ( pTask->IsActive() )
+ {
+ pWork = pParent;
+ while ( pWork )
+ {
+ pWork->ArrangeChilds_Impl();
+ pWork = pWork->GetParent_Impl();
+ }
+
+ ArrangeChilds_Impl();
+
+ pWork = pParent;
+ while ( pWork )
+ {
+ pWork->ShowChilds_Impl();
+ pWork = pWork->GetParent_Impl();
+ }
+
+ ShowChilds_Impl();
+ }
+
+ if ( aStatBar.pStatusBar )
+ {
+ StatusBar *pBar = aStatBar.pStatusBar->GetStatusBar();
+// pBar->SetBottomBorder( FALSE );
+ pBar->SetPosSizePixel( 0, 0, 0, pBar->CalcWindowSizePixel().Height(), WINDOW_POSSIZE_HEIGHT );
+ ArrangeChilds_Impl();
+ }
+
+ ShowChilds_Impl();
+}
+
+void SfxIPWorkWin_Impl::UpdateObjectBars_Impl()
+{
+ SfxWorkWindow::UpdateObjectBars_Impl();
+ if ( pWorkWin->IsVisible() )
+ {
+ ArrangeChilds_Impl();
+ ShowChilds_Impl();
+ }
+}
+
+SfxStatusBarManager* SfxWorkWindow::GetStatusBarManager_Impl()
+{
+ return aStatBar.pStatusBar;
+}
+
+//------------------------------------------------------------------------
+
+void SfxWorkWindow::UpdateObjectBars_Impl()
+{
+ // SplitWindows locken (d.h. Resize-Reaktion an den
+ // DockingWindows unterdr"ucken)
+ USHORT n;
+ for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ SfxSplitWindow *p = pSplit[n];
+ if (p->GetWindowCount())
+ p->Lock();
+ }
+
+ // was man so "ofters braucht, merkt man sich (spart Code und Laufzeit)
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxImageManager *pImgMgr = SFX_IMAGEMANAGER();
+ SfxToolBoxConfig *pTbxCfg = SfxToolBoxConfig::GetOrCreate();
+
+ // die Modi bestimmen, die im Kontext gelten
+ // Geht InPlace nur bein internem InPlace, was aber egal ist, da bei
+ // externem InPlace es schon wegen OLE nicht gehen kann !
+ FASTBOOL bIsFullScreen = FALSE;
+ Window* pSysWin = GetTopWindow();
+ if ( pSysWin )
+ {
+ while ( pSysWin && pSysWin->GetType() != WINDOW_WORKWINDOW )
+ pSysWin = pSysWin->GetParent();
+
+ if ( pSysWin )
+ bIsFullScreen = ((WorkWindow*)pSysWin)->IsFullScreenMode();
+ }
+
+ // "uber alle Toolbox-Positionen iterieren
+ for ( n = 0; n < SFX_OBJECTBAR_MAX; ++n )
+ {
+ SfxChild_Impl *&rpCli = (*pChilds)[TbxMatch(n)];
+
+ // Toolbox und/oder Id an der Position 'n'
+ USHORT nId = aObjBars[n].nId;
+ SfxToolBoxManager *&rpTbx = aObjBars[n].pTbx;
+ FASTBOOL bToolBoxVisible = pTbxCfg->IsToolBoxPositionVisible(n);
+
+ // die Modi bestimmen, f"ur die die ToolBox gilt
+ USHORT nTbxMode = aObjBars[n].nMode;
+ FASTBOOL bFullScreenTbx = SFX_VISIBILITY_FULLSCREEN ==
+ ( nTbxMode & SFX_VISIBILITY_FULLSCREEN );
+ nTbxMode &= ~SFX_VISIBILITY_FULLSCREEN;
+
+ // wird in diesem Kontext eine ToolBox gefordert?
+ FASTBOOL bModesMatching = nUpdateMode && ( nTbxMode & nUpdateMode) == nUpdateMode;
+ if ( nId != 0 && bToolBoxVisible == TRUE &&
+ ( ( bModesMatching && !bIsFullScreen ) ||
+ ( bIsFullScreen && bFullScreenTbx ) ) )
+ {
+ // keine oder falsche Toolbox an der Position 'n' vorhanden?
+ if ( !rpTbx || ( rpTbx && rpTbx->GetType() != nId ) )
+ {
+ // (falsche) Toolbox vorhanden?
+ if (rpTbx)
+ {
+ // dann Toolbox-Inhalt autauschen
+ rpTbx = new SfxToolBoxManager(
+ ResId( aObjBars[n].nId,
+ aObjBars[n].pResMgr ),
+ aObjBars[n].pIFace,
+ aObjBars[n].aName,
+ rpTbx, pConfigShell);
+ rpCli->pWin = &rpTbx->GetToolBox();
+ }
+ else
+ {
+ // sonst Toolbox neu erzeugen
+ rpTbx = new SfxToolBoxManager( pWorkWin,
+ GetBindings(),
+ ResId( aObjBars[n].nId,
+ aObjBars[n].pResMgr ),
+ aObjBars[n].pIFace,
+ n, pConfigShell );
+
+ rpTbx->Initialize();
+ SfxToolbox& rTbx = (SfxToolbox&) rpTbx->GetToolBox();
+ if ( !rpCli )
+ {
+ rpCli = new SfxChild_Impl( rTbx, Size(),
+ rTbx.IsFloatingMode() ? SFX_ALIGN_NOALIGNMENT : rTbx.GetAlignment(), TRUE );
+ }
+ else
+ {
+ rpCli->pWin = &rTbx;
+ }
+
+ bSorted = FALSE;
+ nChilds++;
+ }
+
+ ToolBox& rTbx = rpTbx->GetToolBox();
+ rTbx.SetText(aObjBars[n].aName);
+ if ( rTbx.IsFloatingMode() )
+ rpCli->aSize = rTbx.GetFloatingWindow()->GetSizePixel();
+ else
+ {
+ rpCli->bResize = TRUE;
+ rpCli->aSize = rTbx.GetSizePixel();
+ }
+
+ // Schnelles Statusupdate wirkt optisch besser
+ rpTbx->UpdateControls_Impl();
+ }
+ else
+ {
+ ToolBox& rTbx = rpTbx->GetToolBox();
+ BOOL bWasFloating = rTbx.IsFloatingMode();
+ rpTbx->Reconfigure_Impl( pTbxCfg->GetCfgItem_Impl( n ) );
+ rTbx.SetText(aObjBars[n].aName);
+ String aNext;
+ rpTbx->GetNextToolBox_Impl( &aNext );
+ rTbx.SetNextToolBox( aNext );
+
+ if ( bWasFloating && !rTbx.IsFloatingMode() )
+ {
+ // Toolbox einer nicht aktiven Task wurde angedockt und
+ // jetzt wurde sie wieder aktiviert.
+ // Falls angedockte Toolboxen sichtbar sein sollen, mu\s
+ // sie geshowed werden, da sie vorher in HidePopups
+ // gehidet wurde
+ if ( IsDockingAllowed() && bAllChildsVisible )
+ rpCli->nVisible |= CHILD_ACTIVE;
+ if ( CHILD_VISIBLE == (rpCli->nVisible & CHILD_VISIBLE) )
+ rTbx.Show();
+ }
+ }
+ }
+ else
+ {
+ // ggf. Toolbox an dieser Position l"oschen
+ if (rpTbx)
+ {
+ rpTbx->StoreConfig();
+ rpCli->pWin = 0;
+ SfxToolBoxManager *p = rpTbx;
+ rpTbx = 0;
+ p->Delete();
+ bSorted = FALSE;
+ nChilds--;
+ }
+ }
+
+ if ( rpTbx && !IsDockingAllowed() )
+ {
+ // Presentation mode
+ if ( !rpTbx->GetToolBox().IsFloatingMode() )
+ {
+ // keine angedockten Toolboxen
+ rpCli->pWin = 0;
+ SfxToolBoxManager *p = rpTbx;
+ rpTbx = 0;
+ p->Delete();
+ bSorted = FALSE;
+ nChilds--;
+ }
+ else if( !bAllChildsVisible )
+ // angedockte Toolboxen bis zum Livemodus hiden
+ rpCli->nVisible &= ~CHILD_ACTIVE;
+ }
+ }
+
+ UpdateChildWindows_Impl();
+
+ // SplitWindows wieder ent-locken
+ for ( n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ SfxSplitWindow *p = pSplit[n];
+ if (p->GetWindowCount())
+ p->Lock(FALSE);
+ }
+
+ UpdateStatusBar_Impl();
+}
+
+void SfxWorkWindow::UpdateChildWindows_Impl()
+{
+ FASTBOOL bIsFullScreen = FALSE;
+ Window* pSysWin = GetTopWindow();
+ if ( pSysWin )
+ {
+ while ( pSysWin && pSysWin->GetType() != WINDOW_WORKWINDOW )
+ pSysWin = pSysWin->GetParent();
+
+ if ( pSysWin )
+ bIsFullScreen = ((WorkWindow*)pSysWin)->IsFullScreenMode();
+ }
+
+ // alle vorhandenen oder in den Kontext gekommenen ChildWindows
+ for ( USHORT n=0; n<pChildWins->Count(); n++ )
+ {
+ SfxChildWin_Impl *pCW = (*pChildWins)[n];
+ SfxChildWindow *pChildWin = pCW->pWin;
+ BOOL bCreate = FALSE;
+ if ( pCW->nId && !pCW->bDisabled && IsVisible_Impl( pCW->nVisibility ) )
+ {
+ // Im Kontext ist ein geeignetes ChildWindow erlaubt;
+ // ist es auch eingeschaltet ?
+ if ( pChildWin == 0 && pCW->bCreate )
+ {
+ if ( !IsDockingAllowed() || bIsFullScreen )
+ {
+ // im PresentationMode oder FullScreen nur FloatingWindows
+ SfxChildAlignment eAlign;
+ if ( pCW->aInfo.GetExtraData_Impl( &eAlign ) )
+ bCreate = ( eAlign == SFX_ALIGN_NOALIGNMENT );
+ }
+ else
+ bCreate = TRUE;
+
+ // Momentan kein Fenster da, aber es ist eingeschaltet; Fenster
+ // und ggf. Context erzeugen
+ if ( bCreate )
+ CreateChildWin_Impl( pCW );
+
+ if ( !bAllChildsVisible )
+ {
+ if ( pCW->pCli )
+ pCW->pCli->nVisible &= ~CHILD_ACTIVE;
+ }
+ }
+ else if ( pChildWin )
+ {
+ // Fenster existiert schon; soll es auch sichtbar sein ?
+ if ( ( !bIsFullScreen || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) && bAllChildsVisible )
+ {
+ // Updatemode ist kompatibel; auf jeden Fall wieder einschalten
+ bCreate = TRUE;
+ if ( pCW->pCli )
+ {
+ // Fenster ist direktes Child
+ if ( bAllChildsVisible && ( IsDockingAllowed() || pCW->pCli->eAlign == SFX_ALIGN_NOALIGNMENT ) )
+ pCW->pCli->nVisible |= CHILD_NOT_HIDDEN;
+ }
+ else if ( pCW->bCreate && IsDockingAllowed() )
+ // Fenster liegt in einem SplitWindow
+ ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
+
+ if ( pCW->nInterfaceId != pChildWin->GetContextId() )
+ pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
+ }
+ }
+ }
+
+ if ( pChildWin && !bCreate )
+ {
+ Window *pWindow = pChildWin->GetWindow();
+ if ( pWindow && ( pWindow->HasFocus() || pWindow->HasChildPathFocus( TRUE ) ) )
+ {
+ // Wenn der Focus auf dem Childwindow sitzt, mu\s er auf das aktuelle
+ // Dokument gesetzt werden
+ // Nein !! Das fhrt gerne mal zu Rekursionen, da im GetFocus-Notify erneut ein Update ausgel"ost wird!
+ // ->#66426#
+ // SfxViewFrame *pView = SfxViewFrame::Current();
+ // if ( pView )
+ // pView->GetFrame()->GrabFocusOnComponent_Impl();
+ }
+
+ if ( !pChildWin->QueryClose() || pChildWin->IsHideNotDelete() || Application::IsUICaptured() )
+ {
+ if ( pCW->pCli )
+ {
+ if ( pCW->pCli->nVisible & CHILD_NOT_HIDDEN )
+ pCW->pCli->nVisible ^= CHILD_NOT_HIDDEN;
+ }
+ else
+ ((SfxDockingWindow*)pChildWin->GetWindow())->Disappear_Impl();
+ }
+ else
+ RemoveChildWin_Impl( pCW );
+ }
+ }
+}
+
+void SfxWorkWindow::CreateChildWin_Impl( SfxChildWin_Impl *pCW )
+{
+ if ( pCW->aInfo.bVisible != 42 )
+ pCW->aInfo.bVisible = TRUE;
+
+ SfxChildWindow *pChildWin = SfxChildWindow::CreateChildWindow( pCW->nId, pWorkWin, &GetBindings(), pCW->aInfo);
+ if (pChildWin)
+ {
+ pChildWin->SetWorkWindow_Impl( this );
+#if 0
+ // Enable-Status richtig setzen
+ pChildWin->GetWindow()->EnableInput( pCW->bEnable &&
+ ( pWorkWin->IsInputEnabled() /* || pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT */ ) );
+#endif
+ // Zumindest der ExtraString wird beim Auswerten ver"andert, also neu holen
+ BOOL bTask = ( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) != 0;
+ pCW->aInfo = pChildWin->GetInfo();
+ if ( bTask )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+
+ // Nein !! Sonst kann man keine Fenster defaultmaessig ausschalten ( Partwindow! )
+// pCW->aInfo.bVisible = TRUE;
+
+ // Erzeugung war erfolgreich
+ GetBindings().Invalidate(pCW->nId);
+
+ USHORT nPos = pChildWin->GetPosition();
+ if (nPos != CHILDWIN_NOPOS)
+ {
+ DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!");
+ if ((*pChilds)[TbxMatch(nPos)])// &&
+// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign )
+ {
+ // ChildWindow ersetzt ObjectBar
+ (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN;
+ }
+ }
+
+ pCW->pWin = pChildWin;
+
+ if ( pChildWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ||
+ pChildWin->GetWindow()->GetParent() == pWorkWin)
+ {
+ // Das Fenster ist entweder nicht angedockt oder au\serhalb
+ // eines SplitWindows angedockt und mu\s daher explizit als
+ // Child registriert werden
+ pCW->pCli = RegisterChild_Impl(*(pChildWin->GetWindow()),
+ pChildWin->GetAlignment(), pChildWin->CanGetFocus());
+ pCW->pCli->nVisible = CHILD_VISIBLE;
+ FASTBOOL bIsFullScreen = FALSE;
+ Window* pSysWin = GetTopWindow();
+ if ( pSysWin )
+ {
+ while ( pSysWin && pSysWin->GetType() != WINDOW_WORKWINDOW )
+ pSysWin = pSysWin->GetParent();
+
+ if ( pSysWin )
+ bIsFullScreen = ((WorkWindow*)pSysWin)->IsFullScreenMode();
+ }
+
+ if ( pChildWin->GetAlignment() != SFX_ALIGN_NOALIGNMENT && bIsFullScreen )
+ pCW->pCli->nVisible ^= CHILD_ACTIVE;
+ }
+ else
+ {
+ // Ein angedocktes Fenster, dessen Parent nicht das WorkWindow ist,
+ // mu\s in einem SplitWindow liegen und daher nicht explizit
+ // registriert werden.
+ // Das passiert aber schon bei der Initialisierung des
+ // SfxDockingWindows!
+ }
+
+ if ( pCW->nInterfaceId != pChildWin->GetContextId() )
+ pChildWin->CreateContext( pCW->nInterfaceId, GetBindings() );
+
+ // Information in der INI-Datei sichern
+ SaveStatus_Impl(pChildWin, pCW->aInfo);
+ }
+}
+
+void SfxWorkWindow::RemoveChildWin_Impl( SfxChildWin_Impl *pCW )
+{
+ USHORT nId = pCW->nSaveId;
+ SfxChildWindow *pChildWin = pCW->pWin;
+
+ // vorhandenes Fenster geht aus dem Kontext und wird daher entfernt
+ USHORT nPos = pChildWin->GetPosition();
+ if (nPos != CHILDWIN_NOPOS)
+ {
+ // ChildWindow "uberlagert einen ObjectBar
+ DBG_ASSERT(nPos < SFX_OBJECTBAR_MAX, "Illegal objectbar position!");
+ if ((*pChilds)[TbxMatch(nPos)] &&
+ (aObjBars[nPos].nMode & nUpdateMode) ) //&&
+// pChildWin->GetAlignment() == (*pChilds)[nPos]->eAlign )
+ {
+ // ObjectBar war "uberlagert; jetzt wieder anzeigen
+ (*pChilds)[TbxMatch(nPos)]->nVisible ^= CHILD_NOT_HIDDEN;
+ }
+ }
+
+ // Information in der INI-Datei sichern
+ BOOL bTask = ( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) != 0;
+ pCW->aInfo = pChildWin->GetInfo();
+ if ( bTask )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+ SaveStatus_Impl(pChildWin, pCW->aInfo);
+
+ pChildWin->Hide();
+
+ if ( pCW->pCli )
+ {
+ // ChildWindow ist ein direktes ChildWindow und mu\s sich daher
+ // beim WorkWindow abmelden
+ pCW->pCli = 0;
+ ReleaseChild_Impl(*pChildWin->GetWindow());
+ }
+ else
+ {
+ // ChildWindow liegt in einem SplitWindow und meldet sich
+ // selbst im dtor dort ab
+ }
+
+ pCW->pWin = 0;
+ delete pChildWin;
+
+ GetBindings().Invalidate( nId );
+}
+
+void SfxWorkWindow::ResetStatusBar_Impl()
+{
+ aStatBar.nId = 0;
+ aStatBar.pShell = NULL;
+ aStatBar.pBindings = NULL;
+}
+
+//--------------------------------------------------------------------
+void SfxWorkWindow::SetStatusBar_Impl( const ResId& rResId, SfxShell *pSh, SfxBindings& rBindings )
+{
+ if ( rResId.GetId() )
+ {
+ aStatBar.nId = rResId.GetId();
+ aStatBar.pShell = pSh;
+ aStatBar.pBindings = &rBindings;
+ }
+}
+
+void SfxWorkWindow::SetTempStatusBar_Impl( BOOL bSet )
+{
+ if ( aStatBar.bTemp != bSet )
+ {
+ BOOL bOn = FALSE;
+ SfxToolBoxConfig *pTbxCfg = SfxToolBoxConfig::GetOrCreate();
+ FASTBOOL bIsFullScreen = FALSE;
+ Window* pSysWin = GetTopWindow();
+ if ( pSysWin )
+ {
+ while ( pSysWin && pSysWin->GetType() != WINDOW_WORKWINDOW )
+ pSysWin = pSysWin->GetParent();
+
+ if ( pSysWin )
+ bIsFullScreen = ((WorkWindow*)pSysWin)->IsFullScreenMode();
+ }
+
+ if ( aStatBar.nId && aStatBar.bOn && !bIsFullScreen && pTbxCfg->IsStatusBarVisible() )
+ bOn = TRUE;
+
+ aStatBar.bTemp = bSet;
+ if ( !bOn )
+ {
+ if ( aStatBar.pStatusBar && !aStatBar.pStatusBar->GetBindings_Impl() )
+ {
+ DBG_ERROR( "Kaputte Statusbar-Bindings!" );
+ return;
+ }
+
+ // Nur was tun, wenn die Temp-Einstellung wirklich was bewirkt
+ UpdateStatusBar_Impl();
+ ArrangeChilds_Impl();
+
+ if ( aStatBar.pStatusBar )
+ {
+ StatusBar *pBar = aStatBar.pStatusBar->GetStatusBar();
+ pBar->SetBottomBorder( TRUE );
+ pBar->SetPosSizePixel( 0, 0, 0, pBar->CalcWindowSizePixel().Height(), WINDOW_POSSIZE_HEIGHT );
+ ArrangeChilds_Impl();
+ }
+
+ ShowChilds_Impl();
+ }
+ }
+}
+
+//------------------------------------------------------------------------
+void SfxWorkWindow::UpdateStatusBar_Impl()
+{
+ // Die aktuelle Statusleiste
+ StatusBar *pBar = NULL;
+ SfxToolBoxConfig *pTbxCfg = SfxToolBoxConfig::GetOrCreate();
+
+ // Falls schon eine StatusBar existiert: ist es die gew"unschte?
+ USHORT nActId = 0;
+ if ( aStatBar.pStatusBar )
+ {
+ pBar = aStatBar.pStatusBar->GetStatusBar();
+ nActId = aStatBar.pStatusBar->GetType();
+ }
+
+ // keine Statusleiste, wenn keine Id gew"unscht oder bei FullScreenView
+ // oder wenn ausgeschaltet
+ FASTBOOL bIsFullScreen = FALSE;
+ Window* pSysWin = GetTopWindow();
+ if ( pSysWin )
+ {
+ while ( pSysWin && pSysWin->GetType() != WINDOW_WORKWINDOW )
+ pSysWin = pSysWin->GetParent();
+
+ if ( pSysWin )
+ bIsFullScreen = ((WorkWindow*)pSysWin)->IsFullScreenMode();
+ }
+
+ if ( aStatBar.nId && IsDockingAllowed() &&
+ ( aStatBar.bOn && !bIsFullScreen && pTbxCfg->IsStatusBarVisible() || aStatBar.bTemp ) )
+ {
+ if ( aStatBar.nId != nActId || aStatBar.pStatusBar && aStatBar.pStatusBar->GetBindings_Impl() != aStatBar.pBindings )
+ {
+ // Id hat sich ge"andert, also passenden Statusbarmanager erzeugen,
+ // dieser "ubernimmt die aktuelle Statusleiste;
+ if ( aStatBar.pStatusBar )
+ {
+ // Der Manager erzeugt die Statusleiste nur, er zerst"ort sie
+ // nicht !
+ aStatBar.pStatusBar->StoreConfig();
+ DELETEZ( aStatBar.pStatusBar );
+ }
+
+ aStatBar.pStatusBar = new SfxStatusBarManager(
+ GetWindow(),
+ *aStatBar.pBindings,
+ aStatBar.pShell,
+ aStatBar.nId, pBar, pConfigShell );
+
+ if ( !pBar )
+ {
+ pBar = aStatBar.pStatusBar->GetStatusBar();
+ RegisterChild_Impl( *pBar, SFX_ALIGN_LOWESTBOTTOM );
+ }
+ }
+ }
+ else if ( nActId )
+ {
+ // Aktuelle StatusBar vernichten
+ // Der Manager erzeugt die Statusleiste nur, er zerst"ort sie
+ // nicht !
+ aStatBar.pStatusBar->StoreConfig();
+ ReleaseChild_Impl( *pBar );
+ DELETEZ( aStatBar.pStatusBar );
+ DELETEZ( pBar );
+ }
+}
+
+//------------------------------------------------------------------------
+
+void SfxWorkWindow::SetObjectBarVisibility_Impl( USHORT nMask )
+{
+ switch( nMask )
+ {
+ case SFX_VISIBILITY_UNVISIBLE:
+ case SFX_VISIBILITY_STANDARD:
+ case SFX_VISIBILITY_PLUGSERVER:
+ case SFX_VISIBILITY_PLUGCLIENT:
+ case SFX_VISIBILITY_CLIENT:
+ case SFX_VISIBILITY_SERVER:
+ nOrigMode = nMask;
+ }
+ if (nMask != nUpdateMode)
+ nUpdateMode = nMask;
+}
+
+BOOL SfxWorkWindow::IsContainer_Impl() const
+{
+ return nUpdateMode == SFX_VISIBILITY_CLIENT;
+}
+
+//------------------------------------------------------------------------
+void SfxWorkWindow::HidePopups_Impl(BOOL bHide, BOOL bParent, USHORT nId )
+{
+ if ( nId )
+ {
+ for ( USHORT n = 0; n < SFX_OBJECTBAR_MAX; ++n )
+ {
+ SfxChild_Impl *pCli = (*pChilds)[TbxMatch(n)];
+ if ( pCli && pCli->eAlign == SFX_ALIGN_NOALIGNMENT )
+ {
+ BOOL bHasTbx = ( aObjBars[n].pTbx != 0 );
+ if (bHide)
+ {
+ pCli->nVisible &= ~CHILD_ACTIVE;
+ if ( bHasTbx )
+ aObjBars[n].pTbx->GetToolBox().Hide();
+ }
+ else
+ {
+ pCli->nVisible |= CHILD_ACTIVE;
+ if ( bHasTbx && CHILD_VISIBLE == (pCli->nVisible & CHILD_VISIBLE) )
+ aObjBars[n].pTbx->GetToolBox().Show();
+ }
+ }
+ }
+ }
+
+ for ( USHORT n = 0; n < pChildWins->Count(); ++n )
+ {
+ SfxChildWindow *pCW = (*pChildWins)[n]->pWin;
+ if (pCW && pCW->GetAlignment() == SFX_ALIGN_NOALIGNMENT && pCW->GetType() != nId)
+ {
+ Window *pWin = pCW->GetWindow();
+ SfxChild_Impl *pChild = FindChild_Impl(*pWin);
+ if (bHide)
+ {
+ pChild->nVisible &= ~CHILD_ACTIVE;
+ pCW->Hide();
+ }
+ else
+ {
+ pChild->nVisible |= CHILD_ACTIVE;
+ if ( CHILD_VISIBLE == (pChild->nVisible & CHILD_VISIBLE) )
+ pCW->Show();
+ }
+ }
+ }
+
+ if ( bParent && pParent )
+ pParent->HidePopups_Impl( bHide, bParent, nId );
+}
+
+//------------------------------------------------------------------------
+
+void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
+ SfxDockingConfig eConfig, USHORT nId)
+{
+ SfxDockingWindow* pDockWin=0;
+ SfxToolbox *pBox=0;
+ USHORT nPos = USHRT_MAX;
+ Window *pWin=0;
+ SfxChildWin_Impl *pCW = 0;
+
+ if (eChild == SFX_CHILDWIN_OBJECTBAR)
+ {
+ // Es soll eine Toolbox konfiguriert werden
+ USHORT n;
+ for (n=0; n<SFX_OBJECTBAR_MAX; n++)
+ {
+ if (aObjBars[n].nId == nId && aObjBars[n].pTbx)
+ break;
+ }
+
+ DBG_ASSERT( pParent || n<SFX_OBJECTBAR_MAX, "Unbekannte ToolBox!" );
+ if (n>=SFX_OBJECTBAR_MAX)
+ {
+ if (pParent)
+ pParent->ConfigChild_Impl( eChild, eConfig, nId );
+ return;
+ }
+
+ pWin = pBox = (SfxToolbox*) &aObjBars[n].pTbx->GetToolBox();
+ }
+ else
+ {
+ // Es soll ein DockingWindow als direktes Child konfiguriert werden
+ for (USHORT n=0; n<pChildWins->Count(); n++)
+ {
+ pCW = (*pChildWins)[n];
+ SfxChildWindow *pChild = pCW->pWin;
+ if (pChild)
+ {
+ if (pChild->GetType() == nId)
+ {
+ pDockWin = (SfxDockingWindow*) pChild->GetWindow();
+ break;
+ }
+ }
+ }
+
+ if ( pDockWin )
+ {
+ if ( eChild == SFX_CHILDWIN_DOCKINGWINDOW ||
+ pDockWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT )
+ {
+ if ( eChild == SFX_CHILDWIN_SPLITWINDOW && eConfig == SFX_TOGGLEFLOATMODE)
+ {
+ // Ein DockingWindow wurde aus einem SplitWindow rausgezogen
+ pCW->pCli =
+ RegisterChild_Impl(*pDockWin, pDockWin->GetAlignment(), pCW->pWin->CanGetFocus());
+ pCW->pCli->nVisible = CHILD_VISIBLE;
+ }
+
+ pWin = pDockWin;
+ }
+ else
+ {
+ SfxSplitWindow *pSplitWin = GetSplitWindow_Impl(pDockWin->GetAlignment());
+
+ // Es soll ein DockingWindow in einem SplitWindow konfiguriert werden
+ if ( eConfig == SFX_TOGGLEFLOATMODE)
+ {
+ // Ein DockingWindow wurde in ein SplitWindow hineingezogen
+ pCW->pCli = 0;
+ ReleaseChild_Impl(*pDockWin);
+ }
+
+ pWin = pSplitWin->GetSplitWindow();
+ if ( pSplitWin->GetWindowCount() == 1 )
+ ((SplitWindow*)pWin)->Show();
+ }
+ }
+
+ DBG_ASSERT( pDockWin, "Unbekanntes DockingWindow!" );
+ if ( !pDockWin && pParent )
+ {
+ pParent->ConfigChild_Impl( eChild, eConfig, nId );
+ return;
+ }
+ }
+
+ // Eventuell sind Childs an - oder abgemeldet worden
+ if (!bSorted)
+ Sort_Impl();
+
+ SfxChild_Impl *pChild = 0;
+ USHORT n;
+ for ( n=0; n<aSortedList.Count(); ++n )
+ {
+ pChild = (*pChilds)[aSortedList[n]];
+ if ( pChild )
+ if ( pChild->pWin == pWin )
+ break;
+ }
+
+ nPos = aSortedList[n];
+
+ switch ( eConfig )
+ {
+ case SFX_SETDOCKINGRECTS :
+ {
+ SfxChild_Impl *pChild = (*pChilds)[nPos];
+ Rectangle aOuterRect( GetTopRect_Impl() );
+ aOuterRect.SetPos(
+ pWorkWin->OutputToScreenPixel( aOuterRect.TopLeft() ));
+ Rectangle aInnerRect(aOuterRect);
+ BOOL bTbx = (eChild == SFX_CHILDWIN_OBJECTBAR);
+
+ // Das gerade betroffene Fenster wird bei der Berechnung des
+ // inneren Rechtecks mit eingeschlossen!
+ for ( USHORT m=0; m<aSortedList.Count(); ++m )
+ {
+ USHORT n=aSortedList[m];
+ SfxChild_Impl* pCli = (*pChilds)[n];
+
+ if ( pCli && pCli->nVisible == CHILD_VISIBLE && pCli->pWin )
+ {
+ switch ( pCli->eAlign )
+ {
+ case SFX_ALIGN_TOP:
+ // Objekt-Toolboxen kommen immer zuletzt
+ if ( bTbx || n <= nPos)
+ aInnerRect.Top() += pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_TOOLBOXTOP:
+ // Toolbox geht nur vor, wenn nicht h"ohere Position
+ if ( bTbx && n <= nPos)
+ aInnerRect.Top() += pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_HIGHESTTOP:
+ // Geht immer vor
+ aInnerRect.Top() += pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_LOWESTTOP:
+ // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ if ( n == nPos )
+ aInnerRect.Top() += pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_BOTTOM:
+ // Objekt-Toolboxen kommen immer zuletzt
+ if ( bTbx || n <= nPos)
+ aInnerRect.Bottom() -= pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_TOOLBOXBOTTOM:
+ // Toolbox geht nur vor, wenn nicht h"ohere Position
+ if ( bTbx && n <= nPos)
+ aInnerRect.Bottom() -= pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_LOWESTBOTTOM:
+ // Geht immer vor
+ aInnerRect.Bottom() -= pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ if ( n == nPos )
+ aInnerRect.Bottom() -= pCli->aSize.Height();
+ break;
+
+ case SFX_ALIGN_LEFT:
+ // Toolboxen kommen immer zuletzt
+ if (bTbx || n <= nPos)
+ aInnerRect.Left() += pCli->aSize.Width();
+ break;
+
+ case SFX_ALIGN_TOOLBOXLEFT:
+ // Toolboxen kommen immer zuletzt
+ if (bTbx && n <= nPos)
+ aInnerRect.Left() += pCli->aSize.Width();
+ break;
+
+ case SFX_ALIGN_FIRSTLEFT:
+ // Geht immer vor
+ aInnerRect.Left() += pCli->aSize.Width();
+ break;
+
+ case SFX_ALIGN_LASTLEFT:
+ // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ if (n == nPos)
+ aInnerRect.Left() += pCli->aSize.Width();
+
+ case SFX_ALIGN_RIGHT:
+ // Toolboxen kommen immer zuletzt
+ if (bTbx || n <= nPos)
+ aInnerRect.Right() -= pCli->aSize.Width();
+ break;
+
+ case SFX_ALIGN_TOOLBOXRIGHT:
+ // Toolboxen kommen immer zuletzt
+ if (bTbx && n <= nPos)
+ aInnerRect.Right() -= pCli->aSize.Width();
+ break;
+
+ case SFX_ALIGN_FIRSTRIGHT:
+ // Wird nur mitgez"ahlt, wenn es das aktuelle Fenster ist
+ if (n == nPos)
+ aInnerRect.Right() -= pCli->aSize.Width();
+ break;
+
+ case SFX_ALIGN_LASTRIGHT:
+ // Geht immer vor
+ aInnerRect.Right() -= pCli->aSize.Width();
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if (pBox)
+ pBox->SetDockingRects(aOuterRect, aInnerRect);
+ else
+ pDockWin->SetDockingRects(aOuterRect, aInnerRect);
+ break;
+ }
+
+ case SFX_MOVEDOCKINGWINDOW :
+ case SFX_ALIGNDOCKINGWINDOW :
+ case SFX_TOGGLEFLOATMODE:
+ {
+ SfxChildAlignment eAlign;
+ SfxChild_Impl *pCli = (*pChilds)[nPos];
+ if (pBox)
+ {
+ if ( pBox->IsFloatingMode() )
+ {
+ eAlign = SFX_ALIGN_NOALIGNMENT;
+ pCli->aSize = pBox->GetFloatingWindow()->GetSizePixel();
+ }
+ else
+ {
+ eAlign = pBox->GetAlignment();
+ pCli->bResize = TRUE;
+ Size aActSize( pBox->GetSizePixel() );
+ pCli->aSize = pBox->CalcWindowSizePixel();
+ if ( pBox->IsHorizontal() )
+ pCli->aSize.Width() = aActSize.Width();
+ else
+ pCli->aSize.Height() = aActSize.Height();
+ }
+ }
+ else
+ {
+ eAlign = pDockWin->GetAlignment();
+ if ( eChild == SFX_CHILDWIN_DOCKINGWINDOW ||
+ eAlign == SFX_ALIGN_NOALIGNMENT)
+ {
+ // wenn innerhalb eines SplitWindows umkonfiguriert
+ // wurde, "andert sich am SplitWindow selbst nichts
+ pCli->bResize = TRUE;
+ pCli->aSize = pDockWin->GetSizePixel();
+ }
+ }
+
+ if ( pCli->eAlign != eAlign )
+ bSorted = FALSE;
+ pCli->eAlign = eAlign;
+ ArrangeChilds_Impl();
+ ShowChilds_Impl();
+
+ // INI schreiben
+ if ( pCW )
+ {
+ BOOL bTask = ( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) != 0;
+ pCW->aInfo = pCW->pWin->GetInfo();
+ if ( bTask )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+ if ( eConfig != SFX_MOVEDOCKINGWINDOW )
+ SaveStatus_Impl( pCW->pWin, pCW->aInfo);
+ }
+ break;
+ }
+ }
+}
+
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::SetChildWindowVisible_Impl( ULONG lId, BOOL bEnabled, USHORT nMode )
+{
+ USHORT nInter = (USHORT) ( lId >> 16 );
+ USHORT nId = (USHORT) ( lId & 0xFFFF );
+
+ SfxChildWin_Impl *pCW=NULL;
+ SfxWorkWindow *pWork = pParent;
+
+ // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow
+ // der Task bzw. des Frames oder am AppWorkWindow angemeldet
+ while ( pWork && pWork->pParent )
+ pWork = pWork->pParent;
+
+ if ( pWork )
+ {
+ // Dem Parent schon bekannt ?
+ USHORT nCount = pWork->pChildWins->Count();
+ for (USHORT n=0; n<nCount; n++)
+ if ((*pWork->pChildWins)[n]->nSaveId == nId)
+ {
+ pCW = (*pWork->pChildWins)[n];
+ break;
+ }
+ }
+
+ if ( !pCW )
+ {
+ // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen
+ USHORT nCount = pChildWins->Count();
+ for (USHORT n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ {
+ pCW = (*pChildWins)[n];
+ break;
+ }
+ }
+
+ if ( !pCW )
+ {
+ // Ist neu, also initialisieren; je nach Flag beim Parent oder bei
+ // mir eintragen
+ pCW = new SfxChildWin_Impl( lId );
+ pCW->nId = nId;
+ InitializeChild_Impl( pCW );
+ if ( pWork && !( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) )
+ pWork->pChildWins->Insert( pWork->pChildWins->Count(), pCW );
+ else
+ pChildWins->Insert( pChildWins->Count(), pCW );
+ }
+
+ pCW->nId = nId;
+ if ( nInter )
+ pCW->nInterfaceId = nInter;
+ pCW->nVisibility = nMode;
+ pCW->bEnable = bEnabled;
+#if 0
+ if ( pCW->pWin )
+ pCW->pWin->GetWindow()->EnableInput( bEnabled &&
+ ( pWorkWin->IsInputEnabled() /* || pCW->pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT */ ) );
+#endif
+ pCW->nVisibility = nMode;
+}
+
+//--------------------------------------------------------------------
+// Der An/Aus-Status eines ChildWindows wird umgeschaltet.
+
+void SfxWorkWindow::ToggleChildWindow_Impl(USHORT nId)
+{
+ USHORT nCount = pChildWins->Count();
+ USHORT n;
+ for (n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nId == nId)
+ break;
+
+ if ( n<nCount )
+ {
+ // Das Fenster ist schon bekannt
+ SfxChildWin_Impl *pCW = (*pChildWins)[n];
+ SfxChildWindow *pChild = pCW->pWin;
+
+ if ( pChild && pCW->bCreate )
+ {
+ if ( pChild->QueryClose() )
+ {
+ Window *pWindow = pChild->GetWindow();
+ if ( pWindow && ( pWindow->HasFocus() || pWindow->HasChildPathFocus( TRUE ) ) )
+ {
+ // Wenn der Focus auf dem Childwindow sitzt, mu\s er auf das aktuelle
+ // Dokument gesetzt werden
+ // Nein !! Das fhrt gerne mal zu Rekursionen, da im GetFocus-Notify erneut ein Update ausgel"ost wird!
+ // ->#66426#
+ // SfxViewFrame *pView = SfxViewFrame::Current();
+ // if ( pView )
+ // pView->GetFrame()->GrabFocusOnComponent_Impl();
+ }
+
+ if ( pChild && pChild->IsHideAtToggle() )
+ {
+ pCW->bCreate = !pCW->bCreate;
+ ShowChildWindow_Impl( nId, pCW->bCreate );
+ }
+ else
+ {
+ // Fenster soll ausgeschaltet werdem
+ pCW->bCreate = FALSE;
+ pChild->SetVisible_Impl( FALSE );
+ RemoveChildWin_Impl( pCW );
+ }
+ }
+ }
+ else if ( pCW->bCreate )
+ {
+ pCW->bCreate = FALSE;
+ }
+ else
+ {
+ pCW->bCreate = TRUE;
+
+ if ( pChild )
+ {
+ ShowChildWindow_Impl( nId, pCW->bCreate );
+ }
+ else
+ {
+ // Fenster erzeugen
+ CreateChildWin_Impl( pCW );
+ if ( !pCW->pWin )
+ // Erzeugung war erfolglos
+ pCW->bCreate = FALSE;
+ }
+ }
+
+ ArrangeChilds_Impl();
+ ShowChilds_Impl();
+
+ if ( pCW->bCreate )
+ {
+ if ( !pCW->pCli )
+ {
+ SfxDockingWindow *pDock =
+ (SfxDockingWindow*) pCW->pWin->GetWindow();
+ if ( nId == SID_BROWSER )
+ SfxFrame::BeamerSet_Impl();
+ else if ( pDock->IsAutoHide_Impl() )
+ pDock->AutoShow_Impl();
+ }
+
+ if ( nId != SID_HELP_PI )
+ {
+ SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ pHelpPI->LoadTopic(pCW->pWin->GetWindow()->GetHelpId() );
+ }
+ }
+
+ return;
+ }
+ else if ( pParent )
+ {
+ pParent->ToggleChildWindow_Impl( nId );
+ return;
+ }
+
+#ifdef DBG_UTIL
+ nCount = pChildWins->Count();
+ for (n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ break;
+
+ if ( n < nCount )
+ {
+ DBG_ERROR("ChildWindow ist nicht im Kontext!");
+ }
+ else
+ {
+ DBG_ERROR("ChildWindow ist nicht registriert!");
+ }
+#endif
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxWorkWindow::HasChildWindow_Impl(USHORT nId)
+{
+ USHORT nCount = pChildWins->Count();
+ USHORT n;
+ for (n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ break;
+
+ if (n<nCount)
+ {
+ SfxChildWin_Impl *pCW = (*pChildWins)[n];
+ SfxChildWindow *pChild = pCW->pWin;
+ return ( pChild && pCW->bCreate );
+ }
+
+ if ( pParent )
+ return pParent->HasChildWindow_Impl( nId );
+
+ return FALSE;
+}
+
+BOOL SfxWorkWindow::IsFloating( USHORT nId )
+{
+ SfxChildWin_Impl *pCW=NULL;
+ SfxWorkWindow *pWork = pParent;
+
+ // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow
+ // der Task bzw. des Frames oder am AppWorkWindow angemeldet
+ while ( pWork && pWork->pParent )
+ pWork = pWork->pParent;
+
+ if ( pWork )
+ {
+ // Dem Parent schon bekannt ?
+ USHORT nCount = pWork->pChildWins->Count();
+ for (USHORT n=0; n<nCount; n++)
+ if ((*pWork->pChildWins)[n]->nSaveId == nId)
+ {
+ pCW = (*pWork->pChildWins)[n];
+ break;
+ }
+ }
+
+ if ( !pCW )
+ {
+ // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen
+ USHORT nCount = pChildWins->Count();
+ for (USHORT n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ {
+ pCW = (*pChildWins)[n];
+ break;
+ }
+ }
+
+ if ( !pCW )
+ {
+ // Ist neu, also initialisieren; je nach Flag beim Parent oder bei
+ // mir eintragen
+ pCW = new SfxChildWin_Impl( nId );
+ pCW->bEnable = FALSE;
+ pCW->nId = 0;
+ pCW->nVisibility = 0;
+ InitializeChild_Impl( pCW );
+ if ( pWork && !( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) )
+ pWork->pChildWins->Insert( pWork->pChildWins->Count(), pCW );
+ else
+ pChildWins->Insert( pChildWins->Count(), pCW );
+ }
+
+ SfxChildAlignment eAlign;
+ if ( pCW->aInfo.GetExtraData_Impl( &eAlign ) )
+ return( eAlign == SFX_ALIGN_NOALIGNMENT );
+ else
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxWorkWindow::KnowsChildWindow_Impl(USHORT nId)
+{
+ SfxChildWin_Impl *pCW=0;
+ USHORT nCount = pChildWins->Count();
+ USHORT n;
+ for (n=0; n<nCount; n++)
+ {
+ pCW = (*pChildWins)[n];
+ if ( pCW->nSaveId == nId)
+ break;
+ }
+
+ if (n<nCount)
+ {
+ if ( !IsVisible_Impl( pCW->nVisibility ) )
+ return FALSE;
+ return pCW->bEnable;
+ }
+ else if ( pParent )
+ return pParent->KnowsChildWindow_Impl( nId );
+ else
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::SetChildWindow_Impl(USHORT nId, BOOL bOn)
+{
+ SfxChildWin_Impl *pCW=NULL;
+ SfxWorkWindow *pWork = pParent;
+
+ // Den obersten parent nehmen; ChildWindows werden immer am WorkWindow
+ // der Task bzw. des Frames oder am AppWorkWindow angemeldet
+ while ( pWork && pWork->pParent )
+ pWork = pWork->pParent;
+
+ if ( pWork )
+ {
+ // Dem Parent schon bekannt ?
+ USHORT nCount = pWork->pChildWins->Count();
+ for (USHORT n=0; n<nCount; n++)
+ if ((*pWork->pChildWins)[n]->nSaveId == nId)
+ {
+ pCW = (*pWork->pChildWins)[n];
+ break;
+ }
+ }
+
+ if ( !pCW )
+ {
+ // Kein Parent oder dem Parent noch unbekannt, dann bei mir suchen
+ USHORT nCount = pChildWins->Count();
+ for (USHORT n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ {
+ pCW = (*pChildWins)[n];
+ pWork = this;
+ break;
+ }
+ }
+
+ if ( !pCW )
+ {
+ // Ist neu, also initialisieren; je nach Flag beim Parent oder bei
+ // mir eintragen
+ pCW = new SfxChildWin_Impl( nId );
+ InitializeChild_Impl( pCW );
+ if ( !pWork || pCW->aInfo.nFlags & SFX_CHILDWIN_TASK )
+ pWork = this;
+ pWork->pChildWins->Insert( pWork->pChildWins->Count(), pCW );
+ }
+
+ if ( pCW->bCreate != bOn )
+ pWork->ToggleChildWindow_Impl(nId);
+}
+
+//--------------------------------------------------------------------
+
+void SfxWorkWindow::ShowChildWindow_Impl(USHORT nId, BOOL bVisible)
+{
+ USHORT nCount = pChildWins->Count();
+ SfxChildWin_Impl* pCW=0;
+ USHORT n;
+ for (n=0; n<nCount; n++)
+ {
+ pCW = (*pChildWins)[n];
+ if (pCW->nId == nId)
+ break;
+ }
+
+ if ( n<nCount )
+ {
+ SfxChildWindow *pChildWin = pCW->pWin;
+ if ( pChildWin )
+ {
+// pCW->bCreate = bVisible;
+ if ( bVisible )
+ {
+ if ( pCW->pCli )
+ {
+ pCW->pCli->nVisible = CHILD_VISIBLE;
+ pChildWin->Show();
+ }
+ else
+ ((SfxDockingWindow*)pChildWin->GetWindow())->Reappear_Impl();
+
+ }
+ else
+ {
+ if ( pCW->pCli )
+ {
+ pCW->pCli->nVisible = CHILD_VISIBLE ^ CHILD_NOT_HIDDEN;
+ pCW->pWin->Hide();
+ }
+ else
+ ((SfxDockingWindow*)pChildWin->GetWindow())->Disappear_Impl();
+
+ }
+
+ ArrangeChilds_Impl();
+ ShowChilds_Impl();
+ }
+ else if ( bVisible )
+ {
+ SetChildWindow_Impl( nId, TRUE );
+ pChildWin = pCW->pWin;
+ }
+
+ if ( pChildWin )
+ {
+ pChildWin->SetVisible_Impl( bVisible );
+ BOOL bTask = ( pCW->aInfo.nFlags & SFX_CHILDWIN_TASK ) != 0;
+ pCW->aInfo = pChildWin->GetInfo();
+ if ( bTask )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+ if ( !pCW->bCreate )
+ SaveStatus_Impl( pChildWin, pCW->aInfo );
+ }
+
+ return;
+ }
+
+ if ( pParent )
+ {
+ pParent->ShowChildWindow_Impl( nId, bVisible );
+ return;
+ }
+
+#ifdef DBG_UTIL
+ nCount = pChildWins->Count();
+ for (n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ break;
+
+ if ( n<nCount )
+ {
+ DBG_ERROR("ChildWindow ist nicht im Kontext!");
+ }
+ else
+ {
+ DBG_ERROR("ChildWindow ist nicht registriert!");
+ }
+#endif
+}
+
+//--------------------------------------------------------------------
+
+SfxChildWindow* SfxWorkWindow::GetChildWindow_Impl(USHORT nId)
+{
+ USHORT nCount = pChildWins->Count();
+ USHORT n;
+ for (n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ break;
+
+ if (n<nCount)
+ return (*pChildWins)[n]->pWin;
+ else if ( pParent )
+ return pParent->GetChildWindow_Impl( nId );
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+void SfxWorkWindow::ResetChildWindows_Impl()
+{
+// if ( pParent )
+// pParent->ResetChildWindows_Impl();
+
+ for ( USHORT n = 0; n < pChildWins->Count(); ++n )
+ {
+ (*pChildWins)[n]->nId = 0;
+ (*pChildWins)[n]->bEnable = FALSE;
+ }
+}
+
+//------------------------------------------------------------------------
+// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent
+// windows liefert, in der Child-Fenster angeordnet werden k"onnen.
+// in der ClientArea des parent findet.
+
+Rectangle SfxWorkWindow::GetTopRect_Impl()
+{
+ return Rectangle (Point(), pWorkWin->GetOutputSizePixel() );
+}
+
+//------------------------------------------------------------------------
+// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent
+// windows liefert, in der Child-Fenster angeordnet werden k"onnen.
+// in der ClientArea des parent findet.
+
+Rectangle SfxFrameWorkWin_Impl::GetTopRect_Impl()
+{
+ return pFrame->GetTopOuterRectPixel_Impl();
+}
+
+//------------------------------------------------------------------------
+// Virtuelle Methode, die die Gr"o\se der Fl"ache (client area) des parent
+// windows liefert, in der Child-Fenster angeordnet werden k"onnen.
+// in der ClientArea des parent findet.
+
+Rectangle SfxIPWorkWin_Impl::GetTopRect_Impl()
+{
+ return pEnv->GetContainerEnv()->GetTopOuterRectPixel();
+}
+
+//------------------------------------------------------------------------
+// Virtuelle Methode, um herauszufinden, ob ein Child-Fenster noch Platz
+// in der ClientArea des parent findet.
+
+BOOL SfxWorkWindow::RequestTopToolSpacePixel_Impl( SvBorder aBorder )
+{
+ if ( !IsDockingAllowed() ||
+ aClientArea.GetWidth() < aBorder.Left() + aBorder.Right() ||
+ aClientArea.GetHeight() < aBorder.Top() + aBorder.Bottom() )
+ return FALSE;
+ else
+ return TRUE;;
+}
+
+//------------------------------------------------------------------------
+// Implementation am InPlaceObject: benutzt die SO-Methode, um am InPlaceClient
+// um Platz nachzusuchen.
+
+BOOL SfxIPWorkWin_Impl::RequestTopToolSpacePixel_Impl( SvBorder aBorder )
+{
+ if ( !IsDockingAllowed() )
+ return FALSE;
+ else
+ return pEnv->GetContainerEnv()->RequestTopToolSpacePixel( aBorder );
+}
+
+
+void SfxIPWorkWin_Impl::SaveStatus_Impl(SfxChildWindow *pChild, const SfxChildWinInfo &rInfo)
+{
+ if ( pEnv->IsInternalInPlace() )
+ SfxWorkWindow::SaveStatus_Impl( pChild, rInfo );
+}
+
+void SfxWorkWindow::SaveStatus_Impl(SfxChildWindow *pChild, const SfxChildWinInfo &rInfo)
+{
+ // Den Status vom Presentation mode wollen wir nicht sichern
+ if ( IsDockingAllowed() )
+ pChild->SaveStatus(rInfo);
+}
+
+void SfxWorkWindow::InitializeChild_Impl(SfxChildWin_Impl *pCW)
+{
+ SfxChildWinFactory* pFact=0;
+ SfxApplication *pApp = SFX_APP();
+ SfxChildWinFactArr_Impl &rFactories = pApp->GetChildWinFactories_Impl();
+ for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ {
+ pFact = rFactories[nFactory];
+ if ( pFact->nId == pCW->nSaveId )
+ {
+ pCW->aInfo = pFact->aInfo;
+ SfxChildWindow::InitializeChildWinFactory_Impl(
+ pCW->nSaveId, pCW->aInfo);
+ pCW->bCreate = pCW->aInfo.bVisible;
+ USHORT nFlags = pFact->aInfo.nFlags;
+ if ( nFlags & SFX_CHILDWIN_TASK )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+ if ( nFlags & SFX_CHILDWIN_CANTGETFOCUS )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_CANTGETFOCUS;
+ pFact->aInfo = pCW->aInfo;
+ return;
+ }
+ }
+
+ SfxDispatcher *pDisp = pBindings->GetDispatcher_Impl();
+ SfxModule *pMod = pDisp ? pApp->GetActiveModule( pDisp->GetFrame() ) :0;
+ if ( pMod )
+ {
+ SfxChildWinFactArr_Impl *pFactories = pMod->GetChildWinFactories_Impl();
+ if ( pFactories )
+ {
+ SfxChildWinFactArr_Impl &rFactories = *pFactories;
+ for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ {
+ pFact = rFactories[nFactory];
+ if ( pFact->nId == pCW->nSaveId )
+ {
+ pCW->aInfo = pFact->aInfo;
+ SfxChildWindow::InitializeChildWinFactory_Impl(
+ pCW->nSaveId, pCW->aInfo);
+ pCW->bCreate = pCW->aInfo.bVisible;
+ USHORT nFlags = pFact->aInfo.nFlags;
+ if ( nFlags & SFX_CHILDWIN_TASK )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_TASK;
+ if ( nFlags & SFX_CHILDWIN_CANTGETFOCUS )
+ pCW->aInfo.nFlags |= SFX_CHILDWIN_CANTGETFOCUS;
+ pFact->aInfo = pCW->aInfo;
+ return;
+ }
+ }
+ }
+ }
+}
+
+SfxSplitWindow* SfxWorkWindow::GetSplitWindow_Impl( SfxChildAlignment eAlign )
+{
+ switch ( eAlign )
+ {
+ case SFX_ALIGN_TOP:
+ return pSplit[2];
+ break;
+
+ case SFX_ALIGN_BOTTOM:
+ return pSplit[3];
+ break;
+
+ case SFX_ALIGN_LEFT:
+ return pSplit[0];
+ break;
+
+ case SFX_ALIGN_RIGHT:
+ return pSplit[1];
+ break;
+
+ default:
+ return 0;
+ break;
+ }
+}
+
+void SfxWorkWindow::MakeChildsVisible_Impl( BOOL bVis )
+{
+ if ( pParent )
+ pParent->MakeChildsVisible_Impl( bVis );
+
+ bAllChildsVisible = bVis;
+ if ( bVis )
+ {
+ if ( !bSorted )
+ Sort_Impl();
+ for ( USHORT n=0; n<aSortedList.Count(); ++n )
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]];
+ if ( pCli->eAlign == SFX_ALIGN_NOALIGNMENT || IsDockingAllowed() )
+ pCli->nVisible |= CHILD_ACTIVE;
+ }
+ }
+ else
+ {
+ if ( !bSorted )
+ Sort_Impl();
+ for ( USHORT n=0; n<aSortedList.Count(); ++n )
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aSortedList[n]];
+ pCli->nVisible &= ~CHILD_ACTIVE;
+ }
+ }
+}
+
+BOOL SfxWorkWindow::IsAutoHideMode( const SfxSplitWindow *pSplitWin )
+{
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ if ( pSplit[n] != pSplitWin && pSplit[n]->IsAutoHide( TRUE ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+void SfxWorkWindow::EndAutoShow_Impl()
+{
+ if ( pParent )
+ pParent->EndAutoShow_Impl();
+
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ SfxSplitWindow *p = pSplit[n];
+ if ( p && p->IsAutoHide() )
+ p->FadeOut();
+ }
+}
+
+void SfxWorkWindow::ArrangeAutoHideWindows( SfxSplitWindow *pActSplitWin )
+{
+ if ( pParent )
+ pParent->ArrangeAutoHideWindows( pActSplitWin );
+
+ Rectangle aArea( aClientArea );
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ // Es werden entweder Dummyfenster oder Fenster im AutoShow-Modus
+ // ( nicht gepinned, FadeIn ) behandelt.
+ // Nur das "ubergebene Fenster darf unsichtbar sein, denn vielleicht
+ // soll daf"ur gerade die Gr"o\se berechnet werden, bevor es angezeigt
+ // wird.
+ SfxSplitWindow* pSplitWin = pSplit[n];
+ BOOL bDummyWindow = !pSplitWin->IsFadeIn();
+ Window *pDummy = pSplitWin->GetSplitWindow();
+ Window *pWin = bDummyWindow ? pDummy : pSplitWin;
+ if ( pSplitWin->IsPinned() && !bDummyWindow || !pWin->IsVisible() && pActSplitWin != pSplitWin )
+ continue;
+
+ // Breite und Position des Dummy-Fensters als Ausgangspunkt
+ Size aSize = pDummy->GetSizePixel();
+ Point aPos = pDummy->GetPosPixel();
+
+ switch ( n )
+ {
+ case ( 0 ) :
+ {
+ // Linkes SplitWindow
+ // Breite vom Fenster selbst holen, wenn nicht das DummyWindow
+ if ( !bDummyWindow )
+ aSize.Width() = pSplitWin->GetSizePixel().Width();
+
+ // Wenn links ein Window sichtbar ist, beginnt der freie
+ // Bereich rechts davon bzw. bei der Client area
+ long nLeft = aPos.X() + aSize.Width();
+ if ( nLeft > aArea.Left() )
+ aArea.Left() = nLeft;
+ break;
+ }
+ case ( 1 ) :
+ {
+ // Rechtes SplitWindow
+ // Position um Differenz der Breiten korrigieren
+ aPos.X() += aSize.Width();
+
+ // Breite vom Fenster selbst holen, wenn nicht das DummyWindow
+ if ( !bDummyWindow )
+ aSize.Width() = pSplitWin->GetSizePixel().Width();
+
+ aPos.X() -= aSize.Width();
+
+ // Wenn links schon ein Fenster aufgeklappt ist, darf
+ // das rechte nicht dar"uber gehen
+ if ( aPos.X() < aArea.Left() )
+ {
+ aPos.X() = aArea.Left();
+ aSize.Width() = aArea.GetWidth();
+ }
+
+ // Wenn rechts ein Window sichtbar ist, endet der freie
+ // Bereich links davon bzw. bei der Client area
+ long nRight = aPos.X();
+ if ( nRight < aArea.Right() )
+ aArea.Right() = nRight;
+ break;
+ }
+ case ( 2 ) :
+ {
+ // Oberes SplitWindow
+ // H"ohe vom Fenster selbst holen, wenn nicht das DummyWindow
+ if ( !bDummyWindow )
+ aSize.Height() = pSplitWin->GetSizePixel().Height();
+
+ // Breite anpassen, je nachdem ob links oder rechts
+ // schon ein Fenster aufgeklappt ist
+ aPos.X() = aArea.Left();
+ aSize.Width() = aArea.GetWidth();
+
+ // Wenn oben ein Window sichtbar ist, beginnt der freie
+ // Bereich darunter bzw. bei der Client Area
+ long nTop = aPos.Y() + aSize.Height();
+ if ( nTop > aArea.Top() )
+ aArea.Top() = nTop;
+ break;
+ }
+ case ( 3 ) :
+ {
+ // Das untere SplitWindow
+ // Position um Differenz der H"ohen korrigieren
+ aPos.Y() += aSize.Height();
+
+ // H"ohe vom Fenster selbst holen, wenn nicht das DummmyWindow
+ if ( !bDummyWindow )
+ aSize.Height() = pSplitWin->GetSizePixel().Height();
+
+ aPos.Y() -= aSize.Height();
+
+ // Breite anpassen, je nachdem ob links oder rechts
+ // schon ein Fenster aufgeklappt ist
+ aPos.X() = aArea.Left();
+ aSize.Width() = aArea.GetWidth();
+
+ // Wenn oben schon ein Fenster aufgeklappt ist, darf
+ // das untere nicht dar"uber gehen
+ if ( aPos.Y() < aArea.Top() )
+ {
+ aPos.Y() = aArea.Top();
+ aSize.Height() = aArea.GetHeight();
+ }
+
+ break;
+ }
+ }
+
+ if ( !bDummyWindow )
+ // Das FadeIn-Window ist ein Float, dessen Koordinaten in
+ // Screenkoordinaten gesetzt werden
+ pSplitWin->SetPosSizePixel( pWorkWin->OutputToScreenPixel(aPos), aSize );
+ else
+ // Das angedockte DummyWindow
+ pDummy->SetPosSizePixel( aPos, aSize );
+ }
+}
+
+Rectangle SfxWorkWindow::GetFreeArea( BOOL bAutoHide ) const
+{
+ if ( bAutoHide )
+ {
+ Rectangle aArea( aClientArea );
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ if ( pSplit[n]->IsPinned() || !pSplit[n]->IsVisible() )
+ continue;
+
+ Size aSize = pSplit[n]->GetSizePixel();
+ switch ( n )
+ {
+ case ( 0 ) :
+ aArea.Left() += aSize.Width();
+ break;
+ case ( 1 ) :
+ aArea.Right() -= aSize.Width();
+ break;
+ case ( 2 ) :
+ aArea.Top() += aSize.Height();
+ break;
+ case ( 3 ) :
+ aArea.Bottom() -= aSize.Height();
+ break;
+ }
+ }
+
+ return aArea;
+ }
+ else
+ return aClientArea;
+}
+
+SfxChildWinController_Impl::SfxChildWinController_Impl( USHORT nId, SfxWorkWindow *pWork )
+ : SfxControllerItem( nId, pWork->GetBindings() )
+ , pWorkwin( pWork )
+{}
+
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SfxWorkWindow::CreateDispatch( const String& )
+{
+ return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch >();
+}
+
+void SfxChildWinController_Impl::StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pState )
+{
+ pWorkwin->DisableChildWindow_Impl( nSID, eState == SFX_ITEM_DISABLED );
+}
+
+void SfxWorkWindow::DisableChildWindow_Impl( USHORT nId, BOOL bDisable )
+{
+ USHORT nCount = pChildWins->Count();
+ USHORT n;
+ for (n=0; n<nCount; n++)
+ if ((*pChildWins)[n]->nSaveId == nId)
+ break;
+ if ( n<nCount && (*pChildWins)[n]->bDisabled != bDisable )
+ {
+ (*pChildWins)[n]->bDisabled = bDisable;
+ UpdateChildWindows_Impl();
+ ArrangeChilds_Impl();
+ ShowChilds_Impl();
+ }
+}
+
+void SfxWorkWindow::SetActiveChild_Impl( Window *pChild )
+{
+ pActiveChild = pChild;
+}
+
+Window* SfxWorkWindow::GetActiveChild_Impl()
+{
+ return pActiveChild;
+}
+
+BOOL SfxWorkWindow::ActivateNextChild_Impl( BOOL bForward )
+{
+ // Alle Kinder gem"a\s Liste sortieren
+ SvUShorts aList;
+ USHORT i;
+ for (i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++)
+ {
+ SfxChild_Impl *pCli = (*pChilds)[i];
+ if ( pCli && pCli->bCanGetFocus && pCli->pWin )
+ {
+ USHORT k;
+ for (k=0; k<aList.Count(); k++)
+ if ( ChildTravelValue((*pChilds)[aList[k]]->eAlign) > ChildTravelValue(pCli->eAlign) )
+ break;
+ aList.Insert(i,k);
+ }
+ }
+
+ // Wenn der Focus in der Task liegt, ist pActiveChild zu ignorieren
+ SfxFrame *pTask = SfxViewFrame::Current()->GetFrame();
+ BOOL bTaskActive = pTask->GetWindow().HasChildPathFocus();
+
+ // F"ur das Taskfenster einen Dummy-Eintrag in die Liste
+ USHORT nDummy =0xFFFF;
+ USHORT nTopValue = ChildTravelValue( SFX_ALIGN_LOWESTTOP );
+ for ( i=0; i<aList.Count(); i++ )
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aList[i]];
+ if ( pCli->pWin && ChildTravelValue( pCli->eAlign ) > nTopValue )
+ break;
+ }
+
+ aList.Insert( nDummy, i );
+
+ USHORT n = bForward ? 0 : aList.Count()-1;
+ if ( bTaskActive )
+ n = i;
+
+ SfxChild_Impl *pAct=NULL;
+ if ( pActiveChild && !bTaskActive )
+ {
+ // Das aktive Fenster suchen
+ for ( n=0; n<aList.Count(); n++ )
+ {
+ if ( aList[n] == nDummy )
+ continue;
+
+ SfxChild_Impl* pCli = (*pChilds)[aList[n]];
+ if ( pCli && pCli->pWin && ( pCli->pWin == pActiveChild || !pActiveChild ) )
+ {
+ pAct = pCli;
+ break;
+ }
+ }
+ }
+
+ if ( pAct )
+ {
+ for ( USHORT i=0; i<SFX_SPLITWINDOWS_MAX; i++ )
+ {
+ // Eventuell ist pAct ein Splitwindow
+ SfxSplitWindow *p = pSplit[i];
+ if ( pAct->pWin == p )
+ {
+ if( p->ActivateNextChild_Impl( bForward ) )
+ return TRUE;
+ break;
+ }
+ }
+
+ // pAct ist ein direktes ChildWindow
+ // mit dem Nachfolger bzw. Vorg"anger des aktiven Fensters weitermachen
+ if ( bForward )
+ n = n+1<aList.Count() ? n+1 : 0;
+ else
+ n = n>0 ? n-1 : aList.Count() - 1;
+ }
+
+ USHORT nStart = n;
+ for( ;; )
+ {
+ if ( aList[n] == nDummy )
+ {
+ // Das n"achste Fenster ist das Taskfenster
+ SfxWorkWindow* pTaskWin = pTask->GetWorkWindow_Impl();
+ if ( pActiveChild && !bTaskActive )
+ pTaskWin->pActiveChild = NULL;
+ if ( pTaskWin->ActivateNextChild_Impl( bForward ) )
+ return TRUE;
+ }
+ else
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aList[n]];
+ if ( pCli == pAct )
+ // Alle durchgesehen
+ break;
+ else if ( pCli->pWin )
+ {
+ SfxChild_Impl* pNext = pCli;
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ // Eventuell ist pNext ein Splitwindow
+ SfxSplitWindow *p = pSplit[n];
+ if ( pNext->pWin == p )
+ {
+ // Das erste/letzte Fenster dort aktivieren
+ p->SetActiveWindow_Impl( NULL );
+ pNext = NULL;
+ if( p->ActivateNextChild_Impl( bForward ) )
+ return TRUE;
+ break;
+ }
+ }
+
+ if ( pNext )
+ {
+ pNext->pWin->GrabFocus();
+ pActiveChild = pNext->pWin;
+ return TRUE;
+ }
+ }
+ }
+
+ if ( bForward )
+ n = n+1<aList.Count() ? n+1 : 0;
+ else
+ n = n>0 ? n-1 : aList.Count() - 1;
+
+ if ( n == nStart )
+ // Alle durchgesehen
+ break;
+ }
+
+ return FALSE;
+}
+
+/*
+BOOL SfxTaskWorkWin_Impl::ActivateNextChild_Impl( BOOL bForward )
+{
+ // Alle Kinder gem"a\s Liste sortieren
+ SvUShorts aList;
+ USHORT i;
+ for (i=SFX_OBJECTBAR_MAX; i<pChilds->Count(); i++)
+ {
+ SfxChild_Impl *pCli = (*pChilds)[i];
+ if ( pCli && pCli->bCanGetFocus && pCli->pWin )
+ {
+ USHORT k;
+ for (k=0; k<aList.Count(); k++)
+ if ( ChildTravelValue((*pChilds)[aList[k]]->eAlign) > ChildTravelValue(pCli->eAlign) )
+ break;
+ aList.Insert(i,k);
+ }
+ }
+
+ BOOL bFrameActive = pTask->GetActiveFrame()->GetWindow().HasChildPathFocus();
+
+ // F"ur das Taskfenster einen Dummy-Eintrag in die Liste
+ USHORT nDummy =0xFFFF;
+ USHORT nTopValue = ChildTravelValue( SFX_ALIGN_LOWESTTOP );
+ for ( i=0; i<aList.Count(); i++ )
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aList[i]];
+ if ( pCli->pWin && ChildTravelValue( pCli->eAlign ) > nTopValue )
+ break;
+ }
+
+ aList.Insert( nDummy, i );
+
+ // Index des aktiven Fensters
+ USHORT n = bForward ? 0 : aList.Count()-1;
+ if ( bFrameActive )
+ n = i;
+
+ SfxChild_Impl *pAct=NULL;
+ if ( pActiveChild && !bFrameActive )
+ {
+ // Das aktive Fenster suchen
+ for ( n=0; n<aList.Count(); n++ )
+ {
+ if ( aList[n] == nDummy )
+ continue;
+
+ SfxChild_Impl* pCli = (*pChilds)[aList[n]];
+ if ( pCli && pCli->pWin && ( pCli->pWin == pActiveChild || !pActiveChild ) )
+ {
+ pAct = pCli;
+ break;
+ }
+ }
+ }
+
+ if ( pAct )
+ {
+ for ( USHORT i=0; i<SFX_SPLITWINDOWS_MAX; i++ )
+ {
+ // Eventuell ist pAct ein Splitwindow
+ SfxSplitWindow *p = pSplit[i];
+ if ( pAct->pWin == p )
+ {
+ if( p->ActivateNextChild_Impl( bForward ) )
+ return TRUE;
+ break;
+ }
+ }
+ }
+
+ if ( pAct || bFrameActive )
+ {
+ // mit dem Nachfolger bzw. Vorg"anger des aktiven Fensters weitermachen
+ if ( bForward )
+ {
+ n = n+1;
+ if ( n == aList.Count() )
+ return FALSE;
+ }
+ else
+ {
+ if ( n == 0 )
+ return FALSE;
+ n = n-1;
+ }
+ }
+
+ for( ;; )
+ {
+ if ( aList[n] == nDummy )
+ {
+ SfxFrame *pFrame = pTask->GetFrame_Impl( bForward ? 0 : ( pTask->GetFrameCount_Impl() - 1 ) );
+ if ( !pFrame->ActivateNextChildWindow_Impl( bForward ) )
+ pFrame->GetFrameInterface()->activate();
+ return TRUE;
+ }
+ else
+ {
+ SfxChild_Impl* pCli = (*pChilds)[aList[n]];
+ if ( pCli == pAct )
+ // Alle durchgesehen
+ break;
+ else if ( pCli->pWin )
+ {
+ SfxChild_Impl* pNext = pCli;
+ for ( USHORT n=0; n<SFX_SPLITWINDOWS_MAX; n++ )
+ {
+ // Eventuell ist pNext ein Splitwindow
+ SfxSplitWindow *p = pSplit[n];
+ if ( pNext->pWin == p )
+ {
+ // Das erste/letzte Fenster dort aktivieren
+ p->SetActiveWindow_Impl( NULL );
+ pNext = NULL;
+ if( p->ActivateNextChild_Impl( bForward ) )
+ return TRUE;
+ break;
+ }
+ }
+
+ if ( pNext )
+ {
+ pNext->pWin->GrabFocus();
+ pActiveChild = pNext->pWin;
+ return TRUE;
+ }
+ }
+ }
+
+ if ( bForward )
+ {
+ n = n+1;
+ if ( n == aList.Count() )
+ break;
+ }
+ else
+ {
+ if ( n == 0 )
+ break;
+ n = n-1;
+ }
+
+ }
+
+ return FALSE;
+}
+ */
+
diff --git a/sfx2/source/bastyp/bastyp.hrc b/sfx2/source/bastyp/bastyp.hrc
new file mode 100644
index 000000000000..f243028afdba
--- /dev/null
+++ b/sfx2/source/bastyp/bastyp.hrc
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ * $RCSfile: bastyp.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "sfx.hrc"
+
+//fuer das Mapping Fehlercode -> ResId
+
+#define RC_BASTYP RID_SFX_BASTYP_START
+#define DLG_FILTER_SELECT (RC_BASTYP)
+#if SUPD<552
+#define STR_ERR_HDLMESS (RC_BASTYP+1)
+#define RID_ERRHDL_CLASS (RC_BASTYP+2)
+#endif
+#define STR_FILTER_DOWNLOAD (RC_BASTYP+3)
+#define STR_FILTER_CHOOSER (RC_BASTYP+4)
+#define STR_FILTER_OTHERS (RC_BASTYP+5)
+#define STR_FILTER_ZIPPED (RC_BASTYP+6)
+#define STR_FILTER_CHANNELON_OFFLINE (RC_BASTYP+7)
+#define STR_FILTER_EXTERNAL (RC_BASTYP+8)
+#define STR_FILTER_NOT_INSTALLED (RC_BASTYP+9)
+#define STR_FILTER_CONSULT_SERVICE (RC_BASTYP+10)
+#define STR_FILTER_COMPONENT (RC_BASTYP+11)
+#define STR_MEMEXCEPTION (RC_BASTYP+28)
+#define MSG_MEM_WARN (RC_BASTYP+29)
+
+#define RID_JSPROMPT (RC_BASTYP+8)
+#define RID_JSPROMPT_TEXT 1
+#define RID_JSPROMPT_CANCEL 2
+#define RID_JSPROMPT_OK 3
+
+#define RID_FLT_INTERACTIVE (RC_BASTYP+9)
+#define RID_FLT_INTERACTIVE_TEXT 1
+#define RID_FLT_INTERACTIVE_EDIT 2
+#define RID_FLT_INTERACTIVE_CANCEL 3
+#define RID_FLT_INTERACTIVE_OK 4
+
+//= ErrorTexte "downloadcontroller" =================================================================
+#define ERR_INET_NAME_RESOLVE (RC_BASTYP + 12)
+#define ERR_INET_CONNECT (RC_BASTYP + 13)
+#define ERR_INET_READ (RC_BASTYP + 14)
+#define ERR_INET_WRITE (RC_BASTYP + 15)
+#define ERR_INET_GENERAL (RC_BASTYP + 16)
+#define ERR_WRONG_URL (RC_BASTYP + 17)
+#define ERR_ACTIVEDOWNLOADS (RC_BASTYP + 18)
+#define ERR_QUEUEDDOWNLOADS (RC_BASTYP + 19)
+#define ERR_FILEISLOCAL (RC_BASTYP + 20)
+#define ERR_FILENAMECHECK83 (RC_BASTYP + 21)
+#define ERR_INSUFFICIENTDISKSPACE (RC_BASTYP + 22)
+
+//= Texte "downloadcontroller" =================================================================
+#define STR_DOWNLOAD_SOURCE (RC_BASTYP + 23)
+#define STR_DOWNLOAD_DESTINATION (RC_BASTYP + 24)
+#define STR_DOWNLOAD_STATE (RC_BASTYP + 25)
+#define STR_DOWNLOAD_REMAININGTIME (RC_BASTYP + 26)
+#define STR_DOWNLOAD_STATEFORMAT (RC_BASTYP + 27)
+
diff --git a/sfx2/source/bastyp/bastyp.src b/sfx2/source/bastyp/bastyp.src
new file mode 100644
index 000000000000..fccc51dc3c54
--- /dev/null
+++ b/sfx2/source/bastyp/bastyp.src
@@ -0,0 +1,433 @@
+/*************************************************************************
+ *
+ * $RCSfile: bastyp.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ //==============================================================================
+ // (C) 1992-1995 StarDivision GmbH, Hamburg, Germany
+ //==============================================================================
+#include "bastyp.hrc"
+
+ // == Error Strings ====================================================================
+String ERR_INET_NAME_RESOLVE
+{
+ Text = "Der Rechnername konnte nicht aufgelst werden\n" ;
+ Text [ ENGLISH ] = "Could not resolve hostname" ;
+ Text [ dutch ] = "De naam van de computer kon niet worden herleid\n" ;
+ Text [ english_us ] = "The computer name could not be resolved\n" ;
+ Text [ italian ] = "Non stato possibile risolvere il nome dell'host\n" ;
+ Text [ spanish ] = "El nombre del ordenador no se pudo resolver.\n" ;
+ Text [ french ] = "Impossible de rsoudre le nom de l'ordinateur\n" ;
+ Text [ swedish ] = "Datornamnet kunde inte lsas upp\n" ;
+ Text [ danish ] = "Det var ikke muligt at fortolke computernavnet\n" ;
+ Text [ portuguese ] = "Impossvel resolver o nome do computador.\n" ;
+ Text [ portuguese_brazilian ] = "Der Rechnername konnte nicht aufgelst werden\n" ;
+ Text[ chinese_simplified ] = "޷ҵַ\n";
+ Text[ russian ] = " \n";
+ Text[ polish ] = "Nazwy komputera nie mona byo przetworzy\n";
+ Text[ japanese ] = "νĖ͌‚܂ł\n";
+ Text[ chinese_traditional ] = "LkDq}C\n";
+ Text[ arabic ] = " \n";
+ Text[ greek ] = " $(ARG1)";
+ Text[ korean ] = "ǻ ̸ Ȯ ߽ϴ \n";
+ Text[ turkish ] = "Bilgisayarn ad zlemedi\n";
+};
+String ERR_INET_CONNECT
+{
+ Text = "Die Internetverbindung konnte nicht hergestellt werden" ;
+ Text [ ENGLISH ] = "The Internetconnection could not be established" ;
+ Text [ dutch ] = "De Internet-verbinding kon niet worden tot stand gebracht worden" ;
+ Text [ english_us ] = "Internet connection could not be established" ;
+ Text [ italian ] = "Non stato possibile ripristinare il collegamento Internet" ;
+ Text [ spanish ] = "No se pudo crear la conexin Internet" ;
+ Text [ french ] = "Impossible d'tablir la connexion Internet" ;
+ Text [ swedish ] = "Det gick inte att upprtta en Internet-frbindelse" ;
+ Text [ danish ] = "Det var ikke muligt at oprette en forbindelse til Internettet" ;
+ Text [ portuguese_brazilian ] = "Die Internetverbindung konnte nicht hergestellt werden" ;
+ Text [ portuguese ] = "Impossvel estabelecer a ligao com a Internet." ;
+ Text[ chinese_simplified ] = "޷͹ʻ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nie mona byo uzyska poczenia z sieci Internetu";
+ Text[ japanese ] = "ȯĂ̐ڑłĂ܂B";
+ Text[ chinese_traditional ] = "LkM Internet إ߳sC";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " Internet";
+ Text[ korean ] = "ͳ ϼ ʾҽϴ.";
+ Text[ turkish ] = "Internet balants gerekletirilemedi.";
+};
+String ERR_INET_READ
+{
+ Text = "Daten konnten nicht ber das Internet gelesen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text [ ENGLISH ] = "Error reading from the internet\n.Server error message: $(ARG1)" ;
+ Text [ dutch ] = "De gegevens konden niet via Internet worden gelezen.\nFoutmelding server: $(ARG1)" ;
+ Text [ english_us ] = "Error reading data from the internet\n.Server error message: $(ARG1)" ;
+ Text [ italian ] = "Non stato possibile leggere i dati tramite Internet.\nErrore di server: $(ARG1)" ;
+ Text [ spanish ] = "Los datos no se pudieron leer a travs de Internet.\nMensaje de error del servidor: $(ARG1)" ;
+ Text [ french ] = "Impossible de lire des donnes via Internet.\nMessage d'erreur du serveur : $(ARG1)" ;
+ Text [ swedish ] = "Data kunde inte lsas via Internet.\nServerfelmeddelande: $(ARG1)" ;
+ Text [ danish ] = "Det var ikke muligt at indlse data over Internettet.\nServerfejlmelding: $(ARG1)" ;
+ Text [ portuguese ] = "Foi impossvel ler os dados via Internet.\nMensagem de erro do servidor: $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "Daten konnten nicht ber das Internet gelesen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text[ chinese_simplified ] = "޷ͨʻȡݡ\n$(ARG1)";
+ Text[ russian ] = " .\n : $(ARG1)";
+ Text[ polish ] = "Danych nie mona odczyta przez Internet. \nKomunikat o bdzie serwera: $(ARG1)";
+ Text[ japanese ] = "ްͲȯĂ͓ǂݎ܂ł\nBް װ ү: $(ARG1)";
+ Text[ chinese_traditional ] = "LkzL Internet ŪơC\nAi~G$(ARG1)";
+ Text[ arabic ] = " .\n : $(ARG1)";
+ Text[ greek ] = " Internet.\n : $(ARG1)";
+ Text[ korean ] = "ͳݿ б \n. ޼: $(ARG1)";
+ Text[ turkish ] = "Internet zerinden veri okunurken hata olutu.\nSunucu hata iletisi: $(ARG1)";
+};
+String ERR_INET_WRITE
+{
+ Text = "Daten konnten nicht ins Internet bertragen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text [ ENGLISH ] = "Error writing to the internet.Server error message: $(ARG1)" ;
+ Text [ dutch ] = "De gegevens konden niet naar Internet worden getransfereerd.\nFoutmelding server: $(ARG1)" ;
+ Text [ english_us ] = "Error transferring data to the internet.\nServer error message: $(ARG1)" ;
+ Text [ italian ] = "Non stato possibile trasmettere i dati in Internet.\nErrore di server: $(ARG1)" ;
+ Text [ spanish ] = "Los datos no se pudieron transferir a Internet.\nMensaje de error del servidor: $(ARG1)" ;
+ Text [ french ] = "Impossible de transmettre les donnes l'Internet.\nMessage d'erreur du serveur : $(ARG1)" ;
+ Text [ swedish ] = "Data kunde inte verfras till Internet.\nServerfelmeddelande: $(ARG1)" ;
+ Text [ danish ] = "Det var ikke muligt at overfre data til Internettet.\nServerfejlmelding: $(ARG1)" ;
+ Text [ portuguese ] = "Foi impossvel transmitir dados para a Internet.\nMensagem de erro do servidor: $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "Daten konnten nicht ins Internet bertragen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text[ chinese_simplified ] = "޷ʻݡ\n$(ARG1)";
+ Text[ russian ] = " .\n : $(ARG1)";
+ Text[ polish ] = "Danych nie mona przesa przez Internet.\nKomunikat o bdzie z serwera: $(ARG1)";
+ Text[ japanese ] = "ްͲȯĂɓ]ł܂ł\nBް װ ү: $(ARG1)";
+ Text[ chinese_traditional ] = "LkV Internet ǻơC\nAi~G$(ARG1)";
+ Text[ arabic ] = " .\n : $(ARG1)";
+ Text[ greek ] = " Internet.\n : $(ARG1)";
+ Text[ korean ] = "ͳݿ ȯ .\n ޼: $(ARG1)";
+ Text[ turkish ] = "Veriler Internet zerinden aktarlamad.\nSunucu hata iletisi: $(ARG1)";
+};
+String ERR_INET_GENERAL
+{
+ Text = "Ein allgemeiner Fehler im Internetbereich trat auf" ;
+ Text [ ENGLISH ] = "Gereral Internet Error" ;
+ Text [ dutch ] = "Algemene fout in Internet" ;
+ Text [ english_us ] = "General Internet Error" ;
+ Text [ italian ] = "Si verificato un errore generale nell'area Internet" ;
+ Text [ spanish ] = "Error general en Internet" ;
+ Text [ french ] = "Erreur gnrale Internet" ;
+ Text [ swedish ] = "Ett allmnt Internet-fel uppstod" ;
+ Text [ danish ] = "Der opstod en generel Internetfejl" ;
+ Text [ portuguese ] = "Surgiu um erro geral na rea da Internet." ;
+ Text [ portuguese_brazilian ] = "Ein allgemeiner Fehler im Internetbereich trat auf" ;
+ Text[ chinese_simplified ] = "ڹʻڷһһ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Wystpi oglny bd w sieci Internetu";
+ Text[ japanese ] = "ȯė̈̈ʓIȴװ̔";
+ Text[ chinese_traditional ] = "b Internet sS򤺵oͤ@Ӥ@~C";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " Internet";
+ Text[ korean ] = "Ϲ ͳ ";
+ Text[ turkish ] = "Genel Internet hatas";
+};
+String ERR_WRONG_URL
+{
+ Text = "Fehlerhafter URL\n" ;
+ Text [ ENGLISH ] = "Wrong URL\n" ;
+ Text [ dutch ] = "Foutief URL\n" ;
+ Text [ english_us ] = "Faulty URL\n" ;
+ Text [ italian ] = "URL errato\n" ;
+ Text [ spanish ] = "URL errnea\n" ;
+ Text [ french ] = "URL erron\n" ;
+ Text [ swedish ] = "Felaktig URL\n" ;
+ Text [ danish ] = "Fejlagtig URL\n" ;
+ Text [ portuguese ] = "Erro no URL\n" ;
+ Text [ portuguese_brazilian ] = "Fehlerhafter URL\n" ;
+ Text[ chinese_simplified ] = "URLַ\n";
+ Text[ russian ] = " URL\n";
+ Text[ polish ] = "Bd w URL\n";
+ Text[ japanese ] = "URLɴװ\n";
+ Text[ chinese_traditional ] = "URL }\n";
+ Text[ arabic ] = "URL \n";
+ Text[ greek ] = " URL\n";
+ Text[ korean ] = "URL \n";
+ Text[ turkish ] = "Hatal URL\n";
+};
+String ERR_ACTIVEDOWNLOADS
+{
+ Text = "Es sind noch Downloads aktiv.\nWollen Sie wirklich abbrechen?\n" ;
+ Text [ english_us ] = "There are still downloads that are active.\nAre you sure you want to quit?\n" ;
+ Text[ italian ] = "Ci sono ancora dei download attivi.\nVolete davvero terminare?\n";
+ Text[ portuguese_brazilian ] = "Es sind noch Downloads aktiv.\nWollen Sie wirklich beenden?\n";
+ Text[ portuguese ] = "Existem ainda alguns downloads em curso.\nCancelar?\n";
+ Text[ danish ] = "Der er fortsat aktive overfrsler.\nEr du sikker p, at du vil annullere?\n";
+ Text[ french ] = "Vous avez des tlchargements en cours.\nVoulez-vous vraiment annuler ?\n";
+ Text[ swedish ] = "Det finns fortfarande aktiva nedladdningar.\nVill Du verkligen avbryta?\n";
+ Text[ dutch ] = "Er zijn nog downloads actief.\nWilt u de applicatie werkelijk stoppen?\n";
+ Text[ spanish ] = "Todava existen descargas activas.\nDesea realmente cancelar?\n";
+ Text[ chinese_simplified ] = "ļ\nҪж\n";
+ Text[ russian ] = " .\n ?\n";
+ Text[ polish ] = "Trwa jeszcze pobieranie.\nCzy chcesz je przerwa?\n";
+ Text[ japanese ] = "܂޳۰ޒłB\n~Ă낵ł?\n";
+ Text[ chinese_traditional ] = "٥bUɮסC\nun_H\n";
+ Text[ arabic ] = " .\n \n";
+ Text[ greek ] = " .\n ;\n";
+ Text[ korean ] = "ٿε尡 Դϴ.\n׷ Ͻðڽϱ?\n";
+ Text[ turkish ] = "u an devam eden veri indirme ileri var.\nGerekten kmak istiyor musunuz?\n";
+};
+String ERR_QUEUEDDOWNLOADS
+{
+ Text = "Es stehen noch Downloads in der Warteschlange.\nWollen Sie wirklich beenden?\n" ;
+ Text [ english ] = "There are still downloads in the queue.\nDo you really want to quit?\n" ;
+ Text [ english_us ] = "There are still downloads to be performed.\nDo you really want to quit?\n" ;
+ Text [ portuguese ] = "Ainda existem downloads em fila de espera.\\Deseja realmente cancelar?\n" ;
+ Text [ portuguese_brazilian ] = "Es stehen noch Downloads in der Warteschlange.\nWollen Sie wirklich beenden?\n" ;
+ Text [ swedish ] = "Det finns fortfarande nedladdningar i k.\nVill Du nd avsluta?\n" ;
+ Text [ danish ] = "Der er fortsat overfrsler i k.\nEr du sikker p, at du vil afslutte?\n" ;
+ Text [ italian ] = "Ci sono ancora dei download in corso.\nVolete davvero terminare?\n" ;
+ Text [ spanish ] = "Todava hay documentos para descargar.\nDesea realmente cancelar?\n" ;
+ Text [ french ] = "Il y a des tlchargements dans la file d'attente.\ntes-vous sr de vouloir quitter ?\n" ;
+ Text [ dutch ] = "Er staan nog downloads op de wachtlijst.\nWilt u werkelijk beindigen?\n" ;
+ Text[ chinese_simplified ] = "Ⱥ\nҪ\n";
+ Text[ russian ] = " .\n ?\n";
+ Text[ polish ] = "Dokumenty czekaj jeszcze na zaadowanie.\nCzy chcesz na pewno zakoczy?\n";
+ Text[ japanese ] = "޳۰ނ͂܂ҋ@łB\nIĂ낵ł?\n";
+ Text[ chinese_traditional ] = "٥bUɮסC\nunH\n";
+ Text[ arabic ] = " .\n \n";
+ Text[ greek ] = " .\n ;\n";
+ Text[ korean ] = "ٿε尡 Դϴ.\n׷ Ͻðڽϱ?\n";
+ Text[ turkish ] = "Bekleme srasnda veri indirme ileri var.\nGerekten kmak istiyor musunuz?\n";
+};
+String ERR_FILEISLOCAL
+{
+ Text = "Die Datei liegt bereits lokal auf Ihrem Rechner.\nSoll sie trotzdem kopiert werden?" ;
+ Text [ english ] = "The file already exists on your computer.\nDo you really want to copy?" ;
+ Text [ english_us ] = "The file already exists on your computer.\nDo you want to copy it anyway?" ;
+ Text [ portuguese ] = "O ficheiro j se encontra no seu computador.\nMesmo assim copiar?" ;
+ Text [ portuguese_brazilian ] = "Die Datei liegt bereits lokal auf Ihrem Rechner.\nSoll sie trotzdem kopiert werden?" ;
+ Text [ swedish ] = "Filen finns redan lokalt p Din dator.\nSkall den nd kopieras?" ;
+ Text [ danish ] = "Filen findes allerede lokalt p din computer.\nSkal den kopieres alligevel?" ;
+ Text [ italian ] = "Il file si trova gi sul computer dell'utente.\nVolete copiarlo lo stesso?" ;
+ Text [ spanish ] = "El archivo ya est guardado localmente en su ordenador.\nDesea copiarlo de todas maneras?" ;
+ Text [ french ] = "Ce fichier existe dj sur votre disque dur.\nSouhaitez-vous tout de mme la copier?" ;
+ Text [ dutch ] = "Het bestand bevindt zich reeds op uw computer.\nWilt u het toch kopiren?" ;
+ Text[ chinese_simplified ] = "ļѾļϡ\nҪ";
+ Text[ russian ] = " .\n ?";
+ Text[ polish ] = "Plik jest ju ulokowany w twoim komputerze.\nCzy ma on pomimo tego zosta skopiowany?";
+ Text[ japanese ] = "̧ق͂łɺ߭ɂ܂B\nł߰܂H";
+ Text[ chinese_traditional ] = "oɮפwgxsbϺФWC\n٬OnƻsH";
+ Text[ arabic ] = " .\n ߿";
+ Text[ greek ] = " .\n ' ;";
+ Text[ korean ] = " ̹ մϴ.\n׷ Ͻðڽϱ?";
+ Text[ turkish ] = "Dosya bilgisayarnzda zaten mevcut.\nYine de kopyalansn m?";
+};
+String ERR_FILENAMECHECK83
+{
+ Text = "Der eingegebene Dateiname ist ungltig.\nBitte beachten sie, dass der Dateiname maximal 8 Zeichen\nund die Dateierweiterung maximal 3 Zeichen lang sein drfen." ;
+ Text [ english ] = "Der eingegebene Dateiname ist ungltig.\nBitte beachten sie, da der Dateiname maximal 8 Zeichen\n und die Dateierweiterung maximal 3 Zeichen lang sein drfen." ;
+ Text [ english_us ] = "The file name entered is invalid.\nPlease note that file names may not exceed 8 characters\n and the file extension may only consist of 3 characters." ;
+ Text [ portuguese ] = "O nome do ficheiro indicado no vlido.\nO nome do ficheiro dever ter no mximo 8 caracteres\n e a respectiva extenso o mximo de 3." ;
+ Text [ portuguese_brazilian ] = "Der eingegebene Dateiname ist ungltig.\nBitte beachten sie, da der Dateiname maximal 8 Zeichen\n und die Dateierweiterung maximal 3 Zeichen lang sein drfen." ;
+ Text [ swedish ] = "Det inmatade filnamnet r ogiltigt.\nVar vnlig och se till att filnamnet innehller maximalt 8 tecken\n och filnamnstillgget maximalt 3 tecken." ;
+ Text [ danish ] = "Det indtastede navn er ugyldigt.\nBemrk venligst at filnavnet hjst m indeholde 8 tegn \nog filypenavnet hjst m best af 3 tegn." ;
+ Text [ italian ] = "Il nome del file digitato non valido.\nTenete presente che il nome del file pu avere una lunghezza massima di 8 caratteri\ne l'estensione del file di 3." ;
+ Text [ spanish ] = "El nombre del archivo especificado no es vlido.\\Tenga en cuenta que el nombre debe tener un mximo de 8 caracteres\ny la terminacin 3." ;
+ Text [ french ] = "Le nom de fichier indiqu est incorrect.\nIl peut comporter au maximum 8 caractres\net l'extension de fichier au maximum 3 caractres." ;
+ Text [ dutch ] = "De aangegeven bestandsnaam is ongeldig.\nWij wijzen u erop dat de bestandsnaam maximaal 8 tekens\nen de extensie maximaal 3 tekens lang mag zijn." ;
+ Text[ chinese_simplified ] = "ļЧ\nע⣺ļó8ַ\nļչó 3 ַ";
+ Text[ russian ] = " .\n, , 8 \n, 3 .";
+ Text[ polish ] = "Podana nazwa pliku jest nieprawidowa.\nProsz uwzgldni, e nazwa pliku moe zawiera maksym. 8 znakw\n,a rozszerzenie pliku maksym. 3 znaki.";
+ Text[ japanese ] = "w肵̧ٖłB\ņٖ͍ō8܂\ņيgq͍ō3܂łłȂĂ͂ȂƂɒӂĉB";
+ Text[ chinese_traditional ] = "JɮצWLġC\nбzdNɮצWoWL8ӦrC\nɦWoWL 3 ӦrC";
+ Text[ arabic ] = " .\n \n .";
+ Text[ greek ] = " .\n 8 \n 3 .";
+ Text[ korean ] = " ̸ ȿ ʽϴ.\n ̸ 8ڸ ʰ ٴ°Ͱ \n Ȯڰ3ڸ ʰ Ҽ ٴ° Ͻʽÿ.";
+ Text[ turkish ] = "Girilen dosya ad geerli deil.\nDosya ad en fazla 8 ve dosyan\\uzants en fazla 3 karakter uzunluunda olabilir.";
+};
+String ERR_INSUFFICIENTDISKSPACE
+{
+ Text = "Die Datei %1 wird grer als der zur Verfgung stehende Plattenplatz.\nWollen Sie fortfahren ?\n" ;
+ Text [ english_us ] = "The file %1 exceeds the available disk space.\nDo you want to continue anyway?\n" ;
+ Text[ italian ] = "Il file %1 occupa pi spazio di quello disponibile sul disco.\nVolete continuare?\n";
+ Text[ portuguese_brazilian ] = "Die Datei %1 wird grer als der zur Verfgung stehende Plattenplatz.\nWollen Sie fortfahren ?\n";
+ Text[ portuguese ] = "O ficheiro %1 excede o espao disponvel no disco.\nContinuar?\n";
+ Text[ danish ] = "Filen %1 overskrider den tilgngelige diskplads.\nVil du fortstte alligevel?\n";
+ Text[ french ] = "La taille du fichier %1 dpasse l'espace libre sur votre disque dur.\nSouhaitez-vous poursuivre ?\n";
+ Text[ swedish ] = "Filen %1 blir strre n det tillgngliga diskutrymmet.\nVill Du nd fortstta?\n";
+ Text[ dutch ] = "Bestand %1 wordt groter dan de beschikbare schuifruimte.\nWilt u doorgaan ?\n";
+ Text[ spanish ] = "El tamao del archivo %1 exceder al del disponible en el disco.\nDesea continuar?\n";
+ Text[ chinese_simplified ] = "ļ %1 ռеĿÿռ䡣\nҪ\n";
+ Text[ russian ] = " %1 , .\n ?\n";
+ Text[ polish ] = "Plik %1 przewysza ilo miejsca na dysku.\nKontynuowa ?\n";
+ Text[ japanese ] = "̧ %1͋޽eʗ̈zĂ܂\ns܂?\n";
+ Text[ chinese_traditional ] = "ɮ %1 һݪŶj{siΪŶC\nn~S\n";
+ Text[ arabic ] = " %1 .\n ɿ\n";
+ Text[ greek ] = " %1 .\n ;\n";
+ Text[ korean ] = " %1 ũ ʰ߽ϴ.\n׷ Ͻðڽϱ?\n";
+ Text[ turkish ] = "%1 dosyas mevcut disk alann ayor.\nDevam etmek istiyor musunuz ?\n";
+};
+//= Texte "downloadcontroller" =================================================================
+String STR_DOWNLOAD_SOURCE
+{
+ Text = "Quelle" ;
+ Text [ English ] = "Location" ;
+ Text [ English_us ] = "Source" ;
+ Text [ italian ] = "Sorgente" ;
+ Text [ spanish ] = "Fuente" ;
+ Text [ french ] = "Source" ;
+ Text [ dutch ] = "Bron" ;
+ Text [ swedish ] = "Klla" ;
+ Text [ danish ] = "Kilde" ;
+ Text [ portuguese ] = "Fonte" ;
+ Text [ portuguese_brazilian ] = "Quelle" ;
+ Text [ chinese_simplified ] = "Դ";
+ Text [ russian ] = "";
+ Text [ polish ] = "rdo";
+ Text [ japanese ] = "";
+ Text [ chinese_traditional ] = "ӷ";
+ Text [ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ҽ";
+ Text[ turkish ] = "Kaynak";
+};
+String STR_DOWNLOAD_DESTINATION
+{
+ Text = "Ziel" ;
+ Text [ English ] = "Saving" ;
+ Text [ English_us ] = "Target" ;
+ Text [ italian ] = "Destinazione" ;
+ Text [ spanish ] = "Destino" ;
+ Text [ french ] = "Destination" ;
+ Text [ dutch ] = "Doel" ;
+ Text [ swedish ] = "Ml" ;
+ Text [ danish ] = "Ml" ;
+ Text [ portuguese ] = "Destino" ;
+ Text [ portuguese_brazilian ] = "Ziel" ;
+ Text [ chinese_simplified ] = "Ŀ";
+ Text [ russian ] = "";
+ Text [ polish ] = "Cel";
+ Text [ japanese ] = "ޯ";
+ Text [ chinese_traditional ] = "ؼ";
+ Text [ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ǥ";
+ Text[ turkish ] = "Hedef";
+};
+String STR_DOWNLOAD_STATE
+{
+ Text = "Status" ;
+ Text [ English ] = "Status" ;
+ Text [ English_us ] = "Status" ;
+ Text [ italian ] = "Stato" ;
+ Text [ spanish ] = "Estado" ;
+ Text [ french ] = "Statut" ;
+ Text [ dutch ] = "Status" ;
+ Text [ swedish ] = "Status" ;
+ Text [ danish ] = "Status" ;
+ Text [ portuguese ] = "Estado" ;
+ Text [ portuguese_brazilian ] = "Status" ;
+ Text [ chinese_simplified ] = "״̬";
+ Text [ russian ] = "";
+ Text [ polish ] = "Stan";
+ Text [ japanese ] = "ð";
+ Text [ chinese_traditional ] = "A";
+ Text [ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Durum";
+};
+String STR_DOWNLOAD_REMAININGTIME
+{
+ Text = "Restzeit" ;
+ Text [ English ] = "Time Left" ;
+ Text [ English_us ] = "Remaining Time" ;
+ Text [ italian ] = "Tempo restante" ;
+ Text [ spanish ] = "Tiempo restante" ;
+ Text [ french ] = "Temps restant" ;
+ Text [ dutch ] = "Resttijd" ;
+ Text [ swedish ] = "Resterande tid" ;
+ Text [ danish ] = "Resterende tid" ;
+ Text [ portuguese ] = "Tempo restante" ;
+ Text [ portuguese_brazilian ] = "Restzeit" ;
+ Text [ chinese_simplified ] = "ʣʱ";
+ Text [ russian ] = " ";
+ Text [ polish ] = "Pozostay czas";
+ Text [ japanese ] = "c莞";
+ Text [ chinese_traditional ] = "Ѿlɶ";
+ Text [ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ð";
+ Text[ turkish ] = "Kalan sre";
+};
+String STR_DOWNLOAD_STATEFORMAT
+{
+ Text = "$(READ) von $(TOTAL) [ $(TIME) ]" ;
+ Text [ English ] = "$(READ) of $(TOTAL) [ $(TIME) ]" ;
+ Text[ english_us ] = "$(READ) of $(TOTAL) [ $(TIME) ]";
+ Text[ portuguese ] = "$(READ) de $(TOTAL) [ $(TIME) ]";
+ Text[ russian ] = "$(READ) $(TOTAL) [ $(TIME) ]";
+ Text[ greek ] = "$(READ) $(TOTAL) [ $(TIME) ]";
+ Text[ dutch ] = "$(READ) van $(TOTAL) [ $(TIME) ]";
+ Text[ french ] = "$(READ) de $(TOTAL) [ $(TIME) ]";
+ Text[ spanish ] = "$(READ) de $(TOTAL) [ $(TIME) ]";
+ Text[ italian ] = "$(READ) di $(TOTAL) [ $(TIME) ]";
+ Text[ danish ] = "$(READ) af $(TOTAL) [ $(TIME) ]";
+ Text[ swedish ] = "$(READ) av $(TOTAL) [ $(TIME) ]";
+ Text[ polish ] = "$(READ) z $(TOTAL) [ $(TIME) ]";
+ Text[ portuguese_brazilian ] = "$(READ) of $(TOTAL) [ $(TIME) ]";
+ Text[ japanese ] = "$(READ) von $(TOTAL) [ $(TIME) ]";
+ Text[ korean ] = "$(TOTAL) $(READ) [ $(TIME) ]";
+ Text[ chinese_simplified ] = "$(READ) ܼ $(TOTAL) [ $(TIME) ]";
+ Text[ chinese_traditional ] = "$(READ) `p $(TOTAL) [ $(TIME) ]";
+ Text[ arabic ] = "$(READ) of $(TOTAL) [ $(TIME) ]";
+ Text[ turkish ] = "$(READ) Toplam $(TOTAL) [ $(TIME) ]";
+};
diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx
new file mode 100644
index 000000000000..1e88ff5c1646
--- /dev/null
+++ b/sfx2/source/bastyp/bitset.cxx
@@ -0,0 +1,428 @@
+/*************************************************************************
+ *
+ * $RCSfile: bitset.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#pragma hdrstop
+
+#include "bitset.hxx"
+
+#include <string.h> // memset(), memcpy()
+#include <limits.h> // USHRT_MAX
+
+//====================================================================
+// add nOffset to each bit-value in the set
+
+BitSet BitSet::operator<<( USHORT nOffset ) const
+{
+ DBG_MEMTEST();
+ // create a work-copy, return it if nothing to shift
+ BitSet aSet(*this);
+ if ( nOffset == 0 )
+ return aSet;
+
+ // compute the shiftment in long-words and bits
+ USHORT nBlockDiff = nOffset / 32;
+ ULONG nBitValDiff = nOffset % 32;
+
+ // compute the new number of bits
+ for ( USHORT nBlock = 0; nBlock < nBlockDiff; ++nBlock )
+ aSet.nCount -= CountBits( *(aSet.pBitmap+nBlock) );
+ aSet.nCount -= CountBits( *(aSet.pBitmap+nBlockDiff) >> (32-nBitValDiff) );
+
+ // shift complete long-words
+ USHORT nTarget, nSource;
+ for ( nTarget = 0, nSource = nBlockDiff;
+ (nSource+1) < aSet.nBlocks;
+ ++nTarget, ++nSource )
+ *(aSet.pBitmap+nTarget) =
+ ( *(aSet.pBitmap+nSource) << nBitValDiff ) |
+ ( *(aSet.pBitmap+nSource+1) >> (32-nBitValDiff) );
+
+ // shift the remainder (if in total minor 32 bits, only this)
+ *(aSet.pBitmap+nTarget) = *(aSet.pBitmap+nSource) << nBitValDiff;
+
+ // determine the last used block
+ while ( *(aSet.pBitmap+nTarget) == 0 )
+ --nTarget;
+
+ // shorten the block-array
+ if ( nTarget < aSet.nBlocks )
+ {
+ ULONG* pNewMap = new ULONG[nTarget];
+ memcpy( pNewMap, aSet.pBitmap, 4 * nTarget );
+ delete aSet.pBitmap;
+ aSet.pBitmap = pNewMap;
+ aSet.nBlocks = nTarget;
+ }
+
+ return aSet;
+}
+
+//--------------------------------------------------------------------
+
+// substracts nOffset from each bit-value in the set
+
+BitSet BitSet::operator>>( USHORT nOffset ) const
+{
+ DBG_MEMTEST();
+ return BitSet();
+}
+
+//--------------------------------------------------------------------
+
+// internal code for operator= and copy-ctor
+
+void BitSet::CopyFrom( const BitSet& rSet )
+{
+ DBG_MEMTEST();
+ nCount = rSet.nCount;
+ nBlocks = rSet.nBlocks;
+ if ( rSet.nBlocks )
+ {
+ DBG_MEMTEST();
+ pBitmap = new ULONG[nBlocks];
+ memcpy( pBitmap, rSet.pBitmap, 4 * nBlocks );
+ }
+ else
+ pBitmap = 0;
+}
+
+//--------------------------------------------------------------------
+
+// creates an empty bitset
+
+BitSet::BitSet()
+{
+ DBG_MEMTEST();
+ nCount = 0;
+ nBlocks = 0;
+ pBitmap = 0;
+}
+
+//--------------------------------------------------------------------
+
+// creates a copy of bitset rOrig
+
+BitSet::BitSet( const BitSet& rOrig )
+{
+ DBG_MEMTEST();
+ CopyFrom(rOrig);
+}
+
+//--------------------------------------------------------------------
+
+// creates a bitset from an array
+
+BitSet::BitSet( USHORT* pArray, USHORT nSize ):
+ nCount(0)
+{
+ DBG_MEMTEST();
+ // find the highest bit to set
+ USHORT nMax = 0;
+ for ( USHORT n = 0; n < nCount; ++n )
+ if ( pArray[n] > nMax )
+ nMax = pArray[n];
+
+ // if there are bits at all
+ if ( nMax > 0 )
+ {
+ // allocate memory for all blocks needed
+ nBlocks = nMax / 32 + 1;
+ pBitmap = new ULONG[nBlocks];
+ memset( pBitmap, 0, 4 * nBlocks );
+
+ // set all the bits
+ for ( USHORT n = 0; n < nCount; ++n )
+ {
+ // compute the block no. and bitvalue
+ USHORT nBlock = n / 32;
+ ULONG nBitVal = 1L << (n % 32);
+
+ // set a single bit
+ if ( ( *(pBitmap+nBlock) & nBitVal ) == 0 )
+ {
+ *(pBitmap+nBlock) |= nBitVal;
+ ++nCount;
+ }
+ }
+ }
+ else
+ {
+ // initalize emtpy set
+ nBlocks = 0;
+ pBitmap = 0;
+ }
+}
+
+//--------------------------------------------------------------------
+
+// frees the storage
+
+BitSet::~BitSet()
+{
+ DBG_MEMTEST();
+ delete pBitmap;
+}
+
+//--------------------------------------------------------------------
+
+// creates a bitmap with all bits in rRange set
+
+BitSet::BitSet( const Range& rRange )
+{
+ DBG_MEMTEST();
+
+}
+
+//--------------------------------------------------------------------
+
+// assignment from another bitset
+
+BitSet& BitSet::operator=( const BitSet& rOrig )
+{
+ DBG_MEMTEST();
+ if ( this != &rOrig )
+ {
+ delete pBitmap;
+ CopyFrom(rOrig);
+ }
+ return *this;
+}
+
+//--------------------------------------------------------------------
+
+// assignment from a single bit
+
+BitSet& BitSet::operator=( USHORT nBit )
+{
+ DBG_MEMTEST();
+ delete pBitmap;
+
+ USHORT nBlocks = nBit / 32;
+ ULONG nBitVal = 1L << (nBit % 32);
+ nCount = 1;
+
+ ULONG *pBitmap = new ULONG[nBlocks];
+ memset( pBitmap + nBlocks, 0, 4 * nBlocks );
+
+ *(pBitmap+nBlocks) = nBitVal;
+
+ return *this;
+}
+
+//--------------------------------------------------------------------
+
+// creates the asymetric difference with another bitset
+
+BitSet& BitSet::operator-=(USHORT nBit)
+{
+ DBG_MEMTEST();
+ USHORT nBlock = nBit / 32;
+ ULONG nBitVal = 1L << (nBit % 32);
+
+ if ( nBlock >= nBlocks )
+ return *this;
+
+ if ( (*(pBitmap+nBlock) & nBitVal) )
+ {
+ *(pBitmap+nBlock) &= ~nBitVal;
+ --nCount;
+ }
+
+ return *this;
+}
+
+//--------------------------------------------------------------------
+
+// unites with the bits of rSet
+
+BitSet& BitSet::operator|=( const BitSet& rSet )
+{
+ DBG_MEMTEST();
+ USHORT nMax = Min(nBlocks, rSet.nBlocks);
+
+ // expand the bitmap
+ if ( nBlocks < rSet.nBlocks )
+ {
+ ULONG *pNewMap = new ULONG[rSet.nBlocks];
+ memset( pNewMap + nBlocks, 0, 4 * (rSet.nBlocks - nBlocks) );
+
+ if ( pBitmap )
+ {
+ memcpy( pNewMap, pBitmap, 4 * nBlocks );
+ delete pBitmap;
+ }
+ pBitmap = pNewMap;
+ nBlocks = rSet.nBlocks;
+ }
+
+ // add the bits blocks by block
+ for ( USHORT nBlock = 0; nBlock < nMax; ++nBlock )
+ {
+ // compute numberof additional bits
+ ULONG nDiff = ~*(pBitmap+nBlock) & *(rSet.pBitmap+nBlock);
+ nCount += CountBits(nDiff);
+
+ *(pBitmap+nBlock) |= *(rSet.pBitmap+nBlock);
+ }
+
+ return *this;
+}
+
+//--------------------------------------------------------------------
+
+// unites with a single bit
+
+BitSet& BitSet::operator|=( USHORT nBit )
+{
+ DBG_MEMTEST();
+ USHORT nBlock = nBit / 32;
+ ULONG nBitVal = 1L << (nBit % 32);
+
+ if ( nBlock >= nBlocks )
+ {
+ ULONG *pNewMap = new ULONG[nBlock+1];
+ memset( pNewMap + nBlocks, 0, 4 * (nBlock - nBlocks + 1) );
+
+ if ( pBitmap )
+ {
+ memcpy( pNewMap, pBitmap, 4 * nBlocks );
+ delete pBitmap;
+ }
+ pBitmap = pNewMap;
+ nBlocks = nBlock+1;
+ }
+
+ if ( (*(pBitmap+nBlock) & nBitVal) == 0 )
+ {
+ *(pBitmap+nBlock) |= nBitVal;
+ ++nCount;
+ }
+
+ return *this;
+}
+
+//--------------------------------------------------------------------
+
+// determines if the bit is set (may be the only one)
+
+BOOL BitSet::Contains( USHORT nBit ) const
+{
+ DBG_MEMTEST();
+ USHORT nBlock = nBit / 32;
+ ULONG nBitVal = 1L << (nBit % 32);
+
+ if ( nBlock >= nBlocks )
+ return FALSE;
+ return ( nBitVal & *(pBitmap+nBlock) ) == nBitVal;
+}
+
+//--------------------------------------------------------------------
+
+// determines if the bitsets are equal
+
+BOOL BitSet::operator==( const BitSet& rSet ) const
+{
+ DBG_MEMTEST();
+ if ( nBlocks != rSet.nBlocks )
+ return FALSE;
+
+ USHORT nBlock = nBlocks;
+ while ( nBlock-- > 0 )
+ if ( *(pBitmap+nBlock) != *(rSet.pBitmap+nBlock) )
+ return FALSE;
+
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+// counts the number of 1-bits in the parameter
+
+USHORT BitSet::CountBits( ULONG nBits )
+{
+ USHORT nCount = 0;
+ int nBit = 32;
+ while ( nBit-- && nBits )
+ { if ( ( (long)nBits ) < 0 )
+ ++nCount;
+ nBits = nBits << 1;
+ }
+ return nCount;
+}
+
+//--------------------------------------------------------------------
+
+USHORT IndexBitSet::GetFreeIndex()
+{
+ for(USHORT i=0;i<USHRT_MAX;i++)
+ if(!Contains(i))
+ {
+ *this|=i;
+ return i;
+ }
+ DBG_ASSERT(FALSE, "IndexBitSet enthaelt mehr als USHRT_MAX Eintraege");
+ return 0;
+}
+
+
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
new file mode 100644
index 000000000000..c23b6eeb2842
--- /dev/null
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -0,0 +1,3215 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltfnc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "fltfnc.hxx"
+
+#ifndef _EXCHANGE_HXX //autogen
+#include <vcl/exchange.hxx>
+#endif
+#ifndef _CONFIG_HXX //autogen
+#include <vcl/config.hxx>
+#endif
+#ifndef _SB_SBMETH_HXX //autogen
+#include <basic/sbmeth.hxx>
+#endif
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _SBX_SBXOBJECT_HXX //autogen
+#include <svtools/sbxobj.hxx>
+#endif
+#ifndef __SBX_SBXMETHOD_HXX //autogen
+#include <svtools/sbxmeth.hxx>
+#endif
+#ifndef _SBXCORE_HXX //autogen
+#include <svtools/sbxcore.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _RTL_USTRING_HXX //autogen
+#include <rtl/ustring.hxx>
+#endif
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _EXTATTR_HXX
+#include <svtools/extattr.hxx>
+#endif
+#ifndef _LCKBITEM_HXX //autogen
+#include <svtools/lckbitem.hxx>
+#endif
+#ifndef _INETTYPE_HXX //autogen
+#include <svtools/inettype.hxx>
+#endif
+#ifndef _INET_CONFIG_HXX //autogen
+#include <inet/inetcfg.hxx>
+#endif
+#ifndef _SFXRECTITEM_HXX
+#include <svtools/rectitem.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFO_HPP_
+#include <com/sun/star/document/XDocumentInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFOSUPPLIER_HPP_
+#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_DOCUMENT_XSTANDALONEDOCUMENTINFO_HPP_
+#include <com/sun/star/document/XStandaloneDocumentInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
+#include <com/sun/star/frame/XDispatch.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
+#include <com/sun/star/frame/XStatusListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTION_HPP_
+#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HPP_
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_DISPATCHDESCRIPTOR_HPP_
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HPP_
+#include <com/sun/star/frame/FrameActionEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTION_HPP_
+#include <com/sun/star/frame/FrameAction.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAMELOADER_HPP_
+#include <com/sun/star/frame/XFrameLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XLOADEVENTLISTENER_HPP_
+#include <com/sun/star/frame/XLoadEventListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFILTERDETECT_HPP_
+#include <com/sun/star/frame/XFilterDetect.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINMODE_HPP_
+#include <com/sun/star/plugin/PluginMode.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINDESCRIPTION_HPP_
+#include <com/sun/star/plugin/PluginDescription.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINEXCEPTION_HPP_
+#include <com/sun/star/plugin/PluginException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINVARIABLE_HPP_
+#include <com/sun/star/plugin/PluginVariable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_XPLUGIN_HPP_
+#include <com/sun/star/plugin/XPlugin.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_XPLUGINMANAGER_HPP_
+#include <com/sun/star/plugin/XPluginManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_XPLUGINCONTEXT_HPP_
+#include <com/sun/star/plugin/XPluginContext.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LOADER_XIMPLEMENTATIONLOADER_HPP_
+#include <com/sun/star/loader/XImplementationLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LOADER_CANNOTACTIVATEFACTORYEXCEPTION_HPP_
+#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX
+#include <unotools/processfactory.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_CHAOS_DOCUMENTHEADERFIELD_HPP_
+#include <com/sun/star/chaos/DocumentHeaderField.hpp>
+#endif
+
+#include <sal/types.h>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/ucb/XContent.hpp>
+#include <rtl/ustring.hxx>
+#include <vos/process.hxx>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+using namespace ::com::sun::star::chaos;
+using namespace ::rtl;
+using namespace ::vos;
+
+#ifndef _SV_SOUND_HXX
+#include <vcl/sound.hxx>
+#endif
+#ifndef _SV_SYSTEM_HXX
+#include <vcl/system.hxx>
+#endif
+#ifndef _SVTOOLS_CTYPEITM_HXX
+#include <svtools/ctypeitm.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+
+#include "inimgr.hxx"
+#include "app.hxx"
+#include "fltdlg.hxx"
+#include "sfxhelp.hxx"
+#include "sfxbasic.hxx"
+#include "docfilt.hxx"
+#include "docfac.hxx"
+#include "sfxtypes.hxx"
+#include "sfxuno.hxx"
+#include "docfile.hxx"
+#include "progress.hxx"
+#include "loadenv.hxx"
+#include "iodlg.hxx"
+#include "openflag.hxx"
+#include "bastyp.hrc"
+#include "sfxresid.hxx"
+#include "doctempl.hxx"
+#include "frame.hxx"
+#include "dispatch.hxx"
+#include "urlframe.hxx"
+#include "picklist.hxx"
+#include "topfrm.hxx"
+#include "plugwin.hxx"
+#include "helper.hxx"
+
+// wg. EXPLORER_BROWSER
+#include "request.hxx"
+#include "nfltdlg.hxx"
+#include "arrdecl.hxx"
+#include "appdata.hxx"
+#include "appuno.hxx"
+#include "viewfrm.hxx"
+#include "ucbhelp.hxx"
+
+#define SFX_STR_OVERRIDE "Override"
+
+#ifndef ERRCODE_SFX_RESTART
+#define ERRCODE_SFX_RESTART 0
+#endif
+
+#define EXPLORER_URL_FILTER "explorer"
+#define SFX_FILTERNAME_COMPONENT "component"
+#define SFX_FILTERNAME_HELPENTRY "helpentry"
+
+class SfxSound_Impl
+{
+ Sound* pSound;
+ String aSoundFile;
+ sal_Bool bDeleteFile;
+ DECL_LINK( Done, void* );
+ DECL_LINK( Start, void* );
+
+public:
+ SfxSound_Impl( const String& rSound, sal_Bool bTemp );
+ ~SfxSound_Impl()
+ { delete pSound; }
+};
+
+SfxSound_Impl::SfxSound_Impl( const String& rSound, sal_Bool bTemp )
+ : aSoundFile( rSound )
+ , pSound( new Sound )
+ , bDeleteFile( bTemp )
+{
+ Application::PostUserEvent( LINK( this, SfxSound_Impl, Start ) );
+}
+
+IMPL_LINK( SfxSound_Impl, Start, void*, pVoid )
+{
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( INET_PROT_FILE );
+ aObj.SetSmartURL( aSoundFile );
+ if ( pSound->SetSoundName( aObj.PathToFileName() ) )
+ {
+ pSound->SetNotifyHdl( LINK( this, SfxSound_Impl, Done ) );
+ pSound->Play();
+ }
+ else
+ delete this;
+ if ( bDeleteFile )
+ SfxContentHelper::Kill( aObj.GetMainURL() );
+ return 0L;
+}
+
+IMPL_LINK( SfxSound_Impl, Done, void*, pVoid )
+{
+ if ( !pSound->IsPlaying() || pSound->GetLastError() )
+ delete this;
+ return 0L;
+}
+
+class SfxAsyncChaosFactory_Impl : public SfxListener
+{
+//(dv) CntAnchorRef xAnchor;
+ SfxItemSet* pArgs;
+
+public:
+ SfxAsyncChaosFactory_Impl( /*(dv)CntAnchorRef& rAnchor,*/ SfxItemSet* pSet );
+ ~SfxAsyncChaosFactory_Impl();
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+};
+
+
+SfxAsyncChaosFactory_Impl::SfxAsyncChaosFactory_Impl( /*(dv)CntAnchorRef& rAnchor, */SfxItemSet* pSet )
+ : /*(dv)xAnchor( &rAnchor )
+ , */ pArgs( pSet )
+{
+ if (!pArgs)
+ pArgs = new SfxAllItemSet( SFX_APP()->GetPool() );
+//(dv) StartListening( *xAnchor );
+}
+
+SfxAsyncChaosFactory_Impl::~SfxAsyncChaosFactory_Impl()
+{
+//(dv) EndListening( *xAnchor );
+ delete pArgs;
+}
+
+void SfxAsyncChaosFactory_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+#if 0 //(dv)
+ if( rHint.ISA(CntStatusHint) )
+ {
+ const CntStatusHint& rStatusHint = (const CntStatusHint&)rHint;
+ CntStatus eStatus = rStatusHint.GetStatus();
+ sal_uInt16 nWhich = rStatusHint.GetRequest() ? rStatusHint.GetRequest()->Which() : 0;
+ if ( nWhich == WID_INSERT )
+ {
+ if( eStatus == CNT_STATUS_DONE )
+ {
+ pArgs->Put( SfxStringItem ( SID_FILE_NAME, xAnchor->GetViewURL() ), SID_FILE_NAME );
+ SFX_APP()->GetDispatcher().Execute( SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, *pArgs );
+ delete this;
+ }
+ else if( eStatus == CNT_STATUS_ERROR )
+ {
+ ErrCode nErr = rStatusHint.GetError();
+ nErr &= ~(ERRCODE_DYNAMIC_MASK);
+ if( nErr == ERRCODE_ABORT )
+ delete this;
+ }
+ }
+ }
+#endif //(dv)
+}
+
+struct FlagMapping_Impl
+{
+ const char* pName;
+ SfxFilterFlags nValue;
+};
+
+static const FlagMapping_Impl aMap[] =
+{
+ "Import", SFX_FILTER_IMPORT,
+ "Export", SFX_FILTER_EXPORT,
+ "Internal", SFX_FILTER_INTERNAL,
+ "Template", SFX_FILTER_TEMPLATE,
+ "TemplatePath", SFX_FILTER_TEMPLATEPATH,
+ "Own", SFX_FILTER_OWN,
+ "Alien", SFX_FILTER_ALIEN,
+ "Asynchron", SFX_FILTER_ASYNC,
+ "Readonly", SFX_FILTER_OPENREADONLY,
+ "UsesOptions", SFX_FILTER_USESOPTIONS,
+ "NotInstalled", SFX_FILTER_MUSTINSTALL,
+ "ConsultService", SFX_FILTER_CONSULTSERVICE,
+ "NotInChooser", SFX_FILTER_NOTINCHOOSER,
+ "NotInFileDialog", SFX_FILTER_NOTINFILEDLG,
+ "Packed", SFX_FILTER_PACKED,
+ "SilentExport", SFX_FILTER_SILENTEXPORT,
+ "Prefered", SFX_FILTER_PREFERED,
+ "BrowserPrefered", SFX_FILTER_BROWSERPREFERED,
+ 0, 0
+};
+
+SfxFilterFlags NameToFlag_Impl( const String& aName )
+/* [Beschreibung]
+
+ Konvertiert einen Namen aus der Install.ini in das zug. SFX_FILTER_FLAG
+
+ */
+
+{
+ sal_uInt16 n = 0;
+ for( const char* pc = aMap[0].pName; pc;
+ pc = aMap[++n].pName)
+ if( aName.EqualsAscii(pc) )
+ return aMap[n].nValue;
+ DBG_ERROR("Name nicht gefunden" );
+ return 0;
+}
+
+String FlagsToName_Impl( SfxFilterFlags nValue )
+/* [Beschreibung]
+
+ Konvertiert ein SFX_FILTER_FLAG in einen Text, der in die Install.ini
+ geschrieben werden kann
+ */
+{
+ ByteString aRet;
+ sal_uInt16 n = 0;
+ for( const char* pc = aMap[0].pName; pc;
+ pc = aMap[++n].pName)
+ if( nValue & aMap[n].nValue )
+ {
+ if( !aRet.Len() )
+ aRet = pc;
+ else
+ {
+ aRet+="|";
+ aRet+=pc;
+ }
+ }
+
+ return String(S2U(aRet));
+}
+
+//----------------------------------------------------------------
+
+inline String ToUpper_Impl( const String &rStr )
+{
+ String aRet(rStr);
+ Application::GetAppInternational().ToUpper(aRet);
+ return aRet;
+}
+
+//----------------------------------------------------------------
+
+struct LoadArg_Impl
+{
+ String aGroup;
+ sal_Bool bInstallIni;
+ SfxFilterFlags nOrFlags;
+ SfxFilterFlags nNotFlags;
+};
+
+class SfxFilterContainer_Impl
+{
+public:
+ SfxFilterContainer_Impl() : bLoadPending( sal_False ), pArg( 0 ) {}
+ SfxFilterList_Impl aList;
+ String aName;
+ LoadArg_Impl* pArg;
+ sal_Bool bLoadPending;
+ SfxFilterContainerFlags eFlags;
+};
+
+
+//----------------------------------------------------------------
+
+SfxFilterContainer::SfxFilterContainer( const String& rName )
+{
+ pImpl = new SfxFilterContainer_Impl;
+ pImpl->eFlags = 0;
+ pImpl->aName = rName;
+}
+
+//----------------------------------------------------------------
+
+SfxFilterContainer::~SfxFilterContainer()
+{
+ DELETEZ( pImpl->pArg );
+ SfxFilterList_Impl& rList = pImpl->aList;
+ sal_uInt16 nCount = (sal_uInt16 )rList.Count();
+ for( sal_uInt16 n = 0; n<nCount; n++ )
+ delete rList.GetObject( n );
+ delete pImpl;
+}
+
+SfxFilterContainerFlags SfxFilterContainer::GetFlags() const
+{
+ return pImpl->eFlags;
+}
+
+void SfxFilterContainer::SetFlags( SfxFilterContainerFlags eFlags )
+{
+ pImpl->eFlags = eFlags;
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterContainer::GetFilter4Protocol(
+ SfxMedium& rMed, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+/* [Beschreibung]
+
+ Gibt den Filter zu einem bestimmten Protokoll zurueck. Diese Methode
+ darf sich nicht auf Inhalte beziehen, sondern soll allein anhand von
+ Protokoll / ::com::sun::star::util::URL einen Filter auswaehlen.
+ In der Basisimplementierung werden einige Protokolle direkt auf
+ GetFilter4FilterName abgebildet, man zur Integration des Filters
+ in die Filterdetection einfach einen Filter des Protokollnames anlegen
+ kann.
+ */
+{
+ const INetURLObject& rObj = rMed.GetURLObject();
+ String aName = rMed.GetURLObject().GetMainURL();
+ // Hier noch pruefen, ob das Doc im Browser dargestellt werden soll
+ SFX_ITEMSET_ARG( rMed.GetItemSet(), pTargetItem, SfxStringItem,
+ SID_TARGETNAME, sal_False);
+ if( pTargetItem && pTargetItem->GetValue().EqualsAscii("_beamer") )
+ return 0;
+ return GetFilter4Protocol( aName, nMust, nDont );
+}
+
+const SfxFilter* SfxFilterContainer::GetFilter4Protocol( const String& rName, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+{
+ String aName( rName );
+ ForceFilterLoad_Impl();
+ aName.ToLowerAscii();
+ sal_uInt16 nCount = ( sal_uInt16 ) pImpl->aList.Count();
+ for( sal_uInt16 n = 0; n < nCount; n++ )
+ {
+ const SfxFilter* pFilter = pImpl->aList.GetObject( n );
+ SfxFilterFlags nFlags = pFilter->GetFilterFlags();
+ String aString( pFilter->GetURLPattern());
+ if ( (nFlags & nMust) == nMust && !(nFlags & nDont ) &&
+ WildCard(aString ).Matches( aName ) )
+ return pFilter;
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+sal_Bool SfxFilterContainer::IsUsableForRedirects() const
+/* [Beschreibung]
+
+ Alle FilterContainer, die hier stehen, werden fuer den InternetFileTypen
+ Dialog benutzt (koennen dort MIME Types usw. zugeordnet werden).
+ */
+{
+ String aName = pImpl->aName;
+ // Bloed, aber erstmal notwendig. Spaeter ueber MussAenderung beim
+ // Impl Makro
+ return aName.EqualsAscii("swriter") || aName.EqualsAscii("simpress") || aName.EqualsAscii("scalc") ||
+ aName.EqualsAscii("simage") || aName.EqualsAscii("schart") || aName.EqualsAscii("smath") ||
+ aName.EqualsAscii("PlugIn") || aName.EqualsAscii("swriter/web") || aName.EqualsAscii("sdraw") ||
+ aName.EqualsAscii(SFX_FCONTNR_EXTAPP) ||
+// aName == String( SfxResId( STR_FILTER_OTHERS ) );
+ aName.EqualsAscii("soffice");
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxFilterContainer::Execute( SfxMedium& rMedium, SfxFrame*& pFrame) const
+{
+ return ERRCODE_ABORT;
+}
+
+//----------------------------------------------------------------
+
+sal_uInt16 SfxFilterContainer::GetFilterCount() const
+{
+ // Dazu muessen die Filter geladen werden
+ ForceFilterLoad_Impl();
+ return (sal_uInt16) pImpl->aList.Count();
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterContainer::GetFilter( sal_uInt16 nPos ) const
+{
+ ForceFilterLoad_Impl();
+ return pImpl->aList.GetObject( nPos );
+}
+
+IMPL_STATIC_LINK( SfxFilterContainer, LoadHdl_Impl, void*, EMPTYARG )
+/* [Beschreibung]
+
+ Handler, der ueber LateInit das echte Laden des
+ SfxFilterContainers aus;loesst. */
+{
+ if( pThis->pImpl->bLoadPending )
+ {
+ pThis->pImpl->bLoadPending = sal_False;
+ pThis->RealLoad_Impl();
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterContainer::RealLoad_Impl()
+/* [Beschreibung]
+
+ Eigentliches Laden der Filter eines Containers aus der install.ini
+ */
+
+{
+ static sal_Bool bRecurse = sal_False;
+
+ LoadArg_Impl* pArg = pImpl->pArg;
+ String aString( pArg->aGroup);
+ aString+=DEFINE_CONST_UNICODE("-Filters");
+ if( pArg->bInstallIni )
+ {
+ if( !bRecurse )
+ {
+ bRecurse = sal_True;
+ sal_uInt32 nCount = pImpl->aList.Count();
+ RealLoad_Impl();
+ bRecurse = sal_False;
+ // Falls wir keine lokalisierten Filter gefunden haben, nehmen wir
+ // die alten
+ if( pImpl->aList.Count() != nCount )
+ {
+// DELETEZ( pImpl->pArg );
+ return;
+ }
+ }
+ else
+ {
+ aString += '-';
+ aString += String::CreateFromAscii(ResMgr::GetLang());
+ }
+ }
+ Config* pConfig = SFX_APP()->GetFilterIni();
+ SfxIniManager *pMgr = SFX_INIMANAGER();
+ SfxIniManager *pSubMgr = pMgr->GetSubManager();
+ if( pSubMgr )
+ pMgr = pSubMgr;
+
+ if( pArg->bInstallIni )
+ pConfig->SetGroup( U2S(aString) );
+
+ sal_uInt16 nCount = pArg->bInstallIni ? pConfig->GetKeyCount() : pMgr->GetKeyCount( aString );
+ String aOver( DEFINE_CONST_UNICODE(SFX_STR_OVERRIDE) );
+ String aName, aLine, aUIType, aMimeType, aClipFormat, aMacType, aTypeName, aWild, aFlags, aDefaultTemplate, aUserData;
+ for( sal_uInt16 n = 0; n < nCount; n++ )
+ {
+ aName = pArg->bInstallIni ? String(S2U(pConfig->GetKeyName( n ))) : pMgr->GetKeyName( aString, n );
+ aLine = pArg->bInstallIni ? String(S2U(pConfig->ReadKey( n ))) : pMgr->ReadKey( aString, aName );
+ sal_uInt16 nTokCount = aLine.GetTokenCount( ',' );
+ if( nTokCount < 8 )
+ {
+#ifdef DBG_UTIL
+ ByteString aMsg( "Falsches FilterFormat: " );
+ aMsg += U2S(aLine).getStr();
+ DBG_ERRORFILE( aMsg.GetBuffer() );
+#endif
+ continue;
+ }
+
+#ifdef DBG_UTIL
+ if( nTokCount < 10 )
+ {
+ ByteString aMsg( "Obsoletes FilterFormat: " );
+ aMsg += U2S(aLine).getStr();
+ DBG_ERRORFILE( aMsg.GetBuffer() );
+ }
+ static bWarned = sal_False;
+ if( nTokCount > 11 && !bWarned )
+ {
+ bWarned = sal_True;
+ ByteString aMsg( "Neueres FilterFormat: " );
+ aMsg += U2S(aLine).getStr();
+ DBG_ERRORFILE( aMsg.GetBuffer() );
+ }
+#endif
+ // Override-Filter haben keinen Namen
+ if( aName.Match( aOver ) >= aOver.Len() )
+ aName.Erase();
+
+ sal_uInt16 i = 0;
+ if( nTokCount >= 10 )
+ aUIType = aLine.GetToken( i++, ',' );
+ else
+ aUIType = aName;
+
+ aMimeType = aLine.GetToken( i++, ',' );
+ aClipFormat = aLine.GetToken( i++, ',' );
+ aMacType = aLine.GetToken( i++, ',' );
+ aTypeName = aLine.GetToken( i++, ',' );
+ aWild = aLine.GetToken( i++, ',' );
+ sal_uInt16 nDocIconId = aLine.GetToken( i++, ',' ).ToInt32();
+ aUserData = aLine.GetToken( i++, ',' );
+ sal_uInt32 nVersion = SOFFICE_FILEFORMAT_NOW;
+ if( nTokCount >= 8 )
+ nVersion = aLine.GetToken( i++, ',' ).ToInt32();
+ aFlags = aLine.GetToken( i++, ',' );
+ if( nTokCount >= 11 )
+ aDefaultTemplate = aLine.GetToken( i++, ',' );
+ else aDefaultTemplate.Erase();
+ SfxFilterFlags nFlags = pArg->nOrFlags;
+ nTokCount = aFlags.GetTokenCount('|');
+ for( i = 0; i < nTokCount; i++ )
+ {
+ String aTok = aFlags.GetToken( i, '|' );
+ nFlags |= NameToFlag_Impl( aTok );
+ }
+
+ nFlags &= ~pArg->nNotFlags;
+ sal_uInt32 nClipId = 0;
+ if( aClipFormat.Len() )
+ nClipId = Exchange::RegisterFormatName( aClipFormat );
+ SfxFilter* pFilter = new SfxFilter(
+ aName, aWild, nFlags, nClipId, aMacType, aTypeName, nDocIconId,
+ aMimeType, this, aUserData );
+ pFilter->SetUIName( aUIType );
+ pFilter->SetDefaultTemplate( aDefaultTemplate );
+ if( nVersion )
+ pFilter->SetVersion( nVersion );
+ AddFilter( pFilter, GetFilterCount() );
+ }
+// if( !bRecurse ) DELETEZ( pImpl->pArg );
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterContainer::ForceFilterLoad_Impl() const
+/* [Beschreibung]
+
+ Erzwingt das echte Laden der Filter vor Eintritt des Lateinits
+ */
+{
+ if( pImpl->bLoadPending )
+ {
+ ((SfxFilterContainer*)this)->LoadHdl_Impl(
+ (SfxFilterContainer*)this ,0 );
+ }
+}
+
+//----------------------------------------------------------------
+/* [Beschreibung]
+
+ Da die meisten GetFilter4xxx Routinen in einem Container einfach eine
+ Abfrage ueber alle enthaltenen Filter durchlaufen, sind diese in
+ einem Makro kodiert.
+
+ nMust sind die Flags, die gesetzt sein muessen, damit der Filter
+ in Betracht gezogen wird, nDont duerfen nicht gesetzt sein.
+ */
+
+#define IMPL_CONTAINER_LOOP( aMethod, aArgType, aTest ) \
+const SfxFilter* SfxFilterContainer::aMethod( \
+ aArgType aArg, SfxFilterFlags nMust, SfxFilterFlags nDont ) const \
+{ \
+ ForceFilterLoad_Impl(); \
+ sal_uInt16 nCount = ( sal_uInt16 ) pImpl->aList.Count(); \
+ for( sal_uInt16 n = 0; n < nCount; n++ ) \
+ { \
+ const SfxFilter* pFilter = pImpl->aList.GetObject( n ); \
+ SfxFilterFlags nFlags = pFilter->GetFilterFlags(); \
+ if ( (nFlags & nMust) == nMust && \
+ !(nFlags & nDont ) && aTest ) \
+ return pFilter; \
+ } \
+ return 0; \
+}
+
+/* [Beschreibung]
+
+ Ermitelt einen Filter nach seinem Namen. Dieser enthaelt vorangestellt
+ den Namen des Containers, falls er nicht im DefaultContainer steckt.
+ */
+
+IMPL_CONTAINER_LOOP( GetFilter, const String&,
+ pFilter->GetName().CompareIgnoreCaseToAscii( aArg ) == COMPARE_EQUAL )
+
+/* [Beschreibung]
+ Ermitelt einen Filter nach seinem Mimetypen.
+ */
+IMPL_CONTAINER_LOOP(
+ GetFilter4Mime, const String&,
+ pFilter->GetMimeType().CompareIgnoreCaseToAscii( aArg ) == COMPARE_EQUAL )
+
+/* [Beschreibung]
+ Ermitelt einen Filter nach seinem FilterNamen. Dies ist der Name ohne
+ vorangestellten Containernamen.
+ */
+IMPL_CONTAINER_LOOP(
+ GetFilter4FilterName, const String&,
+ pFilter->GetFilterName().CompareIgnoreCaseToAscii(aArg ) == COMPARE_EQUAL )
+
+/* [Beschreibung]
+ Ermitelt einen Filter nach seiner ClipboardID. Diese steckt im Storage.
+ */
+IMPL_CONTAINER_LOOP(
+ GetFilter4ClipBoardId, sal_uInt32, aArg && pFilter->GetFormat() == aArg )
+
+#ifdef MAC
+#define CONDITION \
+ String( aArg ).Erase( 5 ) == String( pFilter->GetTypeName() ).Erase( 5 )
+#else
+#define CONDITION \
+ aArg == pFilter->GetTypeName()
+#endif
+/* [Beschreibung]
+ Ermitelt einen Filter nach seinen Extended Attributes.
+ Nur auf MAC und OS/2 von Interesse.
+ */
+IMPL_CONTAINER_LOOP(
+ GetFilter4EA, const String&, CONDITION )
+#undef CONDITION
+
+/* [Beschreibung]
+ Ermitelt einen Filter nach seiner Extension.
+ (2Ah = '*')
+ */
+IMPL_CONTAINER_LOOP(
+ GetFilter4Extension, const String&,
+ pFilter->GetWildcard() != String() && pFilter->GetWildcard() != DEFINE_CONST_UNICODE("*.*") && pFilter->GetWildcard() != 0x002A &&
+ WildCard( ToUpper_Impl( pFilter->GetWildcard()() ), ';' ) == ToUpper_Impl( aArg ))
+
+IMPL_CONTAINER_LOOP(
+ GetFilter4UIName, const String&,
+ pFilter->GetUIName() == aArg )
+
+//----------------------------------------------------------------
+
+const String SfxFilterContainer::GetName() const
+{
+ return pImpl->aName;
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterContainer::DeleteFilter( const SfxFilter* pFilter )
+/* [Beschreibung]
+
+ Loescht einen Filter aus seinem Container und den Filter selbst.
+ */
+{
+ ForceFilterLoad_Impl();
+ pImpl->aList.Remove( (SfxFilter*)pFilter );
+ delete (SfxFilter*)pFilter;
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterContainer::AddFilter( SfxFilter* pFilter, sal_uInt16 nPos )
+{
+/* [Beschreibung]
+
+ Fuegt einen Filter in einen Container ein.
+ */
+ ForceFilterLoad_Impl();
+ if ( pImpl->pArg )
+ {
+ pFilter->nFormatType |= pImpl->pArg->nOrFlags;
+ pFilter->nFormatType &= ~pImpl->pArg->nNotFlags;
+ }
+
+ if ( !pFilter->GetFilterName().Len() ||
+ !GetFilter4FilterName( pFilter->GetFilterName() ))
+ pImpl->aList.Insert( pFilter, nPos );
+#if !defined(PRODUCT)
+ else
+ delete pFilter;
+#endif
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterContainer::LoadFilters(
+ const String& rGroup, // ConfigGruppe, aus der gelesen werden soll
+ sal_Bool bInstallIni, // Falls sal_True aus install.ini lesen,
+ // sonst soffice3.ini
+ SfxFilterFlags nOrFlags, // Flags zusaetzlich zu denen in der Ini
+ SfxFilterFlags nNotFlags ) // Flags, die nicht aus der ini genommen werden
+/* [Beschreibung]
+
+ Stoesst das Laden eines FilterContainers an. Das eigentliche
+ Laden erfolgt im LateInitHandler bzw. in ForceFilterLoad_Impl,
+ falls vor LateInit auf den FilterContainer zugegriffen wird. */
+{
+ LoadArg_Impl* pArg = new LoadArg_Impl;
+ pArg->aGroup = rGroup;
+ pArg->bInstallIni = bInstallIni;
+ pArg->nOrFlags = nOrFlags;
+ pArg->nNotFlags = nNotFlags;
+ pImpl->pArg = pArg;
+ SFX_APP()->InsertLateInitHdl( STATIC_LINK(
+ this, SfxFilterContainer, LoadHdl_Impl ) );
+ pImpl->bLoadPending = sal_True;
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterContainer::SaveFilters( const String& rGroup, SfxFilterFlags nMask ) const
+/* [Beschreibung]
+
+ Speichert die Filter des Containers in der soffice3.ini.
+ */
+{
+ String aString( rGroup);
+ aString+=DEFINE_CONST_UNICODE("-Filters");
+ SfxIniManager *pMgr = SFX_INIMANAGER();
+ SfxIniManager *pSubMgr = pMgr->GetSubManager();
+ if( pSubMgr )
+ pMgr = pSubMgr;
+
+ pMgr->DeleteGroup( aString );
+
+ SfxFilterMatcher aMatcher( ( SfxFilterContainer* ) this );
+ SfxFilterMatcherIter aIter( &aMatcher, nMask );
+ sal_uInt16 n = 1;
+ String aLine, aKey;
+ for( const SfxFilter* pFilter = aIter.First(); pFilter; pFilter = aIter.Next() )
+ {
+ if ( pFilter->GetURLPattern().Len() )
+ // Filter mit URLPattern k"onnen wir nicht einlesen, also auch nicht speichern!
+ continue;
+
+ aLine = pFilter->GetUIName();
+ aLine += ',';
+ aLine += pFilter->GetMimeType();
+ aLine+=',';
+ sal_uInt32 nFormat = pFilter->GetFormat();
+ if( nFormat )
+ aLine += Exchange::GetFormatName( pFilter->GetFormat() );
+ aLine += ',';
+ aLine += pFilter->GetMacType();
+ aLine+=',';
+ aLine += pFilter->GetRealTypeName();
+ aLine+=',';
+ aLine += pFilter->GetWildcard()();
+ aLine+=',';
+ aLine += String::CreateFromInt32( pFilter->GetDocIconId() );
+ aLine+=',';
+ aLine += pFilter->GetUserData();
+ aLine+=',';
+ if( pFilter->GetVersion() != SOFFICE_FILEFORMAT_NOW )
+ aLine += String::CreateFromInt32( pFilter->GetVersion() );
+ aLine += ',';
+ aLine += FlagsToName_Impl( pFilter->GetFilterFlags() );
+ aLine += ',';
+ aLine += pFilter->GetDefaultTemplate();
+ aKey = pFilter->GetFilterName();
+ if ( !aKey.Len() )
+ aKey = DEFINE_CONST_UNICODE( SFX_STR_OVERRIDE );
+ aKey += String::CreateFromInt32( n++ );
+ pMgr->WriteKey( aString, aKey, aLine );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+sal_uInt32 SfxFilterContainer::GetFilter4Content(
+ SfxMedium& rMedium, const SfxFilter** ppFilter,
+ SfxFilterFlags, SfxFilterFlags ) const
+{
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+const SfxFilter* SfxExternalAppFilterContainer::GetFilter4Protocol(
+ SfxMedium& rMed, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+/* [Beschreibung]
+
+ Diese Methode ist ueberladen, um zu verhindern, dass fuer jedes Protokoll
+ ein Filter erzeugt wird (denn in dem SfxExternalAppFilterContainer ist
+ jeder Filter vorhanden, so wie nach ihm gefragt wird und
+ GetFilter4Protocol forwarded in der Basisimplementierung an
+ GetFilter4FilterName ).
+ */
+{
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxExecutableFilterContainer::Choose_Impl( SfxMedium& rMedium ) const
+{
+ SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
+ SfxFilterDialog *pDlg =
+ new SfxFilterDialog(
+ 0, &rMedium, rMatcher, 0, 0 );
+ const sal_Bool bOk = RET_OK == pDlg->Execute();
+ if (bOk)
+ {
+ const SfxFilter* pFilter = rMatcher.GetFilter4UIName(
+ pDlg->GetSelectEntry() );
+ delete pDlg;
+ rMedium.SetFilter( pFilter );
+ return ERRCODE_NONE;
+ }
+ delete pDlg;
+ return ERRCODE_ABORT;
+}
+
+SV_DECL_VARARR( SfxExecutableFilterTypes_Impl, SfxExecutableFilterType_Impl,
+ 5, 5 )
+SV_IMPL_VARARR( SfxExecutableFilterTypes_Impl, SfxExecutableFilterType_Impl )
+
+
+void SfxExecutableFilterContainer::AddExeFilter(
+ SfxFilter* pFilter, SfxExecutableFilterType_Impl eType,
+ const String& rPattern )
+{
+ AddFilter( pFilter, GetFilterCount() );
+ pTypes->Insert( eType, pTypes->Count() );
+ if( rPattern.Len() )
+ pFilter->SetURLPattern( rPattern );
+}
+
+
+#define SFX_EXE_FILTERFLAGS (SFX_FILTER_IMPORT | SFX_FILTER_NOTINFILEDLG |\
+ SFX_FILTER_EXECUTABLE|SFX_FILTER_NOTINCHOOSER|SFX_FILTER_INTERNAL)
+
+//----------------------------------------------------------------
+
+SfxExecutableFilterContainer::SfxExecutableFilterContainer()
+// : SfxFilterContainer( String( SfxResId( STR_FILTER_OTHERS ) ) )
+ : SfxFilterContainer( DEFINE_CONST_UNICODE("soffice") )
+/* [Beschreibung]
+
+ Der SfxExecutableFilterContainer enthaelt alle Filter, die
+ nicht direkt zum Laden eines Dokumentes fuehren, sondern
+ statt dessen ausgefuehrt werden. Indirekt koennen durchaus
+ Docs geladen werden, wenn z.B. der bugdoc Filter ein
+ Dokument raussucht.
+ */
+{
+ pTypes = new SfxExecutableFilterTypes_Impl;
+ String aEmpty;
+ sal_uInt16 nPos = 0;
+
+// Was ist denn hiermit ??
+#ifdef SOLAR_JAVA
+ AddExeFilter( new SfxFilter( "JavaApplication", DEFINE_CONST_UNICODE("*.class"), SFX_EXE_FILTERFLAGS | SFX_FILTER_ASYNC, this ),
+ SFX_EXE_FILTER_COMPONENT, DEFINE_CONST_UNICODE("private:java/*") );
+#endif
+/*
+ AddExeFilter( new SfxFilter( DEFINE_CONST_UNICODE("ExternBrowser"), DEFINE_CONST_UNICODE("*.htm;*.html"), SFX_EXE_FILTERFLAGS | SFX_FILTER_ASYNC, 0,
+ aEmpty, aEmpty, 0, DEFINE_CONST_UNICODE("text/html"),this, aEmpty ),
+ SFX_EXE_FILTER_EXTERNBROWSER, aEmpty );
+*/
+ AddExeFilter( new SfxFilter( "bookmark", DEFINE_CONST_UNICODE("*.*"), SFX_EXE_FILTERFLAGS, this ),
+ SFX_EXE_FILTER_BOOKMARK, aEmpty );
+ AddExeFilter( new SfxFilter( "link", DEFINE_CONST_UNICODE("*.lnk"), SFX_EXE_FILTERFLAGS, this ),
+ SFX_EXE_FILTER_BOOKMARK, aEmpty );
+ AddExeFilter( new SfxFilter( SFX_FILTERNAME_HELPENTRY, DEFINE_CONST_UNICODE("*.svh"), SFX_EXE_FILTERFLAGS, this ),
+ SFX_EXE_FILTER_HELPENTRY, aEmpty );
+ AddExeFilter( new SfxFilter( "helpid", aEmpty, SFX_EXE_FILTERFLAGS, this ),
+ SFX_EXE_FILTER_HELPID, DEFINE_CONST_UNICODE("private:helpid/*") );
+ AddExeFilter( new SfxFilter( "bugid", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_BUGID, DEFINE_CONST_UNICODE("bugid:*") );
+ AddExeFilter( new SfxFilter( "mailto", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_MAILTO, DEFINE_CONST_UNICODE("mailto:*") );
+ AddExeFilter( new SfxFilter( "command", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_COMMAND, DEFINE_CONST_UNICODE("file:///{*}/*") );
+ AddExeFilter( new SfxFilter( "macro", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_MACRO, DEFINE_CONST_UNICODE("macro:*") );
+ AddExeFilter( new SfxFilter( "uno", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_UNO, DEFINE_CONST_UNICODE(".uno:*") );
+ AddExeFilter( new SfxFilter( "slot", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_SLOT, DEFINE_CONST_UNICODE("slot:*") );
+ AddExeFilter( new SfxFilter( "factory", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_FACTORY, DEFINE_CONST_UNICODE("private:factory/*") );
+ AddExeFilter( new SfxFilter( "bugdoc", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_BUGDOC, DEFINE_CONST_UNICODE("bugdoc:*") );
+ AddExeFilter( new SfxFilter( "exe", aEmpty, SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_EXECUTE, DEFINE_CONST_UNICODE("internal") );
+ AddExeFilter( new SfxFilter( DEFINE_CONST_UNICODE(EXPLORER_URL_FILTER), aEmpty, SFX_EXE_FILTERFLAGS, 0, aEmpty, aEmpty, 0, aEmpty, this, aEmpty),
+ SFX_EXE_FILTER_EXPLORER, aEmpty );
+ AddExeFilter( new SfxFilter( "sound", DEFINE_CONST_UNICODE("*.wav;*.au"), SFX_EXE_FILTERFLAGS, this),
+ SFX_EXE_FILTER_SOUND, DEFINE_CONST_UNICODE("internal") );
+/*
+ AddExeFilter( new SfxFilter( SFX_FILTER_DOWNLOAD, DEFINE_CONST_UNICODE("*.*"), SFX_FILTER_IMPORT | SFX_FILTER_NOTINFILEDLG | SFX_FILTER_EXECUTABLE | SFX_FILTER_ASYNC, this),
+ SFX_EXE_FILTER_DOWNLOAD, aEmpty );
+*/
+ // Und nun die Filter, die auch im Dateitypendialog sichtbar sein sollen
+ SfxFilter *pFilter = new SfxFilter( DEFINE_CONST_UNICODE("choose"), DEFINE_CONST_UNICODE("*.*"),
+ SFX_FILTER_IMPORT | SFX_FILTER_NOTINFILEDLG | SFX_FILTER_EXECUTABLE| SFX_FILTER_NOTINCHOOSER, 0, aEmpty, aEmpty, 0, aEmpty, this, aEmpty);
+ pFilter->SetUIName( SfxResId( STR_FILTER_CHOOSER ) );
+ AddExeFilter( pFilter, SFX_EXE_FILTER_CHOOSER, aEmpty);
+
+ pFilter = new SfxFilter( "extern", DEFINE_CONST_UNICODE("*.*"), SFX_FILTER_IMPORT | SFX_FILTER_EXECUTABLE, this );
+ pFilter->SetUIName( SfxResId( STR_FILTER_EXTERNAL ) );
+ AddExeFilter( pFilter, SFX_EXE_FILTER_EXECUTE, DEFINE_CONST_UNICODE("external") );
+
+ pFilter = new SfxFilter( "component", DEFINE_CONST_UNICODE("*.*"), SFX_FILTER_IMPORT | SFX_FILTER_EXECUTABLE | SFX_FILTER_ASYNC, this );
+ pFilter->SetUIName( SfxResId( STR_FILTER_COMPONENT ) );
+ AddExeFilter( pFilter, SFX_EXE_FILTER_COMPONENT, aEmpty );
+}
+
+SfxExecutableFilterContainer::~SfxExecutableFilterContainer()
+{
+ delete pTypes;
+}
+
+sal_Bool SfxIsHelpEntryURL( const String &rURL, const String &rExtMask )
+{
+ INetURLObject aURL( rURL );
+ if ( aURL.GetProtocol() == INET_PROT_FILE && aURL.GetMainURL().Len() > 8 )
+ {
+ String aExt = aURL.getExtension().ToLowerAscii();
+ INetURLObject aHelpDir( SFX_INIMANAGER()->Get( SFX_KEY_HELP_DIR ), INET_PROT_FILE );
+ if ( WildCard( aHelpDir.GetMainURL() ).Matches( rURL ) && WildCard( rExtMask ).Matches( aExt ) )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+const SfxFilter* SfxExecutableFilterContainer::GetFilter4Protocol(
+ SfxMedium& rMed, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+/* [Beschreibung]
+ */
+{
+ INetProtocol eProt;
+ String aName;
+ const INetURLObject &rURL = rMed.GetURLObject();
+ aName = rURL.GetMainURL();
+ eProt = rURL.GetProtocol();
+
+ // ::com::sun::star::util::URL within Help-Directory?
+ if ( eProt == INET_PROT_FILE && SfxIsHelpEntryURL( aName, DEFINE_CONST_UNICODE("htm*") ) )
+ return SfxFilterContainer::GetFilter4FilterName( DEFINE_CONST_UNICODE(SFX_FILTERNAME_HELPENTRY), nMust, nDont );
+
+ return SfxFilterContainer::GetFilter4Protocol( rMed, nMust, nDont );
+}
+
+const SfxFilter* SfxExecutableFilterContainer::CheckForFolder( SfxMedium& rMed, SfxFilterFlags nMust, SfxFilterFlags nDont )
+{
+ INetProtocol eProt;
+ String aName;
+ const INetURLObject &rURL = rMed.GetURLObject();
+ aName = rURL.GetMainURL();
+ eProt = rURL.GetProtocol();
+
+ Reference < XContent > xContent( rMed.GetContent() );
+ FASTBOOL bHandled = sal_False;
+ sal_Bool bTest = sal_True;
+
+ if ( INET_PROT_FTP == eProt && SvBinding::ShouldUseFtpProxy( aName ) )
+ bTest = sal_False;
+
+ if ( bTest )
+ {
+ if ( xContent.is() )
+ {
+ Any aAny( UCB_Helper::GetProperty( xContent, WID_FLAG_IS_FOLDER ) );
+ Any aNotherAny( UCB_Helper::GetProperty( xContent, WID_FLAG_IS_DOCUMENT ) );
+ sal_Bool bIsDocument = TRUE;
+ sal_Bool bIsFolder = FALSE;
+ aAny >>= bIsFolder;
+ aNotherAny >>= bIsDocument;
+ bHandled = bIsFolder && !bIsDocument;
+ }
+ }
+
+ return bHandled ? GetExplorerFilter() : NULL;
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxExecutableFilterContainer::GetDownloadFilter()
+{
+ String aName( DEFINE_CONST_UNICODE(SFX_FILTER_DOWNLOAD) );
+ return SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aName );
+}
+
+const SfxFilter* SfxExecutableFilterContainer::GetComponentFilter()
+{
+ String aName( DEFINE_CONST_UNICODE(SFX_FILTERNAME_COMPONENT) );
+ return SFX_APP()->GetFilterMatcher().GetContainer( DEFINE_CONST_UNICODE("soffice") )->GetFilter4FilterName( aName );
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxExecutableFilterContainer::GetChooserFilter()
+{
+// String aName( SfxResId( STR_FILTER_OTHERS ) );
+ String aName( DEFINE_CONST_UNICODE("soffice") );
+ aName+=DEFINE_CONST_UNICODE(": ");
+ aName+=DEFINE_CONST_UNICODE("choose");
+// aName+=String( SfxResId( STR_FILTER_CHOOSER ) );
+ return SFX_APP()->GetFilterMatcher().GetFilter( aName );
+}
+
+const SfxFilter* SfxExecutableFilterContainer::GetExplorerFilter()
+{
+ String aName( DEFINE_CONST_UNICODE(EXPLORER_URL_FILTER) );
+ return SFX_APP()->GetFilterMatcher().GetFilter4FilterName( aName );
+}
+
+//----------------------------------------------------------------
+
+String SfxExecutableFilterContainer::GetBugdocName_Impl(
+ const String& rName ) const
+/* [Beschreibung]
+
+ Sucht ein Bugdoc in den ueblichen Verzeichnissen
+ */
+{
+/*! (pb)
+ static const char* pNames[] =
+ {
+ "q:\\sw\\bugdoc",
+ "q:\\sd\\bugdoc",
+ "q:\\sc\\bugdoc",
+ "q:\\sch\\bugdoc",
+ "q:\\solar\\bugdoc",
+ "q:\\bugdoc",
+ 0
+ };
+ sal_uInt32 nNumber = rName.ToInt32();
+ String aMatch = rName;
+ aMatch += '*';
+ sal_uInt16 n = 1;
+ const char* pName = pNames[ 0 ];
+ while( pName )
+ {
+ DirEntry aEntry( String::CreateFromAscii(pName) );
+ for( sal_uInt32 nBase = ( nNumber / 500 + 1 ) * 500;
+ nBase - nNumber < 5000; nBase+=500 )
+ {
+ DirEntry aAkt( aEntry );
+ String aBis( DEFINE_CONST_UNICODE("bis") );
+ aBis += String::CreateFromInt32( nBase );
+ aAkt += DirEntry( aBis );
+ if( aAkt.Exists() )
+ {
+ aAkt += DirEntry( aMatch );
+ Dir aDir( aAkt );
+ if( aDir.Count() )
+ return aDir[ 0 ].GetFull();
+ }
+ }
+ pName = pNames[ n++ ];
+ }
+*/
+ return String();
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxExecutableFilterContainer::Execute(
+ SfxMedium& rMedium, SfxFrame*& rpFrame ) const
+/* [Beschreibung]
+
+ Fuehrt die Funktionalitaet eines mit SFX_FILTER_EXECUTABLE registrierten
+ Filters aus.
+ */
+{
+ SfxApplication* pApp = SFX_APP();
+ const SfxFilter* pFilter = rMedium.GetFilter();
+ DBG_ASSERT( pFilter, "Medium braucht Filter" );
+
+ // Referer und TargetPath zum Speichern
+ SfxStringItem aReferer( SID_REFERER, String() );
+ SfxStringItem aPath( SID_TARGETPATH, String() );
+
+ // Wurden welche mitgeschickt ?
+ SFX_ITEMSET_ARG(rMedium.GetItemSet(), pReferer, SfxStringItem, SID_REFERER, sal_False);
+ SFX_ITEMSET_ARG(rMedium.GetItemSet(), pPath, SfxStringItem, SID_TARGETPATH, sal_False);
+ if ( !pReferer )
+ pReferer = &aReferer;
+ if ( !pPath )
+ {
+ // Wenn kein TargetPath, dann diesen mit dem Referer belegen
+ if ( pReferer )
+ aPath.SetValue( pReferer->GetValue() );
+ rMedium.GetItemSet()->Put( aPath, SID_TARGETPATH );
+ pPath = &aPath;
+ }
+
+ SfxFrameItem aFrameItem( SID_DOCFRAME, rpFrame );
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pTarget, SfxStringItem,
+ SID_TARGETPATH, sal_False);
+
+ sal_Bool bPreview = rMedium.IsPreview_Impl();
+ const SfxPoolItem* ppInternalArgs[] =
+ {
+ &aFrameItem, pReferer, pTarget, 0
+ };
+
+ SfxExecutableFilterType_Impl eType;
+ for( sal_uInt16 nPos = GetFilterCount(); nPos--; )
+ if( GetFilter( nPos ) == pFilter )
+ {
+ eType = pTypes->GetObject( nPos );
+ break;
+ }
+ switch( eType )
+ {
+ case SFX_EXE_FILTER_SOUND:
+ {
+ // Achtung: GetPhysicalName nicht im ctor, IsTemporary() k"onnte vorher aufgerufen werden !!
+ String aName = rMedium.GetPhysicalName();
+ new SfxSound_Impl( aName, rMedium.IsTemporary() );
+ rMedium.SetTemporary( sal_False );
+ return ERRCODE_ABORT;
+ break;
+ }
+
+ case SFX_EXE_FILTER_COMMAND:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+#if 0 //(dv)
+ CntAnchorRef xAnchor = rMedium.GetAnchor(); // MI: ???
+ if ( !xAnchor.Is() )
+ return ERRCODE_IO_UNKNOWN; // MI: kann das ueberhaupt passieren?
+#ifndef TF_UCB
+ xAnchor->Put( CntCmpCommandItem( WID_COMPONENT_COMMAND, ::rtl::OUString("executeDefaultCommand") ) );
+#else
+ xAnchor->Put( CntCmpCommandItem( WID_COMPONENT_COMMAND, "executeDefaultCommand" ) );
+#endif
+#endif //(dv)
+ return ERRCODE_ABORT;
+ break;
+ }
+
+ case SFX_EXE_FILTER_EXPLORER:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ // ansonsten als Komponente laden
+ }
+
+/*
+ case SFX_EXE_FILTER_COMPONENT:
+ {
+ rMedium.Close();
+
+ const INetURLObject& rURLObj = rMedium.GetURLObject();
+ String aName( rURLObj.GetMainURL() );
+ SfxURLTransformer aTrans ( ::utl::getProcessServiceFactory() );
+ ::rtl::OUString aTargetURL = aName;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ TransformItems( SID_OPENDOC, *rMedium.GetItemSet(), aArgs );
+
+ sal_uInt16 nRet = rpFrame->LoadComponent_Impl( aTargetURL, aArgs, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > (), rMedium.GetItemSet() );
+ if ( nRet == RET_NEWTASK )
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
+
+ if ( nRet == RET_OK || nRet == RET_CANCEL )
+ return ERRCODE_ABORT;
+ else if ( nRet == RET_NEWTASK )
+ return ERRCODE_SFX_RESTART;
+ else // nRet == RET_PENDING !
+ return ERRCODE_IO_PENDING;
+ break;
+ }
+
+ case SFX_EXE_FILTER_EXTERNBROWSER:
+ {
+ String aExtBrw( SfxIniManager::Get()->Get( SFX_KEY_EXTBRW_FILE ) );
+ if ( !rpFrame->IsTop() && aExtBrw.Len() )
+ {
+ // external Browser in subframes only possible if IExplorer
+ const SfxFilter* pFilter = SFX_APP()->GetFilterMatcher().GetFilter4Mime( DEFINE_CONST_UNICODE("text/html"), SFX_FILTER_IMPORT | SFX_FILTER_EXPORT );
+ rMedium.SetFilter(pFilter);
+
+ return pFilter ? ERRCODE_SFX_RESTART : ERRCODE_IO_NOTSUPPORTED;
+ }
+
+ rMedium.Close();
+
+ // put filter into itemset, otherwise mediums filter will become component filter!
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_FILTER_NAME, pFilter->GetName() ) );
+
+ const INetURLObject& rURLObj = rMedium.GetURLObject();
+ INetProtocol eProt = rURLObj.GetProtocol();
+ String aName;
+ if ( eProt != INET_PROT_FILE && eProt != INET_PROT_HTTP && eProt != INET_PROT_HTTPS && eProt != INET_PROT_FTP )
+ {
+ aName = rMedium.GetPhysicalName();
+ rMedium.SetTemporary( sal_False );
+ }
+ else
+ aName = rURLObj.GetMainURL();
+
+ if ( aExtBrw.Len() )
+ {
+ String aFile( '\"');
+ aFile += aExtBrw;
+ aFile += '\"';
+ aFile += ' ';
+ aFile += '\"';
+ aFile += aName;
+ aFile += '\"';
+ sal_Bool bOk = System::StartProcess( Application::GetAppWindow(), aFile );
+ return bOk ? ERRCODE_ABORT : ERRCODE_IO_NOTSUPPORTED;
+ }
+
+ SfxURLTransformer aTrans ( ::utl::getProcessServiceFactory() );
+ ::rtl::OUString aTargetURL = aName;
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ TransformItems( SID_OPENDOC, *rMedium.GetItemSet(), aArgs );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xReg( xMgr->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.FrameLoaderFactory") ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > xLoader( xReg->createInstance( DEFINE_CONST_UNICODE("private:iexplorer") ), ::com::sun::star::uno::UNO_QUERY );
+
+ sal_uInt16 nRet = rpFrame->LoadComponent_Impl( aTargetURL, aArgs, xLoader, rMedium.GetItemSet() );
+ if ( nRet == RET_NEWTASK )
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
+
+ if ( nRet == RET_OK || nRet == RET_CANCEL )
+ return ERRCODE_ABORT;
+ else if ( nRet == RET_NEWTASK )
+ return ERRCODE_SFX_RESTART;
+ else // nRet == RET_PENDING !
+ return ERRCODE_IO_PENDING;
+ break;
+ }
+*/
+/*
+ case SFX_EXE_FILTER_DOWNLOAD:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ rMedium.Close();
+
+ const INetURLObject& rURLObj = rMedium.GetURLObject();
+ String aName( rURLObj.GetMainURL() );
+ ::rtl::OUString aTargetURL = aName;
+
+
+ // Downloader always uses his own special task
+ SfxFrame *pFrame = SfxTopFrame::Create();
+ rMedium.GetItemSet()->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle( 0, 0, 500, 250 ) ) );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ TransformItems( SID_OPENDOC, *rMedium.GetItemSet(), aArgs );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > xFrameLoader ( xMgr->createInstance( DEFINE_CONST_UNICODE("com.sun.star.comp.sfx2.DownloaderLoader") ), ::com::sun::star::uno::UNO_QUERY );
+ if ( xFrameLoader.is() )
+ {
+ USHORT nRet = pFrame->LoadComponent_Impl( aTargetURL, aArgs, xFrameLoader, rMedium.GetItemSet() );
+ if ( nRet == RET_OK )
+ pFrame->GetCurrentDocument()->SetFlags( pFrame->GetCurrentDocument()->GetFlags() | SFXOBJECTSHELL_DONTREPLACE );
+ }
+
+ return ERRCODE_ABORT;
+ break;
+ }
+ */
+ case SFX_EXE_FILTER_CHOOSER:
+ if ( bPreview )
+ return ERRCODE_ABORT;
+ return Choose_Impl( rMedium ); break;
+ case SFX_EXE_FILTER_MAILTO:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ // an SID_MAIL_SENDDOC forwarden
+ SfxAllItemSet aSet( pApp->GetPool() );
+ aSet.Put( SfxStringItem( SID_MAIL_RECIPIENT, rMedium.GetURLObject().GetMainURL() ) );
+ aSet.Put( SfxBoolItem( SID_MAIL_ATTACH, sal_False ) );
+
+ String aRefererStr = pReferer ? pReferer->GetValue() : String();
+ if ( aRefererStr.CompareToAscii("private:msgid/", 14 ) != COMPARE_EQUAL )
+ aSet.Put( aFrameItem );
+
+ // look for subject and body
+ SfxItemSet* pSet = rMedium.GetItemSet();
+ if( pSet )
+ {
+ SFX_ITEMSET_ARG( pSet, pSendDirect, SfxBoolItem, SID_MAIL_SEND, sal_False);
+ if ( pSendDirect )
+ aSet.Put( *pSendDirect );
+
+ SFX_ITEMSET_ARG( pSet, pToPost, SfxStringItem, SID_POSTSTRING, sal_False);
+ if ( pToPost )
+ {
+ aSet.Put( SfxStringItem( SID_MAIL_TEXT, pToPost->GetValue() ) );
+
+ // Subject nur setzen, wenn nicht in mailto-::com::sun::star::util::URL
+ String aParam = rMedium.GetURLObject().GetParam().ToLowerAscii();
+ FASTBOOL bSubjectFound = sal_False;
+ sal_uInt16 nIdx = 0;
+ while ( nIdx != STRING_NOTFOUND )
+ {
+ String aParamTok = aParam.GetToken( 0, '&', nIdx );
+ aParamTok.EraseLeadingChars();
+ if ( aParamTok.SearchAscii( "subject=" ) == 0 )
+ {
+ bSubjectFound = sal_True;
+ break;
+ }
+ }
+
+ if ( !bSubjectFound )
+ aSet.Put( SfxStringItem( SID_MAIL_SUBJECT, DEFINE_CONST_UNICODE("Mail Posted by StarOffice") ) );
+ }
+ }
+
+ if ( rpFrame->GetCurrentDocument() || !rpFrame->IsTop() )
+ {
+ SfxFrame *pFrame = SfxTopFrame::Create();
+ aSet.Put( SfxFrameItem( SID_DOCFRAME, pFrame ) );
+ }
+
+ pApp->GetDispatcher().Execute( SID_MAIL_SENDDOC, SFX_CALLMODE_SYNCHRON, aSet );
+ return ERRCODE_ABORT;
+ }
+ case SFX_EXE_FILTER_HELPENTRY:
+ {
+ rMedium.Close();
+
+ // Redirection within Help-Directory
+ INetURLObject aObj( rMedium.GetName() );
+ if ( aObj.getExtension().CompareIgnoreCaseToAscii( "svh" ) == COMPARE_EQUAL )
+ {
+ SfxHelp::ShowHelp( HELP_INDEX, sal_False, U2S( aObj.PathToFileName() ).getStr() );
+ return ERRCODE_ABORT;
+ }
+ else
+ {
+ INetURLObject aHelpDir( SFX_INIMANAGER()->Get(SFX_KEY_HELP_DIR ), INET_PROT_FILE );
+ aHelpDir.setFinalSlash();
+ String aNewURL = DEFINE_CONST_UNICODE(".component:Help/Content.Contents;\001");
+ aNewURL += aObj.getBase();
+ aNewURL += DEFINE_CONST_UNICODE("\001");
+ aNewURL += aHelpDir.GetMainURL();
+ aNewURL += String::CreateFromAscii( ResMgr::GetLang() );
+ aNewURL += DEFINE_CONST_UNICODE("/text/sbasic/starone/ref/");
+ aNewURL += aObj.getName();
+ aNewURL += DEFINE_CONST_UNICODE("\001.Content");
+ rMedium.SetName( aNewURL, sal_True );
+ rMedium.SetPhysicalName( String() );
+ rMedium.Init_Impl();
+ rMedium.SetFilter(0);
+ return ERRCODE_SFX_RESTART;
+ }
+ }
+/*
+ case SFX_EXE_FILTER_BOOKMARK:
+ {
+ rMedium.Close();
+ String aTitle, aFrame, aOpen, aWorkDir, aArguments, aURL;
+
+ Reference < XContent > xContent( rMedium.GetContent() );
+ Any aAny( UCB_Helper::GetProperty( xContent, WID_TARGET_URL ) );
+ OUString aTarget;
+ if ( !( aAny >>= aTarget ) || !aTarget.len() )
+ return ERRCODE_SFX_INVALIDLINK;
+ else
+ aURL = String(aTarget);
+
+ aAny = UCB_Helper::GetProperty( xContent, WID_DOCUMENT_HEADER );
+ Sequence < DocumentHeaderField > aSeq;
+ if ( aAny >>= aSeq )
+ {
+ USHORT nCount = aSeq.getLength();
+ for ( USHORT n = 0; n < nCount; ++n )
+ {
+ String aName( aSeq.getArray()[ n ].Name );
+ String aValue( aSeq.getArray()[ n ].Value );
+ if ( aName.ToLowerAscii().EqualsAscii("title") )
+ aTitle = aValue;
+
+ if ( aName.ToLowerAscii().EqualsAscii( "workingdirectory" ) )
+ {
+ aWorkDir = aValue;
+ if ( aWorkDir.Len() )
+ {
+ INetURLObject aObj( aWorkDir, INET_PROT_FILE );
+ aWorkDir = aObj.PathToFileName();
+ }
+ }
+
+ if ( aName.ToLowerAscii().EqualsAscii( "arguments" ) )
+ aArguments = aValue;
+
+ if ( aName.EqualsAscii( "frame" ) )
+ aFrame = aValue;
+
+ if ( aName.EqualsAscii( "openas" ) )
+ aOpen = aValue;
+ }
+ }
+
+ INetURLObject aPresObj( rMedium.GetName() );
+ sal_Bool bIsURLFile = aPresObj.GetExtension().EqualsAscii( "url" );
+ if ( aArguments.Len() || aWorkDir.Len() )
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ String aName( aURL );
+ Any aAny( UCB_Helper::GetProperty( aName, WID_FLAG_IS_FOLDER ) );
+ BOOL bIsFolder = FALSE;
+ if ( !( aAny >>= bIsFolder ) || !bIsFolder )
+ {
+ INetURLObject aFake( "macro:" );
+ if ( pApp->IsSecureURL( aFake, &rMedium.GetReferer() ) )
+ {
+ String aName;
+ if ( bIsURLFile )
+ {
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( INET_PROT_FILE );
+ aObj.SetSmartURL( aURL );
+ aName += '\"';
+ aName += aObj.PathToFileName();
+ aName += '\"';
+
+ if ( aArguments.Len() )
+ {
+ aName += ' ';
+ // Don't quote the arguments because StartProcess doesn't know which
+ // quotes should be removed and which not. If the argument needs to
+ // be quoted it has to be quoted in the URL file itself
+ aName += aArguments;
+ }
+ }
+ else if ( rMedium.GetPhysicalName().Len() )
+ {
+ // Bei propriet"aren Formaten lassen wir lieber das BS die Arbeit tun
+ aName += '\"';
+ aName += rMedium.GetPhysicalName();
+ aName += '\"';
+ }
+
+ sal_Bool bOK = sal_False;
+ if ( aWorkDir.Len() )
+ bOK = System::StartProcess( NULL, aName, aWorkDir );
+ else
+ bOK = System::StartProcess( NULL, aName );
+ return bOK ? ERRCODE_ABORT : ERRCODE_IO_NOTSUPPORTED;
+ }
+ }
+ }
+
+ if ( aOpen.EqualsAscii(INTERNETSHORTCUT_TEMPLATE_TAG) )
+ rMedium.GetItemSet()->Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
+
+ if ( aFrame.Len() )
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_TARGETNAME, aFrame ) );
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_REFERER, rMedium.GetName() ) );
+ rMedium.GetItemSet()->Put( aPath, SID_TARGETPATH );
+ rMedium.SetName( aURL, sal_True );
+ rMedium.SetOrigFilter_Impl( 0 );
+ rMedium.SetPhysicalName( String() );
+ rMedium.Init_Impl();
+ rMedium.SetFilter( 0 );
+
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False);
+ sal_Bool bReadOnly = pROItem ? pROItem->GetValue() : sal_False;
+ rMedium.SetOpenMode( bReadOnly ? SFX_STREAM_READONLY : SFX_STREAM_READWRITE, sal_False );
+
+ return ERRCODE_SFX_RESTART;
+ }
+
+ case SFX_EXE_FILTER_HELPID:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ rMedium.Close();
+
+#ifdef WNT
+ String aName( rMedium.GetName() );
+ if ( aName.GetTokenCount( '/' ) == 2 )
+ {
+ String aHelpFile( aName.GetToken( 1, '/' ) );
+ if ( WildCard( DEFINE_CONST_UNICODE("*.chm") ).Matches( aHelpFile ) )
+ {
+ String aHelp( DEFINE_CONST_UNICODE("hh.exe ") );
+ aHelp += aHelpFile;
+ System::StartProcess( NULL, aHelp );
+ }
+ }
+#endif
+
+ String aHID( rMedium.GetURLObject().GetMark() );
+ String aFileName;
+ sal_uInt32 nHID;
+ if ( aHID.Search( ':' ) != STRING_NOTFOUND )
+ {
+ aFileName = aHID.GetToken( 0, ':' );
+ nHID = aHID.GetToken( 1, ':' ).ToInt32();
+ }
+ else
+ {
+ nHID = aHID.ToInt32();
+ }
+ SfxHelp::ShowHelp( nHID, sal_False, aFileName.Len() ? U2S(aFileName).getStr() : NULL );
+ return ERRCODE_ABORT;
+ }
+
+ case SFX_EXE_FILTER_EXECUTE:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ rMedium.SetTemporary( sal_False );
+ INetURLObject aURL( "macro:" );
+ if ( pApp->IsSecureURL( aURL, &rMedium.GetReferer() ) && rMedium.GetPhysicalName().Len() )
+ {
+ String aName( '\"');
+ aName += rMedium.GetPhysicalName();
+ aName += '\"';
+ rMedium.SetTemporary( sal_False );
+ rMedium.CloseInStream();
+ sal_Bool bOk = System::StartProcess( NULL, aName );
+ return bOk ? ERRCODE_ABORT : ERRCODE_IO_NOTEXISTS;
+ }
+ return ERRCODE_IO_ACCESSDENIED;
+ }
+ */
+ case SFX_EXE_FILTER_BUGID:
+ {
+ String aPathName = DEFINE_CONST_UNICODE("http://webserver1.stardiv.de/Bugtracker/Source/Body_ReportDetail.asp?ID=");
+ aPathName += rMedium.GetURLObject().GetURLPath();
+ rMedium.SetName( aPathName );
+ rMedium.SetPhysicalName( String() );
+ rMedium.Init_Impl();
+ rMedium.SetFilter( 0 );
+ return ERRCODE_SFX_RESTART;
+ }
+
+ case SFX_EXE_FILTER_BUGDOC:
+ {
+ String aPathName = GetBugdocName_Impl(
+ rMedium.GetURLObject().GetURLPath() );
+ if( aPathName.Len() )
+ {
+ rMedium.SetName( aPathName );
+ rMedium.SetPhysicalName( String() );
+ rMedium.Init_Impl();
+ rMedium.SetFilter( 0 );
+ return ERRCODE_SFX_RESTART;
+ }
+ else return ERRCODE_SFX_INVALIDLINK;
+ }
+ case SFX_EXE_FILTER_MACRO:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ pApp->EnterBasicCall();
+
+ // macro:-::com::sun::star::util::URL analysiern
+ // 'macro://#lib.mod.proc(args)' => Macro via App-BASIC-Mgr
+ // 'macro:#lib.mod.proc(args)' => Macro via zugehoerigen Doc-BASIC-Mgr
+ // 'macro:obj.method(args)' => Object via App-BASIC-Mgr
+ String aMacro = rMedium.GetURLObject().GetMainURL();
+ sal_uInt16 nHashPos = aMacro.Search( '#' );
+ sal_uInt16 nArgsPos = aMacro.Search( '(' );
+ BasicManager *pBasMgr = 0;
+ ErrCode nErr;
+
+ // wird Macro angesprochen (also KEIN Object)?
+ if ( STRING_NOTFOUND != nHashPos && nHashPos < nArgsPos )
+ {
+ // BasManager ermitteln
+ String aBasMgrName( INetURLObject::decode(aMacro.Copy( 6, nHashPos-6 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
+ if ( aBasMgrName.EqualsAscii("//") )
+ pBasMgr = pApp->GetBasicManager();
+ else if ( !aBasMgrName.Len() )
+ pBasMgr = SfxObjectShell::Current()->GetBasicManager();
+ else
+ for ( SfxObjectShell *pObjSh = SfxObjectShell::GetFirst();
+ pObjSh && !pBasMgr;
+ pObjSh = SfxObjectShell::GetNext(*pObjSh) )
+ if ( aBasMgrName == pObjSh->GetTitle(SFX_TITLE_APINAME) )
+ pBasMgr = pObjSh->GetBasicManager();
+ if ( pBasMgr )
+ {
+ // Funktion suchen
+ String aQualifiedMethod( INetURLObject::decode(aMacro.Copy( nHashPos+1 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
+ String aArgs;
+ if ( STRING_NOTFOUND != nArgsPos )
+ {
+ aArgs = aQualifiedMethod.Copy( nArgsPos - nHashPos - 1 );
+ aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 );
+ }
+ SbxMethod *pMethod = SfxQueryMacro( pBasMgr, aQualifiedMethod );
+
+ // falls gefunden Funktion ueber ihren Parent ausfuehren
+ if ( pMethod )
+ {
+ String aQuotedArgs;
+ if ( aArgs.Len()<2 || aArgs.GetBuffer()[1] == '\"')
+ aQuotedArgs = aArgs;
+ else
+ {
+ // Klammern entfernen
+ aArgs.Erase(0,1);
+ aArgs.Erase( aArgs.Len()-1,1);
+
+ aQuotedArgs = '(';
+
+ // Alle Parameter mit T"uddelchen
+ sal_uInt16 nCount = aArgs.GetTokenCount(',');
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ aQuotedArgs += '\"';
+ aQuotedArgs += aArgs.GetToken( n, ',' );
+ aQuotedArgs += '\"';
+ if ( n<nCount-1 )
+ aQuotedArgs += ',';
+ }
+
+ aQuotedArgs += ')';
+ }
+
+ String aCall( '[' );
+ aCall += pMethod->GetName();
+ aCall += aQuotedArgs;
+ aCall += ']';
+ pMethod->GetParent()->Execute( aCall );
+ nErr = SbxBase::GetError();
+ }
+ else
+ nErr = ERRCODE_BASIC_PROC_UNDEFINED;
+ }
+ else
+ nErr = ERRCODE_IO_NOTEXISTS;
+ }
+ else
+ {
+ // (optional Objekt-qualifizierte) Basic-Funktion ausfuehren
+ String aCall( '[' );
+ aCall += INetURLObject::decode(aMacro.Copy(6), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET);
+ aCall += ']';
+ pApp->GetBasicManager()->GetLib(0)->Execute( aCall );
+ nErr = SbxBase::GetError();
+ }
+
+ pApp->LeaveBasicCall();
+ SbxBase::ResetError();
+ return nErr ? nErr : ERRCODE_ABORT;
+ }
+/*
+ case SFX_EXE_FILTER_FACTORY:
+ {
+ INetURLObject aObj( rMedium.GetURLObject() );
+ String aParam;
+ if ( aObj.HasParam() && (sal_uInt16) aObj.GetParam().ToInt32() )
+ {
+ aParam = aObj.GetParam();
+ aObj.SetParam("");
+ }
+
+ String aPathName( aObj.GetMainURL() );
+ const SfxObjectFactory* pFact = SfxObjectFactory::GetFactory( aPathName );
+ if ( pFact )
+ {
+ if ( aParam.Len() )
+ {
+ sal_uInt16 nSlotId = aParam.ToInt32();
+ SfxModule* pMod = pFact->GetModule()->Load();
+ pMod->ExecuteSlot( SfxRequest( nSlotId, SFX_CALLMODE_SYNCHRON, pMod->GetPool() ) );
+ return ERRCODE_ABORT;
+ }
+
+ SfxAllItemSet aSet( SFX_APP()->GetPool() );
+ sal_uInt16 nSlotId = SID_NEWDOCDIRECT;
+ if( pFact->GetStandardTemplate().Len() )
+ {
+ aSet.Put( SfxStringItem ( SID_FILE_NAME, pFact->GetStandardTemplate() ) );
+ aSet.Put( SfxBoolItem( SID_TEMPLATE, sal_True ) );
+ nSlotId = SID_OPENDOC;
+ }
+ else
+ aSet.Put( SfxStringItem ( SID_NEWDOCDIRECT, aPathName ) );
+
+ aSet.Put( aFrameItem );
+
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pViewId, SfxUInt16Item, SID_VIEW_ID, sal_False );
+ if ( pViewId )
+ aSet.Put( *pViewId );
+
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pHidden, SfxBoolItem, SID_HIDDEN, sal_False );
+ if ( pHidden )
+ aSet.Put( *pHidden );
+
+ if ( rMedium.IsPreview_Impl() )
+ aSet.Put( SfxBoolItem( SID_PREVIEW, sal_True ) );
+
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pReadonly, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ if ( pReadonly )
+ aSet.Put( *pReadonly );
+
+ if ( pTarget )
+ aSet.Put( *pTarget );
+ if ( pReferer )
+ aSet.Put( *pReferer );
+ if ( pPath )
+ aSet.Put( *pPath );
+
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pAPI, SfxBoolItem, SID_SILENT, sal_False );
+ SfxCallMode eMode = SFX_CALLMODE_SYNCHRON;
+ if ( pAPI && pAPI->GetValue() )
+ eMode |= SFX_CALLMODE_API;
+
+ const SfxPoolItem *pRet = pApp->GetAppDispatcher().Execute( nSlotId, eMode, aSet );
+ if ( pRet )
+ rMedium.GetItemSet()->Put( *pRet, SID_OPENURL );
+
+ return ERRCODE_ABORT;
+ }
+ else
+ {
+ // Chaos-Factory ??
+ String aFact( aPathName );
+ String aPrefix( DEFINE_CONST_UNICODE("private:factory/") );
+ if ( aPrefix.Len() == aFact.Match( aPrefix ) )
+ // Factory-Namen extrahieren
+ aFact.Erase( 0, aPrefix.Len() );
+
+ // ContentType ermitteln
+ INetContentType eType = INetContentTypes::GetContentType( aFact );
+ if ( eType != CONTENT_TYPE_UNKNOWN )
+ {
+ // ChaosObjekte werden immer in der Explorer-Root angelegt
+ String aExplorerRoot( SFX_INIMANAGER()->Get( SFX_KEY_EXPLORER_DIR ) );
+ INetURLObject aExp;
+ aExp.SetSmartURL( aExplorerRoot );
+#if 0 //(dv)
+ CntAnchorRef xRoot = new CntAnchor( NULL, aExp.GetMainURL() );
+
+ // Chaos-Factory daf"ur besorgen
+ sal_uInt16 nPos = CntHelperFunctions::GetFactoryPosByContentType( *xRoot, eType, sal_True, 0, 0, 0, CNT_CREATION_FLAG_HIDDEN );
+ if ( nPos != CNTFACTORY_NOTFOUND )
+ {
+ SfxItemSet* pSet = new SfxAllItemSet( SFX_APP()->GetPool() );
+ if ( rpFrame && rpFrame->GetCurrentDocument() )
+ pSet->Put( SfxFrameItem( SID_DOCFRAME, rpFrame ), SID_DOCFRAME );
+ if ( pReferer )
+ pSet->Put( *pReferer, SID_REFERER );
+ CntAnchorRef xRef = CntHelperFunctions::CreateAnchor( *xRoot, nPos, 0, sal_False );
+ if ( xRef.Is() && !xRef->GetError() )
+ {
+ new SfxAsyncChaosFactory_Impl( xRef, pSet );
+ xRef->Put( SfxVoidItem(WID_INSERT) );
+ return ERRCODE_ABORT;
+ }
+ }
+#endif //(dv)
+ }
+ }
+
+ return ERRCODE_IO_NOTSUPPORTED;
+ }
+
+ case SFX_EXE_FILTER_UNO:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ SfxViewFrame *pView = SfxViewFrame::Current();
+ if ( pView )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame;
+ SfxFrame *pFrame = pView->GetFrame();
+ while ( pFrame )
+ {
+ // Falls es eine Mutter-Komponente gibt, diese ansprechen
+ if ( pFrame->HasComponent() )
+ xFrame = pFrame->GetFrameInterface();
+ pFrame = pFrame->GetParentFrame();
+ }
+
+ if ( !xFrame.is() )
+ xFrame = pView->GetFrame()->GetFrameInterface();
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
+ if ( xProv.is())
+ {
+ ::com::sun::star::util::URL aURL;
+ aURL.Complete = rMedium.GetName();
+ SfxURLTransformer aTrans ( ::utl::getProcessServiceFactory() );
+ aTrans.parseStrict( aURL );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
+ if ( xDisp.is() )
+ xDisp->dispatch( aURL, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() );
+ }
+ }
+
+ return ERRCODE_ABORT;
+ }
+*/
+ case SFX_EXE_FILTER_SLOT:
+ {
+ if ( bPreview )
+ return ERRCODE_ABORT;
+
+ const INetURLObject &rURL = rMedium.GetURLObject();
+ SfxUInt16Item aTabPageNoItem( SID_TABPAGE, rURL.GetMark().ToInt32() );
+ const SfxPoolItem* pArgs[] =
+ {
+ &aTabPageNoItem, 0
+ };
+
+ String aSlots( rURL.GetURLPath() );
+ sal_uInt16 nCount = aSlots.GetTokenCount(',');
+ for ( sal_uInt16 nSlot=0; nSlot<nCount; nSlot++ )
+ {
+ sal_uInt16 nSlotId = (sal_uInt16) aSlots.GetToken( nSlot, ',' ).ToInt32();
+ pApp->GetDispatcher().Execute( nSlotId, SFX_CALLMODE_SYNCHRON, pArgs, 0, ppInternalArgs );
+ }
+
+ return ERRCODE_ABORT;
+ }
+
+ default:
+ return ERRCODE_IO_NOTSUPPORTED;
+ }
+}
+
+//----------------------------------------------------------------
+
+SfxExternalAppFilterContainer::SfxExternalAppFilterContainer( )
+ : SfxFilterContainer( DEFINE_CONST_UNICODE(SFX_FCONTNR_EXTAPP) )
+/* [Beschreibung]
+
+ Der SfxExternalAppFilterContainer enthaellt jeden Filter, nach
+ dem er per GetFilter4FilterName gefragt wird. Er ist fuer
+ Redirects von Bedeutung. Im Execute oeffnet er die durch den
+ Filter bezeichnete Applikation. */
+
+{
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxExternalAppFilterContainer::Execute( SfxMedium& rMedium, SfxFrame*& ) const
+{
+ const SfxFilter* pFilter = rMedium.GetFilter();
+ DBG_ASSERT( pFilter, "Medium braucht Filter" );
+ const UniString& rPhysicalName = rMedium.GetPhysicalName();
+ // GetPhysicalName() setzt das tmp-Flag zurueck auf sal_True
+ rMedium.SetTemporary( sal_False );
+
+ OProcess aApp( pFilter->GetFilterName(), rPhysicalName );
+ OProcess::TProcessOption eOption =
+ (OProcess::TProcessOption)( OProcess::TOption_SearchPath | OProcess::TOption_Detached );
+ sal_Bool bOk = ( aApp.execute( eOption ) == OProcess::E_None );
+ return bOk ? ERRCODE_ABORT : ERRCODE_IO_NOTEXISTS;
+}
+
+//----------------------------------------------------------------
+
+sal_uInt16 SfxExternalAppFilterContainer::GetFilterCount() const
+{
+ return SfxFilterContainer::GetFilterCount();
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxExternalAppFilterContainer::GetFilter4FilterName(
+ const String& rName, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+/* [Beschreibung]
+
+ Erzeugt einen entspr. Filter, falls er noch nicht existiert und gibt
+ diesen zurueck.
+ */
+{
+ String aEmpty;
+ SfxFilterFlags nFlags = SFX_FILTER_IMPORT|SFX_FILTER_NOTINFILEDLG|
+ SFX_FILTER_EXECUTABLE;
+ if ( (nFlags & nMust) != nMust ||
+ (nFlags & nDont ) )
+ return 0;
+ const SfxFilter* pFilt =
+ SfxFilterContainer::GetFilter4FilterName( rName );
+ if( !pFilt )
+ {
+ SfxFilter* pFilter = new SfxFilter(
+ rName, DEFINE_CONST_UNICODE("none"), nFlags, 0, aEmpty, aEmpty, 0, aEmpty, this,
+ aEmpty );
+ pImpl->aList.Insert( pFilter, (sal_uInt32)0 );
+ pFilt = pFilter;
+ }
+ return pFilt;
+}
+
+//----------------------------------------------------------------
+
+SfxFactoryFilterContainer::SfxFactoryFilterContainer(
+ const String& rName, const SfxObjectFactory& rFactP )
+ : SfxFilterContainer( rName ), rFact( rFactP ), pFunc(0)
+/* [Beschreibung]
+
+ Im SfxFactoryFilterContainer befinden sich die Filter einer
+ SfxObjectFactory. Wird kein DetectFilter registriert, so wird
+ fuer die DefaultFactory <SfxApplication::DetectFilter> genommen
+ */
+{
+ //Defaults in den Container der DefaultFactory laden
+ SetFlags( GetFlags() | SFX_FILTER_CONTAINER_FACTORY );
+ if( &SfxObjectFactory::GetDefaultFactory() == &rFactP )
+ {
+ pFunc = &SfxFilterMatcher::AppDetectFilter;
+ }
+}
+//----------------------------------------------------------------
+
+sal_uInt32 SfxFactoryFilterContainer::GetFilter4Content(
+ SfxMedium& rMedium, const SfxFilter** ppFilter, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+{
+ ForceFilterLoad_Impl();
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pTargetItem, SfxStringItem,
+ SID_TARGETNAME, sal_False);
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pDontItem, SfxBoolItem,
+ SID_FILTER_DONTDETECTONCONTENT, sal_False);
+ if( pDontItem && pDontItem->GetValue() )
+ return 0;
+
+ if ( *ppFilter && ( (*ppFilter)->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
+ return 0;
+
+ if( pFunc )
+ {
+ sal_uInt32 nErr = (*pFunc)(rMedium, ppFilter, nMust, nDont);
+ DBG_ASSERT( !*ppFilter ||
+ (((*ppFilter)->GetFilterFlags() & nMust ) == nMust &&
+ ((*ppFilter)->GetFilterFlags() & nDont ) == 0 ),
+ "DetectFilter Spec nicht eingehalten" );
+ return nErr;
+ }
+ else
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+DECLARE_LIST( SfxFContainerList_Impl, SfxFilterContainer * );
+
+class SfxFilterMatcher_Impl
+{
+public:
+ sal_uInt16 nAkt;
+ SfxFContainerList_Impl aList;
+ sal_Bool bDeleteContainers;
+};
+
+//----------------------------------------------------------------
+
+SfxFilterMatcher::SfxFilterMatcher( SfxFilterContainer* pCont)
+{
+ pImpl = new SfxFilterMatcher_Impl;
+ pImpl->bDeleteContainers = sal_False;
+ AddContainer( pCont );
+}
+
+//----------------------------------------------------------------
+
+SfxFilterMatcher::SfxFilterMatcher()
+{
+ pImpl = new SfxFilterMatcher_Impl;
+ pImpl->bDeleteContainers = sal_False;
+}
+
+SfxFilterMatcher::SfxFilterMatcher(sal_Bool bDeleteContainers)
+{
+ pImpl = new SfxFilterMatcher_Impl;
+ pImpl->bDeleteContainers = bDeleteContainers;
+}
+
+//----------------------------------------------------------------
+
+SfxFilterMatcher::~SfxFilterMatcher()
+{
+ if ( pImpl->bDeleteContainers )
+ {
+ for ( sal_uInt32 n = pImpl->aList.Count(); n--; )
+ {
+ SfxFilterContainer *pFCont = pImpl->aList.Remove(n);
+ delete pFCont;
+ }
+ }
+ delete pImpl;
+}
+
+//----------------------------------------------------------------
+
+void SfxFilterMatcher::AddContainer( SfxFilterContainer* pC )
+{
+ pImpl->aList.Insert( pC, pImpl->aList.Count() );
+}
+
+//----------------------------------------------------------------
+
+sal_uInt16 SfxFilterMatcher::GetContainerCount() const
+{
+ return (sal_uInt16)pImpl->aList.Count();
+}
+
+//----------------------------------------------------------------
+
+SfxFilterContainer* SfxFilterMatcher::GetContainer( sal_uInt16 nPos ) const
+{
+ return pImpl->aList.GetObject( nPos );
+}
+
+//----------------------------------------------------------------
+
+SfxFilterContainer* SfxFilterMatcher::GetContainer( const String &rName ) const
+{
+ SfxFContainerList_Impl& rList = pImpl->aList;
+ sal_uInt16 nCount = (sal_uInt16) rList.Count();
+ for( sal_uInt16 n = 0; n < nCount; n++ )
+ if( rList.GetObject( n )->GetName() == rName )
+ return rList.GetObject( n );
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent(
+ SfxMedium& rMedium, const SfxFilter**ppFilter,
+ SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+{
+ String aFileName = rMedium.GetName();
+ sal_uInt32 nErr = ERRCODE_NONE;
+ const SfxFilter* pFilter = *ppFilter;
+ const INetURLObject& rObj = rMedium.GetURLObject();
+
+#if defined(WNT) || defined(WIN) || defined(OS2)
+ if( !pFilter )
+ {
+ // Hier kommen zunaechst fest eingehackte Regeln:
+ if( rObj.GetProtocol() == INET_PROT_FILE && rObj.GetExtension().CompareIgnoreCaseToAscii( "exe" ) == COMPARE_EQUAL )
+ {
+ String aStr( DEFINE_CONST_UNICODE("soffice") );
+// String aStr( SfxResId( STR_FILTER_OTHERS ) );
+ aStr += DEFINE_CONST_UNICODE(": exe");
+ pFilter = GetFilter( aStr, nMust, nDont );
+ }
+ }
+#endif
+
+ SfxFilterContainer *pCont = GetContainer( DEFINE_CONST_UNICODE("soffice") );
+ if ( pCont )
+ {
+ if ( !pFilter )
+ pFilter = SfxExecutableFilterContainer::CheckForFolder( rMedium, nMust, nDont );
+/*
+ if ( !pFilter )
+ {
+ // Wenn eine Komponente f"ur das vorhandene ::com::sun::star::util::URL-Pattern registriert ist und sie auch
+ // mit der speziellen ::com::sun::star::util::URL was anfangen kann, gibt createObject einen Loader zur"uck
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xReg( xMgr->createInstance( DEFINE_CONST_UNICODE("com.sun.star.frame.FrameLoaderFactory") ), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > aRef = xReg->createInstance( aFileName );
+ if ( aRef.is() )
+ pFilter = pCont->GetFilter4FilterName(DEFINE_CONST_UNICODE("component"), nMust, nDont );
+ }
+ */
+ }
+
+ if( !pFilter )
+ pFilter = SFX_APP()->GetFilterMatcher().GetFilter4Protocol( rMedium );
+
+ sal_Bool bCheckExternBrowser = rMedium.IsAllowedForExternalBrowser();
+ if ( bCheckExternBrowser && !GetContainer( DEFINE_CONST_UNICODE("soffice") ) )
+ bCheckExternBrowser = sal_False;
+ if ( bCheckExternBrowser && ( (nDont & SFX_EXE_FILTERFLAGS ) || (( nMust & SFX_EXE_FILTERFLAGS ) != nMust ) ) )
+ bCheckExternBrowser = sal_False;
+
+ if( pFilter )
+ {
+ pFilter = ResolveRedirection( pFilter, rMedium );
+ }
+ else if ( rMedium.ProvidesData_Impl() )
+ {
+ // Falls Medium Remote, Zunaechst ueber Mimetypen pruefen ( nicht bei ExternBrowser, sofern dabei angeladen wird )
+ if( !pFilter && rMedium.SupportsMIME_Impl() && ( !bCheckExternBrowser || rObj.GetProtocol() != INET_PROT_HTTP && rObj.GetProtocol() != INET_PROT_HTTPS ) )
+ {
+ // Mime Typen holen
+ String aMime;
+ nErr = rMedium.GetMIMEAndRedirect( aMime );
+ nErr = ERRCODE_TOERROR( nErr );
+ if ( nErr == ERRCODE_IO_PENDING )
+ return nErr;
+ else if( !nErr && aMime.Len() )
+ {
+ if ( aMime.EqualsAscii(CONTENT_TYPE_STR_X_CNT_HTTPFILE) )
+ // FilterDetection nur "uber den Content
+ return ERRCODE_NONE;
+ else
+ pFilter = GetFilter4Mime( aMime, nMust, nDont );
+
+ if ( pFilter && aMime.EqualsAscii(CONTENT_TYPE_STR_APP_OCTSTREAM) )
+ {
+ // Damit eigene Formate wie sdw auch bei falsch konfiguriertem Server erkannt werden, bevor
+ // wir GetInStream rufen
+ const SfxFilter* pMimeFilter = pFilter;
+ pFilter = GetFilter4Extension( rMedium.GetURLObject().GetName(), nMust, nDont );
+ pFilter = ResolveRedirection( pFilter, rMedium );
+ if( pFilter )
+ {
+ nErr = ERRCODE_NONE;
+ if ( ( pFilter == SfxExecutableFilterContainer::GetChooserFilter() ||
+ pFilter->GetFilterName().EqualsAscii(SFX_FILTER_DOWNLOAD) ) && !rMedium.IsRemote() )
+ // Chooser/Downloader bei MIME nur wenn remote
+ pFilter = 0;
+ }
+
+ if ( !pFilter )
+ pFilter = pMimeFilter;
+ }
+
+ // Bei MIME Typen keinen Storage anfordern
+ if( !nErr && rMedium.SupportsMIME_Impl() && rMedium.ProvidesData_Impl() &&
+ pFilter && !pFilter->UsesStorage() )
+ {
+ rMedium.GetInStream();
+ nErr = rMedium.GetError();
+ }
+ }
+
+ if( nErr )
+ {
+ if ( nErr == ERRCODE_SFX_CONSULTUSER )
+ *ppFilter = pFilter;
+ return nErr;
+ }
+ else if ( pFilter && aMime.EqualsAscii(CONTENT_TYPE_STR_TEXT_HTML) )
+ {
+ // MIME ist vertrauenswuerdig ( !? )
+ nErr = ERRCODE_SFX_NEVERCHECKCONTENT;
+ }
+ }
+
+ if( !pFilter && rMedium.ProvidesFile_Impl() && rMedium.IsDownloadDone_Impl() )
+ {
+ // dann ueber Storage CLSID
+ // Remote macht das keinen Sinn, wenn der Download noch la"uft
+ if( rMedium.IsStorage() )
+ {
+ SvStorageRef aStor = rMedium.GetStorage();
+ if ( !aStor.Is() )
+ return ERRCODE_IO_GENERAL;
+ pFilter = GetFilter4ClipBoardId( aStor->GetFormat(), nMust, nDont );
+ }
+
+ // Als naechstes ueber Extended Attributes pruefen
+ String aNewFileName;
+ if( !pFilter )
+ {
+ aNewFileName = rMedium.GetPhysicalName();
+ SvEaMgr aMgr( aNewFileName );
+ String aType;
+ if( aMgr.GetFileType( aType ))
+ {
+ // Plain text verwerfen wir, damit unter OS/2
+ // html Dateien mit attribut Text als html geladen werden
+ if( aType.CompareIgnoreCaseToAscii( "Plain Text" ) != COMPARE_EQUAL )
+ pFilter = GetFilter4EA( aType, nMust, nDont );
+ }
+ }
+ }
+
+ // Zu allerletzt ueber Extension mappen
+ pFilter = ResolveRedirection( pFilter, rMedium );
+ if( !pFilter )
+ {
+ pFilter = GetFilter4Extension( rMedium.GetURLObject().GetName(), nMust, nDont );
+ if( !pFilter || pFilter->GetWildcard()==DEFINE_CONST_UNICODE("*.*") || pFilter->GetWildcard() == '*' )
+ pFilter = 0;
+ pFilter = ResolveRedirection( pFilter, rMedium );
+ if( pFilter &&
+ ( pFilter == SfxExecutableFilterContainer::GetChooserFilter() ||
+ pFilter->GetFilterName().EqualsAscii(SFX_FILTER_DOWNLOAD) ) &&
+ !rMedium.IsRemote() )
+ pFilter = 0;
+ }
+ }
+
+ if ( bCheckExternBrowser &&
+ ( ( pFilter && pFilter->GetMimeType().EqualsAscii(CONTENT_TYPE_STR_TEXT_HTML) ) ||
+ (!pFilter && ( rObj.GetProtocol() == INET_PROT_HTTP || rObj.GetProtocol() == INET_PROT_HTTPS || rObj.GetProtocol() == INET_PROT_FTP && rMedium.SupportsMIME_Impl() ) ) ) )
+ {
+ const SfxFilter* pBrwFilter = GetFilter4FilterName( DEFINE_CONST_UNICODE("ExternBrowser"), nMust, nDont );
+ if ( pBrwFilter )
+ {
+ rMedium.GetItemSet()->Put( SfxBoolItem (SID_DOC_READONLY, sal_True ) );
+ rMedium.SetOpenMode( SFX_STREAM_READONLY, sal_True );
+ pFilter = pBrwFilter;
+ if ( rMedium.GetFilter() )
+ rMedium.SetFilter( 0 );
+/*(dv) CntAnchorRef xAnchor( rMedium.GetAnchor() );
+ if ( xAnchor.Is() )
+ xAnchor->Put( CntContentTypeItem(WID_CONTENT_TYPE, CONTENT_TYPE_TEXT_HTML ) );
+*/ }
+ }
+
+ if ( !pFilter && rObj.GetProtocol() == INET_PROT_FTP )
+ {
+ pFilter = SfxExecutableFilterContainer::GetDownloadFilter();
+ nErr = ERRCODE_SFX_CONSULTUSER;
+ }
+
+ *ppFilter = pFilter;
+ return nErr;
+}
+
+//----------------------------------------------------------------
+
+#define CHECKERROR() \
+if( nErr == 1 || nErr == USHRT_MAX || nErr == ULONG_MAX ) \
+{ \
+ ByteString aText = "Fehler in FilterDetection: Returnwert ";\
+ aText += ByteString::CreateFromInt32(nErr); \
+ if( pFilter ) \
+ { \
+ aText += ' '; \
+ aText += ByteString(U2S(pFilter->GetName())); \
+ } \
+ DBG_ERROR( aText.GetBuffer() ); \
+ nErr = ERRCODE_ABORT; \
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxFilterMatcher::GuessFilter(
+ SfxMedium& rMedium, const SfxFilter**ppFilter,
+ SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+{
+ const SfxFilter* pOldFilter = ResolveRedirection( *ppFilter, rMedium );
+ const SfxFilter* pFilter = pOldFilter;
+
+ sal_Bool bConsultUser = sal_False;
+ sal_Bool bProvidesData = rMedium.ProvidesData_Impl();
+ sal_Bool bSupportsMime = rMedium.SupportsMIME_Impl();
+
+ // Zunaechst, falls Filter mitkommt einmal testen, ob dieser in Ordnung ist.
+ ErrCode nErr = ERRCODE_NONE;
+ if( pFilter && bProvidesData && ( pFilter->GetFilterContainer()->GetFlags() & SFX_FILTER_CONTAINER_FACTORY ) )
+ {
+ rMedium.StartDownload();
+ if ( !rMedium.IsDownloadDone_Impl() )
+ {
+ if ( pFilter->GetFilterFlags() & SFX_FILTER_ASYNC )
+ {
+ // kurzzeitig auf synchron schalten solange die Apps sich weigern asynchron
+ // zu detecten
+ rMedium.ForceSynchronStream_Impl( sal_True );
+ if ( !rMedium.GetInStream() )
+ {
+ ErrCode e = rMedium.GetErrorCode();
+ if ( e == ERRCODE_NONE )
+ {
+ *ppFilter = pFilter;
+ return ERRCODE_IO_PENDING;
+ }
+ else
+ return e;
+ }
+ }
+ else
+ {
+ *ppFilter = pFilter;
+ return ERRCODE_IO_PENDING;
+ }
+ }
+
+ if( bSupportsMime && !pFilter->UsesStorage() )
+ rMedium.GetInStream();
+
+ nErr = pFilter->GetFilterContainer()->GetFilter4Content( rMedium, &pFilter, nMust, nDont );
+ CHECKERROR();
+
+ rMedium.ForceSynchronStream_Impl( sal_False );
+
+ // ABORT bedeutet Filter ungueltig
+ if( nErr && (nErr != ERRCODE_ABORT && nErr != ERRCODE_SFX_FORCEQUIET ) )
+ return nErr;
+
+ // War der Filter ungueltig oder wurde ein anderer zurueckgegeben,
+ // so detecten wir selbst (wg. redirection)
+ if( nErr == ERRCODE_ABORT && pFilter )
+ bConsultUser = sal_True;
+
+ if( nErr != ERRCODE_SFX_FORCEQUIET && pOldFilter && pFilter != pOldFilter )
+ pFilter = 0;
+ }
+
+ if( !pFilter )
+ {
+ bConsultUser = sal_False;
+//DV !!!! don't close InStream when using the new medium
+// rMedium.CloseInStream();
+
+ // Als erstes Protocol, MIME-Type, Extension etc. probieren
+ nErr = GuessFilterIgnoringContent( rMedium, &pFilter, nMust, nDont );
+ if ( nErr == ERRCODE_IO_PENDING )
+ {
+ *ppFilter = pFilter;
+ return nErr;
+ }
+
+ if ( pFilter && nErr == ERRCODE_SFX_CONSULTUSER )
+ {
+ pFilter = ResolveRedirection( pFilter, rMedium );
+ *ppFilter = pFilter;
+ }
+
+ if ( !pFilter && SFX_APP()->ShouldUseExternalBrowser( rMedium.GetName() ) )
+ {
+ sal_Bool bIExplorer = sal_False;
+ INetURLObject aObj( rMedium.GetName() );
+ if ( aObj.GetProtocol() == INET_PROT_HTTP )
+ {
+ bIExplorer = sal_True;
+ }
+ else if ( aObj.GetProtocol() == INET_PROT_FILE || aObj.GetProtocol() == INET_PROT_FTP )
+ {
+ String aExt = aObj.GetExtension().ToLowerAscii();
+ if ( aExt.EqualsAscii("htm") || aExt.EqualsAscii("html") )
+ bIExplorer = sal_True;
+ }
+
+ if ( bIExplorer )
+ DBG_ERROR( "Das wre ihr Preis gewesen ... " );
+ }
+
+/*
+ // Erst jetzt auch das Betriebssystem einschalten
+ if ( !pFilter && 0 != GetContainer( DEFINE_CONST_UNICODE(SFX_FCONTNR_EXTAPP) ) )
+ {
+ sal_Bool bExternalAllowed = sal_True;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ if ( pFlags )
+ {
+ // Werte auf einzelne Items verteilen
+ String aFileFlags = pFlags->GetValue();
+ aFileFlags.ToUpperAscii();
+ if ( STRING_NOTFOUND != aFileFlags.Search( 'B' ) )
+ bExternalAllowed = sal_False;
+ else if ( STRING_NOTFOUND != aFileFlags.Search( 'H' ) )
+ bExternalAllowed = sal_False;
+ }
+
+ INetURLObject aURL( "macro:" );
+ String aReferer( rMedium.GetReferer() );
+ if ( !SFX_APP()->IsSecureURL( aURL, &aReferer ) )
+ bExternalAllowed = sal_False;
+
+ if ( bExternalAllowed && rMedium.GetURLObject().GetProtocol() == INET_PROT_HTTP )
+ bExternalAllowed = sal_False;
+
+ if ( aReferer.EqualsAscii("private:OpenEvent") )
+ bExternalAllowed = sal_False;
+
+ if ( bExternalAllowed && rMedium.GetPhysicalName().Len() )
+ {
+ String aName( '\"');
+ aName += rMedium.GetPhysicalName();
+ aName += '\"';
+ rMedium.SetTemporary(sal_False);
+
+ // Wenn "uber das Betriebssystem geladen werden kann, wird der aktuelle Ladevorgang
+ // abgebrochen
+ if ( System::StartProcess( NULL, aName ) )
+ return ERRCODE_ABORT;
+ }
+ }
+*/
+ if( nErr && nErr != ERRCODE_ABORT && nErr != ERRCODE_SFX_FORCEQUIET && nErr != ERRCODE_SFX_NEVERCHECKCONTENT )
+ return nErr;
+
+ if( nErr == ERRCODE_ABORT )
+ pFilter = 0;
+
+ pFilter = ResolveRedirection( pFilter, rMedium );
+
+ // Jetzt wird geprueft, ob das Modul auch einverstanden ist; ist das nicht der Fall, wird auf
+ // jeden Fall auf ConsultUser umgeschaltet
+ if( pFilter && bProvidesData )
+ {
+ if( nErr == ERRCODE_SFX_NEVERCHECKCONTENT )
+ nErr = ERRCODE_NONE;
+ else if( pFilter->GetFilterContainer()->GetFlags() & SFX_FILTER_CONTAINER_FACTORY )
+ {
+ rMedium.StartDownload();
+ if ( !rMedium.IsDownloadDone_Impl() )
+ {
+ if ( !pFilter->UsesStorage() && rMedium.GetInStream() && ( pFilter->GetFilterFlags() & SFX_FILTER_ASYNC ) )
+ // kurzzeitig auf synchron schalten solange die Apps sich weigern asynchron
+ // zu detecten
+ rMedium.ForceSynchronStream_Impl( sal_True );
+ else
+ {
+ *ppFilter = pFilter;
+ return ERRCODE_IO_PENDING;
+ }
+ }
+
+ const SfxFilter* pTmpFilter = pFilter;
+ nErr = pFilter->GetFilterContainer()->GetFilter4Content( rMedium, &pFilter, nMust, nDont );
+ CHECKERROR();
+
+ rMedium.ForceSynchronStream_Impl( sal_False );
+
+ // ABORT bedeutet Filter ungueltig
+ if( nErr && (nErr != ERRCODE_ABORT && nErr != ERRCODE_SFX_FORCEQUIET ) )
+ return nErr;
+
+ if( nErr == ERRCODE_ABORT && pFilter )
+ pFilter = 0;
+ }
+ }
+ }
+
+ // Jetzt einmal drueberiterieren und nur die perfekten Filter nehmen
+ if( !pFilter )
+ {
+ // Achtung: hier k"onnte auch asynchron detected werden!
+ rMedium.StartDownload();
+ if ( !rMedium.IsDownloadDone_Impl() )
+ return ERRCODE_IO_PENDING;
+
+ rMedium.IsStorage();
+ nErr = rMedium.GetErrorCode();
+ if( nErr )
+ return nErr;
+ nErr = GetFilter4Content( rMedium, &pFilter, nMust, nDont, sal_True );
+ CHECKERROR();
+ if( nErr && (nErr != ERRCODE_ABORT && nErr != ERRCODE_SFX_FORCEQUIET ) )
+ return nErr;
+
+ if( nErr == ERRCODE_ABORT && pFilter )
+ pFilter = 0;
+ }
+
+ // Letzte Moeglichkeit ist die Befragung aller ObjectFactories.
+ if( !pFilter )
+ {
+ // Achtung: hier k"onnte auch asynchron detected werden!
+ if ( !rMedium.IsDownloadDone_Impl() )
+ return ERRCODE_IO_PENDING;
+
+//DV !!!! don't close InStream when using the new Medium
+//rMedium.CloseInStream();
+
+ rMedium.IsStorage();
+ nErr = GetFilter4Content( rMedium, &pFilter, nMust, nDont );
+ CHECKERROR();
+ if( nErr && (nErr != ERRCODE_ABORT && nErr != ERRCODE_SFX_FORCEQUIET ) )
+ return nErr;
+
+ if( nErr == ERRCODE_ABORT && pFilter )
+ bConsultUser = sal_True;
+ }
+
+ if ( pFilter &&
+ ( pFilter == SfxExecutableFilterContainer::GetChooserFilter() && pFilter != pOldFilter ||
+ pFilter->GetFilterName().EqualsAscii(SFX_FILTER_DOWNLOAD) && !rMedium.IsRemote() ) )
+ pFilter = NULL;
+
+ *ppFilter = pFilter;
+
+ if ( ( ( pOldFilter && pOldFilter!=pFilter &&
+ ( !pOldFilter->IsOwnTemplateFormat() || !pFilter->IsOwnFormat() ) ) ) &&
+ nErr != ERRCODE_SFX_FORCEQUIET || bConsultUser )
+ return ERRCODE_SFX_CONSULTUSER;
+/*
+ if( rMedium.SupportsMIME_Impl() && bProvidesData &&
+ pFilter && !pFilter->UsesStorage() )
+ rMedium.GetInStream(); // Bei MIME Typen keinen Storage anfordern
+*/
+ if( !pOldFilter )
+ pOldFilter = pFilter;
+
+ // Checken, ob Daten vorliegen. Dies verhindert Fehler, die in
+ // GetFilter4Content auftreten und die Auswahlbox hochbringen.
+ ErrCode nMediumError = rMedium.GetErrorCode();
+ if( nMediumError )
+ return nMediumError;
+
+ *ppFilter = pFilter;
+ if ( ( nErr ||
+ ( pOldFilter && pOldFilter!=pFilter
+ && ( !pOldFilter->IsOwnTemplateFormat() ||
+ !pFilter->IsOwnFormat() ) ))
+ && nErr != ERRCODE_SFX_FORCEQUIET )
+ nErr = ERRCODE_SFX_CONSULTUSER;
+
+ if( nErr == ERRCODE_SFX_FORCEQUIET )
+ nErr = 0;
+ return nErr;
+};
+
+//----------------------------------------------------------------
+sal_Bool SfxFilterMatcher::IsFilterInstalled( const SfxFilter* pFilter )
+{
+ Window *pWindow = SFX_APP()->GetTopWindow();
+ if ( pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL )
+ {
+ // Hier k"onnte noch eine Nachinstallation angeboten werden
+ String aText( SfxResId( STR_FILTER_NOT_INSTALLED ) );
+ aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() );
+ QueryBox aQuery( pWindow, WB_YES_NO | WB_DEF_YES, aText );
+ short nRet = aQuery.Execute();
+ if ( nRet == RET_YES )
+ {
+#ifdef DBG_UTIL
+ // Setup starten
+ InfoBox( pWindow, DEFINE_CONST_UNICODE("Hier soll jetzt das Setup starten!") ).Execute();
+#endif
+ // Installation mu\s hier noch mitteilen, ob es geklappt hat, dann kann das
+ // Filterflag gel"oscht werden
+ }
+
+ return ( !(pFilter->GetFilterFlags() & SFX_FILTER_MUSTINSTALL) );
+ }
+ else if ( pFilter->GetFilterFlags() & SFX_FILTER_CONSULTSERVICE )
+ {
+ String aText( SfxResId( STR_FILTER_CONSULT_SERVICE ) );
+ aText.SearchAndReplaceAscii( "$(FILTER)", pFilter->GetUIName() );
+ InfoBox ( pWindow, aText ).Execute();
+ return sal_False;
+ }
+ else
+ return sal_True;
+}
+
+
+sal_uInt32 SfxFilterMatcher::DetectFilter( SfxMedium& rMedium, const SfxFilter**ppFilter, sal_Bool bPlugIn, sal_Bool bAPI ) const
+/* [Beschreibung]
+
+ Hier wird noch die Filterauswahlbox hochgezogen. Sonst GuessFilter
+ */
+
+{
+ const SfxFilter* pOldFilter = rMedium.GetFilter();
+ if ( pOldFilter )
+ {
+ if( !IsFilterInstalled( pOldFilter ) )
+ pOldFilter = 0;
+ else
+ {
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ if ( ( pOldFilter->GetFilterFlags() & SFX_FILTER_PACKED ) && pSalvageItem )
+ // Salvage is always done without packing
+ pOldFilter = 0;
+ }
+ }
+
+ const SfxFilter* pFilter = pOldFilter;
+
+ sal_Bool bPreview = rMedium.IsPreview_Impl(), bInsert = sal_False;
+ SFX_ITEMSET_ARG(rMedium.GetItemSet(), pReferer, SfxStringItem, SID_REFERER, FALSE);
+ if ( bPreview && rMedium.IsRemote() && ( !pReferer || pReferer->GetValue().CompareToAscii("private:searchfolder:",21 ) != COMPARE_EQUAL ) )
+ return ERRCODE_ABORT;
+
+ ErrCode nErr = GuessFilter( rMedium, &pFilter );
+ if ( nErr == ERRCODE_ABORT )
+ return nErr;
+
+ if ( nErr == ERRCODE_IO_PENDING )
+ {
+ *ppFilter = pFilter;
+ return nErr;
+ }
+
+ if ( !pFilter )
+ {
+ const SfxFilter* pInstallFilter = NULL;
+
+ // Jetzt auch Filter testen, die nicht installiert sind ( ErrCode ist irrelevant )
+ GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, SFX_FILTER_CONSULTSERVICE );
+ if ( pInstallFilter )
+ {
+ if ( IsFilterInstalled( pInstallFilter ) )
+ // Eventuell wurde der Filter nachinstalliert
+ pFilter = pInstallFilter;
+ }
+ else
+ {
+ // Jetzt auch Filter testen, die erst von Star bezogen werden m"ussen ( ErrCode ist irrelevant )
+ GuessFilter( rMedium, &pInstallFilter, SFX_FILTER_IMPORT, 0 );
+ if ( pInstallFilter )
+ IsFilterInstalled( pInstallFilter );
+ }
+ }
+
+ sal_Bool bHidden = bPreview;
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ if ( !bHidden && pFlags )
+ {
+ String aFlags( pFlags->GetValue() );
+ aFlags.ToUpperAscii();
+ if( STRING_NOTFOUND != aFlags.Search( 'H' ) )
+ bHidden = sal_True;
+ }
+
+ if ( ( !pFilter || nErr == ERRCODE_SFX_CONSULTUSER ) && !bAPI && !bHidden )
+ {
+ if ( !pFilter && rMedium.IsRemote() )
+ pFilter = SfxExecutableFilterContainer::GetDownloadFilter();
+ else if ( !pFilter )
+ pFilter = pOldFilter;
+
+ String aTmpName;
+ if ( pFilter )
+ aTmpName = pFilter->GetUIName();
+
+ SfxFilterMatcher *pMatcher;
+ if( bPlugIn && pFilter )
+ pMatcher = new SfxFilterMatcher( (SfxFilterContainer *) pFilter->GetFilterContainer() );
+ else
+ pMatcher = (SfxFilterMatcher*) this;
+
+ SfxFilterDialog *pDlg = new SfxFilterDialog( 0, &rMedium, *pMatcher, pFilter ? &aTmpName: 0, 0 );
+ const sal_Bool bOk = RET_OK == pDlg->Execute();
+ if (bOk)
+ pFilter = pMatcher->GetFilter4UIName( pDlg->GetSelectEntry());
+
+ if( bPlugIn && pFilter )
+ delete pMatcher;
+ delete pDlg;
+
+ if ( !bOk)
+ nErr = ERRCODE_ABORT;
+ else
+ nErr = ERRCODE_NONE;
+
+ pFilter = ResolveRedirection( pFilter, rMedium );
+ }
+
+ *ppFilter = pFilter;
+
+ if ( bHidden || bAPI && nErr == ERRCODE_SFX_CONSULTUSER )
+ nErr = pFilter ? ERRCODE_NONE : ERRCODE_ABORT;
+ return nErr;
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterMatcher::GetDefaultFilter() const
+/* [Beschreibung]
+
+ Returned den ersten Filter, der nicht internal ist und im Filedialog
+ auftaucht
+ */
+{
+ SfxFilterMatcherIter aIter(
+ this, 0, SFX_FILTER_INTERNAL | SFX_FILTER_NOTINFILEDLG );
+ return aIter.First();
+}
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxFilterMatcher::GetFilter4Content(
+ SfxMedium& rMedium, const SfxFilter** ppFilter, SfxFilterFlags nMust, SfxFilterFlags nDont, sal_Bool bOnlyGoodOnes ) const
+{
+ sal_uInt32 nErr = ERRCODE_NONE;
+ SfxFContainerList_Impl& rList = pImpl->aList;
+ sal_uInt16 nCount = (sal_uInt16)rList.Count();
+ for( sal_uInt16 n = 0; n<nCount; n++ )
+ {
+ const SfxFilter* pFilter = 0;
+ nErr = rList.GetObject( n )->GetFilter4Content(
+ rMedium, &pFilter, nMust, nDont );
+ CHECKERROR();
+ if( nErr == ERRCODE_ABORT && bOnlyGoodOnes ) pFilter = 0;
+ if( pFilter )
+ {
+ *ppFilter = pFilter;
+ return nErr;
+ }
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+#define IMPL_LOOP( Type, ArgType ) \
+const SfxFilter* SfxFilterMatcher::Type( \
+ ArgType rStr, SfxFilterFlags nMust, SfxFilterFlags nDont ) const \
+{ \
+ SfxApplication* pApp = SFX_APP(); \
+ if( this == &pApp->GetFilterMatcher() ) \
+ pApp->ForcePendingInitFactories(); \
+ SfxFContainerList_Impl& rList = pImpl->aList; \
+ sal_uInt16 nCount = (sal_uInt16)rList.Count(); \
+ for( sal_uInt16 n = 0; n<nCount; n++ ) \
+ { \
+ const SfxFilter* pFilter = \
+ rList.GetObject( n )->Type(rStr, nMust, nDont ); \
+ if( pFilter ) \
+ return pFilter; \
+ } \
+ return 0; \
+}
+
+IMPL_LOOP( GetFilter4Mime, const String& )
+IMPL_LOOP( GetFilter4EA, const String& )
+IMPL_LOOP( GetFilter4Extension, const String& )
+IMPL_LOOP( GetFilter4Protocol, SfxMedium& )
+IMPL_LOOP( GetFilter4ClipBoardId, sal_uInt32 )
+IMPL_LOOP( GetFilter, const String& )
+IMPL_LOOP( GetFilter4FilterName, const String& )
+IMPL_LOOP( GetFilter4UIName, const String& )
+
+//----------------------------------------------------------------
+
+sal_uInt32 SfxFilterMatcher::AppDetectFilter(
+ SfxMedium& rMedium, const SfxFilter** ppFilter, SfxFilterFlags nMust, SfxFilterFlags nDont )
+{
+ SfxFilterFlags nClass = nMust & SFX_FILTER_TEMPLATE ?
+ SFX_FILTER_TEMPLATE : USHRT_MAX;
+ return SFX_APP()->DetectFilter( rMedium, ppFilter, (sal_uInt16)nMust );
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterMatcher::ResolveRedirection( const SfxFilter* pFilter, SfxMedium& rMedium ) const
+{
+ return ResolveRedirection( pFilter, rMedium.GetURLObject().GetURLPath() );
+}
+
+const SfxFilter* SfxFilterMatcher::ResolveRedirection( const SfxFilter* pFilter, const String& rURLPath ) const
+{
+ while( sal_True )
+ {
+ if( !pFilter || !(pFilter->GetFilterFlags() & SFX_FILTER_REDIRECT))
+ return pFilter;
+ {
+ if( !(pFilter->GetFilterFlags() & SFX_FILTER_ALIEN ) )
+ // Es ist der Officefilter
+ {
+ sal_Bool bFound = sal_False;
+ String aName = ToUpper_Impl( rURLPath );
+
+ // jetzt auch die Nicht-Own-Filter f"ur das MsgDoc
+ SfxFilterMatcherIter aIter( this, SFX_FILTER_IMPORT );
+ for( const SfxFilter* pAppFilter = aIter.First(); pAppFilter;
+ pAppFilter = aIter.Next() )
+ {
+ SfxFilterFlags nFlags = pAppFilter->GetFilterFlags();
+ // aber nicht den OfficeFilter
+ WildCard aCard( ToUpper_Impl( pAppFilter->GetWildcard()() ), ';' );
+ if ( aCard() == DEFINE_CONST_UNICODE("*.*") || aCard() == '*' )
+ continue;
+
+ if( aCard.Matches( aName ) && pAppFilter != pFilter )
+ {
+ pFilter = pAppFilter;
+ bFound = sal_True;
+ break;
+ }
+ }
+
+ if (!bFound)
+ {
+ DBG_ERROR( "AppFilter nicht gefunden" );
+ return 0;
+ }
+ }
+ else
+ {
+ String aData = pFilter->GetUserData();
+ if( aData.GetTokenCount( '|' )!=2 )
+ {
+ DBG_ERROR( "Schlechtes Redirectionsformat" );
+ return 0;
+ }
+ else
+ {
+ String aContainer = aData.GetToken( 0, '|' );
+ String aFilter = aData.GetToken( 1, '|' );
+ SfxFilterContainer* pCont = GetContainer( aContainer );
+ if( pCont )
+ pFilter = pCont->GetFilter4FilterName( aFilter );
+ else
+ return 0;
+ }
+ }
+ }
+ }
+}
+
+//----------------------------------------------------------------
+
+IMPL_STATIC_LINK( SfxFilterMatcher, MaybeFileHdl_Impl, String*, pString )
+{
+ const SfxFilter* pFilter =
+ pThis->GetFilter4Extension( *pString, SFX_FILTER_IMPORT );
+ if( pFilter && !pFilter->GetWildcard().Matches( String() ) &&
+ pFilter->GetWildcard() != DEFINE_CONST_UNICODE("*.*") && pFilter->GetWildcard() != '*' )
+ return sal_True;
+ return sal_False;
+}
+
+//----------------------------------------------------------------
+
+SfxFilterMatcherIter::SfxFilterMatcherIter(
+ const SfxFilterMatcher* pMatchP,
+ SfxFilterFlags nOrMaskP, SfxFilterFlags nAndMaskP )
+ : pMatch( pMatchP->pImpl),
+ nOrMask( nOrMaskP ), nAndMask( nAndMaskP )
+{
+ // Iterator auf AppFilterMatcher -> DoInitFactory
+ SfxApplication* pApp = SFX_APP();
+ if( pMatchP == &pApp->GetFilterMatcher() )
+ pApp->ForcePendingInitFactories();
+ if( nOrMask == 0xffff ) //Wg. Fehlbuild auf s
+ nOrMask = 0;
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter *SfxFilterMatcherIter::Forward_Impl()
+{
+ sal_uInt16 nCount = (sal_uInt16 )pMatch->aList.Count();
+ for( ++nAktContainer; nAktContainer < nCount ; nAktContainer++ )
+ {
+ pCont = pMatch->aList.GetObject( nAktContainer );
+ sal_uInt16 nCnt = pCont->GetFilterCount();
+ if( nCnt )
+ {
+ nBorder=nCnt;
+ nAktFilter = 0;
+ return pCont->GetFilter( 0 );
+ }
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterMatcherIter::First_Impl()
+{
+ nAktFilter = -1;
+ nAktContainer = -1;
+ nBorder = 0;
+
+ return Forward_Impl();
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterMatcherIter::Next_Impl()
+{
+ if( ++nAktFilter < nBorder )
+ return pCont->GetFilter( nAktFilter );
+ return Forward_Impl();
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterMatcherIter::First()
+{
+ const SfxFilter* pFilter;
+ for( pFilter = First_Impl(); pFilter; pFilter = Next_Impl())
+ {
+ SfxFilterFlags nFlags = pFilter->GetFilterFlags();
+ if( ((nFlags & nOrMask) == nOrMask ) && !(nFlags & nAndMask ) )
+ break;
+ }
+ return pFilter;
+}
+
+//----------------------------------------------------------------
+
+const SfxFilter* SfxFilterMatcherIter::Next()
+{
+ const SfxFilter* pFilter;
+ for( pFilter = Next_Impl(); pFilter; pFilter = Next_Impl())
+ {
+ SfxFilterFlags nFlags = pFilter->GetFilterFlags();
+ if( ((nFlags & nOrMask) == nOrMask ) && !(nFlags & nAndMask ) )
+ break;
+ }
+ return pFilter;
+}
+
+//----------------------------------------------------------------
+
+SfxFrameWindowFactory::SfxFrameWindowFactory(
+ FactoryFunc pFuncP, String aNameP ) :
+ pFunc( pFuncP ), aName( aNameP.ToUpperAscii() )
+{
+}
+
+SfxPluginFilterContainer::SfxPluginFilterContainer()
+ : SfxFilterContainer( DEFINE_CONST_UNICODE("plugin") )
+ , bInitialized( Application::IsRemoteServer() )
+{
+ SFX_APP()->InsertLateInitHdl( LINK( this, SfxPluginFilterContainer, LoadHdl_Impl ) );
+}
+
+sal_uInt32 SfxPluginFilterContainer::Execute( SfxMedium& rMedium, SfxFrame*& pFrame) const
+{
+/*
+ rMedium.Close();
+ ::rtl::OUString aTargetURL = rMedium.GetURLObject().GetMainURL();
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_CONTENTTYPE, rMedium.GetFilter()->GetMimeType() ) );
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ TransformItems( SID_OPENDOC, *rMedium.GetItemSet(), aArgs );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrameLoader > xLoader( (::cppu::OWeakObject*)new PluginLoader(::utl::getProcessServiceFactory()), ::com::sun::star::uno::UNO_QUERY );
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_FILTER_NAME, rMedium.GetFilter()->GetName() ) );
+ USHORT nRet = pFrame->LoadComponent_Impl( aTargetURL, aArgs, xLoader, rMedium.GetItemSet() );
+
+ if ( nRet == RET_NEWTASK )
+ rMedium.GetItemSet()->Put( SfxStringItem( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") ) );
+
+ if ( nRet == RET_OK || nRet == RET_CANCEL )
+ return ERRCODE_ABORT;
+ else if ( nRet == RET_NEWTASK )
+ return ERRCODE_SFX_RESTART;
+ else // nRet == RET_PENDING !
+ return ERRCODE_IO_PENDING;
+ */
+ return ERRCODE_IO_NOTSUPPORTED;
+}
+
+sal_uInt16 SfxPluginFilterContainer::GetFilterCount() const
+{
+ if ( !bInitialized )
+ SAL_CONST_CAST(SfxPluginFilterContainer*, this)->LoadHdl_Impl( 0 );
+ return SfxFilterContainer::GetFilterCount();
+}
+
+IMPL_LINK( SfxPluginFilterContainer, LoadHdl_Impl, void*, pVoid )
+{
+ if ( bInitialized )
+ return 0;
+
+ bInitialized = sal_True;
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::plugin::XPluginManager > xPlugMgr( xMan->createInstance( DEFINE_CONST_UNICODE("com.sun.star.plugin.PluginManager") ), ::com::sun::star::uno::UNO_QUERY );
+ if( xPlugMgr.is() )
+ {
+ // Alle MIME-Types, f"ur die Plugins registriert sind, werden als
+ // Filter registriert
+ ::com::sun::star::uno::Sequence< ::com::sun::star::plugin::PluginDescription > aDescr = xPlugMgr->getPluginDescriptions();
+ const ::com::sun::star::plugin::PluginDescription *pArr = aDescr.getConstArray();
+ for ( sal_uInt16 n=0; n<aDescr.getLength(); n++ )
+ {
+ ::rtl::OUString aExt = pArr[n].Extension;
+ if ( aExt.compareToAscii("*") != 0 )
+ {
+ // Den default-Filter wollen wir nicht, da die Filter dazu
+ // dienen sollen, registrierte PlugIns beim Laden als Dokument
+ // zu erkennen
+
+ String aExtension( aExt );
+
+ // Fix fuer 3.0 PlugIns mit mehreren FileExt.
+ sal_uInt16 nPos = 0;
+ while( (nPos = aExtension.SearchAndReplace(',', ';', nPos)) != STRING_NOTFOUND )
+ ;
+// aExtension.Insert("*.", nPos+1);
+// aExtension.Insert( "*.", 0 );
+ String aPlug = pArr[n].Description;
+ aPlug += DEFINE_CONST_UNICODE(" (PlugIn)");
+ String aEmpty;
+ SfxFilter *pFilter = new SfxFilter( aPlug, aExtension,
+ SFX_FILTER_PLUGIN|SFX_FILTER_IMPORT|SFX_FILTER_EXECUTABLE,
+ 0, String(), aPlug, 0, pArr[n].Mimetype, this, String() );
+ AddFilter( pFilter, GetFilterCount() );
+ }
+ }
+ }
+ else
+ new SfxAsyncServiceErrorHandler_Impl( DEFINE_CONST_UNICODE("PluginManager") );
+
+ return 0;
+}
+
+const SfxFilter* SfxPluginFilterContainer::GetFilter4Protocol( SfxMedium& rMed, SfxFilterFlags nMust, SfxFilterFlags nDont ) const
+{
+ if ( !bInitialized )
+ SAL_CONST_CAST(SfxPluginFilterContainer*, this)->LoadHdl_Impl( 0 );
+ return SfxFilterContainer::GetFilter4Protocol( rMed, nMust, nDont );
+}
+
+
diff --git a/sfx2/source/bastyp/fltfnc.src b/sfx2/source/bastyp/fltfnc.src
new file mode 100644
index 000000000000..453b62e85c65
--- /dev/null
+++ b/sfx2/source/bastyp/fltfnc.src
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltfnc.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "bastyp.hrc"
+#include "helpid.hrc"
+String STR_FILTER_CHANNELON_OFFLINE
+{
+ Text = "Dieses Abonnement soll gem Einstellung im Offline Modus gelesen werden.\n\nDas StarOffice befindet sich aber im Online Modus. Mchten Sie StarOffice jetzt in den Offline Modus umschalten?" ;
+ Text [ english_us ] = "This subscription is set to be read in the offline mode.\n\nStarOffice is presently in the online mode. Switch to offline mode now?" ;
+ Text [ portuguese_brazilian ] = "Dieses Abonnement soll gem Einstellung im Offline Modus gelesen werden.\n\nDas StarOffice befindet sich aber im Online Modus. Mchten Sie StarOffice jetzt in den Offline Modus umschalten?" ;
+ Text [ swedish ] = "Denna prenumeration skall enligt instllningarna lsas i offlinelget.\n\nMen StarOffice r i onlinelge. Vill Du vxla till offlinelget nu?" ;
+ Text [ danish ] = "Dette abonnement skal iflge indstillingerne lses i offlinetilstand.\n\nDit StarOffice befinder sig for tiden i onlinetilstand. Vil du skifte til offlinetilstand nu?" ;
+ Text [ italian ] = "Questa sottoscrizione deve essere letta nel modo offline conformemente all'impostazione. \n\nStarOffice attualmente si trova nel modo online. Volete passare al modo offline?" ;
+ Text [ spanish ] = "Esta suscripcin se debe poder leer en modo desconectado (Offline).\n\nStarOffice se encuentra sin embargo en modo en lnea. Desea cambiar StarOffice al modo desconectado?" ;
+ Text [ french ] = "Cet abonnement ne peut tre lu que hors connexion.\n\nStarOffice est cependant en ligne. Souhaitez-vous dconnecter StarOffice maintenant?" ;
+ Text [ dutch ] = "Dit abonnement moet in offline modus worden gelezen.\n\nStarOffice bevindt zich echter in de online-modus. Wilt u omschakelen naar offline-modus?" ;
+ Text [ portuguese ] = "Esta subscrio foi definida para ser lida em offline.\n\nDe momento o StarOffice encontra-se no modo online. Deseja passar ao modo offline? " ;
+ Text[ chinese_simplified ] = "趨ûʹѻĶģʽ\n\nStarOffice ڴ״̬Ҫ StarOffice תѻģʽ";
+ Text[ russian ] = " , , Offline.\n\nStarOffice Online. StarOffice Offline?";
+ Text[ polish ] = "Wedug ustawie ta subskrypcja ma zosta odczytana w trybie offline.\n\n StarOffice znajduje si w trybie online. Czy przeczy na tryb offline?";
+ Text[ japanese ] = "̍wǂ͵ײ Ӱނł̐ݒɏ]ēǂݎ܂B\n\nStarOffice ݵײ ӰނɂȂĂ܂BStarOffice ײ Ӱނɐ؂芷܂?";
+ Text[ chinese_traditional ] = "ӳ]wϥΪ̨ϥγsu\\ŪҦC\n\nStarOffice {bBuWACzn StarOffice suҦH";
+ Text[ arabic ] = " ߡ ʡ .\n\nStarOffice . StarOffice ";
+ Text[ greek ] = " .\n\n StarOffice ' . ;";
+ Text[ korean ] = "˸û 忡 б ˴ϴ.\n\nStarOffice ¶θԴϴ. ȯϽðڽϱ?";
+ Text[ turkish ] = "Bu yelik, evrimd kipte okunmak zere ayarlanmtr.\n\nStarOffice u an evrimii kipinde. StarOffice, evrimd kipe gesin mi?";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILTER_EXTERNAL
+{
+ Text = "Andere Anwendung" ;
+ Text [ english ] = "Other application" ;
+ Text [ english_us ] = "Other application" ;
+ Text [ portuguese ] = "Outra aplicao" ;
+ Text [ portuguese_brazilian ] = "Andere Anwendung" ;
+ Text [ swedish ] = "Annan tillmpning" ;
+ Text [ danish ] = "Anden applikation" ;
+ Text [ italian ] = "Altra applicazione" ;
+ Text [ spanish ] = "Otra aplicacin" ;
+ Text [ french ] = "Autres applications" ;
+ Text [ dutch ] = "Andere toepassing" ;
+ Text[ chinese_simplified ] = "Ӧó";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Inna aplikacja";
+ Text[ japanese ] = "ق̱ع";
+ Text[ chinese_traditional ] = "䥦ε{";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Ÿ α׷";
+ Text[ turkish ] = "Dier uygulama";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_FILTER_COMPONENT
+{
+ Text = "StarOffice Komponente" ;
+ Text [ english ] = "StarOffice Component" ;
+ Text [ english_us ] = "StarOffice Component" ;
+ Text[ portuguese ] = "Componentes StarOffice";
+ Text[ russian ] = "StarOffice - ";
+ Text[ greek ] = "StarOffice - ";
+ Text[ dutch ] = "StarOffice component";
+ Text[ french ] = "Composants de StarOffice";
+ Text[ spanish ] = "StarOffice Componentes";
+ Text[ italian ] = "Componenti StarOffice";
+ Text[ danish ] = "StarOffice komponent";
+ Text[ swedish ] = "StarOffice-komponent";
+ Text[ polish ] = "Skadnik StarOffice ";
+ Text[ portuguese_brazilian ] = "StarOffice Component";
+ Text[ japanese ] = "StarOffice ߰";
+ Text[ korean ] = "StarOffice Ʈ";
+ Text[ chinese_simplified ] = "StarOffice ";
+ Text[ chinese_traditional ] = "StarOffice ";
+ Text[ arabic ] = " StarOffice";
+ Text[ turkish ] = "StarOffice bileeni";
+};
+
+String STR_FILTER_NOT_INSTALLED
+{
+ Text = "Der ausgewhlte Filter $(FILTER) ist nicht installiert.\nMchten Sie das nachholen ?";
+ Text [ English ] = " The selected filter $(FILTER) has not been installed.\nWould you like to do this now ?";
+ Text[ english_us ] = "The selected filter $(FILTER) has not been installed.\nWould you like to do this now ?";
+ Text[ portuguese ] = "O filtro seleccionado $(FILTER) no est instalado.\nInstalar agora?";
+ Text[ russian ] = " $(FILTER) .\n ?";
+ Text[ dutch ] = "De gekozen filter $(FILTER) is niet genstalleerd.\nWilt u dat nu doen ?";
+ Text[ french ] = "Le filtre $(FILTER) que vous avez slectionn n'est pas install\nSouhaitez-vous l'installer ?";
+ Text[ spanish ] = "El filtro seleccionado $(FILTER) no ha sido instalado.\nDesea instalarlo?";
+ Text[ italian ] = "Il filtro selezionato $(FILTER) non stato instalalto.\nVolete installarlo adesso?";
+ Text[ danish ] = "Det udvalgte filter $(FILTER) er ikke installeret.\nVil du installere det nu?";
+ Text[ swedish ] = "Det utvalda filtret $(FILTER) r inte installerat.\nVill Du gra det nu?";
+ Text[ polish ] = "Wybrany filtr $(FILTER) nie jest zainstalowany.\nCzy to teraz zrobi ?";
+ Text[ portuguese_brazilian ] = "The selected filter $(FILTER) has not been installed.\nWould you like to do this now ?";
+ Text[ japanese ] = "Iꂽ̨$(FILTER)ͲݽİقĂ܂B\nݽİقꂽł?";
+ Text[ chinese_simplified ] = "ѡĹ $(FILTER)ûбװá\nҪװ";
+ Text[ chinese_traditional ] = "zܪLo $(FILTER)٨Sw˦nC\n{bnwˡH";
+ Text[ arabic ] = " $(FILTER) .\n ";
+ Text[ greek ] = " $(FILTER) .\n ;";
+ Text[ korean ] = "õ $(FILTER) ġǾ ʽϴ.\n ġ Ͻðڽϱ ?";
+ Text[ turkish ] = "Seilen $(FILTER) filtresi kurulu deil.\nimdi kurmak ister misiniz ?";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_FILTER_CONSULT_SERVICE
+{
+ Text = "Der ausgewhlte Filter $(FILTER) ist in Ihrer Edition nicht enthalten.\nInformationen zu Bestellmglichkeiten finden Sie auf unserer Homepage.";
+ Text [ English ] = "The selected filter $(FILTER) is not included in your edition.\nOrdering informations can be found on our website.";
+ Text[ english_us ] = "The selected filter $(FILTER) is not included in your edition.\nYou can find information about orders on our homepage.";
+ Text[ portuguese ] = "O filtro seleccionado $(FILTER) no est includo na sua verso.\nEncontrar as informaes necessrias para uma possvel encomenda na nossa pgina principal.";
+ Text[ russian ] = " $(FILTER) .\n .";
+ Text[ dutch ] = "De geselecteerde filter $(FILTER) komt in uw versie niet voor.\nVoor informatie over bestelmogelijkheden zie onze homepage.";
+ Text[ french ] = "Le filtre $(FILTER) que vous avez slectionn n'est pas inclus dans votre version.\nVous trouverez les renseignements ncessaires une ventuelle commande sur notre page d'accueil.";
+ Text[ spanish ] = "El filtro seleccionado $(FILTER) no est incluido en su edicin.\nEn nuestra pgina de Internet encontrar las informaciones para poder pedirlos.";
+ Text[ italian ] = "Il filtro selezionato $(FILTER) non incluso nella vostra versione.\nTroverete informazioni su eventuali ordini sulla nostra home page.";
+ Text[ danish ] = "De udvalgte filter $(FILTER) er ikke indeholdt i din version.\nDu kan finde informationer omkring ordremuligheder p vores hjemmeside.";
+ Text[ swedish ] = "Det utvalda filtret $(FILTER) r inte inkluderat i Din version.\nDu hittar information om bestllningsmjligheter p vr hemsida.";
+ Text[ polish ] = "Wybrany filtr $(FILTER) nie jest zawarty w twoim edytorze. \nInformacje dotyczce zamwienia znajdziesz na naszej stronie macierzystej.";
+ Text[ portuguese_brazilian ] = "The selected filter $(FILTER) is not included in your version.\nPlease contact our sales department.";
+ Text[ japanese ] = "Iꂽ̨$(FILTER)հް̎gpłɊ܂܂Ă܂B\n”\\ȏ͂킪Ђΰ߰Ŏɓ܂B";
+ Text[ chinese_simplified ] = "汾ûṩѡĹ $(FILTER)\nǹ˾ҳṩϢ";
+ Text[ chinese_traditional ] = "oӪ٨SѱzҿܪLo $(FILTER)C\nаѾ\\ڭ̪Ѫwʳn骺TC";
+ Text[ arabic ] = " $(FILTER) .\n .";
+ Text[ greek ] = " $(FILTER) .\n .";
+ Text[ korean ] = " $(FILTER) ʽϴ.\nֹ û ɼ Ȩ ʽÿ.";
+ Text[ turkish ] = "Seilen $(FILTER) filtresi srmnzde bulunmuyor.\nSipari etmek iin gereken bilgileri web sitemizde bulabilirsiniz.";
+ Text[ language_user1 ] = " ";
+};
diff --git a/sfx2/source/bastyp/frmhtml.cxx b/sfx2/source/bastyp/frmhtml.cxx
new file mode 100644
index 000000000000..8ce52764ec2a
--- /dev/null
+++ b/sfx2/source/bastyp/frmhtml.cxx
@@ -0,0 +1,880 @@
+/*************************************************************************
+ *
+ * $RCSfile: frmhtml.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <tools/list.hxx>
+#include <tools/table.hxx>
+
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _HTMLTOKN_H
+#include <svtools/htmltokn.h>
+#endif
+#pragma hdrstop
+
+#include "docinf.hxx"
+
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_ULONGS
+#include <svtools/svstdarr.hxx>
+
+#include "sfx.hrc"
+
+#include "app.hxx"
+#include "frmhtml.hxx"
+#include "fsetobsh.hxx"
+#include "docfile.hxx"
+#include "viewfrm.hxx"
+#include "evntconf.hxx"
+#include "request.hxx"
+#include "fcontnr.hxx"
+#include "sfxtypes.hxx"
+#include "inimgr.hxx"
+
+#define SFX_HTMLFRMSIZE_REL 0x0001
+#define SFX_HTMLFRMSIZE_PERCENT 0x0002
+
+static sal_Char __READONLY_DATA sHTML_SC_yes[] = "YES";
+static sal_Char __READONLY_DATA sHTML_SC_no[] = "NO";
+static sal_Char __READONLY_DATA sHTML_SC_auto[] = "AUTO";
+
+#define HTML_O_READONLY "READONLY"
+#define HTML_O_EDIT "EDIT"
+
+static HTMLOptionEnum __READONLY_DATA aScollingTable[] =
+{
+ { sHTML_SC_yes, ScrollingYes },
+ { sHTML_SC_no, ScrollingNo },
+ { sHTML_SC_auto, ScrollingAuto },
+ { 0, 0 }
+};
+
+SV_IMPL_PTRARR( _SfxFrameHTMLContexts, _SfxFrameHTMLContext* )
+
+long SfxParserDelete_Impl( void* pObj, void* pArg )
+{
+ ((SfxFrameHTMLParser*)pArg )->ReleaseRef();
+ delete (AsynchronLink*)pObj;
+ return 0;
+}
+
+/* */
+
+_SfxFrameHTMLContext::_SfxFrameHTMLContext( const SfxFrameHTMLParser *pParser ) :
+ nFrame( pParser->nFrame ),
+ pFrameSet( pParser->pFrameSet )
+{}
+
+_SfxFrameHTMLContext::~_SfxFrameHTMLContext()
+{}
+
+/* */
+
+void SfxFrameHTMLParser::SaveContext()
+{
+ _SfxFrameHTMLContext *pContext = new _SfxFrameHTMLContext( this );
+ aContextStack.C40_INSERT( _SfxFrameHTMLContext, pContext,
+ aContextStack.Count() );
+}
+
+void SfxFrameHTMLParser::InitContext( SfxFrameSetDescriptor *pFSet )
+{
+ nFrame = 0;
+ pFrameSet = pFSet;
+}
+
+void SfxFrameHTMLParser::RestoreContext()
+{
+ DBG_ASSERT( aContextStack.Count(), "keine Kontexte mehr vorhanden!" )
+ if( !aContextStack.Count() )
+ return;
+
+ _SfxFrameHTMLContext *pContext =
+ aContextStack[ aContextStack.Count()-1 ];
+ aContextStack.Remove( aContextStack.Count()-1, 1 );
+
+ nFrame = pContext->nFrame;
+ pFrameSet = pContext->pFrameSet;
+
+ delete pContext;
+}
+
+/* */
+
+SfxFrameDescriptor *SfxFrameHTMLParser::GetCurrentFrame() const
+{
+ if( !pFrameSet || nFrame >= pFrameSet->GetFrameCount() )
+ return 0;
+ return pFrameSet->GetFrame( nFrame );
+}
+
+void SfxFrameHTMLParser::IncFramePos()
+{
+ if( !pFrameSet || nFrame >= pFrameSet->GetFrameCount() )
+ return;
+ nFrame++;
+}
+
+/* */
+
+void SfxFrameHTMLParser::ParseSizeSpec( const String& rSpec,
+ SvULongs& rSizes,
+ SvUShorts& rAttrs ) const
+{
+ if( !rSpec.Len() )
+ return;
+
+ xub_StrLen nPos = 0, nEnd = 0;
+ while( STRING_NOTFOUND != nEnd )
+ {
+ sal_Unicode c;
+ while ( ( c = rSpec.GetChar(nPos) ) == ' ' || c == '\t' ||
+ c == '\n' || c == '\r' )
+ {
+ nPos++;
+ }
+
+ nEnd = rSpec.Search( ',', nPos );
+
+ String aTmp( rSpec.Copy( nPos, STRING_NOTFOUND==nEnd ? STRING_LEN
+ : nEnd-nPos ) );
+ sal_Int32 nSz = aTmp.ToInt32();
+ if ( nSz == 0L && aTmp.Search('0') == STRING_NOTFOUND )
+ nSz = 1L;
+
+ rSizes.Insert( nSz, rSizes.Count() );
+ USHORT nAttrs = 0;
+ if( STRING_NOTFOUND != aTmp.Search( '*' ) )
+ nAttrs |= SFX_HTMLFRMSIZE_REL;
+ else if( STRING_NOTFOUND != aTmp.Search( '%' ) )
+ nAttrs |= SFX_HTMLFRMSIZE_PERCENT;
+
+ rAttrs.Insert( nAttrs, rAttrs.Count() );
+
+ nPos = nEnd;
+ nPos++;
+ }
+}
+
+void SfxFrameHTMLParser::Continue( int nToken )
+{
+ String sTmpBaseURL( INetURLObject::GetBaseURL() );
+ INetURLObject::SetBaseURL( aBaseURL );
+
+ HTMLParser::Continue( nToken );
+
+ INetURLObject::SetBaseURL( sTmpBaseURL );
+}
+
+/* */
+
+void SfxFrameHTMLParser::NextToken( int nToken )
+{
+ if( bInNoFrames )
+ {
+ switch ( nToken )
+ {
+ case HTML_META:
+ return;
+ break;
+ case HTML_NOFRAMES_OFF:
+ bInNoFrames = FALSE;
+ break;
+ default:
+ break;
+ }
+ }
+
+ switch( nToken )
+ {
+ case HTML_BODY_ON:
+ // Without JavaScript, the cann be ignored.
+ break;
+
+ case HTML_META:
+ if( pDoc )
+ {
+ ParseMetaOptions( GetDocInfo(), pDoc->GetHeaderAttributes() );
+ }
+ break;
+
+ case HTML_TITLE_ON:
+ InsertTitle();
+ break;
+
+ case HTML_BASE:
+ {
+ const HTMLOptions *pOptions = GetOptions();
+ USHORT nArrLen = pOptions->Count();
+
+ for( USHORT i = pOptions->Count(); i; )
+ {
+ const HTMLOption *pOption = (*pOptions)[ --i ];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_HREF:
+ aBaseURL = pOption->GetString();
+// INetURLObject::SetBaseURL( aBaseURL );
+ break;
+ }
+ }
+ }
+ break;
+
+ case HTML_FRAMESET_ON:
+ if( pDocFrameSet )
+ NewFrameSet();
+ else
+ {
+ // es ist ein Frames Dokument
+ bIsFrameDoc = TRUE;
+ eState = SVPAR_ACCEPTED;
+ }
+ break;
+ case HTML_FRAMESET_OFF:
+ if( pDocFrameSet )
+ EndFrameSet();
+ break;
+
+ case HTML_FRAME_ON:
+ if( pDocFrameSet )
+ InsertFrame();
+ break;
+
+ case HTML_NOFRAMES_ON:
+ bInNoFrames = TRUE;
+ break;
+
+ case HTML_APPLET_ON:
+ case HTML_IFRAME_ON:
+ case HTML_LINEBREAK:
+ case HTML_HORZRULE:
+ case HTML_IMAGE:
+ case HTML_EMBED:
+ case HTML_INPUT:
+ case HTML_SELECT_ON:
+ case HTML_TEXTAREA_ON:
+ if( !pDocFrameSet )
+ {
+ // es ist kein Frames Dokument (natuerlich gibt es noch mehr Tags,
+ // aber dies duerften die haeufigsten am Dok-Anfang sein
+ bIsFrameDoc = FALSE;
+ eState = SVPAR_ACCEPTED;
+ }
+ break;
+
+ case HTML_TEXTTOKEN:
+ if( !pDocFrameSet && aToken.Len() &&
+ (aToken.Len() > 1 || ' ' != aToken.GetChar(0)) )
+ {
+ // es ist kein Frames Dokument
+ bIsFrameDoc = FALSE;
+ eState = SVPAR_ACCEPTED;
+ }
+ break;
+ case HTML_SCRIPT_ON:
+ NewScript();
+ break;
+
+ case HTML_SCRIPT_OFF:
+ EndScript();
+ break;
+
+ case HTML_RAWDATA:
+ if( IsReadScript() && !bIgnoreRawData )
+ {
+ if( aScriptSource.Len() )
+ aScriptSource += '\n';
+ aScriptSource += aToken;
+ }
+ break;
+
+// case HTML_UNKNOWNCONTROL_ON:
+// if( IsInHeader() && !aUnknownToken.Len() &&
+// sSaveToken.Len() && '!' != sSaveToken.GetChar(0) )
+// aUnknownToken = sSaveToken;
+// break;
+ }
+}
+
+void SfxFrameHTMLParser::NewScript()
+{
+ BOOL bFinishDownload = FALSE;
+ String aScriptURL;
+ String aScriptType;
+ String aLib, aModule;
+ ParseScriptOptions( aScriptType, eScriptType, aScriptURL,
+ aLib, aModule );
+
+ if( aScriptURL.Len() && HTML_SL_JAVASCRIPT == eScriptType )
+ {
+ // Den Inhalt des Script-Tags ignorieren
+ bIgnoreRawData = TRUE;
+ }
+}
+
+void SfxFrameHTMLParser::EndScript()
+{
+ bIgnoreRawData = FALSE;
+
+ // MIB: 3/3/2000: Scripts a ignored currently?
+ aScriptSource.Erase();
+}
+
+/* */
+
+void SfxFrameHTMLParser::InsertTitle()
+{
+ String aTitle;
+ int nToken;
+ while( HTML_TEXTTOKEN == (nToken = GetNextToken()) && IsParserWorking() )
+ {
+ aTitle += aToken;
+ }
+
+ if( SVPAR_PENDING == GetStatus() )
+ return;
+
+ // Wir sollten jetzt eigentlich auf einem </TITLE> stehen, das wir
+ // aber ignorieren
+ if( HTML_TITLE_OFF != nToken )
+ SkipToken( -1 );
+
+ SfxDocumentInfo *pDocInfo = GetDocInfo();
+ if( aTitle.Len() && pDocInfo && !pDocInfo->GetTitle().Len() )
+ {
+ pDocInfo->SetTitle( aTitle );
+ }
+}
+
+void SfxFrameHTMLParser::NewFrameSet()
+{
+ String aRowSpec, aColSpec;
+ Wallpaper aWallpaper;
+ BOOL bBorder = TRUE;
+ BOOL bBorderSet = FALSE;
+ BOOL bSpacingSet = FALSE;
+ BOOL bBrushSet = FALSE;
+ long nSpacing = 0L;
+
+ // die Optionen holen
+ ScriptType eScriptType = STARBASIC;
+ USHORT nEvent;
+
+ const HTMLOptions *pOptions = GetOptions();
+ USHORT nArrLen = pOptions->Count();
+ for ( USHORT i=0; i<nArrLen; i++ )
+ {
+ BOOL bSetEvent = FALSE;
+ const HTMLOption *pOption = (*pOptions)[i];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_BORDERCOLOR:
+ {
+ Color aColor;
+ pOption->GetColor( aColor );
+ aWallpaper.SetColor( aColor );
+ bBrushSet = TRUE;
+ break;
+ }
+ case HTML_O_ROWS:
+ aRowSpec = pOption->GetString();
+ break;
+ case HTML_O_COLS:
+ aColSpec = pOption->GetString();
+ break;
+ case HTML_O_FRAMEBORDER:
+ {
+ bBorderSet = TRUE;
+ String aStr = pOption->GetString();
+ bBorder = TRUE;
+ if ( aStr.EqualsIgnoreCaseAscii("NO") ||
+ aStr.EqualsIgnoreCaseAscii("0") )
+ bBorder = FALSE;
+ break;
+ }
+ case HTML_O_FRAMESPACING:
+ case HTML_O_BORDER:
+ bSpacingSet = TRUE;
+ nSpacing = pOption->GetNumber();
+ break;
+ case HTML_O_ONLOAD:
+ eScriptType = JAVASCRIPT;
+ case HTML_O_SDONLOAD:
+ nEvent = SFX_EVENT_OPENDOC;
+ bSetEvent = TRUE;
+ break;
+
+ case HTML_O_ONUNLOAD:
+ eScriptType = JAVASCRIPT;
+ case HTML_O_SDONUNLOAD:
+ nEvent = SFX_EVENT_PREPARECLOSEDOC;
+ bSetEvent = TRUE;
+ break;
+
+ case HTML_O_ONFOCUS:
+ eScriptType = JAVASCRIPT;
+ case HTML_O_SDONFOCUS:
+ nEvent = SFX_EVENT_ACTIVATEDOC;
+ bSetEvent = TRUE;
+ break;
+
+ case HTML_O_ONBLUR:
+ eScriptType = JAVASCRIPT;
+ case HTML_O_SDONBLUR:
+ nEvent = SFX_EVENT_DEACTIVATEDOC;
+ bSetEvent = TRUE;
+ break;
+
+ case HTML_O_ONERROR:
+// if( bAnyStarBasic )
+// InsertBasicDocEvent( SFX_EVENT_ACTIVATEDOC,
+// pOption->GetString() );
+ break;
+ }
+
+ if ( bSetEvent )
+ {
+ DBG_ASSERT( pDoc, "Macros im Parser, aber kein Dokument!" );
+ String sEmpty;
+ SFX_APP()->GetEventConfig()->ConfigureEvent( nEvent,
+ SvxMacro( pOption->GetString(), sEmpty, eScriptType ),
+ pDoc );
+ }
+
+ }
+
+ if ( !aRowSpec.Len() && !aColSpec.Len() )
+ {
+ // Netscape l"a\st es zu, da\s keine Gr"o\senangabe erfolgt
+ aRowSpec.AssignAscii( "100%" );
+ }
+
+ // die ROW/COL-Optionen parsen
+ SvULongs aRowSizes;
+ SvUShorts aRowAttrs;
+ ParseSizeSpec( aRowSpec, aRowSizes, aRowAttrs );
+ USHORT nRows = aRowSizes.Count();
+
+ SvULongs aColSizes;
+ SvUShorts aColAttrs;
+ ParseSizeSpec( aColSpec, aColSizes, aColAttrs );
+ USHORT nCols = aColSizes.Count();
+
+ // einen FrameSet anlegen (wenn pFrameSet nicht gesetzt ist, ist dies
+ // das erste <FRAMESET> und wir muessen den Doc-Frameset benutzen)
+ SfxFrameDescriptor *pFrame = GetCurrentFrame();
+ if ( pFrameSet )
+ {
+ while ( !pFrame && aContextStack.Count() )
+ {
+ EndFrameSet();
+ pFrame = GetCurrentFrame();
+ }
+
+ if ( !pFrame )
+ return;
+ }
+
+ SfxFrameSetDescriptor *pNewFrameSet =
+ pFrameSet ? new SfxFrameSetDescriptor( pFrame )
+ : pDocFrameSet;
+
+ // und mit Leben fuellen
+ if( nRows && nCols )
+ {
+ SfxFrameSetDescriptor *pFirst = NULL;
+ for( USHORT i=0; i<nRows; i++ )
+ {
+ pNewFrameSet->SetColSet( FALSE );
+ SfxFrameDescriptor *pNewFrame =
+ new SfxFrameDescriptor( pNewFrameSet );
+ SfxFrameSetDescriptor *pFrameSet =
+ new SfxFrameSetDescriptor( pNewFrame );
+ if ( !pFirst )
+ pFirst = pFrameSet;
+ pFrameSet->SetColSet( TRUE );
+
+ if( (aRowAttrs[i] & SFX_HTMLFRMSIZE_REL) != 0 )
+ pNewFrame->SetWidthRel( aRowSizes[i] );
+ else if( (aRowAttrs[i] & SFX_HTMLFRMSIZE_PERCENT) != 0 )
+ pNewFrame->SetWidthPercent( aRowSizes[i] );
+ else
+ pNewFrame->SetWidthAbs( aRowSizes[i] );
+
+ for( USHORT j=0; j<nCols; j++ )
+ {
+ SfxFrameDescriptor *pFrame =
+ new SfxFrameDescriptor( pFrameSet );
+ if( (aColAttrs[j] & SFX_HTMLFRMSIZE_REL) != 0 )
+ pFrame->SetWidthRel( aColSizes[j] );
+ else if( (aColAttrs[j] & SFX_HTMLFRMSIZE_PERCENT) != 0 )
+ pFrame->SetWidthPercent( aColSizes[j] );
+ else
+ pFrame->SetWidthAbs( aColSizes[j] );
+ }
+ }
+
+ // den aktuellen FrameSet-Kontext retten und einen neuen einstellen
+ if( pNewFrameSet != pDocFrameSet )
+ SaveContext();
+ InitContext( pNewFrameSet );
+ SaveContext();
+ InitContext( pFirst );
+ }
+ else if( nRows || nCols )
+ {
+ USHORT nCount = nRows ? nRows : nCols;
+ pNewFrameSet->SetColSet( nCols != 0 );
+
+ for( USHORT i=0; i<nCount; i++ )
+ {
+ SfxFrameDescriptor *pFrame =
+ new SfxFrameDescriptor( pNewFrameSet );
+ USHORT nAttrs = (nRows ? aRowAttrs[i] : aColAttrs[i] );
+ ULONG nSize = (nRows ? aRowSizes[i] : aColSizes[i] );
+ if( (nAttrs & SFX_HTMLFRMSIZE_REL) != 0 )
+ pFrame->SetWidthRel( nSize );
+ else if( (nAttrs & SFX_HTMLFRMSIZE_PERCENT) != 0 )
+ pFrame->SetWidthPercent( nSize );
+ else
+ pFrame->SetWidthAbs( nSize );
+ }
+
+ // den aktuellen FrameSet-Kontext retten und einen neuen einstellen
+ if( pNewFrameSet != pDocFrameSet )
+ SaveContext();
+ InitContext( pNewFrameSet );
+ }
+
+ if ( bBorderSet )
+ pNewFrameSet->SetFrameBorder( bBorder );
+ if ( bSpacingSet )
+ pNewFrameSet->SetFrameSpacing( nSpacing );
+ if ( bBrushSet )
+ pNewFrameSet->SetWallpaper( aWallpaper );
+}
+
+void SfxFrameHTMLParser::EndFrameSet()
+{
+ if( aContextStack.Count() )
+ {
+ // den vorherigen FrameSet-Kontext wieder herstellen
+ RestoreContext();
+
+ // und zum naechsten Frame gehen
+ IncFramePos();
+ SfxFrameDescriptor *pFrame = GetCurrentFrame();
+ if ( pFrame && pFrame->GetFrameSet() )
+ {
+ SaveContext();
+ InitContext( pFrame->GetFrameSet() );
+ }
+ }
+ else
+ {
+ // der Root-Frameset wird beendet
+ if( pFrameSet )
+ {
+ // "Cursor" aus dem Frameset herausbewegen, damit nichsts
+ // mehr eingefuegt wird.
+ nFrame = pFrameSet->GetFrameCount();
+ }
+ }
+}
+
+void SfxFrameHTMLParser::InsertFrame()
+{
+ // den aktuellen Frame holen (ist nicht da, falls es noch kein
+ // <FRAMESET> gab oder das aktuelle FrameSet schon voll ist
+ SfxFrameDescriptor *pFrame = GetCurrentFrame();
+ while ( !pFrame && aContextStack.Count() )
+ {
+ EndFrameSet();
+ pFrame = GetCurrentFrame();
+ }
+
+ if ( !pFrame )
+ return;
+
+ const HTMLOptions *pOptions = GetOptions();
+ ParseFrameOptions( pFrame, pOptions );
+
+ // und zum naechsten Frame gehen
+ IncFramePos();
+}
+
+void SfxFrameHTMLParser::ParseFrameOptions( SfxFrameDescriptor *pFrame,
+ const HTMLOptions *pOptions )
+{
+ // die Optionen holen und setzen
+ Size aMargin( pFrame->GetMargin() );
+
+ // MIB 15.7.97: Netscape scheint marginwidth auf 0 zu setzen, sobald
+ // marginheight gesetzt wird und umgekehrt. Machen wir jetzt wegen
+ // bug #41665# auch so.
+ // Netscape l"a\st aber ein direktes Setzen auf 0 nicht zu, IE4.0 schon.
+ // Den Bug machen wir nicht mit!
+ BOOL bMarginWidth = FALSE, bMarginHeight = FALSE;
+
+ USHORT nArrLen = pOptions->Count();
+ for ( USHORT i=0; i<nArrLen; i++ )
+ {
+ const HTMLOption *pOption = (*pOptions)[i];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_BORDERCOLOR:
+ {
+ Color aColor;
+ pOption->GetColor( aColor );
+ pFrame->SetWallpaper( Wallpaper( aColor ) );
+ break;
+ }
+ case HTML_O_SRC:
+ pFrame->SetURL( INetURLObject::RelToAbs(pOption->GetString()) );
+ break;
+ case HTML_O_NAME:
+ pFrame->SetName( pOption->GetString() );
+ break;
+ case HTML_O_MARGINWIDTH:
+ aMargin.Width() = pOption->GetNumber();
+
+// if( aMargin.Width() < 1 )
+// aMargin.Width() = 1;
+ if( !bMarginHeight )
+ aMargin.Height() = 0;
+ bMarginWidth = TRUE;
+ break;
+ case HTML_O_MARGINHEIGHT:
+ aMargin.Height() = pOption->GetNumber();
+
+// if( aMargin.Height() < 1 )
+// aMargin.Height() = 1;
+ if( !bMarginWidth )
+ aMargin.Width() = 0;
+ bMarginHeight = TRUE;
+ break;
+ case HTML_O_SCROLLING:
+ pFrame->SetScrollingMode(
+ (ScrollingMode)pOption->GetEnum( aScollingTable,
+ ScrollingAuto ) );
+ break;
+ case HTML_O_FRAMEBORDER:
+ {
+ String aStr = pOption->GetString();
+ BOOL bBorder = TRUE;
+ if ( aStr.EqualsIgnoreCaseAscii("NO") ||
+ aStr.EqualsIgnoreCaseAscii("0") )
+ bBorder = FALSE;
+ pFrame->SetFrameBorder( bBorder );
+ break;
+ }
+ case HTML_O_NORESIZE:
+ pFrame->SetResizable( FALSE );
+ break;
+ default:
+ if ( pOption->GetTokenString().EqualsIgnoreCaseAscii(
+ HTML_O_READONLY ) )
+ {
+ String aStr = pOption->GetString();
+ BOOL bReadonly = TRUE;
+ if ( aStr.EqualsIgnoreCaseAscii("FALSE") )
+ bReadonly = FALSE;
+ pFrame->SetReadOnly( bReadonly );
+ }
+ else if ( pOption->GetTokenString().EqualsIgnoreCaseAscii(
+ HTML_O_EDIT ) )
+ {
+ String aStr = pOption->GetString();
+ BOOL bEdit = TRUE;
+ if ( aStr.EqualsIgnoreCaseAscii("FALSE") )
+ bEdit = FALSE;
+ pFrame->SetEditable( bEdit );
+ }
+
+ break;
+ }
+ }
+
+ pFrame->SetMargin( aMargin );
+}
+
+
+SfxFrameHTMLParser::SfxFrameHTMLParser( SfxMedium& rMedium,
+ SfxFrameSetObjectShell* _pDoc )
+ : SfxHTMLParser( *rMedium.GetInStream(), TRUE, &rMedium ),
+ nLine( 0 ),
+ nFrame( 0 ),
+ pFrameSet( 0 ),
+ pDoc( _pDoc ),
+ pDocFrameSet( 0 ),
+ bIsFrameDoc( FALSE ),
+ bInNoFrames( FALSE ),
+ bIgnoreRawData( FALSE ),
+ eScriptType ( HTML_SL_JAVASCRIPT ),
+ pDeleteLink(0),
+ aBaseURL( pDoc ? pDoc->GetBaseURL() : INetURLObject::GetBaseURL() )
+{
+ SvKeyValueIterator *pHeaderAttrs = pDoc->GetHeaderAttributes();
+ if( pHeaderAttrs )
+ SetEncodingByHTTPHeader( pHeaderAttrs );
+
+ if ( pDoc )
+ {
+ SfxItemSet* pSet = rMedium.GetItemSet();
+ SFX_ITEMSET_ARG(
+ pSet, pLoadRef, SfxRefItem, SID_LOADENVIRONMENT, FALSE);
+ if( pLoadRef )
+ {
+ ((SfxLoadEnvironment*)&pLoadRef->GetValue())->
+ DocumentDetected( _pDoc, ERRCODE_NONE );
+ }
+ pDocFrameSet = pDoc->pDescriptor;
+ }
+}
+
+SfxFrameHTMLParser::SfxFrameHTMLParser( SvStream& rStream,
+ SfxFrameSetObjectShell* _pDoc )
+ : SfxHTMLParser( rStream, TRUE ),
+ nLine( 0 ),
+ nFrame( 0 ),
+ pFrameSet( 0 ),
+ pDoc( _pDoc ),
+ pDocFrameSet( 0 ),
+ bIsFrameDoc( FALSE ),
+ bInNoFrames( FALSE ),
+ eScriptType ( HTML_SL_JAVASCRIPT ),
+ pDeleteLink(0),
+ aBaseURL( pDoc ? pDoc->GetBaseURL() : INetURLObject::GetBaseURL() )
+{
+ // Ohne Medium kann es auch keinen HTTP-Header und damit auch
+ // keine Zeichsatz-Informationen geben!
+ if ( pDoc )
+ {
+ pDocFrameSet = pDoc->pDescriptor;
+ }
+}
+
+SfxFrameHTMLParser::~SfxFrameHTMLParser()
+{
+ if ( pDoc && GetMedium() )
+ {
+ SfxItemSet* pSet = GetMedium()->GetItemSet();
+ const SfxPoolItem *pItem;
+ SfxItemState eItemState = pSet->GetItemState( SID_LOADENVIRONMENT, FALSE, &pItem );
+ SfxLoadEnvironment* pEnv = (SfxLoadEnvironment*)
+ &((const SfxRefItem*)pItem)->GetValue();
+ pEnv->SetDataAvailableLink( Link() );
+ pEnv->DocumentDetected( pDoc, 0 );
+ pSet->ClearItem( SID_LOADENVIRONMENT );
+ pDoc->SetTitle( pDoc->GetDocInfo().GetTitle() );
+ pDoc->ReleaseRef();
+ // FinishedLoading ruft die ViewShell!
+ }
+}
+
+SvParserState SfxFrameHTMLParser::CallParser()
+{
+ // die Base-URL kann durch <BASE> umgeschossen werden
+// String aBaseURL( INetURLObject::GetBaseURL() );
+ if ( pDoc && GetMedium() )
+ {
+ pDoc->AddRef();
+ SfxItemSet* pSet = GetMedium()->GetItemSet();
+ const SfxPoolItem *pItem;
+ SfxItemState eItemState = pSet->GetItemState( SID_LOADENVIRONMENT, FALSE, &pItem );
+ SfxLoadEnvironment* pEnv = (SfxLoadEnvironment*)
+ &((const SfxRefItem*)pItem)->GetValue();
+ pEnv->SetDataAvailableLink( GetAsynchCallLink() );
+ }
+
+ SvParserState eState = HTMLParser::CallParser();
+
+ if ( eState == SVPAR_ACCEPTED && pDoc && GetMedium() )
+ {
+ // DataAvailableLink zur"ucksetzen, damit den keiner mehr aufruft
+ SfxItemSet* pSet = GetMedium()->GetItemSet();
+ const SfxPoolItem *pItem;
+ SfxItemState eItemState = pSet->GetItemState( SID_LOADENVIRONMENT, FALSE, &pItem );
+ SfxLoadEnvironment* pEnv = (SfxLoadEnvironment*)
+ &((const SfxRefItem*)pItem)->GetValue();
+ pEnv->SetDataAvailableLink( Link() );
+ }
+
+// INetURLObject::SetBaseURL( aBaseURL );
+
+ return eState;
+}
+
+SfxDocumentInfo* SfxFrameHTMLParser::GetDocInfo()
+{
+ return pDoc ? &pDoc->GetDocInfo() : NULL;
+}
+
+void SfxFrameHTMLParser::EndParser()
+{
+ AddRef();
+ AsynchronLink* pLink = new AsynchronLink;
+ *pLink = Link( pLink, SfxParserDelete_Impl );
+ pLink->Call( this );
+}
+
+
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
new file mode 100644
index 000000000000..f6dec7efed17
--- /dev/null
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -0,0 +1,582 @@
+/*************************************************************************
+ *
+ * $RCSfile: frmhtmlw.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <so3/iface.hxx>
+#ifndef _INETDEF_HXX
+#include <svtools/inetdef.hxx>
+#endif
+//!(dv) #include <chaos2/cntapi.hxx>
+#pragma hdrstop
+#ifndef _RTL_TENCINFO_H
+#include <rtl/tencinfo.h>
+#endif
+
+#include "docinf.hxx"
+#include "frmhtmlw.hxx"
+#include "fsetobsh.hxx"
+#include "evntconf.hxx"
+#include "frame.hxx"
+#include "app.hxx"
+#include "viewfrm.hxx"
+#include "fsetvwsh.hxx"
+#include "docfile.hxx"
+
+#include "sfx.hrc"
+
+// -----------------------------------------------------------------------
+
+extern sal_Char __FAR_DATA sHTML_META_classification[];
+
+static sal_Char __READONLY_DATA sHTML_SC_yes[] = "YES";
+static sal_Char __READONLY_DATA sHTML_SC_no[] = "NO";
+static sal_Char __READONLY_DATA sHTML_SC_auto[] = "AUTO";
+static sal_Char __READONLY_DATA sHTML_MIME_text_html[] = "text/html; charset=";
+
+static HTMLOutEvent __FAR_DATA aFrameSetEventTable[] =
+{
+ { sHTML_O_SDonload, sHTML_O_onload, SFX_EVENT_OPENDOC },
+ { sHTML_O_SDonunload, sHTML_O_onunload, SFX_EVENT_PREPARECLOSEDOC },
+ { sHTML_O_SDonfocus, sHTML_O_onfocus, SFX_EVENT_ACTIVATEDOC },
+ { sHTML_O_SDonblur, sHTML_O_onblur, SFX_EVENT_DEACTIVATEDOC },
+ { 0, 0, 0 }
+};
+
+#if defined(MAC)
+const sal_Char SfxFrameHTMLWriter::sNewLine[] = "\015";
+#elif defined(UNX)
+const sal_Char SfxFrameHTMLWriter::sNewLine[] = "\012";
+#else
+const sal_Char __FAR_DATA SfxFrameHTMLWriter::sNewLine[] = "\015\012";
+#endif
+
+/* */
+
+SfxFrameHTMLWriter::SfxFrameHTMLWriter() :
+ pStrm( 0 ),
+ nNestCnt( 0 )
+{
+ aFill.Fill( 20, '\t' );
+}
+
+
+SfxFrameHTMLWriter::~SfxFrameHTMLWriter()
+{
+ DBG_ASSERT( !pStrm, "Stream ist noch da!" );
+}
+
+/* */
+
+void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
+ const sal_Char *pIndent,
+ const String& rName,
+ const String& rContent, BOOL bHTTPEquiv,
+ rtl_TextEncoding eDestEnc )
+{
+ rStrm << sNewLine;
+ if( pIndent )
+ rStrm << pIndent;
+
+ ByteString sOut( '<' );
+ (((sOut += sHTML_meta) += ' ')
+ += (bHTTPEquiv ? sHTML_O_httpequiv : sHTML_O_name)) += "=\"";
+ rStrm << sOut.GetBuffer();
+
+ HTMLOutFuncs::Out_String( rStrm, rName, eDestEnc );
+
+ ((sOut = "\" ") += sHTML_O_content) += "=\"";
+ rStrm << sOut.GetBuffer();
+
+ HTMLOutFuncs::Out_String( rStrm, rContent, eDestEnc ) << "\">";
+}
+
+void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm,
+ const SfxDocumentInfo* pInfo,
+ const sal_Char *pIndent,
+ rtl_TextEncoding eDestEnc )
+{
+ const sal_Char *pCharSet =
+ rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
+
+ if( pCharSet )
+ {
+ String aContentType = String::CreateFromAscii( sHTML_MIME_text_html );
+ aContentType.AppendAscii( pCharSet );
+ OutMeta( rStrm, pIndent, sHTML_META_content_type, aContentType, TRUE,
+ eDestEnc );
+ }
+
+ // Titel (auch wenn er leer ist)
+ rStrm << sNewLine;
+ if( pIndent )
+ rStrm << pIndent;
+ HTMLOutFuncs::Out_AsciiTag( rStrm, sHTML_title );
+ if( pInfo )
+ {
+ const String& rTitle = pInfo->GetTitle();
+ if( rTitle.Len() )
+ HTMLOutFuncs::Out_String( rStrm, rTitle, eDestEnc );
+ }
+ HTMLOutFuncs::Out_AsciiTag( rStrm, sHTML_title, FALSE );
+
+ // Target-Frame
+ if( pInfo )
+ {
+ const String& rTarget = pInfo->GetDefaultTarget();
+ if( rTarget.Len() )
+ {
+ rStrm << sNewLine;
+ if( pIndent )
+ rStrm << pIndent;
+
+ ByteString sOut( '<' );
+ (((sOut += sHTML_base) += ' ') += sHTML_O_target) += "=\"";
+ rStrm << sOut.GetBuffer();
+ HTMLOutFuncs::Out_String( rStrm, rTarget, eDestEnc )
+ << "\">";
+ }
+ }
+
+ // Who we are
+ String sGenerator = String::CreateFromAscii( INET_PRODUCTNAME );
+ OutMeta( rStrm, pIndent, sHTML_META_generator, sGenerator, FALSE,
+ eDestEnc );
+
+ if( pInfo )
+ {
+ // Reload
+ if( pInfo->IsReloadEnabled() )
+ {
+ String sContent = String::CreateFromInt32(
+ (sal_Int32)pInfo->GetReloadDelay() );
+
+ const String &rReloadURL = pInfo->GetReloadURL();
+ if( rReloadURL.Len() )
+ {
+ sContent.AppendAscii( ";URL=" );
+ sContent += INetURLObject::AbsToRel(rReloadURL);
+ }
+
+ OutMeta( rStrm, pIndent, sHTML_META_refresh, sContent, TRUE,
+ eDestEnc );
+ }
+
+ // Author
+ const SfxStamp& rCreated = pInfo->GetCreated();
+ const String& rAuthor = rCreated.GetName();
+ if( rAuthor.Len() )
+ OutMeta( rStrm, pIndent, sHTML_META_author, rAuthor, FALSE,
+ eDestEnc );
+
+ // created
+ const DateTime& rCreatedDT = rCreated.GetTime();
+ String sOut(
+ String::CreateFromInt32( (sal_Int32)rCreatedDT.GetDate() ) );
+ (sOut += ';') +=
+ String::CreateFromInt32( (sal_Int32)rCreatedDT.GetTime() );
+ OutMeta( rStrm, pIndent, sHTML_META_created, sOut, FALSE, eDestEnc );
+
+ // changedby
+ const SfxStamp& rChanged = pInfo->GetChanged();
+ const String& rChangedBy = rChanged.GetName();
+ if( rChangedBy.Len() )
+ OutMeta( rStrm, pIndent, sHTML_META_changedby, rChangedBy, FALSE,
+ eDestEnc );
+
+ // changed
+ const DateTime& rChangedDT = rChanged.GetTime();
+ sOut = String::CreateFromInt32( (sal_Int32)rChangedDT.GetDate() );
+ (sOut += ';') +=
+ String::CreateFromInt32( (sal_Int32)rChangedDT.GetTime() );
+ OutMeta( rStrm, pIndent, sHTML_META_changed, sOut, FALSE, eDestEnc );
+
+ // Thema
+ const String& rTheme = pInfo->GetTheme();
+ if( rTheme.Len() )
+ OutMeta( rStrm, pIndent, sHTML_META_classification, rTheme, FALSE,
+ eDestEnc );
+
+ // Beschreibung
+ const String& rComment = pInfo->GetComment();
+ if( rComment.Len() )
+ OutMeta( rStrm, pIndent, sHTML_META_description, rComment, FALSE,
+ eDestEnc);
+
+ // Keywords
+ const String& rKeywords = pInfo->GetKeywords();
+ if( rKeywords.Len() )
+ OutMeta( rStrm, pIndent, sHTML_META_keywords, rKeywords, FALSE,
+ eDestEnc);
+
+ // die Benutzer-Eintraege
+ USHORT nKeys = pInfo->GetUserKeyCount();
+
+ // Leere Eintraege am Ende werden nicht ausgegeben
+ while( nKeys && !pInfo->GetUserKey(nKeys-1).GetWord().Len() )
+ nKeys--;
+
+ for( USHORT i=0; i< nKeys; i++ )
+ {
+ const SfxDocUserKey& rUserKey = pInfo->GetUserKey(i);
+ String aWord( rUserKey.GetWord() );
+ aWord.EraseTrailingChars();
+ if( rUserKey.GetTitle().Len() )
+ OutMeta( rStrm, pIndent, rUserKey.GetTitle(), aWord, FALSE,
+ eDestEnc );
+ }
+ }
+}
+
+
+/* */
+
+ULONG SfxFrameHTMLWriter::Write(
+ SfxFrameSetObjectShell *pDocShell, SvStream& rOut,
+ const SfxFrameSetDescriptor* pSet, BOOL bFlatten, SfxFrame* pTopFrame )
+{
+ if( !pSet ) pSet = pDocShell->GetFrameSetDescriptor();
+
+ // Initalisierung
+ pDoc = pDocShell;
+ pStrm = &rOut;
+ nNestCnt = 0;
+
+ // get text encoding
+ const sal_Char *pCharSet =
+ rtl_getBestMimeCharsetFromTextEncoding( gsl_getSystemTextEncoding() );
+ rtl_TextEncoding eDestEnc = rtl_getTextEncodingFromMimeCharset( pCharSet );
+
+ // Header ausgeben
+ OutHeader( eDestEnc );
+
+ // Frameset augeben
+ Out_FrameSetDescriptor( pSet, bFlatten, pTopFrame, eDestEnc );
+
+ // Footer ausgeben
+ OutFooter();
+
+ // Deinitialisierung
+ pStrm = 0;
+
+ return 0;
+}
+
+/* */
+
+void SfxFrameHTMLWriter::OutHeader( rtl_TextEncoding eDestEnc )
+{
+ // <HTML>
+ // <HEAD>
+ // <TITLE>Titel</TITLE>
+ // </HEAD>
+ HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_html ) << sNewLine;
+ HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head );
+
+ Out_DocInfo( Strm(), &pDoc->GetDocInfo(), "\t", eDestEnc );
+ Strm() << sNewLine;
+ HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head, FALSE ) << sNewLine;
+
+//! OutScript(); // Hier fehlen noch die Scripten im Header
+}
+
+/* */
+
+void SfxFrameHTMLWriter::Out_FrameSetDescriptor(
+ const SfxFrameSetDescriptor *pFSet, BOOL bFlatten, SfxFrame* pTopFrame,
+ rtl_TextEncoding eDestEnc )
+{
+ USHORT i, j;
+
+ ByteString aRows, aCols; // die Rows/Cols-Spezifikationen
+
+ // aus der ersten Line eine ROWS/COLS-Spezifikation erstellen
+ ByteString aSpec;
+ USHORT nFrames = pFSet->GetFrameCount();
+ for( i=0; i<nFrames; i++ )
+ {
+ const SfxFrameDescriptor* pFrame = pFSet->GetFrame( i );
+
+ if( i>0 )
+ aSpec += ',';
+
+ if ( pFrame->GetWidth() != 1 || pFrame->GetSizeSelector() != SIZE_REL )
+ aSpec +=
+ ByteString::CreateFromInt32( (sal_Int32)pFrame->GetWidth() );
+ switch( pFrame->GetSizeSelector() )
+ {
+ case SIZE_PERCENT: aSpec += '%'; break;
+ case SIZE_REL: aSpec += '*'; break;
+ }
+ }
+ if( pFSet->IsColSet() )
+ aCols = aSpec;
+ else
+ aRows = aSpec;
+
+ // <FRAMESET> ausgeben
+ ByteString sOut( '<' );
+ sOut += sHTML_frameset;
+
+ // ROWS/COLS, wie zuvor gesetzt
+ if( aRows.Len() )
+ ((((sOut += ' ') += sHTML_O_rows) += "=\"") += aRows) += '\"';
+ if( aCols.Len() )
+ ((((sOut += ' ') += sHTML_O_cols) += "=\"") += aCols) += '\"';
+
+ // frame border (MS+Netscape-Erweiterung)
+ if ( pFSet->IsFrameBorderSet() )
+ {
+ const sal_Char * pStr =
+ pFSet->IsFrameBorderOn() ? sHTML_SC_yes : sHTML_SC_no;
+ if( pStr )
+ (((sOut += ' ') += sHTML_O_frameborder) += '=') += pStr;
+ }
+
+ // frame spacing (MS-Erweiterung), nur wenn es gesetzt ist
+ // MBA: jetzt in Netscape-Syntax!
+ if ( pFSet->IsFrameSpacingSet() )
+ {
+ long nFrameSpacing = pFSet->GetFrameSpacing();
+ (((sOut += ' ') += sHTML_O_border) += '=')
+ += ByteString::CreateFromInt32( nFrameSpacing );
+ }
+
+ OutNestSpace();
+
+ // frame color (Netscape-Erweiterung)
+ if ( pFSet->GetWallpaper() )
+ {
+ ((sOut += ' ') += sHTML_O_bordercolor) += '=';
+ Strm() << sOut.GetBuffer();
+ HTMLOutFuncs::Out_Color( Strm(), pFSet->GetWallpaper()->GetColor(), eDestEnc );
+ }
+ else
+ Strm() << sOut.GetBuffer();
+
+ if ( pFSet->IsRootFrameSet() )
+ {
+ SfxEventConfiguration* pECfg = SFX_APP()->GetEventConfig();
+ SvxMacroTableDtor *pMacTable =
+ pECfg ? pECfg->GetDocEventTable( pDoc ) : 0;
+
+ if( pMacTable && pMacTable->Count() )
+ HTMLOutFuncs::Out_Events( Strm(), *pMacTable, aFrameSetEventTable,
+ FALSE, eDestEnc ); // BOOL - BASIC schreiben oder nicht
+ }
+
+ Strm() << '>' << sNewLine;
+
+ nNestCnt++; // jetzt sind wir eine Ebene tiefer
+
+ nFrames = pFSet->GetFrameCount();
+ for( j=0; j<nFrames; j++ )
+ {
+ // wenn der Frame in Wirklichkeit ein Frameset ist, geben wir das
+ // Frameset aus und sind fertig
+ SfxFrameDescriptor* pDesc = pFSet->GetFrame(j);
+ SfxFrameSetDescriptor* pSet = pDesc->GetFrameSet();
+ if( pSet && !pSet->IsRootFrameSet() )
+ {
+ Out_FrameSetDescriptor( pSet, bFlatten, pTopFrame, eDestEnc );
+ }
+ else
+ {
+ OutNestSpace();
+ ByteString sOut( '<' );
+ sOut += sHTML_frame;
+ Strm() << sOut.GetBuffer();
+ Out_FrameDescriptor( Strm(), pDesc, bFlatten, pTopFrame, eDestEnc );
+ Strm() << '>' << sNewLine;
+ }
+ }
+
+ nNestCnt--; // und wieder eine Ebene hoeher
+
+ OutNestSpace();
+ HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_frameset, FALSE ) << sNewLine;
+}
+
+String SfxFrameHTMLWriter::CreateDataURL(
+ SfxFrameSetObjectShell *pDoc, const SfxFrameSetDescriptor* pSet,
+ SfxFrame* pTopFrame )
+{
+ SvMemoryStream aStream;
+ SfxFrameHTMLWriter().Write(
+ pDoc, aStream, pSet, TRUE, pTopFrame );
+ // TODO: MAX_STRLEN or USHRT_MAX?
+ ByteString aData( (sal_Char*)aStream.GetData(), (USHORT) Min(
+ (ULONG)USHRT_MAX, aStream.Tell()) );
+ String sEncoded(
+ INetURLObject::encode( aData, INetURLObject::PART_URIC, '%',
+ INetURLObject::ENCODE_ALL ) );
+ String aURL( String::CreateFromAscii("data:text/html,") );
+ aURL += sEncoded;
+ return aURL;
+}
+
+
+String SfxFrameHTMLWriter::CreateURL( SfxFrame* pFrame )
+{
+ String aRet;
+ SfxObjectShell* pShell = pFrame->GetCurrentDocument();
+ SfxViewShell* pView = pFrame->GetCurrentViewFrame()->GetViewShell();
+ if( pView && !pView->IsImplementedAsFrameset_Impl() )
+ {
+ SfxFrameSetViewShell* pFShell = PTR_CAST( SfxFrameSetViewShell, pView );
+ if( pFShell && pFShell->GetDescriptor()->CheckContent() )
+ {
+ SfxFrameSetObjectShell *pFObjShell = PTR_CAST( SfxFrameSetObjectShell, pShell );
+ aRet = CreateDataURL( pFObjShell, pFShell->GetDescriptor(), pFrame );
+ }
+ }
+
+ if( !aRet.Len() && pShell )
+ {
+ aRet = pShell->GetMedium()->GetName();
+//!(dv) CntAnchor::ToPresentationURL( aRet );
+ }
+
+ return aRet;
+}
+
+void SfxFrameHTMLWriter::Out_FrameDescriptor(
+ SvStream& rOut, const SfxFrameDescriptor *pFrame, BOOL bFlatten,
+ SfxFrame* pTopFrame, rtl_TextEncoding eDestEnc )
+{
+ SfxFrameSetDescriptor *pFSet = pFrame->GetFrameSet();
+
+ ByteString sOut;
+
+ String aURL;
+ if( pFSet && pFSet->IsRootFrameSet() && pFSet->CheckContent() && bFlatten)
+ {
+ SfxFrame* pSubFrame = pTopFrame->SearchFrame_Impl(
+ pFrame->GetItemId(), TRUE );
+ SfxFrameSetObjectShell* pSh =
+ (SfxFrameSetObjectShell*)
+ ( pSubFrame ? pSubFrame->GetCurrentDocument() : 0 );
+ if( pSh )
+ aURL = CreateDataURL( pSh, pFSet, pTopFrame );
+ }
+ if( !aURL.Len() ) aURL = bFlatten ? pFrame->GetActualURL().GetMainURL() :
+ pFrame->GetURL().GetMainURL();
+ if( aURL.Len() )
+ {
+ if( !bFlatten ) aURL = INetURLObject::AbsToRel( aURL );
+ ((sOut += ' ') += sHTML_O_src) += "=\"";
+ rOut << sOut.GetBuffer();
+ HTMLOutFuncs::Out_String( rOut, aURL, eDestEnc );
+ sOut = '\"';
+ }
+
+ // der Name (nur wenn der String nicht leer ist)
+ const String& rName = pFrame->GetName();
+ if( rName.Len() )
+ {
+ ((sOut += ' ') += sHTML_O_name) += "=\"";
+ rOut << sOut.GetBuffer();
+ HTMLOutFuncs::Out_String( rOut, rName, eDestEnc );
+ sOut = '\"';
+ }
+
+ // margin width und height; -1 ist der Default-Margin
+ const Size& rMargin = pFrame->GetMargin();
+ if( rMargin.Width() >= 0 )
+ (((sOut += ' ') += sHTML_O_marginwidth) += '=')
+ += ByteString::CreateFromInt32( (sal_Int32)rMargin.Width() );
+ if( rMargin.Height() >= 0 )
+ (((sOut += ' ') += sHTML_O_marginheight) += '=')
+ += ByteString::CreateFromInt32( (sal_Int32)rMargin.Height() );
+
+ // scroll mode
+ const sal_Char *pStr = 0;
+ switch( pFrame->GetScrollingMode() )
+ {
+ case ScrollingYes: pStr = sHTML_SC_yes; break;
+ case ScrollingNo: pStr = sHTML_SC_no; break;
+// case ScrollingAuto: pStr = sHTML_SC_auto; break; // Default !!
+ }
+
+ if( pStr )
+ (((sOut += ' ') += sHTML_O_scrolling) += '=') += pStr;
+
+ // resize
+ if( !pFrame->IsResizable() )
+ (sOut += ' ') += sHTML_O_noresize;
+
+ // frame border (MS+Netscape-Erweiterung)
+ if ( pFrame->IsFrameBorderSet() )
+ {
+ pStr = pFrame->IsFrameBorderOn() ? sHTML_SC_yes : sHTML_SC_no;
+ if( pStr )
+ (((sOut += ' ') += sHTML_O_frameborder) += '=') += pStr;
+ }
+
+ if ( pFrame->GetWallpaper() )
+ {
+ ((sOut += ' ') += sHTML_O_bordercolor) += '=';
+ rOut << sOut.GetBuffer();
+ HTMLOutFuncs::Out_Color( rOut, pFrame->GetWallpaper()->GetColor(), eDestEnc );
+ }
+ else
+ rOut << sOut.GetBuffer();
+}
+
+
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
new file mode 100644
index 000000000000..cd1b4d5e9fde
--- /dev/null
+++ b/sfx2/source/bastyp/helper.cxx
@@ -0,0 +1,673 @@
+/*************************************************************************
+ *
+ * $RCSfile: helper.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "helper.hxx"
+
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HPP_
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SDBC_XROW_HPP_
+#include <com/sun/star/sdbc/XRow.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_COMMANDABORTEDEXCEPTION_HPP_
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_ILLEGALIDENTIFIEREXCEPTION_HPP_
+#include <com/sun/star/ucb/IllegalIdentifierException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_NAMECLASH_HPP_
+#include <com/sun/star/ucb/NameClash.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_NUMBEREDSORTINGINFO_HPP_
+#include <com/sun/star/ucb/NumberedSortingInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_TRANSFERINFO_HPP_
+#include <com/sun/star/ucb/TransferInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XANYCOMPAREFACTORY_HPP_
+#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XCOMMANDINFO_HPP_
+#include <com/sun/star/ucb/XCommandInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XCONTENTACCESS_HPP_
+#include <com/sun/star/ucb/XContentAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XDYNAMICRESULTSET_HPP_
+#include <com/sun/star/ucb/XDynamicResultSet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XSORTEDDYNAMICRESULTSETFACTORY_HPP_
+#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
+#include <com/sun/star/util/DateTime.hpp>
+#endif
+
+#include <tools/ref.hxx>
+#include <tools/debug.hxx>
+#include <tools/urlobj.hxx>
+#include <tools/datetime.hxx>
+#include <vcl/svapp.hxx>
+#include <ucbhelper/content.hxx>
+#include <unotools/processfactory.hxx>
+#include <osl/file.hxx>
+
+using namespace ::ucb;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::sdbc;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::ucb;
+using namespace rtl;
+using namespace utl;
+using namespace osl;
+
+DECLARE_LIST( StringList_Impl, OUString* );
+
+#define CONVERT_DATETIME( aUnoDT, aToolsDT ) \
+ aToolsDT = DateTime( Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ), \
+ Time( aUnoDT.Hours, aUnoDT.Minutes, aUnoDT.Seconds, aUnoDT.HundredthSeconds ) );
+
+void AppendDateTime_Impl( const ::com::sun::star::util::DateTime rDT, String& rRow )
+{
+ DateTime aDT;
+ CONVERT_DATETIME( rDT, aDT );
+ const International& rInter = Application::GetAppInternational();
+ String aDateStr = rInter.GetDate( aDT );
+ aDateStr += String::CreateFromAscii( ", " );
+ aDateStr += rInter.GetTime( aDT );
+ rRow += aDateStr;
+}
+
+// SfxContentHelper ------------------------------------------------------
+
+sal_Bool SfxContentHelper::Transfer_Impl( const String& rSource, const String& rDest, sal_Bool bMoveData, sal_Int32 nNameClash )
+{
+ sal_Bool bRet = sal_True, bKillSource = sal_False;
+ INetURLObject aSourceObj( rSource, INET_PROT_FILE );
+ INetURLObject aDestObj( rDest, INET_PROT_FILE );
+ if ( bMoveData && aSourceObj.GetProtocol() != aDestObj.GetProtocol() )
+ {
+ bMoveData = sal_False;
+ bKillSource = sal_True;
+ }
+ String aName = aDestObj.getName();
+ aDestObj.removeSegment();
+ aDestObj.setFinalSlash();
+
+ try
+ {
+ Content aDestPath( aDestObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ Reference< ::com::sun::star::ucb::XCommandInfo > xInfo = aDestPath.getCommands();
+ OUString aTransferName = OUString::createFromAscii( "transfer" );
+ if ( xInfo->hasCommandByName( aTransferName ) )
+ {
+ aDestPath.executeCommand( aTransferName, makeAny(
+ ::com::sun::star::ucb::TransferInfo( bMoveData, aSourceObj.GetMainURL(), aName, nNameClash ) ) );
+ }
+ else
+ {
+ DBG_ERRORFILE( "transfer command not available" );
+ }
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ bRet = sal_False;
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ bRet = sal_False;
+ }
+
+ if ( bKillSource )
+ SfxContentHelper::Kill( rSource );
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::IsDocument( const String& rContent )
+{
+ sal_Bool bRet = sal_False;
+ INetURLObject aObj( rContent, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ bRet = aCnt.isDocument();
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ::com::sun::star::ucb::IllegalIdentifierException& )
+ {
+ DBG_WARNING( "IllegalIdentifierException" );
+ }
+ catch( ContentCreationException& )
+ {
+ DBG_WARNING( "IllegalIdentifierException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::IsFolder( const String& rContent )
+{
+ sal_Bool bRet = sal_False;
+ INetURLObject aObj( rContent, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ bRet = aCnt.isFolder();
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ::com::sun::star::ucb::IllegalIdentifierException& )
+ {
+ DBG_WARNING( "IllegalIdentifierException" );
+ }
+ catch( ContentCreationException& )
+ {
+ DBG_WARNING( "IllegalIdentifierException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::GetTitle( const String& rContent, String& rTitle )
+{
+ sal_Bool bRet = sal_False;
+ INetURLObject aObj( rContent, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ OUString aTemp;
+ aCnt.getPropertyValue( OUString::createFromAscii( "Title" ) ) >>= aTemp;
+ rTitle = String( aTemp );
+ bRet = sal_True;
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::Kill( const String& rContent )
+{
+ sal_Bool bRet = sal_True;
+ INetURLObject aDeleteObj( rContent, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aDeleteObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ aCnt.executeCommand( OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) );
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ bRet = sal_False;
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ bRet = sal_False;
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+Sequence < OUString > SfxContentHelper::GetFolderContents( const String& rFolder, sal_Bool bFolder )
+{
+ StringList_Impl* pFiles = NULL;
+ INetURLObject aFolderObj( rFolder, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aFolderObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ Reference< XResultSet > xResultSet;
+ Sequence< OUString > aProps(1);
+ OUString* pProps = aProps.getArray();
+ pProps[0] == OUString::createFromAscii( "Url" );
+
+ try
+ {
+ ResultSetInclude eInclude = bFolder ? INCLUDE_FOLDERS_AND_DOCUMENTS : INCLUDE_DOCUMENTS_ONLY;
+ xResultSet = aCnt.createCursor( aProps, eInclude );
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "createCursor: CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "createCursor: Any other exception" );
+ }
+
+ if ( xResultSet.is() )
+ {
+ pFiles = new StringList_Impl;
+ Reference< com::sun::star::ucb::XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
+ try
+ {
+ while ( xResultSet->next() )
+ {
+ OUString aId = xContentAccess->queryContentIdentfierString();
+ OUString* pFile = new OUString( aId );
+ pFiles->Insert( pFile, LIST_APPEND );
+ }
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "XContentAccess::next(): CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "XContentAccess::next(): Any other exception" );
+ }
+ }
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "GetFolderContents: Any other exception" );
+ }
+
+ if ( pFiles )
+ {
+ USHORT nCount = pFiles->Count();
+ Sequence < OUString > aRet( nCount );
+ OUString* pRet = aRet.getArray();
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ OUString* pFile = pFiles->GetObject(i);
+ pRet[i] = *( pFile );
+ delete pFile;
+ }
+ delete pFiles;
+ return aRet;
+ }
+ else
+ return Sequence < OUString > ();
+}
+
+// -----------------------------------------------------------------------
+
+Sequence < OUString > SfxContentHelper::GetFolderContentProperties( const String& rFolder, sal_Bool bFolder )
+{
+ StringList_Impl* pProperties = NULL;
+ INetURLObject aFolderObj( rFolder, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aFolderObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+ Reference< XResultSet > xResultSet;
+ Reference< com::sun::star::ucb::XDynamicResultSet > xDynResultSet;
+ Sequence< OUString > aProps(5);
+ OUString* pProps = aProps.getArray();
+ pProps[0] = OUString::createFromAscii( "Title" );
+ pProps[1] = OUString::createFromAscii( "ContentType" );
+ pProps[2] = OUString::createFromAscii( "Size" );
+ pProps[3] = OUString::createFromAscii( "DateModified" );
+ pProps[4] = OUString::createFromAscii( "IsFolder" );
+
+ try
+ {
+ ResultSetInclude eInclude = bFolder ? INCLUDE_FOLDERS_AND_DOCUMENTS : INCLUDE_DOCUMENTS_ONLY;
+ xDynResultSet = aCnt.createDynamicCursor( aProps, eInclude );
+
+ Reference < com::sun::star::ucb::XAnyCompareFactory > xFactory;
+ Reference < XMultiServiceFactory > xMgr = getProcessServiceFactory();
+ Reference < com::sun::star::ucb::XSortedDynamicResultSetFactory > xSRSFac(
+ xMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SortedDynamicResultSetFactory") ), UNO_QUERY );
+
+ Sequence< com::sun::star::ucb::NumberedSortingInfo > aSortInfo( 2 );
+ com::sun::star::ucb::NumberedSortingInfo* pInfo = aSortInfo.getArray();
+ pInfo[ 0 ].ColumnIndex = 5;
+ pInfo[ 0 ].Ascending = sal_False;
+ pInfo[ 1 ].ColumnIndex = 1;
+ pInfo[ 1 ].Ascending = sal_True;
+
+ Reference< com::sun::star::ucb::XDynamicResultSet > xDynamicResultSet;
+ xDynamicResultSet =
+ xSRSFac->createSortedDynamicResultSet( xDynResultSet, aSortInfo, xFactory );
+ if ( xDynamicResultSet.is() )
+ {
+ sal_Int16 nCaps = xDynamicResultSet->getCapabilities();
+ xResultSet = xDynamicResultSet->getStaticResultSet();
+ }
+
+// if ( xDynResultSet.is() )
+// xResultSet = xDynResultSet->getStaticResultSet();
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "createCursor: CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "createCursor: Any other exception" );
+ }
+
+ if ( xResultSet.is() )
+ {
+ pProperties = new StringList_Impl;
+ Reference< com::sun::star::sdbc::XRow > xRow( xResultSet, UNO_QUERY );
+ Reference< com::sun::star::ucb::XContentAccess > xContentAccess( xResultSet, UNO_QUERY );
+ ULONG nFolderPos = LIST_APPEND;
+
+ try
+ {
+ while ( xResultSet->next() )
+ {
+ String aTitle( xRow->getString(1) );
+ String aType( xRow->getString(2) );
+ sal_Int64 nSize = xRow->getLong(3);
+ ::com::sun::star::util::DateTime aDT = xRow->getTimestamp(4);
+ sal_Bool bFolder = xRow->getBoolean(5);
+
+ String aRow = aTitle;
+ aRow += '\t';
+//! aRow += aType;
+//! aRow += '\t';
+ aRow += String::CreateFromInt64( nSize );
+ aRow += '\t';
+ AppendDateTime_Impl( aDT, aRow );
+ aRow += '\t';
+ aRow += String( xContentAccess->queryContentIdentfierString() );
+ aRow += '\t';
+ aRow += bFolder ? '1' : '0';
+ OUString* pRow = new OUString( aRow );
+ ULONG nPos = LIST_APPEND;
+ if ( bFolder )
+ {
+ if ( LIST_APPEND == nFolderPos )
+ nFolderPos = 0;
+ else
+ nFolderPos++;
+ nPos = nFolderPos;
+ }
+ pProperties->Insert( pRow, nPos );
+ }
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "XContentAccess::next(): CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "XContentAccess::next(): Any other exception" );
+ }
+ }
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "GetFolderContents: Any other exception" );
+ }
+
+ if ( pProperties )
+ {
+ USHORT nCount = pProperties->Count();
+ Sequence < OUString > aRet( nCount );
+ OUString* pRet = aRet.getArray();
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ OUString* pProperty = pProperties->GetObject(i);
+ pRet[i] = *( pProperty );
+ delete pProperty;
+ }
+ delete pProperties;
+ return aRet;
+ }
+ else
+ return Sequence < OUString > ();
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::CopyTo( const String& rSource, const String& rDest )
+{
+ return Transfer_Impl( rSource, rDest, sal_False, NameClash::ERROR );
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::MoveTo( const String& rSource, const String& rDest, sal_Int32 nNameClash )
+{
+ return Transfer_Impl( rSource, rDest, sal_True, nNameClash );
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::MakeFolder( const String& rFolder )
+{
+ INetURLObject aURL( rFolder, INET_PROT_FILE );
+ String aNewFolderURL = aURL.GetMainURL();
+ String aTitle = aURL.getName();
+ aURL.removeSegment();
+ Sequence<OUString> aNames(2);
+ OUString* pNames = aNames.getArray();
+ pNames[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) );
+ pNames[1] = OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) );
+ Sequence<Any> aValues(2);
+ Any* pValues = aValues.getArray();
+ pValues[0] = makeAny( OUString( aTitle ) );
+ pValues[1] = makeAny( sal_Bool( sal_True ) );
+ Reference< ::com::sun::star::ucb::XCommandEnvironment > aCmdEnv;
+ sal_Bool bRet = sal_False;
+ try
+ {
+ Content aCnt( aURL.GetMainURL(), aCmdEnv );
+ Content aNewFolder( aNewFolderURL, aCmdEnv );
+ OUString aType( RTL_CONSTASCII_USTRINGPARAM( "FSysFolder" ) );
+ bRet = aCnt.insertNewContent( aType, aNames, aValues, aNewFolder );
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+ErrCode SfxContentHelper::QueryDiskSpace( const String& rPath, sal_Int64& rFreeBytes )
+{
+ ErrCode nErr = 0;
+ rFreeBytes = 0;
+ INetURLObject aObj( rPath, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ aCnt.getPropertyValue( OUString::createFromAscii( "FreeSpace" ) ) >>= rFreeBytes;
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ nErr = ERRCODE_IO_GENERAL;
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ nErr = ERRCODE_IO_GENERAL;
+ }
+ return nErr;
+}
+
+// -----------------------------------------------------------------------
+
+ULONG SfxContentHelper::GetSize( const String& rContent )
+{
+ ULONG nSize = 0;
+ sal_Int64 nTemp = 0;
+ INetURLObject aObj( rContent, INET_PROT_FILE );
+ try
+ {
+ Content aCnt( aObj.GetMainURL(), Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ aCnt.getPropertyValue( OUString::createFromAscii( "Size" ) ) >>= nTemp;
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+ nSize = (UINT32)nTemp;
+ return nSize;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::IsYounger( const String& rIsYoung, const String& rIsOlder )
+{
+ DateTime aYoungDate, aOlderDate;
+ INetURLObject aYoungObj( rIsYoung, INET_PROT_FILE );
+ INetURLObject aOlderObj( rIsOlder, INET_PROT_FILE );
+ try
+ {
+ Reference< ::com::sun::star::ucb::XCommandEnvironment > aCmdEnv;
+ Content aYoung( aYoungObj.GetMainURL(), aCmdEnv );
+ ::com::sun::star::util::DateTime aTempYoungDate;
+ aYoung.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aTempYoungDate;
+ CONVERT_DATETIME( aTempYoungDate, aYoungDate );
+ Content aOlder( aOlderObj.GetMainURL(), aCmdEnv );
+ ::com::sun::star::util::DateTime aTempOlderDate;
+ aOlder.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aTempOlderDate;
+ CONVERT_DATETIME( aTempOlderDate, aOlderDate );
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+
+ return ( aYoungDate > aOlderDate );
+}
+
+// -----------------------------------------------------------------------
+// please don't use it (only used in appbas.cxx and appcfg.cxx)
+sal_Bool SfxContentHelper::Exists( const String& rContent )
+{
+ INetURLObject aObj( rContent, INET_PROT_FILE );
+ rtl::OUString aTmp( aObj.GetMainURL() );
+ rtl::OUString aResult;
+ if ( FileBase::getNormalizedPathFromFileURL( aTmp, aResult ) == FileBase::E_None )
+ {
+ FileBase::RC err = Directory::create( aResult );
+ if ( err == FileBase::E_EXIST )
+ return sal_True;
+ else
+ Directory::remove( aResult );
+ }
+
+ return sal_False;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Bool SfxContentHelper::Find( const String& rFolder, const String& rName, String& rFile )
+{
+ sal_Bool bRet = sal_False;
+ rtl::OUString aFile;
+ if ( FileBase::searchNormalizedPath( rName, rFolder, aFile ) == FileBase::E_None )
+ {
+ rtl::OUString aResult;
+ FileBase::getFileURLFromNormalizedPath( aFile, aResult );
+ rFile = aResult;
+ bRet = sal_True;
+ }
+
+ return bRet;
+}
+
+
diff --git a/sfx2/source/bastyp/makefile.mk b/sfx2/source/bastyp/makefile.mk
new file mode 100644
index 000000000000..e6fcee81c370
--- /dev/null
+++ b/sfx2/source/bastyp/makefile.mk
@@ -0,0 +1,117 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=bastyp
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES =\
+ $(SLO)$/streams.obj \
+ $(SLO)$/downimpl.obj \
+ $(SLO)$/plugwin.obj \
+ $(SLO)$/downloadcontroller.obj \
+ $(SLO)$/propset.obj \
+ $(SLO)$/itmfac.obj \
+ $(SLO)$/sfxhtml.obj \
+ $(SLO)$/frmhtml.obj \
+ $(SLO)$/frmhtmlw.obj \
+ $(SLO)$/misc.obj \
+ $(SLO)$/idpool.obj \
+ $(SLO)$/progress.obj \
+ $(SLO)$/sfxresid.obj \
+ $(SLO)$/newhdl.obj \
+ $(SLO)$/bitset.obj \
+ $(SLO)$/minarray.obj \
+ $(SLO)$/fltfnc.obj \
+ $(SLO)$/eacopier.obj \
+ $(SLO)$/mieclip.obj \
+ $(SLO)$/fltdlg.obj \
+ $(SLO)$/helper.obj
+
+SRCFILES =\
+ fltdlg.src \
+ fltfnc.src \
+ bastyp.src \
+ newhdl.src
+
+EXCEPTIONSFILES =\
+ $(SLO)$/propset.obj \
+ $(SLO)$/streams.obj \
+ $(SLO)$/downimpl.obj \
+ $(SLO)$/helper.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/bastyp/mieclip.cxx b/sfx2/source/bastyp/mieclip.cxx
new file mode 100644
index 000000000000..1b5b6dccf222
--- /dev/null
+++ b/sfx2/source/bastyp/mieclip.cxx
@@ -0,0 +1,190 @@
+/*************************************************************************
+ *
+ * $RCSfile: mieclip.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#ifndef _CACHESTR_HXX //autogen
+#include <tools/cachestr.hxx>
+#endif
+
+#ifndef _SV_EXCHANGE_HXX //autogen
+#include <vcl/exchange.hxx>
+#endif
+
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _DTRANS_HXX //autogen
+#include <so3/dtrans.hxx>
+#endif
+#ifndef _SOT_FORMATS_HXX //autogen
+#include <sot/formats.hxx>
+#endif
+
+#include <mieclip.hxx>
+#include "sfxuno.hxx"
+
+MSE40HTMLClipFormatObj::~MSE40HTMLClipFormatObj()
+{
+ delete pStrm;
+}
+
+BOOL MSE40HTMLClipFormatObj::GetData( SotDataObject& rObj )
+{
+ SvData aData( SOT_FORMATSTR_ID_HTML_SIMPLE );
+ if( rObj.GetData( &aData ) )
+ return GetData( aData );
+ return FALSE;
+}
+
+BOOL MSE40HTMLClipFormatObj::GetData( SvData& rData )
+{
+ BOOL bRet = FALSE;
+ SvStorageStreamRef xStrm;
+ rData.GetData( (SvStorageStreamRef&)xStrm );
+ if( xStrm.Is() )
+ {
+ ByteString sLine, sVersion;
+ ULONG nStt = 0, nEnd = 0;
+ USHORT nIndex = 0;
+
+ xStrm->Seek(STREAM_SEEK_TO_BEGIN);
+ xStrm->ResetError();
+
+ if( xStrm->ReadLine( sLine ) &&
+ sLine.GetToken( 0, ':', nIndex ) == "Version" )
+ {
+ sVersion = sLine.Copy( nIndex );
+ while( xStrm->ReadLine( sLine ) )
+ {
+ nIndex = 0;
+ ByteString sTmp( sLine.GetToken( 0, ':', nIndex ) );
+ if( sTmp == "StartHTML" )
+ nStt = (ULONG)(sLine.Erase( 0, nIndex ).ToInt32());
+ else if( sTmp == "EndHTML" )
+ nEnd = (ULONG)(sLine.Erase( 0, nIndex ).ToInt32());
+ else if( sTmp == "SourceURL" )
+ sBaseURL = String(S2U(sLine.Erase( 0, nIndex )));
+
+ if( nEnd && nStt &&
+ ( sBaseURL.Len() || xStrm->Tell() >= nStt ))
+ {
+ bRet = TRUE;
+ break;
+ }
+ }
+ }
+
+ if( bRet )
+ {
+ xStrm->Seek( nStt );
+
+ pStrm = new SvCacheStream( ( nEnd - nStt < 0x10000l
+ ? nEnd - nStt + 32
+ : 0 ));
+ *pStrm << *xStrm;
+ pStrm->SetStreamSize( nEnd - nStt );
+ pStrm->Seek( STREAM_SEEK_TO_BEGIN );
+
+ bRet = TRUE;
+ }
+ }
+ return bRet;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+/* $Log: not supported by cvs2svn $
+/* Revision 1.9 2000/09/17 16:47:18 willem.vandorp
+/* OpenOffice header added.
+/*
+/* Revision 1.8 2000/09/06 14:49:46 willem.vandorp
+/* Header and footer replaced.
+/*
+/* Revision 1.7 2000/05/02 09:16:06 as
+/* unicode changes
+/*
+/* Revision 1.6 2000/03/02 19:08:47 jp
+/* Bug #73756#: GetData - Base URL may not be exist
+/*
+/* Revision 1.5 1999/12/16 19:33:27 er
+/* #60614# add: GetData with SvData
+/*
+/* Revision 1.4 1999/01/18 13:36:12 JP
+/* Task #59398#: unnoetiges RegisterClipb... gegen IDS ausgetauscht
+/*
+
+ Rev 1.3 18 Jan 1999 14:36:12 JP
+ Task #59398#: unnoetiges RegisterClipb... gegen IDS ausgetauscht
+
+ Rev 1.2 23 Nov 1998 12:14:26 MBA
+ Fix #56371#: Umstellung TF_ONE51
+
+ Rev 1.1 22 Jun 1998 21:20:44 JP
+ SvDataObject gegen SorDataObject ausgetauscht
+
+ Rev 1.0 18 Feb 1998 17:28:08 OK
+ NEW: MSE40HTMLClipFormatObj
+
+*/
+
diff --git a/sfx2/source/bastyp/minarray.cxx b/sfx2/source/bastyp/minarray.cxx
new file mode 100644
index 000000000000..9bd98fe1fe40
--- /dev/null
+++ b/sfx2/source/bastyp/minarray.cxx
@@ -0,0 +1,766 @@
+/*************************************************************************
+ *
+ * $RCSfile: minarray.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "minarray.hxx"
+
+// -----------------------------------------------------------------------
+
+SfxPtrArr::SfxPtrArr( BYTE nInitSize, BYTE nGrowSize ):
+ nUsed( 0 ),
+ nGrow( nGrowSize ? nGrowSize : 1 ),
+ nUnused( nInitSize )
+{
+ DBG_MEMTEST();
+ USHORT nMSCBug = nInitSize;
+
+ if ( nMSCBug > 0 )
+ pData = new void*[nMSCBug];
+ else
+ pData = 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPtrArr::SfxPtrArr( const SfxPtrArr& rOrig )
+{
+ DBG_MEMTEST();
+ nUsed = rOrig.nUsed;
+ nGrow = rOrig.nGrow;
+ nUnused = rOrig.nUnused;
+
+ if ( rOrig.pData != 0 )
+ {
+ pData = new void*[nUsed+nUnused];
+ memcpy( pData, rOrig.pData, nUsed*sizeof(void*) );
+ }
+ else
+ pData = 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPtrArr::~SfxPtrArr()
+{
+ DBG_MEMTEST();
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPtrArr& SfxPtrArr::operator=( const SfxPtrArr& rOrig )
+{
+ DBG_MEMTEST();
+
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+
+ nUsed = rOrig.nUsed;
+ nGrow = rOrig.nGrow;
+ nUnused = rOrig.nUnused;
+
+ if ( rOrig.pData != 0 )
+ {
+ pData = new void*[nUsed+nUnused];
+ memcpy( pData, rOrig.pData, nUsed*sizeof(void*) );
+ }
+ else
+ pData = 0;
+ return *this;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxPtrArr::Append( void* aElem )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( (nUsed+1) < ( USHRT_MAX / sizeof(void*) ), "array too large" );
+ // musz das Array umkopiert werden?
+ if ( nUnused == 0 )
+ {
+ USHORT nNewSize = (nUsed == 1) ? (nGrow==1 ? 2 : nGrow) : nUsed+nGrow;
+ void** pNewData = new void*[nNewSize];
+ if ( pData )
+ {
+ DBG_ASSERT( nUsed <= nNewSize, "" );
+ memmove( pNewData, pData, sizeof(void*)*nUsed );
+ __DELETE (DEL_ARRAY (nUsed)) pData;
+ }
+ nUnused = nNewSize-nUsed;
+ pData = pNewData;
+ }
+
+ // jetzt hinten in den freien Raum schreiben
+ pData[nUsed] = aElem;
+ ++nUsed;
+ --nUnused;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT SfxPtrArr::Remove( USHORT nPos, USHORT nLen )
+{
+ DBG_MEMTEST();
+ // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird
+ nLen = Min( (USHORT)(nUsed-nPos), nLen );
+
+ // einfache Aufgaben erfordern einfache Loesungen!
+ if ( nLen == 0 )
+ return 0;
+
+ // bleibt vielleicht keiner uebrig
+ if ( (nUsed-nLen) == 0 )
+ {
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ pData = 0;
+ nUsed = 0;
+ nUnused = 0;
+ return nLen;
+ }
+
+ // feststellen, ob das Array dadurch physikalisch schrumpft...
+ if ( (nUnused+nLen) >= nGrow )
+ {
+ // auf die naechste Grow-Grenze aufgerundet verkleinern
+ USHORT nNewUsed = nUsed-nLen;
+ USHORT nNewSize = (nNewUsed+nGrow-1)/nGrow; nNewSize *= nGrow;
+ DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize,
+ "shrink size computation failed" );
+ void** pNewData = new void*[nNewSize];
+ if ( nPos > 0 )
+ {
+ DBG_ASSERT( nPos <= nNewSize, "" );
+ memmove( pNewData, pData, sizeof(void*)*nPos );
+ }
+ if ( nNewUsed != nPos )
+ memmove( pNewData+nPos, pData+nPos+nLen,
+ sizeof(void*)*(nNewUsed-nPos) );
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ pData = pNewData;
+ nUsed = nNewUsed;
+ nUnused = nNewSize - nNewUsed;
+ return nLen;
+ }
+
+ // in allen anderen Faellen nur zusammenschieben
+ if ( nUsed-nPos-nLen > 0 )
+ memmove( pData+nPos, pData+nPos+nLen, (nUsed-nPos-nLen)*sizeof(void*) );
+ nUsed -= nLen;
+ nUnused += nLen;
+ return nLen;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxPtrArr::Remove( void* aElem )
+{
+ DBG_MEMTEST();
+ // einfache Aufgaben ...
+ if ( nUsed == 0 )
+ return FALSE;
+
+ // rueckwaerts, da meist der letzte zuerst wieder entfernt wird
+ void* *pIter = pData + nUsed - 1;
+ for ( USHORT n = 0; n < nUsed; ++n, --pIter )
+ if ( *pIter == aElem )
+ {
+ Remove(nUsed-n-1, 1);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxPtrArr::Replace( void* aOldElem, void* aNewElem )
+{
+ DBG_MEMTEST();
+ // einfache Aufgaben ...
+ if ( nUsed == 0 )
+ return FALSE;
+
+ // rueckwaerts, da meist der letzte zuerst wieder entfernt wird
+ void* *pIter = pData + nUsed - 1;
+ for ( USHORT n = 0; n < nUsed; ++n, --pIter )
+ if ( *pIter == aOldElem )
+ {
+ pData[nUsed-n-1] = aNewElem;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxPtrArr::Contains( const void* rItem ) const
+{
+ DBG_MEMTEST();
+ if ( !nUsed )
+ return FALSE;
+
+ for ( USHORT n = 0; n < nUsed; ++n )
+ {
+ void* p = GetObject(n);
+ if ( p == rItem )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxPtrArr::Insert( USHORT nPos, void* rElem )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( (nUsed+1) < ( USHRT_MAX / sizeof(void*) ), "array too large" );
+ // musz das Array umkopiert werden?
+ if ( nUnused == 0 )
+ {
+ // auf die naechste Grow-Grenze aufgerundet vergroeszern
+ USHORT nNewSize = nUsed+nGrow;
+ void** pNewData = new void*[nNewSize];
+
+ if ( pData )
+ {
+ DBG_ASSERT( nUsed < nNewSize, "" );
+ memmove( pNewData, pData, sizeof(void*)*nUsed );
+ __DELETE (DEL_ARRAY (nUsed)) pData;
+ }
+ nUnused = nNewSize-nUsed;
+ pData = pNewData;
+ }
+
+ // jetzt den hinteren Teil verschieben
+ if ( nPos < nUsed )
+ memmove( pData+nPos+1, pData+nPos, (nUsed-nPos)*sizeof(void*) );
+
+ // jetzt in den freien Raum schreiben
+ memmove( pData+nPos, &rElem, sizeof(void*) );
+ nUsed += 1;
+ nUnused -= 1;
+}
+
+// class ByteArr ---------------------------------------------------------
+
+ByteArr::ByteArr( BYTE nInitSize, BYTE nGrowSize ):
+ nUsed( 0 ),
+ nGrow( nGrowSize ? nGrowSize : 1 ),
+ nUnused( nInitSize )
+{
+ DBG_MEMTEST();
+ USHORT nMSCBug = nInitSize;
+
+ if ( nInitSize > 0 )
+ pData = new char[nMSCBug];
+ else
+ pData = 0;
+}
+
+// -----------------------------------------------------------------------
+
+ByteArr::ByteArr( const ByteArr& rOrig )
+{
+ DBG_MEMTEST();
+ nUsed = rOrig.nUsed;
+ nGrow = rOrig.nGrow;
+ nUnused = rOrig.nUnused;
+
+ if ( rOrig.pData != 0 )
+ {
+ pData = new char[nUsed+nUnused];
+ memcpy( pData, rOrig.pData, nUsed*sizeof(char) );
+ }
+ else
+ pData = 0;
+}
+
+// -----------------------------------------------------------------------
+
+ByteArr::~ByteArr()
+{
+ DBG_MEMTEST();
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+}
+
+// -----------------------------------------------------------------------
+
+ByteArr& ByteArr::operator=( const ByteArr& rOrig )
+{
+ DBG_MEMTEST();
+
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+
+ nUsed = rOrig.nUsed;
+ nGrow = rOrig.nGrow;
+ nUnused = rOrig.nUnused;
+
+ if ( rOrig.pData != 0 )
+ {
+ pData = new char[nUsed+nUnused];
+ memcpy( pData, rOrig.pData, nUsed*sizeof(char) );
+ }
+ else
+ pData = 0;
+ return *this;
+}
+
+// -----------------------------------------------------------------------
+
+void ByteArr::Append( char aElem )
+{
+ DBG_MEMTEST();
+ // musz das Array umkopiert werden?
+ if ( nUnused == 0 )
+ {
+ USHORT nNewSize = (nUsed == 1) ? (nGrow==1 ? 2 : nGrow) : nUsed+nGrow;
+ char* pNewData = new char[nNewSize];
+ if ( pData )
+ {
+ DBG_ASSERT( nUsed <= nNewSize, "" );
+ memmove( pNewData, pData, sizeof(char)*nUsed );
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ }
+ nUnused = nNewSize-nUsed;
+ pData = pNewData;
+ }
+
+ // jetzt hinten in den freien Raum schreiben
+ pData[nUsed] = aElem;
+ ++nUsed;
+ --nUnused;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ByteArr::Remove( USHORT nPos, USHORT nLen )
+{
+ DBG_MEMTEST();
+ // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird
+ nLen = Min( (USHORT)(nUsed-nPos), nLen );
+
+ // einfache Aufgaben erfordern einfache Loesungen!
+ if ( nLen == 0 )
+ return 0;
+
+ // bleibt vielleicht keiner uebrig
+ if ( (nUsed-nLen) == 0 )
+ {
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ pData = 0;
+ nUsed = 0;
+ nUnused = 0;
+ return nLen;
+ }
+
+ // feststellen, ob das Array dadurch physikalisch schrumpft...
+ if ( (nUnused+nLen) >= nGrow )
+ {
+ // auf die naechste Grow-Grenze aufgerundet verkleinern
+ USHORT nNewUsed = nUsed-nLen;
+ USHORT nNewSize = (nNewUsed+nGrow-1)/nGrow; nNewSize *= nGrow;
+ DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize,
+ "shrink size computation failed" );
+ char* pNewData = new char[nNewSize];
+ if ( nPos > 0 )
+ {
+ DBG_ASSERT( nPos <= nNewSize, "" );
+ memmove( pNewData, pData, sizeof(char)*nPos );
+ }
+ if ( nNewUsed != nPos )
+ memmove( pNewData+nPos, pData+nPos+nLen,
+ sizeof(char)*(nNewUsed-nPos) );
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ pData = pNewData;
+ nUsed = nNewUsed;
+ nUnused = nNewSize - nNewUsed;
+ return nLen;
+ }
+
+ // in allen anderen Faellen nur zusammenschieben
+ if ( nUsed-nPos-nLen > 0 )
+ memmove( pData+nPos, pData+nPos+nLen, (nUsed-nPos-nLen)*sizeof(char) );
+ nUsed -= nLen;
+ nUnused += nLen;
+ return nLen;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ByteArr::Remove( char aElem )
+{
+ DBG_MEMTEST();
+ // einfache Aufgaben ...
+ if ( nUsed == 0 )
+ return FALSE;
+
+ // rueckwaerts, da meist der letzte zuerst wieder entfernt wird
+ char *pIter = pData + nUsed - 1;
+ for ( USHORT n = 0; n < nUsed; ++n, --pIter )
+ if ( *pIter == aElem )
+ {
+ Remove(nUsed-n-1, 1);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ByteArr::Contains( const char rItem ) const
+{
+ DBG_MEMTEST();
+ if ( !nUsed )
+ return FALSE;
+
+ for ( USHORT n = 0; n < nUsed; ++n )
+ {
+ char p = GetObject(n);
+ if ( p == rItem )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void ByteArr::Insert( USHORT nPos, char rElem )
+{
+ DBG_MEMTEST();
+ // musz das Array umkopiert werden?
+ if ( nUnused == 0 )
+ {
+ // auf die naechste Grow-Grenze aufgerundet vergroeszern
+ USHORT nNewSize = nUsed+nGrow;
+ char* pNewData = new char[nNewSize];
+
+ if ( pData )
+ {
+ DBG_ASSERT( nUsed < nNewSize, "" );
+ memmove( pNewData, pData, sizeof(char)*nUsed );
+ __DELETE (DEL_ARRAY (nUsed)) pData;
+ }
+ nUnused = nNewSize-nUsed;
+ pData = pNewData;
+ }
+
+ // jetzt den hinteren Teil verschieben
+ if ( nPos < nUsed )
+ memmove( pData+nPos+1, pData+nPos, (nUsed-nPos)*sizeof(char) );
+
+ // jetzt in den freien Raum schreiben
+ memmove( pData+nPos, &rElem, sizeof(char) );
+ nUsed += 1;
+ nUnused -= 1;
+}
+
+// -----------------------------------------------------------------------
+
+char ByteArr::operator[]( USHORT nPos ) const
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nPos < nUsed, "" );
+ return *(pData+nPos);
+}
+
+// -----------------------------------------------------------------------
+
+char& ByteArr::operator [] (USHORT nPos)
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nPos < nUsed, "" );
+ return *(pData+nPos);
+}
+
+// class WordArr ---------------------------------------------------------
+
+WordArr::WordArr( BYTE nInitSize, BYTE nGrowSize ):
+ nUsed( 0 ),
+ nGrow( nGrowSize ? nGrowSize : 1 ),
+ nUnused( nInitSize )
+{
+ DBG_MEMTEST();
+ USHORT nMSCBug = nInitSize;
+
+ if ( nInitSize > 0 )
+ pData = new short[nMSCBug];
+ else
+ pData = 0;
+}
+
+// -----------------------------------------------------------------------
+
+WordArr::WordArr( const WordArr& rOrig )
+{
+ DBG_MEMTEST();
+ nUsed = rOrig.nUsed;
+ nGrow = rOrig.nGrow;
+ nUnused = rOrig.nUnused;
+
+ if ( rOrig.pData != 0 )
+ {
+ pData = new short[nUsed+nUnused];
+ memcpy( pData, rOrig.pData, nUsed*sizeof(short) );
+ }
+ else
+ pData = 0;
+}
+
+// -----------------------------------------------------------------------
+
+WordArr::~WordArr()
+{
+ DBG_MEMTEST();
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+}
+
+// -----------------------------------------------------------------------
+
+WordArr& WordArr::operator=( const WordArr& rOrig )
+{
+ DBG_MEMTEST();
+
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+
+ nUsed = rOrig.nUsed;
+ nGrow = rOrig.nGrow;
+ nUnused = rOrig.nUnused;
+
+ if ( rOrig.pData != 0 )
+ {
+ pData = new short[nUsed+nUnused];
+ memcpy( pData, rOrig.pData, nUsed*sizeof(short) );
+ }
+ else
+ pData = 0;
+ return *this;
+}
+
+// -----------------------------------------------------------------------
+
+void WordArr::Append( short aElem )
+{
+ DBG_MEMTEST();
+ // musz das Array umkopiert werden?
+ if ( nUnused == 0 )
+ {
+ USHORT nNewSize = (nUsed == 1) ? (nGrow==1 ? 2 : nGrow) : nUsed+nGrow;
+ short* pNewData = new short[nNewSize];
+ if ( pData )
+ {
+ DBG_ASSERT( nUsed <= nNewSize, " " );
+ memmove( pNewData, pData, sizeof(short)*nUsed );
+ __DELETE (DEL_ARRAY (nUsed)) pData;
+ }
+ nUnused = nNewSize-nUsed;
+ pData = pNewData;
+ }
+
+ // jetzt hinten in den freien Raum schreiben
+ pData[nUsed] = aElem;
+ ++nUsed;
+ --nUnused;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT WordArr::Remove( USHORT nPos, USHORT nLen )
+{
+ DBG_MEMTEST();
+ // nLen adjustieren, damit nicht ueber das Ende hinaus geloescht wird
+ nLen = Min( (USHORT)(nUsed-nPos), nLen );
+
+ // einfache Aufgaben erfordern einfache Loesungen!
+ if ( nLen == 0 )
+ return 0;
+
+ // bleibt vielleicht keiner uebrig
+ if ( (nUsed-nLen) == 0 )
+ {
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ pData = 0;
+ nUsed = 0;
+ nUnused = 0;
+ return nLen;
+ }
+
+ // feststellen, ob das Array dadurch physikalisch schrumpft...
+ if ( (nUnused+nLen) >= nGrow )
+ {
+ // auf die naechste Grow-Grenze aufgerundet verkleinern
+ USHORT nNewUsed = nUsed-nLen;
+ USHORT nNewSize = (nNewUsed+nGrow-1)/nGrow; nNewSize *= nGrow;
+ DBG_ASSERT( nNewUsed <= nNewSize && nNewUsed+nGrow > nNewSize,
+ "shrink size computation failed" );
+ short* pNewData = new short[nNewSize];
+ if ( nPos > 0 )
+ {
+ DBG_ASSERT( nPos <= nNewSize, "" );
+ memmove( pNewData, pData, sizeof(short)*nPos );
+ }
+ if ( nNewUsed != nPos )
+ memmove( pNewData+nPos, pData+nPos+nLen,
+ sizeof(short)*(nNewUsed-nPos) );
+ __DELETE (DEL_ARRAY (nUsed+nUnused)) pData;
+ pData = pNewData;
+ nUsed = nNewUsed;
+ nUnused = nNewSize - nNewUsed;
+ return nLen;
+ }
+
+ // in allen anderen Faellen nur zusammenschieben
+ if ( nUsed-nPos-nLen > 0 )
+ memmove( pData+nPos, pData+nPos+nLen, (nUsed-nPos-nLen)*sizeof(short) );
+ nUsed -= nLen;
+ nUnused += nLen;
+ return nLen;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WordArr::Remove( short aElem )
+{
+ DBG_MEMTEST();
+ // einfache Aufgaben ...
+ if ( nUsed == 0 )
+ return FALSE;
+
+ // rueckwaerts, da meist der letzte zuerst wieder entfernt wird
+ short *pIter = pData + nUsed - 1;
+ for ( USHORT n = 0; n < nUsed; ++n, --pIter )
+ if ( *pIter == aElem )
+ {
+ Remove(nUsed-n-1, 1);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WordArr::Contains( const short rItem ) const
+{
+ DBG_MEMTEST();
+ if ( !nUsed )
+ return FALSE;
+
+ for ( USHORT n = 0; n < nUsed; ++n )
+ {
+ short p = GetObject(n);
+ if ( p == rItem )
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void WordArr::Insert( USHORT nPos, short rElem )
+{
+ DBG_MEMTEST();
+ // musz das Array umkopiert werden?
+ if ( nUnused == 0 )
+ {
+ // auf die naechste Grow-Grenze aufgerundet vergroeszern
+ USHORT nNewSize = nUsed+nGrow;
+ short* pNewData = new short[nNewSize];
+
+ if ( pData )
+ {
+ DBG_ASSERT( nUsed < nNewSize, "" );
+ memmove( pNewData, pData, sizeof(short)*nUsed );
+ __DELETE (DEL_ARRAY (nUsed)) pData;
+ }
+ nUnused = nNewSize-nUsed;
+ pData = pNewData;
+ }
+
+ // jetzt den hinteren Teil verschieben
+ if ( nPos < nUsed )
+ memmove( pData+nPos+1, pData+nPos, (nUsed-nPos)*sizeof(short) );
+
+ // jetzt in den freien Raum schreiben
+ memmove( pData+nPos, &rElem, sizeof(short) );
+ nUsed += 1;
+ nUnused -= 1;
+}
+
+// -----------------------------------------------------------------------
+
+short WordArr::operator[]( USHORT nPos ) const
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nPos < nUsed, "" );
+ return *(pData+nPos);
+}
+
+// -----------------------------------------------------------------------
+
+short& WordArr::operator [] (USHORT nPos)
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nPos < nUsed, "" );
+ return *(pData+nPos);
+}
+
+
diff --git a/sfx2/source/bastyp/misc.cxx b/sfx2/source/bastyp/misc.cxx
new file mode 100644
index 000000000000..47d9b462bd16
--- /dev/null
+++ b/sfx2/source/bastyp/misc.cxx
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ * $RCSfile: misc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "sfxtypes.hxx"
+
+//--------------------------------------------------------------------
+
+#if defined(DBG_UTIL) && ( defined(WNT) || defined(OS2) )
+unsigned SfxStack::nLevel = 0;
+#endif
+
+//--------------------------------------------------------------------
+
+String SearchAndReplace( const String &rSource,
+ const String &rToReplace,
+ const String &rReplacement )
+{
+ String aTarget( rSource );
+ USHORT nPos = rSource.Search( rToReplace );
+ if ( nPos != STRING_NOTFOUND )
+ {
+ aTarget.Erase( nPos, rToReplace.Len() );
+ return aTarget.Insert( rReplacement, nPos );
+ }
+ return rSource;
+}
+
+//--------------------------------------------------------------------
+
+String SfxStringEncode( const String &rSource, const char *pKey )
+{
+ String aRet;
+ String aCoded(rSource);
+/*ASMUSS
+ // codieren
+ USHORT nCode = 0;
+ for ( USHORT n1 = 0; n1 < aCoded.Len(); ++n1 )
+ {
+ aCoded[n1] ^= pKey[nCode];
+ if ( !pKey[++nCode] )
+ nCode = 0;
+ }
+
+ // als reine Buchstabenfolge darstellen
+ for ( USHORT n2 = 0; n2 < aCoded.Len(); ++n2 )
+ {
+ aRet += (char) ( 'a' + ((aCoded[n2] & 0xF0) >> 4) );
+ aRet += (char) ( 'a' + (aCoded[n2] & 0xF) );
+ }
+*/
+ return aRet;
+}
+
+//--------------------------------------------------------------------
+
+String SfxStringDecode( const String &rSource, const char *pKey )
+{
+ // Output-Buffer aufbereiten
+ String aRet;/*ASMUSS
+ aRet.AllocStrBuf( rSource.Len() / 2 );
+
+ // Buchstabenfolge in normale Zeichen wandeln
+ USHORT nTo = 0;
+ for ( USHORT n1 = 0; n1 < rSource.Len(); n1 += 2)
+ aRet[nTo++] = (unsigned char)
+ ( ( ( rSource[n1] - 'a' ) << 4 ) +
+ ( ( rSource[ USHORT(n1+1) ] - 'a' ) ) );
+
+ // decodieren
+ USHORT nCode = 0;
+ for ( USHORT n2 = 0; n2 < aRet.Len(); ++n2 )
+ {
+ aRet[n2] ^= pKey[nCode];
+ if ( !pKey[++nCode] )
+ nCode = 0;
+ }
+*/
+ return aRet;
+}
+
+
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
new file mode 100644
index 000000000000..fa63434a23a3
--- /dev/null
+++ b/sfx2/source/bastyp/progress.cxx
@@ -0,0 +1,849 @@
+/*************************************************************************
+ *
+ * $RCSfile: progress.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "appdata.hxx"
+
+#ifndef _SBX_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#pragma hdrstop
+
+#include "progress.hxx"
+#include "viewfrm.hxx"
+#include "ipfrm.hxx"
+#include "viewsh.hxx"
+#include "objsh.hxx"
+#include "app.hxx"
+#include "stbmgr.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "docfile.hxx"
+#include <workwin.hxx>
+
+#include <time.h>
+
+struct SfxProgress_Impl :
+ public SfxCancellable
+{
+ String aText, aStateText;
+ ULONG nMax;
+ clock_t nCreate;
+ clock_t nNextReschedule;
+ BOOL bLocked, bAllDocs;
+ BOOL bWaitMode;
+ BOOL bAllowRescheduling;
+ BOOL bRunning;
+ BOOL bIsStatusText;
+
+ SfxProgress* pActiveProgress;
+ SfxObjectShellRef xObjSh;
+ SfxStatusBarManager* pMgr;
+ SfxApplication* pApp;
+ SfxWorkWindow* pWorkWin;
+
+ SfxProgress_Impl( const String& );
+
+};
+
+//========================================================================
+
+#define TIMEOUT_PROGRESS 5L /* 10th s */
+#define MAXPERCENT_PROGRESS 33
+
+#define TIMEOUT_RESCHEDULE 10L /* 10th s */
+#define MAXPERCENT_RESCHEDULE 50
+
+#define Progress
+#include "sfxslots.hxx"
+
+#define aTypeLibInfo aProgressTypeLibImpl
+
+//========================================================================
+
+inline ULONG Get10ThSec()
+{
+#if defined (MSC) && defined (WIN)
+ ULONG n10Ticks = 10 * (ULONG)GetTickCount();
+#else
+ ULONG n10Ticks = 10 * (ULONG)clock();
+#endif
+
+ return n10Ticks / CLOCKS_PER_SEC;
+}
+
+// -----------------------------------------------------------------------
+
+void Enable_Impl(SfxObjectShell *pDoc, BOOL bEnable)
+{
+ SfxViewFrame *pFrame= SfxViewFrame::GetFirst(pDoc);
+ while ( pFrame )
+ {
+ pFrame->Enable(bEnable);
+ if ( pDoc )
+ pFrame->GetDispatcher()->Lock( !bEnable );
+ pFrame = SfxViewFrame::GetNext(*pFrame, pDoc);
+ }
+
+ if ( pDoc )
+ {
+ SfxFrame* pFrm = pDoc->GetMedium()->GetLoadTargetFrame();
+ pFrame = pFrm ? pFrm->GetCurrentViewFrame() : NULL;
+ if ( pFrame )
+ {
+ pFrame->Enable( bEnable );
+ pFrame->GetDispatcher()->Lock( !bEnable );
+ }
+ }
+ else
+ SFX_APP()->LockDispatcher( !bEnable );
+}
+
+// -----------------------------------------------------------------------
+
+SfxProgress_Impl::SfxProgress_Impl( const String &rTitle )
+ : SfxCancellable( ( pApp = SFX_APP(), pApp->GetCancelManager() ), rTitle ),
+ pActiveProgress( 0 )
+
+{
+}
+
+// -----------------------------------------------------------------------
+
+SfxProgress::SfxProgress
+(
+ SfxObjectShell* pObjSh, /* SfxObjectShell, an der die Aktion ausgef"uhrt
+ wird. Kann NULL sein, dann wird die Applikation
+ verwendet */
+
+ const String& rText, /* Text, der in der Statuszeile vor den Statusmonitor
+ erscheint */
+
+ ULONG nRange, /* Maximalwert des Bereiches */
+
+ BOOL bAll /* alle Dokumente oder nur das Dokument des ViewFrames
+ disablen (FALSE) */
+ ,BOOL bWait /* initial den Wait-Pointer aktivieren (TRUE) */
+)
+
+/* [Beschreibung]
+
+ Der Konstruktor der Klasse SfxProgress schaltet den als Parameter
+ "ubergebenen SfxObjectShell und SfxViewFrames, welche dieses Dokument
+ anzeigen in einen Progress-Mode. D.h. solange eine dieser SfxViewFrame
+ Instanzen aktiv ist, ist der dazugeh"orige SfxDispatcher und das
+ dazugeh"orige Window disabled. In der Statuszeile wird ein Balken zur
+ Fortschritts-Anzeige angezeigt.
+*/
+
+: nVal(0),
+ bSuspended(TRUE),
+ pImp( new SfxProgress_Impl( rText ) )
+{
+ pImp->bRunning = TRUE;
+ pImp->bAllowRescheduling = Application::IsInExecute();;
+
+ pImp->xObjSh = pObjSh;
+ pImp->aText = rText;
+ pImp->nMax = nRange;
+ pImp->bLocked = FALSE;
+ pImp->bWaitMode = bWait;
+ pImp->bIsStatusText = FALSE;
+ pImp->nCreate = Get10ThSec();
+ pImp->nNextReschedule = pImp->nCreate;
+ DBG( DbgOutf( "SfxProgress: created for '%s' at %luds",
+ rText.GetBuffer(), pImp->nCreate ) );
+ pImp->bAllDocs = bAll;
+ //pImp->pApp = SFX_APP();
+ pImp->pMgr = 0;
+ pImp->pWorkWin = 0;
+
+ pImp->pActiveProgress = GetActiveProgress( pObjSh );
+ if ( pObjSh )
+ pObjSh->SetProgress_Impl(this);
+ else if( !pImp->pActiveProgress )
+ pImp->pApp->SetProgress_Impl(this);
+ Resume();
+}
+
+// -----------------------------------------------------------------------
+
+SfxProgress::~SfxProgress()
+
+/* [Beschreibung]
+
+ Der Destruktor der Klasse SfxProgress restauriert den alten Zustand;
+ die Dokumente werden wieder freigeschaltet und die Statuszeile zeigt
+ wieder Items an.
+*/
+
+{
+ Stop();
+ if( pImp->bIsStatusText == TRUE )
+ GetpApp()->HideStatusText( );
+ delete pImp;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::Stop()
+
+/* [Beschreibung]
+
+ Vorzeitiges Beenden des <SfxProgress>.
+*/
+
+{
+ if( pImp->pActiveProgress ) return;
+ if ( !pImp->bRunning )
+ return;
+ pImp->bRunning = FALSE;
+ DBG( DbgOutf( "SfxProgress: destroyed at %luds", Get10ThSec() ) );
+
+ Suspend();
+ if ( pImp->xObjSh.Is() )
+ pImp->xObjSh->SetProgress_Impl(0);
+ else
+ pImp->pApp->SetProgress_Impl(0);
+ if ( pImp->bLocked )
+ {
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ Enable_Impl(pImp->xObjSh, TRUE);
+ }
+ else
+ {
+ Enable_Impl(0, TRUE);
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::SetText
+(
+ const String& rText /* neuer Text */
+)
+
+/* [Beschreibung]
+
+ "Andert den Text, der links neben dem Fortschritts-Balken
+ angezeigt wird.
+*/
+
+{
+ if( pImp->pActiveProgress ) return;
+ if ( pImp->pMgr && pImp->pMgr->IsProgressMode() )
+ {
+ pImp->pMgr->EndProgressMode();
+ pImp->aText = rText;
+ pImp->pMgr->StartProgressMode( pImp->aText, pImp->nMax );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+const String& SfxProgress::GetStateText_Impl() const
+{
+ return pImp->aStateText;
+}
+
+// -----------------------------------------------------------------------
+/*
+IMPL_STATIC_LINK( SfxProgress, SetStateHdl, PlugInLoadStatus*, pStatus )
+{
+ INetRequest* pReq = 0;
+ const INetHint *pHint = PTR_CAST( INetHint, pStatus->pHint );
+ pReq = PTR_CAST( INetRequest, pStatus->pBC );
+
+ String aString;
+ if( pReq )
+ aString = SfxMedium::GetStatusString( pHint->GetId(), pReq, pHint );
+ if( aString.Len() )
+ {
+ GetpApp()->ShowStatusText( aString );
+ if( pThis )
+ pThis->pImp->bIsStatusText = TRUE;
+ }
+ return 0;
+}
+*/
+
+// -----------------------------------------------------------------------
+
+// muss in AppDaten
+static ULONG nLastTime = 0;
+
+long TimeOut_Impl( void* pThis, void* pArgV )
+{
+ Timer *pArg = (Timer*)pArgV;
+ if( Time::GetSystemTicks() - nLastTime > 3000 )
+ {
+ GetpApp()->HideStatusText();
+ nLastTime = 0;
+ delete pArg;
+ }
+ else pArg->Start();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_STATIC_LINK( SfxProgress, DefaultBindingProgress, SvProgressArg*, pArg )
+{
+ if( !nLastTime )
+ {
+ Timer *pTimer = new Timer();
+ pTimer->SetTimeout( 3000 );
+ pTimer->SetTimeoutHdl( Link( 0, TimeOut_Impl ) );
+ pTimer->Start();
+ }
+ if( Time::GetSystemTicks( ) - nLastTime > 100 )
+ {
+ nLastTime = Time::GetSystemTicks();
+ String aString = SfxMedium::GetStatusString( pArg );
+ if( aString.Len() )
+ GetpApp()->ShowStatusText( aString );
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxProgress::SetStateText
+(
+ ULONG nNewVal, /* neuer Wert f"ur die Fortschritts-Anzeige */
+ const String& rNewVal, /* Status als Text */
+ ULONG nNewRange /* neuer Maximalwert, 0 f"ur Beibehaltung des alten */
+)
+
+{
+ pImp->aStateText = rNewVal;
+ return SetState( nNewVal, nNewRange );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxProgress::SetState
+(
+ ULONG nNewVal, /* neuer Wert f"ur die Fortschritts-Anzeige */
+
+ ULONG nNewRange /* neuer Maximalwert, 0 f"ur Beibehaltung des alten */
+)
+/* [Beschreibung]
+
+ Setzen des aktuellen Status; nach einem zeitlichen Versatz
+ wird Reschedule aufgerufen.
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Fortfahren mit der Aktion
+
+ FALSE
+ Abbrechen der Aktion
+*/
+
+{
+ // wurde via Stop-Button angehalten?
+ if ( pImp->IsCancelled() )
+ return FALSE;
+
+ if( pImp->pActiveProgress ) return TRUE;
+
+ // neuen Wert "ubernehmen
+ BOOL bOver=FALSE;
+ nVal = nNewVal;
+
+ // neuer Range?
+ if ( nNewRange && nNewRange != pImp->nMax )
+ {
+ DBG( DbgOutf( "SfxProgress: range changed from %lu to %lu",
+ pImp->nMax, nNewRange ) );
+ pImp->nMax = nNewRange;
+ bOver = TRUE;
+ }
+
+ // noch kein StbManager eingestellt?
+ if ( !pImp->pMgr )
+ {
+ ULONG nTime = Get10ThSec();
+ ULONG nTimeDiff = nTime - pImp->nCreate;
+ ULONG nPercent = pImp->nMax ? nNewVal * 100 / pImp->nMax : 0;
+ DBG( DbgOutf( "SfxProgress: SetState invisible at %luds (%luds/%luds), %ld%%/%d%%",
+ nTime, nTimeDiff, TIMEOUT_PROGRESS,
+ nPercent, MAXPERCENT_PROGRESS ) );
+ if ( nTimeDiff > TIMEOUT_PROGRESS && nPercent <= MAXPERCENT_PROGRESS )
+ {
+ pImp->pWorkWin = pImp->pApp->GetWorkWindow_Impl( SfxViewFrame::Current() );
+ if( pImp->pWorkWin )
+ {
+ pImp->pWorkWin->SetTempStatusBar_Impl( TRUE );
+ pImp->pMgr = pImp->pWorkWin->GetStatusBarManager_Impl();
+ }
+ DBG( DbgOutf( "SfxProgress: visible" ) );
+ }
+ }
+
+ // schon ein StbManager?
+ if ( pImp->pMgr )
+ {
+// if ( ( !pImp->xObjSh.Is() || &pImp->xObjSh == SfxObjectShell::Current() ) )
+ {
+ // Rescheduling noch nicht aktiv?
+ if ( !pImp->bLocked && pImp->bAllowRescheduling )
+ {
+ ULONG nTime = Get10ThSec();
+ ULONG nTimeDiff = nTime - pImp->nCreate;
+ ULONG nPercent = pImp->nMax ? nNewVal * 100 / pImp->nMax : 0;
+ DBG( DbgOutf( "SfxProgress: SetState unlocked at %luds (%luds/%luds), %ld%%/%d%%",
+ nTime, nTimeDiff, TIMEOUT_RESCHEDULE,
+ nPercent, MAXPERCENT_RESCHEDULE ) );
+ // Zeitpunkt zum verz"ogerten Rescheduling erreicht?
+ if ( nTimeDiff > TIMEOUT_RESCHEDULE && nPercent <= MAXPERCENT_RESCHEDULE )
+ Lock();
+ }
+
+ if ( !bSuspended )
+ {
+ // reiner Text-Progress?
+ if ( !pImp->nMax )
+ GetpApp()->ShowStatusText( pImp->aStateText );
+ else
+ {
+ // Progress-Fortschritt anzeigen
+ if ( bOver )
+ pImp->pMgr->SetProgressMaxValue( pImp->nMax );
+ if ( !pImp->pMgr->IsProgressMode() )
+ pImp->pMgr->StartProgressMode( pImp->aText, pImp->nMax );
+ pImp->pMgr->SetProgressState(nNewVal);
+ }
+ }
+ }
+
+ Reschedule();
+ }
+
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::Resume()
+
+/* [Beschreibung]
+
+ Nimmt die Anzeige des Status nach einer Unterbrechung wieder auf.
+
+ [Querverweise]
+ <SfxProgress::Suspend()>
+*/
+
+{
+ if( pImp->pActiveProgress ) return;
+ if ( bSuspended )
+ {
+ DBG( DbgOutf( "SfxProgress: resumed" ) );
+ if ( pImp->pMgr && pImp->nMax )
+ {
+ pImp->pMgr->StartProgressMode( pImp->aText, pImp->nMax );
+ pImp->pMgr->SetProgressState( nVal );
+ }
+ if ( pImp->bWaitMode )
+ {
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImp->xObjSh);
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImp->xObjSh ) )
+ pFrame->GetWindow().EnterWait();
+ SfxFrame* pFrm = pImp->xObjSh->GetMedium()->GetLoadTargetFrame();
+ if ( pFrm )
+ pFrm->GetWindow().EnterWait();
+ }
+//(mba)/task
+/*
+ else if ( Application::GetAppWindow() )
+ Application::GetAppWindow()->EnterWait();
+ */
+ }
+
+ SfxBindings *pBindings = 0;
+ if ( pImp->xObjSh )
+ {
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImp->xObjSh);
+ if ( pFrame )
+ pFrame->GetBindings().ENTERREGISTRATIONS();
+ }
+
+ bSuspended = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::Suspend()
+
+/* [Beschreibung]
+
+ Unterbricht die Anzeige des Status
+
+ [Querverweise]
+ <SfxProgress::Resume()>
+*/
+
+{
+ if( pImp->pActiveProgress ) return;
+ if ( !bSuspended )
+ {
+ DBG( DbgOutf( "SfxProgress: suspended" ) );
+ bSuspended = TRUE;
+ if ( pImp->pMgr )
+ {
+ if ( pImp->pMgr->IsProgressMode() )
+ pImp->pMgr->EndProgressMode();
+ pImp->pMgr->ShowItems();
+ pImp->pWorkWin->SetTempStatusBar_Impl( FALSE );
+ }
+
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ for ( SfxViewFrame *pFrame =
+ SfxViewFrame::GetFirst(pImp->xObjSh);
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImp->xObjSh ) )
+ pFrame->GetWindow().LeaveWait();
+ SfxFrame* pFrm = pImp->xObjSh->GetMedium()->GetLoadTargetFrame();
+ if ( pFrm )
+ pFrm->GetWindow().LeaveWait();
+ }
+//(mba)/task
+/*
+ else if ( Application::GetAppWindow() )
+ Application::GetAppWindow()->LeaveWait();
+*/
+ SfxBindings *pBindings = 0;
+ if ( pImp->xObjSh.Is() )
+ {
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst(pImp->xObjSh);
+ if ( pFrame )
+ pFrame->GetBindings().LEAVEREGISTRATIONS();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::Lock()
+{
+ if( pImp->pActiveProgress ) return;
+ // kein Reschedule bei Embedded-Objekten,
+ // da wir gegen das OLE Protokoll wehrlos sind
+ if ( !pImp->xObjSh.Is() )
+ {
+ for ( SfxObjectShell *pDocSh = SfxObjectShell::GetFirst();
+ pDocSh;
+ pDocSh = SfxObjectShell::GetNext(*pDocSh) )
+ {
+ SfxObjectCreateMode eMode = pDocSh->GetCreateMode();
+ if ( ( eMode == SFX_CREATE_MODE_EMBEDDED ) ||
+ ( eMode == SFX_CREATE_MODE_PREVIEW ) )
+ {
+ DBG( DbgOutf( "SfxProgress: not locked because EMBEDDED/PREVIEW found" ) );
+ pImp->bAllowRescheduling = FALSE;
+ }
+ }
+ }
+ else
+ {
+ SfxObjectCreateMode eMode = pImp->xObjSh->GetCreateMode();
+ if ( ( eMode == SFX_CREATE_MODE_EMBEDDED ) ||
+ ( eMode == SFX_CREATE_MODE_PREVIEW ) )
+ {
+ DBG( DbgOutf( "SfxProgress: not locked because ObjectShell is EMBEDDED/PREVIEW" ) );
+ pImp->bAllowRescheduling = FALSE;
+ }
+ }
+
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ Enable_Impl(pImp->xObjSh, FALSE);
+ }
+ else
+ {
+ Enable_Impl(0, FALSE);
+ }
+
+ DBG( DbgOutf( "SfxProgress: locked" ) );
+ pImp->bLocked = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::UnLock()
+{
+ if( pImp->pActiveProgress ) return;
+ if ( !pImp->bLocked )
+ return;
+
+ DBG( DbgOutf( "SfxProgress: unlocked" ) );
+ pImp->bLocked = FALSE;
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ Enable_Impl(pImp->xObjSh, TRUE);
+ }
+ else
+ {
+ Enable_Impl(0, TRUE);
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::Reschedule()
+
+/* [Beschreibung]
+
+ Reschedule von au"sen rufbar
+
+*/
+
+{
+ SFX_STACK(SfxProgress::Reschedule);
+
+ if( pImp->pActiveProgress ) return;
+ if ( pImp->bLocked && 0 == pImp->pApp->Get_Impl()->nRescheduleLocks )
+ {
+ DBG_ASSERTWARNING( pImp->pApp->IsInAsynchronCall_Impl(),
+ "Reschedule in synchron-call-stack" );
+
+ SfxAppData_Impl *pAppData = pImp->pApp->Get_Impl();
+ ++pAppData->nInReschedule;
+ Application::Reschedule();
+ --pAppData->nInReschedule;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::SetWaitMode
+(
+ BOOL bWait /* TRUE
+ Wartecursor wird verwendet
+
+ FALSE
+ Es wird kein Wartecursor verwendet */
+)
+
+/* [Beschreibung]
+
+ Wartecursor-Modus umschalten.
+
+*/
+
+{
+ if( pImp->pActiveProgress ) return;
+ if ( !bSuspended && pImp->bWaitMode != bWait )
+ {
+ if ( bWait )
+ {
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ for ( SfxViewFrame *pFrame =
+ SfxViewFrame::GetFirst(pImp->xObjSh);
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImp->xObjSh ) )
+ pFrame->GetWindow().EnterWait();
+ SfxFrame* pFrm = pImp->xObjSh->GetMedium()->GetLoadTargetFrame();
+ if ( pFrm )
+ pFrm->GetWindow().EnterWait();
+ }
+//(mba)/task
+/*
+ else if ( Application::GetAppWindow() )
+ Application::GetAppWindow()->EnterWait();
+ */
+ }
+ else
+ {
+ if ( pImp->xObjSh.Is() && !pImp->bAllDocs )
+ {
+ for ( SfxViewFrame *pFrame =
+ SfxViewFrame::GetFirst(pImp->xObjSh);
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame, pImp->xObjSh ) )
+ pFrame->GetWindow().LeaveWait();
+ SfxFrame* pFrm = pImp->xObjSh->GetMedium()->GetLoadTargetFrame();
+ if ( pFrm )
+ pFrm->GetWindow().LeaveWait();
+ }
+//(mba)/task
+ /*
+
+ else if ( Application::GetAppWindow() )
+ Application::GetAppWindow()->LeaveWait();
+ */
+ }
+ }
+
+ pImp->bWaitMode = bWait;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxProgress::GetWaitMode() const
+
+/* [Beschreibung]
+
+ Wartecursor-Modus abfragen.
+
+*/
+
+{
+ return pImp->bWaitMode;
+}
+
+// -----------------------------------------------------------------------
+
+SfxProgress* SfxProgress::GetActiveProgress
+(
+ SfxObjectShell* pDocSh /* <SfxObjectShell>, die nach einem laufenden
+ <SfxProgress> gefragt werden soll, oder
+ 0, wenn ein f"ur die gesamte Applikation
+ laufender SfxProgress erfragt werden soll.
+ Der Pointer braucht nur zum Zeitpunkt des
+ Aufrufs g"ultig zu sein. */
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann erfragt werden, ob und welcher <SfxProgress>-
+ f"ur eine bestimmte Instanz von SfxObjectShell oder gar die gesamte
+ Applikation zur Zeit aktiv ist. Dies kann z.B. zum Abfangen von
+ Time-Out-Events etc. verwendet werden.
+
+ Anstelle eines Pointer auf den SfxProgress der SfxObjectShell wird
+ ggf. der auf den SfxProgress der Applikation geliefert, mit der
+ Abfrage 'SfxProgress::GetActiveProgress(pMyDocSh)' wird also
+ insofern vorhanden der SfxProgress von 'pMyDocSh' geliefert,
+ sonst der SfxProgress der Applikation bzw. ein 0-Pointer.
+
+
+ [Anmerkung]
+
+ "auft kein SfxProgress an der Applikation und ebenfalls keiner an
+ der angegebenen SfxObjectShell, dann wird immer 0 zur"uckgeliefert,
+ auch wenn an einer anderen SfxObjectShell ein SfxProgress l"uft.
+
+
+ [Querverweise]
+
+ <SfxApplication::GetProgress()const>
+ <SfxObjectShell::GetProgress()const>
+*/
+
+{
+ SfxProgress *pProgress = 0;
+ if ( pDocSh )
+ pProgress = pDocSh->GetProgress();
+ if ( !pProgress )
+ pProgress = SFX_APP()->GetProgress();
+ return pProgress;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::EnterLock()
+{
+ SFX_APP()->Get_Impl()->nRescheduleLocks++;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxProgress::LeaveLock()
+{
+ SfxAppData_Impl *pImp = SFX_APP()->Get_Impl();
+ DBG_ASSERT( 0 != pImp->nRescheduleLocks, "SFxProgress::LeaveLock but no locks" )
+ pImp->nRescheduleLocks--;
+}
+
+// -----------------------------------------------------------------------
+
+FASTBOOL SfxProgress::StatusBarManagerGone_Impl
+(
+ SfxStatusBarManager *pStb // dieser <SfxStatusBarManager> wird zerst"ort
+)
+
+/* [Beschreibung]
+
+ Interne Methode zum Benachrichtigen des SfxProgress, da\s der angegebene
+ SfxStatusBarManger zerst"ort wird. Damit der Progress ihn loslassen
+ kann.
+*/
+
+{
+ if ( pImp->pMgr != pStb )
+ return FALSE;
+
+ DBG( DbgOutf( "SfxProgress: StatusBarManager gone" ) );
+ pImp->pMgr = 0;
+ return TRUE;
+}
+
diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx
new file mode 100644
index 000000000000..46ab6382de14
--- /dev/null
+++ b/sfx2/source/bastyp/sfxhtml.cxx
@@ -0,0 +1,762 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxhtml.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <tools/urlobj.hxx>
+
+#include "objsh.hxx"
+#include "docinf.hxx"
+#include "docfile.hxx"
+#include "openflag.hxx"
+
+#ifndef _SFXAPP_HXX //autogen
+#include <app.hxx>
+#endif
+
+#ifndef _HTMLKYWD_HXX
+#include <svtools/htmlkywd.hxx>
+#endif
+#ifndef _HTMLTOKN_H
+#include <svtools/htmltokn.h>
+#endif
+#ifndef _IMAP_HXX
+#include <svtools/imap.hxx>
+#endif
+#ifndef _GOODIES_IMAPCIRC_HXX
+#include <svtools/imapcirc.hxx>
+#endif
+#ifndef _GOODIES_IMAPOBJ_HXX
+#include <svtools/imapobj.hxx>
+#endif
+#ifndef _GOODIES_IMAPPOLY_HXX
+#include <svtools/imappoly.hxx>
+#endif
+#ifndef _GOODIES_IMAPRECT_HXX
+#include <svtools/imaprect.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _SVSTDARR_ULONGS_DECL
+#define _SVSTDARR_ULONGS
+#include <svtools/svstdarr.hxx>
+#endif
+#ifndef _ZFORLIST_HXX
+#include <svtools/zforlist.hxx>
+#endif
+#ifndef _INETTYPE_HXX
+#include <svtools/inettype.hxx>
+#endif
+
+#ifndef _INETBND_HXX
+#include <so3/inetbnd.hxx>
+#endif
+
+#ifndef _RTL_TENCINFO_H
+#include <rtl/tencinfo.h>
+#endif
+
+#include "sfxhtml.hxx"
+#include "inimgr.hxx"
+
+sal_Char __FAR_DATA sHTML_MIME_text[] = "text/";
+sal_Char __FAR_DATA sHTML_MIME_application[] = "application/";
+sal_Char __FAR_DATA sHTML_MIME_experimental[] = "x-";
+
+#define HTML_META_NONE 0
+#define HTML_META_AUTHOR 1
+#define HTML_META_DESCRIPTION 2
+#define HTML_META_KEYWORDS 3
+#define HTML_META_REFRESH 4
+#define HTML_META_CLASSIFICATION 5
+#define HTML_META_CREATED 6
+#define HTML_META_CHANGEDBY 7
+#define HTML_META_CHANGED 8
+#define HTML_META_GENERATOR 9
+#define HTML_META_SDFOOTNOTE 10
+#define HTML_META_SDENDNOTE 11
+#define HTML_META_CONTENT_TYPE 12
+
+// <INPUT TYPE=xxx>
+static HTMLOptionEnum __READONLY_DATA aAreaShapeOptEnums[] =
+{
+ { sHTML_SH_rect, IMAP_OBJ_RECTANGLE },
+ { sHTML_SH_rectangle, IMAP_OBJ_RECTANGLE },
+ { sHTML_SH_circ, IMAP_OBJ_CIRCLE },
+ { sHTML_SH_circle, IMAP_OBJ_CIRCLE },
+ { sHTML_SH_poly, IMAP_OBJ_POLYGON },
+ { sHTML_SH_polygon, IMAP_OBJ_POLYGON },
+ { 0, 0 }
+};
+
+// <META NAME=xxx>
+static HTMLOptionEnum __READONLY_DATA aHTMLMetaNameTable[] =
+{
+ { sHTML_META_author, HTML_META_AUTHOR },
+ { sHTML_META_changed, HTML_META_CHANGED },
+ { sHTML_META_changedby, HTML_META_CHANGEDBY },
+ { sHTML_META_classification,HTML_META_CLASSIFICATION},
+ { sHTML_META_content_type, HTML_META_CONTENT_TYPE },
+ { sHTML_META_created, HTML_META_CREATED },
+ { sHTML_META_description, HTML_META_DESCRIPTION },
+ { sHTML_META_keywords, HTML_META_KEYWORDS },
+ { sHTML_META_generator, HTML_META_GENERATOR },
+ { sHTML_META_refresh, HTML_META_REFRESH },
+ { sHTML_META_sdendnote, HTML_META_SDENDNOTE },
+ { sHTML_META_sdfootnote, HTML_META_SDFOOTNOTE },
+ { 0, 0 }
+};
+
+SfxHTMLParser::SfxHTMLParser( SvStream& rStream, BOOL bNewDoc,
+ SfxMedium *pMed ) :
+ HTMLParser( rStream, bNewDoc ),
+ pMedium( pMed ), pDLMedium( 0 ),
+ nMetaTags( 0 )
+{
+ DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW == GetSrcEncoding( ),
+ "SfxHTMLParser::SfxHTMLParser: Wo kommt der ZS her?" );
+ DBG_ASSERT( !IsSwitchToUCS2(),
+ "SfxHTMLParser::SfxHTMLParser: Switch to UCS2?" );
+
+ // If the system encoding is ANSI, this encoding is used as default
+ // source encoding. Otherwise ISO-8859-1 will be used, because this
+ // is the real default encoding.
+ SetSrcEncoding( RTL_TEXTENCODING_MS_1252 == gsl_getSystemTextEncoding()
+ ? RTL_TEXTENCODING_MS_1252
+ : RTL_TEXTENCODING_ISO_8859_1 );
+
+ // If the file starts with a BOM, switch to UCS2.
+ SetSwitchToUCS2( TRUE );
+}
+
+__EXPORT SfxHTMLParser::~SfxHTMLParser()
+{
+ DBG_ASSERT( !pDLMedium, "Da ist ein File-Download stehengeblieben" );
+ delete pDLMedium;
+}
+
+BOOL SfxHTMLParser::ParseMapOptions(ImageMap * pImageMap,
+ const HTMLOptions * pOptions)
+{
+ DBG_ASSERT( pImageMap, "ParseMapOptions: keine Image-Map" );
+ DBG_ASSERT( pOptions, "ParseMapOptions: keine Optionen" );
+
+ String aName;
+
+ for( USHORT i=pOptions->Count(); i; )
+ {
+ const HTMLOption *pOption = (*pOptions)[--i];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_NAME:
+ aName = pOption->GetString();
+ break;
+ }
+ }
+
+ if( aName.Len() )
+ pImageMap->SetName( aName );
+
+ return aName.Len() > 0;
+}
+
+BOOL SfxHTMLParser::ParseAreaOptions(ImageMap * pImageMap,
+ const HTMLOptions * pOptions,
+ USHORT nEventMouseOver,
+ USHORT nEventMouseOut )
+{
+ DBG_ASSERT( pImageMap, "ParseAreaOptions: keine Image-Map" );
+ DBG_ASSERT( pOptions, "ParseAreaOptions: keine Optionen" );
+
+ USHORT nShape = IMAP_OBJ_RECTANGLE;
+ SvULongs aCoords;
+ String aName, aHRef, aAlt, aTarget, sEmpty;
+ BOOL bNoHRef = FALSE;
+ SvxMacroTableDtor aMacroTbl;
+
+ for( USHORT i=pOptions->Count(); i; )
+ {
+ USHORT nEvent = 0;
+ ScriptType eScrpType = STARBASIC;
+ const HTMLOption *pOption = (*pOptions)[--i];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_NAME:
+ aName = pOption->GetString();
+ break;
+ case HTML_O_SHAPE:
+ pOption->GetEnum( nShape, aAreaShapeOptEnums );
+ break;
+ case HTML_O_COORDS:
+ pOption->GetNumbers( aCoords, TRUE );
+ break;
+ case HTML_O_HREF:
+ aHRef = INetURLObject::RelToAbs( pOption->GetString() );
+ break;
+ case HTML_O_NOHREF:
+ bNoHRef = TRUE;
+ break;
+ case HTML_O_ALT:
+ aAlt = pOption->GetString();
+ break;
+ case HTML_O_TARGET:
+ aTarget = pOption->GetString();
+ break;
+
+ case HTML_O_ONMOUSEOVER:
+ eScrpType = JAVASCRIPT;
+ case HTML_O_SDONMOUSEOVER:
+ nEvent = nEventMouseOver;
+ goto IMAPOBJ_SETEVENT;
+
+ case HTML_O_ONMOUSEOUT:
+ eScrpType = JAVASCRIPT;
+ case HTML_O_SDONMOUSEOUT:
+ nEvent = nEventMouseOut;
+ goto IMAPOBJ_SETEVENT;
+IMAPOBJ_SETEVENT:
+ if( nEvent )
+ {
+ String sTmp( pOption->GetString() );
+ if( sTmp.Len() )
+ {
+ sTmp.ConvertLineEnd();
+ aMacroTbl.Insert( nEvent,
+ new SvxMacro( sTmp, sEmpty, eScrpType ));
+ }
+ }
+ break;
+ }
+ }
+
+ if( bNoHRef )
+ aHRef.Erase();
+
+ BOOL bNewArea = TRUE;
+ switch( nShape )
+ {
+ case IMAP_OBJ_RECTANGLE:
+ if( aCoords.Count() >=4 )
+ {
+ Rectangle aRec( aCoords[0], aCoords[1],
+ aCoords[2], aCoords[3] );
+ IMapRectangleObject aMapRObj( aRec, aHRef, aAlt, aTarget, aName,
+ !bNoHRef );
+ if( aMacroTbl.Count() )
+ aMapRObj.SetMacroTable( aMacroTbl );
+ pImageMap->InsertIMapObject( aMapRObj );
+ }
+ break;
+ case IMAP_OBJ_CIRCLE:
+ if( aCoords.Count() >=3 )
+ {
+ Point aPoint( aCoords[0], aCoords[1] );
+ IMapCircleObject aMapCObj( aPoint, aCoords[2],aHRef, aAlt,
+ aTarget, aName, !bNoHRef );
+ if( aMacroTbl.Count() )
+ aMapCObj.SetMacroTable( aMacroTbl );
+ pImageMap->InsertIMapObject( aMapCObj );
+ }
+ break;
+ case IMAP_OBJ_POLYGON:
+ if( aCoords.Count() >=6 )
+ {
+ USHORT nCount = aCoords.Count() / 2;
+ Polygon aPoly( nCount );
+ for( USHORT i=0; i<nCount; i++ )
+ aPoly[i] = Point( aCoords[2*i], aCoords[2*i+1] );
+ IMapPolygonObject aMapPObj( aPoly, aHRef, aAlt, aTarget, aName,
+ !bNoHRef );
+ if( aMacroTbl.Count() )
+ aMapPObj.SetMacroTable( aMacroTbl );
+ pImageMap->InsertIMapObject( aMapPObj );
+ }
+ break;
+ default:
+ bNewArea = FALSE;
+ }
+
+ return bNewArea;
+}
+
+BOOL SfxHTMLParser::ParseMetaOptions( SfxDocumentInfo *pInfo,
+ SvKeyValueIterator *pHTTPHeader,
+ const HTMLOptions *pOptions,
+ USHORT &rMetaCount,
+ rtl_TextEncoding& rEnc )
+{
+ String aName, aContent;
+ USHORT nAction = HTML_META_NONE;
+ BOOL bHTTPEquiv = FALSE, bChanged = FALSE;
+
+ for( USHORT i = pOptions->Count(); i; )
+ {
+ const HTMLOption *pOption = (*pOptions)[ --i ];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_NAME:
+ aName = pOption->GetString();
+ if( HTML_META_NONE==nAction )
+ pOption->GetEnum( nAction, aHTMLMetaNameTable );
+ break;
+ case HTML_O_HTTPEQUIV:
+ aName = pOption->GetString();
+ pOption->GetEnum( nAction, aHTMLMetaNameTable );
+ bHTTPEquiv = TRUE;
+ break;
+ case HTML_O_CONTENT:
+ aContent = pOption->GetString();
+ break;
+ }
+ }
+
+ if( bHTTPEquiv || HTML_META_DESCRIPTION!=nAction )
+ {
+ // wenn's keine Description ist CRs und LFs aus dem CONTENT entfernen
+ aContent.EraseAllChars( _CR );
+ aContent.EraseAllChars( _LF );
+ }
+ else
+ {
+ // fuer die Beschreibung die Zeilen-Umbrueche entsprechen wandeln
+ aContent.ConvertLineEnd();
+ }
+
+
+ if( bHTTPEquiv && pHTTPHeader )
+ {
+ // #57232#: Netscape scheint ein abschliessendes " einfach zu
+ // ignorieren, also tun wir das auch.
+ if( aContent.Len() && '"' == aContent.GetChar( aContent.Len()-1 ) )
+ aContent.Erase( aContent.Len() - 1 );
+ SvKeyValue aKeyValue( aName, aContent );
+ pHTTPHeader->Append( aKeyValue );
+ }
+
+ switch( nAction )
+ {
+ case HTML_META_AUTHOR:
+ {
+ SfxStamp aStamp;
+ aStamp = pInfo->GetCreated();
+ aStamp.SetName( aContent );
+ pInfo->SetCreated( aStamp );
+ bChanged = TRUE;
+ }
+ break;
+ case HTML_META_DESCRIPTION:
+ pInfo->SetComment( aContent );
+ bChanged = TRUE;
+ break;
+ case HTML_META_KEYWORDS:
+ pInfo->SetKeywords( aContent );
+ bChanged = TRUE;
+ break;
+ case HTML_META_CLASSIFICATION:
+ pInfo->SetTheme( aContent );
+ bChanged = TRUE;
+ break;
+
+ case HTML_META_CHANGEDBY:
+ {
+ SfxStamp aStamp;
+ aStamp = pInfo->GetChanged();
+ aStamp.SetName( aContent );
+ pInfo->SetChanged( aStamp );
+ bChanged = TRUE;
+ }
+ break;
+
+ case HTML_META_CREATED:
+ case HTML_META_CHANGED:
+ if( aContent.Len() && aContent.GetTokenCount()==2 )
+ {
+ SfxStamp aStamp;
+ aStamp = ( HTML_META_CREATED==nAction
+ ? pInfo->GetCreated()
+ : pInfo->GetChanged() );
+ Date aDate( (ULONG)aContent.GetToken(0).ToInt32() );
+ Time aTime( (ULONG)aContent.GetToken(1).ToInt32() );
+ DateTime aDateTime( aDate, aTime );
+ aStamp.SetTime( aDateTime );
+ if( HTML_META_CREATED==nAction )
+ pInfo->SetCreated( aStamp );
+ else
+ pInfo->SetChanged( aStamp );
+ bChanged = TRUE;
+ }
+ break;
+
+ case HTML_META_REFRESH:
+ DBG_ASSERT( !bHTTPEquiv || pHTTPHeader,
+ "Reload-URL aufgrund unterlsassener MUSS-Aenderung verlorengegangen" );
+ break;
+
+ case HTML_META_CONTENT_TYPE:
+ if( aContent.Len() )
+ rEnc = GetEncodingByMIME( aContent );
+ break;
+
+ case HTML_META_NONE:
+ if( !bHTTPEquiv )
+ {
+ USHORT nKeys = pInfo->GetUserKeyCount();
+ if( rMetaCount==USHRT_MAX )
+ {
+ rMetaCount = 0;
+ while( rMetaCount<nKeys &&
+ pInfo->GetUserKey(rMetaCount).GetWord().Len() )
+ {
+ rMetaCount++;
+ }
+ }
+ if( rMetaCount < nKeys )
+ {
+ const SfxDocUserKey& rUserKey = pInfo->GetUserKey(rMetaCount);
+ if( !rUserKey.GetWord().Len() )
+ {
+ SfxDocUserKey aUserKey( aName, aContent );
+ pInfo->SetUserKey( aUserKey, rMetaCount );
+ rMetaCount++;
+ bChanged = TRUE;
+ break;
+ }
+ }
+ }
+ break;
+ }
+
+ return bChanged;
+}
+
+BOOL SfxHTMLParser::ParseMetaOptions( SfxDocumentInfo *pInfo,
+ SvKeyValueIterator *pHeader )
+{
+ USHORT nContentOption = HTML_O_CONTENT;
+ rtl_TextEncoding eEnc = RTL_TEXTENCODING_DONTKNOW;
+
+ BOOL bRet = ParseMetaOptions( pInfo, pHeader,
+ GetOptions(&nContentOption),
+ nMetaTags, eEnc );
+
+ // If the encoding is set by a META tag, it may only overwrite the
+ // current encoding if both, the current and the new encoding, are 1-BYTE
+ // encodings. Everything else cannot lead to reasonable results.
+ if( RTL_TEXTENCODING_DONTKNOW != eEnc &&
+ eEnc < RTL_TEXTENCODING_STD_COUNT &&
+ GetSrcEncoding() < RTL_TEXTENCODING_STD_COUNT )
+ SetSrcEncoding( eEnc );
+
+ return bRet;
+}
+
+
+void SfxHTMLParser::StartFileDownload( const String& rURL, int nToken,
+ SfxObjectShell *pSh )
+{
+ DBG_ASSERT( !pDLMedium, "StartFileDwonload bei aktivem Download" );
+ if( pDLMedium )
+ return;
+
+ pDLMedium = new SfxMedium( rURL, SFX_STREAM_READONLY, FALSE );
+ pDLMedium->SetTransferPriority( SFX_TFPRIO_DOC );
+
+ if( pSh )
+ {
+ // Medium registrieren, damit abgebrochen werden kann
+ pSh->RegisterTransfer( *pDLMedium );
+
+ // Target-Frame uebertragen, damit auch javascript:-URLs
+ // "geladen" werden koennen.
+ const SfxMedium *pShMedium = pSh->GetMedium();
+ if( pShMedium )
+ pDLMedium->SetLoadTargetFrame( pShMedium->GetLoadTargetFrame() );
+ }
+
+ // Downloading-Flag auf TRUE setzen. Es werden dann auch
+ // Data-Available-Links, wenn wir in den Pending-Staus gelangen.
+ SetDownloadingFile( TRUE );
+
+ // Download anstossen (Achtung: Kann auch synchron sein).
+ pDLMedium->DownLoad( STATIC_LINK( this, SfxHTMLParser, FileDownloadDone ) );
+
+ // Wenn das Dowsnloading-Flag noch gesetzt ist erfolgt der Download
+ // asynchron. Wir gehen dann in den Pedning-Staus und warten dort.
+ // Solange sind alle Aufrufe des Data-Avaialble-Link gesperrt.
+ if( IsDownloadingFile() )
+ {
+ // Den aktuellen Zustand einfrieren und in den Pending-Status gehen.
+ // Wenn der Download beendet oder abgebrochen wurde, wird ueber
+ // NewDataRead ein Continue mit dem uebergeben Token angesteossen.
+ SaveState( nToken );
+ eState = SVPAR_PENDING;
+ }
+}
+
+BOOL SfxHTMLParser::GetFileDownloadMIME( String& rMIME )
+{
+ return pDLMedium && pDLMedium->GetErrorCode()==0 &&
+ pDLMedium->GetMIMEAndRedirect(rMIME)==0;
+}
+
+BOOL SfxHTMLParser::FinishFileDownload( String& rStr )
+{
+ String aStr;
+
+ BOOL bOK = pDLMedium && pDLMedium->GetErrorCode()==0;
+ if( bOK )
+ {
+ SvStream* pStream = pDLMedium->GetInStream();
+ DBG_ASSERT( pStream, "Kein In-Stream vom Medium erhalten" );
+
+ SvMemoryStream aStream;
+ if( pStream ) // HACK wegen #65563#
+ aStream << *pStream;
+
+ aStream.Seek( STREAM_SEEK_TO_END );
+ DBG_ASSERT( aStream.Tell() < STRING_MAXLEN,
+ "File zu lang fuer einen String, Ende abgeschnitten" );
+ xub_StrLen nLen = aStream.Tell() < STRING_MAXLEN
+ ? (xub_StrLen)aStream.Tell()
+ : STRING_MAXLEN;
+
+ // TODO: untested!!!
+ rtl_TextEncoding eEnc =
+ RTL_TEXTENCODING_MS_1252 == gsl_getSystemTextEncoding()
+ ? RTL_TEXTENCODING_MS_1252
+ : RTL_TEXTENCODING_ISO_8859_1;
+ String sMime;
+ if( pDLMedium->GetMIMEAndRedirect( sMime ) == 0 )
+ {
+ rtl_TextEncoding eMimeEnc = GetEncodingByMIME( sMime );
+ if( RTL_TEXTENCODING_DONTKNOW != eMimeEnc )
+ eEnc = eMimeEnc;
+ }
+
+ ByteString sBuffer;
+ sal_Char* pBuffer = sBuffer.AllocBuffer(nLen);
+ aStream.Read((void*)pBuffer, nLen);
+ rStr = String( S2U(pBuffer) );
+ }
+
+ delete pDLMedium;
+ pDLMedium = 0;
+
+ return bOK;
+}
+
+IMPL_STATIC_LINK( SfxHTMLParser, FileDownloadDone, void*, EMPTYARG )
+{
+ // Der Download ist jetzt abgeschlossen. Ausserdem muss/darf der
+ // Data-Available-Link wieder durchgelassen werden.
+ pThis->SetDownloadingFile( FALSE );
+
+ // ... und einmal aufrufen, damit weitergelesen wird.
+ pThis->CallAsyncCallLink();
+
+ return 0;
+}
+
+rtl_TextEncoding SfxHTMLParser::GetEncodingByMIME( const String& rMime )
+{
+ ByteString sType;
+ ByteString sSubType;
+ INetContentTypeParameterList aParameters;
+ ByteString sMime( rMime, RTL_TEXTENCODING_ASCII_US );
+ if (INetContentTypes::parse(sMime, sType, sSubType, &aParameters))
+ {
+ const INetContentTypeParameter * pCharset
+ = aParameters.find("charset");
+ if (pCharset != 0)
+ {
+ ByteString sValue( pCharset->m_sValue, RTL_TEXTENCODING_ASCII_US );
+ return rtl_getTextEncodingFromMimeCharset( sValue.GetBuffer() );
+ }
+ }
+ return RTL_TEXTENCODING_DONTKNOW;
+}
+
+BOOL SfxHTMLParser::SetEncodingByHTTPHeader(
+ SvKeyValueIterator *pHTTPHeader )
+{
+ BOOL bRet = FALSE;
+ if( pHTTPHeader )
+ {
+ SvKeyValue aKV;
+ for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont;
+ bCont = pHTTPHeader->GetNext( aKV ) )
+ {
+ if( aKV.GetKey().EqualsIgnoreCaseAscii( sHTML_META_content_type ) )
+ {
+ if( aKV.GetValue().Len() )
+ {
+ rtl_TextEncoding eEnc =
+ GetEncodingByMIME( aKV.GetValue() );
+ if( RTL_TEXTENCODING_DONTKNOW != eEnc )
+ {
+ SetSrcEncoding( eEnc );
+ bRet = TRUE;
+ }
+ }
+// break;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+void SfxHTMLParser::GetScriptType_Impl( SvKeyValueIterator *pHTTPHeader )
+{
+ aScriptType = DEFINE_CONST_UNICODE(SVX_MACRO_LANGUAGE_JAVASCRIPT);
+ eScriptType = JAVASCRIPT;
+ if( pHTTPHeader )
+ {
+ SvKeyValue aKV;
+ for( BOOL bCont = pHTTPHeader->GetFirst( aKV ); bCont;
+ bCont = pHTTPHeader->GetNext( aKV ) )
+ {
+ if( aKV.GetKey().EqualsIgnoreCaseAscii(
+ sHTML_META_content_script_type ) )
+ {
+ if( aKV.GetValue().Len() )
+ {
+ String aTmp( aKV.GetValue() );
+ if( aTmp.EqualsIgnoreCaseAscii( sHTML_MIME_text, 0, 5 ) )
+ aTmp.Erase( 0, 5 );
+ else if( aTmp.EqualsIgnoreCaseAscii( sHTML_MIME_application,
+ 0, 12 ) )
+ aTmp.Erase( 0, 12 );
+ else
+ break;
+
+ if( aTmp.EqualsIgnoreCaseAscii( sHTML_MIME_experimental, 0,
+ 2 ) )
+ {
+ aTmp.Erase( 0, 2 );
+ }
+
+ if( aTmp.EqualsIgnoreCaseAscii( sHTML_LG_starbasic ) )
+ {
+ eScriptType = STARBASIC;
+ aScriptType = DEFINE_CONST_UNICODE(SVX_MACRO_LANGUAGE_STARBASIC);
+ }
+ if( !aTmp.EqualsIgnoreCaseAscii( sHTML_LG_javascript ) )
+ {
+ eScriptType = EXTENDED_STYPE;
+ aScriptType = aTmp;
+ }
+ }
+ break;
+ }
+ }
+ }
+}
+
+ScriptType SfxHTMLParser::GetScriptType( SvKeyValueIterator *pHTTPHeader ) const
+{
+ if( !aScriptType.Len() )
+ ((SfxHTMLParser *)this)->GetScriptType_Impl( pHTTPHeader );
+
+ return eScriptType;
+}
+
+const String& SfxHTMLParser::GetScriptTypeString(
+ SvKeyValueIterator *pHTTPHeader ) const
+{
+ if( !aScriptType.Len() )
+ ((SfxHTMLParser *)this)->GetScriptType_Impl( pHTTPHeader );
+
+ return aScriptType;
+}
+
+double SfxHTMLParser::GetTableDataOptionsValNum( ULONG& nNumForm,
+ LanguageType& eNumLang, const String& aValStr, const String& aNumStr,
+ SvNumberFormatter& rFormatter )
+{
+ LanguageType eParseLang = (LanguageType )aNumStr.ToInt32();
+ ULONG nParseForm =
+ rFormatter.GetFormatForLanguageIfBuiltIn( 0, eParseLang );
+ double fVal;
+ rFormatter.IsNumberFormat( aValStr, nParseForm, fVal );
+ if ( aNumStr.GetTokenCount( ';' ) > 2 )
+ {
+ eNumLang = (LanguageType)aNumStr.GetToken( 1, ';' ).ToInt32();
+ xub_StrLen nPos = aNumStr.Search( ';' );
+ nPos = aNumStr.Search( ';', nPos + 1 );
+ String aFormat( aNumStr.Copy( nPos + 1 ) );
+ xub_StrLen nCheckPos;
+ short nType;
+ if ( eNumLang != LANGUAGE_SYSTEM )
+ rFormatter.PutEntry( aFormat, nCheckPos, nType, nNumForm, eNumLang );
+ else
+ rFormatter.PutandConvertEntry( aFormat, nCheckPos, nType, nNumForm,
+ eParseLang, eNumLang );
+ }
+ else
+ {
+ eNumLang = LANGUAGE_SYSTEM;
+ nNumForm = rFormatter.GetFormatForLanguageIfBuiltIn( 0, eNumLang );
+ }
+ return fVal;
+}
+
diff --git a/sfx2/source/bastyp/sfxresid.cxx b/sfx2/source/bastyp/sfxresid.cxx
new file mode 100644
index 000000000000..b118288a44ef
--- /dev/null
+++ b/sfx2/source/bastyp/sfxresid.cxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxresid.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:28 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#ifndef _TOOLS_SIMPLERESMGR_HXX_
+#include <tools/simplerm.hxx>
+#endif
+
+#include "sfxresid.hxx"
+#include "app.hxx"
+
+// -----------------------------------------------------------------------
+
+SfxResId::SfxResId( USHORT nId ) :
+
+ ResId( nId, SFX_APP()->GetSfxResManager() )
+{
+}
+
+//============================================================================
+//
+// SfxSimpleResId Implementation.
+//
+//============================================================================
+
+SfxSimpleResId::SfxSimpleResId(USHORT nID):
+ m_sText( SFX_APP()->GetSimpleResManager()->ReadString(nID) )
+{}
+
+
+
diff --git a/sfx2/source/config/config.hrc b/sfx2/source/config/config.hrc
new file mode 100644
index 000000000000..77832dfccd49
--- /dev/null
+++ b/sfx2/source/config/config.hrc
@@ -0,0 +1,124 @@
+/*************************************************************************
+ *
+ * $RCSfile: config.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFX_CONFIG_HRC
+#define _SFX_CONFIG_HRC
+
+#include "sfx.hrc"
+
+// #defines *****************************************************************
+
+#define STR_WARNING_ITEM RID_SFX_CONFIG_START+1
+
+#define CONFIG_PATH_START (RID_SFX_CONFIG_START+2)
+#define STR_KEY_SUB_INI (CONFIG_PATH_START)
+#define STR_KEY_CONFIG_DIR (CONFIG_PATH_START+1)
+#define STR_KEY_WORK_PATH (CONFIG_PATH_START+2)
+#define STR_KEY_GRAPHICS_PATH (CONFIG_PATH_START+3)
+#define STR_KEY_BITMAP_PATH (CONFIG_PATH_START+4)
+#define STR_KEY_BASIC_PATH (CONFIG_PATH_START+5)
+#define STR_KEY_DATABASE_PATH (CONFIG_PATH_START+6)
+#define STR_KEY_PALETTE_PATH (CONFIG_PATH_START+7)
+#define STR_KEY_BACKUP_PATH (CONFIG_PATH_START+8)
+#define STR_KEY_MODULES_PATH (CONFIG_PATH_START+9)
+#define STR_KEY_TEMPLATE_PATH (CONFIG_PATH_START+10)
+#define STR_KEY_GLOSSARY_PATH (CONFIG_PATH_START+11)
+#define STR_KEY_DICTIONARY_PATH (CONFIG_PATH_START+12)
+#define STR_KEY_DOCMANAGER_INI (CONFIG_PATH_START+13)
+#define STR_KEY_DESKTOP_DIR (CONFIG_PATH_START+14)
+#define STR_KEY_CACHE_DIR (CONFIG_PATH_START+15)
+#define STR_KEY_HELP_DIR (CONFIG_PATH_START+16)
+#define STR_KEY_BOOKMARK_DIR (CONFIG_PATH_START+17)
+#define CONFIG_PATH_END STR_KEY_BOOKMARK_DIR
+
+#define CONFIG_OSPATH_START (CONFIG_PATH_END+1)
+#define STR_OSKEY_SUB_INI (CONFIG_OSPATH_START+0)
+#define STR_OSKEY_CONFIG_DIR (CONFIG_OSPATH_START+1)
+#define STR_OSKEY_WORK_PATH (CONFIG_OSPATH_START+2)
+#define STR_OSKEY_GRAPHICS_PATH (CONFIG_OSPATH_START+3)
+#define STR_OSKEY_BITMAP_PATH (CONFIG_OSPATH_START+4)
+#define STR_OSKEY_BASIC_PATH (CONFIG_OSPATH_START+5)
+#define STR_OSKEY_DATABASE_PATH (CONFIG_OSPATH_START+6)
+#define STR_OSKEY_PALETTE_PATH (CONFIG_OSPATH_START+7)
+#define STR_OSKEY_BACKUP_PATH (CONFIG_OSPATH_START+8)
+#define STR_OSKEY_MODULES_PATH (CONFIG_OSPATH_START+9)
+#define STR_OSKEY_TEMPLATE_PATH (CONFIG_OSPATH_START+10)
+#define STR_OSKEY_GLOSSARY_PATH (CONFIG_OSPATH_START+11)
+#define STR_OSKEY_DICTIONARY_PATH (CONFIG_OSPATH_START+12)
+#define STR_OSKEY_DOCMANAGER_INI (CONFIG_OSPATH_START+13)
+#define STR_OSKEY_DESKTOP_DIR (CONFIG_OSPATH_START+14)
+#define STR_OSKEY_CACHE_DIR (CONFIG_OSPATH_START+15)
+#define STR_OSKEY_HELP_DIR (CONFIG_OSPATH_START+16)
+#define STR_OSKEY_BOOKMARK_DIR (CONFIG_OSPATH_START+17)
+#define CONFIG_OSPATH_END STR_OSKEY_BOOKMARK_DIR
+
+#define STR_EVENTCONFIG (CONFIG_OSPATH_END+1)
+#define DLG_MACROQUERY (CONFIG_OSPATH_END+2)
+#define RID_STR_NAME_MISCCFG (CONFIG_OSPATH_END+3)
+
+#define CB_WARNING 1
+#define BTN_OK 2
+#define BTN_CANCEL 3
+#define FT_MESSAGE 4
+#define ICN_MESSAGE 5
+
+#endif
+
diff --git a/sfx2/source/config/config.src b/sfx2/source/config/config.src
new file mode 100644
index 000000000000..92789dd27302
--- /dev/null
+++ b/sfx2/source/config/config.src
@@ -0,0 +1,291 @@
+/*************************************************************************
+ *
+ * $RCSfile: config.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "config.hrc"
+
+String RID_STR_NAME_MISCCFG
+{
+ Text = "Sonstiges" ;
+ Text [ English ] = "Miscellaneous" ;
+ Text [ english_us ] = "Other" ;
+ Text [ swedish ] = "vrigt" ;
+ Text [ danish ] = "Andet" ;
+ Text [ italian ] = "Altro" ;
+ Text [ spanish ] = "Otros" ;
+ Text [ french ] = "Autres" ;
+ Text [ dutch ] = "Overige" ;
+ Text [ portuguese ] = "Outros" ;
+ Text [ portuguese_brazilian ] = "Sonstiges" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Inne";
+ Text[ japanese ] = "̑";
+ Text[ chinese_traditional ] = "L";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Overige";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ÿ";
+ Text[ turkish ] = "Dier";
+ Text[ language_user1 ] = " ";
+};
+String STR_EVENTCONFIG
+{
+ Text = "Ereigniszuordnung" ;
+ Text [ ENGLISH ] = "Event assignments" ;
+ Text [ english_us ] = "Assign events" ;
+ Text [ italian ] = "Correlazione eventi" ;
+ Text [ spanish ] = "Asignar acontecimientos" ;
+ Text [ french ] = "Attribution vnement" ;
+ Text [ dutch ] = "Gebeurtenis toewijzen" ;
+ Text [ swedish ] = "Hndelsetilldelning" ;
+ Text [ danish ] = "Tildel begivenheder" ;
+ Text [ portuguese ] = "Atribuir eventos" ;
+ Text [ portuguese_brazilian ] = "Ereigniszuordnung" ;
+ Text[ chinese_simplified ] = "ָ¼";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Przyporzdkowanie wydarze";
+ Text[ japanese ] = "s_@̔zu";
+ Text[ chinese_traditional ] = "]wʧ@";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Gebeurtenis toewijzen";
+ Text[ chinese_simplified ] = "ָ¼";
+ Text[ greek ] = " ";
+ Text[ korean ] = "̺Ʈ ";
+ Text[ turkish ] = "Olay ata";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILTERNAME_CFG
+{
+ Text = "Konfiguration" ;
+ Text [ ENGLISH ] = "Configuration" ;
+ Text [ english_us ] = "Configuration" ;
+ Text [ italian ] = "Configurazione" ;
+ Text [ spanish ] = "Configuracin" ;
+ Text [ french ] = "Configuration" ;
+ Text [ dutch ] = "Configuratie" ;
+ Text [ swedish ] = "Konfiguration" ;
+ Text [ danish ] = "Konfiguration" ;
+ Text [ portuguese ] = "Configurao" ;
+ Text [ portuguese_brazilian ] = "Konfiguration" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Konfiguracja";
+ Text[ japanese ] = "ݒ";
+ Text[ chinese_traditional ] = "tm";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Configuratie";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Konfigrasyon";
+ Text[ language_user1 ] = " ";
+};
+ModalDialog DLG_MACROQUERY
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Moveable = TRUE ;
+ Size = MAP_APPFONT ( 163 , 94 ) ;
+ Text = "Makro ausfhren" ;
+ Text [ english ] = "Execute Macro" ;
+ Text [ english_us ] = "Execute Macro" ;
+ Text [ french ] = "Excuter la macro" ;
+ TEXT[ italian ] = "Esegui macro";
+ TEXT[ portuguese_brazilian ] = "Makro ausfhren";
+ TEXT[ portuguese ] = "Executar macro";
+ TEXT[ danish ] = "Udfr makro";
+ TEXT[ swedish ] = "Utfr makro";
+ TEXT[ dutch ] = "Macro uitvoeren";
+ TEXT[ spanish ] = "Ejecutar macro";
+ TEXT[ chinese_simplified ] = "ִк";
+ TEXT[ russian ] = " ";
+ TEXT[ polish ] = "Wykonaj makro";
+ TEXT[ japanese ] = "ϸۂ̎s";
+ TEXT[ chinese_traditional ] = "楨";
+ TEXT[ arabic ] = " ";
+ FixedImage ICN_MESSAGE
+ {
+ Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 30 , 30 ) ;
+ };
+ FixedText FT_MESSAGE
+ {
+ WordBreak = TRUE ;
+ Pos = MAP_APPFONT ( 42 , 6 ) ;
+ Size = MAP_APPFONT ( 115 , 46 ) ;
+ Text = "Es wurde ein Ereignis ausgelst, auf das ein Makro konfiguriert wurde. Mchten Sie dieses Makro ausfhren?" ;
+ Text [ English ] = "Es wurde ein Ereignis ausgelst, auf das ein Makro konfiguriert wurde. Mchten Sie dieses Makro ausfhren?" ;
+ Text [ english_us ] = "An event to which a macro is configured has been started. Do you want to execute the macro?" ;
+ Text [ portuguese_brazilian ] = "Es wurde ein Ereignis ausgelst, auf das ein Makro konfiguriert wurde. Mchten Sie dieses Makro ausfhren?" ;
+ Text [ swedish ] = "En hndelse utlstes fr vilket ett makro konfigurerades. Skall detta makro utfras?" ;
+ Text [ danish ] = "Der blev udlst en handling, som en makro er konfigureret til. Vil du udfre denne makro?" ;
+ Text [ italian ] = " stato attivato un evento che stato configurato su una macro. Esguire la macro?" ;
+ Text [ spanish ] = "Se ha iniciado un acontecimiento en el cual se ha configurado una macro. Desea que se ejecute esta macro?" ;
+ Text [ french ] = "Un vnement s'est produit pour lequel une macro a t configure. Dsirez-vous l'excuter?" ;
+ Text [ dutch ] = "Er werd een gebeurtenis veroorzaakt, waarop een macro werd geconfigureerd. Wilt u dit macro uitvoeren?" ;
+ Text [ portuguese ] = "Foi produzido um acontecimento para o qual foi configurada uma macro. Deseja execut-la?" ;
+ Text[ chinese_simplified ] = "ֱһ꣬Ҫִꣿ";
+ Text[ russian ] = " , . ?";
+ Text[ polish ] = "Zostao uruchomione wydarzenie, do ktrego zostao skonfigurowane makro. Czy chcesz wykona to makro?";
+ Text[ japanese ] = "ϸۂŐݒ肵s_@Jn܂Bϸۂs܂?";
+ Text[ chinese_traditional ] = "ާ@OӦۤ@ӥMznoӥH";
+ Text[ arabic ] = " . ";
+ Text[ dutch ] = "Er werd een gebeurtenis veroorzaakt, waarop een macro werd geconfigureerd. Wilt u dit macro uitvoeren?";
+ Text[ chinese_simplified ] = "ֱһ꣬Ҫִꣿ";
+ Text[ greek ] = " , . ;";
+ Text[ korean ] = "ũΰ ̺Ʈ Ǿϴ. ũθ Ͻðڽϱ?";
+ Text[ turkish ] = "Balatlan olay ile ilgili bir yaplandrlm bir makro mevcut. Bu makroyu altrmak istiyor musunuz?";
+ Text[ language_user1 ] = " ";
+ };
+ CheckBox CB_WARNING
+ {
+ Pos = MAP_APPFONT ( 6 , 58 ) ;
+ Size = MAP_APPFONT ( 151 , 10 ) ;
+ Text = " Fr dieses Dokument nicht mehr warnen" ;
+ Text [ ENGLISH ] = " Fr dieses Dokument nicht mehr warnen" ;
+ Text [ portuguese ] = "No avisar mais para este documento" ;
+ Text [ english_us ] = "Do not warn again for this document" ;
+ Text [ portuguese_brazilian ] = "Fr dieses Dokument nicht mehr warnen" ;
+ Text [ swedish ] = "Varna inte mer fr det hr dokumentet" ;
+ Text [ danish ] = "Advar ikke igen for dette dokument" ;
+ Text [ italian ] = "Non avvertire pi per il documento corrente" ;
+ Text [ spanish ] = "Desactivar las advertencias para este documento" ;
+ Text [ french ] = "Ne plus afficher d'avertissement pour ce document" ;
+ Text [ dutch ] = "Voor dit document niet meer waarschuwen" ;
+ Text[ chinese_simplified ] = "ҪٴΪĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nie pokazuj wicej ostrzeenia dla tego dokumentu";
+ Text[ japanese ] = "޷Ă̂߂ɂx͂Ȃʼn";
+ Text[ chinese_traditional ] = "nAoӤ󴣥Xĵi";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Voor dit document niet meer waarschuwen";
+ Text[ chinese_simplified ] = "ҪٴΪĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ̻ ";
+ Text[ turkish ] = "Bu belge iin bir daha uyar grntleme";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 44 , 74 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "Ausfhren" ;
+ Text [ ENGLISH ] = "Execute" ;
+ Text [ portuguese ] = "Executar" ;
+ Text [ english_us ] = "Execute" ;
+ Text [ portuguese_brazilian ] = "Ausfhren" ;
+ Text [ swedish ] = "Utfr" ;
+ Text [ danish ] = "Udfr" ;
+ Text [ italian ] = "Esegui" ;
+ Text [ spanish ] = "Ejecutar" ;
+ Text [ french ] = "Excuter" ;
+ Text [ dutch ] = "Uitvoeren" ;
+ Text[ chinese_simplified ] = "ִ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wykonaj";
+ Text[ japanese ] = "s";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Uitvoeren";
+ Text[ chinese_simplified ] = "ִ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "altr";
+ Text[ language_user1 ] = " ";
+ };
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 97 , 74 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ Text = "Nicht Ausfhren" ;
+ Text [ ENGLISH ] = "Don't execute" ;
+ Text [ english_us ] = "Don't execute" ;
+ Text [ portuguese_brazilian ] = "Nicht Ausfhren" ;
+ Text [ swedish ] = "Utfr inte" ;
+ Text [ danish ] = "Udfr ikke" ;
+ Text [ italian ] = "Non eseguire" ;
+ Text [ spanish ] = "No ejecutar" ;
+ Text [ french ] = "Ne pas lancer" ;
+ Text [ dutch ] = "Niet uitvoeren" ;
+ Text [ portuguese ] = "No executar" ;
+ Text[ chinese_simplified ] = "ִ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nie wykonuj";
+ Text[ japanese ] = "sȂ";
+ Text[ chinese_traditional ] = "n";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Niet uitvoeren";
+ Text[ chinese_simplified ] = "ִ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "altrma";
+ Text[ language_user1 ] = " ";
+ };
+ TEXT[ dutch ] = "Macro uitvoeren";
+ TEXT[ chinese_simplified ] = "ִк";
+ TEXT[ greek ] = " ";
+ TEXT[ korean ] = "ũ ";
+ TEXT[ turkish ] = "Makroyu altr";
+ TEXT[ language_user1 ] = " ";
+};
+
+
diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx
new file mode 100644
index 000000000000..0c08a8e60215
--- /dev/null
+++ b/sfx2/source/config/evntconf.cxx
@@ -0,0 +1,714 @@
+/*************************************************************************
+ *
+ * $RCSfile: evntconf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SFXLSTNER_HXX //autogen
+#include <svtools/lstner.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _SB_SBMOD_HXX //autogen
+#include <basic/sbmod.hxx>
+#endif
+#ifndef _URLOBJ_HXX //autogen
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _SBXCLASS_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#pragma hdrstop
+
+#include "evntconf.hxx"
+
+#include "macrconf.hxx"
+#include "docfile.hxx"
+#include "app.hxx"
+#include "objsh.hxx"
+#include "dispatch.hxx"
+#include "config.hrc"
+#include "sfxresid.hxx"
+#include "cfgmgr.hxx"
+#include "macropg.hxx"
+#include "docinf.hxx"
+
+// -----------------------------------------------------------------------
+
+static const USHORT nCompatVersion = 3;
+static const USHORT nOldVersion = 4;
+static const USHORT nVersion = 5;
+
+TYPEINIT1(SfxEventHint, SfxHint);
+
+// class SfxMacroQueryDlg_Impl -------------------------------------------
+
+class SfxMacroQueryDlg_Impl : public ModalDialog
+{
+ FixedImage aIcon;
+ FixedText aFTMessage;
+ CheckBox aCBWarning;
+ OKButton aOKButton;
+ CancelButton aCancelButton;
+
+public:
+ SfxMacroQueryDlg_Impl( const ResId& rResId );
+ void SetWarningState( BOOL bOn )
+ { aCBWarning.Check( !bOn ); }
+ BOOL GetWarningState() const
+ { return !aCBWarning.IsChecked(); }
+ void HideCheckBox()
+ { aCBWarning.Hide(); }
+};
+
+// -----------------------------------------------------------------------
+
+SfxMacroQueryDlg_Impl::SfxMacroQueryDlg_Impl( const ResId& rResId ) :
+ ModalDialog( NULL, rResId ),
+ aIcon( this, ResId( ICN_MESSAGE ) ),
+ aFTMessage( this, ResId( FT_MESSAGE ) ),
+ aCBWarning( this, ResId( CB_WARNING ) ),
+ aOKButton( this, ResId( BTN_OK ) ),
+ aCancelButton( this, ResId( BTN_CANCEL ) )
+{
+ FreeResource();
+ aCBWarning.Show(FALSE);
+ long nY = aCBWarning.GetPosPixel().Y();
+ aOKButton.SetPosPixel( Point( aOKButton.GetPosPixel().X(), nY ) );
+ aCancelButton.SetPosPixel( Point( aCancelButton.GetPosPixel().X(), nY ) );
+ SetOutputSizePixel( Size( GetOutputSizePixel().Width(),
+ nY + aOKButton.GetSizePixel().Height() + 3 ) );
+ aIcon.SetImage( QueryBox::GetStandardImage() );
+}
+
+// class SfxAsyncEvent_Impl ----------------------------------------------
+
+class SfxAsyncEvent_Impl : public SfxListener
+{
+ String aArgs;
+ SfxObjectShell* pSh;
+ const SvxMacro* pMacro;
+ Timer *pTimer;
+
+public:
+
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ SfxAsyncEvent_Impl( SfxObjectShell *pDoc, const SvxMacro *pMacro, const String& rArgs );
+ ~SfxAsyncEvent_Impl();
+ DECL_LINK( TimerHdl, Timer*);
+};
+
+// -----------------------------------------------------------------------
+
+void SfxAsyncEvent_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
+ {
+ pTimer->Stop();
+ delete this;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+SfxAsyncEvent_Impl::SfxAsyncEvent_Impl( SfxObjectShell *pDoc, const SvxMacro *pMac, const String& rArgs )
+ : aArgs( rArgs )
+ , pSh( pDoc )
+ , pMacro( pMac )
+{
+ if( pSh ) StartListening( *pSh );
+ pTimer = new Timer;
+ pTimer->SetTimeoutHdl( LINK(this, SfxAsyncEvent_Impl, TimerHdl) );
+ pTimer->SetTimeout( 0 );
+ pTimer->Start();
+}
+
+// -----------------------------------------------------------------------
+
+SfxAsyncEvent_Impl::~SfxAsyncEvent_Impl()
+{
+ delete pTimer;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK(SfxAsyncEvent_Impl, TimerHdl, Timer*, pTimer)
+{
+ pTimer->Stop();
+ ScriptType eSType = pMacro->GetScriptType();
+ BOOL bIsBasic = ( eSType == STARBASIC );
+ if ( bIsBasic && StarBASIC::IsRunning() )
+ // Neues eventgebundenes Macro erst ausf"uhren, wenn gerade kein anderes Macro mehr l"auft
+ pTimer->Start();
+ else
+ {
+ SFX_APP()->GetMacroConfig()->ExecuteMacro( pSh, pMacro, aArgs );
+ delete this;
+ }
+
+ return 0L;
+}
+
+//==========================================================================
+
+SfxEventConfiguration::SfxEventConfiguration()
+ : pDocEventConfig( NULL )
+{
+ // Array zum Ermitteln der Bindungen
+ pEventArr = new SfxEventArr_Impl;
+
+ // Einen default entry eingf"ugen
+ const SfxEvent_Impl *pEvent = new SfxEvent_Impl(String(), 0);
+ pEventArr->Insert(pEvent, 0);
+
+ // Die EventConfig f"ur globale Bindungen
+ pAppEventConfig =
+ new SfxEventConfigItem_Impl( SFX_ITEMTYPE_APPEVENTCONFIG, this );
+}
+
+//==========================================================================
+
+SfxEventConfiguration::~SfxEventConfiguration()
+{
+ for (USHORT n=0; n<pEventArr->Count(); n++)
+ delete (*pEventArr)[n];
+ delete pEventArr;
+ delete pAppEventConfig;
+}
+
+//==========================================================================
+
+void SfxEventConfiguration::RegisterEvent(USHORT nId, const String& rName)
+{
+ USHORT nCount = pEventArr->Count();
+ const SfxEvent_Impl *pEvent = new SfxEvent_Impl(rName, nId);
+ pEventArr->Insert(pEvent, nCount);
+}
+
+//==========================================================================
+
+const String& SfxEventConfiguration::GetEventName(USHORT nId) const
+{
+ DBG_ASSERT(pEventArr,"Keine Events angemeldet!");
+ USHORT nCount = pEventArr->Count();
+ for (USHORT n=1; n<nCount; n++)
+ {
+ if ((*pEventArr)[n]->nEventId == nId)
+ {
+ return (*pEventArr)[n]->aEventName;
+ }
+ }
+
+ DBG_ERROR("Event nicht gefunden!");
+ return (*pEventArr)[0]->aEventName;
+}
+
+//==========================================================================
+
+USHORT SfxEventConfiguration::GetEventId(const String& rName) const
+{
+ DBG_ASSERT(pEventArr,"Keine Events angemeldet!");
+ USHORT nCount = pEventArr->Count();
+ for (USHORT n=1; n<nCount; n++)
+ {
+ if ((*pEventArr)[n]->aEventName == rName)
+ {
+ return (*pEventArr)[n]->nEventId;
+ }
+ }
+
+ DBG_ERROR("Event nicht gefunden!");
+ return SFX_NO_EVENT;
+}
+
+void SfxEventConfiguration::ConfigureEvent( USHORT nId, const String& rMacro, SfxObjectShell *pObjSh )
+{
+ String aLibrary, aModule, aFunction;
+ if ( STRING_NOTFOUND == rMacro.Search( '(' ) )
+ {
+ // interne Syntax: Library.Module.Function
+ aFunction = rMacro.GetToken( 2, '.' );
+ aModule = rMacro.GetToken( 1, '.' );
+ aLibrary = rMacro.GetToken( 0, '.' );
+ }
+ else
+ {
+ // UI-Syntax: Function(Library.Module)
+ aFunction = rMacro.GetToken( 0, '(' );
+ String aModLib( rMacro.GetToken( 1, '(' ) );
+ aLibrary = aModLib.GetToken( 0, '.' );
+ aModule = aModLib.GetToken( 1, '.' ).GetToken( 0, ')' );
+ }
+
+ //Ist ein DocBasic-Macro oder nicht ?
+ BOOL bDocBasic = FALSE;
+ if ( pObjSh )
+ {
+ BasicManager *pMgr = pObjSh->GetBasicManager();
+ StarBASIC* pLib = pMgr->GetLib( aLibrary );
+ if ( pLib )
+ {
+ SbModule* pMod =
+ pLib->FindModule( aModule );
+ if ( pMod && pMod->GetMethods()->Find( aFunction, SbxCLASS_METHOD ) )
+ bDocBasic = TRUE;
+ }
+ }
+
+ // Event konfigurieren
+ String aCode( aLibrary );
+ if ( aCode.Len() )
+ {
+ aCode += '.';
+ aCode += aModule;
+ aCode += '.';
+ aCode += aFunction;
+ }
+
+ String aBasic;
+ if( bDocBasic )
+ aBasic = pObjSh->GetTitle();
+ else
+ aBasic = SFX_APP()->GetName();
+ SvxMacro aMacro( aCode, aBasic, STARBASIC );
+ ConfigureEvent( nId, aMacro, pObjSh );
+}
+
+void SfxEventConfiguration::ConfigureEvent( USHORT nId, const SvxMacro& rMacro, SfxObjectShell *pDoc )
+{
+ SvxMacro *pMacro = NULL;
+ if ( rMacro.GetMacName().Len() )
+ pMacro = new SvxMacro( rMacro.GetMacName(), rMacro.GetLibName(), rMacro.GetScriptType() );
+ if ( pDoc )
+ {
+ pDocEventConfig = pDoc->GetEventConfig_Impl( TRUE );
+ pDocEventConfig->ConfigureEvent( nId, pMacro );
+ }
+ else
+ {
+ // globale Bindung
+ pAppEventConfig->ConfigureEvent( nId, pMacro );
+ }
+}
+
+//==========================================================================
+
+void SfxEventConfiguration::ExecuteEvent(
+ USHORT nId, SfxObjectShell *pDoc, FASTBOOL bSynchron, const String& rArgs )
+{
+ pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL;
+ const SvxMacro* pMacro=NULL;
+ BOOL bDocMacro = TRUE;
+ if ( pDocEventConfig )
+ pMacro = pDocEventConfig->aMacroTable.Seek( nId );
+ if ( !pMacro )
+ {
+ pMacro = pAppEventConfig->aMacroTable.Seek( nId );
+ bDocMacro = FALSE;
+ }
+ else
+ {
+ bDocMacro = ( pMacro->GetLibName() != SFX_APP()->GetName()
+ && ! pMacro->GetLibName().EqualsAscii("StarDesktop") );
+ }
+
+ if ( pMacro )
+ {
+ SfxApplication *pApp = SFX_APP();
+ SfxMacroConfig *pCfg = pApp->GetMacroConfig();
+
+ if ( bDocMacro )
+ {
+ if ( pCfg->CheckMacro( pDoc, pMacro ) )
+ {
+ BOOL bRet = !Warn_Impl( pDoc, pMacro );
+
+ // Und gleich abspeichern, wenn die Config in einer Vorlage
+ // sitzt und es das Event "CreateDoc" war
+ SfxDocumentInfo rDocInfo = pDoc->GetDocInfo();
+ if ( nId == SFX_EVENT_CREATEDOC && pDoc->GetConfigManager()->IsModified() &&
+ rDocInfo.HasTemplateConfig() )
+ {
+ const String aTemplName( rDocInfo.GetTemplateName() );
+ if ( aTemplName.Len() )
+ {
+ const String aTemplFileName( rDocInfo.GetTemplateFileName() );
+ SvStorageRef aStor = new SvStorage( aTemplFileName );
+ if ( SVSTREAM_OK == aStor->GetError() )
+ pDoc->GetConfigManager()->SaveConfig( aStor );
+ }
+ }
+
+ if ( bRet )
+ return;
+ }
+ }
+
+ if ( bSynchron )
+ pCfg->ExecuteMacro( pDoc, pMacro, rArgs );
+ else
+ new SfxAsyncEvent_Impl( pDoc, pMacro, rArgs );
+ }
+}
+
+//==========================================================================
+
+const SvxMacro* SfxEventConfiguration::GetMacroForEventId
+(
+ USHORT nId,
+ SfxObjectShell* pDoc
+)
+{
+ pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL;
+ const SvxMacro* pMacro=NULL;
+ if ( pDocEventConfig )
+ pMacro = pDocEventConfig->aMacroTable.Seek( nId );
+ if ( !pMacro )
+ pMacro = pAppEventConfig->aMacroTable.Seek( nId );
+ return pMacro;
+}
+
+const SfxMacroInfo* SfxEventConfiguration::GetMacroInfo
+(
+ USHORT nId,
+ SfxObjectShell* pDoc
+) const
+{
+ DBG_ASSERT(pEventArr,"Keine Events angemeldet!");
+
+ SfxEventConfigItem_Impl *pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL;
+ const SvxMacro* pMacro=NULL;
+ if ( pDocEventConfig )
+ pMacro = pDocEventConfig->aMacroTable.Seek( nId );
+ if ( !pMacro )
+ pMacro = pAppEventConfig->aMacroTable.Seek( nId );
+
+ return SFX_APP()->GetMacroConfig()->GetMacroInfo_Impl( pMacro );
+}
+
+//==========================================================================
+
+SfxEventConfigItem_Impl::SfxEventConfigItem_Impl( USHORT nConfigId,
+ SfxEventConfiguration *pCfg )
+ : SfxConfigItem( nConfigId )
+ , aMacroTable( 2, 2 )
+ , pEvConfig( pCfg )
+{
+ SetInternal(TRUE);
+ SetIndividual(TRUE);
+}
+
+void SfxEventConfigItem_Impl::Init( SfxConfigManager *pMgr )
+{
+ if ( GetConfigManager() == pMgr )
+ Initialize();
+ else
+ ReInitialize( pMgr );
+}
+
+//==========================================================================
+
+int SfxEventConfigItem_Impl::Load(SvStream& rStream)
+{
+ USHORT nFileVersion, nCount;
+ rStream >> nFileVersion;
+ if ( nFileVersion < nCompatVersion || nFileVersion > nVersion )
+ return SfxConfigItem::WARNING_VERSION;
+
+ if ( nFileVersion <= nOldVersion )
+ {
+ SvUShorts aSlotArray;
+ if (!aSlotArray.Count())
+ {
+ USHORT nCount = pEvConfig->GetEventCount();
+ for (USHORT n=0; n<nCount; n++)
+ aSlotArray.Insert((USHORT)0 ,n);
+ }
+ else
+ {
+ for (USHORT n=0; n<aSlotArray.Count(); n++)
+ {
+ if (aSlotArray[n])
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId(aSlotArray[n]);
+ aSlotArray[n] = 0;
+ }
+ }
+
+ if ( nFileVersion > nCompatVersion )
+ {
+ USHORT nWarn;
+ rStream >> nWarn;
+ bWarning = ( nWarn & 0x01 ) != 0;
+ bAlwaysWarning = ( nWarn & 0x02 ) != 0;
+ }
+ else
+ bWarning = bAlwaysWarning = FALSE;
+
+ rStream >> nCount;
+ USHORT nId;
+ USHORT i;
+ for (i=0; i<nCount; i++)
+ {
+ SfxMacroInfo aInfo( GetConfigManager_Impl()->GetObjectShell() );
+ rStream >> nId >> aInfo;
+
+ USHORT nCount = aSlotArray.Count();
+ for (USHORT n=0; n<nCount; n++)
+ {
+ if ((*pEvConfig->pEventArr)[n+1]->nEventId == nId)
+ {
+ aSlotArray[n] = aInfo.GetSlotId();
+ break;
+ }
+ }
+ }
+
+ aMacroTable.DelDtor();
+ SfxMacroConfig *pMC = SFX_APP()->GetMacroConfig();
+ for (i=0; i<aSlotArray.Count(); i++)
+ {
+ if (aSlotArray[i])
+ {
+ const SfxMacroInfoPtr pInfo = pMC->GetMacroInfo(aSlotArray[i]);
+ SvxMacro *pMacro = new SvxMacro( pInfo->GetQualifiedName(),
+ pInfo->GetBasicName(), STARBASIC );
+ aMacroTable.Insert( (*pEvConfig->pEventArr)[i+1]->nEventId, pMacro );
+ }
+ }
+ }
+ else
+ {
+ USHORT nWarn;
+ rStream >> nWarn;
+ bWarning = ( nWarn & 0x01 ) != 0;
+ bAlwaysWarning = ( nWarn & 0x02 ) != 0;
+ aMacroTable.Read( rStream );
+ }
+
+ return SfxConfigItem::ERR_OK;
+}
+
+//==========================================================================
+
+BOOL SfxEventConfigItem_Impl::Store(SvStream& rStream)
+{
+ USHORT nWarn=0;
+ if ( bWarning )
+ nWarn |= 0x01;
+ if ( bAlwaysWarning )
+ nWarn |= 0x02;
+ rStream << nVersion << nWarn;
+ aMacroTable.Write( rStream );
+ return TRUE;
+}
+
+//==========================================================================
+
+BOOL SfxEventConfigItem_Impl::Reconfigure(SvStream& rStream, BOOL bDefault)
+{
+ return SfxConfigItem::Reconfigure(rStream, bDefault);
+}
+
+//==========================================================================
+
+String SfxEventConfigItem_Impl::GetName() const
+{
+ return String(SfxResId(STR_EVENTCONFIG));
+}
+
+//==========================================================================
+
+void SfxEventConfigItem_Impl::UseDefault()
+{
+ bWarning = TRUE;
+ bAlwaysWarning = FALSE;
+
+ aMacroTable.DelDtor();
+ SfxConfigItem::UseDefault();
+}
+
+//==========================================================================
+
+SfxEventConfigItem_Impl::~SfxEventConfigItem_Impl()
+{
+}
+
+//==========================================================================
+
+void SfxEventConfigItem_Impl::ConfigureEvent( USHORT nId, SvxMacro *pMacro )
+{
+ if ( aMacroTable.Seek( nId ) )
+ {
+ if ( pMacro )
+ aMacroTable.Replace( nId, pMacro );
+ else
+ aMacroTable.Remove( nId );
+ }
+ else if ( pMacro )
+ aMacroTable.Insert( nId, pMacro );
+ SetDefault(FALSE);
+}
+
+BOOL SfxEventConfiguration::IsWarningEnabled() const
+{
+ return pAppEventConfig->bWarning;
+}
+
+BOOL SfxEventConfiguration::IsWarningForced() const
+{
+ return pAppEventConfig->bAlwaysWarning;
+}
+
+void SfxEventConfiguration::SetWarningEnabled( BOOL bOn )
+{
+ if ( pAppEventConfig->bWarning != bOn )
+ {
+ pAppEventConfig->bWarning = bOn;
+ pAppEventConfig->SetDefault( FALSE );
+ }
+}
+
+void SfxEventConfiguration::SetWarningForced( BOOL bOn )
+{
+ if ( pAppEventConfig->bAlwaysWarning != bOn )
+ {
+ pAppEventConfig->bAlwaysWarning = bOn;
+ pAppEventConfig->SetDefault( FALSE );
+ }
+}
+
+
+BOOL SfxEventConfiguration::Warn_Impl( SfxObjectShell *pDoc, const SvxMacro* pMacro )
+{
+ BOOL bWarn = FALSE;
+ if ( pDoc )
+ {
+ pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL;
+ if ( !pDocEventConfig )
+ return TRUE; // IsSecure ???
+
+ // Wenn das Macro sowieso nicht ausgef"uhrt wird, mu\s auch nicht gefragt werden
+ if ( pMacro->GetScriptType() == STARBASIC && !pDoc->IsSecure() )
+ return FALSE;
+
+ // Bei dokumentgebundenen Macros WarningStatus checken
+ // Wenn "Immer warnen" angeschaltet ist, Warnung ausgeben
+ bWarn = pAppEventConfig->bAlwaysWarning;
+ if ( bWarn )
+ {
+ SfxMacroQueryDlg_Impl aBox ( SfxResId( DLG_MACROQUERY ) );
+ if ( aBox.Execute() )
+ bWarn = FALSE;
+ }
+ }
+
+ return !bWarn;
+}
+
+void SfxEventConfiguration::AddEvents( SfxMacroTabPage* pPage ) const
+{
+ DBG_ASSERT(pEventArr,"Keine Events angemeldet!");
+ USHORT nCount = pEventArr->Count();
+ for (USHORT n=1; n<nCount; n++)
+ pPage->AddEvent( (*pEventArr)[n]->aEventName, (*pEventArr)[n]->nEventId );
+}
+
+SvxMacroTableDtor* SfxEventConfiguration::GetAppEventTable()
+{
+ return &pAppEventConfig->aMacroTable;
+}
+
+SvxMacroTableDtor* SfxEventConfiguration::GetDocEventTable( SfxObjectShell*pDoc )
+{
+ pDocEventConfig = pDoc ? pDoc->GetEventConfig_Impl() : NULL;
+ if ( pDocEventConfig )
+ return &pDocEventConfig->aMacroTable;
+ return NULL;
+}
+
+void SfxEventConfiguration::SetAppEventTable( const SvxMacroTableDtor& rTable )
+{
+ pAppEventConfig->aMacroTable = rTable;
+ pAppEventConfig->SetDefault(FALSE);
+}
+
+void SfxEventConfiguration::SetDocEventTable( SfxObjectShell *pDoc,
+ const SvxMacroTableDtor& rTable )
+{
+ if ( pDoc )
+ {
+ pDocEventConfig = pDoc->GetEventConfig_Impl( TRUE );
+ pDocEventConfig->aMacroTable = rTable;
+ pDocEventConfig->SetDefault(FALSE);
+ }
+ else
+ DBG_ERROR( "Kein Dokument!" );
+}
+
+
diff --git a/sfx2/source/config/makefile.mk b/sfx2/source/config/makefile.mk
new file mode 100644
index 000000000000..acc016f966a1
--- /dev/null
+++ b/sfx2/source/config/makefile.mk
@@ -0,0 +1,115 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=config
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+# defaults for cppumaker
+# UNOUCRBASE=UCR
+# UNOUCRRDB=$(SOLARUCRDIR)$/uce.rdb
+# UNOUCROUT=$(OUT)$/inc
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+# Every source directory generates headers in a own output directory to
+# enable parallel building of the source directories within a project!
+UNOUCROUT=$(OUT)$/inc$/$(PRJNAME)$/$(TARGET)
+INCPRE+=$(UNOUCROUT)
+
+UNOTYPES=\
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.beans.XPropertyChangeListener \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.uno.XWeak \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.frame.XConfigManager \
+ com.sun.star.registry.XSimpleRegistry
+
+SRCFILES = \
+ config.src
+
+SLOFILES = \
+ $(SLO)$/saveopt.obj \
+ $(SLO)$/cfgmgr.obj \
+ $(SLO)$/cfgitem.obj \
+ $(SLO)$/misccfg.obj \
+ $(SLO)$/evntconf.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
new file mode 100644
index 000000000000..ea5e1a3f7c67
--- /dev/null
+++ b/sfx2/source/control/bindings.cxx
@@ -0,0 +1,3022 @@
+/*************************************************************************
+ *
+ * $RCSfile: bindings.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXITEMITER_HXX //autogen
+#include <svtools/itemiter.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _AEITEM_HXX //autogen
+#include <svtools/aeitem.hxx>
+#endif
+#include <svtools/intitem.hxx>
+#include <svtools/stritem.hxx>
+
+#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
+#include <com/sun/star/util/XURLTransformer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
+#include <com/sun/star/frame/XDispatch.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
+#include <com/sun/star/frame/XStatusListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTION_HPP_
+#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HPP_
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_DISPATCHDESCRIPTOR_HPP_
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#include <unotools/processfactory.hxx>
+
+#pragma hdrstop
+
+#include "ipfrm.hxx"
+#include "ipenv.hxx"
+#include "interno.hxx"
+#include "bindings.hxx"
+#include "msg.hxx"
+#include "statcach.hxx"
+#include "ctrlitem.hxx"
+#include "app.hxx"
+#include "appdata.hxx"
+#include "dispatch.hxx"
+#include "request.hxx"
+#include "objface.hxx"
+#include "sfxtypes.hxx"
+#include "workwin.hxx"
+#include "macrconf.hxx"
+#include "unoctitm.hxx"
+#include "sfx.hrc"
+#include "sfxuno.hxx"
+#include "topfrm.hxx"
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+DBG_NAME(SfxBindingsMsgPos);
+DBG_NAME(SfxBindingsUpdateServers);
+DBG_NAME(SfxBindingsCreateSet);
+DBG_NAME(SfxBindingsUpdateCtrl1);
+DBG_NAME(SfxBindingsUpdateCtrl2);
+DBG_NAME(SfxBindingsNextJob_Impl0);
+DBG_NAME(SfxBindingsNextJob_Impl);
+DBG_NAME(SfxBindingsUpdate_Impl);
+DBG_NAME(SfxBindingsInvalidateAll);
+
+//====================================================================
+
+#define TIMEOUT_FIRST 20
+#define TIMEOUT_UPDATING 0
+#define TIMEOUT_IDLE 2500
+
+static sal_uInt32 nCache1 = 0;
+static sal_uInt32 nCache2 = 0;
+
+//====================================================================
+//TYPEINIT1(SfxSlotInterceptorItem, SfxPoolItem);
+
+DECL_PTRARRAY(SfxStateCacheArr_Impl, SfxStateCache*, 32, 16);
+DECL_PTRARRAY(SfxInterceptorArr_Impl, SfxSlotInterceptor*, 2, 2);
+
+//====================================================================
+
+struct SfxSlotInterceptor_Impl
+{
+ SfxBindings* _pBindings;
+ sal_Bool _bIsActive;
+};
+
+//====================================================================
+
+class SfxBindings_Impl
+
+/* [Beschreibung]
+
+ Diese Implementations-Struktur der Klasse SfxBindings dient
+ der Entkopplung von "Anderungen vom exportierten Interface sowie
+ der Verringerung von extern sichtbaren Symbolen.
+
+ Eine Instanz exisitiert pro SfxBindings-Instanz f"ur deren Laufzeit.
+*/
+
+{
+public:
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv;
+ SfxUnoControllerArr_Impl*
+ pUnoCtrlArr;
+ SfxWorkWindow* pWorkWin;
+ SfxBindings* pSubBindings;
+ SfxBindings* pSuperBindings;
+ SfxInterceptorArr_Impl* pInterceptors; // Slots vor dem Dispatcher abfangen
+ SfxStateCacheArr_Impl* pCaches; // je ein cache fuer jede gebundene
+ sal_uInt16 nCachedFunc1; // index der zuletzt gerufenen
+ sal_uInt16 nCachedFunc2; // index der vorletzt gerufenen
+ sal_uInt16 nMsgPos; // Message-Position, ab der zu aktualisieren ist
+ SfxPopupAction ePopupAction; // in DeleteFloatinWindow() abgefragt
+ sal_Bool bMsgDirty; // wurde ein MessageServer invalidiert?
+ sal_Bool bAllMsgDirty; // wurden die MessageServer invalidiert?
+ sal_Bool bAllDirty; // nach InvalidateAll
+ sal_Bool bCtrlReleased; // waehrend EnterRegistrations
+ AutoTimer aTimer; // fuer volatile Slots
+ sal_Bool bInUpdate; // fuer Assertions
+ sal_Bool bInNextJob; // fuer Assertions
+ sal_Bool bFirstRound; // Erste Runde im Update
+ sal_uInt16 nFirstShell; // Shell, die in erster Runde bevorzugt wird
+// sal_Bool bInExecute; // zum Test auf synchrone Executes
+ sal_uInt16 nOwnRegLevel; // z"ahlt die echten Locks, ohne die der SuperBindings
+
+ void InsertSlotInterceptor( SfxSlotInterceptor* );
+ void RemoveSlotInterceptor( SfxSlotInterceptor* );
+};
+
+void SfxBindings_Impl::InsertSlotInterceptor( SfxSlotInterceptor* pInter )
+{
+ // ggf. Interceptor-Liste on-demand erzeugen
+ if ( !pInterceptors )
+ pInterceptors = new SfxInterceptorArr_Impl;
+ pInterceptors->Insert( 0, pInter );
+
+ if ( pSubBindings )
+ pSubBindings->pImp->InsertSlotInterceptor( pInter );
+}
+
+void SfxBindings_Impl::RemoveSlotInterceptor( SfxSlotInterceptor* pInter )
+{
+ // bei den Bindings austragen
+ pInterceptors->Remove( pInter );
+
+ // gar kein SfxSlotInterceptor mehr => auf 0 setzen (f"ur Schnellabfrage)
+ if ( !pInterceptors->Count() )
+ DELETEZ( pInterceptors );
+
+ if ( pSubBindings )
+ pSubBindings->pImp->RemoveSlotInterceptor( pInter );
+}
+
+//--------------------------------------------------------------------
+
+struct SfxFoundCache_Impl
+
+/* [Beschreibung]
+
+ In Instanzen dieser Struktur werden in <SfxBindings::CreateSet_Impl()>
+ weitere Informationen zu den gemeinsam von einem <Slot-Server> zu
+ erfragenden Status gesammelt, deren Ids dort in die Ranges eines
+ <SfxItemSet>s aufgenommen werden.
+
+ Diese Informationen werden w"ahrend der Suche nach den zusammen
+ upzudatenden Ids sowieso als Zwischenergebnis ermittelt und nachher
+ wieder ben"otigt, daher macht es Sinn, sie f"ur diesen kurzen Zeitraum
+ gleich aufzubewahren.
+*/
+
+{
+ sal_uInt16 nSlotId; // die Slot-Id
+ sal_uInt16 nWhichId; // falls verf"ugbar die Which-Id, sonst nSlotId
+ const SfxSlot* pSlot; // Pointer auf den <Master-Slot>
+ SfxStateCache* pCache; // Pointer auf den StatusCache, ggf. 0
+
+ SfxFoundCache_Impl():
+ nSlotId(0),
+ nWhichId(0),
+ pSlot(0),
+ pCache(0)
+ {}
+
+ SfxFoundCache_Impl(SfxFoundCache_Impl&r):
+ nSlotId(r.nSlotId),
+ nWhichId(r.nWhichId),
+ pSlot(r.pSlot),
+ pCache(r.pCache)
+ {}
+
+ SfxFoundCache_Impl(sal_uInt16 nS, sal_uInt16 nW, const SfxSlot *pS, SfxStateCache *pC ):
+ nSlotId(nS),
+ nWhichId(nW),
+ pSlot(pS),
+ pCache(pC)
+ {}
+
+ int operator<( const SfxFoundCache_Impl &r ) const
+ { return nWhichId < r.nWhichId; } const
+
+ int operator==( const SfxFoundCache_Impl &r )
+ { return nWhichId== r.nWhichId; }
+};
+
+//--------------------------------------------------------------------------
+
+SV_DECL_PTRARR_SORT_DEL(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*, 16, 16 );
+SV_IMPL_OP_PTRARR_SORT(SfxFoundCacheArr_Impl, SfxFoundCache_Impl*);
+
+//==========================================================================
+
+SfxBindings::SfxBindings()
+
+/* [Beschreibung]
+
+ Konstruktor der Klasse SfxBindings. Genau eine Instanz wird automatisch
+ von der <SfxApplication> vor <SfxApplication::Init()> angelegt. Wird
+ eine Instanz ben"otigt, z.B. zum Invalidieren von Slots, sollte diese
+ "uber den zugeh"origen <SfxViewFrame> besorgt werden. Bestimmte
+ SfxViewFrame Subklassen (z.B. <SfxInPlaceFrame>) legen ihre eigene
+ Instanz der SfxBindings an.
+
+ <SfxControllerItem> Instanzen k"onnen erst angelegt werden, wenn
+ die zugeh"orige SfxBindings Instanz existiert.
+*/
+
+: pImp(new SfxBindings_Impl),
+ pDispatcher(0),
+ nRegLevel(1) // geht erst auf 0, wenn Dispatcher gesetzt
+{
+ pImp->nMsgPos = 0;
+ pImp->bAllMsgDirty = sal_True;
+ pImp->bMsgDirty = sal_True;
+ pImp->bAllDirty = sal_True;
+ pImp->ePopupAction = SFX_POPUP_DELETE;
+ pImp->nCachedFunc1 = 0;
+ pImp->nCachedFunc2 = 0;
+ pImp->bCtrlReleased = sal_False;
+ pImp->bFirstRound = sal_False;
+ pImp->bInNextJob = sal_False;
+ pImp->bInUpdate = sal_False;
+// pImp->bInExecute = sal_False;
+ pImp->pSubBindings = NULL;
+ pImp->pSuperBindings = NULL;
+ pImp->pWorkWin = NULL;
+ pImp->pUnoCtrlArr = NULL;
+ pImp->nOwnRegLevel = nRegLevel;
+
+ // all caches are valid (no pending invalidate-job)
+ // create the list of caches
+ pImp->pCaches = new SfxStateCacheArr_Impl;
+ pImp->aTimer.SetTimeoutHdl( LINK(this, SfxBindings, NextJob_Impl) );
+ pImp->pInterceptors = 0;
+}
+
+//====================================================================
+
+SfxBindings::~SfxBindings()
+
+/* [Beschreibung]
+
+ Destruktor der Klasse SfxBindings. Die eine, f"ur jede <SfxApplication>
+ existierende Instanz wird von der <SfxApplication> nach Ausf"urhung
+ von <SfxApplication::Exit()> automatisch zerst"ort.
+
+ Noch existierende <SfxControllerItem> Instanzen, die bei dieser
+ SfxBindings Instanz angemeldet sind, werden im Destruktor
+ automatisch zerst"ort. Dies sind i.d.R. Floating-Toolboxen, Value-Sets
+ etc. Arrays von SfxControllerItems d"urfen zu diesem Zeitpunkt nicht
+ mehr exisitieren.
+*/
+
+{
+ // Die SubBindings sollen ja nicht gelocked werden !
+ pImp->pSubBindings = NULL;
+
+ ENTERREGISTRATIONS();
+
+ pImp->aTimer.Stop();
+ DeleteControllers_Impl();
+
+ // Caches selbst l"oschen
+ sal_uInt16 nCount = pImp->pCaches->Count();
+ for ( sal_uInt16 nCache = 0; nCache < nCount; ++nCache )
+ delete pImp->pCaches->GetObject(nCache);
+
+ delete pImp->pCaches;
+ delete pImp;
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::DeleteControllers_Impl()
+
+/* [Beschreibung]
+
+ Interne Methode zum l"oschen noch existierender <SfxControllerItem>
+ Instanzen, die bei dieser SfxBindings Instanz angemeldet sind.
+
+ Dies sind i.d.R. <SfxPopupWindow>s. Nich sich selbst geh"orende
+ SfxControllerItems d"urfen bei Aufruf nur noch existieren, wenn sie
+ einem der restlichen SfxPopupWindows geh"oren.
+
+
+ [Anmerkung]
+
+ Wird beim Beenden der Applikation gerufen, bevor das Applikations-
+ Fenster gel"oscht wird.
+*/
+
+{
+ // in der ersten Runde den SfxPopupWindows l"oschen
+ sal_uInt16 nCount = pImp->pCaches->Count();
+ sal_uInt16 nCache;
+ for ( nCache = 0; nCache < nCount; ++nCache )
+ {
+ // merken wo man ist
+ SfxStateCache *pCache = pImp->pCaches->GetObject(nCache);
+ sal_uInt16 nSlotId = pCache->GetId();
+
+ // SfxPopupWindow l"oschen lassen
+ pCache->DeleteFloatingWindows();
+
+ // da der Cache verkleinert worden sein kann, wiederaufsetzen
+ sal_uInt16 nNewCount = pImp->pCaches->Count();
+ if ( nNewCount < nCount )
+ {
+ nCache = GetSlotPos(nSlotId);
+ if ( nCache >= nNewCount ||
+ nSlotId != pImp->pCaches->GetObject(nCache)->GetId() )
+ --nCache;
+ nCount = nNewCount;
+ }
+ }
+
+ // alle Caches l"oschen
+ for ( nCache = pImp->pCaches->Count(); nCache > 0; --nCache )
+ {
+ // Cache via ::com::sun::star::sdbcx::Index besorgen
+ SfxStateCache *pCache = pImp->pCaches->GetObject(nCache-1);
+
+ // alle Controller in dem Cache unbinden
+ SfxControllerItem *pNext;
+ for ( SfxControllerItem *pCtrl = pCache->GetItemLink();
+ pCtrl; pCtrl = pNext )
+ {
+ pNext = pCtrl->GetItemLink();
+ pCtrl->UnBind();
+ }
+
+ // Cache l"oschen
+ if( nCache-1 < pImp->pCaches->Count() )
+ delete (*pImp->pCaches)[nCache-1];
+ pImp->pCaches->Remove(nCache-1, 1);
+ }
+
+ if( pImp->pUnoCtrlArr )
+ {
+ sal_uInt16 nCount = pImp->pUnoCtrlArr->Count();
+ for ( sal_uInt16 n=nCount; n>0; n-- )
+ {
+ SfxUnoControllerItem *pCtrl = (*pImp->pUnoCtrlArr)[n-1];
+ pCtrl->ReleaseBindings();
+ }
+
+ DBG_ASSERT( !pImp->pUnoCtrlArr->Count(), "UnoControllerItems nicht entfernt!" );
+ DELETEZ( pImp->pUnoCtrlArr );
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxPopupAction SfxBindings::GetPopupAction_Impl() const
+{
+ return pImp->ePopupAction;
+}
+
+
+//--------------------------------------------------------------------
+
+void SfxBindings::HidePopups( FASTBOOL bHide )
+
+/* [Beschreibung]
+
+ Dieser Methode versteckt und zeigt die <SfxPopupWindows>, die aus
+ <SfxToolboxControl>s dieser SfxBindings-Instanz abgerissen wurden bzw.
+ floating <SfxChildWindow>-Instanzen dieser SfxBindings-Instanz.
+
+
+ [Anmerkung]
+
+ Es k"onnten noch weitere Floating-Windows exisitieren, die durch
+ diese Methode nicht erfa\st werden.
+*/
+
+{
+ // SfxPopupWindows hiden
+ HidePopupCtrls_Impl( bHide );
+ SfxBindings *pSub = pImp->pSubBindings;
+ while ( pSub )
+ {
+ pImp->pSubBindings->HidePopupCtrls_Impl( bHide );
+ pSub = pSub->pImp->pSubBindings;
+ }
+
+ // SfxChildWindows hiden
+ DBG_ASSERT( pDispatcher, "HidePopups not allowed without dispatcher" );
+ if ( pImp->pWorkWin )
+ pImp->pWorkWin->HidePopups_Impl( bHide, sal_True );
+}
+
+void SfxBindings::HidePopupCtrls_Impl( FASTBOOL bHide )
+{
+ if ( bHide )
+ {
+ // SfxPopupWindows hiden
+ pImp->ePopupAction = SFX_POPUP_HIDE;
+ }
+ else
+ {
+ // SfxPopupWindows showen
+ pImp->ePopupAction = SFX_POPUP_SHOW;
+ }
+
+ for ( sal_uInt16 nCache = 0; nCache < pImp->pCaches->Count(); ++nCache )
+ pImp->pCaches->GetObject(nCache)->DeleteFloatingWindows();
+ pImp->ePopupAction = SFX_POPUP_DELETE;
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::Update_Impl
+(
+ SfxStateCache* pCache // der upzudatende SfxStatusCache
+)
+
+/* [Beschreibung]
+
+ Interne Methode zum Updaten eines Caches und den von derselben
+ Status-Methode in derselben Shell bedienten und dirty Slots.
+*/
+
+{
+ if( pCache->GetDispatch().is() && pCache->GetItemLink() )
+ {
+ pCache->SetCachedState();
+ return;
+ }
+
+ if ( !pDispatcher )
+ return;
+ DBG_PROFSTART(SfxBindingsUpdate_Impl);
+
+ // alle mit derselben Statusmethode zusammensammeln, die dirty sind
+ SfxDispatcher &rDispat = *pDispatcher;
+ const SfxSlot *pRealSlot = 0;
+ const SfxSlotServer* pMsgServer = 0;
+ SfxFoundCacheArr_Impl aFound;
+ SfxItemSet *pSet = CreateSet_Impl( pCache, pRealSlot, &pMsgServer, aFound );
+ sal_Bool bUpdated = sal_False;
+ if ( pSet )
+ {
+ // Status erfragen
+ if ( rDispat._FillState( *pMsgServer, *pSet, pRealSlot ) )
+ {
+ // Status posten
+ const SfxInterface *pInterface =
+ rDispat.GetShell(pMsgServer->GetShellLevel())->GetInterface();
+ for ( sal_uInt16 nPos = 0; nPos < aFound.Count(); ++nPos )
+ {
+ const SfxFoundCache_Impl *pFound = aFound[nPos];
+ sal_uInt16 nWhich = pFound->nWhichId;
+ const SfxPoolItem *pItem = 0;
+ SfxItemState eState = pSet->GetItemState(nWhich, sal_True, &pItem);
+ if ( eState == SFX_ITEM_DEFAULT && SfxItemPool::IsWhich(nWhich) )
+ pItem = &pSet->Get(nWhich);
+ UpdateControllers_Impl( pInterface, aFound[nPos], pItem, eState );
+ }
+ bUpdated = sal_True;
+ }
+
+ delete pSet;
+ }
+
+ if ( !bUpdated && pCache )
+ {
+ // Wenn pCache == NULL und kein SlotServer ( z.B. weil Dispatcher gelockt! ),
+ // darf nat"urlich kein Update versucht werden
+ SfxFoundCache_Impl aFound( pCache->GetId(), 0,
+ pRealSlot, pCache );
+ UpdateControllers_Impl( 0, &aFound, 0, SFX_ITEM_DISABLED);
+ }
+
+ DBG_PROFSTOP(SfxBindingsUpdate_Impl);
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::Update
+(
+ sal_uInt16 nId // die gebundene und upzudatende Slot-Id
+)
+
+/* [Beschreibung]
+
+ Diese Methode sorgt f"ur synchrones Updaten der auf die Slot-Id nId
+ gebundenen <SfxContollerItem> Instanzen, die an dieser SfxBindings
+ Instanz angemeldet sind. Vergleichbar zu Window::Update()
+ (StarView) erfolgt ein Update nur, wenn entweder ein auf diese
+ Slot-Id gebundenes SfxContollerItem dirty ist, oder die Slot-Id
+ selbst dirty ist. Dies kann durch einen vorhergehendes Aufruf von
+ <SfxBindings::Invalidate(sal_uInt16)> erzwungen werden.
+
+
+ [Anmerkung]
+
+ Es ist g"unstiger, zun"achst alle zu invalidierenden Slot-Ids per
+ <SfxBindings::Invalidate(sal_uInt16)> zu invalidieren und dann
+ Update() aufzurufen, als einzelne abwechselnde Invalidate/Update,
+ da von derselben Status-Methode bediente Status-Anfragen von
+ den SfxBindings automatisch zusammengefa"st werden.
+
+
+ [Querverweise]
+
+ <SfxShell::Invalidate(sal_uInt16)>
+ <SfxBindings::Invalidate(sal_uInt16)>
+ <SfxBindings::InvalidateAll(sal_Bool)>
+ <SfxBindings::Update()>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+//!!TLX: Fuehrte zu Vorlagenkatalogstillstand
+// if ( nRegLevel )
+// return;
+
+ if ( pDispatcher )
+ pDispatcher->Flush();
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->Update( nId );
+
+ SfxStateCache* pCache = GetStateCache( nId );
+ if ( pCache )
+ {
+ pImp->bInUpdate = sal_True;
+ if ( pImp->bMsgDirty )
+ {
+ UpdateSlotServer_Impl();
+ pCache = GetStateCache( nId );
+ }
+
+ if (pCache)
+ {
+ if( pCache->GetDispatch().is() && pCache->GetItemLink() )
+ {
+ pCache->SetCachedState();
+ }
+ else
+ {
+ // Status erfragen
+ const SfxSlotServer* pMsgServer =
+ pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ if ( !pCache->IsControllerDirty() &&
+ ( !pMsgServer ||
+ !pMsgServer->GetSlot()->IsMode(SFX_SLOT_VOLATILE) ) )
+ {
+ pImp->bInUpdate = sal_False;
+ return;
+ }
+ if (!pMsgServer)
+ {
+ pCache->SetState(SFX_ITEM_DISABLED, 0);
+ pImp->bInUpdate = sal_False;
+ return;
+ }
+
+ Update_Impl(pCache);
+ }
+
+ pImp->bAllDirty = sal_False;
+ }
+
+ pImp->bInUpdate = sal_False;
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::Update()
+
+/* [Beschreibung]
+
+ Diese Methode sorgt f"ur synchrones Updaten aller <SfxContollerItem>
+ Instanzen, die an dieser SfxBindings Instanz angemeldet sind. Vergleichbar
+ zu Window::Update() (StarView) erfolgt ein Update nur, wenn entweder ein
+ SfxContollerItem dirty ist, in einem Status-Cache der Zeiger auf den
+ <Slot-Server> dirty ist. Ersteres kann durch einen Aufruf von
+ <SfxBindings::Invalidate(sal_uInt16)> erzwungen werden, letzters durch
+ <SfxBindings::InvalidateAll(sal_Bool)>.
+
+
+ [Querverweise]
+
+ <SfxShell::Invalidate(sal_uInt16)>
+ <SfxBindings::Invalidate(sal_uInt16)>
+ <SfxBindings::InvalidateAll(sal_Bool)>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->Update();
+
+ if ( pDispatcher )
+ {
+ if ( nRegLevel )
+ return;
+
+ pImp->bInUpdate = sal_True;
+ pDispatcher->Flush();
+ pDispatcher->Update_Impl();
+ while ( !NextJob_Impl(0) )
+ ; // loop
+ pImp->bInUpdate = sal_False;
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::SetState
+(
+ const SfxItemSet& rSet // zu setzende Status-Werte
+)
+
+/* [Beschreibung]
+
+ Diese Methode erlaubt das direkte Setzen neuer Status-Werte, ohne
+ den Umweg "uber <SfxBindings::Invalidate()> und das dann im Update
+ erfolgende Rufen der Status-Methoden an den <SfxShell>s.
+
+
+ [Querverweise]
+
+ <SfxBindings::SetState(const SfxPoolItem&)>
+*/
+
+{
+ // wenn gelockt, dann nur invalidieren
+ if ( nRegLevel )
+ {
+ SfxItemIter aIter(rSet);
+ for ( const SfxPoolItem *pItem = aIter.FirstItem();
+ pItem;
+ pItem = aIter.NextItem() )
+ Invalidate( pItem->Which() );
+ }
+ else
+ {
+ // Status d"urfen nur angenommen werden, wenn alle Slot-Pointer gesetzt sind
+ if ( pImp->bMsgDirty )
+ UpdateSlotServer_Impl();
+
+ // "uber das ItemSet iterieren, falls Slot gebunden, updaten
+ //! Bug: WhichIter verwenden und ggf. VoidItems hochschicken
+ SfxItemIter aIter(rSet);
+ for ( const SfxPoolItem *pItem = aIter.FirstItem();
+ pItem;
+ pItem = aIter.NextItem() )
+ {
+ SfxStateCache* pCache =
+ GetStateCache( rSet.GetPool()->GetSlotId(pItem->Which()) );
+ if ( pCache )
+ {
+ // Status updaten
+ if ( !pCache->IsControllerDirty() )
+ pCache->Invalidate(sal_False);
+ pCache->SetState( SFX_ITEM_AVAILABLE, pItem );
+
+ //! nicht implementiert: Updates von EnumSlots via MasterSlots
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::SetState
+(
+ const SfxPoolItem& rItem // zu setzender Status-Wert
+)
+
+/* [Beschreibung]
+
+ Diese Methode erlaubt das direkte Setzen eines neuen Status-Wertes,
+ ohne den Umweg "uber <SfxBindings::Invalidate()> und das dann im Update
+ erfolgende Rufen der Status-Methoden an den <SfxShell>s.
+
+ Mit dieser Methode k"onnen nur <SfxPoolItem>s mit Slot, nicht
+ aber mit Which-Id gesetzt werden, da kein <SfxItemPool> bekannt ist,
+ "uber den gemappt werden k"onnte.
+
+
+ [Querverweise]
+
+ <SfxBindings::SetState(const SfxItemSet&)>
+*/
+
+{
+ if ( nRegLevel )
+ {
+ Invalidate( rItem.Which() );
+ }
+ else
+ {
+ // Status d"urfen nur angenommen werden, wenn alle Slot-Pointer gesetzt sind
+ if ( pImp->bMsgDirty )
+ UpdateSlotServer_Impl();
+
+ // falls der Slot gebunden ist, updaten
+ DBG_ASSERT( SfxItemPool::IsSlot( rItem.Which() ),
+ "cannot set items with which-id" );
+ SfxStateCache* pCache = GetStateCache( rItem.Which() );
+ if ( pCache )
+ {
+ // Status updaten
+ if ( !pCache->IsControllerDirty() )
+ pCache->Invalidate(sal_False);
+ pCache->SetState( SFX_ITEM_AVAILABLE, &rItem );
+
+ //! nicht implementiert: Updates von EnumSlots via MasterSlots
+ }
+ }
+}
+
+
+//--------------------------------------------------------------------
+
+SfxStateCache* SfxBindings::GetAnyStateCache_Impl( sal_uInt16 nId )
+{
+ SfxStateCache* pCache = GetStateCache( nId );
+ if ( !pCache && pImp->pSubBindings )
+ return pImp->pSubBindings->GetAnyStateCache_Impl( nId );
+ return pCache;
+}
+
+SfxStateCache* SfxBindings::GetStateCache
+(
+ sal_uInt16 nId /* Slot-Id, deren SfxStatusCache gefunden
+ werden soll */,
+ sal_uInt16* pPos /* 0 bzw. Position, ab der die Bindings
+ bin"ar durchsucht werden sollen. Liefert
+ die Position zur"uck, an der nId gefunden
+ wurde, bzw. an der es einfef"ugt werden
+ w"urde. */
+)
+
+/* [Beschreibung]
+
+ Diese Methode sucht die zu einer Slot-Id geh"orige <SfxStatusCache>
+ Instanz. Falls die Slot-Id in keinem Controller gebunden ist, wird
+ ein 0-Pointer zur"uckgegeben.
+
+ Falls pPos != 0, wird erst ab der Position mit der Suche angefangen.
+ Dieses ist eine Optimierung, f"ur den Fall, da"s die kleineren
+ Ids bereits abgearbeitet wurden.
+
+ In *pPos wird der ::com::sun::star::sdbcx::Index innerhalb der SfxBindings zur"uckgegeben,
+ unter dem dieser Cache z.Zt. abgelegt ist. Dieser ::com::sun::star::sdbcx::Index ist bis zum
+ n"achsten Aufruf von <SfxBindings::EnterRegistrations()> g"ultig.
+ W"ahrend der Umkonfiguration (<SfxBindings::IsInRegistrations()> == sal_True)
+ kann ist der ::com::sun::star::sdbcx::Index und der R"uckgabewert nur sehr kurzfristig
+ g"ultig.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+ // is the specified function bound?
+ const sal_uInt16 nStart = ( pPos ? *pPos : 0 );
+ const sal_uInt16 nPos = GetSlotPos( nId, nStart );
+
+ if ( nPos < pImp->pCaches->Count() &&
+ (*pImp->pCaches)[nPos]->GetId() == nId )
+ {
+ if ( pPos )
+ *pPos = nPos;
+ return (*pImp->pCaches)[nPos];
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::InvalidateAll
+(
+ sal_Bool bWithMsg /* sal_True
+ Slot-Server als ung"ultig markieren
+
+ sal_False
+ Slot-Server bleiben g"ultig */
+)
+
+/* [Beschreibung]
+
+ Invalidiert alle <SfxControllerItem> Instanzen, die an dieser
+ SfxBindings Instanz angemeldet sind, und bei bWithMsg == sal_True
+ ebenfalls die <Slot-Server>-Caches.
+
+ Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
+ beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
+ bevor "uberhaupt etwas passiert.
+
+
+ [Querverweise]
+
+ <SfxShell::Invalidate(sal_uInt16)>
+ <SfxBindings::Invalidate(sal_uInt16)>
+ <SfxBindings::Invalidate(sal_uInt16*)>
+ <SfxBindings::Update()>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_PROFSTART(SfxBindingsInvalidateAll);
+ DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+
+ DBG_MEMTEST();
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->InvalidateAll( bWithMsg );
+
+ // ist schon alles dirty gesetzt oder downing => nicht zu tun
+ if ( !pDispatcher ||
+ ( pImp->bAllDirty && ( !bWithMsg || pImp->bAllMsgDirty ) ) ||
+ SFX_APP()->IsDowning() )
+ {
+ DBG_PROFSTOP(SfxBindingsInvalidateAll);
+ return;
+ }
+
+ pImp->bAllMsgDirty = pImp->bAllMsgDirty || bWithMsg;
+ pImp->bMsgDirty = pImp->bMsgDirty || pImp->bAllMsgDirty || bWithMsg;
+ pImp->bAllDirty = sal_True;
+
+ for ( sal_uInt16 n = 0; n < pImp->pCaches->Count(); ++n )
+ pImp->pCaches->GetObject(n)->Invalidate(bWithMsg);
+ pImp->nMsgPos = 0;
+ if ( !nRegLevel )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+// pImp->bFirstRound = sal_True;
+// pImp->nFirstShell = 0;
+ }
+
+ DBG_PROFSTOP(SfxBindingsInvalidateAll);
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::Invalidate
+(
+ const sal_uInt16* pIds /* numerisch sortiertes 0-terminiertes Array
+ von Slot-Ids (einzel, nicht als Paare!) */
+)
+
+/* [Beschreibung]
+
+ Invalidiert die <SfxControllerItem> Instanzen der Slot-Ids in 'pIds',
+ die an dieser SfxBindings Instanz angemeldet sind.
+
+ Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
+ beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
+ bevor "uberhaupt etwas passiert.
+
+
+ [Querverweise]
+
+ <SfxShell::Invalidate(sal_uInt16)>
+ <SfxBindings::Invalidate(sal_uInt16)>
+ <SfxBindings::InvalidateAll(sal_uInt16)>
+ <SfxBindings::Update()>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_PROFSTART(SfxBindingsInvalidateAll);
+ DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+
+ DBG_MEMTEST();
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->Invalidate( pIds );
+
+ // ist schon alles dirty gesetzt oder downing => nicht zu tun
+ if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() )
+ return;
+
+ // in immer kleiner werdenden Berichen bin"ar suchen
+ for ( sal_uInt16 n = GetSlotPos(*pIds);
+ *pIds && n < pImp->pCaches->Count();
+ n = GetSlotPos(*pIds, n) )
+ {
+ // falls SID "uberhaupt gebunden ist, den Cache invalidieren
+ SfxStateCache *pCache = pImp->pCaches->GetObject(n);
+ if ( pCache->GetId() == *pIds )
+ pCache->Invalidate(sal_False);
+
+ // n"achste SID
+ if ( !*++pIds )
+ break;
+ DBG_ASSERT( *pIds > *(pIds-1), "pIds unsorted" );
+ }
+
+ // falls nicht gelockt, Update-Timer starten
+ pImp->nMsgPos = 0;
+ if ( !nRegLevel )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+// pImp->bFirstRound = sal_True;
+// pImp->nFirstShell = 0;
+ }
+
+ DBG_PROFSTOP(SfxBindingsInvalidateAll);
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::InvalidateShell
+(
+ const SfxShell& rSh /* Die <SfxShell>, deren Slot-Ids
+ invalidiert werden sollen. */,
+
+ sal_Bool bDeep /* sal_True
+ auch die, von der SfxShell
+ ererbten Slot-Ids werden invalidert
+
+ sal_False
+ die ererbten und nicht "uberladenen
+ Slot-Ids werden invalidiert */
+ //! MI: z. Zt. immer bDeep
+)
+
+/* [Beschreibung]
+
+ Invalidiert alle <SfxControllerItem> Instanzen, die zur Zeit von
+ der angegebenen SfxShell Instanz bedient werden und an dieser
+ SfxBindings Instanz angemeldet sind
+
+ Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
+ beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
+ bevor "uberhaupt etwas passiert.
+
+
+ [Querverweise]
+
+ <SfxShell::Invalidate(sal_uInt16)>
+ <SfxBindings::Invalidate(sal_uInt16)>
+ <SfxBindings::Update()>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->InvalidateShell( rSh, bDeep );
+
+ if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() )
+ return;
+
+ DBG_PROFSTART(SfxBindingsInvalidateAll);
+ DBG_MEMTEST();
+
+ // Jetzt schon flushen, wird in GetShellLevel(rSh) sowieso gemacht; wichtig,
+ // damit pImp->bAll(Msg)Dirty korrekt gesetzt ist
+ pDispatcher->Flush();
+
+ if ( !pDispatcher ||
+ ( pImp->bAllDirty && pImp->bAllMsgDirty ) ||
+ SFX_APP()->IsDowning() )
+ {
+ // Wenn sowieso demn"achst alle Server geholt werden
+ return;
+ }
+
+ // Level finden
+ sal_uInt16 nLevel = pDispatcher->GetShellLevel(rSh);
+ if ( nLevel != USHRT_MAX )
+ {
+ for ( sal_uInt16 n = 0; n < pImp->pCaches->Count(); ++n )
+ {
+ SfxStateCache *pCache = pImp->pCaches->GetObject(n);
+ const SfxSlotServer *pMsgServer =
+ pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ if ( pMsgServer && pMsgServer->GetShellLevel() == nLevel )
+ pCache->Invalidate(sal_False);
+ }
+ pImp->nMsgPos = 0;
+ if ( !nRegLevel )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+ pImp->bFirstRound = sal_True;
+ pImp->nFirstShell = nLevel;
+ }
+ }
+
+ DBG_PROFSTOP(SfxBindingsInvalidateAll);
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::Invalidate
+(
+ sal_uInt16 nId // zu invalidierende Slot-Id
+)
+
+/* [Beschreibung]
+
+ Invalidiert alle <SfxControllerItem> Instanzen, die auf die Slot-Id
+ nId gebunden sind und an dieser SfxBindings Instanz angemeldet sind.
+
+ Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
+ beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
+ bevor "uberhaupt etwas passiert.
+
+
+ [Querverweise]
+ <SfxBindings::Invalidate(sal_uInt16*)>
+ <SfxBindings::InvalidateAll(sal_Bool)>
+ <SfxBindings::Update()>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->Invalidate( nId );
+
+ if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() )
+ return;
+
+ SfxStateCache* pCache = GetStateCache(nId);
+ if ( pCache )
+ {
+ pCache->Invalidate(sal_False);
+ pImp->nMsgPos = Min(GetSlotPos(nId), pImp->nMsgPos);
+ if ( !nRegLevel )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::Invalidate
+(
+ sal_uInt16 nId, // zu invalidierende Slot-Id
+ sal_Bool bWithItem, // StateCache clearen ?
+ sal_Bool bWithMsg // SlotServer neu holen ?
+)
+
+/* [Beschreibung]
+
+ Invalidiert alle <SfxControllerItem> Instanzen, die auf die Slot-Id
+ nId gebunden sind und an dieser SfxBindings Instanz angemeldet sind,
+ und bei bWithMsg == sal_True ebenfalls den <Slot-Server>-Cache.
+
+ Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
+ beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
+ bevor "uberhaupt etwas passiert.
+
+ [Querverweise]
+ <SfxBindings::Invalidate(sal_uInt16*)>
+ <SfxBindings::InvalidateAll(sal_Bool)>
+ <SfxBindings::Update()>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->Invalidate( nId, bWithItem, bWithMsg );
+
+ if ( SFX_APP()->IsDowning() )
+ return;
+
+ SfxStateCache* pCache = GetStateCache(nId);
+ if ( pCache )
+ {
+ if ( bWithItem )
+ pCache->ClearCache();
+ pCache->Invalidate(bWithMsg);
+
+ if ( !pDispatcher || pImp->bAllDirty )
+ return;
+
+ pImp->nMsgPos = Min(GetSlotPos(nId), pImp->nMsgPos);
+ if ( !nRegLevel )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+ }
+ }
+}
+
+void SfxBindings::Invalidate
+(
+ sal_uInt16 nId, // zu invalidierende Slot-Id
+ sal_Bool bWithMsg // SlotServer neu holen ?
+)
+
+/* [Beschreibung]
+
+ Invalidiert alle <SfxControllerItem> Instanzen, die auf die Slot-Id
+ nId gebunden sind und an dieser SfxBindings Instanz angemeldet sind,
+ und bei bWithMsg == sal_True ebenfalls den <Slot-Server>-Cache.
+
+ Es wird daraufhin ein Timer gestartet, bei dessen Ablauf das Updaten
+ beginnt. Somit k"onnen mehrere Invalidierungen vorgenommen werden,
+ bevor "uberhaupt etwas passiert.
+
+ [Querverweise]
+ <SfxBindings::Invalidate(sal_uInt16*)>
+ <SfxBindings::InvalidateAll(sal_Bool)>
+ <SfxBindings::Update()>
+ <SfxBindings::Update(sal_uInt16)>
+*/
+
+{
+ DBG_ERROR( "Methode veraltet!" );
+/*
+ DBG_MEMTEST();
+ DBG_ASSERT( !pImp->bInUpdate, "SfxBindings::Invalidate while in update" );
+ DBG_ASSERT( sal_False, "alte Methode aus Kompatibilitaetsgruenden gerettet (MH)");
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->Invalidate( nId, bWithMsg );
+
+ if ( !pDispatcher || pImp->bAllDirty || SFX_APP()->IsDowning() )
+ return;
+
+ SfxStateCache* pCache = GetStateCache(nId);
+ if ( pCache )
+ {
+ pCache->Invalidate(bWithMsg);
+ pImp->nMsgPos = Min(GetSlotPos(nId), pImp->nMsgPos);
+ if ( !nRegLevel )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+ }
+ }
+*/
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxBindings::IsBound( sal_uInt16 nSlotId, sal_uInt16 nStartSearchAt )
+
+/* [Beschreibung]
+
+ Stellt fest, ob die angegebene Slot-Id in einem <SfxControllerItem>
+ gebunden ist, der an dieser SfxBindings Instanz angemeldet ist.
+
+
+ [R"uckgabewert]
+
+ sal_Bool sal_True
+ Die angegeben Slot-Id ist gebunden.
+
+ sal_False
+ Die angegeben Slot-Id ist nicht gebunden.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+ return GetStateCache(nSlotId, &nStartSearchAt ) != 0;
+}
+
+//--------------------------------------------------------------------
+
+sal_uInt16 SfxBindings::GetSlotPos( sal_uInt16 nId, sal_uInt16 nStartSearchAt )
+
+/* [Beschreibung]
+
+ Ermittelt den ::com::sun::star::sdbcx::Index der angegebenen Slot-Id in den SfxBindings.
+ Falls die Slot-Id nicht gebunden ist, wird der ::com::sun::star::sdbcx::Index zur"uckgegeben,
+ an dem sie eingef"ugt w"urde.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+ DBG_PROFSTART(SfxBindingsMsgPos);
+
+ // answer immediately if a function-seek comes repeated
+ if ( pImp->nCachedFunc1 < pImp->pCaches->Count() &&
+ (*pImp->pCaches)[pImp->nCachedFunc1]->GetId() == nId )
+ {
+ ++nCache1;
+ DBG_PROFSTOP(SfxBindingsMsgPos);
+ return pImp->nCachedFunc1;
+ }
+ if ( pImp->nCachedFunc2 < pImp->pCaches->Count() &&
+ (*pImp->pCaches)[pImp->nCachedFunc2]->GetId() == nId )
+ {
+ ++nCache2;
+
+ // swap the caches
+ sal_uInt16 nTemp = pImp->nCachedFunc1;
+ pImp->nCachedFunc1 = pImp->nCachedFunc2;
+ pImp->nCachedFunc2 = nTemp;
+ DBG_PROFSTOP(SfxBindingsMsgPos);
+ return pImp->nCachedFunc1;
+ }
+
+ // binary search, if not found, seek to target-position
+ if ( pImp->pCaches->Count() <= nStartSearchAt )
+ {
+ DBG_PROFSTOP(SfxBindingsMsgPos);
+ return 0;
+ }
+ if ( pImp->pCaches->Count() == (nStartSearchAt+1) )
+ {
+ DBG_PROFSTOP(SfxBindingsMsgPos);
+ return (*pImp->pCaches)[nStartSearchAt]->GetId() >= nId ? 0 : 1;
+ }
+ size_t nLow = nStartSearchAt, nMid, nHigh = 0;
+ sal_Bool bFound = sal_False;
+ nHigh = pImp->pCaches->Count() - 1;
+ while ( !bFound && nLow <= nHigh )
+ {
+ nMid = (nLow + nHigh) >> 1;
+ DBG_ASSERT( nMid < pImp->pCaches->Count(), "bsearch ist buggy" );
+ int nDiff = (int) nId - (int) ( ((*pImp->pCaches)[nMid])->GetId() );
+ if ( nDiff < 0)
+ { if ( nMid == 0 )
+ break;
+ nHigh = nMid - 1;
+ }
+ else if ( nDiff > 0 )
+ { nLow = nMid + 1;
+ if ( nLow == 0 )
+ break;
+ }
+ else
+ bFound = sal_True;
+ }
+ sal_uInt16 nPos = bFound ? nMid : nLow;
+ DBG_ASSERT( nPos <= pImp->pCaches->Count(), "" );
+ DBG_ASSERT( nPos == pImp->pCaches->Count() ||
+ nId <= (*pImp->pCaches)[nPos]->GetId(), "" );
+ DBG_ASSERT( nPos == nStartSearchAt ||
+ nId > (*pImp->pCaches)[nPos-1]->GetId(), "" );
+ DBG_ASSERT( ( (nPos+1) >= pImp->pCaches->Count() ) ||
+ nId < (*pImp->pCaches)[nPos+1]->GetId(), "" );
+ pImp->nCachedFunc2 = pImp->nCachedFunc1;
+ pImp->nCachedFunc1 = nPos;
+ DBG_PROFSTOP(SfxBindingsMsgPos);
+ return nPos;
+}
+//--------------------------------------------------------------------
+
+void SfxBindings::Register( SfxControllerItem& rItem )
+
+/* [Beschreibung]
+
+ Mit dieser Methode melden sich Instanzen der Klasse <SfxControllerItem>
+ an der betreffenden SfxBindings Instanz an, wenn sie eine Slot-Id binden.
+
+
+ [Querverweise]
+ <SfxBindings::Release(SfxControllerItem&)>
+ <SfxBindings::EnterRegistrations()>
+ <SfxBindings::LeaveRegistrations()>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nRegLevel > 0, "registration without EnterRegistrations" );
+ DBG_ASSERT( !pImp->bInNextJob, "SfxBindings::Register while status-updating" );
+ //! EnterRegistrations();
+
+ // if not exist, insert a new cache
+ sal_uInt16 nId = rItem.GetId();
+ sal_uInt16 nPos = GetSlotPos(nId);
+ if ( nPos >= pImp->pCaches->Count() ||
+ (*pImp->pCaches)[nPos]->GetId() != nId )
+ {
+ SfxStateCache* pCache = new SfxStateCache(nId);
+ pImp->pCaches->Insert( nPos, pCache );
+ DBG_ASSERT( nPos == 0 ||
+ (*pImp->pCaches)[nPos]->GetId() >
+ (*pImp->pCaches)[nPos-1]->GetId(), "" );
+ DBG_ASSERT( (nPos == pImp->pCaches->Count()-1) ||
+ (*pImp->pCaches)[nPos]->GetId() <
+ (*pImp->pCaches)[nPos+1]->GetId(), "" );
+ pImp->bMsgDirty = sal_True;
+ }
+
+ // enqueue the new binding
+ SfxControllerItem *pOldItem = (*pImp->pCaches)[nPos]->ChangeItemLink(&rItem);
+ rItem.ChangeItemLink(pOldItem);
+
+ //! LeaveRegistrations();
+}
+//--------------------------------------------------------------------
+
+void SfxBindings::Release( SfxControllerItem& rItem )
+
+/* [Beschreibung]
+
+ Mit dieser Methode melden sich Instanzen der Klasse <SfxControllerItem>
+ an den SfxBindings ab.
+
+
+ [Querverweise]
+ <SfxBindings::Register(SfxControllerItem&)>
+ <SfxBindings::Release(SfxControllerItem&)>
+ <SfxBindings::EnterRegistrations()>
+ <SfxBindings::LeaveRegistrations()>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+ //! DBG_ASSERT( nRegLevel > 0, "release without EnterRegistrations" );
+ DBG_ASSERT( !pImp->bInNextJob, "SfxBindings::Release while status-updating" );
+ ENTERREGISTRATIONS();
+
+ // find the bound function
+ sal_uInt16 nId = rItem.GetId();
+ sal_uInt16 nPos = GetSlotPos(nId);
+ SfxStateCache* pCache = (*pImp->pCaches)[nPos];
+ if ( pCache->GetId() == nId )
+ {
+ // is this the first binding in the list?
+ SfxControllerItem* pItem = pCache->GetItemLink();
+ if ( pItem == &rItem )
+ pCache->ChangeItemLink( rItem.GetItemLink() );
+ else
+ {
+ // search the binding in the list
+ while ( pItem && pItem->GetItemLink() != &rItem )
+ pItem = pItem->GetItemLink();
+
+ // unlink it if it was found
+ if ( pItem )
+ pItem->ChangeItemLink( rItem.GetItemLink() );
+ }
+ // was this the last controller?
+ if ( pCache->GetItemLink() == 0 )
+ {
+#ifdef slow
+ // remove the BoundFunc
+ delete (*pImp->pCaches)[nPos];
+ pImp->pCaches->Remove(nPos, 1);
+#endif
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ {
+ delete (*pImp->pCaches)[nPos];
+ pImp->pCaches->Remove(nPos, 1);
+ }
+ else
+ pImp->bCtrlReleased = sal_True;
+ }
+ }
+
+ LEAVEREGISTRATIONS();
+}
+
+//--------------------------------------------------------------------
+#if SUPD<582
+sal_Bool SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, sal_uInt16 nModi )
+{
+ return Execute( nId, SFX_CALLMODE_SLOT, ppItems, nModi );
+}
+
+sal_Bool SfxBindings::Execute( sal_uInt16 nId, SfxCallMode nCallMode, const SfxPoolItem** ppItems, sal_uInt16 nModi, const SfxPoolItem **ppInternalArgs )
+#else
+sal_Bool SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, sal_uInt16 nModi, SfxCallMode nCallMode, const SfxPoolItem **ppInternalArgs )
+#endif
+/* [Beschreibung]
+
+ F"uhrt den Slot mit der Slot-Id nId "uber den <Slot-Server> Cache
+ aus. Dies ist nur bei in dieser SfxBindings INstanz gebundenen
+ Slot-Ids m"oglich.
+
+
+ [R"uckgabewert]
+
+ sal_Bool sal_True
+ Das Execute wurde ausgef"uhrt.
+
+ sal_False
+ Das Execute konnte nicht ausgef"uhrt werden,
+ weil der Slot entweder nicht zur Verf"ugung steht
+ (in keiner aktiven <SfxShell> vorhanden oder
+ disabled) ist oder der Anwender die Ausf"uhrung
+ abgebrochen hat (Cancel in einem Dialog).
+
+
+ [Querverweise]
+ <SfxDispatcher>
+*/
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+ if( !nId || !pDispatcher )
+ return sal_False;
+
+ SfxStateCache *pCache = GetStateCache( nId );
+ if ( !pCache )
+ {
+ SfxBindings *pBind = pImp->pSubBindings;
+ while ( pBind )
+ {
+ if ( pBind->GetStateCache( nId ) )
+#if SUPD<582
+ return pBind->Execute( nId, nCallMode, ppItems, nModi, ppInternalArgs );
+#else
+ return pBind->Execute( nId, ppItems, nModi, nCallMode, ppInternalArgs );
+#endif
+ pBind = pBind->pImp->pSubBindings;
+ };
+ }
+
+ // synchronisieren
+ SfxDispatcher &rDispatcher = *pDispatcher;
+ rDispatcher.Flush();
+// pImp->bInExecute = sal_True;
+ SfxViewFrame *pFrame = rDispatcher.GetFrame();
+
+ // vom cache den Server (Slot+ShellLevel) und die Shell etc. abholen
+ sal_Bool bDeleteCache = sal_False;
+ if ( !pCache && pImp->xProv.is() )
+ {
+ pCache = new SfxStateCache( nId );
+ pCache->GetSlotServer( rDispatcher, pImp->xProv );
+ bDeleteCache = sal_True;
+ }
+
+ if ( pCache && pCache->GetDispatch().is() )
+ {
+ pCache->Dispatch( nCallMode == SFX_CALLMODE_SYNCHRON );
+ if ( bDeleteCache )
+ DELETEZ( pCache );
+ return sal_True;
+ }
+
+ // abgefangen?
+ if ( pImp->pInterceptors )
+ {
+ for ( sal_uInt16 n = 0; n < pImp->pInterceptors->Count(); ++n )
+ {
+ SfxSlotInterceptor *pInterceptor = pImp->pInterceptors->GetObject(n);
+ SfxPoolItem *pState = 0;
+ if ( SFX_ITEM_DISABLED != pInterceptor->QueryState(nId, pState) &&
+ pInterceptor->Execute(nId, (SfxPoolItem**) ppItems) )
+ {
+ delete pState;
+// pImp->bInExecute = sal_False;
+ return sal_True;
+ }
+ }
+ }
+
+ // Zur Sicherheit!
+ if ( pImp->bMsgDirty )
+ UpdateSlotServer_Impl();
+
+ // Neuerdings k"onnen wir auch nicht gecachete Slots executen
+ // ( wg. Acceleratoren, deren Controller aus Performance-Gr"unden nicht mehr
+ // gebunden werden ).
+ SfxShell *pShell=0;
+ const SfxSlot *pSlot=0;
+
+ const SfxSlotServer* pServer = pCache ? pCache->GetSlotServer( rDispatcher, pImp->xProv ) : 0;
+ if ( !pServer )
+ {
+ SfxSlotServer aServer;
+// if ( !rDispatcher._TryIntercept_Impl( nId, aServer, sal_False ) )
+ {
+ if ( !rDispatcher._FindServer( nId, aServer, sal_False ) )
+ {
+// pImp->bInExecute = sal_False;
+ if ( bDeleteCache )
+ delete pCache;
+ return sal_False;
+ }
+ }
+
+ pShell = rDispatcher.GetShell( aServer.GetShellLevel() );
+ pSlot = aServer.GetSlot();
+ }
+ else
+ {
+ pShell = rDispatcher.GetShell( pServer->GetShellLevel() );
+ pSlot = pServer->GetSlot();
+ }
+
+ SfxItemPool &rPool = pShell->GetPool();
+ SfxRequest aReq( nId, nCallMode, rPool );
+ aReq.SetModifier( nModi );
+ if( ppItems )
+ while( *ppItems )
+ aReq.AppendItem( **ppItems++ );
+ if ( ppInternalArgs )
+ {
+ SfxAllItemSet aSet( rPool );
+ for ( const SfxPoolItem **pArg = ppInternalArgs; *pArg; ++pArg )
+ aSet.Put( **pArg );
+ aReq.SetInternalArgs_Impl( aSet );
+ }
+
+/*
+ if ( pFrame && pFrame->IsVisible() )
+ {
+ // Bugfix #48745
+ // damit der Benutzer nicht verwirrt wird, wird bei Executes vom
+ // UI aus, die "Anderungen am Dokument vornehmen, der Focus auf das
+ // EditWindow gezogen, sofern der Frame sichtbar ist und der Focus
+ // nicht schon im Frame liegt
+ SfxViewFrame *pTop = pFrame->GetTopViewFrame();
+ SfxViewFrame *pAct = SfxViewFrame::Current()->GetTopViewFrame();
+ if ( !pSlot->IsMode( SFX_SLOT_READONLYDOC ) && pTop == pAct && !pFrame->GetWindow().HasChildPathFocus( sal_True ) )
+ pFrame->GetFrame()->GrabFocusOnComponent_Impl();
+ }
+*/
+ if ( SFX_KIND_ENUM == pSlot->GetKind() )
+ {
+ // bei Enum-Slots muss der Master mit dem Wert des Enums executet werden
+ const SfxSlot *pRealSlot = pShell->GetInterface()->GetRealSlot(pSlot);
+ const sal_uInt16 nSlotId = pRealSlot->GetSlotId();
+ aReq.SetSlot( nSlotId );
+ aReq.AppendItem( SfxAllEnumItem( rPool.GetWhich(nSlotId),
+ pSlot->GetValue() ) );
+ rDispatcher._Execute( *pShell, *pRealSlot, aReq, nCallMode | SFX_CALLMODE_RECORD );
+ }
+ else if ( SFX_KIND_ATTR == pSlot->GetKind() )
+ {
+ // bei Attr-Slots mu der Which-Wert gemapped werden
+ const sal_uInt16 nSlotId = pSlot->GetSlotId();
+ aReq.SetSlot( nSlotId );
+ if ( pSlot->IsMode(SFX_SLOT_TOGGLE) )
+ {
+ // an togglebare-Attribs (Bools) wird der Wert angeheangt
+ sal_uInt16 nWhich = pSlot->GetWhich(rPool);
+ SfxItemSet aSet(rPool, nWhich, nWhich, 0);
+ SfxStateFunc aFunc = pSlot->GetStateFnc();
+ pShell->CallState( aFunc, aSet );
+ const SfxPoolItem *pOldItem;
+ SfxItemState eState = aSet.GetItemState(nWhich, sal_True, &pOldItem);
+ if ( SFX_ITEM_SET == eState ||
+ ( SFX_ITEM_AVAILABLE == eState &&
+ SfxItemPool::IsWhich(nWhich) &&
+ ( pOldItem = &aSet.Get(nWhich) ) ) )
+ {
+ if ( pOldItem->ISA(SfxBoolItem) )
+ {
+ // wir koennen Bools toggeln
+ sal_Bool bOldValue = ((const SfxBoolItem *)pOldItem)->GetValue();
+ SfxBoolItem *pNewItem = (SfxBoolItem*) (pOldItem->Clone());
+ pNewItem->SetValue( !bOldValue );
+ aReq.AppendItem( *pNewItem );
+ delete pNewItem;
+ }
+ else if ( pOldItem->ISA(SfxEnumItemInterface) &&
+ ((SfxEnumItemInterface *)pOldItem)->HasBoolValue())
+ {
+ // und Enums mit Bool-Interface
+ SfxEnumItemInterface *pNewItem =
+ (SfxEnumItemInterface*) (pOldItem->Clone());
+ pNewItem->SetBoolValue(!((SfxEnumItemInterface *)pOldItem)->GetBoolValue());
+ aReq.AppendItem( *pNewItem );
+ delete pNewItem;
+ }
+ else
+ DBG_ERROR( "Toggle only for Enums and Bools allowed" );
+ }
+ else if ( SFX_ITEM_DONTCARE == eState )
+ {
+ // ein Status-Item per Factory erzeugen
+ SfxPoolItem *pNewItem = pSlot->GetType()->CreateItem();
+ DBG_ASSERT( pNewItem, "Toggle an Slot ohne ItemFactory" );
+ pNewItem->SetWhich( nWhich );
+
+ if ( pNewItem->ISA(SfxBoolItem) )
+ {
+ // wir koennen Bools toggeln
+ ((SfxBoolItem*)pNewItem)->SetValue( sal_True );
+ aReq.AppendItem( *pNewItem );
+ }
+ else if ( pNewItem->ISA(SfxEnumItemInterface) &&
+ ((SfxEnumItemInterface *)pNewItem)->HasBoolValue())
+ {
+ // und Enums mit Bool-Interface
+ ((SfxEnumItemInterface*)pNewItem)->SetBoolValue(sal_True);
+ aReq.AppendItem( *pNewItem );
+ }
+ else
+ DBG_ERROR( "Toggle only for Enums and Bools allowed" );
+ delete pNewItem;
+ }
+ else
+ DBG_ERROR( "suspicious Toggle-Slot" );
+ }
+ rDispatcher._Execute( *pShell, *pSlot, aReq, nCallMode | SFX_CALLMODE_RECORD );
+ }
+ else
+ rDispatcher._Execute( *pShell, *pSlot, aReq, nCallMode | SFX_CALLMODE_RECORD );
+
+// pImp->bInExecute = sal_False;
+ if ( bDeleteCache )
+ delete pCache;
+ return sal_True;
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::UpdateSlotServer_Impl()
+
+/* [Beschreibung]
+
+ Interne Methode zum Updaten der Pointer auf die SlotServer
+ nach <SfxBindings::InvalidateAll(sal_Bool)>.
+*/
+
+{
+ DBG_PROFSTART(SfxBindingsUpdateServers);
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+ // synchronisieren
+ pDispatcher->Flush();
+// pDispatcher->Update_Impl();
+
+ const sal_uInt16 nCount = pImp->pCaches->Count();
+ for(sal_uInt16 i = 0; i < nCount; ++i)
+ {
+ SfxStateCache *pCache = pImp->pCaches->GetObject(i);
+ pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ }
+ pImp->bMsgDirty = pImp->bAllMsgDirty = sal_False;
+
+ Broadcast( SfxSimpleHint(SFX_HINT_DOCCHANGED) );
+
+ DBG_PROFSTOP(SfxBindingsUpdateServers);
+}
+
+//--------------------------------------------------------------------
+
+#ifdef WNT
+int __cdecl CmpUS_Impl(const void *p1, const void *p2)
+#else
+int CmpUS_Impl(const void *p1, const void *p2)
+#endif
+
+/* [Beschreibung]
+
+ Interne Vergleichsfunktion fuer qsort.
+*/
+
+{
+ return *(sal_uInt16 *)p1 - *(sal_uInt16 *)p2;
+}
+
+//--------------------------------------------------------------------
+
+SfxItemSet* SfxBindings::CreateSet_Impl
+(
+ SfxStateCache*& pCache, // in: Status-Cache von nId
+ const SfxSlot*& pRealSlot, // out: RealSlot zu nId
+ const SfxSlotServer** pMsgServer, // out: Slot-Server zu nId
+ SfxFoundCacheArr_Impl& rFound // out: Liste der Caches der Siblings
+)
+
+/* [Beschreibung]
+
+ Diese interne Methode sucht zu pCache die Slot-Ids, die von derselben
+ Status-Methode bedient werden und ebenfalls gebunden und dirty sind.
+ Es wird ein SfxItemSet zusammengestellt, das die Slot-Ids (oder falls
+ vorhanden die mit dem Pool der Shell gemappten Which-Ids) enth"alt.
+ Die Caches dieser Slots werden in pFoundCaches zur"uckgeliefert.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+ DBG_ASSERT( !pImp->bMsgDirty, "CreateSet_Impl mit dirty MessageServer" );
+
+ const SfxSlotServer* pMsgSvr = pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ if(!pMsgSvr || !pDispatcher)
+ return 0;
+
+ DBG_PROFSTART(SfxBindingsCreateSet);
+ pRealSlot = 0;
+ *pMsgServer = pMsgSvr;
+
+ sal_uInt16 nShellLevel = pMsgSvr->GetShellLevel();
+ SfxShell *pShell = pDispatcher->GetShell( nShellLevel );
+ if ( !pShell ) // seltener GPF beim Browsen durch Update aus Inet-Notify
+ return 0;
+
+ SfxItemPool &rPool = pShell->GetPool();
+
+ // hole die Status-Methode, von der pCache bedient wird
+ SfxStateFunc pFnc = 0;
+ const SfxInterface *pInterface = pShell->GetInterface();
+ if ( SFX_KIND_ENUM == pMsgSvr->GetSlot()->GetKind() )
+ {
+ pRealSlot = pInterface->GetRealSlot(pMsgSvr->GetSlot());
+ pCache = GetStateCache( pRealSlot->GetSlotId() );
+// DBG_ASSERT( pCache, "Kein Slotcache fuer den Masterslot gefunden!" );
+ }
+ else
+ pRealSlot = pMsgSvr->GetSlot();
+
+ //
+ // Achtung: pCache darf auch NULL sein !!!
+ //
+
+ pFnc = pRealSlot->GetStateFnc();
+
+ // der RealSlot ist immer drin
+ const SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl(
+ pRealSlot->GetSlotId(), pRealSlot->GetWhich(rPool), pRealSlot, pCache );
+ rFound.Insert( pFound );
+
+ if ( !SfxMacroConfig::IsMacroSlot( pRealSlot->GetSlotId() ) )
+ {
+ pInterface->GetRealInterfaceForSlot( pRealSlot );
+ DBG_ASSERT (pInterface,"Slot in angegebener Shell nicht gefunden!");
+ }
+
+ // Durchsuche die Bindings nach den von derselben Funktion bedienten Slots.
+ // Daf"ur kommen nur Slots in Frage, die es im gefundenen Interface gibt.
+
+ // Die Position des Statecaches im StateCache-Array
+ sal_uInt16 nCachePos = pImp->nMsgPos;
+ const SfxSlot *pSibling = pRealSlot->GetNextSlot();
+
+ // Die Slots eines Interfaces sind im Kreis verkettet
+ while ( pSibling > pRealSlot )
+ {
+ SfxStateFunc pSiblingFnc=0;
+ SfxStateCache *pSiblingCache =
+ GetStateCache( pSibling->GetSlotId(), &nCachePos );
+
+ // Ist der Slot "uberhaupt gecached ?
+ if ( pSiblingCache )
+ {
+ const SfxSlotServer *pServ = pSiblingCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ if ( pServ && pServ->GetShellLevel() == nShellLevel )
+ pSiblingFnc = pServ->GetSlot()->GetStateFnc();
+ }
+
+ // Mu\s der Slot "uberhaupt upgedatet werden ?
+ FASTBOOL bInsert = pSiblingCache && pSiblingCache->IsControllerDirty();
+
+ // Bugfix #26161#: Es reicht nicht, nach der selben Shell zu fragen !!
+ FASTBOOL bSameMethod = pSiblingCache && pFnc == pSiblingFnc;
+
+ // Wenn der Slot ein nicht-dirty MasterSlot ist, dann ist vielleicht
+ // einer seiner Slaves dirty ? Dann wird der Masterslot doch eingef"ugt.
+ if ( !bInsert && bSameMethod && pSibling->GetLinkedSlot() )
+ {
+ // auch Slave-Slots auf Binding pru"fen
+ const SfxSlot* pFirstSlave = pSibling->GetLinkedSlot();
+ for ( const SfxSlot *pSlaveSlot = pFirstSlave;
+ !bInsert;
+ pSlaveSlot = pSlaveSlot->GetNextSlot())
+ {
+ // Die Slaves zeigen auf ihren Master
+ DBG_ASSERT(pSlaveSlot->GetLinkedSlot() == pSibling,
+ "Falsche Master/Slave-Beziehung!");
+
+ sal_uInt16 nCurMsgPos = pImp->nMsgPos;
+ const SfxStateCache *pSlaveCache =
+ GetStateCache( pSlaveSlot->GetSlotId(), &nCurMsgPos );
+
+ // Ist der Slave-Slot gecached und dirty ?
+ bInsert = pSlaveCache && pSlaveCache->IsControllerDirty();
+
+ // Slaves sind untereinander im Kreis verkettet
+ if (pSlaveSlot->GetNextSlot() == pFirstSlave)
+ break;
+ }
+ }
+
+ if ( bInsert && bSameMethod )
+ {
+ const SfxFoundCache_Impl *pFound = new SfxFoundCache_Impl(
+ pSibling->GetSlotId(), pSibling->GetWhich(rPool),
+ pSibling, pSiblingCache );
+
+ rFound.Insert( pFound );
+ }
+
+ pSibling = pSibling->GetNextSlot();
+ }
+
+ // aus den Ranges ein Set erzeugen
+ sal_uInt16 *pRanges = new sal_uInt16[rFound.Count() * 2 + 1];
+ int j = 0;
+ int i = 0;
+ while ( i < rFound.Count() )
+ {
+ pRanges[j++] = rFound[i]->nWhichId;
+ // aufeinanderfolgende Zahlen
+ for ( ; i < rFound.Count()-1; ++i )
+ if ( rFound[i]->nWhichId+1 != rFound[i+1]->nWhichId )
+ break;
+ pRanges[j++] = rFound[i++]->nWhichId;
+ }
+ pRanges[j] = 0; // terminierende NULL
+ SfxItemSet *pSet = new SfxItemSet(rPool, pRanges);
+ delete pRanges;
+ DBG_PROFSTOP(SfxBindingsCreateSet);
+ return pSet;
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::UpdateControllers_Impl
+(
+ const SfxInterface* pIF, // das diese Id momentan bedienende Interface
+ const SfxFoundCache_Impl* pFound, // Cache, Slot, Which etc.
+ const SfxPoolItem* pItem, // item to send to controller
+ SfxItemState eState // state of item
+)
+
+/* [Beschreibung]
+
+ Dieses ist eine Hilfsmethode f"ur NextJob_Impl mit der die SfxController,
+ welche auf nSlotId gebunden sind, upgedated werden. Dabei wird der
+ Wert aus dem SfxPoolItem unter dem Which-Wert nWhich aus dem Set rSet
+ genommen.
+
+ Falls zu rSlot Enum-Werte in der Slotmap eingetragen sind, und diese
+ gebunden sind, werden sie ebenfalls upgedated.
+*/
+
+{
+ DBG_ASSERT( !pFound->pSlot || SFX_KIND_ENUM != pFound->pSlot->GetKind(),
+ "direct update of enum slot isn't allowed" );
+ DBG_PROFSTART(SfxBindingsUpdateCtrl1);
+
+ SfxStateCache* pCache = pFound->pCache;
+ const SfxSlot* pSlot = pFound->pSlot;
+ DBG_ASSERT( !pCache || !pSlot || pCache->GetId() == pSlot->GetSlotId(), "SID mismatch" );
+
+ // insofern gebunden, die Controller f"uer den Slot selbst updaten
+ if ( pCache && pCache->IsControllerDirty() )
+ {
+ // Slot abgefangen?
+ sal_Bool bIntercepted = sal_False;
+ if ( pImp->pInterceptors )
+ {
+ for ( sal_uInt16 n = 0; n < pImp->pInterceptors->Count(); ++n )
+ {
+ SfxSlotInterceptor *pInterceptor = pImp->pInterceptors->GetObject(n);
+ SfxPoolItem *pState = 0;
+ sal_uInt16 nSID = pCache->GetId();
+ SfxItemState eState = pInterceptor->QueryState( nSID, pState );
+ if ( SFX_ITEM_UNKNOWN != eState )
+ {
+ bIntercepted = sal_True;
+ if ( eState == SFX_ITEM_AVAILABLE )
+ {
+ // Default
+ SfxVoidItem aVoid(nSID);
+ pCache->SetState( eState, &aVoid );
+ }
+ else
+ {
+ // Gesetzt
+ pCache->SetState(
+ eState == SFX_ITEM_SET ? SFX_ITEM_AVAILABLE : eState, pState );
+ delete pState;
+ }
+
+ return;
+ }
+ }
+ }
+
+ if ( !bIntercepted )
+ {
+ if ( SFX_ITEM_DONTCARE == eState )
+ {
+ // uneindeuting
+ pCache->SetState( SFX_ITEM_DONTCARE, (SfxPoolItem *)-1 );
+ }
+ else if ( SFX_ITEM_DEFAULT == eState &&
+ pFound->nWhichId > SFX_WHICH_MAX )
+ {
+ // kein Status oder Default aber ohne Pool
+ SfxVoidItem aVoid(0);
+ pCache->SetState( SFX_ITEM_UNKNOWN, &aVoid );
+ }
+ else if ( SFX_ITEM_DISABLED == eState )
+ pCache->SetState(SFX_ITEM_DISABLED, 0);
+ else
+ pCache->SetState(SFX_ITEM_AVAILABLE, pItem);
+ }
+ }
+
+ DBG_PROFSTOP(SfxBindingsUpdateCtrl1);
+
+ // insofern vorhanden und gebunden, die Controller f"uer Slave-Slots
+ // (Enum-Werte) des Slots updaten
+ DBG_PROFSTART(SfxBindingsUpdateCtrl2);
+ DBG_ASSERT( !pSlot || 0 == pSlot->GetLinkedSlot() || !pItem ||
+ pItem->ISA(SfxEnumItemInterface),
+ "master slot with non-enum-type found" );
+ const SfxSlot *pFirstSlave = pSlot ? pSlot->GetLinkedSlot() : 0;
+ if ( pIF && pFirstSlave)
+ {
+ // Items auf EnumItem casten
+ const SfxEnumItemInterface *pEnumItem =
+ PTR_CAST(SfxEnumItemInterface,pItem);
+ if ( eState == SFX_ITEM_AVAILABLE && !pEnumItem )
+ eState = SFX_ITEM_DONTCARE;
+ else
+ eState = SfxControllerItem::GetItemState( pEnumItem );
+
+ // "uber alle Slaves-Slots iterieren
+ for ( const SfxSlot *pSlave = pFirstSlave; pSlave;
+ pSlave = pSlave->GetNextSlot() )
+ {
+ DBG_ASSERT(pSlave, "Falsche SlaveSlot-Verkettung!");
+ DBG_ASSERT(SFX_KIND_ENUM == pSlave->GetKind(),"non enum slaves aren't allowed");
+ DBG_ASSERT(pSlave->GetMasterSlotId() == pSlot->GetSlotId(),"falscher MasterSlot!");
+
+ // ist die Funktion gebunden?
+ SfxStateCache *pEnumCache = GetStateCache( pSlave->GetSlotId() );
+ if ( pEnumCache )
+ {
+ pEnumCache->Invalidate(sal_False);
+
+ HACK(CONTROL/SELECT Kram)
+ if ( eState == SFX_ITEM_DONTCARE && pFound->nWhichId == 10144 )
+ {
+ SfxVoidItem aVoid(0);
+ pEnumCache->SetState( SFX_ITEM_UNKNOWN, &aVoid );
+
+ if (pSlave->GetNextSlot() == pFirstSlave)
+ break;
+
+ continue;
+ }
+
+ if ( SFX_ITEM_DISABLED == eState
+#ifdef OV_hat_das_SvxChooseControlItem_angepasst
+ || USHRT_MAX == pEnumItem->GetPosByValue(pEnumCache->GetValue())
+#endif
+ )
+ {
+ // disabled
+ pEnumCache->SetState(SFX_ITEM_DISABLED, 0);
+ }
+ else if ( SFX_ITEM_AVAILABLE == eState )
+ {
+ // enum-Wert ermitteln
+ sal_uInt16 nValue = pEnumItem->GetEnumValue();
+ SfxBoolItem aBool( pFound->nWhichId, pSlave->GetValue() == nValue );
+ pEnumCache->SetState(SFX_ITEM_AVAILABLE, &aBool);
+ }
+ else
+ {
+ // uneindeuting
+ pEnumCache->SetState( SFX_ITEM_DONTCARE, (SfxPoolItem *)-1 );
+ }
+ }
+
+ if (pSlave->GetNextSlot() == pFirstSlave)
+ break;
+ }
+ }
+
+ DBG_PROFSTOP(SfxBindingsUpdateCtrl2);
+}
+
+
+//--------------------------------------------------------------------
+
+IMPL_LINK( SfxBindings, NextJob_Impl, Timer *, pTimer )
+
+/* [Beschreibung]
+
+ Die SfxController werden "uber einen Timer updated. Dieses ist der
+ dazugeh"orige interne TimeOut-Handler.
+ */
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+ DBG_PROFSTART(SfxBindingsNextJob_Impl0);
+ SfxApplication *pSfxApp = SFX_APP();
+
+ if( pDispatcher )
+ pDispatcher->Update_Impl();
+
+ // modifying the SfxObjectInterface-stack without SfxBindings => nothing to do
+ SfxViewFrame* pFrame = pDispatcher->GetFrame();
+ if ( pFrame && pFrame->GetObjectShell()->IsInModalMode() || pSfxApp->IsDowning() || !pImp->pCaches->Count() )
+ {
+ DBG_PROFSTOP(SfxBindingsNextJob_Impl0);
+ return sal_True;
+ }
+ if ( !pDispatcher || !pDispatcher->IsFlushed() )
+ {
+ DBG_PROFSTOP(SfxBindingsNextJob_Impl0);
+ return sal_True;
+ }
+
+ // gfs. alle Server aktualisieren / geschieht in eigener Zeitscheibe
+ if ( pImp->bMsgDirty )
+ {
+ UpdateSlotServer_Impl();
+ DBG_PROFSTOP(SfxBindingsNextJob_Impl0);
+ return sal_False;
+ }
+
+ DBG_PROFSTOP(SfxBindingsNextJob_Impl0);
+ DBG_PROFSTART(SfxBindingsNextJob_Impl);
+ pImp->bAllDirty = sal_False;
+ pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
+
+ // at least 10 loops and further if more jobs are available but no input
+ FASTBOOL bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule;
+ sal_uInt16 nLoops = 10;
+ pImp->bInNextJob = sal_True;
+ const sal_uInt16 nCount = pImp->pCaches->Count();
+ while ( pImp->nMsgPos < nCount )
+ {
+ // iterate through the bound functions
+ sal_Bool bJobDone = sal_False;
+ while ( !bJobDone )
+ {
+ SfxStateCache* pCache = (*pImp->pCaches)[pImp->nMsgPos];
+ DBG_ASSERT( pCache, "invalid SfxStateCache-position in job queue" );
+ sal_Bool bWasDirty = pCache->IsControllerDirty();
+ if ( bWasDirty )
+ {
+/*
+ sal_Bool bSkip = sal_False;
+ if ( pImp->bFirstRound )
+ {
+ // Falls beim Update eine Shell vorgezogen werden soll,
+ // kommt in einer ersten Update-Runde nur diese dran
+ const SfxSlotServer *pMsgServer =
+ pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ if ( pMsgServer &&
+ pMsgServer->GetShellLevel() != pImp->nFirstShell )
+ bSkip = sal_True;
+ }
+
+ if ( !bSkip )
+ {
+*/
+ Update_Impl( pCache );
+ DBG_ASSERT( nCount == pImp->pCaches->Count(),
+ "Reschedule in StateChanged => buff" );
+// }
+ }
+
+ // skip to next function binding
+ ++pImp->nMsgPos;
+
+ // keep job if it is not completed, but any input is available
+ bJobDone = pImp->nMsgPos >= nCount;
+ if ( bJobDone && pImp->bFirstRound )
+ {
+ // Update der bevorzugten Shell ist gelaufen, nun d"urfen
+ // auch die anderen
+ bJobDone = sal_False;
+ pImp->bFirstRound = sal_False;
+ pImp->nMsgPos = 0;
+ }
+
+ if ( bWasDirty && !bJobDone && bPreEmptive && (--nLoops == 0) )
+ {
+ DBG_PROFSTOP(SfxBindingsNextJob_Impl);
+ pImp->bInNextJob = sal_False;
+ return sal_False;
+ }
+ }
+ }
+
+ // volatiles wieder von vorne starten
+ pImp->nMsgPos = 0;
+ pImp->aTimer.SetTimeout(TIMEOUT_IDLE);
+ for ( sal_uInt16 n = 0; n < nCount; ++n )
+ {
+ SfxStateCache* pCache = (*pImp->pCaches)[n];
+ const SfxSlotServer *pSlotServer = pCache->GetSlotServer(*pDispatcher, pImp->xProv);
+ if ( pSlotServer &&
+ pSlotServer->GetSlot()->IsMode(SFX_SLOT_VOLATILE) )
+ pCache->Invalidate(sal_False);
+ }
+
+ // Update-Runde ist beendet
+ pImp->bInNextJob = sal_False;
+ Broadcast(SfxSimpleHint(SFX_HINT_UPDATEDONE));
+ DBG_PROFSTOP(SfxBindingsNextJob_Impl);
+ return sal_True;
+}
+
+//--------------------------------------------------------------------
+
+sal_uInt16 SfxBindings::EnterRegistrations(char *pFile, int nLine)
+
+/* [Beschreibung]
+
+ Die An- oder Abmeldung von <SfxControllerItem> Instanzen mu"s in
+ EnterRegistrations() und LeaveRegistrations() geklammert werden.
+ W"ahrend dieser Zeit erfolgen keine Udates der <SfxContollerItem>
+ Instanzen (weder der alten noch der neu angemeldeten).
+
+ [Parameter]
+
+ pFile, nLine Dateiname und Zeilennummer der rufenden
+ Methode (nur Debug)
+
+ [R"uckgabewert]
+
+ sal_uInt16 Level der Registrierung. Dieser kann in
+ <SfxBindings::LeaveRegistrations(sal_uInt16)> als
+ Parameter angegeben werden, um die Paarigkeit
+ der EnterRegistrations() und LeaveRegistrations()
+ zu pr"ufen.
+
+
+ [Querverweise]
+ <SfxBindings::IsInRegistrations()>
+ <SfxBindings::Register(SfxControllerItem&)>
+ <SfxBindings::Release(SfxControllerItem&)>
+ <SfxBindings::LeaveRegistrations()>
+*/
+
+{
+ DBG_MEMTEST();
+#ifdef DBG_UTIL
+ ByteString aMsg;
+ aMsg.Fill( Min(nRegLevel, sal_uInt16(8) ) );
+ aMsg += "this = ";
+ aMsg += ByteString::CreateFromInt32((long)this);
+ aMsg += " Level = ";
+ aMsg += ByteString::CreateFromInt32(nRegLevel);
+ aMsg += " SfxBindings::EnterRegistrations ";
+ if(pFile) {
+ aMsg += "File: ";
+ aMsg += pFile;
+ aMsg += " Line: ";
+ aMsg += ByteString::CreateFromInt32(nLine);
+ }
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+
+ // Wenn Bindings gelockt werden, auch SubBindings locken
+ if ( pImp->pSubBindings )
+ {
+ pImp->pSubBindings->ENTERREGISTRATIONS();
+
+ // Dieses EnterRegistrations ist f"ur die SubBindings kein "echtes"
+ pImp->pSubBindings->pImp->nOwnRegLevel--;
+
+ // Bindings synchronisieren
+ pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel + 1;
+ }
+
+ pImp->nOwnRegLevel++;
+
+ // check if this is the outer most level
+ if ( ++nRegLevel == 1 )
+ {
+ // stop background-processing
+ pImp->aTimer.Stop();
+
+ // flush the cache
+ pImp->nCachedFunc1 = 0;
+ pImp->nCachedFunc2 = 0;
+
+ // merken, ob ganze Caches verschwunden sind
+ pImp->bCtrlReleased = sal_False;
+ }
+
+ return nRegLevel;
+}
+//--------------------------------------------------------------------
+
+void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, char *pFile, int nLine )
+
+/* [Beschreibung]
+
+ Die An- oder Abmeldung von <SfxControllerItem> Instanzen mu"s in
+ EnterRegistrations() und LeaveRegistrations() geklammert werden.
+ W"ahrend dieser Zeit erfolgen keine Udates der <SfxContollerItem>
+ Instanzen (weder der alten noch der neu angemeldeten).
+
+
+ [Parameter]
+
+ sal_uInt16 nLevel == USRT_MAX
+ keine Paarigkeits-Pr"ufung f"ur diese Klammerung
+
+
+ pFile, nLine Dateiname und Zeilennummer der rufenden
+ Methode (nur Debug)
+
+ < USHRT_MAX
+ R"uckgabewert des zugeh"origen EnterRegistrations()
+ zum pr"ufen der Paarigkeit.
+
+
+ [Querverweise]
+ <SfxBindings::IsInRegistrations()>
+ <SfxBindings::Register(SfxControllerItem&)>
+ <SfxBindings::Release(SfxControllerItem&)>
+ <SfxBindings::EnterRegistrations()>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nRegLevel, "Leave without Enter" );
+ DBG_ASSERT( nLevel == USHRT_MAX || nLevel == nRegLevel, "wrong Leave" );
+
+ // Nur wenn die SubBindings noch von den SuperBindings gelockt sind, diesen Lock entfernen
+ // ( d.h. wenn es mehr Locks als "echte" Locks dort gibt )
+ if ( pImp->pSubBindings && pImp->pSubBindings->nRegLevel > pImp->pSubBindings->pImp->nOwnRegLevel )
+ {
+ // Bindings synchronisieren
+ pImp->pSubBindings->nRegLevel = nRegLevel + pImp->pSubBindings->pImp->nOwnRegLevel;
+
+ // Dieses LeaveRegistrations ist f"ur die SubBindings kein "echtes"
+ pImp->pSubBindings->pImp->nOwnRegLevel++;
+ pImp->pSubBindings->LEAVEREGISTRATIONS();
+ }
+
+ pImp->nOwnRegLevel--;
+
+ // check if this is the outer most level
+ if ( --nRegLevel == 0 && !SFX_APP()->IsDowning() )
+ {
+#ifndef slow
+ SfxViewFrame* pFrame = pDispatcher->GetFrame();
+
+ // ggf unbenutzte Caches entfernen bzw. PlugInInfo aufbereiten
+ if ( pImp->bCtrlReleased )
+ {
+ for ( sal_uInt16 nCache = pImp->pCaches->Count(); nCache > 0; --nCache )
+ {
+ // Cache via ::com::sun::star::sdbcx::Index besorgen
+ SfxStateCache *pCache = pImp->pCaches->GetObject(nCache-1);
+
+ // kein Controller mehr interessiert
+ if ( pCache->GetItemLink() == 0 )
+ {
+ // Cache entfernen
+ delete (*pImp->pCaches)[nCache-1];
+ pImp->pCaches->Remove(nCache-1, 1);
+ }
+ else
+ {
+ // neue Controller mit den alten Items benachrichtigen
+ //!pCache->SetCachedState();
+ }
+ }
+ }
+#endif
+ // restart background-processing
+ pImp->nMsgPos = 0;
+ if ( !pFrame || !pFrame->GetObjectShell() )
+ return;
+ if ( pImp->pCaches && pImp->pCaches->Count() )
+ {
+ pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
+ pImp->aTimer.Start();
+// pImp->bFirstRound = sal_True;
+ }
+ }
+
+#ifdef DBG_UTIL
+ ByteString aMsg;
+ aMsg.Fill( Min(nRegLevel, sal_uInt16(8)) );
+ aMsg += "this = ";
+ aMsg += ByteString::CreateFromInt32((long)this);
+ aMsg += " Level = ";
+ aMsg += ByteString::CreateFromInt32(nRegLevel);
+ aMsg += " SfxBindings::LeaveRegistrations ";
+ if(pFile) {
+ aMsg += "File: ";
+ aMsg += pFile;
+ aMsg += " Line: ";
+ aMsg += ByteString::CreateFromInt32(nLine);
+ }
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+}
+
+//--------------------------------------------------------------------
+
+const SfxSlot* SfxBindings::GetSlot(sal_uInt16 nSlotId)
+
+/* [Beschreibung]
+
+ Diese Methode liefert einen Pointer auf den zur Zeit gecacheten
+ SfxSlot f"ur die angegebene Slot-Id.
+
+
+ [R"uckgabewert]
+
+ const <SfxSlot>* 0
+ Falls die Slot-Id nicht gebunden ist oder
+ ein solcher Slot momentan in keiner aktiven
+ <SfxShell> vorhanden ist.
+
+ != 0
+ Falls die Slot-Id gebunden ist und ein solcher
+ Slot momentan in einer aktiven <SfxShell>
+ vorhanden ist.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->pCaches != 0, "SfxBindings not initialized" );
+
+ // syncronisieren
+ pDispatcher->Flush();
+ if ( pImp->bMsgDirty )
+ UpdateSlotServer_Impl();
+
+ // get the cache for the specified function; return if not bound
+ SfxStateCache* pCache = GetStateCache(nSlotId);
+ return pCache && pCache->GetSlotServer(*pDispatcher, pImp->xProv)?
+ pCache->GetSlotServer(*pDispatcher, pImp->xProv)->GetSlot(): 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::SetDispatcher( SfxDispatcher *pDisp )
+
+/* [Beschreibung]
+
+ Setzt den zur Zeit von dieser SfxBindings Instanz zu verwendenden
+ Dispatcher um.
+
+ Falls sich der Dispatcher dadurch "andert, wird intern
+ <SFxBindings::InvalidateAll(sal_Bool)> mit sal_True gerufen, also jegliche
+ gecachete Information der Bindings weggeworfen.
+*/
+
+{
+ SfxDispatcher *pOldDispat = pDispatcher;
+ if ( pDisp != pDispatcher )
+ {
+ if ( pOldDispat )
+ {
+ SfxBindings* pBind = pOldDispat->GetBindings();
+ while ( pBind )
+ {
+ if ( pBind->pImp->pSubBindings == this && pBind->pDispatcher != pDisp )
+ pBind->SetSubBindings_Impl( NULL );
+ pBind = pBind->pImp->pSubBindings;
+ }
+ }
+
+ pDispatcher = pDisp;
+ InvalidateAll( sal_True );
+ InvalidateUnoControllers_Impl();
+ if ( pDispatcher && !pOldDispat )
+ {
+ if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat )
+ {
+ DBG_ERROR( "SubBindings vor Aktivieren schon gesetzt!" );
+ pImp->pSubBindings->ENTERREGISTRATIONS();
+ }
+ LEAVEREGISTRATIONS();
+ }
+ else if( !pDispatcher )
+ {
+ ENTERREGISTRATIONS();
+ if ( pImp->pSubBindings && pImp->pSubBindings->pDispatcher != pOldDispat )
+ {
+ DBG_ERROR( "SubBindings im Deaktivieren immer noch gesetzt!" );
+ pImp->pSubBindings->LEAVEREGISTRATIONS();
+ }
+ }
+
+ Broadcast( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
+
+ if ( pDisp )
+ {
+ SfxBindings* pBind = pDisp->GetBindings();
+ while ( pBind && pBind != this )
+ {
+ if ( !pBind->pImp->pSubBindings )
+ {
+ pBind->SetSubBindings_Impl( this );
+ break;
+ }
+
+ pBind = pBind->pImp->pSubBindings;
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxBindings::ClearCache_Impl( sal_uInt16 nSlotId )
+
+// interne Methode zum forwarden dieses Methodenaufrufs
+
+{
+ GetStateCache(nSlotId)->ClearCache();
+}
+
+//--------------------------------------------------------------------
+
+// interne Methode zum Ansto\sen des Statusupdates
+
+void SfxBindings::StartUpdate_Impl( sal_Bool bComplete )
+{
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->StartUpdate_Impl( bComplete );
+
+ if ( !bComplete )
+ // Update darf unterbrochen werden
+ NextJob_Impl(&pImp->aTimer);
+ else
+ // alle Slots am St"uck updaten
+ NextJob_Impl(0);
+}
+
+//--------------------------------------------------------------------
+
+#if SUPD<359
+SfxSlotInterceptor::SfxSlotInterceptor( SfxBindings *pBindings )
+: _pImp( new SfxSlotInterceptor_Impl )
+{
+ DBG_ASSERT( pBindings, "SfxBindings: 0-Pointer not allowed" );
+ _pImp->_pBindings = pBindings;
+ _pImp->_bIsActive = sal_False;
+
+ // ggf. Interceptor-Liste on-demand erzeugen
+ if ( !_pImp->_pBindings->pImp->pInterceptors )
+ _pImp->_pBindings->pImp->pInterceptors = new SfxInterceptorArr_Impl;
+
+ Activate(sal_True);
+}
+#endif
+
+SfxSlotInterceptor::SfxSlotInterceptor( SfxBindings *pBindings, sal_Bool bActivate )
+
+/* [Bindings]
+
+ Registriert diese Instanz an den angegebenen <SfxBindings>.
+ Ab jetzt wird vor jedem Ausf"uhren eines Slots "uber diese
+ Bindings die virtuelle Methode <SfxSlotInterceptor::Execute()>
+ gerufen und vor jedem Erfragen eines Status die virtuelle
+ Methode <SfxSlotInterceptor::QueryState()>.
+*/
+
+: _pImp( new SfxSlotInterceptor_Impl )
+{
+ _pImp->_pBindings = pBindings;
+ _pImp->_bIsActive = sal_False;
+
+ Activate( bActivate );
+}
+
+//--------------------------------------------------------------------
+
+SfxSlotInterceptor::~SfxSlotInterceptor()
+
+/* [Bindings]
+
+ Beendet das Abfangen der Execute- und Status-Aufrufe an den
+ im Ctor angegebenen Bindings.
+*/
+
+{
+ Activate(sal_False);
+ delete _pImp;
+}
+
+void SfxSlotInterceptor::SetBindings( SfxBindings* pBindings )
+{
+ DBG_ASSERT( !_pImp->_pBindings, "SetBindings bei gesetzten Bindings" );
+ _pImp->_pBindings = pBindings;
+}
+
+SfxBindings* SfxSlotInterceptor::GetBindings() const
+{
+ return _pImp->_pBindings;
+}
+
+
+//--------------------------------------------------------------------
+
+void SfxSlotInterceptor::Activate( sal_Bool bActivate )
+{
+
+ if ( _pImp->_bIsActive == bActivate )
+ return;
+
+ if ( bActivate)
+ _pImp->_pBindings->pImp->InsertSlotInterceptor( this );
+ else
+ _pImp->_pBindings->pImp->RemoveSlotInterceptor( this );
+
+ _pImp->_bIsActive = bActivate;
+ _pImp->_pBindings->InvalidateAll( sal_False );
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxSlotInterceptor::IsActive() const
+{
+ return _pImp->_bIsActive;
+}
+
+//-------------------------------------------------------------------------
+
+#if SUPD < 355
+sal_Bool SfxSlotInterceptor::Execute( sal_uInt16 nSID )
+#else
+sal_Bool SfxSlotInterceptor::Execute( sal_uInt16 nSID, SfxPoolItem **ppArgs )
+#endif
+
+
+/* [Beschreibung]
+
+ Diese pur-virtuelle Methode mu\s von Subklassen "uberladen werden.
+ Sie wird gerufen, um 'nSID' auszuf"uhren.
+
+ Wurde die SID nicht bearbeitet und soll an den Dispatcher weitergeleitet
+ werden, so mu\s sal_False zur"uckgegeben werden.
+
+ [Beispiel]
+
+ sal_Bool X::Execute( sal_uInt16 nSID )
+ {
+ switch ( nSID )
+ {
+ case SID_A:
+ ...
+ return sal_True;
+
+ case SID_B:
+ ...
+ return sal_True;
+
+ case SID_C:
+ ...
+ return sal_True;
+ }
+
+ return sal_False;
+ }
+*/
+
+{
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+
+SfxItemState SfxSlotInterceptor::QueryState
+(
+ sal_uInt16 nSID, // IN: Slot-Id, deren Status erfragt wird
+ SfxPoolItem*& rpState // OUT: Status-Wert (Eigent"umer"ubergang)
+)
+
+/* [Beschreibung]
+
+ Diese pur-virtuelle Methode mu\s von Subklassen "uberladen werden.
+ Sie wird gerufen, um den Status f"ur 'nSID' zu erfragen. 'rpState'
+ darf nur dann ein mit 'new' anzulegendes <SfxPoolItem> zugewiesen
+ werden, wenn <SFX_ITEM_SET> zur"uckgeliefert wird.
+
+ Wurde die SID nicht bearbeitet und soll an den Dispatcher weitergeleitet
+ werden, so mu\s <SFX_ITEM_UNKNOWN> zur"uckgegeben werden (Basisklasse
+ rufen!).
+
+ [Beispiel]
+
+ SfxItemState X::QueryState( sal_uInt16 nSID, SfxPoolItem*& rpState )
+ {
+ switch ( nSID )
+ {
+ case SID_A:
+ // Status-Item verschicken => enabled
+ rpState = new SfxStringItem( nSID, ... );
+ return SFX_ITEM_SET;
+
+ case SID_B:
+ // kein Status aber trotzdem enabled
+ return SFX_ITEM_AVAILABLE;
+
+ case SID_C:
+ // disabled
+ return SFX_ITEM_DISABLED;
+
+ case SID_D:
+ // mehrdeutig, enabled
+ return SFX_ITEM_DONTCARE;
+ }
+
+ return SfxSlotInterceptor::QueryState( nSID, rpState );
+ }
+*/
+
+{
+ return SFX_ITEM_UNKNOWN;
+}
+
+//-------------------------------------------------------------------------
+
+SfxItemState SfxBindings::QueryState( sal_uInt16 nSlot, SfxPoolItem* &rpState )
+/* [Beschreibung]
+
+ Wird gerufen, um den Status f"ur 'nSlot' zu erfragen. Wenn der return
+ value SFX_ITEM_SET ist, wird ein SfxPoolItem zur"uckgegeben, indem der
+ rpState entsprechend gesetzt wird. Es findet dabei ein Eigent"umer"ubergang
+ statt, d.h. die aufrufende Methode mu\s das Item l"oschen.
+
+ Anmerkung: diese Methode ist sehr teuer und sollte nur gerufen werden,
+ wenn kein Controller f"ur das Erfragen des Status angelegt werden kann oder
+ der Status unbedingt sofort geliefert werden mu\s.
+*/
+
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp;
+ SfxStateCache *pCache = GetStateCache( nSlot );
+ if ( pCache )
+ xDisp = pCache->GetDispatch();
+ if ( xDisp.is() || !pCache && pImp->xProv.is() )
+ {
+//(mba)/compview
+ const SfxSlot* pSlot = 0;//SfxComponentViewShell::GetUnoSlot( nSlot );
+ ::com::sun::star::util::URL aURL;
+ if ( pSlot )
+ {
+ String aCmd( DEFINE_CONST_UNICODE(".uno:"));
+ aCmd += String::CreateFromAscii(pSlot->GetUnoName());
+ aURL.Complete = aCmd;
+ }
+ else
+ {
+ String aCmd( DEFINE_CONST_UNICODE("slot:") );
+ aCmd += String::CreateFromInt32(nSlot);
+ aURL.Complete = aCmd;
+ }
+
+ Reference < XURLTransformer > xTrans( ::utl::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ xTrans->parseStrict( aURL );
+ if ( !xDisp.is() )
+ xDisp = pImp->xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
+
+ if ( xDisp.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xTunnel( xDisp, ::com::sun::star::uno::UNO_QUERY );
+ SfxOfficeDispatch* pDisp = NULL;
+ if ( xTunnel.is() )
+ {
+ sal_Int64 nImplementation = xTunnel->getSomething(SfxOfficeDispatch::impl_getStaticIdentifier());
+ pDisp = (SfxOfficeDispatch*)(nImplementation);
+ }
+
+ if ( !pDisp || pDisp->IsInterceptDispatch() )
+ {
+ SfxItemState eState = SFX_ITEM_SET;
+ SfxPoolItem *pItem=NULL;
+ BindDispatch_Impl *pBind = new BindDispatch_Impl( xDisp, aURL, NULL );
+ pBind->acquire();
+ xDisp->addStatusListener( pBind, aURL );
+ if ( !pBind->GetStatus().IsEnabled )
+ eState = SFX_ITEM_DISABLED;
+ else
+ {
+ ::com::sun::star::uno::Any aAny = pBind->GetStatus().State;
+ ::com::sun::star::uno::Type pType = aAny.getValueType();
+
+ if ( pType == ::getBooleanCppuType() )
+ {
+ sal_Bool bTemp ;
+ aAny >>= bTemp ;
+ pItem = new SfxBoolItem( nSlot, bTemp );
+ }
+ else if ( pType == ::getCppuType((const sal_uInt16*)0) )
+ {
+ sal_uInt16 nTemp ;
+ aAny >>= nTemp ;
+ pItem = new SfxUInt16Item( nSlot, nTemp );
+ }
+ else if ( pType == ::getCppuType((const sal_uInt32*)0) )
+ {
+ sal_uInt32 nTemp ;
+ aAny >>= nTemp ;
+ pItem = new SfxUInt32Item( nSlot, nTemp );
+ }
+ else if ( pType == ::getCppuType((const ::rtl::OUString*)0) )
+ {
+ ::rtl::OUString sTemp ;
+ aAny >>= sTemp ;
+ pItem = new SfxStringItem( nSlot, sTemp );
+ }
+ else
+ pItem = new SfxVoidItem( nSlot );
+ }
+
+ pBind->Release();
+ rpState = pItem;
+ return eState;
+ }
+ }
+ }
+
+ SfxSlotServer aServer;
+/*
+ if ( pDispatcher->_TryIntercept_Impl( nSlot, aServer, sal_False ) )
+ {
+ SfxShell* pShell = pDispatcher->GetShell( aServer.GetShellLevel() );
+ const SfxPoolItem *pItem = pShell->GetSlotState(nSlot);
+ if ( !pItem )
+ return SFX_ITEM_DISABLED;
+ else
+ {
+ rpState = pItem->Clone();
+ return SFX_ITEM_SET;
+ }
+ }
+*/
+ if ( pImp->pInterceptors )
+ {
+ // Zuerst die Interceptoren testen
+ for ( sal_uInt16 n = 0; n < pImp->pInterceptors->Count(); ++n )
+ {
+ SfxSlotInterceptor *pInterceptor = pImp->pInterceptors->GetObject(n);
+ SfxItemState eState = pInterceptor->QueryState( nSlot, rpState );
+ if ( SFX_ITEM_UNKNOWN != eState )
+ return eState;
+ }
+ }
+
+ // Dann am Dispatcher testen; da die von dort zur"uckgegebenen Items immer
+ // DELETE_ON_IDLE sind, mu\s eine Kopie davon gezogen werden, um einen
+ // Eigent"umer"ubergang zu erm"oglichen
+ const SfxPoolItem *pItem = NULL;
+ SfxItemState eState = pDispatcher->QueryState( nSlot, pItem );
+ if ( eState == SFX_ITEM_SET )
+ {
+ DBG_ASSERT( pItem, "SFX_ITEM_SET aber kein Item!" );
+ if ( pItem )
+ rpState = pItem->Clone();
+ }
+ else if ( eState == SFX_ITEM_AVAILABLE && pItem )
+ {
+ rpState = pItem->Clone();
+ }
+
+ return eState;
+}
+
+#if 0
+sal_Bool SfxBindings::IsInExecute_Impl() const
+{
+ return pImp->bInExecute;
+}
+#endif
+
+void SfxBindings::SetSubBindings_Impl( SfxBindings *pSub )
+{
+ if ( pImp->pSubBindings )
+ {
+ if ( pImp->pInterceptors )
+ {
+ for ( sal_uInt16 n = 0; n < pImp->pInterceptors->Count(); ++n )
+ {
+ SfxSlotInterceptor *pInter = pImp->pInterceptors->GetObject(n);
+ pImp->pSubBindings->pImp->RemoveSlotInterceptor( pInter );
+ }
+ }
+
+ pImp->pSubBindings->SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > () );
+ pImp->pSubBindings->pImp->pSuperBindings = NULL;
+ }
+
+ pImp->pSubBindings = pSub;
+
+ if ( pSub )
+ {
+ pImp->pSubBindings->SetDispatchProvider_Impl( pImp->xProv );
+ pSub->pImp->pSuperBindings = this;
+
+ if ( pImp->pInterceptors )
+ {
+ for ( sal_uInt16 n = 0; n < pImp->pInterceptors->Count(); ++n )
+ {
+ SfxSlotInterceptor *pInter = pImp->pInterceptors->GetObject(n);
+ pImp->pSubBindings->pImp->InsertSlotInterceptor( pInter );
+ }
+ }
+ }
+}
+
+SfxBindings* SfxBindings::GetSubBindings_Impl( sal_Bool bTop ) const
+{
+ SfxBindings *pRet = pImp->pSubBindings;
+ if ( bTop )
+ {
+ while ( pRet->pImp->pSubBindings )
+ pRet = pRet->pImp->pSubBindings;
+ }
+
+ return pRet;
+}
+
+void SfxBindings::SetWorkWindow_Impl( SfxWorkWindow* pWork )
+{
+ pImp->pWorkWin = pWork;
+}
+
+SfxWorkWindow* SfxBindings::GetWorkWindow_Impl() const
+{
+ return pImp->pWorkWin;
+}
+
+void SfxBindings::RegisterUnoController_Impl( SfxUnoControllerItem* pControl )
+{
+ if ( !pImp->pUnoCtrlArr )
+ pImp->pUnoCtrlArr = new SfxUnoControllerArr_Impl;
+ pImp->pUnoCtrlArr->Insert( pControl, pImp->pUnoCtrlArr->Count() );
+}
+
+void SfxBindings::ReleaseUnoController_Impl( SfxUnoControllerItem* pControl )
+{
+ if ( pImp->pUnoCtrlArr )
+ {
+ sal_uInt16 nPos = pImp->pUnoCtrlArr->GetPos( pControl );
+ if ( nPos != 0xFFFF )
+ {
+ pImp->pUnoCtrlArr->Remove( nPos );
+ return;
+ }
+ }
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->ReleaseUnoController_Impl( pControl );
+}
+
+void SfxBindings::InvalidateUnoControllers_Impl()
+{
+ if ( pImp->pUnoCtrlArr )
+ {
+ sal_uInt16 nCount = pImp->pUnoCtrlArr->Count();
+ for ( sal_uInt16 n=nCount; n>0; n-- )
+ {
+ SfxUnoControllerItem *pCtrl = (*pImp->pUnoCtrlArr)[n-1];
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef( (::cppu::OWeakObject*)pCtrl, ::com::sun::star::uno::UNO_QUERY );
+ pCtrl->ReleaseDispatch();
+ pCtrl->GetNewDispatch();
+ }
+ }
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->InvalidateUnoControllers_Impl();
+}
+
+sal_Bool SfxBindings::IsInUpdate() const
+{
+ sal_Bool bInUpdate = pImp->bInUpdate;
+ if ( !bInUpdate && pImp->pSubBindings )
+ bInUpdate = pImp->pSubBindings->IsInUpdate();
+ return bInUpdate;
+}
+
+void SfxBindings::SetActiveFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & rFrame )
+{
+ if ( rFrame.is() )
+ SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > ( rFrame, ::com::sun::star::uno::UNO_QUERY ) );
+ else if ( pDispatcher && pDispatcher->GetFrame() )
+ {
+ SfxFrame *pFrame = pDispatcher->GetFrame()->GetFrame();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( pFrame->GetInterceptor_Impl(), ::com::sun::star::uno::UNO_QUERY );
+ SetDispatchProvider_Impl( xProv );
+ }
+ else
+ SetDispatchProvider_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > () );
+}
+
+void SfxBindings::SetDispatchProvider_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & rProv )
+{
+ sal_Bool bInvalidate = ( rProv != pImp->xProv );
+ if ( bInvalidate )
+ {
+ pImp->xProv = rProv;
+ InvalidateAll( sal_True );
+ InvalidateUnoControllers_Impl();
+ }
+
+ if ( pImp->pSubBindings )
+ pImp->pSubBindings->SetDispatchProvider_Impl( pImp->xProv );
+}
+
+const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & SfxBindings::GetDispatchProvider_Impl() const
+{
+ return pImp->xProv;
+}
+
+SystemWindow* SfxBindings::GetSystemWindow() const
+{
+ SfxViewFrame *pFrame = pDispatcher->GetFrame();
+ while ( pFrame->GetParentViewFrame_Impl() )
+ pFrame = pFrame->GetParentViewFrame_Impl();
+ SfxTopViewFrame* pTop = PTR_CAST( SfxTopViewFrame, pFrame->GetTopViewFrame() );
+ return pTop->GetTopFrame_Impl()->GetTopWindow_Impl();
+}
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
new file mode 100644
index 000000000000..2d832fd0ef80
--- /dev/null
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -0,0 +1,480 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrlitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#pragma hdrstop
+
+#include "ctrlitem.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "msgpool.hxx"
+#include "statcach.hxx"
+
+//====================================================================
+
+DBG_NAME(SfxControllerItem);
+
+//--------------------------------------------------------------------
+#ifdef DBG_UTIL
+
+void SfxControllerItem::CheckConfigure_Impl( ULONG nType )
+{
+ // echter Slot? (also kein Separator etc.)
+ if ( !nId )
+ return;
+
+ // ist die Id "uberhaupt in 'nType' konfigurierbar?
+ const SfxSlot *pSlot = SFX_SLOTPOOL().GetSlot(nId);
+ DBG_ASSERTWARNING( pSlot, "SfxControllerItem: binding not existing slot" );
+ if ( pSlot && !pSlot->IsMode(nType) )
+ {
+ DBG_WARNING( "SfxControllerItem: slot without ...Config-flag" );
+ DbgOutf( "SfxControllerItem: Config-flag missing at SID %5d",
+ pSlot->GetSlotId() );
+ }
+}
+
+#endif
+
+//--------------------------------------------------------------------
+
+// returns the next registered SfxControllerItem with the same id
+
+SfxControllerItem* SfxControllerItem::GetItemLink()
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ return pNext == this ? 0 : pNext;
+}
+
+//--------------------------------------------------------------------
+
+// returns TRUE if this binding is really bound to a function
+
+BOOL SfxControllerItem::IsBound() const
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ return pNext != this;
+}
+
+//--------------------------------------------------------------------
+
+// returns the associated function-id or 0 if none
+
+// USHORT SfxControllerItem::GetId() const;
+
+//====================================================================
+
+// registeres with the id at the bindings
+
+void SfxControllerItem::Bind( USHORT nNewId, SfxBindings *pBindinx )
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ DBG_ASSERT(pBindings || pBindinx, "Keine Bindings");
+
+ if ( IsBound() ) {
+ DBG_ASSERT(pBindings, "Keine Bindings");
+ pBindings->Release(*this);
+ }
+
+ nId = nNewId;
+ pNext = 0;
+
+ if (pBindinx)
+ pBindings = pBindinx;
+ pBindings->Register(*this);
+}
+
+
+//====================================================================
+
+void SfxControllerItem::UnBind()
+
+/* [Beschreibung]
+
+ "ost die Verbindung dieses SfxControllerItems mit der SfxBindings-Instanz,
+ an der es zur Zeit gebunden ist. Ab diesem Zeitpunkt erh"alt es keine
+ Statusbenachrichtigungen (<SfxControllerItem::StateChented()>) mehr.
+
+
+ [Querverweise]
+
+ <SfxControllerItem::ReBind()>
+ <SfxControllerItem::ClearCache()>
+*/
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ DBG_ASSERT(pBindings, "Keine Bindings");
+ DBG_ASSERT( IsBound(), "unbindings unbound SfxControllerItem" );
+
+ pBindings->Release(*this);
+ pNext = this;
+}
+
+//====================================================================
+
+void SfxControllerItem::ReBind()
+
+/* [Beschreibung]
+
+ Binded dieses SfxControllerItem wieder an die SfxBindings-Instanz,
+ an der es zuletzt gebunden war. Ab diesem Zeitpunkt erh"alt es wieder
+ Statusbenachrichtigungen (<SfxControllerItem::StateChented()>).
+
+
+ [Querverweise]
+
+ <SfxControllerItem::UnBind()>
+ <SfxControllerItem::ClearCache()>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ DBG_ASSERT(pBindings, "Keine Bindings");
+ DBG_ASSERT( !IsBound(), "bindings rebound SfxControllerItem" );
+
+ pBindings->Register(*this);
+}
+
+//====================================================================
+
+void SfxControllerItem::UpdateSlot()
+
+/* [Beschreibung]
+
+ Holt den Status 'hart' neu.
+
+ [Querverweise]
+
+ <SfxControllerItem::ClearCache()>
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ DBG_ASSERT(pBindings, "Keine Bindings");
+
+ pBindings->Update( GetId() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxControllerItem::ClearCache()
+
+/* [Beschreibung]
+
+ "oscht den Status-Cache f"ur dieses SfxControllerItem. D.h. beim
+ n"achsten Status-Update wird das <SfxPoolItem> auf jeden Fall geschickt,
+ auch wenn zuvor dasselbe geschickt wurde. Dies wird ben"otigt, wenn
+ ein Controller umgeschaltet werden kann und sich diesen Status
+ selbst merkt.
+
+
+ [Beispiel]
+
+ Der Kombi-Controller f"ur das Einstellen des Fl"achentyps und der
+ konkreten Auspr"agung (Farbe blau oder Schraffur X) kann im Typ
+ umgestellt werden, wird jedoch dann bei der n"achsten Selektion
+ wieder benachrichtigt, auch wenn es dieselben Daten sind.
+
+
+ [Querverweise]
+
+ <SfxControllerItem::UnBind()>
+ <SfxControllerItem::ReBind()>
+*/
+
+
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ DBG_ASSERT(pBindings, "Keine Bindings");
+
+ pBindings->ClearCache_Impl( GetId() );
+}
+
+//--------------------------------------------------------------------
+
+// replaces the successor in the list of bindings of the same id
+
+SfxControllerItem* SfxControllerItem::ChangeItemLink( SfxControllerItem* pNewLink )
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ SfxControllerItem* pOldLink = pNext;
+ pNext = pNewLink;
+ return pOldLink == this ? 0 : pOldLink;
+}
+
+//--------------------------------------------------------------------
+
+// changes the id of unbound functions (e.g. for sub-menu-ids)
+
+void SfxControllerItem::SetId( USHORT nItemId )
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+ DBG_ASSERT( !IsBound(), "changing id of bound binding" );
+ nId = nItemId;
+}
+
+//--------------------------------------------------------------------
+
+SvStream& operator<<( SvStream& rStream, const SfxControllerItem& rFunc )
+{
+ DBG_MEMTEST();
+ SFX_SLOTPOOL().StoreId( rStream, rFunc.nId );
+ return rStream;
+}
+
+//--------------------------------------------------------------------
+
+SvStream& operator>>( SvStream& rStream, SfxControllerItem& rFunc )
+{
+ DBG_MEMTEST();
+ USHORT nId;
+ SFX_SLOTPOOL().LoadId( rStream, nId );
+ rFunc.Bind(nId);
+ return rStream;
+}
+
+//--------------------------------------------------------------------
+
+// creates a atomic item for a controller without registration
+
+SfxControllerItem::SfxControllerItem():
+ nId(0),
+ pNext(this),
+ pBindings(0)
+{
+ DBG_MEMTEST();
+ DBG_CTOR(SfxControllerItem, 0);
+}
+
+//--------------------------------------------------------------------
+
+// creates a representation of the function nId and registeres it
+
+SfxControllerItem::SfxControllerItem( USHORT nId, SfxBindings &rBindings ):
+ nId(nId),
+ pNext(this),
+ pBindings(&rBindings)
+{
+ DBG_MEMTEST();
+ DBG_CTOR(SfxControllerItem, 0);
+ Bind(nId, &rBindings);
+}
+
+//--------------------------------------------------------------------
+
+// unregisteres the item in the bindings
+
+SfxControllerItem::~SfxControllerItem()
+{
+ DBG_MEMTEST();
+ if ( IsBound() )
+ pBindings->Release(*this);
+ DBG_DTOR(SfxControllerItem, 0);
+}
+
+//--------------------------------------------------------------------
+
+void SfxControllerItem::StateChanged
+(
+ USHORT nSID, // <SID> des ausl"osenden Slot
+ SfxItemState eState, // <SfxItemState> von 'pState'
+ const SfxPoolItem* pState // Slot-Status, ggf. 0 oder IsInvalidItem()
+)
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode wird vom SFx gerufen, um <SfxControllerItem>s
+ dar"uber zu benachrichtigen, da\s sich der Status des Slots 'nSID'
+ ge"andert hat. Der neue Wert sowie der von diesem Wert ermittelte
+ Status wird als 'pState' bzw. 'eState' mitgegeben.
+
+ Der Status eines Slots kann sich "andern, wenn z.B. das MDI-Fenster
+ gewechselt wird oder der Slot explizit mit <SfxBindings::Invalidate()>
+ invalidiert wurde.
+
+ Achtung! Die Methode wird nicht gerufen, wenn der Slot ung"ultig wurde,
+ danach jedoch wieder denselben Wert angenommen hat.
+
+ Diese Basisklasse braucht nicht gerufen zu werden, weitere Zwischenstufen
+ jedoch (z.B. <SfxToolboxControl>) sollten gerufen werden.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+}
+
+//--------------------------------------------------------------------
+
+void SfxControllerItem::DeleteFloatingWindow()
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxControllerItem, 0);
+}
+
+//--------------------------------------------------------------------
+
+void SfxStatusForwarder::StateChanged
+(
+ USHORT nSID, // <SID> des ausl"osenden Slot
+ SfxItemState eState, // <SfxItemState> von 'pState'
+ const SfxPoolItem* pState // Slot-Status, ggf. 0 oder IsInvalidItem()
+)
+
+{
+ pMaster->StateChanged( nSID, eState, pState );
+}
+
+//--------------------------------------------------------------------
+
+SfxStatusForwarder::SfxStatusForwarder(
+ USHORT nSlotId,
+ SfxControllerItem& rMaster ):
+ SfxControllerItem( nSlotId, rMaster.GetBindings() ),
+ pMaster( &rMaster )
+{
+}
+
+//--------------------------------------------------------------------
+
+SfxItemState SfxControllerItem::GetItemState
+(
+ const SfxPoolItem* pState /* Pointer auf das <SfxPoolItem>, dessen
+ Status erfragt werden soll. */
+)
+
+/* [Beschreibung]
+
+ Statische Methode zum Ermitteln des Status des SfxPoolItem-Pointers,
+ in der Methode <SfxControllerItem::StateChanged(const SfxPoolItem*)>
+ zu verwenden.
+
+ [R"uckgabewert]
+
+ SfxItemState SFX_ITEM_UNKNOWN
+ Enabled, aber keine weitere Statusinformation
+ verf"ugbar. Typisch f"ur <Slot>s, die allenfalls
+ zeitweise disabled sind, aber ihre Darstellung sonst
+ nicht "andern.
+
+ SFX_ITEM_DISABLED
+ Disabled und keine weiter Statusinformation
+ verf"ugbar. Alle anderen ggf. angezeigten Werte sollten
+ auf den Default zur"uckgesetzt werden.
+
+ SFX_ITEM_DONTCARE
+ Enabled aber es waren nur uneindeutige Werte
+ verf"ugbar (also keine, die abgefragt werden k"onnen).
+
+ SFX_ITEM_AVAILABLE
+ Enabled und mit verf"ugbarem Wert, der von 'pState'
+ erfragbar ist. Der Typ ist dabei im gesamten
+ Programm eindeutig und durch den Slot festgelegt.
+*/
+
+{
+ return !pState
+ ? SFX_ITEM_DISABLED
+ : IsInvalidItem(pState)
+ ? SFX_ITEM_DONTCARE
+ : pState->ISA(SfxVoidItem) && !pState->Which()
+ ? SFX_ITEM_UNKNOWN
+ : SFX_ITEM_AVAILABLE;
+}
+
+//--------------------------------------------------------------------
+
+SfxMapUnit SfxControllerItem::GetCoreMetric() const
+
+/* [Beschreibung]
+
+ Holt vom zust"andigen Pool die Ma\seinheit ab, in der das Status-Item
+ vorliegt.
+*/
+
+{
+ SfxStateCache *pCache = pBindings->GetStateCache( nId );
+ SfxDispatcher *pDispat = pBindings->GetDispatcher_Impl();
+ const SfxSlotServer *pServer = pCache->GetSlotServer( *pDispat );
+ SfxShell *pSh = pDispat->GetShell( pServer->GetShellLevel() );
+ SfxItemPool &rPool = pSh->GetPool();
+ USHORT nWhich = rPool.GetWhich( nId );
+ return rPool.GetMetric( nWhich );
+}
+
+//------------------------------------------------------------------------
+
+#ifdef WNT
+#pragma optimize("g",off)
+#endif
+
+
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
new file mode 100644
index 000000000000..57c5c7f6e630
--- /dev/null
+++ b/sfx2/source/control/dispatch.cxx
@@ -0,0 +1,3493 @@
+/*************************************************************************
+ *
+ * $RCSfile: dispatch.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXITEMITER_HXX //autogen
+#include <svtools/itemiter.hxx>
+#endif
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXEITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _UNDO_HXX //autogen
+#include <svtools/undo.hxx>
+#endif
+#ifndef _WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SVTOOLS_TTPROPS_HXX
+#include <svtools/ttprops.hxx>
+#endif
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h> // wg. bsearch
+
+#define _SVSTDARR_ULONGS
+#include <svtools/svstdarr.hxx>
+
+#pragma hdrstop
+
+#include "sfxhelp.hxx"
+#include "appdata.hxx"
+#include "dispatch.hxx"
+#include "minstack.hxx"
+#include "msg.hxx"
+#include "objface.hxx"
+#include "bindings.hxx"
+#include "request.hxx"
+#include "app.hxx"
+#include "hintpost.hxx"
+#include "slotserv.hxx"
+#include "ipfrm.hxx"
+#include "interno.hxx"
+#include "sfxtypes.hxx"
+#include "macrconf.hxx"
+#include "virtmenu.hxx"
+#include "viewfrm.hxx"
+#include "viewsh.hxx"
+#include "mnumgr.hxx"
+#include "childwin.hxx"
+#include "docfac.hxx"
+#include "saveopt.hxx"
+#include "ipenv.hxx"
+#include "msgpool.hxx"
+#include "module.hxx"
+#include "tbxconf.hxx"
+#include "topfrm.hxx"
+#include "sfxuno.hxx"
+
+//==================================================================
+DBG_NAME(SfxDispatcherFlush);
+DBG_NAME(SfxDispatcherFillState);
+
+//==================================================================
+SV_IMPL_PTRARR( SfxItemPtrArray, SfxPoolItemPtr );
+
+DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
+//==================================================================
+
+struct SfxToDo_Impl
+{
+ SfxShell* pCluster;
+ sal_Bool bPush;
+ sal_Bool bDelete;
+ sal_Bool bUntil;
+
+ SfxToDo_Impl():
+ bPush(sal_False), bDelete(sal_False), bUntil(sal_False), pCluster(0) {}
+ SfxToDo_Impl( sal_Bool bOpPush, sal_Bool bOpDelete, sal_Bool bOpUntil, SfxShell& rCluster ):
+ bPush(bOpPush), bDelete(bOpDelete), bUntil(bOpUntil), pCluster(&rCluster) {}
+ ~SfxToDo_Impl(){}
+
+ sal_Bool operator==( const SfxToDo_Impl& rWith ) const
+ { return pCluster==rWith.pCluster && bPush==rWith.bPush; }
+};
+
+DECL_OBJSTACK(SfxToDoStack_Impl, SfxToDo_Impl, 8, 4);
+IMPL_OBJSTACK(SfxToDoStack_Impl, SfxToDo_Impl);
+
+struct SfxObjectBars_Impl
+{
+ ResId aResId; // Resource - und ConfigId der Toolbox
+ sal_uInt16 nMode; // spezielle Sichtbarkeitsflags
+ String aName;
+ SfxInterface* pIFace;
+
+ SfxObjectBars_Impl() :
+ aResId( 0,0 )
+ {}
+};
+
+//------------------------------------------------------------------
+
+struct SfxDispatcher_Impl
+{
+ const SfxSlotServer* pCachedServ1; // zuletzt gerufene Message
+ const SfxSlotServer* pCachedServ2; // vorletzt gerufene Message
+ SfxShellStack_Impl aStack; // aktive Funktionalitaet
+ Timer aTimer; // fuers flushen
+ SfxToDoStack_Impl aToDoStack; // nicht abgearb. Push/Pop
+ SfxViewFrame* pFrame; // 0 oder zugeh"or. Frame
+ SfxDispatcher* pParent; // z.B. AppDispatcher, ggf. 0
+ SfxHintPosterRef xPoster; // asynchrones Execute
+ sal_Bool bFlushing; // sal_True waehrend Flush //?
+ sal_Bool bFlushed; // aToDoStack.Count() == 0
+ sal_Bool bUpdated; // Update_Impl gelaufen
+ sal_Bool bLocked; // kein Execute
+ sal_Bool bInvalidateOnUnlock;// da fragte jemand
+ sal_Bool bActive; // nicht verwechseln mit gesetzt!
+ sal_Bool* pInCallAliveFlag; // dem Stack den Dtor anzeigen
+ SfxObjectBars_Impl aObjBars[SFX_OBJECTBAR_MAX];
+ SfxObjectBars_Impl aFixedObjBars[SFX_OBJECTBAR_MAX];
+ SvULongs aChildWins;
+ sal_uInt16 nActionLevel; // in EnterAction
+ sal_uInt32 nEventId; // EventId UserEvent
+ sal_Bool bUILocked; // Update abgeklemmt (!zappeln)
+ sal_Bool bNoUI; // UI nur vom Parent Dispatcher
+ sal_Bool bReadOnly; // Dokument ist ReadOnly
+ sal_Bool bQuiet; // nur parent dispatcher verwenden
+ sal_Bool bModal; // nur Slots vom Parent-Dispatcher
+
+ sal_Bool bFilterEnabling; // sal_True=filter enabled slots, 2==ReadOnlyDoc uebersteuert
+ sal_uInt16 nFilterCount; // Anzahl der SIDs in pFilterSIDs
+ const sal_uInt16* pFilterSIDs; // sortiertes Array von SIDs
+ sal_uInt16 nStandardMode; // ExecuteMode f. PlugInDispatcher
+ SvUShorts* pDisableList;
+ sal_uInt32 nDisableFlags;
+};
+
+#define NO_OBJECTBAR 0
+#define OWN_OBJECTBAR 1
+#define OTHER_OBJECTBAR 2
+
+//------------------------------------------------------------------
+
+#define SFX_FLUSH_TIMEOUT 50
+
+//====================================================================
+sal_Bool SfxDispatcher::IsLocked( sal_uInt16 nSID ) const
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann festgestellt werden, ob der SfxDispatcher
+ gesperrt oder freigegeben ist. Ein gesperrter SfxDispatcher
+ f"uhrt keine <SfxRequest>s mehr aus und liefert keine
+ Status-Informationen mehr. Er verh"alt sich so als w"aren alle
+ Slots disabled.
+
+ Der Dispatcher gilt auch als gesperrt, wenn alle Dispatcher
+ gelockt sind (<SfxApplication::LockDispatcher()>) oder der zugeh"orige
+ Top-Frame im modal-mode ist und der angegebene Slot Frame-spezifisch
+ (also nicht von der Application) bedient wird.
+*/
+
+{
+ return nSID != SID_BROWSE_STOP && nSID != SID_HELP_PI &&
+ ( pImp->bLocked || SFX_APP()->IsDispatcherLocked() );
+}
+
+//--------------------------------------------------------------------
+sal_Bool SfxDispatcher::IsAppDispatcher() const
+
+/* [Beschreibung]
+
+ Mit dieser Methode l"a\st sich festellen, ob der SfxDispacher der
+ Applikations-Dispatcher ist.
+
+
+ [R"uckgabewert]
+
+ sal_Bool sal_True
+ Es ist der Applikations-Dispatcher.
+
+ sal_False
+ Es ist ein Dispatcher eines SfxViewFrame.
+*/
+
+{
+ return !pImp->pFrame;
+}
+
+//--------------------------------------------------------------------
+int SfxDispatcher::Call_Impl( SfxShell& rShell, const SfxSlot &rSlot, SfxRequest &rReq, sal_Bool bRecord )
+
+/* [Beschreibung]
+
+ Hilfsfunktion zum pr"ufen, ob ein Slot executed werden darf und
+ der Execution selbst.
+*/
+
+{
+ SFX_STACK(SfxDispatcher::Call_Impl);
+
+ // darf der Slot gerufen werden (i.S.v. enabled)
+ SfxApplication *pSfxApp = SFX_APP();
+ if ( rSlot.IsMode(SFX_SLOT_FASTCALL) || rShell.CanExecuteSlot_Impl(rSlot) )
+ {
+ // ggf. die Bindings locken (MI: warum?)
+ SfxBindings *pBindings = GetBindings();
+#if modal_mode_sinnlos
+ sal_Bool bLockBindings = rSlot.GetSlotId() != SID_OPENDOC && rSlot.GetSlotId() != SID_OPENURL;
+ if ( bLockBindings && pBindings )
+ pBindings->DENTERREGISTRATIONS();
+#endif
+
+ // Alles holen, was gebraucht wird, da der Slot den Execute evtl. nicht
+ // "uberlebt, falls es ein 'Pseudoslot' f"ur Macros oder Verben ist
+ sal_Bool bAutoUpdate = rSlot.IsMode(SFX_SLOT_AUTOUPDATE);
+ SFX_REQUEST_ARG(rReq, pOrigItem, SfxExecuteItem, SID_SUBREQUEST, sal_False);
+ SfxExecuteItem *pExecuteItem = pOrigItem
+ ? (SfxExecuteItem*)pOrigItem->Clone()
+ : 0;
+
+ // ggf. TabPage-ID setzen und SID merken
+ SfxAppData_Impl *pAppData = pSfxApp->Get_Impl();
+ SFX_REQUEST_ARG(rReq, pTabPageItem, SfxUInt16Item, SID_TABPAGE, sal_False);
+ if ( pTabPageItem )
+ {
+ pAppData->nAutoTabPageId = pTabPageItem->GetValue();
+ rReq.RemoveItem( SID_TABPAGE ); // sonst ArgCount > 0 => Seiteneff.
+ }
+ pAppData->nExecutingSID = rReq.GetSlot();
+
+ // API-Call-Klammerung und Document-Lock w"ahrend des Calls
+ {
+ // 'this' mu\s im Dtor bescheid sagen
+ sal_Bool bThisDispatcherAlive = sal_True;
+ sal_Bool *pOldInCallAliveFlag = pImp->pInCallAliveFlag;
+ pImp->pInCallAliveFlag = &bThisDispatcherAlive;
+
+ // eigentlichen Call durchf"uhren
+ sal_Bool bDone = sal_False;
+/*
+ SfxViewFrame *pViewFrame = GetFrame();
+ if ( pViewFrame )
+ {
+ SFX_REQUEST_ARG(rReq, pInterceptorItem, SfxBoolItem, SID_INTERCEPTOR, sal_False);
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor > xProv( pViewFrame->GetFrame()->GetInterceptor_Impl() );
+ sal_Bool bDirect = ( pInterceptorItem != 0 );
+ if ( bDirect )
+ {
+ bDirect = !pInterceptorItem->GetValue();
+ rReq.RemoveItem( SID_INTERCEPTOR );
+ }
+
+ if ( xProv.is() && !bDirect )
+ {
+ bDone = sal_True;
+ ::com::sun::star::util::URL aURL;
+ String aName( rSlot.GetUnoName() );
+ String aCmd;
+ if ( aName.getLength() )
+ {
+ aCmd = ".uno:";
+ aCmd += aName;
+ }
+ else
+ {
+ aCmd = "slot:";
+ aCmd += rSlot.GetSlotId();
+ }
+
+ aURL.Complete = S2U( aCmd );
+ SfxURLTransformer aTrans;
+ aTrans.parseStrict( aURL );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = xProv->queryDispatch( aURL, "", 0 );
+ if ( xDisp.is() )
+ {
+// automatisch auskommentiert - [getImplementation] - Wird von OWeakObject nicht weiter untersttzt!
+// void* pDisp = xDisp->getImplementation( ::getCppuType((const SfxOfficeDispatch*)0) );
+
+ if ( pDisp)
+ bDone = sal_False;
+ else
+ {
+ ::com::sun::star::uno::Sequence <PropertyValue> aSequ;
+ if ( rReq.GetArgs() )
+ TransformItems( rSlot.GetSlotId(), *rReq.GetArgs(), aSequ, &rSlot );
+ xDisp->dispatch( aURL, aSequ );
+ }
+ }
+ }
+ }
+*/
+ if ( !bDone )
+ {
+ // Bei neuen/komplizierten Funktionen den HelpAgent feuern...
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ ((SfxHelp_Impl*)pHelp)->SlotExecutedOrFocusChanged( rReq.GetSlot(), sal_True, pSfxApp->GetOptions().IsAutoHelpAgent() );
+
+ SfxExecFunc pFunc = rSlot.GetExecFnc();
+ rShell.CallExec( pFunc, rReq );
+ }
+
+ // falls 'this' noch lebt
+ if ( bThisDispatcherAlive )
+ pImp->pInCallAliveFlag = pOldInCallAliveFlag;
+ else if ( pOldInCallAliveFlag )
+ // auch verschachtelte Stack-Frames sch"utzen
+ *pOldInCallAliveFlag = sal_False;
+ }
+
+ // TabPage-ID und Executing-SID zurueck setzen
+ if ( pTabPageItem )
+ pAppData->nAutoTabPageId = 0;
+ pAppData->nExecutingSID = 0;
+
+#if modal_mode_sinnlos
+ // ggf. Lock wieder freigeben
+ if ( bLockBindings )
+ pBindings->DLEAVEREGISTRATIONS();
+#endif
+
+ if( pExecuteItem )
+ {
+ Execute( *pExecuteItem );
+ delete pExecuteItem;
+ }
+
+ if ( rReq.IsDone() )
+ {
+ // bei AutoUpdate sofort updaten; "Pseudoslots" d"urfen nicht
+ // Autoupdate sein!
+ if ( bAutoUpdate )
+ {
+ const SfxSlot* pSlave = rSlot.GetLinkedSlot();
+ if (pSlave)
+ {
+ // bei Enum-Slots irgendeinen gebundenen Slave-Slot nehmen
+ while (!pBindings->IsBound(pSlave->GetSlotId()) && pSlave != &rSlot )
+ pSlave = pSlave->GetLinkedSlot();
+ pBindings->Invalidate(pSlave->GetSlotId());
+ pBindings->Update(pSlave->GetSlotId());
+ }
+ else
+ {
+ pBindings->Invalidate(rSlot.GetSlotId());
+ pBindings->Update(rSlot.GetSlotId());
+ }
+ }
+ return sal_True;
+ }
+ }
+
+ return sal_False;
+}
+
+//====================================================================
+void SfxDispatcher::Construct_Impl( SfxDispatcher* pParent )
+{
+ pImp = new SfxDispatcher_Impl;
+ bFlushed = sal_True;
+ SfxApplication *pSfxApp = SFX_APP();
+
+ pImp->pCachedServ1 = 0;
+ pImp->pCachedServ2 = 0;
+ pImp->bFlushing = sal_False;
+ pImp->bUpdated = sal_False;
+ pImp->bLocked = sal_False;
+ pImp->bActive = sal_False;
+ pImp->pParent = NULL;
+ pImp->bUILocked = sal_False;
+ pImp->bNoUI = sal_False;
+ pImp->bReadOnly = sal_False;
+ pImp->bQuiet = sal_False;
+ pImp->bModal = sal_False;
+ pImp->pInCallAliveFlag = 0;
+ pImp->bFilterEnabling = sal_False;
+ pImp->nFilterCount = 0;
+ pImp->pFilterSIDs = 0;
+ pImp->nStandardMode = 0;
+ pImp->pDisableList = pSfxApp->GetDisabledSlotList_Impl();
+ pImp->nDisableFlags = 0;
+
+ pImp->pParent = pParent;
+
+ pImp->bInvalidateOnUnlock = sal_False;
+ pImp->nActionLevel = 0;
+
+ for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
+ pImp->aObjBars[n].aResId = ResId( 0,0 );
+
+ GenLink aGenLink( LINK(this, SfxDispatcher, PostMsgHandler) );
+
+ pImp->xPoster = new SfxHintPoster(aGenLink);
+
+ pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT);
+ pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) );
+}
+
+SfxDispatcher::SfxDispatcher( SfxDispatcher* pParent )
+{
+ Construct_Impl( pParent );
+ pImp->pFrame = 0;
+}
+
+SfxDispatcher::SfxDispatcher( SfxViewFrame *pViewFrame )
+
+/* [Beschreibung]
+
+ Der Konstruktor der Klasse SfxDispatcher legt einen leeren Stack
+ von <SfxShell>-Pointern an. Er ist initial nicht gelockt und gilt als
+ geflusht.
+*/
+
+{
+ if ( pViewFrame )
+ {
+ SfxViewFrame *pFrame = pViewFrame->GetParentViewFrame();
+ if ( pFrame )
+ Construct_Impl( pFrame->GetDispatcher() );
+ else
+ Construct_Impl( 0 );
+ }
+ else
+ Construct_Impl( 0 );
+ pImp->pFrame = pViewFrame;
+}
+
+//====================================================================
+SfxDispatcher::~SfxDispatcher()
+
+/* [Beschreibung]
+
+ Der Destruktor der Klasse SfxDispatcher darf nicht gerufen werden,
+ wenn die SfxDispatcher-Instanz aktiv ist. Es d"urfen sich allerdings
+ noch <SfxShell>-Pointer auf dem Stack befinden.
+*/
+
+{
+#ifdef DBG_UTIL
+ ByteString sTemp( "Delete Dispatcher " );
+ sTemp += ByteString::CreateFromInt32( (sal_uInt32)this );
+ DBG_TRACE( sTemp.GetBuffer() );
+ DBG_ASSERT( !pImp->bActive, "deleting active Dispatcher" );
+#endif
+
+ // Damit in LeaveRegistrations kein Timer per Reschedule in PlugComm
+ // zuschlaegt
+ pImp->aTimer.Stop();
+ pImp->xPoster->SetEventHdl( Link() );
+
+ // die Stack-Varialblem in Call_Impl benachrichtigen
+ if ( pImp->pInCallAliveFlag )
+ *pImp->pInCallAliveFlag = sal_False;
+
+ // Bindings und App besorgen
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxBindings* pBindings = GetBindings();
+
+// if (pImp->nEventId)
+// pSfxApp->RemoveEventHdl(pImp->nEventId);
+
+ // wenn noch nicht flushed, die Bindings wiederbeleben
+ if ( pBindings && !pSfxApp->IsDowning() && !bFlushed )
+ pBindings->DLEAVEREGISTRATIONS();
+
+ // ggf. bei den Bindings abmelden
+ while ( pBindings )
+ {
+ if ( pBindings->GetDispatcher_Impl() == this)
+ pBindings->SetDispatcher(0);
+ pBindings = pBindings->GetSubBindings_Impl();
+ }
+
+ delete pImp;
+}
+
+//====================================================================
+void SfxDispatcher::Pop
+(
+ SfxShell& rShell, /* Die vom Stack zu nehmende SfxShell-Instanz. */
+
+ sal_uInt16 nMode /* SFX_SHELL_POP_UNTIL
+ Es werden auch alle "uber 'rShell' liegenenden
+ SfxShell's vom Stack genommen.
+
+ SFX_SHELL_POP_DELETE
+ Alle tats"achlich vom Stack genommenen
+ SfxShells werden gel"oscht.
+
+ SFX_SHELL_PUSH (InPlace use only)
+ Die Shell wird gepusht. */
+)
+/* [Beschreibung]
+
+ Mit dieser Methode wird eine oder mehrere <SfxShell> vom SfxDispatcher
+ gepoppt. Die SfxShell wird zun"achst zum poppen vermerkt und
+ es wird ein Timer aufgesetzt. Erst bei Ablauf des Timers wird
+ tats"achlich gepoppt (<SfxDispatcher::Flush()>) und die <SfxBindings>
+ werden invalidiert. W"ahrend der Timer l"auft gleichen sich
+ entgegengesetzte Push und Pop Befehle mit derselben SfxShell aus.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( rShell.GetInterface(),
+ "pushing SfxShell without previous RegisterInterface()" );
+ DBG_ASSERT( pImp->nActionLevel == 0, "Push or Pop within Action" );
+// DBG_ASSERT( SFX_APP()->IsInAsynchronCall_Impl(),
+// "Dispatcher Push/Pop in synchron-call-stack" );
+
+ FASTBOOL bDelete = (nMode & SFX_SHELL_POP_DELETE) == SFX_SHELL_POP_DELETE;
+ FASTBOOL bUntil = (nMode & SFX_SHELL_POP_UNTIL) == SFX_SHELL_POP_UNTIL;
+ FASTBOOL bPush = (nMode & SFX_SHELL_PUSH) == SFX_SHELL_PUSH;
+
+ SfxApplication *pSfxApp = SFX_APP();
+
+#ifdef DBG_UTIL
+ ByteString aMsg( "SfxDispatcher(" );
+ aMsg += ByteString::CreateFromInt32( (long) this );
+ aMsg += bPush ? ")::Push(" : ")::Pop(";
+ if ( rShell.GetInterface() )
+ aMsg += rShell.GetInterface()->GetClassName();
+ else
+ aMsg += ByteString::CreateFromInt32( (long) &rShell );
+ aMsg += bDelete ? ") with delete" : ")";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+
+ // gleiche Shell wie on-Top des ToDo-Stacks?
+ if ( pImp->aToDoStack.Count() && pImp->aToDoStack.Top().pCluster == &rShell )
+ {
+ // inverse Actions heben sich auf
+ if ( pImp->aToDoStack.Top().bPush != bPush )
+ pImp->aToDoStack.Pop();
+ else
+ {
+ DBG_ASSERT( bPush, "SfxInterface pushed more than once" );
+ DBG_ASSERT( !bPush, "SfxInterface popped more than once" );
+ }
+ }
+ else
+ {
+ // ::com::sun::star::chaos::Action merken
+ pImp->aToDoStack.Push( SfxToDo_Impl(bPush, bDelete, bUntil, rShell) );
+ if ( bFlushed )
+ {
+ bFlushed = sal_False;
+ pImp->bUpdated = sal_False;
+
+ // Bindings schlafen legen
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->DENTERREGISTRATIONS();
+ }
+ }
+
+ if ( !pSfxApp->IsDowning() && pImp->aToDoStack.Count() )
+ {
+ //! if (SFX_APP()->AnyInput(INPUT_KEYBOARD | INPUT_MOUSE) )
+ //! AnyInput haut nicht hin; hier muss noch ein Kriterium gefunden
+ //! werden. Solange wieder immer mit Timer.
+
+ if (sal_True)
+ {
+ // Kein sofortiges Update gewuenscht
+ pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT);
+ pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) );
+ pImp->aTimer.Start();
+ }
+ else
+ {
+ // Schnellstmoegliches Update (sollte Normalfall sein)
+ pImp->aTimer.Stop();
+ GetpApp()->PostUserEvent(pImp->nEventId, (void*)0);
+ }
+ }
+ else
+ {
+ // doch nichts zu tun
+ pImp->aTimer.Stop();
+
+ // ggf. Bindings wieder aufwecken
+ if ( !pImp->aToDoStack.Count() )
+ {
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->DLEAVEREGISTRATIONS();
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxDispatcher, EventHdl_Impl, void *, pvoid )
+
+/* [Beschreibung]
+
+ Dieser Handler wird nach <SfxDispatcher::Invalidate()> oder Bewegungen
+ auf dem Stack (<SfxDispatcher::Push()> und <SfxDispatcher::Pop()) gerufen.
+
+ Er flusht den Stack, falls er dirty ist, f"uhrt also die ausstehenden
+ Push und Pop Befehle tats"achlich aus.
+*/
+
+{
+ DBG_MEMTEST();
+
+ Flush();
+ Update_Impl();
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->StartUpdate_Impl(sal_False);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxDispatcher, EventHdl_Impl, void *, pvoid )
+
+//--------------------------------------------------------------------
+sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell& rShell, sal_Bool bDeep )
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann gepr"uft werden, ob sich die <SfxShell> rShell
+ auf dem Stack befindet, wenn er geflusht w"are. Dabei wird der
+ SfxDispatcher jedoch nicht tats"achlich geflusht.
+
+ Diese Methode ist u.a. dazu gedacht, Assertions zu erm"oglichen, ohne
+ als Seiteneffekt den SfxDispathcer flushen zu m"ussen.
+*/
+
+{
+ DBG_MEMTEST();
+ SFX_STACK(SfxDispatcher::CheckVirtualStack);
+
+ SfxShellStack_Impl aStack( pImp->aStack );
+ for ( short nToDo = pImp->aToDoStack.Count()-1; nToDo >= 0; --nToDo )
+ {
+ SfxToDo_Impl aToDo( pImp->aToDoStack.Top(nToDo) );
+ if ( aToDo.bPush )
+ aStack.Push( (SfxShell*) aToDo.pCluster );
+ else
+ {
+ SfxShell* pPopped = 0;
+ do
+ {
+ DBG_ASSERT( aStack.Count(), "popping from empty stack" );
+ pPopped = aStack.Pop();
+ }
+ while ( aToDo.bUntil && pPopped != aToDo.pCluster );
+ DBG_ASSERT( pPopped == aToDo.pCluster, "popping unpushed SfxInterface" );
+ }
+ }
+
+ sal_Bool bReturn;
+ if ( bDeep )
+ bReturn = aStack.Contains(&rShell);
+ else
+ bReturn = aStack.Top() == &rShell;
+ return bReturn;
+}
+
+//--------------------------------------------------------------------
+sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell& rShell )
+
+/* [Beschreibung]
+
+ Ermittelt die Position einer SfxShell im Stack des Dispatchers.
+ Dazu wird dieser ggf. zuvor geflusht.
+
+
+ [Rckgabewert]
+
+ sal_uInt16 == USRT_MAX
+ Die SfxShell befindet sich nicht auf
+ diesem SfxDispatcher.
+
+ < USHRT_MAX
+ Position der SfxShell auf dem Dispatcher
+ von oben mit 0 beginnend gez"ahlt.
+*/
+
+{
+ DBG_MEMTEST();
+ SFX_STACK(SfxDispatcher::GetShellLevel);
+ Flush();
+
+ for ( sal_uInt16 n = 0; n < pImp->aStack.Count(); ++n )
+ if ( pImp->aStack.Top( n ) == &rShell )
+ return n;
+ if ( pImp->pParent )
+ {
+ sal_uInt16 nRet = pImp->pParent->GetShellLevel(rShell);
+ if ( nRet == USHRT_MAX )
+ return nRet;
+ return nRet + pImp->aStack.Count();
+ }
+
+ return USHRT_MAX;
+}
+
+//--------------------------------------------------------------------
+SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const
+
+/* [Beschreibung]
+
+ Liefert einen Pointer auf die <SfxShell>, welche sich an der Position
+ nIdx (von oben, letzt-gepushte liegt bei 0) auf dem Stack befindet.
+
+ Dabei wird der SfxDispatcher nicht geflusht.
+
+ Ist der Stack nicht tief genug, wird ein 0-Pointer zur"uckgegeben.
+*/
+
+{
+ DBG_MEMTEST();
+
+ sal_uInt16 nShellCount = pImp->aStack.Count();
+ if ( nIdx < nShellCount )
+ return pImp->aStack.Top(nIdx);
+ else if ( pImp->pParent )
+ return pImp->pParent->GetShell( nIdx - nShellCount );
+ return 0;
+}
+
+//--------------------------------------------------------------------
+SfxBindings* SfxDispatcher::GetBindings() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert einen Pointer auf die <SfxBindings> Instanz
+ zur"uck, an die der SfxDispatcher gerade gebunden ist. Ein SfxDispatcher
+ ist nur dann an SfxBindings gebunden, wenn er <UI-aktiv> ist. Ist
+ er nicht UI-aktiv, wird ein 0-Pointer zur"uckgegeben.
+
+ Der zur"uckgegebene Pointer ist nur im <unmittelbaren Kontext> des
+ Methodenaufrufs g"ultig.
+*/
+
+{
+ if ( pImp->pFrame )
+ return &pImp->pFrame->GetBindings();
+ else
+ return NULL;
+}
+
+//--------------------------------------------------------------------
+SfxViewFrame* SfxDispatcher::GetFrame() const
+
+/* [Beschreibung]
+
+ Liefert einen Pointer auf die <SfxViewFrame> Instanz, der dieser
+ SfxDispatcher geh"ort. Falls es sich um den Applikations-Dispatcher
+ handelt, wird ein 0-Pointer zur"uckgegeben.
+*/
+
+{
+ DBG_MEMTEST();
+ return pImp->pFrame;
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::DoActivate_Impl( sal_Bool bMDI )
+
+/* [Beschreibung]
+
+ Diese Methode steuert das Aktivieren eines Dispatchers.
+
+ Da der Applikations-Dispatcher immer aktiv ist, entweder als
+ Unterdispatcher des <SfxViewFrame>-Dispatchers oder selbst, wird
+ er nie als ganzes Aktiviert, sondern nur seine einzelnen <SfxShell>s
+ bei <SfxDispatcher::Push(SfxShell&)>.
+
+ Beim Aktivieren eines SfxDispatchers wird an allen auf seinem
+ Stack befindlichen SfxShells, beginnend mit der untersten, der Handler
+ <SfxShell::Activate(sal_Bool)> gerufen.
+*/
+
+{
+ DBG_MEMTEST();
+ SFX_STACK(SfxDispatcher::DoActivate);
+ if ( bMDI )
+ {
+ #ifdef DBG_UTIL
+ ByteString sTemp("Activate Dispatcher ");
+ sTemp += ByteString::CreateFromInt32( (sal_uInt32) this );
+ DBG_TRACE(sTemp.GetBuffer());
+ DBG_ASSERT( !pImp->bActive, "Activate-Fehler" );
+ #endif
+ pImp->bActive = sal_True;
+ pImp->bUpdated = sal_False;
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ {
+ pBindings->SetDispatcher(this);
+ pBindings->SetActiveFrame( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > () );
+ }
+ }
+ else
+ {
+ #ifdef DBG_UTIL
+ ByteString sTemp("Non-MDI-Activate Dispatcher");
+ sTemp += ByteString::CreateFromInt32( (sal_uInt32) this );
+ DBG_TRACE( sTemp.GetBuffer() );
+ #endif
+ }
+
+ if ( IsAppDispatcher() )
+ return;
+
+ for ( int i = int(pImp->aStack.Count()) - 1; i >= 0; --i )
+ pImp->aStack.Top( (sal_uInt16) i )->DoActivate(pImp->pFrame, bMDI);
+
+ if ( pImp->aToDoStack.Count() )
+ {
+ if (sal_True)
+ {
+ // Kein sofortiges Update gewuenscht
+ pImp->aTimer.SetTimeout(SFX_FLUSH_TIMEOUT);
+ pImp->aTimer.SetTimeoutHdl( LINK(this, SfxDispatcher, EventHdl_Impl ) );
+ pImp->aTimer.Start();
+ }
+ else
+ {
+ // Schnellstmoegliches Update (sollte Normalfall sein)
+ pImp->aTimer.Stop();
+ GetpApp()->PostUserEvent(pImp->nEventId, (void*)0);
+ }
+ }
+}
+
+void SfxDispatcher::DoParentActivate_Impl()
+{
+ for ( int i = int(pImp->aStack.Count()) - 1; i >= 0; --i )
+ pImp->aStack.Top( (sal_uInt16) i )->ParentActivate();
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::DoDeactivate_Impl( sal_Bool bMDI )
+
+/* [Beschreibung]
+
+ Diese Methode steuert das Deaktivieren eines Dispatchers.
+
+ Da der Applikations-Dispatcher immer aktiv ist, entweder als
+ Unterdispatcher des <SfxViewFrame>-Dispatchers oder selbst, wird
+ er nie als ganzes Deaktiviert, sondern nur seine einzelnen <SfxShell>s
+ bei <SfxDispatcher::Pop(SfxShell&)>.
+
+ Beim Deaktivieren eines SfxDispatchers wird an allen auf seinem
+ Stack befindlichen SfxShells, beginnend mit der obersten, der Handler
+ <SfxShell::Deactivate(sal_Bool)> gerufen.
+*/
+
+{
+ DBG_MEMTEST();
+ SFX_STACK(SfxDispatcher::DoDeactivate);
+
+ SfxApplication *pSfxApp = SFX_APP();
+
+ if ( bMDI )
+ {
+ DBG_TRACE(ByteString("Deactivate Dispatcher ").Append(ByteString::CreateFromInt32( (sal_uInt32) this )).GetBuffer());
+ DBG_ASSERT( pImp->bActive, "Deactivate-Fehler" );
+ pImp->bActive = sal_False;
+
+ if ( pImp->pFrame && !pImp->pFrame->IsA(TYPE(SfxInPlaceFrame)) )
+ {
+ SfxWorkWindow *pWorkWin = pSfxApp->GetWorkWindow_Impl(pImp->pFrame);
+ for (sal_uInt16 n=0; n<pImp->aChildWins.Count();)
+ {
+ SfxChildWindow *pWin =
+ pWorkWin->GetChildWindow_Impl(
+ (sal_uInt16) ( pImp->aChildWins[n] & 0xFFFF ) );
+ if (!pWin || pWin && pWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT)
+ pImp->aChildWins.Remove(n);
+ else
+ n++;
+ }
+ }
+ }
+ else
+ DBG_TRACE( ByteString ("Non-MDI-DeActivate Dispatcher").Append(ByteString::CreateFromInt32( (sal_uInt32) this )).GetBuffer() );
+
+ if ( IsAppDispatcher() && !pSfxApp->IsDowning() )
+ return;
+
+ for ( sal_uInt16 i = 0; i < pImp->aStack.Count(); ++i )
+ pImp->aStack.Top(i)->DoDeactivate(pImp->pFrame, bMDI);
+
+ Flush();
+}
+
+void SfxDispatcher::DoParentDeactivate_Impl()
+{
+ for ( int i = int(pImp->aStack.Count()) - 1; i >= 0; --i )
+ pImp->aStack.Top( (sal_uInt16) i )->ParentDeactivate();
+}
+
+//--------------------------------------------------------------------
+int SfxDispatcher::GetShellAndSlot_Impl
+(
+ sal_uInt16 nSlot, // die zu suchende Slot-Id
+ SfxShell** ppShell, // die SfxShell, welche nSlot z.Zt. bedient
+ const SfxSlot** ppSlot, // der SfxSlot, welcher nSlot z.Zt. bedient
+ sal_Bool bOwnShellsOnly,
+ sal_Bool bModal // trotz ModalMode
+)
+
+/* [Beschreibung]
+
+ Diese Methode sucht im SfxDispatcher nach der <SfxShell>, von der
+ die Slot-Id nSlot zur Zeit bedient wird. Dazu wird der Dispatcher
+ zuvor geflusht.
+
+
+ [R"uckgabewert]
+
+ int sal_True
+ Die SfxShell wurde gefunden, ppShell und ppSlot
+ sind g"ultig.
+
+ sal_True
+ Die SfxShell wurde nicht gefunden, ppShell und ppSlot
+ sind ung"ultig.
+*/
+
+{
+ SFX_STACK(SfxDispatcher::GetShellAndSlot_Impl);
+
+ Flush();
+ SfxSlotServer aSvr;
+ if ( _FindServer(nSlot, aSvr, bModal) )
+ {
+ if ( bOwnShellsOnly && aSvr.GetShellLevel() >= pImp->aStack.Count() )
+ return sal_False;
+
+ *ppShell = GetShell(aSvr.GetShellLevel());
+ *ppSlot = aSvr.GetSlot();
+ if ( 0 == (*ppSlot)->GetExecFnc() )
+ *ppSlot = (*ppShell)->GetInterface()->GetRealSlot(*ppSlot);
+
+#ifdef DBG_UTILx
+ ByteString aMsg( nSlot );
+ aMsg += " found in ";
+ aMsg += (*ppShell)->GetInterface()->GetClassName();
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+
+ return sal_True;
+ }
+
+#ifdef DBG_UTILx
+ ByteString aMsg( nSlot );
+ aMsg += " not found";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+
+ return sal_False;
+}
+
+/*
+struct Executer : public SfxHint
+{
+ SfxRequest *pRequest;
+ const SfxSlot* pSlot;
+ sal_uInt16 nLevel;
+
+ Executer( SfxRequest* pReq, const SfxSlot* p, sal_uInt16 n )
+ : pRequest( pReq )
+ , pSlot(p)
+ , nLevel(n)
+ {}
+ ~Executer()
+ {delete pRequest;}
+};
+*/
+
+//--------------------------------------------------------------------
+void SfxDispatcher::_Execute
+(
+ SfxShell& rShell, // zu rufende <SfxShell>
+ const SfxSlot& rSlot, // zu rufender <SfxSlot>
+ SfxRequest& rReq, // auszuf"uhrende Funktion (Id und optional Parameter)
+ SfxCallMode eCallMode // synchron, asynchron oder wie beim Slot angegeben
+)
+
+/* [Beschreibung]
+
+ Diese Methode f"uhrt einen Request "uber einen gecachten <Slot-Server>
+ aus.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( !pImp->bFlushing, "recursive call to dispatcher" );
+ DBG_ASSERT( !pImp->aToDoStack.Count(), "unprepared InPlace _Execute" );
+
+ if ( IsLocked( rSlot.GetSlotId() ) )
+ return;
+
+ sal_uInt16 nSlot = rSlot.GetSlotId();
+ if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
+ SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot );
+
+ if ( (eCallMode & SFX_CALLMODE_ASYNCHRON) ||
+ ( !(eCallMode & SFX_CALLMODE_SYNCHRON) &&
+ rSlot.IsMode(SFX_SLOT_ASYNCHRON) ) )
+ {
+ SfxDispatcher *pDispat = this;
+ while ( pDispat )
+ {
+ sal_uInt16 nShellCount = pDispat->pImp->aStack.Count();
+ for ( sal_uInt16 n=0; n<nShellCount; n++ )
+ {
+ if ( &rShell == pDispat->pImp->aStack.Top(n) )
+ {
+ pDispat->pImp->xPoster->Post(new SfxRequest(rReq));
+// pDispat->pImp->xPoster->Post(new Executer(new SfxRequest(rReq), &rSlot, n ));
+ return;
+ }
+ }
+
+ pDispat = pDispat->pImp->pParent;
+ }
+ }
+ else
+ Call_Impl( rShell, rSlot, rReq, SFX_CALLMODE_RECORD==(eCallMode&SFX_CALLMODE_RECORD) );
+}
+
+//--------------------------------------------------------------------
+void MappedPut_Impl( SfxAllItemSet &rSet, const SfxPoolItem &rItem )
+
+/* [Beschreibung]
+
+ Hilfsfunktion zum putten von rItem unter der im Pool des Item-Sets
+ rSet geltenden Which-Id.
+*/
+
+{
+ // mit ggf. gemappter Which-Id putten
+ const SfxItemPool *pPool = rSet.GetPool();
+ sal_uInt16 nWhich = rItem.Which();
+#ifdef TF_POOLABLE
+ if ( pPool->IsSlot(nWhich) )
+#else
+ if ( pPool->HasMap() && pPool->IsSlot(nWhich) )
+#endif
+ nWhich = pPool->GetWhich(nWhich);
+ rSet.Put( rItem, nWhich );
+}
+
+//--------------------------------------------------------------------
+
+#ifndef SFX_USE_BINDINGS
+#define SFX_USE_BINDINGS 0x8000
+#endif
+
+sal_uInt16 SfxDispatcher::ExecuteFunction( sal_uInt16 nSlot, SfxPoolItem **pArgs,
+ sal_uInt16 nMode )
+{
+ if ( !nMode )
+ nMode = pImp->nStandardMode;
+
+ // via Bindings/Interceptor? (dann ist der Returnwert nicht exakt)
+ sal_Bool bViaBindings = SFX_USE_BINDINGS == ( nMode & SFX_USE_BINDINGS );
+ nMode &= ~sal_uInt16(SFX_USE_BINDINGS);
+ if ( bViaBindings && GetBindings() )
+ return GetBindings()->Execute( nSlot, (const SfxPoolItem **) pArgs, nMode )
+ ? EXECUTE_POSSIBLE
+ : EXECUTE_NO;
+
+ // sonst via Dispatcher
+ if ( IsLocked(nSlot) )
+ return 0;
+ SfxShell *pShell = 0;
+ SfxCallMode eCall = SFX_CALLMODE_SYNCHRON;
+ sal_uInt16 nRet = EXECUTE_NO;
+ const SfxSlot *pSlot = 0;
+ if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False, sal_False ) )
+ {
+ // Ausf"uhrbarkeit vorher testen
+ if ( pSlot->IsMode( SFX_SLOT_FASTCALL ) ||
+ pShell->CanExecuteSlot_Impl( *pSlot ) )
+ nRet = EXECUTE_POSSIBLE;
+
+ if ( nMode == EXECUTEMODE_ASYNCHRON )
+ eCall = SFX_CALLMODE_ASYNCHRON;
+ else if ( nMode == EXECUTEMODE_DIALOGASYNCHRON && pSlot->IsMode( SFX_SLOT_HASDIALOG ) )
+ eCall = SFX_CALLMODE_ASYNCHRON;
+ else if ( pSlot->GetMode() & SFX_SLOT_ASYNCHRON )
+ eCall = SFX_CALLMODE_ASYNCHRON;
+ sal_Bool bDone = sal_False;
+ if ( pArgs && *pArgs )
+ {
+ SfxAllItemSet aSet( pShell->GetPool() );
+ for ( SfxPoolItem **pArg = pArgs; *pArg; ++pArg )
+ MappedPut_Impl( aSet, **pArg );
+ SfxRequest aReq( nSlot, eCall, aSet );
+ _Execute( *pShell, *pSlot, aReq, eCall );
+ bDone = aReq.IsDone();
+ }
+ else
+ {
+ SfxRequest aReq( nSlot, eCall, pShell->GetPool() );
+ _Execute( *pShell, *pSlot, aReq, eCall );
+ bDone = aReq.IsDone();
+ }
+ }
+
+ return nRet;
+}
+
+sal_uInt16 SfxDispatcher::GetSlotId( const String& rCommand )
+{
+ // Anzahl der Shells auf den verkettenten Dispatchern z"ahlen
+ Flush();
+ sal_uInt16 nTotCount = pImp->aStack.Count();
+ if ( pImp->pParent )
+ {
+ SfxDispatcher *pParent = pImp->pParent;
+ while ( pParent )
+ {
+ nTotCount += pParent->pImp->aStack.Count();
+ pParent = pParent->pImp->pParent;
+ }
+ }
+
+ const SfxSlot *pSlot=NULL;
+ sal_uInt16 nFirstShell = 0;
+ for ( sal_uInt16 i = nFirstShell; i < nTotCount; ++i )
+ {
+ SfxShell *pObjShell = GetShell(i);
+ SfxInterface *pIFace = pObjShell->GetInterface();
+ pSlot = pIFace->GetSlot( rCommand );
+ if ( pSlot )
+ return pSlot->GetSlotId();
+ }
+
+ return 0;
+}
+
+//--------------------------------------------------------------------
+int SfxExecuteItem::operator==( const SfxPoolItem& rItem ) const
+{
+ SfxExecuteItem& rArg = (SfxExecuteItem& )rItem;
+ sal_uInt16 nCount = Count();
+ if( nCount != rArg.Count() )
+ return sal_False;
+ while( nCount -- )
+ if( *GetObject( nCount ) != *rArg.GetObject( nCount ) )
+ return sal_False;
+ return eCall == rArg.eCall;
+}
+
+//--------------------------------------------------------------------
+SfxPoolItem* SfxExecuteItem::Clone( SfxItemPool* pPool ) const
+{
+ return new SfxExecuteItem( *this );
+}
+
+//--------------------------------------------------------------------
+SfxExecuteItem::SfxExecuteItem( const SfxExecuteItem& rArg )
+ : SfxPoolItem( rArg ), nModifier( 0 )
+{
+ eCall = rArg.eCall;
+ nSlot = rArg.nSlot;
+ sal_uInt16 nCount = rArg.Count();
+ for( sal_uInt16 nPos = 0; nPos < nCount; nPos++ )
+ Insert( rArg[ nPos ]->Clone(), nPos );
+}
+
+//--------------------------------------------------------------------
+SfxExecuteItem::SfxExecuteItem(
+ sal_uInt16 nWhich, sal_uInt16 nSlotP, SfxCallMode eModeP,
+ const SfxPoolItem* pArg1, ... ) :
+ SfxPoolItem( nWhich ), eCall( eModeP ), nSlot( nSlotP ), nModifier( 0 )
+{
+ va_list pVarArgs;
+ va_start( pVarArgs, pArg1 );
+ for ( const SfxPoolItem *pArg = pArg1; pArg;
+ pArg = va_arg( pVarArgs, const SfxPoolItem* ) )
+ Insert( pArg->Clone(), Count() );
+ va_end(pVarArgs);
+}
+
+//--------------------------------------------------------------------
+SfxExecuteItem::SfxExecuteItem(
+ sal_uInt16 nWhich, sal_uInt16 nSlotP, SfxCallMode eModeP )
+ : SfxPoolItem( nWhich ), nSlot( nSlotP ), eCall( eModeP ), nModifier( 0 )
+{
+}
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxDispatcher::Execute( const SfxExecuteItem& rItem )
+{
+ const SfxPoolItem** pPtr = new const SfxPoolItem*[ rItem.Count() + 1 ];
+ for( sal_uInt16 nPos = rItem.Count(); nPos--; )
+ pPtr[ nPos ] = rItem.GetObject( nPos );
+ pPtr[ rItem.Count() ] = 0;
+ const SfxPoolItem* pRet = Execute(
+ rItem.GetSlot(), rItem.GetCallMode(), pPtr, rItem.GetModifier() );
+
+ __DELETE(rItem.Count() + 1) (SfxPoolItem**)pPtr;
+
+ return pRet;
+}
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxDispatcher::Execute
+(
+ sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion
+ SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT
+ const SfxPoolItem **pArgs, // 0-terminiertes C-Array von Parametern
+ sal_uInt16 nModi,
+ const SfxPoolItem **pInternalArgs // 0-terminiertes C-Array von Parametern
+)
+
+/* [Beschreibung]
+
+ Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id.
+
+
+ [R"uckgabewert]
+
+ const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf
+ der Message-Loop g"ultiges SfxPoolItem,
+ welches den R"uckgabewert enth"alt.
+
+ Oder ein 0-Pointer, wenn die Funktion nicht
+ ausgef"uhrt wurde (z.B. Abbruch durch den
+ Benutzer).
+*/
+
+{
+ if ( IsLocked(nSlot) )
+ return 0;
+
+ SfxShell *pShell = 0;
+ const SfxSlot *pSlot = 0;
+ if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False,
+ SFX_CALLMODE_MODAL==(eCall&SFX_CALLMODE_MODAL) ) )
+ {
+ SfxRequest* pReq;
+ if ( pArgs && *pArgs )
+ {
+ SfxAllItemSet aSet( pShell->GetPool() );
+ for ( const SfxPoolItem **pArg = pArgs; *pArg; ++pArg )
+ MappedPut_Impl( aSet, **pArg );
+ pReq = new SfxRequest( nSlot, eCall, aSet );
+ }
+ else
+ pReq = new SfxRequest( nSlot, eCall, pShell->GetPool() );
+ pReq->SetModifier( nModi );
+ if( pInternalArgs && *pInternalArgs)
+ {
+ SfxAllItemSet aSet( SFX_APP()->GetPool() );
+ for ( const SfxPoolItem **pArg = pInternalArgs; *pArg; ++pArg )
+ aSet.Put( **pArg );
+ pReq->SetInternalArgs_Impl( aSet );
+ }
+ _Execute( *pShell, *pSlot, *pReq, eCall );
+ const SfxPoolItem* pRet = pReq->GetReturnValue();
+ delete pReq; return pRet;
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxDispatcher::Execute
+(
+ sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion
+ SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT
+ const SfxItemSet &rArgs // <SfxItemSet> mit Parametern
+)
+
+/* [Beschreibung]
+
+ Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id.
+
+
+ [R"uckgabewert]
+
+ const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf
+ der Message-Loop g"ultiges SfxPoolItem,
+ welches den R"uckgabewert enth"alt.
+
+ Oder ein 0-Pointer, wenn die Funktion nicht
+ ausgef"uhrt wurde (z.B. Abbruch durch den
+ Benutzer).
+*/
+
+{
+ if ( IsLocked(nSlot) )
+ return 0;
+
+ SfxShell *pShell = 0;
+ const SfxSlot *pSlot = 0;
+ if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False,
+ SFX_CALLMODE_MODAL==(eCall&SFX_CALLMODE_MODAL) ) )
+ {
+ SfxAllItemSet aSet( pShell->GetPool() );
+ SfxItemIter aIter(rArgs);
+ for ( const SfxPoolItem *pArg = aIter.FirstItem();
+ pArg;
+ pArg = aIter.NextItem() )
+ MappedPut_Impl( aSet, *pArg );
+ SfxRequest aReq( nSlot, eCall, aSet );
+ _Execute( *pShell, *pSlot, aReq, eCall );
+ return aReq.GetReturnValue();
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxDispatcher::_Execute
+(
+ sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion
+ SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT
+ va_list pVarArgs, // Parameterliste ab 2. Parameter
+ const SfxPoolItem* pArg1 // erster Parameter
+)
+
+/* [Beschreibung]
+
+ Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id.
+
+
+ [R"uckgabewert]
+
+ const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf
+ der Message-Loop g"ultiges SfxPoolItem,
+ welches den R"uckgabewert enth"alt.
+
+ Oder ein 0-Pointer, wenn die Funktion nicht
+ ausgef"uhrt wurde (z.B. Abbruch durch den
+ Benutzer).
+*/
+
+{
+ if ( IsLocked(nSlot) )
+ return 0;
+
+ SfxShell *pShell = 0;
+ const SfxSlot *pSlot = 0;
+ if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False,
+ SFX_CALLMODE_MODAL==(eCall&SFX_CALLMODE_MODAL) ) )
+ {
+ SfxAllItemSet aSet( pShell->GetPool() );
+
+ for ( const SfxPoolItem *pArg = pArg1;
+ pArg;
+ pArg = va_arg( pVarArgs, const SfxPoolItem* ) )
+ MappedPut_Impl( aSet, *pArg );
+
+ SfxRequest aReq( nSlot, eCall, aSet );
+ _Execute( *pShell, *pSlot, aReq, eCall );
+ return aReq.GetReturnValue();
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxDispatcher::Execute
+(
+ sal_uInt16 nSlot, // die Id der auszufuehrenden Funktion
+ SfxCallMode eCall, // SFX_CALLMODE_SYNCRHON, ..._ASYNCHRON oder ..._SLOT
+ const SfxPoolItem* pArg1, // erster Parameter
+ ... // 0-terminiertes Liste Parametern
+)
+
+/* [Beschreibung]
+
+ Methode zum Ausf"uhren eines <SfxSlot>s "uber die Slot-Id.
+
+
+ [Anmerkung]
+
+ Die Parameter werden kopiert, k"onnen daher als Adresse von
+ Stack-Objekten "ubergeben werden.
+
+
+ [R"uckgabewert]
+
+ const SfxPoolItem* Pointer auf ein bis zum n"achsten Durchlauf
+ der Message-Loop g"ultiges SfxPoolItem,
+ welches den R"uckgabewert enth"alt.
+
+ Oder ein 0-Pointer, wenn die Funktion nicht
+ ausgef"uhrt wurde (z.B. Abbruch durch den
+ Benutzer).
+
+
+ [Beispiel]
+
+ pDispatcher->Execute( SID_OPENDOCUMENT, SFX_CALLMODE_SYNCHRON,
+ &SfxStringItem( SID_FILE_NAME, "\\tmp\\temp.sdd" ),
+ &SfxStringItem( SID_FILTER_NAME, "StarDraw Presentation" ),
+ &SfxBoolItem( SID_DOC_READONLY, sal_False ),
+ 0L );
+*/
+
+{
+ if ( IsLocked(nSlot) )
+ return 0;
+
+ SfxShell *pShell = 0;
+ const SfxSlot *pSlot = 0;
+ if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False,
+ SFX_CALLMODE_MODAL==(eCall&SFX_CALLMODE_MODAL) ) )
+ {
+ SfxAllItemSet aSet( pShell->GetPool() );
+
+ va_list pVarArgs;
+ va_start( pVarArgs, pArg1 );
+ for ( const SfxPoolItem *pArg = pArg1;
+ pArg;
+ pArg = va_arg( pVarArgs, const SfxPoolItem* ) )
+ MappedPut_Impl( aSet, *pArg );
+ va_end(pVarArgs);
+
+ SfxRequest aReq( nSlot, eCall, aSet );
+ _Execute( *pShell, *pSlot, aReq, eCall );
+ return aReq.GetReturnValue();
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+IMPL_LINK( SfxDispatcher, PostMsgHandler, SfxRequest*, pReq )
+
+/* [Beschreibung]
+
+ Hilfsmethode zum Empfangen der asynchron auszuf"uhrenden <SfxRequest>s.
+*/
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( !pImp->bFlushing, "recursive call to dispatcher" );
+ SFX_STACK(SfxDispatcher::PostMsgHandler);
+
+ // ist auch der Pool noch nicht gestorben?
+// SfxRequest* pReq = pExec->pRequest;
+ if ( !pReq->IsCancelled() )
+ {
+ if ( !IsLocked(pReq->GetSlot()) )
+ {
+ Flush();
+ SfxSlotServer aSvr;
+ if ( _FindServer(pReq->GetSlot(), aSvr, HACK(x) sal_True ) )
+// SfxShell *pShell = GetShell(pExec->nLevel);
+// if ( pShell && pShell->GetInterface()->GetSlot( pExec->pSlot->GetSlotId() ) )
+ {
+ const SfxSlot *pSlot = aSvr.GetSlot();
+ SfxShell *pSh = GetShell(aSvr.GetShellLevel());
+
+ DBG( SfxApplication *pSfxApp = SFX_APP() );
+ DBG( pSfxApp->EnterAsynchronCall_Impl() );
+
+ // Wenn pSlot ein "Pseudoslot" f"ur Macros oder Verben ist, kann
+ // er im Call_Impl zerst"ort werden, also nicht mehr benutzen!
+ pReq->SetSynchronCall( sal_False );
+ Call_Impl( *pSh, *pSlot, *pReq, sal_True ); //! woher bRecord?
+// Call_Impl( *pShell, *pExec->pSlot, *pReq, sal_True ); //! woher bRecord?
+ DBG( pSfxApp->LeaveAsynchronCall_Impl() );
+ }
+
+// delete pExec;
+ }
+ else
+ {
+// pImp->xPoster->Post(pExec);
+ pImp->xPoster->Post(new SfxRequest(*pReq));
+ }
+ }
+// else
+// delete pExec;
+
+ delete pReq;
+ return 0;
+}
+//--------------------------------------------------------------------
+void SfxDispatcher::EnterAction( const String& rName )
+
+// marks the beginning of a block of actions
+
+{
+ DBG_MEMTEST();
+ Flush();
+ DBG_ASSERT( pImp->aStack.Count() > 0, "EnterAction on empty dispatcher stack" );
+ if ( ++pImp->nActionLevel == 1 )
+ {
+ SfxUndoManager *pUndoMgr = GetShell(0)->GetUndoManager();
+ if ( pUndoMgr )
+ pUndoMgr->EnterListAction( rName, rName HACK(RepeatComment), 0 HACK(ID) );
+ }
+}
+//--------------------------------------------------------------------
+void SfxDispatcher::LeaveAction()
+
+// marks the end of a block of actions
+
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pImp->nActionLevel > 0, "EnterAction without LeaveAction" );
+ if ( --pImp->nActionLevel == 0 )
+ {
+ SfxUndoManager *pUndoMgr = GetShell(0)->GetUndoManager();
+ if ( pUndoMgr )
+ pUndoMgr->LeaveListAction();
+ }
+}
+//--------------------------------------------------------------------
+void SfxDispatcher::SetMenu_Impl()
+{
+ SfxApplication *pSfxApp = SFX_APP();
+ if ( pImp->pFrame )
+ {
+ if ( !pImp->pFrame->GetViewShell() )
+ return;
+
+ SfxTopViewFrame* pTop= PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() );
+ if ( pTop && pTop->GetBindings().GetDispatcher() == this )
+ {
+ SfxTopFrame* pFrm = pTop->GetTopFrame_Impl();
+ SfxMenuBarManager* pMenuBar = pImp->pFrame->GetViewShell()->GetMenuBar_Impl();
+ if ( pMenuBar )
+ {
+ MenuBar* pMenu = (MenuBar*) pMenuBar->GetMenu()->GetSVMenu();
+ pFrm->LockResize_Impl( TRUE );
+ pFrm->SetMenuBar_Impl( pMenu );
+ pFrm->LockResize_Impl( FALSE );
+ }
+ else if ( pImp->pParent )
+ {
+ pImp->pParent->SetMenu_Impl();
+ }
+ }
+ }
+}
+
+long SfxDispatcher::Update_Impl( sal_Bool bForce )
+
+/* [Beschreibung]
+
+ Hilfsmethode zum Updaten der <Object-Bars> und <Object-Menus>,
+ nach Bewegungen auf dem Stack.
+*/
+
+{
+ SFX_STACK(SfxDispatcher::Update_Impl);
+
+ Flush();
+
+ if ( !pImp->pFrame )
+ return 0;
+
+ if ( pImp->bUILocked )
+ return 0;
+
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxDispatcher *pDisp = this;
+ sal_Bool bUpdate = bForce;
+ while ( pDisp && pDisp->pImp->pFrame )
+ {
+ SfxWorkWindow *pWork = pSfxApp->GetWorkWindow_Impl( pDisp->pImp->pFrame );
+ SfxDispatcher *pAct = pWork->GetBindings().GetDispatcher_Impl();
+ if ( pAct == pDisp || pAct == this )
+ {
+ if ( !bUpdate )
+ bUpdate = !pDisp->pImp->bUpdated;
+ pDisp->pImp->bUpdated = sal_True;
+ }
+ else
+ break;
+
+ pDisp = pDisp->pImp->pParent;
+ }
+
+ if ( !bUpdate )
+ return 0;
+
+ SfxTopViewFrame* pTop = pImp->pFrame ? PTR_CAST( SfxTopViewFrame, pImp->pFrame->GetTopViewFrame() ) : NULL;
+ sal_Bool bUIActive = pTop && pTop->GetBindings().GetDispatcher() == this;
+ SfxMenuBarManager* pAppMenu = NULL;
+
+ if ( !bUIActive && pTop && GetBindings() == &pTop->GetBindings() )
+ // Eigene Tools nur intern festhalten und da"fur sorgen, da\s der
+ // aktive Dispatcher sie abholt
+ GetBindings()->GetDispatcher()->pImp->bUpdated = sal_False;
+
+ // Bindings schlafen legen
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->DENTERREGISTRATIONS();
+
+ // Test auf InPlaceFrame und speziell internes InPlace
+ SfxInPlaceFrame *pIPFrame = PTR_CAST ( SfxInPlaceFrame, pImp->pFrame);
+ sal_Bool bIsIPOwner = (pIPFrame && pIPFrame->GetObjectShell()->GetInPlaceObject()->GetIPClient()->Owner());
+ SvInPlaceClient *pClient = pImp->pFrame ? pImp->pFrame->GetViewShell()->GetIPClient() : NULL;
+ if ( bUIActive && !pIPFrame && ( !pClient || !pClient->GetProtocol().IsUIActive() ) )
+ {
+ SetMenu_Impl();
+ pAppMenu = pImp->pFrame->GetViewShell()->GetMenuBar_Impl();
+ pAppMenu->ResetObjectMenus();
+ }
+
+ // Environment
+ SfxWorkWindow *pWorkWin = pSfxApp->GetWorkWindow_Impl(pImp->pFrame);
+
+ // der SfxInternalFrame oder SfxTopViewFrame, zu dem ich geh"ore
+ SfxViewFrame *pAct =
+ bIsIPOwner ?
+ pImp->pFrame->GetParentViewFrame_Impl() :
+ pImp->pFrame;
+
+ // Ich kontrolliere die StatusBar einer Task auch wenn ich nicht aktiv bin, aber
+ // zu einem internem InPlaceFrame oder einem anderen ViewFrame innerhalb der Task geh"ore
+ SfxFrame *pTask = pAct ? pAct->GetFrame()->GetTopFrame() : NULL;
+
+ SfxWorkWindow *pTaskWin = NULL;
+ sal_Bool bSet = sal_True;
+ if ( pImp->pFrame && pImp->pFrame->GetViewShell() )
+ {
+ SvInPlaceClient *pClient = pImp->pFrame->GetViewShell()->GetIPClient();
+ if ( pClient && pClient->GetProtocol().IsUIActive() )
+ bSet = sal_False;
+ }
+
+ if ( pTask && bSet )
+ {
+ pTaskWin = pTask->GetWorkWindow_Impl();
+ pTaskWin->ResetStatusBar_Impl();
+ }
+
+ SfxDispatcher *pDispat = this;
+ while ( pDispat )
+ {
+ SfxWorkWindow *pWork = pSfxApp->GetWorkWindow_Impl(pDispat->pImp->pFrame);
+ SfxDispatcher *pAct = pWork->GetBindings().GetDispatcher_Impl();
+ if ( pAct == pDispat || pAct == this )
+ {
+ pWork->ResetObjectBars_Impl();
+ pWork->ResetChildWindows_Impl();
+ }
+
+ pDispat = pDispat->pImp->pParent;
+ }
+
+ sal_Bool bIsActive = sal_False;
+ SfxDispatcher *pActDispat = pWorkWin->GetBindings().GetDispatcher_Impl();
+ pDispat = this;
+ while ( pActDispat && !bIsActive )
+ {
+ if ( pDispat == pActDispat )
+ bIsActive = sal_True;
+ pActDispat = pActDispat->pImp->pParent;
+ }
+
+ if ( !pIPFrame && !IsAppDispatcher() && bIsActive )
+ CollectTools_Impl( pWorkWin );
+
+ // Jetzt rekursiv die Dispatcher abklappern
+ sal_uInt32 nHelpId = _Update_Impl( bUIActive, !pIPFrame, bIsIPOwner, pAppMenu, bSet ? pTaskWin : NULL );
+ if ( bUIActive || bIsActive )
+ {
+ pWorkWin->UpdateObjectBars_Impl();
+
+ if ( pAppMenu )
+ pAppMenu->UpdateObjectMenus();
+
+ if ( bUIActive )
+ {
+ // ggf. Hilfe-PI antriggern
+ SfxHelpPI* pHelpPI = pSfxApp->GetHelpPI();
+ if (pHelpPI && nHelpId)
+ pHelpPI->LoadTopic( nHelpId );
+ }
+ }
+
+ if ( pTaskWin )
+ pTaskWin->UpdateStatusBar_Impl();
+
+ if ( pBindings )
+ pBindings->DLEAVEREGISTRATIONS();
+ return 1;
+}
+
+
+void SfxDispatcher::CollectTools_Impl( SfxWorkWindow* pWorkWin )
+{
+ // Innerhalb eines ToolSpace werden auch die Tools von nicht aktiven Frames
+ // angezeigt, damit es beim Wechsel der Frames nicht zappelt
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxToolBoxConfig *pTbxCfg = SfxToolBoxConfig::GetOrCreate();
+
+ // Die Objectbars aller ViewFrames der aktuellen Task einsammeln
+ for ( SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
+ pViewFrame;
+ pViewFrame = SfxViewFrame::GetNext(*pViewFrame) )
+ {
+ // Frames mit anderem WorkWindow interessieren hier nicht
+ if ( pViewFrame->GetFrame()->GetWorkWindow_Impl() != pWorkWin )
+ continue;
+
+ // Nur weitermachen, wenn es nicht sowieso einer meiner parents ist
+ SfxDispatcher *pDispat = pViewFrame->GetDispatcher();
+ SfxDispatcher *pParent = this;
+ while ( pParent )
+ {
+ if ( pParent == pDispat )
+ break;
+ pParent = pParent->pImp->pParent;
+ }
+
+ if ( pParent )
+ continue;
+
+ // Alle objectbars des ViewFrames vormerken
+ sal_uInt16 n;
+ for (n=0; n<SFX_OBJECTBAR_MAX; n++)
+ {
+ SfxObjectBars_Impl& rBar = pDispat->pImp->aObjBars[n];
+ sal_uInt16 nId = rBar.aResId.GetId();
+ if ( nId && pTbxCfg->GetAlignment(n) != SFX_ALIGN_NOALIGNMENT )
+ pWorkWin->SetObjectBar_Impl( rBar.nMode,
+ rBar.aResId, rBar.pIFace, &rBar.aName );
+ }
+
+ SfxShell *pShell = pDispat->GetShell(0);
+ SfxModule *pMod = pShell->GetInterface()->GetModule();
+ SfxSlotPool& rSlotPool = pMod ? *pMod->GetSlotPool() : pShell->GetSlotPool_Impl();
+
+ // ChildWindows auch "bunkern"
+ for (n=0; n<pDispat->pImp->aChildWins.Count(); n++)
+ {
+ sal_uInt32 nId = pDispat->pImp->aChildWins[n];
+ const SfxSlot *pSlot = rSlotPool.GetSlot( (sal_uInt16) nId );
+ sal_uInt16 nMode = SFX_VISIBILITY_STANDARD;
+ if( pSlot )
+ {
+ if ( pSlot->IsMode(SFX_SLOT_CONTAINER) )
+ {
+ if ( !pWorkWin->IsVisible_Impl( SFX_VISIBILITY_CLIENT ) )
+ continue;
+ nMode |= SFX_VISIBILITY_CLIENT;
+ }
+ else
+ {
+ if ( !pWorkWin->IsVisible_Impl( SFX_VISIBILITY_SERVER ) )
+ continue;
+ nMode |= SFX_VISIBILITY_SERVER;
+ }
+ }
+
+ pWorkWin->SetChildWindowVisible_Impl( nId, sal_False, nMode );
+ }
+ }
+}
+
+
+sal_uInt32 SfxDispatcher::_Update_Impl( sal_Bool bUIActive, sal_Bool bIsMDIApp,
+ sal_Bool bIsIPOwner, SfxMenuBarManager *pAppMenu, SfxWorkWindow *pTaskWin )
+{
+ sal_uInt32 nHelpId = 0L;
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxWorkWindow *pWorkWin = pSfxApp->GetWorkWindow_Impl( pImp->pFrame );
+ sal_Bool bIsActive = sal_False;
+ sal_Bool bIsTaskActive = sal_False;
+ SfxDispatcher *pActDispat = pWorkWin->GetBindings().GetDispatcher_Impl();
+ SfxDispatcher *pDispat = this;
+ while ( pActDispat && !bIsActive )
+ {
+ if ( pDispat == pActDispat )
+ bIsActive = sal_True;
+ pActDispat = pActDispat->pImp->pParent;
+ }
+
+ if ( pImp->pParent && !pImp->bQuiet /* && bUIActive */ )
+ // Das Men"u kommt immer vom obersten Dispatcher, also pAppMenu nicht weiterreichen
+ nHelpId = pImp->pParent->_Update_Impl( bUIActive, bIsMDIApp, bIsIPOwner, NULL, pTaskWin );
+
+ // Internen Zwischenspeicher ObjectBars und ChildWindows zur"ucksetzen
+ for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
+ pImp->aObjBars[n].aResId = ResId( 0,0 );
+ pImp->aChildWins.Remove(0, pImp->aChildWins.Count());
+
+ // bQuiet : eigene Shells weder f"ur UI noch f"ur SlotServer ber"ucksichtigen
+ // bNoUI: eigene Shells f"ur das UI nicht ber"ucksichtigen
+ if ( pImp->bQuiet || pImp->bNoUI || pImp->pFrame && pImp->pFrame->GetObjectShell()->IsPreview() )
+ return nHelpId;
+
+ sal_uInt16 nStatBarId=0;
+ SfxShell *pStatusBarShell = NULL;
+
+ sal_uInt16 nTotCount = pImp->aStack.Count();
+ for ( sal_uInt16 nShell = nTotCount; nShell > 0; --nShell )
+ {
+ SfxShell *pShell = GetShell( nShell-1 );
+ SfxInterface *pIFace = pShell->GetInterface();
+ if (pShell->GetHelpId())
+ nHelpId = pShell->GetHelpId();
+
+ // Shells von Dispatcher mit Attribut "Hidden" oder "Quiet" auslassen
+ sal_Bool bReadOnlyShell = IsReadOnlyShell_Impl( nShell-1 );
+ SfxSlotPool& rSlotPool = pIFace->GetModule() ?
+ *pIFace->GetModule()->GetSlotPool() : pShell->GetSlotPool_Impl();
+
+ sal_uInt16 nNo;
+ for ( nNo = 0; pIFace && nNo<pIFace->GetObjectBarCount(); ++nNo )
+ {
+ sal_uInt16 nPos = pIFace->GetObjectBarPos(nNo);
+ if ( bReadOnlyShell && !( nPos & SFX_VISIBILITY_READONLYDOC ) )
+ continue;
+
+ // Soll die ObjectBar nur angezeigt werden, wenn die Shell
+ // einen bestimmten UI-Modus hat?
+ sal_uInt32 nFeature = pIFace->GetObjectBarFeature(nNo);
+ if ( nFeature && !pShell->HasUIFeature( nFeature ) )
+ continue;
+
+ // Auf jeden Fall eintragen, auch wenn unsichtbar. Dann kann
+ // WorkWindow anbieten, wieder anzuschalten
+ sal_Bool bVisible = pIFace->IsObjectBarVisible(nNo);
+ if ( !bVisible )
+ nPos &= SFX_POSITION_MASK;
+
+ SfxObjectBars_Impl& rBar = pImp->aObjBars[nPos & SFX_POSITION_MASK];
+ rBar.nMode = nPos;
+ rBar.aResId = pIFace->GetObjectBarResId(nNo);
+ const String *pName = pIFace->GetObjectBarName(nNo);
+ if ( pName )
+ rBar.aName = *pName;
+ else
+ rBar.aName.Erase();
+ rBar.pIFace = pIFace;
+
+ if ( bUIActive || bIsActive )
+ {
+ pWorkWin->SetObjectBar_Impl(
+ nPos, rBar.aResId, rBar.pIFace, &rBar.aName );
+ }
+
+ if ( !bVisible )
+ rBar.aResId = ResId( 0,0 );
+ }
+
+ for ( nNo=0; pIFace && nNo<pIFace->GetChildWindowCount(); nNo++ )
+ {
+ sal_uInt32 nId = pIFace->GetChildWindowId(nNo);
+ const SfxSlot *pSlot = rSlotPool.GetSlot( (sal_uInt16) nId );
+ DBG_ASSERT( pSlot, "Da fehlt ein Childwindow-Slot!");
+ if ( bReadOnlyShell )
+ {
+ // Bei read only documents nur solche ChildWindows anzeigen,
+ // die daf"ur freigegeben sind
+ if ( pSlot && !pSlot->IsMode( SFX_SLOT_READONLYDOC ) )
+ continue;
+ }
+
+ sal_uInt32 nFeature = pIFace->GetChildWindowFeature(nNo);
+ if ( nFeature && !pShell->HasUIFeature( nFeature ) )
+ continue;
+
+ // Bei den anderen auf CONTAINER/SERVER-Slots abfragen
+ sal_uInt16 nMode = SFX_VISIBILITY_STANDARD;
+ if( pSlot )
+ {
+ if ( pSlot->IsMode(SFX_SLOT_CONTAINER) )
+ {
+ if ( !pWorkWin->IsVisible_Impl( SFX_VISIBILITY_CLIENT ) )
+ continue;
+ nMode |= SFX_VISIBILITY_CLIENT;
+ }
+ else
+ {
+ if ( !pWorkWin->IsVisible_Impl( SFX_VISIBILITY_SERVER ) )
+ continue;
+ nMode |= SFX_VISIBILITY_SERVER;
+ }
+ }
+
+ if ( bUIActive || bIsActive )
+ pWorkWin->SetChildWindowVisible_Impl( nId, sal_True, nMode );
+ if ( bUIActive || bIsActive || !pWorkWin->IsFloating( (sal_uInt16) ( nId & 0xFFFF ) ) )
+ pImp->aChildWins.Insert( nId, pImp->aChildWins.Count());
+ }
+
+ if ( pAppMenu )
+ {
+ // update Object-Menus
+ for ( nNo = 0; pIFace && nNo<pIFace->GetObjectMenuCount(); ++nNo )
+ pAppMenu->SetObjectMenu( pIFace->GetObjectMenuPos(nNo),
+ pIFace->GetObjectMenuResId(nNo));
+ }
+
+ if ( bIsMDIApp || bIsIPOwner )
+ {
+ // Bei MDIEnvironment oder internem InPlace Statuszeile setzen
+ sal_uInt16 nId = pIFace->GetStatusBarResId().GetId();
+ if ( nId )
+ {
+ nStatBarId = nId;
+ pStatusBarShell = pShell;
+ }
+ }
+ }
+
+ for ( sal_uInt16 nPos=0; nPos<SFX_OBJECTBAR_MAX; nPos++ )
+ {
+ SfxObjectBars_Impl& rFixed = pImp->aFixedObjBars[nPos];
+ if ( rFixed.aResId.GetId() )
+ {
+ SfxObjectBars_Impl& rBar = pImp->aObjBars[nPos];
+ rBar = rFixed;
+ pWorkWin->SetObjectBar_Impl( rFixed.nMode,
+ rFixed.aResId, rFixed.pIFace, &rFixed.aName );
+ }
+ }
+
+ if ( pTaskWin && ( bIsMDIApp || bIsIPOwner ) )
+ {
+ SfxDispatcher *pActDispat = pTaskWin->GetBindings().GetDispatcher_Impl();
+ SfxDispatcher *pDispat = this;
+ if ( bIsIPOwner && pImp->pFrame )
+ pDispat = pImp->pFrame->GetParentViewFrame_Impl()->GetDispatcher();
+
+ while ( pActDispat && !bIsTaskActive )
+ {
+ if ( pDispat == pActDispat )
+ bIsTaskActive = sal_True;
+ pActDispat = pActDispat->pImp->pParent;
+ }
+
+ if ( bIsTaskActive && nStatBarId && pImp->pFrame )
+ {
+ // Ich kontrolliere die StatusBar einer Task auch wenn ich nicht aktiv bin, aber
+ // zu einem internem InPlaceFrame oder einem anderen ViewFrame innerhalb der Task geh"ore
+ SfxBindings& rBindings = pImp->pFrame->GetBindings();
+ pTaskWin->SetStatusBar_Impl( nStatBarId, pStatusBarShell, rBindings );
+ }
+ }
+
+ return nHelpId;
+}
+
+//--------------------------------------------------------------------
+long SfxDispatcher::UpdateObjectMenus_Impl( SfxMenuBarManager *pMenuMgr )
+
+/* [Beschreibung]
+
+ Hilfsmethode zum Updaten der <Object-Menus>.
+*/
+
+{
+ SFX_STACK(SfxDispatcher::UpdateObjecteMenus_Impl);
+
+ Flush();
+
+ if (!pImp->pFrame && !IsAppDispatcher())
+ {
+ DBG_ERROR( "Dispatcher ohne Frame aber mit Parent?!?" );
+ return 0;
+ }
+
+ // Bindings und App besorgen
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->DENTERREGISTRATIONS();
+ pMenuMgr->ResetObjectMenus();
+
+ sal_uInt16 nTotCount = pImp->aStack.Count();
+ sal_uInt16 nMinCount = pImp->bQuiet || pImp->bNoUI ? nTotCount : 0;
+
+ if ( pImp->pParent ) // && !(pImp->pFrame->GetFrameType() & SFXFRAME_PLUGIN ) )
+ {
+ // Parents nur bei PlugIns nicht ber"ucksichtigen
+ // (AppDispatcher oder parent frame)
+ SfxDispatcher *pParent = pImp->pParent;
+ while ( pParent )
+ {
+ nTotCount += pParent->pImp->aStack.Count();
+ if ( pParent->pImp->bQuiet || pParent->pImp->bNoUI )
+ nMinCount = nTotCount;
+ pParent = pParent->pImp->pParent;
+ }
+ }
+
+ for ( sal_uInt16 nShell = nTotCount; nShell > nMinCount; --nShell )
+ {
+ SfxShell *pShell = GetShell( nShell-1 );
+ const SfxInterface *pIFace = pShell->GetInterface();
+
+ // update Object-Menus
+ for ( sal_uInt16 nNo = 0; pIFace && nNo<pIFace->GetObjectMenuCount(); ++nNo )
+ pMenuMgr->SetObjectMenu( pIFace->GetObjectMenuPos(nNo),
+ pIFace->GetObjectMenuResId(nNo));
+ }
+
+ pMenuMgr->UpdateObjectMenus();
+ if ( pBindings )
+ pBindings->DLEAVEREGISTRATIONS();
+ return 0;
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::FlushImpl()
+
+/* [Beschreibung]
+
+ Hilfsmethode zum Ausf"uhren der ausstehenden Push- und Pop-Befehle.
+*/
+
+{
+ DBG_PROFSTART(SfxDispatcherFlush);
+ DBG_MEMTEST();
+ SFX_STACK(SfxDispatcher::FlushImpl);
+
+
+#ifdef DBG_UTIL
+ ByteString aMsg( "SfxDispatcher(" );
+ aMsg += ByteString::CreateFromInt32( (long) this );
+ aMsg += ")::Flush()";
+#endif
+
+ pImp->aTimer.Stop();
+
+ if ( pImp->pParent )
+ pImp->pParent->Flush();
+
+// if ( pImp->bQuiet )
+// return;
+
+ pImp->bFlushing = !pImp->bFlushing;
+ if ( !pImp->bFlushing )
+ {
+ pImp->bFlushing = sal_True;
+ DBG_PROFSTOP(SfxDispatcherFlush);
+//!
+#ifdef DBG_UTIL_MESSEHACK_AUSKOMMENT
+ DBG_ERROR( "reentering SfxDispatcher::Flush()" );
+ aMsg += " reentering, aborted";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+ return;
+ }
+
+ SfxApplication *pSfxApp = SFX_APP();
+
+ // in der 1. Runde den echten Stack 'um'bauen
+ SfxToDoStack_Impl aToDoCopy;
+ sal_Bool bModify = sal_False;
+ short nToDo;
+ for ( nToDo = pImp->aToDoStack.Count()-1; nToDo >= 0; --nToDo )
+ {
+ bModify = sal_True;
+
+ SfxToDo_Impl aToDo( pImp->aToDoStack.Top(nToDo) );
+ if ( aToDo.bPush )
+ {
+ // tats"aechlich pushen
+ DBG_ASSERT( !pImp->aStack.Contains( aToDo.pCluster ),
+ "pushed SfxShell already on stack" );
+ pImp->aStack.Push( aToDo.pCluster );
+ aToDo.pCluster->SetDisableFlags( pImp->nDisableFlags );
+
+ // die bewegte Shell merken
+ aToDoCopy.Push( aToDo );
+ }
+ else
+ {
+ // tats"aechlich poppen
+ SfxShell* pPopped = 0;
+ FASTBOOL bFound = sal_False;
+ do
+ {
+ DBG_ASSERT( pImp->aStack.Count(), "popping from empty stack" );
+ pPopped = pImp->aStack.Pop();
+ pPopped->SetDisableFlags( 0 );
+ bFound = pPopped == aToDo.pCluster;
+
+ // die bewegte Shell merken
+ aToDoCopy.Push( SfxToDo_Impl( sal_False, aToDo.bDelete, sal_False, *pPopped) );
+ }
+ while ( aToDo.bUntil && !bFound );
+ DBG_ASSERT( bFound, "wrong SfxShell popped" );
+ }
+
+ if ( nToDo == 0 )
+ pImp->aToDoStack.Clear();
+ }
+
+ // ggf. Bindings invalidieren
+ if ( !pSfxApp->IsDowning() )
+ {
+ if ( bModify )
+ {
+ pImp->pCachedServ1 = 0;
+ pImp->pCachedServ2 = 0;
+ }
+
+ InvalidateBindings_Impl( bModify );
+ }
+
+ pImp->bFlushing = sal_False;
+ pImp->bUpdated = sal_False; // nicht nur bei bModify, falls Doc/Template-Config
+ bFlushed = sal_True;
+
+ // in der 2. Runde die Shells aktivieren und ggf. l"oschen
+ for ( nToDo = aToDoCopy.Count()-1; nToDo >= 0; --nToDo )
+ {
+ SfxToDo_Impl aToDo( aToDoCopy.Top(nToDo) );
+ if ( aToDo.bPush )
+ {
+ if ( pImp->bActive )
+ aToDo.pCluster->DoActivate(pImp->pFrame, sal_True);
+ }
+ else
+ if ( pImp->bActive )
+ aToDo.pCluster->DoDeactivate(pImp->pFrame, sal_True);
+ }
+ for ( nToDo = aToDoCopy.Count()-1; nToDo >= 0; --nToDo )
+ {
+ SfxToDo_Impl aToDo( aToDoCopy.Top(nToDo) );
+ if ( aToDo.bDelete ) delete aToDo.pCluster;
+ }
+ sal_Bool bAwakeBindings = aToDoCopy.Count() != 0;
+ if( bAwakeBindings )
+ aToDoCopy.Clear();
+
+ // Wenn bei Activate/Deactivate/Delete weitere Stackbewegungen erfolgt sind :
+ if (!bFlushed)
+ // falls jemand Push/Pop gerufen hat, wurde auch EnterReg gerufen!
+ FlushImpl();
+
+ if( bAwakeBindings && GetBindings() )
+ GetBindings()->DLEAVEREGISTRATIONS();
+ DBG_PROFSTOP(SfxDispatcherFlush);
+
+ for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
+ pImp->aFixedObjBars[n].aResId = ResId( 0,0 );
+
+#ifdef DBG_UTIL
+ aMsg += " done";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::SetSlotFilter
+(
+ HACK(hier muss mal ein enum rein)
+ sal_Bool bEnable, /* sal_True:
+ nur angegebene Slots enablen,
+ alle anderen disablen
+
+ sal_False:
+ die angegebenen Slots disablen,
+ alle anderen zun"achst enablen
+ */
+ sal_uInt16 nCount, // Anzahl der SIDs im folgenden Array
+ const sal_uInt16* pSIDs // sortiertes Array von 'nCount' SIDs
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird ein Filter gesetzt, mit dem gezielt Slots
+ enabled bzw. disabled werden k"onnen. Das "ubergebene Array mu\s
+ bis zum Dtor bzw. n"achsten <SetSlotFilter()> erhalten bleiben, es
+ wird nicht vom Dispatcher gel"oscht, es kann daher static sein.
+
+ In ReadOnly-Dokumenten kann man mit 'bEnable==2' quasi das ReadOnlyDoc
+ Flag von Slots "ubersteuern, dieser werden also wieder gefunden. Auf
+ andere Slots hat das dann keine Auswirkung.
+
+
+ [Beispiel]
+
+ gezieltes disablen der Slots 1, 2 und 3:
+
+ static sal_uInt16 __READONLY_DATA pSIDs[] = { 1, 2, 3 };
+ pDisp->SetSlotFilter( sal_False, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs );
+
+ nur die Slots 5, 6 und 7 zulassen:
+
+ static sal_uInt16 __READONLY_DATA pSIDs[] = { 5, 6, 7 };
+ pDisp->SetSlotFilter( sal_True, sizeof(pSIDs)/sizeof(sal_uInt16), pSIDs );
+
+ Filter ausschalten:
+
+ pDisp->SetSlotFilter();
+*/
+
+{
+#ifdef DBG_UTIL
+ // Array "uberpr"ufen
+ for ( sal_uInt16 n = 1; n < nCount; ++n )
+ DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sortet" );
+#endif
+
+ if ( pImp->pFilterSIDs )
+ pImp->pFilterSIDs = 0;
+
+ pImp->bFilterEnabling = bEnable;
+ pImp->nFilterCount = nCount;
+ pImp->pFilterSIDs = pSIDs;
+
+ GetBindings()->InvalidateAll(sal_True);
+}
+
+//--------------------------------------------------------------------
+EXTERN_C
+#if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC ))
+int _stdcall
+#else
+#ifdef WNT
+int _cdecl
+#else
+int
+#endif
+#endif
+
+SfxCompareSIDs_Impl( const void* pSmaller, const void* pBigger )
+{
+ DBG_MEMTEST();
+ return ( (long) *((sal_uInt16*)pSmaller) ) - ( (long) *((sal_uInt16*)pBigger) );
+}
+
+//--------------------------------------------------------------------
+sal_Bool SfxDispatcher::IsSlotEnabledByFilter_Impl( sal_uInt16 nSID ) const
+
+/* [Beschreibung]
+
+ Sucht 'nSID' in dem mit <SetSlotFilter()> gesetzten Filter und
+ liefert sal_True, falls die SID erlaubt ist, bzw. sal_False, falls sie
+ durch den Filter disabled ist.
+
+ [R"uckgabewert]
+ sal_Bool 0 => disabled
+ 1 => enabled
+ 2 => enabled even if ReadOnlyDoc
+*/
+
+{
+ // kein Filter?
+ if ( 0 == pImp->nFilterCount )
+ // => alle SIDs erlaubt
+ return sal_True;
+
+ // suchen
+ sal_Bool bFound = 0 != bsearch( &nSID, pImp->pFilterSIDs, pImp->nFilterCount,
+ sizeof(sal_uInt16), SfxCompareSIDs_Impl );
+
+ // even if ReadOnlyDoc
+ if ( 2 == pImp->bFilterEnabling )
+ return bFound ? 2 : 1;
+ // sonst je nach Negativ/Positiv Filter
+ return pImp->bFilterEnabling ? bFound : !bFound;
+}
+
+//--------------------------------------------------------------------
+sal_Bool SfxDispatcher::_TryIntercept_Impl
+(
+ sal_uInt16 nSlot, // zu suchende Slot-Id
+ SfxSlotServer& rServer, // zu f"uellende <SfxSlotServer>-Instanz
+ sal_Bool bSelf
+)
+{
+ // Eventuell geh"ort der parent auch zu einer Komponente
+ SfxDispatcher *pParent = pImp->pParent;
+ sal_uInt16 nLevels = pImp->aStack.Count();
+ while ( pParent && pParent->pImp->pFrame )
+ {
+ if ( pParent->pImp->pFrame->GetFrame()->HasComponent() )
+ {
+ // Components d"urfen intercepten
+ if ( pParent->_TryIntercept_Impl( nSlot, rServer, sal_True ) )
+ {
+ // Die eigenen Shells zum Shelllevel hinzuz"ahlen
+ rServer.SetShellLevel( rServer.GetShellLevel() + nLevels );
+ return sal_True;
+ }
+ else
+ // Keine weitere Interception
+ break;
+ }
+ else
+ nLevels += pParent->pImp->aStack.Count();
+
+ pParent = pParent->pImp->pParent;
+ }
+
+ if ( bSelf )
+ {
+ // Die ComponentViewShell befragen
+ Flush();
+ SfxShell *pObjShell = GetShell(0);
+ SfxInterface *pIFace = pObjShell->GetInterface();
+ const SfxSlot *pSlot = pIFace->GetSlot(nSlot);
+
+ if ( pSlot )
+ {
+ rServer.SetSlot(pSlot);
+ rServer.SetShellLevel(0);
+#ifdef DBG_UTILx
+ String aMsg( nSlot );
+ aMsg += " intercepted";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+ return sal_True;
+ }
+ }
+
+ return sal_False;
+}
+
+sal_Bool SfxDispatcher::_FindServer
+(
+ sal_uInt16 nSlot, // zu suchende Slot-Id
+ SfxSlotServer& rServer, // zu f"uellnde <SfxSlotServer>-Instanz
+ sal_Bool bModal // trotz ModalMode
+)
+
+/* [Beschreibung]
+
+ Diese Hilfsmethode sucht den <Slot-Server>, der nSlot zur Zeit bedient.
+ Als Ergebnis wird rServer entsprechend gef"ullt.
+
+ Falls bekannt, kann das SfxInterface mitgegeben werden, von welchem
+ nSlot momentan bedient wird.
+
+ Vor der Suche nach nSlot wird der SfxDispatcher geflusht.
+
+
+ [R"uckgabewert]
+
+ sal_Bool sal_True
+ Der Slot wurde gefunden, rServer ist g"ultig.
+
+ sal_False
+ Der Slot wird momentan nicht bedient, rServer
+ ist ung"ultig.
+*/
+
+{
+ SFX_STACK(SfxDispatcher::_FindServer);
+
+ // Dispatcher gelockt? (SID_BROWSE_STOP und SID_HELP_PI trotzdem durchlassen)
+ SfxApplication *pSfxApp = SFX_APP();
+ sal_Bool bAllLocked = pSfxApp->IsDispatcherLocked();
+ if ( IsLocked(nSlot) )
+ {
+ if ( bAllLocked )
+ pSfxApp->Get_Impl()->bInvalidateOnUnlock = sal_True;
+ pImp->bInvalidateOnUnlock = sal_True;
+ return sal_False;
+ }
+
+ // Anzahl der Shells auf den verkettenten Dispatchern z"ahlen
+ Flush();
+ sal_uInt16 nTotCount = pImp->aStack.Count();
+ if ( pImp->pParent )
+ {
+ SfxDispatcher *pParent = pImp->pParent;
+ while ( pParent )
+ {
+ nTotCount += pParent->pImp->aStack.Count();
+ pParent = pParent->pImp->pParent;
+ }
+ }
+
+ // Makro-Slot?
+ if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
+ {
+ rServer.SetShellLevel(nTotCount-1);
+ rServer.SetSlot(pSfxApp->GetMacroConfig()->GetMacroInfo(nSlot)->GetSlot());
+ return sal_True;
+ }
+ // Verb-Slot?
+ else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END)
+ {
+ SfxShell *pSh = 0;
+ for ( sal_uInt16 nShell = 0; pSh = GetShell(nShell); ++nShell )
+ {
+ if ( pSh->ISA(SfxViewShell) )
+ {
+ rServer.SetShellLevel(nShell);
+ rServer.SetSlot(pSh->GetVerbSlot_Impl(nSlot));
+ return sal_True;
+ }
+ }
+
+ return sal_False;
+ }
+
+ // SID gegen gesetzten Filter pr"ufen
+ sal_uInt16 nSlotEnableMode=0;
+ if ( pImp->pFrame )
+ {
+ nSlotEnableMode = IsSlotEnabledByFilter_Impl( nSlot );
+ if ( 0 == nSlotEnableMode )
+ return sal_False;
+ }
+
+ // im Quiet-Mode nur Parent-Dispatcher
+ if ( pImp->bQuiet )
+ {
+ if ( pImp->pParent )
+ {
+ sal_Bool bRet = pImp->pParent->_FindServer( nSlot, rServer, bModal );
+ rServer.SetShellLevel
+ ( rServer.GetShellLevel() + pImp->aStack.Count() );
+ return bRet;
+ }
+ else
+ return sal_False;
+ }
+
+ sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ) ||
+ ( pImp->pFrame && pImp->pFrame->GetObjectShell() &&
+ pImp->pFrame->GetObjectShell()->IsLoading() );
+
+ // durch alle Shells der verketteten Dispatchern von oben nach unten suchen
+#ifdef DBG_UTILx
+ String aStack( "Stack:" );
+#endif
+ sal_uInt16 nFirstShell = pImp->bModal && !bModal ? pImp->aStack.Count() : 0;
+ for ( sal_uInt16 i = nFirstShell; i < nTotCount; ++i )
+ {
+ SfxShell *pObjShell = GetShell(i);
+ SfxInterface *pIFace = pObjShell->GetInterface();
+ const SfxSlot *pSlot = pIFace->GetSlot(nSlot);
+
+ if ( pSlot && pSlot->nDisableFlags && ( pSlot->nDisableFlags & pObjShell->GetDisableFlags() ) != 0 )
+ return sal_False;
+
+ if ( pSlot && !( pSlot->nFlags & SFX_SLOT_READONLYDOC ) && bReadOnly )
+ return sal_False;
+
+ if ( pSlot )
+ {
+ // Slot geh"ort zum Container?
+ FASTBOOL bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER);
+ FASTBOOL bIsInPlace = pImp->pFrame && pImp->pFrame->ISA( SfxInPlaceFrame );
+
+ // Shell geh"ort zum Server?
+ // AppDispatcher oder IPFrame-Dispatcher
+ FASTBOOL bIsServerShell = !pImp->pFrame || bIsInPlace;
+
+ // Nat"urlich sind ServerShell-Slots auch ausf"uhrbar, wenn sie auf
+ // einem Container-Dispatcher ohne IPClient ausgef"uhrt werden sollen.
+ if ( !bIsServerShell )
+ {
+ SfxViewShell *pViewSh = pImp->pFrame->GetViewShell();
+ bIsServerShell = !pViewSh || !pViewSh->GetIPClient();
+ }
+
+ // Shell geh"ort zum Container?
+ // AppDispatcher oder kein IPFrameDispatcher
+ FASTBOOL bIsContainerShell = !pImp->pFrame || !bIsInPlace;
+#ifdef MBA
+ if ( !bIsContainerShell )
+ {
+ // Bei internem InPlace auch den AppDispatcher zug"angig machen
+ if ( pImp->pFrame && pImp->pFrame->GetParentViewFrame_Impl() )
+ {
+ if ( i == nTotCount - 1 )
+ bIsContainerShell = sal_True;
+ }
+ }
+#endif
+ // Shell und Slot passen zusammen
+ if ( !( ( bIsContainerSlot && bIsContainerShell ) ||
+ ( !bIsContainerSlot && bIsServerShell ) ) )
+ pSlot = 0;
+ }
+
+#ifdef DBG_UTILx
+ if ( pSlot )
+ {
+ String aMsg( nSlot );
+ aMsg += " found in ";
+ aMsg += pObjShell->GetInterface()->GetClassName();
+ DbgTrace( aMsg.GetBuffer() );
+ }
+ else
+ {
+ aStack += " ";
+ aStack += pObjShell->GetInterface()->GetClassName();
+ }
+#endif
+ if ( pSlot && !IsAllowed( nSlot ) )
+ {
+ pSlot = NULL;
+ }
+
+ if ( pSlot )
+ {
+ rServer.SetSlot(pSlot);
+ rServer.SetShellLevel(i);
+ return sal_True;
+ }
+ }
+
+#ifdef DBG_UTILx
+ String aMsg( nSlot );
+ aMsg += " not found in ";
+ aMsg += aStack;
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+ return sal_False;
+}
+//--------------------------------------------------------------------
+sal_Bool SfxDispatcher::_FillState
+(
+ const SfxSlotServer& rSvr, // abzufragende <Slot-Server>
+ SfxItemSet& rState, // zu f"ullendes <SfxItemSet>
+ const SfxSlot* pRealSlot // ggf. der tats"achliche Slot
+)
+
+/* [Beschreibung]
+
+ Hilfsmethode zum Abfragen des Status des <Slot-Server>s rSvr.
+ In rState m"ussen die gew"unschten Slots-Ids (teilweise in Which-Ids
+ des betreffenden Pools umgewandelt) vorhanden sein.
+
+ Der SfxDispatcher wird vor der Abfrage geflusht.
+*/
+
+{
+ SFX_STACK(SfxDispatcher::_FillState);
+
+ DBG_PROFSTART(SfxDispatcherFillState);
+
+ const SfxSlot *pSlot = rSvr.GetSlot();
+ SfxApplication *pSfxApp = SFX_APP();
+ sal_Bool bAllLocked = pSfxApp->IsDispatcherLocked();
+ if ( pSlot && IsLocked( pSlot->GetSlotId() ) )
+ {
+ if ( bAllLocked )
+ pSfxApp->Get_Impl()->bInvalidateOnUnlock = sal_True;
+ pImp->bInvalidateOnUnlock = sal_True;
+ DBG_PROFSTOP(SfxDispatcherFillState);
+ return sal_False;
+ }
+
+ if ( pSlot )
+ {
+ Flush();
+
+ // Objekt ermitteln und Message an diesem Objekt aufrufen
+ SfxShell *pSh = GetShell(rSvr.GetShellLevel());
+ DBG_ASSERT(pSh, "ObjektShell nicht gefunden");
+
+ SfxStateFunc pFunc;
+
+ if (pRealSlot)
+ pFunc = pRealSlot->GetStateFnc();
+ else
+ pFunc = pSlot->GetStateFnc();
+
+ pSh->CallState( pFunc, rState );
+#ifdef DBG_UTIL
+ // pr"ufen, ob IDL (SlotMap) und aktuelle Items "ubereinstimmen
+ if ( DbgIsAssertWarning() && rState.Count() )
+ {
+ SfxInterface *pIF = pSh->GetInterface();
+ SfxItemIter aIter( rState );
+ for ( const SfxPoolItem *pItem = aIter.FirstItem();
+ pItem;
+ pItem = aIter.NextItem() )
+ if ( !IsInvalidItem(pItem) && !pItem->ISA(SfxVoidItem) )
+ {
+ sal_uInt16 nSlotId = rState.GetPool()->GetSlotId(pItem->Which());
+ if ( !pItem->IsA(pIF->GetSlot(nSlotId)->GetType()->Type()) )
+ {
+ ByteString aMsg( "item-type unequal to IDL (=> no BASIC)" );
+ aMsg += "\nwith SID: ";
+ aMsg += ByteString::CreateFromInt32( nSlotId );
+ aMsg += "\nin ";
+ aMsg += pIF->GetClassName();
+ DbgOut( aMsg.GetBuffer(), DBG_OUT_ERROR, __FILE__, __LINE__);
+ }
+ }
+ }
+#endif
+
+ DBG_PROFSTOP(SfxDispatcherFillState);
+ return sal_True;
+ }
+
+ DBG_PROFSTOP(SfxDispatcherFillState);
+ return sal_False;
+}
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxDispatcher::_Execute( const SfxSlotServer &rSvr )
+
+/* [Beschreibung]
+
+ Diese Methode f"uhrt einen Request "uber einen gecachten <Slot-Server>
+ aus.
+*/
+
+{
+ const SfxSlot *pSlot = rSvr.GetSlot();
+ if ( IsLocked( pSlot->GetSlotId() ) )
+ return 0;
+
+ if ( pSlot )
+ {
+ Flush();
+
+ sal_uInt16 nSlot = pSlot->GetSlotId();
+ if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
+ SFX_APP()->GetMacroConfig()->RegisterSlotId( nSlot );
+
+ if ( pSlot->IsMode(SFX_SLOT_ASYNCHRON) )
+ //! ignoriert rSvr
+ {
+ SfxShell *pShell = GetShell( rSvr.GetShellLevel() );
+ SfxDispatcher *pDispat = this;
+ while ( pDispat )
+ {
+ sal_uInt16 nShellCount = pDispat->pImp->aStack.Count();
+ for ( sal_uInt16 n=0; n<nShellCount; n++ )
+ if ( pShell == pDispat->pImp->aStack.Top(n) )
+ {
+ pDispat->pImp->xPoster->Post(
+ new SfxRequest( pSlot->GetSlotId(),
+ SFX_CALLMODE_RECORD, pShell->GetPool() ) );
+// pDispat->pImp->xPoster->Post(new Executer(
+// new SfxRequest( pSlot->GetSlotId(),
+// SFX_CALLMODE_RECORD, pShell->GetPool() ),
+// pSlot, n ));
+ return 0;
+ }
+ }
+ }
+ else
+ {
+ // Objekt ermitteln und Message an diesem Objekt aufrufen
+ SfxShell *pSh = GetShell(rSvr.GetShellLevel());
+ SfxRequest aReq( pSlot->GetSlotId(), SFX_CALLMODE_RECORD, pSh->GetPool() );
+ if ( Call_Impl( *pSh, *pSlot, aReq, sal_True ) ) // von Bindings immer recorden
+ return aReq.GetReturnValue();
+ }
+ }
+ return 0;
+}
+
+//----------------------------------------------------------------------
+void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId,
+ Window *pWin, const Point *pPos,
+ const SfxPoolItem *pArg1, ... )
+
+/* [Beschreibung]
+
+ Diese Methode f"uhrt das unter der Id nConfigId registrierte PopupMenu
+ aus. Die Regisitrierung wird i.d.R. in <SFX_IMPL_INTERFACE> vorgenommen.
+
+ Bei nConfigId == 0 werden die auf dem Stack des Dispatchers befindlichen
+ <SfxShell>s von oben nach unten nach dem ersten registrieren PopupMenu
+ durchsucht.
+*/
+
+{
+ SfxDispatcher &rDisp = *SFX_APP()->GetDispatcher_Impl();
+ sal_uInt16 nShLevel = 0;
+
+ const SvVerbList *pVerbList = 0;
+
+ // Nur die eigenen Shells nehmen !!
+ sal_uInt16 nMaxShellLevel = rDisp.pImp->aStack.Count();
+
+ SfxShell *pSh;
+ for ( pSh = rDisp.GetShell(nShLevel);
+ pSh && nShLevel < nMaxShellLevel ;
+ ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
+ {
+
+ if (pSh->GetVerbs())
+ {
+ pVerbList = pSh->GetVerbs();
+ break;
+ }
+ }
+
+ nShLevel=0;
+
+ if ( rDisp.pImp->bQuiet )
+ {
+ nConfigId = 0;
+ nShLevel = rDisp.pImp->aStack.Count();
+ }
+
+ Window *pWindow = pWin ? pWin :
+ SFX_APP()->GetWorkWindow_Impl( rDisp.pImp->pFrame )->GetWindow();
+
+ for ( pSh = rDisp.GetShell(nShLevel);
+ pSh;
+ ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
+ {
+ const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId();
+ if ( ( nConfigId == 0 && rResId.GetId() ) ||
+ ( nConfigId != 0 && rResId.GetId() == nConfigId ) )
+ {
+ SfxPopupMenuManager aPop(rResId.GetId(), *rDisp.GetBindings() );
+ aPop.SetResMgr(rResId.GetResMgr());
+ aPop.AddClipboardFunctions();
+ aPop.Initialize();
+
+ if (pVerbList && pVerbList->Count())
+ aPop.InsertVerbs(pVerbList);
+
+ aPop.RemoveDisabledEntries();
+ sal_uInt16 nRetId = aPop.Execute(
+ pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow );
+ return;
+ }
+ }
+}
+
+//----------------------------------------------------------------------
+void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId
+ , Window *pWin, const Point *pPos
+ )
+
+/* [Beschreibung]
+
+ Diese Methode f"uhrt das unter der Id nConfigId registrierte PopupMenu
+ aus. Die Regisitrierung wird i.d.R. in <SFX_IMPL_INTERFACE> vorgenommen.
+
+ Bei nConfigId == 0 werden die auf dem Stack des Dispatchers befindlichen
+ <SfxShell>s von oben nach unten nach dem ersten registrieren PopupMenu
+ durchsucht.
+*/
+
+{
+ SfxDispatcher &rDisp = *SFX_APP()->GetDispatcher_Impl();
+ sal_uInt16 nShLevel = 0;
+ const SvVerbList *pVerbList = 0;
+
+ // Nur die eigenen Shells nehmen !!
+ sal_uInt16 nMaxShellLevel = rDisp.pImp->aStack.Count();
+
+ SfxShell *pSh;
+ for ( pSh = rDisp.GetShell(nShLevel);
+ pSh && nShLevel < nMaxShellLevel ;
+ ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
+ {
+
+ if (pSh->GetVerbs())
+ {
+ pVerbList = pSh->GetVerbs();
+ break;
+ }
+ }
+
+ nShLevel=0;
+
+ if ( rDisp.pImp->bQuiet )
+ {
+ nConfigId = 0;
+ nShLevel = rDisp.pImp->aStack.Count();
+ }
+
+ Window *pWindow = pWin ? pWin :
+ SFX_APP()->GetWorkWindow_Impl( rDisp.pImp->pFrame )->GetWindow();
+
+ for ( pSh = rDisp.GetShell(nShLevel);
+ pSh;
+ ++nShLevel, pSh = rDisp.GetShell(nShLevel) )
+ {
+
+ const ResId& rResId = pSh->GetInterface()->GetPopupMenuResId();
+ if ( ( nConfigId == 0 && rResId.GetId() ) ||
+ ( nConfigId != 0 && rResId.GetId() == nConfigId ) )
+ {
+ SfxPopupMenuManager aPop(rResId.GetId(), *rDisp.GetBindings() );
+ aPop.SetResMgr(rResId.GetResMgr());
+ aPop.AddClipboardFunctions();
+ aPop.Initialize();
+ if (pVerbList && pVerbList->Count())
+ aPop.InsertVerbs(pVerbList);
+
+ aPop.RemoveDisabledEntries();
+ sal_uInt16 nRetId = aPop.Execute(
+ pPos ? *pPos : pWindow->GetPointerPosPixel(), pWindow );
+ return;
+ }
+ }
+}
+
+//----------------------------------------------------------------------
+void SfxDispatcher::ExecutePopup( const ResId &rId
+ , Window *pWin, const Point *pPos
+ )
+
+/* [Beschreibung]
+
+ Diese Methode l"adt ein PopupMenu aus der angegebenen Resource und
+ f"uhrt es aus. Die Selektion wird "uber diesen SfxDispatcher ausgef"uhrt.
+*/
+
+{
+ Window *pWindow = pWin ? pWin :
+ SFX_APP()->GetWorkWindow_Impl( pImp->pFrame )->GetWindow();
+
+ SfxPopupMenuManager aPop( rId, *GetBindings() );
+ aPop.AddClipboardFunctions();
+ aPop.Initialize();
+ aPop.RemoveDisabledEntries();
+ sal_uInt16 nRetId = aPop.Execute( pPos ? *pPos : pWindow->GetPointerPosPixel(),
+ pWindow );
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::Lock( sal_Bool bLock )
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann der SfxDispatcher gesperrt und freigegeben
+ werden. Ein gesperrter SfxDispatcher f"uhrt keine <SfxRequest>s mehr
+ aus und liefert keine Status-Informationen mehr. Er verh"alt sich
+ so als w"aren alle Slots disabled.
+*/
+
+{
+ SfxBindings* pBindings = GetBindings();
+ if ( !bLock && pImp->bLocked && pImp->bInvalidateOnUnlock )
+ {
+ if ( pBindings )
+ pBindings->InvalidateAll(sal_True);
+ pImp->bInvalidateOnUnlock = sal_False;
+ }
+ else if ( pBindings )
+ pBindings->InvalidateAll(sal_False);
+ pImp->bLocked = bLock;
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::ShowObjectBar(sal_uInt16 nId, SfxShell *pShell) const
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann auf einer Objektleistenposition gezielt eine
+ bestimmte Objektleiste eingeblendet werden.
+*/
+
+{
+ ResId aResId(nId);
+ sal_uInt16 nPos = USHRT_MAX;
+ sal_uInt16 nNo;
+ SfxInterface *pIFace;
+
+ if ( pShell )
+ {
+ // Nur in der Shell suchen
+ pIFace = pShell->GetInterface();
+ for ( nNo=0; nNo<pIFace->GetObjectBarCount(); nNo++ )
+ {
+ if (pIFace->GetObjectBarResId(nNo).GetId() == nId)
+ {
+ nPos = pIFace->GetObjectBarPos(nNo);
+ break;
+ }
+ }
+ }
+ else
+ {
+ // Alle Shells absuchen
+ for ( sal_uInt16 nIdx=0; (pShell=GetShell(nIdx)); nIdx++ )
+ {
+ pIFace = pShell->GetInterface();
+ for ( nNo=0; nNo<pIFace->GetObjectBarCount(); nNo++ )
+ {
+ if (pIFace->GetObjectBarResId(nNo).GetId() == nId)
+ {
+ nPos = pIFace->GetObjectBarPos(nNo);
+ break;
+ }
+ }
+
+ if ( nPos != USHRT_MAX )
+ break;
+ }
+ }
+
+ if ( nPos != USHRT_MAX )
+ {
+ // Auf jeden Fall eintragen, auch wenn unsichtbar. Dann kann
+ // WorkWindow anbieten, wieder anzuschalten
+ SfxObjectBars_Impl& rBar = pImp->aObjBars[nPos & SFX_POSITION_MASK];
+ SfxObjectBars_Impl& rFixed = pImp->aFixedObjBars[nPos & SFX_POSITION_MASK];
+
+ sal_uInt16 nOldId = rBar.aResId.GetId();
+
+ if ( pImp->bReadOnly && !( nPos & SFX_VISIBILITY_READONLYDOC ) )
+ return;
+
+ sal_uInt32 nFeature = pIFace->GetObjectBarFeature(nNo);
+ if ( nFeature && !pShell->HasUIFeature( nFeature ) )
+ return;
+
+ sal_Bool bVisible = pIFace->IsObjectBarVisible(nNo);
+ if ( !bVisible )
+ // Alle Sichtbarkeitsflags ausschalten
+ nPos &= SFX_POSITION_MASK;
+
+ aResId.SetResMgr( pIFace->GetObjectBarResId(nNo).GetResMgr() );
+ rBar.aResId = aResId;
+ rBar.nMode = nPos;
+ const String *pName = pIFace->GetObjectBarName(nNo);
+ if ( pName )
+ rBar.aName = *pName;
+ else
+ rBar.aName.Erase();
+ rBar.pIFace = pIFace;
+
+ rFixed = rBar;
+
+ if ( nOldId != aResId.GetId() && pImp->bUpdated )
+ {
+ SfxWorkWindow *pWorkWin = SFX_APP()->GetWorkWindow_Impl(pImp->pFrame);
+ pWorkWin->SetObjectBar_Impl( nPos, aResId, pIFace, pName );
+ pWorkWin->UpdateObjectBars_Impl();
+ }
+
+ if ( !bVisible )
+ {
+ rBar.aResId = ResId( 0,0 );
+ rFixed.aResId = ResId( 0,0 );
+ }
+
+ return;
+ }
+
+// DBG_ERROR("Objektleiste nicht bekannt!");
+}
+
+sal_uInt16 SfxDispatcher::GetObjectBarId( sal_uInt16 nPos ) const
+{
+ return pImp->aObjBars[nPos].aResId.GetId();
+}
+
+//--------------------------------------------------------------------
+void SfxDispatcher::ResetObjectBars_Impl()
+
+/* [Beschreibung]
+
+ Mit dieser Methode werden alle Objectbar-Anforderungen, die dieser
+ Dispatcher an das AppWindow hat, beseitigt.
+*/
+{
+ for (sal_uInt16 n=0; n<SFX_OBJECTBAR_MAX; n++)
+ pImp->aObjBars[n].aResId = ResId( 0,0 );
+ pImp->aChildWins.Remove(0, pImp->aChildWins.Count());
+}
+
+
+//--------------------------------------------------------------------
+void SfxDispatcher::DebugOutput_Impl() const
+{
+#ifdef DBG_UTIL
+
+ sal_uInt16 nOld = (sal_uInt16) DbgGetData()->nTraceOut;
+ DbgGetData()->nTraceOut = DBG_OUT_FILE;
+
+ if (pImp->bFlushed)
+ DBG_TRACE("Flushed");
+ if (pImp->bUpdated)
+ DBG_TRACE("Updated");
+
+ for ( sal_uInt16 nShell = pImp->aStack.Count(); nShell > 0; --nShell )
+ {
+ SfxShell *pShell = GetShell(nShell-1);
+ const SfxInterface *pIFace = pShell->GetInterface();
+ DBG_TRACE (pIFace->GetClassName());
+ }
+
+ DbgGetData()->nTraceOut = nOld;
+
+#endif
+}
+
+void SfxDispatcher::LockUI_Impl( sal_Bool bLock )
+{
+ sal_Bool bWasLocked = pImp->bUILocked;
+ pImp->bUILocked = bLock;
+ if ( !bLock && bWasLocked )
+ Update_Impl( sal_True );
+}
+
+//-------------------------------------------------------------------------
+void SfxDispatcher::HideUI( sal_Bool bHide )
+{
+// if ( !bHide && pImp->bReadOnly )
+// bHide = sal_True;
+ sal_Bool bWasHidden = pImp->bNoUI;
+ pImp->bNoUI = bHide;
+ if ( bHide != bWasHidden )
+ Update_Impl( sal_True );
+}
+
+void SfxDispatcher::SetReadOnly_Impl( sal_Bool bOn )
+{
+ pImp->bReadOnly = bOn;
+// pImp->bNoUI = bOn;
+}
+
+sal_Bool SfxDispatcher::GetReadOnly_Impl() const
+{
+ return pImp->bReadOnly;
+}
+
+//-------------------------------------------------------------------------
+void SfxDispatcher::SetQuietMode_Impl( sal_Bool bOn )
+
+/* [Beschreibung]
+
+ Bei 'bOn' stellt sich dieser Dispatcher quasi tot und leitet alles
+ an den Parent-Dispatcher weiter.
+*/
+
+{
+ pImp->bQuiet = bOn;
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->InvalidateAll(sal_True);
+}
+
+//-------------------------------------------------------------------------
+void SfxDispatcher::SetModalMode_Impl( sal_Bool bOn )
+
+/* [Beschreibung]
+
+ Bei 'bOn' werden nur noch Slots des Parent-Dispatchers gefunden.
+*/
+
+{
+ pImp->bModal = bOn;
+ SfxBindings* pBindings = GetBindings();
+ if ( pBindings )
+ pBindings->InvalidateAll(sal_True);
+}
+
+void SfxDispatcher::SetExecuteMode( sal_uInt16 nMode )
+{
+ pImp->nStandardMode = nMode;
+}
+
+SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSlot, const SfxPoolItem* &rpState )
+{
+ SfxShell *pShell = 0;
+ const SfxSlot *pSlot = 0;
+ if ( GetShellAndSlot_Impl( nSlot, &pShell, &pSlot, sal_False, sal_False ) )
+ {
+ rpState = pShell->GetSlotState(nSlot);
+ if ( !rpState )
+ return SFX_ITEM_DISABLED;
+ else
+ return SFX_ITEM_AVAILABLE;
+ }
+
+ return SFX_ITEM_DISABLED;
+}
+
+sal_Bool SfxDispatcher::IsReadOnlyShell_Impl( sal_uInt16 nShell ) const
+{
+ sal_uInt16 nShellCount = pImp->aStack.Count();
+ if ( nShell < nShellCount )
+ {
+ if( nShell == nShellCount - 1 )
+ return pImp->aStack.Bottom()->ISA( SfxModule ) ?
+ sal_False : pImp->bReadOnly;
+ else return pImp->bReadOnly;
+ }
+ else if ( pImp->pParent )
+ return pImp->pParent->IsReadOnlyShell_Impl( nShell - nShellCount );
+ return sal_True;
+}
+
+// Ein dirty trick, um an die Methoden der private base class von
+// SfxShellStack_Impl heranzukommen
+class StackAccess_Impl : public SfxShellStack_Implarr_
+{};
+
+void SfxDispatcher::InsertShell_Impl( SfxShell& rShell, sal_uInt16 nPos )
+{
+ Flush();
+
+ // Der cast geht, weil SfxShellStack_Impl keine eigenen member hat
+ ((StackAccess_Impl*) (&pImp->aStack))->Insert( nPos, &rShell );
+ rShell.SetDisableFlags( pImp->nDisableFlags );
+ rShell.DoActivate(pImp->pFrame, sal_True);
+
+ if ( !SFX_APP()->IsDowning() )
+ {
+ pImp->bUpdated = sal_False;
+ pImp->pCachedServ1 = 0;
+ pImp->pCachedServ2 = 0;
+ InvalidateBindings_Impl(sal_True);
+ }
+}
+
+void SfxDispatcher::RemoveShell_Impl( SfxShell& rShell )
+{
+ Flush();
+
+ // Der cast geht, weil SfxShellStack_Impl keine eigenen member hat
+ StackAccess_Impl& rStack = *((StackAccess_Impl*) (&pImp->aStack));
+ sal_uInt16 nCount = rStack.Count();
+ for ( sal_uInt16 n=0; n<nCount; ++n )
+ {
+ if ( rStack[n] == &rShell )
+ {
+ rStack.Remove( n );
+ rShell.SetDisableFlags( 0 );
+ rShell.DoDeactivate(pImp->pFrame, sal_True);
+ break;
+ }
+ }
+
+ if ( !SFX_APP()->IsDowning() )
+ {
+ pImp->bUpdated = sal_False;
+ pImp->pCachedServ1 = 0;
+ pImp->pCachedServ2 = 0;
+ InvalidateBindings_Impl(sal_True);
+ }
+}
+
+sal_Bool SfxDispatcher::IsAllowed
+(
+ sal_uInt16 nSlot
+) const
+/*
+ [Beschreibung]
+ Die Methode prueft, ob der Zugriff auf diese Schnittstelle erlaubt ist.
+ */
+{
+ if ( !pImp->pDisableList )
+ {
+ return sal_True;
+ }
+
+ // BinSearch in der DisableListe
+ SvUShorts& rList = *pImp->pDisableList;
+ sal_uInt16 nCount = rList.Count();
+ sal_uInt16 nLow = 0, nMid, nHigh;
+ sal_Bool bFound = sal_False;
+ nHigh = nCount - 1;
+
+ while ( !bFound && nLow <= nHigh )
+ {
+ nMid = (nLow + nHigh) >> 1;
+ DBG_ASSERT( nMid < nCount, "bsearch ist buggy" );
+
+ int nDiff = (int) nSlot - (int) rList[nMid];
+ if ( nDiff < 0)
+ {
+ if ( nMid == 0 )
+ break;
+ nHigh = nMid - 1;
+ }
+ else if ( nDiff > 0 )
+ {
+ nLow = nMid + 1;
+ if ( nLow == 0 )
+ break;
+ }
+ else
+ bFound = sal_True;
+ }
+
+ // Slot in der Liste gefunden ?
+ sal_uInt16 nPos = bFound ? nMid : nLow;
+
+ DBG_ASSERT( nPos <= nCount, "" );
+ DBG_ASSERT( nPos == nCount || nSlot <= rList[nPos], "" );
+ DBG_ASSERT( nPos == 0 || nSlot > rList[nPos-1], "" );
+ DBG_ASSERT( ( (nPos+1) >= nCount ) || nSlot < rList[nPos+1], "" );
+
+ return !bFound;
+}
+
+void SfxDispatcher::InvalidateBindings_Impl( sal_Bool bModify )
+{
+ // App-Dispatcher?
+ if ( IsAppDispatcher() )
+ {
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
+ pFrame;
+ pFrame = SfxViewFrame::GetNext( *pFrame ) )
+ pFrame->GetBindings().InvalidateAll(bModify);
+/*
+ // alle Bindings sind betroffen
+ for ( SfxInPlaceFrame *pIPFrame = (SfxInPlaceFrame*)
+ SfxViewFrame::GetFirst(0, TYPE(SfxInPlaceFrame));
+ pIPFrame;
+ pIPFrame = (SfxInPlaceFrame*)
+ SfxViewFrame::GetNext(*pIPFrame, 0, TYPE(SfxInPlaceFrame)) )
+ pIPFrame->GetBindings().InvalidateAll(bModify);
+
+ for ( SfxPlugInFrame *pPIFrame = (SfxPlugInFrame*)
+ SfxViewFrame::GetFirst(0, TYPE(SfxPlugInFrame));
+ pPIFrame;
+ pPIFrame = (SfxPlugInFrame*)
+ SfxViewFrame::GetNext(*pPIFrame, 0, TYPE(SfxPlugInFrame)) )
+ pPIFrame->GetBindings().InvalidateAll(bModify);
+
+ for ( SfxTask* pTask = SfxTask::GetFirst(); pTask;
+ pTask = SfxTask::GetNext( *pTask ) )
+ if ( !pTask->IsExternal() )
+ pTask->GetBindings()->InvalidateAll(bModify);
+*/
+ }
+ else
+ {
+ SfxDispatcher *pDisp = GetBindings()->GetDispatcher_Impl();
+ while ( pDisp )
+ {
+ if ( pDisp == this )
+ {
+ GetBindings()->InvalidateAll( bModify );
+ break;
+ }
+
+ pDisp = pDisp->pImp->pParent;
+ }
+ }
+}
+
+sal_uInt16 SfxDispatcher::GetNextToolBox_Impl( sal_uInt16 nPos, sal_uInt16 nType, String *pStr )
+{
+ SfxShell *pShell;
+ sal_Bool bReadOnly = sal_False;
+ SfxViewFrame *pFrame = pImp->pFrame;
+ if ( pFrame )
+ {
+ SfxObjectShell *pObj = pFrame->GetObjectShell();
+ bReadOnly = !pObj || pObj->IsReadOnly();
+ }
+
+ sal_Bool bFound = sal_False;
+ SfxWorkWindow *pWorkWin = GetBindings()->GetWorkWindow_Impl();
+
+ // Wenn die aktuelle Toolbox die letzte ist, mu\s die erste zur"uckgegeben
+ // werden
+ sal_uInt16 nNext = 0;
+
+ if ( nPos != 0xFFFF )
+ {
+ SfxDispatcher *pDispat = this;
+ while ( pDispat )
+ {
+ SfxBindings* pBindings = pDispat->GetBindings();
+ if ( !pBindings || pBindings->GetWorkWindow_Impl() != pWorkWin )
+ break;
+
+ sal_uInt16 nCount = pDispat->pImp->aStack.Count();
+ // Alle interfaces auf dem Dispatcher-Stack durchsuchen
+ for ( sal_uInt16 nIdx=0; nIdx<nCount; nIdx++ )
+ {
+ pShell = pDispat->pImp->aStack.Top(nIdx);
+ const SfxInterface *pInterFace = pShell->GetInterface();
+ for ( sal_uInt16 nNo = 0; pInterFace && nNo<pInterFace->GetObjectBarCount(); ++nNo )
+ {
+ // Ist die Objectbar an der richtigen Position und sichtbar ?
+ sal_uInt16 nP = pInterFace->GetObjectBarPos(nNo);
+
+ if ( (nP & SFX_POSITION_MASK) == (nPos & SFX_POSITION_MASK) &&
+ pInterFace->IsObjectBarVisible(nNo) &&
+ ( !bReadOnly || ( nP & SFX_VISIBILITY_READONLYDOC ) ) )
+ {
+ sal_uInt16 nId = pInterFace->GetObjectBarResId(nNo).GetId();
+ if ( nId != nType )
+ {
+ // Es ist eine andere Toolbox
+ // Ist sie aktivierbar ?
+ sal_uInt32 nFeature = pInterFace->GetObjectBarFeature( nNo );
+ if ( nFeature && !pShell->HasUIFeature( nFeature ) )
+ continue;
+
+ // Kommt sie nach der aktuellen ?
+ if ( bFound )
+ {
+ // Ja, also ist sie die n"achste
+ if ( pStr )
+ *pStr = *pInterFace->GetObjectBarName( nNo );
+ return nId;
+ }
+ else if ( !nNext )
+ {
+ // Nein, aber vielleicht ist es die erste ?
+ nNext = nId;
+ if ( pStr )
+ *pStr = *pInterFace->GetObjectBarName( nNo );
+ }
+ }
+ else
+ // das ist die aktuelle!
+ bFound = sal_True;
+ }
+ }
+ }
+
+ pDispat = pDispat->pImp->pParent;
+ }
+ }
+
+ return nNext;
+}
+
+sal_Bool SfxDispatcher::IsUpdated_Impl() const
+{
+ return pImp->bUpdated;
+}
+
+void SfxDispatcher::SetDisableFlags( sal_uInt32 nFlags )
+{
+ pImp->nDisableFlags = nFlags;
+ for ( int i = int(pImp->aStack.Count()) - 1; i >= 0; --i )
+ pImp->aStack.Top( (sal_uInt16) i )->SetDisableFlags( nFlags );
+}
+
+sal_uInt32 SfxDispatcher::GetDisableFlags() const
+{
+ return pImp->nDisableFlags;
+}
+
+sal_Bool SfxDispatcher::HasSlot_Impl( sal_uInt16 nSlot )
+{
+ Flush();
+ sal_uInt16 nTotCount = pImp->aStack.Count();
+
+ if ( pImp->pParent && !pImp->pParent->pImp->pFrame )
+ {
+ // the last frame also uses the AppDispatcher
+ nTotCount += pImp->aStack.Count();
+ }
+
+ if ( SfxMacroConfig::IsMacroSlot( nSlot ) )
+ // Makro-Slot?
+ return sal_True;
+ else if (nSlot >= SID_VERB_START && nSlot <= SID_VERB_END)
+ {
+ // Verb-Slot?
+ SfxShell *pSh = 0;
+ for ( sal_uInt16 nShell = 0; pSh = GetShell(nShell); ++nShell )
+ {
+ if ( pSh->ISA(SfxViewShell) )
+ return sal_True;
+ }
+
+ return sal_False;
+ }
+
+ // SID gegen gesetzten Filter pr"ufen
+ sal_uInt16 nSlotEnableMode=0;
+ if ( pImp->pFrame )
+ {
+ nSlotEnableMode = IsSlotEnabledByFilter_Impl( nSlot );
+ if ( 0 == nSlotEnableMode )
+ return sal_False;
+ }
+
+ // im Quiet-Mode nur Parent-Dispatcher
+ if ( pImp->bQuiet )
+ return sal_False;
+
+ sal_Bool bReadOnly = ( 2 != nSlotEnableMode && pImp->bReadOnly ) ||
+ ( pImp->pFrame && pImp->pFrame->GetObjectShell() &&
+ pImp->pFrame->GetObjectShell()->IsLoading() );
+
+ for ( sal_uInt16 i=0 ; i < nTotCount; ++i )
+ {
+ SfxShell *pObjShell = GetShell(i);
+ SfxInterface *pIFace = pObjShell->GetInterface();
+ const SfxSlot *pSlot = pIFace->GetSlot(nSlot);
+ if ( pSlot && pSlot->nDisableFlags && ( pSlot->nDisableFlags & pObjShell->GetDisableFlags() ) != 0 )
+ return sal_False;
+
+ if ( pSlot && !( pSlot->nFlags & SFX_SLOT_READONLYDOC ) && bReadOnly )
+ return sal_False;
+
+ if ( pSlot )
+ {
+ // Slot geh"ort zum Container?
+ FASTBOOL bIsContainerSlot = pSlot->IsMode(SFX_SLOT_CONTAINER);
+ FASTBOOL bIsInPlace = pImp->pFrame && pImp->pFrame->ISA( SfxInPlaceFrame );
+
+ // Shell geh"ort zum Server?
+ // AppDispatcher oder IPFrame-Dispatcher
+ FASTBOOL bIsServerShell = !pImp->pFrame || bIsInPlace;
+
+ // Nat"urlich sind ServerShell-Slots auch ausf"uhrbar, wenn sie auf
+ // einem Container-Dispatcher ohne IPClient ausgef"uhrt werden sollen.
+ if ( !bIsServerShell )
+ {
+ SfxViewShell *pViewSh = pImp->pFrame->GetViewShell();
+ bIsServerShell = !pViewSh || !pViewSh->GetIPClient();
+ }
+
+ // Shell geh"ort zum Container?
+ // AppDispatcher oder kein IPFrameDispatcher
+ FASTBOOL bIsContainerShell = !pImp->pFrame || !bIsInPlace;
+
+ // Shell und Slot passen zusammen
+ if ( !( ( bIsContainerSlot && bIsContainerShell ) ||
+ ( !bIsContainerSlot && bIsServerShell ) ) )
+ pSlot = 0;
+ }
+
+ if ( pSlot && !IsAllowed( nSlot ) )
+ pSlot = NULL;
+
+ if ( pSlot )
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+
diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx
new file mode 100644
index 000000000000..2e9625af311f
--- /dev/null
+++ b/sfx2/source/control/macrconf.cxx
@@ -0,0 +1,947 @@
+/*************************************************************************
+ *
+ * $RCSfile: macrconf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#if SUPD<582
+#ifndef _SFXSFXJS_HXX //autogen
+#include <sfxjs.hxx>
+#endif
+#ifndef _SJIMPL2_HXX //autogen
+#include <sj2/sjimpl2.hxx>
+#endif
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _SBX_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#ifndef _SB_SBMETH_HXX //autogen
+#include <basic/sbmeth.hxx>
+#endif
+#ifndef _SB_SBMOD_HXX //autogen
+#include <basic/sbmod.hxx>
+#endif
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _BASIC_SBUNO_HXX
+#include <basic/sbuno.hxx>
+#endif
+
+#include <osl/mutex.hxx>
+
+#include <com/sun/star/script/XEngine.hpp>
+
+#pragma hdrstop
+
+#include "msgpool.hxx"
+#include "macrconf.hxx"
+#include "sfxbasic.hxx"
+#include "sfx.hrc"
+#include "app.hxx"
+#include "objsh.hxx"
+#include "dispatch.hxx"
+#include "minfitem.hxx"
+#include "imgmgr.hxx"
+#include "evntconf.hxx"
+#include "docfile.hxx"
+#include "genlink.hxx"
+#include <viewfrm.hxx>
+#include <appdata.hxx>
+
+static const sal_uInt16 nCompatVersion = 2;
+static const sal_uInt16 nVersion = 3;
+
+// Static member
+SfxMacroConfig* SfxMacroConfig::pMacroConfig = NULL;
+
+SfxMacroConfig* SfxMacroConfig::GetOrCreate()
+{
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( !pMacroConfig )
+ pMacroConfig = new SfxMacroConfig;
+ return pMacroConfig;
+}
+
+void SfxMacroConfig::Release_Impl()
+{
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ DELETEZ( pMacroConfig );
+}
+
+//==========================================================================
+
+struct SfxMacroConfig_Impl
+{
+ SfxMacroInfoArr_Impl aArr;
+ sal_uInt32 nEventId;
+ sal_Bool bWaitingForCallback;
+
+ SfxMacroConfig_Impl()
+ : nEventId( 0 )
+ , bWaitingForCallback( sal_False )
+ {}
+};
+
+//==========================================================================
+
+SbMethod* SfxQueryMacro_Impl( BasicManager* pMgr , const String& rMacro,
+ const String &rLibName, const String& rModule )
+{
+ const International &rInter = Application::GetAppInternational();
+
+ sal_uInt16 nLibCount = pMgr->GetLibCount();
+ for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib )
+ {
+ if ( COMPARE_EQUAL == rInter.Compare( pMgr->GetLibName( nLib ), rLibName, INTN_COMPARE_IGNORECASE ) )
+ {
+ StarBASIC* pLib = pMgr->GetLib( nLib );
+ if( !pLib )
+ {
+ pMgr->LoadLib( nLib );
+ pLib = pMgr->GetLib( nLib );
+ }
+
+ if( pLib )
+ {
+ sal_uInt16 nModCount = pLib->GetModules()->Count();
+ for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod )
+ {
+ SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod );
+ if ( pMod &&
+ COMPARE_EQUAL == rInter.Compare( pMod->GetName(), rModule, INTN_COMPARE_IGNORECASE ) )
+ {
+ SbMethod* pMethod =
+ (SbMethod*)pMod->Find( rMacro, SbxCLASS_METHOD );
+ if( pMethod )
+ return pMethod;
+ }
+ }
+ }
+ }
+ }
+ return 0;
+}
+
+SbMethod* SfxQueryMacro( BasicManager* pMgr , const String& rMacro )
+{
+ sal_uInt16 nLast = 0;
+ String aMacro = rMacro;
+ String aLibName = aMacro.GetToken( 0, '.', nLast );
+ String aModule = aMacro.GetToken( 0, '.', nLast );
+ aMacro.Erase( 0, nLast );
+
+ return SfxQueryMacro_Impl( pMgr, aMacro, aLibName, aModule );
+}
+
+ErrCode SfxCallMacro( BasicManager* pMgr, const String& rCode,
+ SbxArray *pArgs, SbxValue *pRet )
+{
+ ErrCode nErr;
+ SfxApplication *pApp = SFX_APP();
+ pApp->EnterBasicCall();
+ SbMethod* pMethod = SfxQueryMacro( pMgr, rCode );
+ if ( pMethod )
+ {
+ if ( pArgs )
+ pMethod->SetParameters( pArgs );
+ nErr = pMethod->Call( pRet );
+ }
+ else
+ nErr = ERRCODE_BASIC_PROC_UNDEFINED;
+
+ pApp->LeaveBasicCall();
+ return nErr;
+}
+
+//==========================================================================
+
+SfxMacroInfo::SfxMacroInfo( SfxObjectShell *pDoc ) :
+ bAppBasic(pDoc == NULL),
+ nSlotId(0),
+ nRefCnt(0),
+ pSlot(0),
+ pHelpText(0)
+{}
+
+//==========================================================================
+
+SfxMacroInfo::SfxMacroInfo(SfxObjectShell *pDoc, const String& rLibName,
+ const String& rModuleName, const String& rMethodName) :
+ aLibName(rLibName),
+ aModuleName(rModuleName),
+ aMethodName(rMethodName),
+ nSlotId(0),
+ nRefCnt(0),
+ pSlot(0),
+ pHelpText(0)
+{
+ bAppBasic = (pDoc == 0);
+}
+
+//==========================================================================
+
+SfxMacroInfo::SfxMacroInfo(SfxObjectShell *pDoc, const String& rQualifiedName )
+: nSlotId(0),
+ nRefCnt(0),
+ pSlot(0),
+ pHelpText(0)
+{
+ sal_uInt16 nCount = rQualifiedName.GetTokenCount('.');
+ aMethodName = rQualifiedName.GetToken( nCount-1, '.' );
+ if ( nCount > 1 )
+ aModuleName = rQualifiedName.GetToken( nCount-2, '.' );
+ if ( nCount > 2 )
+ aLibName = rQualifiedName.GetToken( 0, '.' );
+ bAppBasic = (pDoc == 0);
+}
+
+//==========================================================================
+
+SfxMacroInfo::SfxMacroInfo(SfxMacroInfo& rOther) :
+ bAppBasic(rOther.bAppBasic),
+ aLibName(rOther.aLibName),
+ aModuleName(rOther.aModuleName),
+ aMethodName(rOther.aMethodName),
+ nSlotId(rOther.nSlotId),
+ pSlot(0),
+ nRefCnt(0),
+ pHelpText(0)
+{}
+
+//==========================================================================
+
+SfxMacroInfo::~SfxMacroInfo()
+{
+ delete pSlot;
+ delete pHelpText;
+}
+
+//==========================================================================
+
+sal_Bool SfxMacroInfo::operator==(const SfxMacroInfo& rOther) const
+{
+ if ( GetQualifiedName() == rOther.GetQualifiedName() &&
+ bAppBasic == rOther.bAppBasic )
+ return sal_True;
+ else
+ return sal_False;
+}
+
+//==========================================================================
+
+String SfxMacroInfo::GetMacroName() const
+{
+ String aMacroName = aMethodName;
+ aMacroName += '(';
+ aMacroName += aLibName;
+ aMacroName += '.';
+ aMacroName += aModuleName;
+ aMacroName += ')';
+ return aMacroName;
+}
+
+//==========================================================================
+
+String SfxMacroInfo::GetQualifiedName() const
+{
+ String aMacroName;
+ if( aMacroName.Len() || aLibName.Len() )
+ {
+ // Altes Format
+ aMacroName = aLibName;
+ aMacroName += '.';
+ aMacroName += aModuleName;
+ aMacroName += '.';
+ }
+
+ // Wg. ::com::sun::star::script::JavaScript kein Zerlegen des Strings mehr
+ aMacroName += aMethodName;
+ return aMacroName;
+}
+
+String SfxMacroInfo::GetFullQualifiedName() const
+{
+ // Liefert nur Unsinn, wenn f"ur ein ::com::sun::star::script::JavaScript aufgerufen !
+ String aRet;
+ if ( bAppBasic )
+ aRet = SFX_APP()->GetName();
+ aRet += '.';
+ aRet += GetQualifiedName();
+ return aRet;
+}
+
+//==========================================================================
+
+BasicManager* SfxMacroInfo::GetBasicManager() const
+{
+ if (bAppBasic)
+ {
+ return SFX_APP()->GetBasicManager();
+ }
+ else
+ {
+ SfxObjectShell *pDocShell = SfxObjectShell::Current();
+ return pDocShell ? pDocShell->GetBasicManager() :
+ SFX_APP()->GetBasicManager();
+ }
+}
+
+//==========================================================================
+
+String SfxMacroInfo::GetBasicName() const
+{
+ if (bAppBasic)
+ {
+ return SFX_APP()->GetName();
+ }
+ else
+ {
+ SfxObjectShell *pDocShell = SfxObjectShell::Current();
+ if ( pDocShell )
+ return pDocShell->GetTitle();
+ else
+ return SFX_APP()->GetName();
+ }
+}
+
+String SfxMacroInfo::GetHelpText() const
+{
+ if ( pHelpText )
+ return *pHelpText;
+ return String();
+}
+
+String SfxMacroConfig::RequestHelp( sal_uInt16 nId )
+{
+ SfxMacroInfo *pInfo = SFX_APP()->GetMacroConfig()->GetMacroInfo( nId );
+ if ( !pInfo )
+ return String();
+
+ if ( !pInfo->pHelpText )
+ {
+ SbMethod *pMethod =
+ SfxQueryMacro_Impl( pInfo->GetBasicManager(), pInfo->aMethodName,
+ pInfo->aLibName, pInfo->aModuleName );
+ if ( pMethod && pMethod->GetInfo() )
+ pInfo->pHelpText = new String( pMethod->GetInfo()->GetComment() );
+ }
+
+ return pInfo->GetHelpText();
+}
+
+void SfxMacroInfo::SetHelpText( const String& rName )
+{
+ if ( !pHelpText )
+ pHelpText = new String;
+ *pHelpText = rName;
+}
+
+//==========================================================================
+
+SvStream& operator >> (SvStream& rStream, SfxMacroInfo& rInfo)
+{
+ sal_uInt16 nAppBasic, nFileVersion;
+ String aDocName;
+
+ rStream >> nFileVersion;
+ if ( nVersion < nCompatVersion )
+ {
+ // In der 1.Version ohne Versionskennung
+ nAppBasic = nVersion;
+ nFileVersion = 1;
+ rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8);
+ rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
+ rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
+ rStream.ReadByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
+ }
+ else
+ {
+ String aInput;
+ rStream >> nAppBasic;
+ rStream.ReadByteString(aDocName,RTL_TEXTENCODING_UTF8); // Vorsicht: kann bei AppName Unsinn sein!
+ rStream.ReadByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
+ rStream.ReadByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
+ rStream.ReadByteString(aInput,RTL_TEXTENCODING_UTF8);
+
+ if ( nFileVersion == nCompatVersion )
+ rInfo.aMethodName = aInput;
+ else
+ {
+ sal_uInt16 nCount = aInput.GetTokenCount('.');
+ rInfo.aMethodName = aInput.GetToken( nCount-1, '.' );
+ if ( nCount > 1 )
+ rInfo.aModuleName = aInput.GetToken( nCount-2, '.' );
+ if ( nCount > 2 )
+ rInfo.aLibName = aInput.GetToken( 0, '.' );
+ }
+ }
+
+ rInfo.bAppBasic = (sal_Bool) nAppBasic;
+ rInfo.nSlotId = SFX_APP()->GetMacroConfig()->GetSlotId(&rInfo);
+ return rStream;
+}
+
+//==========================================================================
+
+SvStream& operator << (SvStream& rStream, const SfxMacroInfo& rInfo)
+{
+ if ( rInfo.bAppBasic )
+ {
+ rStream << nVersion
+ << (sal_uInt16) rInfo.bAppBasic;
+ rStream.WriteByteString(rInfo.GetBasicName(),RTL_TEXTENCODING_UTF8);
+ rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
+ rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
+ rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
+ }
+ else
+ {
+ rStream << nVersion
+ << (sal_uInt16) rInfo.bAppBasic;
+ rStream.WriteByteString(SFX_APP()->GetName(),RTL_TEXTENCODING_UTF8);
+ rStream.WriteByteString(rInfo.aLibName,RTL_TEXTENCODING_UTF8);
+ rStream.WriteByteString(rInfo.aModuleName,RTL_TEXTENCODING_UTF8);
+ rStream.WriteByteString(rInfo.aMethodName,RTL_TEXTENCODING_UTF8);
+ }
+
+ return rStream;
+}
+
+sal_Bool SfxMacroInfo::Compare( const SvxMacro& rMacro ) const
+{
+ String aName = rMacro.GetLibName();
+ aName += '.';
+ aName += rMacro.GetMacName();
+ if ( GetFullQualifiedName() == aName )
+ return sal_True;
+ return sal_False;
+}
+
+//==========================================================================
+
+SfxMacroConfig::SfxMacroConfig()
+{
+ pImp = new SfxMacroConfig_Impl;
+}
+
+//==========================================================================
+
+SfxMacroConfig::~SfxMacroConfig()
+{
+ if ( pImp->nEventId )
+ Application::RemoveUserEvent( pImp->nEventId );
+ delete pImp;
+}
+
+//==========================================================================
+
+SFX_STATE_STUB( SfxApplication, MacroState_Impl )
+SFX_EXEC_STUB( SfxApplication, MacroExec_Impl )
+
+sal_uInt16 SfxMacroConfig::GetSlotId(SfxMacroInfoPtr pInfo)
+{
+ sal_uInt16 nCount = pImp->aArr.Count(); // Macro suchen
+ sal_uInt16 i;
+ for (i=0; i<nCount; i++)
+ if ((*(pImp->aArr)[i]) == (*pInfo))
+ break;
+
+ if (i == nCount)
+ { // Macro noch unbekannt
+ nCount = aIdArray.Count();
+ sal_uInt16 n;
+ for (n=0; n<nCount; n++) // freie SlotId suchen
+ if (aIdArray[n] > SID_MACRO_START + n)
+ break;
+
+ sal_uInt16 nNewSlotId = SID_MACRO_START + n;
+ if ( nNewSlotId > SID_MACRO_END )
+ return 0;
+ aIdArray.Insert( SID_MACRO_START + n, n );
+
+ SfxSlot *pNewSlot = new SfxSlot;
+ pNewSlot->nSlotId = SID_MACRO_START + n;
+ pNewSlot->nGroupId = 0;
+ pNewSlot->nFlags = SFX_SLOT_ASYNCHRON;
+ pNewSlot->nMasterSlotId = 0;
+ pNewSlot->nValue = 0;
+ pNewSlot->fnExec = SFX_STUB_PTR(SfxApplication,MacroExec_Impl);
+ pNewSlot->fnState = SFX_STUB_PTR(SfxApplication,MacroState_Impl);
+ pNewSlot->pType = 0; HACK(SFX_TYPE(SfxVoidItem))
+ pNewSlot->pName = pNewSlot->pMethodName = U2S(pInfo->aMethodName).getStr();
+ pNewSlot->pLinkedSlot = 0;
+ pNewSlot->nArgDefCount = 0;
+ pNewSlot->pFirstArgDef = 0;
+ pNewSlot->pUnoName = 0;
+
+ if (nCount)
+ {
+ SfxSlot *pSlot = (pImp->aArr)[0]->pSlot;
+ pNewSlot->pNextSlot = pSlot->pNextSlot;
+ pSlot->pNextSlot = pNewSlot;
+ }
+ else
+ pNewSlot->pNextSlot = pNewSlot;
+
+ // Macro uebernehmen
+ SfxMacroInfoPtr pNewInfo = new SfxMacroInfo(*pInfo);
+ pNewInfo->nSlotId = SID_MACRO_START + n;
+ pImp->aArr.Insert(pNewInfo,n);
+ pNewInfo->pSlot = pNewSlot;
+ pInfo->nSlotId = pNewInfo->nSlotId;
+ pNewInfo->nRefCnt++;
+ }
+ else
+ {
+ pInfo->nSlotId = (pImp->aArr)[i]->nSlotId;
+ (pImp->aArr)[i]->nRefCnt++;
+ }
+
+ return pInfo->nSlotId;
+}
+
+//==========================================================================
+
+void SfxMacroConfig::ReleaseSlotId(sal_uInt16 nId)
+{
+ DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!");
+
+ sal_uInt16 nCount = pImp->aArr.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
+ {
+ SfxMacroInfo *pInfo = (pImp->aArr)[i];
+ if (pInfo->nSlotId == nId)
+ {
+ pInfo->nRefCnt--;
+ if (pInfo->nRefCnt == 0)
+ {
+ // Slot wird nicht mehr referenziert, also holen
+ SfxSlot *pSlot = pInfo->pSlot;
+
+ // Slot aus der Verkettung rausnehmen
+ while (pSlot->pNextSlot != pInfo->pSlot)
+ pSlot = (SfxSlot*) pSlot->pNextSlot;
+ pSlot->pNextSlot = pInfo->pSlot->pNextSlot;
+
+ // Slot selbst kurz schlie\sen
+ pSlot = pInfo->pSlot;
+ pSlot->pNextSlot = pSlot;
+
+ // MacroInfo aus Array entfernen, damit sie kein Unheil
+ // anrichten kann
+ pImp->aArr.Remove(i);
+
+ // SlotId wieder freigeben
+ sal_uInt16 nCount = aIdArray.Count();
+ for (sal_uInt16 n=0; n<nCount; n++)
+ {
+ if (aIdArray[n] == nId)
+ {
+ aIdArray.Remove(n);
+ break;
+ }
+ }
+
+ // Falls ein Image belegt wwurde, kann das jetzt wieder frei
+ // gegeben werden (wenn nicht aus dtor gerufen, da ist der
+ // ImageManager schon weg)
+ SfxImageManager *pImgMgr = SFX_IMAGEMANAGER();
+ if (pImgMgr)
+ pImgMgr->ReplaceImage(nId, 0);
+
+ // Sofern nicht die Applikation heruntergefahren wird, mu\s
+ // der Slot asynchron gel"oscht werden, falls er in seinem
+ // eigenen Execute abgeschossen wird!
+ if ( !SFX_APP()->IsDowning() )
+ pImp->nEventId = Application::PostUserEvent( LINK(this, SfxMacroConfig, EventHdl_Impl), pInfo );
+ else
+ EventHdl_Impl( pInfo );
+ }
+ return;
+ }
+ }
+
+ DBG_ERROR("Macro-SlotId nicht gefunden!");
+}
+
+//==========================================================================
+
+void SfxMacroConfig::RegisterSlotId(sal_uInt16 nId)
+{
+ DBG_ASSERT( IsMacroSlot( nId ), "SlotId ist kein Macro!");
+
+ sal_uInt16 nCount = pImp->aArr.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
+ {
+ if ((pImp->aArr)[i]->nSlotId == nId)
+ {
+ (pImp->aArr)[i]->nRefCnt++;
+ return;
+ }
+ }
+
+ DBG_ERROR("Macro-SlotId nicht gefunden!");
+}
+
+//==========================================================================
+
+const SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo(sal_uInt16 nId) const
+{
+ sal_uInt16 nCount = pImp->aArr.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
+ if ((pImp->aArr)[i]->nSlotId == nId)
+ return (pImp->aArr)[i];
+
+ return 0;
+}
+
+//==========================================================================
+
+const SfxMacroInfoPtr SfxMacroConfig::GetMacroInfo_Impl( const SvxMacro *pMacro ) const
+{
+ sal_uInt16 nCount = pImp->aArr.Count();
+ for (sal_uInt16 i=0; i<nCount; i++)
+ if ((pImp->aArr)[i]->Compare(*pMacro) )
+ return (pImp->aArr)[i];
+ return 0;
+}
+
+//==========================================================================
+
+sal_Bool SfxMacroConfig::ExecuteMacro( sal_uInt16 nId, const String& rArgs ) const
+{
+ const SfxMacroInfoPtr pInfo = GetMacroInfo( nId );
+ if ( !pInfo )
+ return sal_False;
+
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+
+ SvxMacro aMacro( pInfo->GetQualifiedName(), pInfo->GetBasicName(), STARBASIC );
+ sal_Bool bRet = ExecuteMacro( pSh, &aMacro, rArgs );
+
+ // Release, da im Dispatcher-Execute ein Register gemacht wurde
+ ((SfxMacroConfig*)this)->ReleaseSlotId( nId );
+ return bRet;
+}
+
+sal_Bool SfxMacroConfig::ExecuteMacro( SfxObjectShell *pSh, const SvxMacro* pMacro, const String& rArgs ) const
+{
+ SfxApplication *pApp = SFX_APP();
+
+ // Name des Macros oder Scripts bzw. ScriptCode
+ String aCode( pMacro->GetMacName() );
+ ErrCode nErr = ERRCODE_NONE;
+
+ // Ist es ein Basic-Macro ?
+ ScriptType eSType = pMacro->GetScriptType();
+ sal_Bool bIsBasic = eSType == STARBASIC;
+ sal_Bool bIsStarScript = ( eSType == EXTENDED_STYPE && pMacro->GetLibName().SearchAscii( "StarScript" ) != STRING_NOTFOUND );
+ sal_Bool bIsBasicLibBased = bIsBasic || bIsStarScript || !pSh;
+
+#if SUPD<582
+ if ( !bIsBasicLibBased && pSh && pApp->GetIniManager()->IsJavaScriptEnabled() )
+ {
+ // AB: #49303# hier muss Window als this gesetzt werden
+ SfxJS* pJS = pSh->GetMedium()->GetJavaScript();
+ SjJScriptWindowObject* pWindow = pJS ? pJS->GetWindowObject() : NULL;
+
+ Link aLink = LINK( this, SfxMacroConfig, CallbackHdl_Impl );
+ pImp->bWaitingForCallback = sal_True;
+ nErr = pSh->CallJavaScript( *pMacro, pWindow, &aLink );
+ sal_uInt32 nTicks = Time::GetSystemTicks();
+ nTicks += 5000;
+ while ( pImp->bWaitingForCallback && nTicks > Time::GetSystemTicks() )
+ Application::Yield();
+ pImp->bWaitingForCallback = sal_False;
+ return nErr != ERRCODE_NONE;
+ }
+ else
+#endif
+
+ if ( bIsBasicLibBased )
+ {
+ pApp->EnterBasicCall();
+ BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
+ if( bIsBasic )
+ {
+ // BasicManager von Document?
+ BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
+
+ // Da leider der Name zwischendurch h"aufig gewechselt hat ...
+ if( SFX_APP()->GetName() == pMacro->GetLibName() ||
+ pMacro->GetLibName().EqualsAscii("StarDesktop") )
+ pMgr = pAppMgr;
+ else if ( pMgr == pAppMgr )
+ pMgr = NULL;
+
+ if ( pSh && pMgr && pMgr == pAppMgr )
+ {
+/*
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pSh, 0, sal_False );
+ SbxVariable *pDocVar = pAppMgr->GetLib(0)->Find( "ThisDocument", SbxCLASS_PROPERTY );
+ if ( pDocVar )
+ pDocVar->PutObject( pSh->GetSbxObject() );
+
+ SbxVariable *pWinVar = pAppMgr->GetLib(0)->Find( "ThisWindow", SbxCLASS_PROPERTY );
+ if ( pWinVar )
+ pWinVar->PutObject( pFrame->GetSbxObject() );
+*/
+ SFX_APP()->Get_Impl()->pThisDocument = pSh;
+ SbxVariable *pCompVar = pAppMgr->GetLib(0)->Find( DEFINE_CONST_UNICODE("ThisComponent"), SbxCLASS_PROPERTY );
+ if ( pCompVar )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInterface ( pSh->GetModel() , ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Any aAny;
+ aAny <<= xInterface;
+ pCompVar->PutObject( GetSbUnoObject( DEFINE_CONST_UNICODE("ThisComponent"), aAny ) );
+ }
+
+ nErr = Call( 0, aCode, pMgr );
+
+ SFX_APP()->Get_Impl()->pThisDocument = NULL;
+/*
+ if ( pDocVar )
+ pDocVar->PutObject( NULL );
+ if ( pWinVar )
+ pWinVar->PutObject( NULL );
+ */
+ if ( pCompVar )
+ pCompVar->PutObject( NULL );
+ }
+ else if ( pMgr )
+ nErr = Call( 0, aCode, pMgr );
+ else
+ nErr = SbxERR_NO_METHOD;
+
+ }
+#if SUPD<582
+ else if( bIsStarScript )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xSource;
+
+ // Haben wir eine Shell?
+ if( pSh )
+ {
+ // dann dort callen
+ nErr = pSh->CallScript( pMacro->GetLibName(), aCode, xSource, NULL, NULL );
+ }
+ else
+ {
+ // ::com::sun::star::script::Engine von der Standard-Bibliothek anfordern
+ StarBASIC* pStdLib = pAppMgr->GetStdLib();
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngine > xEngine= pStdLib->getEngine( pAppMgr );
+ SfxMacroConfig::CallStarScript( xEngine, aCode, xSource, NULL, NULL );
+ }
+ }
+#endif
+ pApp->LeaveBasicCall();
+ }
+ else
+ {
+ nErr = SbxERR_NO_METHOD;
+ }
+
+ return ( nErr == ERRCODE_NONE );
+}
+
+sal_Bool SfxMacroConfig::CheckMacro( SfxObjectShell *pSh, const SvxMacro* pMacro ) const
+{
+ SfxApplication *pApp = SFX_APP();
+
+ // Name des Macros oder Scripts bzw. ScriptCode
+ String aCode( pMacro->GetMacName() );
+ ErrCode nErr = ERRCODE_NONE;
+
+#if SUPD<582
+ // Ist es ein Basic-Macro ?
+ sal_Bool bIsBasic = pMacro->GetScriptType() == STARBASIC;
+ if ( !bIsBasic )
+ return pSh != NULL;
+#endif
+
+ // BasicManager von Document oder Application
+ pApp->EnterBasicCall();
+ BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
+ BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
+
+ // Da leider der Name zwischendurch h"aufig gewechselt hat ...
+ if( SFX_APP()->GetName() == pMacro->GetLibName() ||
+ pMacro->GetLibName().EqualsAscii("StarDesktop") )
+ pMgr = pAppMgr;
+ else if ( pMgr == pAppMgr )
+ pMgr = NULL;
+
+ if ( !pMgr || !SfxQueryMacro( pMgr, aCode ) )
+ nErr = SbxERR_NO_METHOD;
+ pApp->LeaveBasicCall();
+ return ( nErr == ERRCODE_NONE );
+}
+
+//==========================================================================
+
+sal_Bool SfxMacroConfig::CheckMacro( sal_uInt16 nId ) const
+{
+ const SfxMacroInfoPtr pInfo = GetMacroInfo( nId );
+ if ( !pInfo )
+ return sal_False;
+
+ // Basic nur initialisieren, wenn default nicht ::com::sun::star::script::JavaScript; dann mu\s
+ // in IsBasic() sowieso das Basic angelegt werden
+ SfxObjectShell* pSh = SfxObjectShell::Current();
+
+ SfxApplication *pApp = SFX_APP();
+ pApp->EnterBasicCall();
+
+ // BasicManager von Document oder Application
+ BasicManager *pAppMgr = SFX_APP()->GetBasicManager();
+ BasicManager *pMgr = pSh ? pSh->GetBasicManager() : NULL;
+
+ if( SFX_APP()->GetName() == pInfo->GetBasicName() )
+ pMgr = SFX_APP()->GetBasicManager();
+ else if ( pMgr == pAppMgr )
+ pMgr = NULL;
+
+ String aFull( pInfo->GetQualifiedName() );
+ sal_Bool bIsBasic = pMgr ? IsBasic( 0, aFull, pMgr ) : sal_False;
+ pApp->LeaveBasicCall();
+ return bIsBasic;
+}
+
+//==========================================================================
+
+IMPL_LINK( SfxMacroConfig, CallbackHdl_Impl, SfxMacroConfig*, pConfig )
+{
+ pImp->bWaitingForCallback = sal_False;
+ return 0;
+}
+
+IMPL_LINK( SfxMacroConfig, EventHdl_Impl, SfxMacroInfo*, pInfo )
+{
+ delete pInfo;
+ pImp->nEventId = 0;
+ return 0;
+}
+
+sal_Bool SfxMacroConfig::IsBasic( SbxObject* pVCtrl, const String& rCode, BasicManager* pMgr )
+{
+ sal_Bool bFound;
+ SFX_APP()->EnterBasicCall();
+ bFound = SfxQueryMacro( pMgr, rCode ) != 0;
+ SFX_APP()->LeaveBasicCall();
+ return bFound;
+}
+
+ErrCode SfxMacroConfig::Call( SbxObject* pVCtrl,
+ const String& rCode, BasicManager* pMgr, SbxArray *pArgs, SbxValue *pRet )
+{
+ SfxApplication *pApp = SFX_APP();
+ pApp->EnterBasicCall();
+ SbMethod* pMethod = SfxQueryMacro( pMgr, rCode );
+ ErrCode nErr = 0;
+ if( pMethod )
+ {
+ if ( pArgs )
+ pMethod->SetParameters( pArgs );
+ nErr = pMethod->Call( pRet );
+ }
+ else
+ nErr = ERRCODE_BASIC_PROC_UNDEFINED;
+
+ pApp->LeaveBasicCall();
+ return nErr;
+}
+
+#if SUPD<582
+void SfxMacroConfig::CallStarScript( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngine > & rxEngine, const String & rCode,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rSource, void *pArgs, void *pRet )
+{
+ static String aCallPrefix( "();" );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > aArgs;
+ if( pArgs )
+ aArgs = *(::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > *)pArgs;
+
+ // HACK!!! TODO: Klaeren, wie das wirklich laufen soll
+ String aCode = rCode;
+ aCode += aCallPrefix;
+
+ ::rtl::OUString aUCode = StringToOUString( aCode, RTL_TEXTENCODING_UTF8 );
+ if ( pRet )
+ {
+ *((::com::sun::star::uno::Any*)pRet) = rxEngine->run( aUCode, rSource, aArgs );
+ }
+ else
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::script::XEngineListener > xCB;
+ rxEngine->runAsync( aUCode, rSource, aArgs, xCB );
+ }
+}
+#endif
+
+sal_Bool SfxMacroConfig::IsMacroSlot( sal_uInt16 nId )
+{
+ return ( nId >= SID_MACRO_START && nId <= SID_MACRO_END );
+}
+
+
diff --git a/sfx2/source/control/macro.cxx b/sfx2/source/control/macro.cxx
new file mode 100644
index 000000000000..8affc5acfa37
--- /dev/null
+++ b/sfx2/source/control/macro.cxx
@@ -0,0 +1,858 @@
+/*************************************************************************
+ *
+ * $RCSfile: macro.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _ARGS_HXX //autogen
+#include <svtools/args.hxx>
+#endif
+
+#ifndef _SBXVAR_HXX //autogen
+#include <svtools/sbxvar.hxx>
+#endif
+#pragma hdrstop
+
+#include <app.hxx>
+#include <module.hxx>
+#include <shell.hxx>
+#include <request.hxx>
+#include <objsh.hxx>
+#include <viewsh.hxx>
+#include <viewfrm.hxx>
+#include <msg.hxx>
+#include <macro.hxx>
+#include <sfxtypes.hxx>
+
+//====================================================================
+
+SV_DECL_PTRARR_DEL( SfxStatements_Impl, SfxMacroStatement*, 16, 8 );
+SV_IMPL_PTRARR( SfxStatements_Impl, SfxMacroStatement* );
+TYPEINIT1(SfxMacroItem,SfxPoolItem);
+
+//--------------------------------------------------------------------
+
+struct SfxMacro_Impl
+
+/* [Beschreibung]
+
+ Implementations-Struktur der Klasse <SfxMacro>.
+*/
+
+{
+ SfxMacroMode eMode; /* Zweck der <SfxMacro>-Instanz,
+ Bedeutung siehe enum <SfxMacroMode> */
+ SfxStatements_Impl aList; /* Liste von aufgezeichneten Statements */
+ USHORT nObjNo; // Durchnumerierung der SbxObjects
+};
+
+//====================================================================
+
+SfxMacroStatement::SfxMacroStatement
+(
+ const SfxShell& rShell, // <SfxShell>, die den Request ausf"uhrte
+ const String& rTarget, // Name des Zielobjektes vor der Ausf"urhung
+ BOOL bAbsolute, // obsolet
+ const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann
+ BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt
+ SfxArguments* pArguments // aktuelle Parameter (werden "ubernommen)
+)
+
+/* [Beschreibung]
+
+ Dieser Konstruktor der Klasse SfxMacroStatement erzeugt ein Statement,
+ bei dem ein Objekt angesprochen wird, welches durch 'rShell' angegeben
+ ist. Dabei erfolgt die Addressierung je nach 'bAbsolute' absolut,
+ also z.B. als '[mydoc.sdc]' oder relativ, also z.B. 'ActiveDocument'.
+
+ Je nach Art der Subklasse von 'rShell' ergeben sich folgende
+ Ausdr"ucke:
+
+ |absolut relativ
+ -----------------------------------------------------------------------
+ SfxApplication' | 'StarCalc' 'Application'
+ SfxViewFrame' |'[mydoc.sdc:1]' 'ActiveWindow'
+ SfxViewShell' | '[mydoc.sdc:1]' 'AvtiveWindow'
+ SfxObjectShell' | '[mydoc.sdc]' 'ActiveDocument'
+ sonstige (Sub-Shells) | '[mydoc.sdc:1]' 'ActiveWindow'
+
+ Dabei sind 'StarCalc' stellvertretend fr den Namen der Applikation
+ (Application::GetAppName()const). In der absoluten Fassung k"onnte
+ die Selektion auch deskriptiv z.B. als 'CellSelection("A5-D8")')
+ angesprochen werden, dazu mu\ jedoch vom Anwendungsprogrammierer der
+ Konstruktor <SfxMacroStatement::SfxMacroStatement(const String&,
+ const SfxSlot&,BOOL,SfxArguments*)> verwendet werden.
+
+ F"ur das so bezeichnete Objekt wird dann je nach Typ des Slots
+ eine Zuweisung an eines seiner Properties oder der Aufruf einer seiner
+ Methoden ausgedr"uckt.
+
+
+ [Beispiele]
+
+ absolut:
+ SCalc3.OpenDocument( "\docs\mydoc.sdd", "StarDraw Presentation", 0, 0 )
+ [mydoc.sdd].Activate()
+ [mydoc.sdd:1].SwitchToView( 2 )
+ [mydoc.sdc:1:1].CellSelection( "A5-D8" ).LineColor = 192357
+
+ relativ:
+ ActiveWindow.LineColor = 192357
+
+
+ [Querverweise]
+
+ <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)>
+ <SfxMacroStatement::SfxMacroStatement(const String&)>
+*/
+
+: nSlotId( rSlot.GetSlotId() ),
+ pArgs( pArguments ),
+ bDone( bRequestDone ),
+ pDummy( 0 )
+{
+ // Workaround Recording nicht exportierter Slots (#25386#)
+ if ( !rSlot.pName )
+ return;
+
+ // Objekt-Typ bestimmen
+ FASTBOOL bIsApp = rShell.ISA(SfxApplication);
+ FASTBOOL bIsDoc = rShell.ISA(SfxObjectShell);
+ FASTBOOL bIsWin = !bIsApp && !bIsDoc &&
+ ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) );
+ FASTBOOL bIsSel = !bIsApp && !bIsDoc && !bIsWin;
+
+ // Objekt nicht schon im Slot-Namen enthalten?
+ if ( bIsSel || rSlot.pName[0] == '.' )
+ {
+ // absolutes Aufzeichnen?
+ if ( rSlot.IsMode( SFX_SLOT_RECORDABSOLUTE ) )
+ {
+ // an der Applikation oder am Modul
+ if ( rShell.ISA(SfxApplication) || rShell.ISA(SfxModule) )
+ aStatement = rTarget;
+
+ // am Dokument?
+ // '[' = 5Bh
+ // ']' = 5Dh
+ else if ( rShell.ISA(SfxObjectShell) )
+ {
+ aStatement = 0x005B;
+ aStatement += rTarget;
+ aStatement += 0x005D;
+ }
+
+ else if ( rShell.ISA(SfxViewFrame) )
+ {
+ aStatement = 0x005B;
+ aStatement += rShell.GetSbxObject()->GetName();
+ aStatement += 0x005D;
+ }
+
+ else
+ {
+ // an der View oder Sub-Shell
+ SfxViewShell *pViewShell = rShell.GetViewShell();
+ aStatement = 0x005B;
+ aStatement += pViewShell->GetViewFrame()->GetSbxObject()->GetName();
+ aStatement += 0x005D;
+ if ( !rShell.ISA(SfxViewFrame) )
+ // an einer Sub-Shell zus"atlich .Selection anh"angen
+ aStatement += DEFINE_CONST_UNICODE(".Selection");
+ }
+ }
+ else // relatives Aufzeichnen
+ {
+ // an der Application?
+ if ( rShell.ISA(SfxApplication) )
+ aStatement = DEFINE_CONST_UNICODE("Application");
+
+ // am Modul?
+ else if ( rShell.ISA(SfxModule) )
+ aStatement = DEFINE_CONST_UNICODE("ActiveModule");
+
+ // am Dokument
+ else if ( rShell.ISA(SfxObjectShell) )
+ aStatement = DEFINE_CONST_UNICODE("ActiveDocument");
+
+ // am Window
+ else if ( rShell.ISA(SfxViewShell) || rShell.ISA(SfxViewFrame) )
+ aStatement = DEFINE_CONST_UNICODE("ActiveWindow");
+
+ else
+ // an einer Sub-Shell
+ aStatement = DEFINE_CONST_UNICODE("Selection");
+ }
+ }
+/*
+ if ( bIsSel )
+ {
+ // bei Selection ggf. noch den Namen der SubShell anh"angen
+ const SfxShellObject *pShObj =
+ (const SfxShellObject*) rShell.GetSbxObject();
+ if ( pShObj )
+ {
+ const SfxShellObject *pParentObj =
+ (const SfxShellObject*) pShObj->GetParent();
+ SfxShell *pParentSh = pParentObj->GetShell();
+ DBG_ASSERT( pParentSh->ISA(SfxViewFrame),
+ "parent of SubShell must be a Frame" );
+ if ( rSlot.pName[0] == '.' )
+ {
+ aStatement += '.';
+ aStatement += rShell.GetSbxObject()->GetName();
+ }
+ }
+ else
+ DBG_ASSERT( rSlot.pName[0] != '0', "recording unnamed object" );
+ }
+*/
+ // an diesen Objekt-Ausdruck den Methoden-/Property-Namen und Parameter
+ GenerateNameAndArgs_Impl( SfxRequest::GetRecordingMacro(),
+ rSlot, bRequestDone, pArgs);
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroStatement::SfxMacroStatement
+(
+ const String& rTarget, // Objekt, was beim Playing angesprochen wird
+ const SfxSlot& rSlot, // der <SfxSlot>, der das Statement abspielen kann
+ BOOL bRequestDone, // wurde der Request tats"achlich ausgef"uhrt
+ SfxArguments* pArguments // aktuelle Parameter (werden "ubernommen)
+)
+
+/* [Beschreibung]
+
+
+ [Querverweise]
+
+ <SfxMacroStatement::SfxMacroStatement(const String&)>
+ <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)>
+*/
+
+: nSlotId( rSlot.GetSlotId() ),
+ pArgs( pArguments ),
+ bDone( bRequestDone ),
+ pDummy( 0 )
+{
+ aStatement = rTarget;
+ aStatement += 0x002E; // '.' = 2Eh
+ GenerateNameAndArgs_Impl( SfxRequest::GetRecordingMacro(),
+ rSlot, bRequestDone, pArgs);
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroStatement::SfxMacroStatement
+(
+ const String& rStatement // manuell erzeugte(s) Statement(s)
+)
+
+/* [Beschreibung]
+
+ Dieser Konstruktor erzeugt eine SfxMacroStatement-Instanz, deren
+ Aufbau vollst"andig vom Applikationsentwickler bestimmt wird. Da der
+ angegebene String auch mehrere mit CR/LF getrennte Statements
+ enthalten darf, ist damit ein weitgehender Eingriff in das Aufzeichnen
+ von BASIC-Makros m"oglich, um Spezialf"alle zu behandeln.
+
+
+ [Querverweise]
+
+ <SfxMacroStatement::SfxMacroStatement(const String&,const SfxSlot&,BOOL,SfxArguments*)>
+ <SfxMacroStatement::SfxMacroStatement(const SfxShell&,BOOL,const SfxSlot&,BOOL,SfxArguments*)>
+*/
+
+: aStatement( rStatement ),
+ nSlotId( 0 ),
+ pArgs( 0 ),
+ bDone( TRUE ),
+ pDummy( 0 )
+{
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroStatement::SfxMacroStatement
+(
+ const SfxMacroStatement& rOrig // Original, von dem kopiert wird
+)
+
+/* [Beschreibung]
+
+ Copy-Konstruktor der SfxMacroStatement-Klasse.
+*/
+
+: aStatement( rOrig.aStatement ),
+ nSlotId( rOrig.nSlotId ),
+ pArgs( 0 ),
+ bDone( rOrig.bDone ),
+ pDummy( 0 )
+{
+ if ( rOrig.pArgs )
+ pArgs = new SfxArguments( *rOrig.pArgs );
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroStatement::~SfxMacroStatement()
+
+/* [Beschreibung]
+
+ Destruktor der Klasse SfxMacroStatement. Gibt die Liste der
+ aktuellen Parameter frei.
+*/
+
+{
+ delete pArgs;
+}
+
+//--------------------------------------------------------------------
+
+void SfxMacroStatement::GenerateNameAndArgs_Impl
+(
+ SfxMacro* pMacro, // darin wird aufgezeichnet
+ const SfxSlot& rSlot, // der Slot, der das Statement abspielen kann
+ BOOL bRequestDone, // TRUE=wurde ausgef"uhrt, FALSE=abgebrochen
+ SfxArguments* pArgs // die aktuellen Parameter
+)
+
+/* [Beschreibung]
+
+ Interne Hilfsmethode zum generieren des Funktions-/Property-Names
+ sowie der Parameter. Diese Methode wird nur verwendet, wenn der
+ Anwendungsprogrammierer keinen eigenen Source an den <SfxRequest>
+ geh"angt hat.
+*/
+
+{
+ // . zwsischen Object und Prop/Meth-Name
+ // '.' = 2Eh
+ if ( aStatement.Len() && aStatement.GetChar( aStatement.Len() - 1 ) != 0x002E &&
+ rSlot.pName[0] != 0x002E )
+ aStatement += 0x002E;
+
+ // der Name des Slots ist der Name der Methode / des Properties
+ aStatement += String::CreateFromAscii(rSlot.pName);
+ if ( rSlot.IsMode(SFX_SLOT_METHOD) )
+ aStatement += DEFINE_CONST_UNICODE("( ");
+ else
+ aStatement += DEFINE_CONST_UNICODE(" = ");
+
+ // alle zusammengesuchten Parameter rausschreiben
+ if ( pArgs && pArgs->Count() ) // Abfrage doppelt wegen BLC-Bug
+ for ( USHORT nArg = 0; nArg < pArgs->Count(); ++nArg )
+ {
+ // den Parameter textuell darstellen
+ String aArg;
+ const SbxVariable& rVar = pArgs->Get(nArg);
+ switch ( rVar.GetType() & (2*SbxUSERn+1) )
+ {
+ case SbxEMPTY:
+ case SbxNULL:
+ // kein Argument
+ break;
+
+ case SbxSTRING:
+ {
+ // Anf"uhrungszeichen werden verdoppelt
+ XubString aRecordable( rVar.GetString() );
+ USHORT nPos = 0;
+ while ( TRUE )
+ {
+ nPos = aRecordable.SearchAndReplace( DEFINE_CONST_UNICODE('"'), DEFINE_CONST_UNICODE("\"\""), nPos );
+ if ( STRING_NOTFOUND == nPos )
+ break;
+ nPos += 2;
+ }
+
+ // nicht druckbare Zeichen werden als chr$(...) geschrieben
+ FASTBOOL bPrevReplaced = FALSE;
+ for ( USHORT n = 0; n < aRecordable.Len(); ++n )
+ {
+ sal_Unicode cChar = aRecordable.GetChar(n);
+ if ( !( cChar>=32 && cChar!=127 ) ) // ALS ERSATZ FUER String::IsPrintable()!
+ {
+ XubString aReplacement( DEFINE_CONST_UNICODE("+chr$(") );
+ aReplacement += cChar;
+
+ if ( bPrevReplaced )
+ {
+ aRecordable.Insert( aReplacement, n - 2 );
+ n += aReplacement.Len();
+ aRecordable.SetChar((unsigned short) (n-2), 0x0029);// ')' = 29h
+ aRecordable.Replace( n-1, 2, DEFINE_CONST_UNICODE("+\"") );
+ // ++n;
+ }
+ else
+ {
+ aReplacement += DEFINE_CONST_UNICODE(")+\"");
+ aRecordable.SetChar(n, 0x0022 );// '"' = 22h
+ aRecordable.Insert( aReplacement, n + 1 );
+ n += aReplacement.Len();
+ }
+ bPrevReplaced = TRUE;
+ }
+ else
+ bPrevReplaced = FALSE;
+ }
+
+ // Argument in Anf"uhrungszeichen
+ aArg = 0x0022; // '"' = 22h
+ aArg += aRecordable;
+ aArg += 0x0022;
+ break;
+ }
+
+ case SbxBOOL:
+ {
+ // symbolisch als TRUE und FALSE
+ aArg = rVar.GetBool() ? DEFINE_CONST_UNICODE("TRUE") : DEFINE_CONST_UNICODE("FALSE");
+ break;
+ }
+
+ case SbxBYTE:
+ {
+ // als Zahl darstellen
+ aArg = (USHORT) rVar.GetByte();
+ break;
+ }
+
+ case SbxOBJECT:
+ {
+ HACK(only an experimental implementation)
+ SbxObjectRef xObj = (SbxObject*) rVar.GetObject();
+
+ // einen Objektnamen generieren
+ String aObjectName( 'a' );
+ aObjectName += xObj->GetClassName();
+ aObjectName += pMacro->NextObjectNo();
+
+ // das Objekt mit Daten belegen
+ String aObjectDef( DEFINE_CONST_UNICODE("\nDIM ") );
+ aObjectDef += aObjectName;
+ aObjectDef += DEFINE_CONST_UNICODE(" AS NEW ");
+ aObjectDef += xObj->GetClassName();
+ aObjectDef += DEFINE_CONST_UNICODE("\nWITH ");
+ aObjectDef += aObjectName;
+ aObjectDef += DEFINE_CONST_UNICODE("\n");
+ aObjectDef += xObj->GenerateSource( DEFINE_CONST_UNICODE("\t"), 0 );
+ aObjectDef += DEFINE_CONST_UNICODE("\nEND WITH\n");
+ aStatement.Insert( aObjectDef, 0 );
+ aObjectDef += DEFINE_CONST_UNICODE("\n\n");
+
+ // Objektname als Parameter anh"angen
+ aArg = aObjectName;
+ break;
+ }
+
+ default:
+ // alles andere als String ohne Anf"uhrungszeichen
+ aArg = rVar.GetString();
+ }
+
+ // den Parameter anh"angen
+ aStatement += aArg;
+ aStatement += DEFINE_CONST_UNICODE(", ");
+ }
+
+ // Statement beeden
+ if ( pArgs && pArgs->Count() )
+ aStatement.Erase( aStatement.Len() - 2, 1 );
+ else
+ aStatement.Erase( aStatement.Len() - 1, 1 );
+ if ( rSlot.IsMode(SFX_SLOT_METHOD) )
+ aStatement += 0x0029; // ')' = 29h
+
+ if ( !bRequestDone )
+ // nicht als "Done()" gekennzeichnete Statements auskommentieren
+ aStatement.InsertAscii( "rem ", 0 );
+}
+
+//--------------------------------------------------------------------
+
+SfxMacro::SfxMacro
+(
+ SfxMacroMode eMode // Zweck der Instanz, siehe <SfxMacroMode>
+)
+
+/* [Beschreibung]
+
+ Konstruktor der Klasse SfxMacro. Instanzen dieser Klasse werden im
+ SFx zu zwei Zwecken ben"otigt:
+
+ 1. zum Aufzeichnen von Makros
+ In diesem Fall wird der Konstruktor mit SFX_MACRO_RECORDINGABSOLUTE
+ oder SFX_MACRO_RECORDINGRELATIVE aufgerufen. Es sollte sich um eine
+ Instanz einer abgeleiteten Klasse handeln, um in der Ableitung
+ die Information dar"uber unterzubringen, wo das Makro gespeichert
+ werden soll. Ein solches Makro solle sich dann in seinem Destruktor
+ an der vom Benutzer gew"ahlten Stelle speichern.
+
+ 2. zum Zuordnen von exisitierenden Makros
+ In diesem Fall wird der Konstruktor mit SFX_MACRO_EXISTING aufgerufen.
+ Eine solche Instanz wird z.B. ben"otigt, wenn Makros auf Events
+ oder <SfxControllerItem>s konfiguriert werden sollen.
+*/
+
+: pImp( new SfxMacro_Impl )
+
+{
+ pImp->eMode = eMode;
+ pImp->nObjNo = 0;
+}
+
+//--------------------------------------------------------------------
+
+SfxMacro::~SfxMacro()
+
+/* [Beschreibung]
+
+ Virtueller Destruktor der Klasse SfxMacro. Dieser sollte in den
+ abgeleiteten Klassen "uberladen werden, um in den Modi
+ SFX_MACRO_RECORDINGABSOLUTE und SFX_MACRO_RECORDINGRELATIVE den
+ aufgezeichneten Source abzuspeichern.
+
+
+ [Querverweise]
+
+ <SfxMacro::GenerateSource()const>
+*/
+
+{
+#ifdef DBG_UTIL
+#ifdef MAC
+ SvFileStream aStream( DEFINE_CONST_UNICODE("record.bas"), STREAM_STD_WRITE );
+#else
+ SvFileStream aStream( DEFINE_CONST_UNICODE("/tmp/record.bas"), STREAM_STD_WRITE );
+#endif
+ aStream.WriteLine( ByteString(U2S(GenerateSource())) );
+#endif
+ delete pImp;
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroMode SfxMacro::GetMode() const
+
+/* [Beschreibung]
+
+ Liefert den Modus, der besagt zu welchem Zweck das SfxMacro konstruiert
+ wurde.
+
+
+ [Querverweise]
+
+ enum <SfxMacroMode>
+*/
+
+{
+ return pImp->eMode;
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxMacro::NextObjectNo()
+
+/* [Beschreibung]
+
+ Liefert eine Nummer, die als Namens-Erweiterung f"ur SbxObjects,
+ die per DIM angelegt werden m"ussen, verwendet werden kann. Bei jedem
+ Abfragen kommt eine um 1 erh"ohte Nummer zur"uck, die in diesem Makro
+ einmalig ist.
+*/
+
+{
+ return ++pImp->nObjNo;
+}
+
+//--------------------------------------------------------------------
+
+void SfxMacro::Record
+(
+ SfxMacroStatement* pStatement // aufzuzeichnendes <SfxMacroStatement>
+)
+
+/* [Beschreibung]
+
+ Diese Methode zeichnet das als Parameter "ubergeben Statement auf.
+ Die Instanz auf die der "ubergebe Pointer zeigt, geht in das Eigentum
+ des SfxMacro "uber.
+
+ Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt,
+ welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE
+ konstruiert wirde.
+
+
+ [Querverweise]
+
+ <SfxMacro::Replace(SfxMacroStatement*)>
+ <SfxMacro::Remove()>
+ <SfxMacro::GetLastStatement()const>
+*/
+
+{
+ DBG_ASSERT( pImp->eMode != SFX_MACRO_EXISTING,
+ "invalid call to non-recording SfxMacro" );
+ pImp->aList.C40_INSERT( SfxMacroStatement, pStatement, pImp->aList.Count() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxMacro::Replace
+(
+ SfxMacroStatement* pStatement // aufzuzeichnendes <SfxMacroStatement>
+)
+
+/* [Beschreibung]
+
+ Diese Methode zeichnet das als Parameter "ubergeben Statement auf.
+ Dabei wird das jeweils zuletzt aufgezeichnete Statement "uberschrieben.
+ Die Instanz auf die der "ubergebe Pointer zeigt, geht in das Eigentum
+ des SfxMacro "uber.
+
+ Mit dieser Methode ist es m"oglich, Statements zusammenzufassen. Z.B.
+ anstelle f"unfmal hintereinander 'CursorLeft()' aufzurufen, k"onnte
+ das zu 'CursorLeft(5)' zusammengefa\st werden. Oder anstelle ein Wort
+ Buchstabe f"ur Buchstabe aufzubauen, k"onnte dies durch ein einziges
+ Statement 'InsertString("Hallo")' ersetzt werden.
+
+ Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt,
+ welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE
+ konstruiert wurde und bereits ein aufgezeichnetes Statement vorhanden
+ ist.
+
+
+ [Anmerkung]
+
+ Diese Methode wird typischerweise aus den Execute-Methoden der
+ <SfxSlot>s von den Applikationsentwicklern gerufen.
+
+
+ [Querverweise]
+
+ <SfxMacro::Record(SfxMacroStatement*)>
+ <SfxMacro::Remove()>
+ <SfxMacro::GetLastStatement()const>
+*/
+
+{
+ DBG_ASSERT( pImp->eMode != SFX_MACRO_EXISTING,
+ "invalid call to non-recording SfxMacro" );
+ DBG_ASSERT( pImp->aList.Count(), "no replaceable statement available" )
+ pImp->aList.Remove( pImp->aList.Count() - 1 );
+ pImp->aList.C40_INSERT( SfxMacroStatement,pStatement, pImp->aList.Count() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxMacro::Remove()
+
+/* [Beschreibung]
+
+ Diese Methode l"oscht das zuletzt aufgezeichnete <SfxMacroStatement>
+ und entfernt es aus dem Macro.
+
+ Mit dieser Methode ist es m"oglich, Statements zusammenzufassen. Z.B.
+ anstelle f"unfmal hintereinander 'CursorLeft()' aufzurufen, k"onnte
+ das zu 'CursorLeft(5)' zusammengefa\st werden. Oder anstelle ein Wort
+ Buchstabe f"ur Buchstabe aufzubauen, k"onnte dies durch ein einziges
+ Statement 'InsertString("Hallo")' ersetzt werden.
+
+ Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt,
+ welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE
+ konstruiert wurde und bereits ein aufgezeichnetes Statement vorhanden
+ ist.
+
+
+ [Anmerkung]
+
+ Diese Methode wird typischerweise aus den Execute-Methoden der
+ <SfxSlot>s von den Applikationsentwicklern gerufen.
+
+
+ [Querverweise]
+
+ <SfxMacro::Replace(SfxMacroStatement*)>
+ <SfxMacro::Record(SfxMacroStatement*)>
+ <SfxMacro::GetLastStatement()const>
+*/
+
+{
+ DBG_ASSERT( pImp->eMode != SFX_MACRO_EXISTING,
+ "invalid call to non-recording SfxMacro" );
+ DBG_ASSERT( pImp->aList.Count(), "no replaceable statement available" )
+ pImp->aList.Remove( pImp->aList.Count() - 1 );
+}
+
+//--------------------------------------------------------------------
+
+const SfxMacroStatement* SfxMacro::GetLastStatement() const
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann auf das jeweils zuletzt aufgezeichnete Statement
+ lesend zugegriffen werden. Zusammen mit der Methode
+ <SfxMacro::Replace(SfxMacroStatement*)> ergibt sich dadurch die
+ M"oglichkeit, Statements zusammenzufassen.
+
+ Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt,
+ welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE
+ konstruiert wurde.
+
+
+ [Querverweise]
+
+ <SfxMacro::Record(SfxMacroStatement*)>
+ <SfxMacro::Replace(SfxMacroStatement*)>
+*/
+
+{
+ DBG_ASSERT( pImp->eMode != SFX_MACRO_EXISTING,
+ "invalid call to non-recording SfxMacro" );
+ if ( pImp->aList.Count() )
+ return pImp->aList.GetObject( pImp->aList.Count() - 1 );
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+String SfxMacro::GenerateSource() const
+
+/* [Beschreibung]
+
+ Diese Funktion generiert aus den, seit dem Konstruieren der Instanz
+ bis zum Zeitpunkt des Aufrufs dieser Methode aufgezeichneten
+ <SfxMacroStatement>s einen BASIC-Sourcecode, der die Statements,
+ jedoch nicht den Header ('Sub X') und den Footer ('End Sub') enth"alt.
+
+
+ [Querverweise]
+
+ <SfxMacro::Record(SfxMacroStatement*)>
+ <SfxMacro::Repeat(SfxMacroStatement*)>
+*/
+
+{
+ DBG_ASSERT( pImp->eMode != SFX_MACRO_EXISTING,
+ "invalid call to non-recording SfxMacro" );
+ String aSource;
+ for ( USHORT n = 0; n < pImp->aList.Count(); ++n )
+ {
+ aSource += pImp->aList.GetObject(n)->GetStatement();
+ if ( (n+1) < pImp->aList.Count() )
+ aSource += DEFINE_CONST_UNICODE("\n");
+ }
+
+ return aSource;
+}
+
+//--------------------------------------------------------------------
+
+SbxError SfxMacro::Call
+(
+ SbxArray* pArgs // aktuelle Parameter f"ur den Aufruf
+)
+
+/* [Beschreibung]
+
+ Diese Methode sollte von Suklassen "uberladen werden, damit der
+ SFx das in der Ableitung beschriebene BASIC-Programm rufen kann,
+ wenn es an ein Event oder in einem Controller gebunden ist.
+
+ Der Aufruf ist nur g"ultig, wenn es sich um ein SfxMacro handelt,
+ welches mit SFX_MACRO_RECORDINGABSOLUTE oder SFX_MACRO_RECORDINGRELATIVE
+ konstruiert wurde.
+
+ Die Basisimplementierung liefert immer SbxERR_NOTIMP zur"uck.
+
+
+ [Anmerkung]
+
+ I.d.R. ist pArgs == 0, der Parameter ist f"ur Zuk"unftige Erweiterungen
+ gedacht.
+*/
+
+{
+ return SbxERR_NOTIMP;
+}
+
+//--------------------------------------------------------------------
+
+SfxMacroItem::SfxMacroItem( USHORT nWhich, SfxMacro *pTheMacro )
+: SfxPoolItem( nWhich ),
+ pMacro( pTheMacro )
+{
+}
+
+//--------------------------------------------------------------------
+
+SfxPoolItem* SfxMacroItem::Clone( SfxItemPool *pPool ) const
+{
+ return new SfxMacroItem( Which(), pMacro );
+}
+
+//--------------------------------------------------------------------
+
+int SfxMacroItem::operator==( const SfxPoolItem &rOther ) const
+{
+ return pMacro == ((const SfxMacroItem&)rOther).pMacro;
+}
+
+
diff --git a/sfx2/source/control/makefile.mk b/sfx2/source/control/makefile.mk
new file mode 100644
index 000000000000..53723b82cebf
--- /dev/null
+++ b/sfx2/source/control/makefile.mk
@@ -0,0 +1,120 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=control
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# w.g. compilerbugs
+.IF "$(GUI)"=="WNT"
+CFLAGS+=-Od
+.ENDIF
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ unoctitm.cxx \
+ macro.cxx \
+ request.cxx \
+ dispatch.cxx \
+ ctrlitem.cxx \
+ statcach.cxx \
+ msgpool.cxx \
+ shell.cxx \
+ objface.cxx \
+ msg.cxx \
+ bindings.cxx \
+ macrconf.cxx \
+ minfitem.cxx \
+ srchitem.cxx \
+ $(PROJECTPCHSOURCE).cxx
+
+SLOFILES = \
+ $(SLO)$/unoctitm.obj \
+ $(SLO)$/request.obj \
+ $(SLO)$/dispatch.obj \
+ $(SLO)$/msgpool.obj \
+ $(SLO)$/objface.obj \
+ $(SLO)$/ctrlitem.obj \
+ $(SLO)$/statcach.obj \
+ $(SLO)$/shell.obj \
+ $(SLO)$/msg.obj \
+ $(SLO)$/bindings.obj \
+ $(SLO)$/minfitem.obj \
+ $(SLO)$/srchitem.obj \
+ $(SLO)$/macrconf.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/control/minfitem.cxx b/sfx2/source/control/minfitem.cxx
new file mode 100644
index 000000000000..9a6735d7a9c8
--- /dev/null
+++ b/sfx2/source/control/minfitem.cxx
@@ -0,0 +1,136 @@
+/*************************************************************************
+ *
+ * $RCSfile: minfitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#pragma hdrstop
+
+#include "minfitem.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+TYPEINIT1(SfxMacroInfoItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+SfxMacroInfoItem::SfxMacroInfoItem(USHORT nWhich, // Slot-ID
+ const BasicManager* pMgr,
+ const String &rLibName,
+ const String &rModuleName,
+ const String &rMethodName,
+ const String &rComment) :
+ SfxPoolItem(nWhich),
+ pBasicManager(pMgr),
+ aLibName(rLibName),
+ aModuleName(rModuleName),
+ aMethodName(rMethodName),
+ aCommentText(rComment)
+{
+}
+
+// -----------------------------------------------------------------------
+
+// copy ctor
+
+SfxMacroInfoItem::SfxMacroInfoItem(const SfxMacroInfoItem& rCopy):
+ SfxPoolItem(rCopy),
+ pBasicManager(rCopy.pBasicManager),
+ aLibName(rCopy.aLibName),
+ aModuleName(rCopy.aModuleName),
+ aMethodName(rCopy.aMethodName),
+ aCommentText(rCopy.aCommentText)
+{
+}
+
+// -----------------------------------------------------------------------
+
+// op ==
+
+int SfxMacroInfoItem::operator==( const SfxPoolItem& rCmp) const
+{
+ return SfxPoolItem::operator==(rCmp) &&
+ pBasicManager == ((const SfxMacroInfoItem&)rCmp).pBasicManager &&
+ aLibName == ((const SfxMacroInfoItem&)rCmp).aLibName &&
+ aModuleName == ((const SfxMacroInfoItem&)rCmp).aModuleName &&
+ aMethodName == ((const SfxMacroInfoItem&)rCmp).aMethodName &&
+ aCommentText == ((const SfxMacroInfoItem&)rCmp).aCommentText;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem *SfxMacroInfoItem::Clone( SfxItemPool *) const
+{
+ return new SfxMacroInfoItem(*this);
+}
+
+// -----------------------------------------------------------------------
+
+String SfxMacroInfoItem::GetQualifiedName() const
+{
+ String aMacroName = aLibName;
+ aMacroName += '.';
+ aMacroName += aModuleName;
+ aMacroName += '.';
+ aMacroName += aMethodName;
+ return aMacroName;
+}
+
+
diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx
new file mode 100644
index 000000000000..028f05b17a5d
--- /dev/null
+++ b/sfx2/source/control/msg.cxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: msg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#pragma hdrstop
+
+#include "msg.hxx"
+
+//====================================================================
+
+SfxSlotKind SfxSlot::GetKind() const
+{
+ if( !nMasterSlotId && !nValue)
+ return (SfxSlotKind) SFX_KIND_STANDARD;
+ if ( nMasterSlotId && fnExec==0 && fnState==0 )
+ {
+ if ( pType->Type() == TYPE(SfxBoolItem) )
+ return (SfxSlotKind) SFX_KIND_ENUM;
+ else
+ {
+ DBG_ERROR( "invalid slot kind detected" );
+ return SFX_KIND_ENUM;
+ }
+ }
+ else
+ return (SfxSlotKind) SFX_KIND_ATTR;
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxSlot::GetWhich( const SfxItemPool &rPool ) const
+{
+ if ( !nMasterSlotId || nMasterSlotId == USHRT_MAX )
+ ((SfxSlot*) this) -> nMasterSlotId = rPool.GetWhich(nSlotId);
+ return nMasterSlotId;
+}
+
+
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
new file mode 100644
index 000000000000..6e98f8e9e074
--- /dev/null
+++ b/sfx2/source/control/msgpool.cxx
@@ -0,0 +1,627 @@
+/*************************************************************************
+ *
+ * $RCSfile: msgpool.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#ifndef _RSCSFX_HXX //autogen
+#include <rsc/rscsfx.hxx>
+#endif
+#pragma hdrstop
+
+#include "msgpool.hxx"
+#include "minarray.hxx"
+#include "msg.hxx"
+#include "app.hxx"
+#include "objface.hxx"
+#include "idpool.hxx"
+#include "sfxtypes.hxx"
+#include "slotinfo.hxx"
+#include "macrconf.hxx"
+#include "sfxresid.hxx"
+#include "arrdecl.hxx"
+
+#include "sfx.hrc"
+
+//====================================================================
+
+struct SfxSIDRegistration_Impl
+{
+ String _aGroup;
+ String _aName;
+ USHORT _nSID;
+};
+
+struct SfxSlotType_Impl
+{
+ USHORT nId;
+ TypeId nType;
+
+ SfxSlotType_Impl( USHORT nTheId, TypeId nTheType ):
+ nId(nTheId), nType(nTheType)
+ {}
+};
+
+DECL_2BYTEARRAY(SfxSlotGroupArr_Impl, USHORT, 6, 4);
+DECL_PTRARRAY(SfxInterfaceArr_Impl, SfxInterface*, 6, 3);
+DECL_PTRARRAY(SfxSlotTypeArr_Impl, SfxSlotType_Impl*, 8, 8);
+
+
+//====================================================================
+
+SfxSlotPool::SfxSlotPool( SfxSlotPool *pParent, ResMgr* pResManager )
+ : _pParentPool( pParent )
+ , _pIdPool(0)
+ , _pTypes(0)
+ , _pGroups(0)
+ , _nCurGroup(0)
+ , _pInterfaces(0)
+ , _nCurInterface(0)
+ , _nCurMsg(0)
+ , _pResMgr( pResManager )
+ , _pUnoSlots( 0 )
+{
+ if ( !_pResMgr )
+ _pResMgr = Resource::GetResManager();
+}
+
+//====================================================================
+
+SfxSlotPool::~SfxSlotPool()
+{
+ _pParentPool = 0;
+ for ( SfxInterface *pIF = FirstInterface(); pIF; pIF = FirstInterface() )
+ delete pIF;
+ delete _pInterfaces;
+ delete _pGroups;
+ delete _pUnoSlots;
+ if ( _pTypes )
+ {
+ for ( USHORT n =_pTypes->Count(); n--; )
+ delete _pTypes->GetObject(n);
+ delete _pTypes;
+ }
+ delete _pIdPool;
+}
+
+//====================================================================
+
+// registers the availability of the Interface of functions
+
+void SfxSlotPool::RegisterInterface( SfxInterface& rInterface )
+{
+ DBG_MEMTEST();
+
+ // add to the list of SfxObjectInterface instances
+ if ( _pInterfaces == 0 )
+ _pInterfaces = new SfxInterfaceArr_Impl;
+ _pInterfaces->Append(&rInterface);
+
+ // bei einem (einzelnen) Null-Slot abbrechen (aus syntaktischen Gr"unden
+ // enthalten interfaces immer mindestens einen Slot)
+ if ( rInterface.Count() == 1 && !rInterface[0]->nSlotId )
+ return;
+
+ // possibly add Interface-id and group-ids of funcs to the list of groups
+ if ( !_pGroups )
+ {
+ _pGroups = new SfxSlotGroupArr_Impl;
+
+ if ( _pParentPool )
+ {
+ // Die Groups im parent Slotpool sind auch hier bekannt
+ SfxSlotGroupArr_Impl& rGroups = *_pParentPool->_pGroups;
+ for ( USHORT n=0; n<rGroups.Count(); n++ )
+ _pGroups->Append( rGroups[n] );
+ }
+ }
+
+ if ( !_pTypes )
+ _pTypes = new SfxSlotTypeArr_Impl;
+ for ( USHORT nFunc = 0; nFunc < rInterface.Count(); ++nFunc )
+ {
+ SfxSlot *pDef = rInterface[nFunc];
+ if ( pDef->GetUnoName() )
+ {
+ if ( !_pUnoSlots )
+ _pUnoSlots = new SfxSlotArr_Impl;
+ _pUnoSlots->Insert( pDef, _pUnoSlots->Count() );
+ }
+
+ if ( pDef->GetGroupId() && /* pDef->GetGroupId() != GID_INTERN && */
+ !_pGroups->Contains(pDef->GetGroupId()) )
+ {
+ if (pDef->GetGroupId() == GID_INTERN)
+ _pGroups->Insert(0, pDef->GetGroupId());
+ else
+ _pGroups->Append(pDef->GetGroupId());
+ }
+
+ const TypeId &rTypeId = pDef->GetType()->Type();
+ if ( rTypeId != TYPE(SfxVoidItem) && rTypeId != 0 )
+ {
+ USHORT nPos;
+ for ( nPos = 0; nPos < _pTypes->Count(); ++nPos )
+ {
+ if ( _pTypes->GetObject(nPos)->nId == pDef->GetSlotId() )
+ {
+ DBG_ASSERT( rTypeId == _pTypes->GetObject(nPos)->nType,
+ "same slot id with unequal item types" );
+ }
+ else if ( _pTypes->GetObject(nPos)->nId > pDef->GetSlotId() )
+ break;
+ }
+ if ( nPos >= _pTypes->Count() ||
+ _pTypes->GetObject(nPos)->nId > pDef->GetSlotId() )
+ _pTypes->Append( new SfxSlotType_Impl( pDef->GetSlotId(), rTypeId ) );
+ }
+ }
+}
+
+//====================================================================
+
+TypeId SfxSlotPool::GetSlotType( USHORT nId ) const
+{
+ for ( USHORT nPos = 0; nPos < _pTypes->Count(); ++nPos )
+ {
+ if ( _pTypes->GetObject(nPos)->nId == nId )
+ return _pTypes->GetObject(nPos)->nType;
+ }
+ return _pParentPool ? _pParentPool->GetSlotType( nId ) : 0;
+}
+
+//====================================================================
+
+// unregisters the availability of the Interface of functions
+
+void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces, "releasing SfxInterface, but there are none" );
+ // remove from the list of SfxInterface instances
+ _pInterfaces->Remove(&rInterface);
+}
+
+//--------------------------------------------------------------------
+
+// get the first SfxMessage for a special Id (e.g. for getting check-mode)
+
+const SfxSlot* SfxSlotPool::GetSlot( USHORT nId )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+
+ // Zun"achst die eigenen Interfaces absuchen
+ for ( USHORT nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf )
+ {
+ const SfxSlot *pDef =
+ _pInterfaces->GetObject(nInterf)->GetSlot(nId);
+ if ( pDef )
+ return pDef;
+ }
+
+ // Dann beim eventuell vorhandenen parent versuchen
+ return _pParentPool ? _pParentPool->GetSlot( nId ) : 0;
+}
+
+//--------------------------------------------------------------------
+
+// returns the pool of unused ids for macros, menus etc.
+
+IdPool& SfxSlotPool::GetIdPool()
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0 && _pInterfaces->Count(),
+ "no Interfaces registered" );
+
+ if ( !_pIdPool )
+ {
+ _pIdPool = new IdPool();
+
+ // create a set of all registered function-ids
+ BitSet aRegIds;
+ for ( USHORT nInterface = 0; nInterface < _pInterfaces->Count(); ++nInterface )
+ {
+ SfxInterface* pInterface = (*_pInterfaces)[nInterface];
+ for ( USHORT nFunc = 0; nFunc < pInterface->Count(); ++nFunc )
+ aRegIds |= (*pInterface)[nFunc]->GetGroupId();
+ }
+
+ //lock all registered ids
+ _pIdPool->Lock(aRegIds);
+ }
+
+ return *_pIdPool;
+}
+
+
+//--------------------------------------------------------------------
+
+// stores the id persistent to a stream (expand macros-names)
+
+void SfxSlotPool::StoreId( SvStream& rStream, USHORT nId )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+
+ rStream << nId;
+ //! later: write 0 and macro-lib/name
+}
+
+
+//--------------------------------------------------------------------
+
+// load a persistent id from a stream (assign id if a macro)
+
+void SfxSlotPool::LoadId( SvStream& rStream, USHORT &rId )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+
+ rStream >> (unsigned short&) rId;
+}
+
+
+//--------------------------------------------------------------------
+
+// skips to the next group
+
+String SfxSlotPool::SeekGroup( USHORT nNo )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+
+ // if the group exists, use it
+ if ( _pGroups && nNo < _pGroups->Count() )
+ {
+ _nCurGroup = nNo;
+ if ( _pParentPool )
+ {
+ // Meistens stimmt die Reihenfolge der Ids "uberein
+ USHORT nParentCount = _pParentPool->_pGroups->Count();
+ if ( nNo < nParentCount && (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[nNo] )
+ _pParentPool->_nCurGroup = nNo;
+ else
+ {
+ // Ansonsten mu\s gesucht werden
+ // Wenn die Gruppe im parent pool nicht gefunden wird, wird
+ // _nCurGroup au\serhalb des g"ultigen Bereiches gesetzt
+ USHORT i;
+ for ( i=1; i<nParentCount; i++ )
+ if ( (*_pGroups)[nNo] == (*_pParentPool->_pGroups)[i] )
+ break;
+ _pParentPool->_nCurGroup = i;
+ }
+ }
+
+ SfxResId aResId( (*_pGroups)[_nCurGroup] );
+ aResId.SetRT(RSC_STRING);
+ if ( !aResId.GetResMgr()->IsAvailable(aResId) )
+ {
+ DBG_ERROR( "GroupId-Name nicht im SFX definiert!" );
+ return String();
+ }
+
+ return String( aResId );
+ }
+
+ return String();
+}
+
+
+//--------------------------------------------------------------------
+
+USHORT SfxSlotPool::GetGroupCount()
+{
+ return _pGroups->Count();
+}
+
+
+//--------------------------------------------------------------------
+
+// internal search loop
+
+const SfxSlot* SfxSlotPool::SeekSlot( USHORT nStartInterface )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+
+ // Die Numerierung der interfaces startet beim parent pool
+ USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0;
+
+ // sind wir am Ende des Parent-Pools angekommen?
+ if ( nStartInterface < nFirstInterface &&
+ _pParentPool->_nCurGroup >= _pParentPool->_pGroups->Count() )
+ nStartInterface = nFirstInterface;
+
+ // liegt das Interface noch im Parent-Pool?
+ if ( nStartInterface < nFirstInterface )
+ {
+ DBG_ASSERT( _pParentPool, "Kein parent pool!" );
+ _nCurInterface = nStartInterface;
+ return _pParentPool->SeekSlot( nStartInterface );
+ }
+
+ // find the first func-def with the current group id
+ USHORT nCount = _pInterfaces->Count() + nFirstInterface;
+ for ( _nCurInterface = nStartInterface;
+ _nCurInterface < nCount;
+ ++_nCurInterface )
+ {
+ SfxInterface* pInterface = (*_pInterfaces)[_nCurInterface-nFirstInterface];
+ for ( _nCurMsg = 0;
+ _nCurMsg < pInterface->Count();
+ ++_nCurMsg )
+ {
+ const SfxSlot* pMsg = (*pInterface)[_nCurMsg];
+ if ( pMsg->GetGroupId() == _pGroups->GetObject(_nCurGroup) )
+ return pMsg;
+ }
+ }
+
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+// skips to the next func in the current group
+
+const SfxSlot* SfxSlotPool::NextSlot()
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+
+ // Die Numerierung der interfaces startet beim parent pool
+ USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0;
+
+ if ( _nCurInterface < nFirstInterface && _nCurGroup >= _pParentPool->_pGroups->Count() )
+ _nCurInterface = nFirstInterface;
+
+ if ( _nCurInterface < nFirstInterface )
+ {
+ DBG_ASSERT( _pParentPool, "Kein parent pool!" );
+ const SfxSlot *pSlot = _pParentPool->NextSlot();
+ _nCurInterface = _pParentPool->_nCurInterface;
+ if ( pSlot )
+ return pSlot;
+ if ( _nCurInterface == nFirstInterface )
+ // parent pool ist fertig
+ return SeekSlot( nFirstInterface );
+ }
+
+ USHORT nInterface = _nCurInterface - nFirstInterface;
+ // possibly we are already at the end
+ if ( nInterface >= _pInterfaces->Count() )
+ return 0;
+
+ // look for further matching func-defs within the same Interface
+ SfxInterface* pInterface = (*_pInterfaces)[nInterface];
+ while ( ++_nCurMsg < pInterface->Count() )
+ {
+ SfxSlot* pMsg = (*pInterface)[_nCurMsg];
+ if ( pMsg->GetGroupId() == _pGroups->GetObject(_nCurGroup) )
+ return pMsg;
+ }
+
+ return SeekSlot(++_nCurInterface );
+}
+
+
+//--------------------------------------------------------------------
+
+// SlotName erfragen, gfs. mit HilfeText
+
+String SfxSlotPool::GetSlotName_Impl(USHORT nId, String *pHelpText) const
+{
+ // ist es eine Makro-SlotId?
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ {
+ const SfxMacroInfo *pMacro = SFX_APP()->GetMacroConfig()->GetMacroInfo(nId);
+ if ( pMacro )
+ return pMacro->GetMacroName();
+ else
+ return String();
+ }
+
+ // Zun"achst den eigenen ResManager testen, dann evtl. den des parent pools
+ ResId aResId( nId, _pResMgr );
+ aResId.SetRT( RSC_SFX_SLOT_INFO );
+ if( !Resource::GetResManager()->IsAvailable( aResId ) && _pParentPool )
+ aResId.SetResMgr( _pParentPool->_pResMgr );
+ if( Resource::GetResManager()->IsAvailable( aResId ) )
+ {
+ SfxSlotInfo aInfo(aResId);
+ if(pHelpText)
+ *pHelpText = aInfo.GetHelpText();
+ return aInfo.GetName();
+ }
+
+#ifdef DBG_UTIL
+ String aError(DEFINE_CONST_UNICODE("Slot ohne ConfigName: "));
+ aError += String::CreateFromInt32( nId );
+// DBG_ERROR( aError );
+ return aError;
+#endif
+ return String();
+}
+
+
+//--------------------------------------------------------------------
+
+// SlotName erfragen, gfs. mit HilfeText
+
+String SfxSlotPool::GetSlotHelpText_Impl(USHORT nId) const
+{
+ String aHelpText;
+ GetSlotName_Impl( nId, &aHelpText );
+ return aHelpText;
+}
+
+//--------------------------------------------------------------------
+#ifdef STARBASIC
+
+
+// assignes a request-id for a specific macro
+
+USHORT SfxSlotPool::RegisterMacro( sbToken aToken )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pInterfaces != 0, "no Interfaces registered" );
+ DBG_ASSERT( TRUE, "not implemented - call MI" );
+ return 0;
+}
+
+
+//--------------------------------------------------------------------
+
+// frees the request-id of a specific macro
+
+void SfxSlotPool::ReleaseMacro( sbToken aToken )
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( pInterfaces != 0, "no Interfaces registered" );
+ DBG_ASSERT( TRUE, "not implemented - call MI" );
+}
+
+#endif
+
+//--------------------------------------------------------------------
+
+SfxInterface* SfxSlotPool::FirstInterface()
+{
+ _nCurInterface = 0;
+ if ( !_pInterfaces || !_pInterfaces->Count() )
+ return 0;
+ return _pParentPool ? _pParentPool->FirstInterface() : (*_pInterfaces)[0];
+}
+
+
+//--------------------------------------------------------------------
+
+SfxInterface* SfxSlotPool::NextInterface()
+{
+ _nCurInterface++;
+ USHORT nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0;
+ if ( _nCurInterface < nFirstInterface )
+ return (*_pParentPool->_pInterfaces)[_nCurInterface];
+ USHORT nInterface = _nCurInterface - nFirstInterface;
+ return nInterface < _pInterfaces->Count() ? (*_pInterfaces)[nInterface] : 0;
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxSlotPool::RegisterSID( const String &rGroup, const String &rName )
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxSlotPool::ReleaseSID( const String &rGroup, const String &rName )
+{
+}
+
+const SfxSlot* SfxSlotPool::GetUnoSlot( USHORT nId )
+{
+ const SfxSlot *pSlot = NULL;
+ if ( _pParentPool )
+ pSlot = _pParentPool->GetUnoSlot( nId );
+
+ if ( !pSlot && _pUnoSlots )
+ {
+ USHORT nCount = _pUnoSlots->Count();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ if ( (*_pUnoSlots)[n]->GetSlotId() == nId )
+ {
+ pSlot = (*_pUnoSlots)[n];
+ break;
+ }
+ }
+ }
+
+ return pSlot;
+}
+
+const SfxSlot* SfxSlotPool::GetUnoSlot( const String& rName )
+{
+ const SfxSlot *pSlot = NULL;
+ if ( _pParentPool )
+ pSlot = _pParentPool->GetUnoSlot( rName );
+
+ if ( !pSlot && _pUnoSlots )
+ {
+ USHORT nCount = _pUnoSlots->Count();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ if ( rName.EqualsAscii((*_pUnoSlots)[n]->GetUnoName()) )
+ {
+ pSlot = (*_pUnoSlots)[n];
+ break;
+ }
+ }
+ }
+
+ return pSlot;
+}
+
+
+
diff --git a/sfx2/source/control/objface.cxx b/sfx2/source/control/objface.cxx
new file mode 100644
index 000000000000..15b8d55a2753
--- /dev/null
+++ b/sfx2/source/control/objface.cxx
@@ -0,0 +1,1427 @@
+/*************************************************************************
+ *
+ * $RCSfile: objface.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdlib.h>
+
+#ifndef _TOOLS_RCID_H
+#include <tools/rcid.h>
+#endif
+#pragma hdrstop
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#include "module.hxx"
+#include "objface.hxx"
+#include "msg.hxx"
+#include "msgpool.hxx"
+#include "cfgitem.hxx"
+#include "sfxresid.hxx"
+#include "minarray.hxx"
+#include "cfgmgr.hxx"
+#include "tbxmgr.hxx"
+#ifdef _PROXYSHELL_VERWENDEN
+#include "bindings.hxx" // fuer ProxyInterface
+#include "dispatch.hxx" // fuer ProxyInterface
+#endif
+
+DBG_NAME(SfxInterface);
+
+static const USHORT nVersion = 5;
+
+//====================================================================
+
+EXTERN_C
+#if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC ))
+int _stdcall
+#else
+#ifdef WNT
+int _cdecl
+#else
+int
+#endif
+#endif
+
+SfxCompareSlots_Impl( const void* pSmaller, const void* pBigger )
+{
+ DBG_MEMTEST();
+ return ( (int) ((SfxSlot*)pSmaller)->GetSlotId() ) -
+ ( (int) ((SfxSlot*)pBigger)->GetSlotId() );
+}
+
+//=========================================================================
+
+struct SfxObjectUI_Impl
+{
+ USHORT nPos;
+ USHORT nInterfaceId;
+ ResId aResId;
+ BOOL bVisible;
+ BOOL bContext;
+ String* pName;
+ ULONG nFeature;
+
+ SfxObjectUI_Impl(USHORT n, const ResId& rResId, BOOL bVis, ULONG nFeat,
+ USHORT nClassId=0xFFFF) :
+ nPos(n),
+ aResId(rResId.GetId(), rResId.GetResMgr()),
+ nInterfaceId(nClassId),
+ bVisible(bVis),
+ pName(0),
+ bContext(FALSE),
+ nFeature(nFeat)
+ {
+ aResId.SetRT(rResId.GetRT());
+ }
+
+ ~SfxObjectUI_Impl()
+ {
+ delete pName;
+ }
+};
+
+DECL_PTRARRAY(SfxObjectUIArr_Impl, SfxObjectUI_Impl*, 2, 2);
+
+struct SfxInterface_Impl
+{
+ SfxObjectUIArr_Impl* pObjectBars; // registered ObjectBars
+ SfxObjectUIArr_Impl* pObjectMenues; // registered ObjectMenues
+ SfxObjectUIArr_Impl* pChildWindows; // registered ChildWindows
+ ResId aPopupRes; // registered PopupMenu
+ ResId aStatBarRes; // registered StatusBar
+ SfxModule* pModule;
+
+ SfxInterface_Impl() :
+ aPopupRes((USHORT)0),
+ aStatBarRes((USHORT)0)
+ {
+ pObjectBars = new SfxObjectUIArr_Impl;
+ pObjectMenues = new SfxObjectUIArr_Impl;
+ pChildWindows = new SfxObjectUIArr_Impl;
+ }
+
+ ~SfxInterface_Impl()
+ {
+ USHORT n;
+ for (n=0; n<pObjectBars->Count(); n++)
+ delete (*pObjectBars)[n];
+ delete pObjectBars;
+
+ for (n=0; n<pObjectMenues->Count(); n++)
+ delete (*pObjectMenues)[n];
+ delete pObjectMenues;
+
+ for (n=0; n<pChildWindows->Count(); n++)
+ delete (*pChildWindows)[n];
+ delete pChildWindows;
+ }
+};
+
+//====================================================================
+
+class SfxIFConfig_Impl : public SfxConfigItem
+{
+friend class SfxInterface;
+ USHORT nCount;
+ SfxInterface* pIFace;
+ SfxObjectUIArr_Impl* pObjectBars;
+
+public:
+ SfxIFConfig_Impl(USHORT nClassId, SfxInterface *pIF);
+ virtual ~SfxIFConfig_Impl();
+ virtual int Load(SvStream&);
+ virtual BOOL Store(SvStream&);
+ virtual String GetName() const
+ { if (pIFace->HasName()) return pIFace->GetName();
+ else return String(); }
+ virtual void UseDefault();
+ void SaveDefaults(USHORT);
+};
+
+//-------------------------------------------------------------------------
+
+SfxIFConfig_Impl::SfxIFConfig_Impl(USHORT nClassId, SfxInterface *pIF) :
+ SfxConfigItem(SFX_ITEMTYPE_INTERFACE_START + nClassId),
+ nCount(0),
+ pObjectBars(0),
+ pIFace(pIF)
+{
+ SetInternal(TRUE);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxIFConfig_Impl::SaveDefaults(USHORT nClassId)
+{
+ if ( pObjectBars )
+ return;
+
+ pObjectBars = new SfxObjectUIArr_Impl;
+
+ for (nCount=0; nCount < pIFace->pImpData->pObjectBars->Count(); nCount++)
+ {
+ SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(
+ pIFace->GetObjectBarPos(nCount),
+ pIFace->GetObjectBarResId(nCount),
+ pIFace->IsObjectBarVisible(nCount),
+ pIFace->GetObjectBarFeature(nCount),
+ nClassId);
+
+ pObjectBars->Append(pUI);
+ pUI->pName = new String(*pIFace->GetObjectBarName(nCount));
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxIFConfig_Impl::~SfxIFConfig_Impl()
+{
+ if( pObjectBars )
+ {
+ for (USHORT n=0; n<pObjectBars->Count(); n++)
+ delete (*pObjectBars)[n];
+ delete pObjectBars;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+int SfxIFConfig_Impl::Load(SvStream& rStream)
+{
+ for ( ;pIFace->pImpData->pObjectBars->Count(); )
+ pIFace->ReleaseObjectBar(pIFace->GetObjectBarResId(0).GetId());
+
+ USHORT n;
+ rStream >> n;
+
+ if ( n != nVersion)
+ return SfxConfigItem::WARNING_VERSION;
+
+ rStream >> n;
+ for (USHORT i=0; i<n; i++)
+ {
+ pIFace->LoadObjectBar(i, rStream);
+ }
+
+ return SfxConfigItem::ERR_OK;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxIFConfig_Impl::Store(SvStream& rStream)
+{
+ rStream << nVersion;
+
+ rStream << pIFace->pImpData->pObjectBars->Count();
+ USHORT nIFaceId = GetType() - SFX_ITEMTYPE_INTERFACE_START;
+
+ for (USHORT i=0; i<pIFace->pImpData->pObjectBars->Count(); i++)
+ {
+ pIFace->StoreObjectBar(i, rStream);
+ }
+
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxIFConfig_Impl::UseDefault()
+{
+ pIFace->UseDefault();
+}
+
+//====================================================================
+// ctor, registeres a new unit
+
+SfxInterface::SfxInterface( SfxModule *pMod,
+ const char *pClassName,
+ const ResId& rNameResId,
+ USHORT nId,
+ const SfxInterface* pParent,
+ const SfxTypeLibImpl* pLibInfo ):
+ pName(pClassName),
+ nClassId(nId),
+ aNameResId(rNameResId.GetId()),
+ pGenoType(pParent),
+ pTypeLibInfo(pLibInfo),
+ pConfig(NULL),
+ pImpData(0),
+ nCount(0)
+{
+ aNameResId.SetResMgr(rNameResId.GetResMgr());
+ Init( );
+ pImpData->pModule = pMod;
+}
+
+SfxInterface::SfxInterface( SfxModule *pMod,
+ const char *pClassName,
+ const ResId& rNameResId,
+ USHORT nId,
+ const SfxInterface* pParent,
+ const SfxTypeLibImpl* pLibInfo,
+ SfxSlot &rSlotMap, USHORT nSlotCount ):
+ pName(pClassName),
+ nClassId(nId),
+ aNameResId(rNameResId.GetId()),
+ pGenoType(pParent),
+ pTypeLibInfo(pLibInfo),
+ pConfig(NULL),
+ pImpData(0)
+{
+ aNameResId.SetResMgr(rNameResId.GetResMgr());
+ Init();
+ pImpData->pModule = pMod;
+ SetSlotMap( rSlotMap, nSlotCount );
+ // register the functions at the SfxMessagePool
+ if ( pMod )
+ pMod->GetSlotPool()->RegisterInterface(*this);
+ else
+ SFX_APP()->GetAppSlotPool_Impl().RegisterInterface(*this);
+}
+
+void SfxInterface::Init()
+{
+ DBG_MEMTEST();
+ DBG_CTOR(SfxInterface, 0);
+// DBG_ASSERT(nCount, "Anzahl der Slot == NULL");
+
+ if ( nClassId )
+ pConfig = new SfxIFConfig_Impl(nClassId, this);
+ pImpData = new SfxInterface_Impl;
+}
+
+
+void SfxInterface::SetSlotMap( SfxSlot& rSlotMap, USHORT nSlotCount )
+{
+ pSlots = &rSlotMap;
+ nCount = nSlotCount;
+ SfxSlot* pIter = pSlots;
+ if ( 1 == nCount && !pIter->pNextSlot )
+ pIter->pNextSlot = pIter;
+
+ if ( !pIter->pNextSlot )
+ {
+ // sort the SfxSlots by id
+ qsort( pSlots, nCount, sizeof(SfxSlot), SfxCompareSlots_Impl );
+
+ // link masters and slaves
+ USHORT nIter = 1;
+ for ( pIter = pSlots; nIter <= nCount; ++pIter, ++nIter )
+ {
+ //! hier bitte sinnvoll pruefen
+ //! DBG_ASSERT(!(pIter->IsMode(SFX_SLOT_CACHABLE) &&
+ //! pIter->IsMode(SFX_SLOT_VOLATILE)),
+ //! "invalid Flags" );
+ DBG_ASSERT( nIter == nCount ||
+ pIter->GetSlotId() != (pIter+1)->GetSlotId(),
+ "doppelte SID" );
+
+ // jeder Master verweist auf seinen ersten Slave (ENUM), alle
+ // Slaves auf ihren Master.
+ // Slaves verweisen im Ring auf die anderen mit gleichem Master
+ if ( pIter->GetKind() == SFX_KIND_ENUM )
+ {
+ pIter->pLinkedSlot = GetSlot( pIter->nMasterSlotId );
+ DBG_ASSERT( pIter->pLinkedSlot, "slave without master" );
+ if ( !pIter->pLinkedSlot->pLinkedSlot )
+ ( (SfxSlot*) pIter->pLinkedSlot)->pLinkedSlot = pIter;
+
+ if ( 0 == pIter->GetNextSlot() )
+ {
+ SfxSlot *pLastSlot = pIter;
+ for ( USHORT n = nIter; n < Count(); ++n )
+ {
+ SfxSlot *pCurSlot = (pSlots+n);
+ if ( pCurSlot->nMasterSlotId == pIter->nMasterSlotId )
+ {
+ pLastSlot->pNextSlot = pCurSlot;
+ pLastSlot = pCurSlot;
+ }
+ }
+ pLastSlot->pNextSlot = pIter;
+ }
+ }
+ else if ( 0 == pIter->GetNextSlot() )
+ {
+ // Slots verweisen im Ring auf den n"achten mit derselben Statusmethode
+ SfxSlot *pLastSlot = pIter;
+ for ( USHORT n = nIter; n < Count(); ++n )
+ {
+ SfxSlot *pCurSlot = (pSlots+n);
+ if ( pCurSlot->GetStateFnc() == pIter->GetStateFnc() )
+ {
+ pLastSlot->pNextSlot = pCurSlot;
+ pLastSlot = pCurSlot;
+ }
+ }
+ pLastSlot->pNextSlot = pIter;
+ }
+ }
+ }
+#ifdef DBG_UTIL
+ else
+ {
+ USHORT nIter = 1;
+ for ( SfxSlot *pNext = pIter+1; nIter < nCount; ++pNext, ++nIter )
+ {
+
+ if ( pNext->GetSlotId() <= pIter->GetSlotId() )
+ DBG_ERROR ("Falsche Reihenfolge!");
+
+ if ( pIter->GetKind() == SFX_KIND_ENUM )
+ {
+ const SfxSlot *pMasterSlot = GetSlot(pIter->nMasterSlotId);
+ const SfxSlot *pFirstSlave = pMasterSlot->pLinkedSlot;
+ const SfxSlot *pSlave = pFirstSlave;
+ do
+ {
+ if ( pSlave->pLinkedSlot != pMasterSlot )
+ {
+ ByteString aStr("Falsche Master/Slave-Verkettung : ");
+ aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId());
+ aStr += " , ";
+ aStr += ByteString::CreateFromInt32(pSlave->GetSlotId());
+ DBG_ERROR(aStr.GetBuffer());
+ }
+
+ if ( pSlave->nMasterSlotId != pMasterSlot->GetSlotId() )
+ {
+ ByteString aStr("Falsche Master/Slave-Ids : ");
+ aStr += ByteString::CreateFromInt32(pMasterSlot->GetSlotId());
+ aStr += " , ";
+ aStr += ByteString::CreateFromInt32(pSlave->GetSlotId());
+ DBG_ERROR(aStr.GetBuffer());
+ }
+
+ pSlave = pSlave->pNextSlot;
+ }
+ while ( pSlave != pFirstSlave );
+ }
+ else
+ {
+ if ( pIter->pLinkedSlot )
+ {
+ if ( pIter->pLinkedSlot->GetKind() != SFX_KIND_ENUM )
+ {
+ ByteString aStr("Slave ist kein enum : ");
+ aStr += ByteString::CreateFromInt32(pIter->GetSlotId());
+ aStr += " , ";
+ aStr += ByteString::CreateFromInt32(pIter->pLinkedSlot->GetSlotId());
+ DBG_ERROR(aStr.GetBuffer());
+ }
+ }
+
+ const SfxSlot *pLastSlot = pIter;
+ const SfxSlot *pCurSlot = pIter;
+ do
+ {
+ pCurSlot = pCurSlot->pNextSlot;
+ if ( pCurSlot->GetStateFnc() != pIter->GetStateFnc() )
+ {
+ ByteString aStr("Verkettete Slots mit verschiedenen StateMethods : ");
+ aStr += ByteString::CreateFromInt32(pCurSlot->GetSlotId());
+ aStr += " , ";
+ aStr += ByteString::CreateFromInt32(pIter->GetSlotId());
+ DBG_ERROR(aStr.GetBuffer());
+ }
+ }
+ while ( pCurSlot != pIter );
+ }
+
+ pIter = pNext;
+ }
+ }
+#endif
+}
+
+
+//--------------------------------------------------------------------
+
+
+
+SfxInterface::~SfxInterface()
+{
+ if (pConfig)
+ delete pConfig;
+
+ SfxModule *pMod = pImpData->pModule;
+ delete pImpData;
+ if ( nClassId )
+ {
+ if ( pMod )
+ pMod->GetSlotPool()->ReleaseInterface(*this);
+ else
+ SFX_APP()->GetAppSlotPool_Impl().ReleaseInterface(*this);
+ }
+}
+
+//--------------------------------------------------------------------
+
+// searches for the specified func
+
+
+const SfxSlot* SfxInterface::GetSlot( USHORT nFuncId ) const
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxInterface, 0);
+ DBG_ASSERT( this && pSlots && nCount, "" );
+
+ // find the id using binary search
+ void* p = bsearch( &nFuncId, pSlots, nCount, sizeof(SfxSlot),
+ SfxCompareSlots_Impl );
+ if ( !p && pGenoType )
+ return pGenoType->GetSlot( nFuncId );
+
+ return p ? (const SfxSlot*)p : 0;
+}
+
+const SfxSlot* SfxInterface::GetSlot( const String& rCommand ) const
+{
+ SfxSlotPool& rPool = SFX_SLOTPOOL();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ USHORT nId = (pSlots+n)->GetSlotId();
+ if ( rCommand.CompareIgnoreCaseToAscii( rPool.GetSlotName_Impl( nId ) ) == COMPARE_EQUAL )
+ return pSlots+n;
+ }
+
+ return pGenoType ? pGenoType->GetSlot( rCommand ) : NULL;
+}
+
+//--------------------------------------------------------------------
+
+
+const SfxSlot* SfxInterface::GetRealSlot( const SfxSlot *pSlot ) const
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxInterface, 0);
+ DBG_ASSERT( this && pSlots && nCount, "" );
+
+ if ( !ContainsSlot_Impl(pSlot) )
+ {
+ if(pGenoType)
+ return pGenoType->GetRealSlot(pSlot);
+ DBG_ERROR("fremder Slot");
+ return 0;
+ }
+
+ return pSlot->pLinkedSlot;
+}
+
+//--------------------------------------------------------------------
+
+
+const SfxSlot* SfxInterface::GetRealSlot( USHORT nSlotId ) const
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxInterface, 0);
+ DBG_ASSERT( this && pSlots && nCount, "" );
+
+ const SfxSlot *pSlot = GetSlot(nSlotId);
+ if ( !pSlot )
+ {
+ if(pGenoType)
+ return pGenoType->GetRealSlot(nSlotId);
+ DBG_ERROR("fremder Slot");
+ return 0;
+ }
+
+ return pSlot->pLinkedSlot;
+}
+
+//--------------------------------------------------------------------
+
+
+void SfxInterface::RegisterPopupMenu( const ResId& rResId )
+{
+ DBG_CHKTHIS(SfxInterface, 0);
+ pImpData->aPopupRes = rResId;
+}
+
+//--------------------------------------------------------------------
+
+
+void SfxInterface::LoadConfig()
+{
+ if ( pConfig )
+ {
+ pConfig->SaveDefaults(nClassId);
+
+ // Wenn die Application schon l"auft, wurde das Interface nachtr"aglich
+ // erzeugt und mu\s daher explizit initialisiert werden.
+ if ( Application::IsInExecute() )
+ pConfig->Initialize();
+ }
+}
+
+
+BOOL SfxInterface::IsDefault()
+{
+ if (pConfig)
+ return pConfig->IsDefault();
+ else
+ return TRUE;
+}
+
+
+void SfxInterface::UseDefault()
+{
+ if ( !pConfig )
+ {
+ for (USHORT n=0; n<pImpData->pObjectBars->Count(); n++)
+ delete (*pImpData->pObjectBars)[n];
+ pImpData->pObjectBars->Remove(0, pImpData->pObjectBars->Count());
+ return;
+ }
+ else if ( !pConfig->IsDefault() )
+ {
+ USHORT n;
+ for (n=0; n<pImpData->pObjectBars->Count(); n++)
+ delete (*pImpData->pObjectBars)[n];
+ pImpData->pObjectBars->Remove(0, pImpData->pObjectBars->Count());
+
+ for (n=0; n<pConfig->nCount; n++)
+ {
+ SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(
+ (*pConfig->pObjectBars)[n]->nPos,
+ (*pConfig->pObjectBars)[n]->aResId,
+ (*pConfig->pObjectBars)[n]->bVisible,
+ (*pConfig->pObjectBars)[n]->nFeature,
+ nClassId);
+
+ pImpData->pObjectBars->Append(pUI);
+ pUI->pName = new String(*((*pConfig->pObjectBars)[n]->pName));
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+
+void SfxInterface::SetObjectBarName(const String& rName, USHORT nId)
+{
+ // Objectbar im eigenen Array suchen
+ USHORT nCount = pImpData->pObjectBars->Count();
+ USHORT n;
+ for ( n=0; n<nCount; n++ )
+ if ((*pImpData->pObjectBars)[n]->aResId.GetId() == nId) break;
+
+ if ( n >= nCount )
+ {
+ // Nicht gefunden, in der Superklasse versuchen
+ BOOL bGenoType = ( pGenoType != 0 && !pGenoType->HasName() );
+ if (bGenoType)
+ ((SfxInterface*)pGenoType)->SetObjectBarName ( rName, nId );
+ else
+ DBG_ERROR("Objectbar ist unbekannt!");
+ }
+ else
+ {
+ SfxObjectUI_Impl *pUI = (*pImpData->pObjectBars)[n];
+ delete pUI->pName;
+ pUI->pName = new String( rName );
+ if ( pConfig )
+ pConfig->SetDefault(FALSE);
+ }
+}
+
+
+void SfxInterface::SetObjectBarPos(USHORT nPos, USHORT nId)
+{
+ // Objectbar im eigenen Array suchen
+ USHORT nCount = pImpData->pObjectBars->Count();
+ USHORT n;
+ for ( n=0; n<nCount; n++ )
+ if ((*pImpData->pObjectBars)[n]->aResId.GetId() == nId) break;
+
+ if ( n >= nCount )
+ {
+ // Nicht gefunden, in der Superklasse versuchen
+ BOOL bGenoType = ( pGenoType != 0 && !pGenoType->HasName() );
+ if (bGenoType)
+ ((SfxInterface*)pGenoType)->SetObjectBarPos ( nPos, nId );
+ else
+ DBG_ERROR("Objectbar ist unbekannt!");
+ }
+ else
+ {
+ (*pImpData->pObjectBars)[n]->nPos = nPos;
+ if (pConfig)
+ pConfig->SetDefault(FALSE);
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxInterface::RegisterObjectBar( USHORT nPos, const ResId& rResId,
+ const String *pStr )
+{
+ RegisterObjectBar( nPos, rResId, 0UL, pStr );
+}
+
+
+void SfxInterface::RegisterObjectBar( USHORT nPos, const ResId& rResId,
+ ULONG nFeature, const String *pStr )
+{
+ if ((nPos & SFX_VISIBILITY_MASK) == 0)
+ {
+ if ((nPos & SFX_POSITION_MASK) == 0 )
+ nPos |= SFX_VISIBILITY_CLIENT | SFX_VISIBILITY_STANDARD;
+ else
+ nPos |= (SFX_VISIBILITY_STANDARD | SFX_VISIBILITY_SERVER);
+ }
+
+ // App-Leiste?
+ if ( SFX_OBJECTBAR_APPLICATION == ( nPos & SFX_POSITION_MASK ) )
+ // je nach Desktop oder Einzelapp nur die richtige registrieren
+ if ( !( SFX_VISIBILITY_DESKTOP == ( nPos & SFX_VISIBILITY_DESKTOP ) ) )
+ return;
+ nPos &= ~(USHORT)SFX_VISIBILITY_DESKTOP;
+
+ if( nPos & SFX_VISIBILITY_SERVER )
+ nPos |= SFX_VISIBILITY_PLUGSERVER;
+ if( nPos & SFX_VISIBILITY_CLIENT )
+ nPos |= SFX_VISIBILITY_PLUGCLIENT;
+
+ SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(nPos, rResId, TRUE, nFeature, nClassId);
+
+ pImpData->pObjectBars->Append(pUI);
+
+ if (pStr == 0)
+ {
+ ResId aResId(rResId);
+ aResId.SetRT(RSC_STRING);
+ aResId.SetResMgr(rResId.GetResMgr());
+ if ( !Resource::GetResManager()->IsAvailable(aResId) )
+ {
+ DBG_ERROR("Der Objectbar-Name fehlt in der Resource!");
+ pUI->pName = new String (DEFINE_CONST_UNICODE("NoName"));
+ }
+ else
+ pUI->pName = new String(aResId);
+ }
+ else
+ pUI->pName = new String(*pStr);
+}
+
+
+void SfxInterface::TransferObjectBar( USHORT nPos, USHORT nId, SfxInterface *pIFace,
+ const String *pStr)
+{
+ if ( !pIFace )
+ {
+ RegisterObjectBar( nPos, nId, pStr );
+ if (pConfig)
+ pConfig->SetDefault(FALSE);
+ return;
+ }
+
+ // Suche den ObjectBar im Quellen-Interface ( GenoType ?? )
+ USHORT n;
+ for (n=0; n<pIFace->pImpData->pObjectBars->Count(); n++)
+ if ((*pIFace->pImpData->pObjectBars)[n]->aResId.GetId() == nId) break;
+
+ DBG_ASSERT(n<pIFace->pImpData->pObjectBars->Count(),"Objectbar ist unbekannt!");
+
+ // Uebernimm ResId und Interface-Id
+ SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(nPos,
+ (*pIFace->pImpData->pObjectBars)[n]->aResId,
+ (*pIFace->pImpData->pObjectBars)[n]->bVisible,
+ (*pIFace->pImpData->pObjectBars)[n]->nFeature,
+ (*pIFace->pImpData->pObjectBars)[n]->nInterfaceId);
+ pImpData->pObjectBars->Append(pUI);
+
+ if (pStr == 0)
+ {
+ pUI->pName = new String( *(pIFace->GetObjectBarName(n)));
+ }
+ else
+ pUI->pName = new String(*pStr);
+
+ if (pConfig)
+ pConfig->SetDefault(FALSE);
+
+ pIFace->ReleaseObjectBar(nId);
+}
+
+
+
+void SfxInterface::ReleaseObjectBar( USHORT nId )
+{
+ // Objectbar im eigenen Array suchen
+ USHORT nCount = pImpData->pObjectBars->Count();
+ USHORT n;
+ for ( n=0; n<nCount; n++ )
+ if ((*pImpData->pObjectBars)[n]->aResId.GetId() == nId) break;
+
+ if ( n >= nCount )
+ {
+ // Nicht gefunden, in der Superklasse versuchen
+ BOOL bGenoType = ( pGenoType != 0 && !pGenoType->HasName() );
+ if (bGenoType)
+ ((SfxInterface*)pGenoType)->ReleaseObjectBar( nId );
+ else
+ DBG_ERROR("Objectbar ist unbekannt!");
+ }
+ else
+ {
+ delete (*pImpData->pObjectBars)[n];
+ pImpData->pObjectBars->Remove(n);
+ if (pConfig)
+ pConfig->SetDefault(FALSE);
+ }
+}
+
+//--------------------------------------------------------------------
+
+
+const ResId& SfxInterface::GetObjectBarResId( USHORT nNo ) const
+{
+ BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName());
+ if ( bGenoType )
+ {
+ // Gibt es Toolbars in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetObjectBarCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->GetObjectBarResId( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pObjectBars->Count();
+ DBG_ASSERT( nNo<nCount,"Objectbar ist unbekannt!" );
+ return (*pImpData->pObjectBars)[nNo]->aResId;
+}
+
+//--------------------------------------------------------------------
+
+
+USHORT SfxInterface::GetObjectBarPos( USHORT nNo ) const
+{
+ BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName());
+ if ( bGenoType )
+ {
+ // Gibt es Toolbars in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetObjectBarCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->GetObjectBarPos( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pObjectBars->Count();
+ DBG_ASSERT( nNo<nCount,"Objectbar ist unbekannt!" );
+ return (*pImpData->pObjectBars)[nNo]->nPos;
+}
+
+//--------------------------------------------------------------------
+
+
+USHORT SfxInterface::GetObjectBarCount() const
+{
+ if (pGenoType && ! pGenoType->HasName())
+ return pImpData->pObjectBars->Count() + pGenoType->GetObjectBarCount();
+ else
+ return pImpData->pObjectBars->Count();
+}
+
+//--------------------------------------------------------------------
+
+
+const ResId& SfxInterface::GetObjectMenuResId( USHORT nNo ) const
+{
+ DBG_ASSERT(nNo<pImpData->pObjectMenues->Count(),"ObjectMenue ist unbekannt!");
+ return (*pImpData->pObjectMenues)[nNo]->aResId;
+}
+
+//--------------------------------------------------------------------
+
+
+USHORT SfxInterface::GetObjectMenuPos( USHORT nNo ) const
+{
+ DBG_ASSERT(nNo<pImpData->pObjectMenues->Count(),"ObjectMenue ist unbekannt!");
+ return (*pImpData->pObjectMenues)[nNo]->nPos;
+}
+
+//--------------------------------------------------------------------
+
+
+USHORT SfxInterface::GetObjectMenuCount() const
+{
+ return pImpData->pObjectMenues->Count();
+}
+
+void SfxInterface::ClearObjectMenus()
+{
+ for (USHORT n = pImpData->pObjectMenues->Count(); n; )
+ {
+ delete pImpData->pObjectMenues->GetObject( --n );
+ pImpData->pObjectMenues->Remove( n );
+ }
+}
+
+void SfxInterface::RemoveObjectMenu( USHORT nPos )
+{
+ for (USHORT n = pImpData->pObjectMenues->Count(); n; )
+ if( pImpData->pObjectMenues->GetObject(--n)->nPos == nPos )
+ {
+ delete pImpData->pObjectMenues->GetObject( n );
+ pImpData->pObjectMenues->Remove( n );
+ }
+}
+//--------------------------------------------------------------------
+
+
+void SfxInterface::RegisterObjectMenu( USHORT nPos, const ResId& rResId )
+{
+ SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(nPos, rResId, TRUE, 0, nClassId);
+ pImpData->pObjectMenues->Append(pUI);
+}
+
+//--------------------------------------------------------------------
+
+
+BOOL SfxInterface::StoreObjectBar(USHORT n, SvStream& rStream)
+{
+ rStream << ((*pImpData->pObjectBars)[n]->nPos)
+ << (*pImpData->pObjectBars)[n]->aResId.GetId()
+ << (*pImpData->pObjectBars)[n]->nInterfaceId
+ << (USHORT) (*pImpData->pObjectBars)[n]->bVisible;
+ rStream.WriteByteString(*(*pImpData->pObjectBars)[n]->pName);
+ rStream << (*pImpData->pObjectBars)[n]->nFeature;
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+
+int SfxInterface::LoadObjectBar(USHORT n, SvStream& rStream)
+{
+ DBG_ASSERT( pConfig, "LoadObjectBar ohne Config!" );
+
+ USHORT nId, nPos, nIFaceId, nVisible;
+ ULONG nFeature;
+ String aName;
+
+ rStream >> nPos >> nId >> nIFaceId >> nVisible;
+ rStream.ReadByteString(aName);
+
+ if ( nVersion > 4 )
+ rStream >> nFeature;
+
+ ResId aResId(nId);
+ RegisterObjectBar(nPos, aResId, nFeature, &aName );
+ (*pImpData->pObjectBars)[n]->nInterfaceId = nIFaceId;
+ (*pImpData->pObjectBars)[n]->bVisible = (BOOL) nVisible;
+
+ SfxIFConfig_Impl *pCfg = pConfig;
+
+ if (nIFaceId != nClassId) // pConfig von anderem Interface holen
+ {
+ SfxInterface *pIFace =
+ SFX_APP()->GetInterfaceByIdImpl(SfxInterfaceId(nIFaceId));
+ if (pIFace)
+ pCfg = pIFace->pConfig;
+ }
+
+ ResMgr *pResMgr=0; // falls selbstdefiniert!
+ if (pCfg->pObjectBars->Count())
+ pResMgr = (*pCfg->pObjectBars)[0]->aResId.GetResMgr();
+
+ (*pImpData->pObjectBars)[n]->aResId.SetResMgr(pResMgr);
+
+ return SfxConfigItem::ERR_OK;
+}
+
+
+void SfxInterface::RegisterChildWindow(USHORT nId, BOOL bContext, const String* pName)
+{
+ RegisterChildWindow( nId, bContext, 0UL, pName );
+}
+
+void SfxInterface::RegisterChildWindow(USHORT nId, BOOL bContext, ULONG nFeature, const String*)
+{
+ SfxObjectUI_Impl* pUI = new SfxObjectUI_Impl(0, nId, TRUE, nFeature, 0);
+ pUI->bContext = bContext;
+ pImpData->pChildWindows->Append(pUI);
+}
+
+void SfxInterface::ReleaseChildWindow( USHORT nId )
+{
+ USHORT nCount = pImpData->pChildWindows->Count();
+ USHORT n;
+ for ( n=0; n<nCount; n++ )
+ if ((*pImpData->pChildWindows)[n]->aResId.GetId() == nId) break;
+
+ if ( n >= nCount )
+ {
+ // Nicht gefunden, in der Superklasse versuchen
+ BOOL bGenoType = ( pGenoType != 0 && !pGenoType->HasName() );
+ if (bGenoType)
+ ((SfxInterface*)pGenoType)->ReleaseChildWindow( nId );
+ else
+ DBG_ERROR("ChildWindow ist unbekannt!");
+ }
+ else
+ {
+ delete (*pImpData->pChildWindows)[n];
+ pImpData->pChildWindows->Remove(n);
+ if (pConfig)
+ pConfig->SetDefault(FALSE);
+ }
+}
+
+void SfxInterface::RegisterStatusBar(const ResId& rResId)
+{
+ pImpData->aStatBarRes = rResId;
+}
+
+
+ULONG SfxInterface::GetChildWindowId (USHORT nNo) const
+{
+ if ( pGenoType )
+ {
+ // Gibt es ChildWindows in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetChildWindowCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->GetChildWindowId( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pChildWindows->Count();
+ DBG_ASSERT( nNo<nCount,"ChildWindow ist unbekannt!" );
+ ULONG nRet = (ULONG) (*pImpData->pChildWindows)[nNo]->aResId.GetId();
+ if ( (*pImpData->pChildWindows)[nNo]->bContext )
+ nRet += ( (ULONG) nClassId ) << 16;
+ return nRet;
+}
+
+ULONG SfxInterface::GetChildWindowFeature (USHORT nNo) const
+{
+ if ( pGenoType )
+ {
+ // Gibt es ChildWindows in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetChildWindowCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->GetChildWindowFeature( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pChildWindows->Count();
+ DBG_ASSERT( nNo<nCount,"ChildWindow ist unbekannt!" );
+ ULONG nRet = (ULONG) (*pImpData->pChildWindows)[nNo]->nFeature;
+ return nRet;
+}
+
+//--------------------------------------------------------------------
+
+
+USHORT SfxInterface::GetChildWindowCount() const
+{
+ if (pGenoType)
+ return pImpData->pChildWindows->Count() + pGenoType->GetChildWindowCount();
+ else
+ return pImpData->pChildWindows->Count();
+}
+
+
+const ResId& SfxInterface::GetPopupMenuResId() const
+{
+ return pImpData->aPopupRes;
+}
+
+
+const ResId& SfxInterface::GetStatusBarResId() const
+{
+ if (pImpData->aStatBarRes.GetId() == 0 && pGenoType)
+ return pGenoType->GetStatusBarResId();
+ else
+ return pImpData->aStatBarRes;
+}
+
+
+
+const String* SfxInterface::GetObjectBarName ( USHORT nNo ) const
+{
+ BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName());
+ if ( bGenoType )
+ {
+ // Gibt es Toolbars in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetObjectBarCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->GetObjectBarName( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pObjectBars->Count();
+ DBG_ASSERT( nNo<nCount,"Objectbar ist unbekannt!" );
+ return (*pImpData->pObjectBars)[nNo]->pName;
+}
+
+ULONG SfxInterface::GetObjectBarFeature ( USHORT nNo ) const
+{
+ BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName());
+ if ( bGenoType )
+ {
+ // Gibt es Toolbars in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetObjectBarCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->GetObjectBarFeature( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pObjectBars->Count();
+ DBG_ASSERT( nNo<nCount,"Objectbar ist unbekannt!" );
+ return (*pImpData->pObjectBars)[nNo]->nFeature;
+}
+
+
+BOOL SfxInterface::IsObjectBarVisible(USHORT nNo) const
+{
+ BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName());
+ if ( bGenoType )
+ {
+ // Gibt es Toolbars in der Superklasse ?
+ USHORT nBaseCount = pGenoType->GetObjectBarCount();
+ if ( nNo < nBaseCount )
+ // Die der Superklasse kommen zuerst
+ return pGenoType->IsObjectBarVisible( nNo );
+ else
+ nNo -= nBaseCount;
+ }
+
+ USHORT nCount = pImpData->pObjectBars->Count();
+ DBG_ASSERT( nNo<nCount,"Objectbar ist unbekannt!" );
+ return (*pImpData->pObjectBars)[nNo]->bVisible;
+}
+
+
+void SfxInterface::SetObjectBarVisible(BOOL bVis, USHORT nId)
+{
+ // Objectbar im eigenen Array suchen
+ USHORT nCount = pImpData->pObjectBars->Count();
+ USHORT n;
+ for ( n=0; n<nCount; n++ )
+ if ( (*pImpData->pObjectBars)[n]->aResId.GetId() == nId ) break;
+
+ if ( n >= nCount )
+ {
+ // Nicht gefunden, in der Superklasse versuchen
+ BOOL bGenoType = (pGenoType != 0 && !pGenoType->HasName());
+ if (bGenoType)
+ ((SfxInterface*)pGenoType)->SetObjectBarVisible(bVis,nId);
+ else
+ DBG_ERROR("Objectbar ist unbekannt!");
+ }
+ else
+ {
+ (*pImpData->pObjectBars)[n]->bVisible = bVis;
+ if (pConfig)
+ pConfig->SetDefault(FALSE);
+ }
+}
+
+
+void SfxInterface::ReInitialize(SfxConfigManager *pCfgMgr)
+{
+ DBG_ASSERT( pConfig, "ReInitialize ohne Config!" );
+
+ SfxConfigManager *pOld = pConfig->GetConfigManager_Impl();
+ if (pCfgMgr == pOld)
+ return;
+ pConfig->ReInitialize(pCfgMgr);
+
+ pCfgMgr->RemoveConfigItem(pConfig);
+ pOld->AddConfigItem(pConfig);
+
+ pConfig->SetDefault(FALSE);
+
+ for (USHORT n=0; n<pImpData->pObjectBars->Count(); n++)
+ {
+ USHORT nId = (*pImpData->pObjectBars)[n]->aResId.GetId();
+ if ( SfxToolBoxManager::IsUserDefToolBox_Impl(nId))
+ {
+ if (!pOld->HasConfigItem(nId))
+ pOld->InsertConfigItem(nId);
+ }
+ }
+}
+
+
+void SfxInterface::SaveConfig()
+{
+ if ( pConfig )
+ pConfig->StoreConfig();
+}
+
+
+USHORT SfxInterface::GetConfigId() const
+{
+ return SFX_ITEMTYPE_INTERFACE_START + nClassId;
+}
+
+
+SfxObjectUIArr_Impl* SfxInterface::GetObjectBarArr_Impl() const
+{
+ return pImpData->pObjectBars;
+}
+
+
+USHORT SfxInterface::RegisterUserDefToolBox(USHORT nId, const String *pName,
+ SfxConfigManager *pCfgMgr)
+{
+ // Zuerst "uber den Namen die ToolBox suchen
+ SfxInterface *pIFace;
+ for (pIFace = SFX_SLOTPOOL().FirstInterface(); pIFace != 0;
+ pIFace = SFX_SLOTPOOL().NextInterface())
+ {
+ // Nur Interfaces mit Namen d"urfen welche bekommen
+ if (pIFace->HasName())
+ {
+ // Zugriff auf ObjectBars
+ SfxObjectUIArr_Impl *pArr = pIFace->GetObjectBarArr_Impl();
+ for (USHORT nNo=0; nNo<pArr->Count(); nNo++)
+ {
+ if ( *pName == *(*pArr)[nNo]->pName)
+ return (*pArr)[nNo]->aResId.GetId();
+ }
+ }
+ }
+
+ // Ansonsten n"achste freie Id besorgen
+ USHORT nFreeId = SfxToolBoxManager::GetUserDefToolBoxId_Impl();
+ BOOL bFound = FALSE;
+
+ // Alle Interfaces durchprobieren, ob sie noch eine UserDefToolBox
+ // aufnehmen k"onnen
+ USHORT nPos;
+ for (pIFace = SFX_SLOTPOOL().FirstInterface(); pIFace != 0;
+ pIFace = SFX_SLOTPOOL().NextInterface())
+ {
+ BOOL bFound = FALSE;
+
+ // Nur Interfaces mit Namen d"urfen welche bekommen
+ if (pIFace->HasName())
+ {
+ // Zugriff auf ObjectBars
+ SfxObjectUIArr_Impl *pArr = pIFace->GetObjectBarArr_Impl();
+
+ for ( nPos=SFX_OBJECTBAR_USERDEF1; nPos<=SFX_OBJECTBAR_USERDEF3; nPos++ )
+ {
+ // Nach freier Position suchen
+ bFound = TRUE;
+ for (USHORT nNo=0; nNo<pArr->Count(); nNo++)
+ {
+ if ( nPos == (*pArr)[nNo]->nPos)
+ {
+ // Diese Position ist schon besetzt, n"achste versuchen
+ bFound = FALSE;
+ break;
+ }
+ }
+
+ // Wurde eine noch freie Position gefunden ?
+ if ( bFound )
+ break;
+ }
+ }
+
+ // Wurde am Interface etwas gefunden ?
+ if ( bFound )
+ break;
+ }
+
+ if ( pIFace )
+ {
+ // Am gefundenen Interface mu\s die Konfiguration ver"andert werden
+ SfxConfigItem *pCfgItem = pIFace->GetConfig_Impl();
+ SfxConfigManager *pOldCfgMgr = pCfgItem->GetConfigManager_Impl();
+
+ if ( pOldCfgMgr != pCfgMgr )
+ {
+ // Wenn das Interface bisher von einem anderen ConfigManager
+ // bedient wird, wird dessen Config gesichert
+ pCfgItem->StoreConfig();
+
+ // Der Ziel-Configmanager mu\s die Konfiguration aufnehmen k"onnen
+ if ( !pCfgMgr->HasConfigItem(pIFace->GetConfigId()) )
+ pCfgMgr->InsertConfigItem(pIFace->GetConfigId());
+
+ // Verbindung mit dem ConfigItem herstellen und Config "ubernehmen
+ pCfgMgr->AddConfigItem(pCfgItem);
+ pCfgItem->Initialize();
+ }
+
+ // Jetzt wird das Interface umkonfiguriert
+ pIFace->RegisterObjectBar(nPos, nFreeId, pName);
+ pIFace->SetObjectBarVisible(TRUE, nFreeId);
+
+ // Konfiguration sichern und aktuellen Stand der Config restaurieren
+ if ( pCfgMgr != pOldCfgMgr && pCfgMgr != SFX_CFGMANAGER() )
+ {
+ pCfgItem->StoreConfig();
+ pCfgMgr->RemoveConfigItem(pCfgItem);
+ pCfgItem->Connect(pOldCfgMgr);
+ pCfgItem->Initialize();
+ }
+ }
+
+ return nFreeId;
+}
+
+
+void SfxInterface::ReleaseUserDefToolBox(USHORT nId, SfxConfigManager *pCfgMgr)
+
+{
+ BOOL bDone = FALSE;
+
+ // Alle Interfaces durchprobieren, ob sie diese UserDefToolBox haben
+ for (SfxInterface *pIFace = SFX_SLOTPOOL().FirstInterface(); pIFace != 0;
+ pIFace = SFX_SLOTPOOL().NextInterface())
+ {
+ // Nur Interfaces mit Namen k"onnen welche haben
+ if (pIFace->HasName())
+ {
+ // Die Konfiguration vom "ubergebenen Manager interessiert
+ SfxConfigItem *pCfgItem = pIFace->GetConfig_Impl();
+ SfxConfigManager *pOldCfgMgr = pCfgItem->GetConfigManager_Impl();
+
+ if ( pOldCfgMgr != pCfgMgr )
+ {
+ // Wenn das Interface bisher von einem anderen ConfigManager
+ // bedient wird, wird dessen Config gesichert
+ pCfgItem->StoreConfig();
+
+ // Verbindung mit dem ConfigItem herstellen und Config "ubernehmen
+ pCfgMgr->AddConfigItem(pCfgItem);
+ pCfgItem->Initialize();
+ }
+
+ if ( pIFace->HasObjectBar(nId) )
+ {
+ pIFace->ReleaseObjectBar(nId);
+ BOOL bDone = TRUE;
+ }
+
+ // Konfiguration sichern und aktuellen Stand der Config restaurieren
+ if ( pCfgMgr != pOldCfgMgr )
+ {
+ pCfgItem->StoreConfig();
+ pCfgMgr->RemoveConfigItem(pCfgItem);
+ pCfgItem->Connect(pOldCfgMgr);
+ pCfgItem->Initialize();
+ }
+ }
+
+ if ( bDone )
+ {
+ break;
+ }
+ }
+}
+
+
+BOOL SfxInterface::HasObjectBar( USHORT nId ) const
+{
+ for (USHORT n=0; n<pImpData->pObjectBars->Count(); n++)
+ if ((*pImpData->pObjectBars)[n]->aResId.GetId() == nId) return TRUE;
+ return FALSE;
+}
+
+SfxModule* SfxInterface::GetModule() const
+{
+ return pImpData->pModule;
+}
+
+const SfxInterface* SfxInterface::GetRealInterfaceForSlot( const SfxSlot *pRealSlot ) const
+{
+ const SfxInterface* pInterface = this;
+
+ // Der Slot k"onnte auch aus dem Interface einer Shell-Basisklasse stammen
+ do
+ {
+ const SfxSlot *pLastSlot = (*pInterface)[pInterface->Count()-1];
+ const SfxSlot *pFirstSlot = (*pInterface)[0];
+
+ // Ist pInterface der Owner von pRealSlot ?
+ if ( pFirstSlot <= pRealSlot && pRealSlot <= pLastSlot )
+ break;
+
+ // Sonst Interface der Superklasse probieren
+ pInterface = pInterface->pGenoType;
+ }
+ while ( pInterface );
+
+ return pInterface;
+}
+
+
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
new file mode 100644
index 000000000000..f03edd48cc6d
--- /dev/null
+++ b/sfx2/source/control/request.cxx
@@ -0,0 +1,576 @@
+/*************************************************************************
+ *
+ * $RCSfile: request.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXITEMITER_HXX //autogen
+#include <svtools/itemiter.hxx>
+#endif
+
+#ifndef _ARGS_HXX //autogen
+#include <svtools/args.hxx>
+#endif
+
+#ifndef _SVTOOLS_ITEMDEL_HXX
+#include <svtools/itemdel.hxx>
+#endif
+
+#include <svtools/itempool.hxx>
+
+#pragma hdrstop
+
+#include "request.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "msg.hxx"
+#include "objsh.hxx"
+#include "saveopt.hxx"
+#include "viewfrm.hxx"
+#include "viewsh.hxx"
+#include "app.hxx"
+#include "objface.hxx"
+
+//===================================================================
+
+struct SfxRequest_Impl: public SfxListener
+
+/* [Beschreibung]
+
+ Implementations-Struktur der Klasse <SfxRequest>.
+*/
+
+{
+ SfxRequest* pAnti; // Owner wegen sterbendem Pool
+ SfxItemPool* pPool; // ItemSet mit diesem Pool bauen
+ SfxPoolItem* pRetVal; // R"uckgabewert geh"ort sich selbst
+ const SfxShell* pShell; // ausgef"uhrt an dieser Shell
+ const SfxSlot* pSlot; // ausgef"uhrter Slot
+ USHORT nModifier; // welche Modifier waren gedrueckt?
+ BOOL bDone; // "uberhaupt ausgef"uhrt
+ BOOL bIgnored; // vom User abgebrochen
+ BOOL bCancelled; // nicht mehr zustellen
+ USHORT nCallMode; // Synch/Asynch/API/Record
+ SfxAllItemSet* pInternalArgs;
+
+ SfxRequest_Impl( SfxRequest *pOwner )
+ : pAnti( pOwner), bCancelled(FALSE),
+ nCallMode( SFX_CALLMODE_SYNCHRON ), nModifier(0),
+ pPool(0), pInternalArgs( 0 )
+ {}
+ ~SfxRequest_Impl() { delete pInternalArgs; }
+
+
+ void SetPool( SfxItemPool *pNewPool );
+ virtual void Notify( SfxBroadcaster &rBC, const SfxHint &rHint );
+};
+
+
+//====================================================================
+
+void SfxRequest_Impl::Notify( SfxBroadcaster &rBC, const SfxHint &rHint )
+{
+ SfxSimpleHint *pSimpleHint = PTR_CAST(SfxSimpleHint, &rHint);
+ if ( pSimpleHint && pSimpleHint->GetId() == SFX_HINT_DYING )
+ pAnti->Cancel();
+}
+
+//====================================================================
+
+void SfxRequest_Impl::SetPool( SfxItemPool *pNewPool )
+{
+ if ( pNewPool != pPool )
+ {
+ if ( pPool )
+ EndListening( pPool->BC() );
+ pPool = pNewPool;
+ if ( pNewPool )
+ StartListening( pNewPool->BC() );
+ }
+}
+
+//====================================================================
+
+
+SfxRequest::~SfxRequest()
+{
+ DBG_MEMTEST();
+ // nicht mit Done() marktierte Requests mit 'rem' rausschreiben
+
+ // Objekt abr"aumen
+ delete pArgs;
+ if ( pImp->pRetVal )
+ DeleteItemOnIdle(pImp->pRetVal);
+ delete pImp;
+}
+//--------------------------------------------------------------------
+
+
+SfxRequest::SfxRequest
+(
+ const SfxRequest& rOrig
+)
+: nSlot(rOrig.nSlot),
+ pArgs(rOrig.pArgs? new SfxAllItemSet(*rOrig.pArgs): 0),
+ pImp( new SfxRequest_Impl(this) )
+{
+ DBG_MEMTEST();
+
+ pImp->bDone = FALSE;
+ pImp->bIgnored = FALSE;
+ pImp->pRetVal = 0;
+ pImp->pShell = 0;
+ pImp->pSlot = 0;
+ pImp->nCallMode = rOrig.pImp->nCallMode;
+ pImp->nModifier = rOrig.pImp->nModifier;
+
+ if ( pArgs )
+ pImp->SetPool( pArgs->GetPool() );
+ else
+ pImp->SetPool( rOrig.pImp->pPool );
+}
+
+SfxRequest::SfxRequest
+(
+ USHORT nSlotId, // auszuf"uhrende <Slot-Id>
+ SfxCallMode nMode, // Synch/API/...
+ SfxItemPool& rPool // ggf. f"ur das SfxItemSet f"ur Parameter
+)
+
+// creates a SfxRequest without arguments
+
+: nSlot(nSlotId),
+ pArgs(0),
+ pImp( new SfxRequest_Impl(this) )
+{
+ DBG_MEMTEST();
+
+ pImp->bDone = FALSE;
+ pImp->bIgnored = FALSE;
+ pImp->SetPool( &rPool );
+ pImp->pRetVal = 0;
+ pImp->pShell = 0;
+ pImp->pSlot = 0;
+ pImp->nCallMode = nMode;
+}
+
+//-----------------------------------------------------------------------
+
+SfxRequest::SfxRequest
+(
+ USHORT nSlotId,
+ USHORT nMode,
+ const SfxAllItemSet& rSfxArgs
+)
+
+// creates a SfxRequest with arguments
+
+: nSlot(nSlotId),
+ pArgs(new SfxAllItemSet(rSfxArgs)),
+ pImp( new SfxRequest_Impl(this) )
+{
+ DBG_MEMTEST();
+
+ pImp->bDone = FALSE;
+ pImp->bIgnored = FALSE;
+ pImp->SetPool( rSfxArgs.GetPool() );
+ pImp->pRetVal = 0;
+ pImp->pShell = 0;
+ pImp->pSlot = 0;
+ pImp->nCallMode = nMode;
+}
+//--------------------------------------------------------------------
+
+USHORT SfxRequest::GetCallMode() const
+{
+ return pImp->nCallMode;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxRequest::IsSynchronCall() const
+{
+ return SFX_CALLMODE_SYNCHRON == ( SFX_CALLMODE_SYNCHRON & pImp->nCallMode );
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::SetSynchronCall( BOOL bSynchron )
+{
+ if ( bSynchron )
+ pImp->nCallMode |= SFX_CALLMODE_SYNCHRON;
+ else
+ pImp->nCallMode &= ~(USHORT) SFX_CALLMODE_SYNCHRON;
+}
+
+void SfxRequest::SetInternalArgs_Impl( const SfxAllItemSet& rArgs )
+{
+ delete pImp->pInternalArgs;
+ pImp->pInternalArgs = new SfxAllItemSet( rArgs );
+}
+
+const SfxItemSet* SfxRequest::GetInternalArgs_Impl() const
+{
+ return pImp->pInternalArgs;
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::SetArgs( const SfxAllItemSet& rArgs )
+{
+ delete pArgs;
+ pArgs = new SfxAllItemSet(rArgs);
+ pImp->SetPool( pArgs->GetPool() );
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::AppendItem(const SfxPoolItem &rItem)
+{
+ if(!pArgs)
+ pArgs = new SfxAllItemSet(*pImp->pPool);
+ pArgs->Put(rItem, rItem.Which());
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::RemoveItem( USHORT nID )
+{
+ if (pArgs)
+ {
+ pArgs->ClearItem(nID);
+ if ( !pArgs->Count() )
+ DELETEZ(pArgs);
+ }
+}
+
+//--------------------------------------------------------------------
+
+const SfxPoolItem* SfxRequest::GetArg
+(
+ USHORT nSlotId, // Slot-Id oder Which-Id des Parameters
+ FASTBOOL bDeep, // FALSE: nicht in Parent-ItemSets suchen
+ TypeId aType // != 0: RTTI Pruefung mit Assertion
+) const
+{
+ return GetItem( pArgs, nSlotId, bDeep, aType );
+}
+
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxRequest::GetItem
+(
+ const SfxItemSet* pArgs,
+ USHORT nSlotId, // Slot-Id oder Which-Id des Parameters
+ FASTBOOL bDeep, // FALSE: nicht in Parent-ItemSets suchen
+ TypeId aType // != 0: RTTI Pruefung mit Assertion
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird der Zugriff auf einzelne Parameter im
+ SfxRequest wesentlich vereinfacht. Insbesondere wird die Typpr"ufung
+ (per Assertion) durchgef"uhrt, wodurch die Applikations-Sourcen
+ wesentlich "ubersichtlicher werden. In der PRODUCT-Version wird
+ eine 0 zur"uckgegeben, wenn das gefundene Item nicht von der
+ angegebenen Klasse ist.
+
+
+ [Beispiel]
+
+ void MyShell::Execute( SfxRequest &rReq )
+ {
+ switch ( rReq.GetSlot() )
+ {
+ case SID_MY:
+ {
+ ...
+ // ein Beispiel ohne Verwendung des Makros
+ const SfxInt32Item *pPosItem = (const SfxUInt32Item*)
+ rReq.GetArg( SID_POS, FALSE, TYPE(SfxInt32Item) );
+ USHORT nPos = pPosItem ? pPosItem->GetValue() : 0;
+
+ // ein Beispiel mit Verwendung des Makros
+ SFX_REQUEST_ARG(rReq, pSizeItem, SfxInt32Item, SID_SIZE, FALSE);
+ USHORT nSize = pSizeItem ? pPosItem->GetValue() : 0;
+
+ ...
+ }
+
+ ...
+ }
+ }
+*/
+
+{
+ if ( pArgs )
+ {
+ // ggf. in Which-Id umrechnen
+ USHORT nWhich = pArgs->GetPool()->GetWhich(nSlotId);
+
+ // ist das Item gesetzt oder bei bDeep==TRUE verf"ugbar?
+ const SfxPoolItem *pItem = 0;
+ if ( ( bDeep ? SFX_ITEM_AVAILABLE : SFX_ITEM_SET )
+ <= pArgs->GetItemState( nWhich, bDeep, &pItem ) )
+ {
+ // stimmt der Typ "uberein?
+ if ( !pItem || pItem->IsA(aType) )
+ return pItem;
+
+ // Item da aber falsch => Programmierfehler
+ DBG_ERROR( "invalid argument type" );
+ }
+ }
+
+ // keine Parameter, nicht gefunden oder falschen Typ gefunden
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::SetReturnValue(const SfxPoolItem &rItem)
+{
+ DBG_ASSERT(!pImp->pRetVal, "Returnwert mehrfach setzen?");
+ if(pImp->pRetVal)
+ delete pImp->pRetVal;
+ pImp->pRetVal = rItem.Clone();
+}
+
+//--------------------------------------------------------------------
+
+const SfxPoolItem* SfxRequest::GetReturnValue() const
+{
+ return pImp->pRetVal;
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::Done
+(
+ const SfxItemSet& rSet, /* von der Applikation mitgeteilte Parameter,
+ die z.B. in einem Dialog vom Benuter
+ erfragt wurden, ggf. 0 falls keine
+ Parameter gesetzt wurden */
+
+ FASTBOOL bKeep /* TRUE (default)
+ 'rSet' wird gepeichert und ist "uber
+ GetArgs() abfragbar
+
+ FALSE
+ 'rSet' wird nicht kopiert (schneller) */
+)
+
+/* [Beschreibung]
+
+ Diese Methode mu\s in der <Execute-Methode> des <SfxSlot>s gerufen
+ werden, der den SfxRequest ausgef"uhrt hat, wenn die Ausf"uhrung
+ tats"achlich stattgefunden hat. Wird 'Done()' nicht gerufen, gilt
+ der SfxRequest als abgebrochen.
+
+ Etwaige Returnwerte werden nur durchgereicht, wenn 'Done()' gerufen
+ wurde. Ebenso werden beim Aufzeichnen von Makros nur echte
+ Statements erzeugt, wenn 'Done()' gerufen wurde; f"ur SfxRequests,
+ die nicht derart gekennzeichnet wurden, wird anstelle dessen eine
+ auf die abgebrochene Funktion hinweisende Bemerkung ('rem') eingf"ugt.
+
+
+ [Anmerkung]
+
+ 'Done()' wird z.B. nicht gerufen, wenn ein durch die Funktion gestarteter
+ Dialog vom Benutzer abgebrochen wurde oder das Ausf"uhren aufgrund
+ eines falschen Kontextes (ohne Verwendung separater <SfxShell>s)
+ nicht durchgef"uhrt werden konnte. 'Done()' mu\s sehr wohl gerufen
+ werden, wenn das Ausf"uhren der Funktion zu einem regul"aren Fehler
+ f"uhrte (z.B. Datei konnte nicht ge"offnet werden).
+*/
+
+{
+ pImp->bDone = TRUE;
+
+ // ggf. Items merken, damit StarDraw sie abfragen kann
+ if ( bKeep )
+ {
+ if ( !pArgs )
+ {
+ pArgs = new SfxAllItemSet( rSet );
+ pImp->SetPool( pArgs->GetPool() );
+ }
+ else
+ {
+ SfxItemIter aIter(rSet);
+ const SfxPoolItem* pItem = aIter.FirstItem();
+ while(pItem)
+ {
+ if(!IsInvalidItem(pItem))
+ pArgs->Put(*pItem,pItem->Which());
+ pItem = aIter.NextItem();
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+
+void SfxRequest::Done( BOOL bRelease )
+// [<SfxRequest::Done(SfxItemSet&)>]
+{
+ pImp->bDone = TRUE;
+ if( bRelease )
+ DELETEZ( pArgs );
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxRequest::IsCancelled() const
+{
+ return pImp->bCancelled;
+}
+
+//--------------------------------------------------------------------
+
+void SfxRequest::Cancel()
+
+/* [Beschreibung]
+
+ Markiert diesen Request als nicht mehr auszufuehren. Wird z.B. gerufen,
+ wenn das Ziel (genauer dessen Pool) stirbt.
+*/
+
+{
+ pImp->bCancelled = TRUE;
+ pImp->SetPool( 0 );
+ DELETEZ( pArgs );
+}
+
+//--------------------------------------------------------------------
+
+
+void SfxRequest::Ignore()
+
+/* [Beschreibung]
+
+ Wird diese Methode anstelle von <SfxRequest::Done()> gerufen, dann
+ wird dieser Request nicht recorded.
+
+
+ [Bespiel]
+
+ Das Selektieren von Tools im StarDraw soll nicht aufgezeichnet werden,
+ dieselben Slots sollen aber zum erzeugen der von den Tools zu
+ erzeugenden Objekte verwendet werde. Also kann nicht NoRecord
+ angegeben werden, dennoch soll u.U. nicht aufgezeichnet werden.
+*/
+
+{
+ // als tats"achlich ausgef"uhrt markieren
+ pImp->bIgnored = TRUE;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxRequest::IsDone() const
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann abgefragt werden, ob der SfxRequest tats"achlich
+ ausgef"uhrt wurde oder nicht. Wurde ein SfxRequest nicht ausgef"uhrt,
+ liegt dies z.B. daran, da\s der Benutzer abgebrochen hat oder
+ der Kontext f"ur diesen Request falsch war, dieses aber nicht "uber
+ eine separate <SfxShell> realisiert wurde.
+
+ SfxRequest-Instanzen, die hier FALSE liefern, werden nicht recorded.
+
+
+ [Querverweise]
+
+ <SfxRequest::Done(const SfxItemSet&)>
+ <SfxRequest::Done()>
+*/
+
+{
+ return pImp->bDone;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxRequest::IsAPI() const
+
+/* [Beschreibung]
+
+ Liefert TRUE, wenn dieser SfxRequest von einer API (z.B. BASIC)
+ erzeugt wurde, sonst FALSE.
+*/
+
+{
+ return SFX_CALLMODE_API == ( SFX_CALLMODE_API & pImp->nCallMode );
+}
+
+//--------------------------------------------------------------------
+void SfxRequest::SetModifier( USHORT nModi )
+{
+ pImp->nModifier = nModi;
+}
+
+//--------------------------------------------------------------------
+USHORT SfxRequest::GetModifier() const
+{
+ return pImp->nModifier;
+}
+
+
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
new file mode 100644
index 000000000000..b73b804f5a45
--- /dev/null
+++ b/sfx2/source/control/shell.cxx
@@ -0,0 +1,1524 @@
+/*************************************************************************
+ *
+ * $RCSfile: shell.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _PSEUDO_HXX //autogen
+#include <so3/pseudo.hxx>
+#endif
+#ifndef _SFXITEMPOOL_HXX //autogen
+#include <svtools/itempool.hxx>
+#endif
+#ifndef _UNDO_HXX //autogen
+#include <svtools/undo.hxx>
+#endif
+#ifndef _SVTOOLS_ITEMDEL_HXX
+#include <svtools/itemdel.hxx>
+#endif
+
+#ifndef _SBXCLASS_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "shell.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "viewfrm.hxx"
+#include "sfxbasic.hxx"
+#include "objface.hxx"
+#include "objsh.hxx"
+#include "viewsh.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "request.hxx"
+#include "mnumgr.hxx"
+#include "saveopt.hxx"
+#include "statcach.hxx"
+
+//====================================================================
+
+DBG_NAME(SfxShell);
+
+//====================================================================
+
+TYPEINIT0(SfxShell);
+
+//====================================================================
+typedef SfxSlot* SfxSlotPtr;
+SV_DECL_PTRARR_DEL( SfxVerbSlotArr_Impl, SfxSlotPtr, 4, 4);
+SV_IMPL_PTRARR( SfxVerbSlotArr_Impl, SfxSlotPtr);
+
+struct SfxVerbList
+{
+ SfxVerbSlotArr_Impl aSlotArr;
+ SvVerbList aVerbList;
+};
+
+struct SfxShell_Impl: public SfxBroadcaster
+{
+ String aObjectName;// Name des Sbx-Objects
+ SfxItemArray_Impl aItems; // Datenaustausch auf Item-Basis
+ SfxViewShell* pViewSh; // SfxViewShell falls Shell ViewFrame/ViewShell/SubShell ist
+ SfxViewFrame* pFrame; // Frame, falls <UI-aktiv>
+ SfxVerbList* pVerbs;
+ SfxRepeatTarget* pRepeatTarget;
+// SbxObjectRef xParent;
+ BOOL bInAppBASIC;
+ BOOL bActive;
+ ULONG nDisableFlags;
+ ULONG nHelpId;
+ AsynchronLink* pExecuter;
+ AsynchronLink* pUpdater;
+ SfxShell_Impl() : pExecuter( 0 ), pUpdater( 0 ) {}
+ ~SfxShell_Impl() { delete pExecuter; delete pUpdater;}
+};
+
+//====================================================================
+#ifdef DBG_UTIL
+
+String SfxShellIdent_Impl( const SfxShell *pSh )
+
+/* [Beschreibung]
+
+ Interne Hilfesfunktion. Liefert einen die SfxShell 'pSh' beschreibenden
+ String zur"uck. Z.B.: SfxApplication[StarWriter]
+*/
+
+{
+ String aIdent( pSh->ISA(SfxApplication) ? DEFINE_CONST_UNICODE("SfxApplication") :
+ pSh->ISA(SfxViewFrame) ? DEFINE_CONST_UNICODE("SfxViewFrame") :
+ pSh->ISA(SfxViewShell) ? DEFINE_CONST_UNICODE("SfxViewShell") :
+ pSh->ISA(SfxObjectShell) ? DEFINE_CONST_UNICODE("SfxObjectShell") : DEFINE_CONST_UNICODE("SfxShell") );
+ aIdent += 0x005B; // '[' = 5Bh
+ aIdent += pSh->GetName();
+ aIdent += 0x005D; // ']' = 5Dh
+ return aIdent;
+}
+
+#endif
+//====================================================================
+
+void __EXPORT SfxShell::EmptyExecStub(SfxShell *, SfxRequest &)
+{
+}
+
+void __EXPORT SfxShell::EmptyStateStub(SfxShell *, SfxItemSet &)
+{
+}
+
+SfxShell::SfxShell()
+
+/* [Beschreibung]
+
+ Der Konstruktor der Klasse SfxShell initialisierung nur einfache
+ Typen, das dazugeh"orige SbxObject wird erst on-demand erzeugt.
+ Daher ist das Anlegen einer SfxShell Instanz sehr billig.
+*/
+
+: pPool(0),
+ pUndoMgr(0),
+ pImp(0)
+{
+ DBG_CTOR(SfxShell, 0);
+ pImp = new SfxShell_Impl;
+ pImp->pViewSh = 0;
+ pImp->pFrame = 0;
+ pImp->pVerbs = 0;
+ pImp->pRepeatTarget = 0;
+ pImp->bInAppBASIC = FALSE;
+ pImp->nHelpId = 0L;
+ pImp->bActive = FALSE;
+ pImp->nDisableFlags = 0;
+}
+
+//-------------------------------------------------------------------------
+
+SfxShell::SfxShell( SfxViewShell *pViewSh )
+
+/* [Beschreibung]
+
+ Der Konstruktor der Klasse SfxShell initialisierung nur einfache
+ Typen, das dazugeh"orige SbxObject wird erst on-demand erzeugt.
+ Daher ist das Anlegen einer SfxShell Instanz sehr billig.
+*/
+
+: pPool(0),
+ pUndoMgr(0),
+ pImp(0)
+{
+ DBG_CTOR(SfxShell, 0);
+ pImp = new SfxShell_Impl;
+ pImp->pViewSh = pViewSh;
+ pImp->pFrame = 0;
+ pImp->pVerbs = 0;
+ pImp->pRepeatTarget = 0;
+ pImp->bInAppBASIC = FALSE;
+ pImp->nHelpId = 0L;
+ pImp->bActive = FALSE;
+}
+
+//--------------------------------------------------------------------
+
+SfxShell::~SfxShell()
+
+/* [Beschreibung]
+
+ Die Verbindungs zu einem ggf. zugeh"origen SbxObject wird gel"ost.
+ Das SbxObject existiert ggf. weiter, kann aber keine Funktionen
+ mehr ausf"uhren und keine Properties mehr bereitstellen.
+*/
+
+{
+ DBG_DTOR(SfxShell, 0);
+ delete pImp->pVerbs;
+ delete pImp;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::SetName( const String &rName )
+
+/* [Beschreibung]
+
+ Setzt den Namen des Shell-Objekts. Mit diesem Namen kann die
+ SfxShell-Instanz vom BASIC aus angesprochen werden.
+*/
+
+{
+ pImp->aObjectName = rName;
+}
+
+//--------------------------------------------------------------------
+
+const String& SfxShell::GetName() const
+
+/* [Beschreibung]
+
+ Liefert den Namen des Shell-Objekts. Mit diesem Namen kann die
+ SfxShell-Instanz vom BASIC aus angesprochen werden.
+*/
+
+{
+ return pImp->aObjectName;
+}
+
+//--------------------------------------------------------------------
+
+SvGlobalName SfxShell::GetGlobalName() const
+
+/* [Beschreibung]
+
+ Liefert den Global Unique Identifier des Shell-Objekts. Mit diesem
+ Namen kann die SfxShell-Instanz z.B. via OLE Automation angesprochen
+ werden, bzw. in der Registration-Database gefunden werden.
+*/
+
+{
+ return SvGlobalName();
+}
+
+//--------------------------------------------------------------------
+
+SfxDispatcher* SfxShell::GetDispatcher() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert einen Pointer auf den <SfxDispatcher>, in
+ dem die SfxShell gerade <UI-aktiv> ist bzw. einen 0-Pointer, wenn
+ sie gerade nicht UI-aktiv ist.
+
+ Der zur"uckgegebene Pointer ist nur im unmittelbaren Kontext des
+ Methodenaufrufs g"ultig.
+*/
+
+{
+ return pImp->pFrame ? pImp->pFrame->GetDispatcher() : 0;
+}
+
+//--------------------------------------------------------------------
+
+SfxViewShell* SfxShell::GetViewShell() const
+
+/* [Beschreibung]
+
+ Liefert bei SubShells die SfxViewShell, in der sie liegen. Sonst und
+ falls nicht vom App-Entwickler angegeben liefert diese Methode 0.
+*/
+
+{
+ return pImp->pViewSh;
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFrame* SfxShell::GetFrame() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert einen Pointer auf den <SfxViewFrame>, dem diese
+ SfxShell-Instanz zugeordnet ist oder in dem sie zur Zeit <UI-aktiv> ist.
+ Ein 0-Pointer wird geliefert, wenn diese SfxShell-OInstanz gerade nicht
+ UI-aktiv ist und auch keinem SfxViewFrame fest zugeordnet ist.
+
+ Der zur"uckgegebene Pointer ist nur im unmittelbaren Kontext des
+ Methodenaufrufs g"ultig.
+
+
+ [Anmerkung]
+
+ Nur Instanzen von Subklasse von SfxApplication und SfxObjectShell sollten
+ hier einen 0-Pointer liefern. Ansonsten liegt ein Fehler im Anwendungs-
+ programm vor (falscher Ctor von SfxShell gerufen).
+
+
+ [Querverweise]
+
+ <SfxViewShell::GetViewFrame()const>
+*/
+
+{
+ if ( pImp->pFrame )
+ return pImp->pFrame;
+ if ( pImp->pViewSh )
+ return pImp->pViewSh->GetViewFrame();
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+const SfxPoolItem* SfxShell::GetItem
+(
+ USHORT nSlotId // Slot-Id des zu erfragenden <SfxPoolItem>s
+) const
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann auf beliebige Objekte von Subklassen von
+ <SfxPoolItem> zugegriffen werden. Diese Austauschtechnik wird ben"otigt,
+ wenn z.B. spezielle <SfxToolBoxControl> Subklassen Zugriff auf
+ bestimmte Daten z.B. der <SfxObjectShell> ben"otigen.
+
+ Die zur"uckgelieferte Instanz geh"ort der jeweilige SfxShell und
+ darf nur im unmittelbaren Kontext des Methodenaufrufs verwendet werden.
+
+
+ [Querverweise]
+
+ <SfxShell::PutItem(const SfxPoolItem&)>
+ <SfxShell::RemoveItem(USHORT)>
+*/
+
+{
+ for ( USHORT nPos = 0; nPos < pImp->aItems.Count(); ++nPos )
+ if ( pImp->aItems.GetObject(nPos)->Which() == nSlotId )
+ return pImp->aItems.GetObject(nPos);
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::RemoveItem
+(
+ USHORT nSlotId // Slot-Id des zu l"oschenden <SfxPoolItem>s
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode k"onnen die allgemein zur Verf"ugung gestellten
+ Instanzen von Subklassen von <SfxPoolItem> aus der SfxShell entfernt
+ werden.
+
+ Die gespeicherte Instanz wird gel"oscht.
+
+
+ [Querverweise]
+
+ <SfxShell::PutItem(const SfxPoolItem&)>
+ <SfxShell::GetItem(USHORT)>
+*/
+
+{
+ for ( USHORT nPos = 0; nPos < pImp->aItems.Count(); ++nPos )
+ if ( pImp->aItems.GetObject(nPos)->Which() == nSlotId )
+ {
+ // Item entfernen und l"oschen
+ SfxPoolItem *pItem = pImp->aItems.GetObject(nPos);
+ delete pItem;
+ pImp->aItems.Remove(nPos);
+
+ // falls aktiv Bindings benachrichtigen
+ SfxDispatcher *pDispat = GetDispatcher();
+ if ( pDispat )
+ {
+ SfxVoidItem aVoid( nSlotId );
+ pDispat->GetBindings()->Broadcast( SfxPoolItemHint( &aVoid ) );
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::PutItem
+(
+ const SfxPoolItem& rItem /* Instanz, von der eine Kopie erstellt wird,
+ die in der SfxShell in einer Liste
+ gespeichert wird. */
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode k"onnen beliebige Objekte von Subklassen von
+ <SfxPoolItem> zur Verf"ugung gestellt werden. Diese Austauschtechnik
+ wird ben"otigt, wenn z.B. spezielle <SfxToolBoxControl> Subklassen
+ Zugriff auf bestimmte Daten z.B. der <SfxObjectShell> ben"otigen.
+
+ Falls ein SfxPoolItem mit derselben Slot-Id exisitert, wird dieses
+ automatisch gel"oscht.
+
+
+ [Querverweise]
+
+ <SfxShell::RemoveItem(USHORT)>
+ <SfxShell::GetItem(USHORT)>
+*/
+
+{
+ DBG_ASSERT( !rItem.ISA(SfxSetItem), "SetItems aren't allowed here" );
+ DBG_ASSERT( SfxItemPool::IsSlot( rItem.Which() ),
+ "items with Which-Ids aren't allowed here" );
+
+ // MSC auf WNT/W95 machte hier Mist, Vorsicht bei Umstellungen
+ const SfxPoolItem *pItem = rItem.Clone();
+ SfxPoolItemHint aItemHint( (SfxPoolItem*) pItem );
+ const USHORT nWhich = rItem.Which();
+ SfxPoolItem **ppLoopItem = (SfxPoolItem**) pImp->aItems.GetData();
+ USHORT nPos;
+ for ( nPos = 0; nPos < pImp->aItems.Count(); ++nPos, ++ppLoopItem )
+ {
+ if ( (*ppLoopItem)->Which() == nWhich )
+ {
+ // Item austauschen
+ delete *ppLoopItem;
+ pImp->aItems.Remove(nPos);
+ pImp->aItems.Insert( (SfxPoolItemPtr) pItem, nPos );
+
+ // falls aktiv Bindings benachrichtigen
+ SfxDispatcher *pDispat = GetDispatcher();
+ if ( pDispat )
+ pDispat->GetBindings()->Broadcast( aItemHint );
+ return;
+ }
+ }
+
+ Broadcast( aItemHint );
+ pImp->aItems.Insert((SfxPoolItemPtr)pItem, nPos );
+}
+
+//--------------------------------------------------------------------
+
+SfxInterface* SfxShell::GetInterface() const
+
+/* [Beschreibung]
+
+ Mit dieser virtuellen Methode, die durch das Makro <SFX_DECL_INTERFACE>
+ von jeder Subclass mit eigenen Slots automatisch "uberladen wird, kann
+ auf die zu der Subklasse geh"orende <SfxInterface>-Instanz zugegriffen
+ werden.
+
+ Die Klasse SfxShell selbst hat noch kein eigenes SfxInterface
+ (keine Slots), daher wird ein 0-Pointer zur"uckgeliefert.
+*/
+
+{
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+SfxBroadcaster* SfxShell::GetBroadcaster()
+
+/* [Beschreibung]
+
+ Liefert einen SfxBroadcaster f"ur diese SfxShell-Instanz bis die
+ Klasse SfxShell von SfxBroadcaster abgeleitet ist.
+*/
+
+{
+ return pImp;
+}
+
+//--------------------------------------------------------------------
+
+SfxUndoManager* SfxShell::GetUndoManager()
+
+/* [Beschreibung]
+
+ Jede Subclass von SfxShell kann "uber einen <SfxUndoManager> verf"ugen.
+ Dieser kann in den abgeleiteten Klasse mit <SfxShell:SetUndoManager()>
+ gesetzt werden.
+
+ Die Klasse SfxShell selbst hat noch keinen SfxUndoManager, es wird
+ daher ein 0-Pointer zur"uckgeliefert.
+*/
+
+{
+ return pUndoMgr;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::SetUndoManager( SfxUndoManager *pNewUndoMgr )
+
+/* [Beschreibung]
+
+ Setzt einen <SfxUndoManager> f"ur diese <SfxShell> Instanz. F"ur das
+ Undo wird immer nur der Undo-Manager an der jeweils oben auf dem
+ Stack des <SfxDispatcher> liegenden SfxShell verwendet.
+
+ Am "ubergebenen <SfxUndoManager> wird automatisch die aktuelle
+ Max-Undo-Action-Count Einstellung aus den Optionen gesetzt.
+
+ 'pNewUndoMgr' mu\s bis zum Dtor dieser SfxShell-Instanz oder bis
+ zum n"achsten 'SetUndoManager()' existieren.
+*/
+
+{
+ pUndoMgr = pNewUndoMgr;
+ if ( pUndoMgr )
+ pUndoMgr->SetMaxUndoActionCount( SFX_APP()->GetOptions().GetUndoCount() );
+}
+
+//--------------------------------------------------------------------
+
+SfxRepeatTarget* SfxShell::GetRepeatTarget() const
+
+/* [Beschreibung]
+
+ Liefert einen Pointer auf die <SfxRepeatTarget>-Instanz, die
+ als RepeatTarget bei SID_REPEAT verwendet wird, wenn der
+ von dieser SfxShell gelieferte <SfxUndoManager> angesprochen wird.
+ Der R"uckgabewert kann 0 sein.
+
+
+ [Anmerkung]
+
+ Eine Ableitung von <SfxShell> oder einer ihrer Subklassen von
+ <SfxRepeatTarget> ist nicht zu empfehlen, da Compiler-Fehler
+ provoziert werden (wegen Call-to-Pointer-to-Member-Function to
+ subclass).
+*/
+
+{
+ return pImp->pRepeatTarget;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::SetRepeatTarget( SfxRepeatTarget *pTarget )
+
+/* [Beschreibung]
+
+ Setzt den die <SfxRepeatTarget>-Instanz, die bei SID_REPEAT als
+ RepeatTarget verwendet wird, wenn der von dieser SfxShell gelieferte
+ <SfxUndoManager> angesprochen wird. Durch 'pTarget==0' wird SID_REPEAT
+ f"ur diese SfxShell disabled. Die Instanz '*pTarget' mu\s so lange
+ leben, wie sie angemeldet ist.
+
+
+ [Anmerkung]
+
+ Eine Ableitung von <SfxShell> oder einer ihrer Subklassen von
+ <SfxRepeatTarget> ist nicht zu empfehlen, da Compiler-Fehler
+ provoziert werden (wegen Call-to-Pointer-to-Member-Function to
+ subclass).
+*/
+
+{
+ pImp->pRepeatTarget = pTarget;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::Invalidate
+(
+ USHORT nId /* Zu invalidierende Slot-Id oder Which-Id.
+ Falls diese 0 ist (default), werden
+ alle z.Zt. von dieser Shell bedienten
+ Slot-Ids invalidiert. */
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode k"onnen Slots der Subclasses "uber die Slot-Id
+ oder alternativ "uber die Which-Id invalidiert werden. Slot-Ids,
+ die von der Subclass ererbt sind, werden ebenfalls invalidert.
+
+ [Querverweise]
+ <SfxBindings::Invalidate(USHORT)>
+ <SfxBindings::InvalidateAll(BOOL)>
+*/
+
+{
+ if ( !GetViewShell() )
+ {
+#if SUPD>603
+ DBG_ERROR( "wrong Invalidate method called!" );
+#endif
+ return;
+ }
+
+ Invalidate_Impl( GetViewShell()->GetViewFrame()->GetBindings(), nId );
+}
+
+void SfxShell::Invalidate_Impl( SfxBindings& rBindings, USHORT nId )
+{
+ if ( nId == 0 )
+ {
+ rBindings.InvalidateShell( *this, FALSE );
+ }
+ else
+ {
+ const SfxInterface *pIF = GetInterface();
+ do
+ {
+ const SfxSlot *pSlot = pIF->GetSlot(nId);
+ if ( pSlot )
+ {
+ // bei Enum-Slots ist der Master-Slot zu invalidieren
+ if ( SFX_KIND_ENUM == pSlot->GetKind() )
+ pSlot = pSlot->GetLinkedSlot();
+
+ // den Slot selbst und ggf. auch alle Slave-Slots invalidieren
+ rBindings.Invalidate( pSlot->GetSlotId() );
+ for ( const SfxSlot *pSlave = pSlot->GetLinkedSlot();
+ pSlave && pIF->ContainsSlot_Impl( pSlave ) &&
+ pSlave->GetLinkedSlot() == pSlot;
+ ++pSlave )
+ rBindings.Invalidate( pSlave->GetSlotId() );
+
+ return;
+ }
+
+ pIF = pIF->GetGenoType();
+ }
+
+ while ( pIF );
+
+ DBG_WARNING( "W3: invalidating slot-id unknown in shell" );
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::DoActivate( SfxViewFrame *pFrame, BOOL bMDI )
+
+/* [Beschreibung]
+
+ Diese Methode steuert die Aktivierung der SfxShell-Instanz. Zun"achst
+ wird durch Aufruf der virtuellen Methode <SfxShell::Activate(BOOL)>
+ der Subclass die M"oglichkeit gegeben, auf das Event zu reagieren.
+
+ Bei bMDI == TRUE wird das zugeh"orige SbxObject 'scharfgeschaltet',
+ so da\s Methoden des Objekts unqualifiziert (ohne den Namen des Objekts)
+ vom BASIC gefunden werden.
+*/
+
+{
+#ifndef PRODUCT
+ const SfxInterface *p_IF = GetInterface();
+ if ( !p_IF )
+ return;
+#endif
+#ifdef DBG_UTIL_VB
+ String aMsg("SfxShell::DoActivate() ");
+ aMsg += (long)this;
+ aMsg += " ";
+ aMsg += GetInterface()->GetName();
+ aMsg += " bMDI ";
+ if ( bMDI ) aMsg += "MDI";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+
+ if ( bMDI )
+ {
+ // Frame merken, in dem aktiviert wird
+ pImp->pFrame = pFrame;
+ pImp->bActive = TRUE;
+ }
+
+ // Subklasse benachrichtigen
+ Activate(bMDI);
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::DoDeactivate( SfxViewFrame *pFrame, BOOL bMDI )
+
+/* [Beschreibung]
+
+ Diese Methode steuert die Deaktivierung der SfxShell-Instanz. Bei
+ bMDI == TRUE wird zun"achst das SbxObject in einen Status versetzt,
+ so da\s Methoden vom BASIC aus nur noch qualifiziert gerufen werden
+ k"onnen.
+
+ Dann erh"alt in jedem Fall die Subclass durch Aufruf der virtuellen
+ Methode <SfxShell::Deactivate(BOOL)> die M"oglichkeit auf das Event
+ zu reagieren.
+*/
+
+{
+#ifndef PRODUCT
+ const SfxInterface *p_IF = GetInterface();
+ if ( !p_IF )
+ return;
+#endif
+#ifdef DBG_UTIL_VB
+ String aMsg("SfxShell::DoDeactivate()");
+ aMsg += (long)this;
+ aMsg += " ";
+ aMsg += GetInterface()->GetName();
+ aMsg += " bMDI ";
+ if ( bMDI ) aMsg += "MDI";
+ DbgTrace( aMsg.GetBuffer() );
+#endif
+
+ // nur wenn er vom Frame kommt (nicht z.B. pop der BASIC-IDE vom AppDisp)
+ if ( bMDI && pImp->pFrame == pFrame )
+ {
+ // austragen
+ pImp->pFrame = 0;
+ pImp->bActive = FALSE;
+ }
+
+ // Subklasse benachrichtigen
+ Deactivate(bMDI);
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxShell::IsActive() const
+{
+ return pImp->bActive;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::Activate
+(
+ BOOL bMDI /* TRUE
+ der <SfxDispatcher>, auf dem die SfxShell sich
+ befindet, ist aktiv geworden oder die SfxShell
+ Instanz wurde auf einen aktiven SfxDispatcher
+ gepusht. (vergl. SystemWindow::IsMDIActivate())
+
+ FALSE
+ das zum <SfxViewFrame>, auf dessen SfxDispatcher
+ sich die SfxShell Instanz befindet, wurde
+ aktiviert.
+ (z.B. durch einen geschlossenen Dialog) */
+)
+
+/* [Beschreibung]
+
+ Virtuelle Methode, die beim Aktivieren der SfxShell Instanz gerufen
+ wird, um den Subclasses die Gelegenheit zu geben, auf das Aktivieren
+ zu reagieren.
+
+ Die Basisimplementation ist leer und braucht nicht gerufen zu werden.
+
+
+ [Querverweise]
+ StarView SystemWindow::Activate(BOOL)
+*/
+
+{
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::Deactivate
+(
+ BOOL bMDI /* TRUE
+ der <SfxDispatcher>, auf dem die SfxShell sich
+ befindet, ist inaktiv geworden oder die SfxShell
+ Instanz wurde auf einen aktiven SfxDispatcher
+ gepoppt. (vergl. SystemWindow::IsMDIActivate())
+
+ FALSE
+ das zum <SfxViewFrame>, auf dessen SfxDispatcher
+ sich die SfxShell Instanz befindet, wurde
+ deaktiviert. (z.B. durch einen Dialog) */
+
+)
+
+/* [Beschreibung]
+
+ Virtuelle Methode, die beim Deaktivieren der SfxShell Instanz gerufen
+ wird, um den Subclasses die Gelegenheit zu geben, auf das Deaktivieren
+ zu reagieren.
+
+ Die Basisimplementation ist leer und braucht nicht gerufen zu werden.
+
+
+ [Querverweise]
+ StarView SystemWindow::Dectivate(BOOL)
+*/
+
+{
+}
+
+void SfxShell::ParentActivate
+(
+)
+
+/* [Beschreibung]
+
+ Ein Parent des <SfxDispatcher>, auf dem die SfxShell sich befindet,
+ ist aktiv geworden, oder die SfxShell Instanz wurde auf einen
+ <SfxDispatcher> gepusht, dessen parent aktiv ist.
+
+ Die Basisimplementation ist leer und braucht nicht gerufen zu werden.
+
+ [Querverweise]
+ SfxShell::Activate()
+*/
+{
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::ParentDeactivate
+(
+)
+
+/* [Beschreibung]
+
+ Der aktive Parent des <SfxDispatcher>, auf dem die SfxShell sich befindet,
+ ist deaktiviert worden.
+
+ Die Basisimplementation ist leer und braucht nicht gerufen zu werden.
+
+ [Querverweise]
+ SfxShell::Deactivate()
+*/
+{
+}
+
+//--------------------------------------------------------------------
+#if 0
+// falls noch mal "pure virtual function called" auf dem MAC:
+// Bitte MAC nicht mehr unterstuetzen
+// der MPW-Linker will die immer haben, obwohl pure virtual
+
+#ifdef MAC
+extern "C"
+{
+ void debugstr( char *pMsg );
+}
+#endif
+
+SfxItemPool& SfxShell::GetPool()
+{
+ debugstr( "pure virtual function called: SfxShell::GetPool()" );
+ SfxItemPool aPool(0,0);
+ return aPool;
+}
+
+#endif
+
+//--------------------------------------------------------------------
+
+void SfxShell::FillStatusBar( StatusBar& )
+
+/* [Beschreibung]
+
+ Mit dieser Factory-Methode kann der Applikationsprogrammierer einer
+ SfxShell-Subklasse eine eigene Statusbar zuweisen. Der SFx bevorzugt
+ jeweils die Statusbar einer weiter oben auf den <SfxDispatcher>-Stack
+ liegenden SfxShell.
+
+ Die Basisimplementation ist leer und braucht nicht gerufen zu werden.
+
+*/
+
+{
+}
+
+//--------------------------------------------------------------------
+
+ResMgr* SfxShell::GetResMgr() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert den ResMgr der <Resource-DLL>, die von der
+ SfxShell-Instanz verwendet wird. Ist dies ein 0-Pointer, so
+ ist der aktuelle Resource-Manager zu verwenden.
+*/
+
+{
+ return GetInterface()->GetResMgr();
+}
+
+//--------------------------------------------------------------------
+
+FASTBOOL SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
+
+/* [Beschreibung]
+
+ Diese Methode stellt durch Aufruf der Statusfunktion fest,
+ ob 'rSlot' aktuell ausgef"uhrt werden kann.
+*/
+{
+ // Slot-Status holen
+ SfxItemPool &rPool = GetPool();
+ const USHORT nId = rSlot.GetWhich( rPool );
+ SfxItemSet aSet(rPool, nId, nId);
+ SfxStateFunc pFunc = rSlot.GetStateFnc();
+ CallState( pFunc, aSet );
+ return aSet.GetItemState(nId) != SFX_ITEM_DISABLED;
+}
+
+//--------------------------------------------------------------------
+#if 0
+ULONG SfxShell::ExecuteSlot
+(
+ USHORT nSlot, // In: auszuf"uhrender Slot
+ USHORT nMemberId, // In: MemberId f"ur strukturierte Items
+ SbxVariable& rRet, // Out: Returnwert
+ SbxBase* pArgs // In: 0, einzelner Parameter/Parameterliste
+)
+
+/* [Beschreibung]
+
+ Methode zum Ausf"uhren eines <SfxSlot>s von einem SfxShellObject
+ (BASIC oder andere API).
+
+ Aufrufe von APIs werden nicht recorded (ist ja auch kein <SfxDispatcher>).
+
+
+ [R"uckgabewert]
+
+ ULONG ErrorCode
+*/
+
+{
+ // Slot suchen
+ const SfxSlot *pSlot = GetInterface()->GetSlot(nSlot);
+ if ( !pSlot )
+ return SbxERR_PROC_UNDEFINED;
+
+ // ggf. disabled
+ if ( !pSlot->IsMode(SFX_SLOT_FASTCALL) && !CanExecuteSlot_Impl(*pSlot) )
+ return SbERR_METHOD_FAILED;
+
+ // "ofters ben"otigte Werte
+ SfxItemPool &rPool = GetPool();
+ SfxMapUnit eUserMetric = SFX_APP()->GetOptions().GetUserMetric();
+
+ // Returnwert zum sp"ateren Aufbereiten als SbxVariable merken
+ BOOL bDone = FALSE; // Return nur auswerten, wenn nicht abgebrochen wurde
+ const SfxPoolItem *pRetItem = 0;
+ SbxObject *pOwnObject = GetSbxObject(); // Hack fuer #22783
+
+ // aktuelle Parameter oder Property (impliziter Parameter)?
+ if ( pArgs || pSlot->IsMode(SFX_SLOT_PROPSET) )
+ {
+ // aktuelle Parameter in diesem ItemSet sammeln
+ SfxAllItemSet aSet( rPool );
+
+ // mehrere Parameter?
+ if ( pSlot->IsMode(SFX_SLOT_METHOD) )
+ {
+ // das kann nur ein Methoden-Slot sein
+ DBG_ASSERT( !pArgs || pArgs->ISA(SbxArray), "not an SbxArray as arguments" );
+
+ // "uber die formalen Parameter iterieren
+ USHORT nFormalArgs = pSlot->GetFormalArgumentCount();
+ USHORT nActualArgs = pArgs ? ((SbxArray*)pArgs)->Count() - 1 : 0;
+ USHORT nBasicArg = 0;
+ for ( USHORT nArg = 0;
+ nArg < nFormalArgs && nBasicArg < nActualArgs;
+ ++nArg )
+ {
+ // formale Paramterbeschreibung besorgen
+ const SfxFormalArgument &rArg = pSlot->GetFormalArgument(nArg);
+
+ // Item per Factory erzeugen
+ SfxPoolItem *pItem = rArg.CreateItem();
+ DBG_ASSERT( pItem, "item without factory" );
+ pItem->SetWhich( rPool.GetWhich(rArg.nSlotId) );
+
+ // Konvertieren / ggf. strukturierte Items zusammensetzen
+ ULONG eErr = 0;
+ USHORT nSubCount = rArg.pType->nAttribs;
+ if ( !nSubCount )
+ {
+ // einfaches Item
+ SbxVariable *pSubArg = ((SbxArray*)pArgs)->Get(++nBasicArg);
+ eErr = rPool.SetVariable( *pItem, *pSubArg, eUserMetric );
+ }
+ else
+ {
+ // strukturiertes Item
+ for ( USHORT n = 1; n <= nSubCount && !eErr; ++n )
+ {
+ SbxVariable *pSubArg = ((SbxArray*)pArgs)->Get(++nBasicArg);
+ pSubArg->SetUserData(
+ long(rArg.pType->aAttrib[n-1].nAID) << 20 );
+ eErr = rPool.SetVariable( *pItem, *pSubArg, eUserMetric );
+ }
+ }
+
+ // falls Item erzeugt werden konnte, an Request anh"angen
+ if ( 0 == eErr )
+ aSet.Put( *pItem,pItem->Which() );
+ delete pItem; //! Optimieren (Put mit direkter Uebernahme)
+ if ( 0 != eErr )
+ return eErr;
+ }
+
+ // nicht alle Parameter abger"aumt (zuviele)?
+ if ( nBasicArg < nActualArgs )
+ return SbxERR_WRONG_ARGS;
+ }
+ else
+ {
+ // Instanz von SfxPoolItem-Subklasse besorgen/erzeugen
+ SfxPoolItem *pItem = 0;
+
+ // Teil eines strukturiertes Items?
+ if ( nMemberId )
+ {
+ // => Status-Item besorgen
+ const SfxPoolItem *pState = GetSlotState(nSlot);
+ if ( pState && !pState->ISA(SfxVoidItem) )
+ pItem = pState->Clone();
+ }
+
+ // kein StatusItem oder einfaches/komplexes Item
+ if ( !pItem )
+ {
+ // per Factory erzeugen
+ pItem = pSlot->GetType()->CreateItem();
+ DBG_ASSERT( pItem, "item without factory" );
+ pItem->SetWhich( rPool.GetWhich(nSlot) );
+ }
+
+ // Daten aus Variable in das Item "ubertragen
+ ULONG eErr = rPool.SetVariable( *pItem, rRet, eUserMetric );
+ if ( 0 == eErr )
+ aSet.Put( *pItem,pItem->Which() );
+ delete pItem; //! Optimieren (Put mit direkter Uebernahme)
+ if ( 0 != eErr )
+ return eErr;
+ }
+
+ // via Request mit 'normaler' Execute-Methode ausf"uhren
+ SfxRequest aReq( nSlot, SFX_CALLMODE_API, aSet );
+ aSet.ClearItem(); // pPool k"onnte in _Execute sterben
+ SfxExecFunc pFunc = pSlot->GetExecFnc();
+ CallExec( pFunc, aReq );
+ bDone = aReq.IsDone();
+ pRetItem = aReq.GetReturnValue();
+ }
+ else
+ {
+ // ohne Parameter direkt ausf"uhren
+ SfxRequest aReq( nSlot, SFX_CALLMODE_API, GetPool() );
+// SfxRequest aReq( nSlot, GetPool(), TRUE );
+ SfxExecFunc pFunc = pSlot->GetExecFnc();
+ CallExec( pFunc, aReq );
+ bDone = aReq.IsDone();
+ pRetItem = aReq.GetReturnValue();
+ }
+
+ // in IDL ein Return-Wert angegeben?
+ if ( pSlot->IsMode(SFX_SLOT_METHOD) && rRet.GetType() != SbxVOID )
+ {
+ // ist aber kein Returnwert gesetzt worden?
+ if ( !pRetItem || pRetItem->ISA(SfxVoidItem) )
+ {
+ // Ignore ohne Parameter ist erlaubt und auch normal
+ if ( !bDone )
+ return 0;
+
+ // sonst mu\s einer gesetzt worden sein
+ DBG_ERROR( "IDL hat Return-Wert, Execute-Methode setzt aber keinen!" );
+ return SbxERR_CONVERSION;
+ }
+
+ // Returnwert in SbxVariable packen
+ HACK( #22783 - lebt *this noch? )
+ if ( ((SfxShellObject*)pOwnObject)->GetShell() )
+ GetPool().FillVariable( *pRetItem, rRet, eUserMetric );
+ else
+ pRetItem->FillVariable( rRet, eUserMetric, eUserMetric );
+ }
+
+ return 0;
+}
+#endif
+
+long ShellCall_Impl( void* pObj, void* pArg )
+{
+ ((SfxShell* )pObj)->ExecuteSlot( *(SfxRequest*)pArg, (SfxInterface*)0L );
+ return 0;
+}
+
+/* [Beschreibung]
+ Asynchrones ExecuteSlot fuer das RELOAD
+ */
+
+//--------------------------------------------------------------------
+const SfxPoolItem* SfxShell::ExecuteSlot( SfxRequest& rReq, BOOL bAsync )
+{
+ if( !bAsync )
+ return ExecuteSlot( rReq, (SfxInterface*)0L );
+ else
+ {
+ if( !pImp->pExecuter )
+ pImp->pExecuter = new AsynchronLink(
+ Link( this, ShellCall_Impl ) );
+ pImp->pExecuter->Call( new SfxRequest( rReq ) );
+ return 0;
+ }
+}
+
+const SfxPoolItem* SfxShell::ExecuteSlot
+(
+ SfxRequest &rReq, // der weiterzuleitende <SfxRequest>
+ const SfxInterface* pIF // default = 0 bedeutet virtuell besorgen
+)
+
+/* [Beschreibung]
+
+ Diese Methode erm"oglicht das Weiterleiten eines <SfxRequest> an
+ die angegebene Basis-<SfxShell>.
+
+
+ [Beispiel]
+
+ In einer von SfxViewShell abgeleiteten Klasse soll SID_PRINTDOCDIRECT
+ abgefangen werden. Unter bestimmten Umst"anden soll vor dem Drucken
+ eine Abfrage erscheinen, und der Request soll ggf. abgebrochen werden.
+
+ Dazu ist in der IDL dieser Subklasse der o.g. Slot einzutragen. Die
+ Execute-Methode enth"alt dann skizziert:
+
+ void SubViewShell::Exec( SfxRequest &rReq )
+ {
+ if ( rReq.GetSlot() == SID_PRINTDOCDIRECT )
+ {
+ 'dialog'
+ if ( 'condition' )
+ ExecuteSlot( rReq, SfxViewShell::GetInterface() );
+ }
+ }
+
+ Es braucht i.d.R. kein rReq.Done() gerufen zu werden, da das bereits
+ die Implementierung der SfxViewShell erledigt bzw. abgebrochen wurde.
+
+
+ [Querverweise]
+
+ <SfxShell::GetSlotState(USHORT,const SfxInterface*,SfxItemSet*)>
+*/
+
+{
+ if ( !pIF )
+ pIF = GetInterface();
+ const SfxSlot *pSlot = pIF->GetSlot(rReq.GetSlot());
+ DBG_ASSERT( pSlot, "slot not supported" );
+
+ SfxExecFunc pFunc = pSlot->GetExecFnc();
+ CallExec( pFunc, rReq );
+
+ return rReq.GetReturnValue();
+}
+
+//--------------------------------------------------------------------
+
+const SfxPoolItem* SfxShell::GetSlotState
+(
+ USHORT nSlotId, // Slot-Id des zu befragenden Slots
+ const SfxInterface* pIF, // default = 0 bedeutet virtuell besorgen
+ SfxItemSet* pStateSet // SfxItemSet der Slot-State-Methode
+)
+
+/* [Beschreibung]
+
+ Diese Methode liefert den Status des Slots mit der angegebenen Slot-Id
+ "uber das angegebene Interface.
+
+ Ist der Slot disabled oder in dieser SfxShell (und deren Parent-Shells)
+ nicht bekannt, wird ein 0-Pointer zur"uckgeliefert.
+
+ Hat der Slot keinen Status, wird ein SfxVoidItem zur"uckgeliefert.
+
+ Der Status wird bei pStateSet != 0 gleich in diesem Set gesetzt, so
+ da\s <SfxShell>-Subklassen Slots-"uberladen und auch bei der
+ Status-Methode die Basis-Implementierung rufen k"onnen.
+
+
+ [Beispiel]
+
+ In einer von SfxViewShell abgeleiteten Klasse soll SID_PRINTDOCDIRECT
+ abgefangen werden. Unter bestimmten Umst"anden soll vor dem Drucken
+ eine Abfrage erscheinen, und der Request soll ggf. abgebrochen werden.
+
+ Dazu ist in der IDL dieser Subklasse der o.g. Slot einzutragen. Die
+ Status-Methode enth"alt dann skizziert:
+
+ void SubViewShell::PrintState( SfxItemSet &rState )
+ {
+ if ( rState.GetItemState( SID_PRINTDOCDIRECT ) != SFX_ITEM_UNKNOWN )
+ GetSlotState( SID_PRINTDOCDIRECT, SfxViewShell::GetInterface(),
+ &rState );
+ ...
+ }
+
+
+ [Querverweise]
+
+ <SfxShell::ExecuteSlot(SfxRequest&)>
+*/
+
+{
+ // Slot am angegebenen Interface besorgen
+ if ( !pIF )
+ pIF = GetInterface();
+ SfxItemState eState;
+ SfxItemPool &rPool = GetPool();
+ const SfxSlot *pSlot = pIF->GetSlot(nSlotId);
+ if ( pSlot )
+ // ggf. auf Which-Id mappen
+ nSlotId = pSlot->GetWhich( rPool );
+
+ // Item und Item-Status besorgen
+ const SfxPoolItem *pItem;
+ SfxItemSet aSet( rPool, nSlotId, nSlotId ); // pItem stirbt sonst zu fr"uh
+ if ( pSlot )
+ {
+ // Status-Methode rufen
+ SfxStateFunc pFunc = pSlot->GetStateFnc();
+ CallState( pFunc, aSet );
+ eState = aSet.GetItemState( nSlotId, TRUE, &pItem );
+
+ // ggf. Default-Item besorgen
+ if ( eState == SFX_ITEM_DEFAULT )
+ {
+ if ( SfxItemPool::IsWhich(nSlotId) )
+ pItem = &rPool.GetDefaultItem(nSlotId);
+ else
+ eState = SFX_ITEM_DONTCARE;
+ }
+ }
+ else
+ eState = SFX_ITEM_UNKNOWN;
+
+ // Item und Item-Status auswerten und ggf. in pStateSet mitpflegen
+ SfxPoolItem *pRetItem = 0;
+ if ( eState <= SFX_ITEM_DISABLED )
+ {
+ if ( pStateSet )
+ pStateSet->DisableItem(nSlotId);
+ return 0;
+ }
+ else if ( eState == SFX_ITEM_DONTCARE )
+ {
+ if ( pStateSet )
+ pStateSet->ClearItem(nSlotId);
+ pRetItem = new SfxVoidItem(0);
+ }
+ else
+ {
+ if ( pStateSet && pStateSet->Put( *pItem ) )
+ return &pStateSet->Get( pItem->Which() );
+ pRetItem = pItem->Clone();
+ }
+ DeleteItemOnIdle(pRetItem);
+
+ return pRetItem;
+}
+
+//--------------------------------------------------------------------
+
+SFX_EXEC_STUB(SfxShell, VerbExec)
+SFX_STATE_STUB(SfxShell, VerbState)
+
+
+void SfxShell::SetVerbs(const SvVerbList* pVerbs)
+{
+ SfxViewShell *pViewSh = PTR_CAST ( SfxViewShell, this);
+
+ DBG_ASSERT(pViewSh, "SetVerbs nur an der ViewShell aufrufen!");
+
+ if (pImp->pVerbs)
+ {
+ // Zun"achst alle Statecaches dirty machen, damit keiner mehr versucht,
+ // die Slots zu benutzen
+
+ SfxBindings *pBindings =
+ pViewSh->GetViewFrame()->GetDispatcher()->GetBindings();
+ USHORT nCount = pImp->pVerbs->aSlotArr.Count();
+ for (USHORT n=0; n<nCount ; n++)
+ {
+ USHORT nId = SID_VERB_START + n;
+ pBindings->Invalidate(nId, FALSE, TRUE);
+ }
+
+ DELETEZ (pImp->pVerbs);
+ }
+
+ if (pVerbs)
+ pImp->pVerbs = new SfxVerbList();
+
+ if (pVerbs)
+ {
+ USHORT nr=0;
+ for (USHORT n=0; n<pVerbs->Count(); n++)
+ {
+ SfxSlot *pNewSlot = new SfxSlot;
+ USHORT nSlotId = SID_VERB_START + nr++;
+ DBG_ASSERT(nSlotId <= SID_VERB_END, "Zuviele Verben!");
+ if (nSlotId > SID_VERB_END)
+ break;
+
+ pNewSlot->nSlotId = nSlotId;
+ pNewSlot->nGroupId = 0;
+
+ // Verb-Slots m"ussen asynchron ausgef"uhrt werden, da sie w"ahrend
+ // des Ausf"uhrens zerst"ort werden k"onnten
+ pNewSlot->nFlags = SFX_SLOT_ASYNCHRON;
+ pNewSlot->nMasterSlotId = 0;
+ pNewSlot->nValue = 0;
+ pNewSlot->fnExec = SFX_STUB_PTR(SfxShell,VerbExec);
+ pNewSlot->fnState = SFX_STUB_PTR(SfxShell,VerbState);
+ pNewSlot->pType = 0; HACK(SFX_TYPE(SfxVoidItem))
+ pNewSlot->pName = U2S((*pVerbs)[n].GetName()).getStr();
+ pNewSlot->pLinkedSlot = 0;
+ pNewSlot->nArgDefCount = 0;
+ pNewSlot->pFirstArgDef = 0;
+ pNewSlot->pUnoName = 0;
+
+ if (pImp->pVerbs->aSlotArr.Count())
+ {
+ SfxSlot *pSlot = (pImp->pVerbs->aSlotArr)[0];
+ pNewSlot->pNextSlot = pSlot->pNextSlot;
+ pSlot->pNextSlot = pNewSlot;
+ }
+ else
+ pNewSlot->pNextSlot = pNewSlot;
+
+ pImp->pVerbs->aSlotArr.Insert(pNewSlot, n);
+ pImp->pVerbs->aVerbList.Insert((*pVerbs)[n], n);
+ }
+ }
+
+ if (pViewSh)
+ {
+ // Der Status von SID_OBJECT wird im Controller direkt an der Shell
+ // abgeholt, es reicht also, ein neues StatusUpdate anzuregen
+ SfxBindings *pBindings = pViewSh->GetViewFrame()->GetDispatcher()->
+ GetBindings();
+ pBindings->Invalidate( SID_OBJECT, TRUE, TRUE );
+ }
+}
+
+//--------------------------------------------------------------------
+
+const SvVerbList* SfxShell::GetVerbs() const
+{
+ return pImp->pVerbs ? &pImp->pVerbs->aVerbList : 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::VerbExec(SfxRequest& rReq)
+{
+ USHORT nId = rReq.GetSlot();
+ SfxViewShell *pViewShell = SfxViewShell::Current();
+ const SvVerbList* pList = pViewShell->GetVerbs();
+
+ for (USHORT n=0; n<pList->Count(); n++)
+ {
+ if (nId == SID_VERB_START + n)
+ {
+ pViewShell->DoVerb((*pList)[n].GetId());
+ rReq.Done();
+ return;
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::VerbState(SfxItemSet &rSet)
+{
+}
+
+//--------------------------------------------------------------------
+
+const SfxSlot* SfxShell::GetVerbSlot_Impl(USHORT nId) const
+{
+// DBG_ASSERT(pImp->pVerbs, "Keine Verben bekannt!");
+ if (!pImp->pVerbs)
+ return 0;
+
+ const SvVerbList& rList = pImp->pVerbs->aVerbList;
+
+ DBG_ASSERT(nId >= SID_VERB_START && nId <= SID_VERB_END,"Falsche VerbId!");
+ USHORT nIndex = nId - SID_VERB_START;
+ DBG_ASSERT(nIndex < rList.Count(),"Falsche VerbId!");
+
+ if (nIndex < rList.Count())
+ return pImp->pVerbs->aSlotArr[nIndex];
+ else
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+void SfxShell::SetHelpId(ULONG nId)
+{
+ pImp->nHelpId = nId;
+}
+
+//--------------------------------------------------------------------
+
+ULONG SfxShell::GetHelpId() const
+{
+ return pImp->nHelpId;
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectShell* SfxShell::GetObjectShell()
+{
+ if ( GetViewShell() )
+ return GetViewShell()->GetViewFrame()->GetObjectShell();
+ else
+ return NULL;
+}
+
+//--------------------------------------------------------------------
+
+SfxSlotPool& SfxShell::GetSlotPool_Impl() const
+{
+ return SFX_APP()->GetSlotPool( GetFrame() );
+}
+
+BOOL SfxShell::HasUIFeature( ULONG )
+{
+ return FALSE;
+}
+
+long DispatcherUpdate_Impl( void* pObj, void* pArg )
+{
+ ((SfxDispatcher*) pArg)->Update_Impl( TRUE );
+ return 0;
+}
+
+void SfxShell::UIFeatureChanged()
+{
+ SfxViewFrame *pFrame = GetFrame();
+ if ( pFrame && pFrame->IsVisible() )
+ {
+ // Auch dann Update erzwingen, wenn Dispatcher schon geupdated ist,
+ // sonst bleibt evtl. irgendwas in den gebunkerten Tools stecken.
+ // Asynchron aufrufen, um Rekursionen zu vermeiden
+ if ( !pImp->pUpdater )
+ pImp->pUpdater = new AsynchronLink( Link( this, DispatcherUpdate_Impl ) );
+
+ // Mehrfachaufrufe gestattet
+ pImp->pUpdater->Call( pFrame->GetDispatcher(), TRUE );
+ }
+}
+
+void SfxShell::SetDisableFlags( ULONG nFlags )
+{
+ pImp->nDisableFlags = nFlags;
+}
+
+ULONG SfxShell::GetDisableFlags() const
+{
+ return pImp->nDisableFlags;
+}
+
+SfxItemSet* SfxShell::CreateItemSet( USHORT nId )
+{
+ return NULL;
+}
+
+void SfxShell::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
+{
+}
+
+void SfxShell::SetViewShell_Impl( SfxViewShell* pView )
+{
+ pImp->pViewSh = pView;
+}
+
+
+
diff --git a/sfx2/source/control/srchitem.cxx b/sfx2/source/control/srchitem.cxx
new file mode 100644
index 000000000000..b9ce85cd593a
--- /dev/null
+++ b/sfx2/source/control/srchitem.cxx
@@ -0,0 +1,306 @@
+/*************************************************************************
+ *
+ * $RCSfile: srchitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// include ---------------------------------------------------------------
+
+#ifndef __SBX_SBXVARIABLE_HXX
+#include <svtools/sbxvar.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_UTIL_XREPLACEABLE_HPP_
+#include <com/sun/star/util/XReplaceable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XSEARCHABLE_HPP_
+#include <com/sun/star/util/XSearchable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XSEARCHDESCRIPTOR_HPP_
+#include <com/sun/star/util/XSearchDescriptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XPROPERTYREPLACE_HPP_
+#include <com/sun/star/util/XPropertyReplace.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XREPLACEDESCRIPTOR_HPP_
+#include <com/sun/star/util/XReplaceDescriptor.hpp>
+#endif
+#include <svtools/memberid.hrc>
+//ASDBG #include <usr/uno.hxx>
+
+#pragma hdrstop
+
+#define _SVX_SRCHITEM_CXX
+
+#include "sfxsids.hrc"
+#define ITEMID_SEARCH SID_SEARCH_ITEM
+#include "srchitem.hxx"
+
+#include <sfxuno.hxx>
+
+// STATIC DATA -----------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SvxSearchItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+SvxSearchItem::SvxSearchItem( const sal_uInt16 nId ) :
+
+ SfxPoolItem( nId ),
+
+ nCommand ( 0 ),
+ aSearchString () ,
+ aReplaceString (),
+ bWordOnly ( sal_False ),
+ bExact ( sal_False ),
+ bBackward ( sal_False ),
+ bSelection ( sal_False ),
+ bRegExp ( sal_False ),
+ bPattern ( sal_False ),
+ bContent ( sal_False ),
+ eFamily ( SFX_STYLE_FAMILY_PARA ),
+ bRowDirection ( sal_True ),
+ bAllTables ( sal_False ),
+ nCellType ( SVX_SEARCHIN_FORMULA ),
+ nAppFlag ( SVX_SEARCHAPP_WRITER ),
+ bLevenshtein ( sal_False ),
+ bLEVRelaxed ( sal_True ),
+ nLEVOther ( 2 ),
+ nLEVShorter ( 2 ),
+ nLEVLonger ( 2 )
+{
+}
+
+// -----------------------------------------------------------------------
+
+SvxSearchItem::SvxSearchItem( const SvxSearchItem& rItem ) :
+
+ SfxPoolItem ( rItem ),
+
+ nCommand ( rItem.nCommand ),
+ aSearchString ( rItem.aSearchString ),
+ aReplaceString ( rItem.aReplaceString ),
+ bWordOnly ( rItem.bWordOnly ),
+ bExact ( rItem.bExact ),
+ bBackward ( rItem.bBackward ),
+ bSelection ( rItem.bSelection ),
+ bRegExp ( rItem.bRegExp ),
+ bPattern ( rItem.bPattern ),
+ bContent ( rItem.bContent ),
+ eFamily ( rItem.eFamily ),
+ bRowDirection ( rItem.bRowDirection ),
+ bAllTables ( rItem.bAllTables ),
+ nCellType ( rItem.nCellType ),
+ nAppFlag ( rItem.nAppFlag ),
+ bLevenshtein ( rItem.bLevenshtein ),
+ bLEVRelaxed ( rItem.bLEVRelaxed ),
+ nLEVOther ( rItem.nLEVOther ),
+ nLEVShorter ( rItem.nLEVShorter ),
+ nLEVLonger ( rItem.nLEVLonger )
+{
+}
+
+// -----------------------------------------------------------------------
+
+int SvxSearchItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal which or type" );
+
+ return ( nCommand == ( (SvxSearchItem&)rItem ).nCommand ) &&
+ ( aSearchString == ( (SvxSearchItem&)rItem ).aSearchString ) &&
+ ( aReplaceString == ( (SvxSearchItem&)rItem ).aReplaceString ) &&
+ ( bWordOnly == ( (SvxSearchItem&)rItem ).bWordOnly ) &&
+ ( bExact == ( (SvxSearchItem&)rItem ).bExact ) &&
+ ( bBackward == ( (SvxSearchItem&)rItem ).bBackward ) &&
+ ( bSelection == ( (SvxSearchItem&)rItem ).bSelection ) &&
+ ( bRegExp == ( (SvxSearchItem&)rItem ).bRegExp ) &&
+ ( bPattern == ( (SvxSearchItem&)rItem ).bPattern ) &&
+ ( bContent == ( (SvxSearchItem&)rItem ).bContent ) &&
+ ( eFamily == ( (SvxSearchItem&)rItem ).eFamily ) &&
+ ( bRowDirection == ( (SvxSearchItem&)rItem ).bRowDirection ) &&
+ ( bAllTables == ( (SvxSearchItem&)rItem ).bAllTables ) &&
+ ( nCellType == ( (SvxSearchItem&)rItem ).nCellType ) &&
+ ( nAppFlag == ( (SvxSearchItem&)rItem ).nAppFlag ) &&
+ ( bLevenshtein == ( (SvxSearchItem&)rItem ).bLevenshtein ) &&
+ ( bLEVRelaxed == ( (SvxSearchItem&)rItem ).bLEVRelaxed ) &&
+ ( nLEVOther == ( (SvxSearchItem&)rItem ).nLEVOther ) &&
+ ( nLEVShorter == ( (SvxSearchItem&)rItem ).nLEVShorter ) &&
+ ( nLEVLonger == ( (SvxSearchItem&)rItem ).nLEVLonger );
+}
+
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation SvxSearchItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit eCoreUnit,
+ SfxMapUnit ePresUnit,
+ XubString& rText,
+ const International *
+) const
+{
+/*
+ switch ( ePres )
+ {
+ case SFX_ITEM_PRESENTATION_NONE:
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+ case SFX_ITEM_PRESENTATION_NAMELESS:
+ case SFX_ITEM_PRESENTATION_COMPLETE:
+ {
+ rText = SVX_RESSTR(RID_SVXITEMS_SEARCHCMD_BEGIN + nCommand);
+ rText += cpDelim;
+ rText += aSearchString;
+ rText += cpDelim;
+ rText += aReplaceString;
+ rText += cpDelim;
+ rText += ::GetBoolString( bWordOnly );
+ rText += cpDelim;
+ rText += ::GetBoolString( bExact );
+ rText += cpDelim;
+ rText += ::GetBoolString( bBackward );
+ rText += cpDelim;
+ rText += ::GetBoolString( bSelection );
+ rText += cpDelim;
+ rText += ::GetBoolString( bRegExp );
+ rText += cpDelim;
+ rText += ::GetBoolString( bPattern );
+ rText += cpDelim;
+ rText += ::GetBoolString( bContent );
+ rText += cpDelim;
+ rText += SVX_RESSTR(RID_SVXITEMS_SEARCHSTYLE_BEGIN + (sal_uInt16)eFamily );
+ rText += cpDelim;
+ rText += ::GetBoolString( bRowDirection );
+ rText += cpDelim;
+ rText += ::GetBoolString( bAllTables );
+ rText += cpDelim;
+ rText += SVX_RESSTR(RID_SVXITEMS_SEARCHIN_BEGIN + nCellType);
+ rText += cpDelim;
+ rText += SVX_RESSTR(RID_SVXITEMS_SEARCHAPP_BEGIN + nAppFlag);
+ return ePres;
+ }
+ }
+ */
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+void SvxSearchItem::GetFromDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor >& rDescr )
+{
+ SetSearchString( rDescr->getSearchString() );
+ ::com::sun::star::uno::Any aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchWords") );
+ sal_Bool bTemp ;
+ aAny >>= bTemp ;
+ SetWordOnly( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchCaseSensitive") );
+ aAny >>= bTemp ;
+ SetExact( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchBackwards") );
+ aAny >>= bTemp ;
+ SetBackward( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchInSelection") );
+ aAny >>= bTemp ;
+ SetSelection( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchRegularExpression") );
+ aAny >>= bTemp ;
+ SetRegExp( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarity") );
+ aAny >>= bTemp ;
+ SetLevenshtein( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityRelax") );
+ aAny >>= bTemp ;
+ SetLEVRelaxed( bTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityExchange") );
+ sal_Int16 nTemp ;
+ aAny >>= nTemp ;
+ SetLEVOther( nTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityRemove") );
+ aAny >>= nTemp ;
+ SetLEVShorter( nTemp );
+ aAny = rDescr->getPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityAdd") );
+ aAny >>= nTemp ;
+ SetLEVLonger( nTemp );
+}
+
+void SvxSearchItem::SetToDescriptor( ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor > & rDescr )
+{
+ rDescr->setSearchString( GetSearchString() );
+ ::com::sun::star::uno::Any aAny;
+ aAny <<= GetWordOnly() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchWords"), aAny );
+ aAny <<= GetExact() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchCaseSensitive"), aAny );
+ aAny <<= GetBackward() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchBackwards"), aAny );
+ aAny <<= GetSelection() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchInSelection"), aAny );
+ aAny <<= GetRegExp() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchRegularExpression"), aAny );
+ aAny <<= IsLevenshtein() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarity"), aAny );
+ aAny <<= IsLEVRelaxed() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityRelax"), aAny );
+ aAny <<= GetLEVOther() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityExchange"), aAny );
+ aAny <<= GetLEVShorter() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityRemove"), aAny );
+ aAny <<= GetLEVLonger() ;
+ rDescr->setPropertyValue( DEFINE_CONST_UNICODE("SearchSimilarityAdd"), aAny );
+}
+
+
diff --git a/sfx2/source/control/statcach.cxx b/sfx2/source/control/statcach.cxx
new file mode 100644
index 000000000000..d563da2d0005
--- /dev/null
+++ b/sfx2/source/control/statcach.cxx
@@ -0,0 +1,577 @@
+/*************************************************************************
+ *
+ * $RCSfile: statcach.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+
+#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
+#include <com/sun/star/util/XURLTransformer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HPP_
+#include <com/sun/star/frame/FrameActionEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTION_HPP_
+#include <com/sun/star/frame/FrameAction.hpp>
+#endif
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#include <svtools/eitem.hxx>
+#include <svtools/intitem.hxx>
+#include <svtools/stritem.hxx>
+#include <unotools/processfactory.hxx>
+
+#pragma hdrstop
+
+#include "statcach.hxx"
+#include "msg.hxx"
+#include "ctrlitem.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "sfxuno.hxx"
+#include "unoctitm.hxx"
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+
+//====================================================================
+
+DBG_NAME(SfxStateCache);
+DBG_NAME(SfxStateCacheSetState);
+
+SFX_IMPL_XINTERFACE_2( BindDispatch_Impl, OWeakObject, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
+SFX_IMPL_XTYPEPROVIDER_2( BindDispatch_Impl, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
+
+//-----------------------------------------------------------------------------
+BindDispatch_Impl::BindDispatch_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > & rDisp, const ::com::sun::star::util::URL& rURL, SfxStateCache *pStateCache )
+ : xDisp( rDisp )
+ , aURL( rURL )
+ , pCache( pStateCache )
+{
+ aStatus.IsEnabled = sal_True;
+}
+
+void SAL_CALL BindDispatch_Impl::disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ if ( xDisp.is() )
+ {
+ xDisp->removeStatusListener( (::com::sun::star::frame::XStatusListener*) this, ::com::sun::star::util::URL() );
+ xDisp = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > ();
+ }
+}
+
+void SAL_CALL BindDispatch_Impl::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& rEvent ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ aStatus = rEvent;
+ if ( !pCache )
+ return;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > xRef( (::cppu::OWeakObject*)this, ::com::sun::star::uno::UNO_QUERY );
+ if ( aStatus.Requery )
+ pCache->Invalidate( sal_True );
+ else
+ {
+ pCache->Invalidate( sal_False );
+ if ( !aStatus.IsEnabled )
+ pCache->SetState_Impl( SFX_ITEM_DISABLED, NULL );
+ else
+ {
+ sal_uInt16 nId = pCache->GetId();
+ SfxItemState eState = SFX_ITEM_AVAILABLE;
+ SfxPoolItem *pItem=NULL;
+ ::com::sun::star::uno::Any aAny = aStatus.State;
+ ::com::sun::star::uno::Type pType = aAny.getValueType();
+
+ if ( pType == ::getBooleanCppuType() )
+ {
+ sal_Bool bTemp ;
+ aAny >>= bTemp ;
+ pItem = new SfxBoolItem( nId, bTemp );
+ }
+ else if ( pType == ::getCppuType((const sal_uInt16*)0) )
+ {
+ sal_uInt16 nTemp ;
+ aAny >>= nTemp ;
+ pItem = new SfxUInt16Item( nId, nTemp );
+ }
+ else if ( pType == ::getCppuType((const sal_uInt32*)0) )
+ {
+ sal_uInt32 nTemp ;
+ aAny >>= nTemp ;
+ pItem = new SfxUInt32Item( nId, nTemp );
+ }
+ else if ( pType == ::getCppuType((const ::rtl::OUString*)0) )
+ {
+ ::rtl::OUString sTemp ;
+ aAny >>= sTemp ;
+ pItem = new SfxStringItem( nId, sTemp );
+ }
+ else
+ pItem = new SfxVoidItem( nId );
+ pCache->SetState_Impl( eState, pItem );
+ delete pItem;
+ }
+ }
+}
+
+void BindDispatch_Impl::Release()
+{
+ if ( xDisp.is() )
+ {
+ xDisp->removeStatusListener( (::com::sun::star::frame::XStatusListener*) this, ::com::sun::star::util::URL() );
+ xDisp = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > ();
+ }
+
+ pCache = NULL;
+ release();
+}
+
+const ::com::sun::star::frame::FeatureStateEvent& BindDispatch_Impl::GetStatus() const
+{
+ return aStatus;
+}
+
+void BindDispatch_Impl::Dispatch( sal_Bool bForceSynchron )
+{
+ if ( xDisp.is() && aStatus.IsEnabled )
+ if ( bForceSynchron )
+ {
+ ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aProps(1);
+ aProps.getArray()[0].Name = DEFINE_CONST_UNICODE("SynchronMode");
+ aProps.getArray()[0].Value <<= sal_True ;
+ xDisp->dispatch( aURL, aProps );
+ }
+ else
+ xDisp->dispatch( aURL, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() );
+}
+
+//--------------------------------------------------------------------
+
+/* Dieser Konstruktor fuer einen ungueltigen Cache, der sich also
+ bei der ersten Anfrage zun"achst updated.
+ */
+
+SfxStateCache::SfxStateCache( sal_uInt16 nFuncId ):
+ nId(nFuncId),
+ pController(0),
+ pLastItem( 0 ),
+ eLastState( 0 ),
+ pDispatch( 0 )
+{
+ DBG_MEMTEST();
+ DBG_CTOR(SfxStateCache, 0);
+ bCtrlDirty = sal_True;
+ bSlotDirty = sal_True;
+ bItemDirty = sal_True;
+}
+
+//--------------------------------------------------------------------
+
+/* Der Destruktor pr"uft per Assertion, ob noch Controller angemeldet
+ sind.
+ */
+
+SfxStateCache::~SfxStateCache()
+{
+ DBG_MEMTEST();
+ DBG_DTOR(SfxStateCache, 0);
+ DBG_ASSERT( pController == 0, "es sind noch Controller angemeldet" );
+ if ( !IsInvalidItem(pLastItem) )
+ delete pLastItem;
+ if ( pDispatch )
+ {
+ pDispatch->Release();
+ pDispatch = NULL;
+ }
+}
+
+//--------------------------------------------------------------------
+// invalidates the cache (next request will force update)
+void SfxStateCache::Invalidate( sal_Bool bWithMsg )
+{
+ bCtrlDirty = sal_True;
+ if ( bWithMsg )
+ {
+ bSlotDirty = sal_True;
+ aSlotServ.SetSlot( 0 );
+ if ( pDispatch )
+ {
+ pDispatch->Release();
+ pDispatch = NULL;
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+// gets the corresponding function from the dispatcher or the cache
+
+const SfxSlotServer* SfxStateCache::GetSlotServer( SfxDispatcher &rDispat , const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & xProv )
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxStateCache, 0);
+
+ if ( bSlotDirty )
+ {
+ if ( xProv.is() )
+ {
+ DBG_ASSERT( !pDispatch, "Altes Dispatch nicht entfernt!" );
+
+//(mba)/compview
+ const SfxSlot* pSlot = 0;//SfxComponentViewShell::GetUnoSlot( nId );
+ ::com::sun::star::util::URL aURL;
+ String aName( pSlot ? String::CreateFromAscii(pSlot->GetUnoName()) : String() );
+ String aCmd;
+ if ( aName.Len() )
+ {
+ aCmd = DEFINE_CONST_UNICODE(".uno:");
+ aCmd += aName;
+ }
+ else
+ {
+ aCmd = DEFINE_CONST_UNICODE("slot:");
+ aCmd += String::CreateFromInt32( nId );
+ }
+
+ aURL.Complete = aCmd;
+ Reference < XURLTransformer > xTrans( ::utl::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ xTrans->parseStrict( aURL );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
+ if ( xDisp.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xTunnel( xDisp, ::com::sun::star::uno::UNO_QUERY );
+ SfxOfficeDispatch* pDisp = NULL;
+ if ( xTunnel.is() )
+ {
+ sal_Int64 nImplementation = xTunnel->getSomething(SfxOfficeDispatch::impl_getStaticIdentifier());
+ pDisp = (SfxOfficeDispatch*)(nImplementation);
+ }
+
+ if ( pDisp )
+ {
+ // The intercepting object is a SFX component
+ // Get the shell that is the slotserver of this component
+ SfxDispatcher *pDispatcher = pDisp->GetDispatcher_Impl();
+ pDispatcher->_FindServer( nId, aSlotServ, sal_False );
+ SfxShell* pShell = pDispatcher->GetShell( aSlotServ.GetShellLevel() );
+
+ // Check if this shell is active on the active dispatcher
+ sal_uInt16 nLevel = rDispat.GetShellLevel( *pShell );
+ if ( nLevel != USHRT_MAX )
+ {
+ // so we can use this shell direct without StarONE connection
+ aSlotServ.SetShellLevel( nLevel );
+ bSlotDirty = sal_False;
+ bCtrlDirty = sal_True;
+
+ //MI: wozu das? bItemDirty = sal_True;
+ return aSlotServ.GetSlot()? &aSlotServ: 0;
+ }
+ else
+ {
+ pDispatch = new BindDispatch_Impl( xDisp, aURL, this );
+ pDispatch->acquire();
+
+ // flags must be set before adding StatusListener because the dispatch object will set the state
+ bSlotDirty = sal_False;
+ bCtrlDirty = sal_True;
+ xDisp->addStatusListener( pDispatch, aURL );
+ aSlotServ.SetSlot(0);
+ return NULL;
+ }
+ }
+ else
+ {
+ pDispatch = new BindDispatch_Impl( xDisp, aURL, this );
+ pDispatch->acquire();
+
+ // flags must be set before adding StatusListener because the dispatch object will set the state
+ bSlotDirty = sal_False;
+ bCtrlDirty = sal_True;
+ xDisp->addStatusListener( pDispatch, aURL );
+ aSlotServ.SetSlot(0);
+ return NULL;
+ }
+ }
+ }
+
+// if ( !rDispat._TryIntercept_Impl( nId, aSlotServ, sal_False ) )
+ rDispat._FindServer(nId, aSlotServ, sal_False);
+ bSlotDirty = sal_False;
+ bCtrlDirty = sal_True;
+ //MI: wozu das? bItemDirty = sal_True;
+ }
+
+ return aSlotServ.GetSlot()? &aSlotServ: 0;
+}
+
+
+//--------------------------------------------------------------------
+
+// Status setzen in allen Controllern
+
+void SfxStateCache::SetState
+(
+ SfxItemState eState, // <SfxItemState> von 'pState'
+ const SfxPoolItem* pState // Status des Slots, ggf. 0 oder -1
+)
+
+/* [Beschreibung]
+
+ Diese Methode verteilt die Status auf alle an dieser SID gebundenen
+ <SfxControllerItem>s. Ist der Wert derselbe wie zuvor und wurde in-
+ zwischen weder ein Controller angemeldet, noch ein Controller invalidiert,
+ dann wird kein Wert weitergeleitet. Dadurch wird z.B. Flackern in
+ ListBoxen vermieden.
+*/
+
+{
+ if ( pDispatch )
+ return;
+ SetState_Impl( eState, pState );
+}
+
+
+void SfxStateCache::SetState_Impl
+(
+ SfxItemState eState, // <SfxItemState> von 'pState'
+ const SfxPoolItem* pState // Status des Slots, ggf. 0 oder -1
+)
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxStateCache, 0);
+
+ // wenn zwischen Enter- und LeaveRegistrations ein hartes Update kommt
+ // k"onnen zwischenzeitlich auch Cached ohne Controller exisitieren
+ if ( !pController )
+ return;
+
+ DBG_ASSERT( pController->GetId()==nId, "Cache mit falschem ControllerItem" );
+ DBG_ASSERT( !bSlotDirty, "setting state of dirty message" );
+ DBG_ASSERT( bCtrlDirty ||
+ ( aSlotServ.GetSlot() && aSlotServ.GetSlot()->IsMode(SFX_SLOT_VOLATILE) ),
+ "setting state of non dirty controller" );
+ DBG_ASSERT( SfxControllerItem::GetItemState(pState) == eState,
+ "invalid SfxItemState" );
+ DBG_PROFSTART(SfxStateCacheSetState);
+
+ // m"ussen die Controller "uberhaupt benachrichtigt werden?
+ FASTBOOL bNotify = bItemDirty;
+ if ( !bItemDirty )
+ {
+ FASTBOOL bBothAvailable = pLastItem && pState &&
+ !IsInvalidItem(pState) && !IsInvalidItem(pLastItem);
+ DBG_ASSERT( !bBothAvailable || pState != pLastItem, "setting state with own item" );
+ if ( bBothAvailable )
+ bNotify = pState->Type() != pLastItem->Type() ||
+ *pState != *pLastItem;
+ else
+ bNotify = ( pState != pLastItem ) || ( eState != eLastState );
+ }
+
+ if ( bNotify )
+ {
+ // Controller updaten
+ for ( SfxControllerItem *pCtrl = pController;
+ pCtrl;
+ pCtrl = pCtrl->GetItemLink() )
+ pCtrl->StateChanged( nId, eState, pState );
+
+ // neuen Wert merken
+ if ( !IsInvalidItem(pLastItem) )
+ DELETEZ(pLastItem);
+ if ( pState && !IsInvalidItem(pState) )
+ pLastItem = pState->Clone();
+ else
+ pLastItem = 0;
+ eLastState = eState;
+ bItemDirty = sal_False;
+ }
+
+ bCtrlDirty = sal_False;
+ DBG_PROFSTOP(SfxStateCacheSetState);
+}
+
+
+//--------------------------------------------------------------------
+
+// alten Status in allen Controllern nochmal setzen
+
+void SfxStateCache::SetCachedState()
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxStateCache, 0);
+ DBG_ASSERT( pController, "Cache ohne ControllerItem" );
+ DBG_ASSERT( pController->GetId()==nId, "Cache mit falschem ControllerItem" );
+ DBG_PROFSTART(SfxStateCacheSetState);
+
+ // nur updaten wenn cached item vorhanden und auch verarbeitbar
+ // (Wenn der State gesendet wird, mu\s sichergestellt sein, da\s ein
+ // Slotserver vorhanden ist, s. SfxControllerItem::GetCoreMetric() )
+ if ( !bItemDirty && !bSlotDirty )
+ {
+ // Controller updaten
+ for ( SfxControllerItem *pCtrl = pController;
+ pCtrl;
+ pCtrl = pCtrl->GetItemLink() )
+ pCtrl->StateChanged( nId, eLastState, pLastItem );
+
+ // Controller sind jetzt ok
+ bCtrlDirty = sal_True;
+ }
+
+ DBG_PROFSTOP(SfxStateCacheSetState);
+}
+
+
+//--------------------------------------------------------------------
+
+// FloatingWindows in allen Controls mit dieser Id zerstoeren
+
+void SfxStateCache::DeleteFloatingWindows()
+{
+ DBG_MEMTEST();
+ DBG_CHKTHIS(SfxStateCache, 0);
+
+ SfxControllerItem *pNextCtrl=0;
+ for ( SfxControllerItem *pCtrl=pController; pCtrl; pCtrl=pNextCtrl )
+ {
+ DBG_TRACE((ByteString("pCtrl: ").Append(ByteString::CreateFromInt32((sal_uInt32)pCtrl))).GetBuffer());
+ pNextCtrl = pCtrl->GetItemLink();
+ pCtrl->DeleteFloatingWindow();
+ }
+}
+
+sal_Bool SfxStateCache::UpdateDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & xProv )
+{
+ if ( bSlotDirty && xProv.is() )
+ {
+ DBG_ASSERT( !pDispatch, "Altes Dispatch nicht entfernt!" );
+
+//(mba)/compview
+ const SfxSlot* pSlot = 0;//SfxComponentViewShell::GetUnoSlot( nId );
+ ::com::sun::star::util::URL aURL;
+ String aName( pSlot ? String::CreateFromAscii(pSlot->GetUnoName()) : String() );
+ String aCmd;
+ if ( aName.Len() )
+ {
+ aCmd = DEFINE_CONST_UNICODE(".uno:");
+ aCmd += aName;
+ }
+ else
+ {
+ aCmd = DEFINE_CONST_UNICODE("slot:");
+ aCmd += String::CreateFromInt32( nId );
+ }
+
+ aURL.Complete = aCmd;
+ Reference < XURLTransformer > xTrans( ::utl::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ xTrans->parseStrict( aURL );
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp = xProv->queryDispatch( aURL, ::rtl::OUString(), 0 );
+ if ( xDisp.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xTunnel( xDisp, ::com::sun::star::uno::UNO_QUERY );
+ SfxOfficeDispatch* pDisp = NULL;
+ if ( xTunnel.is() )
+ {
+ sal_Int64 nImplementation = xTunnel->getSomething(SfxOfficeDispatch::impl_getStaticIdentifier());
+ pDisp = (SfxOfficeDispatch*)(nImplementation);
+ }
+
+ if ( pDisp && !pDisp->IsInterceptDispatch() )
+ return sal_False;
+ pDispatch = new BindDispatch_Impl( xDisp, aURL, this );
+ pDispatch->acquire();
+ bSlotDirty = sal_False;
+ bCtrlDirty = sal_True;
+ xDisp->addStatusListener( pDispatch, aURL );
+ aSlotServ.SetSlot(0);
+ }
+ }
+
+ return ( pDispatch != NULL );
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SfxStateCache::GetDispatch() const
+{
+ if ( pDispatch )
+ return pDispatch->xDisp;
+ return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > ();
+}
+
+void SfxStateCache::Dispatch( sal_Bool bForceSynchron )
+{
+ if ( pDispatch )
+ pDispatch->Dispatch( bForceSynchron );
+}
+
+
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
new file mode 100644
index 000000000000..ff821be8732f
--- /dev/null
+++ b/sfx2/source/control/unoctitm.cxx
@@ -0,0 +1,560 @@
+/*************************************************************************
+ *
+ * $RCSfile: unoctitm.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <tools/debug.hxx>
+
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#include <svtools/intitem.hxx>
+#include <svtools/itemset.hxx>
+
+#ifndef _COM_SUN_STAR_UTIL_XURLTRANSFORMER_HPP_
+#include <com/sun/star/util/XURLTransformer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAMEACTIONLISTENER_HPP_
+#include <com/sun/star/frame/XFrameActionListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTIONEVENT_HPP_
+#include <com/sun/star/frame/FrameActionEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMEACTION_HPP_
+#include <com/sun/star/frame/FrameAction.hpp>
+#endif
+#include <unotools/processfactory.hxx>
+
+#include "unoctitm.hxx"
+#include "viewfrm.hxx"
+#include "frame.hxx"
+#include "ctrlitem.hxx"
+#include "sfxuno.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "sfxsids.hrc"
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::util;
+//long nOfficeDispatchCount = 0;
+
+SFX_IMPL_XINTERFACE_2( SfxUnoControllerItem, OWeakObject, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
+SFX_IMPL_XTYPEPROVIDER_2( SfxUnoControllerItem, ::com::sun::star::frame::XStatusListener, ::com::sun::star::lang::XEventListener )
+
+SfxUnoControllerItem::SfxUnoControllerItem( SfxControllerItem *pItem, SfxBindings& rBind, const String& rCmd )
+ : pCtrlItem( pItem )
+ , pBindings( &rBind )
+{
+ DBG_ASSERT( !pCtrlItem || !pCtrlItem->IsBound(), "ControllerItem fehlerhaft!" );
+
+ aCommand.Complete = rCmd;
+ Reference < XURLTransformer > xTrans( ::utl::getProcessServiceFactory()->createInstance( rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer" )), UNO_QUERY );
+ xTrans->parseStrict( aCommand );
+ pBindings->RegisterUnoController_Impl( this );
+}
+
+SfxUnoControllerItem::~SfxUnoControllerItem()
+{
+ // tell bindings to forget this controller ( if still connected )
+ if ( pBindings )
+ pBindings->ReleaseUnoController_Impl( this );
+}
+
+void SfxUnoControllerItem::UnBind()
+{
+ // connection to SfxControllerItem is lost
+ pCtrlItem = NULL;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > aRef( (::cppu::OWeakObject*)this, ::com::sun::star::uno::UNO_QUERY );
+ ReleaseDispatch();
+}
+
+void SAL_CALL SfxUnoControllerItem::statusChanged(const ::com::sun::star::frame::FeatureStateEvent& rEvent) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ DBG_ASSERT( pCtrlItem, "Dispatch hat den StatusListener nicht entfern!" );
+
+ if ( rEvent.Requery )
+ {
+ // Fehler kann nur passieren, wenn das alte Dispatch fehlerhaft implementiert
+ // ist, also removeStatusListener nicht gefunzt hat. Aber sowas soll
+ // ja vorkommen ...
+ // Also besser vor ReleaseDispatch gegen Abflug sch"utzen!
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > aRef( (::cppu::OWeakObject*)this, ::com::sun::star::uno::UNO_QUERY );
+ ReleaseDispatch();
+ if ( pCtrlItem )
+ GetNewDispatch(); // asynchron ??
+ }
+ else if ( pCtrlItem )
+ {
+ // pass new status to the SfxControllerItem
+ SfxItemState eState = SFX_ITEM_DISABLED;
+ SfxPoolItem* pItem = NULL;
+ if ( rEvent.IsEnabled )
+ {
+ eState = SFX_ITEM_AVAILABLE;
+ ::com::sun::star::uno::Type pType = rEvent.State.getValueType();
+
+ if ( pType == ::getBooleanCppuType() )
+ {
+ sal_Bool bTemp ;
+ rEvent.State >>= bTemp ;
+ pItem = new SfxBoolItem( pCtrlItem->GetId(), bTemp );
+ }
+ else if ( pType == ::getCppuType((const sal_uInt16*)0) )
+ {
+ sal_uInt16 nTemp ;
+ rEvent.State >>= nTemp ;
+ pItem = new SfxUInt16Item( pCtrlItem->GetId(), nTemp );
+ }
+ else if ( pType == ::getCppuType((const sal_uInt32*)0) )
+ {
+ sal_uInt32 nTemp ;
+ rEvent.State >>= nTemp ;
+ pItem = new SfxUInt32Item( pCtrlItem->GetId(), nTemp );
+ }
+ else if ( pType == ::getCppuType((const ::rtl::OUString*)0) )
+ {
+ ::rtl::OUString sTemp ;
+ rEvent.State >>= sTemp ;
+ pItem = new SfxStringItem( pCtrlItem->GetId(), sTemp );
+ }
+ else
+ pItem = new SfxVoidItem( pCtrlItem->GetId() );
+ }
+
+ pCtrlItem->StateChanged( pCtrlItem->GetId(), eState, pItem );
+ delete pItem;
+ }
+}
+
+void SAL_CALL SfxUnoControllerItem::disposing( const ::com::sun::star::lang::EventObject& rEvent ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > aRef( (::cppu::OWeakObject*)this, ::com::sun::star::uno::UNO_QUERY );
+ ReleaseDispatch();
+}
+
+void SfxUnoControllerItem::ReleaseDispatch()
+{
+ if ( xDispatch.is() )
+ {
+ xDispatch->removeStatusListener( (::com::sun::star::frame::XStatusListener*) this, aCommand );
+ xDispatch = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > ();
+ }
+}
+
+void SfxUnoControllerItem::GetNewDispatch()
+{
+ if ( !pBindings )
+ {
+ // Bindings released
+ DBG_ERROR( "Tried to get dispatch, but no Bindings!" );
+ return;
+ }
+
+ // forget old dispatch
+ xDispatch = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > ();
+
+ // no arms, no cookies !
+ if ( !pBindings->GetDispatcher_Impl() || !pBindings->GetDispatcher_Impl()->GetFrame() )
+ return;
+
+ SfxFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame();
+ SfxFrame *pParent = pFrame->GetParentFrame();
+ if ( pParent )
+ // parent may intercept
+ xDispatch = TryGetDispatch( pParent );
+
+ if ( !xDispatch.is() )
+ {
+ // no interception
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
+ if ( xProv.is() )
+ xDispatch = xProv->queryDispatch( aCommand, ::rtl::OUString(), 0 );
+ }
+
+ if ( xDispatch.is() )
+ xDispatch->addStatusListener( (::com::sun::star::frame::XStatusListener*) this, aCommand );
+ else if ( pCtrlItem )
+ pCtrlItem->StateChanged( pCtrlItem->GetId(), SFX_ITEM_DISABLED, NULL );
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SfxUnoControllerItem::TryGetDispatch( SfxFrame *pFrame )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp;
+ SfxFrame *pParent = pFrame->GetParentFrame();
+ if ( pParent )
+ // parent may intercept
+ xDisp = TryGetDispatch( pParent );
+
+ // only components may intercept
+ if ( !xDisp.is() && pFrame->HasComponent() )
+ {
+ // no interception
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xFrame = pFrame->GetFrameInterface();
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > xProv( xFrame, ::com::sun::star::uno::UNO_QUERY );
+ if ( xProv.is() )
+ xDisp = xProv->queryDispatch( aCommand, ::rtl::OUString(), 0 );
+ }
+
+ return xDisp;
+}
+
+void SfxUnoControllerItem::Execute()
+{
+ // dispatch the resource
+ if ( xDispatch.is() )
+ xDispatch->dispatch( aCommand, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >() );
+}
+
+void SfxUnoControllerItem::ReleaseBindings()
+{
+ // connection to binding is lost; so forget the binding and the dispatch
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > aRef( (::cppu::OWeakObject*)this, ::com::sun::star::uno::UNO_QUERY );
+ ReleaseDispatch();
+ if ( pBindings )
+ pBindings->ReleaseUnoController_Impl( this );
+ pBindings = NULL;
+}
+
+void SfxStatusDispatcher::ReleaseAll()
+{
+ ::com::sun::star::lang::EventObject aObject;
+ aObject.Source = (::cppu::OWeakObject*) this;
+ aListeners.disposeAndClear( aObject );
+}
+
+void SAL_CALL SfxStatusDispatcher::dispatch( const ::com::sun::star::util::URL&, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+}
+
+SFX_IMPL_XINTERFACE_1( SfxStatusDispatcher, OWeakObject, ::com::sun::star::frame::XDispatch )
+SFX_IMPL_XTYPEPROVIDER_1( SfxStatusDispatcher, ::com::sun::star::frame::XDispatch )
+//IMPLNAME "com.sun.star.comp.sfx2.StatusDispatcher",
+
+SfxStatusDispatcher::SfxStatusDispatcher()
+ : aListeners( aMutex )
+{
+}
+
+void SAL_CALL SfxStatusDispatcher::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ aListeners.addInterface( aURL.Complete, aListener );
+ if ( aURL.Complete.compareToAscii(".uno:LifeTime")==0 )
+ {
+ ::com::sun::star::frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL = aURL;
+ aEvent.Source = (::com::sun::star::frame::XDispatch*) this;
+ aEvent.IsEnabled = sal_True;
+ aEvent.Requery = sal_False;
+ aListener->statusChanged( aEvent );
+ }
+}
+
+void SAL_CALL SfxStatusDispatcher::removeStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ aListeners.removeInterface( aURL.Complete, aListener );
+}
+
+SFX_IMPL_XINTERFACE_1( SfxOfficeDispatch, SfxStatusDispatcher, ::com::sun::star::lang::XUnoTunnel )
+SFX_IMPL_XTYPEPROVIDER_2( SfxOfficeDispatch, ::com::sun::star::frame::XDispatch, ::com::sun::star::lang::XUnoTunnel )
+
+
+//-------------------------------------------------------------------------
+// XUnoTunnel
+sal_Int64 SAL_CALL SfxOfficeDispatch::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException)
+{
+ if ( aIdentifier == impl_getStaticIdentifier() )
+ return (sal_Int64)this;
+ else
+ return 0;
+}
+
+/* ASDBG
+void* SfxOfficeDispatch::getImplementation(Reflection *p)
+{
+ if( p == ::getCppuType((const SfxOfficeDispatch*)0) )
+ return this;
+ else
+ return ::cppu::OWeakObject::getImplementation(p);
+
+}
+
+Reflection* ::getCppuType((const SfxOfficeDispatch*)0)
+{
+ static StandardClassReflection aRefl(
+ 0,
+ createStandardClass(
+ "SfxOfficeDispatch", ::cppu::OWeakObject::get::cppu::OWeakObjectIdlClass(),
+ 1,
+ ::getCppuType((const ::com::sun::star::frame::XDispatch*)0) ) );
+ return &aRefl;
+}
+*/
+
+SfxOfficeDispatch::SfxOfficeDispatch( SfxBindings& rBindings, SfxDispatcher* pDispat, sal_uInt16 nSlotId, const ::com::sun::star::util::URL& rURL, sal_Bool bInter )
+ : bIntercept( bInter )
+{
+// nOfficeDispatchCount++;
+
+ // this object is an adapter that shows a ::com::sun::star::frame::XDispatch-Interface to the outside and uses a SfxControllerItem to monitor a state
+ pControllerItem = new SfxDispatchController_Impl( this, rBindings, pDispat, nSlotId, rURL, bInter );
+}
+
+SfxOfficeDispatch::~SfxOfficeDispatch()
+{
+// --nOfficeDispatchCount;
+
+ if ( pControllerItem )
+ {
+ // when dispatch object is released, destroy its connection to this object and destroy it
+ pControllerItem->UnBindController();
+ delete pControllerItem;
+ }
+}
+
+void SAL_CALL SfxOfficeDispatch::dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ // ControllerItem is the Impl class
+ if ( pControllerItem )
+ pControllerItem->dispatch( aURL, aArgs );
+}
+
+void SAL_CALL SfxOfficeDispatch::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ GetListeners().addInterface( aURL.Complete, aListener );
+ if ( pControllerItem )
+ {
+ // ControllerItem is the Impl class
+ pControllerItem->addStatusListener( aListener, aURL );
+ }
+}
+
+SfxDispatcher* SfxOfficeDispatch::GetDispatcher_Impl()
+{
+ return pControllerItem->GetDispatcher();
+}
+
+SfxDispatchController_Impl::SfxDispatchController_Impl( SfxOfficeDispatch* pDisp, SfxBindings& rBindings, SfxDispatcher* pDispat, sal_uInt16 nSlotId, const ::com::sun::star::util::URL& rURL, sal_Bool bInter )
+ : pDispatch( pDisp )
+ , aDispatchURL( rURL )
+ , pBindings( &rBindings )
+ , pDispatcher( pDispat )
+ , pLastState( 0 )
+ , nSlot( nSlotId )
+{
+}
+
+SfxDispatchController_Impl::~SfxDispatchController_Impl()
+{
+ if ( pLastState && !IsInvalidItem( pLastState ) )
+ delete pLastState;
+
+ if ( pDispatch )
+ {
+ // disconnect
+ pDispatch->pControllerItem = NULL;
+
+ // force all listeners to release the dispatch object
+ ::com::sun::star::lang::EventObject aObject;
+ aObject.Source = (::cppu::OWeakObject*) pDispatch;
+ pDispatch->GetListeners().disposeAndClear( aObject );
+ }
+}
+
+void SfxDispatchController_Impl::UnBindController()
+{
+ pDispatch = NULL;
+ if ( IsBound() )
+ {
+ GetBindings().ENTERREGISTRATIONS();
+ SfxControllerItem::UnBind();
+ GetBindings().LEAVEREGISTRATIONS();
+ }
+}
+
+void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ if ( pDispatch && aURL == aDispatchURL )
+ {
+ if ( !GetId() )
+ {
+ pBindings->ENTERREGISTRATIONS();
+ Bind( nSlot, pBindings );
+ pBindings->LEAVEREGISTRATIONS();
+ }
+
+ SfxAllItemSet aSet( SFX_APP()->GetPool() );
+ TransformParameters( GetId(), aArgs, aSet );
+ aSet.Put( SfxBoolItem( SID_INTERCEPTOR, sal_False ) );
+ if ( !pDispatcher )
+ pDispatcher = GetBindings().GetDispatcher_Impl();
+
+ SfxCallMode nCall = SFX_CALLMODE_SLOT;
+ sal_uInt16 nCount = aArgs.getLength();
+ const ::com::sun::star::beans::PropertyValue* pPropsVal = aArgs.getConstArray();
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ const ::com::sun::star::beans::PropertyValue& rProp = pPropsVal[n];
+ String aName = rProp.Name;
+ sal_Bool bTemp ;
+ if ( aName.EqualsAscii("SynchronMode") && (rProp.Value >>= bTemp) )
+ {
+ nCall = SFX_CALLMODE_SYNCHRON;
+ break;
+ }
+ }
+ pDispatcher->Execute( GetId(), nCall, aSet );
+ }
+}
+
+SfxDispatcher* SfxDispatchController_Impl::GetDispatcher()
+{
+ if ( !pDispatcher )
+ pDispatcher = GetBindings().GetDispatcher_Impl();
+ return pDispatcher;
+}
+
+void SAL_CALL SfxDispatchController_Impl::addStatusListener(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener > & aListener, const ::com::sun::star::util::URL& aURL) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ if ( !pDispatch )
+ return;
+
+ if ( !GetId() )
+ {
+ pBindings->ENTERREGISTRATIONS();
+ Bind( nSlot, pBindings );
+ pBindings->LEAVEREGISTRATIONS();
+ }
+
+ const SfxPoolItem *pItem = 0;
+ if ( !pDispatcher )
+ pDispatcher = GetBindings().GetDispatcher_Impl();
+ SfxItemState eState = pDispatcher->QueryState( GetId(), pItem );
+ ::com::sun::star::uno::Any aState;
+ if ( pItem )
+ pItem->QueryValue( aState );
+
+ ::com::sun::star::frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL = aURL;
+ aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;
+ aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;
+ aEvent.Requery = sal_False;
+ aEvent.State = aState;
+
+ aListener->statusChanged( aEvent );
+}
+
+void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
+{
+ if ( !pDispatch )
+ return;
+
+ if ( pDispatch->IsInterceptDispatch() )
+ {
+ // If this Controller is made for an interception, the state can't be set from outside
+ // because this would be the state of the interceptor itself!
+ if ( !pDispatcher )
+ pDispatcher = GetBindings().GetDispatcher_Impl();
+ eState = pDispatcher->QueryState( GetId(), pState );
+ }
+
+ // Bindings instance notifies controller about a state change, listeners must be notified also
+ sal_Bool bNotify = sal_True;
+ sal_Bool bBothAvailable = pLastState && pState && !IsInvalidItem(pLastState) && !IsInvalidItem(pState);
+ if ( bBothAvailable )
+ bNotify = pState->Type() != pLastState->Type() || *pState != *pLastState;
+ else
+ bNotify = ( pLastState != pState );
+ if ( pLastState && !IsInvalidItem( pLastState ) )
+ delete pLastState;
+ pLastState = ( pState && !IsInvalidItem(pState) ) ? pState->Clone() : pState;
+
+ ::cppu::OInterfaceContainerHelper* pContnr = pDispatch->GetListeners().getContainer ( aDispatchURL.Complete );
+ if ( bNotify && pContnr )
+ {
+ ::com::sun::star::uno::Any aState;
+ if ( pState )
+ pState->QueryValue( aState );
+
+ ::com::sun::star::frame::FeatureStateEvent aEvent;
+ aEvent.FeatureURL = aDispatchURL;
+ aEvent.Source = (::com::sun::star::frame::XDispatch*) pDispatch;
+ aEvent.IsEnabled = eState != SFX_ITEM_DISABLED;
+ aEvent.Requery = sal_False;
+ aEvent.State = aState;
+
+ ::cppu::OInterfaceIteratorHelper aIt( *pContnr );
+ while( aIt.hasMoreElements() )
+ ((::com::sun::star::frame::XStatusListener *)aIt.next())->statusChanged( aEvent );
+ }
+}
+
+
diff --git a/sfx2/source/dialog/about.cxx b/sfx2/source/dialog/about.cxx
new file mode 100644
index 000000000000..2758566f914b
--- /dev/null
+++ b/sfx2/source/dialog/about.cxx
@@ -0,0 +1,421 @@
+/*************************************************************************
+ *
+ * $RCSfile: about.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// include ---------------------------------------------------------------
+
+#ifndef _SV_APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _LIBCALL_HXX //autogen
+#include <svtools/libcall.hxx>
+#endif
+#ifndef _SVTDEMO_HXX //autogen
+#include <svtools/svtdemo.hxx>
+#endif
+#ifndef _PVER_HXX //autogen
+#include <svtools/pver.hxx>
+#endif
+#pragma hdrstop
+
+#include "about.hxx"
+#include "sfxresid.hxx"
+#include "sfxdefs.hxx"
+#include "app.hxx"
+#include "inimgr.hxx"
+
+#include "dialog.hrc"
+
+// defines ---------------------------------------------------------------
+
+#define SCROLL_OFFSET ((long)2)
+#define SPACE_OFFSET ((long)5)
+
+typedef unsigned short (*fncUshort)();
+typedef const char* (*fncChar)();
+
+// functions -------------------------------------------------------------
+
+long CalcTextRows_Impl( const FixedText& rCtrl, long nTextWidth )
+{
+ long nRows = 0;
+ String aText = rCtrl.GetText();
+ while ( aText.Len() > 0 )
+ {
+ USHORT nBreakPos = rCtrl.GetTextBreak( aText, nTextWidth );
+ USHORT nNewLinePos = aText.Search( '\n' );
+ if ( nNewLinePos < nBreakPos )
+ {
+ USHORT nCutLen = nNewLinePos + 1;
+ nRows++;
+ if ( aText.GetChar( nNewLinePos + 1 ) == '\n' )
+ {
+ nCutLen++;
+ nRows++;
+ }
+ aText = aText.Erase( 0, nCutLen );
+ }
+ else
+ {
+ nRows++;
+ if ( nBreakPos != STRING_NOTFOUND )
+ {
+ // search for word break
+ while ( aText.GetChar( nBreakPos ) != ' ' && nBreakPos > 0 )
+ nBreakPos--;
+ aText = aText.Erase( 0, nBreakPos + 1 );
+ }
+ else
+ break;
+ }
+ }
+
+ return nRows;
+}
+
+// class AboutDialog -----------------------------------------------------
+
+AboutDialog::AboutDialog( Window* pParent, const ResId& rId, const String& rVerStr ) :
+
+ SfxModalDialog ( pParent, rId ),
+
+ aOKButton ( this, ResId( ABOUT_BTN_OK ) ),
+ aAppLogo ( ResId( ABOUT_BMP_LOGO ) ),
+ aVersionText ( this, ResId( ABOUT_FTXT_VERSION ) ),
+ aCopyrightText ( this, ResId( ABOUT_FTXT_COPYRIGHT ) ),
+ aDeveloperAry ( ResId( ABOUT_STR_DEVELOPER_ARY ) ),
+ aDevVersionStr ( rVerStr ),
+ aAccelStr ( ResId( ABOUT_STR_ACCEL ) ),
+
+ aTimer (),
+ nOff ( 0 ),
+ nEnd ( 0 ),
+ bNormal ( TRUE )
+
+{
+ SfxIniManager* pIniMgr = SFX_INIMANAGER();
+
+ // Transparenter Font
+ Font aFont = GetFont();
+ aFont.SetTransparent( TRUE );
+ SetFont( aFont );
+
+ // ggf. Spezial Version
+ String aStr = aVersionText.GetText();
+ String aMinor;
+ USHORT nDemo = SvDemo::GetDemoKind( Application::GetAppName() );
+ USHORT nProductVersion = ProductVersion::GetVersion().ToInt32();
+ String aVersion( String::CreateFromInt32( nProductVersion / 10 ) );
+ aVersion += 0x002E ; // 2Eh ^= '.'
+ aVersion += ( String::CreateFromInt32( nProductVersion % 10 ) );
+ String aOfficeVer = aVersion;
+ aStr.SearchAndReplaceAscii( "$(VER)", aOfficeVer );
+ aVersionText.SetText( aStr );
+
+ // Initialisierung fuer Aufruf Entwickler
+ if ( aAccelStr.Len() && ByteString(U2S(aAccelStr)).IsAlphaAscii() )
+ {
+ Accelerator *pAccel = 0, *pPrevAccel = 0, *pFirstAccel = 0;
+ aAccelStr.ToUpperAscii();
+
+ for ( USHORT i = 0; i < aAccelStr.Len(); ++i )
+ {
+ pPrevAccel = pAccel;
+ pAccel = new Accelerator;
+ aAccelList.Insert( pAccel, LIST_APPEND );
+ USHORT nKey = aAccelStr.GetChar(i) - 'A' + KEY_A;
+ pAccel->InsertItem( 1, KeyCode( nKey, KEY_MOD1 ) );
+ if ( i > 0 )
+ pPrevAccel->SetAccel( 1, pAccel );
+ if ( i == 0 )
+ pFirstAccel = pAccel;
+ }
+ pAccel->SetSelectHdl( LINK( this, AboutDialog, AccelSelectHdl ) );
+ GetpApp()->InsertAccel( pFirstAccel );
+ }
+
+ // Hintergrund-Farbe Weiss
+ Color aWhiteCol( COL_WHITE );
+ Wallpaper aWall( aWhiteCol );
+ SetBackground( aWall );
+ Font aNewFont( aCopyrightText.GetFont() );
+ aNewFont.SetTransparent( TRUE );
+
+ aVersionText.SetFont( aNewFont );
+ aCopyrightText.SetFont( aNewFont );
+
+ aVersionText.SetBackground( aWall );
+ aCopyrightText.SetBackground( aWall );
+
+ Color aTextColor( COL_BLACK );
+ aVersionText.SetControlForeground( aTextColor );
+ aCopyrightText.SetControlForeground( aTextColor );
+
+ // Gr"ossen und Positionen berechnen
+ Size aAppLogoSiz = aAppLogo.GetSizePixel();
+ Size aOutSiz = GetOutputSizePixel();
+ Size aTextSize = Size( GetTextWidth( DEFINE_CONST_UNICODE( "StarOfficeAbout" ) ), GetTextHeight() );
+
+ // Fenstergr"osse
+ aOutSiz.Width() = aAppLogoSiz.Width();
+
+ // Texte (Gr"osse und Position )
+ Size a6Size = aVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
+ long nRowH = GetTextHeight();
+ long nSpace = SPACE_OFFSET * 2;
+ long nY = 0;
+ Point aTextPos = aVersionText.GetPosPixel();
+ aTextPos.X() = a6Size.Width() * 2;
+ aTextPos.Y() = aAppLogoSiz.Height() + ( a6Size.Height() * 2 );
+ nY = aTextPos.Y();
+ aVersionText.SetPosPixel( aTextPos );
+ Size aTxtSiz = aVersionText.GetSizePixel();
+ aTxtSiz.Width() = aAppLogoSiz.Width() - ( a6Size.Width() * 4 );
+ long nTextWidth = aTxtSiz.Width();
+ long nSub = GetTextWidth( DEFINE_CONST_UNICODE( "x" ) );
+ long nRows = CalcTextRows_Impl( aVersionText, nTextWidth - nSub );
+ aTxtSiz.Height() = nRows * nRowH + nSpace;
+ aVersionText.SetSizePixel( aTxtSiz );
+ nY += aTxtSiz.Height() + ( a6Size.Height() / 3 );
+
+ aTextPos = aCopyrightText.GetPosPixel();
+ aTextPos.X() = a6Size.Width() * 2;
+ aTextPos.Y() = nY;
+ aCopyrightText.SetPosPixel( aTextPos );
+ aTxtSiz = aCopyrightText.GetSizePixel();
+ aTxtSiz.Width() = nTextWidth;
+ nRows = CalcTextRows_Impl( aCopyrightText, nTextWidth - nSub );
+ aTxtSiz.Height() = nRows * nRowH + nSpace;
+ aCopyrightText.SetSizePixel( aTxtSiz );
+ nY += aTxtSiz.Height() + ( a6Size.Height() / 2 );
+
+ // OK-Button-Position (at the bottom and centered)
+ Size aOKSiz = aOKButton.GetSizePixel();
+ Point aOKPnt = aOKButton.GetPosPixel();
+ aOKPnt.X() = ( aOutSiz.Width() - aOKSiz.Width() ) / 2;
+ aOKPnt.Y() = nY + 8;
+ aOKButton.SetPosPixel( aOKPnt );
+ nY = aOKPnt.Y() + aOKSiz.Height() + a6Size.Height();
+ aOutSiz.Height() = nY;
+ SetOutputSizePixel( aOutSiz );
+
+ FreeResource();
+
+ // explizite Help-Id
+ SetHelpId( SID_ABOUT );
+}
+
+// -----------------------------------------------------------------------
+
+AboutDialog::~AboutDialog()
+{
+ // L"oschen des Entwickleraufrufs
+ if ( aAccelList.Count() )
+ {
+ GetpApp()->RemoveAccel( aAccelList.First() );
+ Accelerator* pAccel = aAccelList.Last();
+
+ while ( pAccel )
+ {
+ delete pAccel;
+ pAccel = aAccelList.Prev();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( AboutDialog, TimerHdl, Timer *, pTimer )
+{
+ // Text scrollen
+ nOff -= SCROLL_OFFSET;
+ MapMode aMapMode( MAP_PIXEL, Point( 0, nOff ), Fraction( 1, 1 ), Fraction( 1, 1 ) );
+ SetMapMode( aMapMode );
+ Scroll( 0, -SCROLL_OFFSET );
+
+ // Wenn der Text zuende gescrollt wurde, Dialogbox beenden
+ if ( ( nOff * -1 ) > nEnd )
+ {
+ bNormal = TRUE;
+ Close();
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( AboutDialog, AccelSelectHdl, Accelerator *, pAccelerator )
+{
+ // init Timer
+ aTimer.SetTimeoutHdl( LINK( this, AboutDialog, TimerHdl ) );
+
+ // init scroll mode
+ nOff = GetOutputSizePixel().Height();
+ MapMode aMapMode( MAP_PIXEL, Point( 0, nOff ), Fraction( 1, 1 ), Fraction( 1, 1 ) );
+ SetMapMode( aMapMode );
+ bNormal = FALSE;
+
+ // text always black on white
+ Font aFont = GetFont();
+ aFont.SetTransparent( TRUE );
+ Color aBlackCol( COL_BLACK );
+ aFont.SetColor( aBlackCol );
+ SetFont( aFont );
+
+ // start scroll Timer
+ aTimer.SetTimeout( 60 );
+ aTimer.Start();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL AboutDialog::Close()
+{
+ // stop Timer and finish the dialog
+ aTimer.Stop();
+ EndDialog( RET_OK );
+ return( FALSE );
+}
+
+// -----------------------------------------------------------------------
+
+void AboutDialog::Paint( const Rectangle& rRect )
+{
+ if ( bNormal )
+ {
+ // not in scroll mode
+ DrawImage( Point(), aAppLogo );
+ return;
+ }
+
+ long nPos = 0;
+ long nW = GetOutputSizePixel().Width() / 2 - 5;
+ Size aSize = Size( GetTextWidth( aDevVersionStr ), GetTextHeight() );
+ USHORT nStartPos = 0;
+ USHORT nEndPos = 0;
+ Point aPnt( nW - ( aSize.Width() / 2 ), nPos );
+ long nPos1 = aPnt.Y(), nPos2 = nPos1 + aSize.Height(), nTop = rRect.Top();
+
+ if ( nPos1 <= nTop && nTop < nPos2 )
+ DrawText( aPnt, aDevVersionStr );
+
+ nPos += aSize.Height() + 3;
+ USHORT nDevCnt = aDeveloperAry.Count();
+
+ if ( nDevCnt )
+ {
+ for ( USHORT i = 0; i < nDevCnt; ++i )
+ {
+ String aStr = aDeveloperAry.GetString(i);
+ long nVal = aDeveloperAry.GetValue(i);
+
+ if ( nVal )
+ {
+ // Versionsnummern gibt es nur in den fetten Zeilen
+ USHORT nProductVersion = ProductVersion::GetVersion().ToInt32();
+ String aVersion = String::CreateFromInt32( nProductVersion / 10 );
+ aVersion += '.';
+ aVersion += String::CreateFromInt32( nProductVersion % 10 );
+ USHORT nSPos = aStr.SearchAndReplaceAscii( "$(VER)", aVersion );
+ while ( STRING_NOTFOUND != nSPos )
+ nSPos = aStr.SearchAndReplaceAscii( "$(VER)", aVersion, nSPos );
+ }
+ aSize = Size( GetTextWidth( aStr ), GetTextHeight() );
+ aPnt = Point( nW - ( aSize.Width() / 2 ), nPos );
+ nPos1 = aPnt.Y();
+ nPos2 = nPos1 + aSize.Height();
+
+ if ( nPos1 <= nTop && nTop < nPos2 )
+ {
+ if ( nVal )
+ {
+ // eine "Uberschrift hervorheben
+ Font aFont = GetFont();
+ FontWeight eOldWeight = aFont.GetWeight();
+ Color aOldCol = aFont.GetColor();
+ aFont.SetWeight( (FontWeight)nVal );
+ if ( aStr.GetChar(1) != ' ' )
+ {
+ Color aGrayCol( COL_GRAY );
+ aFont.SetColor( aGrayCol );
+ }
+ SetFont( aFont );
+ long nOldW = aSize.Width();
+ aSize = Size(GetTextWidth( aStr ),GetTextHeight());
+ aPnt.X() -= ( aSize.Width() - nOldW ) / 2;
+ DrawText( aPnt, aStr );
+ aFont.SetWeight( eOldWeight );
+ aFont.SetColor( aOldCol );
+ SetFont( aFont );
+ }
+ else
+ DrawText( aPnt, aStr );
+ }
+ nPos += aSize.Height() + 3;
+ }
+ }
+ nEnd = nPos - 4;
+}
+
+
diff --git a/sfx2/source/dialog/acccfg.cxx b/sfx2/source/dialog/acccfg.cxx
new file mode 100644
index 000000000000..d0e276cb66e4
--- /dev/null
+++ b/sfx2/source/dialog/acccfg.cxx
@@ -0,0 +1,854 @@
+/*************************************************************************
+ *
+ * $RCSfile: acccfg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _HELP_HXX //autogen
+#include <vcl/help.hxx>
+#endif
+#ifndef VCL
+#ifndef _FILDLG_HXX //autogen
+#include <vcl/fildlg.hxx>
+#endif
+#else
+#ifndef _SV_FILEDLG_HXX //autogen
+#include <svtools/filedlg.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#endif
+#pragma hdrstop
+
+#include "cfg.hxx"
+
+#include "dialog.hrc"
+#include "cfg.hrc"
+
+#ifdef MAC
+#ifndef _EXTATTR_HXX //autogen
+#include <svtools/extattr.hxx>
+#endif
+#endif
+
+#include "app.hxx"
+#include "msg.hxx"
+#include "msgpool.hxx"
+#include "accmgr.hxx"
+#include "sfxresid.hxx"
+#include "macrconf.hxx"
+#include "cfgmgr.hxx"
+#include "sfxresid.hxx"
+#include "objsh.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+
+#ifdef VCL
+#include "iodlg.hxx"
+#endif
+
+//static const char __FAR_DATA pUnknownStr[] = "???";
+static USHORT __FAR_DATA aCodeArr[] =
+{
+ KEY_F2 ,
+ KEY_F3 ,
+ KEY_F4 ,
+ KEY_F5 ,
+ KEY_F6 ,
+ KEY_F7 ,
+ KEY_F8 ,
+ KEY_F9 ,
+ KEY_F10 ,
+ KEY_F11 ,
+ KEY_F12 ,
+
+ KEY_DOWN ,
+ KEY_UP ,
+ KEY_LEFT ,
+ KEY_RIGHT ,
+ KEY_HOME ,
+ KEY_END ,
+ KEY_PAGEUP ,
+ KEY_PAGEDOWN ,
+ KEY_RETURN ,
+ KEY_ESCAPE ,
+ KEY_BACKSPACE,
+ KEY_INSERT ,
+ KEY_DELETE ,
+
+ KEY_F2 | KEY_SHIFT,
+ KEY_F3 | KEY_SHIFT,
+ KEY_F4 | KEY_SHIFT,
+ KEY_F5 | KEY_SHIFT,
+ KEY_F6 | KEY_SHIFT,
+ KEY_F7 | KEY_SHIFT,
+ KEY_F8 | KEY_SHIFT,
+ KEY_F9 | KEY_SHIFT,
+ KEY_F10 | KEY_SHIFT,
+ KEY_F11 | KEY_SHIFT,
+ KEY_F12 | KEY_SHIFT,
+
+ KEY_DOWN | KEY_SHIFT,
+ KEY_UP | KEY_SHIFT,
+ KEY_LEFT | KEY_SHIFT,
+ KEY_RIGHT | KEY_SHIFT,
+ KEY_HOME | KEY_SHIFT,
+ KEY_END | KEY_SHIFT,
+ KEY_PAGEUP | KEY_SHIFT,
+ KEY_PAGEDOWN | KEY_SHIFT,
+ KEY_RETURN | KEY_SHIFT,
+ KEY_SPACE | KEY_SHIFT,
+ KEY_ESCAPE | KEY_SHIFT,
+ KEY_BACKSPACE | KEY_SHIFT,
+ KEY_INSERT | KEY_SHIFT,
+ KEY_DELETE | KEY_SHIFT,
+
+ KEY_0 | KEY_MOD1 ,
+ KEY_1 | KEY_MOD1 ,
+ KEY_2 | KEY_MOD1 ,
+ KEY_3 | KEY_MOD1 ,
+ KEY_4 | KEY_MOD1 ,
+ KEY_5 | KEY_MOD1 ,
+ KEY_6 | KEY_MOD1 ,
+ KEY_7 | KEY_MOD1 ,
+ KEY_8 | KEY_MOD1 ,
+ KEY_9 | KEY_MOD1 ,
+ KEY_A | KEY_MOD1 ,
+ KEY_B | KEY_MOD1 ,
+ KEY_C | KEY_MOD1 ,
+ KEY_D | KEY_MOD1 ,
+ KEY_E | KEY_MOD1 ,
+ KEY_F | KEY_MOD1 ,
+ KEY_G | KEY_MOD1 ,
+ KEY_H | KEY_MOD1 ,
+ KEY_I | KEY_MOD1 ,
+ KEY_J | KEY_MOD1 ,
+ KEY_K | KEY_MOD1 ,
+ KEY_L | KEY_MOD1 ,
+ KEY_M | KEY_MOD1 ,
+ KEY_N | KEY_MOD1 ,
+ KEY_O | KEY_MOD1 ,
+ KEY_P | KEY_MOD1 ,
+ KEY_Q | KEY_MOD1 ,
+ KEY_R | KEY_MOD1 ,
+ KEY_S | KEY_MOD1 ,
+ KEY_T | KEY_MOD1 ,
+ KEY_U | KEY_MOD1 ,
+ KEY_V | KEY_MOD1 ,
+ KEY_W | KEY_MOD1 ,
+ KEY_X | KEY_MOD1 ,
+ KEY_Y | KEY_MOD1 ,
+ KEY_Z | KEY_MOD1 ,
+
+ KEY_F2 | KEY_MOD1 ,
+ KEY_F3 | KEY_MOD1 ,
+ KEY_F4 | KEY_MOD1 ,
+ KEY_F5 | KEY_MOD1 ,
+ KEY_F6 | KEY_MOD1 ,
+ KEY_F7 | KEY_MOD1 ,
+ KEY_F8 | KEY_MOD1 ,
+ KEY_F9 | KEY_MOD1 ,
+ KEY_F10 | KEY_MOD1 ,
+ KEY_F11 | KEY_MOD1 ,
+ KEY_F12 | KEY_MOD1 ,
+
+ KEY_DOWN | KEY_MOD1 ,
+ KEY_UP | KEY_MOD1 ,
+ KEY_LEFT | KEY_MOD1 ,
+ KEY_RIGHT | KEY_MOD1 ,
+ KEY_HOME | KEY_MOD1 ,
+ KEY_END | KEY_MOD1 ,
+ KEY_PAGEUP | KEY_MOD1 ,
+ KEY_PAGEDOWN | KEY_MOD1 ,
+ KEY_RETURN | KEY_MOD1 ,
+ KEY_SPACE | KEY_MOD1 ,
+ KEY_BACKSPACE | KEY_MOD1 ,
+ KEY_INSERT | KEY_MOD1 ,
+ KEY_DELETE | KEY_MOD1 ,
+
+ KEY_ADD | KEY_MOD1 ,
+ KEY_SUBTRACT | KEY_MOD1 ,
+ KEY_MULTIPLY | KEY_MOD1 ,
+ KEY_DIVIDE | KEY_MOD1 ,
+
+ KEY_0 | KEY_SHIFT | KEY_MOD1,
+ KEY_1 | KEY_SHIFT | KEY_MOD1,
+ KEY_2 | KEY_SHIFT | KEY_MOD1,
+ KEY_3 | KEY_SHIFT | KEY_MOD1,
+ KEY_4 | KEY_SHIFT | KEY_MOD1,
+ KEY_5 | KEY_SHIFT | KEY_MOD1,
+ KEY_6 | KEY_SHIFT | KEY_MOD1,
+ KEY_7 | KEY_SHIFT | KEY_MOD1,
+ KEY_8 | KEY_SHIFT | KEY_MOD1,
+ KEY_9 | KEY_SHIFT | KEY_MOD1,
+ KEY_A | KEY_SHIFT | KEY_MOD1,
+ KEY_B | KEY_SHIFT | KEY_MOD1,
+ KEY_C | KEY_SHIFT | KEY_MOD1,
+ KEY_D | KEY_SHIFT | KEY_MOD1,
+ KEY_E | KEY_SHIFT | KEY_MOD1,
+ KEY_F | KEY_SHIFT | KEY_MOD1,
+ KEY_G | KEY_SHIFT | KEY_MOD1,
+ KEY_H | KEY_SHIFT | KEY_MOD1,
+ KEY_I | KEY_SHIFT | KEY_MOD1,
+ KEY_J | KEY_SHIFT | KEY_MOD1,
+ KEY_K | KEY_SHIFT | KEY_MOD1,
+ KEY_L | KEY_SHIFT | KEY_MOD1,
+ KEY_M | KEY_SHIFT | KEY_MOD1,
+ KEY_N | KEY_SHIFT | KEY_MOD1,
+ KEY_O | KEY_SHIFT | KEY_MOD1,
+ KEY_P | KEY_SHIFT | KEY_MOD1,
+ KEY_Q | KEY_SHIFT | KEY_MOD1,
+ KEY_R | KEY_SHIFT | KEY_MOD1,
+ KEY_S | KEY_SHIFT | KEY_MOD1,
+ KEY_T | KEY_SHIFT | KEY_MOD1,
+ KEY_U | KEY_SHIFT | KEY_MOD1,
+ KEY_V | KEY_SHIFT | KEY_MOD1,
+ KEY_W | KEY_SHIFT | KEY_MOD1,
+ KEY_X | KEY_SHIFT | KEY_MOD1,
+ KEY_Y | KEY_SHIFT | KEY_MOD1,
+ KEY_Z | KEY_SHIFT | KEY_MOD1,
+
+ KEY_F2 | KEY_SHIFT | KEY_MOD1,
+ KEY_F3 | KEY_SHIFT | KEY_MOD1,
+ KEY_F4 | KEY_SHIFT | KEY_MOD1,
+ KEY_F5 | KEY_SHIFT | KEY_MOD1,
+ KEY_F6 | KEY_SHIFT | KEY_MOD1,
+ KEY_F7 | KEY_SHIFT | KEY_MOD1,
+ KEY_F8 | KEY_SHIFT | KEY_MOD1,
+ KEY_F9 | KEY_SHIFT | KEY_MOD1,
+ KEY_F10 | KEY_SHIFT | KEY_MOD1,
+ KEY_F11 | KEY_SHIFT | KEY_MOD1,
+ KEY_F12 | KEY_SHIFT | KEY_MOD1,
+
+ KEY_DOWN | KEY_SHIFT | KEY_MOD1,
+ KEY_UP | KEY_SHIFT | KEY_MOD1,
+ KEY_LEFT | KEY_SHIFT | KEY_MOD1,
+ KEY_RIGHT | KEY_SHIFT | KEY_MOD1,
+ KEY_HOME | KEY_SHIFT | KEY_MOD1,
+ KEY_END | KEY_SHIFT | KEY_MOD1,
+ KEY_PAGEUP | KEY_SHIFT | KEY_MOD1,
+ KEY_PAGEDOWN | KEY_SHIFT | KEY_MOD1,
+
+ KEY_RETURN | KEY_SHIFT | KEY_MOD1,
+ KEY_SPACE | KEY_SHIFT | KEY_MOD1,
+ KEY_BACKSPACE | KEY_SHIFT | KEY_MOD1,
+ KEY_INSERT | KEY_SHIFT | KEY_MOD1,
+ KEY_DELETE | KEY_SHIFT | KEY_MOD1
+};
+
+static long nAccCfgTabs[] =
+{
+ 2, // Number of Tabs
+ 0,
+ 120 // Function
+};
+
+#define ACC_CODEARRSIZE ( sizeof( aCodeArr ) / sizeof( aCodeArr[ 0 ] ) )
+#ifdef VCL
+#define ACC_FUNCTIONCOUNT 0
+#else
+#define ACC_FUNCTIONCOUNT 18
+#endif
+
+#ifdef MSC
+#pragma warning (disable:4355)
+#endif
+
+/* SfxAcceleratorConfigListBox::KeyInput() *******************************************
+
+Springt den Eintrag an, der der gedrueckten Tastenkombination entspricht.
+Ausgenommen davon sind die fuer die Dialogsteuerung ueblichen
+Tastenkombinationen.
+
+****************************************************************************/
+
+void SfxAccCfgTabListBox_Impl::KeyInput( const KeyEvent &rKEvt )
+{
+ KeyCode aCode1 = rKEvt.GetKeyCode();
+ USHORT nCode = aCode1.GetCode();
+
+ if ( nCode != KEY_DOWN && nCode != KEY_UP &&
+ nCode != KEY_LEFT && nCode != KEY_RIGHT &&
+ nCode != KEY_PAGEUP && nCode != KEY_PAGEDOWN )
+ {
+ for ( USHORT i = 0; i < ACC_CODEARRSIZE; i++ )
+ {
+ KeyCode aCode2( aCodeArr[ i ] );
+
+ if ( aCode1.GetCode () == aCode2.GetCode () &&
+ aCode1.GetModifier() == aCode2.GetModifier() )
+ {
+ SvLBoxEntry *pEntry = GetEntry( 0, i + ACC_FUNCTIONCOUNT );
+ Select( pEntry );
+ MakeVisible( pEntry );
+ return;
+ }
+ }
+ }
+
+ SfxMenuCfgTabListBox_Impl::KeyInput( rKEvt );
+}
+
+SfxAcceleratorConfigPage::~SfxAcceleratorConfigPage()
+{
+}
+
+// SfxAcceleratorConfigPage::Ctor() ************************************************
+
+SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( Window *pParent, const SfxItemSet& rSet ) :
+
+ SfxTabPage( pParent, SfxResId( TP_CONFIG_ACCEL ), rSet ),
+
+ aChangeButton ( this, ResId( BTN_ACC_CHANGE ) ),
+ aRemoveButton ( this, ResId( BTN_ACC_REMOVE ) ),
+ aEntriesBox ( this, ResId( BOX_ACC_ENTRIES ) ),
+ aKeyboardGroup ( this, ResId( GRP_ACC_KEYBOARD ) ),
+ aGroupText ( this, ResId( TXT_ACC_GROUP ) ),
+ aGroupBox ( this, ResId( BOX_ACC_GROUP ), SFX_SLOT_ACCELCONFIG ),
+ aFunctionText ( this, ResId( TXT_ACC_FUNCTION ) ),
+ aFunctionBox ( this, ResId( BOX_ACC_FUNCTION ) ),
+ aKeyText ( this, ResId( TXT_ACC_KEY ) ),
+ aKeyBox ( this, ResId( BOX_ACC_KEY ) ),
+ aFunctionsGroup ( this, ResId( GRP_ACC_FUNCTIONS ) ),
+ aLoadButton ( this, ResId( BTN_LOAD ) ),
+ aSaveButton ( this, ResId( BTN_SAVE ) ),
+ aResetButton ( this, ResId( BTN_RESET ) ),
+ pMgr( SFX_APP()->GetAcceleratorManager() ),
+ bModified(FALSE),
+ bDefault( pMgr->IsDefault() )
+{
+ FreeResource();
+
+ // Handler installieren
+ aChangeButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage,
+ ChangeHdl ) );
+ aRemoveButton.SetClickHdl ( LINK( this, SfxAcceleratorConfigPage,
+ RemoveHdl ) );
+ aEntriesBox .SetSelectHdl( LINK( this, SfxAcceleratorConfigPage,
+ SelectHdl ) );
+ aGroupBox .SetSelectHdl( LINK( this, SfxAcceleratorConfigPage,
+ SelectHdl ) );
+ aFunctionBox .SetSelectHdl( LINK( this, SfxAcceleratorConfigPage,
+ SelectHdl ) );
+ aKeyBox .SetSelectHdl( LINK( this, SfxAcceleratorConfigPage,
+ SelectHdl ) );
+ aLoadButton .SetClickHdl ( LINK( this, SfxAcceleratorConfigPage,
+ Load ) );
+ aSaveButton .SetClickHdl ( LINK( this, SfxAcceleratorConfigPage,
+ Save ) );
+ aResetButton .SetClickHdl ( LINK( this, SfxAcceleratorConfigPage,
+ Default ) );
+
+ // aAccelArr dimensionieren
+ for ( USHORT i = 0; i < ACC_FUNCTIONCOUNT + ACC_CODEARRSIZE; i++ )
+ aAccelArr.Append( 0 );
+
+ // Entriesbox initialisieren
+//(mba)/task SfxWaitCursor aWait;
+ aEntriesBox.SetWindowBits( WB_HSCROLL|WB_CLIPCHILDREN );
+ aEntriesBox.SetSelectionMode( SINGLE_SELECTION );
+ aEntriesBox.SetTabs( &nAccCfgTabs[0], MAP_APPFONT );
+ aEntriesBox.Resize(); // OS: Hack fuer richtige Selektion
+// aEntriesBox.SetFont( SFX_APP()->GetAppFont() );
+ aEntriesBox.SetSpaceBetweenEntries( 0 );
+ aEntriesBox.SetDragDropMode(0);
+ Init();
+
+ aGroupBox.SetFunctionListBox( &aFunctionBox );
+ aGroupBox.Init();
+ aEntriesBox.Select( aEntriesBox.GetEntry( 0, 0 ) );
+ aGroupBox.Select( aGroupBox.GetEntry( 0, 0 ) );
+}
+
+void SfxAcceleratorConfigPage::Init()
+{
+ // aEntriesBox initialisieren
+ USHORT i;
+ for ( i=0; i<ACC_FUNCTIONCOUNT; i++ )
+ {
+ // F"ur alle "physikalischen" Acceleratoren einen Eintrag anlegen
+ String aEntry = GetFunctionName( ( KeyFuncType ) ( i + 1 ) );
+ SfxMenuConfigEntry *pEntry = new SfxMenuConfigEntry( 0, aEntry, String(), FALSE );
+ SvLBoxEntry *pLBEntry = aEntriesBox.InsertEntry( aEntry, 0L, LIST_APPEND, 0xFFFF );
+ aEntriesBox.EntryInserted( pLBEntry );
+ pLBEntry->SetUserData( pEntry );
+ }
+
+ for ( i=0; i<ACC_CODEARRSIZE; i++ )
+ {
+ // F"ur alle "logischen" Acceleratoren einen Eintrag anlegen
+ String aEntry = PosToKeyCode( i + ACC_FUNCTIONCOUNT ).GetName();
+ SfxMenuConfigEntry *pEntry = new SfxMenuConfigEntry( 0, aEntry, String(), FALSE );
+ SvLBoxEntry *pLBEntry = aEntriesBox.InsertEntry( aEntry, 0L, LIST_APPEND, 0xFFFF );
+ aEntriesBox.EntryInserted( pLBEntry );
+ pLBEntry->SetUserData( pEntry );
+ }
+
+#ifdef MBA_PUT_ITEMS
+ SvFileStream aFile( "c:\\accel.log", STREAM_STD_WRITE );
+#endif
+
+ BOOL bItem = pMgr->FirstItem();
+ while ( bItem )
+ {
+ // F"ur alle Eintr"age, die in der Konfiguration enthalten sind, den Funktionsnamen und Hilfetext holen
+ USHORT nPos = KeyCodeToPos( pMgr->GetKeyCode() );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ {
+ USHORT nCol = aEntriesBox.TabCount() - 1;
+ String aText ('[');
+ aText += SFX_SLOTPOOL().GetSlotName_Impl( pMgr->GetId() );
+ aText += ']';
+ aEntriesBox.SetEntryText( aText, nPos, nCol );
+ aAccelArr[ nPos ] = pMgr->GetId();
+ SfxMenuConfigEntry *pEntry = (SfxMenuConfigEntry*) aEntriesBox.GetEntry( 0, nPos )->GetUserData();
+ pEntry->SetId( pMgr->GetId() );
+
+#ifdef MBA_PUT_ITEMS
+ KeyCode aCode = pMgr->GetKeyCode();
+ String aName;
+ if ( !aCode.IsFunction() )
+ aName = aCode.GetName();
+ else
+ aName = GetFunctionName( aCode.GetFunction() );
+ aFile << aText.GetStr() << '\t' << aName.GetStr() << '\n';
+#endif
+ }
+
+ bItem = pMgr->NextItem();
+ }
+
+// for ( i=0; i<ACC_FUNCTIONCOUNT; i++ )
+// aEntriesBox.GetModel()->Remove( aEntriesBox.FirstChild( 0 ) );
+}
+
+void SfxAcceleratorConfigPage::ResetConfig()
+{
+ aEntriesBox.Clear();
+ for ( USHORT i = 0; i < ACC_FUNCTIONCOUNT + ACC_CODEARRSIZE; i++ )
+ aAccelArr[i] = 0;
+}
+
+void SfxAcceleratorConfigPage::Apply()
+{
+ if (!bModified)
+ return;
+
+ if ( bDefault )
+ {
+ pMgr->UseDefault();
+ pMgr->SetDefault(TRUE);
+ bModified = FALSE;
+ return;
+ }
+
+ bModified = FALSE;
+
+//(mba)/task SfxWaitCursor aWait;
+ SvUShorts aListOfIds;
+
+ // zaehlen
+ USHORT nCount = 0;
+ USHORT i;
+ for ( i = ACC_FUNCTIONCOUNT + ACC_CODEARRSIZE; i > 0; --i )
+ {
+ if ( aAccelArr[i-1] )
+ ++nCount;
+ }
+
+ BOOL bItem = pMgr->FirstItem();
+ while ( bItem )
+ {
+ // Macro-Eintraege referenzieren, da sie sonst beim Clear eventuell
+ // entfernt werden koennten !
+
+ if ( SfxMacroConfig::IsMacroSlot( pMgr->GetId() ) )
+ aListOfIds.Insert(pMgr->GetId(), aListOfIds.Count());
+ bItem = pMgr->NextItem();
+ }
+
+ pMgr->Reset(nCount);
+
+ // Liste von hinten durchgehen, damit logische Acceleratoren Vorrang
+ // vor physikalischen haben.
+ for ( i = ACC_FUNCTIONCOUNT + ACC_CODEARRSIZE; i > 0; --i )
+ {
+ if ( aAccelArr[i-1] )
+ {
+ if ( SfxMacroConfig::IsMacroSlot( aAccelArr[i-1] ) )
+ {
+ USHORT nPos;
+ for (nPos=0; nPos<aListOfIds.Count(); nPos++)
+ if (aListOfIds[nPos] == aAccelArr[i-1])
+ break;
+ if (nPos < aListOfIds.Count())
+ aListOfIds.Remove(nPos);
+ else
+ SFX_APP()->GetMacroConfig()->RegisterSlotId(aAccelArr[i-1]);
+ }
+
+ pMgr->AppendItem( aAccelArr[i-1], PosToKeyCode( i-1 ) );
+ }
+ }
+
+ for (i=0; i<aListOfIds.Count(); i++)
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId(aListOfIds[i]);
+
+ pMgr->Reconfigure();
+}
+
+IMPL_LINK( SfxAcceleratorConfigPage, Load, Button *, pButton )
+{
+ String aCfgName = SfxConfigDialog::FileDialog_Impl( this,
+ WB_OPEN | WB_STDMODAL | WB_3DLOOK, String( SfxResId( STR_LOADACCELCONFIG) ) );
+ if ( aCfgName.Len() )
+ {
+//(mba)/task SfxWaitCursor aWait;
+
+ BOOL bCreated = FALSE;
+ SfxConfigManager *pCfgMgr =
+ SfxConfigDialog::MakeCfgMgr_Impl( aCfgName, bCreated );
+ SfxConfigManager *pOldCfgMgr = pMgr->GetConfigManager_Impl();
+ if (pOldCfgMgr != pCfgMgr)
+ {
+ if (pCfgMgr->HasConfigItem(pMgr->GetType()))
+ {
+ pMgr->ReInitialize(pCfgMgr);
+ aEntriesBox.SetUpdateMode(FALSE);
+ ResetConfig();
+ Init();
+ aEntriesBox.SetUpdateMode(TRUE);
+ aEntriesBox.Invalidate();
+ aEntriesBox.Select( aEntriesBox.GetEntry( 0, 0 ) );
+ pMgr->ReInitialize(pOldCfgMgr);
+ bDefault = FALSE;
+ bModified = TRUE;
+ }
+ }
+
+ if ( bCreated )
+ delete pCfgMgr;
+ }
+
+ return 0;
+}
+
+IMPL_LINK( SfxAcceleratorConfigPage, Save, Button *, pButton )
+{
+ String aCfgName = SfxConfigDialog::FileDialog_Impl( this,
+ WB_SAVEAS | WB_STDMODAL | WB_3DLOOK, String( SfxResId( STR_SAVEACCELCONFIG) ) );
+ if ( aCfgName.Len() )
+ {
+//(mba)/task SfxWaitCursor aWait;
+
+ BOOL bCreated = FALSE;
+ SfxConfigManager *pCfgMgr =
+ SfxConfigDialog::MakeCfgMgr_Impl( aCfgName, bCreated );
+
+ if ( pCfgMgr == SfxObjectShell::Current()->GetConfigManager() )
+ {
+ pCfgMgr->Activate(SFX_CFGMANAGER());
+ pMgr->Connect(pCfgMgr);
+ pCfgMgr->AddConfigItem(pMgr);
+ }
+
+ SfxConfigManager *pOldCfgMgr = pMgr->GetConfigManager_Impl();
+ if (pOldCfgMgr != pCfgMgr)
+ {
+ pMgr->StoreConfig();
+ pMgr->Connect(pCfgMgr);
+ pCfgMgr->AddConfigItem(pMgr);
+ BOOL bMod = bModified;
+ BOOL bItemModified = pMgr->IsModified();
+ Apply();
+ pMgr->SetModified( TRUE );
+ pCfgMgr->StoreConfig();
+ pMgr->ReInitialize(pOldCfgMgr);
+ pMgr->SetModified( bItemModified );
+ bModified = bMod;
+
+ if (bCreated)
+ {
+ pCfgMgr->SetModified( TRUE );
+ pCfgMgr->SaveConfig();
+#ifdef MAC
+ SvEaMgr aEaMgr(aCfgName);
+ aEaMgr.SetFileType("Pref");
+#endif
+ }
+
+ }
+ else
+ {
+ Apply();
+ pMgr->SetModified( TRUE );
+ pCfgMgr->StoreConfig();
+ }
+
+ if (bCreated)
+ delete pCfgMgr;
+ }
+
+ return 0;
+}
+
+IMPL_LINK( SfxAcceleratorConfigPage, Default, PushButton *, pPushButton )
+{
+ SfxConfigManager *pOldCfgMgr = pMgr->GetConfigManager_Impl();
+ bDefault = TRUE;
+ bModified = !pMgr->IsDefault();
+ pMgr->StoreConfig();
+ pMgr->ReleaseConfigManager();
+ pMgr->UseDefault();
+ aEntriesBox.SetUpdateMode(FALSE);
+ ResetConfig();
+ Init();
+ aEntriesBox.SetUpdateMode(TRUE);
+ aEntriesBox.Invalidate();
+ aEntriesBox.Select( aEntriesBox.GetEntry( 0, 0 ) );
+ pMgr->ReInitialize(pOldCfgMgr);
+ return 0;
+}
+
+IMPL_LINK( SfxAcceleratorConfigPage, ChangeHdl, Button *, pButton )
+{
+ bDefault = FALSE;
+ bModified = TRUE;
+
+ // Selektierter Eintrag und selektierte Funktion
+ USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
+ USHORT nId = aFunctionBox.GetCurId();
+
+ String aStr;
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ {
+ // Es ist ein Macro selektiert, f"ur das schon eine SlotId reserviert wurde
+ aStr = SFX_APP()->GetMacroConfig()->GetMacroInfo(nId)->GetMacroName();
+ }
+ else
+ {
+ // Eine normale Funktion ist selektiert
+ aStr = SFX_SLOTPOOL().GetSlotName_Impl( nId );
+ }
+
+ // Hilfetext setzen
+ SfxMenuConfigEntry *pEntry = (SfxMenuConfigEntry*) aEntriesBox.GetEntry( 0, nPos )->GetUserData();
+
+ // Funktions/Macronamen im Eintrag updaten
+ String aText ('[');
+ aText += aStr;
+ aText += ']';
+ USHORT nCol = aEntriesBox.TabCount() - 1;
+ aEntriesBox.SetEntryText( aText, nPos, nCol );
+ aAccelArr[ nPos ] = nId;
+ pEntry->SetId( nId );
+ pEntry->SetHelpText( String() );
+ ((Link &) aFunctionBox.GetSelectHdl()).Call( &aFunctionBox );
+ return 0;
+}
+
+IMPL_LINK( SfxAcceleratorConfigPage, RemoveHdl, Button *, pButton )
+{
+ bDefault = FALSE;
+ bModified = TRUE;
+
+ // Selektierter Eintrag
+ USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
+ SfxMenuConfigEntry *pEntry = (SfxMenuConfigEntry*) aEntriesBox.GetEntry( 0, nPos )->GetUserData();
+ pEntry->SetHelpText( String() );
+
+ // Funktionsnamen aus dem Eintrag l"oschen
+ USHORT nCol = aEntriesBox.TabCount() - 1;
+ aEntriesBox.SetEntryText( pEntry->GetName(), nPos ); // Nur letzte Spalte auf "" setzen funzt nicht - Bug ??
+ aAccelArr[ nPos ] = 0;
+ pEntry->SetId( 0 );
+ ((Link &) aFunctionBox.GetSelectHdl()).Call( &aFunctionBox );
+ return 0;
+}
+
+IMPL_LINK( SfxAcceleratorConfigPage, SelectHdl, Control*, pListBox )
+{
+ // Alle Hilfetexte abschalten
+ Help::ShowBalloon( this, Point(), String() );
+
+ if ( pListBox == &aEntriesBox )
+ {
+ // Eintrag ausgewaehlt: Buttons enablen/disablen
+ USHORT nPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
+ aChangeButton.Enable( nPos >= ACC_FUNCTIONCOUNT && aAccelArr[ nPos ] != aFunctionBox.GetCurId() );
+ aRemoveButton.Enable( nPos >= ACC_FUNCTIONCOUNT && aAccelArr[ nPos ] > 0 );
+ }
+ else if ( pListBox == &aGroupBox )
+ {
+ aGroupBox.GroupSelected();
+ if ( !aFunctionBox.FirstSelected() )
+ aChangeButton.Enable( FALSE );
+ }
+ else if ( pListBox == &aFunctionBox )
+ {
+ aFunctionBox.FunctionSelected();
+
+ // Zuerst "uberpr"ufen, ob durch den Wechsel der Selektion der Zustand des ChangeButtons wechselt
+ USHORT nEntryPos = (USHORT) aEntriesBox.GetModel()->GetRelPos( aEntriesBox.FirstSelected() );
+ USHORT nId = aFunctionBox.GetCurId();
+ aChangeButton.Enable( nEntryPos >= ACC_FUNCTIONCOUNT && aAccelArr[ nEntryPos ] != nId );
+ aRemoveButton.Enable( nEntryPos >= ACC_FUNCTIONCOUNT && aAccelArr[ nEntryPos ] > 0 );
+
+ aKeyBox.Clear();
+ aKeyArr.Clear();
+
+ for ( USHORT i = 0; i < ACC_FUNCTIONCOUNT + ACC_CODEARRSIZE; i++ )
+ {
+ if ( aAccelArr[ i ] == nId )
+ {
+ KeyCode aCode = PosToKeyCode( i );
+ if ( !aCode.IsFunction() )
+ aKeyBox.InsertEntry( aCode.GetName() );
+ else
+ aKeyBox.InsertEntry( GetFunctionName( aCode.GetFunction() ) );
+
+ aKeyArr.Append( i );
+ }
+ }
+ }
+ else
+ {
+ // Taste ausgewaehlt: Eintrag anspringen
+ USHORT n = aKeyBox.GetSelectEntryPos();
+ USHORT nPos = aKeyArr[ n ] /* - ACC_FUNCTIONCOUNT */;
+ SvLBoxEntry *pEntry = aEntriesBox.GetEntry( 0, nPos );
+ aEntriesBox.Select( pEntry );
+ aEntriesBox.MakeVisible( pEntry );
+ }
+ return 0;
+}
+
+KeyCode SfxAcceleratorConfigPage::PosToKeyCode( USHORT nPos ) const
+{
+ DBG_ASSERT( nPos < ACC_CODEARRSIZE + ACC_FUNCTIONCOUNT, "Invalid position!" );
+
+ if ( nPos < ACC_FUNCTIONCOUNT )
+ {
+ KeyCode aTmpCode( ( KeyFuncType ) ( nPos + 1 ) );
+ return aTmpCode;
+ }
+ else
+ {
+ KeyCode aTmpCode( aCodeArr[ nPos - ACC_FUNCTIONCOUNT] & 0xFFF,
+ aCodeArr[ nPos - ACC_FUNCTIONCOUNT] & ( KEY_SHIFT | KEY_MOD1 ) );
+ return aTmpCode;
+ }
+}
+
+USHORT SfxAcceleratorConfigPage::KeyCodeToPos( const KeyCode &rCode ) const
+{
+ if ( rCode.IsFunction() )
+ return ( USHORT ) rCode.GetFunction() - 1;
+ else
+ {
+ USHORT nCode = rCode.GetCode() + rCode.GetModifier();
+
+ for ( USHORT i = 0; i < ACC_CODEARRSIZE; i++ )
+ {
+ if ( aCodeArr[ i ] == nCode )
+ return i + ACC_FUNCTIONCOUNT;
+ }
+
+ return LISTBOX_ENTRY_NOTFOUND;
+ }
+}
+
+String SfxAcceleratorConfigPage::GetFunctionName( KeyFuncType eType ) const
+{
+ String aStr;
+
+ switch ( eType )
+ {
+ case KEYFUNC_NEW : aStr = String( SfxResId( STR_NEW ) ); break;
+ case KEYFUNC_OPEN : aStr = String( SfxResId( STR_OPEN ) ); break;
+ case KEYFUNC_SAVE : aStr = String( SfxResId( STR_SAVE ) ); break;
+ case KEYFUNC_SAVEAS : aStr = String( SfxResId( STR_SAVEAS ) ); break;
+ case KEYFUNC_PRINT : aStr = String( SfxResId( STR_PRINT ) ); break;
+ case KEYFUNC_CLOSE : aStr = String( SfxResId( STR_CLOSE ) ); break;
+ case KEYFUNC_QUIT : aStr = String( SfxResId( STR_QUIT ) ); break;
+ case KEYFUNC_CUT : aStr = String( SfxResId( STR_CUT ) ); break;
+ case KEYFUNC_COPY : aStr = String( SfxResId( STR_COPY ) ); break;
+ case KEYFUNC_PASTE : aStr = String( SfxResId( STR_PASTE ) ); break;
+ case KEYFUNC_UNDO : aStr = String( SfxResId( STR_UNDO ) ); break;
+ case KEYFUNC_REDO : aStr = String( SfxResId( STR_REDO ) ); break;
+ case KEYFUNC_DELETE : aStr = String( SfxResId( STR_DELETE ) ); break;
+ case KEYFUNC_REPEAT : aStr = String( SfxResId( STR_REPEAT ) ); break;
+ case KEYFUNC_FIND : aStr = String( SfxResId( STR_FIND ) ); break;
+ case KEYFUNC_FINDBACKWARD: aStr = String( SfxResId( STR_FINDBACKWARD ) ); break;
+ case KEYFUNC_PROPERTIES : aStr = String( SfxResId( STR_PROPERTIES ) ); break;
+ case KEYFUNC_FRONT : aStr = String( SfxResId( STR_FRONT ) ); break;
+
+ default: DBG_ERROR( "Invalid KeyFuncType!" );
+ }
+
+ aStr = String('\"').Append(aStr).Append('\"');
+ return aStr;
+}
+
+void SfxAcceleratorConfigPage::SelectMacro(const SfxMacroInfoItem *pItem)
+{
+ aGroupBox.SelectMacro( pItem );
+}
+
+
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
new file mode 100644
index 000000000000..55c719b28882
--- /dev/null
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -0,0 +1,1041 @@
+/*************************************************************************
+ *
+ * $RCSfile: basedlgs.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:29 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// include ---------------------------------------------------------------
+
+#include <stdlib.h>
+
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "basedlgs.hxx"
+#include "viewfrm.hxx"
+#include "tabdlg.hxx"
+#include "app.hxx"
+#include "inimgr.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "sfxhelp.hxx"
+#include "accmgr.hxx"
+
+static String aEmptyString;
+
+// class SfxModalDefParentHelper -----------------------------------------
+
+SfxModalDefParentHelper::SfxModalDefParentHelper( Window *pWindow)
+{
+ pOld = Application::GetDefDialogParent();
+ Application::SetDefDialogParent( pWindow );
+}
+
+// -----------------------------------------------------------------------
+
+SfxModalDefParentHelper::~SfxModalDefParentHelper()
+{
+ Application::SetDefDialogParent( pOld );
+}
+
+// -----------------------------------------------------------------------
+
+void SetDialogData_Impl(SfxViewFrame *pFrame, Window *pDlg,
+ sal_uInt16 nId, const String &rExtraData = aEmptyString)
+{
+ // Konfiguration in Ini-Manager abspeichern
+ SfxIniManager *pIniMgr =
+ pFrame ? pFrame->GetIniManager() : SFX_APP()->GetAppIniManager();
+ String aDlgData( pIniMgr->GetString( pDlg->GetPosPixel(), Size() ) );
+ if( rExtraData.Len() )
+ {
+ aDlgData += pIniMgr->GetToken();
+ aDlgData += rExtraData;
+ }
+ pIniMgr->Set( aDlgData, SFX_KEY_DIALOG, nId );
+}
+
+// -----------------------------------------------------------------------
+
+String GetDialogData_Impl( SfxViewFrame *pFrame, Window *pDlg, sal_uInt16 nId)
+
+/* [Beschreibung]
+
+ Hilfsfunktion; liest die Dialogposition aus der Ini-Datei
+ und setzt diese am "ubergebenen Window.
+*/
+
+{
+ String aRetString;
+ // Konfiguration vorhanden?
+ SfxIniManager *pIniMgr =
+ pFrame ? pFrame->GetIniManager() : SFX_APP()->GetAppIniManager();
+ String aDlgData( pIniMgr->Get( SFX_KEY_DIALOG, nId ) );
+ if ( aDlgData.Len() > 0 )
+ {
+ // Konfiguration verwenden
+ Point aPos;
+ Size aDummySize;
+ if ( pIniMgr->GetPosSize(
+ aDlgData.GetToken(
+ 0, pIniMgr->GetToken()), aPos, aDummySize ) )
+ {
+ pDlg->SetPosPixel(aPos);
+ sal_uInt16 nPos = aDlgData.Search( pIniMgr->GetToken() );
+ if( nPos != STRING_NOTFOUND )
+ {
+ aRetString = aDlgData.Copy( nPos + 1 );
+ aDlgData.Erase(nPos+1);
+ }
+ }
+ }
+ return aRetString;
+}
+
+// -----------------------------------------------------------------------
+
+SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur modale Dialoge;
+ ResId wird als ID im ini-file verwendet.
+ Die dort gespeicherte Position wird gesetzt.
+*/
+
+: ModalDialog(pParent, rResId),
+ nUniqId(rResId.GetId())
+{
+ DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" );
+
+ aExtraData = GetDialogData_Impl(0, this, nUniqId);
+ aTimer.SetTimeout( 100 );
+ aTimer.SetTimeoutHdl( LINK( this, SfxModalDialog, TimerHdl_Impl ) );
+ aTimer.Start();
+}
+
+// -----------------------------------------------------------------------
+
+SfxModalDialog::SfxModalDialog(Window* pParent,
+ sal_uInt16 nUniqueId,
+ WinBits nWinStyle) :
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur modale Dialoge;
+ ID f"ur das ini-file wird explizit "ubergeben.
+ Die dort gespeicherte Position wird gesetzt.
+*/
+
+ ModalDialog(pParent, nWinStyle),
+ nUniqId(nUniqueId)
+{
+ DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" );
+ aExtraData = GetDialogData_Impl(0, this, nUniqId);
+ aTimer.SetTimeout( 100 );
+ aTimer.SetTimeoutHdl( LINK( this, SfxModalDialog, TimerHdl_Impl ) );
+ aTimer.Start();
+}
+
+// -----------------------------------------------------------------------
+
+SfxModalDialog::SfxModalDialog
+(
+ SfxViewFrame* pViewFrame,
+ Window* pParent,
+ const ResId& rResId
+)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur modale Dialoge;
+ ResId wird als ID im ini-file verwendet.
+ Die dort gespeicherte Position wird gesetzt.
+*/
+
+: ModalDialog(pParent, rResId),
+ nUniqId(rResId.GetId())
+{
+ aExtraData = GetDialogData_Impl(pViewFrame, this, nUniqId);
+ aTimer.SetTimeout( 100 );
+ aTimer.SetTimeoutHdl( LINK( this, SfxModalDialog, TimerHdl_Impl ) );
+ aTimer.Start();
+}
+
+// -----------------------------------------------------------------------
+
+SfxModalDialog::SfxModalDialog
+(
+ SfxViewFrame* pViewFrame,
+ Window* pParent,
+ sal_uInt16 nUniqueId,
+ WinBits nWinStyle
+)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur modale Dialoge;
+ ID f"ur das ini-file wird explizit "ubergeben.
+ Die dort gespeicherte Position wird gesetzt.
+*/
+
+: ModalDialog(pParent, nWinStyle),
+ nUniqId(nUniqueId)
+{
+ aExtraData = GetDialogData_Impl(pViewFrame, this, nUniqId);
+ aTimer.SetTimeout( 100 );
+ aTimer.SetTimeoutHdl( LINK( this, SfxModalDialog, TimerHdl_Impl ) );
+ aTimer.Start();
+}
+
+// -----------------------------------------------------------------------
+
+SfxModalDialog::~SfxModalDialog()
+
+/* [Beschreibung]
+
+ Dtor; schreibt Dialogposition in das ini-file
+*/
+
+{
+ SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ pHelpPI->ResetTopic();
+
+ SetDialogData_Impl(0, this, nUniqId, aExtraData);
+ aTimer.Stop();
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxModalDialog, TimerHdl_Impl, Timer*, EMPTYARG )
+{
+ SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ pHelpPI->LoadTopic( GetHelpId() );
+ return 0L;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModelessDialog::Initialize(SfxChildWinInfo *pInfo)
+
+/* [Beschreibung]
+
+ Initialisierung der Klasse SfxModelessDialog "uber ein SfxChildWinInfo.
+ Die Initialisierung erfolgt erst in einem 2.Schritt
+ nach dem ctor und sollte vom ctor der abgeleiteten Klasse
+ oder von dem des SfxChildWindows aufgerufen werden.
+*/
+
+{
+ Point aPos;
+ if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 )
+ {
+ aPos = pInfo->aPos;
+ if ( GetStyle() & WB_SIZEABLE )
+ SetSizePixel( pInfo->aSize );
+
+ // Initiale Gr"o\se aus pInfo merken
+ aSize = GetSizePixel();
+
+ // Soll das FloatingWindow eingezoomt werden ?
+ if ( pInfo->nFlags & SFX_CHILDWIN_ZOOMIN )
+ RollUp();
+ }
+ else
+ {
+ // Initiale Gr"o\se aus Resource oder ctor merken
+ aSize = GetSizePixel();
+
+ Size aParentSize = GetParent()->GetOutputSizePixel();
+ Size aSize = GetSizePixel();
+ aPos.X() += ( aParentSize.Width() - aSize.Width() ) / 2;
+ aPos.Y() += ( aParentSize.Height() - aSize.Height() ) / 2;
+ }
+
+ Point aPoint;
+ Rectangle aRect = GetDesktopRectPixel();
+ Size aSize( GetSizePixel() );
+ aPoint.X() = aRect.Right() - aSize.Width();
+ aPoint.Y() = aRect.Bottom() - aSize.Height();
+
+ aPoint = OutputToScreenPixel( aPoint );
+
+ if ( aPos.X() > aPoint.X() )
+ aPos.X() = aPoint.X() ;
+ if ( aPos.Y() > aPoint.Y() )
+ aPos.Y() = aPoint.Y();
+
+ if ( aPos.X() < 0 ) aPos.X() = 0;
+ if ( aPos.Y() < 0 ) aPos.Y() = 0;
+
+ SetPosPixel( aPos );
+}
+
+void SfxModelessDialog::Resize()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse FloatingWindow merkt sich ggf. eine
+ ver"anderte Gr"o\se.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ auch SfxFloatingWindow::Resize() gerufen werden.
+*/
+
+{
+ ModelessDialog::Resize();
+ if ( !IsRollUp() )
+ aSize = GetSizePixel();
+}
+
+// -----------------------------------------------------------------------
+
+SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx,
+ SfxChildWindow *pCW,
+ Window* pParent, WinBits nWinBits ) :
+ ModelessDialog (pParent, nWinBits),
+ pBindings(pBindinx),
+ pMgr(pCW)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur nicht-modale Dialoge.
+*/
+
+{
+ sal_uInt32 nId = GetHelpId();
+ SetHelpId(0);
+ SetUniqueId( nId );
+}
+
+// -----------------------------------------------------------------------
+
+SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx,
+ SfxChildWindow *pCW, Window *pParent,
+ const ResId& rResId ) :
+ ModelessDialog(pParent, rResId),
+ pBindings(pBindinx),
+ pMgr(pCW)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur nicht-modale Dialoge.
+*/
+
+{
+ sal_uInt32 nId = GetHelpId();
+ SetHelpId(0);
+ SetUniqueId( nId );
+}
+
+// -----------------------------------------------------------------------
+
+long SfxModelessDialog::Notify( NotifyEvent& rEvt )
+
+/* [Beschreibung]
+
+ Wenn ein ModelessDialog aktiviert wird, wird sein ViewFrame aktiviert.
+ Notwendig ist das bei PlugInFrames.
+*/
+
+{
+ if ( rEvt.GetType() == EVENT_GETFOCUS )
+ {
+/*
+ SfxViewFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ if ( pFrame )
+ pFrame->MakeActive_Impl();
+
+ if ( rEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
+ ModelessDialog::ParentNotify( rEvt );
+ return sal_True;
+ */
+ pBindings->SetActiveFrame( pMgr->GetFrame() );
+ pMgr->Activate_Impl();
+ }
+ else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() )
+ {
+ pBindings->SetActiveFrame( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > () );
+ pMgr->Deactivate_Impl();
+ }
+ else if( rEvt.GetType() == EVENT_KEYINPUT )
+ {
+ // KeyInput zuerst f"ur Dialogfunktionen zulassen ( TAB etc. )
+ if ( !ModelessDialog::Notify( rEvt ) )
+ // dann auch global g"ultige Acceleratoren verwenden
+ return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
+ return sal_True;
+ }
+
+ return ModelessDialog::Notify( rEvt );
+}
+
+// -----------------------------------------------------------------------
+
+SfxModelessDialog::~SfxModelessDialog()
+
+/* [Beschreibung]
+
+ Dtor
+*/
+
+{
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxModelessDialog::Close()
+
+/* [Beschreibung]
+
+ Das Fenster wird geschlossen, indem das ChildWindow durch Ausf"uhren des
+ ChildWindow-Slots zerst"ort wird.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ danach SfxModelessDialogWindow::Close() gerufen werden, wenn nicht das
+ Close() mit "return sal_False" abgebrochen wird.
+
+*/
+
+{
+ // Execute mit Parametern, da Toggle von einigen ChildWindows ignoriert
+ // werden kann
+ SfxBoolItem aValue( pMgr->GetType(), sal_False);
+ pBindings->GetDispatcher_Impl()->Execute(
+ pMgr->GetType(),
+ SFX_CALLMODE_RECORD|SFX_CALLMODE_SYNCHRON, &aValue, 0L );
+ return sal_True;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxModelessDialog::FillInfo(SfxChildWinInfo& rInfo) const
+
+/* [Beschreibung]
+
+ F"ullt ein SfxChildWinInfo mit f"ur SfxModelessDialof spezifischen Daten,
+ damit sie in die INI-Datei geschrieben werden koennen.
+ Es wird angenommen, da\s rInfo alle anderen evt. relevanten Daten in
+ der ChildWindow-Klasse erh"alt.
+ ModelessDialogs haben keine spezifischen Informationen, so da die
+ Basisimplementierung nichts tut und daher nicht gerufen werden mu\s.
+*/
+
+{
+ rInfo.aSize = aSize;
+ if ( IsRollUp() )
+ rInfo.nFlags |= SFX_CHILDWIN_ZOOMIN;
+}
+
+// -----------------------------------------------------------------------
+
+long SfxFloatingWindow::Notify( NotifyEvent& rEvt )
+
+/* [Beschreibung]
+
+ Wenn ein ModelessDialog aktiviert wird, wird sein ViewFrame aktiviert.
+ Notwendig ist das bei PlugInFrames.
+*/
+
+{
+/*
+ if ( rEvt.GetType() == EVENT_GETFOCUS || rEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
+ {
+ SfxViewFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ if ( pFrame )
+ pFrame->MakeActive_Impl();
+
+ if ( rEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
+ FloatingWindow::ParentNotify( rEvt );
+ return sal_True;
+ }
+*/
+ if ( rEvt.GetType() == EVENT_GETFOCUS )
+ {
+ pBindings->SetActiveFrame( pMgr->GetFrame() );
+ pMgr->Activate_Impl();
+ }
+ else if ( rEvt.GetType() == EVENT_LOSEFOCUS )
+ {
+ if ( !HasChildPathFocus() )
+ pMgr->Deactivate_Impl();
+ }
+ else if( rEvt.GetType() == EVENT_KEYINPUT )
+ {
+ // KeyInput zuerst f"ur Dialogfunktionen zulassen
+ if ( !FloatingWindow::Notify( rEvt ) )
+ // dann auch global g"ultige Acceleratoren verwenden
+ return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
+ return sal_True;
+ }
+
+ return FloatingWindow::Notify( rEvt );
+}
+
+// -----------------------------------------------------------------------
+
+SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
+ SfxChildWindow *pCW,
+ Window* pParent, WinBits nWinBits) :
+ FloatingWindow (pParent, nWinBits),
+ pBindings(pBindinx),
+ pMgr(pCW)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur FloatingWindows;
+*/
+
+{
+ sal_uInt32 nId = GetHelpId();
+ SetHelpId(0);
+ SetUniqueId( nId );
+}
+
+// -----------------------------------------------------------------------
+
+SfxFloatingWindow::SfxFloatingWindow( SfxBindings *pBindinx,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId) :
+ FloatingWindow(pParent, rResId),
+ pBindings(pBindinx),
+ pMgr(pCW)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur FloatingWindows;
+*/
+
+{
+ sal_uInt32 nId = GetHelpId();
+ SetHelpId(0);
+ SetUniqueId( nId );
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxFloatingWindow::Close()
+
+/* [Beschreibung]
+
+ Das Fenster wird geschlossen, indem das ChildWindow durch Ausf"uhren des
+ ChildWindow-Slots zerst"ort wird.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ danach SfxFloatingWindow::Close() gerufen werden, wenn nicht das Close()
+ mit "return sal_False" abgebrochen wird.
+
+*/
+
+{
+ // Execute mit Parametern, da Toggle von einigen ChildWindows ignoriert
+ // werden kann
+ SfxBoolItem aValue( pMgr->GetType(), sal_False);
+ pBindings->GetDispatcher_Impl()->Execute(
+ pMgr->GetType(),
+ SFX_CALLMODE_RECORD|SFX_CALLMODE_SYNCHRON, &aValue, 0L );
+ return sal_True;
+}
+
+// -----------------------------------------------------------------------
+
+SfxFloatingWindow::~SfxFloatingWindow()
+
+/* [Beschreibung]
+
+ Dtor
+*/
+
+{
+}
+
+//-------------------------------------------------------------------------
+
+void SfxFloatingWindow::Resize()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse FloatingWindow merkt sich ggf. eine
+ ver"anderte Gr"o\se.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ auch SfxFloatingWindow::Resize() gerufen werden.
+*/
+
+{
+ FloatingWindow::Resize();
+ if ( !IsRollUp() )
+ aSize = GetSizePixel();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxFloatingWindow::Initialize(SfxChildWinInfo *pInfo)
+
+/* [Beschreibung]
+
+ Initialisierung der Klasse SfxFloatingWindow "uber ein SfxChildWinInfo.
+ Die Initialisierung erfolgt erst in einem 2.Schritt
+ nach dem ctor und sollte vom ctor der abgeleiteten Klasse
+ oder von dem des SfxChildWindows aufgerufen werden.
+*/
+
+{
+ Point aPos;
+ if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 )
+ {
+ aPos = pInfo->aPos;
+ if ( GetStyle() & WB_SIZEABLE )
+ {
+ Size aMinSize( GetMinOutputSizePixel() );
+ if ( pInfo->aSize.Width() < aMinSize.Width() )
+ pInfo->aSize.Width() = aMinSize.Width();
+ if ( pInfo->aSize.Height() < aMinSize.Height() )
+ pInfo->aSize.Height() = aMinSize.Height();
+ SetSizePixel( pInfo->aSize );
+ }
+
+ // Initiale Gr"o\se aus pInfo merken
+ aSize = GetSizePixel();
+
+ // Soll das FloatingWindow eingezoomt werden ?
+ if ( pInfo->nFlags & SFX_CHILDWIN_ZOOMIN )
+ RollUp();
+ }
+ else
+ {
+ // Initiale Gr"o\se aus Resource oder ctor merken
+ aSize = GetSizePixel();
+ Size aParentSize = GetParent()->GetOutputSizePixel();
+ aPos.X() += (aParentSize.Width() - aSize.Width()) / 2;
+ aPos.Y() += (aParentSize.Height() - aSize.Height()) / 2;
+ }
+
+ Point aPoint;
+ Rectangle aRect = GetDesktopRectPixel();
+ Size aSize( GetSizePixel() );
+ aPoint.X() = aRect.Right() - aSize.Width();
+ aPoint.Y() = aRect.Bottom() - aSize.Height();
+
+ aPoint = OutputToScreenPixel( aPoint );
+
+ if ( aPos.X() > aPoint.X() )
+ aPos.X() = aPoint.X() ;
+ if ( aPos.Y() > aPoint.Y() )
+ aPos.Y() = aPoint.Y();
+
+ if ( aPos.X() < 0 ) aPos.X() = 0;
+ if ( aPos.Y() < 0 ) aPos.Y() = 0;
+
+ SetPosPixel( aPos );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxFloatingWindow::FillInfo(SfxChildWinInfo& rInfo) const
+
+/* [Beschreibung]
+
+ F"ullt ein SfxChildWinInfo mit f"ur SfxFloatingWindow spezifischen Daten,
+ damit sie in die INI-Datei geschrieben werden koennen.
+ Es wird angenommen, da\s rInfo alle anderen evt. relevanten Daten in
+ der ChildWindow-Klasse erh"alt.
+ Eingetragen werden hier gemerkte Gr"o\se und das ZoomIn-Flag.
+ Wird diese Methode "uberschrieben, mu\s zuerst die Basisimplementierung
+ gerufen werden.
+*/
+
+{
+ rInfo.aSize = aSize;
+ if ( IsRollUp() )
+ rInfo.nFlags |= SFX_CHILDWIN_ZOOMIN;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxSingleTabDialog, OKHdl_Impl, Button *, pButton )
+
+/* [Beschreibung]
+
+ Ok_Handler; f"ur die gesetzte Page wird FillItemSet() gerufen.
+*/
+
+{
+ if ( !pOutSet )
+ {
+ pOutSet = new SfxItemSet( *pOptions );
+ pOutSet->ClearItem();
+ }
+ sal_Bool bModified = sal_False;
+
+ if ( pPage->HasExchangeSupport() )
+ {
+ int nRet = pPage->DeactivatePage( pOutSet );
+
+ if ( nRet != SfxTabPage::LEAVE_PAGE )
+ return 0;
+ else
+ bModified = ( pOutSet->Count() > 0 );
+ }
+ else
+ bModified = pPage->FillItemSet( *pOutSet );
+
+ if ( bModified )
+ {
+ // auch noch schnell User-Daten im IniManager abspeichern
+ SfxIniManager* pIniMgr = SFX_APP()->GetAppIniManager();
+ pPage->FillUserData();
+ String sData( pPage->GetUserData() );
+
+ if ( sData.Len() )
+ pIniMgr->Set( sData, SFX_KEY_PAGE, GetUniqId() );
+ EndDialog( RET_OK );
+ }
+ else
+ EndDialog( RET_CANCEL );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxSingleTabDialog::SfxSingleTabDialog
+(
+ Window *pParent,
+ const SfxItemSet& rSet,
+ sal_uInt16 nUniqueId,
+ sal_Bool bGroupBox
+) :
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur SingleTab-Dialoge;
+ ID f"ur das ini-file wird "ubergeben.
+*/
+
+ SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
+
+ pOKBtn ( 0 ),
+ pCancelBtn ( 0 ),
+ pHelpBtn ( 0 ),
+ pGroupBox ( 0 ),
+
+ pPage ( 0 ),
+ pOptions ( &rSet ),
+ pOutSet ( 0 ),
+ bGrpBox ( bGroupBox )
+
+{
+ DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" );
+}
+
+// -----------------------------------------------------------------------
+
+SfxSingleTabDialog::SfxSingleTabDialog
+(
+ SfxViewFrame* pViewFrame,
+ Window* pParent,
+ const SfxItemSet& rSet,
+ sal_uInt16 nUniqueId,
+ sal_Bool bGroupBox
+) :
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur SingleTab-Dialoge;
+ ID f"ur das ini-file wird "ubergeben.
+*/
+
+ SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
+
+ pOKBtn ( 0 ),
+ pCancelBtn ( 0 ),
+ pHelpBtn ( 0 ),
+ pGroupBox ( 0 ),
+
+ pPage ( 0 ),
+ pOptions ( &rSet ),
+ pOutSet ( 0 ),
+ bGrpBox ( bGroupBox )
+
+{
+}
+
+// -----------------------------------------------------------------------
+
+SfxSingleTabDialog::SfxSingleTabDialog
+(
+ Window* pParent,
+ sal_uInt16 nUniqueId,
+ const SfxItemSet* pInSet,
+ sal_Bool bGroupBox
+)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur SingleTab-Dialoge;
+ ID f"ur das ini-file wird "ubergeben.
+ Sollte nicht mehr benutzt werden.
+ */
+
+: SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
+
+ pOKBtn ( 0 ),
+ pCancelBtn ( 0 ),
+ pHelpBtn ( 0 ),
+ pGroupBox ( 0 ),
+
+ pPage ( 0 ),
+ pOptions ( pInSet ),
+ pOutSet ( 0 ),
+ bGrpBox ( bGroupBox )
+
+{
+ DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" );
+}
+
+// -----------------------------------------------------------------------
+
+SfxSingleTabDialog::SfxSingleTabDialog
+(
+ SfxViewFrame* pViewFrame,
+ Window* pParent,
+ sal_uInt16 nUniqueId,
+ const SfxItemSet* pInSet,
+ sal_Bool bGroupBox
+)
+
+/* [Beschreibung]
+
+ Konstruktor der allgemeinen Basisklasse f"ur SingleTab-Dialoge;
+ ID f"ur das ini-file wird "ubergeben.
+*/
+
+: SfxModalDialog( pParent, nUniqueId, WinBits( WB_STDMODAL | WB_3DLOOK ) ),
+
+ pOKBtn ( 0 ),
+ pCancelBtn ( 0 ),
+ pHelpBtn ( 0 ),
+ pGroupBox ( 0 ),
+
+ pPage ( 0 ),
+ pOptions ( pInSet ),
+ pOutSet ( 0 ),
+ bGrpBox ( bGroupBox )
+
+{
+}
+
+// -----------------------------------------------------------------------
+
+SfxSingleTabDialog::~SfxSingleTabDialog()
+
+/* [Beschreibung]
+
+ Dtor; l"oscht ggf. die TabPage.
+ */
+
+{
+ delete pOKBtn;
+ delete pCancelBtn;
+ delete pHelpBtn;
+ delete pGroupBox;
+ delete pPage;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxSingleTabDialog::SetTabPage( SfxTabPage* pTabPage,
+ GetTabPageRanges pRangesFunc )
+/* [Beschreibung]
+
+ Setzen einer (neuen) TabPage; eine bereits vorhandene Page
+ wird gel"oscht.
+ Die "ubergebene Page wird durch Aufruf von Reset() mit dem
+ initial "ubergebenen Itemset initialisiert.
+*/
+
+{
+ DBG_ASSERT( !bGrpBox, "GroupBox no more supported" );
+ bGrpBox = sal_False;
+
+ if ( !pOKBtn )
+ {
+ pOKBtn = new OKButton( this, WB_DEFBUTTON );
+ pOKBtn->SetClickHdl( LINK( this, SfxSingleTabDialog, OKHdl_Impl ) );
+ }
+ if ( !pCancelBtn )
+ pCancelBtn = new CancelButton( this );
+ if ( !pHelpBtn )
+ pHelpBtn = new HelpButton( this );
+ if ( !pGroupBox )
+ pGroupBox = new GroupBox( this );
+
+ if ( pPage )
+ delete pPage;
+ pPage = pTabPage;
+ fnGetRanges = pRangesFunc;
+
+ if ( pPage )
+ {
+ // erstmal die User-Daten besorgen, dann erst Reset()
+ SfxIniManager* pIniMgr = SFX_APP()->GetAppIniManager();
+ pPage->SetUserData( pIniMgr->Get( SFX_KEY_PAGE, GetUniqId() ) );
+ pPage->Reset( *pOptions );
+ pPage->Show();
+
+ // Gr"ossen und Positionen anpassen
+ pPage->SetPosPixel( Point() );
+ Size aOutSz( pPage->GetSizePixel() );
+ Size aBtnSiz = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
+ Point aPnt( aOutSz.Width(),
+ LogicToPixel( Point( 0, 6 ), MAP_APPFONT ).Y() );
+ aOutSz.Width() += aBtnSiz.Width() +
+ LogicToPixel( Size( 6, 0 ), MAP_APPFONT ).Width();
+ SetOutputSizePixel( aOutSz );
+ pOKBtn->SetPosSizePixel( aPnt, aBtnSiz );
+ pOKBtn->Show();
+ aPnt.Y() = LogicToPixel( Point( 0, 23 ), MAP_APPFONT ).Y();
+ pCancelBtn->SetPosSizePixel( aPnt, aBtnSiz );
+ pCancelBtn->Show();
+ aPnt.Y() = LogicToPixel( Point( 0, 43 ), MAP_APPFONT ).Y();
+ pHelpBtn->SetPosSizePixel( aPnt, aBtnSiz );
+
+ if ( Help::IsContextHelpEnabled() )
+ pHelpBtn->Show();
+
+ // Text der TabPage in den Dialog setzen
+ SetText( pPage->GetText() );
+
+ // Dialog bekommt HelpId der TabPage
+ SetHelpId( pPage->GetHelpId() );
+ SetUniqueId( pPage->GetUniqueId() );
+ }
+}
+
+//--------------------------------------------------------------------
+// Vergleichsfunktion fuer qsort
+
+#ifdef WNT
+int __cdecl BaseDlgsCmpUS_Impl( const void* p1, const void* p2 )
+#else
+#if defined(OS2) && defined(ICC)
+int _Optlink BaseDlgsCmpUS_Impl( const void* p1, const void* p2 )
+#else
+int BaseDlgsCmpUS_Impl( const void* p1, const void* p2 )
+#endif
+#endif
+{
+ return *(sal_uInt16*)p1 - *(sal_uInt16*)p2;
+}
+
+// -----------------------------------------------------------------------
+
+/*
+ Bildet das Set "uber die Ranges der Page. Die Page muss die statische
+ Methode f"ur das Erfragen ihrer Ranges bei SetTabPage angegeben haben,
+ liefert also ihr Set onDemand.
+ */
+const sal_uInt16* SfxSingleTabDialog::GetInputRanges( const SfxItemPool& rPool )
+{
+ if ( pOptions )
+ {
+ DBG_ERROR( "Set bereits vorhanden!" );
+ return pOptions->GetRanges();
+ }
+
+ if ( pRanges )
+ return pRanges;
+ SvUShorts aUS(16, 16);
+
+ if ( fnGetRanges)
+ {
+ const sal_uInt16 *pTmpRanges = (fnGetRanges)();
+ const sal_uInt16 *pIter = pTmpRanges;
+ sal_uInt16 nLen;
+ for ( nLen = 0; *pIter; ++nLen, ++pIter )
+ ;
+ aUS.Insert( pTmpRanges, nLen, aUS.Count() );
+ }
+
+ //! Doppelte Ids entfernen?
+ sal_uInt16 nCount = aUS.Count();
+
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ aUS[i] = rPool.GetWhich( aUS[i]) ;
+
+ // sortieren
+ if ( aUS.Count() > 1 )
+ qsort( (void*)aUS.GetData(), aUS.Count(), sizeof(sal_uInt16), BaseDlgsCmpUS_Impl );
+
+ pRanges = new sal_uInt16[aUS.Count() + 1];
+ memcpy( pRanges, aUS.GetData(), sizeof(sal_uInt16) * aUS.Count() );
+ pRanges[aUS.Count()] = 0;
+ return pRanges;
+}
+
+
diff --git a/sfx2/source/dialog/cfg.cxx b/sfx2/source/dialog/cfg.cxx
new file mode 100644
index 000000000000..538e2bf1acc5
--- /dev/null
+++ b/sfx2/source/dialog/cfg.cxx
@@ -0,0 +1,1376 @@
+/*************************************************************************
+ *
+ * $RCSfile: cfg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_HELP_HXX //autogen
+#include <vcl/help.hxx>
+#endif
+#ifndef _SBXCLASS_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef __SBX_SBXMETHOD_HXX //autogen
+#include <svtools/sbxmeth.hxx>
+#endif
+#ifndef _SB_SBMOD_HXX //autogen
+#include <basic/sbmod.hxx>
+#endif
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#include <tools/urlobj.hxx>
+#pragma hdrstop
+
+#include "cfg.hxx"
+
+#include "dialog.hrc"
+#include "cfg.hrc"
+
+#ifdef MAC
+#ifndef _EXTATTR_HXX //autogen
+#include <svtools/extattr.hxx>
+#endif
+#endif
+
+#include "app.hxx"
+#include "appdata.hxx"
+#include "msg.hxx"
+#include "msgpool.hxx"
+#include "stbmgr.hxx"
+#include "sfxresid.hxx"
+#include "macrconf.hxx"
+#include "minfitem.hxx"
+#include "cfgmgr.hxx"
+#include "sfxresid.hxx"
+#include "objsh.hxx"
+#include "dispatch.hxx"
+#include "sfxtypes.hxx"
+#include "eventdlg.hxx"
+#include "tbxopdlg.hxx"
+#include "minfitem.hxx"
+#include "iodlg.hxx"
+#include "inimgr.hxx"
+#include "viewfrm.hxx"
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+struct SfxStatBarInfo_Impl
+{
+ USHORT nId;
+ String aHelpText;
+
+ SfxStatBarInfo_Impl(USHORT nID, String aString) :
+ nId(nID),
+ aHelpText(aString)
+ {}
+};
+
+DECL_PTRARRAY(SfxStbInfoArr_Impl, SfxStatBarInfo_Impl*, 20, 4);
+SV_IMPL_PTRARR(SfxGroupInfoArr_Impl, SfxGroupInfoPtr);
+
+SfxMenuConfigEntry::SfxMenuConfigEntry( USHORT nInitId, const String& rInitStr,
+ const String& rHelpText, BOOL bPopup )
+ : nId( nInitId )
+ , bPopUp(bPopup)
+ , aHelpText(rHelpText)
+ , aStr(rInitStr)
+{
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ SFX_APP()->GetMacroConfig()->RegisterSlotId( nId );
+}
+
+void SfxMenuConfigEntry::SetId( USHORT nNew )
+{
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId( nId );
+ nId = nNew;
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ SFX_APP()->GetMacroConfig()->RegisterSlotId( nId );
+}
+
+SfxMenuConfigEntry::~SfxMenuConfigEntry()
+{
+ if ( SfxMacroConfig::IsMacroSlot( nId ) )
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId( nId );
+}
+
+SfxConfigFunctionListBox_Impl::SfxConfigFunctionListBox_Impl( Window* pParent, const ResId& rResId)
+/* Beschreibung
+ Diese Listbox arbeiteitet mit der Grouplistbox zusammen und zeigt die zur Konfigurierung verf"ugbaren
+ Funktionen bzw. Macros an, die zur selektierten Gruppe bzw. zum selektierten Modul in der Grouplistbox
+ geh"oren.
+*/
+ : SvTreeListBox( pParent, rResId )
+ , pCurEntry( 0 )
+{
+ SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_SORT );
+ GetModel()->SetSortMode( SortAscending );
+
+ // Timer f"ur die BallonHelp
+ aTimer.SetTimeout( 200 );
+ aTimer.SetTimeoutHdl(
+ LINK( this, SfxConfigFunctionListBox_Impl, TimerHdl ) );
+}
+
+SfxConfigFunctionListBox_Impl::~SfxConfigFunctionListBox_Impl()
+{
+ ClearAll();
+}
+
+void SfxConfigFunctionListBox_Impl::MouseMove( const MouseEvent& rMEvt )
+/* Beschreibung
+ Virtuelle Methode, die gerufen wird, wenn der Mauszeiger "uber der TreeListBox bewegt wurde.
+ Wenn die Position des Mauszeigers "uber dem aktuell selektierten Entry liegt, wird ein Timer
+ aufgesetzt, um ggf. einen Hilfetext einzublenden.
+*/
+{
+ Point aMousePos = rMEvt.GetPosPixel();
+ pCurEntry = GetCurEntry();
+
+ if ( pCurEntry && GetEntry( aMousePos ) == pCurEntry )
+ aTimer.Start();
+ else
+ {
+ Help::ShowBalloon( this, aMousePos, String() );
+ aTimer.Stop();
+ }
+}
+
+
+IMPL_LINK( SfxConfigFunctionListBox_Impl, TimerHdl, Timer*, pTimer)
+/* Beschreibung
+ Timer-Handler f"ur die Einblendung eines Hilfetextes. Wenn nach Ablauf des Timers
+ der Mauszeiger immer noch auf dem aktuell selektierten Eintrag steht, wird der
+ Helptext des Entries als Balloon-Help eingeblendet.
+*/
+{
+ aTimer.Stop();
+ Point aMousePos = GetPointerPosPixel();
+ SvLBoxEntry *pEntry = GetCurEntry();
+ if ( pEntry && GetEntry( aMousePos ) == pEntry && pCurEntry == pEntry )
+ Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), GetHelpText( pEntry ) );
+ return 0L;
+}
+
+void SfxConfigFunctionListBox_Impl::ClearAll()
+/* Beschreibung
+ L"oscht alle Eintr"age in der FunctionListBox, alle UserDaten und alle evtl.
+ vorhandenen MacroInfos.
+*/
+{
+ USHORT nCount = aArr.Count();
+ for ( USHORT i=0; i<nCount; i++ )
+ {
+ SfxGroupInfo_Impl *pData = aArr[i];
+ if ( pData->nKind == SFX_CFGFUNCTION_MACRO )
+ {
+ SfxMacroInfo *pInfo = (SfxMacroInfo*) pData->pObject;
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId( pInfo->GetSlotId() );
+ delete pInfo;
+ }
+ delete pData;
+ }
+
+ aArr.Remove( 0, nCount );
+ Clear();
+}
+
+SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( const String& rName )
+/* Beschreibung
+ Ermittelt den SvLBoxEntry zu einem "ubergebenen String. Das setzt voraus, da\s
+ die Namen eindeutig sind.
+*/
+{
+ SvLBoxEntry *pEntry = First();
+ while ( pEntry )
+ {
+ if ( GetEntryText( pEntry ) == rName )
+ return pEntry;
+ pEntry = Next( pEntry );
+ }
+
+ return NULL;
+}
+
+SvLBoxEntry* SfxConfigFunctionListBox_Impl::GetEntry_Impl( USHORT nId )
+/* Beschreibung
+ Ermittelt den SvLBoxEntry zu einer "ubergebenen Id.
+*/
+{
+ SvLBoxEntry *pEntry = First();
+ while ( pEntry )
+ {
+ SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
+ if ( pData && pData->nOrd == nId )
+ return pEntry;
+ pEntry = Next( pEntry );
+ }
+
+ return NULL;
+}
+
+SfxMacroInfo* SfxConfigFunctionListBox_Impl::GetMacroInfo()
+/* Beschreibung
+ Gibt die MacroInfo des selektierten Entry zur"uck ( sofern vorhanden ).
+*/
+{
+ SvLBoxEntry *pEntry = FirstSelected();
+ if ( pEntry )
+ {
+ SfxGroupInfo_Impl *pData = (SfxGroupInfo_Impl*) pEntry->GetUserData();
+ if ( pData && pData->nKind == SFX_CFGFUNCTION_MACRO )
+ return (SfxMacroInfo*) pData->pObject;
+ }
+
+ return 0;
+}
+
+USHORT SfxConfigFunctionListBox_Impl::GetId( SvLBoxEntry *pEntry )
+/* Beschreibung
+ Gibt die Ordnungsnummer ( SlotId oder Macro-Nummer ) des Eintrags zur"uck.
+*/
+{
+ SfxGroupInfo_Impl *pData = pEntry ?
+ (SfxGroupInfo_Impl*) pEntry->GetUserData() : 0;
+ if ( pData )
+ return pData->nOrd;
+ return 0;
+}
+
+String SfxConfigFunctionListBox_Impl::GetHelpText( SvLBoxEntry *pEntry )
+/* Beschreibung
+ Gibt den Helptext des selektierten Entry zur"uck.
+*/
+{
+ // Information zum selektierten Entry aus den Userdaten holen
+ SfxGroupInfo_Impl *pInfo = pEntry ? (SfxGroupInfo_Impl*) pEntry->GetUserData(): 0;
+ if ( pInfo )
+ {
+ if ( pInfo->nKind == SFX_CFGFUNCTION_SLOT )
+ {
+ // Eintrag ist eine Funktion, Hilfe aus der Office-Hilfe
+ USHORT nId = pInfo->nOrd;
+ String aText = Application::GetHelp()->GetHelpText( nId );
+ if ( !aText.Len() )
+ aText = SFX_SLOTPOOL().GetSlotHelpText_Impl( nId );
+ return aText;
+ }
+ else
+ {
+ // Eintrag ist ein Macro, Hilfe aus der MacroInfo
+ SfxMacroInfo *pMacInfo = (SfxMacroInfo*) pInfo->pObject;
+ return pMacInfo->GetHelpText();
+ }
+ }
+
+ return String();
+}
+
+void SfxConfigFunctionListBox_Impl::FunctionSelected()
+/* Beschreibung
+ Setzt die Balloonhelp zur"uck, da diese immer den Helptext des selektierten
+ Entry anzeigen soll.
+*/
+{
+ Help::ShowBalloon( this, Point(), String() );
+}
+
+SfxConfigGroupListBox_Impl::SfxConfigGroupListBox_Impl(
+ Window* pParent, const ResId& rResId, ULONG nConfigMode )
+ : SvTreeListBox( pParent, rResId )
+ , aScriptType( DEFINE_CONST_UNICODE("StarBasic") )
+ , nMode( nConfigMode )
+/* Beschreibung
+ Diese Listbox zeigt alle Funktionsgruppen und Basics an, die zur Konfiguration
+ zur Verf"ugung stehen. Basics werden noch in Bibliotheken und Module untergliedert.
+*/
+{
+ SetWindowBits( GetStyle() | WB_CLIPCHILDREN | WB_HSCROLL | WB_HASBUTTONS | WB_HASLINES | WB_HASLINESATROOT | WB_HASBUTTONSATROOT );
+ SetNodeBitmaps( Image( BMP_COLLAPSED ), Image( BMP_EXPANDED ) );
+}
+
+
+SfxConfigGroupListBox_Impl::~SfxConfigGroupListBox_Impl()
+{
+}
+
+void SfxConfigGroupListBox_Impl::SetScriptType( const String& rScriptType )
+{
+ aScriptType = rScriptType;
+ ULONG nPos=0;
+ SvLBoxEntry *pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ );
+ while ( pEntry )
+ {
+ SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
+ if ( pInfo->nKind == SFX_CFGGROUP_BASICLIB && ( IsExpanded( pEntry ) || pInfo->bWasOpened ) )
+ {
+ Collapse( pEntry );
+ SvLBoxEntry *pChild = FirstChild( pEntry );
+ while (pChild)
+ {
+ GetModel()->Remove( pChild );
+ pChild = FirstChild( pEntry );
+ }
+
+ Expand( pEntry );
+ }
+
+ pEntry = (SvLBoxEntry*) GetModel()->GetEntryAtAbsPos( nPos++ );
+ }
+}
+
+String SfxConfigGroupListBox_Impl::GetGroup()
+/* Beschreibung
+ Gibt den Namen der selektierten Funktionsgruppe bzw. des selektierten
+ Basics zur"uck.
+*/
+{
+ SvLBoxEntry *pEntry = FirstSelected();
+ while ( pEntry )
+ {
+ SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
+ if ( pInfo->nKind == SFX_CFGGROUP_FUNCTION )
+ {
+ return GetEntryText( pEntry );
+ break;
+ }
+
+ if ( pInfo->nKind == SFX_CFGGROUP_BASICMGR )
+ {
+ BasicManager *pMgr = (BasicManager*) pInfo->pObject;
+ return pMgr->GetName();
+ break;
+ }
+
+ if ( pInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
+ {
+ SfxObjectShell *pDoc = (SfxObjectShell*) pInfo->pObject;
+ return pDoc->GetTitle();
+ break;
+ }
+
+ pEntry = GetParent( pEntry );
+ }
+
+ return String();
+}
+
+void SfxConfigGroupListBox_Impl::Init( SvStringsDtor *pArr )
+/* Beschreibung
+ Die Groupbox wird mit allen Funktionsgruppen und allen Basics gef"ullt
+*/
+{
+ SetUpdateMode(FALSE);
+ SfxApplication *pSfxApp = SFX_APP();
+
+ // Verwendet wird der aktuelle Slotpool
+ if ( nMode )
+ {
+ for ( USHORT i=1; i<SFX_SLOTPOOL().GetGroupCount(); i++ )
+ {
+ // Gruppe anw"ahlen ( Gruppe 0 ist intern )
+ String aName = pSfxApp->GetSlotPool().SeekGroup( i );
+ const SfxSlot *pSfxSlot = SFX_SLOTPOOL().FirstSlot();
+ if ( pSfxSlot )
+ {
+ // Wenn Gruppe nicht leer
+ SvLBoxEntry *pEntry = InsertEntry( aName, NULL );
+ SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_FUNCTION, i );
+ aArr.Insert( pInfo, aArr.Count() );
+ pEntry->SetUserData( pInfo );
+ }
+ }
+ }
+
+ // Basics einsammeln
+ pSfxApp->EnterBasicCall();
+ String aMacroName(' ');
+ aMacroName += String(SfxResId(STR_BASICMACROS));
+
+ // Zuerst AppBasic
+ BasicManager *pAppBasicMgr = pSfxApp->GetBasicManager();
+ BOOL bInsert = TRUE;
+ if ( pArr )
+ {
+ bInsert = FALSE;
+ for ( USHORT n=0; n<pArr->Count(); n++ )
+ {
+ if ( *(*pArr)[n] == pSfxApp->GetName() )
+ {
+ bInsert = TRUE;
+ break;
+ }
+ }
+ }
+
+ if ( bInsert )
+ {
+ pAppBasicMgr->SetName( pSfxApp->GetName() );
+ if ( pAppBasicMgr->GetLibCount() )
+ {
+ // Nur einf"ugen, wenn Bibliotheken vorhanden
+ String aAppBasTitle( SfxResId( STR_HUMAN_APPNAME ) );
+ aAppBasTitle += aMacroName;
+ SvLBoxEntry *pEntry = InsertEntry( aAppBasTitle, 0 );
+ SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMGR, 0, pAppBasicMgr );
+ aArr.Insert( pInfo, aArr.Count() );
+ pEntry->SetUserData( pInfo );
+ pEntry->EnableChildsOnDemand( TRUE );
+// Expand( pEntry );
+ }
+ }
+
+ SfxObjectShell *pDoc = SfxObjectShell::GetFirst();
+ while ( pDoc )
+ {
+ BOOL bInsert = TRUE;
+ if ( pArr )
+ {
+ bInsert = FALSE;
+ for ( USHORT n=0; n<pArr->Count(); n++ )
+ {
+ if ( *(*pArr)[n] == pDoc->GetTitle() )
+ {
+ bInsert = TRUE;
+ break;
+ }
+ }
+ }
+
+ if ( bInsert )
+ {
+ BasicManager *pBasicMgr = pDoc->GetBasicManager();
+ if ( pBasicMgr != pAppBasicMgr && pBasicMgr->GetLibCount() )
+ {
+ pBasicMgr->SetName( pDoc->GetTitle() );
+
+ // Nur einf"ugen, wenn eigenes Basic mit Bibliotheken
+ SvLBoxEntry *pEntry = InsertEntry( pDoc->GetTitle().Append(aMacroName), NULL );
+ SfxGroupInfo_Impl *pInfo =
+ new SfxGroupInfo_Impl( SFX_CFGGROUP_DOCBASICMGR, 0, pDoc );
+ aArr.Insert( pInfo, aArr.Count() );
+ pEntry->SetUserData( pInfo );
+ pEntry->EnableChildsOnDemand( TRUE );
+// Expand( pEntry );
+ }
+ }
+
+ pDoc = SfxObjectShell::GetNext(*pDoc);
+ }
+
+ pSfxApp->LeaveBasicCall();
+ MakeVisible( GetEntry( 0,0 ) );
+ SetUpdateMode( TRUE );
+}
+
+void SfxConfigGroupListBox_Impl::GroupSelected()
+/* Beschreibung
+ Eine Funktionsgruppe oder eine Basicmodul wurde selektiert. Alle Funktionen bzw.
+ Macros werden in der Functionlistbox anzeigt.
+*/
+{
+ SvLBoxEntry *pEntry = FirstSelected();
+ SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
+ pFunctionListBox->SetUpdateMode(FALSE);
+ pFunctionListBox->ClearAll();
+ if ( pInfo->nKind != SFX_CFGGROUP_FUNCTION &&
+ pInfo->nKind != SFX_CFGGROUP_BASICMOD )
+ {
+ pFunctionListBox->SetUpdateMode(TRUE);
+ return;
+ }
+
+ switch ( pInfo->nKind )
+ {
+ case SFX_CFGGROUP_FUNCTION :
+ {
+ USHORT nGroup = pInfo->nOrd;
+ String aSelectedGroup = SFX_SLOTPOOL().SeekGroup( nGroup );
+ if ( aSelectedGroup != String() )
+ {
+ const SfxSlot *pSfxSlot = SFX_SLOTPOOL().FirstSlot();
+ while ( pSfxSlot )
+ {
+ USHORT nId = pSfxSlot->GetSlotId();
+#ifdef UNX
+ if ( nId != SID_DESKTOPMODE && ( pSfxSlot->GetMode() & nMode ) )
+#else
+ if ( pSfxSlot->GetMode() & nMode )
+#endif
+ {
+ String aName = SFX_SLOTPOOL().GetSlotName_Impl( *pSfxSlot );
+ if ( aName.Len() && !pFunctionListBox->GetEntry_Impl( nId ) )
+ {
+#ifdef DBG_UTIL
+ if ( pFunctionListBox->GetEntry_Impl( aName ) )
+ DBG_WARNINGFILE( "function name already exits" );
+#endif
+ // Wenn die Namen unterschiedlich sind, dann auch die Funktion, denn zu
+ // einer Id liefert der Slotpool immer den gleichen Namen!
+ SvLBoxEntry* pFuncEntry = pFunctionListBox->InsertEntry( aName, NULL );
+ SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGFUNCTION_SLOT, nId );
+ pFunctionListBox->aArr.Insert( pInfo, pFunctionListBox->aArr.Count() );
+ pFuncEntry->SetUserData( pInfo );
+ }
+ }
+
+ pSfxSlot = SFX_SLOTPOOL().NextSlot();
+ }
+ }
+
+ break;
+ }
+
+ case SFX_CFGGROUP_BASICMOD :
+ {
+ SvLBoxEntry *pLibEntry = GetParent( pEntry );
+ SfxGroupInfo_Impl *pLibInfo =
+ (SfxGroupInfo_Impl*) pLibEntry->GetUserData();
+ SvLBoxEntry *pBasEntry = GetParent( pLibEntry );
+ SfxGroupInfo_Impl *pBasInfo =
+ (SfxGroupInfo_Impl*) pBasEntry->GetUserData();
+
+ StarBASIC *pLib = (StarBASIC*) pLibInfo->pObject;
+ SfxObjectShell *pDoc = NULL;
+ if ( pBasInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
+ pDoc = (SfxObjectShell*) pBasInfo->pObject;
+
+ SbModule *pMod = (SbModule*) pInfo->pObject;
+ for ( USHORT nMeth=0; nMeth < pMod->GetMethods()->Count(); nMeth++ )
+ {
+ SbxMethod *pMeth = (SbxMethod*)pMod->GetMethods()->Get(nMeth);
+ SfxMacroInfoPtr pInf = new SfxMacroInfo( pDoc,
+ pLib->GetName(),
+ pMod->GetName(),
+ pMeth->GetName());
+ if ( pMeth->GetInfo() )
+ pInf->SetHelpText( pMeth->GetInfo()->GetComment() );
+ USHORT nId = SFX_APP()->GetMacroConfig()->GetSlotId( pInf );
+ if ( !nId )
+ break; // Kein Slot mehr frei
+
+ SvLBoxEntry* pFuncEntry =
+ pFunctionListBox->InsertEntry( pMeth->GetName(), NULL );
+ SfxGroupInfo_Impl *pInfo =
+ new SfxGroupInfo_Impl( SFX_CFGFUNCTION_MACRO, nId, pInf );
+ pFunctionListBox->aArr.Insert( pInfo, pFunctionListBox->aArr.Count() );
+ pFuncEntry->SetUserData( pInfo );
+ }
+
+ break;
+ }
+
+ default:
+ {
+ return;
+ break;
+ }
+ }
+
+ if ( pFunctionListBox->GetEntryCount() )
+ pFunctionListBox->Select( pFunctionListBox->GetEntry( 0, 0 ) );
+
+ pFunctionListBox->SetUpdateMode(TRUE);
+}
+
+BOOL SfxConfigGroupListBox_Impl::Expand( SvLBoxEntry* pParent )
+{
+ BOOL bRet = SvTreeListBox::Expand( pParent );
+ if ( bRet )
+ {
+ // Wieviele Entries k"onnen angezeigt werden ?
+ ULONG nEntries = GetOutputSizePixel().Height() / GetEntryHeight();
+
+ // Wieviele Kinder sollen angezeigt werden ?
+ ULONG nChildCount = GetVisibleChildCount( pParent );
+
+ // Passen alle Kinder und der parent gleichzeitig in die View ?
+ if ( nChildCount+1 > nEntries )
+ {
+ // Wenn nicht, wenigstens parent ganz nach oben schieben
+ MakeVisible( pParent, TRUE );
+ }
+ else
+ {
+ // An welcher relativen ViewPosition steht der aufzuklappende parent
+ SvLBoxEntry *pEntry = GetFirstEntryInView();
+ ULONG nParentPos = 0;
+ while ( pEntry && pEntry != pParent )
+ {
+ nParentPos++;
+ pEntry = GetNextEntryInView( pEntry );
+ }
+
+ // Ist unter dem parent noch genug Platz f"ur alle Kinder ?
+ if ( nParentPos + nChildCount + 1 > nEntries )
+ ScrollOutputArea( (short)( nEntries - ( nParentPos + nChildCount + 1 ) ) );
+ }
+ }
+
+ return bRet;
+}
+
+void SfxConfigGroupListBox_Impl::RequestingChilds( SvLBoxEntry *pEntry )
+/* Beschreibung
+ Ein Basic oder eine Bibliothek werden ge"offnet
+*/
+{
+ SfxGroupInfo_Impl *pInfo = (SfxGroupInfo_Impl*) pEntry->GetUserData();
+ pInfo->bWasOpened = TRUE;
+ switch ( pInfo->nKind )
+ {
+ case SFX_CFGGROUP_BASICMGR :
+ case SFX_CFGGROUP_DOCBASICMGR :
+ {
+ if ( !GetChildCount( pEntry ) )
+ {
+ // Erstmaliges "Offnen
+ BasicManager *pMgr;
+ if ( pInfo->nKind == SFX_CFGGROUP_DOCBASICMGR )
+ pMgr = ((SfxObjectShell*)pInfo->pObject)->GetBasicManager();
+ else
+ pMgr = (BasicManager*) pInfo->pObject;
+
+ SvLBoxEntry *pLibEntry = 0;
+ for ( USHORT nLib=0; nLib<pMgr->GetLibCount(); nLib++)
+ {
+ StarBASIC* pLib = pMgr->GetLib( nLib );
+ pLibEntry = InsertEntry( pMgr->GetLibName( nLib ), pEntry );
+ SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICLIB, nLib, pLib );
+ aArr.Insert( pInfo, aArr.Count() );
+ pLibEntry->SetUserData( pInfo );
+ pLibEntry->EnableChildsOnDemand( TRUE );
+ }
+ }
+
+ break;
+ }
+
+ case SFX_CFGGROUP_BASICLIB :
+ {
+ if ( !GetChildCount( pEntry ) )
+ {
+ // Erstmaliges "Offnen
+ StarBASIC *pLib = (StarBASIC*) pInfo->pObject;
+ if ( !pLib )
+ {
+ // Lib mu\s nachgeladen werden
+ SvLBoxEntry *pParent = GetParent( pEntry );
+ SfxGroupInfo_Impl *pInf =
+ (SfxGroupInfo_Impl*) pParent->GetUserData();
+ BasicManager *pMgr;
+ if ( pInf->nKind == SFX_CFGGROUP_DOCBASICMGR )
+ pMgr = ((SfxObjectShell*)pInf->pObject)->GetBasicManager();
+ else
+ pMgr = (BasicManager*) pInf->pObject;
+
+ if ( pMgr->LoadLib( pInfo->nOrd ) )
+ pInfo->pObject = pLib = pMgr->GetLib( pInfo->nOrd );
+ else
+ break;
+ }
+
+ SvLBoxEntry *pModEntry = 0;
+ for ( USHORT nMod=0; nMod<pLib->GetModules()->Count(); nMod++ )
+ {
+ SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod );
+
+ BOOL bIsStarScript = FALSE; //pMod->ISA( SbJScriptModule );
+ BOOL bWantsStarScript = aScriptType.EqualsAscii("StarScript");
+ if ( bIsStarScript != bWantsStarScript )
+ continue;
+ pModEntry = InsertEntry( pMod->GetName(), pEntry );
+ SfxGroupInfo_Impl *pInfo = new SfxGroupInfo_Impl( SFX_CFGGROUP_BASICMOD, 0, pMod );
+ aArr.Insert( pInfo, aArr.Count() );
+ pModEntry->SetUserData( pInfo );
+ }
+ }
+
+ break;
+ }
+
+ default:
+ DBG_ERROR( "Falscher Gruppentyp!" );
+ break;
+ }
+}
+
+void SfxConfigGroupListBox_Impl::SelectMacro( const SfxMacroInfoItem *pItem )
+{
+ SelectMacro( pItem->GetBasicManager()->GetName(),
+ pItem->GetQualifiedName() );
+}
+
+void SfxConfigGroupListBox_Impl::SelectMacro( const String& rBasic,
+ const String& rMacro )
+{
+ String aBasicName(' ');
+ aBasicName += rBasic;
+ aBasicName += String(SfxResId(STR_BASICMACROS));
+ String aLib, aModule, aMethod;
+ USHORT nCount = rMacro.GetTokenCount('.');
+ aMethod = rMacro.GetToken( nCount-1, '.' );
+ if ( nCount > 2 )
+ {
+ aLib = rMacro.GetToken( 0, '.' );
+ aModule = rMacro.GetToken( nCount-2, '.' );
+ }
+
+ SvLBoxEntry *pEntry = FirstChild(0);
+ while ( pEntry )
+ {
+ String aEntryBas = GetEntryText( pEntry );
+ if ( aEntryBas == aBasicName )
+ {
+ Expand( pEntry );
+ SvLBoxEntry *pLib = FirstChild( pEntry );
+ while ( pLib )
+ {
+ String aEntryLib = GetEntryText( pLib );
+ if ( aEntryLib == aLib )
+ {
+ Expand( pLib );
+ SvLBoxEntry *pMod = FirstChild( pLib );
+ while ( pMod )
+ {
+ String aEntryMod = GetEntryText( pMod );
+ if ( aEntryMod == aModule )
+ {
+ Expand( pMod );
+ MakeVisible( pMod );
+ Select( pMod );
+ SvLBoxEntry *pMethod = pFunctionListBox->First();
+ while ( pMethod )
+ {
+ String aEntryMethod = GetEntryText( pMethod );
+ if ( aEntryMethod == aMethod )
+ {
+ pFunctionListBox->Select( pMethod );
+ pFunctionListBox->MakeVisible( pMethod );
+ return;
+ }
+ pMethod = pFunctionListBox->Next( pMethod );
+ }
+ }
+ pMod = NextSibling( pMod );
+ }
+ }
+ pLib = NextSibling( pLib );
+ }
+ }
+ pEntry = NextSibling( pEntry );
+ }
+}
+
+void SfxConfigDialog::ActivateToolBoxConfig( USHORT nId )
+{
+ SetCurPageId( TP_CONFIG_OBJECTBAR );
+ nObjectBar = nId;
+}
+
+void SfxConfigDialog::PageCreated( USHORT nId, SfxTabPage& rPage )
+{
+ switch ( nId )
+ {
+ case TP_CONFIG_OBJECTBAR :
+ if ( nObjectBar )
+ ((SfxObjectBarConfigPage&)rPage).SetObjectBarId( nObjectBar );
+ break;
+ case TP_CONFIG_ACCEL:
+ if ( pMacroInfo )
+ ((SfxAcceleratorConfigPage&)rPage).SelectMacro( pMacroInfo );
+ break;
+ default:
+ break;
+ }
+}
+
+void SfxConfigDialog::ActivateMacroConfig(const SfxMacroInfoItem *pInfo)
+{
+ // Bei Aufruf "uber die Basic-IDE soll defaultm"a\sig die Tastaturkonfiguration
+ // angeboten werden
+ SetCurPageId( TP_CONFIG_ACCEL );
+ pMacroInfo = pInfo;
+}
+
+SfxTabPage *CreateMenuConfigPage( Window *pParent, const SfxItemSet& rSet )
+{
+ return new SfxMenuConfigPage( pParent, rSet );
+}
+
+SfxTabPage *CreateAccelConfigPage( Window *pParent, const SfxItemSet& rSet )
+{
+ return new SfxAcceleratorConfigPage( pParent, rSet );
+}
+
+SfxTabPage *CreateStatusBarConfigPage( Window *pParent, const SfxItemSet& rSet )
+{
+ return new SfxStatusBarConfigPage( pParent, rSet );
+}
+
+SfxTabPage *CreateObjectBarConfigPage( Window *pParent, const SfxItemSet& rSet )
+{
+ return new SfxObjectBarConfigPage( pParent, rSet );
+}
+
+SfxTabPage *CreateEventConfigPage( Window *pParent, const SfxItemSet& rSet )
+{
+ return new SfxEventConfigPage( pParent, rSet );
+}
+
+SfxConfigDialog::SfxConfigDialog( Window * pParent, const SfxItemSet* pSet )
+ : SfxTabDialog( pParent, SfxResId( DLG_CONFIG ), pSet )
+ , pMacroInfo( 0 )
+ , nObjectBar( 0 )
+{
+ FreeResource();
+
+ AddTabPage( TP_CONFIG_MENU, CreateMenuConfigPage, NULL );
+ AddTabPage( TP_CONFIG_ACCEL, CreateAccelConfigPage, NULL );
+ AddTabPage( TP_CONFIG_STATBAR, CreateStatusBarConfigPage, NULL );
+ AddTabPage( TP_CONFIG_OBJECTBAR, CreateObjectBarConfigPage, NULL );
+ AddTabPage( TP_CONFIG_EVENT, CreateEventConfigPage, NULL );
+}
+
+SfxConfigDialog::~SfxConfigDialog()
+{
+}
+
+short SfxConfigDialog::Ok()
+{
+ return SfxTabDialog::Ok();
+}
+
+// SfxStatusBarConfigPage::Ctor() **********************************************
+
+SfxStatusBarConfigPage::SfxStatusBarConfigPage( Window *pParent, const SfxItemSet& rSet ) :
+
+ SfxTabPage( pParent, SfxResId( TP_CONFIG_STATBAR ), rSet ),
+
+ aEntriesBox ( this, ResId( BOX_STATBAR_ENTRIES ) ),
+ aStatusBarGroup ( this, ResId( GRP_STATBAR ) ),
+ aLoadButton ( this, ResId( BTN_LOAD ) ),
+ aSaveButton ( this, ResId( BTN_SAVE ) ),
+ aResetButton ( this, ResId( BTN_RESET ) ),
+ pMgr( SFX_APP()->GetStatusBarManager() )
+{
+ FreeResource();
+
+ if ( !pMgr )
+ pMgr = new SfxStatusBarManager( NULL, SfxViewFrame::Current()->GetBindings(), SFX_APP() );
+
+ aLoadButton .SetClickHdl ( LINK( this, SfxStatusBarConfigPage,
+ Load ) );
+ aSaveButton .SetClickHdl ( LINK( this, SfxStatusBarConfigPage,
+ Save ) );
+ aResetButton .SetClickHdl ( LINK( this, SfxStatusBarConfigPage,
+ Default ) );
+
+ // aEntriesBox initialisieren
+ aEntriesBox.bDefault = pMgr->IsDefault();
+//(mba)/task SfxWaitCursor aWait;
+
+ aEntriesBox.SetSelectHdl( LINK(this,SfxStatusBarConfigPage, SelectHdl));
+ USHORT nGroup = 0;
+ String aGroupName = SFX_SLOTPOOL().SeekGroup(nGroup);
+
+ while (aGroupName.Len() != 0)
+ {
+ USHORT n=0;
+ for (const SfxSlot *pSlot = SFX_SLOTPOOL().FirstSlot(); pSlot;
+ pSlot = SFX_SLOTPOOL().NextSlot())
+ {
+ if ( !pSlot->GetType() ||
+ pSlot->GetType()->Type() == TYPE(SfxVoidItem) ||
+ !(pSlot->GetMode() & SFX_SLOT_STATUSBARCONFIG) )
+ continue;
+
+ USHORT nId = pSlot->GetSlotId();
+ USHORT i;
+ for (i=0; i<aListOfIds.Count(); i++)
+ if (aListOfIds[i] >= nId) break;
+
+ if (i<aListOfIds.Count() && aListOfIds[i] == nId)
+ continue;
+ else
+ aListOfIds.Insert(nId, i);
+ }
+
+ aGroupName = SFX_SLOTPOOL().SeekGroup(++nGroup);
+ }
+
+ aEntriesBox.bDefault = pMgr->IsDefault();
+ Init();
+}
+
+void SfxStatusBarConfigPage::Init()
+{
+ SvLBoxEntry *pEntry;
+ USHORT nUsed=0;
+ SvUShorts aListOfPos;
+ pArr = new SfxStbInfoArr_Impl;
+
+ for (USHORT i=0; i<aListOfIds.Count(); i++)
+ {
+ USHORT nId = aListOfIds[i];
+ String aName = SFX_SLOTPOOL().GetSlotName_Impl( nId );
+ if ( !aName.Len() )
+ continue;
+
+ SfxStatBarInfo_Impl* pInfo = new SfxStatBarInfo_Impl (nId, String());
+ pArr->Append(pInfo);
+ USHORT nPos = pMgr->GetItemPos(nId);
+ if (nPos != STATUSBAR_ITEM_NOTFOUND)
+ {
+ USHORT np;
+ for (np=0; np<aListOfPos.Count(); np++)
+ if (aListOfPos[np] > nPos) break;
+ aListOfPos.Insert(nPos,np);
+ pEntry = aEntriesBox.InsertEntry(aName, (SvLBoxEntry*)0L, FALSE, (ULONG) np);
+ aEntriesBox.SetCheckButtonState(pEntry, SV_BUTTON_CHECKED);
+ nUsed++;
+ }
+ else
+ {
+ pEntry = aEntriesBox.InsertEntry(aName, (SvLBoxEntry*)0L);
+ }
+
+ pEntry->SetUserData(pInfo);
+ }
+}
+
+void SfxStatusBarConfigPage::ResetConfig()
+{
+ aEntriesBox.Clear();
+ for (USHORT n=0; n<pArr->Count(); n++)
+ delete (*pArr)[n];
+ delete pArr;
+}
+
+SfxStatusBarConfigPage::~SfxStatusBarConfigPage()
+{
+ ResetConfig();
+}
+
+IMPL_LINK( SfxStatusBarConfigPage, SelectHdl, SvTreeListBox *, pBox )
+{
+ return 0;
+}
+
+
+void SfxStatusBarConfigPage::Apply()
+{
+ if (!aEntriesBox.bModified)
+ return;
+
+ if ( aEntriesBox.bDefault )
+ {
+ pMgr->UseDefault();
+ pMgr->SetDefault(TRUE);
+ return;
+ }
+
+//(mba)/task SfxWaitCursor aWait;
+ pMgr->Clear();
+ long nWidth = 100;
+
+ for (SvLBoxEntry *pEntry = aEntriesBox.First(); pEntry; pEntry = aEntriesBox.Next(pEntry))
+ {
+ if (aEntriesBox.GetCheckButtonState(pEntry) == SV_BUTTON_CHECKED)
+ {
+ USHORT nId =
+ ((SfxStatBarInfo_Impl*) pEntry->GetUserData())->nId;
+ pMgr->AddItem(nId, nWidth);
+ }
+ }
+}
+
+IMPL_LINK( SfxStatusBarConfigPage, Default, PushButton *, pPushButton )
+{
+ SfxConfigManager *pOldCfgMgr = pMgr->GetConfigManager_Impl();
+ aEntriesBox.bDefault = TRUE;
+ aEntriesBox.bModified = !pMgr->IsDefault();
+ pMgr->StoreConfig();
+ pMgr->ReleaseConfigManager();
+ pMgr->UseDefault();
+ aEntriesBox.SetUpdateMode(FALSE);
+ ResetConfig();
+ Init();
+ aEntriesBox.SetUpdateMode(TRUE);
+ aEntriesBox.Invalidate();
+ pMgr->ReInitialize(pOldCfgMgr);
+ return 0;
+}
+
+IMPL_LINK( SfxStatusBarConfigPage, Load, Button *, pButton )
+{
+ String aCfgName = SfxConfigDialog::FileDialog_Impl( this,
+ WB_OPEN | WB_STDMODAL | WB_3DLOOK, String( SfxResId( STR_LOADSTATBARCONFIG) ) );
+ if ( aCfgName.Len() )
+ {
+//(mba)/task SfxWaitCursor aWait;
+
+ BOOL bCreated = FALSE;
+ SfxConfigManager *pCfgMgr =
+ SfxConfigDialog::MakeCfgMgr_Impl( aCfgName, bCreated );
+ SfxConfigManager *pOldCfgMgr = pMgr->GetConfigManager_Impl();
+ if ( pOldCfgMgr != pCfgMgr )
+ {
+ if ( pCfgMgr->HasConfigItem( pMgr->GetType() ) )
+ {
+ pMgr->ReInitialize( pCfgMgr );
+ aEntriesBox.SetUpdateMode( FALSE );
+ ResetConfig();
+ Init();
+ aEntriesBox.SetUpdateMode( TRUE );
+ aEntriesBox.Invalidate();
+ pMgr->ReInitialize( pOldCfgMgr );
+ aEntriesBox.bDefault = FALSE;
+ aEntriesBox.bModified = TRUE;
+ }
+ }
+
+ if ( bCreated )
+ delete pCfgMgr;
+ }
+
+ return 0;
+}
+
+IMPL_LINK( SfxStatusBarConfigPage, Save, Button *, pButton )
+{
+ String aCfgName = SfxConfigDialog::FileDialog_Impl( this,
+ WB_SAVEAS | WB_STDMODAL | WB_3DLOOK, String( SfxResId( STR_SAVESTATBARCONFIG) ) );
+ if ( aCfgName.Len() )
+ {
+//(mba)/task SfxWaitCursor aWait;
+
+ BOOL bCreated = FALSE;
+ SfxConfigManager *pCfgMgr =
+ SfxConfigDialog::MakeCfgMgr_Impl( aCfgName, bCreated );
+
+ if ( pCfgMgr == SfxObjectShell::Current()->GetConfigManager() )
+ {
+ pCfgMgr->Activate(SFX_CFGMANAGER());
+ pMgr->Connect(pCfgMgr);
+ pCfgMgr->AddConfigItem(pMgr);
+ }
+
+ SfxConfigManager *pOldCfgMgr = pMgr->GetConfigManager_Impl();
+ if (pOldCfgMgr != pCfgMgr)
+ {
+ pMgr->StoreConfig();
+ pMgr->Connect( pCfgMgr );
+ pCfgMgr->AddConfigItem( pMgr );
+ BOOL bMod = aEntriesBox.bModified;
+ pMgr->GetStatusBar()->SetUpdateMode( FALSE );
+ BOOL bItemModified = pMgr->IsModified();
+ Apply();
+ pMgr->SetModified( TRUE );
+ pCfgMgr->StoreConfig();
+ pMgr->ReInitialize( pOldCfgMgr );
+ pMgr->SetModified( bItemModified );
+ pMgr->GetStatusBar()->SetUpdateMode( TRUE );
+ aEntriesBox.bModified = bMod;
+
+ if ( bCreated )
+ {
+ pCfgMgr->SetModified( TRUE );
+ pCfgMgr->SaveConfig();
+#ifdef MAC
+ SvEaMgr aEaMgr( aCfgName );
+ aEaMgr.SetFileType( "Pref" );
+#endif
+ }
+ }
+ else
+ {
+ Apply();
+ pMgr->SetModified( TRUE );
+ pCfgMgr->StoreConfig();
+ }
+
+ if ( bCreated )
+ delete pCfgMgr;
+ }
+ return 0;
+}
+
+
+SfxStatusBarConfigListBox::SfxStatusBarConfigListBox( Window* pParent, const ResId& rResId)
+ : SvTreeListBox(pParent, rResId)
+ , bModified(FALSE)
+ , pCurEntry(0)
+ , bDefault(TRUE)
+{
+ pButton = new SvLBoxButtonData();
+ pButton->aBmps[SV_BMP_UNCHECKED] = Bitmap(SfxResId(CHKBTN_UNCHECKED));
+ pButton->aBmps[SV_BMP_CHECKED] = Bitmap(SfxResId(CHKBTN_CHECKED));
+ pButton->aBmps[SV_BMP_HICHECKED] = Bitmap(SfxResId(CHKBTN_HICHECKED));
+ pButton->aBmps[SV_BMP_HIUNCHECKED] = Bitmap(SfxResId(CHKBTN_HIUNCHECKED));
+ pButton->aBmps[SV_BMP_TRISTATE] = Bitmap(SfxResId(CHKBTN_TRISTATE));
+ pButton->aBmps[SV_BMP_HITRISTATE] = Bitmap(SfxResId(CHKBTN_HITRISTATE));
+
+ EnableCheckButton(pButton);
+
+ DragDropMode aDDMode = SV_DRAGDROP_CTRL_MOVE;
+ SetDragDropMode( aDDMode );
+ SetHighlightRange(); // OV Selektion ueber gesamte Zeilenbreite
+
+ // Timer f"ur die BallonHelp
+ aTimer.SetTimeout( 200 );
+ aTimer.SetTimeoutHdl(
+ LINK( this, SfxStatusBarConfigListBox, TimerHdl ) );
+}
+
+void SfxStatusBarConfigListBox::KeyInput( const KeyEvent& rKEvt )
+{
+ USHORT aCode = rKEvt.GetKeyCode().GetCode();
+ if( aCode == KEY_SPACE )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*) FirstSelected();
+ if( pEntry && (GetCheckButtonState( pEntry ) == SV_BUTTON_UNCHECKED) )
+ SetCheckButtonState(pEntry, SV_BUTTON_CHECKED);
+ else
+ SetCheckButtonState(pEntry, SV_BUTTON_UNCHECKED);
+ GetCheckButtonHdl().Call(this);
+ }
+ else
+ SvTreeListBox::KeyInput( rKEvt );
+}
+
+BOOL SfxStatusBarConfigListBox::NotifyQueryDrop( SvLBoxEntry* pEntry )
+{
+ return SvTreeListBox::NotifyQueryDrop(pEntry);
+}
+
+BOOL SfxStatusBarConfigListBox::NotifyMoving(SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos)
+{
+ BOOL bRet =
+ SvTreeListBox::NotifyMoving(pTarget, pEntry, rpNewParent, rNewChildPos);
+ if (bRet)
+ {
+ bModified = TRUE;
+ bDefault = FALSE;
+ }
+ return bRet;
+}
+
+void SfxStatusBarConfigListBox::CheckButtonHdl()
+{
+ bDefault = FALSE;
+ bModified = TRUE;
+}
+
+void SfxStatusBarConfigListBox::MouseMove( const MouseEvent& rMEvt )
+/* Beschreibung
+ Virtuelle Methode, die gerufen wird, wenn der Mauszeiger "uber der TreeListBox bewegt wurde.
+ Wenn die Position des Mauszeigers "uber dem aktuell selektierten Entry liegt, wird ein Timer
+ aufgesetzt, um ggf. einen Hilfetext einzublenden.
+*/
+{
+ Point aMousePos = rMEvt.GetPosPixel();
+ SvLBoxEntry *pEntry = GetCurEntry();
+ pCurEntry = pEntry;
+
+ if ( pEntry && GetEntry( aMousePos ) == pEntry )
+ aTimer.Start();
+ else
+ {
+ Help::ShowBalloon( this, aMousePos, String() );
+ aTimer.Stop();
+ }
+}
+
+IMPL_LINK( SfxStatusBarConfigListBox, TimerHdl, Timer*, pTimer)
+/* Beschreibung
+ Timer-Handler f"ur die Einblendung eines Hilfetextes. Wenn nach Ablauf des Timers
+ der Mauszeiger immer noch auf dem aktuell selektierten Eintrag steht, wird der
+ Helptext des Entries als Balloon-Help eingeblendet.
+*/
+{
+ if ( pTimer )
+ pTimer->Stop();
+
+ Point aMousePos = GetPointerPosPixel();
+ SvLBoxEntry *pEntry = GetCurEntry();
+ if ( pEntry && GetEntry( aMousePos ) == pEntry && pEntry == pCurEntry )
+ {
+ SfxStatBarInfo_Impl* pInfo = (SfxStatBarInfo_Impl*) pEntry->GetUserData();
+ if ( !pInfo->aHelpText.Len() )
+ pInfo->aHelpText = Application::GetHelp()->GetHelpText( pInfo->nId );
+ Help::ShowBalloon( this, OutputToScreenPixel( aMousePos ), pInfo->aHelpText );
+ }
+
+ return 0L;
+}
+
+
+
+BOOL SfxStatusBarConfigPage::FillItemSet( SfxItemSet& )
+{
+ if ( aEntriesBox.bModified )
+ {
+ Apply();
+ aEntriesBox.bModified = FALSE;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SfxStatusBarConfigPage::Reset( const SfxItemSet& )
+{
+}
+
+BOOL SfxMenuConfigPage::FillItemSet( SfxItemSet& )
+{
+ if ( bModified )
+ {
+ Apply();
+ bModified = FALSE;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SfxMenuConfigPage::Reset( const SfxItemSet& )
+{
+}
+
+BOOL SfxAcceleratorConfigPage::FillItemSet( SfxItemSet& )
+{
+ if ( bModified )
+ {
+ Apply();
+ bModified = FALSE;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SfxAcceleratorConfigPage::Reset( const SfxItemSet& )
+{
+}
+
+String SfxConfigDialog::FileDialog_Impl( Window *pParent, WinBits nBits, const String& rTitle )
+{
+ SfxSimpleFileDialog aFileDlg( pParent, nBits );
+ aFileDlg.SetText( rTitle );
+#ifdef MAC
+ aFileDlg.AddFilter( String(SfxResId(STR_FILTERNAME_CFG)),DEFINE_CONST_UNICODE("Pref.cfg") );
+#else
+ aFileDlg.AddFilter( String(SfxResId(STR_FILTERNAME_CFG)),DEFINE_CONST_UNICODE("*.cfg") );
+#endif
+ aFileDlg.AddFilter( String(SfxResId(STR_FILTERNAME_ALL) ), DEFINE_CONST_UNICODE(FILEDIALOG_FILTER_ALL) );
+ INetURLObject aFilePath( SFX_INIMANAGER()->Get( SFX_KEY_USERCONFIG_PATH ), INET_PROT_FILE );
+ aFilePath.setFinalSlash();
+ String aCfgName = aFilePath.PathToFileName();
+#ifndef MAC
+ aCfgName += DEFINE_CONST_UNICODE( "*.cfg" );
+ aFileDlg.SetDefaultExt( DEFINE_CONST_UNICODE( "cfg" ) );
+#endif
+
+ aFileDlg.SetPath( aCfgName );
+ if ( aFileDlg.Execute() )
+ return aFileDlg.GetPath();
+ else
+ return String();
+}
+
+SfxConfigManager* SfxConfigDialog::MakeCfgMgr_Impl( const String& rName, BOOL& bCreated )
+{
+ // Zuerst feststellen, ob der Storage schon in Benutzung ist
+ bCreated = FALSE;
+ SfxObjectShell *pDoc = SFX_APP()->DocAlreadyLoaded( rName, TRUE, TRUE );
+ SfxConfigManager *pCfgMgr = 0;
+ if ( !pDoc )
+ {
+ if ( rName != SfxConfigManager::GetDefaultName() )
+ {
+ pCfgMgr = new SfxConfigManager( rName );
+ bCreated = TRUE;
+ }
+ else
+ pCfgMgr = SFX_APP()->GetAppConfigManager_Impl();
+ }
+ else
+ {
+ pCfgMgr = pDoc->GetConfigManager();
+ if ( !pCfgMgr )
+ {
+ pCfgMgr = new SfxConfigManager( 0, SFX_CFGMANAGER() );
+ pDoc->SetConfigManager( pCfgMgr );
+ }
+ }
+
+ return pCfgMgr;
+}
+
+
diff --git a/sfx2/source/dialog/cfg.hrc b/sfx2/source/dialog/cfg.hrc
new file mode 100644
index 000000000000..145740f2b0ee
--- /dev/null
+++ b/sfx2/source/dialog/cfg.hrc
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: cfg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define BTN_MN_OK 1
+#define BTN_MN_CANCEL 2
+#define BTN_MN_NEWPOPUP 6
+#define BTN_MN_NEW 7
+#define BTN_MN_CHANGE 8
+#define BTN_MN_REMOVE 9
+#define BOX_MN_ENTRIES 10
+#define TXT_MN_FUNCTIONTEXT 13
+#define TXT_MN_FUNCTIONINFO 14
+#define TXT_MN_DESCRIPTIONTEXT 15
+#define TXT_MN_DESCRIPTIONINFO 16
+#define GRP_MN_MENU 17
+#define TXT_MN_GROUP 18
+#define BOX_MN_GROUP 19
+#define TXT_MN_FUNCTION 20
+#define BOX_MN_FUNCTION 21
+#define GRP_FUNCTIONS 22
+#define BTN_ACC_OK 1
+#define BTN_ACC_CANCEL 2
+#define BTN_ACC_CHANGE 3
+#define BTN_ACC_REMOVE 4
+#define BOX_ACC_ENTRIES 5
+#define TXT_ACC_DESCRIPTIONTEXT 6
+#define TXT_ACC_DESCRIPTIONINFO 7
+#define GRP_ACC_KEYBOARD 8
+#define TXT_ACC_GROUP 9
+#define BOX_ACC_GROUP 10
+#define TXT_ACC_FUNCTION 11
+#define BOX_ACC_FUNCTION 12
+#define TXT_ACC_KEY 13
+#define BOX_ACC_KEY 14
+#define GRP_ACC_FUNCTIONS 15
+#define TAB_CONTROL 12
+#define BOX_STATBAR_ENTRIES 5
+#define TXT_STATBAR_DESCRIPTIONTEXT 6
+#define TXT_STATBAR_DESCRIPTIONINFO 7
+#define GRP_STATBAR 8
+#define BTN_RESET 20
+#define BTN_LOAD 40
+#define BTN_SAVE 41
+#define BTN_MN_UP 42
+#define BTN_MN_DOWN 43
+
+#define CHKBTN_UNCHECKED 30001
+#define CHKBTN_CHECKED 30002
+#define CHKBTN_HICHECKED 30003
+#define CHKBTN_HIUNCHECKED 30004
+#define CHKBTN_TRISTATE 30005
+#define CHKBTN_HITRISTATE 30006
diff --git a/sfx2/source/dialog/cfg.src b/sfx2/source/dialog/cfg.src
new file mode 100644
index 000000000000..e7e05ab79760
--- /dev/null
+++ b/sfx2/source/dialog/cfg.src
@@ -0,0 +1,1918 @@
+/*************************************************************************
+ *
+ * $RCSfile: cfg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "helpid.hrc"
+#include "dialog.hrc"
+#include "cfg.hrc"
+ // pragma ----------------------------------------------------------------
+
+#define PUSHBUTTON_TEXT_SAVE \
+ Text = "~Speichern..." ; \
+ Text [ ENGLISH ] = "~Save" ; \
+ Text [ dutch ] = "O~pslaan..." ; \
+ Text [ english_us ] = "~Save..." ; \
+ Text [ italian ] = "~Salva..." ; \
+ Text [ spanish ] = "~Guardar..." ; \
+ Text [ french ] = "~Enregistrer..." ; \
+ Text [ swedish ] = "Spara..." ; \
+ Text [ danish ] = "~Gem..." ; \
+ Text [ portuguese_brazilian ] = "~Speichern..." ; \
+ Text [ portuguese ] = "~Guardar..." ; \
+ Text[ chinese_simplified ] = "(~S)..."; \
+ Text[ russian ] = "..."; \
+ Text[ polish ] = "Zapisz..."; \
+ Text[ japanese ] = "ۑ(~S)..."; \
+ Text[ chinese_traditional ] = "xs(~S)..."; \
+ Text[ arabic ] = "..."; \
+ Text[ greek ] = "~..."; \
+ Text[ korean ] = "(~S)..."; \
+ Text[ turkish ] = "~Kaydet..."; \
+ Text[ language_user1 ] = " ";
+
+#define PUSHBUTTON_TEXT_RESET \
+ Text = "Zur~cksetzen" ; \
+ Text [ ENGLISH ] = "R~eset" ; \
+ Text [ dutch ] = "~Terugzetten" ; \
+ Text [ english_us ] = "R~eset" ; \
+ Text [ italian ] = "Ripris~tina" ; \
+ Text [ spanish ] = "~Restablecer" ; \
+ Text [ french ] = "Re~staurer" ; \
+ Text [ swedish ] = "~terstll" ; \
+ Text [ danish ] = "Nulstil" ; \
+ Text [ portuguese_brazilian ] = "~Zurcksetzen" ; \
+ Text [ portuguese ] = "~Restaurar" ; \
+ Text[ chinese_simplified ] = "(~E)"; \
+ Text[ russian ] = ""; \
+ Text[ polish ] = "Zresetuj"; \
+ Text[ japanese ] = "ؾ(~E)"; \
+ Text[ chinese_traditional ] = "](~E)"; \
+ Text[ arabic ] = " "; \
+ Text[ greek ] = "~"; \
+ Text[ korean ] = "(~E)"; \
+ Text[ turkish ] = "Baa al"; \
+ Text[ language_user1 ] = " ";
+
+#define PUSHBUTTON_TEXT_LOAD \
+/* ### ACHTUNG: Neuer Text in Resource? La~den... : ~Laden... */\
+ Text = "La~den..." ; \
+ Text [ ENGLISH ] = "~Load..." ; \
+ Text [ english_us ] = "~Load..." ; \
+ Text [ italian ] = "Ca~rica..." ; \
+ Text [ spanish ] = "~Cargar..." ; \
+ Text [ french ] = "~Charger..." ; \
+ Text [ dutch ] = "~Laden..." ; \
+ Text [ swedish ] = "La~dda..." ; \
+ Text [ danish ] = "Indls..." ; \
+ Text [ portuguese_brazilian ] = "~Laden..." ; \
+ Text [ portuguese ] = "~Carregar..." ; \
+ Text[ chinese_simplified ] = "װ(~L)..."; \
+ Text[ russian ] = "..."; \
+ Text[ polish ] = "aduj..."; \
+ Text[ japanese ] = "ǂݍ(~L)..."; \
+ Text[ chinese_traditional ] = "˸(~L)..."; \
+ Text[ arabic ] = "..."; \
+ Text[ greek ] = "~..."; \
+ Text[ korean ] = "ε(~L)..."; \
+ Text[ turkish ] = "Ykle..."; \
+ Text[ language_user1 ] = " ";
+
+#define PUSHBUTTON_TEXT_REMOVE \
+/* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */\
+ Text = "~Lschen" ; \
+ Text [ ENGLISH ] = "~Remove" ; \
+ Text [ norwegian ] = "~Fjern" ; \
+ Text [ italian ] = "~Elimina" ; \
+ Text [ portuguese_brazilian ] = "~Remover" ; \
+ Text [ portuguese ] = "E~liminar" ; \
+ Text [ finnish ] = "~Poista" ; \
+ Text [ danish ] = "Slet" ; \
+ Text [ french ] = "~Supprimer" ; \
+ Text [ swedish ] = "~Radera" ; \
+ Text [ dutch ] = "~Wissen" ; \
+ Text [ spanish ] = "~Eliminar" ; \
+ Text [ english_us ] = "~Delete" ; \
+ Text[ chinese_simplified ] = "ɾ(~D)"; \
+ Text[ russian ] = ""; \
+ Text[ polish ] = "Usu"; \
+ Text[ japanese ] = "폜(~D)"; \
+ Text[ chinese_traditional ] = "R(~D)"; \
+ Text[ arabic ] = ""; \
+ Text[ greek ] = "~"; \
+ Text[ korean ] = "(~D)"; \
+ Text[ turkish ] = "Sil"; \
+ Text[ language_user1 ] = " ";
+
+#define PUSHBUTTON_TEXT_CHANGE \
+/* ### ACHTUNG: Neuer Text in Resource? ~ndern : ~ndern */\
+ Text = "~ndern" ; \
+ Text [ ENGLISH ] = "~Change" ; \
+ Text [ norwegian ] = "~Endre" ; \
+ Text [ italian ] = "~Cambia" ; \
+ Text [ portuguese_brazilian ] = "~Mudar" ; \
+ Text [ portuguese ] = "~Modificar" ; \
+ Text [ finnish ] = "~Muuta" ; \
+ Text [ danish ] = "Modificer" ; \
+ Text [ french ] = "~Modifier" ; \
+ Text [ swedish ] = "~ndra" ; \
+ Text [ dutch ] = "Wij~zigen" ; \
+ Text [ spanish ] = "~Modificar" ; \
+ Text [ english_us ] = "~Modify" ; \
+ Text[ chinese_simplified ] = "(~M)"; \
+ Text[ russian ] = ""; \
+ Text[ polish ] = "Mo~dyfikuj"; \
+ Text[ japanese ] = "ύX(~M)"; \
+ Text[ chinese_traditional ] = "ܧ(~M)"; \
+ Text[ arabic ] = ""; \
+ Text[ greek ] = "~"; \
+ Text[ korean ] = "(~M)"; \
+ Text[ turkish ] = "Deitir"; \
+ Text[ language_user1 ] = " ";
+
+#define PUSHBUTTON_TEXT_NEW \
+ Text = "~Neu" ; \
+ Text [ ENGLISH ] = "~New" ; \
+ Text [ norwegian ] = "~New" ; \
+ Text [ italian ] = "~Nuovo" ; \
+ Text [ portuguese_brazilian ] = "~Novo" ; \
+ Text [ portuguese ] = "~Novo" ; \
+ Text [ finnish ] = "~Uusi" ; \
+ Text [ danish ] = "~Ny(t)" ; \
+ Text [ french ] = "Nou~veau" ; \
+ Text [ swedish ] = "~Nytt" ; \
+ Text [ dutch ] = "~Nieuw" ; \
+ Text [ spanish ] = "~Nuevo" ; \
+ Text [ english_us ] = "~New" ; \
+ Text[ chinese_simplified ] = "½(~N)"; \
+ Text[ russian ] = "~"; \
+ Text[ polish ] = "Nowy"; \
+ Text[ japanese ] = "VK쐬(~N)"; \
+ Text[ chinese_traditional ] = "}ҷs(~N)"; \
+ Text[ arabic ] = ""; \
+ Text[ greek ] = "~"; \
+ Text[ korean ] = "(~N)"; \
+ Text[ turkish ] = "~Yeni"; \
+ Text[ language_user1 ] = " ";
+
+#define FIXEDTEXT_TEXT_GROUP \
+ Text = "~Bereich" ; \
+ Text [ ENGLISH ] = "~Group" ; \
+ Text [ norwegian ] = "~Gruppe" ; \
+ Text [ italian ] = "Area" ; \
+ Text [ portuguese_brazilian ] = "~Agrupar" ; \
+ Text [ portuguese ] = "~Categoria" ; \
+ Text [ finnish ] = "~Ryhmit" ; \
+ Text [ danish ] = "Omrde" ; \
+ Text [ french ] = "~Catgorie" ; \
+ Text [ swedish ] = "~Kategori" ; \
+ Text [ dutch ] = "~Bereik" ; \
+ Text [ spanish ] = "~rea" ; \
+ Text [ english_us ] = "~Category" ; \
+ Text[ chinese_simplified ] = "Χ(~C)"; \
+ Text[ russian ] = ""; \
+ Text[ polish ] = "Obszar"; \
+ Text[ japanese ] = "͈(~C)"; \
+ Text[ chinese_traditional ] = "S(~C)"; \
+ Text[ arabic ] = ""; \
+ Text[ greek ] = "~"; \
+ Text[ korean ] = "(~C)"; \
+ Text[ turkish ] = "Ka~tegori"; \
+ Text[ language_user1 ] = " ";
+
+#define FIXEDTEXT_TEXT_FUNCTION \
+ Text = "~Funktion" ; \
+ Text [ ENGLISH ] = "~Function" ; \
+ Text [ norwegian ] = "~Function" ; \
+ Text [ italian ] = "~Funzione" ; \
+ Text [ portuguese_brazilian ] = "~Funo" ; \
+ Text [ portuguese ] = "~Funo" ; \
+ Text [ finnish ] = "~Funktio" ; \
+ Text [ danish ] = "Funktion" ; \
+ Text [ french ] = "~Fonction" ; \
+ Text [ swedish ] = "~Funktion" ; \
+ Text [ dutch ] = "~Functie" ; \
+ Text [ spanish ] = "~Funcin" ; \
+ Text [ english_us ] = "Function" ; \
+ Text[ chinese_simplified ] = "(~F)"; \
+ Text[ russian ] = ""; \
+ Text[ polish ] = "Funkcja"; \
+ Text[ japanese ] = "@\\"; \
+ Text[ chinese_traditional ] = "\\(~F)"; \
+ Text[ arabic ] = ""; \
+ Text[ greek ] = "~"; \
+ Text[ korean ] = ""; \
+ Text[ turkish ] = "lev"; \
+ Text[ language_user1 ] = " ";
+
+#define GROUPBOX_TEXT_FUNCTIONS \
+ Text = "Funktionen" ; \
+ Text [ ENGLISH ] = "Functions" ; \
+ Text [ norwegian ] = "Funksjoner" ; \
+ Text [ italian ] = "Funzioni" ; \
+ Text [ portuguese_brazilian ] = "Funes" ; \
+ Text [ portuguese ] = "Funes" ; \
+ Text [ finnish ] = "Toiminnot" ; \
+ Text [ danish ] = "Funktioner" ; \
+ Text [ french ] = "Fonctions" ; \
+ Text [ swedish ] = "Funktioner" ; \
+ Text [ dutch ] = "Functies" ; \
+ Text [ spanish ] = "Funciones" ; \
+ Text [ english_us ] = "Functions" ; \
+ Text[ chinese_simplified ] = ""; \
+ Text[ russian ] = ""; \
+ Text[ polish ] = "Funkcje"; \
+ Text[ japanese ] = "@\\"; \
+ Text[ chinese_traditional ] = "\\"; \
+ Text[ arabic ] = ""; \
+ Text[ greek ] = ""; \
+ Text[ korean ] = "ɵ"; \
+ Text[ turkish ] = "Fonksiyon"; \
+ Text[ language_user1 ] = " ";
+
+ // TP_CONFIG_MENU --------------------------------------------------------
+TabPage TP_CONFIG_MENU
+{
+ HelpId = HID_CONFIG_MENU ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 282 , 205 ) ;
+ PushButton BTN_MN_NEW
+ {
+ Pos = MAP_APPFONT ( 226 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ PUSHBUTTON_TEXT_NEW
+ Text [ english_us ] = "~New" ;
+ Text [ portuguese_brazilian ] = "~Novo" ;
+ Text = "~Neu" ;
+ Text [ swedish ] = "~Nytt" ;
+ Text [ danish ] = "Ny" ;
+ Text [ italian ] = "~Nuovo" ;
+ Text [ spanish ] = "~Nuevo" ;
+ Text [ french ] = "~Nouveau" ;
+ Text [ dutch ] = "~Nieuw" ;
+ Text [ portuguese ] = "~Novo" ;
+ Text[ chinese_simplified ] = "½(~N)";
+ Text[ russian ] = "~";
+ Text[ polish ] = "Nowy";
+ Text[ japanese ] = "VK쐬(~N)";
+ Text[ chinese_traditional ] = "}ҷs(~N)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~N)";
+ Text[ turkish ] = "~Yeni";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_MN_NEWPOPUP
+ {
+ Pos = MAP_APPFONT ( 226 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Neues ~Men : Neues ~Men */
+ /* ### ACHTUNG: Neuer Text in Resource? Neues ~Men : Neues ~Men */
+ Text = "Neues ~Men" ;
+ Text [ ENGLISH ] = "New ~menu" ;
+ Text [ english_us ] = "New Men~u" ;
+ Text [ swedish ] = "Ny ~meny" ;
+ Text [ danish ] = "Ny menu" ;
+ Text [ italian ] = "Nuovo ~Menu" ;
+ Text [ spanish ] = "Nue~vo men" ;
+ Text [ french ] = "Nouveau ~menu" ;
+ Text [ dutch ] = "Nieuw ~menu" ;
+ Text [ portuguese_brazilian ] = "Neues ~Men" ;
+ Text [ portuguese ] = "Novo ~menu" ;
+ Text[ chinese_simplified ] = "²˵(~U)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nowe menu";
+ Text[ japanese ] = "Vƭ(~U)";
+ Text[ chinese_traditional ] = "s\\(~U)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ~";
+ Text[ korean ] = " ޴(~U)";
+ Text[ turkish ] = "Yeni mn";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_MN_CHANGE
+ {
+ Pos = MAP_APPFONT ( 226 , 40 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ PUSHBUTTON_TEXT_CHANGE
+ Text [ english_us ] = "~Modify" ;
+ Text [ portuguese_brazilian ] = "~Mudar" ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~ndern : ~ndern */
+ /* ### ACHTUNG: Neuer Text in Resource? ~ndern : ~ndern */
+ Text = "~ndern" ;
+ Text [ swedish ] = "~ndra" ;
+ Text [ danish ] = "Modificer" ;
+ Text [ italian ] = "Modifica" ;
+ Text [ spanish ] = "~Personalizar" ;
+ Text [ french ] = "~Personnaliser" ;
+ Text [ dutch ] = "Wij~zigen" ;
+ Text [ portuguese ] = "~Modificar" ;
+ Text[ chinese_simplified ] = "(~M)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Modyfikuj";
+ Text[ japanese ] = "ύX(~M)";
+ Text[ chinese_traditional ] = "ܧ(~M)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~M)";
+ Text[ turkish ] = "Deitir";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_MN_REMOVE
+ {
+ Pos = MAP_APPFONT ( 226 , 57 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_REMOVE
+ Text [ english_us ] = "~Delete" ;
+ Text [ portuguese_brazilian ] = "~Remover" ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
+ Text = "~Lschen" ;
+ Text [ swedish ] = "~Radera" ;
+ Text [ danish ] = "Slet" ;
+ Text [ italian ] = "Elimina" ;
+ Text [ spanish ] = "~Eliminar" ;
+ Text [ french ] = "~Supprimer" ;
+ Text [ dutch ] = "~Wissen" ;
+ Text [ portuguese ] = "E~liminar" ;
+ Text[ chinese_simplified ] = "ɾ(~D)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Usu";
+ Text[ japanese ] = "폜(~D)";
+ Text[ chinese_traditional ] = "R(~D)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~D)";
+ Text[ turkish ] = "Sil";
+ Text[ language_user1 ] = " ";
+ };
+ ImageButton BTN_MN_UP
+ {
+ Pos = MAP_APPFONT ( 244 , 77 ) ;
+ Size = MAP_APPFONT ( 14 , 14 ) ;
+ TabStop = TRUE ;
+ Symbol = IMAGEBUTTON_ARROW_UP ;
+ };
+ ImageButton BTN_MN_DOWN
+ {
+ Pos = MAP_APPFONT ( 244 , 94 ) ;
+ Size = MAP_APPFONT ( 14 , 14 ) ;
+ TabStop = TRUE ;
+ Symbol = IMAGEBUTTON_ARROW_DOWN ;
+ };
+ PushButton BTN_RESET
+ {
+ Pos = MAP_APPFONT ( 226 , 189 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_RESET
+ Text [ english_us ] = "R~eset" ;
+ Text [ portuguese_brazilian ] = "~Zurcksetzen" ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : ~Zurcksetzen */
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : Zur~cksetzen */
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : Zur~cksetzen */
+ Text = "Zur~cksetzen" ;
+ Text [ swedish ] = "~terstll" ;
+ Text [ danish ] = "Nulstil" ;
+ Text [ italian ] = "Ri~pristina" ;
+ Text [ spanish ] = "Res~tablecer" ;
+ Text [ french ] = "Re~staurer" ;
+ Text [ dutch ] = "~Terugzetten" ;
+ Text [ portuguese ] = "~Restaurar" ;
+ Text[ chinese_simplified ] = "(~E)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zr~esetuj";
+ Text[ japanese ] = "ؾ(~E)";
+ Text[ chinese_traditional ] = "](~E)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~E)";
+ Text[ turkish ] = "Baa al";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_LOAD
+ {
+ Pos = MAP_APPFONT ( 226 , 155 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_LOAD
+ Text [ english_us ] = "~Load" ;
+ Text [ portuguese_brazilian ] = "~Laden..." ;
+ /* ### ACHTUNG: Neuer Text in Resource? L~aden... : ~Laden... */
+ Text = "L~aden..." ;
+ Text [ swedish ] = "L~adda..." ;
+ Text [ danish ] = "Indls..." ;
+ Text [ italian ] = "~Carica..." ;
+ Text [ spanish ] = "C~argar..." ;
+ Text [ french ] = "~Charger..." ;
+ Text [ dutch ] = "~Laden..." ;
+ Text [ portuguese ] = "~Carregar..." ;
+ Text[ chinese_simplified ] = "װ(~L)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "aduj...";
+ Text[ japanese ] = "ǂݍ(~L)...";
+ Text[ chinese_traditional ] = "˸(~L)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "ε(~L)";
+ Text[ turkish ] = "Ykle...";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_SAVE
+ {
+ TabStop = TRUE ;
+ Group = TRUE ;
+ Pos = MAP_APPFONT ( 226 , 172 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ PUSHBUTTON_TEXT_SAVE
+ Text [ english_us ] = "~Save..." ;
+ Text [ portuguese_brazilian ] = "~Speichern..." ;
+ Text = "~Speichern..." ;
+ Text [ swedish ] = "~Spara..." ;
+ Text [ danish ] = "Gem..." ;
+ Text [ italian ] = "Salva..." ;
+ Text [ spanish ] = "~Guardar..." ;
+ Text [ french ] = "En~registrer..." ;
+ Text [ dutch ] = "O~pslaan..." ;
+ Text [ portuguese ] = "~Guardar..." ;
+ Text[ chinese_simplified ] = "(~S)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Zapi~sz...";
+ Text[ japanese ] = "ۑ(~S)...";
+ Text[ chinese_traditional ] = "xs(~S)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "~...";
+ Text[ korean ] = "(~S)...";
+ Text[ turkish ] = "Kaydet...";
+ Text[ language_user1 ] = " ";
+ };
+ Control BOX_MN_ENTRIES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 202 , 90 ) ;
+ TabStop = TRUE ;
+ HelpId = HID_MENUCONFIG_LISTBOX ;
+ };
+ GroupBox GRP_MN_MENU
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 214 , 107 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Men : Men */
+ /* ### ACHTUNG: Neuer Text in Resource? Men : Men */
+ Text = "Men" ;
+ Text [ ENGLISH ] = "Menu" ;
+ Text [ norwegian ] = "Meny" ;
+ Text [ italian ] = "Menu" ;
+ Text [ portuguese_brazilian ] = "Menu" ;
+ Text [ portuguese ] = "Menu" ;
+ Text [ finnish ] = "Valikko" ;
+ Text [ danish ] = "Menu" ;
+ Text [ french ] = "Menu" ;
+ Text [ swedish ] = "Meny" ;
+ Text [ dutch ] = "Menu" ;
+ Text [ spanish ] = "Men" ;
+ Text [ english_us ] = "Menu" ;
+ Group = TRUE ;
+ Text[ chinese_simplified ] = "˵";
+ Text[ russian ] = "";
+ Text[ polish ] = "Menu";
+ Text[ japanese ] = "ƭ";
+ Text[ chinese_traditional ] = "\\";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "޴";
+ Text[ turkish ] = "Mn";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText TXT_MN_GROUP
+ {
+ Pos = MAP_APPFONT ( 12 , 124 ) ;
+ Size = MAP_APPFONT ( 93 , 8 ) ;
+ Group = TRUE ;
+ Left = TRUE ;
+ FIXEDTEXT_TEXT_GROUP
+ Text [ english_us ] = "C~ategory" ;
+ Text [ portuguese_brazilian ] = "~Agrupar" ;
+ Text = "~Bereich" ;
+ Text [ swedish ] = "~Kategori" ;
+ Text [ danish ] = "Omrde" ;
+ Text [ italian ] = "Area" ;
+ Text [ spanish ] = "~rea" ;
+ Text [ french ] = "~Catgorie" ;
+ Text [ dutch ] = "~Bereik" ;
+ Text [ portuguese ] = "~Categoria" ;
+ Text[ chinese_simplified ] = "(~A)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Obszar";
+ Text[ japanese ] = "͈(~A)";
+ Text[ chinese_traditional ] = "ϰ(~A)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~A)";
+ Text[ turkish ] = "Ka~tegori";
+ Text[ language_user1 ] = " ";
+ };
+ Control BOX_MN_GROUP
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 135 ) ;
+ Size = MAP_APPFONT ( 93 , 60 ) ;
+ TabStop = TRUE ;
+ HelpId = HID_CONFIGGROUP_LISTBOX ;
+ };
+ FixedText TXT_MN_FUNCTION
+ {
+ Pos = MAP_APPFONT ( 111 , 124 ) ;
+ Size = MAP_APPFONT ( 103 , 8 ) ;
+ Left = TRUE ;
+ FIXEDTEXT_TEXT_FUNCTION
+ Text [ portuguese ] = "~Funo" ;
+ Text [ english_us ] = "~Function" ;
+ Text [ portuguese_brazilian ] = "~Funo" ;
+ Text = "~Funktion" ;
+ Text [ swedish ] = "~Funktion" ;
+ Text [ danish ] = "Funktion" ;
+ Text [ italian ] = "~Funzione" ;
+ Text [ spanish ] = "~Funcin" ;
+ Text [ french ] = "~Fonction" ;
+ Text [ dutch ] = "~Functie" ;
+ Text[ chinese_simplified ] = "(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Funkcja";
+ Text[ japanese ] = "@\\(~C)";
+ Text[ chinese_traditional ] = "\\(~C)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~C)";
+ Text[ turkish ] = "lev";
+ Text[ language_user1 ] = " ";
+ };
+ Control BOX_MN_FUNCTION
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 111 , 135 ) ;
+ Size = MAP_APPFONT ( 103 , 60 ) ;
+ TabStop = TRUE ;
+ HelpId = HID_CONFIGFUNCTION_LISTBOX ;
+ };
+ GroupBox GRP_FUNCTIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 115 ) ;
+ Size = MAP_APPFONT ( 214 , 87 ) ;
+ Group = TRUE ;
+ GROUPBOX_TEXT_FUNCTIONS
+ Text [ portuguese ] = "Funes" ;
+ Text [ english_us ] = "Functions" ;
+ Text [ portuguese_brazilian ] = "Funes" ;
+ Text = "Funktionen" ;
+ Text [ swedish ] = "Funktioner" ;
+ Text [ danish ] = "Funktioner" ;
+ Text [ italian ] = "Funzioni" ;
+ Text [ spanish ] = "Funciones" ;
+ Text [ french ] = "Ensemble de fonctions" ;
+ Text [ dutch ] = "Functies" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Funkcja";
+ Text[ japanese ] = "@\\";
+ Text[ chinese_traditional ] = "\\";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ɵ";
+ Text[ turkish ] = "levler";
+ Text[ language_user1 ] = " ";
+ };
+};
+ // TP_CONFIG_ACCEL -------------------------------------------------------
+TabPage TP_CONFIG_ACCEL
+{
+ HelpId = HID_CONFIG_ACCEL ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 282 , 205 ) ;
+ PushButton BTN_ACC_CHANGE
+ {
+ Pos = MAP_APPFONT ( 226 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ PUSHBUTTON_TEXT_CHANGE
+ Text [ portuguese ] = "~Modificar" ;
+ Text [ english_us ] = "Modify" ;
+ Text [ portuguese_brazilian ] = "~Mudar" ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~ndern : ~ndern */
+ /* ### ACHTUNG: Neuer Text in Resource? ~ndern : ~ndern */
+ Text = "~ndern" ;
+ Text [ swedish ] = "~ndra" ;
+ Text [ danish ] = "Modificer" ;
+ Text [ italian ] = "~Cambia" ;
+ Text [ spanish ] = "~Modificar" ;
+ Text [ french ] = "~Modifier" ;
+ Text [ dutch ] = "Wij~zigen" ;
+ Text[ chinese_simplified ] = "(~A)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Modyfikuj";
+ Text[ japanese ] = "ύX(~A)";
+ Text[ chinese_traditional ] = "ܧ(~A)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~A)";
+ Text[ turkish ] = "Deitir";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_ACC_REMOVE
+ {
+ Pos = MAP_APPFONT ( 226 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_REMOVE
+ Text [ english_us ] = "~Delete" ;
+ Text [ portuguese_brazilian ] = "~Remover" ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
+ Text = "~Lschen" ;
+ Text [ swedish ] = "~Radera" ;
+ Text [ danish ] = "Slet" ;
+ Text [ italian ] = "Elimina" ;
+ Text [ spanish ] = "~Eliminar" ;
+ Text [ french ] = "~Supprimer" ;
+ Text [ dutch ] = "~Wissen" ;
+ Text [ portuguese ] = "E~liminar" ;
+ Text[ chinese_simplified ] = "ɾ(~D)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Usu";
+ Text[ japanese ] = "폜(~D)";
+ Text[ chinese_traditional ] = "R(~D)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~D)";
+ Text[ turkish ] = "Sil";
+ Text[ language_user1 ] = " ";
+ };
+ Control BOX_ACC_ENTRIES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 202 , 90 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ HelpId = HID_ACCELCONFIG_LISTBOX ;
+ };
+ GroupBox GRP_ACC_KEYBOARD
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 214 , 107 ) ;
+ Text = "Tastatur" ;
+ Text [ ENGLISH ] = "Keyboard" ;
+ Text [ norwegian ] = "Tastatur" ;
+ Text [ italian ] = "Tastiera" ;
+ Text [ portuguese_brazilian ] = "Teclado" ;
+ Text [ portuguese ] = "Teclado" ;
+ Text [ finnish ] = "Nppimist" ;
+ Text [ danish ] = "Tastatur" ;
+ Text [ french ] = "Clavier" ;
+ Text [ swedish ] = "Tangentbord" ;
+ Text [ dutch ] = "Toetsenbord" ;
+ Text [ spanish ] = "Teclado" ;
+ Text [ english_us ] = "Keyboard" ;
+ Group = TRUE ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Klawiatura";
+ Text[ japanese ] = "ް";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ű";
+ Text[ turkish ] = "Klavye";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText TXT_ACC_GROUP
+ {
+ Pos = MAP_APPFONT ( 12 , 124 ) ;
+ Size = MAP_APPFONT ( 65 , 8 ) ;
+ Group = TRUE ;
+ Left = TRUE ;
+ FIXEDTEXT_TEXT_GROUP
+ Text [ english_us ] = "~Category" ;
+ Text [ portuguese_brazilian ] = "~Agrupar" ;
+ Text = "~Bereich" ;
+ Text [ swedish ] = "~Kategori" ;
+ Text [ danish ] = "Omrde" ;
+ Text [ italian ] = "Area" ;
+ Text [ spanish ] = "~rea" ;
+ Text [ french ] = "~Catgorie" ;
+ Text [ dutch ] = "~Bereik" ;
+ Text [ portuguese ] = "~Categoria" ;
+ Text[ chinese_simplified ] = "Χ(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Obszar";
+ Text[ japanese ] = "͈(~C)";
+ Text[ chinese_traditional ] = "S(~C)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~C)";
+ Text[ turkish ] = "Ka~tegori";
+ Text[ language_user1 ] = " ";
+ };
+ Control BOX_ACC_GROUP
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 135 ) ;
+ Size = MAP_APPFONT ( 65 , 60 ) ;
+ TabStop = TRUE ;
+ HelpId = HID_CONFIGGROUP_ACC_LISTBOX ;
+ };
+ FixedText TXT_ACC_FUNCTION
+ {
+ Pos = MAP_APPFONT ( 83 , 124 ) ;
+ Size = MAP_APPFONT ( 75 , 8 ) ;
+ Left = TRUE ;
+ FIXEDTEXT_TEXT_FUNCTION
+ Text [ portuguese ] = "~Funo" ;
+ Text [ english_us ] = "~Function" ;
+ Text [ portuguese_brazilian ] = "~Funo" ;
+ Text = "~Funktion" ;
+ Text [ swedish ] = "~Funktion" ;
+ Text [ danish ] = "Funktion" ;
+ Text [ italian ] = "~Funzione" ;
+ Text [ spanish ] = "~Funcin" ;
+ Text [ french ] = "~Fonction" ;
+ Text [ dutch ] = "~Functie" ;
+ Text[ chinese_simplified ] = "(~O)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Funkcja";
+ Text[ japanese ] = "@\\(~O)";
+ Text[ chinese_traditional ] = "\\(~O)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~O)";
+ Text[ turkish ] = "lev";
+ Text[ language_user1 ] = " ";
+ };
+ Control BOX_ACC_FUNCTION
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 83 , 135 ) ;
+ Size = MAP_APPFONT ( 75 , 60 ) ;
+ TabStop = TRUE ;
+ HelpId = HID_CONFIGFUNCTION_ACC_LISTBOX ;
+ };
+ FixedText TXT_ACC_KEY
+ {
+ Pos = MAP_APPFONT ( 164 , 124 ) ;
+ Size = MAP_APPFONT ( 50 , 8 ) ;
+ Text = "~Tasten" ;
+ Text [ ENGLISH ] = "~Keys" ;
+ Text [ norwegian ] = "~Taster" ;
+ Text [ italian ] = "~Tasti" ;
+ Text [ portuguese_brazilian ] = "~Teclas" ;
+ Text [ portuguese ] = "~Teclas" ;
+ Text [ finnish ] = "~Nppimet" ;
+ Text [ danish ] = "Taster" ;
+ Text [ french ] = "~Clavier" ;
+ Text [ swedish ] = "~Tangenter" ;
+ Text [ dutch ] = "T~oetsen" ;
+ Text [ spanish ] = "~Teclas" ;
+ Text [ english_us ] = "~Keys" ;
+ Left = TRUE ;
+ Text[ chinese_simplified ] = "(~K)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Klawisze";
+ Text[ japanese ] = "(~K)";
+ Text[ chinese_traditional ] = "(~K)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "Ű(~K)";
+ Text[ turkish ] = "T~ular";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox BOX_ACC_KEY
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 164 , 135 ) ;
+ Size = MAP_APPFONT ( 50 , 60 ) ;
+ TabStop = TRUE ;
+ };
+ GroupBox GRP_ACC_FUNCTIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 115 ) ;
+ Size = MAP_APPFONT ( 214 , 87 ) ;
+ Group = TRUE ;
+ GROUPBOX_TEXT_FUNCTIONS
+ Text [ english_us ] = "Functions" ;
+ Text [ portuguese_brazilian ] = "Funes" ;
+ Text = "Funktionen" ;
+ Text [ swedish ] = "Funktioner" ;
+ Text [ danish ] = "Funktioner" ;
+ Text [ italian ] = "Funzioni" ;
+ Text [ spanish ] = "Funciones" ;
+ Text [ french ] = "Ensemble de fonctions" ;
+ Text [ dutch ] = "Functies" ;
+ Text [ portuguese ] = "Funes" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Funkcje";
+ Text[ japanese ] = "@\\";
+ Text[ chinese_traditional ] = "\\";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ɵ";
+ Text[ turkish ] = "levler";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_RESET
+ {
+ Pos = MAP_APPFONT ( 226 , 189 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_RESET
+ Text [ english_us ] = "R~eset" ;
+ Text [ portuguese_brazilian ] = "~Zurcksetzen" ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : ~Zurcksetzen */
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : Zur~cksetzen */
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : Zur~cksetzen */
+ Text = "Zur~cksetzen" ;
+ Text [ swedish ] = "~terstll" ;
+ Text [ danish ] = "Nulstil" ;
+ Text [ italian ] = "Ri~pristina" ;
+ Text [ spanish ] = "~Restablecer" ;
+ Text [ french ] = "Re~staurer" ;
+ Text [ dutch ] = "~Terugzetten" ;
+ Text [ portuguese ] = "~Restaurar" ;
+ Text[ chinese_simplified ] = "(~E)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zresetuj";
+ Text[ japanese ] = "ؾ(~E)";
+ Text[ chinese_traditional ] = "](~E)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~E)";
+ Text[ turkish ] = "Baa al";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_LOAD
+ {
+ Pos = MAP_APPFONT ( 226 , 155 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_LOAD
+ Text [ english_us ] = "~Load..." ;
+ Text [ portuguese_brazilian ] = "~Laden..." ;
+ /* ### ACHTUNG: Neuer Text in Resource? L~aden... : ~Laden... */
+ Text = "L~aden..." ;
+ Text [ swedish ] = "L~adda..." ;
+ Text [ danish ] = "Indls..." ;
+ Text [ italian ] = "~Carica..." ;
+ Text [ spanish ] = "C~argar..." ;
+ Text [ french ] = "~Charger..." ;
+ Text [ dutch ] = "~Laden..." ;
+ Text [ portuguese ] = "~Carregar..." ;
+ Text[ chinese_simplified ] = "װ(~L)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "aduj...";
+ Text[ japanese ] = "ǂݍ(~L)...";
+ Text[ chinese_traditional ] = "˸(~L)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "ε(~L)...";
+ Text[ turkish ] = "Ykle...";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_SAVE
+ {
+ Pos = MAP_APPFONT ( 226 , 172 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_SAVE
+ Text [ english_us ] = "~Save..." ;
+ Text [ portuguese_brazilian ] = "~Speichern..." ;
+ Text = "~Speichern..." ;
+ Text [ swedish ] = "~Spara..." ;
+ Text [ danish ] = "Gem..." ;
+ Text [ italian ] = "Salva..." ;
+ Text [ spanish ] = "~Guardar..." ;
+ Text [ french ] = "~Enregistrer..." ;
+ Text [ dutch ] = "O~pslaan..." ;
+ Text [ portuguese ] = "~Guardar..." ;
+ Text[ chinese_simplified ] = "(~S)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Zapi~sz...";
+ Text[ japanese ] = "ۑ(~S)...";
+ Text[ chinese_traditional ] = "xs(~S)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "~...";
+ Text[ korean ] = "(~S)...";
+ Text[ turkish ] = "Kaydet...";
+ Text[ language_user1 ] = " ";
+ };
+};
+ // TP_CONFIG_STATBAR -----------------------------------------------------
+TabPage TP_CONFIG_STATBAR
+{
+ HelpId = HID_CONFIG_STATBAR ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 282 , 205 ) ;
+ Control BOX_STATBAR_ENTRIES
+ {
+ Border = TRUE ;
+ ClipChildren = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 202 , 185 ) ;
+ TabStop = TRUE ;
+ HelpId = HID_STATUSBARCONFIG_LISTBOX ;
+ };
+ GroupBox GRP_STATBAR
+ {
+ Group = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 214 , 199 ) ;
+ Text = "Statusleiste " ;
+ Text [ ENGLISH ] = "Statusbar " ;
+ Text [ norwegian ] = "Statuslinje" ;
+ Text [ italian ] = "Barra di stato " ;
+ Text [ portuguese_brazilian ] = "Barra de Status " ;
+ Text [ portuguese ] = "Barra de estado " ;
+ Text [ finnish ] = "Tilarivi" ;
+ Text [ danish ] = "Statuslinje " ;
+ Text [ french ] = "Barre d'tat " ;
+ Text [ swedish ] = "Statuslist " ;
+ Text [ dutch ] = "Statusbalk " ;
+ Text [ spanish ] = "Barra de estado " ;
+ Text [ english_us ] = "Status bar " ;
+ Text[ chinese_simplified ] = "״̬ ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Pasek stanu ";
+ Text[ japanese ] = "ð ް ";
+ Text[ chinese_traditional ] = "AC ";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Durum ubuu ";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_RESET
+ {
+ Pos = MAP_APPFONT ( 226 , 189 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_RESET
+ Text [ english_us ] = "R~eset" ;
+ Text [ portuguese_brazilian ] = "~Zurcksetzen" ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : ~Zurcksetzen */
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : Zur~cksetzen */
+ /* ### ACHTUNG: Neuer Text in Resource? Zur~cksetzen : Zur~cksetzen */
+ Text = "Zur~cksetzen" ;
+ Text [ swedish ] = "~terstll" ;
+ Text [ danish ] = "Nulstil" ;
+ Text [ italian ] = "Ri~pristina" ;
+ Text [ spanish ] = "~Restablecer" ;
+ Text [ french ] = "Re~staurer" ;
+ Text [ dutch ] = "~Terugzetten" ;
+ Text [ portuguese ] = "~Restaurar" ;
+ Text[ chinese_simplified ] = "(~E)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zresetuj";
+ Text[ japanese ] = "ؾ(~E)";
+ Text[ chinese_traditional ] = "](~E)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~E)";
+ Text[ turkish ] = "Baa al";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_LOAD
+ {
+ Pos = MAP_APPFONT ( 226 , 155 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_LOAD
+ Text [ english_us ] = "~Load..." ;
+ Text [ portuguese_brazilian ] = "~Laden..." ;
+ /* ### ACHTUNG: Neuer Text in Resource? L~aden... : ~Laden... */
+ Text = "L~aden..." ;
+ Text [ swedish ] = "L~adda..." ;
+ Text [ danish ] = "Indls..." ;
+ Text [ italian ] = "~Carica..." ;
+ Text [ spanish ] = "C~argar..." ;
+ Text [ french ] = "~Charger..." ;
+ Text [ dutch ] = "~Laden..." ;
+ Text [ portuguese ] = "~Carregar..." ;
+ Text[ chinese_simplified ] = "װ(~L)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "aduj...";
+ Text[ japanese ] = "ǂݍ(~L)...";
+ Text[ chinese_traditional ] = "˸(~L)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "ε(~L)...";
+ Text[ turkish ] = "Ykle...";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_SAVE
+ {
+ Pos = MAP_APPFONT ( 226 , 172 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ PUSHBUTTON_TEXT_SAVE
+ Text [ english_us ] = "~Save..." ;
+ Text [ portuguese_brazilian ] = "~Speichern..." ;
+ Text = "~Speichern..." ;
+ Text [ swedish ] = "~Spara..." ;
+ Text [ danish ] = "Gem..." ;
+ Text [ italian ] = "Salva..." ;
+ Text [ spanish ] = "~Guardar..." ;
+ Text [ french ] = "~Enregistrer..." ;
+ Text [ dutch ] = "O~pslaan..." ;
+ Text [ portuguese ] = "~Guardar..." ;
+ Text[ chinese_simplified ] = "(~S)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Zapi~sz...";
+ Text[ japanese ] = "ۑ(~S)...";
+ Text[ chinese_traditional ] = "xs(~S)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "~...";
+ Text[ korean ] = "(~S)...";
+ Text[ turkish ] = "Kaydet...";
+ Text[ language_user1 ] = " ";
+ };
+ Bitmap CHKBTN_UNCHECKED { File = "chkun.bmp" ; };
+ Bitmap CHKBTN_CHECKED { File = "chkch.bmp" ; };
+ Bitmap CHKBTN_HICHECKED { File = "chkchhi.bmp" ; };
+ Bitmap CHKBTN_HIUNCHECKED { File = "chkunhi.bmp" ; };
+ Bitmap CHKBTN_TRISTATE { File = "chktri.bmp" ; };
+ Bitmap CHKBTN_HITRISTATE { File = "chktrihi.bmp" ; };
+};
+ // DLG_CONFIG ------------------------------------------------------------
+TabDialog DLG_CONFIG
+{
+ OutputSize = TRUE ;
+ Text = "Anpassen" ;
+ Text [ English ] = "Configuration" ;
+ Text [ norwegian ] = "Konfigurasjon" ;
+ Text [ italian ] = "Configura" ;
+ Text [ portuguese_brazilian ] = "Configurao" ;
+ Text [ portuguese ] = "Configurao" ;
+ Text [ finnish ] = "Asetukset" ;
+ Text [ danish ] = "Tilpas" ;
+ Text [ french ] = "Adaptation" ;
+ Text [ swedish ] = "Anpassa" ;
+ Text [ dutch ] = "Configureren" ;
+ Text [ spanish ] = "Configurar" ;
+ Text [ english_us ] = "Configuration" ;
+ Moveable = TRUE ;
+ SvLook = TRUE ;
+ TabControl 1
+ {
+ OutputSize = TRUE ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = TP_CONFIG_MENU ;
+ /* ### ACHTUNG: Neuer Text in Resource? Men : Men */
+ /* ### ACHTUNG: Neuer Text in Resource? Men : Men */
+ Text = "Men" ;
+ Text [ English ] = "Menu" ;
+ PageResID = 300 ;
+ Text [ dutch ] = "Menu" ;
+ Text [ english_us ] = "Menu" ;
+ Text [ italian ] = "Menu" ;
+ Text [ spanish ] = "Men" ;
+ Text [ french ] = "Menu" ;
+ Text [ swedish ] = "Meny" ;
+ Text [ danish ] = "Menu" ;
+ Text [ portuguese_brazilian ] = "Men" ;
+ Text [ portuguese ] = "Menu" ;
+ Text[ chinese_simplified ] = "˵";
+ Text[ russian ] = "";
+ Text[ polish ] = "Menu";
+ Text[ japanese ] = "ƭ";
+ Text[ chinese_traditional ] = "\\";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "޴";
+ Text[ turkish ] = "Mn";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_CONFIG_ACCEL ;
+ Text = "Tastatur" ;
+ Text [ English ] = "Keyboard" ;
+ Text [ norwegian ] = "Tastatur" ;
+ Text [ italian ] = "Tastiera" ;
+ Text [ portuguese_brazilian ] = "Teclado" ;
+ Text [ portuguese ] = "Teclado" ;
+ Text [ finnish ] = "Nppimist" ;
+ Text [ danish ] = "Tastatur" ;
+ Text [ french ] = "Clavier" ;
+ Text [ swedish ] = "Tangentbord" ;
+ Text [ dutch ] = "Toetsenbord" ;
+ Text [ spanish ] = "Teclado" ;
+ Text [ english_us ] = "Keyboard" ;
+ PageResID = 301 ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Klawiatura";
+ Text[ japanese ] = "ް";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ű";
+ Text[ turkish ] = "Klavye";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_CONFIG_STATBAR ;
+ Text = "Statusleiste" ;
+ Text [ English ] = "Statusbar" ;
+ Text [ norwegian ] = "Statuslinje" ;
+ Text [ italian ] = "Barra di stato" ;
+ Text [ portuguese_brazilian ] = "Barra de Status" ;
+ Text [ portuguese ] = "Barra de estado" ;
+ Text [ finnish ] = "Tilarivi" ;
+ Text [ danish ] = "Statuslinje" ;
+ Text [ french ] = "Barre d'tat" ;
+ Text [ swedish ] = "Statuslist" ;
+ Text [ dutch ] = "Statusbalk" ;
+ Text [ spanish ] = "Barra de estado" ;
+ Text [ english_us ] = "Status Bar" ;
+ PageResID = 302 ;
+ Text[ chinese_simplified ] = "״̬";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Pasek stanu";
+ Text[ japanese ] = "ðް";
+ Text[ chinese_traditional ] = "AC";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "¸";
+ Text[ turkish ] = "Durum ubuu";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_CONFIG_OBJECTBAR ;
+ Text = "Symbolleisten" ;
+ Text [ ENGLISH ] = "Toolbox Options" ;
+ Text [ norwegian ] = "Verktyalternativer" ;
+ Text [ italian ] = "Barre dei simboli" ;
+ Text [ portuguese_brazilian ] = "Opes do Quadro de Ferramentas" ;
+ Text [ portuguese ] = "Barras de ferramentas" ;
+ Text [ finnish ] = "Tykalurivin mritykset" ;
+ Text [ danish ] = "Ikonlinjer" ;
+ Text [ french ] = "Barres d'outils" ;
+ Text [ swedish ] = "Symbollister" ;
+ Text [ dutch ] = "Werkbalken" ;
+ Text [ spanish ] = "Barras de smbolos" ;
+ Text [ english_us ] = "Toolbars" ;
+ PageResID = 303 ;
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Paski symboli";
+ Text[ japanese ] = "°ް";
+ Text[ chinese_traditional ] = "ϥܦC";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Ara ubuklar";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_CONFIG_EVENT ;
+ Text = "Ereignisse" ;
+ Text [ ENGLISH ] = "Events" ;
+ Text [ norwegian ] = "+++Events" ;
+ Text [ italian ] = "Eventi" ;
+ Text [ portuguese_brazilian ] = "Eventos" ;
+ Text [ portuguese ] = "Eventos" ;
+ Text [ finnish ] = "Tapahtumat" ;
+ Text [ danish ] = "Begivenheder" ;
+ Text [ french ] = "vnements" ;
+ Text [ swedish ] = "Hndelser" ;
+ Text [ dutch ] = "Gebeurtenissen" ;
+ Text [ spanish ] = "Acontecimientos" ;
+ Text [ english_us ] = "Events" ;
+ PageResID = 304 ;
+ Text[ chinese_simplified ] = "¼";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wydarzenia";
+ Text[ japanese ] = "s_@";
+ Text[ chinese_traditional ] = "ʧ@";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̺Ʈ";
+ Text[ turkish ] = "lemler";
+ Text[ language_user1 ] = " ";
+ };
+ };
+ };
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Konfiguracja";
+ Text[ japanese ] = "ݒ";
+ Text[ chinese_traditional ] = "tm";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "zelletir";
+ Text[ language_user1 ] = " ";
+};
+ // Strings ---------------------------------------------------------------
+String STR_NEW
+{
+ Text = "Neu" ;
+ Text [ ENGLISH ] = "New" ;
+ Text [ norwegian ] = "Ny" ;
+ Text [ italian ] = "Nuovo" ;
+ Text [ portuguese_brazilian ] = "Novo" ;
+ Text [ portuguese ] = "Novo" ;
+ Text [ finnish ] = "Uusi" ;
+ Text [ danish ] = "Ny" ;
+ Text [ french ] = "Nouveau" ;
+ Text [ swedish ] = "Nytt" ;
+ Text [ dutch ] = "Nieuw" ;
+ Text [ spanish ] = "Nuevo" ;
+ Text [ english_us ] = "New" ;
+ Text[ chinese_simplified ] = "½";
+ Text[ russian ] = "";
+ Text[ polish ] = "Nowy";
+ Text[ japanese ] = "VK쐬";
+ Text[ chinese_traditional ] = "}ҷs";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Yeni";
+ Text[ language_user1 ] = " ";
+};
+String STR_OPEN
+{
+ /* ### ACHTUNG: Neuer Text in Resource? ffnen : ffnen */
+ /* ### ACHTUNG: Neuer Text in Resource? ffnen : ffnen */
+ Text = "ffnen" ;
+ Text [ ENGLISH ] = "Open" ;
+ Text [ norwegian ] = "pne" ;
+ Text [ italian ] = "Apri" ;
+ Text [ portuguese_brazilian ] = "Abrir" ;
+ Text [ portuguese ] = "Abrir" ;
+ Text [ finnish ] = "Avaa" ;
+ Text [ danish ] = "bn" ;
+ Text [ french ] = "Ouvrir" ;
+ Text [ swedish ] = "ppna" ;
+ Text [ dutch ] = "Openen" ;
+ Text [ spanish ] = "Abrir" ;
+ Text [ english_us ] = "Open" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Otwrz";
+ Text[ japanese ] = "J";
+ Text[ chinese_traditional ] = "}";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "A";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVE
+{
+ Text = "Speichern" ;
+ Text [ ENGLISH ] = "Save" ;
+ Text [ norwegian ] = "Save" ;
+ Text [ italian ] = "Salva" ;
+ Text [ portuguese_brazilian ] = "Gravar" ;
+ Text [ portuguese ] = "Guardar" ;
+ Text [ finnish ] = "Tallennus" ;
+ Text [ danish ] = "Gem" ;
+ Text [ french ] = "Enregistrer" ;
+ Text [ swedish ] = "Spara" ;
+ Text [ dutch ] = "Opslaan" ;
+ Text [ spanish ] = "Guardar" ;
+ Text [ english_us ] = "Save" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zapisz";
+ Text[ japanese ] = "ۑ";
+ Text[ chinese_traditional ] = "xs";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Kaydet";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVEAS
+{
+ Text = "Speichern als" ;
+ Text [ ENGLISH ] = "Save as" ;
+ Text [ norwegian ] = "Lagre som" ;
+ Text [ italian ] = "Salva con nome" ;
+ Text [ portuguese_brazilian ] = "Gravar como" ;
+ Text [ portuguese ] = "Guardar como" ;
+ Text [ finnish ] = "Tallenna nimell" ;
+ Text [ danish ] = "Gem som" ;
+ Text [ french ] = "Enregistrer sous" ;
+ Text [ swedish ] = "Spara som" ;
+ Text [ dutch ] = "Opslaan als" ;
+ Text [ spanish ] = "Guardar como" ;
+ Text [ english_us ] = "Save As" ;
+ Text[ chinese_simplified ] = "Ϊ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz jako";
+ Text[ japanese ] = "Otĕۑ";
+ Text[ chinese_traditional ] = "tss";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ٸ ̸ ";
+ Text[ turkish ] = "Farkl kaydet";
+ Text[ language_user1 ] = " ";
+};
+String STR_PRINT
+{
+ Text = "Drucken" ;
+ Text [ ENGLISH ] = "Print" ;
+ Text [ norwegian ] = "Skriv ut" ;
+ Text [ italian ] = "Stampa" ;
+ Text [ portuguese_brazilian ] = "Imprimir" ;
+ Text [ portuguese ] = "Imprimir" ;
+ Text [ finnish ] = "Tulosta" ;
+ Text [ danish ] = "Udskriv" ;
+ Text [ french ] = "Imprimer" ;
+ Text [ swedish ] = "Skriv ut" ;
+ Text [ dutch ] = "Afdrukken" ;
+ Text [ spanish ] = "Imprimir" ;
+ Text [ english_us ] = "Print" ;
+ Text[ chinese_simplified ] = "ӡ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Drukuj";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "CL";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "μ";
+ Text[ turkish ] = "Yazdr";
+ Text[ language_user1 ] = " ";
+};
+String STR_QUIT
+{
+ Text = "Beenden" ;
+ Text [ ENGLISH ] = "Quit" ;
+ Text [ norwegian ] = "Avslutt" ;
+ Text [ italian ] = "Esci" ;
+ Text [ portuguese_brazilian ] = "Sair" ;
+ Text [ portuguese ] = "Sair" ;
+ Text [ finnish ] = "Lopeta" ;
+ Text [ danish ] = "Afslut" ;
+ Text [ french ] = "Quitter" ;
+ Text [ swedish ] = "Avsluta" ;
+ Text [ dutch ] = "Sluiten" ;
+ Text [ spanish ] = "Terminar" ;
+ Text [ english_us ] = "Exit" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zakocz";
+ Text[ japanese ] = "I";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Kapat";
+ Text[ language_user1 ] = " ";
+};
+String STR_CUT
+{
+ Text = "Ausschneiden" ;
+ Text [ ENGLISH ] = "Cut" ;
+ Text [ norwegian ] = "Cut" ;
+ Text [ italian ] = "Taglia" ;
+ Text [ portuguese_brazilian ] = "Recortar" ;
+ Text [ portuguese ] = "Cortar" ;
+ Text [ finnish ] = "Leikkaa" ;
+ Text [ danish ] = "Klip" ;
+ Text [ french ] = "Couper" ;
+ Text [ swedish ] = "Klipp ut" ;
+ Text [ dutch ] = "Knippen" ;
+ Text [ spanish ] = "Cortar" ;
+ Text [ english_us ] = "Cut" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wytnij";
+ Text[ japanese ] = "؂";
+ Text[ chinese_traditional ] = "ŤU";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "߶󳻱";
+ Text[ turkish ] = "Kes";
+ Text[ language_user1 ] = " ";
+};
+String STR_COPY
+{
+ Text = "Kopieren" ;
+ Text [ ENGLISH ] = "Copy" ;
+ Text [ norwegian ] = "Kopi" ;
+ Text [ italian ] = "Copia" ;
+ Text [ portuguese_brazilian ] = "Copiar" ;
+ Text [ portuguese ] = "Copiar" ;
+ Text [ finnish ] = "Kopioi" ;
+ Text [ danish ] = "Kopier" ;
+ Text [ french ] = "Copier" ;
+ Text [ swedish ] = "Kopiera" ;
+ Text [ dutch ] = "Kopiren" ;
+ Text [ spanish ] = "Copiar" ;
+ Text [ english_us ] = "Copy" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Kopiuj";
+ Text[ japanese ] = "߰";
+ Text[ chinese_traditional ] = "ƻs";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Kopyala";
+ Text[ language_user1 ] = " ";
+};
+String STR_PASTE
+{
+ /* ### ACHTUNG: Neuer Text in Resource? Einfgen : Einfgen */
+ /* ### ACHTUNG: Neuer Text in Resource? Einfgen : Einfgen */
+ Text = "Einfgen" ;
+ Text [ ENGLISH ] = "Paste" ;
+ Text [ norwegian ] = "Paste" ;
+ Text [ italian ] = "Incolla" ;
+ Text [ portuguese_brazilian ] = "Colar" ;
+ Text [ portuguese ] = "Colar" ;
+ Text [ finnish ] = "Liit" ;
+ Text [ danish ] = "Indst" ;
+ Text [ french ] = "Coller" ;
+ Text [ swedish ] = "Klistra in" ;
+ Text [ dutch ] = "Invoegen" ;
+ Text [ spanish ] = "Pegar" ;
+ Text [ english_us ] = "Paste" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wklej";
+ Text[ japanese ] = "\\t";
+ Text[ chinese_traditional ] = "J";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ٿ ֱ";
+ Text[ turkish ] = "Yaptr";
+ Text[ language_user1 ] = " ";
+};
+String STR_DELETE
+{
+ /* ### ACHTUNG: Neuer Text in Resource? Lschen : Lschen */
+ /* ### ACHTUNG: Neuer Text in Resource? Lschen : Lschen */
+ Text = "Lschen" ;
+ Text [ ENGLISH ] = "Delete" ;
+ Text [ norwegian ] = "Slett" ;
+ Text [ italian ] = "Elimina" ;
+ Text [ portuguese_brazilian ] = "Apagar" ;
+ Text [ portuguese ] = "Eliminar" ;
+ Text [ finnish ] = "Poista" ;
+ Text [ danish ] = "Slet" ;
+ Text [ french ] = "Supprimer" ;
+ Text [ swedish ] = "Radera" ;
+ Text [ dutch ] = "Wissen" ;
+ Text [ spanish ] = "Eliminar" ;
+ Text [ english_us ] = "Delete" ;
+ Text[ chinese_simplified ] = "ɾ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Usu";
+ Text[ japanese ] = "폜";
+ Text[ chinese_traditional ] = "R";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Sil";
+ Text[ language_user1 ] = " ";
+};
+String STR_FIND
+{
+ Text = "Suchen" ;
+ Text [ ENGLISH ] = "Find" ;
+ Text [ norwegian ] = "Ske" ;
+ Text [ italian ] = "Cerca" ;
+ Text [ portuguese_brazilian ] = "Procurar" ;
+ Text [ portuguese ] = "Localizar" ;
+ Text [ finnish ] = "Etsi" ;
+ Text [ danish ] = "Sg" ;
+ Text [ french ] = "Rechercher" ;
+ Text [ swedish ] = "Sk" ;
+ Text [ dutch ] = "Zoeken" ;
+ Text [ spanish ] = "Buscar" ;
+ Text [ english_us ] = "Search" ;
+ Text[ chinese_simplified ] = "Ѱ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Szukaj";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "M";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ã";
+ Text[ turkish ] = "Ara";
+ Text[ language_user1 ] = " ";
+};
+String STR_FINDBACKWARD
+{
+ /* ### ACHTUNG: Neuer Text in Resource? Rckwrts suchen : Rckwrts suchen */
+ /* ### ACHTUNG: Neuer Text in Resource? Rckwrts suchen : Rckwrts suchen */
+ Text = "Rckwrts suchen" ;
+ Text [ ENGLISH ] = "Find backward" ;
+ Text [ norwegian ] = "Sk bakover" ;
+ Text [ italian ] = "Cerca all'indietro" ;
+ Text [ portuguese_brazilian ] = "Procurar Para Trs" ;
+ Text [ portuguese ] = "Localizar para trs" ;
+ Text [ finnish ] = "Etsi taaksepin" ;
+ Text [ danish ] = "Sg baglns" ;
+ Text [ french ] = "Recherche vers le haut" ;
+ Text [ swedish ] = "Sk bakt" ;
+ Text [ dutch ] = "Achterwaarts zoeken" ;
+ Text [ spanish ] = "Buscar hacia atrs" ;
+ Text [ english_us ] = "Search backward" ;
+ Text[ chinese_simplified ] = "Ѱ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Szukaj wstecz";
+ Text[ japanese ] = " ߂";
+ Text[ chinese_traditional ] = "VM";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ڷ ã";
+ Text[ turkish ] = "Geriye doru ara";
+ Text[ language_user1 ] = " ";
+};
+String STR_PROPERTIES
+{
+ Text = "Eigenschaften" ;
+ Text [ ENGLISH ] = "Properties" ;
+ Text [ norwegian ] = "Egenskaper" ;
+ Text [ italian ] = "Propriet" ;
+ Text [ portuguese_brazilian ] = "Propriedades" ;
+ Text [ portuguese ] = "Propriedades" ;
+ Text [ finnish ] = "Ominaisuudet" ;
+ Text [ danish ] = "Egenskaber" ;
+ Text [ french ] = "Proprits" ;
+ Text [ swedish ] = "Egenskaper" ;
+ Text [ dutch ] = "Eigenschappen" ;
+ Text [ spanish ] = "Propiedades" ;
+ Text [ english_us ] = "Properties" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Waciwoci";
+ Text[ japanese ] = "è";
+ Text[ chinese_traditional ] = "ݩ";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "zellikler";
+ Text[ language_user1 ] = " ";
+};
+String STR_FRONT
+{
+ Text = "Nach vorn" ;
+ Text [ ENGLISH ] = "Front" ;
+ Text [ norwegian ] = "Foran" ;
+ Text [ italian ] = "In avanti" ;
+ Text [ portuguese_brazilian ] = "Primeiro plano" ;
+ Text [ portuguese ] = "Para a frente" ;
+ Text [ finnish ] = "Edustalle" ;
+ Text [ danish ] = "Fremad" ;
+ Text [ french ] = "Premier plan" ;
+ Text [ swedish ] = "Framt" ;
+ Text [ dutch ] = "Naar voren" ;
+ Text [ spanish ] = "Primer plano" ;
+ Text [ english_us ] = "To front" ;
+ Text[ chinese_simplified ] = "ǰ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Do przodu";
+ Text[ japanese ] = "O";
+ Text[ chinese_traditional ] = "Ve";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "";
+ Text[ turkish ] = "leri";
+ Text[ language_user1 ] = " ";
+};
+ // MessageBoxes ----------------------------------------------------------
+QueryBox QBX_MNUCFG_UNDEFINED_FUNCTIONS
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ /* ### ACHTUNG: Neuer Text in Resource? Es existieren noch undefinierte Funktionen (???).\n\nWollen Sie diese Konfiguration trotzdem bernehmen? : Es existieren noch undefinierte Funktionen (???).\n\nWollen Sie diese Konfiguration trotzdem bernehmen? */
+ /* ### ACHTUNG: Neuer Text in Resource? Es existieren noch undefinierte Funktionen (???).\n\nWollen Sie diese Konfiguration trotzdem bernehmen? : Es existieren noch undefinierte Funktionen (???).\n\nWollen Sie diese Konfiguration trotzdem bernehmen? */
+ Message = "Es existieren noch undefinierte Funktionen (???).\n\nWollen Sie diese Konfiguration trotzdem bernehmen?" ;
+ Message [ ENGLISH ] = "There are still undefined functions (???).\n\nContinue anyway?" ;
+ Message [ norwegian ] = "Det er fremdeles udefinerte funksjoner are still undefined functions (???).\n\nFortsett likevel?" ;
+ Message [ italian ] = "Vi sono ancora funzioni non definite (???).\n\nContinuare lo stesso?" ;
+ Message [ portuguese_brazilian ] = "Ainda existem Funes indefinidas (???).\n\nContinuar de qualquer forma?" ;
+ Message [ portuguese ] = "Ainda existem funes indefinidas (???).\n\nDeseja continuar?" ;
+ Message [ finnish ] = "Mrittmttmi toimintoja on vielkin (???).\n\nJatketaanko silti?" ;
+ Message [ danish ] = "Der eksisterer stadig udefinerede funktioner (???).\n\nVil du overtage denne konfiguration alligevel?" ;
+ Message [ french ] = "Certaines fonctions n'ont pas t dfinies (???).\n\nPoursuivre malgr tout ?" ;
+ Message [ swedish ] = "Det finns fortfarande odefinierade funktioner (???). \n\nVill Du nd verta den hr konfigurationen?" ;
+ Message [ dutch ] = "Er zijn nog ongedefinieerde functies (???).\n\nWilt u deze configuratie toch overnemen?" ;
+ Message [ spanish ] = "Todava hay funciones no definidas (???).\n\nDesea de todas formas aceptar esta configuracin?" ;
+ Message [ english_us ] = "There are still undefined functions (???).\n\nDo you want to accept the configuration anyway?" ;
+ Message[ chinese_simplified ] = "δĹܡ\n\nҪ";
+ Message[ russian ] = " , (???).\n\n ?";
+ Message[ polish ] = "Istniej jeszcze nie zdefiniowane funkcje (???).\n\nCzy akceptujesz mimo to t konfiguracj?";
+ Message[ japanese ] = "܂`ĂȂ@\\܂(???)\n\n̐ݒKĂłH";
+ Message[ chinese_traditional ] = "٦sbwq\\C\n\n٬OnoӰtmH";
+ Message[ arabic ] = " (???).\n\n ߿";
+ Message[ greek ] = " (???).\n\n ;";
+ Message[ korean ] = "ǵ ɵ ֽϴ. (???).\n\n׷ Ͻðڽϱ?";
+ Message[ turkish ] = "Hala tanmlanmam ilevler mevcut (???).\n\nBu konfigrasyonu yine de kabul etmek istiyor musunuz?";
+ Message[ language_user1 ] = " ";
+};
+QueryBox QBX_MNUCFG_POPUP_FUNCTIONS
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ /* ### ACHTUNG: Neuer Text in Resource? Es existieren noch Eintrge mit Funktionen, die nur Popups zugewiesen werden knnen.\n\nWollen Sie diese Konfiguration trotzdem bernehmen? : Es existieren noch Eintrge mit Funktionen, die nur Popups zugewiesen werden knnen.\n\nWollen Sie diese Konfiguration trotzdem bernehmen? */
+ /* ### ACHTUNG: Neuer Text in Resource? Es existieren noch Eintrge mit Funktionen, die nur Popups zugewiesen werden knnen.\n\nWollen Sie diese Konfiguration trotzdem bernehmen? : Es existieren noch Eintrge mit Funktionen, die nur Popups zugewiesen werden knnen.\n\nWollen Sie diese Konfiguration trotzdem bernehmen? */
+ Message = "Es existieren noch Eintrge mit Funktionen, die nur Popups zugewiesen werden knnen.\n\nWollen Sie diese Konfiguration trotzdem bernehmen?" ;
+ Message [ ENGLISH ] = "There are still entries with functions that can only be assigned to popups.\n\nContinue anyway?" ;
+ Message [ norwegian ] = "Det er fremdeles oppfringer med funksjoner som bare kan tilordnes tilleggsmenyenps.\n\nFortsett likevel?" ;
+ Message [ italian ] = "Vi sono ancora voci con funzioni che possono essere assegnate solo a menu di scelta rapida.\n\nContinuare lo stesso?" ;
+ Message [ portuguese_brazilian ] = "Existem entradas com Funes que s podem ser atribuidas a popupps.\n\nContinuar de qualquer forma?" ;
+ Message [ portuguese ] = "Existem ainda entradas com funes que s podem ser atribudas a janelas instantneas.\n\nContinuar?" ;
+ Message [ finnish ] = "Luettelossa on vielkin toimintoja, jotka voidaan liitt vain kohovalikoihin..\n\nJatketaanko silti?" ;
+ Message [ danish ] = "Der findes stadig elementer med funktioner, som kun kan tildeles popups.\n\nVil du overtage denne konfiguration alligevel?" ;
+ Message [ french ] = "Certaines entres sont encore associes des fonctions rserves des menus droulants\n\nPoursuivre malgr tout ?" ;
+ Message [ swedish ] = "Det finns fortfarande poster med funktioner som bara kan tilldelas popups.\n\nVill Du nd verta den hr konfigurationen?" ;
+ Message [ dutch ] = "Er zijn nog items met functies die alleen aan popups kunnen worden toegewezen.\n\nWilt u deze configuratie toch overnemen?" ;
+ Message [ spanish ] = "Todava hay entradas con funciones que solo pueden ser asignadas a emergentes.\n\nDesea continuar de todos modos?" ;
+ Message [ english_us ] = "There are still entries with functions that can only be assigned to pop-ups.\n\nContinue anyway?" ;
+ Message[ chinese_simplified ] = "һЩָֻʽ˵ִеľijֹܵĿ\nҪ";
+ Message[ russian ] = " , .\n\n ?";
+ Message[ polish ] = "Istniej jeszcze wpisy, ktre mog zosta przypisane tylko oknom typu popup. n\nCzy chcesz mimo to zastosowa t konfiguracj?";
+ Message[ japanese ] = "܂߯߱߂݂̂Ɋ蓖Ă@\\̍ڂ܂B\n\n̐ݒKpĂł?";
+ Message[ chinese_traditional ] = "٦sb@ǥuwֳt\\檺㦳Yإ\\઺ءC\nz٬OnoӰtmH";
+ Message[ arabic ] = " .\n\n ߿";
+ Message[ greek ] = " .\n\n ;";
+ Message[ korean ] = "˾ ִ ɵ ׸ ֽϴ. \n\n׷ Ͻðڽϱ?";
+ Message[ turkish ] = "Yalnzca alan mnlere atanabilen ilevleri olan giriler mevcut.\n\nBu konfigrasyon ile devam etmek istiyor musunuz?";
+ Message[ language_user1 ] = " ";
+};
+InfoBox IBX_MNUCFG_ALREADY_INCLUDED
+{
+ Message = "Die Funktion ist bereits in diesem Popup enthalten." ;
+ Message [ ENGLISH ] = "Function is already included in this popup." ;
+ Message [ norwegian ] = "Funksjon er allerede inkludert i denne tilleggsmenyen." ;
+ Message [ italian ] = "Funzione gi inclusa in questo elenco." ;
+ Message [ portuguese_brazilian ] = "A funo j est includa neste popup." ;
+ Message [ portuguese ] = "A funo j est includa neste menu instantneo." ;
+ Message [ finnish ] = "Toiminto on jo listty thn kohovalikkoon." ;
+ Message [ danish ] = "Funktionen er allerede indeholdt i denne popup." ;
+ Message [ french ] = "Cette fonction est dj incluse dans la liste Menu." ;
+ Message [ swedish ] = "Funktionen ingr redan i denna snabbmeny." ;
+ Message [ dutch ] = "Deze functie komt al voor in dit menu." ;
+ Message [ spanish ] = "La funcin ya est incluida en este emergente." ;
+ Message [ english_us ] = "Function is already included in this popup." ;
+ Message[ chinese_simplified ] = "ʽ˵Ѿܡ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Ta funkcja jest ju zawarta w menu podrcznym.";
+ Message[ japanese ] = "@\\͂łɂ߯߱߂Ɋ܂܂Ă܂B";
+ Message[ chinese_traditional ] = "oӧֳt\\wg]tFoӥ\\C";
+ Message[ arabic ] = " .";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ̹ ˾ ԵǾ ֽϴ.";
+ Message[ turkish ] = "lev zaten bu alan mnde mevcut.";
+ Message[ language_user1 ] = " ";
+};
+String STR_LOADMENUCONFIG
+{
+ /* ### ACHTUNG: Neuer Text in Resource? Menkonfiguration laden : Menkonfiguration laden */
+ /* ### ACHTUNG: Neuer Text in Resource? Menkonfiguration laden : Menkonfiguration laden */
+ Text = "Menkonfiguration laden" ;
+ Text [ ENGLISH ] = "Load Menu Configuration" ;
+ Text [ english_us ] = "Load Menu Configuration" ;
+ Text [ italian ] = "Carica configurazione menu" ;
+ Text [ spanish ] = "Cargar configuracin del men" ;
+ Text [ french ] = "Charger config. du menu" ;
+ Text [ dutch ] = "Menuconfiguratie laden" ;
+ Text [ swedish ] = "Ladda menykonfiguration" ;
+ Text [ danish ] = "Indls menukonfiguration" ;
+ Text [ portuguese_brazilian ] = "Menkonfiguration laden" ;
+ Text [ portuguese ] = "Carregar configurao do menu" ;
+ Text[ chinese_simplified ] = "װز˵";
+ Text[ russian ] = " ";
+ Text[ polish ] = "aduj konfiguracj menu";
+ Text[ japanese ] = "ƭݒ̓ǂݍ";
+ Text[ chinese_traditional ] = "˸\\tm";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "޴ ε";
+ Text[ turkish ] = "Mn konfigrasyonunu ykle";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVEMENUCONFIG
+{
+ Text = "Menkonfiguration speichern" ;
+ Text [ ENGLISH ] = "Save Menu Configuration" ;
+ Text [ english_us ] = "Save Menu Configuration" ;
+ Text [ italian ] = "Salva configurazione menu" ;
+ Text [ spanish ] = "Guardar configuracin del men" ;
+ Text [ french ] = "Enregistrer la configuration du menu" ;
+ Text [ dutch ] = "Menuconfiguratie opslaan" ;
+ Text [ swedish ] = "Spara menykonfiguration" ;
+ Text [ danish ] = "Gem menukonfiguration" ;
+ Text [ portuguese_brazilian ] = "Menkonfiguration speichern" ;
+ Text [ portuguese ] = "Guardar configurao do menu" ;
+ Text[ chinese_simplified ] = "̲˵";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz konfiguracj menu";
+ Text[ japanese ] = "ƭݒ̏㏑ۑ";
+ Text[ chinese_traditional ] = "xstm";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "޴ ";
+ Text[ turkish ] = "Mn konfigrasyonunu kaydet";
+};
+String STR_LOADACCELCONFIG
+{
+ Text = "Tastaturkonfiguration laden" ;
+ Text [ ENGLISH ] = "Load Keyboard Configuration" ;
+ Text [ dutch ] = "Tastatuurconfiguratie laden" ;
+ Text [ english_us ] = "Load Keyboard Configuration" ;
+ Text [ italian ] = "Carica configurazione tastiera" ;
+ Text [ spanish ] = "Cargar configuracin del teclado" ;
+ Text [ french ] = "Charger configuration du clavier" ;
+ Text [ swedish ] = "Ladda tangentbordskonfiguration" ;
+ Text [ danish ] = "Indls tastaturkonfiguration" ;
+ Text [ portuguese_brazilian ] = "Tastaturkonfiguration laden" ;
+ Text [ portuguese ] = "Carregar configurao do teclado" ;
+ Text[ chinese_simplified ] = "װؼ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "aduj konfiguracj klawiatury";
+ Text[ japanese ] = "ްސݒ̓ǂݍ";
+ Text[ chinese_traditional ] = "˸Ltm";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Ű ε";
+ Text[ turkish ] = "Klavye konfigrasyonunu ykle";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVEACCELCONFIG
+{
+ Text = "Tastaturkonfiguration speichern" ;
+ Text [ ENGLISH ] = "Save Keyboard Configuration" ;
+ Text [ english_us ] = "Save Keyboard Configuration" ;
+ Text [ italian ] = "Salva configurazione tastiera" ;
+ Text [ spanish ] = "Guardar configuracin del teclado" ;
+ Text [ french ] = "Enregistrer la configuration du clavier" ;
+ Text [ dutch ] = "Toetsenbordconfiguratie opslaan" ;
+ Text [ swedish ] = "Spara tangentbordskonfiguration" ;
+ Text [ danish ] = "Gem tastaturkonfiguration" ;
+ Text [ portuguese_brazilian ] = "Tastaturkonfiguration speichern" ;
+ Text [ portuguese ] = "Guardar configurao do teclado" ;
+ Text[ chinese_simplified ] = "̼";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz konfiguracj klawiatury";
+ Text[ japanese ] = "ްސݒ̏㏑ۑ";
+ Text[ chinese_traditional ] = "xsLtm";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Ű屸 ";
+ Text[ turkish ] = "Klavye konfigrasyonunu kaydet";
+};
+String STR_LOADSTATBARCONFIG
+{
+ Text = "Statusleistenkonfiguration laden" ;
+ Text [ ENGLISH ] = "Load Statusbar Configuration" ;
+ Text [ dutch ] = "Statusballk-configuratie laden" ;
+ Text [ english_us ] = "Load Status Bar Configuration" ;
+ Text [ italian ] = "Carica configurazione barra di stato" ;
+ Text [ spanish ] = "Cargar configuracin de la barra de estado" ;
+ Text [ french ] = "Chargement de la configuration de la barre d'tat" ;
+ Text [ swedish ] = "Ladda statuslistkonfiguration" ;
+ Text [ danish ] = "Indls statuslinjekonfiguration" ;
+ Text [ portuguese_brazilian ] = "Statusleistenkonfiguration laden" ;
+ Text [ portuguese ] = "Carregar configurao da barra de estado" ;
+ Text[ chinese_simplified ] = "װ״̬";
+ Text[ russian ] = " ";
+ Text[ polish ] = "aduj konfiguracj paska stanu";
+ Text[ japanese ] = "ð ްݒ̓ǂݍ";
+ Text[ chinese_traditional ] = "˸ACtm";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "¸ ε";
+ Text[ turkish ] = "Durum ubuu konfigrasyonunu ykle";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVESTATBARCONFIG
+{
+ Text = "Statusleistenkonfiguration speichern" ;
+ Text [ ENGLISH ] = "Save Statusbar Configuration" ;
+ Text [ english_us ] = "Save Status Bar Configuration" ;
+ Text [ italian ] = "Salva configurazione barra di stato" ;
+ Text [ spanish ] = "Guardar configuracin de la barra de estado" ;
+ Text [ french ] = "Enregistrer la configuration de la barre d'tat" ;
+ Text [ dutch ] = "Statusbalkconfiguratie opslaan" ;
+ Text [ swedish ] = "Spara statuslistkonfiguration" ;
+ Text [ danish ] = "Gem statuslinjekonfiguration" ;
+ Text [ portuguese_brazilian ] = "Statusleistenkonfiguration speichern" ;
+ Text [ portuguese ] = "Guardar configurao da barra de estado" ;
+ Text[ chinese_simplified ] = "״̬";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz konfiguracj paska stanu";
+ Text[ japanese ] = "ð ްݒ̏㏑ۑ";
+ Text[ chinese_traditional ] = "xsAtm";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "¸ ";
+ Text[ turkish ] = "Durum ubuu konfigrasyonunu kaydet";
+};
+String STR_MENU
+{
+ Text = "Men" ;
+ Text [ ENGLISH ] = "Menu" ;
+ Text [ english_us ] = "Menu" ;
+ Text [ swedish ] = "Meny" ;
+ Text [ danish ] = "Menu" ;
+ Text [ italian ] = "Menu" ;
+ Text [ spanish ] = "Men" ;
+ Text [ french ] = "Menu" ;
+ Text [ dutch ] = "Menu" ;
+ Text [ portuguese_brazilian ] = "Men" ;
+ Text [ portuguese ] = "Menu" ;
+ Text[ chinese_simplified ] = "˵";
+ Text[ russian ] = "";
+ Text[ polish ] = "Menu";
+ Text[ japanese ] = "ƭ";
+ Text[ chinese_traditional ] = "\\";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "޴";
+ Text[ turkish ] = "Mn";
+ Text[ language_user1 ] = " ";
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/dialog/dialog.hrc b/sfx2/source/dialog/dialog.hrc
new file mode 100644
index 000000000000..7d68879db823
--- /dev/null
+++ b/sfx2/source/dialog/dialog.hrc
@@ -0,0 +1,184 @@
+/*************************************************************************
+ *
+ * $RCSfile: dialog.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_DIALOG_HRC
+#define _SFX_DIALOG_HRC
+
+#include "sfx.hrc"
+
+// defines ---------------------------------------------------------------
+
+#define ID_NEW 1
+#define ID_EDIT 2
+#define ID_DELETE 3
+
+#define RC_DIALOG_BEGIN RID_SFX_DIALOG_START
+
+#define STR_RESET ( RC_DIALOG_BEGIN + 0)
+#define STR_BASEFMT ( RC_DIALOG_BEGIN + 1)
+
+#define CB_USE_PASSWD ( RC_DIALOG_BEGIN + 2)
+#define CB_READ_ONLY ( RC_DIALOG_BEGIN + 3)
+#define BTN_MANAGER ( RC_DIALOG_BEGIN + 4)
+#define BTN_STANDARD ( RC_DIALOG_BEGIN + 5)
+#define STR_PATH_NOT_FOUND1 ( RC_DIALOG_BEGIN + 6)
+#define STR_PATH_NOT_FOUND2 ( RC_DIALOG_BEGIN + 7)
+#define DLG_PASSWD ( RC_DIALOG_BEGIN + 8)
+#define STR_FILEDLG_INSERT ( RC_DIALOG_BEGIN + 10)
+#define STR_TABPAGE_MANAGESTYLES ( RC_DIALOG_BEGIN + 12)
+#define MSG_TABPAGE_INVALIDNAME ( RC_DIALOG_BEGIN + 13)
+#define MSG_TABPAGE_INVALIDSTYLE ( RC_DIALOG_BEGIN + 14)
+#define DLG_NEW_STYLE_BY_EXAMPLE ( RC_DIALOG_BEGIN + 15)
+#define MSG_POOL_STYLE_NAME ( RC_DIALOG_BEGIN + 16)
+#define MSG_OVERWRITE_STYLE ( RC_DIALOG_BEGIN + 17)
+#define MSG_TABPAGE_INVALIDPARENT ( RC_DIALOG_BEGIN + 18)
+
+#define STR_DELETE_STYLE ( RC_DIALOG_BEGIN + 18)
+#define STR_DELETE_STYLE_USED ( RC_DIALOG_BEGIN + 20)
+
+#define BMP_COLLAPSED ( RC_DIALOG_BEGIN + 18)
+#define BMP_EXPANDED ( RC_DIALOG_BEGIN + 19)
+
+#define TP_CONFIG_ACCEL ( RC_DIALOG_BEGIN + 20)
+#define TP_CONFIG_MENU ( RC_DIALOG_BEGIN + 21)
+#define TP_CONFIG_STATBAR ( RC_DIALOG_BEGIN + 22)
+#define TP_CONFIG_OBJECTBAR ( RC_DIALOG_BEGIN + 31)
+#define TP_CONFIG_EVENT ( RC_DIALOG_BEGIN + 32)
+#define DLG_CONFIG ( RC_DIALOG_BEGIN + 23)
+
+#define IBX_MNUCFG_ALREADY_INCLUDED ( RC_DIALOG_BEGIN + 24)
+#define QBX_MNUCFG_UNDEFINED_FUNCTIONS ( RC_DIALOG_BEGIN + 25)
+#define QBX_MNUCFG_POPUP_FUNCTIONS ( RC_DIALOG_BEGIN + 26)
+
+#define STR_NEW ( RC_DIALOG_BEGIN + 27)
+#define STR_OPEN ( RC_DIALOG_BEGIN + 28)
+#define STR_SAVE ( RC_DIALOG_BEGIN + 29)
+#define STR_SAVEAS ( RC_DIALOG_BEGIN + 30)
+#define STR_PRINT ( RC_DIALOG_BEGIN + 32)
+#define STR_QUIT ( RC_DIALOG_BEGIN + 33)
+#define STR_CUT ( RC_DIALOG_BEGIN + 34)
+#define STR_COPY ( RC_DIALOG_BEGIN + 35)
+#define STR_PASTE ( RC_DIALOG_BEGIN + 36)
+#define STR_DELETE ( RC_DIALOG_BEGIN + 39)
+#define STR_FIND ( RC_DIALOG_BEGIN + 41)
+#define STR_FINDBACKWARD ( RC_DIALOG_BEGIN + 42)
+#define STR_PROPERTIES ( RC_DIALOG_BEGIN + 43)
+#define STR_FRONT ( RC_DIALOG_BEGIN + 44)
+#define STR_BASICMACROS ( RC_DIALOG_BEGIN + 45)
+#define STR_MENU ( RC_DIALOG_BEGIN + 46)
+
+#define LOGO_IMAGELIST ( RC_DIALOG_BEGIN + 45)
+#define MN_CONTEXT_TEMPLDLG ( RC_DIALOG_BEGIN + 46)
+
+#define MSG_LAYOUT_NOT_LOADING ( RC_DIALOG_BEGIN + 49)
+#define ACC_LAYOUT_NOT_LOADING ( RC_DIALOG_BEGIN + 50)
+
+#define STR_LOADMENUCONFIG ( RC_DIALOG_BEGIN + 53)
+#define STR_SAVEMENUCONFIG ( RC_DIALOG_BEGIN + 54)
+
+#define STR_LOADACCELCONFIG ( RC_DIALOG_BEGIN + 55)
+#define STR_SAVEACCELCONFIG ( RC_DIALOG_BEGIN + 56)
+
+#define STR_LOADSTATBARCONFIG ( RC_DIALOG_BEGIN + 57)
+#define STR_SAVESTATBARCONFIG ( RC_DIALOG_BEGIN + 58)
+
+#define MSG_ERR_CANT_EDIT_OLD_FORMAT ( RC_DIALOG_BEGIN + 60 )
+#define MSG_ERR_CANT_EDIT_OPEN_DOCS ( RC_DIALOG_BEGIN + 61 )
+
+#define RID_URLOPEN ( RC_DIALOG_BEGIN + 62 )
+#define RID_URLOPEN_OK 1
+#define RID_URLOPEN_CANCEL 2
+#define RID_URLOPEN_URL 3
+
+#define CB_FILE ( RC_DIALOG_BEGIN + 63 )
+#define CB_URL ( RC_DIALOG_BEGIN + 64 )
+
+#define STR_INTERNET ( RC_DIALOG_BEGIN + 65 )
+#define RID_AUTOHIDE ( RC_DIALOG_BEGIN + 66 )
+
+#define RID_SFX_TP_MACROASSIGN ( RC_DIALOG_BEGIN + 67 )
+
+#define DLG_ONLINE_REGISTER ( RC_DIALOG_BEGIN + 68 )
+#define DLG_VERSIONS ( RC_DIALOG_BEGIN + 69 )
+#define DLG_COMMENTS ( RC_DIALOG_BEGIN + 70 )
+
+#define RID_SFX_SMALLTP_MACROASSIGN ( RC_DIALOG_BEGIN + 71 )
+#define DLG_RUN ( RC_DIALOG_BEGIN + 72 )
+#define RID_REGISTER_DLG ( RC_DIALOG_BEGIN + 73 )
+#define DLG_PHONE_CONFIGURATION ( RC_DIALOG_BEGIN + 74 )
+#define DLG_RECOGNIZER_ENGINEMODE ( RC_DIALOG_BEGIN + 75 )
+#define MSG_ERROR_WRONG_CONFIRM ( RC_DIALOG_BEGIN + 76 )
+#define DLG_RECOGNIZER_SPEAKER ( RC_DIALOG_BEGIN + 77 )
+
+// mail
+#define RID_MAIL_WINDOW ( RC_DIALOG_BEGIN + 78 )
+#define RID_ERRBOX_NO_SMTPSERVER ( RC_DIALOG_BEGIN + 79 )
+#define RID_INFBOX_SEND_SUCCESS ( RC_DIALOG_BEGIN + 80 )
+#define RID_ERRBOX_SEND_FAILED ( RC_DIALOG_BEGIN + 81 )
+#define RID_STR_CLOSE_TITLE ( RC_DIALOG_BEGIN + 82 )
+#define RID_STR_CLOSE_MESSAGE ( RC_DIALOG_BEGIN + 83 )
+#define RID_STR_CLOSE_BTN_SEND ( RC_DIALOG_BEGIN + 84 )
+#define RID_STR_CLOSE_BTN_REJECT ( RC_DIALOG_BEGIN + 85 )
+#define RID_STR_CLOSE_BTN_BACKTOMSG ( RC_DIALOG_BEGIN + 86 )
+
+#endif // #ifndef _SFX_DIALOG_HRC
+
+// eof ------------------------------------------------------------------------
+
diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src
new file mode 100644
index 000000000000..a81af3881db9
--- /dev/null
+++ b/sfx2/source/dialog/dialog.src
@@ -0,0 +1,1028 @@
+/*************************************************************************
+ *
+ * $RCSfile: dialog.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "dialog.hrc"
+#include "helpid.hrc"
+#include "sfxlocal.hrc"
+
+ // Imageliste fuer die AboutBox
+ImageList LOGO_IMAGELIST
+{
+ ImageBitmap = Bitmap { File = "ani_logo.bmp" ; };
+ MaskColor = Color
+ {
+ Red = 0xC000 ;
+ Green = 0xC000 ;
+ Blue = 0xC000 ;
+ };
+ IdList =
+ {
+ 1 ;
+ 2 ;
+ 3 ;
+ 4 ;
+ 5 ;
+ 6 ;
+ };
+ IdCount =
+ {
+ 6 ;
+ };
+};
+String STR_RESET
+{
+ TEXT = "~Zurck" ;
+ TEXT [ ENGLISH ] = "~Reset" ;
+ TEXT [ norwegian ] = "~Still inn p nytt" ;
+ TEXT [ italian ] = "~Ripristina" ;
+ TEXT [ portuguese_brazilian ] = "~Redefinir" ;
+ TEXT [ portuguese ] = "~Repor" ;
+ TEXT [ finnish ] = "~Palauta" ;
+ TEXT [ danish ] = "Tilbage" ;
+ TEXT [ french ] = "~Rinitialisation" ;
+ TEXT [ swedish ] = "terst~ll" ;
+ TEXT [ dutch ] = "~Vorige" ;
+ TEXT [ spanish ] = "~Restablecer" ;
+ TEXT [ english_us ] = "~Reset" ;
+ TEXT[ chinese_simplified ] = "(~R)";
+ TEXT[ russian ] = "~";
+ TEXT[ polish ] = "Zresetuj";
+ TEXT[ japanese ] = "ɖ߂(~R)";
+ TEXT[ chinese_traditional ] = "^(~R)";
+ TEXT[ arabic ] = " ";
+ TEXT[ greek ] = "";
+ TEXT[ korean ] = "(~R)";
+ TEXT[ turkish ] = "~Geri";
+ TEXT[ language_user1 ] = " ";
+};
+String STR_INTERNET
+{
+ TEXT = " (Internet)" ;
+ TEXT [ ENGLISH ] = " (Internet)" ;
+ Text [ english_us ] = "(Internet)" ;
+ Text [ italian ] = "(Internet)" ;
+ Text [ spanish ] = "(Internet)" ;
+ Text [ french ] = "(Internet)" ;
+ Text [ dutch ] = "(Internet)" ;
+ Text [ swedish ] = "(Internet)" ;
+ Text [ danish ] = "(Internet)" ;
+ Text [ portuguese ] = "(Internet)" ;
+ Text [ portuguese_brazilian ] = "(Internet)" ;
+ Text[ chinese_simplified ] = "(ʻ)";
+ Text[ russian ] = "()";
+ Text[ polish ] = "(Internet)";
+ Text[ japanese ] = "(ȯ)";
+ Text[ chinese_traditional ] = "(Internet)";
+ Text[ arabic ] = "()";
+ Text[ greek ] = "(Internet)";
+ Text[ korean ] = "(ͳ)";
+ Text[ turkish ] = "(Internet)";
+ Text[ language_user1 ] = " ";
+};
+String STR_BASEFMT
+{
+ Text = "~Basisformat" ;
+ Text [ ENGLISH ] = "Base format" ;
+ Text [ norwegian ] = "Basis format" ;
+ Text [ italian ] = "Formato di base" ;
+ Text [ portuguese_brazilian ] = "Formato Bsico" ;
+ Text [ portuguese ] = "Formato ~bsico" ;
+ Text [ finnish ] = "Perusmuoto" ;
+ Text [ danish ] = "Basisformat" ;
+ Text [ french ] = "Format de ~base" ;
+ Text [ swedish ] = "Grundformat" ;
+ Text [ dutch ] = "~Basisopmaak" ;
+ Text [ spanish ] = "Formato ~base" ;
+ Text [ english_us ] = "Base format" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Format bazy";
+ Text[ japanese ] = "ް";
+ Text[ chinese_traditional ] = "򥻮榡";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "⺻";
+ Text[ turkish ] = "Temel format";
+ Text[ language_user1 ] = " ";
+};
+CheckBox CB_USE_PASSWD
+{
+ HelpId = HID_FILEDLG_USE_PASSWD ;
+ Text = "~Passwort" ;
+ Text [ ENGLISH ] = "~Password" ;
+ Text [ norwegian ] = "~Passord" ;
+ Text [ italian ] = "~Password" ;
+ Text [ portuguese_brazilian ] = "~Senha" ;
+ Text [ portuguese ] = "~Senha" ;
+ Text [ finnish ] = "~Salasana" ;
+ Text [ danish ] = "Adangskode" ;
+ Text [ french ] = "~Mot de passe" ;
+ Text [ swedish ] = "Lsenord" ;
+ Text [ dutch ] = "~Wachtwoord" ;
+ Text [ spanish ] = "~Contrasea" ;
+ Text [ english_us ] = "~Password" ;
+ Text[ chinese_simplified ] = "(~P)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Haso";
+ Text[ japanese ] = "߽ܰ(~P)";
+ Text[ chinese_traditional ] = "KX(~P)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "н(~P)";
+ Text[ turkish ] = "~ifre";
+ Text[ language_user1 ] = " ";
+};
+CheckBox CB_READ_ONLY
+{
+ HelpId = HID_FILEDLG_READ_ONLY ;
+ Text = "Nu~r lesen" ;
+ Text [ ENGLISH ] = "~Read only" ;
+ Text [ norwegian ] = "~Skrivebeskyttet" ;
+ Text [ italian ] = "~Sola lettura" ;
+ Text [ portuguese_brazilian ] = "~S leitura" ;
+ Text [ portuguese ] = "~S leitura" ;
+ Text [ finnish ] = "~Vain luku" ;
+ Text [ danish ] = "Skrivebeskyttet" ;
+ Text [ french ] = "En ~lecture seule" ;
+ Text [ swedish ] = "Sk~rivskyddad" ;
+ Text [ dutch ] = "~Alleen lezen" ;
+ Text [ spanish ] = "~Solo lectura" ;
+ Text [ english_us ] = "~Read only" ;
+ Text[ chinese_simplified ] = "ֻ(~R)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Tylko do odczytu";
+ Text[ japanese ] = "ǂݎp(~R)";
+ Text[ chinese_traditional ] = "Ū(~R)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "б⸸(~R)";
+ Text[ turkish ] = "Salt okunur";
+ Text[ language_user1 ] = " ";
+};
+PushButton CB_FILE
+{
+ HelpId = HID_FILEDLG_FILE ;
+ Text = "~Dateisystem" ;
+ Text [ ENGLISH ] = "~Filesystem" ;
+ Text [ english_us ] = "~File System" ;
+ Text [ italian ] = "File system" ;
+ Text [ spanish ] = "Sistema de ~archivos" ;
+ Text [ french ] = "Systme ~de fichiers" ;
+ Text [ dutch ] = "~Bestandsysteem" ;
+ Text [ swedish ] = "Fils~ystem" ;
+ Text [ danish ] = "Filsystem" ;
+ Text [ portuguese ] = "~Sistema de ficheiro" ;
+ Text [ portuguese_brazilian ] = "~Dateisystem" ;
+ Text[ chinese_simplified ] = "ļϵͳ(~F)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "System plikw";
+ Text[ japanese ] = "̧ټ(~F)";
+ Text[ chinese_traditional ] = "ɮרt(~F)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ý(~F)";
+ Text[ turkish ] = "Dosya sistemi";
+ Text[ language_user1 ] = " ";
+};
+PushButton CB_URL
+{
+ HelpId = HID_FILEDLG_URL ;
+ Text = "~Internet" ;
+ Text [ ENGLISH ] = "~Internet" ;
+ Text [ english_us ] = "Int~ernet" ;
+ Text [ italian ] = "~Internet" ;
+ Text [ spanish ] = "~Internet" ;
+ Text [ french ] = "~Internet" ;
+ Text [ dutch ] = "~Internet" ;
+ Text [ swedish ] = "~Internet" ;
+ Text [ danish ] = "~Internet" ;
+ Text [ portuguese ] = "~Internet" ;
+ Text [ portuguese_brazilian ] = "~Internet" ;
+ Text[ chinese_simplified ] = "ʻ(~E)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Internet";
+ Text[ japanese ] = "ȯ(~E)";
+ Text[ chinese_traditional ] = "Int~ernet";
+ Text[ arabic ] = "";
+ Text[ greek ] = "Internet";
+ Text[ korean ] = "ͳ(~E)";
+ Text[ turkish ] = "Internet";
+ Text[ language_user1 ] = " ";
+};
+PushButton BTN_MANAGER
+{
+ HelpId = HID_FILEDLG_MANAGER ;
+ Text = "~Manager..." ;
+ Text [ English ] = "~Manager..." ;
+ Text [ norwegian ] = "~Styrer..." ;
+ Text [ italian ] = "~Manager..." ;
+ Text [ portuguese_brazilian ] = "~Gerenciador..." ;
+ Text [ portuguese ] = "~Gestor..." ;
+ Text [ finnish ] = "~Hallinta..." ;
+ Text [ danish ] = "Manager..." ;
+ Text [ french ] = "~Gestionnaire..." ;
+ Text [ swedish ] = "Manager..." ;
+ Text [ dutch ] = "~Beheer..." ;
+ Text [ spanish ] = "~Administrador..." ;
+ Text [ english_us ] = "~Manager..." ;
+ Text[ chinese_simplified ] = "(~M)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Meneder...";
+ Text[ japanese ] = "Ȱެ(~M)...";
+ Text[ chinese_traditional ] = "޲z(~M)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "(~M)...";
+ Text[ turkish ] = "~Ynetici...";
+ Text[ language_user1 ] = " ";
+};
+PushButton BTN_STANDARD
+{
+ HelpId = HID_FILEDLG_STANDARD ;
+ Text = "Stan~dard" ;
+ Text [ English ] = "~Home" ;
+ Text [ norwegian ] = "~Home" ;
+ Text [ italian ] = "~Standard" ;
+ Text [ portuguese_brazilian ] = "~Casa" ;
+ Text [ portuguese ] = "~Padro" ;
+ Text [ finnish ] = "~Vakio" ;
+ Text [ danish ] = "Standa~rd" ;
+ Text [ french ] = "~Par dfaut" ;
+ Text [ swedish ] = "Stan~dard" ;
+ Text [ dutch ] = "~Standaard" ;
+ Text [ spanish ] = "~Predeterminado" ;
+ Text [ english_us ] = "~Home" ;
+ Text[ chinese_simplified ] = "׼(~H)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Standard";
+ Text[ japanese ] = "W";
+ Text[ chinese_traditional ] = "з(~H)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~H)";
+ Text[ turkish ] = "Standart";
+ Text[ language_user1 ] = " ";
+};
+String STR_PATH_NOT_FOUND1
+{
+ Text = "Das Verzeichnis '" ;
+ Text [ English ] = "The directory '" ;
+ Text [ norwegian ] = "The directory '" ;
+ Text [ italian ] = "La cartella" ;
+ Text [ portuguese_brazilian ] = "O diretrio" ;
+ Text [ portuguese ] = "O directrio '" ;
+ Text [ finnish ] = "Hakemistoa '" ;
+ Text [ danish ] = "Biblioteket '" ;
+ Text [ french ] = "Le rpertoire '" ;
+ Text [ swedish ] = "Mappen '" ;
+ Text [ dutch ] = "Directory '" ;
+ Text [ spanish ] = "El directorio '" ;
+ Text [ english_us ] = "The directory '" ;
+ Text[ chinese_simplified ] = "Ŀ¼ '";
+ Text[ russian ] = " '";
+ Text[ polish ] = "Katalog '";
+ Text[ japanese ] = "ިڸ '";
+ Text[ chinese_traditional ] = "ؿ '";
+ Text[ arabic ] = " '";
+ Text[ greek ] = " '";
+ Text[ korean ] = "丮'";
+ Text[ turkish ] = "Dizin '";
+ Text[ language_user1 ] = " ";
+};
+String STR_PATH_NOT_FOUND2
+{
+ Text = "' existiert nicht." ;
+ Text [ English ] = "' does not exist." ;
+ Text [ norwegian ] = "' does not exist." ;
+ Text [ italian ] = "' non esiste." ;
+ Text [ portuguese_brazilian ] = "' no existe." ;
+ Text [ portuguese ] = "' no existe." ;
+ Text [ finnish ] = "' ei ole." ;
+ Text [ danish ] = "' eksisterer ikke." ;
+ Text [ french ] = "' n'existe pas." ;
+ Text [ swedish ] = "' finns inte." ;
+ Text [ dutch ] = "' bestaat niet." ;
+ Text [ spanish ] = "' no existe." ;
+ Text [ english_us ] = "' does not exist." ;
+ Text[ chinese_simplified ] = "' ڡ";
+ Text[ russian ] = "' .";
+ Text[ polish ] = "nie istnieje.";
+ Text[ japanese ] = "' ͂܂B";
+ Text[ chinese_traditional ] = "' sbC";
+ Text[ arabic ] = "' .";
+ Text[ greek ] = "' .";
+ Text[ korean ] = "' ϴ.";
+ Text[ turkish ] = "' mevcut deil.";
+ Text[ language_user1 ] = " ";
+};
+InfoBox MSG_ERROR_PASSWD
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ MESSAGE = "Fehlerhaftes Passwort." ;
+ MESSAGE [ English ] = "Password doesn't match." ;
+ MESSAGE [ norwegian ] = "Passord passer ikke." ;
+ MESSAGE [ italian ] = "La password non corrisponde." ;
+ MESSAGE [ portuguese_brazilian ] = "A senha no combina." ;
+ MESSAGE [ portuguese ] = "A senha no vlida." ;
+ MESSAGE [ finnish ] = "Salasana ei kelpaa." ;
+ MESSAGE [ danish ] = "Ugyldig adgangskode" ;
+ MESSAGE [ french ] = "Mot de passe incorrect." ;
+ MESSAGE [ swedish ] = "Felaktigt lsenord." ;
+ MESSAGE [ dutch ] = "Wachtwoord niet juist" ;
+ MESSAGE [ spanish ] = "Contrasea no vlida." ;
+ MESSAGE [ english_us ] = "Invalid password." ;
+ MESSAGE[ chinese_simplified ] = "Ŀ";
+ MESSAGE[ russian ] = " .";
+ MESSAGE[ polish ] = "Nieprawidowe haso.";
+ MESSAGE[ japanese ] = "Ȃ߽ܰޡ";
+ MESSAGE[ chinese_traditional ] = "KXLġC";
+ MESSAGE[ arabic ] = " .";
+ MESSAGE[ greek ] = " .";
+ MESSAGE[ korean ] = "н尡 Ʋϴ.";
+ MESSAGE[ turkish ] = "Yanl ifre";
+ MESSAGE[ language_user1 ] = " ";
+};
+String STR_FILEDLG_INSERT
+{
+ Text = "Datei einfgen" ;
+ Text [ ENGLISH ] = "Insert File" ;
+ Text [ norwegian ] = "Sett inn" ;
+ Text [ italian ] = "Inserisci file" ;
+ Text [ portuguese_brazilian ] = "Inserir" ;
+ Text [ portuguese ] = "Inserir ficheiro" ;
+ Text [ finnish ] = "Lis" ;
+ Text [ danish ] = "Indst fil" ;
+ Text [ french ] = "Insrer un fichier" ;
+ Text [ swedish ] = "Infoga fil" ;
+ Text [ dutch ] = "Bestand invoegen" ;
+ Text [ spanish ] = "Insertar archivo" ;
+ Text [ english_us ] = "Insert File" ;
+ Text[ chinese_simplified ] = "ļ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Wstaw plik";
+ Text[ japanese ] = "̧ق̑}";
+ Text[ chinese_traditional ] = "Jɮ";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Dosya ekle";
+ Text[ language_user1 ] = " ";
+};
+String STR_TABPAGE_MANAGESTYLES
+{
+ Text = "Verwalten" ;
+ Text [ ENGLISH ] = "Manage" ;
+ Text [ norwegian ] = "Styre" ;
+ Text [ italian ] = "Gestione" ;
+ Text [ portuguese_brazilian ] = "Gerenciar" ;
+ Text [ portuguese ] = "Gerir" ;
+ Text [ finnish ] = "Ksittele" ;
+ Text [ danish ] = "Administrer" ;
+ Text [ french ] = "Grer" ;
+ Text [ swedish ] = "Organisera" ;
+ Text [ dutch ] = "Beheren" ;
+ Text [ spanish ] = "Administrar" ;
+ Text [ english_us ] = "Organizer" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zarzdzaj";
+ Text[ japanese ] = "Ǘ";
+ Text[ chinese_traditional ] = "޲z";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Ynet";
+ Text[ language_user1 ] = " ";
+};
+InfoBox MSG_TABPAGE_INVALIDNAME
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Der Name wird bereits fr eine Vorlage verwendet." ;
+ Message [ ENGLISH ] = "This name is already in use." ;
+ Message [ norwegian ] = "Dette navnet er allerede i bruk." ;
+ Message [ italian ] = "Questo nome gi utilizzato per un modello." ;
+ Message [ portuguese_brazilian ] = "Este nome j est sendo usado." ;
+ Message [ portuguese ] = "Este nome j est a ser usado para um modelo." ;
+ Message [ finnish ] = "Tm nimi on jo kytss." ;
+ Message [ danish ] = "Navnet er allerede i brug som navn p en typografi." ;
+ Message [ french ] = "Ce nom a dj t attribu." ;
+ Message [ swedish ] = "Namnet anvnds redan fr en mall." ;
+ Message [ dutch ] = "Er bestaat reeds een sjabloon/opmaakprofiel met deze naam." ;
+ Message [ spanish ] = "Este nombre ya es usado para una plantilla." ;
+ Message [ english_us ] = "This name is already in use." ;
+ Message[ chinese_simplified ] = "һʽѾʹơ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Ta nazwa zostaa ju uyta dla stylu.";
+ Message[ japanese ] = "̖O͂łɁAقɎgĂ܂B";
+ Message[ chinese_traditional ] = "@Ӽ˦wgϥγoӦW١C";
+ Message[ arabic ] = " .";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ̸ ̹ Ͽ Դϴ.";
+ Message[ turkish ] = "Bu ad bir ablon ad olarak kullanlyor.";
+ Message[ language_user1 ] = " ";
+};
+InfoBox MSG_TABPAGE_INVALIDSTYLE
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Diese Vorlage existiert nicht." ;
+ Message [ ENGLISH ] = "Style doesn't exist." ;
+ Message [ norwegian ] = "Mal finnes ikke." ;
+ Message [ italian ] = "Il modello non esiste." ;
+ Message [ portuguese_brazilian ] = "O estilo no existe." ;
+ Message [ portuguese ] = "Este modelo no existe." ;
+ Message [ finnish ] = "Tyyli ei ole." ;
+ Message [ danish ] = "Denne typografi eksisterer ikke." ;
+ Message [ french ] = "Style inexistant." ;
+ Message [ swedish ] = "Den hr mallen finns inte." ;
+ Message [ dutch ] = "Dit opmaakprofiel bestaat niet." ;
+ Message [ spanish ] = "Este estilo no existe." ;
+ Message [ english_us ] = "This Style does not exist." ;
+ Message[ chinese_simplified ] = "ʽڡ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Szablon nie istnieje.";
+ Message[ japanese ] = "̽ق݂͑Ă܂B";
+ Message[ chinese_traditional ] = "oӼ˦sbC";
+ Message[ arabic ] = " .";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ϴ.";
+ Message[ turkish ] = "Bu ablon mevcut deil.";
+ Message[ language_user1 ] = "All \"Vorlagen\" /Styles are written with a capital S.10.5.00EM";
+};
+InfoBox MSG_TABPAGE_INVALIDPARENT
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Diese Vorlage kann nicht als Basisvorlage verwendet werden,\nda eine Rekursion entstehen wrde." ;
+ Message [ ENGLISH ] = "Style cannot be used as a parent; it would cause a circular connection." ;
+ Message [ norwegian ] = "Mal kan ikke brukes som forelder+++ be used as a parent; den vil forrsake en sirkulr forbindelse." ;
+ Message [ italian ] = "Impossibile usare lo stile come principale;\ncauserebbe una connessione circolare." ;
+ Message [ portuguese_brazilian ] = "O estilo no pode ser usado como superior;\nisto provocaria uma conex o circular." ;
+ Message [ portuguese ] = "Este modelo no pode ser usado como modelo-base,\numa vez que provocaria uma referncia recursiva." ;
+ Message [ finnish ] = "Style cannot be used as a parent; it would cause a circular connection." ;
+ Message [ danish ] = "Denne skabelon kan ikke bruges som basisskabelon, \nda dette ville forrsage en rekursion." ;
+ Message [ french ] = "Ce style ne peut pas tre utilis comme style de base\ncar il entranerait une rfrence rcursive." ;
+ Message [ swedish ] = "Denna mall kan inte anvndas som basmall, d\nen rekursion skulle uppst." ;
+ Message [ dutch ] = "Deze sjabloon kan niet als basissjabloon worden gebruikt;\nhierdoor zou een kringverbinding ontstaan." ;
+ Message [ spanish ] = "Esta plantilla no se puede utilizar como plantilla base,\nya que podra provocar una referencia recursiva." ;
+ Message [ english_us ] = "Template cannot be used as a base template;\nrecursive reference would result." ;
+ Message[ chinese_simplified ] = "ʽ޷ʽļ\nݹá";
+ Message[ russian ] = " ,\n.. .";
+ Message[ polish ] = "Tego szablonu nie moesz uy jako szablonu podstawowego,\nponiewa moga by powsta rekurencja.";
+ Message[ japanese ] = "̽قް قƂĎgpł܂\nװ܂B";
+ Message[ chinese_traditional ] = "oӼ˦LkQ@˦M\n_h|ް_kޥΡC";
+ Message[ arabic ] = " \n ().";
+ Message[ greek ] = " ;\n .";
+ Message[ korean ] = " ⺻Ϸ ϴ. \nݺ ߱ ֱ Դϴ.";
+ Message[ turkish ] = "Bu ablon (zyineleme nedeniyle)\n temel ablon olarak kullanlamaz.";
+ Message[ language_user1 ] = " ";
+};
+InfoBox MSG_POOL_STYLE_NAME
+{
+ MESSAGE = "Der Name ist bereits Name einer Standardvorlage.\nBitte einen anderen Namen vergeben." ;
+ MESSAGE [ English ] = "Name is alreafy used by a default style.\nPlease choose another Name." ;
+ MESSAGE [ norwegian ] = "Navnet er allerede I bruk av en standardstil.\nVelg et annet navn." ;
+ MESSAGE [ italian ] = "Il nome gi usato da uno stile predefinito.\nScegliere un altro nome." ;
+ MESSAGE [ portuguese_brazilian ] = "O nome j est sendo usado por um estilo padr o.\nEscolha outro Nome." ;
+ MESSAGE [ portuguese ] = "O nome j est a ser usado por um estilo padro.\nEscolha outro nome por favor." ;
+ MESSAGE [ finnish ] = "Nime kytetn jo oletustyyliss.\nKirjoita toinen nimi." ;
+ MESSAGE [ danish ] = "Navnet er allerede i brug som navn p en standardtypografi.\nVlg venligst et andet navn." ;
+ MESSAGE [ french ] = "Ce nom a dj attribu un style par dfaut.\nVeuillez en choisir un autre." ;
+ MESSAGE [ swedish ] = "Namnet anvnds redan fr en standardmall.\nVlj ett annat namn." ;
+ MESSAGE [ dutch ] = "Naam wordt al voor een standaardopmaakprofiel gebruikt.\nKies een andere naam." ;
+ MESSAGE [ spanish ] = "El nombre ya est usado por un estilo predeterminado.\nElija otro nombre por favor." ;
+ MESSAGE [ english_us ] = "Name already exists as a default Style.\nPlease choose another name." ;
+ MESSAGE[ chinese_simplified ] = "һ׼ʽơ\nʹһơ";
+ MESSAGE[ russian ] = " .\n, , .";
+ MESSAGE[ polish ] = "Ta nazwa jest ju nazw stylu domylnego .\nProsz wybierz inn nazw.";
+ MESSAGE[ japanese ] = "̖O͂łɕWق̖OƂĎgĂ܂B\n̖OɂĉB";
+ MESSAGE[ chinese_traditional ] = "oӦW٬O@ӼзǼ˦W١C\nбzĥΨL@ӦW١C";
+ MESSAGE[ arabic ] = " .\n .";
+ MESSAGE[ greek ] = " .\n .";
+ MESSAGE[ korean ] = " ̸ ̹ ⺻ ̸Դϴ.\nٸ ̸ Ͻʽÿ.";
+ MESSAGE[ turkish ] = "Bu ad bir standart ablon ad olarak kullanlyor.\nBaka bir ad sein.";
+ MESSAGE[ language_user1 ] = "All \"Vorlagen\" /Styles are written with a capital S.10.5.00EM";
+};
+QueryBox MSG_OVERWRITE_STYLE
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ Message = "Vorlage existiert bereits. berschreiben?" ;
+ Message [ ENGLISH ] = "Style already exists. Overwrite?" ;
+ Message [ norwegian ] = "Mal finnes allerede. Skriv over?" ;
+ Message [ italian ] = "Il modello esiste gi. Sovrascrivere?" ;
+ Message [ portuguese_brazilian ] = "O estilo j existe. Sobregravar?" ;
+ Message [ portuguese ] = "O modelo j existe. Sobregravar?" ;
+ Message [ finnish ] = "Tyyli on jo mritetty. Korvataanko se?" ;
+ Message [ danish ] = "Typografi eksisterer allerede. Skal den overskrives?" ;
+ Message [ french ] = "Ce style existe dj. Voulez-vous le remplacer ?" ;
+ Message [ swedish ] = "Mall finns redan. Skriva ver?" ;
+ Message [ dutch ] = "Deze sjabloon bestaat reeds. Overschrijven?" ;
+ Message [ spanish ] = "El estilo ya existe. Desea sobrescribirlo?" ;
+ Message [ english_us ] = "Style already exists. Overwrite?" ;
+ Message[ chinese_simplified ] = "ʽѾڡҪд";
+ Message[ russian ] = " . ?";
+ Message[ polish ] = "Szablon ju istnieje. Czy go zastpi?";
+ Message[ japanese ] = "̽ق͂łɑ݂Ă܂B㏑܂H";
+ Message[ chinese_traditional ] = "˦wgsbCznмgS";
+ Message[ arabic ] = " . ";
+ Message[ greek ] = " . ;";
+ Message[ korean ] = " ̹ ֽϴ. ?";
+ Message[ turkish ] = "ablon mevcut durumda. zerine yazlsn m?";
+ Message[ language_user1 ] = " ";
+};
+String STR_DELETE_STYLE
+{
+ Text = "Wollen Sie die Vorlage $1 wirklich lschen?" ;
+ Text [ English ] = "Do you really want to delete the style $1?" ;
+ Text [ portuguese ] = "Eliminar realmente o estilo $1?" ;
+ Text [ english_us ] = "Do you really want to delete Style $1?" ;
+ Text [ portuguese_brazilian ] = "Wollen Sie die Vorlage $1 wirklich lschen?" ;
+ Text [ swedish ] = "Vill Du verkligen radera mallen $1?" ;
+ Text [ danish ] = "Er du sikker p, at du vil slette typografi $1?" ;
+ Text [ italian ] = "Eliminare veramente il modello $1 ?" ;
+ Text [ spanish ] = "Desea realmente eliminar el estilo $1?" ;
+ Text [ french ] = "Voulez-vous vraiment supprimer le modle $1 ?" ;
+ Text [ dutch ] = "Wilt u het opmaakprofiel $1 werkelijk wissen?" ;
+ Text[ chinese_simplified ] = "Ҫɾʽ $1 ";
+ Text[ russian ] = " $1?";
+ Text[ polish ] = "Czy chcesz na pewno usun styl $1?";
+ Text[ japanese ] = " $1 폜Ă낵łH";
+ Text[ chinese_traditional ] = "zunR˦ $1 S";
+ Text[ arabic ] = " $1";
+ Text[ greek ] = " $1?";
+ Text[ korean ] = "$1 Ͻðڽϱ?";
+ Text[ turkish ] = "$1 ablonlarn gerekten silmek istiyor musunuz?";
+ Text[ language_user1 ] = "All \"Vorlagen\" /Styles are written with a capital S.10.5.00EM";
+};
+String STR_DELETE_STYLE_USED
+{
+ Text = "Sie lschen eine benutzte Vorlage!\n" ;
+ Text [ English ] = "You are deleting a used style!\n" ;
+ Text [ dutch ] = "U wist een gebruikt opmaakprofiel!\n" ;
+ Text [ english_us ] = "You are deleting an applied Style!\n" ;
+ Text [ italian ] = "Si sta cancellando un modello in uso!\n" ;
+ Text [ spanish ] = "Usted est borrando un estilo que ha sido aplicado!\n" ;
+ Text [ french ] = "Vous supprimez un style utilis !\n" ;
+ Text [ swedish ] = "Du raderar en anvnd formatmall!\n" ;
+ Text [ danish ] = "Du sletter en anvendt typografi!\n" ;
+ Text [ portuguese ] = "Est a eliminar um estilo usado!\n" ;
+ Text [ portuguese_brazilian ] = "Sie lschen eine benutzte Vorlage!\n" ;
+ Text[ chinese_simplified ] = "Ҫɾһʹõʽ\n";
+ Text[ russian ] = " !\n";
+ Text[ polish ] = "Usuwasz zastosowany styl!\n";
+ Text[ japanese ] = "gpق폜悤ƂĂ܂!\n";
+ Text[ chinese_traditional ] = "znRO@ӨϥΪ˦T\n";
+ Text[ arabic ] = " !\n";
+ Text[ greek ] = " !\n";
+ Text[ korean ] = " ϰ ֽϴ!\n";
+ Text[ turkish ] = "Kullanlan bir ablonu siliyorsunuz!\n";
+ Text[ language_user1 ] = "All \"Vorlagen\" /Styles are written with a capital S.10.5.00EM";
+};
+Image BMP_COLLAPSED
+{
+ ImageBitmap = Bitmap
+ {
+ File = "plus.bmp" ;
+ };
+ // MaskColor = Color { Predefine = COL_GREEN ; };
+};
+Image BMP_EXPANDED
+{
+ ImageBitmap = Bitmap
+ {
+ File = "minus.bmp" ;
+ };
+ // MaskColor = Color { Predefine = COL_GREEN ; };
+};
+Menu MN_CONTEXT_TEMPLDLG
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = ID_NEW ;
+ Text = "Neu..." ;
+ Text [ English ] = "New..." ;
+ Text [ norwegian ] = "Ny..." ;
+ Text [ italian ] = "Nuovo..." ;
+ Text [ portuguese_brazilian ] = "Novo..." ;
+ Text [ portuguese ] = "Novo..." ;
+ Text [ finnish ] = "Uusi..." ;
+ Text [ danish ] = "Ny..." ;
+ Text [ french ] = "Nouveau..." ;
+ Text [ swedish ] = "Nytt..." ;
+ Text [ dutch ] = "Nieuw..." ;
+ Text [ spanish ] = "Nuevo..." ;
+ Text [ english_us ] = "New..." ;
+ HelpId = HID_STYLIST_NEW ;
+ Text[ chinese_simplified ] = "½...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Nowy...";
+ Text[ japanese ] = "VK쐬...";
+ Text[ chinese_traditional ] = "}ҷs...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "...";
+ Text[ turkish ] = "Yeni...";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = ID_EDIT ;
+ Text = "ndern..." ;
+ Text [ English ] = "Edit..." ;
+ Text [ norwegian ] = "Rediger..." ;
+ Text [ italian ] = "Modifica..." ;
+ Text [ portuguese_brazilian ] = "Editar..." ;
+ Text [ portuguese ] = "Modificar..." ;
+ Text [ finnish ] = "Muokkaa..." ;
+ Text [ danish ] = "Modificer..." ;
+ Text [ french ] = "Modifier..." ;
+ Text [ swedish ] = "ndra..." ;
+ Text [ dutch ] = "Wijzigen..." ;
+ Text [ spanish ] = "Modificar..." ;
+ Text [ english_us ] = "Modify..." ;
+ HelpId = HID_STYLIST_EDIT ;
+ Text[ chinese_simplified ] = "...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Modyfikuj...";
+ Text[ japanese ] = "ύX...";
+ Text[ chinese_traditional ] = "ܧ...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "...";
+ Text[ turkish ] = "Deitir...";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = ID_DELETE ;
+ Text = "Lschen..." ;
+ Text [ English ] = "Delete..." ;
+ Text [ norwegian ] = "Slett..." ;
+ Text [ italian ] = "Annulla..." ;
+ Text [ portuguese_brazilian ] = "Apagar..." ;
+ Text [ portuguese ] = "Eliminar..." ;
+ Text [ finnish ] = "Poista..." ;
+ Text [ danish ] = "Slet..." ;
+ Text [ french ] = "Supprimer..." ;
+ Text [ swedish ] = "Radera..." ;
+ Text [ dutch ] = "Wissen..." ;
+ Text [ spanish ] = "Eliminar..." ;
+ Text [ english_us ] = "Delete..." ;
+ HelpId = HID_STYLIST_DELETE ;
+ Text[ chinese_simplified ] = "ɾ...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Usu...";
+ Text[ japanese ] = "폜...";
+ Text[ chinese_traditional ] = "R...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "...";
+ Text[ turkish ] = "Sil...";
+ Text[ language_user1 ] = " ";
+ };
+ };
+};
+String STR_BASICMACROS
+{
+ TEXT = "BASIC-Makros" ;
+ TEXT [ ENGLISH ] = "BASIC Macros" ;
+ TEXT [ norwegian ] = "Basis Makroer" ;
+ TEXT [ italian ] = "Macro di BASIC" ;
+ TEXT [ portuguese_brazilian ] = "Macros Bsico" ;
+ TEXT [ portuguese ] = "Macros BASIC" ;
+ TEXT [ finnish ] = "Basic Macros" ;
+ TEXT [ danish ] = "BASIC-makroer" ;
+ TEXT [ french ] = "Macros BASIC" ;
+ TEXT [ swedish ] = "BASIC-makron" ;
+ TEXT [ dutch ] = "BASIC- macros" ;
+ TEXT [ spanish ] = "Macros BASIC" ;
+ TEXT [ english_us ] = "BASIC Macros" ;
+ TEXT[ chinese_simplified ] = "BASIC-";
+ TEXT[ russian ] = " BASIC";
+ TEXT[ polish ] = "Makra BASIC";
+ TEXT[ japanese ] = "BASIC ϸ";
+ TEXT[ chinese_traditional ] = "BASIC-";
+ TEXT[ arabic ] = " BASIC";
+ TEXT[ greek ] = " BASIC";
+ TEXT[ korean ] = "BASIC ũ";
+ TEXT[ turkish ] = "BASIC makrolar";
+ TEXT[ language_user1 ] = " ";
+};
+InfoBox MSG_LAYOUT_NOT_LOADING
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ MESSAGE = "Dokument wird ohne Layout geladen." ;
+ MESSAGE [ English ] = "Loading Documents without Layout." ;
+ MESSAGE [ norwegian ] = "Last inn Dokumenter uten Layout." ;
+ MESSAGE [ italian ] = "Il documento viene caricato senza layout" ;
+ MESSAGE [ portuguese_brazilian ] = "Carregando Documentos sem Layout." ;
+ MESSAGE [ portuguese ] = "A carregar documento sem configurao." ;
+ MESSAGE [ finnish ] = "Luetaan asiakirjat ilman asetttelua." ;
+ MESSAGE [ danish ] = "Indlser dokument uden layout." ;
+ MESSAGE [ french ] = "Chargement d'un document sans mise en page." ;
+ MESSAGE [ swedish ] = "Dokument laddas utan layout." ;
+ MESSAGE [ dutch ] = "Document wordt zonder lay-out geladen." ;
+ MESSAGE [ spanish ] = "Cargando el documento sin diseo." ;
+ MESSAGE [ english_us ] = "Loading document without layout." ;
+ MESSAGE[ chinese_simplified ] = "ʽװļ";
+ MESSAGE[ russian ] = " .";
+ MESSAGE[ polish ] = "Dokument jest adowany bez ukadu.";
+ MESSAGE[ japanese ] = "޷ĂڲĂȂœǂݍ܂܂B";
+ MESSAGE[ chinese_traditional ] = "˸AaC";
+ MESSAGE[ arabic ] = " .";
+ MESSAGE[ greek ] = " .";
+ MESSAGE[ korean ] = " ̾ƿ ε Դϴ.";
+ MESSAGE[ turkish ] = "Belge sayfa dzeni olmadan ykleniyor.";
+ MESSAGE[ language_user1 ] = " ";
+};
+Accelerator ACC_LAYOUT_NOT_LOADING
+{
+ ItemList =
+ {
+ AcceleratorItem
+ {
+ Key = KeyCode
+ {
+ Code = KEY_L ;
+ Shift = FALSE ; Modifier1 = TRUE ; Modifier2 = TRUE ;
+ };
+ Identifier = 1 ;
+ };
+ };
+};
+ //------------------------------------------------------------------------
+ErrorBox MSG_ERR_CANT_EDIT_OLD_FORMAT
+{
+ Message = "Die Dokument-Info von Dokumenten in diesem\nDateiformat kann nicht bearbeitet werden." ;
+ Message [ ENGLISH ] = "Can't edit document-info of documents\nof this file format." ;
+ Message [ dutch ] = "De documentinformatie van documenten in dit\nbestandformaat kan niet worden bewerkt." ;
+ Message [ english_us ] = "Cannot edit document info for documents\n in this file format." ;
+ Message [ italian ] = "La modifica dell'informazione sul documento per\nun documento nel formato dato non possibile." ;
+ Message [ spanish ] = "La informacin de documentos no se puede editar en este\nformato de archivo." ;
+ Message [ french ] = "Impossible d'diter les informations pour\nce type de fichier" ;
+ Message [ swedish ] = "Dokumentinformation frn dokument i det hr\nfilformatet kan inte redigeras." ;
+ Message [ danish ] = "Dokumenters dokumentinformation med dette \nfilformat kan ikke redigeres." ;
+ Message [ portuguese ] = "Impossvel editar a informao sobre documentos\n neste formato de ficheiro." ;
+ Message [ portuguese_brazilian ] = "Die Dokument-Info von Dokumenten in diesem\nDateiformat kann nicht bearbeitet werden." ;
+ Message[ chinese_simplified ] = "޷༭ļʽĵϢ";
+ Message[ russian ] = " \n .";
+ Message[ polish ] = "Informacje o dokumencie dla dokumentw nie mog \nby edytowane w tym formacie pliku.";
+ Message[ japanese ] = "ُ̧޷Ă޷ď\nҏWł܂B";
+ Message[ chinese_traditional ] = "LksoӤ榡TC";
+ Message[ arabic ] = " \n .";
+ Message[ greek ] = " \n .";
+ Message[ korean ] = " \nϼ ϴ.";
+ Message[ turkish ] = "Bu dosya formatndaki belgelerin belge bilgileri ilenemez";
+ Message[ language_user1 ] = " ";
+};
+ //------------------------------------------------------------------------
+ErrorBox MSG_ERR_CANT_EDIT_OPEN_DOCS
+{
+ Message = "Die Dokument-Info von in Bearbeitung befindlichen\nDokumenten kann nicht vom Dokumentmanager bearbeitet werden." ;
+ Message [ ENGLISH ] = "Can't edit document-info of documents\nin work from within the document manager." ;
+ Message [ english_us ] = "Document info of documents\n being currently edited cannot be modified from within the document manager." ;
+ Message [ italian ] = "L'informazione sul documento relativa a documenti\nin fase di modifica non modificabile con la gestione manager." ;
+ Message [ spanish ] = "La informacin acerca de los documentos que se estn editando\nno puede ser editada por el administrador de documentos." ;
+ Message [ french ] = "Impossible de modifier les proprits du document actuel \npar le gestionnaire de document." ;
+ Message [ dutch ] = "De documentinformatie van de in bewerking zijnde\ndocumenten kan niet door de documentmanager worden bewerkt." ;
+ Message [ swedish ] = "Dokumentinformationen frn i redigering befintliga\ndokument kan inte redigeras av dokumentmanagern." ;
+ Message [ danish ] = "Dokumentinformationen til dokumenter som aktuelt redigeres\nkan ikke redigeres af dokumentmanageren." ;
+ Message [ portuguese_brazilian ] = "Die Dokument-Info von in Bearbeitung befindlichen\nDokumenten kann nicht vom Dokumentmanager bearbeitet werden." ;
+ Message [ portuguese ] = "A Informao sobre Documentos dos documentos que\n esto a ser editados no poder ser modificada pelo gestor de documentos." ;
+ Message[ chinese_simplified ] = "ĵѾڱ༭״̬\nĵ޷Щĵ";
+ Message[ russian ] = " \n , \n";
+ Message[ polish ] = "Informacja o dokumencie dla edytowanych dokumentw\nnie moe by edytowana przez menedera dokumentw.";
+ Message[ japanese ] = "ҏW޷Ă޷ď\n޷ ȰެҏWł܂B";
+ Message[ chinese_traditional ] = "wgBs説AM\n޲zLkBzoǤC";
+ Message[ arabic ] = " \n .";
+ Message[ greek ] = " \n .";
+ Message[ korean ] = " \n ڿ ϴ.";
+ Message[ turkish ] = "u an kullanlan belgelerin belge bilgileri belge yneticisi tarafndan ilenemez.";
+ Message[ language_user1 ] = " ";
+};
+ModalDialog RID_URLOPEN
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 204 , 44 ) ;
+ Text = "URL eingeben" ;
+ Text [ ENGLISH ] = "Enter URL" ;
+ Moveable = TRUE ;
+ Text [ english_us ] = "Enter URL" ;
+ Text [ italian ] = "Digitare l'URL" ;
+ Text [ spanish ] = "Entrar URL" ;
+ Text [ french ] = "Saisie d'URL" ;
+ Text [ dutch ] = "URL invoeren" ;
+ Text [ swedish ] = "Mata in URL" ;
+ Text [ danish ] = "Indtast URL" ;
+ Text [ portuguese_brazilian ] = "URL eingeben" ;
+ Text [ portuguese ] = "Entrar URL" ;
+ Text[ chinese_simplified ] = " URL";
+ Text[ russian ] = " URL";
+ Text[ polish ] = "Wprowad URL";
+ Text[ japanese ] = "URL";
+ Text[ chinese_traditional ] = "J URL";
+ Text[ arabic ] = " URL";
+ Text[ greek ] = " URL";
+ Text[ korean ] = "URL Է";
+ Moveable = TRUE ;
+ OKButton RID_URLOPEN_OK
+ {
+ Pos = MAP_APPFONT ( 148 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton RID_URLOPEN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 148 , 24 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ Edit RID_URLOPEN_URL
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 16 ) ;
+ Size = MAP_APPFONT ( 138 , 12 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ };
+ Text[ turkish ] = "URL gir";
+ Text[ language_user1 ] = " ";
+};
+Menu RID_AUTOHIDE
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_AUTOHIDE ;
+ HelpID = SID_AUTOHIDE ;
+ Text = "Verstecken" ;
+ Text [ English ] = "Hide" ;
+ Text [ portuguese ] = "Ocultar" ;
+ Text [ english_us ] = "Hide" ;
+ Text [ portuguese_brazilian ] = "Verstecken" ;
+ Text [ swedish ] = "Dlj" ;
+ Text [ danish ] = "Skjul" ;
+ Text [ italian ] = "Nascondi" ;
+ Text [ spanish ] = "Ocultar" ;
+ Text [ french ] = "Masquer" ;
+ Text [ dutch ] = "Verbergen" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Ukryj";
+ Text[ japanese ] = "B";
+ Text[ chinese_traditional ] = "J";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Gizle";
+ Text[ language_user1 ] = " ";
+ };
+ };
+};
+String RID_AUTOHIDE
+{
+ Text = "Nicht verstecken" ;
+ Text [ English ] = "Show" ;
+ Text [ portuguese ] = "No ocultar" ;
+ Text [ english_us ] = "Don't Hide" ;
+ Text [ portuguese_brazilian ] = "Nicht verstecken" ;
+ Text [ swedish ] = "Dlj inte" ;
+ Text [ danish ] = "Skjul ikke" ;
+ Text [ italian ] = "non nascondere" ;
+ Text [ spanish ] = "No ocultar" ;
+ Text [ french ] = "Ne pas masquer" ;
+ Text [ dutch ] = "Niet verbergen" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nie ukrywaj";
+ Text[ japanese ] = "\\ɂȂ";
+ Text[ chinese_traditional ] = "J";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ʱ";
+ Text[ turkish ] = "Gizleme";
+ Text[ language_user1 ] = " ";
+};
+String SID_NAVIGATOR
+{
+ Text = "Navigator" ;
+ Text [ English ] = "Navigator" ;
+ Text[ english_us ] = "Navigator";
+ Text[ portuguese ] = "Navegador";
+ Text[ russian ] = "";
+ Text[ dutch ] = "Navigator";
+ Text[ french ] = "Navigateur";
+ Text[ spanish ] = "Navegador";
+ Text[ italian ] = "Navigatore";
+ Text[ danish ] = "Navigator";
+ Text[ swedish ] = "Navigator";
+ Text[ polish ] = "Nawigator";
+ Text[ portuguese_brazilian ] = "Navigator";
+ Text[ japanese ] = "޹ް";
+ Text[ chinese_simplified ] = "";
+ Text[ chinese_traditional ] = "U";
+ Text[ arabic ] = "";
+ Text[ greek ] = "Navigator";
+ Text[ korean ] = "׺";
+ Text[ turkish ] = "Navigatr";
+ Text[ language_user1 ] = " ";
+};
+
+ErrorBox MSG_ERROR_WRONG_CONFIRM
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ MESSAGE = "Fehlerhafte Besttigung des Passwortes" ;
+ MESSAGE [ English ] = "Wrong confirmation of the password" ;
+ MESSAGE[ english_us ] = "Faulty password confirmation";
+ MESSAGE[ portuguese ] = "Confirmao errada da senha";
+ MESSAGE[ russian ] = " ";
+ MESSAGE[ greek ] = " ";
+ MESSAGE[ dutch ] = "Foutieve bevestiging van wachtwoord";
+ MESSAGE[ french ] = "Confirmation du mot de passe errone !";
+ MESSAGE[ spanish ] = "Confirmacin errnea de la contrasea";
+ MESSAGE[ italian ] = "Conferma errata della password";
+ MESSAGE[ danish ] = "Forkert bekrftelse af adgangskoden";
+ MESSAGE[ swedish ] = "Felaktig bekrftelse av lsenordet";
+ MESSAGE[ polish ] = "Nieprawidowe potwierdzenie hasa";
+ MESSAGE[ portuguese_brazilian ] = "Wrong confirmation of the password";
+ MESSAGE[ japanese ] = "߽ܰނ̊mFłĂ܂";
+ MESSAGE[ korean ] = "н Ȯ ߸Ǿϴ.";
+ MESSAGE[ chinese_simplified ] = "ȷϿʱ";
+ MESSAGE[ chinese_traditional ] = "KXL";
+ MESSAGE[ arabic ] = " ";
+ MESSAGE[ turkish ] = "ifre onay hatal";
+ MESSAGE[ language_user1 ] = " ";
+};
+
+// ******************************************************************* EOF
+
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
new file mode 100644
index 000000000000..85d4e372b88c
--- /dev/null
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -0,0 +1,962 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX //autogen wg. RET_OK
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+
+#include <svtools/urihelper.hxx>
+
+#pragma hdrstop
+
+#include "dinfdlg.hxx"
+#include "sfxresid.hxx"
+#include "dinfedt.hxx"
+#include "frame.hxx"
+#include "viewfrm.hxx"
+#include "request.hxx"
+#include "expfile.hxx"
+#include "inimgr.hxx"
+#include "exptypes.hxx"
+#include "helper.hxx"
+
+#include "sfx.hrc"
+#include "dinfdlg.hrc"
+#include "sfxlocal.hrc"
+
+// STATIC DATA -----------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SfxDocumentInfoItem, SfxStringItem);
+
+//------------------------------------------------------------------------
+
+String ConvertDateTime_Impl( const SfxStamp& rStamp )
+{
+ const String pDelim ( DEFINE_CONST_UNICODE( ", "));
+ const International& rInter = Application::GetAppInternational();
+ String aStr( rInter.GetDate( rStamp.GetTime() ) );
+ aStr += pDelim;
+ aStr += rInter.GetTime( rStamp.GetTime(), TRUE, FALSE );
+ String aAuthor = rStamp.GetName();
+ aAuthor.EraseLeadingChars();
+ if ( aAuthor.Len() )
+ {
+ aStr += pDelim;
+ aStr += aAuthor;
+ }
+ return aStr;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoItem::SfxDocumentInfoItem() :
+
+ SfxStringItem()
+
+{
+ bOwnFormat = FALSE;
+ bHasTemplate = TRUE;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile, const SfxDocumentInfo& rInfo ) :
+
+ SfxStringItem( SID_DOCINFO, rFile ),
+
+ aDocInfo( rInfo )
+
+{
+ bOwnFormat = FALSE;
+ bHasTemplate = TRUE;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile,
+ const SfxDocumentInfo& rInfo, BOOL bOwn ) :
+
+ SfxStringItem( SID_DOCINFO, rFile ),
+
+ aDocInfo( rInfo )
+
+{
+ bOwnFormat = bOwn;
+ bHasTemplate = TRUE;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoItem::SfxDocumentInfoItem( const SfxDocumentInfoItem& rItem ) :
+
+ SfxStringItem( rItem ),
+
+ aDocInfo( rItem.aDocInfo )
+
+{
+ bOwnFormat = rItem.bOwnFormat;
+ bHasTemplate = rItem.bHasTemplate;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoItem::~SfxDocumentInfoItem()
+{
+}
+
+//------------------------------------------------------------------------
+
+SfxPoolItem* SfxDocumentInfoItem::Clone( SfxItemPool * ) const
+{
+ return new SfxDocumentInfoItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+int SfxDocumentInfoItem::operator==( const SfxPoolItem& rItem) const
+{
+ return rItem.Type() == Type() &&
+ SfxStringItem::operator==(rItem) &&
+ aDocInfo == ((const SfxDocumentInfoItem &)rItem).aDocInfo;
+}
+
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentInfoItem::IsOwnFormat() const
+{
+ return bOwnFormat;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentDescPage::SfxDocumentDescPage( Window * pParent, const SfxItemSet &rItemSet)
+ : SfxTabPage( pParent, SfxResId(TP_DOCINFODESC), rItemSet),
+ aTitleFt( this, ResId( FT_TITLE ) ),
+ aThemaFt( this, ResId( FT_THEMA ) ),
+ aKeywordsFt( this, ResId( FT_KEYWORDS ) ),
+ aCommentFt( this, ResId( FT_COMMENT ) ),
+ aTitleEd( this, ResId( ED_TITLE ) ),
+ aThemaEd( this, ResId( ED_THEMA ) ),
+ aKeywordsEd( this, ResId( ED_KEYWORDS ) ),
+ aCommentEd( this, ResId( ED_COMMENT ) ),
+ pInfoItem(0)
+{
+ FreeResource();
+}
+
+//------------------------------------------------------------------------
+
+SfxTabPage *SfxDocumentDescPage::Create(Window *pParent, const SfxItemSet &rItemSet)
+{
+ return new SfxDocumentDescPage(pParent, rItemSet);
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentDescPage::FillItemSet(SfxItemSet &rSet)
+{
+ // Pruefung, ob eine Aenderung vorliegt
+ const BOOL bTitleMod = aTitleEd.IsModified();
+ const BOOL bThemeMod = aThemaEd.IsModified();
+ const BOOL bKeywordsMod = aKeywordsEd.IsModified();
+ const BOOL bCommentMod = aCommentEd.IsModified();
+ if( !( bTitleMod || bThemeMod || bKeywordsMod || bCommentMod ) )
+ {
+ return FALSE;
+ }
+
+ // Erzeugung der Ausgabedaten
+ const SfxPoolItem *pItem;
+ SfxDocumentInfoItem *pInfo;
+ SfxTabDialog* pDlg = GetTabDialog();
+ const SfxItemSet* pExSet = NULL;
+
+ if ( pDlg )
+ pExSet = pDlg->GetExampleSet();
+
+ if ( pExSet &&
+ SFX_ITEM_SET != pExSet->GetItemState( SID_DOCINFO, TRUE, &pItem ) )
+ {
+ pInfo = pInfoItem;
+ }
+ else
+ {
+ pInfo = new SfxDocumentInfoItem(
+ *( const SfxDocumentInfoItem *) pItem );
+ }
+ SfxDocumentInfo aInfo( (*pInfo)() );
+ if( bTitleMod )
+ {
+ aInfo.SetTitle( aTitleEd.GetText() );
+ }
+ if( bThemeMod )
+ {
+ aInfo.SetTheme( aThemaEd.GetText() );
+ }
+ if( bKeywordsMod )
+ {
+ aInfo.SetKeywords( aKeywordsEd.GetText() );
+ }
+ if( bCommentMod )
+ {
+ aInfo.SetComment( aCommentEd.GetText() );
+ }
+ rSet.Put( SfxDocumentInfoItem( pInfo->GetValue(), aInfo ) );
+ if( pInfo != pInfoItem )
+ {
+ delete pInfo;
+ }
+
+ return TRUE;
+}
+
+//------------------------------------------------------------------------
+
+void SfxDocumentDescPage::Reset(const SfxItemSet &rSet)
+{
+ pInfoItem = &(SfxDocumentInfoItem &)rSet.Get(SID_DOCINFO);
+ const SfxDocumentInfo& rInfo = ( *pInfoItem )();
+
+ aTitleEd.SetText( rInfo.GetTitle() );
+ aThemaEd.SetText( rInfo.GetTheme() );
+ aKeywordsEd.SetText( rInfo.GetKeywords() );
+ aCommentEd.SetText( rInfo.GetComment() );
+
+ if ( rInfo.IsReadOnly() )
+ {
+ aTitleEd.SetReadOnly( TRUE );
+ aThemaEd.SetReadOnly( TRUE );
+ aKeywordsEd.SetReadOnly( TRUE );
+ aCommentEd.SetReadOnly( TRUE );
+ }
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet ) :
+
+ SfxTabPage( pParent, SfxResId( TP_DOCINFODOC ), rItemSet ),
+
+ aBmp1 ( this, ResId( BMP_FILE_1 ) ),
+ aNameED ( this, ResId( ED_FILE_NAME ) ),
+
+ aLine1FL ( this, ResId( FL_FILE_1 ) ),
+ aTypeFT ( this, ResId( FT_FILE_TYP ) ),
+ aShowTypeFT ( this, ResId( FT_FILE_SHOW_TYP ) ),
+ aReadOnlyCB ( this, ResId( CB_FILE_READONLY ) ),
+ aFileFt ( this, ResId( FT_FILE ) ),
+ aFileValFt ( this, ResId( FT_FILE_VAL ) ),
+ aSizeFT ( this, ResId( FT_FILE_SIZE ) ),
+ aShowSizeFT ( this, ResId( FT_FILE_SHOW_SIZE ) ),
+
+ aLine2FL ( this, ResId( FL_FILE_2 ) ),
+ aCreateFt ( this, ResId( FT_CREATE ) ),
+ aCreateValFt ( this, ResId( FT_CREATE_VAL ) ),
+ aTimeLogFt ( this, ResId( FT_TIMELOG ) ),
+ aTimeLogValFt ( this, ResId( FT_TIMELOG_VAL ) ),
+ aChangeFt ( this, ResId( FT_CHANGE ) ),
+ aChangeValFt ( this, ResId( FT_CHANGE_VAL ) ),
+ aDocNoFt ( this, ResId( FT_DOCNO ) ),
+ aDocNoValFt ( this, ResId( FT_DOCNO_VAL ) ),
+ aPrintValFt ( this, ResId( FT_PRINT_VAL ) ),
+ aPrintFt ( this, ResId( FT_PRINT ) ),
+ aDeleteBtn ( this, ResId( BTN_DELETE ) ),
+ aUseUserDataCB ( this, ResId( CB_USE_USERDATA ) ),
+
+ aLine3FL ( this, ResId( FL_FILE_3 ) ),
+ aTemplFt ( this, ResId( FT_TEMPL ) ),
+ aTemplValFt ( this, ResId( FT_TEMPL_VAL ) ),
+
+ aUnknownSize ( ResId( STR_UNKNOWNSIZE ) ),
+
+ bEnableUseUserData ( FALSE ),
+ bHandleDelete ( FALSE )
+
+{
+ FreeResource();
+ aDeleteBtn.SetClickHdl( LINK( this, SfxDocumentPage, DeleteHdl ) );
+}
+
+//------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentPage, DeleteHdl, PushButton*, EMPTYARG )
+{
+ SfxStamp aCreated;
+ if ( bEnableUseUserData && aUseUserDataCB.IsChecked() )
+ aCreated.SetName( SFX_INIMANAGER()->GetUserFullName() );
+ aCreateValFt.SetText( ConvertDateTime_Impl( aCreated ) );
+ XubString aEmpty;
+ aChangeValFt.SetText( aEmpty );
+ aPrintValFt.SetText( aEmpty );
+ const Time aTime( 0 );
+ const International& rInter = Application::GetAppInternational();
+ aTimeLogValFt.SetText( rInter.GetDuration( aTime ) );
+ aDocNoValFt.SetText( '1' );
+ bHandleDelete = TRUE;
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+SfxTabPage* SfxDocumentPage::Create( Window* pParent, const SfxItemSet& rItemSet )
+{
+ return new SfxDocumentPage( pParent, rItemSet );
+}
+
+//------------------------------------------------------------------------
+
+void SfxDocumentPage::EnableUseUserData()
+{
+ bEnableUseUserData = TRUE;
+ aUseUserDataCB.Show();
+ aDeleteBtn.Show();
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentPage::FillItemSet( SfxItemSet& rSet )
+{
+ BOOL bRet = FALSE;
+
+ if ( !bHandleDelete && bEnableUseUserData &&
+ aUseUserDataCB.GetState() != aUseUserDataCB.GetSavedValue() &&
+ GetTabDialog() && GetTabDialog()->GetExampleSet() )
+ {
+ const SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet();
+ const SfxPoolItem* pItem;
+
+ if ( pExpSet && SFX_ITEM_SET ==
+ pExpSet->GetItemState( SID_DOCINFO, TRUE, &pItem ) )
+ {
+ SfxDocumentInfoItem* pInfoItem = (SfxDocumentInfoItem*)pItem;
+ SfxDocumentInfo aInfo( (*pInfoItem)() );
+ BOOL bUseData = ( STATE_CHECK == aUseUserDataCB.GetState() );
+ aInfo.SetUseUserData( bUseData );
+/*
+ if ( !bUseData )
+ {
+ // "Benutzerdaten verwenden" ausgeschaltet ->
+ // den Benutzer aus den Stamps l"oschen
+ String aEmptyUser;
+ aInfo.SetCreated(
+ SfxStamp( aEmptyUser, aInfo.GetCreated().GetTime() ) );
+ aInfo.SetChanged(
+ SfxStamp( aEmptyUser, aInfo.GetChanged().GetTime() ) );
+ aInfo.SetPrinted(
+ SfxStamp( aEmptyUser, aInfo.GetPrinted().GetTime() ) );
+ }
+*/
+ rSet.Put( SfxDocumentInfoItem( pInfoItem->GetValue(), aInfo ) );
+ bRet = TRUE;
+ }
+ }
+
+ if ( bHandleDelete )
+ {
+ const SfxItemSet* pExpSet = GetTabDialog()->GetExampleSet();
+ const SfxPoolItem* pItem;
+
+ if ( pExpSet &&
+ SFX_ITEM_SET == pExpSet->GetItemState( SID_DOCINFO, TRUE, &pItem ) )
+ {
+ SfxDocumentInfoItem* pInfoItem = (SfxDocumentInfoItem*)pItem;
+ SfxDocumentInfo aInfo( pInfoItem->GetDocInfo() );
+ SfxStamp aCreated;
+ if ( bEnableUseUserData && aUseUserDataCB.IsChecked() )
+ aCreated.SetName( SFX_INIMANAGER()->GetUserFullName() );
+ aInfo.SetCreated( aCreated );
+ SfxStamp aInvalid( TIMESTAMP_INVALID_DATETIME );
+ aInfo.SetChanged( aInvalid );
+ aInfo.SetPrinted( aInvalid );
+ aInfo.SetTime( 0L );
+ aInfo.SetDocumentNumber( 1 );
+ aInfo.SetUseUserData( STATE_CHECK == aUseUserDataCB.GetState() );
+ rSet.Put( SfxDocumentInfoItem( pInfoItem->GetValue(), aInfo ) );
+ bRet = TRUE;
+ }
+ }
+
+ if ( aNameED.IsModified() && aNameED.GetText().Len() )
+ {
+ rSet.Put( SfxStringItem( ID_FILETP_TITLE, aNameED.GetText() ) );
+ bRet = TRUE;
+ }
+
+ if ( /* aReadOnlyCB.IsModified() */ TRUE )
+ {
+ rSet.Put( SfxBoolItem( ID_FILETP_READONLY, aReadOnlyCB.IsChecked() ) );
+ bRet = TRUE;
+ }
+
+ return bRet;
+}
+
+//------------------------------------------------------------------------
+
+void SfxDocumentPage::Reset( const SfxItemSet& rSet )
+{
+ // Bestimmung der Dokumentinformationen
+ const SfxDocumentInfoItem *pInfoItem =
+ &(const SfxDocumentInfoItem &)rSet.Get(SID_DOCINFO);
+ const SfxDocumentInfo& rInfo = ( *pInfoItem )();
+
+ // Vorlagendaten
+ if ( pInfoItem->HasTemplate() )
+ {
+ aTemplValFt.SetText( rInfo.GetTemplateName() );
+ }
+ else
+ {
+ aTemplFt.Hide();
+ aTemplValFt.Hide();
+ }
+
+ // Bestimmung des Dateinamens
+ String aFile( pInfoItem->GetValue() );
+ String aFactory( aFile );
+ if ( aFile.Len() > 2 && aFile.GetChar(0) == '[' )
+ {
+ USHORT nPos = aFile.Search( ']' );
+ aFactory = aFile.Copy( 1, nPos-1 );
+ aFile = aFile.Copy( nPos+1 );
+ }
+
+ // Bestimmung des Namens
+ String aName;
+ const SfxPoolItem* pItem = 0;
+ if ( SFX_ITEM_SET != rSet.GetItemState( ID_FILETP_TITLE, FALSE, &pItem ) )
+ {
+ INetURLObject aURL(aFile);
+ aName = aURL.GetName( INetURLObject::DECODE_WITH_CHARSET );
+ if ( !aName.Len() || aURL.GetProtocol() == INET_PROT_PRIVATE )
+ aName = String( SfxResId( STR_NONAME ) );
+ aNameED.SetReadOnly( TRUE );
+ }
+ else
+ {
+ DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ), "SfxDocumentPage:<SfxStringItem> erwartet" );
+ aName = ( ( SfxStringItem* ) pItem )->GetValue();
+ }
+ aNameED.SetText( aName );
+ aNameED.ClearModifyFlag();
+
+ // Bestimmung des R/O-Flags
+ if ( SFX_ITEM_UNKNOWN == rSet.GetItemState( ID_FILETP_READONLY, FALSE, &pItem ) )
+ aReadOnlyCB.Hide();
+ else
+ aReadOnlyCB.Check( ( (SfxBoolItem*)pItem )->GetValue() );
+
+ // Bestimmung des Kontextsymbols
+ INetURLObject aURL;
+ aURL.SetSmartProtocol( INET_PROT_FILE );
+ aURL.SetSmartURL( aFactory);
+ const String& rMainURL = aURL.GetMainURL();
+ aBmp1.SetImage( SfxExplorerFile::GetImage( aURL, TRUE ) );
+
+ // Bestimmung von Groesse und Typ
+ String aSizeText( aUnknownSize );
+ if ( aURL.GetProtocol() == INET_PROT_FILE )
+ aSizeText = CreateSizeText( SfxContentHelper::GetSize( aURL.PathToFileName() ) );
+ aShowSizeFT.SetText( aSizeText );
+ String aDescription( SfxResId( STR_SFX_NEWOFFICEDOC ) );
+ if ( aURL.GetLastName().Len() )
+ aDescription = SfxExplorerFile::GetDescription( rMainURL );
+ aShowTypeFT.SetText( aDescription );
+
+ // Bestimmung des Ortes
+ aURL.SetSmartURL( aFile);
+ if ( aURL.GetProtocol() == INET_PROT_FILE )
+ {
+ INetURLObject aPath( aURL );
+ aPath.setFinalSlash();
+ aPath.removeSegment();
+ String aText( aPath.PathToFileName() ); //! (pb) MaxLen?
+ aFileValFt.SetText( aText );
+ }
+ else if ( aURL.GetProtocol() != INET_PROT_PRIVATE )
+ aFileValFt.SetText( aURL.GetPartBeforeLastName() );
+
+ // Zugriffsdaten
+ const SfxStamp& rCreated = rInfo.GetCreated();
+ aCreateValFt.SetText( ConvertDateTime_Impl( rCreated ) );
+ const SfxStamp& rChanged = rInfo.GetChanged();
+ if ( rCreated != rChanged && rChanged.IsValid() )
+ aChangeValFt.SetText( ConvertDateTime_Impl( rChanged ) );
+ const SfxStamp& rPrinted = rInfo.GetPrinted();
+ if ( rPrinted != rCreated && rPrinted.IsValid())
+ aPrintValFt.SetText( ConvertDateTime_Impl( rPrinted ) );
+ const long nTime = rInfo.GetTime();
+ if( 1 || nTime ) //!!!
+ {
+ const Time aTime( nTime );
+ const International& rInter = Application::GetAppInternational();
+ aTimeLogValFt.SetText( rInter.GetDuration( aTime ) );
+ }
+ aDocNoValFt.SetText( String::CreateFromInt32( rInfo.GetDocumentNumber() ) );
+
+ TriState eState = (TriState)rInfo.IsUseUserData();
+
+ if ( STATE_DONTKNOW == eState )
+ aUseUserDataCB.EnableTriState( TRUE );
+
+ aUseUserDataCB.SetState( eState );
+ aUseUserDataCB.SaveValue();
+ aUseUserDataCB.Enable( bEnableUseUserData );
+ bHandleDelete = FALSE;
+ aDeleteBtn.Enable( bEnableUseUserData );
+}
+
+//------------------------------------------------------------------------
+
+SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet ) :
+
+ SfxTabPage( pParent, SfxResId( TP_DOCINFORELOAD ), rItemSet ),
+
+ aReloadEnabled ( this, ResId( CB_AUTORELOAD ) ),
+ aFTSeconds ( this, ResId( FT_SECONDS ) ),
+ aReloadDelay ( this, ResId( ED_SECONDS ) ),
+ aFTURL ( this, ResId( FT_URL ) ),
+ aReloadURL ( this, ResId( ED_URL ) ),
+ aFTTarget ( this, ResId( FT_DEFAULT ) ),
+ aTargets ( this, ResId( LB_DEFAULT ) ),
+
+ pInfoItem( NULL )
+
+{
+ FreeResource();
+ pInfoItem = &(SfxDocumentInfoItem &)rItemSet.Get(SID_DOCINFO);
+ SfxDocumentInfo& rInfo = (*pInfoItem)();
+ TargetList aList;
+ SfxViewFrame* pFrame = SfxViewFrame::Current();
+ if( pFrame && ( pFrame = pFrame->GetTopViewFrame() ))
+ {
+ pFrame->GetTargetList( aList );
+
+ for( USHORT nPos = (USHORT)aList.Count(); nPos; )
+ {
+ String* pObj = aList.GetObject( --nPos );
+ aTargets.InsertEntry( *pObj );
+ delete pObj;
+ }
+ }
+ aTargets.SetText( rInfo.GetDefaultTarget() );
+ aReloadEnabled.SetClickHdl(LINK(this, SfxInternetPage, ClickHdl));
+}
+
+//------------------------------------------------------------------------
+
+IMPL_LINK( SfxInternetPage, ClickHdl, Control*, pCtrl )
+{
+ if ( pCtrl == &aReloadEnabled )
+ {
+ aFTSeconds.Enable( aReloadEnabled.IsChecked() );
+ aReloadDelay.Enable( aReloadEnabled.IsChecked() );
+ }
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxInternetPage::FillItemSet( SfxItemSet& rSet )
+{
+ // Pruefung, ob sich etwas geaendert hat
+ const BOOL bReloadEnabled = aReloadEnabled.IsChecked();
+ const BOOL bReloadModified = aReloadEnabled.GetSavedValue() !=
+ bReloadEnabled;
+ const BOOL bReloadURLModified = aReloadURL.IsModified();
+ String aTargetFrame( aTargets.GetText() );
+ const BOOL bTargetModified = aOldTarget != aTargetFrame;
+ const BOOL bReloadDelayModified = aReloadDelay.IsModified();
+ if( !( bReloadDelayModified || bTargetModified || bReloadURLModified ||
+ bReloadModified ) )
+ {
+ return FALSE;
+ }
+
+ // Speicherung der Aenderungen
+ const SfxPoolItem *pItem;
+ SfxDocumentInfoItem *pInfo;
+ SfxTabDialog* pDlg = GetTabDialog();
+ const SfxItemSet* pExSet = NULL;
+
+ if ( pDlg )
+ pExSet = pDlg->GetExampleSet();
+
+ if ( pExSet &&
+ SFX_ITEM_SET != pExSet->GetItemState(SID_DOCINFO, TRUE, &pItem) )
+ pInfo = pInfoItem;
+ else
+ pInfo = new SfxDocumentInfoItem(*(const SfxDocumentInfoItem *)pItem);
+
+ SfxDocumentInfo& rInfo = (*pInfo)();
+ if( bReloadModified )
+ {
+ rInfo.EnableReload( bReloadEnabled );
+ }
+ if( bReloadDelayModified )
+ {
+ rInfo.SetReloadDelay( aReloadDelay.GetValue() );
+ }
+ if( bReloadURLModified )
+ {
+ String a2ReloadURL( aReloadURL.GetText() );
+ if ( a2ReloadURL.Len() )
+ {
+ a2ReloadURL = URIHelper::SmartRelToAbs( a2ReloadURL );
+ }
+ rInfo.SetReloadURL( a2ReloadURL );
+ }
+ if( bTargetModified )
+ {
+ rInfo.SetDefaultTarget( aTargetFrame );
+ }
+ rSet.Put( *pInfo );
+ if( pInfo != pInfoItem )
+ delete pInfo;
+ return TRUE;
+}
+
+//------------------------------------------------------------------------
+
+SfxTabPage *SfxInternetPage::Create( Window* pParent, const SfxItemSet& rItemSet )
+{
+ return new SfxInternetPage(pParent, rItemSet);
+}
+
+//------------------------------------------------------------------------
+
+void SfxInternetPage::Reset( const SfxItemSet& rSet )
+{
+ pInfoItem = &(SfxDocumentInfoItem &)rSet.Get(SID_DOCINFO);
+ SfxDocumentInfo& rInfo = (*pInfoItem)();
+
+ aReloadEnabled.Check( rInfo.IsReloadEnabled() );
+ aReloadEnabled.SaveValue();
+ aReloadDelay.SetValue( rInfo.GetReloadDelay() );
+ aReloadURL.SetText( rInfo.GetReloadURL() );
+ aTargets.SetText( rInfo.GetDefaultTarget() );
+ ClickHdl( &aReloadEnabled );
+
+ if ( rInfo.IsReadOnly() )
+ {
+ aReloadEnabled.Disable();
+ aReloadDelay.Disable();
+ aReloadURL.SetReadOnly( TRUE );
+ aTargets.SetReadOnly( TRUE );
+ }
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentUserPage::SfxDocumentUserPage( Window* pParent,
+ const SfxItemSet& rItemSet ) :
+
+ SfxTabPage( pParent, SfxResId( TP_DOCINFOUSER ), rItemSet ),
+
+ aInfo1Ft ( this, ResId( FT_INFO1 ) ),
+ aInfo2Ft ( this, ResId( FT_INFO2 ) ),
+ aInfo3Ft ( this, ResId( FT_INFO3 ) ),
+ aInfo4Ft ( this, ResId( FT_INFO4 ) ),
+ aInfo1Ed ( this, ResId( ED_INFO1 ) ),
+ aInfo2Ed ( this, ResId( ED_INFO2 ) ),
+ aInfo3Ed ( this, ResId( ED_INFO3 ) ),
+ aInfo4Ed ( this, ResId( ED_INFO4 ) ),
+ aEditLabelBtn ( this, ResId( BTN_EDITLABEL ) ),
+
+ bLabelModified ( FALSE ),
+ pInfoItem ( NULL )
+
+{
+ FreeResource();
+ aEditLabelBtn.SetClickHdl( LINK( this, SfxDocumentUserPage, EditLabelHdl ) );
+}
+
+//------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentUserPage, EditLabelHdl, PushButton *, pPushButton )
+{
+ SfxDocInfoEditDlg* pDlg = new SfxDocInfoEditDlg( this );
+ pDlg->SetText1( aInfo1Ft.GetText().EraseAllChars( '~' ) );
+ pDlg->SetText2( aInfo2Ft.GetText().EraseAllChars( '~' ) );
+ pDlg->SetText3( aInfo3Ft.GetText().EraseAllChars( '~' ) );
+ pDlg->SetText4( aInfo4Ft.GetText().EraseAllChars( '~' ) );
+
+ if ( RET_OK == pDlg->Execute() )
+ {
+ aShortcuts.Erase();
+ aInfo1Ft.SetText( CreateShortcutTitle( pDlg->GetText1() ) );
+ aInfo2Ft.SetText( CreateShortcutTitle( pDlg->GetText2() ) );
+ aInfo3Ft.SetText( CreateShortcutTitle( pDlg->GetText3() ) );
+ aInfo4Ft.SetText( CreateShortcutTitle( pDlg->GetText4() ) );
+ bLabelModified = TRUE;
+ }
+ delete pDlg;
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+XubString SfxDocumentUserPage::CreateShortcutTitle( const XubString& rTitle )
+{
+ USHORT nPos;
+
+ if ( !aShortcuts.Len() )
+ {
+ XubString aText = aEditLabelBtn.GetText().ToLowerAscii();
+ nPos = aText.Search( '~' );
+ if ( nPos != STRING_NOTFOUND && nPos != aText.Len() - 1 )
+ aShortcuts = aText.GetChar( nPos + 1 );
+ }
+ XubString aTitle = rTitle;
+ aTitle.ToLowerAscii();
+ const char* pcTitle = U2S(aTitle).getStr();
+ FASTBOOL bFound = FALSE;
+ nPos = 0;
+
+ while ( *pcTitle && !bFound )
+ {
+ char cChar = *pcTitle;
+ if ( ByteString( cChar ).IsAlphaNumericAscii() &&
+ aShortcuts.Search( cChar ) == STRING_NOTFOUND )
+ {
+ bFound = TRUE;
+ aShortcuts += cChar;
+ }
+ else
+ {
+ pcTitle++;
+ nPos++;
+ }
+ }
+
+ if ( !bFound )
+ nPos = 0;
+
+ XubString aShortcutTitle = rTitle;
+ aShortcutTitle.Insert( '~', nPos );
+ return aShortcutTitle;
+}
+
+//------------------------------------------------------------------------
+
+SfxTabPage* SfxDocumentUserPage::Create( Window* pParent, const SfxItemSet& rItemSet )
+{
+ return new SfxDocumentUserPage(pParent, rItemSet);
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentUserPage::FillItemSet( SfxItemSet& rSet )
+{
+ const BOOL bMod = bLabelModified ||
+ aInfo1Ed.IsModified() || aInfo2Ed.IsModified() ||
+ aInfo3Ed.IsModified() || aInfo4Ed.IsModified();
+ if ( !bMod )
+ return FALSE;
+
+ const SfxPoolItem* pItem = 0;
+ SfxDocumentInfoItem* pInfo = 0;
+ SfxTabDialog* pDlg = GetTabDialog();
+ const SfxItemSet* pExSet = NULL;
+
+ if ( pDlg )
+ pExSet = pDlg->GetExampleSet();
+
+ if ( pExSet &&
+ SFX_ITEM_SET != pExSet->GetItemState(SID_DOCINFO, TRUE, &pItem) )
+ pInfo = pInfoItem;
+ else
+ pInfo = new SfxDocumentInfoItem( *(const SfxDocumentInfoItem*)pItem );
+ SfxDocumentInfo& rInfo = pInfo->GetDocInfo();
+
+ if ( bLabelModified || aInfo1Ed.IsModified() )
+ {
+ XubString aTitle = aInfo1Ft.GetText().EraseAllChars( '~' );
+ rInfo.SetUserKey( SfxDocUserKey( aTitle, aInfo1Ed.GetText() ), 0 );
+ }
+ if ( bLabelModified || aInfo2Ed.IsModified() )
+ {
+ XubString aTitle = aInfo2Ft.GetText().EraseAllChars( '~' );
+ rInfo.SetUserKey( SfxDocUserKey( aTitle, aInfo2Ed.GetText() ), 1 );
+ }
+ if ( bLabelModified || aInfo3Ed.IsModified() )
+ {
+ XubString aTitle = aInfo3Ft.GetText().EraseAllChars( '~' );
+ rInfo.SetUserKey( SfxDocUserKey( aTitle, aInfo3Ed.GetText() ), 2 );
+ }
+ if ( bLabelModified || aInfo4Ed.IsModified() )
+ {
+ XubString aTitle = aInfo4Ft.GetText().EraseAllChars( '~' );
+ rInfo.SetUserKey( SfxDocUserKey( aTitle, aInfo4Ed.GetText() ), 3 );
+ }
+ rSet.Put( *pInfo );
+ if ( pInfo != pInfoItem )
+ delete pInfo;
+ return bMod;
+}
+
+//------------------------------------------------------------------------
+
+void SfxDocumentUserPage::Reset(const SfxItemSet &rSet)
+{
+ pInfoItem = &(SfxDocumentInfoItem&)rSet.Get( SID_DOCINFO );
+ const SfxDocumentInfo& rInfo = pInfoItem->GetDocInfo();
+ aShortcuts.Erase();
+ aInfo1Ft.SetText( CreateShortcutTitle( rInfo.GetUserKey(0).GetTitle() ) );
+ aInfo1Ed.SetText( rInfo.GetUserKey(0).GetWord() );
+ aInfo2Ft.SetText( CreateShortcutTitle( rInfo.GetUserKey(1).GetTitle() ) );
+ aInfo2Ed.SetText( rInfo.GetUserKey(1).GetWord() );
+ aInfo3Ft.SetText( CreateShortcutTitle( rInfo.GetUserKey(2).GetTitle() ) );
+ aInfo3Ed.SetText( rInfo.GetUserKey(2).GetWord() );
+ aInfo4Ft.SetText( CreateShortcutTitle( rInfo.GetUserKey(3).GetTitle() ) );
+ aInfo4Ed.SetText( rInfo.GetUserKey(3).GetWord() );
+ bLabelModified = FALSE;
+
+ if ( rInfo.IsReadOnly() )
+ {
+ aInfo1Ed.SetReadOnly( TRUE );
+ aInfo2Ed.SetReadOnly( TRUE );
+ aInfo3Ed.SetReadOnly( TRUE );
+ aInfo4Ed.SetReadOnly( TRUE );
+ aEditLabelBtn.Disable();
+ }
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
+ const SfxItemSet& rItemSet ) :
+
+ SfxTabDialog( 0, pParent, SfxResId( SID_DOCINFO ), &rItemSet )
+
+{
+ FreeResource();
+
+ const SfxDocumentInfoItem* pInfoItem =
+ &(const SfxDocumentInfoItem &)rItemSet.Get( SID_DOCINFO );
+
+ // Bestimmung des Titels
+ const SfxPoolItem* pItem = 0;
+ String aTitle( GetText() );
+ if ( SFX_ITEM_SET !=
+ rItemSet.GetItemState( SID_EXPLORER_PROPS_START, FALSE, &pItem ) )
+ {
+ // Dateiname
+ String aFile( pInfoItem->GetValue() );
+#ifdef WIN
+ if ( aFile.Len() <= 8 )
+ {
+ String sTmp( SfxResId( STR_NONAME ) );
+ USHORT nLen = Min( (USHORT)8, sTmp.Len() );
+
+ if ( sTmp.Copy( 0, nLen ).Lower() ==
+ aFile.Copy( 0, nLen ).Lower() )
+ {
+ aFile = pInfoItem->GetValue();
+ }
+ }
+#endif
+
+ INetURLObject aURL;
+ aURL.SetSmartProtocol( INET_PROT_FILE );
+ aURL.SetSmartURL( aFile);
+ if ( INET_PROT_PRIV_SOFFICE != aURL.GetProtocol() )
+ {
+ String aLastName( aURL.GetLastName() );
+ if ( aLastName.Len() )
+ aTitle += aLastName;
+ else
+ aTitle += aFile;
+ }
+ else
+ aTitle += String( SfxResId( STR_NONAME ) );
+ }
+ else
+ {
+ DBG_ASSERT( pItem->IsA( TYPE( SfxStringItem ) ),
+ "SfxDocumentInfoDialog:<SfxStringItem> erwartet" );
+ aTitle += ( ( SfxStringItem* ) pItem )->GetValue();
+ }
+ SetText( aTitle );
+
+ // Eigenschaftenseiten
+ AddTabPage(TP_DOCINFODESC, SfxDocumentDescPage::Create, 0);
+ AddTabPage(TP_DOCINFODOC, SfxDocumentPage::Create, 0);
+ AddTabPage(TP_DOCINFOUSER, SfxDocumentUserPage::Create, 0);
+ AddTabPage(TP_DOCINFORELOAD, SfxInternetPage::Create, 0);
+}
+
+// -----------------------------------------------------------------------
+
+void SfxDocumentInfoDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
+{
+ if ( TP_DOCINFODOC == nId )
+ ( (SfxDocumentPage&)rPage ).EnableUseUserData();
+}
+
+
diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc
new file mode 100644
index 000000000000..8c25566b4f6b
--- /dev/null
+++ b/sfx2/source/dialog/dinfdlg.hrc
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfdlg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _DINFDLG_HRC
+#define _DINFDLG_HRC
+
+// defines ---------------------------------------------------------------
+
+#define FT_FILE 1
+#define FT_FILE_VAL 2
+#define FT_CHANGE 3
+#define FT_CHANGE_VAL 4
+#define FT_CREATE 7
+#define FT_CREATE_VAL 8
+#define FT_TITLE 9
+#define ED_TITLE 10
+#define FT_THEMA 11
+#define ED_THEMA 12
+#define FT_KEYWORDS 13
+#define ED_KEYWORDS 14
+#define FT_INFO1 15
+#define ED_INFO1 16
+#define FT_INFO2 17
+#define ED_INFO2 18
+#define FT_INFO3 19
+#define ED_INFO3 20
+#define FT_INFO4 21
+#define ED_INFO4 22
+#define FT_COMMENT 23
+#define ED_COMMENT 24
+#define GB_INFO 30
+#define FT_TEMPL 32
+#define FT_TEMPL_VAL 33
+#define BTN_EDITLABEL 34
+#define FT_TIMELOG 35
+#define FT_TIMELOG_VAL 36
+#define FT_DOCNO 37
+#define FT_DOCNO_VAL 38
+#define CB_AUTORELOAD 39
+#define ED_SECONDS 41
+#define FT_SECONDS 42
+#define FT_URL 43
+#define ED_URL 44
+#define LB_DEFAULT 46
+#define FT_DEFAULT 47
+#define CB_FILE_READONLY 48
+#define CB_USE_USERDATA 49
+#define BMP_FILE_1 50
+#define ED_FILE_NAME 51
+#define FL_FILE_1 52
+#define FT_FILE_TYP 53
+#define FT_FILE_SHOW_TYP 54
+#define FT_FILE_SIZE 55
+#define FT_FILE_SHOW_SIZE 56
+#define FL_FILE_2 57
+#define FT_PRINT 58
+#define FT_PRINT_VAL 59
+#define STR_UNKNOWNSIZE 60
+#define FL_FILE_3 61
+#define BTN_DELETE 62
+
+
+#endif
+
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
new file mode 100644
index 000000000000..a25251139ccf
--- /dev/null
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -0,0 +1,1026 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfdlg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+ // include ---------------------------------------------------------------
+
+#include "sfx.hrc"
+#include "helpid.hrc"
+#include "dinfdlg.hrc"
+
+ // TP_DOCINFODESC --------------------------------------------------------
+
+TabPage TP_DOCINFODESC
+{
+ HelpId = HID_DOCINFODESC ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ FixedText FT_TITLE
+ {
+ Pos = MAP_APPFONT ( 6 , 7 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Left = TRUE ;
+ Text = "~Titel" ;
+ Text [ ENGLISH ] = "~Title" ;
+ Text [ norwegian ] = "~Tittel" ;
+ Text [ italian ] = "~Titolo" ;
+ Text [ portuguese_brazilian ] = "~Ttulo" ;
+ Text [ portuguese ] = "~Ttulo" ;
+ Text [ finnish ] = "~Arvo" ;
+ Text [ danish ] = "Titel" ;
+ Text [ french ] = "~Titre" ;
+ Text [ swedish ] = "~Rubrik" ;
+ Text [ dutch ] = "~Titel" ;
+ Text [ spanish ] = "~Ttulo" ;
+ Text [ english_us ] = "~Title" ;
+ Text[ chinese_simplified ] = "(~T)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Tytu";
+ Text[ japanese ] = "(~T)";
+ Text[ chinese_traditional ] = "D(~T)";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~T)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "~Balk";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_TITLE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 6 ) ;
+ Size = MAP_APPFONT ( 184 , 12 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ MaxTextLength = 63 ;
+ };
+ FixedText FT_THEMA
+ {
+ Pos = MAP_APPFONT ( 6 , 22 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Left = TRUE ;
+ Text = "Th~ema" ;
+ Text [ ENGLISH ] = "~Subject" ;
+ Text [ norwegian ] = "~Emne" ;
+ Text [ italian ] = "Oggetto" ;
+ Text [ portuguese_brazilian ] = "~Assunto" ;
+ Text [ portuguese ] = "~Assunto" ;
+ Text [ finnish ] = "~Aihe" ;
+ Text [ danish ] = "Emne" ;
+ Text [ french ] = "~Sujet" ;
+ Text [ swedish ] = "T~ema" ;
+ Text [ dutch ] = "~Onderwerp" ;
+ Text [ spanish ] = "~Tema" ;
+ Text [ english_us ] = "~Subject" ;
+ Text[ chinese_simplified ] = "(~S)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Temat";
+ Text[ japanese ] = "ð(~S)";
+ Text[ chinese_traditional ] = "DD(~S)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~S)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "K~onu";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_THEMA
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 21 ) ;
+ Size = MAP_APPFONT ( 184 , 12 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ MaxTextLength = 63 ;
+ };
+ FixedText FT_KEYWORDS
+ {
+ Pos = MAP_APPFONT ( 6 , 37 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Left = TRUE ;
+ Text = "~Schlsselwrter" ;
+ Text [ ENGLISH ] = "~Keywords" ;
+ Text [ norwegian ] = "~Nkkelord" ;
+ Text [ italian ] = "~Parole chiave" ;
+ Text [ portuguese_brazilian ] = "~Palavras-chave" ;
+ Text [ portuguese ] = "~Palavras-chave" ;
+ Text [ finnish ] = "A~vainsanat" ;
+ Text [ danish ] = "Ngleord" ;
+ Text [ french ] = "~Mots-cls" ;
+ Text [ swedish ] = "~Nyckelord" ;
+ Text [ dutch ] = "~Sleutelwoorden" ;
+ Text [ spanish ] = "~Palabras clave" ;
+ Text [ english_us ] = "~Keywords" ;
+ Text[ chinese_simplified ] = "ؼ(~K)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Sowa kluczowe";
+ Text[ japanese ] = "ܰ(~K)";
+ Text[ chinese_traditional ] = "r(~K)";
+ Text[ greek ] = "-";
+ Text[ korean ] = "Ű(~K)";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "~Anahtar szckler";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_KEYWORDS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 36 ) ;
+ Size = MAP_APPFONT ( 184 , 12 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ MaxTextLength = 127 ;
+ };
+ FixedText FT_COMMENT
+ {
+ Pos = MAP_APPFONT ( 6 , 52 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Left = TRUE ;
+ Text = "~Beschreibung" ;
+ Text [ ENGLISH ] = "~Description" ;
+ Text [ norwegian ] = "~Description" ;
+ Text [ italian ] = "~Descrizione" ;
+ Text [ portuguese_brazilian ] = "~Descrio" ;
+ Text [ portuguese ] = "~Descrio" ;
+ Text [ finnish ] = "~Kuvaus" ;
+ Text [ danish ] = "Beskrivelse" ;
+ Text [ french ] = "~Description" ;
+ Text [ swedish ] = "~Beskrivning" ;
+ Text [ dutch ] = "~Beschrijving" ;
+ Text [ spanish ] = "~Descripcin" ;
+ Text [ english_us ] = "~Comment" ;
+ Text[ chinese_simplified ] = "˵(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Opis";
+ Text[ japanese ] = "(~C)";
+ Text[ chinese_traditional ] = "yz(~C)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~C)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "~Tanm";
+ Text[ language_user1 ] = " ";
+ };
+ MultiLineEdit ED_COMMENT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 51 ) ;
+ Size = MAP_APPFONT ( 184 , 78 ) ;
+ IgnoreTab = TRUE ;
+ Left = TRUE ;
+ MaxTextLength = 255 ;
+ VScroll = TRUE ;
+ };
+};
+
+ // TP_DOCINFODOC ---------------------------------------------------------
+
+TabPage TP_DOCINFODOC
+{
+ HelpId = HID_DOCINFODOC ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ FixedImage BMP_FILE_1
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 20 , 20 ) ;
+ };
+ Edit ED_FILE_NAME
+ {
+ Pos = MAP_APPFONT ( 54 , 8 ) ;
+ Size = MAP_APPFONT ( 200 , 12 ) ;
+ Border = TRUE ;
+ };
+ FixedLine FL_FILE_1
+ {
+ Pos = MAP_APPFONT ( 6 , 25 ) ;
+ Size = MAP_APPFONT ( 248 , 1 ) ;
+ };
+ FixedText FT_FILE_TYP
+ {
+ Pos = MAP_APPFONT ( 6 , 29 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Typ:" ;
+ Text [ ENGLISH ] = "Type:" ;
+ Text [ english_us ] = "Type:" ;
+ Text [ italian ] = "Tipo:" ;
+ Text [ spanish ] = "Tipo:" ;
+ Text [ french ] = "Type :" ;
+ Text [ dutch ] = "Type:" ;
+ Text [ swedish ] = "Typ:" ;
+ Text [ danish ] = "Type:" ;
+ Text [ portuguese_brazilian ] = "Typ:" ;
+ Text [ portuguese ] = "Tipo:" ;
+ Text[ chinese_simplified ] = "ͣ";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Typ:";
+ Text[ japanese ] = ":";
+ Text[ chinese_traditional ] = "G";
+ Text[ greek ] = ":";
+ Text[ korean ] = ":";
+ Text[ arabic ] = ":";
+ Text[ turkish ] = "Tip:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_FILE_SHOW_TYP
+ {
+ Pos = MAP_APPFONT ( 54 , 29 ) ;
+ Size = MAP_APPFONT ( 106 , 10 ) ;
+ };
+ CheckBox CB_FILE_READONLY
+ {
+ Pos = MAP_APPFONT ( 163 , 29 ) ;
+ Size = MAP_APPFONT ( 91 , 10 ) ;
+ Text = "~Schreibgeschtzt" ;
+ Text [ ENGLISH ] = "~Readonly" ;
+ Text [ english_us ] = "~Read-only" ;
+ Text [ portuguese_brazilian ] = "~Schreibgeschtzt" ;
+ Text [ swedish ] = "~Skrivskyddad" ;
+ Text [ danish ] = "Skrivebeskyttet" ;
+ Text [ italian ] = "~Sola lettura" ;
+ Text [ spanish ] = "~Solo lectura" ;
+ Text [ french ] = "~En lecture-seule" ;
+ Text [ dutch ] = "~Schrijfbeveiligd" ;
+ Text [ portuguese ] = "~S leitura" ;
+ Text[ chinese_simplified ] = "д(~R)";
+ Text[ russian ] = "~ ";
+ Text[ polish ] = "Tylko do odczytu";
+ Text[ japanese ] = "ǂݎp(~R)";
+ Text[ chinese_traditional ] = "Ū(~R)";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ȣ(~R)";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "S~alt okunur";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_FILE
+ {
+ Pos = MAP_APPFONT ( 6 , 41 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Ort:" ;
+ Text [ ENGLISH ] = "Location:" ;
+ Text [ english_us ] = "Location:" ;
+ Text [ italian ] = "Posizione file:" ;
+ Text [ spanish ] = "Ubicacin:" ;
+ Text [ french ] = "Emplacement :" ;
+ Text [ dutch ] = "Plaats:" ;
+ Text [ swedish ] = "Plats:" ;
+ Text [ danish ] = "Placering:" ;
+ Text [ portuguese_brazilian ] = "Ort:" ;
+ Text [ portuguese ] = "Local:" ;
+ Text[ chinese_simplified ] = "λã";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Lokalizacja:";
+ Text[ japanese ] = "ꏊ:";
+ Text[ chinese_traditional ] = "mG";
+ Text[ greek ] = ":";
+ Text[ korean ] = "ġ:";
+ Text[ arabic ] = ":";
+ Text[ turkish ] = "Yer:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_FILE_VAL
+ {
+ Pos = MAP_APPFONT ( 54 , 41 ) ;
+ Size = MAP_APPFONT ( 200 , 10 ) ;
+ };
+ FixedText FT_FILE_SIZE
+ {
+ Pos = MAP_APPFONT ( 6 , 53 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Gre:" ;
+ Text [ ENGLISH ] = "Size:" ;
+ Text [ english_us ] = "Size:" ;
+ Text [ italian ] = "Dimensione:" ;
+ Text [ spanish ] = "Tamao:" ;
+ Text [ french ] = "Taille :" ;
+ Text [ dutch ] = "Grootte:" ;
+ Text [ swedish ] = "Storlek:" ;
+ Text [ danish ] = "Strrelse:" ;
+ Text [ portuguese_brazilian ] = "Gre:" ;
+ Text [ portuguese ] = "Tamanho:" ;
+ Text[ chinese_simplified ] = "С";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Rozmiar:";
+ Text[ japanese ] = ":";
+ Text[ chinese_traditional ] = "jpG";
+ Text[ greek ] = ":";
+ Text[ korean ] = "ũ:";
+ Text[ arabic ] = ":";
+ Text[ turkish ] = "Byklk:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_FILE_SHOW_SIZE
+ {
+ Pos = MAP_APPFONT ( 54 , 53 ) ;
+ Size = MAP_APPFONT ( 200 , 10 ) ;
+ };
+ FixedLine FL_FILE_2
+ {
+ Pos = MAP_APPFONT ( 6 , 66 ) ;
+ Size = MAP_APPFONT ( 248 , 1 ) ;
+ };
+ FixedText FT_CREATE
+ {
+ Pos = MAP_APPFONT ( 6 , 70 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Erstellt am:" ;
+ Text [ ENGLISH ] = "Created:" ;
+ Text [ english_us ] = "Created:" ;
+ Text [ italian ] = "Creato il:" ;
+ Text [ spanish ] = "Creado el:" ;
+ Text [ french ] = "Cr le :" ;
+ Text [ dutch ] = "Gemaakt op:" ;
+ Text [ swedish ] = "Skapat:" ;
+ Text [ danish ] = "Oprettet den:" ;
+ Text [ portuguese_brazilian ] = "Erstellt am:" ;
+ Text [ portuguese ] = "Criado em:" ;
+ Text[ chinese_simplified ] = "ڣ";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Utworzony:";
+ Text[ japanese ] = "쐬:";
+ Text[ chinese_traditional ] = "s@G";
+ Text[ greek ] = " :";
+ Text[ korean ] = "ۼ:";
+ Text[ arabic ] = " :";
+ Text[ turkish ] = "Oluturma tarihi:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_CREATE_VAL
+ {
+ Pos = MAP_APPFONT ( 54 , 70 ) ;
+ Size = MAP_APPFONT ( 126 , 10 ) ;
+ };
+ FixedText FT_TIMELOG
+ {
+ Pos = MAP_APPFONT ( 183 , 70 ) ;
+ Size = MAP_APPFONT ( 38 , 10 ) ;
+ Text = "Bearbeitet:" ;
+ Text [ ENGLISH ] = "Edit time:" ;
+ Text [ norwegian ] = "Edit time:" ;
+ Text [ italian ] = "Modificato:" ;
+ Text [ portuguese_brazilian ] = "Edit time:" ;
+ Text [ portuguese ] = "Editado:" ;
+ Text [ french ] = "Dure d'ouverture :" ;
+ Text [ dutch ] = "Bewerkt:" ;
+ Text [ spanish ] = "Abierto desde :" ;
+ Text [ danish ] = "Redigeret:" ;
+ Text [ swedish ] = "Redigeringstid:" ;
+ Text [ finnish ] = "Edit time:" ;
+ Text [ english_us ] = "Accessed:" ;
+ Text[ chinese_simplified ] = "༭ʱ䣺";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Edytowany:";
+ Text[ japanese ] = "ҏW:";
+ Text[ chinese_traditional ] = "sG";
+ Text[ greek ] = ":";
+ Text[ korean ] = ":";
+ Text[ arabic ] = ":";
+ Text[ turkish ] = "Dnzleme:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_TIMELOG_VAL
+ {
+ Pos = MAP_APPFONT ( 224 , 70 ) ;
+ Size = MAP_APPFONT ( 30 , 10 ) ;
+ };
+ FixedText FT_CHANGE
+ {
+ Pos = MAP_APPFONT ( 6 , 82 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Gendert am:" ;
+ Text [ ENGLISH ] = "Changed:" ;
+ Text [ english_us ] = "Modified:" ;
+ Text [ italian ] = "Cambiato" ;
+ Text [ spanish ] = "Modificado el:" ;
+ Text [ french ] = "Modifi le :" ;
+ Text [ dutch ] = "Gewijzigd op:" ;
+ Text [ swedish ] = "ndrat:" ;
+ Text [ danish ] = "ndret den:" ;
+ Text [ portuguese_brazilian ] = "Gendert am:" ;
+ Text [ portuguese ] = "Alterado em:" ;
+ Text[ chinese_simplified ] = "ĵڣ";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Zmodyfikowany:";
+ Text[ japanese ] = "ύX:";
+ Text[ chinese_traditional ] = "ܧ󪺤G";
+ Text[ greek ] = " :";
+ Text[ korean ] = ":";
+ Text[ arabic ] = " :";
+ Text[ turkish ] = "Deitirme tarihi:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_CHANGE_VAL
+ {
+ Pos = MAP_APPFONT ( 54 , 82 ) ;
+ Size = MAP_APPFONT ( 126 , 10 ) ;
+ };
+ FixedText FT_DOCNO
+ {
+ Pos = MAP_APPFONT ( 183 , 82 ) ;
+ Size = MAP_APPFONT ( 38 , 10 ) ;
+ Text = "Version:" ;
+ Text [ ENGLISH ] = "Version:" ;
+ Text [ english_us ] = "Version:" ;
+ Text [ portuguese_brazilian ] = "Nmero do documento:" ;
+ Text [ swedish ] = "Version:" ;
+ Text [ danish ] = "Version:" ;
+ Text [ italian ] = "Versione:" ;
+ Text [ spanish ] = "Versin:" ;
+ Text [ french ] = "Version :" ;
+ Text [ dutch ] = "Versie:" ;
+ Text [ portuguese ] = "Verso:" ;
+ Text[ chinese_simplified ] = "汾";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Wersja:";
+ Text[ japanese ] = "ްޮ:";
+ Text[ chinese_traditional ] = "G";
+ Text[ greek ] = ":";
+ Text[ korean ] = ":";
+ Text[ arabic ] = ":";
+ Text[ turkish ] = "Srm:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_DOCNO_VAL
+ {
+ Pos = MAP_APPFONT ( 224 , 82 ) ;
+ Size = MAP_APPFONT ( 30 , 10 ) ;
+ };
+ FixedText FT_PRINT
+ {
+ Pos = MAP_APPFONT ( 6 , 94 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Gedruckt am:" ;
+ Text [ ENGLISH ] = "Last printed:" ;
+ Text [ english_us ] = "Printed:" ;
+ Text [ italian ] = "Stampato il:" ;
+ Text [ spanish ] = "Impreso el:" ;
+ Text [ french ] = "Imprim le :" ;
+ Text [ dutch ] = "Afgedrukt op:" ;
+ Text [ swedish ] = "Utskrivet den:" ;
+ Text [ danish ] = "Udskrevet den:" ;
+ Text [ portuguese_brazilian ] = "Gedruckt am:" ;
+ Text [ portuguese ] = "Impresso em:" ;
+ Text[ chinese_simplified ] = "ӡڣ";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Wydrukowany:";
+ Text[ japanese ] = "ꂽ:";
+ Text[ chinese_traditional ] = "CLG";
+ Text[ greek ] = " :";
+ Text[ korean ] = "μ:";
+ Text[ arabic ] = " :";
+ Text[ turkish ] = "Yazdrma tarihi:";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_PRINT_VAL
+ {
+ Pos = MAP_APPFONT ( 54 , 94 ) ;
+ Size = MAP_APPFONT ( 126 , 10 ) ;
+ };
+ PushButton BTN_DELETE
+ {
+ Pos = MAP_APPFONT ( 204 , 102 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Hide = TRUE;
+ Text = "~Lschen";
+ Text[English] = "~Delete";
+ Text[ english_us ] = "~Delete";
+ Text[ portuguese ] = "E~liminar";
+ Text[ russian ] = "~";
+ Text[ greek ] = "";
+ Text[ dutch ] = "~Wissen";
+ Text[ french ] = "~Supprimer";
+ Text[ spanish ] = "~Eliminar";
+ Text[ italian ] = "~Elimina";
+ Text[ danish ] = "Slet";
+ Text[ swedish ] = "~Radera";
+ Text[ polish ] = "~Usu";
+ Text[ portuguese_brazilian ] = "~Delete";
+ Text[ japanese ] = "폜(~D)";
+ Text[ korean ] = "(~D)";
+ Text[ chinese_simplified ] = "ɾ(~D)";
+ Text[ chinese_traditional ] = "R(~D)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "~Sil";
+ };
+ CheckBox CB_USE_USERDATA
+ {
+ Pos = MAP_APPFONT ( 6 , 106 ) ;
+ Size = MAP_APPFONT ( 174 , 10 ) ;
+ Hide = TRUE;
+ Text = "~Benutzerdaten verwenden" ;
+ Text[English] = "~Using user data";
+ Text[french] = "~Utiliser les donnes d'identit";
+ Text [ italian ] = "Usa i dati utente" ;
+ Text [ dutch ] = "~Gebruikersgegevens toepassen" ;
+ Text [ spanish ] = "Utilice los ~datos del usuario" ;
+ Text [ swedish ] = "Anvnd ~anvndardata" ;
+ Text [ portuguese ] = "Usar dados do ~utilizador";
+ Text[ portuguese_brazilian ] = "~Benutzerdaten verwenden";
+ Text[ danish ] = "Anvend brugerdata";
+ Text[ english_us ] = "~Apply user data";
+ Text[ chinese_simplified ] = "ʹ(~A)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zast~osuj dane uytkownika";
+ Text[ japanese ] = "հް ްgp";
+ Text[ chinese_traditional ] = "ĥΨϥΪ̸(~A)";
+ Text[ greek ] = " ~ ";
+ Text[ korean ] = " ̿(~A)";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "~Kullanc verilerini kullan";
+ Text[ language_user1 ] = " ";
+ };
+ FixedLine FL_FILE_3
+ {
+ Pos = MAP_APPFONT ( 6 , 119 ) ;
+ Size = MAP_APPFONT ( 248 , 1 ) ;
+ };
+ FixedText FT_TEMPL
+ {
+ Pos = MAP_APPFONT ( 6 , 123 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Vorlage:" ;
+ Text [ ENGLISH ] = "Template:" ;
+ Text [ norwegian ] = "Mal:" ;
+ Text [ italian ] = "Modello:" ;
+ Text [ portuguese_brazilian ] = "Modelo:" ;
+ Text [ portuguese ] = "Modelo:" ;
+ Text [ finnish ] = "Mallipohja:" ;
+ Text [ danish ] = "Skabelon:" ;
+ Text [ french ] = "Modle :" ;
+ Text [ swedish ] = "Mall:" ;
+ Text [ dutch ] = "Sjabloon:" ;
+ Text [ spanish ] = "Plantilla:" ;
+ Text [ english_us ] = "Template:" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = ":";
+ Text[ polish ] = "Szablon:";
+ Text[ japanese ] = "ڰ:";
+ Text[ chinese_traditional ] = "˦G";
+ Text[ language_user1 ] = " ";
+ Text[ greek ] = ":";
+ Text[ korean ] = ":";
+ Text[ arabic ] = ":";
+ Text[ turkish ] = "ablon:";
+ };
+ FixedText FT_TEMPL_VAL
+ {
+ Pos = MAP_APPFONT ( 54 , 123 ) ;
+ Size = MAP_APPFONT ( 200 , 10 ) ;
+ };
+ String STR_UNKNOWNSIZE
+ {
+ Text = "unbekannt" ;
+ Text [ English ] = "unknown" ;
+ Text [ english_us ] = "unknown" ;
+ Text [ portuguese_brazilian ] = "unbekannt" ;
+ Text [ swedish ] = "oknd" ;
+ Text [ danish ] = "ukendt" ;
+ Text [ italian ] = "sconosciuto" ;
+ Text [ spanish ] = "desconocido" ;
+ Text [ french ] = "inconnu" ;
+ Text [ dutch ] = "onbekend" ;
+ Text [ portuguese ] = "desconhecido" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "nieznany";
+ Text[ japanese ] = "s";
+ Text[ chinese_traditional ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "˷ ";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "bilinmiyor";
+ Text[ language_user1 ] = " ";
+ };
+};
+
+ // TP_DOCINFOUSER --------------------------------------------------------
+
+TabPage TP_DOCINFOUSER
+{
+ HelpId = HID_DOCINFOUSER ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ FixedText FT_INFO1
+ {
+ Pos = MAP_APPFONT ( 6 , 7 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ Text = "Info ~0" ;
+ Left = TRUE ;
+ };
+ Edit ED_INFO1
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 72 , 6 ) ;
+ Size = MAP_APPFONT ( 182 , 12 ) ;
+ Left = TRUE ;
+ MaxTextLength = 19 ;
+ };
+ FixedText FT_INFO2
+ {
+ Pos = MAP_APPFONT ( 6 , 22 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ Text = "Info ~1" ;
+ Left = TRUE ;
+ };
+ Edit ED_INFO2
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 72 , 21 ) ;
+ Size = MAP_APPFONT ( 182 , 12 ) ;
+ Left = TRUE ;
+ MaxTextLength = 19 ;
+ };
+ FixedText FT_INFO3
+ {
+ Pos = MAP_APPFONT ( 6 , 37 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ Text = "Info ~2" ;
+ Left = TRUE ;
+ };
+ Edit ED_INFO3
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 72 , 36 ) ;
+ Size = MAP_APPFONT ( 182 , 12 ) ;
+ Left = TRUE ;
+ MaxTextLength = 19 ;
+ };
+ FixedText FT_INFO4
+ {
+ Pos = MAP_APPFONT ( 6 , 52 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ Text = "Info ~3" ;
+ Left = TRUE ;
+ };
+ Edit ED_INFO4
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 72 , 51 ) ;
+ Size = MAP_APPFONT ( 182 , 12 ) ;
+ Left = TRUE ;
+ MaxTextLength = 19 ;
+ };
+ PushButton BTN_EDITLABEL
+ {
+ Pos = MAP_APPFONT ( 194 , 115 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ Text = "~Infofelder..." ;
+ Text [ English ] = "~Info fields..." ;
+ Text [ norwegian ] = "Informajonsfelter..." ;
+ Text [ italian ] = "Campi info..." ;
+ Text [ portuguese_brazilian ] = "Camos de Info..." ;
+ Text [ portuguese ] = "~Campos de informao" ;
+ Text [ finnish ] = "Tietokentt..." ;
+ Text [ danish ] = "Infofelter..." ;
+ Text [ french ] = "~Champs d'information..." ;
+ Text [ swedish ] = "~Infoflt..." ;
+ Text [ dutch ] = "~Infovelden..." ;
+ Text [ spanish ] = "Ca~mpo informacin..." ;
+ Text [ english_us ] = "~Info fields..." ;
+ TabStop = TRUE ;
+ Text[ chinese_simplified ] = "Ϣֶ(~I)...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Pola infor~macyjne...";
+ Text[ japanese ] = "̨(~I)...";
+ Text[ chinese_traditional ] = "T(~I)...";
+ Text[ greek ] = " ...";
+ Text[ korean ] = " ʵ(~I)...";
+ Text[ arabic ] = " ...";
+ Text[ turkish ] = "~Bilgi alanlar...";
+ Text[ language_user1 ] = " ";
+ };
+};
+
+ // TP_DOCINFOUSER --------------------------------------------------------
+
+TabPage TP_DOCINFORELOAD
+{
+ HelpId = HID_DOCINFORELOAD ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ CheckBox CB_AUTORELOAD
+ {
+ Pos = MAP_APPFONT ( 72 , 7 ) ;
+ Size = MAP_APPFONT ( 80 , 10 ) ;
+ Text = "~Autoreload alle" ;
+ Text [ English ] = "~Autoreload every" ;
+ Text [ english_us ] = "~Auto reload every" ;
+ Text [ italian ] = "~Autoricarica" ;
+ Text [ spanish ] = "~Autorecargar cada" ;
+ Text [ french ] = "~Page suivante au bout de" ;
+ Text [ dutch ] = "~Autoreload alle" ;
+ Text [ swedish ] = "~Ladda automatiskt efter" ;
+ Text [ danish ] = "Autogenindls efter" ;
+ Text [ portuguese_brazilian ] = "~Autoreload alle" ;
+ Text [ portuguese ] = "~Autocarregar cada" ;
+ Text[ chinese_simplified ] = "ȫԶװ(~A)";
+ Text[ russian ] = "~ ";
+ Text[ polish ] = "Przea~duj automatycznie co";
+ Text[ japanese ] = "IɍXV(~A)";
+ Text[ chinese_traditional ] = "s۰ʸ˸(~A)";
+ Text[ greek ] = "~ ";
+ Text[ korean ] = " ڵ ٽ ε(~A)";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "~Otm. yeniden ykleme";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField ED_SECONDS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 155 , 6 ) ;
+ Size = MAP_APPFONT ( 30 , 12 ) ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+/* Maximum = 300 ; */
+ First = 1 ;
+ Last = 60 ;
+ SpinSize = 1 ;
+ };
+ FixedText FT_SECONDS
+ {
+ Pos = MAP_APPFONT ( 188 , 7 ) ;
+ Size = MAP_APPFONT ( 66 , 10 ) ;
+ Text = "~Sekunden" ;
+ Text [ English ] = "~Seconds" ;
+ Text [ english_us ] = "~seconds" ;
+ Text [ italian ] = "~Secondi" ;
+ Text [ spanish ] = "~Segundos" ;
+ Text [ french ] = "~secondes" ;
+ Text [ dutch ] = "~seconden" ;
+ Text [ swedish ] = "~sekund(er)" ;
+ Text [ danish ] = "Sekunder" ;
+ Text [ portuguese_brazilian ] = "~Sekunden" ;
+ Text [ portuguese ] = "~segundos" ;
+ Text[ chinese_simplified ] = "(~S)";
+ Text[ russian ] = "()";
+ Text[ polish ] = "Sekundy";
+ Text[ japanese ] = "b(~S)";
+ Text[ chinese_traditional ] = "(~S)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~S)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "~saniyede bir";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_URL
+ {
+ Pos = MAP_APPFONT ( 6 , 22 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ Text = "~URL" ;
+ Text [ English ] = "~URL" ;
+ Text [ english_us ] = "~URL" ;
+ Text [ italian ] = "~URL" ;
+ Text [ spanish ] = "~URL" ;
+ Text [ french ] = "~URL" ;
+ Text [ dutch ] = "~URL" ;
+ Text [ swedish ] = "~URL" ;
+ Text [ danish ] = "URL" ;
+ Text [ portuguese_brazilian ] = "~URL" ;
+ Text [ portuguese ] = "~URL" ;
+ Text[ chinese_simplified ] = "~URL";
+ Text[ russian ] = "~URL";
+ Text[ polish ] = "URL";
+ Text[ japanese ] = "URL(~U)";
+ Text[ chinese_traditional ] = "~URL";
+ Text[ greek ] = "~URL";
+ Text[ korean ] = "URL(~U)";
+ Text[ arabic ] = "URL~";
+ Text[ turkish ] = "~URL";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_URL
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 72 , 21 ) ;
+ Size = MAP_APPFONT ( 182 , 12 ) ;
+ };
+ FixedText FT_DEFAULT
+ {
+ Pos = MAP_APPFONT ( 6 , 37 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ Text = "~Frame" ;
+ Text [ English ] = "~Frame" ;
+ Text [ english_us ] = "Frame" ;
+ Text [ italian ] = "~Frame" ;
+ Text [ spanish ] = "Frame" ;
+ Text [ french ] = "~Frame" ;
+ Text [ dutch ] = "~Frame" ;
+ Text [ swedish ] = "~Ram" ;
+ Text [ danish ] = "Frame" ;
+ Text [ portuguese_brazilian ] = "~Frame" ;
+ Text [ portuguese ] = "~Frame" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "~";
+ Text[ polish ] = "Ramka";
+ Text[ japanese ] = "ڰ";
+ Text[ chinese_traditional ] = "T";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ arabic ] = "~Frame";
+ Text[ turkish ] = "~Frame";
+ Text[ language_user1 ] = " ";
+ };
+ ComboBox LB_DEFAULT
+ {
+ Pos = MAP_APPFONT ( 72 , 36 ) ;
+ Size = MAP_APPFONT ( 182 , 60 ) ;
+ DropDown = TRUE ;
+ };
+};
+
+ // SID_DOCINFO -----------------------------------------------------------
+
+TabDialog SID_DOCINFO
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Moveable = TRUE ;
+ Text = "Eigenschaften von " ;
+ Text [ English ] = "Properties of " ;
+ Text [ english_us ] = "Properties of " ;
+ Text [ italian ] = "Propriet di " ;
+ Text [ spanish ] = "Propiedades de " ;
+ Text [ french ] = "Proprits de " ;
+ Text [ dutch ] = "Eigenschappen van " ;
+ Text [ swedish ] = "Egenskaper fr " ;
+ Text [ danish ] = "Egenskaber af " ;
+ Text [ portuguese_brazilian ] = "Eigenschaften von " ;
+ Text [ portuguese ] = "Propriedades de " ;
+ Text[ chinese_simplified ] = "ԣ ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Waciwoci ";
+ Text[ japanese ] = "è ";
+ Text[ chinese_traditional ] = "ݩʡG ";
+ TabControl 1
+ {
+ SVLook = TRUE ;
+ PageList =
+ {
+ PageItem
+ {
+ Identifier = TP_DOCINFODOC ;
+ Text = "Allgemein" ;
+ Text [ English ] = "Common" ;
+ Text [ english_us ] = "General" ;
+ Text [ italian ] = "Generale" ;
+ Text [ spanish ] = "General" ;
+ Text [ french ] = "Gnral" ;
+ Text [ dutch ] = "Algemeen" ;
+ Text [ swedish ] = "Allmnt" ;
+ Text [ danish ] = "Generelt" ;
+ Text [ portuguese_brazilian ] = "Allgemein" ;
+ Text [ portuguese ] = "Geral" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Oglne";
+ Text[ japanese ] = "S";
+ Text[ chinese_traditional ] = "@";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ϲ";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "Genel";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_DOCINFODESC ;
+ Text = "Beschreibung" ;
+ Text [ English ] = "Description" ;
+ Text [ english_us ] = "Description" ;
+ Text [ italian ] = "Descrizione" ;
+ Text [ spanish ] = "Descripcin" ;
+ Text [ french ] = "Description" ;
+ Text [ dutch ] = "Beschrijving" ;
+ Text [ swedish ] = "Beskrivning" ;
+ Text [ danish ] = "Beskrivelse" ;
+ Text [ portuguese_brazilian ] = "Beschreibung" ;
+ Text [ portuguese ] = "Descrio" ;
+ Text[ chinese_simplified ] = "˵";
+ Text[ russian ] = "";
+ Text[ polish ] = "Opis";
+ Text[ japanese ] = "Tv";
+ Text[ chinese_traditional ] = "yz";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "Tanm";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_DOCINFOUSER ;
+ Text = "Benutzer" ;
+ Text [ English ] = "User" ;
+ Text [ norwegian ] = "User" ;
+ Text [ italian ] = "Utente" ;
+ Text [ portuguese_brazilian ] = "Usurio" ;
+ Text [ portuguese ] = "Utilizador" ;
+ Text [ finnish ] = "Kyttj" ;
+ Text [ danish ] = "Bruger" ;
+ Text [ french ] = "Utilisateur" ;
+ Text [ swedish ] = "Anvndare" ;
+ Text [ dutch ] = "Gebruiker" ;
+ Text [ spanish ] = "Usuario" ;
+ Text [ english_us ] = "User Defined" ;
+ Text[ chinese_simplified ] = "ʹ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Uytkownik";
+ Text[ japanese ] = "հް";
+ Text[ chinese_traditional ] = "ϥΪ";
+ Text[ greek ] = "";
+ Text[ korean ] = " ";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "Kullanc";
+ Text[ language_user1 ] = " ";
+ };
+ PageItem
+ {
+ Identifier = TP_DOCINFORELOAD ;
+ Text = "Internet" ;
+ Text [ English ] = "Internet" ;
+ Text [ dutch ] = "Internet" ;
+ Text [ english_us ] = "Internet" ;
+ Text [ italian ] = "Internet" ;
+ Text [ spanish ] = "Internet" ;
+ Text [ french ] = "Internet" ;
+ Text [ swedish ] = "Internet" ;
+ Text [ danish ] = "Internet" ;
+ Text [ portuguese_brazilian ] = "Internet" ;
+ Text [ portuguese ] = "Internet" ;
+ Text[ chinese_simplified ] = "ʻ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Internet";
+ Text[ japanese ] = "ȯ";
+ Text[ chinese_traditional ] = "Internet";
+ Text[ greek ] = "Internet";
+ Text[ korean ] = "ͳ";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "Internet";
+ Text[ language_user1 ] = " ";
+ };
+ };
+ };
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "zellikler ";
+ Text[ language_user1 ] = " ";
+};
+
+ // ********************************************************************** EOF
diff --git a/sfx2/source/dialog/dinfedt.cxx b/sfx2/source/dialog/dinfedt.cxx
new file mode 100644
index 000000000000..9e7643864fb6
--- /dev/null
+++ b/sfx2/source/dialog/dinfedt.cxx
@@ -0,0 +1,99 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfedt.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "dinfedt.hxx"
+#include "sfxresid.hxx"
+
+#include "sfx.hrc"
+#include "dinfedt.hrc"
+
+// class InfoEdit_Impl ---------------------------------------------------
+
+void InfoEdit_Impl::KeyInput( const KeyEvent& rKEvent )
+{
+ if ( rKEvent.GetCharCode() != '~' )
+ Edit::KeyInput( rKEvent );
+}
+
+/*--------------------------------------------------------------------
+ Beschreibung: Init-Liste
+ --------------------------------------------------------------------*/
+
+SfxDocInfoEditDlg::SfxDocInfoEditDlg( Window* pParent ) :
+
+ ModalDialog( pParent, SfxResId( DLG_DOCINFO_EDT ) ),
+
+ aInfo1ED ( this, ResId( ED_INFO1 ) ),
+ aInfo2ED ( this, ResId( ED_INFO2 ) ),
+ aInfo3ED ( this, ResId( ED_INFO3 ) ),
+ aInfo4ED ( this, ResId( ED_INFO4 ) ),
+ aOkBT ( this, ResId( BT_OK ) ),
+ aCancelBT ( this, ResId( BT_CANCEL ) ),
+ aHelpBtn ( this, ResId( BTN_HELP ) ),
+ aInfoGB ( this, ResId( GB_INFO ) )
+
+{
+ FreeResource();
+}
+
+
diff --git a/sfx2/source/dialog/dinfedt.hrc b/sfx2/source/dialog/dinfedt.hrc
new file mode 100644
index 000000000000..0b1aee0d0065
--- /dev/null
+++ b/sfx2/source/dialog/dinfedt.hrc
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfedt.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define BT_OK 1
+#define BT_CANCEL 2
+#define BTN_HELP 3
+#define FT_INFO1 4
+#define ED_INFO1 5
+#define FT_INFO2 6
+#define ED_INFO2 7
+#define FT_INFO3 8
+#define ED_INFO3 9
+#define FT_INFO4 10
+#define ED_INFO4 11
+#define GB_INFO 12
diff --git a/sfx2/source/dialog/dinfedt.src b/sfx2/source/dialog/dinfedt.src
new file mode 100644
index 000000000000..87ad39e69a50
--- /dev/null
+++ b/sfx2/source/dialog/dinfedt.src
@@ -0,0 +1,174 @@
+/*************************************************************************
+ *
+ * $RCSfile: dinfedt.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "helpid.hrc"
+#include "dinfedt.hrc"
+ // pragma ----------------------------------------------------------------
+
+ // DLG_DOCINFO_EDT -------------------------------------------------------
+ModalDialog DLG_DOCINFO_EDT
+{
+ HelpId = HID_DOCINFO_EDT ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 166 , 83 ) ;
+ Text = "Infonamen bearbeiten" ;
+ Text [ ENGLISH ] = "Edit info names" ;
+ Text [ norwegian ] = "Rediger informasjonnavn" ;
+ Text [ italian ] = "Modifica informazioni nomi" ;
+ Text [ portuguese_brazilian ] = "Editar nomes de info" ;
+ Text [ portuguese ] = "Editar nomes das informaes" ;
+ Text [ finnish ] = "Muokkaa tietonimi" ;
+ Text [ danish ] = "Rediger infonavne" ;
+ Text [ french ] = "dition des noms de champs" ;
+ Text [ swedish ] = "Redigera informationsnamn" ;
+ Text [ dutch ] = "Labels bewerken" ;
+ Text [ spanish ] = "Editar nombres informaciones" ;
+ Text [ english_us ] = "Edit Labels" ;
+ Moveable = TRUE ;
+ Edit ED_INFO1
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 86 , 12 ) ;
+ MaxTextLength = 19 ;
+ };
+ Edit ED_INFO2
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 29 ) ;
+ Size = MAP_APPFONT ( 86 , 12 ) ;
+ MaxTextLength = 19 ;
+ };
+ Edit ED_INFO3
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 44 ) ;
+ Size = MAP_APPFONT ( 86 , 12 ) ;
+ MaxTextLength = 19 ;
+ };
+ Edit ED_INFO4
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 59 ) ;
+ Size = MAP_APPFONT ( 86 , 12 ) ;
+ MaxTextLength = 19 ;
+ };
+ GroupBox GB_INFO
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 98 , 74 ) ;
+ Text = "Namen" ;
+ Text [ English ] = "Names" ;
+ Text [ norwegian ] = "Names" ;
+ Text [ italian ] = "Nomi" ;
+ Text [ portuguese_brazilian ] = "Nomes" ;
+ Text [ portuguese ] = "Nomes" ;
+ Text [ finnish ] = "~Nimet" ;
+ Text [ danish ] = "Navne" ;
+ Text [ french ] = "Noms" ;
+ Text [ swedish ] = "Namn" ;
+ Text [ dutch ] = "Namen" ;
+ Text [ spanish ] = "Nombres" ;
+ Text [ english_us ] = "Names" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Nazwy";
+ Text[ japanese ] = "O";
+ Text[ chinese_traditional ] = "W";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̸";
+ Text[ turkish ] = "Ad";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BT_OK
+ {
+ Pos = MAP_APPFONT ( 110 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 110 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( 110 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ Text[ chinese_simplified ] = "༭";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Edytuj nazwy informacji";
+ Text[ japanese ] = "񖼂ҏW";
+ Text[ chinese_traditional ] = "sD";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "̸ ";
+ Text[ turkish ] = "Etiketleri dzenle";
+ Text[ language_user1 ] = " ";
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
new file mode 100644
index 000000000000..585d1eb71c26
--- /dev/null
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -0,0 +1,1542 @@
+/*************************************************************************
+ *
+ * $RCSfile: dockwin.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifdef VCL
+#ifndef _SV_DECOVIEW_HXX
+#include <vcl/decoview.hxx>
+#endif
+#endif
+#pragma hdrstop
+
+#include "dockwin.hxx"
+#include "bindings.hxx"
+#include "viewfrm.hxx"
+#include "dispatch.hxx"
+#include "workwin.hxx"
+#include "splitwin.hxx"
+#include "viewsh.hxx"
+#include "accmgr.hxx"
+
+#define MAX_TOGGLEAREA_WIDTH 100 // max. 100 Pixel
+#define MAX_TOGGLEAREA_HEIGHT 100 // max. 100 Pixel
+
+class SfxDockingWindow_Impl
+{
+friend class SfxDockingWindow;
+
+ SfxChildAlignment eLastAlignment;
+ SfxChildAlignment eDockAlignment;
+ BOOL bConstructed;
+ Size aMinSize;
+ SfxSplitWindow* pSplitWin;
+ BOOL bSplitable;
+// BOOL bAutoHide;
+
+ // Folgende members sind nur in der Zeit von StartDocking bis EndDocking
+ // g"ultig:
+ BOOL bEndDocked;
+ Size aSplitSize;
+ USHORT nLine;
+ USHORT nPos;
+ USHORT nDockLine;
+ USHORT nDockPos;
+ BOOL bNewLine;
+
+ SfxChildAlignment GetLastAlignment() const
+ { return eLastAlignment; }
+ void SetLastAlignment(SfxChildAlignment eAlign)
+ { eLastAlignment = eAlign; }
+ SfxChildAlignment GetDockAlignment() const
+ { return eDockAlignment; }
+ void SetDockAlignment(SfxChildAlignment eAlign)
+ { eDockAlignment = eAlign; }
+};
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::Resize()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse DockingWindow merkt sich ggf. eine
+ ver"anderte FloatingSize.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ auch SfxDockingWindow::Resize() gerufen werden.
+*/
+{
+ DockingWindow::Resize();
+
+ SfxSplitWindow *pSplit = pImp->pSplitWin;
+ if ( pSplit )
+ {
+ // Die ItemSize des DockingWindows ist immer prozentual, kann sich
+ // also nur "andern, wenn gesplittet wird (->SfxSplitWindow::Split())
+/*
+ long nWinSize = pSplit->GetItemSize( GetType() );
+ if ( pSplit->IsHorizontal() )
+ pImp->aSplitSize.Width() = nWinSize;
+ else
+ pImp->aSplitSize.Height() = nWinSize;
+*/
+/*
+ // Die ItemSize des ItemSets ist immer absolut in Pixeln
+ if ( pSplit->IsHorizontal() )
+ pImp->aSplitSize.Height() = GetOutputSizePixel().Height();
+ else
+ pImp->aSplitSize.Width() = GetOutputSizePixel().Width();
+*/
+ }
+ else
+ {
+ Invalidate();
+ if ( IsFloatingMode() && !GetFloatingWindow()->IsRollUp() )
+ SetFloatingSize(GetOutputSizePixel());
+ }
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDockingWindow::PrepareToggleFloatingMode()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse DockingWindow erm"oglicht ein Eingreifen
+ in das Umschalten des floating mode.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ danach SfxDockingWindow::PrepareToggleFloatingMode() gerufen werden,
+ wenn nicht FALSE zur"uckgegeben wird.
+*/
+
+{
+ if (!pImp->bConstructed)
+ return TRUE;
+
+ if ( Application::IsInModalMode() && IsFloatingMode() || !pMgr )
+ return FALSE;
+
+ if (!IsFloatingMode())
+ {
+ // Testen, ob FloatingMode erlaubt ist
+ if (CheckAlignment(GetAlignment(),SFX_ALIGN_NOALIGNMENT) !=
+ SFX_ALIGN_NOALIGNMENT)
+ return FALSE;
+
+ if ( pImp->pSplitWin )
+ {
+ // Das DockingWindow sitzt in einem SplitWindow und wird abgerissen
+ pImp->pSplitWin->RemoveWindow(this, FALSE);
+ pImp->pSplitWin = 0;
+ }
+ }
+ else if ( pMgr )
+ {
+ // Testen, ob es erlaubt ist, anzudocken
+ if (CheckAlignment(GetAlignment(),pImp->GetLastAlignment()) ==
+ SFX_ALIGN_NOALIGNMENT)
+ return FALSE;
+
+ // Testen, ob das Workwindow gerade ein Andocken erlaubt
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ if ( !pWorkWin->IsDockingAllowed() )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::ToggleFloatingMode()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse DockingWindow setzt die internen
+ Daten des SfxDockingWindow und sorgt f"ur korrektes Alignment am
+ parent window.
+ Durch PrepareToggleFloatMode und Initialize ist sichergestellt, da\s
+ pImp->GetLastAlignment() immer eine erlaubtes Alignment liefert.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ zuerst SfxDockingWindow::ToggleFloatingMode() gerufen werden.
+*/
+{
+ if ( !pImp->bConstructed || !pMgr )
+ return; // Kein Handler-Aufruf
+
+ // Altes Alignment merken und dann umschalten.
+ // Sv hat jetzt schon umgeschaltet, aber Alignment am SfxDockingWindow
+ // ist noch das alte!
+ // Was war ich bisher ?
+ SfxChildAlignment eLastAlign = GetAlignment();
+
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ SfxChildIdentifier eIdent = SFX_CHILDWIN_DOCKINGWINDOW;
+ if ( pImp->bSplitable )
+ eIdent = SFX_CHILDWIN_SPLITWINDOW;
+
+ if (IsFloatingMode())
+ {
+ SetAlignment(SFX_ALIGN_NOALIGNMENT);
+ SetOutputSizePixel( GetFloatingSize() );
+ if ( pImp->bSplitable && !pImp->bEndDocked )
+ // Wenn das Fenster vorher in einem SplitWindow lag, kommt von
+ // Sv kein Show
+ Show();
+ }
+ else
+ {
+ if (pImp->GetDockAlignment() == eLastAlign)
+ {
+ // Wenn ToggleFloatingMode aufgerufen wurde, das DockAlignment
+ // aber noch unver"andert ist, mu\s das ein Toggeln durch DClick
+ // gewesen sein, also LastAlignment verwenden
+ SetAlignment (pImp->GetLastAlignment());
+ if ( pImp->bSplitable )
+ {
+// if ( GetFloatingSize().Height() < pImp->aSplitSize.Height() )
+// pImp->aSplitSize.Height() = GetFloatingSize().Height();
+// if ( GetFloatingSize().Width() < pImp->aSplitSize.Width() )
+// pImp->aSplitSize.Width() = GetFloatingSize().Width();
+ }
+ else
+ SetSizePixel( CalcDockingSize(GetAlignment()) );
+ }
+ else
+ {
+ // Toggeln wurde durch Draggen ausgel"ost
+ pImp->nLine = pImp->nDockLine;
+ pImp->nPos = pImp->nDockPos;
+ SetAlignment (pImp->GetDockAlignment());
+ }
+
+ if ( pImp->bSplitable )
+ {
+ // Das DockingWindow kommt jetzt in ein SplitWindow
+ pImp->pSplitWin = pWorkWin->GetSplitWindow_Impl(GetAlignment());
+
+ // Das LastAlignment ist jetzt immer noch das zuletzt angedockte
+ SfxSplitWindow *pSplit =
+ pWorkWin->GetSplitWindow_Impl(pImp->GetLastAlignment());
+ DBG_ASSERT(pSplit, "LastAlignment kann nicht stimmen!");
+ if ( pSplit && pSplit != pImp->pSplitWin )
+ pSplit->ReleaseWindow_Impl(this);
+ if ( pImp->GetDockAlignment() == eLastAlign )
+ pImp->pSplitWin->InsertWindow(this, pImp->aSplitSize);
+ else
+ pImp->pSplitWin->InsertWindow(this, pImp->aSplitSize,
+ pImp->nLine,pImp->nPos,pImp->bNewLine);
+ if ( !pImp->pSplitWin->IsFadeIn() )
+ pImp->pSplitWin->FadeIn();
+ }
+ }
+
+ // altes Alignment festhalten f"ur n"achstes Togglen; erst jetzt setzen
+ // wg. Abmelden beim SplitWindow!
+ pImp->SetLastAlignment(eLastAlign);
+
+ // DockAlignment zur"ucksetzen, falls noch EndDocking gerufen wird
+ pImp->SetDockAlignment(GetAlignment());
+
+ // SfxChildWindow korrekt andocken bzw. entdocken
+ if ( pMgr )
+ pWorkWin->ConfigChild_Impl( eIdent, SFX_TOGGLEFLOATMODE, pMgr->GetType() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::StartDocking()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse DockingWindow holt vom parent window
+ das innere und "au\sere docking rectangle.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ am Ende SfxDockingWindow::StartDocking() gerufen werden.
+*/
+{
+ if ( !pImp->bConstructed || !pMgr )
+ return;
+ SfxChildIdentifier eIdent = SFX_CHILDWIN_DOCKINGWINDOW;
+ if ( pImp->bSplitable )
+ eIdent = SFX_CHILDWIN_SPLITWINDOW;
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ pWorkWin->ConfigChild_Impl( eIdent, SFX_SETDOCKINGRECTS, pMgr->GetType() );
+ pImp->SetDockAlignment(GetAlignment());
+
+ if ( pImp->pSplitWin )
+ {
+ // Die aktuellen Docking-Daten besorgen
+ pImp->pSplitWin->GetWindowPos(this, pImp->nLine, pImp->nPos);
+ pImp->nDockLine = pImp->nLine;
+ pImp->nDockPos = pImp->nPos;
+ pImp->bNewLine = FALSE;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDockingWindow::Docking( const Point& rPos, Rectangle& rRect )
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse DockingWindow berechnet das aktuelle
+ tracking rectangle. Dazu benutzt sie die Methode CalcAlignment(rPos,rRect),
+ deren Verhalten von abgeleiteten Klassen beeinflu\st werden kann (s.u.).
+ Diese Methode sollte nach M"oglichkeit nicht "uberschrieben werden.
+*/
+{
+ if ( Application::IsInModalMode() )
+ return TRUE;
+
+ if ( !pImp->bConstructed || !pMgr )
+ {
+ rRect.SetSize( Size() );
+ return IsFloatingMode();
+ }
+
+ BOOL bFloatMode = FALSE;
+ if ( GetOuterRect().IsInside( rPos ) && !IsDockingPrevented() )
+ {
+ // Maus innerhalb OuterRect : Alignment und Rectangle berechnen
+ SfxChildAlignment eAlign = CalcAlignment(rPos, rRect);
+ if (eAlign == SFX_ALIGN_NOALIGNMENT)
+ bFloatMode = TRUE;
+ pImp->SetDockAlignment(eAlign);
+ }
+ else
+ {
+ // Maus nicht innerhalb OuterRect : muss FloatingWindow sein
+ // Ist das erlaubt ?
+ if (CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_NOALIGNMENT) !=
+ SFX_ALIGN_NOALIGNMENT)
+ return FALSE;
+ bFloatMode = TRUE;
+ if ( SFX_ALIGN_NOALIGNMENT != pImp->GetDockAlignment() )
+ {
+ // wg. SV-Bug darf rRect nur ver"andert werden, wenn sich das
+ // Alignment "andert !
+ pImp->SetDockAlignment(SFX_ALIGN_NOALIGNMENT);
+ rRect.SetSize(CalcDockingSize(SFX_ALIGN_NOALIGNMENT));
+ }
+ }
+
+ if ( SFX_ALIGN_NOALIGNMENT == pImp->GetDockAlignment() ||
+ (pImp->bSplitable) )
+ {
+ // Falls durch ein ver"andertes tracking rectangle die Mausposition
+ // nicht mehr darin liegt, mu\s die Position des rectangles noch
+ // angepa\st werden
+
+ Point aMouseOffset;
+ aMouseOffset.X() = rRect.Left() - rPos.X();
+ aMouseOffset.Y() = rRect.Top() - rPos.Y();
+
+ if ( (rPos.X() < rRect.Left()) || (rPos.X() > rRect.Right()) )
+ {
+ rRect.SetPos( rPos );
+ rRect.Move( -5, aMouseOffset.Y() );
+ }
+
+ if ( (rPos.Y() < rRect.Top()) || (rPos.Y() > rRect.Bottom()) )
+ {
+ rRect.SetPos( rPos );
+ rRect.Move( aMouseOffset.X(), -5 );
+ }
+ }
+ else if ( !pImp->bSplitable )
+ {
+ // Bei individuell angedocktem Window wird die Position durch das
+ // Alignment und die docking rects festgelegt.
+ Size aSize = rRect.GetSize();
+ Point aPos;
+
+ switch ( pImp->GetDockAlignment() )
+ {
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ aPos = aInnerRect.TopLeft();
+ if ( pImp->GetDockAlignment() == GetAlignment() )
+ aPos.X() -= aSize.Width();
+ break;
+
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ aPos = Point(aOuterRect.Left(), aInnerRect.Top());
+ if ( pImp->GetDockAlignment() == GetAlignment() )
+ aPos.Y() -= aSize.Height();
+ break;
+
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ aPos = Point(aInnerRect.Right() - rRect.GetSize().Width(),
+ aInnerRect.Top());
+ if ( pImp->GetDockAlignment() == GetAlignment() )
+ aPos.X() += aSize.Width();
+ break;
+
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ aPos = Point(aOuterRect.Left(),
+ aInnerRect.Bottom() - rRect.GetSize().Height());
+ if ( pImp->GetDockAlignment() == GetAlignment() )
+ aPos.Y() += aSize.Height();
+ break;
+ }
+
+ rRect.SetPos(aPos);
+ }
+
+ return bFloatMode;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode )
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode der Klasse DockingWindow sorgt f"ur das korrekte
+ Alignment am parent window.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ zuerst SfxDockingWindow::EndDocking() gerufen werden.
+*/
+{
+ if ( !pImp->bConstructed || IsDockingCanceled() || !pMgr )
+ return;
+
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ BOOL bReArrange = FALSE;
+ SfxChildIdentifier eIdent = SFX_CHILDWIN_DOCKINGWINDOW;
+ if ( pImp->bSplitable )
+ {
+ eIdent = SFX_CHILDWIN_SPLITWINDOW;
+
+ // Wenn sich das Alignment "andert und das Fenster befindet sich
+ // im angedockten Zustand in einem SplitWindow, mu\s umgemeldet werden
+ // Wenn neu angedockt wird, machen PrepareToggleFloatingMode()
+ // und ToggleFloatingMode() das Ummelden.
+ if ( !bFloatMode )
+ bReArrange = TRUE;
+ }
+
+ if ( bReArrange )
+ {
+ if ( GetAlignment() != pImp->GetDockAlignment() )
+ {
+ // Vor dem Show() mu\s das Ummelden passiert sein, daher kann nicht
+ // die Basisklasse gerufen werden
+ if ( IsFloatingMode() || !pImp->bSplitable )
+ Show( FALSE, SHOW_NOFOCUSCHANGE );
+
+ // Die Gr"o\se f"urs Toggeln setzen
+ pImp->aSplitSize = rRect.GetSize();
+ if ( IsFloatingMode() )
+ {
+ SetFloatingMode( bFloatMode );
+ if ( IsFloatingMode() || !pImp->bSplitable )
+ Show( TRUE, SHOW_NOFOCUSCHANGE );
+ }
+ else
+ {
+ pImp->pSplitWin->RemoveWindow(this,FALSE);
+ pImp->nLine = pImp->nDockLine;
+ pImp->nPos = pImp->nDockPos;
+ pImp->pSplitWin->ReleaseWindow_Impl(this);
+ pImp->pSplitWin = pWorkWin->GetSplitWindow_Impl(pImp->GetDockAlignment());
+ pImp->pSplitWin->InsertWindow(this, pImp->aSplitSize,
+ pImp->nDockLine, pImp->nDockPos,
+ pImp->bNewLine);
+ if ( !pImp->pSplitWin->IsFadeIn() )
+ pImp->pSplitWin->FadeIn();
+ }
+ }
+ else if ( pImp->nLine != pImp->nDockLine ||
+ pImp->nPos != pImp->nDockPos || pImp->bNewLine )
+ {
+ // Ich wurde innerhalb meines Splitwindows verschoben.
+ if ( pImp->nLine != pImp->nDockLine )
+ pImp->aSplitSize = rRect.GetSize();
+ pImp->pSplitWin->MoveWindow( this, pImp->aSplitSize,
+ pImp->nDockLine, pImp->nDockPos, pImp->bNewLine );
+ }
+ }
+ else
+ {
+ pImp->bEndDocked = TRUE;
+ DockingWindow::EndDocking(rRect, bFloatMode);
+ pImp->bEndDocked = FALSE;
+ }
+
+ SetAlignment(pImp->GetDockAlignment());
+ pWorkWin->ConfigChild_Impl( eIdent, SFX_ALIGNDOCKINGWINDOW, pMgr->GetType() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::Resizing( Size& rSize )
+
+/* [Beschreibung]
+
+ Virtuelle Methode der Klasse DockingWindow.
+ Hier kann das interaktive Umgr"o\sern im FloatingMode beeinflu\t werden,
+ z.B. indem nur diskrete Werte f"ur Breite und/oder H"ohe zugelassen werden.
+ Die Basisimplementation verhindert, da\s die OutputSize kleiner wird als
+ eine mit SetMinOutputSizePixel() gesetzte Gr"o\se.
+*/
+
+{
+ if(rSize.Width() < pImp->aMinSize.Width())
+ rSize.Width() = pImp->aMinSize.Width();
+ if(rSize.Height() < pImp->aMinSize.Height())
+ rSize.Height() = pImp->aMinSize.Height();
+}
+
+//-------------------------------------------------------------------------
+
+SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
+ Window* pParent, WinBits nWinBits) :
+ pBindings(pBindinx),
+ pMgr(pCW),
+ DockingWindow (pParent, nWinBits)
+
+/* [Beschreibung]
+
+ ctor der Klasse SfxDockingWindow. Es wird ein SfxChildWindow ben"otigt,
+ da das Andocken im Sfx "uber SfxChildWindows realisiert wird.
+*/
+
+{
+ ULONG nId = GetHelpId();
+ SetHelpId(0);
+ SetUniqueId( nId );
+
+ pImp = new SfxDockingWindow_Impl;
+ pImp->bConstructed = FALSE;
+ pImp->pSplitWin = 0;
+ pImp->bEndDocked = FALSE;
+
+ pImp->bSplitable = TRUE;
+// pImp->bAutoHide = FALSE;
+
+ // Zun"achst auf Defaults setzen; das Alignment wird in der Subklasse gesetzt
+ pImp->nLine = pImp->nDockLine = 0;
+ pImp->nPos = pImp->nDockPos = 0;
+ pImp->bNewLine = FALSE;
+ pImp->SetLastAlignment(SFX_ALIGN_NOALIGNMENT);
+
+// DBG_ASSERT(pMgr,"DockingWindow erfordert ein SfxChildWindow!");
+}
+
+//-------------------------------------------------------------------------
+
+SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
+ Window* pParent, const ResId& rResId) :
+ pBindings(pBindinx),
+ pMgr(pCW),
+ DockingWindow(pParent, rResId)
+
+/* [Beschreibung]
+
+ ctor der Klasse SfxDockingWindow. Es wird ein SfxChildWindow ben"otigt,
+ da das Andocken im Sfx "uber SfxChildWindows realisiert wird.
+*/
+
+{
+ ULONG nId = GetHelpId();
+ SetHelpId(0);
+ SetUniqueId( nId );
+
+ pImp = new SfxDockingWindow_Impl;
+ pImp->bConstructed = FALSE;
+ pImp->pSplitWin = 0;
+ pImp->bEndDocked = FALSE;
+
+ pImp->bSplitable = TRUE;
+// pImp->bAutoHide = FALSE;
+
+ // Zun"achst auf Defaults setzen; das Alignment wird in der Subklasse gesetzt
+ pImp->nLine = pImp->nDockLine = 0;
+ pImp->nPos = pImp->nDockPos = 0;
+ pImp->bNewLine = FALSE;
+ pImp->SetLastAlignment(SFX_ALIGN_NOALIGNMENT);
+
+// DBG_ASSERT(pMgr,"DockingWindow erfordert ein SfxChildWindow!");
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo)
+
+/* [Beschreibung]
+
+ Initialisierung der Klasse SfxDockingWindow "uber ein SfxChildWinInfo.
+ Die Initialisierung erfolgt erst in einem 2.Schritt nach dem ctor und sollte
+ vom ctor der abgeleiteten Klasse oder vom ctor des SfxChildWindows
+ aufgerufen werden.
+*/
+
+{
+ if ( !pMgr )
+ {
+ // Bugfix #39771
+ pImp->SetDockAlignment( SFX_ALIGN_NOALIGNMENT );
+ pImp->bConstructed = TRUE;
+ return;
+ }
+
+ BOOL bFloatMode = IsFloatingMode();
+ Point aPos;
+ if ( pInfo->aSize.Width() != 0 && pInfo->aSize.Height() != 0 )
+ {
+ // Uebergebene Size und Pos ist immer FloatingSize und FloatingPos.
+ // Bei FloatingWindow ist das auch die aktuelle Size;
+ Size aMinSize( GetMinOutputSizePixel() );
+ if ( pInfo->aSize.Width() < aMinSize.Width() )
+ pInfo->aSize.Width() = aMinSize.Width();
+ if ( pInfo->aSize.Height() < aMinSize.Height() )
+ pInfo->aSize.Height() = aMinSize.Height();
+
+ if ( GetFloatStyle() & WB_SIZEABLE )
+ SetFloatingSize( pInfo->aSize );
+ else
+ SetFloatingSize( GetSizePixel() );
+ pImp->aSplitSize = GetFloatingSize();
+
+ // Falls von FloatingWindow auf DockingWindow umgestellt wurde, gibt
+ // es keinen ExtraString ( Abw"artskompatibel ) und das Alignment
+ // ist SFX_ALIGN_NOALIGNMENT (im ctor zu setzen).
+ if ( pInfo->aExtraString.Len() )
+ {
+ String aStr;
+ USHORT nPos = pInfo->aExtraString.SearchAscii("AL:");
+
+ // Versuche, den Alignment-String "ALIGN:(...)" einzulesen; wenn
+ // er nicht vorhanden ist, liegt eine "altere Version vor
+ if ( nPos != STRING_NOTFOUND )
+ {
+ USHORT n1 = pInfo->aExtraString.Search('(', nPos);
+ if ( n1 != STRING_NOTFOUND )
+ {
+ USHORT n2 = pInfo->aExtraString.Search(')', n1);
+ if ( n2 != STRING_NOTFOUND )
+ {
+ // Alignment-String herausschneiden
+ aStr = pInfo->aExtraString.Copy(nPos, n2 - nPos + 1);
+ pInfo->aExtraString.Erase(nPos, n2 - nPos + 1);
+ aStr.Erase(nPos, n1-nPos+1);
+ }
+ }
+ }
+
+ if ( aStr.Len() )
+ {
+ // Zuerst das Alignment extrahieren
+ SetAlignment( (SfxChildAlignment) (USHORT) aStr.ToInt32() );
+
+ // Um Fehler bei Manipulationen an der INI-Datei zu vermeiden,
+ // wird das Alignment validiert
+ SfxChildAlignment eAlign =
+ CheckAlignment(GetAlignment(),GetAlignment());
+ if ( eAlign != GetAlignment() )
+ {
+ DBG_ERROR("Unsinniges Alignment!");
+ SetAlignment( eAlign );
+ aStr = String();
+ }
+
+ // Dann das LastAlignment
+ nPos = aStr.Search(',');
+ if ( nPos != STRING_NOTFOUND )
+ {
+ aStr.Erase(0, nPos+1);
+ pImp->SetLastAlignment( (SfxChildAlignment) (USHORT) aStr.ToInt32() );
+ }
+
+ // Dann die Splitting-Informationen
+ nPos = aStr.Search(',');
+ if ( nPos != STRING_NOTFOUND )
+ {
+ aStr.Erase(0, nPos+1);
+ SfxIniManager *pAppIniMgr = SFX_APP()->GetAppIniManager();
+ if ( pAppIniMgr->GetPosSize( aStr, aPos, pImp->aSplitSize ) )
+ {
+ pImp->nLine = pImp->nDockLine = (USHORT) aPos.X();
+ pImp->nPos = pImp->nDockPos = (USHORT) aPos.Y();
+ }
+ }
+ }
+ }
+
+ aPos = pInfo->aPos;
+ }
+ else
+ {
+ Size aFloatSize = GetFloatingSize();
+ if ( !aFloatSize.Width() || !aFloatSize.Height())
+ {
+ // Wenn FloatingSize nicht explizit gesetzt ist, wird die aktuelle
+ // Fenstergr"o\se genommen !
+ SetFloatingSize(GetOutputSizePixel());
+ aFloatSize = GetFloatingSize();
+ }
+
+ // Der default f"ur die SplitSize ist die FloatingSize
+ pImp->aSplitSize = aFloatSize;
+ Size aSize = GetParent()->GetOutputSizePixel();
+ aPos = GetFloatingPos();
+ if ( !aPos.X() && !aPos.Y() )
+ {
+ // Wenn nichts gesetzt, FloatingWindow zentrieren
+#ifndef VCL
+ aPos = GetParent()->GetPosPixel();
+#endif
+ aPos.X() += (aSize.Width() - aFloatSize.Width()) / 2;
+ aPos.Y() += (aSize.Height() - aFloatSize.Height()) / 2;
+ }
+ }
+
+#ifdef VCL
+ Point aPoint;
+ Rectangle aRect = GetDesktopRectPixel();
+ Size aSize( GetFloatingSize() );
+
+ aPoint.X() = aRect.Right() - aSize.Width();
+ aPoint.Y() = aRect.Bottom() - aSize.Height();
+
+ aPoint = OutputToScreenPixel( aPoint );
+
+ if ( aPos.X() > aPoint.X() )
+ aPos.X() = aPoint.X() ;
+ if ( aPos.Y() > aPoint.Y() )
+ aPos.Y() = aPoint.Y();
+
+ if ( aPos.X() < 0 ) aPos.X() = 0;
+ if ( aPos.Y() < 0 ) aPos.Y() = 0;
+
+#endif
+
+ SetFloatingPos( aPos );
+
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ if ( GetAlignment() != SFX_ALIGN_NOALIGNMENT )
+ {
+ // Testen, ob das Workwindow gerade ein Andocken erlaubt
+ if ( !pWorkWin->IsDockingAllowed() || ( GetFloatStyle() & WB_STANDALONE )
+ && Application::IsInModalMode() )
+ SetAlignment( SFX_ALIGN_NOALIGNMENT );
+ }
+
+ // ggf. FloatingMode korrekt setzen (ohne Aufruf der Handler, da
+ // pImp->bConstructed noch nicht TRUE ist!)
+ if ( bFloatMode != (GetAlignment() == SFX_ALIGN_NOALIGNMENT) )
+ SetFloatingMode(!bFloatMode);
+
+ if ( pInfo->nFlags & SFX_CHILDWIN_FORCEDOCK )
+ {
+ SetFloatingMode( FALSE );
+ }
+
+
+ if (IsFloatingMode())
+ {
+ GetFloatingWindow()->SetPosPixel(GetFloatingPos());
+ GetFloatingWindow()->SetOutputSizePixel(GetFloatingSize());
+
+ // Leider gibt es von SV kein Resize, also selber machen
+ Resize();
+
+ // Soll das FloatingWindow eingezoomt werden ?
+ if (pInfo && (pInfo->nFlags & SFX_CHILDWIN_ZOOMIN))
+ GetFloatingWindow()->RollUp();
+
+ // LastAlignment "uberpr"ufen
+ SfxChildAlignment eLastAlign = pImp->GetLastAlignment();
+
+ if ( eLastAlign == SFX_ALIGN_NOALIGNMENT)
+ eLastAlign = CheckAlignment(eLastAlign, SFX_ALIGN_LEFT);
+ if ( eLastAlign == SFX_ALIGN_NOALIGNMENT)
+ eLastAlign = CheckAlignment(eLastAlign, SFX_ALIGN_RIGHT);
+ if ( eLastAlign == SFX_ALIGN_NOALIGNMENT)
+ eLastAlign = CheckAlignment(eLastAlign, SFX_ALIGN_TOP);
+ if ( eLastAlign == SFX_ALIGN_NOALIGNMENT)
+ eLastAlign = CheckAlignment(eLastAlign, SFX_ALIGN_BOTTOM);
+ pImp->SetLastAlignment(eLastAlign);
+ }
+ else
+ {
+ pImp->SetLastAlignment(SFX_ALIGN_NOALIGNMENT);
+
+ // Angedockte Fenster werden, sofern sie resizable sind, in ein
+ // SplitWindow eingesetzt
+ if ( pImp->bSplitable && !(pInfo->nFlags & SFX_CHILDWIN_FORCEDOCK) )
+ {
+// pImp->bAutoHide = ( pInfo->nFlags & SFX_CHILDWIN_AUTOHIDE) != 0;
+ SfxViewFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ pImp->pSplitWin = pWorkWin->GetSplitWindow_Impl(GetAlignment());
+ pImp->pSplitWin->InsertWindow(this, pImp->aSplitSize);
+ }
+ else
+ {
+ // Fenster ist individuell angedockt; Gr"o\se berechnen.
+ // Dazu mu\s sie mit der FloatingSize initialisiert werden, falls
+ // irgendwer sich darauf verl"a\st, da\s eine vern"unftige Gr"o\se
+ // gesetz ist
+ SetSizePixel(GetFloatingSize());
+ SetSizePixel(CalcDockingSize(GetAlignment()));
+ }
+ }
+
+ // Ab jetzt d"urfen die DockingHandler aufgerufen werden
+ pImp->SetDockAlignment( GetAlignment() );
+ pImp->bConstructed = TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::FillInfo(SfxChildWinInfo& rInfo) const
+
+/* [Beschreibung]
+
+ F"ullt ein SfxChildWinInfo mit f"ur SfxDockingWindow spezifischen Daten,
+ damit sie in die INI-Datei geschrieben werden koennen.
+ Es wird angenommen, da\s rInfo alle anderen evt. relevanten Daten in
+ der ChildWindow-Klasse erh"alt.
+ Eingetragen werden hier gemerkten Gr"o\sen, das ZoomIn-Flag und die
+ f"ur das Docking relevanten Informationen.
+ Wird diese Methode "uberschrieben, mu\s zuerst die Basisimplementierung
+ gerufen werden.
+*/
+
+{
+ if ( !pMgr )
+ return;
+
+ rInfo.aPos = GetFloatingPos();
+ rInfo.aSize = GetFloatingSize();
+ rInfo.aExtraString += DEFINE_CONST_UNICODE("AL:(");
+ rInfo.aExtraString += String::CreateFromInt32((USHORT) GetAlignment());
+ rInfo.aExtraString += ',';
+ rInfo.aExtraString += String::CreateFromInt32 ((USHORT) pImp->GetLastAlignment());
+ if ( pImp->bSplitable )
+ {
+ rInfo.aExtraString += ',';
+ SfxIniManager *pIniMgr = SFX_INIMANAGER();
+ Point aPos(pImp->nLine, pImp->nPos);
+ rInfo.aExtraString += pIniMgr->GetString( aPos, pImp->aSplitSize );
+ }
+
+ rInfo.aExtraString += ')';
+ if (IsFloatingMode() )
+ {
+ if ( GetFloatingWindow()->IsRollUp() )
+ rInfo.nFlags |= SFX_CHILDWIN_ZOOMIN;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxDockingWindow::~SfxDockingWindow()
+{
+ if ( pMgr && pImp->pSplitWin && pImp->pSplitWin->IsItemValid( GetType() ) )
+ pImp->pSplitWin->RemoveWindow(this);
+ delete pImp;
+}
+
+//-------------------------------------------------------------------------
+
+SfxChildAlignment SfxDockingWindow::CalcAlignment(const Point& rPos, Rectangle& rRect)
+
+/* [Beschreibung]
+
+ Diese Methode berechnet f"ur gegebene Mausposition und tracking rectangle,
+ welches Alignment sich daraus ergeben w"urde. Beim Wechsel des Alignments
+ kann sich auch das tracking rectangle "andern, so dass ein ver"andertes
+ rectangle zur"uckgegeben wird.
+
+ Der Klassenbenutzer kann das Verhalten dieser Methode und damit das Verhalten
+ seiner DockinWindow-Klasse beim Docken beeinflussen, indem er die hier
+ aufgerufene virtuelle Methode
+
+ SfxDockingWindow::CalcDockingSize(SfxChildAlignment eAlign)
+
+ "uberschreibt (s.u.).
+*/
+
+{
+ // Hypothetische Gr"o\sen ausrechnen
+ Size aFloatingSize(CalcDockingSize(SFX_ALIGN_NOALIGNMENT));
+ Size aVerticalSize(CalcDockingSize(SFX_ALIGN_LEFT));
+ Size aHorizontalSize(CalcDockingSize(SFX_ALIGN_TOP));
+
+ // Testen, ob das Workwindow gerade ein Andocken erlaubt
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ if ( !pWorkWin->IsDockingAllowed() )
+ {
+// rRect.SetSize( aFloatingSize );
+ return pImp->GetDockAlignment();
+ }
+
+ long nLeft, nRight, nTop, nBottom;
+ if ( pImp->bSplitable )
+ {
+ Size aSize = pImp->aSplitSize;
+ if ( GetFloatingSize().Height() < aSize.Height() )
+ aSize.Height() = GetFloatingSize().Height();
+ if ( GetFloatingSize().Width() < aSize.Width() )
+ aSize.Width() = GetFloatingSize().Width();
+
+ // die Gr"o\se des Umschaltbereiches sollte begrenzt sein
+ if ( aSize.Width() > MAX_TOGGLEAREA_WIDTH )
+ aSize.Width() = MAX_TOGGLEAREA_WIDTH;
+ if ( aSize.Height() > MAX_TOGGLEAREA_WIDTH )
+ aSize.Height() = MAX_TOGGLEAREA_WIDTH;
+
+ nLeft = nRight = aSize.Width();
+ nTop = nBottom = aSize.Height();
+ }
+ else
+ {
+ nLeft = nRight = aVerticalSize.Width();
+ nTop = nBottom = aHorizontalSize.Height();
+ }
+
+ Rectangle aInRect = GetInnerRect();
+
+ // Inneres Rechteck etwas verkleinern, wenn m"oglich, au\ser wenn das
+ // Fenster an der Kante steht, wo es angedockt ist
+ if ( aInRect.GetWidth() > nLeft )
+ aInRect.Left() += nLeft/2;
+ if ( aInRect.GetWidth() > nRight )
+ aInRect.Right() -= nRight/2;
+ if ( aInRect.GetHeight() > nTop )
+ aInRect.Top() += nTop/2;
+ if ( aInRect.GetHeight() > nBottom )
+ aInRect.Bottom() -= nBottom/2;
+
+ if ( !pImp->pSplitWin ||
+ pImp->nLine == pImp->pSplitWin->GetLineCount()-1 &&
+ pImp->pSplitWin->GetWindowCount(pImp->nLine) == 1)
+ {
+ // Beim Docken mit SplitWindows darf auch au\serhalb angedockt werden,
+ // um eine neue Zeile aufzumachen, es sei denn, das aktuelle Fenster
+ // ist das einzige in der letzten Zeile
+ switch ( GetAlignment() )
+ {
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ aInRect.Left() -= nLeft/2;
+ break;
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ aInRect.Top() -= nTop/2;
+ break;
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ aInRect.Right() += nRight/2;
+ break;
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ aInRect.Bottom() += nBottom/2;
+ break;
+ }
+ }
+
+ // Nun das neue Alignment berechnen
+ SfxChildAlignment eDockAlign = pImp->GetDockAlignment();
+
+ if ( aInRect.IsInside( rPos ) )
+ {
+ // Maus im inneren Rechteck: wird/bleibt FloatingMode
+ eDockAlign = CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_NOALIGNMENT);
+ }
+ else
+ {
+ // Wir befinden uns im Dock-Bereich. Jetzt m"u\sen wir feststellen,
+ // an welcher Kante angedockt werden soll
+
+ Point aInPos( rPos.X()-aInRect.Left(), rPos.Y()-aInRect.Top() );
+ Size aInSize = aInRect.GetSize();
+ BOOL bNoChange = FALSE;
+
+ // Zuerst feststellen, ob das Alignment unver"andert bleiben kann
+ switch ( GetAlignment() )
+ {
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ if (aInPos.X() <= 0)
+ {
+ eDockAlign = GetAlignment();
+ bNoChange = TRUE;
+ }
+ break;
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ if ( aInPos.Y() <= 0)
+ {
+ eDockAlign = GetAlignment();
+ bNoChange = TRUE;
+ }
+ break;
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ if ( aInPos.X() >= aInSize.Width())
+ {
+ eDockAlign = GetAlignment();
+ bNoChange = TRUE;
+ }
+ break;
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ if ( aInPos.Y() >= aInSize.Height())
+ {
+ eDockAlign = GetAlignment();
+ bNoChange = TRUE;
+ }
+ break;
+ default:
+ break;
+ }
+
+ if ( !bNoChange )
+ {
+ // Wenn dem nicht so ist, links/oben/rechts/unten in dieser Reihenfolge
+ // testen
+ BOOL bForbidden = TRUE;
+ if ( aInPos.X() <= 0)
+ {
+ eDockAlign = CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_LEFT);
+ bForbidden = ( eDockAlign != SFX_ALIGN_LEFT &&
+ eDockAlign != SFX_ALIGN_FIRSTLEFT &&
+ eDockAlign != SFX_ALIGN_LASTLEFT );
+ }
+
+ if ( bForbidden && aInPos.Y() <= 0)
+ {
+ eDockAlign = CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_TOP);
+ bForbidden = ( eDockAlign != SFX_ALIGN_TOP &&
+ eDockAlign != SFX_ALIGN_HIGHESTTOP &&
+ eDockAlign != SFX_ALIGN_LOWESTTOP );
+ }
+
+ if ( bForbidden && aInPos.X() >= aInSize.Width())
+ {
+ eDockAlign = CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_RIGHT);
+ bForbidden = ( eDockAlign != SFX_ALIGN_RIGHT &&
+ eDockAlign != SFX_ALIGN_FIRSTRIGHT &&
+ eDockAlign != SFX_ALIGN_LASTRIGHT );
+ }
+
+ if ( bForbidden && aInPos.Y() >= aInSize.Height())
+ {
+ eDockAlign = CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_BOTTOM);
+ bForbidden = ( eDockAlign != SFX_ALIGN_BOTTOM &&
+ eDockAlign != SFX_ALIGN_HIGHESTBOTTOM &&
+ eDockAlign != SFX_ALIGN_LOWESTBOTTOM );
+ }
+
+ // Wenn wir zwar im Dockbereich sind, da\s einzig m"ogliche Alignment
+ // aber verboten ist, mu\s in den FloatingMode geschaltet werden
+ if ( bForbidden )
+ {
+ eDockAlign = CheckAlignment(pImp->GetDockAlignment(),SFX_ALIGN_NOALIGNMENT);
+ }
+ }
+ }
+
+ if ( eDockAlign == SFX_ALIGN_NOALIGNMENT )
+ {
+ //Im FloatingMode erh"alt das tracking rectangle die floating size
+ // wg. SV-Bug darf rRect nur ver"andert werden, wenn sich das
+ // Alignment "andert !
+ if ( eDockAlign != pImp->GetDockAlignment() )
+ rRect.SetSize( aFloatingSize );
+ }
+ else if ( pImp->bSplitable )
+ {
+ // Bei DockingWindows in SplitWindows sind Position und Gr"o\se zu
+ // berechnen, auch wenn sich das Alignment nicht ge"andert hat, da
+ // sich die Zeile ge"andert haben k"onnte.
+ CalcSplitPosition(rPos, rRect, eDockAlign);
+ }
+ else
+ {
+ // Bei individuell angedockten Fenstern mu\s das tracking rectangle
+ // nur ge"andert werden, wenn sich das Dock-Alignment ge"andert hat.
+ if ( eDockAlign != pImp->GetDockAlignment() )
+ {
+ switch ( eDockAlign )
+ {
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ rRect.SetSize( aVerticalSize );
+ break;
+
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ rRect.SetSize( aHorizontalSize );
+ break;
+ }
+ }
+ }
+
+ return eDockAlign;
+}
+
+//-------------------------------------------------------------------------
+
+Size SfxDockingWindow::CalcDockingSize(SfxChildAlignment eAlign)
+
+/* [Beschreibung]
+
+ Virtuelle Methode der Klasse SfxDockingWindow.
+ Hier wird festgelegt, wie sich die Gr"o\se des DockingWindows abh"angig vom
+ Alignment "andert.
+ Die Basisimplementation setzt im Floating Mode die Gr"o\se auf die gemerkte
+ Floating Size.
+ Bei horizontalem Alignment wird die Breite auf die Breite des "au\seren
+ DockingRects, bei vertikalem Alignment die H"ohe auf die H"ohe des inneren
+ DockingRects (ergibt sich aus der Reihenfolge, in der im SFX ChildWindows
+ ausgegeben werden). Die jeweils andere Gr"o\se wird auf die aktuelle
+ Floating Size gesetzt, hier k"onnte eine abgeleitete Klasse "andernd
+ eingreifen.
+ Die DockingSize mu\s f"ur Left/Right und Top/Bottom jeweils gleich sein.
+*/
+
+{
+ // Achtung: falls das Resizing auch im angedockten Zustand geht, mu\s dabei
+ // auch die Floating Size angepa\st werden !?
+
+ Size aSize = GetFloatingSize();
+ switch (eAlign)
+ {
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ aSize.Width() = aOuterRect.Right() - aOuterRect.Left();
+ break;
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ aSize.Height() = aInnerRect.Bottom() - aInnerRect.Top();
+ break;
+ case SFX_ALIGN_NOALIGNMENT:
+ break;
+ }
+
+ return aSize;
+}
+
+//-------------------------------------------------------------------------
+
+SfxChildAlignment SfxDockingWindow::CheckAlignment(SfxChildAlignment,
+ SfxChildAlignment eAlign)
+
+/* [Beschreibung]
+
+ Virtuelle Methode der Klasse SfxDockingWindow.
+ Hier kann eine abgeleitete Klasse bestimmte Alignments verbieten.
+ Die Basisimplementation verbietet kein Alignment.
+*/
+
+{
+ return eAlign;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDockingWindow::Close()
+
+/* [Beschreibung]
+
+ Das Fenster wird geschlossen, indem das ChildWindow durch Ausf"uhren des
+ ChildWindow-Slots zerst"ort wird.
+ Wird diese Methode von einer abgeleiteten Klasse "uberschrieben, mu\s
+ danach SfxDockingWindow::Close() gerufen werden, wenn nicht das Close()
+ mit "return FALSE" abgebrochen wird.
+
+*/
+{
+ // Execute mit Parametern, da Toggle von einigen ChildWindows ignoriert
+ // werden kann
+ if ( !pMgr )
+ return TRUE;
+
+ SfxBoolItem aValue( pMgr->GetType(), FALSE);
+ pBindings->GetDispatcher_Impl()->Execute(
+ pMgr->GetType(), SFX_CALLMODE_RECORD | SFX_CALLMODE_ASYNCHRON, &aValue, 0L );
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::Paint(const Rectangle& rRect)
+
+/* [Beschreibung]
+
+ Es wird im angedockten Zustand eine Begrenzungslinie an der angedockten
+ Kante und ein Rahmen ausgegeben. Dabei wird SVLOOK ber"ucksichtigt.
+*/
+
+{
+ if ( pImp->bSplitable || IsFloatingMode() )
+ return;
+
+ Rectangle aRect = Rectangle(Point(0, 0),
+ GetOutputSizePixel());
+ switch (GetAlignment())
+ {
+ case SFX_ALIGN_TOP:
+ {
+ DrawLine(aRect.BottomLeft(), aRect.BottomRight());
+ aRect.Bottom()--;
+ break;
+ }
+
+ case SFX_ALIGN_BOTTOM:
+ {
+ DrawLine(aRect.TopLeft(), aRect.TopRight());
+ aRect.Top()++;
+ break;
+ }
+
+ case SFX_ALIGN_LEFT:
+ {
+ DrawLine(aRect.TopRight(), aRect.BottomRight());
+ aRect.Right()--;
+ break;
+ }
+
+ case SFX_ALIGN_RIGHT:
+ {
+ DrawLine(aRect.TopLeft(), aRect.BottomLeft());
+ aRect.Left()++;
+ break;
+ }
+ }
+
+ DecorationView aView( this );
+ aView.DrawFrame( aRect, FRAME_DRAW_OUT );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::SetMinOutputSizePixel( const Size& rSize )
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann eine minimale OutpuSize gesetzt werden, die
+ im Resizing()-Handler abgefragt wird.
+*/
+
+{
+ pImp->aMinSize = rSize;
+}
+
+//-------------------------------------------------------------------------
+
+Size SfxDockingWindow::GetMinOutputSizePixel() const
+
+/* [Beschreibung]
+
+ Die gesetzte minimale Gr"o\se wird zur"uckgegeben.
+*/
+
+{
+ return pImp->aMinSize;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::CalcSplitPosition(const Point rPos, Rectangle& rRect,
+ SfxChildAlignment eAlign)
+
+/* [Beschreibung]
+
+ Diese Methode berechnet f"ur gegebene Mausposition und aktuelles tracking
+ rectangle, welches tats"achliche tracking rectangle sich bei einem im
+ SplitWindow angedockten Fenster ergibt (unter Ber"ucksichtigung von Zeile
+ und Spalte des SplitWindows, an der sich die Maus befindet).
+*/
+
+{
+ SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl();
+ SfxSplitWindow *pSplitWin = pWorkWin->GetSplitWindow_Impl(eAlign);
+ USHORT nLine, nPos;
+
+ // Mausposition in Koordinaten des Splitwindows
+ Point aPos(pSplitWin->ScreenToOutputPixel(rPos));
+ if ( pSplitWin->GetWindowPos(aPos, nLine, nPos ) )
+ {
+ // Maus innerhalb des Splitwindows
+ pImp->nDockLine = nLine;
+ pImp->nDockPos = nPos;
+ }
+ else
+ {
+ // Maus au\serhalb, aber au\serhalb des InnerRects (sonst w"are diese
+ // Methode gar nicht gerufen worden ), also soll eine neue Zeile
+ // aufgemacht werden
+ pImp->nDockLine = pSplitWin->GetLineCount();
+ pImp->nDockPos = 0;
+ }
+
+ // Neue Zeile aufmachen ?
+ pImp->bNewLine = (pImp->nDockLine >= pSplitWin->GetLineCount());
+
+ // Tracking rectangle auf gemerkte Splitsize setzen
+ Size aSize = pImp->aSplitSize;
+
+ // Gr"o\se der noch freien client area
+ Size aInnerSize = GetInnerRect().GetSize();
+
+ // Wenn neue Zeile, je nach Alignment Breite oder H"ohe auf die der
+ // freien client area setzen, sonst auf die LineSize der Zeile im
+ // Splitwindow, "uber der die Maus steht
+ if ( eAlign == SFX_ALIGN_TOP || eAlign == SFX_ALIGN_BOTTOM )
+ {
+ if ( pImp->bNewLine )
+ {
+ aSize.Width() = aInnerSize.Width();
+ if ( aSize.Height() > aInnerSize.Height() / 2 &&
+ GetFloatingSize().Height() < aSize.Height() )
+ aSize.Height() = GetFloatingSize().Height();
+ }
+ else
+ {
+ aSize.Height() = pSplitWin->GetLineSize(nLine);
+ if ( aSize.Width() > aInnerSize.Width() / 2 &&
+ GetFloatingSize().Width() < aSize.Width() )
+ aSize.Width() = GetFloatingSize().Width();
+ }
+ }
+ else
+ {
+ if ( pImp->bNewLine )
+ {
+ aSize.Height() = aInnerSize.Height();
+ if ( aSize.Width() > aInnerSize.Width() / 2 &&
+ GetFloatingSize().Width() < aSize.Width() )
+ aSize.Width() = GetFloatingSize().Width();
+ }
+ else
+ {
+ aSize.Width() = pSplitWin->GetLineSize(nLine);
+ if ( aSize.Height() > aInnerSize.Height() / 2 &&
+ GetFloatingSize().Height() < aSize.Height() )
+ aSize.Height() = GetFloatingSize().Height();
+ }
+ }
+
+ rRect.SetSize(aSize);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::EnableSplitting(BOOL bEnable)
+{
+ pImp->bSplitable = bEnable;
+}
+
+// -----------------------------------------------------------------------
+
+long SfxDockingWindow::Notify( NotifyEvent& rEvt )
+{
+ if ( rEvt.GetType() == EVENT_GETFOCUS || rEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
+ {
+ pBindings->SetActiveFrame( pMgr->GetFrame() );
+
+ if ( pImp->pSplitWin )
+ pImp->pSplitWin->SetActiveWindow_Impl( this );
+ else
+ pMgr->Activate_Impl();
+/*
+ // Nur wg. PlugIn
+ SfxViewFrame *pFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ if ( pFrame )
+ pFrame->MakeActive_Impl();
+*/
+ // In VCL geht Notify zun"achst an das Fenster selbst,
+ // also base class rufen, sonst erf"ahrt der parent nichts
+ if ( rEvt.GetType() == EVENT_MOUSEBUTTONDOWN || rEvt.GetWindow() == this )
+ DockingWindow::Notify( rEvt );
+ return TRUE;
+ }
+ else if( rEvt.GetType() == EVENT_KEYINPUT )
+ {
+ // KeyInput zuerst f"ur Dialogfunktionen zulassen
+ if ( !DockingWindow::Notify( rEvt ) )
+ // dann auch global g"ultige Acceleratoren verwenden
+ return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() );
+ return TRUE;
+ }
+ else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() )
+ {
+// pBindings->SetActiveFrame( XFrameRef() );
+ pMgr->Deactivate_Impl();
+ }
+
+ return DockingWindow::Notify( rEvt );
+}
+
+
+USHORT SfxDockingWindow::GetWinBits_Impl() const
+{
+ USHORT nBits = 0;
+// if ( pImp->bAutoHide )
+// nBits |= SWIB_AUTOHIDE;
+ return nBits;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDockingWindow::SetItemSize_Impl( const Size& rSize )
+{
+ pImp->aSplitSize = rSize;
+}
+
+void SfxDockingWindow::Disappear_Impl()
+{
+ if ( pImp->pSplitWin && pImp->pSplitWin->IsItemValid( GetType() ) )
+ pImp->pSplitWin->RemoveWindow(this);
+}
+
+void SfxDockingWindow::Reappear_Impl()
+{
+ if ( pImp->pSplitWin && !pImp->pSplitWin->IsItemValid( GetType() ) )
+ {
+ pImp->pSplitWin->InsertWindow( this, pImp->aSplitSize );
+ }
+}
+
+BOOL SfxDockingWindow::IsAutoHide_Impl() const
+{
+ if ( pImp->pSplitWin )
+ return !pImp->pSplitWin->IsFadeIn();
+ else
+ return FALSE;
+}
+
+BOOL SfxDockingWindow::IsPinned_Impl() const
+{
+ if ( pImp->pSplitWin )
+ return pImp->pSplitWin->IsPinned();
+ else
+ return TRUE;
+}
+
+void SfxDockingWindow::AutoShow_Impl( BOOL bShow )
+{
+ if ( pImp->pSplitWin )
+ {
+ if ( bShow )
+ pImp->pSplitWin->FadeIn();
+ else
+ pImp->pSplitWin->FadeOut();
+ }
+}
+
+void SfxDockingWindow::Pin_Impl( BOOL bPinned )
+{
+ if ( pImp->pSplitWin )
+ pImp->pSplitWin->Pin_Impl( bPinned );
+}
+
+SfxSplitWindow* SfxDockingWindow::GetSplitWindow_Impl() const
+{
+ return pImp->pSplitWin;
+}
+
+void SfxDockingWindow::FadeIn( BOOL bFadeIn )
+{
+}
+
+
diff --git a/sfx2/source/dialog/intro.cxx b/sfx2/source/dialog/intro.cxx
new file mode 100644
index 000000000000..88dbbb0a566a
--- /dev/null
+++ b/sfx2/source/dialog/intro.cxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: intro.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "intro.hxx"
+
+// -----------------------------------------------------------------------
+
+void IntroWindow_Impl::Init()
+{
+ Size aSize = aIntroBmp.GetSizePixel();
+ SetOutputSizePixel( aSize );
+ Size aScreenSize( GetDesktopRectPixel().GetSize() );
+ Size aWinSize( GetSizePixel() );
+ Point aWinPos( ( aScreenSize.Width() - aWinSize.Width() ) / 2,
+ ( aScreenSize.Height() - aWinSize.Height() ) / 2 );
+ SetPosPixel( aWinPos );
+
+ if ( GetColorCount() >= 16 )
+ {
+ Show();
+ Update();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IntroWindow_Impl::IntroWindow_Impl( const Bitmap& rBmp ) :
+
+ WorkWindow( NULL, (WinBits)0 ),
+
+ aIntroBmp( rBmp )
+
+{
+ Hide();
+ Init();
+}
+
+// -----------------------------------------------------------------------
+
+IntroWindow_Impl::~IntroWindow_Impl()
+{
+ Hide();
+}
+
+// -----------------------------------------------------------------------
+
+void IntroWindow_Impl::Paint( const Rectangle& )
+{
+ DrawBitmap( Point(), aIntroBmp );
+ Flush();
+}
+
+// -----------------------------------------------------------------------
+
+void IntroWindow_Impl::Slide()
+{
+}
+
+
diff --git a/sfx2/source/dialog/macropg.cxx b/sfx2/source/dialog/macropg.cxx
new file mode 100644
index 000000000000..5ca4c53548bf
--- /dev/null
+++ b/sfx2/source/dialog/macropg.cxx
@@ -0,0 +1,698 @@
+/*************************************************************************
+ *
+ * $RCSfile: macropg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _RCID_H
+#include <vcl/rcid.h>
+#endif
+#ifndef _BASMGR_HXX //autogen
+#include <basic/basmgr.hxx>
+#endif
+#pragma hdrstop
+
+#define ITEMID_MACRO 0
+#include "macropg.hxx"
+#undef ITEMID_MACRO
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+#ifdef VCL
+#ifndef _SV_MEDIT_HXX
+#include <svtools/svmedit.hxx>
+#endif
+#endif
+
+#include "cfg.hxx"
+#include "app.hxx"
+#include "objsh.hxx"
+#include "macropg.hrc"
+#include "sfxresid.hxx"
+#include "dialog.hrc"
+#include "macrconf.hxx"
+#include "sfxdefs.hxx"
+
+#if SUPD>399
+SvStringsDtor* _ImpGetRangeHdl( _SfxMacroTabPage*, const String& rLanguage );
+SvStringsDtor* _ImpGetMacrosOfRangeHdl( _SfxMacroTabPage*, const String& rLanguage,
+ const String& rRange );
+#else
+SvStringsDtor* _ImpGetRangeHdl( _SfxMacroTabPage*, ScriptType eType );
+SvStringsDtor* _ImpGetMacrosOfRangeHdl( _SfxMacroTabPage*, ScriptType eType,
+ const String& rRange );
+#endif
+static USHORT __FAR_DATA aPageRg[] = {
+ SID_ATTR_MACROITEM, SID_ATTR_MACROITEM,
+ 0
+};
+
+// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
+static long nTabs[] =
+ {
+ 2, // Number of Tabs
+ 0, 90
+ };
+
+#define LB_EVENTS_ITEMPOS 1
+#define LB_MACROS_ITEMPOS 2
+
+String ConvertToUIName_Impl( SvxMacro *pMacro, const String& rLanguage )
+{
+ String aName( pMacro->GetMacName() );
+ String aEntry;
+ if ( ! pMacro->GetLanguage().EqualsAscii("JavaScript") )
+ {
+ USHORT nCount = aName.GetTokenCount('.');
+ aEntry = aName.GetToken( nCount-1, '.' );
+ if ( nCount > 2 )
+ {
+ aEntry += '(';
+ aEntry += aName.GetToken( 0, '.' );
+ aEntry += '.';
+ aEntry += aName.GetToken( nCount-2, '.' );
+ aEntry += ')';
+ }
+ return aEntry;
+ }
+ else
+ return aName;
+}
+
+void _SfxMacroTabPage::EnableButtons( const String& rLangName )
+{
+ // Solange die Eventbox leer ist, nichts tun
+ const SvLBoxEntry* pE = pEventLB->FirstSelected();
+ if ( pE )
+ {
+ // Gebundenes Macro holen
+ const SvxMacro* pM = aTbl.Get( (USHORT)(ULONG) pE->GetUserData() );
+ pDeletePB->Enable( 0 != pM && !bReadOnly );
+
+ // Bei gleichem ScriptType Zuweisung nur, wenn Macro sich
+ // ge"andert hat; bei verschiedenem ScriptType, wenn Script nicht leer
+ String sEventMacro;
+ sEventMacro = ((SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS ))->GetText();
+ if ( rLangName.EqualsAscii("JavaScript") )
+ {
+#if SUPD<582
+ String sScript = pJavaED->GetText();
+ if( pM && rLangName != pM->GetLanguage() )
+ pAssignPB->Enable( TRUE && !bReadOnly );
+ else
+ pAssignPB->Enable( !bReadOnly && sScript.Len() && ( !sEventMacro.Len() || sScript != sEventMacro ) );
+#endif
+ }
+ else
+ {
+ SfxMacroInfo *pInfo = pMacroLB->GetMacroInfo();
+ String sSelMacro;
+ if ( pInfo )
+ sSelMacro = pInfo->GetMacroName();
+ if( pM && rLangName != pM->GetLanguage() )
+ pAssignPB->Enable( pInfo != 0 && !bReadOnly );
+ else
+ pAssignPB->Enable( pInfo && !bReadOnly && !sSelMacro.EqualsIgnoreCaseAscii( sEventMacro ) );
+ }
+ }
+}
+
+_SfxMacroTabPage::_SfxMacroTabPage( Window* pParent, const ResId& rResId,
+ const SfxItemSet& rAttrSet )
+ : SfxTabPage( pParent, rResId, rAttrSet ),
+ pAssignPB( 0 ),
+ pDeletePB( 0 ),
+// pBasicRB( 0 ),
+// pJavaScriptRB( 0 ),
+ pScriptTypeLB( 0 ),
+ pEventLB( 0 ),
+ pGroupLB( 0 ),
+ pMacroLB( 0 ),
+ pEventGB( 0 ),
+ pMacroGB( 0 ),
+#if SUPD<582
+ pJavaStr( 0 ),
+ pJavaED( 0 ),
+#endif
+ pMacroStr( 0 ),
+ fnGetRange( &_ImpGetRangeHdl ),
+ fnGetMacroOfRange( &_ImpGetMacrosOfRangeHdl ),
+ bReadOnly( FALSE )
+{
+}
+
+_SfxMacroTabPage::~_SfxMacroTabPage()
+{
+ delete pAssignPB;
+ delete pDeletePB;
+// delete pBasicRB;
+// delete pJavaScriptRB;
+ delete pScriptTypeLB;
+ delete pEventLB;
+ delete pGroupLB;
+ delete pMacroLB;
+ delete pEventGB;
+ delete pMacroGB;
+#if SUPD<582
+ delete pJavaStr;
+ delete pJavaED;
+#endif
+ delete pMacroStr;
+}
+
+void _SfxMacroTabPage::AddEvent( const String & rEventName, USHORT nEventId )
+{
+ String sTmp( rEventName );
+ sTmp += '\t';
+
+ // falls die Tabelle schon gueltig ist
+ SvxMacro* pM = aTbl.Get( nEventId );
+ if( pM )
+ {
+ String sNew( ConvertToUIName_Impl( pM, pScriptTypeLB->GetSelectEntry() ) );
+ sTmp += sNew;
+ }
+
+ SvLBoxEntry* pE = pEventLB->InsertEntry( sTmp );
+ pE->SetUserData( (void*)nEventId );
+}
+
+void _SfxMacroTabPage::ScriptChanged( const String& aLangName )
+{
+ // neue Bereiche und deren Funktionen besorgen
+#if SUPD<582
+ if ( aLangName == "JavaScript" )
+ {
+ const SvLBoxEntry* pE = pEventLB->FirstSelected();
+ if( pE )
+ {
+ const SvxMacro* pM = aTbl.Get( (USHORT)(ULONG)pE->GetUserData() );
+ if ( pM && pM->GetMacName().Len() && aLangName == pM->GetLanguage() )
+ pJavaED->SetText( pM->GetMacName() );
+ }
+
+ pJavaED->Show();
+ pGroupLB->Hide();
+ pMacroLB->Hide();
+ pMacroGB->SetText( *pJavaStr );
+ }
+ else
+#endif
+ {
+#if SUPD<582
+ pJavaED->Hide();
+#endif
+ pGroupLB->SetScriptType( aLangName );
+ pGroupLB->Show();
+ pMacroLB->Show();
+ pMacroGB->SetText( *pMacroStr );
+ }
+
+ EnableButtons( aLangName );
+}
+
+BOOL _SfxMacroTabPage::FillItemSet( SfxItemSet& rSet )
+{
+ SvxMacroItem aItem( GetWhich( aPageRg[0] ) );
+ ((SvxMacroTableDtor&)aItem.GetMacroTable()) = aTbl;
+
+ const SfxPoolItem* pItem;
+ if( SFX_ITEM_SET != GetItemSet().GetItemState( aItem.Which(), TRUE, &pItem )
+ || aItem != *(SvxMacroItem*)pItem )
+ {
+ rSet.Put( aItem );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void _SfxMacroTabPage::Reset( const SfxItemSet& rSet )
+{
+ const SfxPoolItem* pItem;
+ if( SFX_ITEM_SET == rSet.GetItemState( GetWhich( aPageRg[0] ), TRUE, &pItem ))
+ aTbl = ((SvxMacroItem*)pItem)->GetMacroTable();
+
+ FillEvents();
+
+ SvLBoxEntry* pE = pEventLB->GetEntry( 0 );
+ if( pE )
+ pEventLB->SetCurEntry( pE );
+}
+
+IMPL_STATIC_LINK( _SfxMacroTabPage, SelectEvent_Impl, SvTabListBox*, EMPTYARG )
+{
+ SvLBoxEntry* pE = pThis->pEventLB->FirstSelected();
+ ULONG nPos;
+ if( !pE || LISTBOX_ENTRY_NOTFOUND ==
+ ( nPos = pThis->pEventLB->GetModel()->GetAbsPos( pE ) ) )
+ {
+ DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
+ return 0;
+ }
+
+ USHORT nEventId = (USHORT)(ULONG)pE->GetUserData();
+ String aLanguage = pThis->pScriptTypeLB->GetSelectEntry();
+
+ const SvxMacro* pM = pThis->aTbl.Get( nEventId );
+ if( pM )
+ {
+ if( aLanguage != pM->GetLanguage() )
+ {
+ pThis->pScriptTypeLB->SelectEntry( pM->GetLanguage() );
+ pThis->ScriptChanged( pM->GetLanguage() );
+ }
+ else if ( aLanguage.EqualsAscii("JavaScript") )
+ {
+#if SUPD<582
+
+ const SvxMacro* pM = 0;
+ const SvLBoxEntry* pE = pThis->pEventLB->FirstSelected();
+ if( pE &&
+ ( pM = pThis->aTbl.Get( (USHORT)(ULONG)pE->GetUserData() ) ) != 0 &&
+ pM->GetMacName().Len() )
+ pThis->pJavaED->SetText( pM->GetMacName() );
+#endif
+ }
+ }
+
+ pThis->EnableButtons( aLanguage );
+ return 0;
+}
+
+IMPL_STATIC_LINK( _SfxMacroTabPage, SelectGroup_Impl, ListBox*, EMPTYARG )
+{
+ String sSel( pThis->pGroupLB->GetGroup() );
+ String aLanguage = pThis->pScriptTypeLB->GetSelectEntry();
+ if ( !aLanguage.EqualsAscii("JavaScript") )
+ {
+ pThis->pGroupLB->GroupSelected();
+ SfxMacroInfo *pMacro = pThis->pMacroLB->GetMacroInfo();
+ if ( !pMacro )
+ // Wenn dort ein Macro drin ist, wurde es selektiert und der
+ // AssignButton schon in SelectMacro richtig enabled
+ pThis->pAssignPB->Enable( FALSE );
+ }
+ return 0;
+}
+
+IMPL_STATIC_LINK( _SfxMacroTabPage, SelectMacro_Impl, ListBox*, EMPTYARG )
+{
+ pThis->pMacroLB->FunctionSelected();
+ pThis->EnableButtons( pThis->pScriptTypeLB->GetSelectEntry() );
+ return 0;
+}
+
+IMPL_STATIC_LINK( _SfxMacroTabPage, GetFocus_Impl, Edit*, EMPTYARG )
+{
+ pThis->EnableButtons( DEFINE_CONST_UNICODE("JavaScript") );
+ return 0;
+}
+
+IMPL_STATIC_LINK( _SfxMacroTabPage, AssignDeleteHdl_Impl, PushButton*, pBtn )
+{
+ SvLBoxEntry* pE = pThis->pEventLB->FirstSelected();
+ ULONG nPos;
+ if( !pE || LISTBOX_ENTRY_NOTFOUND ==
+ ( nPos = pThis->pEventLB->GetModel()->GetAbsPos( pE ) ) )
+ {
+ DBG_ASSERT( pE, "wo kommt der leere Eintrag her?" );
+ return 0;
+ }
+
+ const BOOL bAssEnabled = pBtn != pThis->pDeletePB &&
+ pThis->pAssignPB->IsEnabled();
+
+ // aus der Tabelle entfernen
+ USHORT nEvent = (USHORT)(ULONG)pE->GetUserData();
+ SvxMacro *pMacro = pThis->aTbl.Remove( nEvent );
+ delete pMacro;
+
+ String aLanguage = pThis->pScriptTypeLB->GetSelectEntry();
+ String sNew;
+ if( bAssEnabled )
+ {
+ String sGroup;
+ String sMacro;
+ String aEntryText( sNew );
+ if ( aLanguage.EqualsAscii("JavaScript") )
+ {
+#if SUPD<582
+ sNew = sMacro = pThis->pJavaED->GetText();
+#endif
+ }
+ else
+ {
+ SfxMacroInfo *pMacro = pThis->pMacroLB->GetMacroInfo();
+ sMacro = pMacro->GetQualifiedName();
+ sGroup = pThis->pGroupLB->GetGroup();
+ sNew = pMacro->GetMacroName();
+ }
+
+ if ( aLanguage.EqualsAscii("StarBasic") )
+ pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, sGroup, STARBASIC ) );
+ else
+ pThis->aTbl.Insert( nEvent, new SvxMacro( sMacro, aLanguage ) );
+ }
+
+ pThis->pEventLB->SetUpdateMode( FALSE );
+ pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS );
+ pThis->pEventLB->GetModel()->InvalidateEntry( pE );
+ pThis->pEventLB->Select( pE );
+ pThis->pEventLB->MakeVisible( pE );
+ pThis->pEventLB->SetUpdateMode( TRUE );
+
+ pThis->EnableButtons( aLanguage );
+ return 0;
+}
+
+IMPL_STATIC_LINK( _SfxMacroTabPage, ChangeScriptHdl_Impl, RadioButton*, EMPTYARG )
+{
+ pThis->ScriptChanged( pThis->pScriptTypeLB->GetSelectEntry() );
+ return 0;
+}
+
+void _SfxMacroTabPage::InitAndSetHandler()
+{
+ // Handler installieren
+ Link aLnk(STATIC_LINK(this, _SfxMacroTabPage, AssignDeleteHdl_Impl ));
+ pMacroLB->SetDoubleClickHdl( aLnk );
+ pDeletePB->SetClickHdl( aLnk );
+ pAssignPB->SetClickHdl( aLnk );
+ pEventLB->SetDoubleClickHdl( aLnk );
+
+ pEventLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectEvent_Impl ));
+ pGroupLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectGroup_Impl ));
+ pMacroLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, SelectMacro_Impl ));
+
+ pScriptTypeLB->SetSelectHdl( STATIC_LINK( this, _SfxMacroTabPage, ChangeScriptHdl_Impl ));
+
+#if SUPD<582
+ pJavaED->SetGetFocusHdl( STATIC_LINK( this, _SfxMacroTabPage, GetFocus_Impl ));
+ pJavaED->SetModifyHdl( STATIC_LINK( this, _SfxMacroTabPage, GetFocus_Impl ));
+#endif
+
+ pEventLB->SetWindowBits( WB_HSCROLL|WB_CLIPCHILDREN );
+ pEventLB->SetSelectionMode( SINGLE_SELECTION );
+ pEventLB->SetTabs( &nTabs[0], MAP_APPFONT );
+ pEventLB->Resize(); // OS: Hack fuer richtige Selektion
+// pEventLB->SetFont( SFX_APP()->GetAppFont() );
+ pEventLB->SetSpaceBetweenEntries( 0 );
+
+ pEventLB->Show();
+
+ pEventLB->Enable( TRUE );
+ pGroupLB->Enable( TRUE );
+ pMacroLB->Enable( TRUE );
+
+ pScriptTypeLB->SetDropDownLineCount( 3 );
+ pScriptTypeLB->InsertEntry( DEFINE_CONST_UNICODE("StarBasic") );
+
+#if SUPD<582
+ pScriptTypeLB->InsertEntry( DEFINE_CONST_UNICODE("StarScript") );
+ pScriptTypeLB->InsertEntry( DEFINE_CONST_UNICODE("JavaScript") );
+#endif
+
+ pScriptTypeLB->SelectEntry( DEFINE_CONST_UNICODE("StarBasic") );
+
+ pGroupLB->SetFunctionListBox( pMacroLB );
+ FillMacroList();
+}
+
+void _SfxMacroTabPage::FillMacroList()
+{
+ String aLanguage = pScriptTypeLB->GetSelectEntry();
+ if( ! aLanguage.EqualsAscii("JavaScript") )
+ {
+ // 2 Listboxen
+ SvStringsDtor* pArr = (*fnGetRange)( this, DEFINE_CONST_UNICODE("StarBasic") );
+ if( pArr )
+ {
+ pGroupLB->Init( pArr );
+ delete pArr;
+ }
+ }
+}
+
+void _SfxMacroTabPage::FillEvents()
+{
+ String aLanguage = pScriptTypeLB->GetSelectEntry();
+
+ // Events aus der Tabelle holen und die EventListBox entsprechen fuellen
+ for( ULONG n = 0; n < pEventLB->GetEntryCount(); ++n )
+ {
+ SvLBoxEntry* pE = pEventLB->GetEntry( n );
+ if( pE )
+ {
+ SvLBoxString* pLItem = (SvLBoxString*)pE->GetItem( LB_MACROS_ITEMPOS );
+ DBG_ASSERT( pLItem && SV_ITEM_ID_LBOXSTRING == pLItem->IsA(), "kein LBoxString" );
+
+ String sOld( pLItem->GetText() ), sNew;
+ USHORT nEventId = (USHORT)(ULONG)pE->GetUserData();
+ if( aTbl.IsKeyValid( nEventId ) )
+ {
+ // Event vorhanden
+ sNew = ConvertToUIName_Impl( aTbl.Get( nEventId ), aLanguage );
+ }
+
+ if( sOld != sNew )
+ {
+ pE->ReplaceItem( new SvLBoxString( pE, 0, sNew ), LB_MACROS_ITEMPOS );
+ pEventLB->GetModel()->InvalidateEntry( pE );
+ }
+ }
+ }
+}
+
+void _SfxMacroTabPage::SelectEvent( const String & rEventName, USHORT nEventId )
+{
+/*
+ String sTmp( rEventName );
+ sTmp += '\t';
+
+ // falls die Tabelle schon gueltig ist
+ SvxMacro* pM = aTbl.Get( nEventId );
+ if( pM )
+ {
+ String sNew( ConvertToUIName_Impl( pM, pScriptTypeLB->GetSelectEntry() ) );
+ sTmp += sNew;
+ }
+*/
+ for( ULONG n = 0; n < pEventLB->GetEntryCount(); ++n )
+ {
+ SvLBoxEntry* pE = pEventLB->GetEntry( n );
+// if( pE && pE->GetEntryText() == sTmp )
+ if( pE && (USHORT) (ULONG) pE->GetUserData() == nEventId )
+ {
+ pEventLB->SetCurEntry( pE );
+ pEventLB->MakeVisible( pE );
+ break;
+ }
+ }
+}
+
+
+/* */
+
+SvStringsDtor* __EXPORT _ImpGetRangeHdl( _SfxMacroTabPage* pTbPg, const String& rLanguage )
+{
+ SvStringsDtor* pNew = new SvStringsDtor;
+ SfxApplication* pSfxApp = SFX_APP();
+
+ if ( !rLanguage.EqualsAscii("JavaScript") )
+ {
+ pSfxApp->EnterBasicCall();
+
+ // AppBasic einf"ugen
+ String* pNewEntry = new String( pSfxApp->GetName() );
+ pNew->Insert( pNewEntry, pNew->Count() );
+
+ // Aktuelles Dokument
+ SfxObjectShell* pDoc = SfxObjectShell::Current();
+ if ( pDoc )
+ {
+ String aTitle = pDoc->GetTitle();
+
+ // Hack f"ur Aufruf aus der Basic-IDE : das Basic ermitteln, das
+ // gerade bearbeitet wird
+
+ String aAppName(DEFINE_CONST_UNICODE("BASIC - "));
+ USHORT nLen = aAppName.Len();
+ if ( aTitle.CompareIgnoreCaseToAscii( aAppName, nLen ) == COMPARE_EQUAL )
+ {
+ // Basic-Namensprefix entfernen
+ aTitle.Erase( 0, nLen );
+ USHORT nIndex=0, nCount=aTitle.GetTokenCount('.');
+ if ( nCount > 1 )
+ {
+ // Namen der Library entfernen
+ aTitle.GetToken( nCount-2, '.', nIndex );
+ aTitle.Erase( nIndex-1 );
+ }
+
+ // Wenn das App-Basic gerade in der Basic-IDE bearbeitet wird, kein
+ // Dokument verwenden
+ pDoc = SfxObjectShell::GetFirst();
+ while( pDoc )
+ {
+ if ( aTitle == pDoc->GetTitle() )
+ break;
+ pDoc = SfxObjectShell::GetNext( *pDoc );
+ }
+ }
+
+ if ( pDoc && pDoc->GetBasicManager() != SFX_APP()->GetBasicManager() &&
+ pDoc->GetBasicManager()->GetLibCount() )
+ {
+ pNewEntry = new String( aTitle );
+ pNew->Insert( pNewEntry, pNew->Count() );
+ }
+ }
+
+ pSfxApp->LeaveBasicCall();
+ }
+
+ return pNew;
+}
+
+// besorgen der Funktionen eines Bereiches
+SvStringsDtor* __EXPORT _ImpGetMacrosOfRangeHdl( _SfxMacroTabPage* pTbPg,
+ const String& rLanguage, const String& rRange )
+{
+ SvStringsDtor* pNew = new SvStringsDtor;
+ return pNew;
+}
+
+/* */
+
+SfxMacroTabPage::SfxMacroTabPage( Window* pParent, const ResId& rResId,
+ const SfxItemSet& rSet )
+ : _SfxMacroTabPage( pParent, rResId, rSet )
+{
+ pEventGB = new GroupBox(this, SfxResId(GB_EVENT) );
+ pEventLB = new SvTabListBox(this, SfxResId(LB_EVENT) );
+ pAssignPB = new PushButton( this, SfxResId(PB_ASSIGN) );
+ pDeletePB = new PushButton( this, SfxResId(PB_DELETE) );
+ pScriptTypeLB = new ListBox(this, SfxResId(LB_SCRIPTTYPE) );
+ pMacroGB = new GroupBox( this, SfxResId(GB_MACRO) );
+ pGroupLB = new SfxConfigGroupListBox_Impl( this, SfxResId(LB_GROUP) );
+ pMacroLB = new SfxConfigFunctionListBox_Impl( this, SfxResId(LB_MACROS) );
+ pMacroStr = new String( SfxResId(STR_MACROS) );
+#if SUPD<582
+ pJavaStr = new String( SfxResId(STR_JAVASCRIPT) );
+ pJavaED = new MultiLineEdit( this, SfxResId(ED_JAVASCRIPT) );
+#endif
+
+ FreeResource();
+// SetExchangeSupport();
+
+ InitAndSetHandler();
+
+ ScriptChanged( DEFINE_CONST_UNICODE("StarBasic") );
+}
+
+SfxTabPage* SfxMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
+{
+ return new SfxMacroTabPage( pParent, SfxResId( RID_SFX_TP_MACROASSIGN), rAttrSet );
+}
+
+/* */
+
+SfxSmallMacroTabPage::SfxSmallMacroTabPage( Window* pParent, const ResId& rResId,
+ const SfxItemSet& rSet )
+ : _SfxMacroTabPage( pParent, rResId, rSet )
+{
+ pEventGB = new GroupBox(this, SfxResId(GB_EVENT) );
+ pEventLB = new SvTabListBox(this, SfxResId(LB_EVENT) );
+ pAssignPB = new PushButton( this, SfxResId(PB_ASSIGN) );
+ pDeletePB = new PushButton( this, SfxResId(PB_DELETE) );
+ pScriptTypeLB = new ListBox(this, SfxResId(LB_SCRIPTTYPE) );
+ pMacroGB = new GroupBox( this, SfxResId(GB_MACRO) );
+ pGroupLB = new SfxConfigGroupListBox_Impl( this, SfxResId(LB_GROUP) );
+ pMacroLB = new SfxConfigFunctionListBox_Impl( this, SfxResId(LB_MACROS) );
+ pMacroStr = new String( SfxResId(STR_MACROS) );
+#if SUPD<582
+ pJavaStr = new String( SfxResId(STR_JAVASCRIPT) );
+ pJavaED = new MultiLineEdit( this, SfxResId(ED_JAVASCRIPT) );
+#endif
+ FreeResource();
+// SetExchangeSupport();
+
+ InitAndSetHandler();
+
+ ScriptChanged( DEFINE_CONST_UNICODE("StarBasic") );
+}
+
+SfxTabPage* SfxSmallMacroTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
+{
+ return new SfxMacroTabPage( pParent, SfxResId( RID_SFX_SMALLTP_MACROASSIGN), rAttrSet );
+}
+
+/* */
+
+SfxMacroAssignDlg::SfxMacroAssignDlg( Window* pParent, SfxItemSet& rSet )
+ : SfxSingleTabDialog( pParent, rSet, 0 )
+{
+ SetTabPage( SfxMacroTabPage::Create( this, rSet ) );
+}
+
+SfxMacroAssignDlg::~SfxMacroAssignDlg()
+{
+}
+
+
diff --git a/sfx2/source/dialog/macropg.hrc b/sfx2/source/dialog/macropg.hrc
new file mode 100644
index 000000000000..3bbf2ae305c8
--- /dev/null
+++ b/sfx2/source/dialog/macropg.hrc
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: macropg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MACROPG_HRC
+#define _MACROPG_HRC
+
+#define GB_EVENT 1
+#define LB_EVENT 2
+#define PB_ASSIGN 3
+#define PB_DELETE 4
+#define GB_MACRO 5
+#define LB_GROUP 6
+#define LB_MACROS 7
+#define LB_SCRIPTTYPE 8
+#define STR_JAVASCRIPT 10
+#define STR_MACROS 11
+#define ED_JAVASCRIPT 12
+
+
+
+#endif
+
diff --git a/sfx2/source/dialog/macropg.src b/sfx2/source/dialog/macropg.src
new file mode 100644
index 000000000000..021c7a2e3590
--- /dev/null
+++ b/sfx2/source/dialog/macropg.src
@@ -0,0 +1,502 @@
+/*************************************************************************
+ *
+ * $RCSfile: macropg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "macropg.hrc"
+#include "dialog.hrc"
+#include "helpid.hrc"
+TabPage RID_SFX_TP_MACROASSIGN
+{
+ // HelpID = HID_MACROASSIGN ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 260 , 176 ) ;
+ Text = "Makro zuweisen" ;
+ Text [ English ] = "Assign macro" ;
+ Text [ english_us ] = "Assign Macro" ;
+ Text [ italian ] = "Assegna macro" ;
+ Text [ spanish ] = "Asignar macro" ;
+ Text [ french ] = "Assignation de macro" ;
+ Text [ dutch ] = "Macro toewijzen" ;
+ Text [ swedish ] = "Tilldela makro" ;
+ Text [ danish ] = "Tildel makro" ;
+ Text [ portuguese_brazilian ] = "Makro zuweisen" ;
+ Text [ portuguese ] = "Atribuir macro" ;
+ GroupBox GB_EVENT
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 192 , 68 ) ;
+ Text = "Ereignis" ;
+ Text [ ENGLISH ] = "Event" ;
+ Group = TRUE ;
+ Text [ english_us ] = "Event" ;
+ Text [ italian ] = "Evento" ;
+ Text [ spanish ] = "Acontecimiento" ;
+ Text [ french ] = "vnement" ;
+ Text [ dutch ] = "Gebeurtenis" ;
+ Text [ swedish ] = "Hndelse" ;
+ Text [ danish ] = "Begivenhed" ;
+ Text [ portuguese_brazilian ] = "Ereignis" ;
+ Text [ portuguese ] = "Acontecimento" ;
+ Text[ chinese_simplified ] = "¼";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wydarzenie";
+ Text[ japanese ] = "s";
+ Text[ chinese_traditional ] = "ʧ@";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̺Ʈ";
+ Text[ turkish ] = "Olay";
+ };
+ Control LB_EVENT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 180 , 51 ) ;
+ TabStop = TRUE ;
+ ClipChildren = TRUE ;
+ Disable = TRUE ;
+ HelpID = HID_MACRO_LB_EVENT ;
+ };
+ GroupBox GB_MACRO
+ {
+ Pos = MAP_APPFONT ( 6 , 77 ) ;
+ Size = MAP_APPFONT ( 248 , 93 ) ;
+ Group = TRUE ;
+ };
+ Control LB_GROUP
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 88 ) ;
+ Size = MAP_APPFONT ( 111 , 76 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ HelpId = HID_MACRO_GROUP ;
+ };
+ Control LB_MACROS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 129 , 88 ) ;
+ Size = MAP_APPFONT ( 119 , 76 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ HelpId = HID_MACRO_MACROS ;
+ };
+ PushButton PB_ASSIGN
+ {
+ Pos = MAP_APPFONT ( 204 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ // ### ACHTUNG: Neuer Text in Resource? Z~uweisen : Zuweisen
+ Text = "Z~uweisen" ;
+ Text [ English ] = "Assign" ;
+ Disable = TRUE ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Assign" ;
+ Text [ italian ] = "Assegna" ;
+ Text [ spanish ] = "~Asignar" ;
+ Text [ french ] = "~Assigner" ;
+ Text [ dutch ] = "T~oewijzen" ;
+ Text [ swedish ] = "Till~dela" ;
+ Text [ danish ] = "Tildel" ;
+ Text [ portuguese_brazilian ] = "Z~uweisen" ;
+ Text [ portuguese ] = "~Atribuir" ;
+ Text[ chinese_simplified ] = "ָ(~A)";
+ Text[ russian ] = "";
+ Text[ polish ] = "P~rzypisz";
+ Text[ japanese ] = "蓖(~A)";
+ Text[ chinese_traditional ] = "w(~A)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~A)";
+ Text[ turkish ] = "A~ta";
+ };
+ PushButton PB_DELETE
+ {
+ Pos = MAP_APPFONT ( 204 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Aufheben" ;
+ Text [ English ] = "~Dismiss" ;
+ Disable = TRUE ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Remove" ;
+ Text [ italian ] = "Elimina" ;
+ Text [ spanish ] = "~Eliminar" ;
+ Text [ french ] = "~liminer" ;
+ Text [ dutch ] = "~Opheffen" ;
+ Text [ swedish ] = "~Upphv" ;
+ Text [ danish ] = "Oph~v" ;
+ Text [ portuguese_brazilian ] = "~Aufheben" ;
+ Text [ portuguese ] = "~Limpar" ;
+ Text[ chinese_simplified ] = "ȡ(~R)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Usu";
+ Text[ japanese ] = "(~R)";
+ Text[ chinese_traditional ] = "(~R)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~R)";
+ Text[ turkish ] = "~Kaldr";
+ };
+ ListBox LB_SCRIPTTYPE
+ {
+ Pos = MAP_APPFONT ( 204 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 30 ) ;
+ Text = "~Scriptsprache" ;
+ TabStop = TRUE ;
+ Disable = FALSE ;
+ DropDown = TRUE ;
+ };
+ String STR_MACROS
+ {
+ Text = "Makros" ;
+ Text [ ENGLISH ] = "Macros" ;
+ Text [ dutch ] = "Macros" ;
+ Text [ english_us ] = "Macros" ;
+ Text [ italian ] = "Macro" ;
+ Text [ spanish ] = "Macros" ;
+ Text [ french ] = "Macros" ;
+ Text [ swedish ] = "Makron" ;
+ Text [ danish ] = "Makroer" ;
+ Text [ portuguese_brazilian ] = "Makros" ;
+ Text [ portuguese ] = "Macros" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Makra";
+ Text[ japanese ] = "ϸ";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "";
+ Text[ korean ] = "ũ";
+ Text[ turkish ] = "Makro";
+ };
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ polish ] = "Przypisz makro";
+ Text[ japanese ] = "ϸۂ̊蓖";
+ Text[ korean ] = "ũ ";
+ Text[ chinese_simplified ] = "ָ";
+ Text[ chinese_traditional ] = "w";
+ Text[ turkish ] = "Makro ata";
+ Text[ arabic ] = " ";
+#if SUPD<582
+ String STR_JAVASCRIPT
+ {
+ Text = "JavaScript" ;
+ Text [ ENGLISH ] = "JavaScript" ;
+ Text [ english_us ] = "JavaScript" ;
+ Text [ swedish ] = "JavaScript" ;
+ Text [ danish ] = "JavaScript" ;
+ Text [ italian ] = "JavaScript" ;
+ Text [ spanish ] = "JavaScript" ;
+ Text [ french ] = "JavaScript" ;
+ Text [ dutch ] = "JavaScript" ;
+ Text [ portuguese_brazilian ] = "JavaScript" ;
+ Text [ portuguese ] = "JavaScript" ;
+ Text[ chinese_simplified ] = "JavaScript";
+ Text[ russian ] = "JavaScript";
+ Text[ polish ] = "JavaScript";
+ Text[ japanese ] = "JavaScript";
+ Text[ chinese_traditional ] = "JavaScript";
+ Text[ arabic ] = "JavaScript";
+ Text[ greek ] = "JavaScript";
+ Text[ korean ] = "JavaScript";
+ Text[ turkish ] = "JavaScript";
+ };
+ MultiLineEdit ED_JAVASCRIPT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 88 ) ;
+ Size = MAP_APPFONT ( 236 , 76 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ VScroll = TRUE ;
+ HScroll = TRUE ;
+ Hide = TRUE ;
+ IgnoreTab = TRUE ;
+ };
+#endif
+ Text[ chinese_simplified ] = "ָ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Przypisz makro";
+ Text[ japanese ] = "ϸۂ̊蓖";
+ Text[ chinese_traditional ] = "w";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Assign Macro";
+};
+TabPage RID_SFX_SMALLTP_MACROASSIGN
+{
+ // HelpID = HID_MACROASSIGN ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ Text = "Makro zuweisen" ;
+ Text [ English ] = "Assign macro" ;
+ Text [ english_us ] = "Assign Macro" ;
+ Text [ italian ] = "Assegna macro" ;
+ Text [ spanish ] = "Asignar macro" ;
+ Text [ french ] = "Assignation de macro" ;
+ Text [ dutch ] = "Macro toewijzen" ;
+ Text [ swedish ] = "Tilldela makro" ;
+ Text [ danish ] = "Tildel makro" ;
+ Text [ portuguese_brazilian ] = "Makro zuweisen" ;
+ Text [ portuguese ] = "Atribuir macro" ;
+ GroupBox GB_EVENT
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 192 , 57 ) ;
+ Text = "Ereignis" ;
+ Text [ ENGLISH ] = "Event" ;
+ Group = TRUE ;
+ Text [ english_us ] = "Event" ;
+ Text [ italian ] = "Evento" ;
+ Text [ spanish ] = "Acontecimiento" ;
+ Text [ french ] = "vnement" ;
+ Text [ dutch ] = "Gebeurtenis" ;
+ Text [ swedish ] = "Hndelse" ;
+ Text [ danish ] = "Begivenhed" ;
+ Text [ portuguese_brazilian ] = "Ereignis" ;
+ Text [ portuguese ] = "Acontecimento" ;
+ Text[ chinese_simplified ] = "¼";
+ Text[ russian ] = "";
+ Text[ polish ] = "Wydarzenie";
+ Text[ japanese ] = "s";
+ Text[ chinese_traditional ] = "ʧ@";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̺Ʈ";
+ Text[ turkish ] = "Olay";
+ };
+ Control LB_EVENT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 180 , 40 ) ;
+ TabStop = TRUE ;
+ ClipChildren = TRUE ;
+ Disable = TRUE ;
+ HelpID = HID_MACRO_LB_EVENT ;
+ };
+ PushButton PB_ASSIGN
+ {
+ Pos = MAP_APPFONT ( 204 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ // ### ACHTUNG: Neuer Text in Resource? Z~uweisen : Zuweisen
+ Text = "Z~uweisen" ;
+ Text [ English ] = "Assign" ;
+ Disable = TRUE ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Assign" ;
+ Text [ italian ] = "A~ssegna" ;
+ Text [ spanish ] = "~Asignar" ;
+ Text [ french ] = "~Assigner" ;
+ Text [ dutch ] = "T~oewijzen" ;
+ Text [ swedish ] = "Till~dela" ;
+ Text [ danish ] = "Tildel" ;
+ Text [ portuguese_brazilian ] = "Z~uweisen" ;
+ Text [ portuguese ] = "~Atribuir" ;
+ Text[ chinese_simplified ] = "ָ(~A)";
+ Text[ russian ] = "";
+ Text[ polish ] = "P~rzypisz";
+ Text[ japanese ] = "蓖(~A)";
+ Text[ chinese_traditional ] = "w(~A)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~A)";
+ Text[ turkish ] = "A~ta";
+ };
+ PushButton PB_DELETE
+ {
+ Pos = MAP_APPFONT ( 204 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Aufheben" ;
+ Text [ English ] = "~Dismiss" ;
+ Disable = TRUE ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Remove" ;
+ Text [ italian ] = "~Rimuovi" ;
+ Text [ spanish ] = "~Eliminar" ;
+ Text [ french ] = "~liminer" ;
+ Text [ dutch ] = "~Opheffen" ;
+ Text [ swedish ] = "~Upphv" ;
+ Text [ danish ] = "Oph~v" ;
+ Text [ portuguese_brazilian ] = "~Aufheben" ;
+ Text [ portuguese ] = "~Limpar" ;
+ Text[ chinese_simplified ] = "ȡ(~R)";
+ Text[ russian ] = "";
+ Text[ polish ] = "~Usu";
+ Text[ japanese ] = "(~R)";
+ Text[ chinese_traditional ] = "(~R)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~R)";
+ Text[ turkish ] = "~Kaldr";
+ };
+ ListBox LB_SCRIPTTYPE
+ {
+ Pos = MAP_APPFONT ( 204 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 30 ) ;
+ Text = "~Scriptsprache" ;
+ TabStop = TRUE ;
+ Disable = FALSE ;
+ DropDown = TRUE ;
+ };
+ GroupBox GB_MACRO
+ {
+ Pos = MAP_APPFONT ( 6 , 66 ) ;
+ Size = MAP_APPFONT ( 248 , 63 ) ;
+ Group = TRUE ;
+ };
+ Control LB_GROUP
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 77 ) ;
+ Size = MAP_APPFONT ( 111 , 44 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ HelpId = HID_MACRO_GROUP ;
+ };
+ Control LB_MACROS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 129 , 77 ) ;
+ Size = MAP_APPFONT ( 119 , 44 ) ;
+ TabStop = TRUE ;
+ Group = TRUE ;
+ HelpId = HID_MACRO_MACROS ;
+ };
+ String STR_MACROS
+ {
+ Text = "Makros" ;
+ Text [ ENGLISH ] = "Macros" ;
+ Text [ dutch ] = "Macro's" ;
+ Text [ english_us ] = "Macros" ;
+ Text [ italian ] = "Macro" ;
+ Text [ spanish ] = "Macros" ;
+ Text [ french ] = "Macros" ;
+ Text [ swedish ] = "Makron" ;
+ Text [ danish ] = "Makroer" ;
+ Text [ portuguese_brazilian ] = "Makros" ;
+ Text [ portuguese ] = "Macros" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Makra";
+ Text[ japanese ] = "ϸ";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "";
+ Text[ korean ] = "ũ";
+ Text[ turkish ] = "Makro";
+ };
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ polish ] = "Przypisz makro";
+ Text[ japanese ] = "ϸۂ̊蓖";
+ Text[ korean ] = "ũ ";
+ Text[ chinese_simplified ] = "ָ";
+ Text[ chinese_traditional ] = "w";
+ Text[ turkish ] = "Makro ata";
+ Text[ arabic ] = " ";
+#if SUPD<582
+ String STR_JAVASCRIPT
+ {
+ Text = "JavaScript" ;
+ Text [ ENGLISH ] = "JavaScript" ;
+ Text [ english_us ] = "JavaScript" ;
+ Text [ swedish ] = "JavaScript" ;
+ Text [ danish ] = "JavaScript" ;
+ Text [ italian ] = "JavaScript" ;
+ Text [ spanish ] = "JavaScript" ;
+ Text [ french ] = "JavaScript" ;
+ Text [ dutch ] = "JavaScript" ;
+ Text [ portuguese_brazilian ] = "JavaScript" ;
+ Text [ portuguese ] = "JavaScript" ;
+ Text[ chinese_simplified ] = "JavaScript";
+ Text[ russian ] = "JavaScript";
+ Text[ polish ] = "JavaScript";
+ Text[ japanese ] = "JavaScript";
+ Text[ chinese_traditional ] = "JavaScript";
+ Text[ arabic ] = "JavaScript";
+ Text[ greek ] = "JavaScript";
+ Text[ korean ] = "JavaScript";
+ Text[ turkish ] = "JavaScript";
+ };
+ MultiLineEdit ED_JAVASCRIPT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 77 ) ;
+ Size = MAP_APPFONT ( 236 , 44 ) ;
+ TabStop = TRUE ;
+ Left = TRUE ;
+ VScroll = TRUE ;
+ HScroll = TRUE ;
+ Hide = TRUE ;
+ IgnoreTab = TRUE ;
+ };
+#endif
+ Text[ chinese_simplified ] = "ָ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Przypisz makro";
+ Text[ japanese ] = "ϸۂ̊蓖";
+ Text[ chinese_traditional ] = "w";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "Assign Macro";
+};
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
new file mode 100644
index 000000000000..41c617213716
--- /dev/null
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -0,0 +1,364 @@
+/*************************************************************************
+ *
+ * $RCSfile: mailmodel.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:30 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// includes --------------------------------------------------------------
+
+#ifndef _COM_SUN_STAR_CHAOS_XDATACONTAINER_HPP_
+#include <com/sun/star/chaos/XDataContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_COMMANDABORTEDEXCEPTION_HPP_
+#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+
+#include "mailmodel.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "viewfrm.hxx"
+#include "docfile.hxx"
+#include "docfilt.hxx"
+#include "docfac.hxx"
+#include "fcontnr.hxx"
+#include "objshimp.hxx"
+
+#include "sfxsids.hrc"
+
+#include <tools/tempfile.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/eitem.hxx>
+#include <unotools/processfactory.hxx>
+#include <ucbhelper/content.hxx>
+
+using namespace com::sun::star::chaos;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::uno;
+
+// class AddressList_Impl ------------------------------------------------
+
+typedef String* AddressItemPtr_Impl;
+DECLARE_LIST( AddressList_Impl, AddressItemPtr_Impl );
+
+// class SfxMailModel_Impl -----------------------------------------------
+
+void SfxMailModel_Impl::ClearList( AddressList_Impl* pList )
+{
+ if ( pList )
+ {
+ ULONG i, nCount = pList->Count();
+ for ( i = 0; i < nCount; ++i )
+ delete pList->GetObject(i);
+ pList->Clear();
+ }
+}
+
+void SfxMailModel_Impl::MakeValueList( AddressList_Impl* pList, String& rValueList )
+{
+ rValueList.Erase();
+ if ( pList )
+ {
+ ULONG i, nCount = pList->Count();
+ for ( i = 0; i < nCount; ++i )
+ {
+ if ( rValueList.Len() > 0 )
+ rValueList += ',';
+ rValueList += *pList->GetObject(i);
+ }
+ }
+}
+
+sal_Bool SfxMailModel_Impl::SaveDocument( String& rFileName, String& rType )
+{
+ sal_Bool bRet = sal_False;
+ SfxViewFrame* pTopViewFrm = mpBindings->GetDispatcher_Impl()->GetFrame()->GetTopViewFrame();
+ SfxObjectShellRef xDocShell = pTopViewFrm->GetObjectShell();
+
+ // save the document
+ if ( xDocShell.Is() && xDocShell->GetMedium() )
+ {
+ // save old settings
+ BOOL bOldDidDangerousSave = xDocShell->Get_Impl()->bDidDangerousSave;
+ BOOL bModified = xDocShell->IsModified();
+ // prepare for mail export
+ SfxDispatcher* pDisp = pTopViewFrm->GetDispatcher();
+ pDisp->Execute( SID_MAIL_PREPAREEXPORT, SFX_CALLMODE_SYNCHRON );
+ // detect filter
+ const SfxFilter* pFilter = xDocShell->GetMedium()->GetFilter();
+ sal_Bool bHasFilter = pFilter ? sal_True : sal_False;
+ if ( !pFilter )
+ {
+ SfxFilterMatcher aFilterMatcher( xDocShell->GetFactory().GetFilterContainer() );
+ pFilter = aFilterMatcher.GetDefaultFilter();
+ }
+ // create temp file name with leading chars and extension
+ String aLeadingStr( DEFINE_CONST_UNICODE("smail") );
+ sal_Bool bHasName = xDocShell->HasName();
+ if ( !bHasName )
+ aLeadingStr = String( DEFINE_CONST_UNICODE("noname") );
+ String* pExt = NULL;
+ if ( pFilter )
+ {
+ pExt = new String( pFilter->GetWildcard()() );
+ // erase the '*' from the extension (e.g. "*.sdw")
+ pExt->Erase( 0, 1 );
+ }
+ TempFile aTempFile( aLeadingStr, pExt );
+ rFileName = aTempFile.GetName();
+ // save document to temp file
+ SfxStringItem aFileName( SID_FILE_NAME, rFileName );
+ SfxBoolItem aPicklist( SID_PICKLIST, FALSE );
+ SfxBoolItem aSaveTo( SID_SAVETO, TRUE );
+ SfxStringItem* pFilterName = NULL;
+ if ( bHasFilter && pFilter )
+ pFilterName = new SfxStringItem( SID_FILTER_NAME, pFilter->GetName() );
+ pDisp->Execute( SID_SAVEASDOC, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_API,
+ &aFileName, &aPicklist, &aSaveTo, pFilterName, 0L );
+ delete pFilterName;
+ if ( pFilter )
+ {
+ // detect content type and expand with the file name
+ rType = pFilter->GetMimeType();
+ rType += DEFINE_CONST_UNICODE("; name =\"");
+ INetURLObject aFileObj = bHasName ? xDocShell->GetMedium()->GetURLObject()
+ : INetURLObject( rFileName );
+ rType += aFileObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
+ rType += '\"';
+ }
+ // restore old settings
+ if ( !bModified && xDocShell->IsEnableSetModified() )
+ xDocShell->SetModified( FALSE );
+ if ( !bOldDidDangerousSave )
+ xDocShell->Get_Impl()->bDidDangerousSave = sal_False;
+ bRet = sal_True;
+ }
+ return bRet;
+}
+
+IMPL_LINK_INLINE_START( SfxMailModel_Impl, DoneHdl, void*, EMPTYARG )
+{
+ mbLoadDone = sal_True;
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxMailModel_Impl, DoneHdl, void*, EMPTYARG )
+
+SfxMailModel_Impl::SfxMailModel_Impl( SfxBindings* pBinds ) :
+
+ mpToList ( NULL ),
+ mpCcList ( NULL ),
+ mpBccList ( NULL ),
+ mpBindings ( pBinds ),
+ mePriority ( PRIO_NORMAL ),
+ mbLoadDone ( sal_True )
+
+{
+}
+
+SfxMailModel_Impl::~SfxMailModel_Impl()
+{
+ ClearList( mpToList );
+ delete mpToList;
+ ClearList( mpCcList );
+ delete mpCcList;
+ ClearList( mpBccList );
+ delete mpBccList;
+}
+
+void SfxMailModel_Impl::AddAddress( const String& rAddress, AddressRole eRole )
+{
+ // don't add a empty address
+ if ( rAddress.Len() > 0 )
+ {
+ AddressList_Impl* pList = NULL;
+ if ( ROLE_TO == eRole )
+ {
+ if ( !mpToList )
+ // create the list
+ mpToList = new AddressList_Impl;
+ pList = mpToList;
+ }
+ else if ( ROLE_CC == eRole )
+ {
+ if ( !mpCcList )
+ // create the list
+ mpCcList = new AddressList_Impl;
+ pList = mpCcList;
+ }
+ else if ( ROLE_BCC == eRole )
+ {
+ if ( !mpBccList )
+ // create the list
+ mpBccList = new AddressList_Impl;
+ pList = mpBccList;
+ }
+ else
+ {
+ DBG_ERRORFILE( "invalid address role" );
+ }
+
+ if ( pList )
+ {
+ // add address to list
+ AddressItemPtr_Impl pAddress = new String( rAddress );
+ pList->Insert( pAddress, LIST_APPEND );
+ }
+ }
+}
+
+sal_Bool SfxMailModel_Impl::Send()
+{
+ sal_Bool bSend = sal_False;
+ String aFileName, aContentType;
+ if ( SaveDocument( aFileName, aContentType ) )
+ {
+ Reference < XMultiServiceFactory > xMgr = ::utl::getProcessServiceFactory();
+ Reference < XDataContainer > xData(
+ xMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.chaos.DataContainer") ), UNO_QUERY );
+ if ( xData.is() )
+ {
+ xData->setContentType( aContentType );
+ xData->setDataURL( aFileName );
+
+ try
+ {
+ Reference< ::com::sun::star::ucb::XCommandEnvironment > aCmdEnv;
+ String aURL = ::rtl::OUString( DEFINE_CONST_UNICODE("vnd.sun.staroffice.out:///~") );
+ ::ucb::Content aOutbox( aURL, aCmdEnv );
+ ::ucb::Content aMessage( aURL, aCmdEnv );
+
+ sal_Int32 nIdx = 0, nCount = 4;
+ sal_Bool bCc = sal_False, bBcc = sal_False;
+ if ( mpCcList && mpCcList->Count() > 0 )
+ {
+ bCc = sal_True;
+ nCount++;
+ }
+ if ( mpBccList && mpBccList->Count() > 0 )
+ {
+ bBcc = sal_True;
+ nCount++;
+ }
+ Sequence < ::rtl::OUString > aNamesList(nCount);
+ ::rtl::OUString* pNames = aNamesList.getArray();
+ pNames[nIdx++] = ::rtl::OUString::createFromAscii( "Title" );
+ pNames[nIdx++] = ::rtl::OUString::createFromAscii( "MessageFrom" );
+ pNames[nIdx++] = ::rtl::OUString::createFromAscii( "MessageTo" );
+ pNames[nIdx++] = ::rtl::OUString::createFromAscii( "MessageBody" );
+ if ( bCc )
+ pNames[nIdx++] = ::rtl::OUString::createFromAscii( "MessageCC" );
+ if ( bBcc )
+ pNames[nIdx++] = ::rtl::OUString::createFromAscii( "MessageBCC" );
+
+ nIdx = 0;
+ Sequence < Any > aValuesList(nCount);
+ Any* pValues = aValuesList.getArray();
+ pValues[nIdx++] = makeAny( ::rtl::OUString( maSubject ) );
+ pValues[nIdx++] = makeAny( ::rtl::OUString( maFromAddress ) );
+ String aValueList;
+ MakeValueList( mpToList, aValueList );
+ pValues[nIdx++] = makeAny( ::rtl::OUString( aValueList ) );
+ pValues[nIdx++] = makeAny( xData );
+ if ( bCc )
+ {
+ MakeValueList( mpCcList, aValueList );
+ pValues[nIdx++] = makeAny( ::rtl::OUString( aValueList ) );
+ }
+ if ( bBcc )
+ {
+ MakeValueList( mpBccList, aValueList );
+ pValues[nIdx++] = makeAny( ::rtl::OUString( aValueList ) );
+ }
+
+ bSend = aOutbox.insertNewContent(
+ ::rtl::OUString( DEFINE_CONST_UNICODE("application/vnd.sun.staroffice.message") ),
+ aNamesList, aValuesList, aMessage );
+ }
+ catch( ::ucb::ContentCreationException& e )
+ {
+ switch ( e.getReason() )
+ {
+ case ::ucb::ContentCreationException::NO_CONTENT_BROKER :
+ DBG_ERRORFILE( "no content broker" );
+ break;
+
+ default:
+ DBG_ERRORFILE( "ContentCreationException" );
+ }
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& e )
+ {
+ ByteString aError( UniString( e.Message ), RTL_TEXTENCODING_MS_1252 );
+ DBG_ERRORFILE( aError.GetBuffer() );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+ }
+ }
+
+ return bSend;
+}
+
+
diff --git a/sfx2/source/dialog/mailwindow.src b/sfx2/source/dialog/mailwindow.src
new file mode 100644
index 000000000000..3f404b95ae9a
--- /dev/null
+++ b/sfx2/source/dialog/mailwindow.src
@@ -0,0 +1,545 @@
+/*************************************************************************
+ *
+ * $RCSfile: mailwindow.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "dialog.hrc"
+#include "mailwindow.hrc"
+
+Window RID_MAIL_WINDOW
+{
+ HelpId = SID_MAIL_CHILDWIN ;
+ Pos = MAP_APPFONT( 0, 0 );
+ Size = MAP_APPFONT( 323, 87 );
+ DialogControl = TRUE ;
+ PushButton PB_MAILWIN_SEND
+ {
+ Pos = MAP_APPFONT( 6, 6 );
+ Size = MAP_APPFONT( 50, 14 );
+ Text = "~Senden";
+ Text[English] = "Send";
+ TabStop = TRUE;
+ Text[ english_us ] = "Send";
+ Text[ portuguese ] = "Send";
+ Text[ russian ] = "Send";
+ Text[ greek ] = "Send";
+ Text[ dutch ] = "Send";
+ Text[ french ] = "En~voyer";
+ Text[ spanish ] = "Send";
+ Text[ italian ] = "Send";
+ Text[ danish ] = "Send";
+ Text[ swedish ] = "~Skicka";
+ Text[ polish ] = "Send";
+ Text[ portuguese_brazilian ] = "Send";
+ Text[ japanese ] = "M";
+ Text[ korean ] = "Send";
+ Text[ chinese_simplified ] = "Send";
+ Text[ chinese_traditional ] = "oe";
+ Text[ turkish ] = "Send";
+ Text[ arabic ] = "Send";
+ };
+ PushButton PB_MAILWIN_CLOSE
+ {
+ Pos = MAP_APPFONT( 6, 23 );
+ Size = MAP_APPFONT( 50, 14 );
+ Text = "S~chlieen";
+ Text[English] = "Close";
+ TabStop = TRUE;
+ Text[ english_us ] = "Close";
+ Text[ portuguese ] = "Close";
+ Text[ russian ] = "Close";
+ Text[ greek ] = "Close";
+ Text[ dutch ] = "Close";
+ Text[ french ] = "~Fermer";
+ Text[ spanish ] = "Close";
+ Text[ italian ] = "Close";
+ Text[ danish ] = "Luk";
+ Text[ swedish ] = "Close";
+ Text[ polish ] = "Close";
+ Text[ portuguese_brazilian ] = "Close";
+ Text[ japanese ] = "‚";
+ Text[ korean ] = "Close";
+ Text[ chinese_simplified ] = "Close";
+ Text[ chinese_traditional ] = "";
+ Text[ turkish ] = "Close";
+ Text[ arabic ] = "Close";
+ };
+ ListBox LB_MAILWIN_ROLE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT( 62, 6 );
+ Size = MAP_APPFONT( 42, 30 );
+ DropDown = TRUE ;
+ StringList =
+ {
+ < "An" ; 1 ; > ;
+ < "Kopie" ; 2 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ ENGLISH ] =
+ {
+ < "To" ; 1 ; > ;
+ < "Copy" ; 2 ; > ;
+ < "Blind copy" ; 3 ; > ;
+ };
+ StringList [ language_user1 ] =
+ {
+ < "An" ; 1 ; > ;
+ < "Kopie" ; 2 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ english_us ] =
+ {
+ < "To" ; 3 ; > ;
+ < "Copy" ; 3 ; > ;
+ < "Blind Copy" ; 3 ; > ;
+ };
+ StringList [ portuguese ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ russian ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ greek ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ dutch ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ french ] =
+ {
+ < "" ; 3 ; > ;
+ < "Copie" ; 3 ; > ;
+ < "Copie cache" ; 3 ; > ;
+ };
+ StringList [ spanish ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ italian ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ danish ] =
+ {
+ < "Til" ; 3 ; > ;
+ < "Kopi" ; 3 ; > ;
+ < "Blindkopi" ; 3 ; > ;
+ };
+ StringList [ swedish ] =
+ {
+ < "Till" ; 3 ; > ;
+ < "Kopia" ; 3 ; > ;
+ < "Blindkopia" ; 3 ; > ;
+ };
+ StringList [ polish ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ portuguese_brazilian ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ japanese ] =
+ {
+ < "" ; 3 ; > ;
+ < "CC" ; 3 ; > ;
+ < "BCC" ; 3 ; > ;
+ };
+ StringList [ korean ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ chinese_simplified ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ chinese_traditional ] =
+ {
+ < "" ; 3 ; > ;
+ < "۰e" ; 3 ; > ;
+ < "K" ; 3 ; > ;
+ };
+ StringList [ turkish ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ StringList [ arabic ] =
+ {
+ < "An" ; 3 ; > ;
+ < "Kopie" ; 3 ; > ;
+ < "Blindkopie" ; 3 ; > ;
+ };
+ };
+ Edit ED_MAILWIN_ROLE
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 107, 6 );
+ Size = MAP_APPFONT( 210, 12 );
+ };
+ ListBox LB_MAILWIN_ADDRESS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT( 107, 21 );
+ Size = MAP_APPFONT( 210, 30 );
+ AutoHScroll = TRUE ;
+ };
+ FixedText FT_MAILWIN_SUBJECT
+ {
+ Pos = MAP_APPFONT( 62, 55 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text = "~Betreff:";
+ Text[English] = "Subject:";
+ Text[ english_us ] = "Subject:";
+ Text[ portuguese ] = "Subject:";
+ Text[ russian ] = "Subject:";
+ Text[ greek ] = "Subject:";
+ Text[ dutch ] = "Subject:";
+ Text[ french ] = "O~bjet :";
+ Text[ spanish ] = "Subject:";
+ Text[ italian ] = "Subject:";
+ Text[ danish ] = "Emne:";
+ Text[ swedish ] = "Subject:";
+ Text[ polish ] = "Subject:";
+ Text[ portuguese_brazilian ] = "Subject:";
+ Text[ japanese ] = ":";
+ Text[ korean ] = "Subject:";
+ Text[ chinese_simplified ] = "Subject:";
+ Text[ chinese_traditional ] = "DG";
+ Text[ turkish ] = "Subject:";
+ Text[ arabic ] = "Subject:";
+ };
+ Edit ED_MAILWIN_SUBJECT
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 107, 54 );
+ Size = MAP_APPFONT( 210, 12 );
+ };
+ FixedText FT_MAILWIN_FROM
+ {
+ Pos = MAP_APPFONT( 62, 70 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text = "~Von:";
+ Text[English] = "From:";
+ Text[ english_us ] = "From:";
+ Text[ portuguese ] = "From:";
+ Text[ russian ] = "From:";
+ Text[ greek ] = "From:";
+ Text[ dutch ] = "From:";
+ Text[ french ] = "~De :";
+ Text[ spanish ] = "From:";
+ Text[ italian ] = "From:";
+ Text[ danish ] = "Fra:";
+ Text[ swedish ] = "From:";
+ Text[ polish ] = "From:";
+ Text[ portuguese_brazilian ] = "From:";
+ Text[ japanese ] = "ol:";
+ Text[ korean ] = "From:";
+ Text[ chinese_simplified ] = "From:";
+ Text[ chinese_traditional ] = "H̡G";
+ Text[ turkish ] = "From:";
+ Text[ arabic ] = "From:";
+ };
+ Edit ED_MAILWIN_FROM
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 107, 69 );
+ Size = MAP_APPFONT( 120, 12 );
+ };
+ FixedText FT_MAILWIN_PRIO
+ {
+ Pos = MAP_APPFONT( 230, 70 );
+ Size = MAP_APPFONT( 33, 10 );
+ Right = TRUE;
+ Text = "~Prioritt:";
+ Text[English] = "Priority:";
+ Text[ english_us ] = "Priority:";
+ Text[ portuguese ] = "Priority:";
+ Text[ russian ] = "Priority:";
+ Text[ greek ] = "Priority:";
+ Text[ dutch ] = "Priority:";
+ Text[ french ] = "~Priorit :";
+ Text[ spanish ] = "Priority:";
+ Text[ italian ] = "Priority:";
+ Text[ danish ] = "Prioritet:";
+ Text[ swedish ] = "~Prioritet:";
+ Text[ polish ] = "Priority:";
+ Text[ portuguese_brazilian ] = "Priority:";
+ Text[ japanese ] = "dvx:";
+ Text[ korean ] = "Priority:";
+ Text[ chinese_simplified ] = "Priority:";
+ Text[ chinese_traditional ] = "nʡG";
+ Text[ turkish ] = "Priority:";
+ Text[ arabic ] = "Priority:";
+ };
+ ListBox LB_MAILWIN_PRIO
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 266, 69 );
+ Size = MAP_APPFONT( 51, 48 );
+ DropDown = TRUE;
+ StringList =
+ {
+ < "Sehr hoch" ; 1 ; > ;
+ < "Hoch" ; 2 ; > ;
+ < "Normal" ; 3 ; > ;
+ < "Niedrig" ; 4 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ ENGLISH ] =
+ {
+ < "Highest" ; 1 ; > ;
+ < "High" ; 2 ; > ;
+ < "Normal" ; 3 ; > ;
+ < "Low" ; 4 ; > ;
+ < "Lowest" ; 5 ; > ;
+ };
+ StringList [ language_user1 ] =
+ {
+ < "Sehr hoch" ; 1 ; > ;
+ < "Hoch" ; 2 ; > ;
+ < "Normal" ; 3 ; > ;
+ < "Niedrig" ; 4 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ english_us ] =
+ {
+ < "Urgent" ; 5 ; > ;
+ < "Important" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Low" ; 5 ; > ;
+ < "Lowest" ; 5 ; > ;
+ };
+ StringList [ portuguese ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ russian ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ greek ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ dutch ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ french ] =
+ {
+ < "Trs leve" ; 5 ; > ;
+ < "leve" ; 5 ; > ;
+ < "Normale" ; 5 ; > ;
+ < "Faible" ; 5 ; > ;
+ < "Trs faible" ; 5 ; > ;
+ };
+ StringList [ spanish ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ italian ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ danish ] =
+ {
+ < "Meget hj" ; 5 ; > ;
+ < "Hj" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Lav" ; 5 ; > ;
+ < "Meget lav" ; 5 ; > ;
+ };
+ StringList [ swedish ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ polish ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ portuguese_brazilian ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ japanese ] =
+ {
+ < "" ; 5 ; > ;
+ < "⍂" ; 5 ; > ;
+ < "W" ; 5 ; > ;
+ < "Ⴂ" ; 5 ; > ;
+ < "Ⴂ" ; 5 ; > ;
+ };
+ StringList [ korean ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ chinese_simplified ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ chinese_traditional ] =
+ {
+ < "ܰ" ; 5 ; > ;
+ < "" ; 5 ; > ;
+ < "@" ; 5 ; > ;
+ < "C" ; 5 ; > ;
+ < "ܧC" ; 5 ; > ;
+ };
+ StringList [ turkish ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ StringList [ arabic ] =
+ {
+ < "Sehr hoch" ; 5 ; > ;
+ < "Hoch" ; 5 ; > ;
+ < "Normal" ; 5 ; > ;
+ < "Niedrig" ; 5 ; > ;
+ < "Sehr niedrig" ; 5 ; > ;
+ };
+ };
+ Image IMG_MAILWIN_SEND
+ {
+ ImageBitmap = Bitmap { File = "sc05364.bmp" ; };
+ MaskColor = Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; };
+ };
+ Image IMG_MAILWIN_CLOSE
+ {
+ ImageBitmap = Bitmap { File = "sc05503.bmp" ; };
+ MaskColor = Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; };
+ };
+};
+
+// ------------------------------------------------------------------- EOF
+
diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk
new file mode 100644
index 000000000000..de2146fdc613
--- /dev/null
+++ b/sfx2/source/dialog/makefile.mk
@@ -0,0 +1,140 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=dialog
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------------
+
+IMGLST_SRS=$(SRS)$/dialog.srs
+BMP_IN=$(PRJ)$/win/res
+
+SLOFILES =\
+ $(SLO)$/about.obj \
+ $(SLO)$/acccfg.obj \
+ $(SLO)$/basedlgs.obj \
+ $(SLO)$/cfg.obj \
+ $(SLO)$/dinfdlg.obj \
+ $(SLO)$/dinfedt.obj \
+ $(SLO)$/dockwin.obj \
+ $(SLO)$/eventdlg.obj \
+ $(SLO)$/intro.obj \
+ $(SLO)$/macropg.obj \
+ $(SLO)$/mailchildwin.obj \
+ $(SLO)$/maillistener.obj \
+ $(SLO)$/mailmodel.obj \
+ $(SLO)$/mailwindow.obj \
+ $(SLO)$/menucfg.obj \
+ $(SLO)$/mgetempl.obj \
+ $(SLO)$/navigat.obj \
+ $(SLO)$/newstyle.obj \
+ $(SLO)$/oregdlg.obj \
+ $(SLO)$/passwd.obj \
+ $(SLO)$/register.obj \
+ $(SLO)$/sfxurl.obj \
+ $(SLO)$/slotinfo.obj \
+ $(SLO)$/splitwin.obj \
+ $(SLO)$/styfitem.obj \
+ $(SLO)$/styledlg.obj \
+ $(SLO)$/tabdlg.obj \
+ $(SLO)$/templdlg.obj \
+ $(SLO)$/tplcitem.obj \
+ $(SLO)$/tplpitem.obj \
+ $(SLO)$/versdlg.obj
+
+EXCEPTIONSFILES=\
+ $(SLO)$/maillistener.obj \
+ $(SLO)$/mailmodel.obj
+
+SRCFILES =\
+ about.src \
+ cfg.src \
+ dialog.src \
+ dinfdlg.src \
+ dinfedt.src \
+ dlgrun.src \
+ eventdlg.src \
+ macropg.src \
+ mail.src \
+ mailwindow.src \
+ mgetempl.src \
+ newstyle.src \
+ oregdlg.src \
+ passwd.src \
+ register.src \
+ templdlg.src \
+ versdlg.src
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
new file mode 100644
index 000000000000..729aef9d6aa2
--- /dev/null
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -0,0 +1,709 @@
+/*************************************************************************
+ *
+ * $RCSfile: mgetempl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// include ---------------------------------------------------------------
+
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SV_FIELD_HXX //autogen
+#include <vcl/field.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXSTYLE_HXX //autogen
+#include <svtools/style.hxx>
+#endif
+#pragma hdrstop
+
+#include "styfitem.hxx"
+#include "styledlg.hxx"
+#include "app.hxx"
+#include "mgetempl.hxx"
+#include "objsh.hxx"
+#include "sfxtypes.hxx"
+#include "sfxresid.hxx"
+#include "module.hxx"
+#include "saveopt.hxx"
+
+#include "sfx.hrc"
+#include "dialog.hrc"
+#include "mgetempl.hrc"
+
+#ifndef _SFX_STYLE_HRC
+#include <svtools/style.hrc>
+#endif
+
+// SfxManageStyleSheetPage -----------------------------------------------
+
+SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItemSet& rAttrSet ) :
+
+ SfxTabPage( pParent, SfxResId( TP_MANAGE_STYLES ), rAttrSet ),
+
+ aNameFt ( this, ResId( FT_NAME ) ),
+ aNameEd ( this, ResId( ED_NAME ) ),
+ aAutoCB ( this, ResId( CB_AUTO ) ),
+
+ aFollowFt ( this, ResId( FT_NEXT ) ),
+ aFollowLb ( this, ResId( LB_NEXT ) ),
+
+ aBaseFt ( this, ResId( FT_BASE ) ),
+ aBaseLb ( this, ResId( LB_BASE ) ),
+
+ aFilterFt ( this, ResId( FT_REGION ) ),
+ aFilterLb ( this, ResId( LB_REGION ) ),
+
+ aDescFt ( this, ResId( FT_DESC ) ),
+ aDescED ( this, ResId( ED_DESC ) ),
+ aDescGb ( this, ResId( GB_DESC ) ),
+
+ pStyle( &( (SfxStyleDialog*)pParent->GetParent() )->GetStyleSheet() ),
+
+ bModified ( FALSE ),
+ aName ( pStyle->GetName() ),
+ aFollow ( pStyle->GetFollow() ),
+ aParent ( pStyle->GetParent() ),
+ nFlags ( pStyle->GetMask() ),
+ pItem ( 0 )
+
+/* [Beschreibung]
+
+ Konstruktor; initialisiert die ListBoxen mit den Vorlagen
+
+*/
+
+{
+ FreeResource();
+
+ if ( IsBackground() )
+ aDescED.SetBackground( GetBackground() );
+ FixedInfo* pInfo = new FixedInfo( this );
+ aDescED.SetFont( pInfo->GetFont() );
+ delete pInfo;
+
+ aDescED.Hide();
+ aDescFt.Show();
+
+ // diese Page braucht ExchangeSupport
+ SetExchangeSupport();
+
+ ResMgr* pResMgr = SFX_APP()->GetISfxModule()->GetResMgr();
+ DBG_ASSERT( pResMgr, "kein ResMgr am Modul" );
+ pFamilies = new SfxStyleFamilies( ResId( DLG_STYLE_DESIGNER, pResMgr ) );
+
+ SfxStyleSheetBasePool* pPool = 0;
+ SfxObjectShell* pDocShell = SfxObjectShell::Current();
+
+ if ( pDocShell )
+ pPool = pDocShell->GetStyleSheetPool();
+ DBG_ASSERT( pPool, "kein Pool oder keine DocShell" );
+
+ if ( pPool )
+ {
+ pPool->SetSearchMask( pStyle->GetFamily() );
+ pPool->First(); // fuer SW - interne Liste updaten
+ }
+
+ if ( !pStyle->GetName().Len() && pPool )
+ {
+ // NullString als Name -> Name generieren
+ String aNoName( SfxResId( STR_NONAME ) );
+ USHORT nNo = 1;
+ String aNo( aNoName );
+ aNoName += String::CreateFromInt32( nNo );
+ while ( pPool->Find( aNoName ) )
+ {
+ ++nNo;
+ aNoName = aNo;
+ aNoName += String::CreateFromInt32( nNo );
+ }
+ pStyle->SetName( aNoName );
+ aName = aNoName;
+ aFollow = pStyle->GetFollow();
+ aParent = pStyle->GetParent();
+ }
+ aNameEd.SetText(pStyle->GetName());
+
+ if ( !pStyle->IsUserDefined() )
+ aNameEd.SetReadOnly();
+
+ if ( pStyle->HasFollowSupport() && pPool )
+ {
+ SfxStyleSheetBase* pPoolStyle = pPool->First();
+
+ while ( pPoolStyle )
+ {
+ aFollowLb.InsertEntry( pPoolStyle->GetName() );
+ pPoolStyle = pPool->Next();
+ }
+
+ // eine neue Vorlage ist noch nicht im Pool
+ if ( LISTBOX_ENTRY_NOTFOUND == aFollowLb.GetEntryPos( pStyle->GetName() ) )
+ aFollowLb.InsertEntry( pStyle->GetName() );
+ }
+ else
+ {
+ aFollowFt.Hide();
+ aFollowLb.Hide();
+
+ aFilterFt.SetPosPixel( aBaseFt.GetPosPixel() );
+ aFilterLb.SetPosPixel( aBaseLb.GetPosPixel() );
+
+ aBaseFt.SetPosPixel( aFollowFt.GetPosPixel() );
+ aBaseLb.SetPosPixel( aFollowLb.GetPosPixel() );
+ }
+
+ if ( pStyle->HasParentSupport() && pPool )
+ {
+ if ( pStyle->HasClearParentSupport() )
+ // die Basisvorlage darf auf NULL gesetzt werden
+ aBaseLb.InsertEntry( String( SfxResId( STR_NONE ) ) );
+
+ SfxStyleSheetBase* pPoolStyle = pPool->First();
+
+ while ( pPoolStyle )
+ {
+ const String aStr( pPoolStyle->GetName() );
+ // eigener Namen nicht als Basisvorlage
+ if ( aStr != aName )
+ aBaseLb.InsertEntry( aStr );
+ pPoolStyle = pPool->Next();
+ }
+ }
+ else
+ {
+ aBaseFt.Disable();
+ aBaseLb.Disable();
+ }
+ USHORT nCount = pFamilies->Count();
+
+ USHORT i;
+ for ( i = 0; i < nCount; ++i )
+ {
+ pItem = pFamilies->GetObject(i);
+
+ if ( pItem->GetFamily() == pStyle->GetFamily() )
+ break;
+ }
+
+ USHORT nStyleFilterIdx = 0xffff;
+
+ if ( i < nCount )
+ {
+ // Filterflags
+ const SfxStyleFilter& rList = pItem->GetFilterList();
+ nCount = (USHORT)rList.Count();
+ USHORT nIdx = 0;
+ USHORT nMask = pStyle->GetMask() & ~SFXSTYLEBIT_USERDEF;
+
+ if ( !nMask ) // Benutzervorlage?
+ nMask = pStyle->GetMask();
+
+ for ( i = 0; i < nCount; ++i )
+ {
+ SfxFilterTupel* pTupel = rList.GetObject(i);
+
+ if ( pTupel->nFlags != SFXSTYLEBIT_AUTO &&
+ pTupel->nFlags != SFXSTYLEBIT_USED &&
+// pTupel->nFlags != SFXSTYLEBIT_USERDEF &&
+ pTupel->nFlags != SFXSTYLEBIT_ALL )
+ {
+ aFilterLb.InsertEntry( pTupel->aName, nIdx );
+ aFilterLb.SetEntryData(nIdx, (void*)(long)i);
+
+ if ( ( pTupel->nFlags & nMask ) == nMask )
+ nStyleFilterIdx = nIdx;
+ ++nIdx;
+ }
+ }
+
+ if ( nStyleFilterIdx != 0xFFFF )
+ aFilterLb.SelectEntryPos( nStyleFilterIdx );
+ }
+
+ if ( !aFilterLb.GetEntryCount() || !pStyle->IsUserDefined() )
+ {
+ pItem = 0;
+ aFilterFt.Disable();
+ aFilterLb.Disable();
+ }
+ else
+ aFilterLb.SaveValue();
+ SetDescriptionText_Impl();
+
+ if ( aFollowLb.IsEnabled() || aBaseLb.IsEnabled() )
+ {
+ aNameEd.SetGetFocusHdl(
+ LINK( this, SfxManageStyleSheetPage, GetFocusHdl ) );
+ aNameEd.SetLoseFocusHdl(
+ LINK( this, SfxManageStyleSheetPage, LoseFocusHdl ) );
+ }
+ // ist es ein Style mit automatischem Update? (nur SW)
+ if(SFX_ITEM_SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
+ {
+ Size aSize = aNameEd.GetSizePixel();
+ aSize.Width() /= 2;
+ aNameEd.SetSizePixel(aSize);
+ aAutoCB.Show();
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
+
+/* [Beschreibung]
+
+ Destruktor; Freigabe der Daten
+
+*/
+
+{
+ delete pFamilies;
+ pItem = 0;
+ pStyle = 0;
+
+}
+
+//-------------------------------------------------------------------------
+
+void SfxManageStyleSheetPage::UpdateName_Impl( ListBox* pBox,
+ const String& rNew )
+
+/* [Beschreibung]
+
+ Nach der "Anderung eines Vorlagennamens die ListBox pBox
+ aktualisieren
+
+ [Parameter]
+
+ ListBox* pBox ListBox, deren Eintr"age aktualisiert
+ werden sollen
+ const String& rNew der neue Name
+
+*/
+
+{
+ if ( pBox->IsEnabled() )
+ {
+ // ist der aktuelle Eintrag, dessen Namen modifizieren wurde
+ const BOOL bSelect = pBox->GetSelectEntry() == aBuf;
+ pBox->RemoveEntry( aBuf );
+ pBox->InsertEntry( rNew );
+
+ if ( bSelect )
+ pBox->SelectEntry( rNew );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxManageStyleSheetPage::SetDescriptionText_Impl()
+
+/* [Beschreibung]
+
+ Attributbeschreibung setzen. daf"ur die eingestellte Metrik besorgen.
+*/
+
+{
+ SfxApplication* pSfxApp = SFX_APP();
+ SfxMapUnit eUnit = SFX_MAPUNIT_CM;
+ FieldUnit eFieldUnit = pSfxApp->GetOptions().GetMetric();
+ SfxModule* pModule = pSfxApp->GetActiveModule();
+
+ if ( pModule )
+ {
+ const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
+
+ if ( pItem )
+ eFieldUnit = (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+ }
+
+ switch ( eFieldUnit )
+ {
+ case FUNIT_MM: eUnit = SFX_MAPUNIT_MM; break;
+
+ case FUNIT_CM:
+ case FUNIT_M:
+ case FUNIT_KM: eUnit = SFX_MAPUNIT_CM; break;
+
+ case FUNIT_POINT:
+ case FUNIT_PICA: eUnit = SFX_MAPUNIT_POINT; break;
+
+ case FUNIT_INCH:
+ case FUNIT_FOOT:
+ case FUNIT_MILE: eUnit = SFX_MAPUNIT_INCH; break;
+
+ default:
+ DBG_ERRORFILE( "not supported fieldunit" );
+ }
+ aDescFt.SetText( pStyle->GetDescription( eUnit ) );
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
+
+/* [Beschreibung]
+
+ StarView Handler; GetFocus-Handler des Edits mit dem Vorlagennamen.
+
+*/
+
+{
+ aBuf = pEdit->GetText();
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
+
+/* [Beschreibung]
+
+ StarView Handler; LoseFocus-Handler des Edits mit dem Vorlagennamen.
+ Dieser aktualisiert ggf. die Listbox mit den Folgevorlagen.
+ In der Listbox mit den Basisvorlagen ist die aktuelle Vorlage
+ selbst nicht enthalten.
+
+*/
+
+{
+ const String aStr( pEdit->GetText() );
+ // ggf. Listbox der Basisvorlagen aktualisieren
+ if ( aStr != aBuf )
+ UpdateName_Impl( &aFollowLb, aStr );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
+
+//-------------------------------------------------------------------------
+
+BOOL SfxManageStyleSheetPage::FillItemSet( SfxItemSet& rSet )
+
+/* [Beschreibung]
+
+
+ Handler f"ur das Setzen der (modifizierten) Daten. Wird aus
+ dem Ok des SfxTabDialog gerufen.
+
+ [Parameter]
+
+ SfxItemSet &rAttrSet das Set, das die Daten entgegennimmt.
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE: es hat eine "Anderung der Daten
+ stattgefunden
+ FALSE: es hat keine "Anderung der Daten
+ stattgefunden
+
+ [Querverweise]
+
+ <class SfxTabDialog>
+
+*/
+
+{
+ const USHORT nFilterIdx = aFilterLb.GetSelectEntryPos();
+
+ // Filter setzen
+
+ if ( LISTBOX_ENTRY_NOTFOUND != nFilterIdx &&
+ nFilterIdx != aFilterLb.GetSavedValue() &&
+ aFilterLb.IsEnabled() )
+ {
+ bModified = TRUE;
+ DBG_ASSERT( pItem, "kein Item" );
+ // geht nur bei Benutzervorlagen
+#ifdef DEBUG
+ USHORT nIdx = (USHORT)(long)aFilterLb.GetEntryData( nFilterIdx );
+ SfxFilterTupel* p = pItem->GetFilterList().GetObject( nIdx );
+#endif
+ USHORT nMask = pItem->GetFilterList().GetObject(
+ (USHORT)(long)aFilterLb.GetEntryData( nFilterIdx ) )->nFlags |
+ SFXSTYLEBIT_USERDEF;
+ pStyle->SetMask( nMask );
+ }
+ if(aAutoCB.IsVisible() &&
+ aAutoCB.IsChecked() != aAutoCB.GetSavedValue())
+ {
+ rSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, aAutoCB.IsChecked()));
+ }
+
+ return bModified;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxManageStyleSheetPage::Reset( const SfxItemSet& rAttrSet )
+
+/* [Beschreibung]
+
+
+ Handler f"ur das Initialisieren der Seite mit den initialen Daten.
+
+ [Parameter]
+
+ const SfxItemSet &rAttrSet das Set mit den Daten
+
+
+ [Querverweise]
+
+ <class SfxTabDialog>
+
+*/
+
+{
+ bModified = FALSE;
+ String sCmp( pStyle->GetName() );
+
+ if ( sCmp != aName )
+ pStyle->SetName( aName );
+ aNameEd.SetText( aName );
+
+ if ( aFollowLb.IsEnabled() )
+ {
+ sCmp = pStyle->GetFollow();
+
+ if ( sCmp != aFollow )
+ pStyle->SetFollow( aFollow );
+
+ if ( !aFollow.Len() )
+ aFollowLb.SelectEntry( aName );
+ else
+ aFollowLb.SelectEntry( aFollow );
+ }
+
+ if ( aBaseLb.IsEnabled() )
+ {
+ sCmp = pStyle->GetParent();
+
+ if ( sCmp != aParent )
+ pStyle->SetParent( aParent );
+
+ if ( !aParent.Len() )
+ aBaseLb.SelectEntry( String( SfxResId( STR_NONE ) ) );
+ else
+ aBaseLb.SelectEntry( aParent );
+
+ if ( String( SfxResId( STR_STANDARD ) ) == aName )
+ {
+ // die Standardvorlage kann nicht verkn"upft werden
+ aBaseFt.Disable();
+ aBaseLb.Disable();
+ }
+ }
+
+ if ( aFilterLb.IsEnabled() )
+ {
+ USHORT nCmp = pStyle->GetMask();
+
+ if ( nCmp != nFlags )
+ pStyle->SetMask( nFlags );
+ aFilterLb.SelectEntryPos( aFilterLb.GetSavedValue() );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxTabPage* SfxManageStyleSheetPage::Create( Window* pParent,
+ const SfxItemSet &rAttrSet )
+
+/* [Beschreibung]
+
+
+ Factory f"ur das Erzeugen der Seite
+
+ [Querverweise]
+
+ <class SfxTabDialog>
+
+*/
+
+{
+ return new SfxManageStyleSheetPage( pParent, rAttrSet );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
+
+/* [Beschreibung]
+
+ ActivatePage- Handler des SfxTabDialog; wird f"ur die Aktualisierung
+ des beschreibenden Textes verwendet, da sich dieser durch "Anderungen
+ der Daten anderer Seiten ge"andert haben kann.
+
+ [Parameter]
+
+ const SfxItemSet& das Set f"ur den Datenaustausch; wird
+ hier nicht verwendet.
+
+ [Querverweise]
+
+ <SfxTabDialog::ActivatePage(const SfxItemSet &)>
+
+*/
+
+{
+ SetDescriptionText_Impl();
+
+ // ist es ein Style mit automatischem Update? (nur SW)
+ const SfxPoolItem* pItem;
+
+ if ( SFX_ITEM_SET ==
+ rSet.GetItemState( SID_ATTR_AUTO_STYLE_UPDATE, FALSE, &pItem ) )
+ aAutoCB.Check( ( (const SfxBoolItem*)pItem )->GetValue() );
+ aAutoCB.SaveValue();
+}
+
+//-------------------------------------------------------------------------
+
+int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pSet )
+
+/* [Beschreibung]
+
+ DeactivatePage- Handler des SfxTabDialog; die Daten werden
+ an der Vorlage eingestellt, damit die richtige Vererbung
+ f"ur die anderen Seiten des Dialoges vorliegt.
+ Im Fehlerfall wird das Verlassen der Seite unterbunden.
+
+ [Parameter]
+
+ SfxItemSet* das Set f"ur den Datenaustausch; wird hier nicht verwendet.
+
+ [Querverweise]
+
+ <SfxTabDialog::DeactivatePage(SfxItemSet*)>
+
+*/
+
+{
+ int nRet = SfxTabPage::LEAVE_PAGE;
+
+ if ( aNameEd.IsModified() )
+ {
+ // bei <Enter> wird kein LoseFocus() durch StarView ausgel"ost
+ if ( aNameEd.HasFocus() )
+ LoseFocusHdl( &aNameEd );
+
+ if ( !pStyle->SetName( aNameEd.GetText().EraseLeadingChars() ) )
+ {
+ InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDNAME ) );
+ aBox.Execute();
+ aNameEd.GrabFocus();
+ aNameEd.SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
+ return SfxTabPage::KEEP_PAGE;
+ }
+ bModified = TRUE;
+ }
+
+ if ( pStyle->HasFollowSupport() && aFollowLb.IsEnabled() )
+ {
+ const String aFollow( aFollowLb.GetSelectEntry() );
+
+ if ( pStyle->GetFollow() != aFollow )
+ {
+ if ( !pStyle->SetFollow( aFollow ) )
+ {
+ InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDSTYLE ) );
+ aBox.Execute();
+ aFollowLb.GrabFocus();
+ return SfxTabPage::KEEP_PAGE;
+ }
+ bModified = TRUE;
+ }
+ }
+
+ if ( aBaseLb.IsEnabled() )
+ {
+ String aParent( aBaseLb.GetSelectEntry() );
+
+ if ( String( SfxResId( STR_NONE ) ) == aParent || aParent == pStyle->GetName() )
+ aParent.Erase();
+
+ if ( pStyle->GetParent() != aParent )
+ {
+ if ( !pStyle->SetParent( aParent ) )
+ {
+ InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDPARENT ) );
+ aBox.Execute();
+ aBaseLb.GrabFocus();
+ return SfxTabPage::KEEP_PAGE;
+ }
+ bModified = TRUE;
+ nRet |= (int)SfxTabPage::REFRESH_SET;
+ }
+ }
+
+ if ( pSet )
+ FillItemSet( *pSet );
+
+ return nRet;
+}
+
diff --git a/sfx2/source/dialog/mgetempl.hrc b/sfx2/source/dialog/mgetempl.hrc
new file mode 100644
index 000000000000..1bbaa7c09d5a
--- /dev/null
+++ b/sfx2/source/dialog/mgetempl.hrc
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: mgetempl.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define ED_NAME 2
+#define LB_NEXT 4
+#define FT_BASE 5
+#define LB_BASE 6
+#define LB_REGION 8
+#define FT_DESC 9
+#define GB_DESC 10
+#define FT_REGION 7
+#define FT_NEXT 3
+#define FT_NAME 1
+#define ED_DESC 11
+#define CB_AUTO 12
diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src
new file mode 100644
index 000000000000..61c63406678d
--- /dev/null
+++ b/sfx2/source/dialog/mgetempl.src
@@ -0,0 +1,283 @@
+/*************************************************************************
+ *
+ * $RCSfile: mgetempl.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "helpid.hrc"
+#include "mgetempl.hrc"
+ // pragma ----------------------------------------------------------------
+
+ // TP_MANAGE_STYLES ------------------------------------------------------
+TabPage TP_MANAGE_STYLES
+{
+ HelpId = HID_MANAGE_STYLES ;
+ Hide = TRUE ;
+ Size = MAP_APPFONT ( 260 , 135 ) ;
+ FixedText FT_NAME
+ {
+ Pos = MAP_APPFONT ( 6 , 8 ) ;
+ Size = MAP_APPFONT ( 61 , 10 ) ;
+ Text = "~Name" ;
+ Text [ English ] = "~Name" ;
+ Text [ english_us ] = "~Name" ;
+ Text [ italian ] = "~Nome" ;
+ Text [ spanish ] = "~Nombre" ;
+ Text [ french ] = "~Nom" ;
+ Text [ dutch ] = "~Naam" ;
+ Text [ swedish ] = "~Namn" ;
+ Text [ danish ] = "Navn" ;
+ Text [ portuguese ] = "~Nome" ;
+ Text [ portuguese_brazilian ] = "~Name" ;
+ Text[ chinese_simplified ] = "(~N)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Nazwa";
+ Text[ japanese ] = "O(~N)";
+ Text[ chinese_traditional ] = "W(~N)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̸(~N)";
+ Text[ turkish ] = "~Ad";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_NAME
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 6 ) ;
+ Size = MAP_APPFONT ( 182 , 12 ) ;
+ };
+ CheckBox CB_AUTO
+ {
+ Pos = MAP_APPFONT ( 164 , 8 ) ;
+ Size = MAP_APPFONT ( 88 , 10 ) ;
+ Hide = TRUE ;
+ Text = "~Autom. aktualisieren" ;
+ Text [ ENGLISH ] = "~Automatically update" ;
+ Text [ english_us ] = "~AutoUpdate" ;
+ Text [ portuguese_brazilian ] = "~Autom. aktualisieren" ;
+ Text [ swedish ] = "~Autom. uppdatering" ;
+ Text [ danish ] = "Opdater automatisk" ;
+ Text [ italian ] = "~Aggiorna automaticamente" ;
+ Text [ spanish ] = "~Actualizar automticamente" ;
+ Text [ french ] = "Actualisation ~automatique" ;
+ Text [ dutch ] = "~Autom. actualiseren" ;
+ Text [ portuguese ] = "Actualizar ~automaticamente" ;
+ Text[ chinese_simplified ] = "Զ(~A)";
+ Text[ russian ] = ". ";
+ Text[ polish ] = "~Aktualizuj automatycznie";
+ Text[ japanese ] = "IɍXV(~A)";
+ Text[ chinese_traditional ] = "۰ʧs(~A)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ڵ Ʈ(~A)";
+ Text[ turkish ] = "~Otomatik gncelleme";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_NEXT
+ {
+ Pos = MAP_APPFONT ( 6 , 26 ) ;
+ Size = MAP_APPFONT ( 61 , 10 ) ;
+ Text = "~Folgevorlage" ;
+ Text [ ENGLISH ] = "~Next" ;
+ Text [ norwegian ] = "~Neste" ;
+ Text [ italian ] = "Modello ~successivo" ;
+ Text [ portuguese_brazilian ] = "~Prximo" ;
+ Text [ portuguese ] = "~Estilo seguinte" ;
+ Text [ finnish ] = "~Seuraava" ;
+ Text [ danish ] = "Nste typografi" ;
+ Text [ french ] = "~Style suivant" ;
+ Text [ swedish ] = "Nsta ~formatmall" ;
+ Text [ dutch ] = "~Volgend profiel" ;
+ Text [ spanish ] = "~Estilo siguiente" ;
+ Text [ english_us ] = "Ne~xt Style" ;
+ Text[ chinese_simplified ] = "һʽ(~X)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nastpny styl";
+ Text[ japanese ] = "ɑ(~X)";
+ Text[ chinese_traditional ] = "U@Ӽ˦(~X)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " (~X)";
+ Text[ turkish ] = "Sonraki biim";
+ Text[ language_user1 ] = "\"Vorlagen\" Styles are always capitalized no matter where they show up. EM15.5.00";
+ };
+ ListBox LB_NEXT
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 24 ) ;
+ Size = MAP_APPFONT ( 182 , 65 ) ;
+ DropDown = TRUE ;
+ Sort = TRUE ;
+ };
+ FixedText FT_BASE
+ {
+ Pos = MAP_APPFONT ( 6 , 44 ) ;
+ Size = MAP_APPFONT ( 61 , 10 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Verknpft mit : ~Verknpft mit */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Verknpft mit : ~Verknpft mit */
+ Text = "~Verknpft mit" ;
+ Text [ ENGLISH ] = "~Based on" ;
+ Text [ norwegian ] = "~Basert p" ;
+ Text [ italian ] = "~Basato su" ;
+ Text [ portuguese_brazilian ] = "~Baseado em" ;
+ Text [ portuguese ] = "~Baseado em" ;
+ Text [ finnish ] = "~Perustuu" ;
+ Text [ danish ] = "Kdet med" ;
+ Text [ french ] = "~Li " ;
+ Text [ swedish ] = "~Lnkad med" ;
+ Text [ dutch ] = "~Gebaseerd op" ;
+ Text [ spanish ] = "~Vinculado con" ;
+ Text [ english_us ] = "~Based on" ;
+ Text[ chinese_simplified ] = "ӵ(~B)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Poczony z";
+ Text[ japanese ] = "ݸ(~B)";
+ Text[ chinese_traditional ] = "s(~B)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "~ ";
+ Text[ korean ] = " (~B)";
+ Text[ turkish ] = "~Balanlan";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_BASE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 42 ) ;
+ Size = MAP_APPFONT ( 182 , 65 ) ;
+ DropDown = TRUE ;
+ Sort = TRUE ;
+ };
+ FixedText FT_REGION
+ {
+ Pos = MAP_APPFONT ( 6 , 62 ) ;
+ Size = MAP_APPFONT ( 61 , 10 ) ;
+ Text = "~Bereich" ;
+ Text [ ENGLISH ] = "~Region" ;
+ Text [ norwegian ] = "~Omrde" ;
+ Text [ italian ] = "~Area" ;
+ Text [ portuguese_brazilian ] = "~Regio" ;
+ Text [ portuguese ] = "~Categoria" ;
+ Text [ finnish ] = "~Alue" ;
+ Text [ danish ] = "Omrde" ;
+ Text [ french ] = "~Catgorie" ;
+ Text [ swedish ] = "~Omrde" ;
+ Text [ dutch ] = "~Bereik" ;
+ Text [ spanish ] = "~rea" ;
+ Text [ english_us ] = "~Category" ;
+ Text[ chinese_simplified ] = "(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Kategoria";
+ Text[ japanese ] = "͈(~C)";
+ Text[ chinese_traditional ] = "(~C)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "īװ(~C)";
+ Text[ turkish ] = "~Kategori";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_REGION
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 70 , 60 ) ;
+ Size = MAP_APPFONT ( 182 , 65 ) ;
+ DropDown = TRUE ;
+ };
+ FixedText FT_DESC
+ {
+ Pos = MAP_APPFONT ( 12 , 86 ) ;
+ Size = MAP_APPFONT ( 234 , 32 ) ;
+ WordBreak = TRUE ;
+ Hide = TRUE ;
+ };
+ MultiLineEdit ED_DESC
+ {
+ Pos = MAP_APPFONT ( 12 , 86 ) ;
+ Size = MAP_APPFONT ( 234 , 32 ) ;
+ ReadOnly = TRUE ;
+ };
+ GroupBox GB_DESC
+ {
+ Pos = MAP_APPFONT ( 6 , 74 ) ;
+ Size = MAP_APPFONT ( 246 , 52 ) ;
+ Text = "Enthlt" ;
+ Text [ ENGLISH ] = "Contains" ;
+ Text [ norwegian ] = "Inneholder" ;
+ Text [ italian ] = "Contiene" ;
+ Text [ portuguese_brazilian ] = "Contm" ;
+ Text [ portuguese ] = "Contm" ;
+ Text [ finnish ] = "Sislt" ;
+ Text [ danish ] = "Indeholder" ;
+ Text [ french ] = "Contient" ;
+ Text [ swedish ] = "Innehller" ;
+ Text [ dutch ] = "Bevat" ;
+ Text [ spanish ] = "Contiene" ;
+ Text [ english_us ] = "Contains" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zawiera";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "t";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "erik";
+ Text[ language_user1 ] = " ";
+ };
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx
new file mode 100644
index 000000000000..51ddef881e4f
--- /dev/null
+++ b/sfx2/source/dialog/navigat.cxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: navigat.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// includes *******************************************************************
+
+#pragma hdrstop
+
+#include "navigat.hxx"
+#include "sfx.hrc"
+#include "app.hxx"
+#include "sfxresid.hxx"
+#include "helpid.hrc"
+#include <segmentc.hxx>
+
+SEG_EOFGLOBALS();
+
+SFX_IMPL_DOCKINGWINDOW( SfxNavigatorWrapper , SID_NAVIGATOR );
+
+SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParent ,
+ USHORT nId ,
+ SfxBindings* pBindings ,
+ SfxChildWinInfo* pInfo )
+ : SfxChildWindow( pParent , nId )
+{
+ pWindow = new SfxNavigator( pBindings, this, pParent, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK );
+ eChildAlignment = SFX_ALIGN_NOALIGNMENT;
+
+ pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
+ ((SfxDockingWindow*)pWindow)->SetFloatingSize( Size( 240, 240 ) );
+ pWindow->SetSizePixel( Size( 240, 240 ) );
+
+ ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
+ SetHideNotDelete( TRUE );
+}
+
+SfxNavigator::SfxNavigator( SfxBindings* pBindings ,
+ SfxChildWindow* pChildWin ,
+ Window* pParent ,
+ WinBits nBits )
+ : SfxDockingWindow( pBindings ,
+ pChildWin ,
+ pParent ,
+ nBits )
+ , pWrapper( pChildWin )
+{
+ SetText( String( SfxResId( SID_NAVIGATOR ) ) );
+}
+
+void SfxNavigator::Resize()
+{
+ SfxDockingWindow::Resize();
+ if ( pWrapper->GetContextWindow() )
+ pWrapper->GetContextWindow()->SetSizePixel( GetOutputSizePixel() );
+}
+
+void SfxNavigator::Resizing( Size &rSize )
+{
+ SfxDockingWindow::Resizing( rSize );
+
+ SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
+ DBG_ASSERT( pCon, "Kein Context!" );
+ if ( pCon )
+ pCon->Resizing( rSize );
+}
+
+BOOL SfxNavigator::Close()
+{
+ SfxChildWindowContext *pCon = GetChildWindow_Impl()->GetContext_Impl();
+ DBG_ASSERT( pCon, "Kein Context!" );
+ if ( !pCon || pCon->Close() )
+ return SfxDockingWindow::Close();
+ else
+ return FALSE;
+}
+
+
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
new file mode 100644
index 000000000000..7f2afc8565b9
--- /dev/null
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: newstyle.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#ifndef _SFXSTYLE_HXX //autogen
+#include <svtools/style.hxx>
+#endif
+#pragma hdrstop
+
+#include "newstyle.hxx"
+#include "dialog.hrc"
+#include "newstyle.hrc"
+#include "sfxresid.hxx"
+#include "segmentc.hxx"
+
+// PRIVATE METHODES ------------------------------------------------------
+
+IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl )
+{
+ const String aName(aColBox.GetText());
+ SfxStyleSheetBase *pStyle = rPool.Find(aName, rPool.GetSearchFamily(), SFXSTYLEBIT_ALL);
+ if(pStyle) {
+ if(!pStyle->IsUserDefined()) {
+ InfoBox(this, SfxResId(MSG_POOL_STYLE_NAME)).Execute();
+ return 0;
+ }
+ if(RET_YES == aQueryOverwriteBox.Execute()) {
+ EndDialog(RET_OK);
+ }
+ }
+ else {
+ EndDialog(RET_OK);
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox )
+{
+ aOKBtn.Enable( pBox->GetText().EraseAllChars().Len() > 0 );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox )
+
+// CTOR / DTOR -----------------------------------------------------------
+
+SfxNewStyleDlg::SfxNewStyleDlg(Window *pParent, SfxStyleSheetBasePool &pool)
+ : ModalDialog(pParent, SfxResId(DLG_NEW_STYLE_BY_EXAMPLE)),
+ aColBox(this, ResId(LB_COL)),
+ aColGrp(this, ResId(GB_COL)),
+ aOKBtn(this, ResId(BT_OK)),
+ aCancelBtn(this, ResId(BT_CANCEL)),
+ aQueryOverwriteBox(this, ResId(MSG_OVERWRITE)),
+ rPool(pool)
+{
+ FreeResource();
+ aOKBtn.SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl));
+ aColBox.SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl));
+ aColBox.SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl));
+
+ SfxStyleSheetBase *pStyle = rPool.First();
+ while(pStyle) {
+ aColBox.InsertEntry(pStyle->GetName());
+ pStyle = rPool.Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+__EXPORT SfxNewStyleDlg::~SfxNewStyleDlg()
+{
+}
+
+
diff --git a/sfx2/source/dialog/newstyle.hrc b/sfx2/source/dialog/newstyle.hrc
new file mode 100644
index 000000000000..90e4c9608b48
--- /dev/null
+++ b/sfx2/source/dialog/newstyle.hrc
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * $RCSfile: newstyle.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define BT_OK 100
+#define BT_CANCEL 101
+#define LB_COL 1
+#define GB_COL 2
+#define MSG_OVERWRITE 3
diff --git a/sfx2/source/dialog/newstyle.src b/sfx2/source/dialog/newstyle.src
new file mode 100644
index 000000000000..c952fa92ed87
--- /dev/null
+++ b/sfx2/source/dialog/newstyle.src
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: newstyle.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "dialog.hrc"
+#include "newstyle.hrc"
+ // pragma ----------------------------------------------------------------
+
+ // DLG_NEW_STYLE_BY_EXAMPLE ----------------------------------------------
+ModalDialog DLG_NEW_STYLE_BY_EXAMPLE
+{
+ HelpId = SID_STYLE_NEW_BY_EXAMPLE ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 177 , 118 ) ;
+ Text = "Vorlage erzeugen" ;
+ Text [ ENGLISH ] = "Create template" ;
+ Text [ norwegian ] = "Lag mal" ;
+ Text [ italian ] = "Crea modello" ;
+ Text [ portuguese_brazilian ] = "Criar modelo" ;
+ Text [ portuguese ] = "Criar estilo" ;
+ Text [ finnish ] = "Luo malli" ;
+ Text [ danish ] = "Opret typografi" ;
+ Text [ french ] = "Cration d'un style" ;
+ Text [ swedish ] = "Skapa formatmall" ;
+ Text [ dutch ] = "Opmaakprofiel maken" ;
+ Text [ spanish ] = "Crear estilo" ;
+ Text [ english_us ] = "Create Style" ;
+ Moveable = TRUE ;
+ OKButton BT_OK
+ {
+ Disable = TRUE ;
+ Pos = MAP_APPFONT ( 121 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 121 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ ComboBox LB_COL
+ {
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 94 , 92 ) ;
+ TabStop = TRUE ;
+ };
+ GroupBox GB_COL
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 109 , 109 ) ;
+ Text = "Vorlagenname" ;
+ Text [ ENGLISH ] = "Template name" ;
+ Text [ norwegian ] = "Navn p mal" ;
+ Text [ italian ] = "Nome modello" ;
+ Text [ portuguese_brazilian ] = "Nome do modelo" ;
+ Text [ portuguese ] = "Nome do estilo" ;
+ Text [ finnish ] = "Mallin nimi" ;
+ Text [ danish ] = "Typografinavn" ;
+ Text [ french ] = "Nom du style" ;
+ Text [ swedish ] = "Formatmallens namn" ;
+ Text [ dutch ] = "Naam opmaakprofiel" ;
+ Text [ spanish ] = "Nombre del estilo" ;
+ Text [ english_us ] = "Style name" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nazwa stylu";
+ Text[ japanese ] = "ٖ";
+ Text[ chinese_traditional ] = "˦W";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ̸";
+ Text[ turkish ] = "Biim ad";
+ Text[ language_user1 ] = " ";
+ };
+ QueryBox MSG_OVERWRITE
+ {
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ /* ### ACHTUNG: Neuer Text in Resource? Vorlage existiert bereits. berschreiben? : Vorlage existiert bereits. berschreiben? */
+ /* ### ACHTUNG: Neuer Text in Resource? Vorlage existiert bereits. berschreiben? : Vorlage existiert bereits. berschreiben? */
+ Message = "Vorlage existiert bereits. berschreiben?" ;
+ Message [ ENGLISH ] = "Template already exists. Overwrite?" ;
+ Message [ norwegian ] = "Malen finnes allerede. Skriv over?" ;
+ Message [ italian ] = "Il modello esiste gi. Sovrascrivere?" ;
+ Message [ portuguese_brazilian ] = "O modelo j existe. Sobregravar?" ;
+ Message [ portuguese ] = "O modelo j existe. Deseja substitu-lo?" ;
+ Message [ finnish ] = "Malli on jo tehty. Korvataanko se?" ;
+ Message [ danish ] = "Typografien findes allerede. Skal den overskrives?" ;
+ Message [ french ] = "Ce style existe dj. Voulez-vous le remplacer ?" ;
+ Message [ swedish ] = "Formatmallen finns redan. Skriva ver?" ;
+ Message [ dutch ] = "Dit opmaakprofiel bestaat reeds. Overschrijven?" ;
+ Message [ spanish ] = "El estilo ya existe. Desea sobrescribirlo?" ;
+ Message [ english_us ] = "Style already exists. Overwrite?" ;
+ Message[ chinese_simplified ] = "ʽѾڡҪд";
+ Message[ russian ] = " . ?";
+ Message[ polish ] = "Styl ju istnieje. Zastpi innym?";
+ Message[ japanese ] = "ق͂łɂ܂B㏑܂?";
+ Message[ chinese_traditional ] = "˦wgsbCnмgH";
+ Message[ arabic ] = " . ";
+ Message[ greek ] = " . ;";
+ Message[ korean ] = " ̹ ֽϴ. ðڽϱ?";
+ Message[ turkish ] = "Biim mevcut durumda. zerine yazlsn m?";
+ Message[ language_user1 ] = " ";
+ };
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Utwrz styl";
+ Text[ japanese ] = "ق̍쐬";
+ Text[ chinese_traditional ] = "ͦ˦";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ۼ";
+ Text[ turkish ] = "Biim olutur";
+ Text[ language_user1 ] = " ";
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/dialog/partwnd.cxx b/sfx2/source/dialog/partwnd.cxx
new file mode 100644
index 000000000000..90c0795fb713
--- /dev/null
+++ b/sfx2/source/dialog/partwnd.cxx
@@ -0,0 +1,293 @@
+/*************************************************************************
+ *
+ * $RCSfile: partwnd.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// includes ******************************************************************
+
+#ifndef _COM_SUN_STAR_AWT_XWINDOW_HPP_
+#include <com/sun/star/awt/XWindow.hpp>
+#endif
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
+#include <com/sun/star/util/URL.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
+#include <com/sun/star/frame/XController.hpp>
+#endif
+#ifndef _COM_SUN_STAR_AWT_POSSIZE_HPP_
+#include <com/sun/star/awt/PosSize.hpp>
+#endif
+#include <toolkit/helper/vclunohelper.hxx>
+
+#include "partwnd.hxx"
+#include "unoframe.hxx"
+#include "progind.hxx"
+#include "sfxsids.hrc"
+#include "app.hxx"
+#include "bindings.hxx"
+
+// class SfxPartwinFrame_Impl ------------------------------------------
+
+class SfxPartwinFrame_Impl : public SfxUnoFrame
+{
+public:
+ SfxPopupStatusIndicator* pIndicator;
+ SfxPartDockWnd_Impl* pBeamer;
+
+ virtual void SAL_CALL initialize(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > & aPeer) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual SfxFrame* CreateFrame( Window* pParent );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator(void) throw ( ::com::sun::star::uno::RuntimeException );
+ void dispatch_Impl( const ::com::sun::star::util::URL& aURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArgs );
+};
+
+// -----------------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL SfxPartwinFrame_Impl::getStatusIndicator(void) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ return pIndicator->GetInterface();
+}
+
+void SfxPartwinFrame_Impl::dispatch_Impl( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs )
+{
+ if ( !pBeamer )
+ return;
+
+ if ( rURL.Protocol.compareToAscii(".uno:") == 0 )
+ {
+ if ( rURL.Path.compareToAscii("Reload") == 0)
+ {
+ SfxUnoFrame::dispatch_Impl( rURL, rArgs );
+ if ( pBeamer->IsAutoHide_Impl() )
+ pBeamer->AutoShow_Impl( sal_True );
+ return;
+ }
+ }
+ else
+ SfxUnoFrame::dispatch_Impl( rURL, rArgs );
+
+ if ( rURL.Complete.len() )
+ {
+ if ( pBeamer->IsAutoHide_Impl() )
+ pBeamer->AutoShow_Impl( sal_True );
+ }
+ else
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > xTmp( this );
+ SfxApplication* pApp = SFX_APP();
+ pApp->SetChildWindow( SID_PARTWIN, sal_False );
+ pApp->GetBindings().Invalidate( SID_PARTWIN );
+ }
+}
+
+// -----------------------------------------------------------------------
+void SAL_CALL SfxPartwinFrame_Impl::initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > & aWindow ) throw ( ::com::sun::star::uno::RuntimeException )
+{
+ setName( rtl::OUString::createFromAscii("_partwindow") );
+ SetContainerWindow_Impl( aWindow );
+}
+
+// -----------------------------------------------------------------------
+SfxFrame* SfxPartwinFrame_Impl::CreateFrame( Window* pParent )
+{
+ return NULL;
+}
+
+//****************************************************************************
+// SfxPartChildWnd_Impl
+//****************************************************************************
+
+SFX_IMPL_DOCKINGWINDOW( SfxPartChildWnd_Impl, SID_PARTWIN );
+
+SfxPartChildWnd_Impl::SfxPartChildWnd_Impl
+(
+ Window* pParent,
+ sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo
+)
+ : SfxChildWindow( pParent, nId )
+{
+ // Window erzeugen
+ pWindow = new SfxPartDockWnd_Impl(
+ pBindings, this, pParent, WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK );
+ eChildAlignment = SFX_ALIGN_TOP;
+// pWindow->SetHelpId ( HID_NAVIGATOR_WINDOW );
+ ((SfxDockingWindow*)pWindow)->SetFloatingSize( Size( 240, 240 ) );
+ pWindow->SetSizePixel( Size( 240, 240 ) );
+
+ ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo );
+}
+
+sal_Bool SfxPartChildWnd_Impl::QueryClose()
+{
+ return ( (SfxPartDockWnd_Impl*)pWindow )->QueryClose();
+}
+
+//****************************************************************************
+// SfxPartDockWnd_Impl
+//****************************************************************************
+
+SfxPartDockWnd_Impl::SfxPartDockWnd_Impl
+(
+ SfxBindings* pBindings,
+ SfxChildWindow* pChildWin,
+ Window* pParent,
+ WinBits nBits
+) :
+
+ SfxDockingWindow( pBindings, pChildWin, pParent, nBits ),
+ _pFrame( new SfxPartwinFrame_Impl )
+
+{
+ _pFrame->acquire();
+ _pFrame->pBeamer = this;
+ _pFrame->initialize( VCLUnoHelper::GetInterface ( this ) );
+ _pFrame->pIndicator = new SfxPopupStatusIndicator( this );
+ pChildWin->SetFrame( _pFrame );
+}
+
+//****************************************************************************
+
+SfxPartDockWnd_Impl::~SfxPartDockWnd_Impl()
+{
+ _pFrame->SetContainerWindow_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > () );
+ DELETEZ( _pFrame->pIndicator );
+ _pFrame->pBeamer = NULL;
+ _pFrame->dispose();
+ _pFrame->release();
+}
+
+//****************************************************************************
+
+Rectangle impl_Rectangle_Struct2Object( const ::com::sun::star::awt::Rectangle& aRectangleStruct )
+{
+ return Rectangle(aRectangleStruct.X,aRectangleStruct.Y,aRectangleStruct.Width,aRectangleStruct.Height);
+}
+
+void SfxPartDockWnd_Impl::Resize()
+
+/* [Beschreibung]
+
+ Anpassung der Gr"osse der Controls an die neue Windowgr"osse
+*/
+
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > xWindow( _pFrame->getComponentWindow() );
+ if ( xWindow.is() )
+ {
+ Size aSize( GetOutputSizePixel() );
+ Rectangle aRect( impl_Rectangle_Struct2Object(xWindow->getPosSize()) );
+ Point aPos( aRect.TopLeft() );
+ Size aNewSize( aSize.Width() - 2 * aPos.X(), aSize.Height() - aPos.Y() );
+ if ( _pFrame->pIndicator->IsVisible() )
+ {
+ long nHeight = _pFrame->pIndicator->CalcWindowSizePixel().Height();
+ aNewSize.Height() -= nHeight;
+ _pFrame->pIndicator->SetPosSizePixel( 0, aPos.Y() + aNewSize.Height(), aNewSize.Width(), nHeight, WINDOW_POSSIZE_POSSIZE );
+ }
+
+ xWindow->setPosSize( aPos.X(), aPos.Y(), aNewSize.Width(), aNewSize.Height(), ::com::sun::star::awt::PosSize::SIZE );
+ }
+
+ SfxDockingWindow::Resize();
+}
+
+//****************************************************************************
+
+sal_Bool SfxPartDockWnd_Impl::QueryClose()
+{
+ sal_Bool bClose = sal_True;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > xCtrl = _pFrame->getController();
+
+ if ( xCtrl.is() )
+ bClose = xCtrl->suspend( sal_True );
+ return bClose;;
+}
+
+//****************************************************************************
+
+long SfxPartDockWnd_Impl::Notify( NotifyEvent& rEvt )
+{
+ if ( rEvt.GetType() == EVENT_GETFOCUS )
+ _pFrame->activate();
+
+ return SfxDockingWindow::Notify( rEvt );
+}
+
+void SfxPartDockWnd_Impl::FillInfo( SfxChildWinInfo& rInfo ) const
+{
+ SfxDockingWindow::FillInfo( rInfo );
+ rInfo.bVisible = sal_False;
+}
+
+
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
new file mode 100644
index 000000000000..88856c49b209
--- /dev/null
+++ b/sfx2/source/dialog/passwd.cxx
@@ -0,0 +1,226 @@
+/*************************************************************************
+ *
+ * $RCSfile: passwd.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// Include ---------------------------------------------------------------
+
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#pragma hdrstop
+
+#include "passwd.hxx"
+#include "sfxtypes.hxx"
+#include "sfxresid.hxx"
+
+#include "dialog.hrc"
+#include "passwd.hrc"
+
+#define MAX_PASSWORD_LEN ((USHORT)16)
+
+// -----------------------------------------------------------------------
+
+#if (SUPD < 555)
+void SfxPasswordDialog::SetConfirm()
+{
+ SetText( maConfirmStr );
+ maPasswordED.SetText( String() );
+ maPasswordED.GrabFocus();
+}
+#endif
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG )
+{
+ maOKBtn.Enable( maPasswordED.GetText().Len() >= mnMinLen );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxPasswordDialog, EditModifyHdl, Edit *, EMPTYARG )
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxPasswordDialog, OKHdl, OKButton *, EMPTYARG )
+{
+ if ( ( ( mnExtras & SHOWEXTRAS_CONFIRM ) == SHOWEXTRAS_CONFIRM ) &&
+ ( GetConfirm() != GetPassword() ) )
+ {
+ ErrorBox aBox( this, SfxResId( MSG_ERROR_WRONG_CONFIRM ) );
+ aBox.Execute();
+ maConfirmED.SetText( String() );
+ maConfirmED.GrabFocus();
+ }
+ else
+ EndDialog( RET_OK );
+ return 0;
+}
+
+// CTOR / DTOR -----------------------------------------------------------
+
+SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText ) :
+
+ ModalDialog( pParent, SfxResId ( DLG_PASSWD ) ),
+
+ maUserFT ( this, ResId( FT_PASSWD_USER ) ),
+ maUserED ( this, ResId( ED_PASSWD_USER ) ),
+ maPasswordFT ( this, ResId( FT_PASSWD_PASSWORD ) ),
+ maPasswordED ( this, ResId( ED_PASSWD_PASSWORD ) ),
+ maConfirmFT ( this, ResId( FT_PASSWD_CONFIRM ) ),
+ maConfirmED ( this, ResId( ED_PASSWD_CONFIRM ) ),
+ maPasswordBox ( this, ResId( GB_PASSWD_PASSWORD ) ),
+ maOKBtn ( this, ResId( BTN_PASSWD_OK ) ),
+ maCancelBtn ( this, ResId( BTN_PASSWD_CANCEL ) ),
+ maHelpBtn ( this, ResId( BTN_PASSWD_HELP ) ),
+ maConfirmStr ( ResId( STR_PASSWD_CONFIRM ) ),
+
+ mnMinLen ( 5 ),
+ mnExtras ( 0 )
+
+{
+ FreeResource();
+
+ Link aLink = LINK( this, SfxPasswordDialog, EditModifyHdl );
+ maPasswordED.SetModifyHdl( aLink );
+ aLink = LINK( this, SfxPasswordDialog, OKHdl );
+ maOKBtn.SetClickHdl( aLink );
+
+ maPasswordED.SetMaxTextLen( MAX_PASSWORD_LEN );
+ maConfirmED.SetMaxTextLen( MAX_PASSWORD_LEN );
+
+ if ( pGroupText )
+ maPasswordBox.SetText( *pGroupText );
+}
+
+// -----------------------------------------------------------------------
+
+void SfxPasswordDialog::SetMinLen( USHORT nLen )
+{
+ mnMinLen = Min( nLen, MAX_PASSWORD_LEN );
+ EditModifyHdl( NULL );
+}
+
+// -----------------------------------------------------------------------
+
+short SfxPasswordDialog::Execute()
+{
+ if ( mnExtras < SHOWEXTRAS_ALL )
+ {
+ Size a3Size = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
+ Size a6Size = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
+ long nMinHeight = maHelpBtn.GetPosPixel().Y() +
+ maHelpBtn.GetSizePixel().Height() + a6Size.Height();
+ USHORT nRowHided = 1;
+
+ if ( SHOWEXTRAS_NONE == mnExtras )
+ {
+ maUserFT.Hide();
+ maUserED.Hide();
+ maConfirmFT.Hide();
+ maConfirmED.Hide();
+ maPasswordFT.Hide();
+
+ Point aPos = maUserFT.GetPosPixel();
+ long nEnd = maUserED.GetPosPixel().X() + maUserED.GetSizePixel().Width();
+ maPasswordED.SetPosPixel( aPos );
+ Size aSize = maPasswordED.GetSizePixel();
+ aSize.Width() = nEnd - aPos.X();
+ maPasswordED.SetSizePixel( aSize );
+
+ nRowHided = 2;
+ }
+ else if ( SHOWEXTRAS_USER == mnExtras )
+ {
+ maConfirmFT.Hide();
+ maConfirmED.Hide();
+ }
+ else if ( SHOWEXTRAS_CONFIRM == mnExtras )
+ {
+ maUserFT.Hide();
+ maUserED.Hide();
+
+ Point aPwdPos1 = maPasswordFT.GetPosPixel();
+ Point aPwdPos2 = maPasswordED.GetPosPixel();
+
+ Point aPos = maUserFT.GetPosPixel();
+ maPasswordFT.SetPosPixel( aPos );
+ aPos = maUserED.GetPosPixel();
+ maPasswordED.SetPosPixel( aPos );
+
+ maConfirmFT.SetPosPixel( aPwdPos1 );
+ maConfirmED.SetPosPixel( aPwdPos2 );
+ }
+
+ Size aBoxSize = maPasswordBox.GetSizePixel();
+ aBoxSize.Height() -= ( nRowHided * maUserED.GetSizePixel().Height() );
+ aBoxSize.Height() -= ( nRowHided * a3Size.Height() );
+ maPasswordBox.SetSizePixel( aBoxSize );
+
+ long nDlgHeight = maPasswordBox.GetPosPixel().Y() + aBoxSize.Height() + a6Size.Height();
+ if ( nDlgHeight < nMinHeight )
+ nDlgHeight = nMinHeight;
+ Size aDlgSize = GetOutputSizePixel();
+ aDlgSize.Height() = nDlgHeight;
+ SetOutputSizePixel( aDlgSize );
+ }
+
+ return ModalDialog::Execute();
+}
+
+
diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc
new file mode 100644
index 000000000000..80d7a6e59e78
--- /dev/null
+++ b/sfx2/source/dialog/passwd.hrc
@@ -0,0 +1,83 @@
+/*************************************************************************
+ *
+ * $RCSfile: passwd.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_PASSWD_HRC
+#define _SFX_PASSWD_HRC
+
+// defines ---------------------------------------------------------------
+
+#define GB_PASSWD_PASSWORD 10
+#define FT_PASSWD_USER 11
+#define ED_PASSWD_USER 12
+#define FT_PASSWD_PASSWORD 13
+#define ED_PASSWD_PASSWORD 14
+#define FT_PASSWD_CONFIRM 15
+#define ED_PASSWD_CONFIRM 16
+
+#define BTN_PASSWD_OK 20
+#define BTN_PASSWD_CANCEL 21
+#define BTN_PASSWD_HELP 22
+
+#define STR_PASSWD_CONFIRM 30
+
+#endif
+
+// ******************************************************************* EOF
+
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
new file mode 100644
index 000000000000..1abb012dc421
--- /dev/null
+++ b/sfx2/source/dialog/passwd.src
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: passwd.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+ // include ---------------------------------------------------------------
+#include "helpid.hrc"
+#include "dialog.hrc"
+#include "passwd.hrc"
+
+ // DLG_PASSWD ------------------------------------------------------------
+ModalDialog DLG_PASSWD
+{
+ HelpId = HID_PASSWD ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT( 200, 68 );
+ Text = "Passwort eingeben" ;
+ Text [ ENGLISH ] = "Enter password" ;
+ Text [ norwegian ] = "Skriv inn passord" ;
+ Text [ italian ] = "Digita password" ;
+ Text [ portuguese_brazilian ] = "Digitar senha" ;
+ Text [ portuguese ] = "Digitar senha" ;
+ Text [ finnish ] = "Kirjoita salasana" ;
+ Text [ danish ] = "Indtast adgangskode" ;
+ Text [ french ] = "Saisie du mot de passe" ;
+ Text [ swedish ] = "Mata in lsenord" ;
+ Text [ dutch ] = "Wachtwoord invoeren" ;
+ Text [ spanish ] = "Introduzca la contrasea" ;
+ Text [ english_us ] = "Enter Password" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Wprowad haso";
+ Text[ japanese ] = "߽ܰނ̓";
+ Text[ chinese_traditional ] = "JKX";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "н Է";
+ Moveable = TRUE ;
+ FixedText FT_PASSWD_USER
+ {
+ Pos = MAP_APPFONT( 12, 15 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text = "~Benutzer";
+ Text[English] = "User";
+ Text[ english_us ] = "~User";
+ Text[ portuguese ] = "~Utilizador";
+ Text[ russian ] = "";
+ Text[ greek ] = "";
+ Text[ dutch ] = "~Gebruiker";
+ Text[ french ] = "~Utilisateur";
+ Text[ spanish ] = "Usuar~io";
+ Text[ italian ] = "Utente";
+ Text[ danish ] = "Bruger";
+ Text[ swedish ] = "Anvndare";
+ Text[ polish ] = "Uytkownik";
+ Text[ portuguese_brazilian ] = "User";
+ Text[ japanese ] = "հް(~U)";
+ Text[ korean ] = "(~U)";
+ Text[ chinese_simplified ] = "ʹ(~U)";
+ Text[ chinese_traditional ] = "ϥΪ(~U)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "~Kullanc";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_PASSWD_USER
+ {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 57, 14 );
+ Size = MAP_APPFONT( 75, 12 );
+ };
+ FixedText FT_PASSWD_PASSWORD
+ {
+ Pos = MAP_APPFONT( 12, 30 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text = "~Passwort";
+ Text[English] = "Password";
+ Text[ english_us ] = "~Password";
+ Text[ portuguese ] = "~Senha";
+ Text[ russian ] = "";
+ Text[ greek ] = " ";
+ Text[ dutch ] = "~Wachtwoord";
+ Text[ french ] = "~Mot de passe";
+ Text[ spanish ] = "~Contrasea";
+ Text[ italian ] = "~Password";
+ Text[ danish ] = "Adgangskode";
+ Text[ swedish ] = "Lsenord";
+ Text[ polish ] = "Haso";
+ Text[ portuguese_brazilian ] = "Password";
+ Text[ japanese ] = "߽ܰ(~P)";
+ Text[ korean ] = "н(~P)";
+ Text[ chinese_simplified ] = "(~P)";
+ Text[ chinese_traditional ] = "KX(~P)";
+ Text[ arabic ] = " ";
+ Text[ turkish ] = "~ifre";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_PASSWD_PASSWORD
+ {
+ Border = TRUE;
+ PassWord = TRUE;
+ Pos = MAP_APPFONT( 57, 29 );
+ Size = MAP_APPFONT( 75, 12 );
+ };
+ FixedText FT_PASSWD_CONFIRM
+ {
+ Pos = MAP_APPFONT( 12, 45 );
+ Size = MAP_APPFONT( 42, 10 );
+ Text = "~Besttigen";
+ Text[English] = "Confirm";
+ Text[ english_us ] = "~Confirm";
+ Text[ portuguese ] = "~Confirmar";
+ Text[ russian ] = "";
+ Text[ greek ] = "";
+ Text[ dutch ] = "~Bevestigen";
+ Text[ french ] = "~Confirmer";
+ Text[ spanish ] = "~Confirmar";
+ Text[ italian ] = "Conferma";
+ Text[ danish ] = "Bekrft";
+ Text[ swedish ] = "Bekrfta";
+ Text[ polish ] = "Potwierd";
+ Text[ portuguese_brazilian ] = "Confirm";
+ Text[ japanese ] = "mF(~C)";
+ Text[ korean ] = "Ȯ(~C)";
+ Text[ chinese_simplified ] = "ȷ(~C)";
+ Text[ chinese_traditional ] = "T{(~C)";
+ Text[ arabic ] = "";
+ Text[ turkish ] = "~Onayla";
+ };
+ Edit ED_PASSWD_CONFIRM
+ {
+ Border = TRUE;
+ PassWord = TRUE;
+ Pos = MAP_APPFONT( 57, 44 );
+ Size = MAP_APPFONT( 75, 12 );
+ };
+ GroupBox GB_PASSWD_PASSWORD
+ {
+ Pos = MAP_APPFONT( 6, 3 );
+ Size = MAP_APPFONT( 132, 59 );
+ Text = "Passwort" ;
+ Text [ ENGLISH ] = "Password" ;
+ Text [ norwegian ] = "Passord" ;
+ Text [ italian ] = "Password" ;
+ Text [ portuguese_brazilian ] = "Senha" ;
+ Text [ portuguese ] = "Senha" ;
+ Text [ finnish ] = "Salasana" ;
+ Text [ danish ] = "Adgangskode" ;
+ Text [ french ] = "Mot de passe" ;
+ Text [ swedish ] = "Lsenord" ;
+ Text [ dutch ] = "Wachtwoord" ;
+ Text [ spanish ] = "Contrasea" ;
+ Text [ english_us ] = "Password" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Haso";
+ Text[ japanese ] = "߽ܰ";
+ Text[ chinese_traditional ] = "KX";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "н";
+ Text[ turkish ] = "ifre";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BTN_PASSWD_OK
+ {
+ Disable = TRUE;
+ Pos = MAP_APPFONT( 144, 6 );
+ Size = MAP_APPFONT( 50, 14 );
+ DefButton = TRUE;
+ };
+ CancelButton BTN_PASSWD_CANCEL
+ {
+ Pos = MAP_APPFONT( 144, 23 );
+ Size = MAP_APPFONT( 50, 14 );
+ };
+ HelpButton BTN_PASSWD_HELP
+ {
+ Pos = MAP_APPFONT( 144, 43 );
+ Size = MAP_APPFONT( 50, 14 );
+ };
+ String STR_PASSWD_CONFIRM
+ {
+ Text = "Passwort besttigen" ;
+ Text [ ENGLISH ] = "Confirm password" ;
+ Text [ norwegian ] = "Bekrefte passord" ;
+ Text [ italian ] = "Conferma password" ;
+ Text [ portuguese_brazilian ] = "Confirmar senha" ;
+ Text [ portuguese ] = "Confirmar senha" ;
+ Text [ finnish ] = "Varmista salasana" ;
+ Text [ danish ] = "Bekrft adgangskode" ;
+ Text [ french ] = "Confirmer le mot de passe" ;
+ Text [ swedish ] = "Bekrfta lsenord" ;
+ Text [ dutch ] = "Wachtwoord bevestigen" ;
+ Text [ spanish ] = "Confirmar contrasea" ;
+ Text [ english_us ] = "Confirm password" ;
+ Text[ chinese_simplified ] = "ȷϿ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Potwierd haso";
+ Text[ japanese ] = "߽ܰނ̊mF";
+ Text[ chinese_traditional ] = "T{KX";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "н Ȯ";
+ Text[ turkish ] = "ifreyi onayla";
+ Text[ language_user1 ] = " ";
+ };
+ Text[ turkish ] = "ifreyi girin";
+ Text[ language_user1 ] = " ";
+};
+
+// ********************************************************************** EOF
+
diff --git a/sfx2/source/dialog/sfxurl.cxx b/sfx2/source/dialog/sfxurl.cxx
new file mode 100644
index 000000000000..3205fe1b730c
--- /dev/null
+++ b/sfx2/source/dialog/sfxurl.cxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxurl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <iodlg.hxx>
+#include <sfxresid.hxx>
+#include <dialog.hrc>
+
+SfxUrlDialog::SfxUrlDialog( Window *pParent )
+ : ModalDialog( pParent, SfxResId( RID_URLOPEN ) ),
+ aEdit( this, ResId(RID_URLOPEN_URL) ),
+ aCancel( this, ResId(RID_URLOPEN_CANCEL) ),
+ aOk( this, ResId(RID_URLOPEN_OK) )
+{
+ FreeResource();
+}
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
new file mode 100644
index 000000000000..7069973c3ddd
--- /dev/null
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -0,0 +1,1337 @@
+/*************************************************************************
+ *
+ * $RCSfile: splitwin.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+
+#ifndef _WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#pragma hdrstop
+
+#include "splitwin.hxx"
+#include "workwin.hxx"
+#include "dockwin.hxx"
+#include "app.hxx"
+#include "inimgr.hxx"
+#include "dialog.hrc"
+#include "sfxresid.hxx"
+#include "mnumgr.hxx"
+#include "virtmenu.hxx"
+#include "msgpool.hxx"
+#include "viewfrm.hxx"
+
+#define VERSION 1
+#define nPixel 30L
+
+struct SfxDock_Impl
+{
+ USHORT nType;
+ SfxDockingWindow* pWin; // SplitWindow hat dieses Fenster
+ BOOL bNewLine;
+ BOOL bHide; // SplitWindow hatte dieses Fenster
+ long nSize;
+};
+
+typedef SfxDock_Impl* SfxDockPtr;
+SV_DECL_PTRARR_DEL( SfxDockArr_Impl, SfxDockPtr, 4, 4);
+SV_IMPL_PTRARR( SfxDockArr_Impl, SfxDockPtr);
+
+class SfxEmptySplitWin_Impl : public SplitWindow
+{
+/* [Beschreibung]
+
+ Das SfxEmptySplitWin_Impldow ist ein leeres SplitWindow, das das SfxSplitWindow
+ im AutoHide-Modus ersetzt. Es dient nur als Platzhalter, um MouseMoves
+ zu empfangen und ggf. das eigentlichte SplitWindow einzublenden
+*/
+friend class SfxSplitWindow;
+
+ SfxSplitWindow* pOwner;
+ BOOL bFadeIn;
+ BOOL bAutoHide;
+ BOOL bSplit;
+ BOOL bEndAutoHide;
+ Timer aTimer;
+ Point aLastPos;
+ USHORT nState;
+
+ SfxEmptySplitWin_Impl( SfxSplitWindow *pParent )
+ : SplitWindow( pParent->GetParent(), WinBits( WB_BORDER | WB_3DLOOK ) )
+ , pOwner( pParent )
+ , bFadeIn( FALSE )
+ , bAutoHide( FALSE )
+ , bEndAutoHide( FALSE )
+ , bSplit( FALSE )
+ , nState( 1 )
+ {
+ aTimer.SetTimeoutHdl(
+ LINK(pOwner, SfxSplitWindow, TimerHdl ) );
+ aTimer.SetTimeout( 200 );
+ EnableDrop( TRUE );
+ SetAlign( pOwner->GetAlign() );
+ Actualize();
+ ShowAutoHideButton( pOwner->IsAutoHideButtonVisible() );
+ ShowFadeInHideButton( TRUE );
+ }
+
+ ~SfxEmptySplitWin_Impl()
+ {
+ aTimer.Stop();
+ }
+
+ virtual void MouseMove( const MouseEvent& );
+ virtual BOOL QueryDrop( DropEvent& rEvt );
+ virtual void AutoHide();
+ virtual void FadeIn();
+ void Actualize();
+};
+
+void SfxEmptySplitWin_Impl::Actualize()
+{
+ Size aSize( pOwner->GetSizePixel() );
+ switch ( pOwner->GetAlign() )
+ {
+ case WINDOWALIGN_LEFT:
+ case WINDOWALIGN_RIGHT:
+ aSize.Width() = GetFadeInSize();
+ break;
+ case WINDOWALIGN_TOP:
+ case WINDOWALIGN_BOTTOM:
+ aSize.Height() = GetFadeInSize();
+ break;
+ }
+
+ SetSizePixel( aSize );
+}
+
+void SfxEmptySplitWin_Impl::AutoHide()
+{
+ pOwner->SetPinned_Impl( !pOwner->bPinned );
+ FadeIn();
+ aLastPos = GetPointerPosPixel();
+ aTimer.Start();
+}
+
+void SfxEmptySplitWin_Impl::FadeIn()
+{
+ if (!bAutoHide )
+ bAutoHide = IsFadeNoButtonMode();
+ pOwner->SetFadeIn_Impl( TRUE );
+ pOwner->Show_Impl();
+ if ( bAutoHide )
+ {
+ // Timer zum Schlie\sen aufsetzen; der Aufrufer mu\s selbst sicherstellen,
+ // da\s das Window nicht gleich wieder zu geht ( z.B. durch Setzen des
+ // Focus oder einen modal mode )
+ aLastPos = GetPointerPosPixel();
+ aTimer.Start();
+ }
+}
+
+BOOL SfxEmptySplitWin_Impl::QueryDrop( DropEvent& rEvt )
+{
+#ifndef OS2
+ bAutoHide = TRUE;
+ FadeIn();
+#endif
+
+ return FALSE;
+}
+
+
+BOOL SfxSplitWindow::QueryDrop( DropEvent& rEvt )
+{
+ Point aMousePos( rEvt.GetPosPixel() );
+ Rectangle aRect( GetFadeOutRect() );
+ if ( aRect.IsInside( aMousePos ) && !bPinned )
+ {
+ FadeOut();
+ return FALSE;
+ }
+ else
+ return SplitWindow::QueryDrop( rEvt );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.GetClicks() != 2 )
+ SplitWindow::MouseButtonDown( rMEvt );
+}
+
+void SfxEmptySplitWin_Impl::MouseMove( const MouseEvent& rMEvt )
+{
+ SplitWindow::MouseMove( rMEvt );
+}
+
+//-------------------------------------------------------------------------
+
+SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
+ SfxWorkWindow *pW, BOOL bWithButtons, WinBits nBits )
+
+/* [Beschreibung]
+
+ Ein SfxSplitWindow verbirgt die rekursive Struktur des SV-Splitwindows
+ nach au\sen, indem es einen tabellenartigen Aufbau mit Zeilen und Spalten
+ ( also maximale Rekursionstiefe 2 ) simuliert.
+ Au\erdem sichert es die Persistenz der Anordnung der SfxDockingWindows.
+*/
+
+: SplitWindow ( pParent, nBits | WB_HIDE ),
+ eAlign(eAl),
+ pWorkWin(pW),
+ pDockArr( new SfxDockArr_Impl ),
+ bLocked(FALSE),
+ bPinned(FALSE),
+ pEmptyWin(NULL),
+ pActive(NULL)
+{
+ if ( bWithButtons )
+ {
+ ShowAutoHideButton( TRUE );
+ ShowFadeOutButton( TRUE );
+ }
+
+ // SV-Alignment setzen
+ WindowAlign eTbxAlign;
+ switch ( eAlign )
+ {
+ case SFX_ALIGN_LEFT:
+ eTbxAlign = WINDOWALIGN_LEFT;
+ break;
+ case SFX_ALIGN_RIGHT:
+ eTbxAlign = WINDOWALIGN_RIGHT;
+ break;
+ case SFX_ALIGN_TOP:
+ eTbxAlign = WINDOWALIGN_TOP;
+ break;
+ case SFX_ALIGN_BOTTOM:
+ eTbxAlign = WINDOWALIGN_BOTTOM;
+ bPinned = TRUE;
+ break;
+ }
+
+ SetAlign (eTbxAlign);
+ pEmptyWin = new SfxEmptySplitWin_Impl( this );
+ if ( bPinned )
+ {
+ pEmptyWin->bFadeIn = TRUE;
+ pEmptyWin->nState = 2;
+ }
+
+ if ( bWithButtons )
+ {
+ // Konfiguration einlesen
+ SfxIniManager *pAppIniMgr = SFX_APP()->GetAppIniManager();
+ if ( pAppIniMgr )
+ {
+ String aWinData( pAppIniMgr->Get( SFX_KEY_SPLITWINDOW, (USHORT) eTbxAlign ) );
+ if ( aWinData.Len() && aWinData.GetChar( (USHORT) 0 ) == 'V' )
+ {
+ pEmptyWin->nState = aWinData.GetToken( 1, ',' ).ToInt32();
+ if ( pEmptyWin->nState & 2 )
+ pEmptyWin->bFadeIn = TRUE;
+ bPinned = !( pEmptyWin->nState & 1 );
+
+ USHORT i=2;
+ USHORT nCount = (USHORT) aWinData.GetToken(i++, ',').ToInt32();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pDock = new SfxDock_Impl;
+ pDock->pWin = 0;
+ pDock->bNewLine = FALSE;
+ pDock->bHide = TRUE;
+ pDock->nType = (USHORT) aWinData.GetToken(i++, ',').ToInt32();
+ if ( !pDock->nType )
+ {
+ // K"onnte NewLine bedeuten
+ pDock->nType = (USHORT) aWinData.GetToken(i++, ',').ToInt32();
+ if ( !pDock->nType )
+ {
+ // Lesefehler
+ delete pDock;
+ break;
+ }
+ else
+ pDock->bNewLine = TRUE;
+ }
+
+ pDockArr->Insert(pDock,n);
+ }
+ }
+ }
+ }
+ else
+ {
+ bPinned = TRUE;
+ pEmptyWin->bFadeIn = TRUE;
+ pEmptyWin->nState = 2;
+ }
+
+ SetAutoHideState( !bPinned );
+ pEmptyWin->SetAutoHideState( !bPinned );
+}
+
+//-------------------------------------------------------------------------
+
+SfxSplitWindow::~SfxSplitWindow()
+{
+ if ( !pWorkWin->GetParent_Impl() )
+ {
+ // Konfiguration abspeichern
+ String aWinData('V');
+ aWinData += String::CreateFromInt32( VERSION );
+ aWinData += ',';
+ aWinData += String::CreateFromInt32( pEmptyWin->nState );
+ aWinData += ',';
+
+ USHORT nCount = 0;
+ USHORT n;
+ for ( n=0; n<pDockArr->Count(); n++ )
+ {
+ SfxDock_Impl *pDock = (*pDockArr)[n];
+ if ( pDock->bHide )
+ nCount++;
+ }
+
+ aWinData += String::CreateFromInt32( nCount );
+
+ for ( n=0; n<pDockArr->Count(); n++ )
+ {
+ SfxDock_Impl *pDock = (*pDockArr)[n];
+ if ( !pDock->bHide )
+ continue;
+ if ( pDock->bNewLine )
+ aWinData += DEFINE_CONST_UNICODE(",0");
+ aWinData += ',';
+ aWinData += String::CreateFromInt32( pDock->nType);
+ }
+
+ SfxIniManager *pIniMgr = SFX_INIMANAGER();
+ pIniMgr->Set( aWinData, SFX_KEY_SPLITWINDOW, GetAlign() );
+ }
+
+ if ( pEmptyWin )
+ {
+ // pOwner auf NULL setzen, sonst versucht pEmptyWin, nochmal zu
+ // l"oschen; es wird n"amlich von au\sen immer das Fenster deleted,
+ // das gerade angedockt ist
+ pEmptyWin->pOwner = NULL;
+ delete pEmptyWin;
+ }
+
+ delete pDockArr;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::StartSplit()
+{
+ long nSize;
+ Size aSize = GetSizePixel();
+
+ if ( pEmptyWin )
+ {
+ pEmptyWin->bFadeIn = TRUE;
+ pEmptyWin->bSplit = TRUE;
+ }
+
+ Rectangle aRect = pWorkWin->GetFreeArea( !bPinned );
+ switch ( GetAlign() )
+ {
+ case WINDOWALIGN_LEFT:
+ case WINDOWALIGN_RIGHT:
+ nSize = aSize.Width() + aRect.GetWidth();
+ break;
+ case WINDOWALIGN_TOP:
+ case WINDOWALIGN_BOTTOM:
+ nSize = aSize.Height() + aRect.GetHeight();
+ break;
+ }
+
+ SetMaxSizePixel( nSize );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::SplitResize()
+{
+ if ( bPinned )
+ {
+ pWorkWin->ArrangeChilds_Impl();
+ pWorkWin->ShowChilds_Impl();
+ }
+ else
+ pWorkWin->ArrangeAutoHideWindows( this );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::Split()
+{
+ if ( pEmptyWin )
+ pEmptyWin->bSplit = FALSE;
+
+ SplitWindow::Split();
+
+ USHORT nCount = pDockArr->Count();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pD = (*pDockArr)[n];
+ if ( pD->pWin )
+ {
+ USHORT nId = pD->nType;
+ long nSize = GetItemSize( nId );
+ long nSetSize = GetItemSize( GetSet( nId ) );
+ Size aSize;
+
+ if ( IsHorizontal() )
+ {
+ aSize.Width() = nSize;
+ aSize.Height() = nSetSize;
+ }
+ else
+ {
+ aSize.Width() = nSetSize;
+ aSize.Height() = nSize;
+ }
+
+ pD->pWin->SetItemSize_Impl( aSize );
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize)
+
+/* [Beschreibung]
+
+ Zum Einf"ugen von SfxDockingWindows kann auch keine Position "ubergeben
+ werden. Das SfxSplitWindow sucht dann die zuletzt gemerkte zu dem
+ "ubergebenen SfxDockingWindow heraus oder h"angt es als letztes neu an.
+
+*/
+{
+ short nLine = -1; // damit erstes Fenster nLine auf 0 hochsetzen kann
+ USHORT nL;
+ USHORT nPos = 0;
+ BOOL bNewLine = TRUE;
+
+ SfxDock_Impl *pFoundDock=0;
+ USHORT nCount = pDockArr->Count();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pDock = (*pDockArr)[n];
+ if ( pDock->bNewLine )
+ {
+ // Das Fenster er"offnet eine neue Zeile
+ if ( pFoundDock )
+ // Aber hinter dem gerade eingef"ugten Fenster
+ break;
+
+ // Neue Zeile
+ nPos = 0;
+ bNewLine = TRUE;
+ }
+
+ if ( pDock->pWin )
+ {
+ // Es gibt an dieser Stelle gerade ein Fenster
+ if ( bNewLine && !pFoundDock )
+ {
+ // Bisher ist nicht bekannt, in welcher realen Zeile es liegt
+ GetWindowPos( pDock->pWin, nL, nPos );
+ nLine = (short) nL;
+ }
+
+ if ( !pFoundDock )
+ {
+ // Fenster liegt vor dem eingef"ugten
+ nPos++;
+ }
+
+ // Zeile ist schon er"offnet
+ bNewLine = FALSE;
+ if ( pFoundDock )
+ break;
+ }
+
+ if ( pDock->nType == pDockWin->GetType() )
+ {
+ DBG_ASSERT( !pFoundDock && !pDock->pWin, "Fenster ist schon vorhanden!");
+ pFoundDock = pDock;
+ if ( !bNewLine )
+ break;
+ else
+ {
+ // Es wurde zuletzt eine neue Reihe gestartet, aber noch kein
+ // darin liegendes Fenster gefunden; daher weitersuchen, ob noch
+ // ein Fenster in dieser Zeile folgt, um bNewLine korrekt zu setzen.
+ // Dabei darf aber nLine oder nPos nicht mehr ver"andert werden!
+ nLine++;
+ }
+ }
+ }
+
+ if ( !pFoundDock )
+ {
+ // Nicht gefunden, am Ende einf"ugen
+ pFoundDock = new SfxDock_Impl;
+ pFoundDock->bHide = TRUE;
+ pDockArr->Insert( pFoundDock, nCount );
+ pFoundDock->nType = pDockWin->GetType();
+ nLine++;
+ nPos = 0;
+ bNewLine = TRUE;
+ pFoundDock->bNewLine = bNewLine;
+ }
+
+ pFoundDock->pWin = pDockWin;
+ pFoundDock->bHide = FALSE;
+ InsertWindow_Impl( pFoundDock, rSize, nLine, nPos, bNewLine );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::ReleaseWindow_Impl(SfxDockingWindow *pDockWin)
+
+/* [Beschreibung]
+
+ Das DockingWindow wird nicht mehr in den internen Daten gespeichert.
+*/
+
+{
+ SfxDock_Impl *pDock=0;
+ USHORT nCount = pDockArr->Count();
+ BOOL bFound = FALSE;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ pDock = (*pDockArr)[n];
+ if ( pDock->nType == pDockWin->GetType() )
+ {
+ if ( pDock->bNewLine && n<nCount-1 )
+ (*pDockArr)[n+1]->bNewLine = TRUE;
+
+ // Fenster hat schon eine Position, die vergessen wir
+ bFound = TRUE;
+ pDockArr->Remove(n);
+ break;
+ }
+ }
+
+ if ( bFound )
+ delete pDock;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::MoveWindow( SfxDockingWindow* pDockWin, const Size& rSize,
+ USHORT nLine, USHORT nPos, BOOL bNewLine)
+
+/* [Beschreibung]
+
+ Das DockingWindow wird innerhalb des Splitwindows verschoben.
+
+*/
+
+{
+ USHORT nL, nP;
+ GetWindowPos( pDockWin, nL, nP );
+
+ if ( nLine > nL && GetItemCount( GetItemId( nL, 0 ) ) == 1 )
+ {
+ // Wenn das letzte Fenster aus seiner Zeile entfernt wird, rutscht
+ // alles eine Zeile nach vorne!
+ nLine--;
+ }
+ else if ( nLine == nL && nPos > nP )
+ {
+ nPos--;
+ }
+
+ RemoveWindow( pDockWin );
+ InsertWindow( pDockWin, rSize, nLine, nPos, bNewLine );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize,
+ USHORT nLine, USHORT nPos, BOOL bNewLine)
+
+/* [Beschreibung]
+
+ Das DockingWindow wird in dieses Splitwindow geschoben und soll die
+ "ubergebene Position und Gr"o\se haben.
+
+*/
+{
+ ReleaseWindow_Impl( pDockWin );
+ SfxDock_Impl *pDock = new SfxDock_Impl;
+ pDock->bHide = FALSE;
+ pDock->nType = pDockWin->GetType();
+ pDock->bNewLine = bNewLine;
+ pDock->pWin = pDockWin;
+
+ DBG_ASSERT( nPos==0 || !bNewLine, "Falsche Paramenter!");
+ if ( bNewLine )
+ nPos = 0;
+
+ // Das Fenster mu\s vor dem ersten Fenster eingef"ugt werden, das die
+ // gleiche oder eine gr"o\sere Position hat als pDockWin.
+ USHORT nCount = pDockArr->Count();
+
+ // Wenn gar kein Fenster gefunden wird, wird als erstes eingef"ugt
+ USHORT nInsertPos = 0;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pD = (*pDockArr)[n];
+
+ if (pD->pWin)
+ {
+ // Ein angedocktes Fenster wurde gefunden
+ // Wenn kein geeignetes Fenster hinter der gew"unschten Einf"ugeposition
+ // gefunden wird, wird am Ende eingef"ugt
+ nInsertPos = nCount;
+ USHORT nL=0, nP=0;
+ GetWindowPos( pD->pWin, nL, nP );
+
+ if ( nL == nLine && nP == nPos || nL > nLine )
+ {
+ DBG_ASSERT( nL == nLine || bNewLine || nPos > 0, "Falsche Parameter!" );
+ if ( nL == nLine && nPos == 0 && !bNewLine )
+ {
+ DBG_ASSERT(pD->bNewLine, "Keine neue Zeile?");
+
+ // Das Fenster wird auf nPos==0 eingeschoben
+ pD->bNewLine = FALSE;
+ pDock->bNewLine = TRUE;
+ }
+
+ nInsertPos = n;
+ break;
+ }
+ }
+ }
+
+ pDockArr->Insert(pDock, nInsertPos);
+ InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::InsertWindow_Impl( SfxDock_Impl* pDock,
+ const Size& rSize,
+ USHORT nLine, USHORT nPos, BOOL bNewLine)
+
+/* [Beschreibung]
+
+ F"ugt ein DockingWindow ein und veranla\st die Neuberechnung der Gr"o\se
+ des Splitwindows.
+*/
+
+{
+ SfxDockingWindow* pDockWin = pDock->pWin;
+
+ USHORT nItemBits = pDockWin->GetWinBits_Impl();
+
+ long nWinSize, nSetSize;
+ if ( IsHorizontal() )
+ {
+ nWinSize = rSize.Width();
+ nSetSize = rSize.Height();
+ }
+ else
+ {
+ nSetSize = rSize.Width();
+ nWinSize = rSize.Height();
+ }
+
+ pDock->nSize = nWinSize;
+
+ BOOL bUpdateMode = IsUpdateMode();
+ if ( bUpdateMode )
+ SetUpdateMode( FALSE );
+
+ if ( bNewLine || nLine == GetItemCount( 0 ) )
+ {
+ // Es soll nicht in eine vorhandene Zeile eingef"ugt werden, sondern
+ // eine neue erzeugt werden
+
+ USHORT nId = 1;
+ for ( USHORT n=0; n<GetItemCount(0); n++ )
+ {
+ if ( GetItemId(n) >= nId )
+ nId = GetItemId(n)+1;
+ }
+
+ // Eine neue nLine-te Zeile erzeugen
+ USHORT nBits = nItemBits;
+ if ( GetAlign() == WINDOWALIGN_TOP || GetAlign() == WINDOWALIGN_BOTTOM )
+ nBits |= SWIB_COLSET;
+ InsertItem( nId, nSetSize, nLine, 0, nBits );
+ }
+
+ // In Zeile mit Position nLine das Fenster einf"ugen
+ // ItemWindowSize auf "Prozentual" setzen, da SV dann das Umgr"o\sern
+ // so macht, wie man erwartet; "Pixel" macht eigentlich nur Sinn, wenn
+ // auch Items mit prozentualen oder relativen Gr"o\sen dabei sind.
+ nItemBits |= SWIB_PERCENTSIZE;
+ bLocked = TRUE;
+ USHORT nSet = GetItemId( nLine );
+ InsertItem( pDockWin->GetType(), pDockWin, nWinSize, nPos, nSet, nItemBits );
+
+ // Splitwindows werden im SFX einmal angelegt und beim Einf"ugen des ersten
+ // DockingWindows sichtbar gemacht.
+ if ( GetItemCount( 0 ) == 1 && GetItemCount( 1 ) == 1 )
+ {
+ // Das Neuarrangieren am WorkWindow und ein Show() auf das SplitWindow
+ // wird vom SfxDockingwindow veranla\st (->SfxWorkWindow::ConfigChild_Impl)
+ if ( !bPinned && !IsFloatingMode() )
+ {
+ bPinned = TRUE;
+ BOOL bFadeIn = ( pEmptyWin->nState & 2 ) != 0;
+ pEmptyWin->bFadeIn = FALSE;
+ SetPinned_Impl( FALSE );
+ pEmptyWin->Actualize();
+ pWorkWin->RegisterChild_Impl( *GetSplitWindow(), eAlign, TRUE )->nVisible = CHILD_VISIBLE;
+ pWorkWin->ArrangeChilds_Impl();
+ if ( bFadeIn )
+ FadeIn();
+ }
+ else
+ {
+ BOOL bFadeIn = ( pEmptyWin->nState & 2 ) != 0;
+ pEmptyWin->bFadeIn = FALSE;
+ pEmptyWin->Actualize();
+ pWorkWin->RegisterChild_Impl( *GetSplitWindow(), eAlign, TRUE )->nVisible = CHILD_VISIBLE;
+ pWorkWin->ArrangeChilds_Impl();
+ if ( bFadeIn )
+ FadeIn();
+ }
+
+ pWorkWin->ShowChilds_Impl();
+ }
+
+ if ( bUpdateMode )
+ SetUpdateMode( TRUE );
+ bLocked = FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::RemoveWindow( SfxDockingWindow* pDockWin, BOOL bHide )
+
+/* [Beschreibung]
+
+ Entfernt ein DockingWindow. Wenn es das letzte war, wird das SplitWindow
+ gehidet.
+*/
+{
+ USHORT nSet = GetSet( pDockWin->GetType() );
+
+ // Splitwindows werden im SFX einmal angelegt und nach dem Entfernen
+ // des letzten DockingWindows unsichtbar gemacht.
+ if ( GetItemCount( nSet ) == 1 && GetItemCount( 0 ) == 1 )
+ {
+ // Das Neuarrangieren am WorkWindow wird vom SfxDockingwindow
+ // veranla\st!
+ Hide();
+ pEmptyWin->aTimer.Stop();
+ long nRealState = pEmptyWin->nState;
+ FadeOut();
+ pEmptyWin->Hide();
+ pWorkWin->ReleaseChild_Impl( *GetSplitWindow() );
+ pEmptyWin->nState = nRealState;
+ pWorkWin->ArrangeAutoHideWindows( this );
+ }
+
+ SfxDock_Impl *pDock=0;
+ USHORT nCount = pDockArr->Count();
+ BOOL bFound = FALSE;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ pDock = (*pDockArr)[n];
+ if ( pDock->nType == pDockWin->GetType() )
+ {
+ pDock->pWin = 0;
+ pDock->bHide = bHide;
+ break;
+ }
+ }
+
+ // Fenster removen, und wenn es das letzte der Zeile war, auch die Zeile
+ // ( Zeile = ItemSet )
+ BOOL bUpdateMode = IsUpdateMode();
+ if ( bUpdateMode )
+ SetUpdateMode( FALSE );
+ bLocked = TRUE;
+
+ RemoveItem( pDockWin->GetType() );
+
+ if ( nSet && !GetItemCount( nSet ) )
+ RemoveItem( nSet );
+
+ if ( bUpdateMode )
+ SetUpdateMode( TRUE );
+ bLocked = FALSE;
+};
+
+//-------------------------------------------------------------------------
+
+BOOL SfxSplitWindow::GetWindowPos( const SfxDockingWindow* pWindow,
+ USHORT& rLine, USHORT& rPos ) const
+/* [Beschreibung]
+
+ Liefert die Id des Itemsets und die des Items f"ur das "ubergebene
+ DockingWindow in der alten Zeilen/Spalten-Bezeichnung zur"uck.
+*/
+
+{
+ USHORT nSet = GetSet ( pWindow->GetType() );
+ if ( nSet == SPLITWINDOW_ITEM_NOTFOUND )
+ return FALSE;
+
+ rPos = GetItemPos( pWindow->GetType(), nSet );
+ rLine = GetItemPos( nSet );
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxSplitWindow::GetWindowPos( const Point& rTestPos,
+ USHORT& rLine, USHORT& rPos ) const
+/* [Beschreibung]
+
+ Liefert die Id des Itemsets und die des Items f"ur das DockingWindow
+ an der "ubergebenen Position in der alten Zeilen/Spalten-Bezeichnung
+ zur"uck.
+*/
+
+{
+ USHORT nId = GetItemId( rTestPos );
+ if ( nId == 0 )
+ return FALSE;
+
+ USHORT nSet = GetSet ( nId );
+ rPos = GetItemPos( nId, nSet );
+ rLine = GetItemPos( nSet );
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+USHORT SfxSplitWindow::GetLineCount() const
+
+/* [Beschreibung]
+
+ Liefert die Zeilenzahl = Zahl der Sub-Itemsets im Root-Set.
+*/
+{
+ return GetItemCount( 0 );
+}
+
+//-------------------------------------------------------------------------
+
+long SfxSplitWindow::GetLineSize( USHORT nLine ) const
+
+/* [Beschreibung]
+
+ Liefert die "Zeilenh"ohe" des nLine-ten Itemsets.
+*/
+{
+ USHORT nId = GetItemId( nLine );
+ return GetItemSize( nId );
+}
+
+//-------------------------------------------------------------------------
+
+USHORT SfxSplitWindow::GetWindowCount( USHORT nLine ) const
+
+/* [Beschreibung]
+
+ Liefert die
+*/
+{
+ USHORT nId = GetItemId( nLine );
+ return GetItemCount( nId );
+}
+
+//-------------------------------------------------------------------------
+
+USHORT SfxSplitWindow::GetWindowCount() const
+
+/* [Beschreibung]
+
+ Liefert die Gesamtzahl aller Fenstert
+*/
+{
+ return GetItemCount( 0 );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::Command( const CommandEvent& rCEvt )
+{
+#ifdef TF_AUTOSHOW_ON_MOUSEMOVE
+ if ( rCEvt.GetCommand() != COMMAND_CONTEXTMENU )
+ return;
+
+ SfxPopupMenuManager aPop( SfxResId( RID_AUTOHIDE ), pWorkWin->GetBindings() );
+ aPop.StartInsert();
+
+ if ( !bPinned )
+ {
+ aPop.RemoveItem( 0 );
+ String aText( SfxResId(RID_AUTOHIDE ) );
+ aPop.InsertItem( SID_AUTOHIDE, aText, MIB_CHECKABLE ) ;
+ }
+
+ aPop.InsertSeparator();
+
+ USHORT nCount = pDockArr->Count();
+ SfxSlotPool &rSlotPool = SFX_SLOTPOOL();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pD = (*pDockArr)[n];
+ if ( pD->pWin || pD->bHide )
+ {
+ String aHelpText;
+ String aMenuText = rSlotPool.GetSlotName_Impl( pD->nType, &aHelpText );
+ aPop.InsertItem( pD->nType, aMenuText, MIB_CHECKABLE );
+ }
+ }
+
+ aPop.EndInsert();
+
+ if ( aPop.Execute( GetPointerPosPixel() ) == SID_AUTOHIDE )
+ {
+ // ChildWindows neu anordnen
+ SetPinned_Impl( !bPinned );
+ if ( bPinned && pWorkWin->IsAutoHideMode( this ) )
+ pWorkWin->ArrangeAutoHideWindows( this );
+ pWorkWin->ArrangeChilds_Impl();
+ pWorkWin->ShowChilds_Impl();
+ }
+#else
+ SplitWindow::Command( rCEvt );
+#endif
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxSplitWindow, TimerHdl, Timer*, pTimer)
+{
+ if ( pTimer )
+ pTimer->Stop();
+
+ if ( CursorIsOverRect( FALSE ) || !pTimer )
+ {
+ // Wenn der Mauszeiger innerhalb des Fensters liegt, SplitWindow anzeigen
+ // und Timer zum Schlie\sen aufsetzen
+ pEmptyWin->bAutoHide = TRUE;
+ if ( !IsVisible() )
+ pEmptyWin->FadeIn();
+
+ pEmptyWin->aLastPos = GetPointerPosPixel();
+ pEmptyWin->aTimer.Start();
+ }
+ else if ( pEmptyWin->bAutoHide )
+ {
+ if ( GetPointerPosPixel() != pEmptyWin->aLastPos )
+ {
+ // Die Maus wurd innerhalb der Timerlaugzeit bewegt, also erst einmal
+ // nichts tun
+ pEmptyWin->aLastPos = GetPointerPosPixel();
+ pEmptyWin->aTimer.Start();
+ return 0L;
+ }
+
+ // Speziell f"ur TF_AUTOSHOW_ON_MOUSEMOVE :
+ // Wenn das Fenster nicht sichtbar ist, gibt es nichts zu tun
+ // (Benutzer ist einfach mit der Maus "uber pEmptyWin gefahren)
+ if ( IsVisible() )
+ {
+ pEmptyWin->bEndAutoHide = FALSE;
+ if ( !Application::IsInModalMode() &&
+ !PopupMenu::IsInExecute() &&
+ !pEmptyWin->bSplit && !HasChildPathFocus( TRUE ) )
+ {
+ // W"ahrend ein modaler Dialog oder ein Popupmenu offen sind
+ // oder w"ahrend des Splittens auf keinen Fall zumachen; auch
+ // solange eines der Children den Focus hat, bleibt das
+ // das Fenster offen
+ pEmptyWin->bEndAutoHide = TRUE;
+ }
+
+ if ( pEmptyWin->bEndAutoHide )
+ {
+ // Von mir aus kann Schlu\s sein mit AutoShow
+ // Aber vielleicht will noch ein anderes SfxSplitWindow offen bleiben,
+ // dann bleiben auch alle anderen offen
+ if ( !pWorkWin->IsAutoHideMode( this ) )
+ {
+ FadeOut();
+ pWorkWin->ArrangeAutoHideWindows( this );
+ }
+ else
+ {
+ pEmptyWin->aLastPos = GetPointerPosPixel();
+ pEmptyWin->aTimer.Start();
+ }
+ }
+ else
+ {
+ pEmptyWin->aLastPos = GetPointerPosPixel();
+ pEmptyWin->aTimer.Start();
+ }
+ }
+ }
+
+ return 0L;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxSplitWindow::CursorIsOverRect( BOOL bForceAdding ) const
+{
+ BOOL bVisible = IsVisible();
+
+ // Auch das kollabierte SplitWindow ber"ucksichtigen
+ Point aPos = pEmptyWin->GetParent()->OutputToScreenPixel( pEmptyWin->GetPosPixel() );
+ Size aSize = pEmptyWin->GetSizePixel();
+
+ if ( bForceAdding )
+ {
+ // Um +/- ein paar Pixel erweitern, sonst ist es zu nerv"os
+ aPos.X() -= nPixel;
+ aPos.Y() -= nPixel;
+ aSize.Width() += 2 * nPixel;
+ aSize.Height() += 2 * nPixel;
+ }
+
+ Rectangle aRect( aPos, aSize );
+
+ if ( bVisible )
+ {
+ Point aPos = GetPosPixel();
+ Size aSize = GetSizePixel();
+
+ // Um +/- ein paar Pixel erweitern, sonst ist es zu nerv"os
+ aPos.X() -= nPixel;
+ aPos.Y() -= nPixel;
+ aSize.Width() += 2 * nPixel;
+ aSize.Height() += 2 * nPixel;
+
+ Rectangle aVisRect( aPos, aSize );
+ aRect = aRect.GetUnion( aVisRect );
+ }
+
+ if ( aRect.IsInside( OutputToScreenPixel( ((Window*)this)->GetPointerPosPixel() ) ) )
+ return TRUE;
+ return FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+SplitWindow* SfxSplitWindow::GetSplitWindow()
+{
+ if ( !bPinned || !pEmptyWin->bFadeIn )
+ return pEmptyWin;
+ return this;
+}
+
+//-------------------------------------------------------------------------
+BOOL SfxSplitWindow::IsFadeIn() const
+{
+ return pEmptyWin->bFadeIn;
+}
+
+BOOL SfxSplitWindow::IsAutoHide( BOOL bSelf ) const
+{
+ return bSelf ? pEmptyWin->bAutoHide && !pEmptyWin->bEndAutoHide : pEmptyWin->bAutoHide;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::SetPinned_Impl( BOOL bOn )
+{
+ if ( bPinned == bOn )
+ return;
+
+ bPinned = bOn;
+ if ( GetItemCount( 0 ) == 0 )
+ return;
+
+ if ( !bOn )
+ {
+ pEmptyWin->nState |= 1;
+ if ( pEmptyWin->bFadeIn )
+ {
+ // Ersatzfenster anmelden
+ pWorkWin->ReleaseChild_Impl( *this );
+ Hide();
+ pEmptyWin->Actualize();
+ pWorkWin->RegisterChild_Impl( *pEmptyWin, eAlign, TRUE )->nVisible = CHILD_VISIBLE;
+ }
+
+ Point aPos( GetPosPixel() );
+ aPos = GetParent()->OutputToScreenPixel( aPos );
+ SetFloatingPos( aPos );
+ SetFloatingMode( TRUE );
+ GetFloatingWindow()->SetOutputSizePixel( GetOutputSizePixel() );
+
+ if ( pEmptyWin->bFadeIn )
+ Show();
+ }
+ else
+ {
+ pEmptyWin->nState &= ~1;
+ SetOutputSizePixel( GetFloatingWindow()->GetOutputSizePixel() );
+ SetFloatingMode( FALSE );
+
+ if ( pEmptyWin->bFadeIn )
+ {
+ // Ersatzfenster abmelden
+ pWorkWin->ReleaseChild_Impl( *pEmptyWin );
+ pEmptyWin->Hide();
+ pWorkWin->RegisterChild_Impl( *this, eAlign, TRUE )->nVisible = CHILD_VISIBLE;
+ }
+ }
+
+ SetAutoHideState( !bPinned );
+ pEmptyWin->SetAutoHideState( !bPinned );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxSplitWindow::SetFadeIn_Impl( BOOL bOn )
+{
+ if ( bOn == pEmptyWin->bFadeIn )
+ return;
+
+ if ( GetItemCount( 0 ) == 0 )
+ return;
+
+ pEmptyWin->bFadeIn = bOn;
+ if ( bOn )
+ {
+ pEmptyWin->nState |= 2;
+ if ( IsFloatingMode() )
+ {
+ // FloatingWindow ist nicht sichtbar, also anzeigen
+ pWorkWin->ArrangeAutoHideWindows( this );
+ Show();
+ }
+ else
+ {
+ pWorkWin->ReleaseChild_Impl( *pEmptyWin );
+ pEmptyWin->Hide();
+ pWorkWin->RegisterChild_Impl( *this, eAlign, TRUE )->nVisible = CHILD_VISIBLE;
+ pWorkWin->ArrangeChilds_Impl();
+ pWorkWin->ShowChilds_Impl();
+ }
+ }
+ else
+ {
+ pEmptyWin->bAutoHide = FALSE;
+ pEmptyWin->nState &= ~2;
+ if ( !IsFloatingMode() )
+ {
+ // Das Fenster "schwebt" nicht, soll aber ausgeblendet werden,
+ pWorkWin->ReleaseChild_Impl( *this );
+ Hide();
+ pEmptyWin->Actualize();
+ pWorkWin->RegisterChild_Impl( *pEmptyWin, eAlign, TRUE )->nVisible = CHILD_VISIBLE;
+ pWorkWin->ArrangeChilds_Impl();
+ pWorkWin->ShowChilds_Impl();
+ pWorkWin->ArrangeAutoHideWindows( this );
+ }
+ else
+ {
+ Hide();
+ pWorkWin->ArrangeAutoHideWindows( this );
+ }
+ }
+}
+
+void SfxSplitWindow::EndAutoShow_Impl()
+{
+ SfxWorkWindow *pWorkWin = SFX_APP()->GetWorkWindow_Impl(SfxViewFrame::Current());
+ pWorkWin->EndAutoShow_Impl();
+}
+
+void SfxSplitWindow::AutoHide()
+{
+ // Wenn dieser Handler am "echten" SplitWindow aufgerufen wird, ist es
+ // entweder angedockt und soll "schwebend" angezeigt werden oder umgekehrt
+ if ( !bPinned )
+ {
+ // Es "schwebt", also wieder andocken
+ SetPinned_Impl( TRUE );
+ pWorkWin->ArrangeChilds_Impl();
+ }
+ else
+ {
+ // In den "Schwebezustand" bringen
+ SetPinned_Impl( FALSE );
+ pWorkWin->ArrangeChilds_Impl();
+ pWorkWin->ArrangeAutoHideWindows( this );
+ }
+
+ pWorkWin->ShowChilds_Impl();
+}
+
+void SfxSplitWindow::FadeOut()
+{
+ SetFadeIn_Impl( FALSE );
+ Show_Impl();
+}
+
+void SfxSplitWindow::FadeIn()
+{
+ SetFadeIn_Impl( TRUE );
+ Show_Impl();
+}
+
+void SfxSplitWindow::Show_Impl()
+{
+ USHORT nCount = pDockArr->Count();
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pDock = (*pDockArr)[n];
+ if ( pDock->pWin )
+ pDock->pWin->FadeIn( pEmptyWin->bFadeIn );
+ }
+}
+
+void SfxSplitWindow::Pin_Impl( BOOL bPin )
+{
+ if ( bPinned != bPin )
+ AutoHide();
+}
+
+BOOL SfxSplitWindow::ActivateNextChild_Impl( BOOL bForward )
+{
+ // Wenn kein pActive, auf erstes bzw. letztes Fenster gehen ( bei !bForward wird erst in der loop dekrementiert )
+ USHORT nCount = pDockArr->Count();
+ USHORT n = bForward ? 0 : nCount;
+
+ // Wenn Focus innerhalb, dann ein Fenster vor oder zur"uck, wenn m"oglich
+ if ( pActive )
+ {
+ // Aktives Fenster ermitteln
+ for ( n=0; n<nCount; n++ )
+ {
+ SfxDock_Impl *pD = (*pDockArr)[n];
+ if ( pD->pWin && pD->pWin->HasChildPathFocus() )
+ break;
+ }
+
+ if ( bForward )
+ // ein Fenster weiter ( wenn dann n>nCount, wird die Schleife unten gar nicht durchlaufen )
+ n++;
+ }
+
+ if ( bForward )
+ {
+ // N"achstes Fenster suchen
+ for ( USHORT nNext=n; nNext<nCount; nNext++ )
+ {
+ SfxDock_Impl *pD = (*pDockArr)[nNext];
+ if ( pD->pWin )
+ {
+ pD->pWin->GrabFocus();
+ return TRUE;
+ }
+ }
+ }
+ else
+ {
+ // Vorheriges Fenster suchen
+ for ( USHORT nNext=n; nNext--; )
+ {
+ SfxDock_Impl *pD = (*pDockArr)[nNext];
+ if ( pD->pWin )
+ {
+ pD->pWin->GrabFocus();
+ return TRUE;
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+void SfxSplitWindow::SetActiveWindow_Impl( SfxDockingWindow* pWin )
+{
+ pActive = pWin;
+ pWorkWin->SetActiveChild_Impl( this );
+}
+
+
diff --git a/sfx2/source/dialog/styfitem.cxx b/sfx2/source/dialog/styfitem.cxx
new file mode 100644
index 000000000000..0aaa4485f934
--- /dev/null
+++ b/sfx2/source/dialog/styfitem.cxx
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * $RCSfile: styfitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#pragma hdrstop
+
+#include "styfitem.hxx"
+
+// -----------------------------------------------------------------------
+
+class SfxStyleFamilyItem_Impl
+{
+ Bitmap aBitmap;
+ Image aImage;
+};
+
+// -----------------------------------------------------------------------
+
+// Implementierung des Resource-Konstruktors
+
+SfxStyleFamilyItem::SfxStyleFamilyItem( const ResId &rResId ) :
+
+ Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILY_ITEM ) )
+
+{
+ USHORT nMask = (USHORT) ReadShortRes();
+
+ if(nMask & RSC_SFX_STYLE_ITEM_LIST)
+ {
+ USHORT nCount = (USHORT) ReadShortRes();
+ for( USHORT i = 0; i < nCount; i++ )
+ {
+ SfxFilterTupel *pTupel = new SfxFilterTupel;
+ pTupel->aName = ReadStringRes();
+ long lFlags = ReadLongRes();
+ pTupel->nFlags = (USHORT)lFlags;
+ aFilterList.Insert(pTupel, LIST_APPEND);
+ }
+ }
+ if(nMask & RSC_SFX_STYLE_ITEM_BITMAP)
+ {
+ aBitmap = Bitmap(ResId((RSHEADER_TYPE *)GetClassRes()));
+ IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
+ }
+ if(nMask & RSC_SFX_STYLE_ITEM_TEXT)
+ {
+ aText = ReadStringRes();
+ }
+ if(nMask & RSC_SFX_STYLE_ITEM_HELPTEXT)
+ {
+ aHelpText = ReadStringRes();
+ }
+ if(nMask & RSC_SFX_STYLE_ITEM_STYLEFAMILY)
+ {
+ nFamily = (USHORT)ReadShortRes();
+ }
+ else
+ nFamily = SFX_STYLE_FAMILY_PARA;
+ if(nMask & RSC_SFX_STYLE_ITEM_IMAGE)
+ {
+ aImage = Image(ResId((RSHEADER_TYPE *)GetClassRes()));
+ IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
+ }
+ else
+ aImage = Image(aBitmap);
+}
+
+// -----------------------------------------------------------------------
+
+// Destruktor; gibt interne Daten frei
+
+SfxStyleFamilyItem::~SfxStyleFamilyItem()
+{
+ SfxFilterTupel *pTupel = aFilterList.First();
+ while(pTupel)
+ {
+ delete pTupel;
+ pTupel = aFilterList.Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+// Implementierung des Resource-Konstruktors
+
+SfxStyleFamilies::SfxStyleFamilies( const ResId& rResId ) :
+
+ Resource( rResId.SetRT( RSC_SFX_STYLE_FAMILIES ) ),
+ aEntryList( 4, 1 )
+{
+ USHORT nCount = (USHORT)ReadShortRes();
+ for( USHORT i = 0; i < nCount; i++ )
+ {
+ const ResId aResId((RSHEADER_TYPE *)GetClassRes());
+ SfxStyleFamilyItem *pItem = new SfxStyleFamilyItem(aResId);
+ IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) );
+ aEntryList.Insert(pItem, LIST_APPEND);
+ }
+}
+
+// -----------------------------------------------------------------------
+
+// Destruktor; gibt interne Daten frei
+
+SfxStyleFamilies::~SfxStyleFamilies()
+{
+ SfxStyleFamilyItem *pItem = aEntryList.First();
+
+ while(pItem)
+ {
+ delete pItem;
+ pItem = aEntryList.Next();
+ }
+}
+
+
diff --git a/sfx2/source/dialog/styledlg.cxx b/sfx2/source/dialog/styledlg.cxx
new file mode 100644
index 000000000000..4d28e23dbc20
--- /dev/null
+++ b/sfx2/source/dialog/styledlg.cxx
@@ -0,0 +1,260 @@
+/*************************************************************************
+ *
+ * $RCSfile: styledlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// include ---------------------------------------------------------------
+
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SFXSTYLE_HXX //autogen
+#include <svtools/style.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#pragma hdrstop
+
+#include "styledlg.hxx"
+#include "mgetempl.hxx"
+#include "sfxresid.hxx"
+#include "sfxuno.hxx"
+
+#include "dialog.hrc"
+
+// class SfxStyleDialog --------------------------------------------------
+
+#if SUP <= 372
+
+SfxStyleDialog::SfxStyleDialog
+(
+ Window* pParent, // Parent
+ const ResId& rResId, // ResId
+ SfxStyleSheetBase& rStyle, // zu bearbeitendes StyleSheet
+ BOOL bFreeRes // Flag Resourcen freigeben
+) :
+
+/* [Beschreibung]
+
+ Konstruktor: Verwalten-TabPage zuf"ugen, ExampleSet vom Style setzen.
+*/
+
+ SfxTabDialog( pParent, rResId,
+ rStyle.GetItemSet().Clone(),
+ // auch ohne ParentSupport TRUE "ubergeben, aber erweitert
+ // um den StandardButton zu unterdr"ucken
+ rStyle.HasParentSupport() ? TRUE : 2 ),
+
+ pStyle( &rStyle )
+
+{
+ AddTabPage( ID_TABPAGE_MANAGESTYLES,
+ String( SfxResId( STR_TABPAGE_MANAGESTYLES ) ),
+ SfxManageStyleSheetPage::Create, 0, FALSE, 0 );
+
+ // bei neuer Vorlage immer die Verwaltungsseite als aktuelle
+ // Seite setzen
+
+ if( !rStyle.GetName().Len() )
+ SetCurPageId( ID_TABPAGE_MANAGESTYLES );
+ else
+ {
+ String sTxt( GetText() );
+ sTxt += DEFINE_CONST_UNICODE(": ");
+ sTxt += rStyle.GetName();
+ SetText( sTxt );
+ }
+ delete pExampleSet; // im SfxTabDialog::Ctor() schon angelegt
+ pExampleSet = &pStyle->GetItemSet();
+
+ if ( bFreeRes )
+ FreeResource();
+ GetCancelButton().SetClickHdl( LINK(this, SfxStyleDialog, CancelHdl) );
+}
+
+#endif
+
+SfxStyleDialog::SfxStyleDialog
+(
+ Window* pParent, // Parent
+ const ResId& rResId, // ResId
+ SfxStyleSheetBase& rStyle, // zu bearbeitendes StyleSheet
+ BOOL bFreeRes, // Flag Resourcen freigeben
+ const String* pUserBtnTxt
+) :
+
+/* [Beschreibung]
+
+ Konstruktor: Verwalten-TabPage zuf"ugen, ExampleSet vom Style setzen.
+*/
+
+ SfxTabDialog( pParent, rResId,
+ rStyle.GetItemSet().Clone(),
+ // auch ohne ParentSupport TRUE "ubergeben, aber erweitert
+ // um den StandardButton zu unterdr"ucken
+ rStyle.HasParentSupport() ? TRUE : 2,
+ pUserBtnTxt ),
+
+ pStyle( &rStyle )
+
+{
+ AddTabPage( ID_TABPAGE_MANAGESTYLES,
+ String( SfxResId( STR_TABPAGE_MANAGESTYLES ) ),
+ SfxManageStyleSheetPage::Create, 0, FALSE, 0 );
+
+ // bei neuer Vorlage immer die Verwaltungsseite als aktuelle
+ // Seite setzen
+
+ if( !rStyle.GetName().Len() )
+ SetCurPageId( ID_TABPAGE_MANAGESTYLES );
+ else
+ {
+ String sTxt( GetText() );
+ sTxt += DEFINE_CONST_UNICODE(": ") ;
+ sTxt += rStyle.GetName();
+ SetText( sTxt );
+ }
+ delete pExampleSet; // im SfxTabDialog::Ctor() schon angelegt
+ pExampleSet = &pStyle->GetItemSet();
+
+ if ( bFreeRes )
+ FreeResource();
+ GetCancelButton().SetClickHdl( LINK(this, SfxStyleDialog, CancelHdl) );
+}
+
+// -----------------------------------------------------------------------
+
+SfxStyleDialog::~SfxStyleDialog()
+
+/* [Beschreibung]
+
+ Destruktor: ExampleSet auf NULL setzen, damit der SfxTabDialog nicht den
+ Set vom Style l"oscht.
+*/
+
+{
+ pExampleSet = 0;
+ pStyle = 0;
+ delete GetInputSetImpl();
+}
+
+// -----------------------------------------------------------------------
+
+const SfxItemSet* SfxStyleDialog::GetRefreshedSet()
+
+/* [Beschreibung]
+
+ Diese wird gerufen, wenn <SfxTabPage::DeactivatePage(SfxItemSet *)>
+ <SfxTabPage::REFRESH_SET> liefert.
+*/
+
+{
+ return GetInputSetImpl();
+}
+
+// -----------------------------------------------------------------------
+
+short SfxStyleDialog::Ok()
+
+/* [Beschreibung]
+
+ "Uberladen, damit immer RET_OK zur"uckgegeben wird.
+*/
+
+{
+ SfxTabDialog::Ok();
+ return RET_OK;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxStyleDialog, CancelHdl, Button *, pButton )
+
+/* [Beschreibung]
+
+ Wenn der Dialog abgebrochen wurde, m"ussen alle schon eingestellten
+ Attribute wieder zur"uckgesetzt werden.
+*/
+
+{
+ SfxTabPage* pPage = GetTabPage( ID_TABPAGE_MANAGESTYLES );
+
+ const SfxItemSet* pInSet = GetInputSetImpl();
+ SfxWhichIter aIter( *pInSet );
+ USHORT nWhich = aIter.FirstWhich();
+
+ while ( nWhich )
+ {
+ SfxItemState eState = pInSet->GetItemState( nWhich, FALSE );
+
+ if ( SFX_ITEM_DEFAULT == eState )
+ pExampleSet->ClearItem( nWhich );
+ else
+ pExampleSet->Put( pInSet->Get( nWhich ) );
+ nWhich = aIter.NextWhich();
+ }
+
+ if ( pPage )
+ pPage->Reset( *GetInputSetImpl() );
+ EndDialog( RET_CANCEL );
+ return 0;
+}
+
+
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
new file mode 100644
index 000000000000..532d28667571
--- /dev/null
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -0,0 +1,1494 @@
+/*************************************************************************
+ *
+ * $RCSfile: tabdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// include ---------------------------------------------------------------
+
+#include <limits.h>
+#include <stdlib.h>
+
+#ifndef _SV_MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SV_CLIP_HXX //autogen
+#include <vcl/clip.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#pragma hdrstop
+
+#define _SVSTDARR_USHORTS
+#include <svtools/svstdarr.hxx>
+
+#include "sfxtypes.hxx"
+#include "appdata.hxx"
+#include "minarray.hxx"
+#include "tabdlg.hxx"
+#include "viewfrm.hxx"
+#include "app.hxx"
+#include "inimgr.hxx"
+#include "sfxresid.hxx"
+#include "sfxhelp.hxx"
+
+#include "dialog.hrc"
+#include "helpid.hrc"
+
+/* -----------------------------------------------------------------
+ Verwaltungsdatenstruktur f"ur jede Seite
+ ----------------------------------------------------------------- */
+struct Data_Impl
+{
+ USHORT nId; // Die ID
+ CreateTabPage fnCreatePage; // Pointer auf die Factory
+ GetTabPageRanges fnGetRanges;// Pointer auf die Ranges-Funktion
+ SfxTabPage* pTabPage; // die TabPage selber
+ BOOL bOnDemand; // Flag: ItemSet onDemand
+ BOOL bRefresh; // Flag: Seite mu\s neu initialisiert werden
+
+ // Konstruktor
+ Data_Impl( USHORT Id, CreateTabPage fnPage,
+ GetTabPageRanges fnRanges, BOOL bDemand ) :
+
+ nId ( Id ),
+ fnCreatePage( fnPage ),
+ fnGetRanges ( fnRanges ),
+ pTabPage ( 0 ),
+ bOnDemand ( bDemand ),
+ bRefresh ( FALSE )
+ {}
+};
+
+
+DECL_PTRARRAY(SfxTabDlgData_Impl, Data_Impl *, 4,4)
+
+struct TabDlg_Impl
+{
+ BOOL bModified : 1,
+ bModal : 1,
+ bInOK : 1,
+ bHideResetBtn : 1;
+ SfxTabDlgData_Impl* pData;
+
+ TabDlg_Impl( BYTE nCnt ) :
+
+ bModified ( FALSE ),
+ bModal ( TRUE ),
+ bInOK ( FALSE ),
+ bHideResetBtn ( FALSE ),
+ pData ( new SfxTabDlgData_Impl( nCnt ) )
+ {}
+};
+
+struct TabPageImpl
+{
+ BOOL _bStandard;
+
+ TabPageImpl() : _bStandard( FALSE ) {}
+};
+
+/* -----------------------------------------------------------------
+ Hilfsfunktion: Finden einer Page anhand seiner Id
+ ----------------------------------------------------------------- */
+Data_Impl* Find( SfxTabDlgData_Impl& rArr, USHORT nId, USHORT* pPos = 0 );
+
+Data_Impl* Find( SfxTabDlgData_Impl& rArr, USHORT nId, USHORT* pPos )
+{
+ const USHORT nCount = rArr.Count();
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ Data_Impl* pObj = rArr[i];
+
+ if ( pObj->nId == nId )
+ {
+ if ( pPos )
+ *pPos = i;
+ return pObj;
+ }
+ }
+ return 0;
+}
+
+// class SfxTabPage-------------------------------------------------------
+
+SfxTabPage::SfxTabPage( Window *pParent,
+ const ResId &rResId, const SfxItemSet &rAttrSet ) :
+
+/* [Beschreibung]
+
+ Konstruktor
+*/
+
+ TabPage( pParent, rResId ),
+
+ pSet ( &rAttrSet ),
+ bHasExchangeSupport ( FALSE ),
+ pTabDlg ( NULL ),
+ pImpl ( new TabPageImpl )
+
+{
+}
+// -----------------------------------------------------------------------
+SfxTabPage:: SfxTabPage( Window *pParent, WinBits nStyle, const SfxItemSet &rAttrSet ) :
+ TabPage(pParent, nStyle),
+ pSet ( &rAttrSet ),
+ bHasExchangeSupport ( FALSE ),
+ pTabDlg ( NULL ),
+ pImpl ( new TabPageImpl )
+{
+}
+// -----------------------------------------------------------------------
+
+SfxTabPage::~SfxTabPage()
+
+/* [Beschreibung]
+
+ Destruktor
+*/
+
+{
+ delete pImpl;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabPage::ActivatePage( const SfxItemSet& )
+
+/* [Beschreibung]
+
+ Defaultimplementierung der virtuellen ActivatePage-Methode
+ Diese wird gerufen, wenn eine Seite des Dialogs den Datenaustausch
+ zwischen Pages unterst"utzt.
+
+ <SfxTabPage::DeactivatePage(SfxItemSet *)>
+*/
+
+{
+}
+
+// -----------------------------------------------------------------------
+
+int SfxTabPage::DeactivatePage( SfxItemSet* )
+
+/* [Beschreibung]
+
+ Defaultimplementierung der virtuellen DeactivatePage-Methode
+ Diese wird vor dem Verlassen einer Seite durch den Sfx gerufen;
+ die Anwendung kann "uber den Returnwert steuern,
+ ob die Seite verlassen werden soll.
+ Falls die Seite "uber bHasExchangeSupport
+ anzeigt, da\s sie einen Datenaustausch zwischen Seiten
+ unterst"utzt, wird ein Pointer auf das Austausch-Set als
+ Parameter "ubergeben. Dieser nimmt die Daten f"ur den Austausch
+ entgegen; das Set steht anschlie\send als Parameter in
+ <SfxTabPage::ActivatePage(const SfxItemSet &)> zur Verf"ugung.
+
+ [R"uckgabewert]
+
+ LEAVE_PAGE; Verlassen der Seite erlauben
+*/
+
+{
+ return LEAVE_PAGE;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabPage::FillUserData()
+
+/* [Beschreibung]
+
+ virtuelle Methode, wird von der Basisklasse im Destruktor gerufen
+ um spezielle Informationen der TabPage in der Ini-Datei zu speichern.
+ Beim "Uberladen muss ein String zusammengestellt werden, der mit
+ <SetUserData()> dann weggeschrieben wird.
+*/
+
+{
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxTabPage::IsReadOnly() const
+
+/* [Description]
+
+*/
+
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+const SfxPoolItem* SfxTabPage::GetItem( const SfxItemSet& rSet, USHORT nSlot )
+
+/* [Beschreibung]
+
+ static Methode: hiermit wird der Code der TabPage-Implementierungen
+ vereinfacht.
+
+*/
+
+{
+ const SfxItemPool* pPool = rSet.GetPool();
+ USHORT nWh = pPool->GetWhich( nSlot );
+ const SfxPoolItem* pItem = 0;
+ SfxItemState eState = rSet.GetItemState( nWh, TRUE, &pItem );
+
+ if ( !pItem && nWh != nSlot )
+ pItem = &pPool->GetDefaultItem( nWh );
+ return pItem;
+}
+
+// -----------------------------------------------------------------------
+
+const SfxPoolItem* SfxTabPage::GetOldItem( const SfxItemSet& rSet,
+ USHORT nSlot )
+
+/* [Beschreibung]
+
+ Diese Methode gibt f"ur Vergleiche den alten Wert eines
+ Attributs zur"uck.
+*/
+
+{
+ const SfxItemSet& rOldSet = GetItemSet();
+ USHORT nWh = GetWhich( nSlot );
+ const SfxPoolItem* pItem = 0;
+
+ if ( pImpl->_bStandard && rOldSet.GetParent() )
+ pItem = GetItem( *rOldSet.GetParent(), nSlot );
+ else if ( rSet.GetParent() &&
+ SFX_ITEM_DONTCARE == rSet.GetItemState( nWh ) )
+ pItem = GetItem( *rSet.GetParent(), nSlot );
+ else
+ pItem = GetItem( rOldSet, nSlot );
+ return pItem;
+}
+
+// -----------------------------------------------------------------------
+
+const SfxPoolItem* SfxTabPage::GetExchangeItem( const SfxItemSet& rSet,
+ USHORT nSlot )
+
+/* [Beschreibung]
+
+ Diese Methode gibt f"ur Vergleiche den alten Wert eines
+ Attributs zur"uck. Dabei wird ber"ucksichtigt, ob der Dialog
+ gerade mit OK beendet wurde.
+*/
+
+{
+ if ( pTabDlg && !pTabDlg->IsInOK() && pTabDlg->GetExampleSet() )
+ return GetItem( *pTabDlg->GetExampleSet(), nSlot );
+ else
+ return GetOldItem( rSet, nSlot );
+}
+
+// class SfxTabDialog ----------------------------------------------------
+
+#define INI_LIST \
+ aTabCtrl ( this, ResId(ID_TABCONTROL ) ),\
+ aOKBtn ( this ),\
+ pUserBtn ( pUserButtonText? new PushButton(this): 0 ),\
+ aCancelBtn ( this ),\
+ aHelpBtn ( this ),\
+ aResetBtn ( this ),\
+ aBaseFmtBtn ( this ),\
+ pSet ( pItemSet ),\
+ pOutSet ( 0 ),\
+ pExampleSet ( 0 ),\
+ pRanges ( 0 ),\
+ bItemsReset ( FALSE ),\
+ bFmt ( bEditFmt ),\
+ nResId ( rResId.GetId() ), \
+ nAppPageId ( USHRT_MAX ), \
+ pImpl ( new TabDlg_Impl( (BYTE)aTabCtrl.GetPageCount() ) )
+
+// -----------------------------------------------------------------------
+
+SfxTabDialog::SfxTabDialog
+
+/* [Beschreibung]
+
+ Konstruktor
+*/
+
+(
+ SfxViewFrame* pViewFrame, // Frame, zu dem der Dialog geh"ort
+ Window* pParent, // Parent-Fenster
+ const ResId& rResId, // ResourceId
+ const SfxItemSet* pItemSet, // Itemset mit den Daten;
+ // kann NULL sein, wenn Pages onDemand
+ BOOL bEditFmt, // Flag: es werden Vorlagen bearbeitet
+ // wenn ja -> zus"atzlicher Button f"ur Standard
+ const String* pUserButtonText // Text fuer BenutzerButton;
+ // wenn != 0, wird der UserButton erzeugt
+) :
+ TabDialog( pParent, rResId ),
+ INI_LIST,
+ pFrame( pViewFrame )
+{
+ Init_Impl( bFmt, pUserButtonText );
+}
+
+// -----------------------------------------------------------------------
+
+SfxTabDialog::SfxTabDialog
+
+/* [Beschreibung]
+
+ Konstruktor, tempor"ar ohne Frame
+*/
+
+(
+ Window* pParent, // Parent-Fenster
+ const ResId& rResId, // ResourceId
+ const SfxItemSet* pItemSet, // Itemset mit den Daten; kann NULL sein,
+ // wenn Pages onDemand
+ BOOL bEditFmt, // Flag: es werden Vorlagen bearbeitet
+ // wenn ja -> zus"atzlicher Button f"ur Standard
+ const String* pUserButtonText // Text f"ur BenutzerButton;
+ // wenn != 0, wird der UserButton erzeugt
+) :
+ TabDialog( pParent, rResId ),
+ INI_LIST,
+ pFrame( 0 )
+{
+ Init_Impl( bFmt, pUserButtonText );
+ DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" );
+}
+
+// -----------------------------------------------------------------------
+
+SfxTabDialog::~SfxTabDialog()
+{
+ // Konfiguration in Ini-Manager abspeichern
+ SfxIniManager* pIniMgr = SFX_APP()->GetAppIniManager();
+ String aDlgData( pIniMgr->GetString( GetPosPixel(), Size() ) );
+ aDlgData += pIniMgr->GetToken();
+ aDlgData += String::CreateFromInt32( aTabCtrl.GetCurPageId() );
+ pIniMgr->Set( aDlgData, SFX_KEY_DIALOG, nResId );
+ const USHORT nCount = pImpl->pData->Count();
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ Data_Impl* pDataObject = pImpl->pData->GetObject(i);
+
+ if ( pDataObject->pTabPage )
+ {
+ pDataObject->pTabPage->FillUserData();
+ String aPageData(pDataObject->pTabPage->GetUserData());
+ if ( aPageData.Len() )
+ {
+ pIniMgr->Set( aPageData, SFX_KEY_PAGE, pDataObject->nId);
+ }
+
+ if ( pDataObject->bOnDemand )
+ delete (SfxItemSet*)&pDataObject->pTabPage->GetItemSet();
+ delete pDataObject->pTabPage;
+ }
+ delete pDataObject;
+ }
+ delete pImpl->pData;
+ delete pImpl;
+ delete pUserBtn;
+ delete pOutSet;
+ delete pExampleSet;
+ delete pRanges;
+
+ SfxHelpPI *pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI )
+ pHelpPI->ResetTopic();
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::Init_Impl( BOOL bFmt, const String* pUserButtonText )
+
+/* [Beschreibung]
+
+ interne Initialisierung des Dialogs
+*/
+
+{
+ aOKBtn.SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) );
+ aResetBtn.SetClickHdl( LINK( this, SfxTabDialog, ResetHdl ) );
+ aResetBtn.SetText( String( SfxResId( STR_RESET ) ) );
+ aTabCtrl.SetActivatePageHdl(
+ LINK( this, SfxTabDialog, ActivatePageHdl ) );
+ aTabCtrl.SetDeactivatePageHdl(
+ LINK( this, SfxTabDialog, DeactivatePageHdl ) );
+ aTabCtrl.Show();
+ aOKBtn.Show();
+ aCancelBtn.Show();
+ aHelpBtn.Show();
+ aResetBtn.Show();
+ aResetBtn.SetHelpId( HID_TABDLG_RESET_BTN );
+
+ if ( pUserBtn )
+ {
+ pUserBtn->SetText( *pUserButtonText );
+ pUserBtn->SetClickHdl( LINK( this, SfxTabDialog, UserHdl ) );
+ pUserBtn->Show();
+ }
+
+ if ( bFmt )
+ {
+ String aStd( SfxResId( STR_STANDARD ) );
+ aStd.Insert( '~', 0 );
+ aBaseFmtBtn.SetText( aStd );
+ aBaseFmtBtn.SetClickHdl( LINK( this, SfxTabDialog, BaseFmtHdl ) );
+ aBaseFmtBtn.SetHelpId( HID_TABDLG_STANDARD_BTN );
+
+ // bFmt = tempor"ares Flag im Ctor() "ubergeben,
+ // wenn bFmt == 2, dann auch TRUE,
+ // zus"atzlich Ausblendung vom StandardButton,
+ // nach der Initialisierung wieder auf TRUE setzen
+ if ( bFmt != 2 )
+ aBaseFmtBtn.Show();
+ else
+ bFmt = TRUE;
+ }
+
+ if ( pSet )
+ {
+ pExampleSet = new SfxItemSet( *pSet );
+ pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::RemoveResetButton()
+{
+ aResetBtn.Hide();
+ pImpl->bHideResetBtn = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+short SfxTabDialog::Execute()
+{
+ if ( !aTabCtrl.GetPageCount() )
+ return RET_CANCEL;
+ Start_Impl();
+ return TabDialog::Execute();
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::Start( BOOL bShow )
+{
+ aCancelBtn.SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) );
+ pImpl->bModal = FALSE;
+ Start_Impl();
+
+ if ( bShow )
+ Show();
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::Start_Impl()
+{
+ DBG_ASSERT( pImpl->pData->Count() == aTabCtrl.GetPageCount(),
+ "nicht alle Seiten angemeldet" );
+ Point aPos;
+ USHORT nActPage = aTabCtrl.GetPageId( 0 );
+
+ // Konfiguration vorhanden?
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxIniManager* pIniMgr =
+ pFrame ? pFrame->GetIniManager() : pSfxApp->GetAppIniManager();
+ String aDlgData( pIniMgr->Get( SFX_KEY_DIALOG, nResId ) );
+
+ if ( aDlgData.Len() > 0 )
+ {
+ // ggf. Position aus Konfig
+ Size aDummySize;
+
+ if ( pIniMgr->GetPosSize( aDlgData.GetToken( 0, pIniMgr->GetToken() ), aPos, aDummySize ) )
+ SetPosPixel( aPos );
+
+ // initiale TabPage aus Programm/Hilfe/Konfig
+ nActPage = (USHORT)aDlgData.GetToken( 1, pIniMgr->GetToken() ).ToInt32();
+
+ if ( USHRT_MAX != nAppPageId )
+ nActPage = nAppPageId;
+ else
+ {
+ USHORT nAutoTabPageId = pSfxApp->Get_Impl()->nAutoTabPageId;
+
+ if ( nAutoTabPageId )
+ nActPage = nAutoTabPageId;
+ }
+
+ if ( TAB_PAGE_NOTFOUND == aTabCtrl.GetPagePos( nActPage ) )
+ nActPage = aTabCtrl.GetPageId( 0 );
+ }
+ else if ( USHRT_MAX != nAppPageId &&
+ TAB_PAGE_NOTFOUND != aTabCtrl.GetPagePos( nAppPageId ) )
+ nActPage = nAppPageId;
+
+ aTabCtrl.SetCurPageId( nActPage );
+ ActivatePageHdl( &aTabCtrl );
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::AddTabPage
+
+/* [Beschreibung]
+
+ Hinzuf"ugen einer Seite zu dem Dialog.
+ Mu\s korrespondieren zu einem entsprechende Eintrag im
+ TabControl in der Resource des Dialogs.
+*/
+
+(
+ USHORT nId, // ID der Seite
+ CreateTabPage pCreateFunc, // Pointer auf die Factory-Methode
+ GetTabPageRanges pRangesFunc, // Pointer auf die Methode f"ur das
+ // Erfragen der Ranges onDemand
+ BOOL bItemsOnDemand // gibt an, ob das Set dieser Seite beim
+ // Erzeugen der Seite erfragt wird
+)
+{
+ pImpl->pData->Append(
+ new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::AddTabPage
+
+/* [Beschreibung]
+
+ Hinzuf"ugen einer Seite zu dem Dialog.
+ Der Ridertext wird "ubergeben, die Seite hat keine Entsprechung im
+ TabControl in der Resource des Dialogs.
+*/
+
+(
+ USHORT nId,
+ const String& rRiderText,
+ CreateTabPage pCreateFunc,
+ GetTabPageRanges pRangesFunc,
+ BOOL bItemsOnDemand,
+ USHORT nPos
+)
+{
+ DBG_ASSERT( TAB_PAGE_NOTFOUND == aTabCtrl.GetPagePos( nId ),
+ "Doppelte Page-Ids in der Tabpage" );
+ aTabCtrl.InsertPage( nId, rRiderText, nPos );
+ pImpl->pData->Append(
+ new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
+}
+
+// -----------------------------------------------------------------------
+#ifdef SV_HAS_RIDERBITMAPS
+
+void SfxTabDialog::AddTabPage
+
+/* [Beschreibung]
+
+ Hinzuf"ugen einer Seite zu dem Dialog.
+ Die Riderbitmap wird "ubergeben, die Seite hat keine Entsprechung im
+ TabControl in der Resource des Dialogs.
+*/
+
+(
+ USHORT nId,
+ const Bitmap &rRiderBitmap,
+ CreateTabPage pCreateFunc,
+ GetTabPageRanges pRangesFunc,
+ BOOL bItemsOnDemand,
+ USHORT nPos
+)
+{
+ DBG_ASSERT( TAB_PAGE_NOTFOUND == aTabCtrl.GetPagePos( nId ),
+ "Doppelte Page-Ids in der Tabpage" );
+ aTabCtrl.InsertPage( nId, rRiderBitmap, nPos );
+ pImpl->pData->Append(
+ new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
+}
+#endif
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::RemoveTabPage( USHORT nId )
+
+/* [Beschreibung]
+
+ L"oschen der TabPage mit der ID nId
+*/
+
+{
+ USHORT nPos = 0;
+ aTabCtrl.RemovePage( nId );
+ Data_Impl* pDataObject = Find( *pImpl->pData, nId, &nPos );
+
+ if ( pDataObject )
+ {
+ if ( pDataObject->pTabPage )
+ {
+ pDataObject->pTabPage->FillUserData();
+ String aPageData(pDataObject->pTabPage->GetUserData());
+ if ( aPageData.Len() )
+ {
+ SfxIniManager* pIniMgr =
+ pFrame ? pFrame->GetIniManager() : SFX_APP()->GetAppIniManager();
+ pIniMgr->Set( aPageData, SFX_KEY_PAGE, pDataObject->nId);
+ }
+
+ if ( pDataObject->bOnDemand )
+ delete (SfxItemSet*)&pDataObject->pTabPage->GetItemSet();
+ delete pDataObject->pTabPage;
+ }
+
+ delete pDataObject;
+ pImpl->pData->Remove( nPos );
+ }
+ else
+ {
+ DBG_WARNINGFILE( "TabPage-Id nicht bekannt" );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::PageCreated
+
+/* [Beschreibung]
+
+ Defaultimplemetierung der virtuellen Methode.
+ Diese wird unmittelbar nach dem Erzeugen einer Seite gerufen.
+ Hier kann der Dialog direkt an der TabPage Methoden rufen.
+*/
+
+(
+ USHORT, // Id der erzeugten Seite
+ SfxTabPage& // Referenz auf die erzeugte Seite
+)
+{
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemSet* SfxTabDialog::GetInputSetImpl()
+
+/* [Beschreibung]
+
+ Abgeleitete Klassen legen ggf. fuer den InputSet neuen Speicher an.
+ Dieser mu\s im Destruktor auch wieder freigegeben werden. Dazu mu\s
+ diese Methode gerufen werden.
+*/
+
+{
+ return (SfxItemSet*)pSet;
+}
+
+// -----------------------------------------------------------------------
+
+SfxTabPage* SfxTabDialog::GetTabPage( USHORT nPageId ) const
+
+/* [Beschreibung]
+
+ TabPage mit der "Ubergebenen Id zur"uckgeben.
+*/
+
+{
+ USHORT nPos = 0;
+ Data_Impl* pDataObject = Find( *pImpl->pData, nPageId, &nPos );
+
+ if ( pDataObject )
+ return pDataObject->pTabPage;
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxTabDialog::IsInOK() const
+
+/* [Beschreibung]
+
+*/
+
+{
+ return pImpl->bInOK;
+}
+
+// -----------------------------------------------------------------------
+
+short SfxTabDialog::Ok()
+
+/* [Beschreibung]
+
+ Ok-Handler des Dialogs
+ Das OutputSet wird erstellt und jede Seite wird mit
+ dem bzw. ihrem speziellen OutputSet durch Aufruf der Methode
+ <SfxTabPage::FillItemSet(SfxItemSet &)> dazu aufgefordert,
+ die vom Benuzter eingestellten Daten in das Set zu tun.
+
+ [R"uckgabewert]
+
+ RET_OK: wenn mindestens eine Seite TRUE als Returnwert von
+ FillItemSet geliefert hat, sonst RET_CANCEL.
+*/
+
+{
+ pImpl->bInOK = TRUE;
+
+ if ( !pOutSet )
+ {
+ if ( !pExampleSet && pSet )
+ pOutSet = pSet->Clone( FALSE ); // ohne Items
+ else if ( pExampleSet )
+ pOutSet = new SfxItemSet( *pExampleSet );
+ }
+ BOOL bModified = FALSE;
+
+ const USHORT nCount = pImpl->pData->Count();
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ Data_Impl* pDataObject = pImpl->pData->GetObject(i);
+ SfxTabPage* pTabPage = pDataObject->pTabPage;
+
+ if ( pTabPage )
+ {
+ if ( pDataObject->bOnDemand )
+ {
+ SfxItemSet& rSet = (SfxItemSet&)pTabPage->GetItemSet();
+ rSet.ClearItem();
+ bModified |= pTabPage->FillItemSet( rSet );
+ }
+ else if ( pSet && !pTabPage->HasExchangeSupport() )
+ {
+ SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
+
+ if ( pTabPage->FillItemSet( aTmp ) )
+ {
+ bModified |= TRUE;
+ pExampleSet->Put( aTmp );
+ pOutSet->Put( aTmp );
+ }
+ }
+ }
+ }
+
+ if ( pImpl->bModified || ( pOutSet && pOutSet->Count() > 0 ) )
+ bModified |= TRUE;
+
+ if ( bFmt == 2 )
+ bModified |= TRUE;
+ return bModified ? RET_OK : RET_CANCEL;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, CancelHdl, Button*, pButton )
+{
+ Close();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemSet* SfxTabDialog::CreateInputItemSet( USHORT )
+
+/* [Beschreibung]
+
+ Defaultimplemetierung der virtuellen Methode.
+ Diese wird gerufen, wenn Pages ihre Sets onDenamd anlegen
+*/
+
+{
+ DBG_WARNINGFILE( "CreateInputItemSet nicht implementiert" );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+const SfxItemSet* SfxTabDialog::GetRefreshedSet()
+
+/* [Beschreibung]
+
+ Defaultimplemetierung der virtuellen Methode.
+ Diese wird gerufen, wenn <SfxTabPage::DeactivatePage(SfxItemSet *)>
+ <SfxTabPage::REFRESH_SET> liefert.
+*/
+
+{
+ DBG_ERRORFILE( "GetRefreshedSet nicht implementiert" );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, OkHdl, Button *, EMPTYARG )
+
+/* [Beschreibung]
+
+ Handler des Ok-Buttons
+ Dieser ruft f"ur die aktuelle Seite
+ <SfxTabPage::DeactivatePage(SfxItemSet *)>.
+ Liefert diese <SfxTabPage::LEAVE_PAGE>, wird <SfxTabDialog::Ok()> gerufen
+ und so der Dialog beendet.
+*/
+
+{
+ pImpl->bInOK = TRUE;
+
+ if ( OK_Impl() )
+ {
+ if ( pImpl->bModal )
+ EndDialog( Ok() );
+ else
+ {
+ Ok();
+ Close();
+ }
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxTabDialog::OK_Impl()
+{
+ SfxTabPage* pPage =
+ (SfxTabPage*)aTabCtrl.GetTabPage( aTabCtrl.GetCurPageId() );
+
+ BOOL bEnd = !pPage;
+ if ( pPage )
+ {
+ int nRet = SfxTabPage::LEAVE_PAGE;
+ if ( pSet )
+ {
+ SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
+ BOOL bRet = FALSE;
+
+ if ( pPage->HasExchangeSupport() )
+ nRet = pPage->DeactivatePage( &aTmp );
+
+ if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE
+ && aTmp.Count() )
+ {
+ pExampleSet->Put( aTmp );
+ pOutSet->Put( aTmp );
+ }
+ else if ( bRet )
+ pImpl->bModified |= TRUE;
+ }
+ else
+ nRet = pPage->DeactivatePage( NULL );
+ bEnd = nRet;
+ }
+
+ return bEnd;
+}
+
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, UserHdl, Button *, EMPTYARG )
+
+/* [Beschreibung]
+
+ Handler des User-Buttons
+ Dieser ruft f"ur die aktuelle Seite
+ <SfxTabPage::DeactivatePage(SfxItemSet *)>.
+ Liefert diese <SfxTabPage::LEAVE_PAGE>, wird <SfxTabDialog::Ok()> gerufen.
+ Mit dem Return-Wert von <SfxTabDialog::Ok()> wird dann der Dialog beendet.
+*/
+
+{
+ SfxTabPage* pPage =
+ (SfxTabPage *)aTabCtrl.GetTabPage( aTabCtrl.GetCurPageId() );
+
+ FASTBOOL bEnd = !pPage;
+
+ if ( pPage )
+ {
+ int nRet = SfxTabPage::LEAVE_PAGE;
+
+ if ( pSet )
+ {
+ SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
+
+ if ( pPage->HasExchangeSupport() )
+ nRet = pPage->DeactivatePage( &aTmp );
+
+ if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE
+ && aTmp.Count() )
+ {
+ pExampleSet->Put( aTmp );
+ pOutSet->Put( aTmp );
+ }
+ }
+ else
+ nRet = pPage->DeactivatePage( NULL );
+ bEnd = nRet;
+ }
+
+ if ( bEnd )
+ {
+ short nRet = Ok();
+
+ if ( RET_OK == nRet )
+ nRet = RET_USER;
+ else
+ nRet = RET_USER_CANCEL;
+ EndDialog( nRet );
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, ResetHdl, Button *, EMPTYARG )
+
+/* [Beschreibung]
+
+ Handler hinter dem Zur"ucksetzen-Button.
+ Die aktuelle Page wird mit ihren initialen Daten
+ neu initialisiert; alle Einstellungen, die der Benutzer
+ auf dieser Seite get"atigt hat, werden aufgehoben.
+*/
+
+{
+ Data_Impl* pDataObject = Find( *pImpl->pData, aTabCtrl.GetCurPageId() );
+ DBG_ASSERT( pDataObject, "Id nicht bekannt" );
+
+ if ( pDataObject->bOnDemand )
+ {
+ // CSet auf AIS hat hier Probleme, daher getrennt
+ const SfxItemSet* pSet = &pDataObject->pTabPage->GetItemSet();
+ pDataObject->pTabPage->Reset( *(SfxItemSet*)pSet );
+ }
+ else
+ pDataObject->pTabPage->Reset( *pSet );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG )
+
+/* [Beschreibung]
+
+ Handler hinter dem Standard-Button.
+ Dieser Button steht beim Bearbeiten von StyleSheets zur Verf"ugung.
+ Alle in dem bearbeiteten StyleSheet eingestellten Attribute
+ werden gel"oscht.
+*/
+
+{
+ const USHORT nId = aTabCtrl.GetCurPageId();
+ Data_Impl* pDataObject = Find( *pImpl->pData, nId );
+ DBG_ASSERT( pDataObject, "Id nicht bekannt" );
+ bFmt = 2;
+
+ if ( pDataObject->fnGetRanges )
+ {
+ if ( !pExampleSet )
+ pExampleSet = new SfxItemSet( *pSet );
+
+ const SfxItemPool* pPool = pSet->GetPool();
+ const USHORT* pRanges = (pDataObject->fnGetRanges)();
+ SfxItemSet aTmpSet( *pExampleSet );
+
+ while ( *pRanges )
+ {
+ const USHORT* pU = pRanges + 1;
+
+ if ( *pRanges == *pU )
+ {
+ // Range mit zwei gleichen Werten -> nur ein Item setzen
+ USHORT nWh = pPool->GetWhich( *pRanges );
+ pExampleSet->ClearItem( nWh );
+ aTmpSet.ClearItem( nWh );
+ // am OutSet mit InvalidateItem,
+ // damit die "Anderung wirksam wird
+ pOutSet->InvalidateItem( nWh );
+ }
+ else
+ {
+ // richtiger Range mit mehreren Werten
+ USHORT nTmp = *pRanges, nTmpEnd = *pU;
+ DBG_ASSERT( nTmp <= nTmpEnd, "Range ist falsch sortiert" );
+
+ if ( nTmp > nTmpEnd )
+ {
+ // wenn wirklich falsch sortiert, dann neu setzen
+ USHORT nTmp1 = nTmp;
+ nTmp = nTmpEnd;
+ nTmpEnd = nTmp1;
+ }
+
+ while ( nTmp <= nTmpEnd )
+ {
+ // "uber den Range iterieren, und die Items setzen
+ USHORT nWh = pPool->GetWhich( nTmp );
+ pExampleSet->ClearItem( nWh );
+ aTmpSet.ClearItem( nWh );
+ // am OutSet mit InvalidateItem,
+ // damit die "Anderung wirksam wird
+ pOutSet->InvalidateItem( nWh );
+ nTmp++;
+ }
+ }
+ // zum n"achsten Paar gehen
+ pRanges += 2;
+ }
+ // alle Items neu gesetzt -> dann an der aktuellen Page Reset() rufen
+ DBG_ASSERT( pDataObject->pTabPage, "die Page ist weg" );
+ pDataObject->pTabPage->Reset( aTmpSet );
+ pDataObject->pTabPage->pImpl->_bStandard = TRUE;
+ }
+ return 1;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
+
+/* [Beschreibung]
+
+ Handler, der vor dem Umschalten auf eine andere Seite
+ durch Starview gerufen wird.
+ Existiert die Seite noch nicht, so wird sie erzeugt und
+ die virtuelle Methode <SfxTabDialog::PageCreated( USHORT, SfxTabPage &)>
+ gerufen. Existiert die Seite bereits, so wird ggf.
+ <SfxTabPage::Reset(const SfxItemSet &)> oder
+ <SfxTabPage::ActivatePage(const SfxItemSet &)> gerufen.
+*/
+
+{
+ DBG_ASSERT( pImpl->pData->Count(), "keine Pages angemeldet" );
+ const USHORT nId = pTabCtrl->GetCurPageId();
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxIniManager* pIniMgr =
+ pFrame ? pFrame->GetIniManager() : pSfxApp->GetAppIniManager();
+ if ( BOOL( pIniMgr->Get( SFX_GROUP_USER, DEFINE_CONST_UNICODE("HelpAuthor") ).ToInt32() ) )
+ {
+ String aText( DEFINE_CONST_UNICODE("slot:") );
+ aText += pSfxApp->Get_Impl()->nExecutingSID;
+ aText += 0x0023; // '#' = 23h
+ aText += String::CreateFromInt32(nId);
+ GetpApp()->ShowStatusText( aText );
+ Clipboard::Clear();
+ Clipboard::CopyString( aText );
+ }
+
+ // Tab Page schon da?
+ SfxTabPage* pTabPage = (SfxTabPage *)pTabCtrl->GetTabPage( nId );
+ Data_Impl* pDataObject = Find( *pImpl->pData, nId );
+ DBG_ASSERT( pDataObject, "Id nicht bekannt" );
+
+ // ggf. TabPage erzeugen:
+ if ( !pTabPage )
+ {
+ const SfxItemSet* pTmpSet = 0;
+
+ if ( pSet )
+ {
+ if ( bItemsReset && pSet->GetParent() )
+ pTmpSet = pSet->GetParent();
+ else
+ pTmpSet = pSet;
+ }
+
+ if ( pTmpSet && !pDataObject->bOnDemand )
+ pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, *pTmpSet );
+ else
+ pTabPage = (pDataObject->fnCreatePage)
+ ( pTabCtrl, *CreateInputItemSet( nId ) );
+ DBG_ASSERT( NULL == pDataObject->pTabPage, "TabPage mehrfach erzeugt" );
+ pDataObject->pTabPage = pTabPage;
+ pDataObject->pTabPage->SetTabDialog( this );
+
+ pTabPage->SetUserData(pIniMgr->Get( SFX_KEY_PAGE, pDataObject->nId ));
+
+ Size aSiz = pTabPage->GetSizePixel();
+ Size aCtrlSiz = pTabCtrl->GetOutputSizePixel();
+ // Gr"o/se am TabControl nur dann setzen, wenn < als TabPage
+ if ( aCtrlSiz.Width() < aSiz.Width() ||
+ aCtrlSiz.Height() < aSiz.Height() )
+ pTabCtrl->SetOutputSizePixel( aSiz );
+ PageCreated( nId, *pTabPage );
+
+ if ( pDataObject->bOnDemand )
+ pTabPage->Reset( (SfxItemSet &)pTabPage->GetItemSet() );
+ else
+ pTabPage->Reset( *pSet );
+ pTabCtrl->SetTabPage( nId, pTabPage );
+ }
+ else if ( pDataObject->bRefresh )
+ pTabPage->Reset( *pSet );
+ pDataObject->bRefresh = FALSE;
+
+ if ( pExampleSet )
+ pTabPage->ActivatePage( *pExampleSet );
+
+ SfxHelpPI *pHelpPI = pSfxApp->GetHelpPI();
+ if ( pHelpPI )
+ pHelpPI->LoadTopic( pTabPage->GetHelpId() );
+
+ BOOL bReadOnly = pTabPage->IsReadOnly();
+ ( bReadOnly || pImpl->bHideResetBtn ) ? aResetBtn.Hide() : aResetBtn.Show();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
+
+/* [Beschreibung]
+
+ Handler, der vor dem Verlassen einer Seite durch Starview gerufen wird.
+
+ [Querverweise]
+
+ <SfxTabPage::DeactivatePage(SfxItemSet *)>
+*/
+
+{
+ USHORT nId = pTabCtrl->GetCurPageId();
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxIniManager* pIniMgr =
+ pFrame ? pFrame->GetIniManager() : pSfxApp->GetAppIniManager();
+ if ( BOOL( pIniMgr->Get( SFX_GROUP_USER, DEFINE_CONST_UNICODE("HelpAuthor") ).ToInt32() ) )
+ GetpApp()->HideStatusText();
+
+ SfxTabPage *pPage = (SfxTabPage*)pTabCtrl->GetTabPage( nId );
+ DBG_ASSERT( pPage, "keine aktive Page" );
+#ifdef DBG_UTIL
+ Data_Impl* pDataObject = Find( *pImpl->pData, pTabCtrl->GetCurPageId() );
+ DBG_ASSERT( pDataObject, "keine Datenstruktur zur aktuellen Seite" );
+ if ( pPage->HasExchangeSupport() && pDataObject->bOnDemand )
+ {
+ DBG_WARNING( "Datenaustausch bei ItemsOnDemand ist nicht gewuenscht!" );
+ }
+#endif
+
+ int nRet = SfxTabPage::LEAVE_PAGE;
+
+ if ( !pExampleSet && pPage->HasExchangeSupport() && pSet )
+ pExampleSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
+
+ if ( pSet )
+ {
+ SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
+
+ if ( pPage->HasExchangeSupport() )
+ nRet = pPage->DeactivatePage( &aTmp );
+//! else
+//! pPage->FillItemSet( aTmp );
+
+ if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE &&
+ aTmp.Count() )
+ {
+ pExampleSet->Put( aTmp );
+ pOutSet->Put( aTmp );
+ }
+ }
+ else
+ {
+ if ( pPage->HasExchangeSupport() ) //!!!
+ {
+ if ( !pExampleSet )
+ {
+ SfxItemPool* pPool = pPage->GetItemSet().GetPool();
+ pExampleSet =
+ new SfxItemSet( *pPool, GetInputRanges( *pPool ) );
+ }
+ nRet = pPage->DeactivatePage( pExampleSet );
+ }
+ else
+ nRet = pPage->DeactivatePage( NULL );
+ }
+
+ if ( nRet & SfxTabPage::REFRESH_SET )
+ {
+ pSet = GetRefreshedSet();
+ DBG_ASSERT( pSet, "GetRefreshedSet() liefert NULL" );
+ // alle Pages als neu zu initialsieren flaggen
+ const USHORT nCount = pImpl->pData->Count();
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ Data_Impl* pObj = (*pImpl->pData)[i];
+
+ if ( pObj->pTabPage != pPage ) // eigene Page nicht mehr refreshen
+ pObj->bRefresh = TRUE;
+ else
+ pObj->bRefresh = FALSE;
+ }
+ }
+ if ( nRet & SfxTabPage::LEAVE_PAGE )
+ return TRUE;
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+const SfxItemSet* SfxTabDialog::GetOutputItemSet
+
+/* [Beschreibung]
+
+ Liefert die Pages, die ihre Sets onDemand liefern, das OutputItemSet.
+
+ [Querverweise]
+
+ <SfxTabDialog::AddTabPage(USHORT, CreateTabPage, GetTabPageRanges, BOOL)>
+ <SfxTabDialog::AddTabPage(USHORT, const String &, CreateTabPage, GetTabPageRanges, BOOL, USHORT)>
+ <SfxTabDialog::AddTabPage(USHORT, const Bitmap &, CreateTabPage, GetTabPageRanges, BOOL, USHORT)>
+*/
+
+(
+ USHORT nId // die Id, unter der die Seite bei AddTabPage()
+ // hinzugef"ugt wurde.
+) const
+{
+ Data_Impl* pDataObject = Find( *pImpl->pData, nId );
+ DBG_ASSERT( pDataObject, "TabPage nicht gefunden" );
+
+ if ( pDataObject )
+ {
+ if ( !pDataObject->pTabPage )
+ return NULL;
+
+ if ( pDataObject->bOnDemand )
+ return &pDataObject->pTabPage->GetItemSet();
+ // else
+ return pOutSet;
+ }
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+int SfxTabDialog::FillOutputItemSet()
+{
+ int nRet = SfxTabPage::LEAVE_PAGE;
+ if ( OK_Impl() )
+ Ok();
+ else
+ nRet = SfxTabPage::KEEP_PAGE;
+ return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+#ifdef WNT
+int __cdecl TabDlgCmpUS_Impl( const void* p1, const void* p2 )
+#else
+#if defined(OS2) && defined(ICC)
+int _Optlink TabDlgCmpUS_Impl( const void* p1, const void* p2 )
+#else
+int TabDlgCmpUS_Impl( const void* p1, const void* p2 )
+#endif
+#endif
+
+/* [Beschreibung]
+
+ Vergleichsfunktion f"ur qsort
+*/
+
+{
+ return *(USHORT*)p1 - *(USHORT*)p2;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::ShowPage( USHORT nId )
+
+/* [Beschreibung]
+
+ Es wird die TabPage mit der "ubergebenen Id aktiviert.
+*/
+
+{
+ aTabCtrl.SetCurPageId( nId );
+ ActivatePageHdl( &aTabCtrl );
+}
+
+// -----------------------------------------------------------------------
+
+const USHORT* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
+
+/* [Beschreibung]
+
+ Bildet das Set "uber die Ranges aller Seiten des Dialogs.
+ Die Pages m"ussen die statische Methode f"ur das Erfragen ihrer
+ Ranges bei AddTabPage angegeben haben, liefern also ihre Sets onDemand.
+
+ [Querverweise]
+
+ <SfxTabDialog::AddTabPage(USHORT, CreateTabPage, GetTabPageRanges, BOOL)>
+ <SfxTabDialog::AddTabPage(USHORT, const String &, CreateTabPage, GetTabPageRanges, BOOL, USHORT)>
+ <SfxTabDialog::AddTabPage(USHORT, const Bitmap &, CreateTabPage, GetTabPageRanges, BOOL, USHORT)>
+
+ [R"uckgabewert]
+
+ Pointer auf nullterminiertes Array von USHORTs
+ Dieses Array geh"ort dem Dialog und wird beim
+ Zerst"oren des Dialogs gel"oscht.
+*/
+
+{
+ if ( pSet )
+ {
+ DBG_ERRORFILE( "Set bereits vorhanden!" );
+ return pSet->GetRanges();
+ }
+
+ if ( pRanges )
+ return pRanges;
+ SvUShorts aUS( 16, 16 );
+ USHORT nCount = pImpl->pData->Count();
+
+ USHORT i;
+ for ( i = 0; i < nCount; ++i )
+ {
+ Data_Impl* pDataObject = pImpl->pData->GetObject(i);
+
+ if ( pDataObject->fnGetRanges )
+ {
+ const USHORT* pTmpRanges = (pDataObject->fnGetRanges)();
+ const USHORT* pIter = pTmpRanges;
+
+ USHORT nLen;
+ for( nLen = 0; *pIter; ++nLen, ++pIter )
+ ;
+ aUS.Insert( pTmpRanges, nLen, aUS.Count() );
+ }
+ }
+
+ //! Doppelte Ids entfernen?
+#ifndef TF_POOLABLE
+ if ( rPool.HasMap() )
+#endif
+ {
+ nCount = aUS.Count();
+
+ for ( i = 0; i < nCount; ++i )
+ aUS[i] = rPool.GetWhich( aUS[i] );
+ }
+
+ // sortieren
+ if ( aUS.Count() > 1 )
+ qsort( (void*)aUS.GetData(),
+ aUS.Count(), sizeof(USHORT), TabDlgCmpUS_Impl );
+
+ // Ranges erzeugen
+ //!! Auskommentiert, da fehlerhaft
+ /*
+ pRanges = new USHORT[aUS.Count() * 2 + 1];
+ int j = 0;
+ i = 0;
+
+ while ( i < aUS.Count() )
+ {
+ pRanges[j++] = aUS[i];
+ // aufeinanderfolgende Zahlen
+ for( ; i < aUS.Count()-1; ++i )
+ if ( aUS[i] + 1 != aUS[i+1] )
+ break;
+ pRanges[j++] = aUS[i++];
+ }
+ pRanges[j] = 0; // terminierende NULL
+ */
+
+ pRanges = new USHORT[aUS.Count() + 1];
+ memcpy(pRanges, aUS.GetData(), sizeof(USHORT) * aUS.Count());
+ pRanges[aUS.Count()] = 0;
+ return pRanges;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxTabDialog::SetInputSet( const SfxItemSet* pInSet )
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann nachtr"aglich der Input-Set initial oder
+ neu gesetzt werden.
+*/
+
+{
+ FASTBOOL bSet = ( pSet != NULL );
+
+ pSet = pInSet;
+
+ if ( !bSet && !pExampleSet && !pOutSet )
+ {
+ pExampleSet = new SfxItemSet( *pSet );
+ pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
+ }
+}
+
+
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
new file mode 100644
index 000000000000..57ba6c5d519f
--- /dev/null
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -0,0 +1,2644 @@
+/*************************************************************************
+ *
+ * $RCSfile: templdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MENU_HXX //autogen
+#include <vcl/menu.hxx>
+#endif
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _EMBOBJ_HXX //autogen
+#include <so3/embobj.hxx>
+#endif
+#ifndef _SFXSTYLE_HXX //autogen
+#include <svtools/style.hxx>
+#endif
+#ifndef _IFACE_HXX //autogen
+#include <so3/iface.hxx>
+#endif
+#pragma hdrstop
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+#include <sfxhelp.hxx>
+#include "app.hxx"
+#include "dispatch.hxx"
+#include "bindings.hxx"
+#include "templdlg.hxx"
+#include "templdgi.hxx"
+#include "tplcitem.hxx"
+#include "sfxtypes.hxx"
+#include "styfitem.hxx"
+#include "objsh.hxx"
+#include "viewsh.hxx"
+#include "newstyle.hxx"
+#include "tplpitem.hxx"
+#include "sfxresid.hxx"
+
+#include "templdlg.hrc"
+#include "sfx.hrc"
+#include "dialog.hrc"
+#include "arrdecl.hxx"
+#include "fltfnc.hxx"
+#include "docfilt.hxx"
+
+#include "docvor.hxx"
+#include "doctempl.hxx"
+#include "module.hxx"
+#include "imgmgr.hxx"
+#include "helpid.hrc"
+#include "appdata.hxx"
+#include <objshimp.hxx>
+
+#include "viewfrm.hxx"
+
+//=========================================================================
+
+// Fenster wird ab jetzt dynamisch erstellt. Daher hier R"ander usw.
+
+#define SFX_TEMPLDLG_HFRAME 3
+#define SFX_TEMPLDLG_VTOPFRAME 3
+
+#ifdef MAC
+#define SFX_TEMPLDLG_VBOTFRAME 8
+#else
+#define SFX_TEMPLDLG_VBOTFRAME 3
+#endif
+
+#define SFX_TEMPLDLG_MIDHSPACE 3
+#define SFX_TEMPLDLG_MIDVSPACE 3
+#define SFX_TEMPLDLG_FILTERHEIGHT 100
+
+static USHORT nLastItemId = USHRT_MAX;
+
+//=========================================================================
+
+TYPEINIT0(SfxCommonTemplateDialog_Impl);
+TYPEINIT1(SfxTemplateDialog_Impl,SfxCommonTemplateDialog_Impl);
+TYPEINIT1(SfxTemplateCatalog_Impl,SfxCommonTemplateDialog_Impl);
+
+SFX_IMPL_DOCKINGWINDOW(SfxTemplateDialogWrapper, SID_STYLE_DESIGNER)
+
+//-------------------------------------------------------------------------
+
+// Redirektionsfunktionen
+
+SfxTemplateDialog::SfxTemplateDialog
+(
+ SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window *pParent
+)
+
+/* [Beschreibung]
+ Gestalterklasse.
+*/
+ : SfxDockingWindow( pBindings, pCW, pParent, SfxResId(DLG_STYLE_DESIGNER) ),
+ pImpl(0)
+{
+ pImpl=new SfxTemplateDialog_Impl(pParent, pBindings, this);
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateDialog::~SfxTemplateDialog()
+{
+ delete pImpl;
+}
+
+ISfxTemplateCommon* SfxTemplateDialog::GetISfxTemplateCommon()
+{
+ return pImpl->GetISfxTemplateCommon();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog::Update()
+{
+ pImpl->Update();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog::Resize()
+{
+ if(pImpl)
+ pImpl->Resize();
+ SfxDockingWindow::Resize();
+}
+
+
+//-------------------------------------------------------------------------
+
+SfxChildAlignment SfxTemplateDialog::CheckAlignment(SfxChildAlignment eActAlign,SfxChildAlignment eAlign)
+{
+ switch (eAlign)
+ {
+ case SFX_ALIGN_TOP:
+ case SFX_ALIGN_HIGHESTTOP:
+ case SFX_ALIGN_LOWESTTOP:
+ case SFX_ALIGN_BOTTOM:
+ case SFX_ALIGN_LOWESTBOTTOM:
+ case SFX_ALIGN_HIGHESTBOTTOM:
+ return eActAlign;
+ break;
+
+ case SFX_ALIGN_LEFT:
+ case SFX_ALIGN_RIGHT:
+ case SFX_ALIGN_FIRSTLEFT:
+ case SFX_ALIGN_LASTLEFT:
+ case SFX_ALIGN_FIRSTRIGHT:
+ case SFX_ALIGN_LASTRIGHT:
+ return eAlign;
+ break;
+
+ default:
+ return eAlign;
+ break;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateCatalog::SfxTemplateCatalog(Window *pParent, SfxBindings *pBindings)
+ : SfxModalDialog(pParent,SfxResId(RID_STYLECATALOG))
+{
+ pImpl = new SfxTemplateCatalog_Impl(pParent, pBindings, this);
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateCatalog::~SfxTemplateCatalog()
+{
+ delete pImpl;
+}
+
+//-------------------------------------------------------------------------
+
+void DropListBox_Impl::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ nModifier = rMEvt.GetModifier();
+ SvTreeListBox::MouseButtonDown( rMEvt );
+}
+
+
+BOOL DropListBox_Impl::QueryDrop( DropEvent& rEvt )
+
+/* [Beschreibung ]
+
+ Droppen eigentlich immer dann erlaubt, wenn von den selektieren
+ Objekten ine Stylesheet erstellt werden kann und der Dragvorgang
+ von der Selektion aus gestartet wurde.
+ Hier vereinfachend: Es liegen Daten im Clipboardformat der
+ Applikation vor. Cave mehrere Writer gleichzeitig!
+*/
+
+{
+ SvDataObjectRef xObj = SvDataObject::PasteDragServer( rEvt );
+ SvObjectDescriptor aObj( xObj );
+ SfxObjectShell* pDocShell = pDialog->GetObjectShell();
+ if ( pDocShell && aObj.GetClassName() == pDocShell->GetFactory() )
+ {
+ if( rEvt.IsDefaultAction() )
+ rEvt.SetAction( DROP_COPY );
+ if( rEvt.GetAction() != DROP_COPY )
+ return FALSE;
+ SvLBoxEntry *pEntry = GetEntry( rEvt.GetPosPixel(), TRUE );
+ if( pPreDropEntry && ( pEntry != pPreDropEntry || rEvt.IsLeaveWindow()) )
+ {
+ ShowTargetEmphasis( pPreDropEntry, FALSE );
+ pPreDropEntry = 0;
+ }
+ if( pEntry && pEntry!=pPreDropEntry && !rEvt.IsLeaveWindow() )
+ {
+ ShowTargetEmphasis( pEntry, TRUE );
+// MakeVisible( pEntry );
+ pPreDropEntry = pEntry;
+ }
+ if( !pEntry && pDialog->bNewByExampleDisabled ||
+ pEntry && pDialog->bUpdateByExampleDisabled )
+ return FALSE;
+ else
+ return TRUE;
+ }
+ return SvTreeListBox::QueryDrop( rEvt );
+}
+
+//-------------------------------------------------------------------------
+
+BOOL DropListBox_Impl::Drop( const DropEvent& rEvt )
+{
+ BOOL bRet = TRUE;
+ SvDataObjectRef xObj = SvDataObject::PasteDragServer( rEvt );
+ SvObjectDescriptor aObj( xObj );
+ SfxObjectShell* pDocShell = pDialog->GetObjectShell();
+ if ( pDocShell && aObj.GetClassName() == pDocShell->GetFactory() )
+ {
+ SvLBoxEntry *pEntry = GetEntry( rEvt.GetPosPixel(), TRUE );
+ if( pEntry && pEntry!=pPreDropEntry )
+ {
+ ShowTargetEmphasis( pEntry, FALSE );
+ }
+ if( pEntry )
+ {
+ pDialog->SelectStyle( GetEntryText( pEntry) );
+ pDialog->ActionSelect( SID_STYLE_UPDATE_BY_EXAMPLE );
+ }
+ else
+ {
+ pDialog->ActionSelect( SID_STYLE_NEW_BY_EXAMPLE );
+ }
+ }
+ else
+ bRet = SvTreeListBox::Drop( rEvt );
+ return bRet;
+}
+
+//-------------------------------------------------------------------------
+
+
+SfxActionListBox::SfxActionListBox
+(
+ SfxCommonTemplateDialog_Impl* pParent,
+ WinBits nWinBits
+)
+
+/* [Beschreibung]
+
+ ListBox- Klasse, die im Command-Handler ein PopupMenu (Gestalter
+ spezifisch) startet.
+
+*/
+
+: DropListBox_Impl(pParent->GetWindow(), nWinBits, pParent)
+
+{
+}
+
+//-------------------------------------------------------------------------
+
+SfxActionListBox::SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent,
+ const ResId &rResId) :
+ DropListBox_Impl(pParent->GetWindow(), rResId, pParent)
+{
+}
+
+//-------------------------------------------------------------------------
+
+void SfxActionListBox::Command( const CommandEvent& rCEvt )
+{
+ if ( COMMAND_CONTEXTMENU == rCEvt.GetCommand() )
+ pDialog->ExecuteContextMenu_Impl( rCEvt.GetMousePosPixel(), this );
+ else
+ DropListBox_Impl::Command( rCEvt );
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateDialogWrapper::SfxTemplateDialogWrapper(Window *pParent,
+ USHORT nId, SfxBindings *p, SfxChildWinInfo *pInfo) :
+ SfxChildWindow(pParent, nId)
+{
+ SfxTemplateDialog *pWin = new SfxTemplateDialog(p, this, pParent);
+ pWindow = pWin;
+ eChildAlignment = SFX_ALIGN_NOALIGNMENT;
+ Point aEmptyPoint;
+
+ Rectangle aRect( aEmptyPoint, pParent->GetOutputSizePixel() );
+ Size aSize = aRect.GetSize();
+ Point aPoint = aRect.TopLeft();
+ Size aWinSize = pWin->GetSizePixel();
+ aPoint.X() += aSize.Width() - aWinSize.Width() - 20;
+ aPoint.Y() += aSize.Height() / 2 - aWinSize.Height() / 2;
+ pWin->SetFloatingPos( aPoint );
+
+ pWin->Initialize( pInfo );
+ pWin->SetMinOutputSizePixel(pWin->pImpl->GetMinOutputSizePixel());
+}
+
+//=========================================================================
+SV_DECL_PTRARR_DEL(ExpandedEntries, StringPtr,16,8)
+SV_IMPL_PTRARR(ExpandedEntries, StringPtr)
+
+
+/* [Beschreibung]
+
+ TreeListBox- Klasse f"ur die Anzeige der hierarchischen View
+ der Vorlagen
+
+*/
+class StyleTreeListBox_Impl: public DropListBox_Impl
+{
+ SvLBoxEntry *pCurEntry;
+ Link aDoubleClickLink;
+ Link aDropLink;
+ String aParent;
+ String aStyle;
+ SfxCommonTemplateDialog_Impl* pCommon;
+protected:
+
+ virtual void Command( const CommandEvent& rMEvt );
+ virtual BOOL DoubleClickHdl();
+ virtual long ExpandingHdl();
+ virtual void ExpandedHdl();
+ virtual BOOL NotifyMoving(SvLBoxEntry* pTarget,
+ SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent,
+ ULONG& rNewChildPos);
+public:
+ StyleTreeListBox_Impl( SfxCommonTemplateDialog_Impl* pParent, WinBits nWinStyle = 0);
+ void SetDoubleClickHdl(const Link &rLink) { aDoubleClickLink = rLink; }
+ void SetDropHdl(const Link &rLink) { aDropLink = rLink; }
+ const String &GetParent() const { return aParent; }
+ const String &GetStyle() const { return aStyle; }
+ void MakeExpanded_Impl(ExpandedEntries& rEntries) const;
+};
+
+//-------------------------------------------------------------------------
+
+
+void StyleTreeListBox_Impl::MakeExpanded_Impl(ExpandedEntries& rEntries) const
+{
+ SvLBoxEntry *pEntry;
+ USHORT nCount=0;
+ for(pEntry=(SvLBoxEntry*)FirstVisible();pEntry;pEntry=(SvLBoxEntry*)NextVisible(pEntry))
+ {
+ if(IsExpanded(pEntry))
+ {
+ StringPtr pString=new String(GetEntryText(pEntry));
+ rEntries.Insert(pString,nCount++);
+ }
+ }
+}
+
+
+BOOL StyleTreeListBox_Impl::DoubleClickHdl()
+
+/* [Beschreibung]
+
+
+ DoubleClick-Handler; ruft entsprechenden Link.
+ Virtuelle Methode aus SV.
+
+*/
+{
+ aDoubleClickLink.Call(this);
+ return FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+void StyleTreeListBox_Impl::Command( const CommandEvent& rCEvt )
+
+/* [Beschreibung]
+
+ Command Handler; dieser executed ein PopupMenu (Gestalter
+ spezifisch).
+ Virtuelle Methode aus SV.
+
+*/
+{
+ if(COMMAND_CONTEXTMENU == rCEvt.GetCommand())
+// pCommon->ExecuteContextMenu_Impl(OutputToScreenPixel(rCEvt.GetMousePosPixel()));
+ pCommon->ExecuteContextMenu_Impl( rCEvt.GetMousePosPixel(), this );
+ else
+ SvTreeListBox::Command(rCEvt);
+}
+
+//-------------------------------------------------------------------------
+
+BOOL StyleTreeListBox_Impl::NotifyMoving(SvLBoxEntry* pTarget,
+ SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent,
+ ULONG& lPos)
+/* [Beschreibung]
+
+ NotifyMoving Handler; dieser leitet per Link das Event an den Dialog
+ weiter.
+ Virtuelle Methode aus SV.
+
+*/
+{
+ const International aInter(Application::GetAppInternational());
+ if(!pTarget || !pEntry)
+ return FALSE;
+ aParent = GetEntryText(pTarget);
+ aStyle = GetEntryText(pEntry);
+ const BOOL bRet = (BOOL)aDropLink.Call(this);
+ rpNewParent = pTarget;
+ lPos=0;
+ for(SvLBoxEntry *pTmpEntry=FirstChild(pTarget);
+ pTmpEntry && COMPARE_LESS==aInter.Compare(
+ GetEntryText(pTmpEntry),GetEntryText(pEntry));
+ pTmpEntry=NextSibling(pTmpEntry),lPos++);
+
+ return bRet? (BOOL)2: FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+long StyleTreeListBox_Impl::ExpandingHdl()
+
+/* [Beschreibung]
+
+ ExpandingHdl Handler; der aktuelle Eintrag wird gemerkt.
+ Virtuelle Methode aus SV.
+
+ [Querverweise]
+ <StyleTreeListBox_Impl::ExpandedHdl()>
+
+*/
+{
+ pCurEntry = GetCurEntry();
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+void StyleTreeListBox_Impl::ExpandedHdl()
+
+/* [Beschreibung]
+
+ ExpandedHdl Handler;
+ Virtuelle Methode aus SV.
+
+ [Querverweise]
+ <StyleTreeListBox_Impl::ExpandingHdl()>
+
+*/
+
+{
+ SvLBoxEntry *pEntry = GetHdlEntry();
+ if(!IsExpanded(pEntry) && pCurEntry != GetCurEntry())
+ SelectAll( FALSE );
+ pCurEntry = 0;
+}
+
+//-------------------------------------------------------------------------
+
+StyleTreeListBox_Impl::StyleTreeListBox_Impl(
+ SfxCommonTemplateDialog_Impl* pParent, WinBits nWinStyle) :
+ DropListBox_Impl(pParent->GetWindow(), nWinStyle, pParent),
+ pCurEntry(0),
+ pCommon(pParent)
+
+/* [Beschreibung]
+
+ Konstruktor StyleTreeListBox_Impl
+
+*/
+
+{
+ SetDragOptions(DROP_MOVE);
+}
+
+
+//-------------------------------------------------------------------------
+//-------------------------------------------------------------------------
+
+class StyleTreeArr_Impl;
+
+
+/* [Beschreibung]
+
+ Interne Struktur f"ur den Aufbau der hierarchischen View
+
+*/
+
+struct StyleTree_Impl
+{
+ String aName;
+ String aParent;
+ StyleTreeArr_Impl *pChilds;
+ BOOL bIsExpanded;
+ BOOL HasParent() const { return aParent.Len() != 0; }
+
+ StyleTree_Impl(const String &rName, const String &rParent):
+ aName(rName), aParent(rParent), pChilds(0), bIsExpanded(0) {}
+ ~StyleTree_Impl();
+ void Put(StyleTree_Impl* pIns, ULONG lPos=ULONG_MAX);
+ ULONG Count();
+};
+
+typedef StyleTree_Impl* StyleTree_ImplPtr;
+SV_DECL_PTRARR_DEL(StyleTreeArr_Impl, StyleTree_ImplPtr, 16, 8)
+SV_IMPL_PTRARR(StyleTreeArr_Impl, StyleTree_ImplPtr)
+
+
+ULONG StyleTree_Impl::Count()
+{
+ return pChilds ? pChilds->Count() : 0L;
+}
+
+//-------------------------------------------------------------------------
+
+StyleTree_Impl::~StyleTree_Impl()
+{
+ delete pChilds;
+}
+
+//-------------------------------------------------------------------------
+
+void StyleTree_Impl::Put(StyleTree_Impl* pIns, ULONG lPos)
+{
+ if ( !pChilds )
+ pChilds = new StyleTreeArr_Impl;
+
+ if ( ULONG_MAX == lPos )
+ lPos = pChilds->Count();
+ pChilds->Insert( pIns, (USHORT)lPos );
+}
+
+//-------------------------------------------------------------------------
+
+StyleTreeArr_Impl &MakeTree_Impl(StyleTreeArr_Impl &rArr)
+{
+ const International aInter(Application::GetAppInternational());
+ const USHORT nCount = rArr.Count();
+ // Alle unter ihren Parents einordnen
+ USHORT i;
+ for(i = 0; i < nCount; ++i)
+ {
+ StyleTree_ImplPtr pEntry = rArr[i];
+ if(pEntry->HasParent())
+ {
+ for(USHORT j = 0; j < nCount; ++j)
+ {
+ StyleTree_ImplPtr pCmp = rArr[j];
+ if(pCmp->aName == pEntry->aParent)
+ {
+ // initial sortiert einfuegen
+ USHORT ii;
+ for ( ii = 0;
+ ii < pCmp->Count() && COMPARE_LESS ==
+ aInter.Compare( (*pCmp->pChilds)[ii]->aName,
+ pEntry->aName);++ii);
+ pCmp->Put(pEntry,ii);
+ break;
+ }
+ }
+ }
+ }
+ // alle, die schon unter ihrem Parent eingeordnet wurden
+ // entfernen
+ for(i = 0; i < rArr.Count(); )
+ {
+ if(rArr[i]->HasParent())
+ rArr.Remove(i);
+ else
+ ++i;
+ }
+ return rArr;
+}
+
+//-------------------------------------------------------------------------
+
+
+inline BOOL IsExpanded_Impl( const ExpandedEntries& rEntries,
+ const String &rStr)
+{
+ USHORT nCount=rEntries.Count();
+ for(USHORT n=0;n<nCount;n++)
+ if(*rEntries[n]==rStr)
+ return TRUE;
+ return FALSE;
+}
+
+
+
+SvLBoxEntry* FillBox_Impl(SvTreeListBox *pBox,
+ StyleTree_ImplPtr pEntry,
+ const ExpandedEntries& rEntries,
+ SvLBoxEntry* pParent = 0)
+{
+ SvLBoxEntry* pNewEntry = pBox->InsertEntry(pEntry->aName, pParent);
+ const USHORT nCount = pEntry->pChilds? pEntry->pChilds->Count(): 0;
+ for(USHORT i = 0; i < nCount; ++i)
+ FillBox_Impl(pBox, (*pEntry->pChilds)[i], rEntries, pNewEntry);
+ return pNewEntry;
+}
+
+//-------------------------------------------------------------------------
+
+// Konstruktor
+
+SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, SfxDockingWindow* pW ) :
+
+ aISfxTemplateCommon ( this ),
+ pBindings ( pB ),
+ pWindow ( pW ),
+ pModule ( NULL ),
+ pTimer ( NULL ),
+ pStyleSheetPool ( NULL ),
+ pTreeBox ( NULL ),
+ pCurObjShell ( NULL ),
+
+ aFmtLb ( this, WB_BORDER | WB_TABSTOP | WB_SORT ),
+ aFilterLb ( pW, WB_BORDER | WB_DROPDOWN | WB_TABSTOP ),
+
+ nActFamily ( 0xffff ),
+ nActFilter ( 0 ),
+ nAppFilter ( 0 ),
+
+ bDontUpdate ( FALSE ),
+ bIsWater ( FALSE ),
+ bEnabled ( TRUE ),
+ bUpdate ( FALSE ),
+ bUpdateFamily ( FALSE ),
+ bCanEdit ( FALSE ),
+ bCanDel ( FALSE ),
+ bCanNew ( TRUE ),
+ bWaterDisabled ( FALSE ),
+ bNewByExampleDisabled ( FALSE ),
+ bUpdateByExampleDisabled( FALSE ),
+ bTreeDrag ( TRUE ),
+ bHierarchical ( FALSE ),
+ bBindingUpdate ( TRUE )
+
+{
+ aFmtLb.SetHelpId( HID_TEMPLATE_FMT );
+ aFilterLb.SetHelpId( HID_TEMPLATE_FILTER );
+ aFmtLb.SetWindowBits( WB_SORT );
+ Font aFont = aFmtLb.GetFont();
+ aFont.SetWeight( WEIGHT_NORMAL );
+#ifdef MAC
+ aFont.SetName( String::CreateFromAscii( "Geneva" ) );
+ aFont.SetSize( Size( 0, 10 ) );
+#endif
+ aFmtLb.SetFont( aFont );
+}
+
+//-------------------------------------------------------------------------
+
+SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog* pW ) :
+
+ aISfxTemplateCommon ( this ),
+ pBindings ( pB ),
+ pWindow ( pW ),
+ pModule ( NULL ),
+ pTimer ( NULL ),
+ pStyleSheetPool ( NULL ),
+ pTreeBox ( NULL ),
+ pCurObjShell ( NULL ),
+
+ aFmtLb ( this, SfxResId( BT_VLIST ) ),
+ aFilterLb ( pW, SfxResId( BT_FLIST ) ),
+
+ nActFamily ( 0xffff ),
+ nActFilter ( 0 ),
+ nAppFilter ( 0 ),
+
+ bDontUpdate ( FALSE ),
+ bIsWater ( FALSE ),
+ bEnabled ( TRUE ),
+ bUpdate ( FALSE ),
+ bUpdateFamily ( FALSE ),
+ bCanEdit ( FALSE ),
+ bCanDel ( FALSE ),
+ bCanNew ( TRUE ),
+ bWaterDisabled ( FALSE ),
+ bNewByExampleDisabled ( FALSE ),
+ bUpdateByExampleDisabled( FALSE ),
+ bTreeDrag ( TRUE ),
+ bHierarchical ( FALSE ),
+ bBindingUpdate ( TRUE )
+
+{
+ aFmtLb.SetWindowBits( WB_SORT );
+}
+
+//-------------------------------------------------------------------------
+
+USHORT SfxCommonTemplateDialog_Impl::StyleNrToInfoOffset(USHORT nId)
+{
+ const SfxStyleFamilyItem *pItem=pStyleFamilies->GetObject(nId);
+ return SfxFamilyIdToNId(pItem->GetFamily())-1;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::EnableEdit(BOOL bEnable)
+{
+ SfxCommonTemplateDialog_Impl::EnableEdit( bEnable );
+ if( !bEnable || !bUpdateByExampleDisabled )
+ EnableItem( SID_STYLE_UPDATE_BY_EXAMPLE, bEnable);
+}
+
+//-------------------------------------------------------------------------
+
+
+USHORT SfxCommonTemplateDialog_Impl::InfoOffsetToStyleNr(USHORT nId)
+{
+ for ( USHORT i=0;i<pStyleFamilies->Count();i++ )
+ if ( SfxFamilyIdToNId(pStyleFamilies->GetObject(i)->GetFamily()) == nId+1 )
+ return i;
+ DBG_ERROR("Style Nummer nicht gefunden");
+ return 0;
+}
+
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::ReadResource()
+{
+ // globale Benutzer-Resource auslesen
+ USHORT i;
+ for(i = 0; i < MAX_FAMILIES; ++i)
+ pFamilyState[i] = 0;
+
+ SfxViewFrame* pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ pCurObjShell = pViewFrame->GetObjectShell();
+ ResMgr* pMgr = pCurObjShell ? pCurObjShell->GetResMgr() : NULL;
+ ResId aFamId( DLG_STYLE_DESIGNER, pMgr );
+ aFamId.SetRT(RSC_SFX_STYLE_FAMILIES);
+ if( !pMgr || !pMgr->IsAvailable( aFamId ) )
+ pStyleFamilies = new SfxStyleFamilies;
+ else
+ pStyleFamilies = new SfxStyleFamilies( aFamId );
+
+ nActFilter = pCurObjShell ? pCurObjShell->Get_Impl()->nStyleFilter : 0xFFFF;
+
+ // Einfuegen in die Toolbox
+ // umgekehrte Reihenfolge, da immer vorne eingefuegt wird.
+ USHORT nCount = pStyleFamilies->Count();
+
+ pBindings->ENTERREGISTRATIONS();
+
+ for(i = 0; i < nCount; ++i)
+ {
+ USHORT nSlot = 0;
+ switch((USHORT)pStyleFamilies->GetObject(i)->GetFamily())
+ {
+ case SFX_STYLE_FAMILY_CHAR: nSlot = SID_STYLE_FAMILY1; break;
+ case SFX_STYLE_FAMILY_PARA: nSlot = SID_STYLE_FAMILY2; break;
+ case SFX_STYLE_FAMILY_FRAME:nSlot = SID_STYLE_FAMILY3; break;
+ case SFX_STYLE_FAMILY_PAGE: nSlot = SID_STYLE_FAMILY4; break;
+ case SFX_STYLE_FAMILY_PSEUDO: nSlot = SID_STYLE_FAMILY5; break;
+ default: DBG_ERROR("unbekannte StyleFamily"); break;
+ }
+ pBoundItems[i] =
+ new SfxTemplateControllerItem(nSlot, *this, *pBindings);
+ }
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_WATERCAN, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_NEW_BY_EXAMPLE, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_UPDATE_BY_EXAMPLE, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_NEW, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_DRAGHIERARCHIE, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_EDIT, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_DELETE, *this, *pBindings);
+ pBoundItems[i++] = new SfxTemplateControllerItem(
+ SID_STYLE_FAMILY, *this, *pBindings);
+ pBindings->LEAVEREGISTRATIONS();
+
+ for(; i < COUNT_BOUND_FUNC; ++i)
+ pBoundItems[i] = 0;
+
+ StartListening(*pBindings);
+
+//In umgekehrter Reihenfolge des Auftretens in den Stylefamilies einfuegen.
+//Das ist fuer den Toolbar des Gestalters. Die Listbox des Kataloges achtet
+//selbst auf korrekte Reihenfolge.
+
+//Reihenfolgen: Reihenfolge in der Resource = Reihenfolge in Toolbar bzw.
+//Listbox.
+//Reihenfolge aufsteigender SIDs: Niedrige SIDs werden als erstes angezeigt,
+//wenn Vorlagen mehrerer Familien aktiv sind.
+
+ for( ; nCount--; )
+ {
+ const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject( nCount );
+ USHORT nId = SfxFamilyIdToNId( (USHORT) pItem->GetFamily() );
+ InsertFamilyItem( nId, pItem );
+ }
+
+ Resize();
+
+ USHORT nStart = SID_STYLE_FAMILY1;
+ USHORT nEnd = SID_STYLE_FAMILY4;
+
+ for ( i = nStart; i <= nEnd; i++ )
+ pBindings->Update(i);
+
+ pModule = pCurObjShell ? pCurObjShell->GetModule() : NULL;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::ClearResource()
+{
+ ClearFamilyList();
+ DELETEX(pStyleFamilies);
+ USHORT i;
+ for ( i = 0; i < MAX_FAMILIES; ++i )
+ DELETEX(pFamilyState[i]);
+ for ( i = 0; i < COUNT_BOUND_FUNC; ++i )
+ delete pBoundItems[i];
+ pCurObjShell = NULL;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::Initialize()
+{
+ // globale Benutzer-Resource auslesen
+ ReadResource();
+ pBindings->Invalidate( SID_STYLE_FAMILY );
+ pBindings->Update( SID_STYLE_FAMILY );
+ Update_Impl();
+
+ aFilterLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FilterSelectHdl ) );
+ aFmtLb.SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, ApplyHdl ) );
+ aFmtLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FmtSelectHdl ) );
+
+ aFilterLb.Show();
+ aFmtLb.Show();
+}
+
+//-------------------------------------------------------------------------
+
+SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl()
+{
+ String aEmpty;
+ if ( bIsWater )
+ Execute_Impl(SID_STYLE_WATERCAN, aEmpty, aEmpty, 0);
+ GetWindow()->Hide();
+ DELETEX(pStyleFamilies);
+ USHORT i;
+ for ( i = 0; i < MAX_FAMILIES; ++i )
+ DELETEX(pFamilyState[i]);
+ for ( i = 0; i < COUNT_BOUND_FUNC; ++i )
+ delete pBoundItems[i];
+ if ( pStyleSheetPool )
+ EndListening(*pStyleSheetPool);
+ pStyleSheetPool = NULL;
+ delete pTreeBox;
+ delete pTimer;
+}
+
+//-------------------------------------------------------------------------
+
+USHORT SfxCommonTemplateDialog_Impl::SfxFamilyIdToNId( USHORT nFamily )
+{
+ switch ( nFamily )
+ {
+ case SFX_STYLE_FAMILY_CHAR: return 1; break;
+ case SFX_STYLE_FAMILY_PARA: return 2; break;
+ case SFX_STYLE_FAMILY_FRAME: return 3; break;
+ case SFX_STYLE_FAMILY_PAGE: return 4; break;
+ case SFX_STYLE_FAMILY_PSEUDO: return 5; break;
+ default: return 0;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+// Hilfsfunktion: Zugriff auf aktuelles Family-Item
+const SfxStyleFamilyItem *SfxCommonTemplateDialog_Impl::GetFamilyItem_Impl() const
+{
+ const USHORT nCount = pStyleFamilies->Count();
+ for(USHORT i = 0; i < nCount; ++i)
+ {
+ const SfxStyleFamilyItem *pItem = pStyleFamilies->GetObject(i);
+// if(!pItem)continue;
+ USHORT nId = SfxFamilyIdToNId((USHORT)pItem->GetFamily());
+ if(nId == nActFamily)
+ return pItem;
+ }
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr)
+{
+ const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
+ if ( !pItem )
+ return;
+ const SfxStyleFamily eFam = pItem->GetFamily();
+ SfxStyleSheetBase* pStyle = pStyleSheetPool->Find( rStr, eFam, SFXSTYLEBIT_ALL );
+ if( pStyle )
+ EnableEdit( !(pStyle->GetMask() & SFXSTYLEBIT_READONLY) );
+
+ if ( pTreeBox )
+ {
+ if ( rStr.Len() )
+ {
+ SvLBoxEntry* pEntry = pTreeBox->First();
+ while ( pEntry )
+ {
+ if ( pTreeBox->GetEntryText( pEntry ) == rStr )
+ {
+ pTreeBox->MakeVisible( pEntry );
+ pTreeBox->Select( pEntry );
+ return;
+ }
+ pEntry = pTreeBox->Next( pEntry );
+ }
+ }
+ else
+ pTreeBox->SelectAll( FALSE );
+ }
+ else
+ {
+ BOOL bSelect = ( rStr.Len() > 0 );
+ if ( bSelect )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)aFmtLb.FirstVisible();
+ while ( pEntry && aFmtLb.GetEntryText( pEntry ) != rStr )
+ pEntry = (SvLBoxEntry*)aFmtLb.NextVisible( pEntry );
+ if ( !pEntry )
+ bSelect = FALSE;
+ else
+ {
+ aFmtLb.MakeVisible( pEntry );
+ aFmtLb.Select( pEntry );
+ FmtSelectHdl( NULL );
+ }
+ }
+
+ if ( !bSelect )
+ aFmtLb.SelectAll( FALSE );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+String SfxCommonTemplateDialog_Impl::GetSelectedEntry() const
+{
+ String aRet;
+ if ( pTreeBox )
+ {
+ SvLBoxEntry* pEntry = pTreeBox->FirstSelected();
+ if( !pEntry )
+ pEntry = aFmtLb.GetPreDropEntry();
+ if ( pEntry )
+ aRet = pTreeBox->GetEntryText( pEntry );
+ }
+ else
+ {
+ SvLBoxEntry* pEntry = aFmtLb.FirstSelected();
+ if ( pEntry )
+ aRet = aFmtLb.GetEntryText( pEntry );
+ }
+ return aRet;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::EnableTreeDrag( BOOL bEnable )
+{
+ if ( pStyleSheetPool )
+ {
+ SfxStyleSheetBase* pStyle = pStyleSheetPool->First();
+ if ( pTreeBox )
+ {
+ if ( pStyle && pStyle->HasParentSupport() && bEnable )
+ pTreeBox->SetDragDropMode(SV_DRAGDROP_CTRL_MOVE);
+ else
+ pTreeBox->SetDragDropMode(SV_DRAGDROP_NONE);
+ }
+ }
+ bTreeDrag = bEnable;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::FillTreeBox()
+{
+ DBG_ASSERT(pTreeBox, "FillTreeBox ohne TreeBox");
+ if(pStyleSheetPool && nActFamily != 0xffff)
+ {
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ pStyleSheetPool->SetSearchMask(pItem->GetFamily(), SFXSTYLEBIT_ALL);
+ StyleTreeArr_Impl aArr;
+ SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
+ if(pStyle && pStyle->HasParentSupport() && bTreeDrag )
+ pTreeBox->SetDragDropMode(SV_DRAGDROP_CTRL_MOVE);
+ else
+ pTreeBox->SetDragDropMode(SV_DRAGDROP_NONE);
+ while(pStyle)
+ {
+ StyleTree_ImplPtr pNew =
+ new StyleTree_Impl(pStyle->GetName(), pStyle->GetParent());
+ aArr.Insert(pNew, aArr.Count());
+ pStyle = pStyleSheetPool->Next();
+ }
+ MakeTree_Impl(aArr);
+ ExpandedEntries aEntries;
+ if(pTreeBox)
+ ((const StyleTreeListBox_Impl *)pTreeBox)->
+ MakeExpanded_Impl( aEntries);
+ pTreeBox->SetUpdateMode( FALSE );
+ pTreeBox->Clear();
+ const USHORT nCount = aArr.Count();
+ for(USHORT i = 0; i < nCount; ++i)
+ FillBox_Impl(pTreeBox, aArr[i], aEntries);
+
+// EnableEdit(FALSE);
+ EnableItem(SID_STYLE_WATERCAN,FALSE);
+
+ SfxTemplateItem *pState = pFamilyState[nActFamily-1];
+
+ if(nCount)
+ pTreeBox->Expand(pTreeBox->First());
+
+ for(SvLBoxEntry *pEntry=pTreeBox->First();
+ pEntry;pEntry=pTreeBox->Next(pEntry))
+ {
+ if(IsExpanded_Impl(aEntries,pTreeBox->GetEntryText(pEntry)))
+ pTreeBox->Expand(pEntry);
+ }
+
+ if(pState) //Aktuellen Eintrag selektieren
+ {
+ const String aStyle(pState->GetStyleName());
+ SelectStyle(aStyle);
+ }
+ EnableDelete();
+
+ pTreeBox->SetUpdateMode( TRUE );
+ }
+}
+
+//-------------------------------------------------------------------------
+inline BOOL SfxCommonTemplateDialog_Impl::HasSelectedStyle() const
+{
+ return pTreeBox? pTreeBox->FirstSelected() != 0:
+ aFmtLb.GetSelectionCount() != 0;
+}
+
+
+//-------------------------------------------------------------------------
+
+// intern: Aktualisierung der Anzeige
+void SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(USHORT nFlags) // Flags, was aktualisiert werden soll (s.o.)
+{
+ DBG_ASSERT(nFlags, "nichts zu tun");
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ if (!pItem)
+ {
+ // Ist beim Vorlagenkatalog der Fall
+ SfxTemplateItem **ppItem = pFamilyState;
+ const USHORT nFamilyCount = pStyleFamilies->Count();
+ USHORT n;
+ for(n=0;n<nFamilyCount;n++)
+ if(ppItem[StyleNrToInfoOffset(n)])break;
+ if ( n == nFamilyCount )
+ // passiert gelegentlich bei Beichten, Formularen etc.; wei der Teufel warum
+ return;
+ ppItem+=StyleNrToInfoOffset(n);
+ nAppFilter = (*ppItem)->GetValue();
+ FamilySelect( StyleNrToInfoOffset(n)+1 );
+ pItem = GetFamilyItem_Impl();
+ }
+
+ const SfxStyleFamily eFam = pItem->GetFamily();
+
+ SfxFilterTupel *pT = pItem->GetFilterList().GetObject(nActFilter);
+ USHORT nFilter = pT ? pItem->GetFilterList().GetObject(nActFilter)->nFlags : 0;
+ if(!nFilter) // automatisch
+ nFilter = nAppFilter;
+
+ DBG_ASSERT(pStyleSheetPool, "kein StyleSheetPool");
+ if(pStyleSheetPool)
+ {
+ pStyleSheetPool->SetSearchMask(eFam, nFilter);
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ if((nFlags & UPDATE_FAMILY) == UPDATE_FAMILY)
+ {
+ if(ISA(SfxTemplateDialog_Impl))
+ ((DockingWindow* )GetWindow())->SetText(
+ pItem->GetText()); // Titel setzen
+ CheckItem(nActFamily, TRUE); // Button in Toolbox checken
+ aFilterLb.SetUpdateMode(FALSE);
+ aFilterLb.Clear();
+ const SfxStyleFilter& rFilter = pItem->GetFilterList();
+ for(USHORT i = 0; i < rFilter.Count(); ++i)
+ aFilterLb.InsertEntry(rFilter.GetObject(i)->aName);
+ if(nActFilter < aFilterLb.GetEntryCount())
+ aFilterLb.SelectEntryPos(nActFilter);
+ else
+ aFilterLb.SelectEntryPos(nActFilter = 0);
+ aFilterLb.InsertEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)));
+
+ if(pTreeBox)
+ aFilterLb.SelectEntry(String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)));
+ //Falls in Treedarstellung wieder Family Hierarchie selektieren
+
+ aFilterLb.SetUpdateMode(TRUE);
+ }
+ else
+ {
+ if( nActFilter < aFilterLb.GetEntryCount() )
+ aFilterLb.SelectEntryPos(nActFilter);
+ else
+ aFilterLb.SelectEntryPos( nActFilter = 0 );
+ }
+
+ if(nFlags & UPDATE_FAMILY_LIST)
+ {
+// EnableEdit(FALSE);
+ EnableItem(SID_STYLE_WATERCAN,FALSE);
+
+ SfxStyleSheetBase *pStyle = pStyleSheetPool->First();
+ SvLBoxEntry* pEntry = aFmtLb.First();
+ SvStringsDtor aStrings;
+
+ while( pStyle )
+ {
+ //Bubblesort
+ for( USHORT nPos = aStrings.Count() + 1 ; nPos-- ;)
+ {
+ if( !nPos || *aStrings[nPos-1] < pStyle->GetName() )
+ {
+ // Die Namen stehen in den Styles, also nicht kopieren
+ // Reingefallen!: Writer hat insgesamt nur 1 Style
+ aStrings.Insert(
+ new String( pStyle->GetName() ), nPos );
+ break;
+ }
+ }
+ pStyle = pStyleSheetPool->Next();
+ }
+
+
+ USHORT nCount = aStrings.Count();
+ USHORT nPos = 0;
+ while( nPos < nCount && pEntry &&
+ *aStrings[ nPos ] == aFmtLb.GetEntryText( pEntry ) )
+ {
+ nPos++;
+ pEntry = aFmtLb.Next( pEntry );
+ }
+
+ if( nPos < nCount || pEntry )
+ {
+ // Box mit den Vorlagen fuellen
+ aFmtLb.SetUpdateMode(FALSE);
+ aFmtLb.Clear();
+
+ nPos = 0;
+ while( nPos < nCount )
+ aFmtLb.InsertEntry( *aStrings.GetObject( nPos++ ));
+ aFmtLb.SetUpdateMode(TRUE);
+ }
+ // aktuelle Vorlage anzeigen
+ SfxTemplateItem *pState = pFamilyState[nActFamily-1];
+ if(pState)
+ {
+ const String aStyle(pState->GetStyleName());
+ SelectStyle(aStyle);
+ }
+ EnableDelete();
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+// Aktualisierung Anzeige: Gie\skanne an/aus
+void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem)
+{
+// EnableItem(SID_STYLE_WATERCAN, pItem != 0);
+ bWaterDisabled = pItem == 0;
+
+ if(pItem)
+ {
+ CheckItem(SID_STYLE_WATERCAN, pItem->GetValue());
+ EnableItem( SID_STYLE_WATERCAN, TRUE );
+ }
+ else
+ EnableItem(SID_STYLE_WATERCAN, FALSE);
+
+//Waehrend Giesskannenmodus Statusupdates ignorieren.
+
+ USHORT nCount=pStyleFamilies->Count();
+ pBindings->EnterRegistrations();
+ for(USHORT n=0; n<nCount; n++)
+ {
+ SfxControllerItem *pCItem=pBoundItems[n];
+ BOOL bChecked = pItem && pItem->GetValue();
+ if( pCItem->IsBound() == bChecked )
+ if( !bChecked )
+ pCItem->ReBind();
+ else
+ pCItem->UnBind();
+ }
+ pBindings->LeaveRegistrations();
+}
+
+//-------------------------------------------------------------------------
+
+// Item mit dem Status einer Family wird kopiert und gemerkt
+// (Aktualisierung erfolgt, wenn alle Stati aktualisiert worden sind.
+// Siehe auch: <SfxBindings::AddDoneHdl(const Link &)>
+
+void SfxCommonTemplateDialog_Impl::SetFamilyState( USHORT nSlotId, const SfxTemplateItem* pItem )
+{
+ USHORT nIdx = nSlotId - SID_STYLE_FAMILY_START;
+ DELETEZ(pFamilyState[nIdx]);
+ if ( pItem )
+ pFamilyState[nIdx] = new SfxTemplateItem(*pItem);
+ bUpdate = TRUE;
+
+ // Wenn verwendete Vorlagen ( wie zum Teufel findet man das heraus ?? )
+ bUpdateFamily = TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+// Benachrichtigung durch SfxBindings, da"s die Aktualisierung
+// beendet ist. St"o\st die Aktualisierung der Anzeige an.
+
+void SfxCommonTemplateDialog_Impl::Update_Impl()
+{
+ BOOL bDocChanged=FALSE;
+ SfxStyleSheetBasePool *pNewPool = 0;
+ SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
+ if( pDocShell )
+ pNewPool = pDocShell->GetStyleSheetPool();
+
+ if ( pNewPool != pStyleSheetPool && pDocShell )
+ {
+ SfxModule* pNewModule = pDocShell->GetModule();
+ if( pNewModule && pNewModule != pModule )
+ {
+ ClearResource();
+ ReadResource();
+ }
+ if ( pStyleSheetPool )
+ {
+ EndListening(*pStyleSheetPool);
+ pStyleSheetPool = 0;
+ }
+
+ if ( pNewPool )
+ {
+ StartListening(*pNewPool);
+ pStyleSheetPool = pNewPool;
+ bDocChanged=TRUE;
+ }
+// InvalidateBindings();
+ }
+
+ if (bUpdateFamily)
+ UpdateFamily_Impl();
+
+ USHORT i;
+ for(i = 0; i < MAX_FAMILIES; ++i)
+ if(pFamilyState[i])
+ break;
+ if(i == MAX_FAMILIES || !pNewPool)
+ // nichts erlaubt
+ return;
+
+ SfxTemplateItem *pItem = 0;
+ // aktueller Bereich nicht innerhalb der erlaubten Bereiche
+ // oder Default
+ if(nActFamily == 0xffff || 0 == (pItem = pFamilyState[nActFamily-1] ) )
+ {
+ CheckItem(nActFamily, FALSE);
+ SfxTemplateItem **ppItem = pFamilyState;
+ const USHORT nFamilyCount = pStyleFamilies->Count();
+ USHORT n;
+ for(n=0;n<nFamilyCount;n++)
+ if(ppItem[StyleNrToInfoOffset(n)])break;
+ ppItem+=StyleNrToInfoOffset(n);
+
+ nAppFilter = (*ppItem)->GetValue();
+ FamilySelect( StyleNrToInfoOffset(n)+1 );
+
+ pItem = *ppItem;
+ }
+ else if( bDocChanged )
+ {
+ // andere DocShell -> alles neu
+ CheckItem( nActFamily, TRUE );
+ nActFilter = pDocShell->Get_Impl()->nStyleFilter;
+ nAppFilter = pItem->GetValue();
+ if(!pTreeBox)
+ {
+ UpdateStyles_Impl(UPDATE_FAMILY_LIST);
+ }
+ else
+ FillTreeBox();
+ }
+ else
+ {
+ // anderer Filter fuer automatisch
+ CheckItem( nActFamily, TRUE );
+ const SfxStyleFamilyItem *pStyleItem = GetFamilyItem_Impl();
+#ifdef DEBUG
+ SfxFilterTupel *pT = pStyleItem->GetFilterList().GetObject(nActFilter);
+#endif
+ if(0 == pStyleItem->GetFilterList().GetObject(nActFilter)->nFlags
+ && nAppFilter != pItem->GetValue())
+ {
+ nAppFilter = pItem->GetValue();
+ if(!pTreeBox)
+ UpdateStyles_Impl(UPDATE_FAMILY_LIST);
+ else
+ FillTreeBox();
+ }
+ else
+ nAppFilter = pItem->GetValue();
+ }
+ const String aStyle(pItem->GetStyleName());
+ SelectStyle(aStyle);
+ EnableDelete();
+ EnableNew( bCanNew );
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, pTim )
+{
+ if(!bDontUpdate)
+ {
+ bDontUpdate=TRUE;
+ if(!pTreeBox)
+ UpdateStyles_Impl(UPDATE_FAMILY_LIST);
+ else
+ {
+ FillTreeBox();
+ SfxTemplateItem *pState = pFamilyState[nActFamily-1];
+ if(pState)
+ {
+ const String aStyle(pState->GetStyleName());
+ SelectStyle(aStyle);
+ EnableDelete();
+ }
+ }
+ bDontUpdate=FALSE;
+ DELETEZ(pTimer);
+ }
+ else
+ pTimer->Start();
+ return 0;
+}
+
+
+//-------------------------------------------------------------------------
+void SfxCommonTemplateDialog_Impl::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType)
+{
+ // Aktualisierung anstossen
+ if(rHint.Type() == TYPE(SfxSimpleHint))
+ {
+ switch(((SfxSimpleHint&) rHint ).GetId())
+ {
+ case SFX_HINT_UPDATEDONE:
+ {
+ SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
+ if( bUpdate && (
+ !IsCheckedItem(SID_STYLE_WATERCAN) || pDocShell
+ && pDocShell->GetStyleSheetPool() != pStyleSheetPool) )
+ {
+ bUpdate = FALSE;
+ Update_Impl();
+ }
+ else if ( bUpdateFamily )
+ {
+ UpdateFamily_Impl();
+ }
+
+ if( pStyleSheetPool )
+ {
+ String aStr = GetSelectedEntry();
+ if( aStr.Len() && pStyleSheetPool )
+ {
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ if( !pItem ) break;
+ const SfxStyleFamily eFam = pItem->GetFamily();
+ SfxStyleSheetBase *pStyle =
+ pStyleSheetPool->Find(
+ aStr, eFam, SFXSTYLEBIT_ALL );
+ if( pStyle )
+ EnableEdit(
+ !(pStyle->GetMask() & SFXSTYLEBIT_READONLY) );
+ }
+ }
+ break;
+ }
+ // noetig, wenn zwichen Dokumenten umgeschaltet wird,
+ // aber in beiden Dokumenten die gleiche Vorlage gilt.
+ // Nicht sofort Update_Impl rufen, fr den Fall da\s eines
+ // der Dokumente ein internes InPlaceObjekt ist!
+ case SFX_HINT_DOCCHANGED:
+ bUpdate = TRUE;
+ break;
+ case SFX_HINT_DYING:
+ {
+ EndListening(*pStyleSheetPool);
+ pStyleSheetPool=0;
+ break;
+ }
+ }
+ }
+
+ // Timer nicht aufsetzen, wenn der StyleSheetPool in die Kiste geht, denn
+ // es kann sein, da\s sich ein neuer erst anmeldet, nachdem der Timer
+ // abgelaufen ist - macht sich schlecht in UpdateStyles_Impl() !
+
+ ULONG nId = ((SfxSimpleHint&) rHint).GetId();
+
+ if(!bDontUpdate && nId != SFX_HINT_DYING &&
+ (rHint.Type() == TYPE(SfxStyleSheetPoolHint)||
+ rHint.Type() == TYPE(SfxStyleSheetHint) ||
+ rHint.Type() == TYPE( SfxStyleSheetHintExtended )))
+ {
+ if(!pTimer)
+ {
+ pTimer=new Timer;
+ pTimer->SetTimeout(500);
+ pTimer->SetTimeoutHdl(LINK(this,SfxCommonTemplateDialog_Impl,TimeOut));
+ }
+ pTimer->Start();
+
+ }
+}
+
+
+//-------------------------------------------------------------------------
+
+// Anderer Filter; kann durch den Benutzer umgeschaltet werden
+// oder als Folge von Neu oder Bearbeiten, wenn die aktuelle
+// Vorlage einem anderen Filter zugewiesen wurde.
+void SfxCommonTemplateDialog_Impl::FilterSelect(
+ USHORT nEntry, // Idx des neuen Filters
+ BOOL bForce ) // Aktualisierung erzwingen, auch wenn der neue Filter gleich dem aktuellen ist
+{
+ if( nEntry != nActFilter || bForce )
+ {
+ nActFilter = nEntry;
+ SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
+ if (pDocShell)
+ pDocShell->Get_Impl()->nStyleFilter = nActFilter;
+
+ SfxStyleSheetBasePool *pOldStyleSheetPool = pStyleSheetPool;
+ pStyleSheetPool = pDocShell? pDocShell->GetStyleSheetPool(): 0;
+ if ( pOldStyleSheetPool != pStyleSheetPool )
+ {
+ if ( pOldStyleSheetPool )
+ EndListening(*pOldStyleSheetPool);
+ if ( pStyleSheetPool )
+ StartListening(*pOldStyleSheetPool);
+ }
+
+ UpdateStyles_Impl(UPDATE_FAMILY_LIST);
+ }
+}
+
+//-------------------------------------------------------------------------
+
+// Intern: Ausf"uhren von Funktionen "uber den Dispatcher
+BOOL SfxCommonTemplateDialog_Impl::Execute_Impl(
+ USHORT nId, const String &rStr, const String& rRefStr, USHORT nFamily,
+ USHORT nMask, USHORT *pIdx, const USHORT* pModifier)
+{
+ SfxDispatcher &rDispatcher = *SFX_APP()->GetDispatcher_Impl();
+ SfxStringItem aItem(nId, rStr);
+ SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily);
+ SfxUInt16Item aMask( SID_STYLE_MASK, nMask );
+ SfxStringItem aUpdName(SID_STYLE_UPD_BY_EX_NAME, rStr);
+ SfxStringItem aRefName( SID_STYLE_REFERENCE, rRefStr );
+ const SfxPoolItem* pItems[ 6 ];
+ USHORT nCount = 0;
+ if( rStr.Len() )
+ pItems[ nCount++ ] = &aItem;
+ pItems[ nCount++ ] = &aFamily;
+ if( nMask )
+ pItems[ nCount++ ] = &aMask;
+ if(SID_STYLE_UPDATE_BY_EXAMPLE == nId)
+ {
+ //Sonderloesung fuer Numerierungsupdate im Writer
+ const String aTemplName(GetSelectedEntry());
+ aUpdName.SetValue(aTemplName);
+ pItems[ nCount++ ] = &aUpdName;
+ }
+ if ( rRefStr.Len() )
+ pItems[ nCount++ ] = &aRefName;
+
+ pItems[ nCount++ ] = 0;
+
+ const SfxPoolItem* pItem;
+ USHORT nModi = pModifier ? *pModifier : 0;
+ pItem = rDispatcher.Execute(
+ nId, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD | SFX_CALLMODE_MODAL,
+ pItems, nModi );
+
+ if ( !pItem )
+ return FALSE;
+
+ if ( nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId )
+ {
+ SfxUInt16Item *pFilterItem = PTR_CAST(SfxUInt16Item, pItem);
+ DBG_ASSERT(pFilterItem, "SfxUINT16Item erwartet");
+ USHORT nFilterFlags = pFilterItem->GetValue() & ~SFXSTYLEBIT_USERDEF;
+ if(!nFilterFlags) // Benutzervorlage?
+ nFilterFlags = pFilterItem->GetValue();
+ const SfxStyleFamilyItem *pFamilyItem = GetFamilyItem_Impl();
+ const USHORT nCount = (USHORT) pFamilyItem->GetFilterList().Count();
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ const SfxFilterTupel *pTupel =
+ pFamilyItem->GetFilterList().GetObject(i);
+
+ if ( ( pTupel->nFlags & nFilterFlags ) == nFilterFlags && pIdx )
+ *pIdx = i;
+ }
+ }
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+// Handler der Listbox der Filter
+IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
+{
+ if ( pBox->GetSelectEntry() == String(SfxResId(STR_STYLE_FILTER_HIERARCHICAL)) )
+ {
+ if ( !bHierarchical )
+ {
+ // TreeView einschalten
+ bHierarchical=TRUE;
+ const String aSelectEntry( GetSelectedEntry());
+ aFmtLb.Hide();
+ // aFilterLb.Disable();
+
+ pTreeBox = new StyleTreeListBox_Impl(
+ this, WB_HASBUTTONS | WB_HASLINES |
+ WB_BORDER | WB_TABSTOP | WB_HASLINESATROOT |
+ WB_HASBUTTONSATROOT );
+ pTreeBox->SetFont( aFmtLb.GetFont() );
+
+ pTreeBox->SetPosSizePixel(aFmtLb.GetPosPixel(), aFmtLb.GetSizePixel());
+ pTreeBox->SetNodeBitmaps(Image(SfxResId(BMP_COLLAPSED)),
+ Image(SfxResId(BMP_EXPANDED)));
+ pTreeBox->SetSelectHdl(
+ LINK(this, SfxCommonTemplateDialog_Impl, FmtSelectHdl));
+ ((StyleTreeListBox_Impl*)pTreeBox)->
+ SetDoubleClickHdl(
+ LINK(this, SfxCommonTemplateDialog_Impl, ApplyHdl));
+ ((StyleTreeListBox_Impl*)pTreeBox)->
+ SetDropHdl(LINK(this, SfxCommonTemplateDialog_Impl, DropHdl));
+ pTreeBox->SetIndent(10);
+
+ FillTreeBox();
+ SelectStyle(aSelectEntry);
+ pTreeBox->Show();
+ }
+ }
+
+ else
+ {
+ DELETEZ(pTreeBox);
+ aFmtLb.Show();
+ // aFilterLb.Enable();
+ // Falls bHierarchical, kann sich die Familie geaendert haben
+ FilterSelect(pBox->GetSelectEntryPos(), bHierarchical );
+ bHierarchical=FALSE;
+// UpdateStyles_Impl(UPDATE_FAMILY_LIST); // Anzeige aktualisieren
+ }
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+// Select-Handler der Toolbox
+void SfxCommonTemplateDialog_Impl::FamilySelect(USHORT nEntry)
+{
+ USHORT nFamily = nActFamily;
+ if( nEntry != nActFamily )
+ {
+ CheckItem( nActFamily, FALSE );
+ nActFamily = nEntry;
+ SfxDispatcher* pDispat = pBindings->GetDispatcher_Impl();
+ SfxUInt16Item aItem( SID_STYLE_FAMILY, nEntry );
+ pDispat->Execute( SID_STYLE_FAMILY, SFX_CALLMODE_SYNCHRON, &aItem, 0L );
+ pBindings->Invalidate( SID_STYLE_FAMILY );
+ pBindings->Update( SID_STYLE_FAMILY );
+ UpdateFamily_Impl();
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::ActionSelect(USHORT nEntry)
+{
+ String aEmpty;
+ switch(nEntry)
+ {
+ case SID_STYLE_WATERCAN:
+ {
+ const BOOL bState = IsCheckedItem(nEntry);
+ BOOL bCheck;
+ SfxBoolItem aBool;
+ // wenn eine Vorlage ausgewaehlt ist.
+ if(!bState && aFmtLb.GetSelectionCount())
+ {
+ const String aTemplName(
+ GetSelectedEntry());
+ Execute_Impl(
+ SID_STYLE_WATERCAN, aTemplName, aEmpty,
+ (USHORT)GetFamilyItem_Impl()->GetFamily() );
+ bCheck = TRUE;
+ }
+ else
+ {
+ Execute_Impl(SID_STYLE_WATERCAN, aEmpty, aEmpty, 0);
+ bCheck = FALSE;
+ }
+ CheckItem(nEntry, bCheck);
+ aBool.SetValue(bCheck);
+ SetWaterCanState(&aBool);
+ break;
+ }
+ case SID_STYLE_NEW_BY_EXAMPLE:
+ {
+ if(pStyleSheetPool && nActFamily != 0xffff)
+ {
+ const SfxStyleFamily eFam=GetFamilyItem_Impl()->GetFamily();
+//pStyleSheetPool->GetSearchFamily();
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ USHORT nFilter;
+ if(pItem&&nActFilter!=0xffff)
+ {
+ nFilter = pItem->GetFilterList().GetObject(
+ nActFilter)->nFlags;
+ if(!nFilter) // automatisch
+ nFilter = nAppFilter;
+ }
+ else
+ nFilter=pStyleSheetPool->GetSearchMask();
+ pStyleSheetPool->SetSearchMask( eFam, SFXSTYLEBIT_USERDEF );
+
+ SfxNewStyleDlg *pDlg =
+ // FloatingWindow must not be parent of a modal dialog
+ new SfxNewStyleDlg(SFX_APP()->GetTopWindow(), *pStyleSheetPool);
+ if(RET_OK == pDlg->Execute())
+ {
+ pStyleSheetPool->SetSearchMask(eFam, nFilter);
+ const String aTemplName(pDlg->GetName());
+ Execute_Impl(SID_STYLE_NEW_BY_EXAMPLE,
+ aTemplName, aEmpty,
+ (USHORT)GetFamilyItem_Impl()->GetFamily(),
+ nFilter);
+ }
+ pStyleSheetPool->SetSearchMask( eFam, nFilter );
+ delete pDlg;
+ }
+ break;
+ }
+ case SID_STYLE_UPDATE_BY_EXAMPLE:
+ {
+ Execute_Impl(SID_STYLE_UPDATE_BY_EXAMPLE,
+ aEmpty, aEmpty,
+ (USHORT)GetFamilyItem_Impl()->GetFamily());
+ break;
+ }
+ default: DBG_ERROR("not implemented"); break;
+ }
+}
+
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxCommonTemplateDialog_Impl, DropHdl, StyleTreeListBox_Impl *, pBox )
+{
+ bDontUpdate=TRUE;
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ const SfxStyleFamily eFam = pItem->GetFamily();
+ long ret= pStyleSheetPool->SetParent(eFam,pBox->GetStyle(), pBox->GetParent())? 1L: 0L;
+ bDontUpdate=FALSE;
+ return ret;
+}
+
+//-------------------------------------------------------------------------
+
+// Handler des Neu-Buttons
+void SfxCommonTemplateDialog_Impl::NewHdl(void *)
+{
+ String aEmpty;
+ if ( nActFamily != 0xffff )
+ {
+ Window* pTmp;
+ pTmp = Application::GetDefDialogParent();
+ if ( ISA(SfxTemplateDialog_Impl) )
+ Application::SetDefDialogParent( pWindow->GetParent() );
+ else
+ Application::SetDefDialogParent( pWindow );
+
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ const SfxStyleFamily eFam=pItem->GetFamily();
+ USHORT nMask;
+ if(pItem&&nActFilter!=0xffff)
+ {
+ nMask = pItem->GetFilterList().GetObject(
+ nActFilter)->nFlags;
+ if(!nMask) // automatisch
+ nMask = nAppFilter;
+ }
+ else
+ nMask=pStyleSheetPool->GetSearchMask();
+
+ pStyleSheetPool->SetSearchMask(eFam,nMask);
+
+ Execute_Impl(SID_STYLE_NEW,
+ aEmpty, GetSelectedEntry(),
+ ( USHORT )GetFamilyItem_Impl()->GetFamily(),
+ nMask);
+
+ Application::SetDefDialogParent( pTmp );
+
+/* {
+ DBG_ASSERT(nFilter < aFilterLb.GetEntryCount(),
+ "Filter ueberindiziert");
+
+ if(!pTreeBox)
+ {
+// aFilterLb.SelectEntryPos(nFilter);
+ FilterSelect(nActFilter, TRUE);
+ }
+ else
+ {
+ FillTreeBox();
+ SfxTemplateItem *pState = pFamilyState[nActFamily-1];
+ if(pState)
+ {
+ const String aStyle(pState->GetStyleName());
+ SelectStyle(aStyle);
+ }
+ EnableDelete();
+ }*/
+// }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+// Handler des Bearbeiten-Buttons
+void SfxCommonTemplateDialog_Impl::EditHdl(void *)
+{
+ if(IsInitialized() && HasSelectedStyle())
+ {
+ USHORT nFilter = nActFilter;
+ String aTemplName(GetSelectedEntry());
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ const SfxStyleFamily eFam = pItem->GetFamily();
+ SfxStyleSheetBase *pStyle =
+ pStyleSheetPool->Find(aTemplName,eFam,SFXSTYLEBIT_ALL);
+ Window* pTmp;
+ //DefModalDialogParent setzen fuer
+ //Modalitaet der nachfolgenden Dialoge
+ pTmp = Application::GetDefDialogParent();
+ if ( ISA(SfxTemplateDialog_Impl) )
+ Application::SetDefDialogParent( pWindow->GetParent() );
+ else
+ Application::SetDefDialogParent( pWindow );
+ if ( Execute_Impl( SID_STYLE_EDIT, aTemplName, String(),
+ (USHORT)GetFamilyItem_Impl()->GetFamily(), 0, &nFilter ) )
+ {
+// DBG_ASSERT(nFilter < aFilterLb.GetEntryCount(), "Filter ueberindiziert");
+// aTemplName = pStyle->GetName();
+// kann durch Bearbeiten umbenannt worden sein
+/* if(!pTreeBox)
+ {
+ // aFilterLb.SelectEntryPos(nFilter);
+ // FilterSelect(nFilter, TRUE);
+ }
+ else
+ FillTreeBox();*/
+ }
+ Application::SetDefDialogParent( pTmp );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+// Handler des L"oschen-Buttons
+void SfxCommonTemplateDialog_Impl::DeleteHdl(void *)
+{
+ if ( IsInitialized() && HasSelectedStyle() )
+ {
+ const String aTemplName( GetSelectedEntry() );
+ const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl();
+ SfxStyleSheetBase* pStyle =
+ pStyleSheetPool->Find( aTemplName, pItem->GetFamily(), SFXSTYLEBIT_ALL );
+ if ( pStyle )
+ {
+ String aMsg;
+ if ( pStyle->IsUsed() )
+ aMsg = String( SfxResId( STR_DELETE_STYLE_USED ) );
+ aMsg += String ( SfxResId( STR_DELETE_STYLE ) );
+ aMsg.SearchAndReplaceAscii( "$1", aTemplName );
+#if defined UNX
+ QueryBox aBox( SFX_APP()->GetTopWindow(), WB_YES_NO | WB_DEF_NO, aMsg );
+#else
+ QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , aMsg );
+#endif
+ if ( RET_YES == aBox.Execute() )
+ {
+ if ( pTreeBox ) // Damit die Treelistbox beim L"oschen nicht zuklappt
+ {
+ bDontUpdate = TRUE;
+ }
+ Execute_Impl( SID_STYLE_DELETE, aTemplName,
+ String(), (USHORT)GetFamilyItem_Impl()->GetFamily() );
+
+ if ( pTreeBox )
+ {
+ pTreeBox->RemoveParentKeepChilds( pTreeBox->FirstSelected() );
+ bDontUpdate = FALSE;
+ }
+ }
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::EnableDelete()
+{
+ if(IsInitialized() && HasSelectedStyle())
+ {
+ DBG_ASSERT(pStyleSheetPool, "Kein StyleSheetPool");
+ const String aTemplName(GetSelectedEntry());
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ const SfxStyleFamily eFam = pItem->GetFamily();
+ USHORT nFilter = pItem->GetFilterList().GetObject(nActFilter)->nFlags;
+ if(!nFilter) // automatisch
+ nFilter = nAppFilter;
+ const SfxStyleSheetBase *pStyle =
+ pStyleSheetPool->Find(aTemplName,eFam,
+ pTreeBox? SFXSTYLEBIT_ALL: nFilter);
+ DBG_ASSERT(pStyle, "Style nicht gefunden");
+ if(pStyle && pStyle->IsUserDefined())
+ {
+ EnableDel(TRUE);
+ }
+ else
+ {
+ EnableDel(FALSE);
+ }
+ }
+ else
+ {
+ EnableDel(FALSE);
+ }
+// rBindings.Invalidate( SID_STYLE_DELETE );
+// rBindings.Update( SID_STYLE_DELETE );
+}
+
+//-------------------------------------------------------------------------
+
+// nach Selektion eines Eintrags den Focus gfs. wieder auf das App-Fenster
+// setzen
+void SfxCommonTemplateDialog_Impl::ResetFocus()
+{
+ if(ISA(SfxTemplateDialog_Impl))
+ {
+ SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+ SfxViewShell *pVu = pViewFrame->GetViewShell();
+ Window *pAppWin = pVu ? pVu->GetWindow(): 0;
+ if(pAppWin)
+ pAppWin->GrabFocus();
+ }
+}
+
+//-------------------------------------------------------------------------
+
+// Doppelclick auf ein StyleSheet in der ListBox, wird angewendet.
+IMPL_LINK( SfxCommonTemplateDialog_Impl, ApplyHdl, Control *, pControl )
+{
+ // nur, wenn dieser Bereich erlaubt ist
+ if ( IsInitialized() && 0 != pFamilyState[nActFamily-1] &&
+ GetSelectedEntry().Len() )
+ {
+ USHORT nModifier = aFmtLb.GetModifier();
+ Execute_Impl(SID_STYLE_APPLY,
+ GetSelectedEntry(), String(),
+ ( USHORT )GetFamilyItem_Impl()->GetFamily(),
+ 0, 0, &nModifier );
+ if(ISA(SfxTemplateCatalog_Impl))
+ ((SfxTemplateCatalog_Impl*) this)->pReal->EndDialog(RET_OK);
+ }
+// ResetFocus();
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+// Selektion einer Vorlage w"ahrend des Watercan-Status
+IMPL_LINK( SfxCommonTemplateDialog_Impl, FmtSelectHdl, SvTreeListBox *, pListBox )
+{
+ // HilfePI antriggern, wenn von Call als Handler und Bereich erlaubt ist
+ if( !pListBox || pListBox->IsSelected( pListBox->GetHdlEntry() ) )
+ {
+#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI && pListBox && IsInitialized() &&
+ GetSelectedEntry().Len() )
+ {
+ const SfxStyleFamilyItem *pItem = GetFamilyItem_Impl();
+ const SfxStyleFamily eFam = pItem->GetFamily();
+ DBG_ASSERT(pStyleSheetPool, "Kein Pool");
+ // SfxStyleSheetBase* pStyle = pStyleSheetPool
+ // ? pStyleSheetPool->Find( GetSelectedEntry(), eFam ) : 0;
+ SfxStyleSheetBase *pStyle;
+ if ( pStyleSheetPool )
+ pStyle = pStyleSheetPool->Find ( GetSelectedEntry(), eFam );
+ else
+ pStyle = 0;
+
+ if ( pStyle )
+ {
+ String aHelpFile;
+ ULONG nHelpId=pStyle->GetHelpId(aHelpFile);
+ if ( nHelpId )
+ pHelpPI->LoadTopic( nHelpId );
+ }
+ }
+#endif
+
+ // nur, wenn Giesskanne an ist
+ if ( IsInitialized() &&
+ IsCheckedItem(SID_STYLE_WATERCAN) &&
+ // nur, wenn dieser Bereich erlaubt ist
+ 0 != pFamilyState[nActFamily-1] )
+ {
+ String aEmpty;
+ Execute_Impl(SID_STYLE_WATERCAN,
+ aEmpty, aEmpty, 0);
+ Execute_Impl(SID_STYLE_WATERCAN,
+ GetSelectedEntry(), aEmpty,
+ ( USHORT )GetFamilyItem_Impl()->GetFamily());
+ }
+// EnableEdit(TRUE);
+ EnableItem(SID_STYLE_WATERCAN, !bWaterDisabled);
+ EnableDelete();
+ }
+ if( pListBox )
+ SelectStyle( pListBox->GetEntryText( pListBox->GetHdlEntry() ));
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxCommonTemplateDialog_Impl, MenuSelectHdl, Menu *, pMenu )
+{
+ if( pMenu )
+ {
+ nLastItemId = pMenu->GetCurItemId();
+ Application::PostUserEvent(
+ LINK( this, SfxCommonTemplateDialog_Impl, MenuSelectHdl ), 0 );
+ return TRUE;
+ }
+
+ switch(nLastItemId) {
+ case ID_NEW: NewHdl(0); break;
+ case ID_EDIT: EditHdl(0); break;
+ case ID_DELETE: DeleteHdl(0); break;
+ default: return FALSE;
+ }
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::ExecuteContextMenu_Impl( const Point& rPos, Window* pWin )
+{
+ if ( bBindingUpdate )
+ {
+ pBindings->Invalidate( SID_STYLE_NEW, TRUE, FALSE );
+ pBindings->Update( SID_STYLE_NEW );
+ bBindingUpdate = FALSE;
+ }
+ PopupMenu* pMenu = new PopupMenu( SfxResId( MN_CONTEXT_TEMPLDLG ) );
+ pMenu->SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, MenuSelectHdl ) );
+ pMenu->EnableItem( ID_EDIT, bCanEdit );
+ pMenu->EnableItem( ID_DELETE, bCanDel );
+ pMenu->EnableItem( ID_NEW, bCanNew );
+ pMenu->Execute( pWin, rPos );
+ delete pMenu;
+}
+
+// -----------------------------------------------------------------------
+
+SfxStyleFamily SfxCommonTemplateDialog_Impl::GetActualFamily() const
+{
+ const SfxStyleFamilyItem *pFamilyItem = GetFamilyItem_Impl();
+ if( !pFamilyItem || nActFamily == 0xffff )
+ return SFX_STYLE_FAMILY_PARA;
+ else
+ return pFamilyItem->GetFamily();
+}
+
+// -----------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::EnableExample_Impl(USHORT nId, BOOL bEnable)
+{
+ if( nId == SID_STYLE_NEW_BY_EXAMPLE )
+ bNewByExampleDisabled = !bEnable;
+ else if( nId == SID_STYLE_UPDATE_BY_EXAMPLE )
+ bUpdateByExampleDisabled = !bEnable;
+ EnableItem(nId, bEnable);
+}
+
+// ------------------------------------------------------------------------
+
+SfxTemplateDialog_Impl::SfxTemplateDialog_Impl(
+ Window* pParent, SfxBindings* pB, SfxTemplateDialog* pWindow ) :
+
+ SfxCommonTemplateDialog_Impl( pB, pWindow ),
+
+ aActionTbL ( pWindow ),
+ pFloat ( pWindow ),
+ aActionTbR ( pWindow, ResId( TB_ACTION ) ),
+ bZoomIn ( FALSE )
+
+{
+
+ pWindow->FreeResource();
+ Initialize();
+
+ aActionTbL.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxLSelect));
+ aActionTbR.SetSelectHdl(LINK(this, SfxTemplateDialog_Impl, ToolBoxRSelect));
+ aActionTbL.Show();
+ aActionTbR.Show();
+ Font aFont=aFilterLb.GetFont();
+ aFont.SetWeight( WEIGHT_NORMAL );
+ aFilterLb.SetFont( aFont );
+ aActionTbL.SetHelpId( HID_TEMPLDLG_TOOLBOX_LEFT );
+
+ SFX_IMAGEMANAGER()->RegisterToolBox( &aActionTbL, SFX_TOOLBOX_CHANGEOUTSTYLE );
+ SFX_IMAGEMANAGER()->RegisterToolBox( &aActionTbR, SFX_TOOLBOX_CHANGEOUTSTYLE );
+}
+
+// ------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::EnableFamilyItem( USHORT nId, BOOL bEnable )
+{
+ aActionTbL.EnableItem( nId, bEnable );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::InsertFamilyItem(USHORT nId,const SfxStyleFamilyItem *pItem)
+{
+ USHORT nHelpId = 0;
+ switch( (USHORT) pItem->GetFamily() )
+ {
+ case SFX_STYLE_FAMILY_CHAR: nHelpId = SID_STYLE_FAMILY1; break;
+ case SFX_STYLE_FAMILY_PARA: nHelpId = SID_STYLE_FAMILY2; break;
+ case SFX_STYLE_FAMILY_FRAME:nHelpId = SID_STYLE_FAMILY3; break;
+ case SFX_STYLE_FAMILY_PAGE: nHelpId = SID_STYLE_FAMILY4; break;
+ case SFX_STYLE_FAMILY_PSEUDO: nHelpId = SID_STYLE_FAMILY5; break;
+ default: DBG_ERROR("unbekannte StyleFamily"); break;
+ }
+ aActionTbL.InsertItem( nId, pItem->GetImage(), pItem->GetText(), 0, 0);
+ aActionTbL.SetHelpId( nId, nHelpId );
+}
+
+// ------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::ClearFamilyList()
+{
+ aActionTbL.Clear();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCommonTemplateDialog_Impl::InvalidateBindings()
+{
+ pBindings->Invalidate(SID_STYLE_NEW_BY_EXAMPLE, TRUE, FALSE);
+ pBindings->Update( SID_STYLE_NEW_BY_EXAMPLE );
+ pBindings->Invalidate(SID_STYLE_UPDATE_BY_EXAMPLE, TRUE, FALSE);
+ pBindings->Update( SID_STYLE_UPDATE_BY_EXAMPLE );
+ pBindings->Invalidate( SID_STYLE_WATERCAN, TRUE, FALSE);
+ pBindings->Update( SID_STYLE_WATERCAN );
+ pBindings->Invalidate( SID_STYLE_NEW, TRUE, FALSE );
+ pBindings->Update( SID_STYLE_NEW );
+ pBindings->Invalidate( SID_STYLE_DRAGHIERARCHIE, TRUE, FALSE );
+ pBindings->Update( SID_STYLE_DRAGHIERARCHIE );
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateDialog_Impl::~SfxTemplateDialog_Impl()
+{
+ SFX_IMAGEMANAGER()->ReleaseToolBox( &aActionTbL );
+ SFX_IMAGEMANAGER()->ReleaseToolBox( &aActionTbR );
+}
+
+//-------------------------------------------------------------------------
+
+// "Uberladener Resize-Handler ( StarView )
+// Die Groesse der Listboxen wird angepasst
+void SfxTemplateDialog_Impl::Resize()
+{
+ FloatingWindow *pF = pFloat->GetFloatingWindow();
+ if ( pF )
+ {
+// if(pF->IsZoomedIn() && bZoomIn==FALSE)
+// pF->SetText(String(SfxResId( DLG_STYLE_DESIGNER )));
+// if(!pF->IsZoomedIn() && bZoomIn==TRUE && GetFamilyItem_Impl())
+// UpdateStyles_Impl(UPDATE_FAMILY); //Bereich wieder in Titel schreiben
+ bZoomIn = pF->IsRollUp();
+ if ( bZoomIn )
+ return;
+ }
+
+ Size aDlgSize=pFloat->PixelToLogic(pFloat->GetOutputSizePixel());
+ Size aSizeATL=pFloat->PixelToLogic(aActionTbL.CalcWindowSizePixel());
+ Size aSizeATR=pFloat->PixelToLogic(aActionTbR.CalcWindowSizePixel());
+ Size aMinSize = GetMinOutputSizePixel();
+
+ long nListHeight = pFloat->PixelToLogic( aFilterLb.GetSizePixel() ).Height();
+ long nWidth = aDlgSize.Width()- 2 * SFX_TEMPLDLG_HFRAME;
+
+ aActionTbL.SetPosSizePixel(pFloat->LogicToPixel(Point(SFX_TEMPLDLG_HFRAME,SFX_TEMPLDLG_VTOPFRAME)),
+ pFloat->LogicToPixel(aSizeATL));
+
+ // Die Position der rechten Toolbox nur ver"andern, wenn das Fenster
+ // breit genug ist
+ Point aPosATR(aDlgSize.Width()-SFX_TEMPLDLG_HFRAME-aSizeATR.Width(),SFX_TEMPLDLG_VTOPFRAME);
+ if(aDlgSize.Width() >= aMinSize.Width())
+ aActionTbR.SetPosPixel(pFloat->LogicToPixel(aPosATR));
+ else
+ aActionTbR.SetPosPixel( pFloat->LogicToPixel(
+ Point( SFX_TEMPLDLG_HFRAME + aSizeATL.Width() + SFX_TEMPLDLG_MIDHSPACE,
+ SFX_TEMPLDLG_VTOPFRAME ) ) );
+
+ aActionTbR.SetSizePixel(pFloat->LogicToPixel(aSizeATR));
+
+ Point aFilterPos(
+ pFloat->LogicToPixel(Point(SFX_TEMPLDLG_HFRAME,
+ aDlgSize.Height()-SFX_TEMPLDLG_VBOTFRAME-nListHeight)) );
+
+ Size aFilterSize(
+ pFloat->LogicToPixel(Size(nWidth,SFX_TEMPLDLG_FILTERHEIGHT)) );
+
+ Point aFmtPos(
+ pFloat->LogicToPixel(Point(SFX_TEMPLDLG_HFRAME, SFX_TEMPLDLG_VTOPFRAME +
+ SFX_TEMPLDLG_MIDVSPACE+aSizeATL.Height())) );
+ Size aFmtSize(
+ pFloat->LogicToPixel(Size(nWidth,
+ aDlgSize.Height() - SFX_TEMPLDLG_VBOTFRAME -
+ SFX_TEMPLDLG_VTOPFRAME - 2*SFX_TEMPLDLG_MIDVSPACE-
+ nListHeight-aSizeATL.Height())) );
+
+ // Die Position der Listboxen nur ver"andern, wenn das Fenster
+ // hoch genug ist
+ if(aDlgSize.Height() >= aMinSize.Height())
+ {
+ aFilterLb.SetPosPixel(aFilterPos);
+ aFmtLb.SetPosPixel( aFmtPos );
+ if(pTreeBox)
+ pTreeBox->SetPosPixel(aFmtPos);
+ }
+ else
+ aFmtSize.Height() += aFilterSize.Height();
+
+ aFilterLb.SetSizePixel(aFilterSize);
+ aFmtLb.SetSizePixel( aFmtSize );
+ if(pTreeBox)
+ pTreeBox->SetSizePixel(aFmtSize);
+}
+
+// -----------------------------------------------------------------------
+
+
+Size SfxTemplateDialog_Impl::GetMinOutputSizePixel()
+{
+ Size aSizeATL=pFloat->PixelToLogic(aActionTbL.CalcWindowSizePixel());
+ Size aSizeATR=pFloat->PixelToLogic(aActionTbR.CalcWindowSizePixel());
+ Size aMinSize=Size(
+ aSizeATL.Width()+aSizeATR.Width()+
+ 2*SFX_TEMPLDLG_HFRAME + SFX_TEMPLDLG_MIDHSPACE,
+ 4*aSizeATL.Height()+2*SFX_TEMPLDLG_MIDVSPACE);
+ return aMinSize;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::Command( const CommandEvent& rCEvt )
+{
+ if(COMMAND_CONTEXTMENU == rCEvt.GetCommand())
+ ExecuteContextMenu_Impl( rCEvt.GetMousePosPixel(), pFloat );
+// ExecuteContextMenu_Impl(pFloat->OutputToScreenPixel(rCEvt.GetMousePosPixel()));
+ else
+ pFloat->Command(rCEvt);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::EnableItem(USHORT nMesId, BOOL bCheck)
+{
+ String aEmpty;
+ switch(nMesId)
+ {
+ case SID_STYLE_WATERCAN :
+ if(!bCheck && IsCheckedItem(SID_STYLE_WATERCAN))
+ Execute_Impl(SID_STYLE_WATERCAN, aEmpty, aEmpty, 0);
+ case SID_STYLE_NEW_BY_EXAMPLE:
+ case SID_STYLE_UPDATE_BY_EXAMPLE:
+ aActionTbR.EnableItem(nMesId,bCheck);
+ break;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateDialog_Impl::CheckItem(USHORT nMesId, BOOL bCheck)
+{
+ switch(nMesId)
+ {
+ case SID_STYLE_WATERCAN :
+ bIsWater=bCheck;
+ aActionTbR.CheckItem(SID_STYLE_WATERCAN,bCheck);
+ break;
+ default:
+ aActionTbL.CheckItem(nMesId,bCheck); break;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxTemplateDialog_Impl::IsCheckedItem(USHORT nMesId)
+{
+ switch(nMesId)
+ {
+ case SID_STYLE_WATERCAN :
+ return aActionTbR.GetItemState(SID_STYLE_WATERCAN)==STATE_CHECK;
+ default:
+ return aActionTbL.GetItemState(nMesId)==STATE_CHECK;
+ }
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateDialog_Impl, ToolBoxLSelect, ToolBox *, pBox )
+{
+ const USHORT nEntry = pBox->GetCurItemId();
+ FamilySelect(nEntry);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateDialog_Impl, ToolBoxLSelect, ToolBox *, pBox )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateDialog_Impl, ToolBoxRSelect, ToolBox *, pBox )
+{
+ const USHORT nEntry = pBox->GetCurItemId();
+ ActionSelect(nEntry);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateDialog_Impl, ToolBoxRSelect, ToolBox *, pBox )
+
+//-------------------------------------------------------------------------
+
+SfxTemplateCatalog_Impl::SfxTemplateCatalog_Impl( Window* pParent, SfxBindings* pB,
+ SfxTemplateCatalog* pWindow ) :
+
+ SfxCommonTemplateDialog_Impl( pB, pWindow ),
+
+ aOkBtn ( pWindow, SfxResId( BT_OK ) ),
+ aCancelBtn ( pWindow, SfxResId( BT_CANCEL ) ),
+ aNewBtn ( pWindow, SfxResId( BT_NEW ) ),
+ aChangeBtn ( pWindow, SfxResId( BT_EDIT ) ),
+ aDelBtn ( pWindow, SfxResId( BT_DEL ) ),
+ aHelpBtn ( pWindow, SfxResId( BT_HELP ) ),
+ aOrgBtn ( pWindow, SfxResId( BT_ORG ) ),
+ aFamList ( pWindow, SfxResId( BT_TOOL ) ),
+ pReal ( pWindow ),
+ aHelper ( pWindow )
+
+{
+ aNewBtn.Disable();
+ aDelBtn.Disable();
+ aChangeBtn.Disable();
+
+ SFX_APP()->Get_Impl()->pTemplateCommon = GetISfxTemplateCommon();
+ pWindow->FreeResource();
+
+ Initialize();
+
+ aFamList.SetSelectHdl( LINK( this, SfxTemplateCatalog_Impl, FamListSelect ) );
+ aOkBtn.SetClickHdl( LINK( this, SfxTemplateCatalog_Impl, OkHdl ) );
+ aCancelBtn.SetClickHdl( LINK( this, SfxTemplateCatalog_Impl, CancelHdl ) );
+ aNewBtn.SetClickHdl( LINK( this, SfxTemplateCatalog_Impl, NewHdl ) );
+ aDelBtn.SetClickHdl( LINK( this, SfxTemplateCatalog_Impl, DelHdl ) );
+ aChangeBtn.SetClickHdl( LINK( this, SfxTemplateCatalog_Impl, ChangeHdl ) );
+ aOrgBtn.SetClickHdl( LINK( this, SfxTemplateCatalog_Impl, OrgHdl ) );
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateCatalog_Impl::~SfxTemplateCatalog_Impl()
+{
+ SFX_APP()->Get_Impl()->pTemplateCommon = 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, OkHdl, Button *, pButton )
+{
+ ApplyHdl( NULL );
+ pReal->EndDialog( RET_OK );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, OkHdl, Button *, pButton )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, CancelHdl, Button *, pButton )
+{
+ pReal->EndDialog( RET_CANCEL );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, CancelHdl, Button *, pButton )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, NewHdl, Button *, pButton )
+{
+ aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) );
+ SfxCommonTemplateDialog_Impl::NewHdl( NULL );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, NewHdl, Button *, pButton )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, ChangeHdl, Button *, pButton )
+{
+ aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) );
+ SfxCommonTemplateDialog_Impl::EditHdl( NULL );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, ChangeHdl, Button *, pButton )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, DelHdl, Button *, pButton )
+{
+ aDelBtn.Disable();
+ aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) );
+ SfxCommonTemplateDialog_Impl::DeleteHdl( NULL );
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, DelHdl, Button *, pButton )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxTemplateCatalog_Impl, OrgHdl, Button *, pButton )
+{
+ aCancelBtn.SetText( String( SfxResId( STR_CLOSE ) ) );
+ SfxDocumentTemplates aTemplates;
+ aTemplates.Construct();
+ SfxTemplateOrganizeDlg* pDlg = new SfxTemplateOrganizeDlg( pReal, &aTemplates );
+ const short nRet = pDlg->Execute();
+ delete pDlg;
+ if ( RET_OK == nRet )
+ Update_Impl();
+ else if ( RET_EDIT_STYLE == nRet )
+ pReal->EndDialog( RET_CANCEL );
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateCatalog_Impl::EnableEdit( BOOL bEnable )
+{
+ SfxCommonTemplateDialog_Impl::EnableEdit( bEnable );
+ aChangeBtn.Enable( bEnable );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateCatalog_Impl::EnableDel( BOOL bEnable )
+{
+ SfxCommonTemplateDialog_Impl::EnableDel( bEnable );
+ aDelBtn.Enable( bEnable );
+}
+
+void SfxTemplateCatalog_Impl::EnableNew(BOOL bEnable)
+{
+ SfxCommonTemplateDialog_Impl::EnableNew( bEnable );
+ aNewBtn.Enable( bEnable );
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxTemplateCatalog_Impl, FamListSelect, ListBox *, pList )
+{
+ const USHORT nEntry = aFamIds[pList->GetSelectEntryPos()];
+ FamilySelect(nEntry);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxTemplateCatalog_Impl, FamListSelect, ListBox *, pList )
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateCatalog_Impl::EnableItem( USHORT nMesId, BOOL bCheck )
+{
+ if ( nMesId == SID_STYLE_WATERCAN )
+ aOkBtn.Enable( bCheck );
+ if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR )
+ return;
+
+/* for(USHORT i=0;i<aFamIds.Count&&aFamIds[i]!=nMesId;i++);
+ if(i!=aFamIds.Count())
+ aFamList.SelectEntry(aFamIds[i]);
+ else
+ DBG_ERROR("Entry nicht gefunden");*/
+
+}
+
+//-------------------------------------------------------------------------
+
+void SfxTemplateCatalog_Impl::CheckItem(USHORT nMesId, BOOL bCheck)
+{
+ if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR )
+ return;
+ USHORT i;
+ for ( i = 0; i < aFamIds.Count() && aFamIds[i] != nMesId; i++ );
+ aFamList.SelectEntryPos(i);
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxTemplateCatalog_Impl::IsCheckedItem(USHORT nMesId)
+{
+ if ( nMesId > SFX_STYLE_FAMILY_PSEUDO || nMesId < SFX_STYLE_FAMILY_CHAR )
+ return FALSE;
+ USHORT i;
+ for ( i = 0; i < aFamIds.Count() && aFamIds[i] != nMesId; i++ )
+ ;
+ return aFamList.IsEntrySelected( String::CreateFromInt32(i) );
+}
+
+//-------------------------------------------------------------------------
+
+// Der Katalog muss nur das Disablen beherrschen, da waehrend seiner
+// Lebenszeit keine Selektionsaenderungen vorgenommen werden koennen
+void SfxTemplateCatalog_Impl::EnableFamilyItem( USHORT nId, BOOL bEnable )
+{
+ if ( !bEnable )
+ for ( USHORT nPos = aFamIds.Count(); nPos--; )
+ if ( aFamIds[ nPos ] == nId )
+ {
+ aFamIds.Remove( nPos );
+ aFamList.RemoveEntry( nPos );
+ }
+}
+
+void SfxTemplateCatalog_Impl::InsertFamilyItem( USHORT nId, const SfxStyleFamilyItem* pItem )
+{
+ if ( nId > SFX_STYLE_FAMILY_PSEUDO || nId < SFX_STYLE_FAMILY_CHAR )
+ return;
+ aFamList.InsertEntry( pItem->GetText(), 0 );
+ aFamIds.Insert( nId, 0 );
+}
+
+void SfxTemplateCatalog_Impl::ClearFamilyList()
+{
+ aFamList.Clear();
+ aFamIds.Remove( 0, aFamIds.Count() );
+}
+
+void SfxCommonTemplateDialog_Impl::SetFamily( USHORT nId )
+{
+ if ( nId != nActFamily )
+ {
+ if ( nActFamily != 0xFFFF )
+ CheckItem( nActFamily, FALSE );
+ nActFamily = nId;
+ if ( nId != 0xFFFF )
+ bUpdateFamily = TRUE;
+ }
+}
+
+void SfxCommonTemplateDialog_Impl::UpdateFamily_Impl()
+{
+ bUpdateFamily = FALSE;
+
+ SfxDispatcher* pDispat = pBindings->GetDispatcher_Impl();
+ SfxViewFrame *pViewFrame = pDispat->GetFrame();
+ SfxObjectShell *pDocShell = pViewFrame->GetObjectShell();
+
+ SfxStyleSheetBasePool *pOldStyleSheetPool = pStyleSheetPool;
+ pStyleSheetPool = pDocShell? pDocShell->GetStyleSheetPool(): 0;
+ if ( pOldStyleSheetPool != pStyleSheetPool )
+ {
+ if ( pOldStyleSheetPool )
+ EndListening(*pOldStyleSheetPool);
+ if ( pStyleSheetPool )
+ StartListening(*pOldStyleSheetPool);
+ }
+
+ bWaterDisabled = FALSE;
+ bCanNew = TRUE;
+ bTreeDrag = TRUE;
+ bUpdateByExampleDisabled = FALSE;
+
+ if ( pStyleSheetPool )
+ {
+ if(!pTreeBox)
+ UpdateStyles_Impl(UPDATE_FAMILY | UPDATE_FAMILY_LIST);
+ else
+ {
+ UpdateStyles_Impl(UPDATE_FAMILY);
+ FillTreeBox();
+ }
+ }
+
+ InvalidateBindings();
+
+ if ( IsCheckedItem( SID_STYLE_WATERCAN ) &&
+ // nur, wenn dieser Bereich erlaubt ist
+ 0 != pFamilyState[ nActFamily - 1 ] )
+ Execute_Impl( SID_STYLE_APPLY, GetSelectedEntry(),
+ String(), (USHORT)GetFamilyItem_Impl()->GetFamily() );
+}
+
+
diff --git a/sfx2/source/dialog/templdlg.hrc b/sfx2/source/dialog/templdlg.hrc
new file mode 100644
index 000000000000..6999844a9b86
--- /dev/null
+++ b/sfx2/source/dialog/templdlg.hrc
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * $RCSfile: templdlg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define TB_FMT 1
+#define LB_FMT 3
+#define BTN_EDIT 11
+#define BTN_DELETE 12
+#define TB_ACTION 15
+#define BTN_NEW 10
+#define LB_FILTER 4
+
+#define ID_APPLY_TEMPLATE 10
+
+#define ID_NEW_STYLE_BY_EXAMPLE 20
+#define ID_UPDATE_STYLE_BY_EXAMPLE 21
+#define ID_TREEVIEW 22
+
+#define BT_OK 1
+#define BT_CANCEL 2
+#define BT_ORG 3
+#define BT_DEL 4
+#define BT_EDIT 5
+#define BT_NEW 6
+#define BT_HELP 7
+#define BT_FLIST 8
+#define BT_VLIST 9
+#define BT_TOOL 10
+
+
diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src
new file mode 100644
index 000000000000..1af839c1c30b
--- /dev/null
+++ b/sfx2/source/dialog/templdlg.src
@@ -0,0 +1,435 @@
+/*************************************************************************
+ *
+ * $RCSfile: templdlg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "dialog.hrc"
+#include "templdlg.hrc"
+#include "helpid.hrc"
+ // pragma ----------------------------------------------------------------
+
+ // RID_TEMPLATE ----------------------------------------------------------
+ImageList DLG_STYLE_DESIGNER
+{
+ ImageBitmap = Bitmap { File = "sc_tdlg.bmp" ; };
+ MaskColor = Color { Red = 0xC000 ; Green = 0xC000 ; Blue = 0xC000 ; };
+ IdList =
+ {
+ SID_STYLE_WATERCAN ; SID_STYLE_NEW_BY_EXAMPLE ;
+ SID_STYLE_UPDATE_BY_EXAMPLE ;
+ };
+ IdCount = { 3 ; };
+};
+ // RID_STYLECATALOG ------------------------------------------------------
+ModalDialog RID_STYLECATALOG
+{
+ HelpId = SID_STYLE_CATALOG ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 181 , 134 ) ;
+ Text = "Vorlagenkatalog" ;
+ Text [ English ] = "Stylesheet Catalogue" ;
+ Text [ norwegian ] = "Stylesheet Catalogue" ;
+ Text [ italian ] = "Catalogo modelli" ;
+ Text [ portuguese_brazilian ] = "Stylesheet Catalogue" ;
+ Text [ portuguese ] = "Catlogo de estilos" ;
+ Text [ french ] = "Catalogue de styles" ;
+ Text [ dutch ] = "Catalogus opmaakprofielen" ;
+ Text [ spanish ] = "Catlogo de estilos" ;
+ Text [ danish ] = "Typografi-katalog" ;
+ Text [ swedish ] = "Mallkatalog" ;
+ Text [ finnish ] = "Stylesheet Catalogue" ;
+ Text [ english_us ] = "Style Catalog" ;
+ Moveable = TRUE ;
+ // Closeable = TRUE; // Dialog hat Cancel oder OK - Button !
+ OKButton BT_OK
+ {
+ DefButton = TRUE ;
+ Pos = MAP_APPFONT ( 123 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 123 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton BT_ORG
+ {
+ Pos = MAP_APPFONT ( 123 , 97 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Verwalten..." ;
+ Text [ English ] = "~Organize..." ;
+ Text [ norwegian ] = "~Organize..." ;
+ Text [ italian ] = "Gestisci..." ;
+ Text [ portuguese_brazilian ] = "~Organize..." ;
+ Text [ portuguese ] = "~Gerir..." ;
+ Text [ french ] = "~Grer..." ;
+ Text [ dutch ] = "Be~heren..." ;
+ Text [ spanish ] = "~Administrar..." ;
+ Text [ danish ] = "Administrer..." ;
+ Text [ swedish ] = "~Frvalta..." ;
+ Text [ finnish ] = "~Organize..." ;
+ Text [ english_us ] = "~Organizer..." ;
+ TabStop = TRUE ;
+ Text[ chinese_simplified ] = "(~O)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Zarzdzaj...";
+ Text[ japanese ] = "Ǘ(~O)...";
+ Text[ chinese_traditional ] = "޲z(~O)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "(~O)...";
+ Text[ turkish ] = "~Ynet...";
+ };
+ PushButton BT_DEL
+ {
+ Pos = MAP_APPFONT ( 123 , 78 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen... : ~Lschen... */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen... : ~Lschen... */
+ Text = "~Lschen..." ;
+ Text [ English ] = "~Delete..." ;
+ Text [ norwegian ] = "~Delete..." ;
+ Text [ italian ] = "Elimina..." ;
+ Text [ portuguese_brazilian ] = "~Apagar..." ;
+ Text [ portuguese ] = "E~liminar..." ;
+ Text [ french ] = "~Supprimer..." ;
+ Text [ dutch ] = "~Wissen..." ;
+ Text [ spanish ] = "~Eliminar..." ;
+ Text [ danish ] = "Slet..." ;
+ Text [ swedish ] = "~Radera..." ;
+ Text [ finnish ] = "~Delete..." ;
+ Text [ english_us ] = "~Delete..." ;
+ TabStop = TRUE ;
+ Text[ chinese_simplified ] = "ɾ(~D)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Usu...";
+ Text[ japanese ] = "폜(~D)...";
+ Text[ chinese_traditional ] = "R(~D)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "(~D)...";
+ Text[ turkish ] = "~Sil...";
+ };
+ PushButton BT_EDIT
+ {
+ Pos = MAP_APPFONT ( 123 , 60 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~ndern... : ~ndern... */
+ /* ### ACHTUNG: Neuer Text in Resource? ~ndern... : ~ndern... */
+ Text = "n~dern..." ;
+ Text [ English ] = "~Change..." ;
+ Text [ norwegian ] = "~Change..." ;
+ Text [ italian ] = "Mo~difica..." ;
+ Text [ portuguese_brazilian ] = "~Change..." ;
+ Text [ portuguese ] = "~Modificar..." ;
+ Text [ french ] = "~Personnaliser..." ;
+ Text [ dutch ] = "~Wijzigen..." ;
+ Text [ spanish ] = "~Modificar..." ;
+ Text [ danish ] = "Modificer..." ;
+ Text [ swedish ] = "n~dra..." ;
+ Text [ finnish ] = "~Change..." ;
+ Text [ english_us ] = "~Modify..." ;
+ TabStop = TRUE ;
+ Text[ chinese_simplified ] = "(~M)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Modyfikuj...";
+ Text[ japanese ] = "ύX(~M)...";
+ Text[ chinese_traditional ] = "ܧ(~M)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "(~M)...";
+ Text[ turkish ] = "~Deitir...";
+ };
+ PushButton BT_NEW
+ {
+ Pos = MAP_APPFONT ( 123 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Neu..." ;
+ Text [ English ] = "~New..." ;
+ Text [ norwegian ] = "~New..." ;
+ Text [ italian ] = "Nuovo..." ;
+ Text [ portuguese_brazilian ] = "~Novo..." ;
+ Text [ portuguese ] = "~Novo..." ;
+ Text [ english_us ] = "~New..." ;
+ Text [ finnish ] = "~Uusi..." ;
+ Text [ danish ] = "Ny..." ;
+ Text [ french ] = "~Nouveau..." ;
+ Text [ swedish ] = "~Nytt..." ;
+ Text [ dutch ] = "~Nieuw.." ;
+ Text [ spanish ] = "~Nuevo..." ;
+ TabStop = TRUE ;
+ Text[ chinese_simplified ] = "½(~N)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Nowy...";
+ Text[ japanese ] = "VK쐬(~N)...";
+ Text[ chinese_traditional ] = "}ҷs(~N)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "(~N)...";
+ Text[ turkish ] = "~Yeni...";
+ };
+ HelpButton BT_HELP
+ {
+ Pos = MAP_APPFONT ( 123 , 114 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ ListBox BT_TOOL
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 110 , 55 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ };
+ Control BT_VLIST
+ {
+ HelpId = HID_TEMPLATE_FMT ;
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 23 ) ;
+ Size = MAP_APPFONT ( 110 , 89 ) ;
+ TabStop = TRUE ;
+ };
+ ListBox BT_FLIST
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 114 ) ;
+ Size = MAP_APPFONT ( 110 , 55 ) ;
+ TabStop = TRUE ;
+ Hide = TRUE ;
+ DropDown = TRUE ;
+ };
+ Text[ chinese_simplified ] = "ʽĿ¼";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Katalog stylw";
+ Text[ japanese ] = "ق̶۸";
+ Text[ chinese_traditional ] = "˦ؿ";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " īŻα";
+ Text[ turkish ] = "Biim katalou";
+};
+ // Strings ---------------------------------------------------------------
+String DLG_STYLE_DESIGNER
+{
+ Text = "Stylist" ;
+ Text [ English ] = "Stylist" ;
+ Text [ english_us ] = "Stylist" ;
+ Text [ portuguese_brazilian ] = "Designer" ;
+ Text [ swedish ] = "Stylist" ;
+ Text [ danish ] = "Stylist" ;
+ Text [ italian ] = "Stilista" ;
+ Text [ spanish ] = "Estilista" ;
+ Text [ french ] = "Styliste" ;
+ Text [ dutch ] = "Stylist" ;
+ Text [ portuguese ] = "Estilista" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Stylista";
+ Text[ japanese ] = "ؽ";
+ Text[ chinese_traditional ] = "U˦";
+ Text[ arabic ] = "";
+ Text[ greek ] = "Stylist";
+ Text[ korean ] = "Stylist";
+ Text[ turkish ] = "Stylist";
+};
+String STR_STYLE_FILTER_HIERARCHICAL
+{
+ TEXT = "Hierarchisch" ;
+ TEXT [ English ] = "Hierarchical" ;
+ TEXT [ norwegian ] = "Hierarkisk" ;
+ TEXT [ italian ] = "Gerarchico" ;
+ TEXT [ portuguese_brazilian ] = "Hierarchical" ;
+ TEXT [ portuguese ] = "Hierrquico" ;
+ TEXT [ finnish ] = "Hierarchical" ;
+ TEXT [ danish ] = "Hierarkisk" ;
+ TEXT [ french ] = "Hirarchique" ;
+ TEXT [ swedish ] = "Hierarkiskt" ;
+ TEXT [ dutch ] = "Hirarchisch" ;
+ TEXT [ spanish ] = "Jerrquico" ;
+ TEXT [ english_us ] = "Hierarchical" ;
+ TEXT[ chinese_simplified ] = "ȼʽ";
+ TEXT[ russian ] = " ";
+ TEXT[ polish ] = "Hierarchiczny";
+ TEXT[ japanese ] = "Kw";
+ TEXT[ chinese_traditional ] = "Ŧ";
+ TEXT[ arabic ] = "";
+ TEXT[ greek ] = "";
+ TEXT[ korean ] = "";
+ TEXT[ turkish ] = "Hiyerarik";
+};
+ // DLG_STYLE_DESIGNER ----------------------------------------------------
+DockingWindow DLG_STYLE_DESIGNER
+{
+ HelpId = SID_STYLE_DESIGNER ;
+ OutputSize = TRUE ;
+ Hide = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 116 , 215 ) ;
+ Pos = MAP_APPFONT ( 0 , 0 ) ;
+ Closeable = TRUE ;
+ Zoomable = TRUE ;
+ Sizeable = TRUE ;
+ Dockable = TRUE ;
+ EnableResizing = TRUE ;
+ // HideWhenDeactivate = TRUE;
+ Border = TRUE ;
+ Moveable = TRUE ;
+ ToolBox TB_ACTION
+ {
+ Pos = MAP_APPFONT ( 3 , 3 ) ;
+ Size = MAP_APPFONT ( 57 , 42 ) ;
+ LineCount = 1 ;
+ ItemImageList = DLG_STYLE_DESIGNER ;
+ HelpId = HID_TEMPLDLG_TOOLBOX_RIGHT ;
+ ItemList =
+ {
+ ToolBoxItem
+ {
+ HelpId = HID_TEMPLDLG_WATERCAN ;
+ Identifier = SID_STYLE_WATERCAN ;
+ /* ### ACHTUNG: Neuer Text in Resource? Giekannenmodus : Giekannenmodus */
+ /* ### ACHTUNG: Neuer Text in Resource? Giekannenmodus : Giekannenmodus */
+ Text = "Giekannenmodus" ;
+ Text [ English ] = "Watercan" ;
+ Text [ norwegian ] = "Rammefyll" ;
+ Text [ italian ] = "Modo riempimento" ;
+ Text [ portuguese_brazilian ] = "Watercan" ;
+ Text [ portuguese ] = "Preenchimento completo" ;
+ Text [ english_us ] = "Fill Format Mode" ;
+ Text [ finnish ] = "Ruisku" ;
+ Text [ danish ] = "Fyldmodus" ;
+ Text [ french ] = "Mode Remplir tout" ;
+ Text [ swedish ] = "Vattenkannelge" ;
+ Text [ dutch ] = "Gietermodus" ;
+ Text [ spanish ] = "Modo regadera" ;
+ /* ### ACHTUNG: Neuer Text in Resource? Vorlagen im Giekannenmodus anwenden : Vorlagen im Giekannenmodus anwenden */
+ /* ### ACHTUNG: Neuer Text in Resource? Vorlagen im Giekannenmodus anwenden : Vorlagen im Giekannenmodus anwenden */
+ Text[ chinese_simplified ] = "ģʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Tryb polewaczki";
+ Text[ japanese ] = "Ӱ";
+ Text[ chinese_traditional ] = "RҦ";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ä";
+ Text[ turkish ] = "Doldur kipi";
+ };
+ ToolBoxItem
+ {
+ HelpId = HID_TEMPLDLG_NEWBYEXAMPLE ;
+ Identifier = SID_STYLE_NEW_BY_EXAMPLE ;
+ Text = "Neue Vorlage aus Selektion" ;
+ Text [ English ] = "New style by example" ;
+ Text [ norwegian ] = "Ny mal etter eksempel" ;
+ Text [ italian ] = "Nuovo modello dalla selezione" ;
+ Text [ portuguese_brazilian ] = "Novo estilo por exemplo" ;
+ Text [ portuguese ] = "Novo estilo a partir da seleco" ;
+ Text [ english_us ] = "New Style from Selection" ;
+ Text [ finnish ] = "Uusi tyyli esimerkin mukaan" ;
+ Text [ danish ] = "Ny typografi fra markeringen" ;
+ Text [ french ] = "Nouveau style partir de la slection" ;
+ Text [ swedish ] = "Ny formatmall frn markeringen" ;
+ Text [ dutch ] = "Nieuw opmaakprofiel uit selectie" ;
+ Text [ spanish ] = "Nuevo estilo a partir de seleccin" ;
+ Text[ chinese_simplified ] = "ѡеʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nowy styl z selekcji";
+ Text[ japanese ] = "IقVK쐬";
+ Text[ chinese_traditional ] = "s˦q";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ÿ ";
+ Text[ turkish ] = "Yeni biim seimi";
+ };
+ ToolBoxItem
+ {
+ HelpId = HID_TEMPLDLG_UPDATEBYEXAMPLE ;
+ Identifier = SID_STYLE_UPDATE_BY_EXAMPLE ;
+ Text = "Vorlage aktualisieren" ;
+ Text [ English ] = "Update style by example" ;
+ Text [ norwegian ] = "Oppdater mal etter eksempel" ;
+ Text [ italian ] = "Aggiorna modello" ;
+ Text [ portuguese_brazilian ] = "Atualizar estilo por exemplo" ;
+ Text [ portuguese ] = "Actualizar modelo" ;
+ Text [ english_us ] = "Update Style" ;
+ Text [ finnish ] = "Pivit tyyli esimerkin mukaan" ;
+ Text [ danish ] = "Opdater typografi" ;
+ Text [ french ] = "Actualiser le style" ;
+ Text [ swedish ] = "Uppdatera formatmall" ;
+ Text [ dutch ] = "Opmaakprofiel actualiseren" ;
+ Text [ spanish ] = "Actualizar estilo" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Aktualizuj styl";
+ Text[ japanese ] = "ق̍XV";
+ Text[ chinese_traditional ] = "s˦";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " Ʈ";
+ Text[ turkish ] = "Biimi gncelle";
+ };
+ };
+ };
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/dialog/tplcitem.cxx b/sfx2/source/dialog/tplcitem.cxx
new file mode 100644
index 000000000000..0cad3172011e
--- /dev/null
+++ b/sfx2/source/dialog/tplcitem.cxx
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * $RCSfile: tplcitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#include <svtools/intitem.hxx>
+
+#pragma hdrstop
+
+#include "templdlg.hxx"
+#include "bindings.hxx"
+#include "tplpitem.hxx"
+#include "tplcitem.hxx"
+#include "templdgi.hxx"
+
+#include "sfx.hrc"
+#include "dialog.hrc"
+
+// STATIC DATA -----------------------------------------------------------
+
+// Konstruktor
+
+SfxTemplateControllerItem::SfxTemplateControllerItem(
+ USHORT nId, // ID
+ SfxCommonTemplateDialog_Impl &rDlg, // Controller-Instanz, dem dieses Item zugeordnet ist.
+ SfxBindings &rBindings):
+ SfxControllerItem(nId, rBindings),
+ rTemplateDlg(rDlg)
+{
+}
+
+// -----------------------------------------------------------------------
+
+// Benachrichtigung "uber Status"anderung; wird an den
+// im Konstruktor "ubergebenen Controller propagiert
+
+void SfxTemplateControllerItem::StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pItem )
+{
+ switch(nSID)
+ {
+ case SID_STYLE_FAMILY1:
+ case SID_STYLE_FAMILY2:
+ case SID_STYLE_FAMILY3:
+ case SID_STYLE_FAMILY4:
+ case SID_STYLE_FAMILY5:
+ {
+ FASTBOOL bAvailable = SFX_ITEM_AVAILABLE == eState;
+ if ( !bAvailable )
+ rTemplateDlg.SetFamilyState(GetId(), 0);
+ else {
+ const SfxTemplateItem *pStateItem = PTR_CAST(
+ SfxTemplateItem, pItem);
+ DBG_ASSERT(pStateItem != 0, "SfxTemplateItem erwartet");
+ rTemplateDlg.SetFamilyState( GetId(), pStateItem );
+ }
+ BOOL bDisable = eState == SFX_ITEM_DISABLED;
+ // Familie Disablen
+ USHORT nFamily;
+ switch( GetId())
+ {
+ case SID_STYLE_FAMILY1:
+ nFamily = 1; break;
+ case SID_STYLE_FAMILY2:
+ nFamily = 2; break;
+ case SID_STYLE_FAMILY3:
+ nFamily = 3; break;
+ case SID_STYLE_FAMILY4:
+ nFamily = 4; break;
+ case SID_STYLE_FAMILY5:
+ nFamily = 5; break;
+ default: DBG_ERROR("unbekannte StyleFamily"); break;
+ }
+ rTemplateDlg.EnableFamilyItem( nFamily, !bDisable );
+ break;
+ }
+ case SID_STYLE_WATERCAN:
+ {
+ if ( eState == SFX_ITEM_DISABLED )
+ rTemplateDlg.SetWaterCanState(0);
+ else if( eState == SFX_ITEM_AVAILABLE )
+ {
+ const SfxBoolItem *pStateItem = PTR_CAST(SfxBoolItem, pItem);
+ DBG_ASSERT(pStateItem != 0, "BoolItem erwartet");
+ rTemplateDlg.SetWaterCanState(pStateItem);
+ }
+ break;
+ }
+ case SID_STYLE_EDIT:
+ rTemplateDlg.EnableEdit( SFX_ITEM_DISABLED != eState );
+ break;
+ case SID_STYLE_DELETE:
+ rTemplateDlg.EnableDel( SFX_ITEM_DISABLED != eState );
+ break;
+ case SID_STYLE_NEW_BY_EXAMPLE:
+
+ rTemplateDlg.EnableExample_Impl(
+ GetId(), SFX_ITEM_DISABLED != eState );
+ break;
+ case SID_STYLE_UPDATE_BY_EXAMPLE:
+ {
+ rTemplateDlg.EnableExample_Impl(
+ GetId(), eState != SFX_ITEM_DISABLED );
+ // Das Select Disabled dann, falls enabled und Style Readonly
+/* String aStr = rTemplateDlg.GetSelectedEntry();
+ if( aStr.Len() ) rTemplateDlg.SelectStyle( aStr ); */
+ break;
+ }
+ case SID_STYLE_NEW:
+ {
+ rTemplateDlg.EnableNew( SFX_ITEM_DISABLED != eState );
+ break;
+ }
+ case SID_STYLE_DRAGHIERARCHIE:
+ {
+ rTemplateDlg.EnableTreeDrag( SFX_ITEM_DISABLED != eState );
+ break;
+ }
+ case SID_STYLE_FAMILY :
+ {
+ const SfxUInt16Item *pStateItem = PTR_CAST( SfxUInt16Item, pItem);
+ if (pStateItem)
+ rTemplateDlg.SetFamily( pStateItem->GetValue() );
+ break;
+ }
+ }
+}
+
+
diff --git a/sfx2/source/dialog/tplpitem.cxx b/sfx2/source/dialog/tplpitem.cxx
new file mode 100644
index 000000000000..ffb1dff8ad30
--- /dev/null
+++ b/sfx2/source/dialog/tplpitem.cxx
@@ -0,0 +1,123 @@
+/*************************************************************************
+ *
+ * $RCSfile: tplpitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#pragma hdrstop
+
+#include "tplpitem.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+TYPEINIT1(SfxTemplateItem, SfxFlagItem);
+
+//=========================================================================
+
+SfxTemplateItem::SfxTemplateItem
+(
+ USHORT nWhich, // Slot-ID
+ const String& rStyle, // Name des aktuellen Styles
+ USHORT nValue // Flags f"ur das Filtern bei automatischer Anzeige
+) :
+
+ SfxFlagItem( nWhich, nValue ),
+
+ aStyle( rStyle )
+
+{
+}
+
+//-------------------------------------------------------------------------
+
+// copy ctor
+SfxTemplateItem::SfxTemplateItem( const SfxTemplateItem& rCopy ) :
+
+ SfxFlagItem( rCopy ),
+
+ aStyle( rCopy.aStyle )
+{
+}
+
+//-------------------------------------------------------------------------
+
+// op ==
+
+int SfxTemplateItem::operator==( const SfxPoolItem& rCmp ) const
+{
+ return ( SfxFlagItem::operator==( rCmp ) &&
+ aStyle == ( (const SfxTemplateItem&)rCmp ).aStyle );
+}
+
+//-------------------------------------------------------------------------
+
+SfxPoolItem* SfxTemplateItem::Clone( SfxItemPool *) const
+{
+ return new SfxTemplateItem(*this);
+}
+
+//-------------------------------------------------------------------------
+
+BYTE SfxTemplateItem::GetFlagCount() const
+{
+ return sizeof(USHORT) * 8;
+}
+
+
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
new file mode 100644
index 000000000000..54a8f5fb6904
--- /dev/null
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -0,0 +1,351 @@
+/*************************************************************************
+ *
+ * $RCSfile: versdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <svtools/eitem.hxx>
+#include <svtools/intitem.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/itemset.hxx>
+#include <vcl/msgbox.hxx>
+
+#include "versdlg.hrc"
+#include "versdlg.hxx"
+#include "viewfrm.hxx"
+#include "sfxresid.hxx"
+#include "docfile.hxx"
+#include "objsh.hxx"
+#include "sfxsids.hrc"
+#include "dispatch.hxx"
+#include "inimgr.hxx"
+#include "request.hxx"
+
+// **************************************************************************
+
+static String ConvertDateTime_Impl(const SfxStamp &rTime)
+{
+ const String pDelim ( DEFINE_CONST_UNICODE( ", "));
+ const International& rInter = Application::GetAppInternational();
+ String aStr(rInter.GetDate(rTime.GetTime()));
+ aStr += pDelim;
+ aStr += rInter.GetTime(rTime.GetTime(), TRUE, FALSE);
+ return aStr;
+}
+
+// Achtung im Code wird dieses Array direkt (0, 1, ...) indiziert
+static long nTabs_Impl[] =
+{
+ 3, // Number of Tabs
+ 0, 62, 124
+};
+
+void SfxVersionsTabListBox_Impl::KeyInput( const KeyEvent& rKeyEvent )
+{
+ const KeyCode& rCode = rKeyEvent.GetKeyCode();
+ switch ( rCode.GetCode() )
+ {
+ case KEY_RETURN :
+ case KEY_ESCAPE :
+ case KEY_TAB :
+ Window::GetParent()->KeyInput( rKeyEvent );
+ break;
+ default:
+ SvTabListBox::KeyInput( rKeyEvent );
+ break;
+ }
+}
+
+SfxVersionsTabListBox_Impl::SfxVersionsTabListBox_Impl( Window* pParent, const ResId& rResId )
+ : SvTabListBox( pParent, rResId )
+{
+}
+
+SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pFrame, Window *pParent )
+ : SfxModalDialog( pFrame, pParent, SfxResId( DLG_VERSIONS ) )
+ , aNewGroup( this, ResId( GB_NEWVERSIONS ) )
+ , aSaveButton( this, ResId( PB_SAVE ) )
+ , aSaveCheckBox( this, ResId( CB_SAVEONCLOSE ) )
+ , aExistingGroup( this, ResId( GB_OLDVERSIONS ) )
+ , aDateTimeText( this, ResId( FT_DATETIME ) )
+ , aSavedByText( this, ResId( FT_SAVEDBY ) )
+ , aCommentText( this, ResId( FT_COMMENTS ) )
+ , aVersionBox( this, ResId( TLB_VERSIONS ) )
+ , aViewButton( this, ResId( PB_VIEW ) )
+ , aOpenButton( this, ResId( PB_OPEN ) )
+ , aDeleteButton( this, ResId( PB_DELETE ) )
+ , aCompareButton( this, ResId( PB_COMPARE ) )
+ , aCloseButton( this, ResId( PB_CLOSE ) )
+ , aHelpButton( this, ResId ( PB_HELP ) )
+ , pViewFrame( pFrame )
+{
+ FreeResource();
+
+ aViewButton.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+ aSaveButton.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+ aDeleteButton.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+ aCompareButton.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+ aCloseButton.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+ aOpenButton.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+ aVersionBox.SetSelectHdl( LINK( this, SfxVersionDialog, SelectHdl_Impl ) );
+ aVersionBox.SetDoubleClickHdl( LINK( this, SfxVersionDialog, DClickHdl_Impl ) );
+ aSaveCheckBox.SetClickHdl ( LINK( this, SfxVersionDialog, ButtonHdl_Impl ) );
+
+ aVersionBox.GrabFocus();
+ aVersionBox.SetWindowBits( WB_HSCROLL | WB_CLIPCHILDREN );
+ aVersionBox.SetSelectionMode( SINGLE_SELECTION );
+ aVersionBox.SetTabs( &nTabs_Impl[0], MAP_APPFONT );
+ aVersionBox.Resize(); // OS: Hack fuer richtige Selektion
+ Init_Impl();
+}
+
+void SfxVersionDialog::Init_Impl()
+{
+ SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
+ SfxMedium* pMedium = pObjShell->GetMedium();
+ const SfxVersionTableDtor* pTable = pMedium->GetVersionList();
+ if ( pTable )
+ {
+ for ( USHORT n=0; n<pTable->Count(); n++ )
+ {
+ SfxVersionInfo *pInfo = pTable->GetObject(n);
+ String aEntry = ConvertDateTime_Impl( pInfo->aCreateStamp );
+ aEntry += '\t';
+ aEntry += pInfo->aCreateStamp.GetName();
+ aEntry += '\t';
+ aEntry += pInfo->aComment;
+ SvLBoxEntry *pEntry = aVersionBox.InsertEntry( aEntry );
+ pEntry->SetUserData( pInfo );
+ }
+ }
+
+ aSaveCheckBox.Check( pObjShell->GetDocInfo().IsSaveVersionOnClose() );
+
+ aOpenButton.Enable( FALSE );
+ aSaveButton.Enable( !pObjShell->IsReadOnly() );
+ aSaveCheckBox.Enable( !pObjShell->IsReadOnly() );
+ aDeleteButton.Enable( FALSE );
+
+ const SfxPoolItem *pDummy=NULL;
+ SfxItemState eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_MERGE, pDummy );
+ eState = pViewFrame->GetDispatcher()->QueryState( SID_DOCUMENT_COMPARE, pDummy );
+ aCompareButton.Enable( eState >= SFX_ITEM_AVAILABLE );
+
+ // set dialog title (filename or docinfo title)
+ String sText = GetText();
+ ( sText += ' ' ) += pObjShell->GetTitle();
+ SetText( sText );
+}
+
+SfxVersionDialog::~SfxVersionDialog ()
+{
+}
+
+void SfxVersionDialog::Open_Impl()
+{
+ SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
+
+ SvLBoxEntry *pEntry = aVersionBox.FirstSelected();
+ ULONG nPos = aVersionBox.GetModel()->GetRelPos( pEntry );
+ SfxInt16Item aItem( SID_VERSION, nPos+1 );
+ SfxStringItem aTarget( SID_TARGETNAME, DEFINE_CONST_UNICODE("_blank") );
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE("private:user") );
+ SfxStringItem aFile( SID_FILE_NAME, pObjShell->GetMedium()->GetName() );
+ pViewFrame->GetDispatcher()->Execute(
+ SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aFile, &aItem, &aTarget, &aReferer, 0L );
+ Close();
+}
+
+IMPL_LINK( SfxVersionDialog, DClickHdl_Impl, Control*, pControl )
+{
+ Open_Impl();
+ return 0L;
+}
+
+IMPL_LINK( SfxVersionDialog, SelectHdl_Impl, Control*, pControl )
+{
+ SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
+ SvLBoxEntry *pEntry = aVersionBox.FirstSelected();
+ aDeleteButton.Enable( !pObjShell->IsReadOnly() );
+ aOpenButton.Enable( TRUE );
+ return 0L;
+}
+
+IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
+{
+ SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
+ SvLBoxEntry *pEntry = aVersionBox.FirstSelected();
+
+ if ( pButton == &aCloseButton )
+ {
+ Close();
+ }
+ else if ( pButton == &aSaveCheckBox )
+ {
+ pObjShell->GetDocInfo().SetSaveVersionOnClose( aSaveCheckBox.IsChecked() );
+ pObjShell->SetModified( TRUE );
+ }
+ else if ( pButton == &aSaveButton )
+ {
+ SfxVersionInfo aInfo;
+ aInfo.aCreateStamp = SfxStamp( SFX_INIMANAGER()->GetUserFullName() );
+ SfxViewVersionDialog_Impl* pDlg = new SfxViewVersionDialog_Impl( this, aInfo, TRUE );
+ short nRet = pDlg->Execute();
+ if ( nRet == RET_OK )
+ {
+ SfxStringItem aComment( SID_VERSION, aInfo.aComment );
+ pObjShell->SetModified( TRUE );
+ pViewFrame->GetDispatcher()->Execute(
+ SID_SAVEDOC, SFX_CALLMODE_SYNCHRON, &aComment, 0L );
+ aVersionBox.SetUpdateMode( FALSE );
+ aVersionBox.Clear();
+ Init_Impl();
+ aVersionBox.SetUpdateMode( TRUE );
+ }
+
+ delete pDlg;
+ }
+ if ( pButton == &aDeleteButton && pEntry )
+ {
+ pObjShell->GetMedium()->RemoveVersion_Impl( *(SfxVersionInfo*) pEntry->GetUserData() );
+ pObjShell->SetModified( TRUE );
+ aVersionBox.SetUpdateMode( FALSE );
+ aVersionBox.Clear();
+ Init_Impl();
+ aVersionBox.SetUpdateMode( TRUE );
+ }
+ else if ( pButton == &aOpenButton && pEntry )
+ {
+ Open_Impl();
+ }
+ else if ( pButton == &aViewButton && pEntry )
+ {
+ SfxVersionInfo* pInfo = (SfxVersionInfo*) pEntry->GetUserData();
+ SfxViewVersionDialog_Impl* pDlg = new SfxViewVersionDialog_Impl( this, *pInfo, FALSE );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ else if ( pEntry && pButton == &aCompareButton )
+ {
+ SfxAllItemSet aSet( pObjShell->GetPool() );
+ ULONG nPos = aVersionBox.GetModel()->GetRelPos( pEntry );
+ aSet.Put( SfxInt16Item( SID_VERSION, nPos+1 ) );
+ aSet.Put( SfxStringItem( SID_FILE_NAME, pObjShell->GetMedium()->GetName() ) );
+
+ SfxItemSet* pSet = pObjShell->GetMedium()->GetItemSet();
+ SFX_ITEMSET_ARG( pSet, pFilterItem, SfxStringItem, SID_FILTER_NAME, FALSE );
+ SFX_ITEMSET_ARG( pSet, pFilterOptItem, SfxStringItem, SID_FILE_FILTEROPTIONS, FALSE );
+ if ( pFilterItem )
+ aSet.Put( *pFilterItem );
+ if ( pFilterOptItem )
+ aSet.Put( *pFilterOptItem );
+
+ pViewFrame->GetDispatcher()->Execute( SID_DOCUMENT_COMPARE, SFX_CALLMODE_ASYNCHRON, aSet );
+ Close();
+ }
+
+ return 0L;
+}
+
+SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl ( Window *pParent, SfxVersionInfo& rInfo, BOOL bEdit )
+ : SfxModalDialog( pParent, SfxResId( DLG_COMMENTS ) )
+ , aDateTimeText( this, ResId( FT_DATETIME ) )
+ , aSavedByText( this, ResId( FT_SAVEDBY ) )
+ , aEdit( this, ResId ( ME_VERSIONS ) )
+ , aOKButton( this, ResId( PB_OK ) )
+ , aCancelButton( this, ResId( PB_CANCEL ) )
+ , aCloseButton( this, ResId( PB_CLOSE ) )
+ , aHelpButton( this, ResId ( PB_HELP ) )
+ , pInfo( &rInfo )
+{
+ FreeResource();
+
+ aDateTimeText.SetText( aDateTimeText.GetText().Append(ConvertDateTime_Impl( pInfo->aCreateStamp )) );
+ aSavedByText.SetText( aSavedByText.GetText().Append(pInfo->aCreateStamp.GetName()) );
+ aEdit.SetText( rInfo.aComment );
+
+ aCloseButton.SetClickHdl ( LINK( this, SfxViewVersionDialog_Impl, ButtonHdl ) );
+ aOKButton.SetClickHdl ( LINK( this, SfxViewVersionDialog_Impl, ButtonHdl ) );
+
+ aEdit.GrabFocus();
+ if ( !bEdit )
+ {
+ aOKButton.Hide();
+ aCancelButton.Hide();
+ aEdit.SetReadOnly( TRUE );
+ }
+ else
+ aCloseButton.Hide();
+}
+
+IMPL_LINK( SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton )
+{
+ if ( pButton == &aCloseButton )
+ {
+ EndDialog( RET_CANCEL );
+ }
+ else if ( pButton == &aOKButton )
+ {
+ pInfo->aComment = aEdit.GetText();
+ EndDialog( RET_OK );
+ }
+
+ return 0L;
+}
+
+
diff --git a/sfx2/source/dialog/versdlg.hrc b/sfx2/source/dialog/versdlg.hrc
new file mode 100644
index 000000000000..7ca2fce0eb6c
--- /dev/null
+++ b/sfx2/source/dialog/versdlg.hrc
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: versdlg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <dialog.hrc>
+
+#define GB_NEWVERSIONS 1
+#define PB_SAVE 2
+#define CB_SAVEONCLOSE 3
+#define TLB_VERSIONS 4
+#define PB_DELETE 5
+#define PB_OPEN 6
+#define PB_HELP 7
+#define PB_CLOSE 8
+#define GB_OLDVERSIONS 9
+#define FT_DATETIME 10
+#define FT_SAVEDBY 11
+#define FT_COMMENTS 12
+#define PB_VIEW 13
+#define ME_VERSIONS 14
+#define PB_OK 15
+#define PB_CANCEL 16
+#define PB_COMPARE 17
+#define PB_MERGE 18
+
diff --git a/sfx2/source/dialog/versdlg.src b/sfx2/source/dialog/versdlg.src
new file mode 100644
index 000000000000..659da76934c4
--- /dev/null
+++ b/sfx2/source/dialog/versdlg.src
@@ -0,0 +1,581 @@
+/*************************************************************************
+ *
+ * $RCSfile: versdlg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:31 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "versdlg.hrc"
+ModalDialog DLG_VERSIONS
+{
+ OutputSize = TRUE ;
+ Size = MAP_APPFONT ( 340 , 184 ) ;
+ Text = "Versionen in" ;
+ Text [ English ] = "Versions in" ;
+ SvLook = TRUE ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ GroupBox GB_NEWVERSIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 272 , 31 ) ;
+ Text = "Neue Versionen" ;
+ Text [ English ] = "New versions" ;
+ Text [ english_us ] = "New versions" ;
+ Text [ portuguese_brazilian ] = "Neue Versionen" ;
+ Text [ swedish ] = "Nya versioner" ;
+ Text [ danish ] = "Ny version" ;
+ Text [ italian ] = "Nuove versioni" ;
+ Text [ spanish ] = "Nuevas versiones" ;
+ Text [ french ] = "Nouvelles versions" ;
+ Text [ dutch ] = "Nieuwe versies" ;
+ Text [ portuguese ] = "Novas verses" ;
+ Text[ chinese_simplified ] = "°汾";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nowe wersje";
+ Text[ japanese ] = "Vްޮ";
+ Text[ chinese_traditional ] = "s";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Yeni srmler";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton PB_SAVE
+ {
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 80 , 14 ) ;
+ Text = "~Neue Version speichern" ;
+ Text [ English ] = "~Save new version" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "Save ~New Version" ;
+ Text [ portuguese_brazilian ] = "~Neue Version speichern" ;
+ Text [ swedish ] = "Spara ~ny version" ;
+ Text [ danish ] = "Gem ny version" ;
+ Text [ italian ] = "~Salva la versione nuova" ;
+ Text [ spanish ] = "~Guardar versin nueva" ;
+ Text [ french ] = "~Enregistrer une nouvelle version" ;
+ Text [ dutch ] = "~Nieuwe versie opslaan" ;
+ Text [ portuguese ] = "~Guardar nova verso" ;
+ Text[ chinese_simplified ] = "°汾(~S)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zapisz now wersj";
+ Text[ japanese ] = "Vްޮ݂̕ۑ(~S)";
+ Text[ chinese_traditional ] = "Oss(~S)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " (~N)";
+ Text[ turkish ] = "~Yeni srm kaydet";
+ Text[ language_user1 ] = " ";
+ };
+ CheckBox CB_SAVEONCLOSE
+ {
+ Pos = MAP_APPFONT ( 131 , 16 ) ;
+ Size = MAP_APPFONT ( 144 , 10 ) ;
+ Text = "~Beim Schlieen immer Version speichern" ;
+ Text [ English ] = "~Always save a version on closing" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Always save a version on closing" ;
+ Text [ portuguese_brazilian ] = "~Beim Schlieen immer Version speichern" ;
+ Text [ swedish ] = "~Spara alltid en version vid stngning" ;
+ Text [ danish ] = "Gem version altid ved lukning" ;
+ Text [ italian ] = "~Salva sempre la versione quando chiudi" ;
+ Text [ spanish ] = "Guardar ~versin siempre al cerrar" ;
+ Text [ french ] = "~Toujours enregistrer une version lors de la fermeture" ;
+ Text [ dutch ] = "~Bij sluiten altijd versie opslaan" ;
+ Text [ portuguese ] = "~Guardar sempre uma verso ao fechar" ;
+ Text[ chinese_simplified ] = "ڹرʱDZ汾Ϣ(~A)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zawsze zapisuj wersj przy zamykaniu";
+ Text[ japanese ] = "‚ƂAްޮ݂̕ۑ(~A)";
+ Text[ chinese_traditional ] = "b`OOsT(~A)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ׻ (~A)";
+ Text[ turkish ] = "~Kapatrken daima srm kaydet";
+ Text[ language_user1 ] = " ";
+ };
+ GroupBox GB_OLDVERSIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 40 ) ;
+ Size = MAP_APPFONT ( 272 , 138 ) ;
+ Text = "Vorhandene Versionen" ;
+ Text [ English ] = "Existing versions" ;
+ Text [ english_us ] = "Existing versions" ;
+ Text [ portuguese_brazilian ] = "Vorhandene Versionen" ;
+ Text [ swedish ] = "Befintliga versioner" ;
+ Text [ danish ] = "Eksisterende version" ;
+ Text [ italian ] = "Versioni esistenti" ;
+ Text [ spanish ] = "Versiones existentes" ;
+ Text [ french ] = "Versions existantes" ;
+ Text [ dutch ] = "Bestaande versies" ;
+ Text [ portuguese ] = "Verses existentes" ;
+ Text[ chinese_simplified ] = "ִİ汾";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Istniejce wersje";
+ Text[ japanese ] = "ްޮ";
+ Text[ chinese_traditional ] = "{s";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Mevcut srmler";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_DATETIME
+ {
+ Pos = MAP_APPFONT ( 15 , 51 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text = "Datum und Uhrzeit" ;
+ Text [ English ] = "Date and time" ;
+ Text [ english_us ] = "Date and time" ;
+ Text [ portuguese_brazilian ] = "Datum und Uhrzeit" ;
+ Text [ swedish ] = "Datum och tid" ;
+ Text [ danish ] = "Dato og klokkeslt" ;
+ Text [ italian ] = "Data e ora" ;
+ Text [ spanish ] = "Fecha y hora" ;
+ Text [ french ] = "Date et heure" ;
+ Text [ dutch ] = "Datum en tijd" ;
+ Text [ portuguese ] = "Data e horas" ;
+ Text[ chinese_simplified ] = "ںʱ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Data i godzina";
+ Text[ japanese ] = "tƎ";
+ Text[ chinese_traditional ] = "Mɶ";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = "¥ ð";
+ Text[ turkish ] = "Tarih ve saat";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_SAVEDBY
+ {
+ Pos = MAP_APPFONT ( 76 , 51 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text = "gespeichert von" ;
+ Text [ English ] = "Saved by" ;
+ Text [ english_us ] = "Saved by" ;
+ Text [ portuguese_brazilian ] = "gespeichert von" ;
+ Text [ swedish ] = "Sparad av" ;
+ Text [ danish ] = "gemt af" ;
+ Text [ italian ] = "salvato da" ;
+ Text [ spanish ] = "Guardado por" ;
+ Text [ french ] = "Enregistre par" ;
+ Text [ dutch ] = "opgeslagen door" ;
+ Text [ portuguese ] = "Guardado por" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zapisana przez";
+ Text[ japanese ] = "ۑ";
+ Text[ chinese_traditional ] = "@";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ü";
+ Text[ turkish ] = "Kaydeden";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_COMMENTS
+ {
+ Pos = MAP_APPFONT ( 138 , 51 ) ;
+ Size = MAP_APPFONT ( 60 , 10 ) ;
+ Text = "Kommentar" ;
+ Text [ English ] = "Comments" ;
+ Text [ english_us ] = "Comments" ;
+ Text [ portuguese_brazilian ] = "Kommentar" ;
+ Text [ swedish ] = "Kommentar" ;
+ Text [ danish ] = "Kommentar" ;
+ Text [ italian ] = "Commento" ;
+ Text [ spanish ] = "Comentario" ;
+ Text [ french ] = "Commentaire" ;
+ Text [ dutch ] = "Commentaar" ;
+ Text [ portuguese ] = "Comentrio" ;
+ Text[ chinese_simplified ] = "ע";
+ Text[ russian ] = "";
+ Text[ polish ] = "Komentarz";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "`";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Aklama";
+ Text[ language_user1 ] = " ";
+ };
+ Control TLB_VERSIONS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 64 ) ;
+ Size = MAP_APPFONT ( 260 , 108 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton PB_CLOSE
+ {
+ Pos = MAP_APPFONT ( 284 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "Schlieen" ;
+ Text [ English ] = "Close" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Close" ;
+ Text [ portuguese_brazilian ] = "Schlieen" ;
+ Text [ swedish ] = "Stng" ;
+ Text [ danish ] = "Luk" ;
+ Text [ italian ] = "Chiudi" ;
+ Text [ spanish ] = "Cerrar" ;
+ Text [ french ] = "Fermer" ;
+ Text [ dutch ] = "Sluiten" ;
+ Text [ portuguese ] = "Fechar" ;
+ Text[ chinese_simplified ] = "ر";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zamknij";
+ Text[ japanese ] = "‚";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ݱ(~C)";
+ Text[ turkish ] = "Kapat";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton PB_OPEN
+ {
+ Pos = MAP_APPFONT ( 284 , 26 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "ffnen" ;
+ Text [ English ] = "Open" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "Open" ;
+ Text [ portuguese_brazilian ] = "ffnen" ;
+ Text [ swedish ] = "ppna" ;
+ Text [ danish ] = "bn" ;
+ Text [ italian ] = "Apri" ;
+ Text [ spanish ] = "Abrir" ;
+ Text [ french ] = "Ouvrir" ;
+ Text [ dutch ] = "Openen" ;
+ Text [ portuguese ] = "Abrir" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Otwrz";
+ Text[ japanese ] = "J";
+ Text[ chinese_traditional ] = "}";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "A";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton PB_VIEW
+ {
+ Pos = MAP_APPFONT ( 284 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Anzeigen..." ;
+ Text [ English ] = "~View" ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ Text [ english_us ] = "~Show..." ;
+ Text [ portuguese_brazilian ] = "~Anzeigen..." ;
+ Text [ swedish ] = "Vis~a..." ;
+ Text [ danish ] = "Vis..." ;
+ Text [ italian ] = "~Mostra..." ;
+ Text [ spanish ] = "~Mostrar..." ;
+ Text [ french ] = "~Afficher..." ;
+ Text [ dutch ] = "~Weergeven..." ;
+ Text [ portuguese ] = "~Mostrar..." ;
+ Text[ chinese_simplified ] = "ʾ(~S)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Po~ka...";
+ Text[ japanese ] = "\\(~S)...";
+ Text[ chinese_traditional ] = "(~S)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "ǥ(~S)...";
+ Text[ turkish ] = "~Grntle...";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton PB_DELETE
+ {
+ Pos = MAP_APPFONT ( 284 , 60 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Lschen" ;
+ Text [ English ] = "~Delete" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Delete" ;
+ Text [ portuguese_brazilian ] = "~Lschen" ;
+ Text [ swedish ] = "~Radera" ;
+ Text [ danish ] = "Slet" ;
+ Text [ italian ] = "~Elimina" ;
+ Text [ spanish ] = "~Eliminar" ;
+ Text [ french ] = "~Supprimer" ;
+ Text [ dutch ] = "~Wissen" ;
+ Text [ portuguese ] = "E~liminar" ;
+ Text[ chinese_simplified ] = "ɾ(~D)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Usu";
+ Text[ japanese ] = "폜(~D)";
+ Text[ chinese_traditional ] = "R(~D)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~D)";
+ Text[ turkish ] = "~Sil";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton PB_COMPARE
+ {
+ Pos = MAP_APPFONT ( 284 , 77 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "Vergleichen" ;
+ Text [ English ] = "Compare" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "Compare" ;
+ Text [ portuguese_brazilian ] = "Vergleichen" ;
+ Text [ swedish ] = "~Jmfr" ;
+ Text [ danish ] = "Sammenlign" ;
+ Text [ italian ] = "Confronta" ;
+ Text [ spanish ] = "Comparar" ;
+ Text [ french ] = "Comparer" ;
+ Text [ dutch ] = "Vergelijken" ;
+ Text [ portuguese ] = "Comparar" ;
+ Text[ chinese_simplified ] = "Ƚ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Porw~naj";
+ Text[ japanese ] = "r";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Karlatr";
+ Text[ language_user1 ] = " ";
+ };
+ HelpButton PB_HELP
+ {
+ Pos = MAP_APPFONT ( 284 , 97 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ Text [ portuguese ] = "Verses em" ;
+ Text [ english_us ] = "Versions of" ;
+ Text [ portuguese_brazilian ] = "Versionen in" ;
+ Text [ swedish ] = "Versioner i" ;
+ Text [ danish ] = "Versioner i" ;
+ Text [ italian ] = "Versioni in" ;
+ Text [ spanish ] = "Versiones en" ;
+ Text [ french ] = "Versions de" ;
+ Text [ dutch ] = "Versies in" ;
+ Text[ chinese_simplified ] = "汾";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Wersje w";
+ Text[ japanese ] = "ްޮ";
+ Text[ chinese_traditional ] = "b";
+ Text[ arabic ] = " ";
+ Text[ language_user1 ] = "LS 16.07.99: Erkl?ung laut Help Agent: In der Titelleiste des Dialogs sehen Sie hinter \"Versionen in\" den Dateinamen ohne Pfad oder (wenn gesetzt) den Titel des Dokuments. (z.B. \"Versionen in brief.sdw\". (Warum nicht eher Versionen VON?)";
+ Text[ greek ] = " ";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Mevcut srmler:";
+};
+ModalDialog DLG_COMMENTS
+{
+ OutputSize = TRUE ;
+ Size = MAP_APPFONT ( 180 , 118 ) ;
+ Text = "Versionskommentar eingeben" ;
+ Text [ English ] = "Input version comment" ;
+ SvLook = TRUE ;
+ Moveable = TRUE ;
+ FixedText FT_DATETIME
+ {
+ Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 168 , 10 ) ;
+ Text = "Datum und Uhrzeit : " ;
+ Text [ English ] = "Date and time : " ;
+ Text [ english_us ] = "Date and time : " ;
+ Text [ portuguese_brazilian ] = "Datum und Uhrzeit : " ;
+ Text [ swedish ] = "Datum och tid : " ;
+ Text [ danish ] = "Dato og klokkeslt: " ;
+ Text [ italian ] = "Data e ora : " ;
+ Text [ spanish ] = "Fecha y hora: " ;
+ Text [ french ] = "Date et heure : " ;
+ Text [ dutch ] = "Datum en tijd : " ;
+ Text [ portuguese ] = "Data e horas : " ;
+ Text[ chinese_simplified ] = "ںʱ䣺 ";
+ Text[ russian ] = " : ";
+ Text[ polish ] = "Data i godzina : ";
+ Text[ japanese ] = "tƎ: ";
+ Text[ chinese_traditional ] = "MɶG ";
+ Text[ arabic ] = " : ";
+ Text[ greek ] = " : ";
+ Text[ korean ] = "¥ ð : ";
+ Text[ turkish ] = "Tarih ve saat : ";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_SAVEDBY
+ {
+ Pos = MAP_APPFONT ( 6 , 19 ) ;
+ Size = MAP_APPFONT ( 168 , 10 ) ;
+ Text = "gespeichert von " ;
+ Text [ English ] = "Saved by " ;
+ Text [ english_us ] = "Saved by " ;
+ Text [ portuguese_brazilian ] = "gespeichert von " ;
+ Text [ swedish ] = "sparat av " ;
+ Text [ danish ] = "gemt af " ;
+ Text [ italian ] = "salvato da " ;
+ Text [ spanish ] = "guardado por " ;
+ Text [ french ] = "Enregistr par " ;
+ Text [ dutch ] = "opgeslagen door " ;
+ Text [ portuguese ] = "Guardado por " ;
+ Text[ chinese_simplified ] = " ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "zapisany przez ";
+ Text[ japanese ] = "ۑ ";
+ Text[ chinese_traditional ] = "@ ";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ü ";
+ Text[ turkish ] = "Kaydeden ";
+ Text[ language_user1 ] = " ";
+ };
+ MultiLineEdit ME_VERSIONS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 32 ) ;
+ Size = MAP_APPFONT ( 168 , 60 ) ;
+ TabStop = TRUE ;
+ };
+ OKButton PB_OK
+ {
+ Pos = MAP_APPFONT ( 15 , 98 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton PB_CANCEL
+ {
+ Pos = MAP_APPFONT ( 68 , 98 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ PushButton PB_CLOSE
+ {
+ Pos = MAP_APPFONT ( 68 , 98 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Schlieen" ;
+ Text [ English ] = "~Close" ;
+ TabStop = TRUE ;
+ Text [ english_us ] = "~Close" ;
+ Text [ portuguese_brazilian ] = "~Schlieen" ;
+ Text [ swedish ] = "~Stng" ;
+ Text [ danish ] = "Luk" ;
+ Text [ italian ] = "~Chiudi" ;
+ Text [ spanish ] = "~Cerrar" ;
+ Text [ french ] = "~Fermer" ;
+ Text [ dutch ] = "~Sluiten" ;
+ Text [ portuguese ] = "~Fechar" ;
+ Text[ chinese_simplified ] = "ر(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zamknij";
+ Text[ japanese ] = "‚(~C)";
+ Text[ chinese_traditional ] = "(~C)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ݱ(~C)";
+ Text[ turkish ] = "~Kapat";
+ Text[ language_user1 ] = " ";
+ };
+ HelpButton PB_HELP
+ {
+ Pos = MAP_APPFONT ( 124 , 98 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ Text [ english_us ] = "Insert Version Comment" ;
+ Text [ portuguese_brazilian ] = "Versionskommentar eingeben" ;
+ Text [ swedish ] = "Mata in versionskommentar" ;
+ Text [ danish ] = "Indst versionskommentar" ;
+ Text [ italian ] = "Inserisci commento versioni" ;
+ Text [ spanish ] = "Escribir comentario sobre la versin" ;
+ Text [ french ] = "Saisie du commentaire de version (facultatif)" ;
+ Text [ dutch ] = "Versiecommentaar invoeren" ;
+ Text [ portuguese ] = "Inserir comentrio sobre verso" ;
+ Text[ chinese_simplified ] = "汾ע";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Wprowad komentarz do wersji";
+ Text[ japanese ] = "ްޮݺĂ̓";
+ Text[ chinese_traditional ] = "J`";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " Է";
+ Text[ turkish ] = "Srm aklamas ekle";
+ Text[ language_user1 ] = " ";
+};
+String DLG_COMMENTS
+{
+ Text = "Versionskommentar" ;
+ Text [ English ] = "Version comment" ;
+ Text [ portuguese ] = "Comentrio sobre verso" ;
+ Text [ english_us ] = "Version comment" ;
+ Text [ portuguese_brazilian ] = "Versionskommentar" ;
+ Text [ swedish ] = "Versionskommentar" ;
+ Text [ danish ] = "Versionskommentar" ;
+ Text [ italian ] = "Commento versioni" ;
+ Text [ spanish ] = "Comentario sobre la versin" ;
+ Text [ french ] = "Commentaire de version" ;
+ Text [ dutch ] = "Versiecommentaar" ;
+ Text[ chinese_simplified ] = "汾ע";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Komentarz do wersji";
+ Text[ japanese ] = "ްޮݺ";
+ Text[ chinese_traditional ] = "`";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Srm aklamas";
+ Text[ language_user1 ] = " ";
+};
diff --git a/sfx2/source/doc/doc.hrc b/sfx2/source/doc/doc.hrc
new file mode 100644
index 000000000000..73e672160d9f
--- /dev/null
+++ b/sfx2/source/doc/doc.hrc
@@ -0,0 +1,178 @@
+/*************************************************************************
+ *
+ * $RCSfile: doc.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_DOC_HRC
+#define _SFX_DOC_HRC
+
+#include "sfx.hrc"
+
+// #defines *****************************************************************
+
+#define STR_NODEFPRINTER (RID_SFX_DOC_START+ 0)
+#define STR_PRINTER_NOTAVAIL_1 (RID_SFX_DOC_START+ 1)
+#define STR_PRINTER_NOTAVAIL_2 (RID_SFX_DOC_START+ 2)
+#define STR_PRINTER_NOTAVAIL_3 (RID_SFX_DOC_START+ 3)
+#define STR_PRINTER_NOTAVAIL_4 (RID_SFX_DOC_START+ 4)
+#define STR_PRINTER_NOTAVAIL_5 (RID_SFX_DOC_START+ 5)
+#define STR_PRINT_OPTIONS (RID_SFX_DOC_START+ 6)
+#define STR_ERROR_PRINTER_BUSY (RID_SFX_DOC_START+ 7)
+#define STR_NOSTARTPRINTER (RID_SFX_DOC_START+ 8)
+#define MSG_CONFIRM_FILTER (RID_SFX_DOC_START+11)
+#define MSG_CONFIRM_OVERWRITE_TEMPLATE (RID_SFX_DOC_START+12)
+#define MSG_QUERY_LOAD_TEMPLATE (RID_SFX_DOC_START+13)
+
+#define STR_DELETE_REGION (RID_SFX_DOC_START+14)
+#define STR_DELETE_TEMPLATE (RID_SFX_DOC_START+15)
+#define MSG_REGION_NOTEMPTY (RID_SFX_DOC_START+17)
+
+#define DLG_NEW_FILE (RID_SFX_DOC_START+1)
+#define DLG_DOC_TEMPLATE (RID_SFX_DOC_START+2)
+#define DLG_ORGANIZE (RID_SFX_DOC_START+3)
+
+#define BMP_STYLES_CLOSED (RID_SFX_DOC_START+ 0)
+#define BMP_STYLES_OPENED (RID_SFX_DOC_START+ 1)
+
+#define BMP_STYLES_FAMILY1 (RID_SFX_DOC_START+ 2)
+#define BMP_STYLES_FAMILY2 (RID_SFX_DOC_START+ 3)
+#define BMP_STYLES_FAMILY3 (RID_SFX_DOC_START+ 4)
+#define BMP_STYLES_FAMILY4 (RID_SFX_DOC_START+ 5)
+
+#define STR_STYLES (RID_SFX_DOC_START+ 18)
+#define STR_MACROS (RID_SFX_DOC_START+ 19)
+
+#define STR_PRINT_STYLES (RID_SFX_DOC_START+ 20)
+#define STR_PRINT_STYLES_HEADER (RID_SFX_DOC_START+ 21)
+#define MSG_PRINT_ERROR (RID_SFX_DOC_START+ 22)
+#define STR_BACKUP_COPY (RID_SFX_DOC_START+ 23)
+#define MSG_WARNING_BACKUP (RID_SFX_DOC_START+ 24)
+#define MSG_CANT_OPEN_TEMPLATE (RID_SFX_DOC_START+ 25)
+#define MSG_VIEW_OPEN_CANT_SAVE (RID_SFX_DOC_START+ 26)
+#define STR_ERROR_SAVE (RID_SFX_DOC_START+ 27)
+#define STR_TEMPLATE_FILTER (RID_SFX_DOC_START+ 28)
+#define STR_ERROR_COPY_TEMPLATE (RID_SFX_DOC_START+ 29)
+
+#define STR_ERROR_DELETE_TEMPLATE (RID_SFX_DOC_START+ 30)
+#define STR_ERROR_MOVE_TEMPLATE (RID_SFX_DOC_START+ 32)
+#define MSG_ERROR_RESCAN (RID_SFX_DOC_START+ 33)
+#define STR_ERROR_SAVE_TEMPLATE (RID_SFX_DOC_START+ 34)
+#define MSG_ERROR_RENAME_TEMPLATE (RID_SFX_DOC_START+ 34)
+#define MSG_ERROR_RENAME_TEMPLATE_REGION (RID_SFX_DOC_START+ 35)
+#define STR_CONFIG (RID_SFX_DOC_START+ 37)
+#define MSG_ERROR_EMPTY_NAME (RID_SFX_DOC_START+ 37)
+#define MSG_ERROR_UNIQ_NAME (RID_SFX_DOC_START+ 38)
+#define STR_QUERY_DEFAULT_TEMPLATE (RID_SFX_DOC_START+ 39)
+#define MSG_QUERY_RESET_DEFAULT_TEMPLATE (RID_SFX_DOC_START+ 39)
+#define MSG_TEMPLATE_DIR_NOT_EXIST (RID_SFX_DOC_START+ 40)
+#define MSG_DOCINFO_CANTREAD (RID_SFX_DOC_START+ 41)
+#define STR_ERROR_NOSTORAGE (RID_SFX_DOC_START+ 42)
+#define STR_QUERY_SAVEOWNFORMAT (RID_SFX_DOC_START+ 43)
+#define STR_QUERY_MUSTOWNFORMAT (RID_SFX_DOC_START+ 44)
+#define STR_SAVEDOC (RID_SFX_DOC_START+ 45)
+#define STR_UPDATEDOC (RID_SFX_DOC_START+ 46)
+#define STR_SAVEASDOC (RID_SFX_DOC_START+ 47)
+#define STR_SAVECOPYDOC (RID_SFX_DOC_START+ 48)
+#define STR_CLOSEDOC (RID_SFX_DOC_START+ 49)
+#define STR_CLOSEDOC_ANDRETURN (RID_SFX_DOC_START+ 50)
+#define STR_WIZARD (RID_SFX_DOC_START+ 51)
+#define RID_STR_FILTCONFIG (RID_SFX_DOC_START+ 52)
+#define RID_STR_FILTBASIC (RID_SFX_DOC_START+ 53)
+#define RID_STR_WARNSTYLEOVERWRITE (RID_SFX_DOC_START+ 54)
+#define RID_DLSTATUS (RID_SFX_DOC_START+ 55)
+#define RID_DLSTATUS2 (RID_SFX_DOC_START+ 56)
+
+#define STR_DOC_LOADING (RID_SFX_DOC_START+ 57)
+#define MSG_OPEN_READONLY (RID_SFX_DOC_START+ 58)
+
+#define RID_OFFICEFILTER (RID_SFX_DOC_START+ 59)
+#define RID_OFFICEFILTER_WILDCARD (RID_SFX_DOC_START+ 60)
+#define RID_OFFICEFILTER_MACTYPE (RID_SFX_DOC_START+ 61)
+#define RID_OFFICEFILTER_OS2TYPE (RID_SFX_DOC_START+ 62)
+#define STR_FRAMEOBJECT_PROPERTIES (RID_SFX_DOC_START+ 63)
+
+#define STR_FSET_FILTERNAME0 (RID_SFX_DOC_START+ 64)
+#define STR_FSET_FILTERNAME1 (RID_SFX_DOC_START+ 65)
+
+#define STR_TEMPL_MOVED (RID_SFX_DOC_START+ 66)
+#define STR_TEMPL_RESET (RID_SFX_DOC_START+ 67)
+#define STR_AUTOMATICVERSION (RID_SFX_DOC_START+ 68)
+
+#define STR_DOCTYPENAME_SW (RID_SFX_DOC_START+ 69)
+#define STR_DOCTYPENAME_SWWEB (RID_SFX_DOC_START+ 70)
+#define STR_DOCTYPENAME_SWGLOB (RID_SFX_DOC_START+ 71)
+#define STR_DOCTYPENAME_SC (RID_SFX_DOC_START+ 72)
+#define STR_DOCTYPENAME_SI (RID_SFX_DOC_START+ 73)
+#define STR_DOCTYPENAME_SD (RID_SFX_DOC_START+ 74)
+#define STR_DOCTYPENAME_MESSAGE (RID_SFX_DOC_START+ 75)
+#define RID_STR_NEW_TASK (RID_SFX_DOC_START+ 76)
+
+#define STR_SAVEANDCLOSE (RID_SFX_DOC_START+ 77)
+#define STR_NOSAVEANDCLOSE (RID_SFX_DOC_START+ 78)
+#define STR_PACKNGO_NOACCESS (RID_SFX_DOC_START+ 79)
+#define STR_PACKNGO_NEWMEDIUM (RID_SFX_DOC_START+ 80)
+
+#define DLOAD_URL 1
+#define DLOAD_STATUS 2
+#define DLOAD_NAME 3
+#define DLOAD_TEXT 4
+#define DLOAD_CANCEL 1
+
+
+#endif
+
diff --git a/sfx2/source/doc/doc.src b/sfx2/source/doc/doc.src
new file mode 100644
index 000000000000..f54c436fa449
--- /dev/null
+++ b/sfx2/source/doc/doc.src
@@ -0,0 +1,2066 @@
+/*************************************************************************
+ *
+ * $RCSfile: doc.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "sfx.hrc"
+#include "doc.hrc"
+#define __RSC
+#include <svtools/inetdef.hxx>
+#include <so3/so2defs.hxx>
+
+ // -----------------------------------------------------------------------
+QueryBox MSG_CONFIRM_FILTER
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_YES ;
+ Message = "Beim Speichern in Fremdformate kann ein\nInformationsverlust aufgetreten sein. Trotzdem schlieen?" ;
+ Message [ English ] = "Saving in foreign formats might have caused\nlossage of information. Close anyway?" ;
+ Message [ norwegian ] = "Lagring i ukjent format kan forrsake\ntap av informasjon." ;
+ Message [ italian ] = "Salvare in formati estranei pu causare\nla perdita di informazioni. Chiudere lo stesso?" ;
+ Message [ portuguese_brazilian ] = "Gravar em formatos estrangeiros poder provocar \na perda de Informaes." ;
+ Message [ portuguese ] = "Ao guardar em formatos estranhos poder provocar \na perda de informaes. Mesmo assim, guardar?" ;
+ Message [ finnish ] = "Tallentaminen vieraaseen muotoon voi\naiheuttaa tietojen katoamista." ;
+ Message [ danish ] = "Lagring i fremmedformater kan have forrsaget\ninformationstab. Vil du lukke alligevel?" ;
+ Message [ french ] = "L'enregistrement dans un format externe peut entraner\nune perte de certaines informations. Voulez-vous vraiment poursuivre ?" ;
+ Message [ swedish ] = "Sparar Du i ett frmmande format kan\ninformation g frlorad. Stnga nd?" ;
+ Message [ dutch ] = "Bij het opslaan in een extern formaat kan\ninformatie verloren gegaan zijn. Toch sluiten?" ;
+ Message [ spanish ] = "Al guardar en formatos extraos podra haberse provocado una prdida\nde informacin. Desea cerrar de todas formas?" ;
+ Message [ english_us ] = "Saving in external formats may have caused\n information loss. Do you still want to close?" ;
+ Message[ chinese_simplified ] = "ļ̳һĸʽʱ\nܻʧϢ\nҪرļ";
+ Message[ russian ] = " \n . ?";
+ Message[ polish ] = "Podczas zapisu w obcych formatach n\nmoe doj do utraty informacji. Mimo to zamkn?";
+ Message[ japanese ] = "Oŕۑ\n񂪎”\\܂B‚Ă낵ł?";
+ Message[ chinese_traditional ] = "bxs@ӥ~Ӫ榡\nTi|yC\n٬OnoӤH";
+ Message[ arabic ] = " \n . ߿";
+ Message[ dutch ] = "Bij het opslaan in een extern formaat kan\ninformatie verloren gegaan zijn. Toch sluiten?";
+ Message[ chinese_simplified ] = "ļ̳һĸʽʱ\nܻʧϢ\nҪرļ";
+ Message[ greek ] = " \n . ;";
+ Message[ korean ] = "ܺ \n սǵ ֽϴ. ׷ ðڽϱ?";
+ Message[ turkish ] = "Yabanc formatla kaydederken verin\nkayb olumu olabilir. Yine de kapatmak istiyor musunuz?";
+ Message[ language_user1 ] = " ";
+};
+QueryBox MSG_CONFIRM_OVERWRITE_TEMPLATE
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ Message = "Es existiert bereits eine Vorlage mit diesem Namen.\nSoll sie berschrieben werden?" ;
+ Message [ English ] = "Name already in use.\nOverride document template?" ;
+ Message [ norwegian ] = "Navnet er allerede i bruk.\nIgnorer dokumentmal?" ;
+ Message [ italian ] = "Nome gi in uso.\nSovrascrivere il modello di documento?" ;
+ Message [ portuguese_brazilian ] = "Nome j em uso.\nSobregravar o modelo do documento?" ;
+ Message [ portuguese ] = "J existe um modelo com este nome.\nSobregravar o modelo do documento?" ;
+ Message [ finnish ] = "Nimi on jo kytss.\nOhitetaanko asiakirjamalli?" ;
+ Message [ danish ] = "Der eksisterer allerede et dokument med dette navn.\nSkal det erstattes?" ;
+ Message [ french ] = "Un modle de ce nom existe dj.\nRemplacer le modle existant ?" ;
+ Message [ swedish ] = "Det finns redan en mall med det hr namnet.\nVill Du skriva ver den?" ;
+ Message [ dutch ] = "Er bestaat reeds een sjabloon met deze naam.\nOverschrijven?" ;
+ Message [ spanish ] = "Ya existe una plantilla con este nombre.\nDesea sobrescribirla?" ;
+ Message [ english_us ] = "Name already in use.\nDo you want to overwrite document template?" ;
+ Message[ chinese_simplified ] = "һͬʽѾڡ\nҪд";
+ Message[ russian ] = " .\n?";
+ Message[ polish ] = "Ju istnieje szablon o tej nazwie.\nCzy go zastpi innym?";
+ Message[ japanese ] = "łɂ̖OڰĂ܂B\n㏑Ă낵ł?";
+ Message[ chinese_traditional ] = "@ӦPW˦wgsbC\nznмgH";
+ Message[ arabic ] = " .\n ";
+ Message[ dutch ] = "Er bestaat reeds een sjabloon met deze naam.\nOverschrijven?";
+ Message[ chinese_simplified ] = "һͬʽѾڡ\nҪд";
+ Message[ greek ] = " .\n ;";
+ Message[ korean ] = " ̸ ̹ ֽϴ.\n ðڽϱ?";
+ Message[ turkish ] = "Ayn ad tayan bir ablon zaten mevcut.\nBu ablonun zerine yazlsn m?";
+ Message[ language_user1 ] = " ";
+};
+QueryBox MSG_QUERY_LOAD_TEMPLATE
+{
+ BUTTONS = WB_YES_NO ;
+ DEFBUTTON = WB_DEF_NO ;
+ HelpId = MSG_QUERY_LOAD_TEMPLATE;
+
+ MESSAGE = "Die Formatvorlagen dieses Dokuments stimmen nicht mit Ihren aktuellen Vorlagen berein. Sollen Ihre aktuellen Vorlagen auf dieses Dokument angewendet werden?" ;
+ MESSAGE [ English ] = "Die Formatvorlagen dieses Dokuments stimmen nicht mit Ihren aktuellen Vorlagen berein. Sollen Ihre aktuellen Vorlagen auf dieses Dokument angewendet werden?" ;
+ MESSAGE[ english_us ] = "The Styles in this document do not match your current Styles. Should your current Styles be applied to this document?";
+ MESSAGE[ portuguese ] = "Os estilos de formato deste documento no coincidem com os estilos actuais. Aplicar os seus estilos actuais a este documento?";
+ MESSAGE[ russian ] = " .\n ?";
+ MESSAGE[ dutch ] = "De sjablonen bij dit document komen niet overeen met uw actuele sjablonen. Wilt u dat uw actuele sjablonen op dit documentworden toegepast?";
+ MESSAGE[ french ] = "Les styles de format utiliss dans ce document ne concordent pas avec les styles actifs.\nSouhaitez-vous appliquer les styles actifs dans ce document ?";
+ MESSAGE[ spanish ] = "Los estilos de este documento no coinciden con sus estilos actuales.\nDesea aplicar sus estilos actuales a este documento?";
+ MESSAGE[ italian ] = "I modelli del documento non corrispondono ai modelli attuali.\nApplicare i modelli attuali al documento?";
+ MESSAGE[ danish ] = "Dette dokuments formattypografi svarer ikke til din aktuelle skabelon. Skal den aktuelle skabelon anvendes p dette dokument?";
+ MESSAGE[ swedish ] = "Det hr dokumentets formatmall stmmer inte verens med den aktuella mallen. Skall Din aktuella mall anvndas i det hr dokumentet?";
+ MESSAGE[ polish ] = "Style formatu w tym dokumencie nie zgadzaj si z aktualnymi szablonami.\nCzy zastosowa twoje aktualne szablony do tego dokumentu?";
+ MESSAGE[ portuguese_brazilian ] = "O modelo do documento foi modificado.\nDeseja atualizar o modelo no documento?";
+ MESSAGE[ japanese ] = "޷Ă̏ق݂͌̽قƈv܂B\n݂̽ق޷ĂɓKp܂H";
+ MESSAGE[ chinese_simplified ] = "ĵĸʽʽѾġ\nҪõǰʽдĵ";
+ MESSAGE[ chinese_traditional ] = "oɮ׼˦wgܧC\nznsoӼ˦H";
+ MESSAGE[ arabic ] = " . Ͽ";
+ MESSAGE[ dutch ] = "De sjablonen bij dit document komen niet overeen met uw actuele sjablonen. Wilt u dat uw actuele sjablonen op dit documentworden toegepast?";
+ MESSAGE[ chinese_simplified ] = "ĵĸʽʽѾġ\nҪõǰʽдĵ";
+ MESSAGE[ greek ] = " . ;";
+ MESSAGE[ korean ] = " ġ ʽϴ. Ͻðڽϱ?";
+ MESSAGE[ turkish ] = "Bu belgenin biimleri, yrrlkteki biimlerle rtmyor. Yrrlkteki biimler bu belgenize uygulansn m?";
+ MESSAGE[ language_user1 ] = " ";
+};
+String STR_DELETE_REGION
+{
+ TEXT = "Soll der Bereich \"$1\" gelscht werden?" ;
+ TEXT [ English ] = "Delete region \"$1\"?" ;
+ Text [ english_us ] = "Are you sure you want to delete the region \"$1\"?" ;
+ Text [ portuguese_brazilian ] = "Apagar regiao" ;
+ Text [ swedish ] = "Skall omrdet \"$1\" raderas?" ;
+ Text [ danish ] = "Er du sikker p, at du vil slette omrdet \"$1\"?" ;
+ Text [ italian ] = "Eliminare la categoria \"$1\"?" ;
+ Text [ spanish ] = "Desea eliminar el rea \"$1\"?" ;
+ Text [ french ] = "Voulez-vous vraiment supprimer la catgorie $1?" ;
+ Text [ dutch ] = "Wilt u het bereik \"$1\" wissen?" ;
+ Text [ portuguese ] = "Eliminar realmente a categoria \"$1\"?" ;
+ Text[ chinese_simplified ] = "Ҫɾ $1 ";
+ Text[ russian ] = " \"$1\"?";
+ Text[ polish ] = "Czy usun obszar \"$1\"?";
+ Text[ japanese ] = "͈\"$1\"폜܂?";
+ Text[ chinese_traditional ] = "nRoӰϰ $1H";
+ Text[ arabic ] = " \"$1\"";
+ Text[ dutch ] = "Wilt u het bereik \"$1\" wissen?";
+ Text[ chinese_simplified ] = "Ҫɾ $1 ";
+ Text[ greek ] = " $1?";
+ Text[ korean ] = "$1 Ͻðڽϱ?";
+ Text[ turkish ] = "\"$1\" blm silinsin mi?";
+ Text[ language_user1 ] = " ";
+};
+String STR_DELETE_TEMPLATE
+{
+ TEXT = "Soll der Eintrag \"$1\" gelscht werden?" ;
+ TEXT [ English ] = "Delete entry \"$1\"?" ;
+ Text [ english_us ] = "Are you sure you want to delete the entry \"$1\"?" ;
+ Text [ portuguese_brazilian ] = "Apagar modelo" ;
+ Text [ swedish ] = "Skall posten \"$1\" raderas?" ;
+ Text [ danish ] = "Er du sikker p, at du vil slette elementet \"$1\"?" ;
+ Text [ italian ] = "Volete eliminare la voce \"$1\"?" ;
+ Text [ spanish ] = "Desea eliminar la entrada \"$1\"?" ;
+ Text [ french ] = "Voulez-vous vraiment supprimer l'entre $1?" ;
+ Text [ dutch ] = "Wilt u item \"$1\" wissen?" ;
+ Text [ portuguese ] = "Deseja realmente eliminar a entrada \"$1\"?" ;
+ Text[ chinese_simplified ] = "ҪɾĿ $1 ";
+ Text[ russian ] = " \"$1\"?";
+ Text[ polish ] = "Usun wpis \"$1\"?";
+ Text[ japanese ] = "͍\"$1\"폜܂?";
+ Text[ chinese_traditional ] = "nRoӶ $1 H";
+ Text[ arabic ] = " \"$1\"";
+ Text[ dutch ] = "Wilt u item \"$1\" wissen?";
+ Text[ chinese_simplified ] = "ҪɾĿ $1 ";
+ Text[ greek ] = " $1;";
+ Text[ korean ] = "׸$1 Ͻðڽϱ?";
+ Text[ turkish ] = "\"$1\" girii silinsin mi?";
+ Text[ language_user1 ] = " ";
+};
+QueryBox MSG_REGION_NOTEMPTY
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ Message = "Der Bereich ist nicht leer.\nTrotzdem lschen?" ;
+ Message [ English ] = "Region not empty.\nDelete anyway?" ;
+ Message [ norwegian ] = "Omrdet er ikke tomt.\nSlett likevel?" ;
+ Message [ italian ] = "L'area non vuota.\nVolete eliminarla lo stesso?" ;
+ Message [ portuguese_brazilian ] = "Regiao no est vazia.\nApagar de qualquer modo?" ;
+ Message [ portuguese ] = "A categoria no est vazia.\nMesmo assim, eliminar?" ;
+ Message [ finnish ] = "Alue ei ole tyhj.\nPoistetaanko se silti?" ;
+ Message [ danish ] = "Omrdet er ikke tomt.\nVil du slette alligevel?" ;
+ Message [ french ] = "La catgorie n'est pas vide.\nSupprimer quand mme ?" ;
+ Message [ swedish ] = "Omrdet r ej tomt.\nRadera nd?" ;
+ Message [ dutch ] = "Het bereik is niet leeg.\nToch verwijderen?" ;
+ Message [ spanish ] = "El rea no est vaca.\nDesea eliminarla de todas formas?" ;
+ Message [ english_us ] = "The category is not empty.\nDelete anyway?" ;
+ Message[ chinese_simplified ] = "ݡ\nҪɾ";
+ Message[ russian ] = " .\n ?";
+ Message[ polish ] = "Obszar nie jest pusty.\nMimo to usun?";
+ Message[ japanese ] = "͈͂͋ł͂܂B\nł폜܂?";
+ Message[ chinese_traditional ] = "oӰϰtơC\n٬OnRH";
+ Message[ arabic ] = " .\n ߿";
+ Message[ dutch ] = "Het bereik is niet leeg.\nToch verwijderen?";
+ Message[ chinese_simplified ] = "ݡ\nҪɾ";
+ Message[ greek ] = " .\n ;";
+ Message[ korean ] = " ʽϴ.\n׷ Ͻðڽϱ?";
+ Message[ turkish ] = "Kategori bo deil.\nYine de silinsin mi?";
+ Message[ language_user1 ] = " ";
+};
+String STR_QUERY_SAVE_DOCUMENT
+{
+ Text = "Das Dokument \"$(DOC)\" wurde gendert.\nSollen die nderungen gespeichert werden?" ;
+ Text [ English ] = "The Document \"$(DOC)\" has been modified.\nDo you want to save your changes?" ;
+ Text [ norwegian ] = "Dokumentet \"$(DOC)\" har blitt endret.\nVil du lagre endringene dine?" ;
+ Text [ italian ] = "Il documento \"$(DOC)\" stato modificato.\nVolete salvare le modifiche?" ;
+ Text [ portuguese_brazilian ] = "O documento '$(DOC)' foi modificado.\nDeseja gravar as modificaes?" ;
+ Text [ portuguese ] = "O documento \"$(DOC)\" foi modificado.\nGuardar modificaes?" ;
+ Text [ finnish ] = "Asiakirjaa \"$(DOC)\" on muokattu.\nTallennetaanko muutokset?" ;
+ Text [ danish ] = "Dokumentet \"$(DOC)\" er blevet ndret.\nSkal ndringerne gemmes?" ;
+ Text [ french ] = "Le document '$(DOC)' a t modifi.\nSouhaitez-vous enregistrer les modifications apportes ?" ;
+ Text [ swedish ] = "Dokumentet \"$(DOC)\" har ndrats.\nSkall ndringarna sparas?" ;
+ Text [ dutch ] = "Het document \"$(DOC)\" is gewijzigd.\nWilt u uw wijzigingen opslaan?" ;
+ Text [ spanish ] = "El documento \"$(DOC)\" ha sido modificado.\nDesea guardar las modificaciones?" ;
+ Text [ english_us ] = "The document \"$(DOC)\" has been modified.\nDo you want to save your changes?" ;
+ Text[ chinese_simplified ] = "ĵ$(DOC)Ѿ޸ġ\nҪЩ";
+ Text[ russian ] = " '$(DOC)' .\n ?";
+ Text[ polish ] = "Zmieniono dokument \"$(DOC)\".\nCzy zapisa zmiany?";
+ Text[ japanese ] = "޷\"$(DOC)\"͕ύXĂ܂B\nύXۑ܂?";
+ Text[ chinese_traditional ] = "oӤ$(DOC)wgܧC\nnxsoܧH";
+ Text[ arabic ] = " \"$(DOC)\".\n ʿ";
+ Text[ dutch ] = "Het document \"$(DOC)\" is gewijzigd.\nWilt u uw wijzigingen opslaan?";
+ Text[ chinese_simplified ] = "ĵ$(DOC)Ѿ޸ġ\nҪЩ";
+ Text[ greek ] = " '$(DOC)' .\n ;";
+ Text[ korean ] = "'$(DOC)' Ǿϴ.\n Ͻðڽϱ?";
+ Text[ turkish ] = "Belge \"$(DOC)\" deitirildi.\nDeiiklikler kaydedilsin mi?";
+};
+Bitmap BMP_STYLES_CLOSED { File = "newex.bmp" ; };
+Bitmap BMP_STYLES_OPENED { File = "newex.bmp" ; };
+String STR_STYLES
+{
+ Text = "Vorlagen" ;
+ Text [ English ] = "Styles" ;
+ Text [ norwegian ] = "Styles" ;
+ Text [ italian ] = "Modelli" ;
+ Text [ portuguese_brazilian ] = "Estilos" ;
+ Text [ portuguese ] = "Estilos" ;
+ Text [ finnish ] = "Tyylit" ;
+ Text [ danish ] = "Typografier" ;
+ Text [ french ] = "Styles" ;
+ Text [ swedish ] = "Mallar" ;
+ Text [ dutch ] = "Opmaakprofielen" ;
+ Text [ spanish ] = "Estilos" ;
+ Text [ english_us ] = "Styles" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Style";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "˦";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Opmaakprofielen";
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Biimler";
+ Text[ language_user1 ] = " ";
+};
+String STR_MACROS
+{
+ Text = "Makros" ;
+ Text [ English ] = "Macros" ;
+ Text [ norwegian ] = "Makroer" ;
+ Text [ italian ] = "Macro" ;
+ Text [ portuguese_brazilian ] = "Macros" ;
+ Text [ portuguese ] = "Macros" ;
+ Text [ finnish ] = "Makrot" ;
+ Text [ danish ] = "Makroer" ;
+ Text [ french ] = "Macros" ;
+ Text [ swedish ] = "Makron" ;
+ Text [ dutch ] = "Macro's" ;
+ Text [ spanish ] = "Macros" ;
+ Text [ english_us ] = "Macros" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Makra";
+ Text[ japanese ] = "ϸ";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Macro's";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ũ";
+ Text[ turkish ] = "Makro";
+ Text[ language_user1 ] = " ";
+};
+String STR_CONFIG
+{
+ Text = "Konfiguration" ;
+ Text [ English ] = "Configuration" ;
+ Text [ norwegian ] = "Konfigurasjon" ;
+ Text [ italian ] = "Configurazione" ;
+ Text [ portuguese_brazilian ] = "Configurao" ;
+ Text [ portuguese ] = "Configurao" ;
+ Text [ finnish ] = "Asetukset" ;
+ Text [ danish ] = "Konfiguration" ;
+ Text [ french ] = "Paramtres" ;
+ Text [ swedish ] = "Konfiguration" ;
+ Text [ dutch ] = "Configuratie" ;
+ Text [ spanish ] = "Configuracin" ;
+ Text [ english_us ] = "Configuration" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Konfiguracja";
+ Text[ japanese ] = "ݒ";
+ Text[ chinese_traditional ] = "tm";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Configuratie";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Konfigrasyon";
+ Text[ language_user1 ] = " ";
+};
+String STR_PRINT_STYLES_HEADER
+{
+ Text = "Formatvorlagen in " ;
+ Text [ English ] = "Styles in " ;
+ Text [ norwegian ] = "Stiler i " ;
+ Text [ italian ] = "Modelli in " ;
+ Text [ portuguese_brazilian ] = "Estilos em " ;
+ Text [ portuguese ] = "Estilos em " ;
+ Text [ finnish ] = "Tyylit: " ;
+ Text [ danish ] = "Formattypografi i " ;
+ Text [ french ] = "Styles dans " ;
+ Text [ swedish ] = "Formatmallar i " ;
+ Text [ dutch ] = "Opmaakprofielen in " ;
+ Text [ spanish ] = "Estilos en " ;
+ Text [ english_us ] = "Styles in " ;
+ Text[ chinese_simplified ] = "ʽʽ ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Style formatu w ";
+ Text[ japanese ] = " ";
+ Text[ chinese_traditional ] = "榡˦b ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Opmaakprofielen in ";
+ Text[ chinese_simplified ] = "ʽʽ ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Biimler: ";
+ Text[ language_user1 ] = " ";
+};
+String STR_PRINT_STYLES
+{
+ Text = "Drucke Formatvorlagen" ;
+ Text [ English ] = "Printing styles" ;
+ Text [ norwegian ] = "Utskriftsstil" ;
+ Text [ italian ] = "Stampa modelli" ;
+ Text [ portuguese_brazilian ] = "Estilos de impresso" ;
+ Text [ portuguese ] = "Estilos de impresso" ;
+ Text [ finnish ] = "Tyylien tulostus" ;
+ Text [ danish ] = "Udskriver formattypografier" ;
+ Text [ french ] = "Impression des styles" ;
+ Text [ swedish ] = "Skriver ut formatmallar" ;
+ Text [ dutch ] = "Opmaakprofielen afdrukken" ;
+ Text [ spanish ] = "Imprimiento estilos de impresin" ;
+ Text [ english_us ] = "Printing Styles" ;
+ Text[ chinese_simplified ] = "ӡʽʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Drukuj style formatu";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "CL榡˦";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Opmaakprofielen afdrukken";
+ Text[ chinese_simplified ] = "ӡʽʽ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " μ";
+ Text[ turkish ] = "Biimler yazdrlyor";
+ Text[ language_user1 ] = " ";
+};
+Bitmap BMP_STYLES_FAMILY1 { File = "styfam1.bmp" ; };
+Bitmap BMP_STYLES_FAMILY2 { File = "styfam2.bmp" ; };
+Bitmap BMP_STYLES_FAMILY3 { File = "styfam3.bmp" ; };
+Bitmap BMP_STYLES_FAMILY4 { File = "styfam4.bmp" ; };
+ErrorBox MSG_PRINT_ERROR
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Der Druckvorgang konnte nicht gestartet werden." ;
+ Message [ ENGLISH ] = "The print job couldn't be started." ;
+ Message [ norwegian ] = "Utskriftsjobben kunne ikke startes." ;
+ Message [ italian ] = "Non stato possibile avviare il lavoro di stampa." ;
+ Message [ portuguese_brazilian ] = "O servio de impresso no pode ser iniciado." ;
+ Message [ portuguese ] = "Impossvel iniciar a impresso." ;
+ Message [ finnish ] = "Tulostustyt ei voi aloittaa." ;
+ Message [ danish ] = "Det var ikke muligt at starte udskrivningen." ;
+ Message [ french ] = "Le travail d'impression n'a pas pu tre lanc." ;
+ Message [ swedish ] = "Utskriftsarbetet kunde inte pbrjas." ;
+ Message [ dutch ] = "De afdrukopdracht kan niet worden gestart." ;
+ Message [ spanish ] = "No se pudo inicializar la impresin." ;
+ Message [ english_us ] = "The print job could not be started." ;
+ Message[ chinese_simplified ] = "޷ӡ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Zadanie wydruku nie mogo zosta rozpoczte.";
+ Message[ japanese ] = "͊Jnł܂łB";
+ Message[ chinese_traditional ] = "LkCLާ@C";
+ Message[ arabic ] = " ";
+ Message[ dutch ] = "De afdrukopdracht kan niet worden gestart.";
+ Message[ chinese_simplified ] = "޷ӡ";
+ Message[ greek ] = " .";
+ Message[ korean ] = "μ ۾ ߽ϴ.";
+ Message[ turkish ] = "Yazdrma ilemi balatlamad.";
+ Message[ language_user1 ] = " ";
+};
+String STR_BACKUP_COPY
+{
+ Text = " Kopie" ;
+ Text [ English ] = " Copy" ;
+ Text [ norwegian ] = "Kopi" ;
+ Text [ italian ] = "Copia" ;
+ Text [ portuguese_brazilian ] = "Copiar" ;
+ Text [ portuguese ] = "Cpia" ;
+ Text [ finnish ] = " Kopioi" ;
+ Text [ danish ] = "Kopi" ;
+ Text [ french ] = "Copie" ;
+ Text [ swedish ] = "Kopia" ;
+ Text [ dutch ] = "Kopie" ;
+ Text [ spanish ] = "Copia" ;
+ Text [ english_us ] = "Copy" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Kopia";
+ Text[ japanese ] = "߰";
+ Text[ chinese_traditional ] = "ƻs";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Kopie";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Kopya";
+ Text[ language_user1 ] = " ";
+};
+WarningBox MSG_WARNING_BACKUP
+{
+ Message = "Sicherungskopie konnte nicht angelegt werden." ;
+ Message [ English ] = "Couldn't create backup copy." ;
+ Message [ norwegian ] = "Kan ikke lage sikkerhetskopi." ;
+ Message [ italian ] = "Impossibile creare copia di backup." ;
+ Message [ portuguese_brazilian ] = "No pude criar cpia em backup." ;
+ Message [ portuguese ] = "Impossvel criar cpia de segurana." ;
+ Message [ finnish ] = "Varmistuskopiota ei voi tehd." ;
+ Message [ danish ] = "Det var ikke muligt at oprette sikkerhedskopi." ;
+ Message [ french ] = "Cration de la copie de sauvegarde impossible." ;
+ Message [ swedish ] = "Skerhetskopia kunde inte skapas." ;
+ Message [ dutch ] = "Reservekopie kon niet worden gemaakt." ;
+ Message [ spanish ] = "No se pudo crear la copia de seguridad." ;
+ Message [ english_us ] = "Could not create backup copy." ;
+ Buttons = WB_OK ;
+ DefButton = WB_DEF_OK ;
+ Message[ chinese_simplified ] = "޷ȫ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Kopii zapasowej nie mona byo utworzy.";
+ Message[ japanese ] = "ޯ ͍߰쐬ł܂łB";
+ Message[ chinese_traditional ] = "LkإߦwƥC";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Reservekopie kon niet worden gemaakt.";
+ Message[ chinese_simplified ] = "޷ȫ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " 縦 ߽ϴ.";
+ Message[ turkish ] = "Yedekleme kopyas oluturulamad.";
+ Message[ language_user1 ] = " ";
+};
+InfoBox MSG_CANT_OPEN_TEMPLATE
+{
+ Message = "Die Dokumentvorlage kann nicht geffnet werden." ;
+ Message [ ENGLISH ] = "The document template could not be opened." ;
+ Message [ norwegian ] = "Dokumentmalen kan ikke pnes." ;
+ Message [ italian ] = "Impossibile aprire il modello." ;
+ Message [ portuguese_brazilian ] = "O modelo do documento no pode ser aberto." ;
+ Message [ portuguese ] = "No possvel abrir o modelo do documento." ;
+ Message [ finnish ] = "Asiakirjamallia ei voitu avata." ;
+ Message [ danish ] = "Det er ikke muligt at bne dokumentskabelonen." ;
+ Message [ french ] = "Impossible d'ouvrir le modle de document." ;
+ Message [ swedish ] = "Dokumentmallen kan inte ppnas." ;
+ Message [ dutch ] = "De documentsjabloon kan niet worden geopend." ;
+ Message [ spanish ] = "No se puede abrir la plantilla del documento." ;
+ Message [ english_us ] = "The template could not be opened." ;
+ Message[ chinese_simplified ] = "޷ļʽ";
+ Message[ russian ] = " ";
+ Message[ polish ] = "Szablonu dokumentu nie mona otworzy.";
+ Message[ japanese ] = "޷ ڰĂ͊JƂł܂B";
+ Message[ chinese_traditional ] = "Lk}Ҥ˦@";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "De documentsjabloon kan niet worden geopend.";
+ Message[ chinese_simplified ] = "޷ļʽ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ߽ϴ.";
+ Message[ turkish ] = "Belge ablonu alamyor.";
+ Message[ language_user1 ] = " ";
+};
+InfoBox MSG_VIEW_OPEN_CANT_SAVE
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ MESSAGE = "Das Dokument ist bereits zur Bearbeitung geffnet." ;
+ MESSAGE [ English ] = "This document is already opened." ;
+ MESSAGE [ norwegian ] = "Dette dokumentet er allerede pent." ;
+ MESSAGE [ italian ] = "Questo documento gi aperto." ;
+ MESSAGE [ portuguese_brazilian ] = "Este documento j est aberto." ;
+ MESSAGE [ portuguese ] = "Este documento j est aberto para editar." ;
+ MESSAGE [ finnish ] = "Asiakirja on jo avattu." ;
+ MESSAGE [ danish ] = "Dette dokument er allerede bnet til redigering." ;
+ MESSAGE [ french ] = "Ce document est dj ouvert pour l'dition." ;
+ MESSAGE [ swedish ] = "Dokumentet r redan ppnat fr redigering." ;
+ MESSAGE [ dutch ] = "Dit document is reeds geopend." ;
+ MESSAGE [ spanish ] = "Este documento ya est abierto para editar." ;
+ MESSAGE [ english_us ] = "Document already open for editing." ;
+ MESSAGE[ chinese_simplified ] = "ļѾ򿪱༭";
+ MESSAGE[ russian ] = " .";
+ MESSAGE[ polish ] = "Dokument jest ju otwarty do edycji.";
+ MESSAGE[ japanese ] = "޷Ă͂łɕҏWpɊJĂ܂B";
+ MESSAGE[ chinese_traditional ] = "oɮפwg}ҽsC";
+ MESSAGE[ arabic ] = " .";
+ MESSAGE[ dutch ] = "Dit document is reeds geopend.";
+ MESSAGE[ chinese_simplified ] = "ļѾ򿪱༭";
+ MESSAGE[ greek ] = " .";
+ MESSAGE[ korean ] = " ̹ ֽϴ.";
+ MESSAGE[ turkish ] = "Belge zaten dzenlenmek zere ald.";
+ MESSAGE[ language_user1 ] = " ";
+};
+String STR_ERROR_SAVE
+{
+ Text = "Fehler beim Schreiben des Dokumentes " ;
+ Text [ English ] = "Error writing document " ;
+ Text [ norwegian ] = "Feil ved skriving av dokument " ;
+ Text [ italian ] = "Errore durante la scrittura del documento. " ;
+ Text [ portuguese_brazilian ] = "Erro ao gravar o documento " ;
+ Text [ portuguese ] = "Erro ao gravar o documento " ;
+ Text [ finnish ] = "Virhe kirjoitettaessa asiakirjaa " ;
+ Text [ danish ] = "Fejl under skrivning af dokumentet " ;
+ Text [ french ] = "Erreur lors de l'criture du document " ;
+ Text [ swedish ] = "Fel vid skrivning av dokument " ;
+ Text [ dutch ] = "Fout bij schrijven van document " ;
+ Text [ spanish ] = "Error al escribir documento " ;
+ Text [ english_us ] = "Error recording document " ;
+ Text[ chinese_simplified ] = "дĵʱһ ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Bd przy zapisie dokumentu ";
+ Text[ japanese ] = "޷Ă̈ړ̍ۂ̴װ ";
+ Text[ chinese_traditional ] = "bgJɵoͤ@ӿ~ ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Fout bij schrijven van document ";
+ Text[ chinese_simplified ] = "дĵʱһ ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " Ͻ ߻. ";
+ Text[ turkish ] = "Belge yazlrken hata olutu ";
+ Text[ language_user1 ] = " ";
+};
+String STR_TEMPLATE_FILTER
+{
+ Text = "Dokumentvorlagen" ;
+ Text [ English ] = "Document templates" ;
+ Text [ norwegian ] = "Dokumentmaler" ;
+ Text [ italian ] = "Modelli" ;
+ Text [ portuguese_brazilian ] = "Modelos do documento" ;
+ Text [ portuguese ] = "Modelos de documentos" ;
+ Text [ finnish ] = "Asiakirjamallit" ;
+ Text [ danish ] = "Dokumentskabeloner" ;
+ Text [ french ] = "Modles de document" ;
+ Text [ swedish ] = "Dokumentmallar" ;
+ Text [ dutch ] = "Sjablonen" ;
+ Text [ spanish ] = "Plantillas" ;
+ Text [ english_us ] = "Templates" ;
+ Text[ chinese_simplified ] = "ĵʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Szablony dokumentw";
+ Text[ japanese ] = "޷Ăڰ";
+ Text[ chinese_traditional ] = "˦";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Sjablonen";
+ Text[ chinese_simplified ] = "ĵʽ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Belge ablonlar";
+ Text[ language_user1 ] = " ";
+};
+String STR_ERROR_COPY_TEMPLATE
+{
+ Text = "Fehler beim Kopieren der Vorlage \"$1\".\nEventuell existiert die Vorlage bereits." ;
+ Text [ English ] = "Error copying template \"$1\".\nMaybe template already exists." ;
+ Text [ norwegian ] = "Feil ved kopiering av mal \"$1\"." ;
+ Text [ italian ] = "Errore durante la copia del modello \"$1\".\nProbabilmente il modello esiste gi." ;
+ Text [ portuguese_brazilian ] = "Erro ao copiar o modelo" ;
+ Text [ portuguese ] = "Erro ao copiar o modelo \"$1\".\n possvel que j exista." ;
+ Text [ finnish ] = "Virhe kopioitaessa mallia " ;
+ Text [ danish ] = "Fejl ved kopiering af skabelonen \"$1\".\nMuligvis findes skabelonen allerede." ;
+ Text [ french ] = "Erreur lors de la copie du modle \"$1\".\nIl se peut qu'il existe dj." ;
+ Text [ swedish ] = "Fel vid kopiering av mallen \"$1\".\nEventuellt existerar mallen redan." ;
+ Text [ dutch ] = "Fout bij kopiren van sjabloon \"$1\".\nEventueel bestaat deze reeds." ;
+ Text [ spanish ] = "Error al copiar la plantilla \"$1\".\nEs posible que esta ya exista." ;
+ Text [ english_us ] = "Error copying template \"$1\". \nA template with this name may already exist." ;
+ Text[ chinese_simplified ] = "ڸʽ$1ʱ\nʽѾڡ";
+ Text[ russian ] = " \"$1\".\n, .";
+ Text[ polish ] = "Bd podczas kopiowania szablonu \"$1\".\nSzablon ju by moe istnieje.";
+ Text[ japanese ] = "ڰ\"$1\"߰ۂ̴װ\n炭ڰĂ͂łɂ܂B";
+ Text[ chinese_traditional ] = "bƻs˦ɵoͤ@ӿ~C\ni˦wgsbC";
+ Text[ arabic ] = " \"$1\".\n .";
+ Text[ dutch ] = "Fout bij kopiren van sjabloon \"$1\".\nEventueel bestaat deze reeds.";
+ Text[ chinese_simplified ] = "ڸʽ$1ʱ\nʽѾڡ";
+ Text[ greek ] = " \"$1\". \n .";
+ Text[ korean ] = "\"$1\" . \n ̹ 𸨴ϴ.";
+ Text[ turkish ] = "\"$1\" ablonu kopyalanrken hata olutu.\nBu ablon zaten mevcut olabilir.";
+ Text[ language_user1 ] = " ";
+};
+String STR_ERROR_DELETE_TEMPLATE
+{
+ Text = "Die Vorlage \"$1\" kann nicht gelscht werden." ;
+ Text [ English ] = "The template \"$1\" can't by deleted." ;
+ Text [ english_us ] = "The template \"$1\" can not be deleted." ;
+ Text [ portuguese_brazilian ] = "Die Vorlage $1 kann nicht gelscht werden." ;
+ Text [ swedish ] = "Mallen \"$1\" kan inte raderas." ;
+ Text [ danish ] = "Det er ikke muligt at slette skabelonen \"$1\"." ;
+ Text [ italian ] = "Impossibile eliminare il modello $1." ;
+ Text [ spanish ] = "No es posible eliminar la plantilla \"$1\"." ;
+ Text [ french ] = "Impossible de supprimer le modle \"$1\"." ;
+ Text [ dutch ] = "De sjabloon \"$1\" kan niet worden gewist." ;
+ Text [ portuguese ] = "Impossvel eliminar o modelo \"$1\"." ;
+ Text[ chinese_simplified ] = "޷ɾʽ $1";
+ Text[ russian ] = " \"$1\" .";
+ Text[ polish ] = "Szablonu \"$1\" nie mona usun.";
+ Text[ japanese ] = "ڰ\"$1\"͍폜ł܂B";
+ Text[ chinese_traditional ] = "LkRoӼ˦ $1 C";
+ Text[ arabic ] = " \"$1\".";
+ Text[ dutch ] = "De sjabloon \"$1\" kan niet worden gewist.";
+ Text[ chinese_simplified ] = "޷ɾʽ $1";
+ Text[ greek ] = " \"$1\".";
+ Text[ korean ] = " \"$1\" ϴ.";
+ Text[ turkish ] = "\"$1\" ablonu silinemiyor.";
+ Text[ language_user1 ] = " ";
+};
+String STR_ERROR_MOVE_TEMPLATE
+{
+ Text = "Fehler beim Verschieben der Vorlage \"$1\"." ;
+ Text [ English ] = "Error moving template \"$1\"." ;
+ Text [ norwegian ] = "Feil ved flytting av mal \"$1\"." ;
+ Text [ italian ] = "Errore durante lo spostamento del modello \"$1\"." ;
+ Text [ portuguese_brazilian ] = "Erro ao mover o modelo " ;
+ Text [ portuguese ] = "Erro ao mover o modelo \"$1\"." ;
+ Text [ finnish ] = "Virhe siirrettess mallia \"$1\"." ;
+ Text [ danish ] = "Fejl under flytning af skabelonen \"$1\"." ;
+ Text [ french ] = "Erreur lors du dplacement du modle \"$1\"." ;
+ Text [ swedish ] = "Fel vid flyttning av mall \"$1\" " ;
+ Text [ dutch ] = "Fout bij verplaatsen van sjabloon \"$1\"." ;
+ Text [ spanish ] = "Error al desplazar la plantilla \"$1\" " ;
+ Text [ english_us ] = "Error moving template \"$1\"." ;
+ Text[ chinese_simplified ] = "ƶʽ$1ʱ";
+ Text[ russian ] = " \"$1\".";
+ Text[ polish ] = "Bd przy przenoszeniu szablonu \"$1\".";
+ Text[ japanese ] = "ڰ\"$1\"̈ړ̍ۂ̴װB";
+ Text[ chinese_traditional ] = "bʼ˦ $1ɵoͿ~ C";
+ Text[ arabic ] = " \"$1\".";
+ Text[ dutch ] = "Fout bij verplaatsen van sjabloon \"$1\".";
+ Text[ chinese_simplified ] = "ƶʽ$1ʱ";
+ Text[ greek ] = " \"$1\".";
+ Text[ korean ] = " \"$1\" ̵ ߻.";
+ Text[ turkish ] = "\"$1\" ablonu tanrken hata olutu.";
+ Text[ language_user1 ] = " ";
+};
+ErrorBox MSG_ERROR_RESCAN
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Die Aktualisierungen konnte nicht gespeichert werden." ;
+ Message [ ENGLISH ] = "The updates could not be saved." ;
+ Message [ norwegian ] = "Oppdateringene kan ikke lagres." ;
+ Message [ italian ] = "Impossibile salvare gli aggiornamenti." ;
+ Message [ portuguese_brazilian ] = "As atualizaes no puderam ser gravadas." ;
+ Message [ portuguese ] = "As actualizaes no puderam ser guardadas." ;
+ Message [ finnish ] = "Pivityksi ei voitu tallentaa." ;
+ Message [ danish ] = "Det var ikke muligt at gemme opdateringen." ;
+ Message [ french ] = "Impossible d'enregistrer les actualisations !" ;
+ Message [ swedish ] = "Uppdateringen kunde inte sparas." ;
+ Message [ dutch ] = "De wijzigingen kunnen niet worden opgeslagen." ;
+ Message [ spanish ] = "No se pudieron guardar las actualizaciones." ;
+ Message [ english_us ] = "The updates could not be saved." ;
+ Message[ chinese_simplified ] = "޷̸¡";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Aktualizacje nie mogy zosta zapisane.";
+ Message[ japanese ] = "XV͕ۑłĂ܂B";
+ Message[ chinese_traditional ] = "LkxsseC";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "De wijzigingen kunnen niet worden opgeslagen.";
+ Message[ chinese_simplified ] = "޷̸¡";
+ Message[ greek ] = " .";
+ Message[ korean ] = "Ʈ ߽ϴ.";
+ Message[ turkish ] = "Gncellemeler kaydedilemedi.";
+ Message[ language_user1 ] = " ";
+};
+String STR_ERROR_SAVE_TEMPLATE
+{
+ Text = "Fehler beim Schreiben der Vorlage " ;
+ Text [ English ] = "Error writing template " ;
+ Text [ norwegian ] = "Feil ved skriving av mal " ;
+ Text [ italian ] = "Errore durante la scrittura del modello " ;
+ Text [ portuguese_brazilian ] = "Erro ao gravar o modelo " ;
+ Text [ portuguese ] = "Erro ao gravar o modelo " ;
+ Text [ finnish ] = "Virhe kirjoitettaessa mallia " ;
+ Text [ danish ] = "Fejl under skrivning af skabelonen " ;
+ Text [ french ] = "Erreur lors de l'criture du modle " ;
+ Text [ swedish ] = "Fel vid skrivning av mall " ;
+ Text [ dutch ] = "Fout bij schrijven van sjabloon " ;
+ Text [ spanish ] = "Error de escritura de plantilla " ;
+ Text [ english_us ] = "Error saving template " ;
+ Text[ chinese_simplified ] = "дʽʱһ ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Bd przy zapisie szablonu ";
+ Text[ japanese ] = "ڰĂ̈ړ̍ۂ̴װ ";
+ Text[ chinese_traditional ] = "bgJ˦ɵoͤ@ӿ~ ";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Fout bij schrijven van sjabloon ";
+ Text[ chinese_simplified ] = "дʽʱһ ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " Ͻ ߻ ";
+ Text[ turkish ] = "ablon yazlrken hata olutu ";
+ Text[ language_user1 ] = " ";
+};
+ErrorBox MSG_ERROR_RENAME_TEMPLATE
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Fehler bei der Umbenennung der Vorlage." ;
+ Message [ ENGLISH ] = "Error renaming template." ;
+ Message [ norwegian ] = "Feil oppstod da det ble gitt nytt navn til mal." ;
+ Message [ italian ] = "Errore durante la rinominazione del modello." ;
+ Message [ portuguese_brazilian ] = "Erro ao renomear o modelo." ;
+ Message [ portuguese ] = "Erro ao renomear o modelo." ;
+ Message [ finnish ] = "Virhe mallia nimettess." ;
+ Message [ danish ] = "Fejl under omdbning af skabelonen." ;
+ Message [ french ] = "Erreur lors du changement du nom du modle." ;
+ Message [ swedish ] = "Fel vid namnndring p mall." ;
+ Message [ dutch ] = "Fout bij de naamswijziging van de sjabloon." ;
+ Message [ spanish ] = "Error al cambiar el nombre de la plantilla." ;
+ Message [ english_us ] = "Error renaming template." ;
+ Message[ chinese_simplified ] = "ʽʱ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Bd przy zmianie nazwy szablonu.";
+ Message[ japanese ] = "ڰĂ̖OύX̍ۂ̴װ";
+ Message[ chinese_traditional ] = "sRW˦ɵoͿ~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Fout bij de naamswijziging van de sjabloon.";
+ Message[ chinese_simplified ] = "ʽʱ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ̸ ߻.";
+ Message[ turkish ] = "ablon yeniden adlandrlrken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+ErrorBox MSG_ERROR_RENAME_TEMPLATE_REGION
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Fehler bei der Umbenennung des Bereiches." ;
+ Message [ ENGLISH ] = "Error renaming template region." ;
+ Message [ norwegian ] = "Feil oppstod da det ble gitt nytt navn til malomrde." ;
+ Message [ italian ] = "Errore durante la rinominazione dell'area." ;
+ Message [ portuguese_brazilian ] = "Erro ao renomear a regiao do modelo." ;
+ Message [ portuguese ] = "Erro ao renomear a regio do modelo." ;
+ Message [ finnish ] = "Virhe mallialuetta nimettess." ;
+ Message [ danish ] = "Fejl under omdbning af omrdet." ;
+ Message [ french ] = "Erreur du changement du nom de la catgorie." ;
+ Message [ swedish ] = "Fel vid namnndring p mallomrde." ;
+ Message [ dutch ] = "Fout bij de naamsverandering van het bereik." ;
+ Message [ spanish ] = "Error al cambiar el nombre del rea." ;
+ Message [ english_us ] = "Error renaming template catagory." ;
+ Message[ chinese_simplified ] = "ʱ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Bd przy zmianie nazwy obszaru.";
+ Message[ japanese ] = "͈̖͂OύX̍ۂ̴װ";
+ Message[ chinese_traditional ] = "sRWϰɵoͿ~C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "Fout bij de naamsverandering van het bereik.";
+ Message[ chinese_simplified ] = "ʱ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ̸ ߻.";
+ Message[ turkish ] = "Kategori yeniden adlandrlrken hata olutu.";
+ Message[ language_user1 ] = " ";
+};
+ErrorBox MSG_ERROR_EMPTY_NAME
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Es muss ein Name angegeben werden." ;
+ Message [ ENGLISH ] = "You must specify a name." ;
+ Message [ norwegian ] = "Du m angi et navn." ;
+ Message [ italian ] = " necessario specificare un nome." ;
+ Message [ portuguese_brazilian ] = " preciso especificar um nome." ;
+ Message [ portuguese ] = " necessrio especificar um nome." ;
+ Message [ finnish ] = "Sinun on annettava nimi." ;
+ Message [ danish ] = "Du skal angive et navn." ;
+ Message [ french ] = "Veuillez indiquer un nom." ;
+ Message [ swedish ] = "Ett namn mste anges." ;
+ Message [ dutch ] = "U moet een naam invullen." ;
+ Message [ spanish ] = "Es necesario introducir un nombre." ;
+ Message [ english_us ] = "Please specify a name." ;
+ Message[ chinese_simplified ] = "ָһơ";
+ Message[ russian ] = " .";
+ Message[ polish ] = "Trzeba poda nazw.";
+ Message[ japanese ] = "Ow肵ĉB";
+ Message[ chinese_traditional ] = "zJ@ӦW١C";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "U moet een naam invullen.";
+ Message[ chinese_simplified ] = "ָһơ";
+ Message[ greek ] = " .";
+ Message[ korean ] = "̸ ؾ մϴ.";
+ Message[ turkish ] = "Bir ad girin.";
+ Message[ language_user1 ] = " ";
+};
+ErrorBox MSG_ERROR_UNIQ_NAME
+{
+ BUTTONS = WB_OK ;
+ DEFBUTTON = WB_DEF_OK ;
+ Message = "Es muss ein eindeutiger Name angegeben werden.\nZwischen Gro- und Kleinschreibung wird nicht unterschieden." ;
+ Message [ ENGLISH ] = "You must specify an uniq name.\nUpper and lower letters are the same." ;
+ Message [ norwegian ] = "Du m angi et unikt navn .\nOver- og underbokstaver er like." ;
+ Message [ italian ] = " necessario specificare un nome univoco.\n possibile utilizzare lettere maiuscole o minuscole." ;
+ Message [ portuguese_brazilian ] = " preciso especificar um nome exclusivo.\nLetras maisculas ou minsculas podem ser usadas." ;
+ Message [ portuguese ] = " necessrio especificar um nome unvoco.\nNo h distino entre maisculas e minsculas." ;
+ Message [ finnish ] = "Sinun on annettava yksiksitteinen nimi.\nIsoilla ja pienill kirjaimilla ei ole eroa." ;
+ Message [ danish ] = "Du skal angive et entydigt navn.\nDer gres ingen forskel mellem store og sm bogstaver." ;
+ Message [ french ] = "Veuillez indiquer un nom univoque.\nIl ne sera fait aucune distinction de casse (majuscules / minuscules)." ;
+ Message [ swedish ] = "Ett entydigt namn mste anges.\nDet grs ingen skillnad p sm och stora bokstver." ;
+ Message [ dutch ] = "De naam moet uniek zijn.\nEr wordt geen onderscheid gemaakt tussen hoofdletters en kleine letters." ;
+ Message [ spanish ] = "Debe especificar un nombre nico.\nNo se distingue entre maysculas y minsculas." ;
+ Message [ english_us ] = "Please specify a unique name.\nEntries must not be case specific." ;
+ Message[ chinese_simplified ] = "һȷеơ\nĸСд";
+ Message[ russian ] = " .\n .";
+ Message[ polish ] = "Musi zosta podana jednoznaczna nazwa. \nNie ma rozrniania duych i maych liter.";
+ Message[ japanese ] = "mȖOw肵ĉB\n啶Ə͋ʂ܂B";
+ Message[ chinese_traditional ] = "zJ@ӥTW١C\nzϧOrjpgC";
+ Message[ arabic ] = " .\n .";
+ Message[ dutch ] = "De naam moet uniek zijn.\nEr wordt geen onderscheid gemaakt tussen hoofdletters en kleine letters.";
+ Message[ chinese_simplified ] = "һȷеơ\nĸСд";
+ Message[ greek ] = " .\n .";
+ Message[ korean ] = "и ̸ ؾ մϴ.\n빮ڿ ҹ о Էմϴ.";
+ Message[ turkish ] = "Benzersiz bir ad girin.\nGirilen ad byk/kk harf duyarl olmamaldr.";
+ Message[ language_user1 ] = " ";
+};
+String STR_QUERY_DEFAULT_TEMPLATE
+{
+ TEXT = "Wollen Sie die Vorlage \"$(TEXT)\" zur Standardvorlage machen?" ;
+ TEXT [ English ] = "Should the template \"$(TEXT)\" become the default template?" ;
+ TEXT [ norwegian ] = "Vil du at malen \"$(TEXT)\" skal bli standardmal?" ;
+ TEXT [ italian ] = "Volete che il modello \"$(TESTO)\" diventi il modello predefinito?" ;
+ TEXT [ portuguese_brazilian ] = "O modelo $(TEXTO) deve se tornar o modelo padr o?" ;
+ TEXT [ portuguese ] = "Deseja usar o modelo \"$(TEXTO)\" como modelo padro?" ;
+ TEXT [ finnish ] = "Valitaanko malli \"$(TEXT)\" oletusmalliksi?" ;
+ TEXT [ danish ] = "Vil du definere skabelonen \"$(TEKST)\" som standardskabelon?" ;
+ TEXT [ french ] = "Souhaitez-vous faire du modle \"$(TEXT)\" le modle par dfaut ?" ;
+ TEXT [ swedish ] = "Skall mallen \"$(TEXT)\" gras till standardmall?" ;
+ TEXT [ dutch ] = "Moet de sjabloon \"$(TEKST)\" de standaardsjabloon worden?" ;
+ TEXT [ spanish ] = "Desea convertir la plantilla \"$(TEXT)\" en una plantilla predeterminada?" ;
+ TEXT [ english_us ] = "Should the template \"$(TEXT)\" become the default template?" ;
+ TEXT[ chinese_simplified ] = "Ҫʽ$(TEXT)趨ɱ׼ʽ";
+ TEXT[ russian ] = " , \"$(TEXT)\" ?";
+ TEXT[ polish ] = "Czy chcesz przeksztaci \"$(TEXT)\" na szablon domylny?";
+ TEXT[ japanese ] = "ڰ\"$(TEXT)\"Wقɂ܂?";
+ TEXT[ chinese_traditional ] = "nNoӼ˦$(TEXT)]wзǼ˦H";
+ TEXT[ arabic ] = " \"$(TEXT)\" ";
+ TEXT[ dutch ] = "Moet de sjabloon \"$(TEKST)\" de standaardsjabloon worden?";
+ TEXT[ chinese_simplified ] = "Ҫʽ$(TEXT)趨ɱ׼ʽ";
+ TEXT[ greek ] = " $(TEXT) ;";
+ TEXT[ korean ] = "$(TEXT) ⺻ Ϸ Ͻðڽϱ?";
+ TEXT[ turkish ] = "\"$(TEXT)\" ablonu, standart ablon olarak belirlensin mi?";
+ TEXT[ language_user1 ] = " ";
+};
+QueryBox MSG_QUERY_RESET_DEFAULT_TEMPLATE
+{
+ Buttons = WB_YES_NO ;
+ DefButton = WB_DEF_NO ;
+ Message = "Wollen Sie die Standardvorlage zurcksetzen?" ;
+ Message [ English ] = "Do you want to reset the default template?" ;
+ Message [ norwegian ] = "Vil du stille standardmalen inn p nytt?" ;
+ Message [ italian ] = "Reimpostare il modello predefinito?" ;
+ Message [ portuguese_brazilian ] = "Deseja redefinir o modelo padro?" ;
+ Message [ portuguese ] = "Deseja redefinir o modelo padro?" ;
+ Message [ finnish ] = "Haluatko palauttaa oletusmallin?" ;
+ Message [ danish ] = "Vil du nulstille standardskabelonen?" ;
+ Message [ french ] = "Souhaitez-vous restaurer le modle par dfaut ?" ;
+ Message [ swedish ] = "Vill Du terstlla standardmallen?" ;
+ Message [ dutch ] = "Wilt u de veranderingen in de standaardsjabloon ongedaan maken?" ;
+ Message [ spanish ] = "Desea usted restablecer la plantilla predeterminada?" ;
+ Message [ english_us ] = "Do you want to reset the default template?" ;
+ Message[ chinese_simplified ] = "Ҫ׼ʽļ";
+ Message[ russian ] = " ?";
+ Message[ polish ] = "Czy chcesz zresetowa szablon domylny?";
+ Message[ japanese ] = "WقؾĂ܂?";
+ Message[ chinese_traditional ] = "zn]зǼ˦ɮסH";
+ Message[ arabic ] = " ";
+ Message[ dutch ] = "Wilt u de veranderingen in de standaardsjabloon ongedaan maken?";
+ Message[ chinese_simplified ] = "Ҫ׼ʽļ";
+ Message[ greek ] = " ;";
+ Message[ korean ] = "⺻ Ͻðڽϱ?";
+ Message[ turkish ] = "Standart ablonu baa almak istiyor musunuz?";
+ Message[ language_user1 ] = " ";
+};
+InfoBox MSG_TEMPLATE_DIR_NOT_EXIST
+{
+ Message = "Das Vorlagenverzeichnis\n$(DIR)\nexistiert nicht." ;
+ Message [ ENGLISH ] = "The template directory\n$(DIR)\ndoen't exist." ;
+ Message [ norwegian ] = "Malkatalogen\n$(DIR)\nfinnes ikke." ;
+ Message [ italian ] = "La cartella dei modelli\n$(DIR)\nnon esiste." ;
+ Message [ portuguese_brazilian ] = "O diretrio modelo\n$(DIR)\nno existe." ;
+ Message [ portuguese ] = "O directrio dos modelos\n$(DIR)\nno existe." ;
+ Message [ finnish ] = "Mallihakemistoa\n$(DIR)\nei ole." ;
+ Message [ danish ] = "Skabelonbiblioteket\n$(DIR)\neksisterer ikke." ;
+ Message [ french ] = "Ce rpertoire de modles\n$(DIR)\nn'existe pas." ;
+ Message [ swedish ] = "Mallkatalogen\n$(DIR)\nfinns inte." ;
+ Message [ dutch ] = "De sjablonenmap\n$(DIR)\nbestaat niet." ;
+ Message [ spanish ] = "El directorio de plantillas\n$(DIR)\nno existe." ;
+ Message [ english_us ] = "Template directory\n$(DIR)\ndoes not exist." ;
+ Message[ chinese_simplified ] = "ʽĿ¼\n$(DIR)\nڡ";
+ Message[ russian ] = " \n$(DIR)\n .";
+ Message[ polish ] = "Katalog stylw \n$(DIR)\nnie istnieje.";
+ Message[ japanese ] = "ڰčڂ\n$(DIR)\n܂B";
+ Message[ chinese_traditional ] = "oӼ˦ؿ\n$(DIR)\nsbC";
+ Message[ arabic ] = " \n$(DIR)\n .";
+ Message[ dutch ] = "De sjablonenmap\n$(DIR)\nbestaat niet.";
+ Message[ chinese_simplified ] = "ʽĿ¼\n$(DIR)\nڡ";
+ Message[ greek ] = " \n$(DIR)\n .";
+ Message[ korean ] = " 丮\n$(DIR)\n ϴ.";
+ Message[ turkish ] = "\n$(DIR)\nablon dizini mevcut deil.";
+ Message[ language_user1 ] = " ";
+};
+InfoBox MSG_DOCINFO_CANTREAD
+{
+ Message = "Die Dokumenteigenschaften knnen nicht gelesen werden." ;
+ Message [ ENGLISH ] = "The document properties can't be read." ;
+ Message [ dutch ] = "De documentinformatie kon niet worden gelezen." ;
+ Message [ english_us ] = "Document info cannot be read." ;
+ Message [ italian ] = "Impossibile leggere le informazioni relative al documento." ;
+ Message [ spanish ] = "No se pueden leer las informaciones sobre el documento." ;
+ Message [ french ] = "Lecture des infos document impossible." ;
+ Message [ swedish ] = "Dokumentegenskaperna kan inte lsas." ;
+ Message [ danish ] = "Det er ikke muligt at lse dokumentegenskaberne." ;
+ Message [ portuguese ] = "No possvel ler as propriedades do documento." ;
+ Message [ portuguese_brazilian ] = "Die Dokumenteigenschaften knnen nicht gelesen werden." ;
+ Message[ chinese_simplified ] = "޷ȡĵԡ";
+ Message[ russian ] = " ";
+ Message[ polish ] = "Waciwoci dokumentu nie mona odczyta.";
+ Message[ japanese ] = "޷Ă͓̑ǂݎ܂łB";
+ Message[ chinese_traditional ] = "LkŪݩʡC";
+ Message[ arabic ] = " .";
+ Message[ dutch ] = "De documentinformatie kon niet worden gelezen.";
+ Message[ chinese_simplified ] = "޷ȡĵԡ";
+ Message[ greek ] = " .";
+ Message[ korean ] = " ϴ.";
+ Message[ turkish ] = "Belge zellikleri okunamyor.";
+ Message[ language_user1 ] = " ";
+};
+String STR_ERROR_NOSTORAGE
+{
+ /* ### ACHTUNG: Neuer Text in Resource? Die ausgewhlte Datei besitzt ein falsches Format. : Die ausgewhlte Datei besitzt ein falsches Format. */
+ /* ### ACHTUNG: Neuer Text in Resource? Die ausgewhlte Datei besitzt ein falsches Format. : Die ausgewhlte Datei besitzt ein falsches Format. */
+ Text = "Die ausgewhlte Datei besitzt ein falsches Format." ;
+ Text [ ENGLISH ] = "The chosen file is in wrong format." ;
+ Text [ norwegian ] = "The chosen file is in wrong format." ;
+ Text [ italian ] = "Il file scelto ha un formato errato." ;
+ Text [ portuguese_brazilian ] = "The chosen file is in wrong format." ;
+ Text [ portuguese ] = "O ficheiro seleccionado tem um formato errado." ;
+ Text [ french ] = "Le fichier slectionn a un format incorrect." ;
+ Text [ dutch ] = "Het gekozen bestand heeft een verkeerd formaat." ;
+ Text [ spanish ] = "El archivo seleccionado tiene un formato incorrecto." ;
+ Text [ danish ] = "Den udvalgte fil har et forkert format." ;
+ Text [ swedish ] = "Den valda filen har ett felaktigt format." ;
+ Text [ finnish ] = "The chosen file is in wrong format." ;
+ Text [ english_us ] = "The selected file has an incorrect format." ;
+ Text[ chinese_simplified ] = "ѡеļĸʽЧ";
+ Text[ russian ] = " .";
+ Text[ polish ] = "Wybrany plik zawiera nieprawidowy format.";
+ Text[ japanese ] = "I̧ق͏܂B";
+ Text[ chinese_traditional ] = "襤ɮ׮榡LġC";
+ Text[ arabic ] = " .";
+ Text[ dutch ] = "Het gekozen bestand heeft een verkeerd formaat.";
+ Text[ chinese_simplified ] = "ѡеļĸʽЧ";
+ Text[ greek ] = " .";
+ Text[ korean ] = " Ʋ ϰ ֽϴ.";
+ Text[ turkish ] = "Seilen dosyann format yanl.";
+ Text[ language_user1 ] = " ";
+};
+String STR_QUERY_SAVEOWNFORMAT
+{
+ Text = "Dieses Dokument kann Formatierungen und Informationen\nenthalten, die nicht im $(FORMAT) Format gespeichert\nwerden knnen. Mchten Sie die nderungen im\n$(OWNFORMAT) Format speichern?" ;
+ Text [ ENGLISH ] = "This document may contain attributes and informations\nthat cannot be saved using the $(FORMAT). Do you want\nto save your changes using the $(OWNFORMAT) format?" ;
+ Text [ dutch ] = "Dit document kan opmaakattributen en gegevens \nbevatten die niet in $(FORMAT) formaat opgeslagen\nkunnen worden. Wilt u deze wijzigingen in\n$(OWNFORMAT) formaat opslaan?" ;
+ Text [ english_us ] = "This document may contain attributes and information that cannot be saved under\n$(FORMAT). Do you want to save your changes using the\n$(OWNFORMAT) format?" ;
+ Text [ italian ] = "Il presente documento pu contenere formattazioni e informazioni\nche non possono essere salvate nel formato \n$(FORMAT). Salvare le modifiche nel formato \n$(OWNFORMAT)?" ;
+ Text [ spanish ] = "Este documento puede contener informaciones y formatos\nque no se pueden guardar en el formato $(FORMAT).\nDesea guardar los cambios en formato\n$(OWNFORMAT)?" ;
+ Text [ french ] = "Ce document peut contenir des formatages et des informations,\nqui ne peuvent pas tre enregistrs au format $(FORMAT).\nSouhaitez-vous enregistrer les modifications au format\n$(OWNFORMAT) ?" ;
+ Text [ swedish ] = "Detta dokument kan innehlla formateringar och information\nsom inte kan sparas i $(FORMAT)format.\nSkall ndringarna sparas i \n$(OWNFORMAT) format?" ;
+ Text [ danish ] = "Dette dokument kan indeholde formateringer og informationer\nsom ikke kan gemmes i $(FORMAT) format.\nVil du gemme ndringerne i $(OWNFORMAT) format?" ;
+ Text [ portuguese ] = "Este documento poder conter atributos e informaes que no podem ser guardados no\nformato $(FORMAT). Guardar as modificaes no\nformato $(OWNFORMAT)?" ;
+ Text [ portuguese_brazilian ] = "Dieses Dokument kann Formatierungen und Informationen\nenthalten, die nicht im $(FORMAT) Format gespeichert\nwerden knnen. Mchten Sie die nderungen im\n$(OWNFORMAT) Format speichern?" ;
+ Text[ chinese_simplified ] = "ĵܺһЩ޷ $(FORMAT) ʽ̵ĸʽϢ\nҪʹ $(OWNFORMAT) ʽĵĸ";
+ Text[ russian ] = ", , $(FORMAT). \n$(OWNFORMAT)?";
+ Text[ polish ] = "Dokument ten moe zawiera formatowania\ni informacje, ktrych nie bdzie mona zapisa\nw formacie $(FORMAT). Czy chcesz zapisa\nzmiany w formacie $(OWNFORMAT)?";
+ Text[ japanese ] = "޷Ă $(FORMAT) ŕۑłȂݒƏ\n܂ł܂BύX\n$(OWNFORMAT) ɕۑ܂?";
+ Text[ chinese_traditional ] = "oӤit@ǵLk $(FORMAT) 榡xs榡C\nznϥ $(OWNFORMAT) 榡xsܧH";
+ Text[ arabic ] = " ʡ ϡ\n $(FORMAT). \n $(OWNFORMAT)";
+ Text[ dutch ] = "Dit document kan opmaakattributen en gegevens \nbevatten die niet in $(FORMAT) formaat opgeslagen\nkunnen worden. Wilt u deze wijzigingen in\n$(OWNFORMAT) formaat opslaan?";
+ Text[ chinese_simplified ] = "ĵܺһЩ޷ $(FORMAT) ʽ̵ĸʽϢ\nҪʹ $(OWNFORMAT) ʽĵĸ";
+ Text[ greek ] = " \n \n $(FORMAT). \n$(OWNFORMAT);";
+ Text[ korean ] = " $(FORMAT) Ŀ Ӽ \n ֽϴ. \n$(OWNFORMAT) Ŀ Ͻðڽϱ?";
+ Text[ turkish ] = "Bu belgede, $(FORMAT) formatnda kaydedilemeyen\n formatlamalar ve bilgiler bulunabilir. Deiiklikleri \n$(OWNFORMAT) formatnda kaydetmek istiyor musunuz?";
+ Text[ language_user1 ] = " ";
+};
+String STR_QUERY_MUSTOWNFORMAT
+{
+ Text = "Dokumente knnen nicht im $(FORMAT) Format gespeichert\nwerden. Mchten Sie das Dokument im $(OWNFORMAT) Format\nspeichern?" ;
+ Text [ ENGLISH ] = "Documents cannot be exportet to $(FORMAT) format. Do you\nwant to save your changes using the $(OWNFORMAT) format?" ;
+ Text [ english_us ] = "Documents cannot be saved in $(FORMAT) format. Do you\nwant to save your changes using the $(OWNFORMAT) format?" ;
+ Text [ italian ] = "I documenti non possono essere salvati nel formato $(FORMAT).\nVolete salvarli nel formato $(OWNFORMAT)?" ;
+ Text [ spanish ] = "Los documentos no se pueden guardar en el formato $(FORMAT).\nDesea guardar el documento en formato $(OWNFORMAT)?" ;
+ Text [ french ] = "Impossible d'enregistrer les documents au format $(FORMAT).\nSouhaitez-vous enregistrer le document au format $(OWNFORMAT) ?" ;
+ Text [ dutch ] = "Documenten kunnen niet in $(FORMAT) formaat worden \nopgeslagen. Wilt u het document in $(OWNFORMAT) formaat\nopslaan?" ;
+ Text [ swedish ] = "Dokument kan inte sparas i $(FORMAT)-format.\nSkall dokumentet sparas i $(OWNFORMAT)-format?" ;
+ Text [ danish ] = "Det er ikke muligt at gemmme dokumenter i $(FORMAT) format.\nVil du gemme dokumentet i $(OWNFORMAT) format?" ;
+ Text [ portuguese_brazilian ] = "Dokumente knnen nicht im $(FORMAT) Format gespeichert\nwerden. Mchten Sie das Dokument im $(OWNFORMAT) Format\nspeichern?" ;
+ Text [ portuguese ] = "Impossvel guardar documentos no formato $(FORMAT).\nDeseja guardar o documento no formato $(OWNFORMAT)?" ;
+ Text[ chinese_simplified ] = "޷ $(FORMAT) ʽĵ\nҪʹ $(OWNFORMAT) ʽ";
+ Text[ russian ] = " $(FORMAT) .\n \n $(OWNFORMAT)?";
+ Text[ polish ] = "Nie mona zapisa dokumentw w formacie $(FORMAT).\nCzy chcesz zapisa dokument\nw formacie $(OWNFORMAT) ?";
+ Text[ japanese ] = "޷Ă $(FORMAT) \nۑł܂łB޷Ă $(OWNFORMAT) \nۑ܂H";
+ Text[ chinese_traditional ] = "Lk $(FORMAT) 榡xsC\nznϥ $(OWNFORMAT) 榡xsH";
+ Text[ arabic ] = " $(FORMAT).\n \n$(OWNFORMAT)";
+ Text[ dutch ] = "Documenten kunnen niet in $(FORMAT) formaat worden \nopgeslagen. Wilt u het document in $(OWNFORMAT) formaat\nopslaan?";
+ Text[ chinese_simplified ] = "޷ $(FORMAT) ʽĵ\nҪʹ $(OWNFORMAT) ʽ";
+ Text[ greek ] = " $(FORMAT).\n $(OWNFORMAT);";
+ Text[ korean ] = " $(FORMAT) Ŀ ϴ. $(OWNFORMAT) Ŀ \nϽðڽϱ?";
+ Text[ turkish ] = "Belgeler $(FORMAT) formatnda kaydedilemiyor\n. Belgeyi $(OWNFORMAT) formatnda\nkaydetmek ister misiniz?";
+};
+String STR_SAVEDOC
+{
+ Text = "~Speichern" ;
+ Text [ ENGLISH ] = "~Save" ;
+ Text [ english_us ] = "~Save" ;
+ Text [ italian ] = "~Salva" ;
+ Text [ spanish ] = "~Guardar" ;
+ Text [ french ] = "~Enregistrer" ;
+ Text [ dutch ] = "~Opslaan" ;
+ Text [ swedish ] = "Spara" ;
+ Text [ danish ] = "Gem" ;
+ Text [ portuguese_brazilian ] = "~Speichern" ;
+ Text [ portuguese ] = "~Guardar" ;
+ Text[ chinese_simplified ] = "(~S)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zapisz";
+ Text[ japanese ] = "ۑ(~S)";
+ Text[ chinese_traditional ] = "xs(~S)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Opslaan";
+ Text[ chinese_simplified ] = "(~S)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~S)";
+ Text[ turkish ] = "~Kaydet";
+ Text[ language_user1 ] = " ";
+};
+String STR_UPDATEDOC
+{
+ Text = "Aktuali~siere" ;
+ Text [ ENGLISH ] = "Update" ;
+ Text [ english_us ] = "~Update" ;
+ Text [ italian ] = "~Aggiorna" ;
+ Text [ spanish ] = "Actuali~zacin" ;
+ Text [ french ] = "Actuali~se" ;
+ Text [ dutch ] = "Aktuali~seer" ;
+ Text [ swedish ] = "~Uppdatera" ;
+ Text [ danish ] = "Opdater" ;
+ Text [ portuguese_brazilian ] = "Aktuali~siere" ;
+ Text [ portuguese ] = "A ac~tualizar" ;
+ Text[ chinese_simplified ] = "(~U)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Aktualizuj";
+ Text[ japanese ] = "XV(~U)";
+ Text[ chinese_traditional ] = "s(~U)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Aktuali~seer";
+ Text[ chinese_simplified ] = "(~U)";
+ Text[ greek ] = "";
+ Text[ korean ] = "Ʈ(~U)";
+ Text[ turkish ] = "Gn~celle";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVEASDOC
+{
+ Text = "Speichern ~unter..." ;
+ Text [ ENGLISH ] = "Save ~as..." ;
+ Text [ dutch ] = "Opslaa~n als..." ;
+ Text [ english_us ] = "Save ~As..." ;
+ Text [ italian ] = "Salva ~con nome..." ;
+ Text [ spanish ] = "G~uardar como..." ;
+ Text [ french ] = "Enregistrer ~sous..." ;
+ Text [ swedish ] = "Spara som..." ;
+ Text [ danish ] = "Ge~m som..." ;
+ Text [ portuguese_brazilian ] = "Speichern ~unter..." ;
+ Text [ portuguese ] = "Guardar ~como..." ;
+ Text[ chinese_simplified ] = "Ϊ(~A)...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Zapisz jako...";
+ Text[ japanese ] = "Otĕۑ(~A)...";
+ Text[ chinese_traditional ] = "tss(~A)...";
+ Text[ arabic ] = " ...";
+ Text[ dutch ] = "Opslaa~n als...";
+ Text[ chinese_simplified ] = "Ϊ(~A)...";
+ Text[ greek ] = " ...";
+ Text[ korean ] = "ٸ ̸ (~A)...";
+ Text[ turkish ] = "~Farkl kaydet...";
+ Text[ language_user1 ] = " ";
+};
+String STR_SAVECOPYDOC
+{
+ Text = "Kopie Speichern ~unter..." ;
+ Text [ ENGLISH ] = "Save Copy ~as" ;
+ Text [ english_us ] = "Save Copy ~as..." ;
+ Text [ italian ] = "Salva copia con ~nome..." ;
+ Text [ spanish ] = "Guardar copia ~como..." ;
+ Text [ french ] = "Enregistrer la copie ~sous..." ;
+ Text [ dutch ] = "~Kopie opslaan als..." ;
+ Text [ swedish ] = "Spara kopia som..." ;
+ Text [ danish ] = "Gem kopi som..." ;
+ Text [ portuguese_brazilian ] = "Kopie Speichern ~unter..." ;
+ Text [ portuguese ] = "Guardar ~cpia como..." ;
+ Text[ chinese_simplified ] = "Ϊ(~A)...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Zapisz kopi jako...";
+ Text[ japanese ] = "߰ɖOtĕۑ(~A)...";
+ Text[ chinese_traditional ] = "_tss(~A)...";
+ Text[ arabic ] = " ...";
+ Text[ dutch ] = "~Kopie opslaan als...";
+ Text[ chinese_simplified ] = "Ϊ(~A)...";
+ Text[ greek ] = " ...";
+ Text[ korean ] = "縦 ٸ ̸ (~A)...";
+ Text[ turkish ] = "Kopyasn farkl ka~ydet...";
+ Text[ language_user1 ] = " ";
+};
+String STR_CLOSEDOC
+{
+ Text = "S~chlieen" ;
+ Text [ ENGLISH ] = "~Close" ;
+ Text [ dutch ] = "S~luiten" ;
+ Text [ english_us ] = "~Close" ;
+ Text [ italian ] = "Chiudi" ;
+ Text [ spanish ] = "~Cerrar" ;
+ Text [ french ] = "~Fermer" ;
+ Text [ swedish ] = "St~ng" ;
+ Text [ danish ] = "Luk" ;
+ Text [ portuguese_brazilian ] = "S~chlieen" ;
+ Text [ portuguese ] = "~Fechar" ;
+ Text[ chinese_simplified ] = "ر(~C)";
+ Text[ russian ] = "~";
+ Text[ polish ] = "Zamknij";
+ Text[ japanese ] = "‚(~C)";
+ Text[ chinese_traditional ] = "(~C)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "S~luiten";
+ Text[ chinese_simplified ] = "ر(~C)";
+ Text[ greek ] = "";
+ Text[ korean ] = "ݱ(~C)";
+ Text[ turkish ] = "~Kapat";
+ Text[ language_user1 ] = " ";
+};
+String STR_CLOSEDOC_ANDRETURN
+{
+ /* ### ACHTUNG: Neuer Text in Resource? S~chlieen & zurck zu : S~chlieen & zurck zu */
+ /* ### ACHTUNG: Neuer Text in Resource? S~chlieen & zurck zu : S~chlieen & zurck zu */
+ Text = "S~chlieen & zurck zu " ;
+ Text [ ENGLISH ] = "~Close & Return to " ;
+ Text [ english_us ] = "~Close & Return to " ;
+ Text [ italian ] = "Chiudi e ritorna a " ;
+ Text [ spanish ] = "C~errar y regresar a " ;
+ Text [ french ] = "~Fermer & retourner " ;
+ Text [ dutch ] = "S~luiten en terug naar " ;
+ Text [ swedish ] = "St~ng och tillbaka till " ;
+ Text [ danish ] = "Luk og g tilbage til " ;
+ Text [ portuguese_brazilian ] = "S~chlieen & zurck zu " ;
+ Text [ portuguese ] = "~Fechar & Regressar a " ;
+ Text[ chinese_simplified ] = "رպͷ(~C)";
+ Text[ russian ] = " & ";
+ Text[ polish ] = "Zamknij & Powr do ";
+ Text[ japanese ] = "‚&߂(~C)";
+ Text[ chinese_traditional ] = "M^(~C)";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "S~luiten en terug naar ";
+ Text[ chinese_simplified ] = "رպͷ(~C)";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ݰ ǵư (~C)";
+ Text[ turkish ] = "Kapat ve geri dn ";
+ Text[ language_user1 ] = " ";
+};
+String STR_WIZARD
+{
+ Text = "wizard" ;
+ Text [ ENGLISH ] = "wizard" ;
+ Text [ english_us ] = "wizard" ;
+ Text [ italian ] = "wizard" ;
+ Text [ spanish ] = "asistente" ;
+ Text [ french ] = "Assistant" ;
+ Text [ dutch ] = "wizard" ;
+ Text [ swedish ] = "wizard" ;
+ Text [ danish ] = "wizard" ;
+ Text [ portuguese_brazilian ] = "wizard" ;
+ Text [ portuguese ] = "wizard" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "kreator";
+ Text[ japanese ] = "ް";
+ Text[ chinese_traditional ] = "Q";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "wizard";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Asistan";
+ Text[ language_user1 ] = " ";
+};
+String RID_STR_FILTCONFIG
+{
+ Text = "Konfigurationen" ;
+ Text [ ENGLISH ] = "Configurations" ;
+ Text [ dutch ] = "Configuraties" ;
+ Text [ english_us ] = "Configurations" ;
+ Text [ italian ] = "Configurazioni" ;
+ Text [ spanish ] = "Configuraciones" ;
+ Text [ french ] = "Paramtres" ;
+ Text [ swedish ] = "Konfigurationer" ;
+ Text [ danish ] = "Konfigurationer" ;
+ Text [ portuguese_brazilian ] = "Konfigurationen" ;
+ Text [ portuguese ] = "Configuraes" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Konfiguracje";
+ Text[ japanese ] = "ݒ";
+ Text[ chinese_traditional ] = "tm";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Configuraties";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Konfigrasyonlar";
+ Text[ language_user1 ] = " ";
+};
+String RID_STR_FILTBASIC
+{
+ Text = "StarBasic Bibliotheken" ;
+ Text [ ENGLISH ] = "StarBasic Libraries" ;
+ Text [ dutch ] = "StarOffice Basic Bibliotheken" ;
+ Text [ english_us ] = "StarOffice Basic Libraries" ;
+ Text [ italian ] = "Biblioteche di StarOffice Basic" ;
+ Text [ spanish ] = "Bibliotecas StarOffice Basic" ;
+ Text [ french ] = "Bibilothques StarOffice Basic" ;
+ Text [ swedish ] = "StarOffice Basic Bibliotek" ;
+ Text [ danish ] = "StarOffice Basic biblioteker" ;
+ Text [ portuguese_brazilian ] = "StarOffice Basic Bibliotheken" ;
+ Text [ portuguese ] = "Bibliotecas StarOffice Basic" ;
+ Text[ chinese_simplified ] = "StarOffice Basic ";
+ Text[ russian ] = " StarOffice Basic";
+ Text[ polish ] = "Biblioteki w StarOffice Basic";
+ Text[ japanese ] = "StarOffice Basic ײ";
+ Text[ chinese_traditional ] = "StarOffice Basic {w";
+ Text[ arabic ] = " StarOffice Basic";
+ Text[ dutch ] = "StarOffice Basic Bibliotheken";
+ Text[ chinese_simplified ] = "StarOffice Basic ";
+ Text[ greek ] = " StarOffice Basic";
+ Text[ korean ] = "StarOffice Basic ̺귯";
+ Text[ turkish ] = "StarOffice Basic kitaplklar";
+ Text[ language_user1 ] = " ";
+};
+String RID_STR_WARNSTYLEOVERWRITE
+{
+ Text = "Soll der Style \"$(ARG1)\" ersetzt werden?" ;
+ Text [ ENGLISH ] = "Should style \"$(ARG1)\" be overwritten?" ;
+ Text [ english_us ] = "Should the \"$(ARG1)\" Style be replaced?" ;
+ Text [ italian ] = "Volete sostituire lo stile \"$(ARG1)\"?" ;
+ Text [ spanish ] = "Desea substituir el estilo \"$(ARG1)\"?" ;
+ Text [ french ] = "Voulez-vous vraiment remplacer le style $(ARG1) ?" ;
+ Text [ dutch ] = "Wilt u opmaakprofiel \"$(ARG1)\" vervangen?" ;
+ Text [ swedish ] = "Ska formatet \"$(ARG1)\" ersttas?" ;
+ Text [ danish ] = "Skal typografien \"$(ARG1)\" erstattes?" ;
+ Text [ portuguese_brazilian ] = "Soll der Style $(ARG1) ersetzt werden?" ;
+ Text [ portuguese ] = "Deseja substituir o estilo \"$(ARG1)\"?" ;
+ Text[ chinese_simplified ] = "Ҫʽ$(ARG1)";
+ Text[ russian ] = " \"$(ARG1)\"?";
+ Text[ polish ] = "Zastpi styl \"$(ARG1)\"?";
+ Text[ japanese ] = "\"$(ARG1)\"u܂?";
+ Text[ chinese_traditional ] = "nN˦$(ARG1)H";
+ Text[ arabic ] = " \"$(ARG1)\"";
+ Text[ dutch ] = "Wilt u opmaakprofiel \"$(ARG1)\" vervangen?";
+ Text[ chinese_simplified ] = "Ҫʽ$(ARG1)";
+ Text[ greek ] = " $(ARG1);";
+ Text[ korean ] = " $(ARG1) üϽðڽϱ?";
+ Text[ turkish ] = "\"$(ARG1)\" biimi bakas ile deitirilsin mi?";
+ Text[ language_user1 ] = "All \"Vorlagen\" /Styles are written with a capital S.10.5.00EM";
+};
+String STR_DOC_LOADING
+{
+ Text = "Dokument wird geladen" ;
+ Text [ English ] = "loading document" ;
+ Text [ english_us ] = "Loading Document" ;
+ Text [ italian ] = "Il documento viene aperto" ;
+ Text [ spanish ] = "Cargando el documento" ;
+ Text [ french ] = "Document en cours de chargement" ;
+ Text [ dutch ] = "Document wordt geladen" ;
+ Text [ swedish ] = "Dokument laddas" ;
+ Text [ danish ] = "Indlser dokument" ;
+ Text [ portuguese_brazilian ] = "Dokument wird geladen" ;
+ Text [ portuguese ] = "A carregar documento" ;
+ Text[ chinese_simplified ] = "װĵ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "adowanie dokumentu";
+ Text[ japanese ] = "޷Ăǂݍł܂";
+ Text[ chinese_traditional ] = "b˸";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Document wordt geladen";
+ Text[ chinese_simplified ] = "װĵ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ε ";
+ Text[ turkish ] = "Belge ykleniyor";
+ Text[ language_user1 ] = " ";
+};
+Resource RID_DLSTATUS
+{
+ String INET_NAME_RESOLVE_START
+ {
+ Text = "Verbindung zu: $(HOST). Warten auf Antwort..." ;
+ Text [ ENGLISH ] = "Connection to: $(HOST). Waiting for response..." ;
+ Text [ dutch ] = "Verbinding met: $(HOST). Wacht op antwoord..." ;
+ Text [ english_us ] = "Connection to: $(HOST). Waiting for response..." ;
+ Text [ italian ] = "Collegamento a: $(HOST). in attesa di risposta..." ;
+ Text [ spanish ] = "Conexin con: $(HOST). Esperando respuesta..." ;
+ Text [ french ] = "Connexion : $(HOST). Attend rponse..." ;
+ Text [ swedish ] = "Ansluter till: $(HOST). Vntar p svar..." ;
+ Text [ danish ] = "Forbindelse til: $(HOST). Venter p svar..." ;
+ Text [ portuguese_brazilian ] = "Verbindung zu: $(HOST). Warten auf Antwort..." ;
+ Text [ portuguese ] = "Ligao com: $(HOST). Esperando resposta..." ;
+ Text[ chinese_simplified ] = "ӵ$(HOST)ڵȺ...";
+ Text[ russian ] = " : $(HOST). ...";
+ Text[ polish ] = "Poczenie z: $(HOST). Czekanie na odpowied...";
+ Text[ japanese ] = "ڑ:$(HOST)B҂Ă܂...";
+ Text[ chinese_traditional ] = "su$(HOST)CbԵ_...";
+ Text[ arabic ] = " : $(HOST). ...";
+ Text[ dutch ] = "Verbinding met: $(HOST). Wacht op antwoord...";
+ Text[ chinese_simplified ] = "ӵ$(HOST)ڵȺ...";
+ Text[ greek ] = " : $(HOST). ...";
+ Text[ korean ] = " : $(HOST). ȸ ٸʽÿ...";
+ Text[ turkish ] = "Balanlan: $(HOST). Yant bekleniyor...";
+ Text[ language_user1 ] = " ";
+ };
+ String INET_CONNECT_START
+ {
+ Text = "Geffnet wird: $(TARGET) auf $(HOST)" ;
+ Text [ ENGLISH ] = "Opening $(TARGET) at $(HOST)" ;
+ Text [ dutch ] = "Geopend wordt: $(TARGET) op $(HOST)" ;
+ Text [ english_us ] = "Opening $(TARGET) at $(HOST)" ;
+ Text [ italian ] = "Viene aperto: $(TARGET) su $(HOST)" ;
+ Text [ spanish ] = "Abriendo: $(TARGET) en $(HOST)" ;
+ Text [ french ] = "Ouvrir : $(TARGET) $(HOST)" ;
+ Text [ swedish ] = "$(TARGET) ppnas p $(HOST)" ;
+ Text [ danish ] = "bner: $(TARGET) p $(HOST)" ;
+ Text [ portuguese_brazilian ] = "Geffnet wird: $(TARGET) auf $(HOST)" ;
+ Text [ portuguese ] = "Abrir: $(TARGET) em $(HOST)" ;
+ Text[ chinese_simplified ] = "򿪣$(HOST)ϵ$(TARGET)";
+ Text[ russian ] = "$(TARGET) $(HOST)";
+ Text[ polish ] = "Otwieranie: $(TARGET) na $(HOST)";
+ Text[ japanese ] = "J:$(HOST)$(TARGET)";
+ Text[ chinese_traditional ] = "}ҡG$(HOST)W$(TARGET)";
+ Text[ arabic ] = " : $(TARGET) $(HOST)";
+ Text[ dutch ] = "Geopend wordt: $(TARGET) op $(HOST)";
+ Text[ chinese_simplified ] = "򿪣$(HOST)ϵ$(TARGET)";
+ Text[ greek ] = ": $(TARGET) $(HOST)";
+ Text[ korean ] = "$(HOST) $(TARGET) ";
+ Text[ turkish ] = "Alan: $(HOST) zerinde bulunan $(TARGET)";
+ Text[ language_user1 ] = " ";
+ };
+ String INET_READ_STATUS
+ {
+ Text = "bertragen wird: $(TARGET) von $(HOST). Gelesen: $(BYTE)" ;
+ Text [ ENGLISH ] = "Loading: $(TARGET) from $(HOST). Loaded: $(BYTE)" ;
+ Text [ english_us ] = "Loading: $(TARGET) from $(HOST). Loaded: $(BYTE)" ;
+ Text [ italian ] = "Viene trasferito: $(TARGET) da $(HOST). Letti: $(BYTE)" ;
+ Text [ spanish ] = "Transfiriendo: $(TARGET) desde $(HOST). Ledo: $(BYTE)" ;
+ Text [ french ] = "$(TARGET) de $(HOST) transfr. Charg : $(BYTE)" ;
+ Text [ dutch ] = "Geladen wordt: $(TARGET) van $(HOST). Gelezen: $(BYTE)" ;
+ Text [ swedish ] = "$(TARGET) verfrs frn $(HOST). Lst: $(BYTE)" ;
+ Text [ danish ] = "Overfrer: $(TARGET) fra$(HOST). Indlst: $(BYTE)" ;
+ Text [ portuguese_brazilian ] = "bertragen wird: $(TARGET) von $(HOST). Gelesen: $(BYTE)" ;
+ Text [ portuguese ] = "Transferir: $(TARGET) de $(HOST). Lidos: $(BYTE)" ;
+ Text[ chinese_simplified ] = "ݣ$(HOST)$(TARGET)ѾĶ$(BYTE)";
+ Text[ russian ] = ": $(TARGET) $(HOST). : $(BYTE)";
+ Text[ polish ] = "adowanie: $(TARGET) z $(HOST). Zaadowano: $(BYTE)";
+ Text[ japanese ] = "]:$(HOST)$(TARGET)B ǂݎ: $(BYTE)";
+ Text[ chinese_traditional ] = "ǻG$(HOST)$(TARGET)Cwg\\ŪG $(BYTE)";
+ Text[ arabic ] = " : $(TARGET) $(HOST). : $(BYTE)";
+ Text[ dutch ] = "Geladen wordt: $(TARGET) van $(HOST). Gelezen: $(BYTE)";
+ Text[ chinese_simplified ] = "ݣ$(HOST)$(TARGET)ѾĶ$(BYTE)";
+ Text[ greek ] = ": $(TARGET) $(HOST). : $(BYTE)";
+ Text[ korean ] = " : $(HOST) $(TARGET) . ε: $(BYTE)";
+ Text[ turkish ] = "Aktarlan: $(HOST) sunucusundan $(TARGET). Okunan: $(BYTE)";
+ Text[ language_user1 ] = " ";
+ };
+ String INET_CONNECTION_CLOSED
+ {
+ Text = "Verbindung abgebaut" ;
+ Text [ ENGLISH ] = "Disconnected" ;
+ Text [ dutch ] = "Verbinding verbroken" ;
+ Text [ english_us ] = "Disconnected" ;
+ Text [ italian ] = "Collegamento interrotto" ;
+ Text [ spanish ] = "Desconectado" ;
+ Text [ french ] = "Dconnect" ;
+ Text [ swedish ] = "Nedkoppling" ;
+ Text [ danish ] = "Forbindelse afbrudt" ;
+ Text [ portuguese ] = "Ligao cancelada" ;
+ Text [ portuguese_brazilian ] = "Verbindung abgebaut" ;
+ Text[ chinese_simplified ] = "Ѿ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Poczenie rozczone";
+ Text[ japanese ] = "ڑ~܂";
+ Text[ chinese_traditional ] = "wgsu";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Verbinding verbroken";
+ Text[ chinese_simplified ] = "Ѿ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Balant kesildi";
+ Text[ language_user1 ] = " ";
+ };
+};
+Resource RID_DLSTATUS2
+{
+ String SVBINDSTATUS_FINDINGRESOURCE
+ {
+ Text = "Verbindung zu: $(HOST). Warten auf Antwort..." ;
+ Text [ ENGLISH ] = "Connection to: $(HOST). Waiting for response..." ;
+ Text [ dutch ] = "Verbinding met: $(HOST). Wacht op antwoord..." ;
+ Text [ english_us ] = "Connection to: $(HOST). Waiting for response..." ;
+ Text [ italian ] = "Collegamento con: $(HOST). in attesa di risposta..." ;
+ Text [ spanish ] = "Conexin con: $(HOST). Esperando respuesta..." ;
+ Text [ french ] = "Connexion : $(HOST). Attend rponse..." ;
+ Text [ swedish ] = "Ansluter till: $(HOST). Vntar p svar..." ;
+ Text [ danish ] = "Forbindelse til: $(HOST). Venter p svar..." ;
+ Text [ portuguese_brazilian ] = "Verbindung zu: $(HOST). Warten auf Antwort..." ;
+ Text [ portuguese ] = "Ligao com: $(HOST). Esperando resposta ..." ;
+ Text[ chinese_simplified ] = "ӣ$(HOST)ڵȺ...";
+ Text[ russian ] = " : $(HOST). ...";
+ Text[ polish ] = "Poczenie z: $(HOST). Czekanie na odpowied...";
+ Text[ japanese ] = "ڑ:$(HOST)B҂Ă܂...";
+ Text[ chinese_traditional ] = "suG$(HOST)CbԵ_...";
+ Text[ arabic ] = " : $(HOST). ...";
+ Text[ dutch ] = "Verbinding met: $(HOST). Wacht op antwoord...";
+ Text[ chinese_simplified ] = "ӣ$(HOST)ڵȺ...";
+ Text[ greek ] = " : $(HOST). ...";
+ Text[ korean ] = " : $(HOST). ȸ ٸʽÿ...";
+ Text[ turkish ] = "Balanlan: $(HOST). Yant bekleniyor...";
+ Text[ language_user1 ] = " ";
+ };
+ String SVBINDSTATUS_CONNECTING
+ {
+ Text = "Geffnet wird: $(TARGET) auf $(HOST)" ;
+ Text [ ENGLISH ] = "Opening $(TARGET) at $(HOST)" ;
+ Text [ dutch ] = "Geopend wordt: $(TARGET) op $(HOST)" ;
+ Text [ english_us ] = "Opening $(TARGET) at $(HOST)" ;
+ Text [ italian ] = "Viene aperto: $(TARGET) su $(HOST)" ;
+ Text [ spanish ] = "Abriendo: $(TARGET) en $(HOST)" ;
+ Text [ french ] = "En cours d'ouverture : $(TARGET) sur $(HOST)" ;
+ Text [ swedish ] = "$(TARGET) ppnas p $(HOST)" ;
+ Text [ danish ] = "bner: $(TARGET) p $(HOST)" ;
+ Text [ portuguese ] = "Abrir: $(TARGET) em $(HOST)" ;
+ Text [ portuguese_brazilian ] = "Geffnet wird: $(TARGET) auf $(HOST)" ;
+ Text[ chinese_simplified ] = "򿪣 $(HOST)ϵ$(TARGET)";
+ Text[ russian ] = "$(TARGET) $(HOST)";
+ Text[ polish ] = "Otwieranie: $(TARGET) na $(HOST)";
+ Text[ japanese ] = "J:$(HOST)$(TARGET)";
+ Text[ chinese_traditional ] = "}ҡG$(HOST)W$(TARGET)";
+ Text[ arabic ] = " : $(TARGET) $(HOST)";
+ Text[ dutch ] = "Geopend wordt: $(TARGET) op $(HOST)";
+ Text[ chinese_simplified ] = "򿪣 $(HOST)ϵ$(TARGET)";
+ Text[ greek ] = ": $(TARGET) $(HOST)";
+ Text[ korean ] = "$(HOST) $(TARGET) ";
+ Text[ turkish ] = "Alan: $(HOST) zerinde bulunan $(TARGET)";
+ Text[ language_user1 ] = " ";
+ };
+ String SVBINDSTATUS_DOWNLOADINGDATA
+ {
+ Text = "bertragen wird: $(TARGET) Gelesen: $(BYTE)" ;
+ Text [ ENGLISH ] = "Loading: $(TARGET) Loaded: $(BYTE)" ;
+ Text [ english_us ] = "Loading: $(TARGET) Loaded: $(BYTE)" ;
+ Text [ italian ] = "Viene trasferito: $(TARGET) Letti: $(BYTE)" ;
+ Text [ spanish ] = "Transfiriendo: $(TARGET) Ledo: $(BYTE)" ;
+ Text [ french ] = "En cours de transfert : $(TARGET) Lu : $(BYTE)" ;
+ Text [ dutch ] = "Geladen wordt: $(TARGET) Gelezen: $(BYTE)" ;
+ Text [ swedish ] = "verfrs: $(TARGET) Lst: $(BYTE)" ;
+ Text [ danish ] = "Overfrer: $(TARGET) Indlst: $(BYTE)" ;
+ Text [ portuguese_brazilian ] = "bertragen wird: $(TARGET) Gelesen: $(BYTE)" ;
+ Text [ portuguese ] = "Transferir: $(TARGET) Lidos: $(BYTE)" ;
+ Text[ chinese_simplified ] = "ݣ$(TARGET)ѾĶ$(BYTE)";
+ Text[ russian ] = ": $(TARGET) : $(BYTE)";
+ Text[ polish ] = "adowanie: $(TARGET) Zaadowano: $(BYTE)";
+ Text[ japanese ] = "]:$(TARGET) ǂݎ:$(BYTE)";
+ Text[ chinese_traditional ] = "ǻG$(TARGET)wg\\ŪG$(BYTE)";
+ Text[ arabic ] = " : $(TARGET) : $(BYTE)";
+ Text[ dutch ] = "Geladen wordt: $(TARGET) Gelezen: $(BYTE)";
+ Text[ chinese_simplified ] = "ݣ$(TARGET)ѾĶ$(BYTE)";
+ Text[ greek ] = ": $(TARGET) : $(BYTE)";
+ Text[ korean ] = " : $(TARGET) ε: $(BYTE)";
+ Text[ turkish ] = "Aktarlan: $(TARGET) Okunan: $(BYTE)";
+ Text[ language_user1 ] = " ";
+ };
+ String SVBINDSTATUS_ENDDOWNLOADDATA
+ {
+ Text = "Verbindung abgebaut" ;
+ Text [ ENGLISH ] = "Disconnected" ;
+ Text [ english_us ] = "Disconnected" ;
+ Text [ italian ] = "Collegamento interrotto" ;
+ Text [ spanish ] = "Desconectado" ;
+ Text [ french ] = "Dconnexion connexion" ;
+ Text [ dutch ] = "Verbinding verbroken" ;
+ Text [ swedish ] = "Nedkopplad" ;
+ Text [ danish ] = "Forbindelse afbrudt" ;
+ Text [ portuguese_brazilian ] = "Verbindung abgebaut" ;
+ Text [ portuguese ] = "Ligao cancelada" ;
+ Text[ chinese_simplified ] = "Ѿ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Poczenie rozczone";
+ Text[ japanese ] = "ڑ~܂";
+ Text[ chinese_traditional ] = "wgsu";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Verbinding verbroken";
+ Text[ chinese_simplified ] = "Ѿ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Balant kesildi";
+ Text[ language_user1 ] = " ";
+ };
+};
+QueryBox MSG_OPEN_READONLY
+{
+ BUTTONS = WB_YES_NO ;
+ DEFBUTTON = WB_DEF_YES ;
+ MESSAGE = "Das Dokument kann nicht zur Bearbeitung geffnet werden.\nMchten Sie es zum Lesen ffnen?" ;
+ MESSAGE [ English ] = "The Document can't be opened for writing.\nDo you want to open it read-only?" ;
+ MESSAGE [ norwegian ] = "Dokumentet kan ikke pnes for skriving.\nVil du pne det som skrivebeskyttet?" ;
+ MESSAGE [ italian ] = "Impossibile aprire il documento per la scrittura.\nAprirlo in sola lettura?" ;
+ MESSAGE [ portuguese_brazilian ] = "O documento no pode ser aberto para gravao.\nDeseja abri-lo como s leitura?" ;
+ MESSAGE [ portuguese ] = "Impossvel abrir documento para editar.\n Abri-lo apenas para leitura?" ;
+ MESSAGE [ finnish ] = "Asiakirjaa ei voi avata kirjoittamista varten.\nAvataanko se vain lukemista varten?" ;
+ MESSAGE [ danish ] = "Det er ikke muligt at bne dokumentet til redigering.\nVil du bne det i skrivebeskyttet tilstand?" ;
+ MESSAGE [ french ] = "Impossible d'ouvrir le document pour modification.\nVoulez-vous l'ouvrir en lecture seule ?" ;
+ MESSAGE [ swedish ] = "Dokumentet kan inte ppnas fr redigering. \nVill Du ppna det fr lsning?" ;
+ MESSAGE [ dutch ] = "Dit document is schrijfbeveiligd.\nWilt u het alleen-lezen?" ;
+ MESSAGE [ spanish ] = "El documento no se puede abrir para editar.\nDesea abrirlo solo para leer?" ;
+ MESSAGE [ english_us ] = "Document can't be opened for editing.\nDo you want to open it as read only?" ;
+ MESSAGE[ chinese_simplified ] = "ܱ༭ļ\nҪĶ";
+ MESSAGE[ russian ] = " .\n ?";
+ MESSAGE[ polish ] = "Dokumentu nie mona otworzy do edycji.\nCzy chcesz go otworzy do odczytu?";
+ MESSAGE[ japanese ] = "޷Ă͕ҏWpɊJƂ͂ł܂B\nǂݎpɊJ܂?";
+ MESSAGE[ chinese_traditional ] = "zsoɮסC\nn}Ҿ\\ŪH";
+ MESSAGE[ arabic ] = " .\n ɿ";
+ MESSAGE[ dutch ] = "Dit document is schrijfbeveiligd.\nWilt u het alleen-lezen?";
+ MESSAGE[ chinese_simplified ] = "ܱ༭ļ\nҪĶ";
+ MESSAGE[ greek ] = " .\n ;";
+ MESSAGE[ korean ] = " ϴ.\n ðڽϱ?";
+ MESSAGE[ turkish ] = "Belge dzenleme iin alamyor.\nBelge okuma iin alsn m?";
+ MESSAGE[ language_user1 ] = " ";
+};
+String STR_EDIT
+{
+ Text = "Bearbeiten" ;
+ Text [ English ] = "Edit" ;
+ Text [ english_us ] = "Edit" ;
+ Text [ portuguese_brazilian ] = "Bearbeiten" ;
+ Text [ swedish ] = "Redigera" ;
+ Text [ danish ] = "Rediger" ;
+ Text [ italian ] = "Modifica" ;
+ Text [ spanish ] = "Editar" ;
+ Text [ french ] = "Modifier" ;
+ Text [ dutch ] = "Bewerken" ;
+ Text [ portuguese ] = "Editar" ;
+ Text[ chinese_simplified ] = "༭";
+ Text[ russian ] = "";
+ Text[ polish ] = "Edytuj";
+ Text[ japanese ] = "ҏW";
+ Text[ chinese_traditional ] = "s";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Bewerken";
+ Text[ chinese_simplified ] = "༭";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Dzenle";
+ Text[ language_user1 ] = " ";
+};
+String RID_OFFICEFILTER
+{
+ Text = "StarOffice Dokumente" ;
+ Text [ English ] = "StarOffice Documents" ;
+ Text [ english_us ] = "StarOffice Documents" ;
+ Text [ italian ] = "Documenti StarOffice" ;
+ Text [ spanish ] = "Documentos StarOffice" ;
+ Text [ french ] = "Documents StarOffice" ;
+ Text [ dutch ] = "StarOffice-documenten" ;
+ Text [ swedish ] = "StarOffice-dokument" ;
+ Text [ danish ] = "StarOffice dokumenter" ;
+ Text [ portuguese_brazilian ] = "StarOffice Dokumente" ;
+ Text [ portuguese ] = "Documentos StarOffice" ;
+ Text[ chinese_simplified ] = "StarOffice ĵ";
+ Text[ russian ] = "StarOffice - ";
+ Text[ polish ] = "StarOffice - Dokumenty";
+ Text[ japanese ] = "StarOffice޷";
+ Text[ chinese_traditional ] = "StarOffice ";
+ Text[ arabic ] = " StarOffice ";
+ Text[ dutch ] = "StarOffice-documenten";
+ Text[ chinese_simplified ] = "StarOffice ĵ";
+ Text[ greek ] = "StarOffice - ";
+ Text[ korean ] = "StarOffice ";
+ Text[ turkish ] = "StarOffice belgeleri";
+ Text[ language_user1 ] = " ";
+};
+String RID_OFFICEFILTER_WILDCARD
+{
+ Text = "*.sdw;*.sdd;*.sda;*.sdc;*.smf;*.sds;*.sd;*.sdm;*.smd" ;
+};
+String RID_OFFICEFILTER_MACTYPE
+{
+ Text = "SVsd0;SW/\2510;SVsc0;SVsm0;SVsh0;SVsd1;SW/\2511;SVsc1;SVsm1;SVsh1;MAIL" ;
+};
+String RID_OFFICEFILTER_OS2TYPE
+{
+ Text = "StarWriter 4.0;StarWriter 3.0;StarDraw 4.0;StarDraw 3.0;StarCalc 4.0;StarCalc 3.0;StarMath 4.0;StarMath 3.0;StarChart 4.0;StarChart 3.0;StarFrameSet;StarMessage" ;
+};
+String STR_FRAMEOBJECT_PROPERTIES
+{
+ Text = "~Eigenschaften ..." ;
+ Text [ ENGLISH ] = "~Properties ..." ;
+ Text [ english_us ] = "Propert~ies ..." ;
+ Text [ swedish ] = "~Egenskaper..." ;
+ Text [ danish ] = "Egenskaber ..." ;
+ Text [ italian ] = "Propri~et..." ;
+ Text [ spanish ] = "Prop~iedades..." ;
+ Text [ french ] = "~Proprits ..." ;
+ Text [ dutch ] = "~Eigenschappen ..." ;
+ Text [ portuguese_brazilian ] = "~Eigenschaften ..." ;
+ Text [ portuguese ] = "~Propriedades ..." ;
+ Text[ chinese_simplified ] = "(~I)...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Waciwoci ...";
+ Text[ japanese ] = "è(~I)...";
+ Text[ chinese_traditional ] = "ݩ(~I)...";
+ Text[ arabic ] = "...";
+ Text[ dutch ] = "~Eigenschappen ...";
+ Text[ chinese_simplified ] = "(~I)...";
+ Text[ greek ] = " ...";
+ Text[ korean ] = "(~I)...";
+ Text[ turkish ] = "~zellikler ...";
+ Text[ language_user1 ] = " ";
+};
+String STR_FSET_FILTERNAME0
+{
+ Text = "HTML (FrameSet)" ;
+ Text [ ENGLISH ] = "HTML (FrameSet)" ;
+ Text [ english_us ] = "HTML (FrameSet)" ;
+ Text [ portuguese_brazilian ] = "HTML (FrameSet)" ;
+ Text [ swedish ] = "HTML (FrameSet)" ;
+ Text [ danish ] = "HTML (FrameSet)" ;
+ Text [ italian ] = "HTML (FrameSet)" ;
+ Text [ spanish ] = "HTML (FrameSet)" ;
+ Text [ french ] = "HTML (FrameSet)" ;
+ Text [ dutch ] = "HTML (FrameSet)" ;
+ Text [ portuguese ] = "HTML (FrameSet)" ;
+ Text[ chinese_simplified ] = "HTML ()";
+ Text[ russian ] = "HTML ( )";
+ Text[ polish ] = "HTML (Zestaw ramek)";
+ Text[ japanese ] = "HTML(ڰѾ)";
+ Text[ chinese_traditional ] = "HTML (Tج[)";
+ Text[ arabic ] = "HTML (FrameSet)";
+ Text[ dutch ] = "HTML (FrameSet)";
+ Text[ chinese_simplified ] = "HTML ()";
+ Text[ greek ] = "HTML (FrameSet)";
+ Text[ korean ] = "HTML ( )";
+ Text[ turkish ] = "HTML (FrameSet)";
+ Text[ language_user1 ] = " ";
+};
+String STR_FSET_FILTERNAME1
+{
+ // nur 'Dokument' "ubersetzen - only translate 'Document'
+ Text = "StarOffice Frame Dokument" ;
+ Text [ ENGLISH ] = "StarOffice Frame Document" ;
+ Text [ english_us ] = "StarOffice Frame Document" ;
+ Text [ portuguese_brazilian ] = "StarFrame Dokument" ;
+ Text [ swedish ] = "StarOffice Frame-dokument" ;
+ Text [ danish ] = "StarOffice Frame-dokument" ;
+ Text [ italian ] = "Documento StarOffice Frame" ;
+ Text [ spanish ] = "Documento StarOffice Frame" ;
+ Text [ french ] = "Document StarOffice Frame" ;
+ Text [ dutch ] = "StarOffice Frame-document" ;
+ Text [ portuguese ] = "Documento StarOffice Frame" ;
+ Text[ chinese_simplified ] = "StarOffice Frame ĵ";
+ Text[ russian ] = "StarOffice Frame - ";
+ Text[ polish ] = "Dokument StarOffice Frame";
+ Text[ japanese ] = "StarOffice Frame ޷";
+ Text[ chinese_traditional ] = "StarOffice Frame ";
+ Text[ arabic ] = " StarOffice Frame";
+ Text[ dutch ] = "StarOffice Frame-document";
+ Text[ chinese_simplified ] = "StarOffice Frame ĵ";
+ Text[ greek ] = " StarOfficeFrame";
+ Text[ korean ] = "StarOffice Frame ";
+ Text[ turkish ] = "StarOffice frame belgesi";
+ Text[ language_user1 ] = " ";
+};
+String STR_TEMPL_MOVED
+{
+ Text = "Die Vorlage \"$(TEMPLATE)\" wurde nicht an ihrem ursprnglichem Ort gefunden. Eine Vorlage gleichen Namens existiert an der Stelle \"$(FOUND)\". Soll diese Vorlage in Zukunft zum Abgleichen benutzt werden?" ;
+ Text [ ENGLISH ] = "Die Vorlage \"$(TEMPLATE)\" wurde nicht an ihrem ursprnglichem Ort gefunden. Eine Vorlage gleichen Namens existiert an der Stelle \"$(FOUND)\". Soll diese Vorlage in Zukunft zum Abgleichen benutzt werden?" ;
+ Text [ english_us ] = "The template \"$(TEMPLATE)\" was not found at the original location. A template with the same name exists at \"$(FOUND)\". Should this template be used in the future when comparing?" ;
+ Text [ portuguese_brazilian ] = "Die Vorlage $(TEMPLATE) wurde nicht an ihrem ursprnglichem Ort gefunden. Eine Vorlage gleichen Namens existiert an der Stelle $(FOUND). Soll diese Vorlage in Zukunft zum Abgleichen benutzt werden?" ;
+ Text [ swedish ] = "Mallen \"$(TEMPLATE)\" hittades inte p sin ursprungliga plats. En mall med samma namn finns p \"$(FOUND)\". Skall denna mall fortsttningsvis anvndas vid synkronisering?" ;
+ Text [ danish ] = "Skabelonen \"$(TEMPLATE)\" blev ikke fundet p det oprindelige sted. En skabelon med samme navn findes p stedet \"$(FOUND)\". Skal denne skabelon fremover bruges til synkronisering?" ;
+ Text [ italian ] = "Il modello $(TEMPLATE) non stato trovato al suo posto originario. Un modello con lo stesso nome esiste in $(FOUND). Volete usare in futuro questo modello per l'aggiornamento?" ;
+ Text [ spanish ] = "La plantilla \"$(TEMPLATE)\" no se encontr en su ubicacin original. Una plantilla con el mismo nombre se encontr en \"$(FOUND)\". Desea utilizar esta plantilla al sincronizar en el futuro?" ;
+ Text [ french ] = "Le modle \"$(TEMPLATE)\" n'a pas t trouv son emplacement d'origine. Un modle du mme nom a t dtect sur le chemin \"$(FOUND)\". Voulez-vous que ce modle soit utilis l'avenir en remplacement du modle introuvable ?" ;
+ Text [ dutch ] = "Sjabloon \"$(TEMPLATE)\" werd niet op de oorspronkelijke plaats gevonden. Een sjabloon met dezelfde naam bevindt zich op \"$(FOUND)\". Wilt u deze sjabloon in de toekomst voor het synchroniseren gebruiken?" ;
+ Text [ portuguese ] = "O modelo \"$(TEMPLATE)\" no foi encontrado no seu lugar original. J existe um modelo com o mesmo nome em \"$(FOUND)\". Deseja usar este modelo para actualizaes futuras?" ;
+ Text[ chinese_simplified ] = "ûԭλҵʽ$(TEMPLATE)һͬʽڡ$(FOUND)Ҫʹʽе";
+ Text[ russian ] = " \"$(TEMPLATE)\" . \"$(FOUND)\". ?";
+ Text[ polish ] = "Szablonu \"$(TEMPLATE)\" nie znaleziono na jego pierwotnym miejscu. Szablon o tej samej nazwie istnieje w \"$(FOUND)\". Czy uy w przyszoci tego szablonu do aktualizacji?";
+ Text[ japanese ] = "ڰ\"$(TEMPLATE)\" ̏ꏊɌ‚܂łBOڰĂ \"$(FOUND)\"ɂ܂BڰĂ ݸۂɎg܂?";
+ Text[ chinese_traditional ] = "SbӪmoӼ˦$(TEMPLATE)C@ӦPW˦b $(FOUND) CznoӼ˦H";
+ Text[ arabic ] = " \"$(TEMPLATE)\" . \"$(FOUND)\". ";
+ Text[ dutch ] = "Sjabloon \"$(TEMPLATE)\" werd niet op de oorspronkelijke plaats gevonden. Een sjabloon met dezelfde naam bevindt zich op \"$(FOUND)\". Wilt u deze sjabloon in de toekomst voor het synchroniseren gebruiken?";
+ Text[ chinese_simplified ] = "ûԭλҵʽ$(TEMPLATE)һͬʽڡ$(FOUND)Ҫʹʽе";
+ Text[ greek ] = " $(TEMPLATE) . $(FOUND). ;";
+ Text[ korean ] = "$(TEMPLATE) ġ ߰ߵ ʾҽϴ. ̸ $(FOUND) ֽϴ. ȭ ̿Ͻðڽϱ?";
+ Text[ turkish ] = "\"$(TEMPLATE)\" ablonu asl yerinde bulunamad. Ayn adl ablonun bulunduu yerin ad: \"$(FOUND)\". Bu ablon gelecekte karlatrma iin kullanlsn m?";
+ Text[ language_user1 ] = " ";
+};
+String STR_TEMPL_RESET
+{
+ Text = "Die Vorlage \"$(TEMPLATE)\" wurde nicht gefunden. Soll in Zukunft weiterhin nach ihr gesucht werden?" ;
+ Text [ ENGLISH ] = "Die Vorlage \"$(TEMPLATE)\" wurde nicht gefunden. Soll in Zukunft weiterhin nach ihr gesucht werden?" ;
+ Text [ english_us ] = "The template \"$(TEMPLATE)\" has not been found. Should the template be looked for the next time the document is opened ?" ;
+ Text [ portuguese_brazilian ] = "Die Vorlage $(TEMPLATE) wurde nicht gefunden. Soll in Zukunft weiterhin nach ihr gesucht werden?" ;
+ Text [ swedish ] = "Mallen \"$(TEMPLATE)\" hittades inte. Skall mallen skas nsta gng dokumentet ppnas?" ;
+ Text [ danish ] = "Skabelonen \"$(TEMPLATE)\" blev ikke fundet. Skal der sges efter den igen, nste gang dokumentet bnes?" ;
+ Text [ italian ] = "Il modello $(TEMPLATE) non stato trovato. Volete che venga cercato anche in futuro?" ;
+ Text [ spanish ] = "No se encontr la plantilla \"$(TEMPLATE)\". Desea que se busque la prxima vez que abra el documento?" ;
+ Text [ french ] = "Le modle $(TEMPLATE) est introuvable. Devra-t-il tre recherch la prochaine ouverture du document ?" ;
+ Text [ dutch ] = "De sjabloon \"$(TEMPLATE)\" werd niet gevonden. Wilt u dat er ook in de toekomst naar wordt gezocht?" ;
+ Text [ portuguese ] = "O modelo \"$(TEMPLATE)\" no foi encontrado. Deseja continuar a procura quando abrir o documento novamente?" ;
+ Text[ chinese_simplified ] = "޷ҵʽ$(TEMPLATE)ҪѰ";
+ Text[ russian ] = " \"$(TEMPLATE)\" . ?";
+ Text[ polish ] = "Szablonu \"$(TEMPLATE)\" nie znaleziono. Czy szuka go nadal?";
+ Text[ japanese ] = "ڰ\"$(TEMPLATE)\"͌‚܂łBꂩČ܂?";
+ Text[ chinese_traditional ] = "LkoӼ˦ $(TEMPLATE) Cn~M䥦H";
+ Text[ arabic ] = " \"$(TEMPLATE)\". ";
+ Text[ dutch ] = "De sjabloon \"$(TEMPLATE)\" werd niet gevonden. Wilt u dat er ook in de toekomst naar wordt gezocht?";
+ Text[ chinese_simplified ] = "޷ҵʽ$(TEMPLATE)ҪѰ";
+ Text[ greek ] = " $(TEMPLATE) . ;";
+ Text[ korean ] = " $(TEMPLATE) ߰ߵ ʾҽϴ. ε ãðڽϱ?";
+ Text[ turkish ] = "\"$(TEMPLATE)\" ablonu bulunamad. Bu ablon gelecekte de aransn m?";
+ Text[ language_user1 ] = " ";
+};
+String STR_AUTOMATICVERSION
+{
+ Text = "Automatisch gespeicherte Version" ;
+ Text [ ENGLISH ] = "Automatically saved version" ;
+ Text [ english_us ] = "Automatically saved version" ;
+ Text [ portuguese_brazilian ] = "Automatisch gespeicherte Version" ;
+ Text [ swedish ] = "Automatiskt sparad version" ;
+ Text [ danish ] = "Automatisk gemt version" ;
+ Text [ italian ] = "Versione salvata automaticamente" ;
+ Text [ spanish ] = "Versin guardada automticamente" ;
+ Text [ french ] = "Version enregistre automatiquement" ;
+ Text [ dutch ] = "Automatisch opgeslagen versie" ;
+ Text [ portuguese ] = "Verso guardada automaticamente" ;
+ Text[ chinese_simplified ] = "Զ̵İ汾";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Autoomatycznie zapisana wersja";
+ Text[ japanese ] = "ۑްޮ";
+ Text[ chinese_traditional ] = "۰xs";
+ Text[ arabic ] = " ";
+ Text[ dutch ] = "Automatisch opgeslagen versie";
+ Text[ chinese_simplified ] = "Զ̵İ汾";
+ Text[ greek ] = " ";
+ Text[ korean ] = "ڵ ";
+ Text[ turkish ] = "Otomatik kaydedilen srm";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_DOCTYPENAME_SW
+{
+ Text = "Textdokument";
+ Text [ ENGLISH ] = "Text Document" ;
+ Text[ english_us ] = "Text Document";
+ Text[ portuguese ] = "Texto";
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ dutch ] = "Tekstdocument";
+ Text[ french ] = "Texte";
+ Text[ spanish ] = "Documento de texto";
+ Text[ italian ] = "Documento di testo";
+ Text[ danish ] = "Tekstdokument";
+ Text[ swedish ] = "Textdokument";
+ Text[ polish ] = "Dokument tekstowy";
+ Text[ portuguese_brazilian ] = "Text Document";
+ Text[ japanese ] = "޷";
+ Text[ korean ] = "Text Document";
+ Text[ chinese_simplified ] = "ıĵ";
+ Text[ chinese_traditional ] = "r";
+ Text[ turkish ] = "Metin belgesi";
+ Text[ arabic ] = " ";
+};
+
+String STR_DOCTYPENAME_SWWEB
+{
+ Text = "HTML-Dokument";
+ Text [ ENGLISH ] = "HTML Document" ;
+ Text[ english_us ] = "HTML Document";
+ Text[ portuguese ] = "Documento HTML";
+ Text[ russian ] = " HTML";
+ Text[ greek ] = " HTML";
+ Text[ dutch ] = "HTML-document";
+ Text[ french ] = "Document HTML";
+ Text[ spanish ] = "Documento HTML";
+ Text[ italian ] = "Documento HTML";
+ Text[ danish ] = "HTML-dokument";
+ Text[ swedish ] = "HTML-dokument";
+ Text[ polish ] = "Dokument HTML";
+ Text[ portuguese_brazilian ] = "HTML Document";
+ Text[ japanese ] = "HTML `޷";
+ Text[ korean ] = "HTML Document";
+ Text[ chinese_simplified ] = "HTML ĵ";
+ Text[ chinese_traditional ] = "HTML ";
+ Text[ turkish ] = "HTML belgesi";
+ Text[ arabic ] = "HTML ";
+};
+
+String STR_DOCTYPENAME_SWGLOB
+{
+ Text = "Globaldokument";
+ Text [ ENGLISH ] = "Master Document" ;
+ Text[ english_us ] = "Master Document";
+ Text[ portuguese ] = "Documento-mestre";
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ dutch ] = "Master-document";
+ Text[ french ] = "Document matre";
+ Text[ spanish ] = "Documento maestro";
+ Text[ italian ] = "Documento master";
+ Text[ danish ] = "Hoveddokument";
+ Text[ swedish ] = "Samlingsdokument";
+ Text[ polish ] = "Dokument gwny";
+ Text[ portuguese_brazilian ] = "Master Document";
+ Text[ japanese ] = "Ͻ ޷";
+ Text[ korean ] = "Master Document";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ chinese_traditional ] = "D";
+ Text[ turkish ] = "Ana belge";
+ Text[ arabic ] = " ";
+};
+
+String STR_DOCTYPENAME_SC
+{
+ Text = "Tabellendokument";
+ Text [ ENGLISH ] = "Spreadsheet" ;
+ Text[ english_us ] = "Spreadsheet";
+ Text[ portuguese ] = "Folha de clculo";
+ Text[ russian ] = " ";
+ Text[ greek ] = " ";
+ Text[ dutch ] = "Werkbladdocument";
+ Text[ french ] = "Classeur";
+ Text[ spanish ] = "Hoja de clculo";
+ Text[ italian ] = "Foglio elettronico";
+ Text[ danish ] = "Regneark";
+ Text[ swedish ] = "Tabelldokument";
+ Text[ polish ] = "Arkusz kalkulacyjny";
+ Text[ portuguese_brazilian ] = "Spreadsheet";
+ Text[ japanese ] = "\\vZ޷";
+ Text[ korean ] = "Spreadsheet";
+ Text[ chinese_simplified ] = "ĵ";
+ Text[ chinese_traditional ] = "u@";
+ Text[ turkish ] = "Hesap tablosu";
+ Text[ arabic ] = " ";
+};
+
+String STR_DOCTYPENAME_SI
+{
+ Text = "Prsentation";
+ Text [ ENGLISH ] = "Presentation" ;
+ Text[ english_us ] = "Presentation";
+ Text[ portuguese ] = "Apresentao";
+ Text[ russian ] = "";
+ Text[ greek ] = "";
+ Text[ dutch ] = "Presentatie";
+ Text[ french ] = "Prsentation";
+ Text[ spanish ] = "Presentacin";
+ Text[ italian ] = "Presentazione";
+ Text[ danish ] = "Prsentation";
+ Text[ swedish ] = "Presentation";
+ Text[ polish ] = "Prezentacja";
+ Text[ portuguese_brazilian ] = "Presentation";
+ Text[ japanese ] = "ھð";
+ Text[ korean ] = "Presentation";
+ Text[ chinese_simplified ] = "ʾĸ";
+ Text[ chinese_traditional ] = "²";
+ Text[ turkish ] = "Sunu";
+ Text[ arabic ] = " ";
+};
+
+String STR_DOCTYPENAME_SD
+{
+ Text = "Zeichnung";
+ Text [ ENGLISH ] = "Drawing" ;
+ Text[ english_us ] = "Drawing";
+ Text[ portuguese ] = "Desenho";
+ Text[ russian ] = "";
+ Text[ greek ] = "";
+ Text[ dutch ] = "Tekening";
+ Text[ french ] = "Dessin";
+ Text[ spanish ] = "Dibujo";
+ Text[ italian ] = "Disegno";
+ Text[ danish ] = "Tegning";
+ Text[ swedish ] = "Teckning";
+ Text[ polish ] = "Rysunek";
+ Text[ portuguese_brazilian ] = "Drawing";
+ Text[ japanese ] = "}``";
+ Text[ korean ] = "Drawing";
+ Text[ chinese_simplified ] = "ͼ";
+ Text[ chinese_traditional ] = "øϤ";
+ Text[ turkish ] = "izim";
+ Text[ arabic ] = "";
+};
+
+String STR_DOCTYPENAME_MESSAGE
+{
+ Text = "Nachricht";
+ Text [ ENGLISH ] = "Mail" ;
+ Text[ english_us ] = "Message";
+ Text[ portuguese ] = "Mensagem";
+ Text[ russian ] = "";
+ Text[ greek ] = "";
+ Text[ dutch ] = "Bericht";
+ Text[ french ] = "Message";
+ Text[ spanish ] = "Mensaje";
+ Text[ italian ] = "Messaggio";
+ Text[ danish ] = "Meddelelse";
+ Text[ swedish ] = "Meddelande";
+ Text[ polish ] = "Wiadomo";
+ Text[ portuguese_brazilian ] = "Mail";
+ Text[ japanese ] = "ү";
+ Text[ korean ] = "Mail";
+ Text[ chinese_simplified ] = "ʼ";
+ Text[ chinese_traditional ] = "qll";
+ Text[ turkish ] = "leti";
+ Text[ arabic ] = "";
+};
+
+String STR_NOSAVEANDCLOSE
+{
+ Text = "~Verwerfen" ;
+ Text [ ENGLISH ] = "~Discard" ;
+ Text [ english_us ] = "~Discard" ;
+ Text[ portuguese ] = "~Rejeitar";
+ Text[ russian ] = "";
+ Text[ dutch ] = "~Verwerpen";
+ Text[ french ] = "~Ignorer";
+ Text[ spanish ] = "~Rechazar";
+ Text[ italian ] = "~Rigetta";
+ Text[ danish ] = "Forkast";
+ Text[ swedish ] = "~Kasta bort";
+ Text[ polish ] = "Odrzu";
+ Text[ portuguese_brazilian ] = "~Discard";
+ Text[ japanese ] = "j(~D)";
+ Text[ chinese_simplified ] = "(~D)";
+ Text[ chinese_traditional ] = "(~D)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Verwerpen";
+ Text[ chinese_simplified ] = "(~D)";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~D)";
+ Text[ turkish ] = "~Sil";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_PACKNGO_NOACCESS
+{
+ Text = "Auf den aktuellen Datentrger konnte nicht zugegriffen werden." ;
+ Text [ ENGLISH ] = "It was not posiible to access the media." ;
+ Text [ english_us ] = "Access to the current data medium not possible." ;
+ Text[ portuguese ] = "Recusado o acesso ao suporte de dados actual.";
+ Text[ russian ] = " .";
+ Text[ greek ] = " .";
+ Text[ dutch ] = "Geen toegang tot het actuele medium";
+ Text[ french ] = "Impossible d'accder au mdia actuel !";
+ Text[ spanish ] = "No se pudo acceder al medio actual.";
+ Text[ italian ] = "Non stato possibile accedere al supporto dati attuale.";
+ Text[ danish ] = "Det var ikke muligt at f adgang til det aktuelle datamedie.";
+ Text[ swedish ] = "Det gick inte att f tillgng till det aktuella datamediet.";
+ Text[ polish ] = "Nie mona byo dosta si do aktualnego nonika danych.";
+ Text[ portuguese_brazilian ] = "It was not posiible to access the media.";
+ Text[ japanese ] = "ײނɱł܂";
+ Text[ korean ] = " ü ׼ Ұմϴ.";
+ Text[ chinese_simplified ] = "޷ȡǰ̡";
+ Text[ chinese_traditional ] = "LkŪeuϤC";
+ Text[ arabic ] = " .";
+ Text[ turkish ] = "Kullanlan veri taycsna eriim salanamad.";
+};
+
+String STR_PACKNGO_NEWMEDIUM
+{
+ Text = "Legen Sie den nchsten Datentrger ein und bettigen Sie den OK-Button." ;
+ Text [ ENGLISH ] = "Insert the next media and press OK.";
+ Text [ english_us ] = "Insert the next data carrier and press OK." ;
+ Text[ portuguese ] = "Coloque o suporte de dados seguinte e prima OK.";
+ Text[ russian ] = " OK.";
+ Text[ greek ] = " OK.";
+ Text[ dutch ] = "Leg het volgende medium in het station en klik op OK.";
+ Text[ french ] = "Insrez le mdia suivant et cliquez sur OK.";
+ Text[ spanish ] = "Inserte el siguiente medio y pulse el botn Aceptar.";
+ Text[ italian ] = "Inserite il supporto dati successivo, quindi confermate con OK.";
+ Text[ danish ] = "Indst det nste datamedie og tryk p OK.";
+ Text[ swedish ] = "Lgg in nsta datamedium och tryck OK.";
+ Text[ polish ] = "Wsu nastpny nonik danych i nacinij przycisk OK.";
+ Text[ portuguese_brazilian ] = "Insert the next media and press OK.";
+ Text[ japanese ] = "̔}̂[OK]دĉB";
+ Text[ korean ] = " ü ϰ Ȯ ư ʽÿ.";
+ Text[ chinese_simplified ] = "һ̲ȷ(OK)ť";
+ Text[ chinese_traditional ] = "бzJU@ӺϤAMZ@UTwC";
+ Text[ arabic ] = " \"\".";
+ Text[ turkish ] = "Bir sonraki veri taycsn takp Tamam dmesine tklaynz.";
+};
+
+// ******************************************************************* EOF
+
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
new file mode 100644
index 000000000000..0bbea96cf24e
--- /dev/null
+++ b/sfx2/source/doc/docfac.cxx
@@ -0,0 +1,701 @@
+/*************************************************************************
+ *
+ * $RCSfile: docfac.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_REGISTRY_MERGECONFLICTEXCEPTION_HPP_
+#include <com/sun/star/registry/MergeConflictException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REGISTRY_XSIMPLEREGISTRY_HPP_
+#include <com/sun/star/registry/XSimpleRegistry.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include <unotools/processfactory.hxx>
+#endif
+
+#ifndef _EMBOBJ_HXX //autogen
+#include <so3/embobj.hxx>
+#endif
+
+#include <vcl/config.hxx>
+#pragma hdrstop
+
+#include "sfx.hrc"
+
+#include "docfilt.hxx"
+#include "docfac.hxx"
+#include "viewfac.hxx"
+#include "fltfnc.hxx"
+#include "appdata.hxx"
+#include "arrdecl.hxx"
+#include "app.hxx"
+#include "module.hxx"
+#include "mnumgr.hxx"
+#include "accmgr.hxx"
+#include <inimgr.hxx>
+#include <sfxresid.hxx>
+#include <sfxuno.hxx>
+#include "doc.hrc"
+
+//========================================================================
+
+DECL_PTRARRAY( SfxViewFactoryArr_Impl, SfxViewFactory*, 2, 2 );
+
+//========================================================================
+
+DBG_NAME(SfxObjectFactory);
+TYPEINIT1(SfxObjectFactory,SvFactory);
+
+static SfxObjectFactoryArr_Impl* pObjFac = 0;
+
+//========================================================================
+
+struct SfxObjectFactory_Impl
+{
+ SfxViewFactoryArr_Impl aViewFactoryArr;// Liste von <SfxViewFactory>s
+ SfxFilterArr_Impl aFilterArr; // Liste von <SFxFilter>n
+ ResId* pMenuBarResId;
+ ResId* pPluginMenuBarResId;
+ ResId* pAccelResId;
+ ResId* pNameResId;
+ String aHelpFile;
+ String aHelpPIFile;
+ ::rtl::OUString aServiceName;
+ sal_Bool bInitFactoryCalled;
+ SfxVoidFunc pInitFactory;
+ SfxFactoryFilterContainer* pFilterContainer;
+ SfxModule* pModule;
+ SfxMenuBarManager* pMenu;
+ SfxAcceleratorManager* pAccMgr;
+ sal_uInt16 nImageId;
+ sal_Bool bOwnsAccel;
+ sal_Bool bOwnsMenu;
+ String aStandardTemplate;
+ sal_Bool bTemplateInitialized;
+ sal_uInt16 nCreateNewSlotId;
+
+ SfxObjectFactory_Impl() :
+ pMenuBarResId ( NULL ),
+ pPluginMenuBarResId ( NULL ),
+ pAccelResId ( NULL ),
+ pNameResId ( NULL ),
+ bInitFactoryCalled ( sal_False ),
+ pInitFactory ( NULL ),
+ pFilterContainer ( NULL ),
+ pModule ( NULL ),
+ pMenu ( NULL ),
+ pAccMgr ( NULL ),
+ nImageId ( 0 ),
+ bTemplateInitialized( sal_False ),
+ nCreateNewSlotId ( 0 ) {}
+
+ ~SfxObjectFactory_Impl()
+ {
+ delete pMenuBarResId;
+ delete pPluginMenuBarResId;
+ delete pAccelResId;
+ // Jetzt vom FilterMatcher
+ // delete pFilterContainer;
+ if ( bOwnsMenu )
+ delete pMenu;
+ if ( bOwnsAccel )
+ delete pAccMgr;
+ }
+};
+
+//========================================================================
+
+SfxFactoryFilterContainer* SfxObjectFactory::GetFilterContainer(
+ sal_Bool bForceLoad ) const
+{
+ if( bForceLoad )
+ ((SfxObjectFactory *)this)->DoInitFactory();
+ return pImpl->pFilterContainer;
+}
+
+void SfxObjectFactory::RegisterInitFactory(SfxVoidFunc pFunc)
+{
+ pImpl->pInitFactory = pFunc;
+// DoInitFactory();
+}
+
+void SfxObjectFactory::RegisterFilter
+(
+ const String& rName, // Klartext-Name f"ur Anzeige im Dialog
+ const String& rWildcard, // Default-Wildcards
+ SfxFilterFlags eType, // SFX_FILTER_...
+ sal_uInt32 lFormat, // Clipboard-Format
+ const String& rMacType, // 4-Byte-Type f"ur Apple Macintosh
+ const String& rTypeName, // String-Type f"ur OS/2
+ sal_uInt16 nIconId, // Resource-Id f"ur Icon
+ const String& rMimeType,
+ const String& rUserData // zum Wiedererkennen oder (frei verwendbar)
+)
+{
+ DBG_CHKTHIS(SfxObjectFactory, 0);
+ sal_uInt16 nDemo = SFX_APP()->GetDemoKind();
+
+ SfxFilter* pFilter = new SfxFilter(
+ rName, rWildcard, eType, lFormat, rMacType,
+ rTypeName, nIconId, rMimeType, pImpl->pFilterContainer, rUserData );
+/* if( nDemo != SFX_DEMOKIND_DEMO && nDemo != SFX_DEMOKIND_INVALID ||
+ pFilter->IsOwnFormat() )*/
+ // Jetzt immer uebernehmen, da es keine Demo mehr gibt. Sonst bei Ablauf
+ // Absturz in sba
+ pImpl->pFilterContainer->AddFilter(
+ pFilter, pImpl->pFilterContainer->GetFilterCount() );
+/* else
+ delete pFilter;*/
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::DoInitFactory()
+{
+ if(!pImpl->bInitFactoryCalled)
+ {
+ pImpl->bInitFactoryCalled = sal_True;
+ // FilterContainer Landen
+ GetFilterCount( );
+ (*pImpl->pInitFactory)();
+ String aShortName( String::CreateFromAscii( pShortName ) );
+ aShortName.ToLowerAscii();
+ if ( aShortName.EqualsAscii( "swriter" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SW );
+ else if ( aShortName.EqualsAscii( "swriter/web" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SWWEB );
+ else if ( aShortName.EqualsAscii( "swriter/globaldocument" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SWGLOB );
+ else if ( aShortName.EqualsAscii( "scalc" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SC );
+ else if ( aShortName.EqualsAscii( "simpress" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SI );
+ else if ( aShortName.EqualsAscii( "sdraw" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_SD );
+ else if ( aShortName.EqualsAscii( "message" ) )
+ pImpl->pNameResId = new SfxResId( STR_DOCTYPENAME_MESSAGE );
+
+ if ( pImpl->aServiceName.len() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XSimpleRegistry > xRegistry = ::com::sun::star::uno::Reference< ::com::sun::star::registry::XSimpleRegistry >
+ ( xMan->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.registry.DefaultRegistry" ) ), ::com::sun::star::uno::UNO_QUERY );
+ if ( xRegistry.is() )
+ {
+ SfxFilterContainer *pCont = GetFilterContainer();
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xRootKey = xRegistry->getRootKey();
+
+ // In der Registry die Section suchen, in der Filter f"ur mein Model registriert sind
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey = xRootKey->openKey( DEFINE_CONST_UNICODE( "/Filter/" ) + pImpl->aServiceName );
+ if ( xKey.is() && xKey->getValueType() == ::com::sun::star::registry::RegistryValueType_ASCIILIST )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aNames = xKey->getAsciiListValue();
+ const ::rtl::OUString* pStr = aNames.getConstArray();
+ for ( sal_uInt32 n=0; n<aNames.getLength(); n++ )
+ {
+ // F"ur jeden Filter die Kriterien einsammeln und einen SfxFilter generieren
+ String aName, aPattern, aExtension, aMimeType;
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xLocalKey = xRootKey->openKey( DEFINE_CONST_UNICODE( "/IMPLEMENTATIONS/" ) + pStr[n] + DEFINE_CONST_UNICODE( "/Filter" ) );
+
+ sal_uInt32 nFilterFlags = 0;
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "Import" ) );
+ if ( xKey.is() )
+ {
+ nFilterFlags |= SFX_FILTER_IMPORT;
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "Template" ) );
+ if ( xKey.is() )
+ nFilterFlags |= SFX_FILTER_TEMPLATE;
+ }
+
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "Export" ) );
+ if ( xKey.is() )
+ nFilterFlags |= SFX_FILTER_EXPORT;
+
+ if ( nFilterFlags )
+ {
+ nFilterFlags |= SFX_FILTER_STARONEFILTER;
+
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "Name" ) );
+ if ( xKey.is() )
+ aName = String( xKey->getAsciiValue() );
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "Pattern" ) );
+ if ( xKey.is() )
+ aPattern = String( xKey->getAsciiValue() );
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "MimeType" ) );
+ if ( xKey.is() )
+ aMimeType = String( xKey->getAsciiValue() );
+ xKey = xLocalKey->openKey( DEFINE_CONST_UNICODE( "Extension" ) );
+ if ( xKey.is() )
+ {
+ aExtension = DEFINE_CONST_UNICODE( "*." );
+ aExtension += String( xKey->getAsciiValue() );
+ }
+
+ SfxFilter *pFilter = new SfxFilter( pStr[n], aExtension, nFilterFlags, 0, String(), String(), 0, aMimeType, pCont, String() );
+ pFilter->SetUIName( aName );
+ pCont->AddFilter( pFilter, pCont->GetFilterCount() );
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+IMPL_LINK_INLINE( SfxObjectFactory, InitFactoryHdl, void*, EMPTYARG,
+{
+ pImpl->pFilterContainer->LoadHdl_Impl( pImpl->pFilterContainer, 0 );
+ SFX_APP()->Get_Impl()->aPendingInitFactories.Remove( this );
+ DoInitFactory();
+ return 0;
+}
+)
+
+sal_uInt16 SfxObjectFactory::GetFilterCount() const
+{
+ ((SfxObjectFactory *)this)->DoInitFactory();
+ return pImpl->pFilterContainer->GetFilterCount();
+}
+
+//--------------------------------------------------------------------
+
+const SfxFilter* SfxObjectFactory::GetFilter(sal_uInt16 i) const
+{
+ ((SfxObjectFactory *)this)->DoInitFactory();
+ return pImpl->pFilterContainer->GetFilter( i );
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectShell *SfxObjectFactory::CreateObject(SfxObjectCreateMode eMode) const
+{
+ DBG_CHKTHIS(SfxObjectFactory, 0);
+ return (*fnCreate)(eMode);
+}
+
+// -----------------------------------------------------------------------
+
+void SfxObjectFactory::Construct
+(
+ sal_uInt16 nFactoryId,
+ SfxObjectCtor fnCreateFnc,
+ SfxObjectShellFlags nFlagsP,
+ const char* pName
+)
+{
+ DBG_CHKTHIS(SfxObjectFactory, 0);
+
+ nFlags = nFlagsP;
+ fnCreate = fnCreateFnc;
+ nId = nFactoryId;
+// pIniMgr = 0;
+ pShortName = pName;
+ pImpl->pFilterContainer = new SfxFactoryFilterContainer(
+ String::CreateFromAscii( pName ), *this );
+ SFX_APP()->GetFilterMatcher().AddContainer( pImpl->pFilterContainer );
+ if( !(nFlagsP & SFXOBJECTSHELL_DONTLOADFILTERS) )
+ pImpl->pFilterContainer->LoadFilters( String::CreateFromAscii( pName ) );
+
+ pImpl->aHelpFile = String::CreateFromAscii(pShortName);
+ pImpl->aHelpFile.Erase( 8 );
+ pImpl->aHelpPIFile = String(pImpl->aHelpFile,0,3);
+ pImpl->aHelpPIFile += DEFINE_CONST_UNICODE( "hlppi" );
+ pImpl->aHelpFile += DEFINE_CONST_UNICODE( ".hlp" );
+ pImpl->aHelpPIFile += DEFINE_CONST_UNICODE( ".hlp" );
+ pImpl->bOwnsMenu = pImpl->bOwnsAccel = sal_False;
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectFactory::SfxObjectFactory
+(
+ const SvGlobalName& rName,
+ const String& rClassName,
+ CreateInstanceType funcCIT
+)
+: SvFactory( rName, rClassName, funcCIT ),
+ fnCreate( 0 ),
+ nId( 0 ),
+// pIniMgr( 0 ),
+ pShortName( 0 ),
+ pImpl( new SfxObjectFactory_Impl )
+{
+ DBG_CTOR(SfxObjectFactory, 0);
+
+ SfxApplication* pApp = SFX_APP();
+ RegisterObjectFactory_Impl(*this);
+ pApp->InsertLateInitHdl( LINK( this, SfxObjectFactory, InitFactoryHdl ) );
+ pApp->Get_Impl()->aPendingInitFactories.Insert( this );
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectFactory::~SfxObjectFactory()
+{
+ DBG_DTOR(SfxObjectFactory, 0);
+
+ const sal_uInt16 nCount = pImpl->aFilterArr.Count();
+ for ( sal_uInt16 i = 0; i < nCount; ++i )
+ delete pImpl->aFilterArr[i];
+ delete pImpl->pNameResId;
+ delete pImpl;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::RegisterViewFactory
+(
+ SfxViewFactory &rFactory
+)
+{
+ sal_uInt16 nPos;
+ for ( nPos = 0;
+ nPos < pImpl->aViewFactoryArr.Count() &&
+ pImpl->aViewFactoryArr[nPos]->GetOrdinal() <= rFactory.GetOrdinal();
+ ++nPos )
+ /* empty loop */;
+ pImpl->aViewFactoryArr.Insert(nPos, &rFactory);
+}
+
+//--------------------------------------------------------------------
+
+sal_uInt16 SfxObjectFactory::GetViewFactoryCount() const
+{
+ return pImpl->aViewFactoryArr.Count();
+}
+
+//--------------------------------------------------------------------
+
+SfxViewFactory& SfxObjectFactory::GetViewFactory(sal_uInt16 i) const
+{
+ return *pImpl->aViewFactoryArr[i];
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::RegisterMenuBar( const ResId& rId )
+{
+ delete pImpl->pMenuBarResId;
+ pImpl->pMenuBarResId = new ResId( rId );
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::RegisterPluginMenuBar( const ResId& rId )
+{
+ delete pImpl->pPluginMenuBarResId;
+ pImpl->pPluginMenuBarResId = new ResId( rId );
+}
+
+//--------------------------------------------------------------------
+
+const ResId* SfxObjectFactory::GetMenuBarId() const
+{
+ return pImpl->pMenuBarResId;
+}
+
+//--------------------------------------------------------------------
+
+const ResId* SfxObjectFactory::GetPluginMenuBarId() const
+{
+ return pImpl->pPluginMenuBarResId;
+}
+
+//--------------------------------------------------------------------
+
+const ResId* SfxObjectFactory::GetAccelId() const
+{
+ return pImpl->pAccelResId;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::RegisterAccel( const ResId& rId )
+{
+ DBG_ASSERT( !pImpl->pAccelResId, "SfxObjectFactory: double registration of Accel" );
+ pImpl->pAccelResId = new ResId(rId);
+}
+
+//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::RegisterHelpFile( const String& rString )
+{
+ pImpl->aHelpFile = rString;
+}
+
+//--------------------------------------------------------------------
+
+const String& SfxObjectFactory::GetHelpFile() const
+{
+ return pImpl->aHelpFile;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectFactory::RegisterHelpPIFile( const String& rString )
+{
+ pImpl->aHelpPIFile = rString;
+}
+
+//--------------------------------------------------------------------
+
+const String& SfxObjectFactory::GetHelpPIFile() const
+{
+ return pImpl->aHelpPIFile;
+}
+
+SfxModule* SfxObjectFactory::GetModule() const
+{
+ return pImpl->pModule;
+}
+
+SfxAcceleratorManager* SfxObjectFactory::GetAccMgr_Impl()
+{
+ if ( !pImpl->pAccMgr && pImpl->pAccelResId )
+ {
+ // Checken, ob der Accel schon von einer anderen Factory angeboten wird
+ SfxApplication *pApp = SFX_APP();
+ SfxObjectFactoryArr_Impl& rArr = GetObjFacArray_Impl();
+ sal_uInt32 nCount = rArr.Count();
+ const ResId& rMyId = *GetAccelId();
+ for ( sal_uInt32 n=0; n<nCount; n++ )
+ {
+ SfxObjectFactory *pFact = rArr[(sal_uInt16)n];
+ if ( pFact == this )
+ break;
+ const ResId *pId = pFact->pImpl->pAccelResId;
+ if ( pId &&
+ pId->GetId() == rMyId.GetId() &&
+ pId->GetResMgr() == rMyId.GetResMgr() )
+ {
+ pImpl->pAccMgr = pFact->GetAccMgr_Impl();
+ return pImpl->pAccMgr;
+ }
+ }
+
+ pImpl->pAccMgr =
+ new SfxAcceleratorManager( rMyId );
+ pImpl->pAccMgr->Initialize();
+ pImpl->bOwnsAccel = sal_True;
+ }
+
+ return pImpl->pAccMgr;
+}
+
+void SfxObjectFactory::SetModule_Impl( SfxModule *pMod )
+{
+ pImpl->pModule = pMod;
+}
+
+void SfxObjectFactory::SetExplorerImageId( sal_uInt16 nImageId )
+{
+ pImpl->nImageId = nImageId;
+}
+
+sal_uInt16 SfxObjectFactory::GetExplorerImageId() const
+{
+ return pImpl->nImageId;
+}
+
+void SfxObjectFactory::SetStandardTemplate( const String& rFactoryURL, const String& rTemplate )
+{
+ const SfxObjectFactory* pFactory = SfxObjectFactory::GetFactory( rFactoryURL );
+ if ( pFactory )
+ {
+ ((SfxObjectFactory*)pFactory)->pImpl->aStandardTemplate = rTemplate;
+ SfxIniManager* pIni = SFX_INIMANAGER();
+ if ( !rTemplate.Len() )
+ pIni->DeleteKey( DEFINE_CONST_UNICODE( "StandardTemplates"),
+ String::CreateFromAscii( pFactory->pShortName ) );
+ else
+ pIni->WriteKey( DEFINE_CONST_UNICODE( "StandardTemplates"),
+ String::CreateFromAscii( pFactory->pShortName ), rTemplate );
+ }
+}
+
+const String& SfxObjectFactory::GetStandardTemplate() const
+{
+ if (!pImpl->bTemplateInitialized )
+ {
+ pImpl->bTemplateInitialized = sal_True;
+ SfxIniManager *pIni = SFX_INIMANAGER();
+ pImpl->aStandardTemplate = pIni->SubstPathVars( pIni->ReadKey( DEFINE_CONST_UNICODE( "StandardTemplates"),
+ String::CreateFromAscii( pShortName ) ) );
+ }
+
+ return pImpl->aStandardTemplate;
+}
+
+const SfxObjectFactory* SfxObjectFactory::GetFactory( const String& rFactoryURL )
+{
+ const SfxObjectFactory* pFactory = 0;
+ String aFact( rFactoryURL );
+ String aPrefix( DEFINE_CONST_UNICODE( "private:factory/" ) );
+ if ( aPrefix.Len() == aFact.Match( aPrefix ) )
+ // Aufruf m"oglich mit z.B. "swriter" oder "private:factory/swriter"
+ aFact.Erase( 0, aPrefix.Len() );
+ sal_uInt16 nPos = aFact.Search( '?' );
+
+ // Etwaige Parameter abschneiden
+ aFact.Erase( nPos, aFact.Len() );
+
+ SfxApplication *pApp = SFX_APP();
+
+ // "swriter4" durch "swriter" ersetzen, zum Vergleichen uppercase verwenden
+ WildCard aSearchedFac( aFact.EraseAllChars('4').ToUpperAscii() );
+ for( sal_uInt16 n = GetObjectFactoryCount_Impl(); !pFactory && n--; )
+ {
+ pFactory = &GetObjectFactory_Impl( n );
+ String aCompareTo = String::CreateFromAscii( pFactory->GetShortName() );
+ aCompareTo.ToUpperAscii();
+ if( !aSearchedFac.Matches( aCompareTo ) )
+ pFactory = 0;
+ }
+
+ return pFactory;
+}
+
+const SfxFilter* SfxObjectFactory::GetTemplateFilter() const
+{
+ sal_uInt16 nCount = GetFilterCount();
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ const SfxFilter *pFilter = pImpl->pFilterContainer->GetFilter(n);
+ if ( pFilter->GetFilterFlags() & SFX_FILTER_TEMPLATE)
+ return pFilter;
+ }
+
+ return 0;
+}
+
+void SfxObjectFactory::SetCreateNewSlotId( sal_uInt16 nId )
+{
+ pImpl->nCreateNewSlotId = nId;
+}
+
+sal_uInt16 SfxObjectFactory::GetCreateNewSlotId() const
+{
+ return pImpl->nCreateNewSlotId;
+}
+
+void SfxObjectFactory::SetDocumentTypeNameResource( const ResId& rId )
+{
+ DBG_ASSERT( !pImpl->pNameResId, "UI-Namensresource mehrfach gesetzt!" );
+ pImpl->pNameResId = new ResId( rId );
+}
+
+String SfxObjectFactory::GetDocumentTypeName() const
+{
+ ((SfxObjectFactory*)this)->DoInitFactory();
+ if ( pImpl->pNameResId )
+ return String( *pImpl->pNameResId );
+ return String();
+}
+
+void SfxObjectFactory::SetDocumentServiceName( const ::rtl::OUString& rServiceName )
+{
+ pImpl->aServiceName = rServiceName;
+}
+
+const ::rtl::OUString& SfxObjectFactory::GetDocumentServiceName() const
+{
+ return pImpl->aServiceName;
+}
+
+void SfxObjectFactory::RegisterObjectFactory_Impl( SfxObjectFactory &rFac )
+{
+ SfxObjectFactory *pFac = &rFac;
+ GetObjFacArray_Impl().C40_INSERT( SfxObjectFactory, pFac, GetObjFacArray_Impl().Count() );
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxObjectFactory::GetObjectFactoryCount_Impl()
+{
+ return GetObjFacArray_Impl().Count();
+}
+
+//--------------------------------------------------------------------
+
+const SfxObjectFactory &SfxObjectFactory::GetObjectFactory_Impl(USHORT i)
+{
+ return *GetObjFacArray_Impl()[i];
+}
+
+const SfxObjectFactory& SfxObjectFactory::GetDefaultFactory()
+{
+ const SfxObjectFactory &rFactory = GetObjectFactory_Impl(0);
+ return rFactory;
+}
+
+sal_Bool SfxObjectFactory::HasObjectFactories()
+{
+ return ( GetObjFacArray_Impl().Count() != 0 );
+}
+
+SfxObjectFactoryArr_Impl& SfxObjectFactory::GetObjFacArray_Impl()
+{
+ if ( !pObjFac )
+ pObjFac = new SfxObjectFactoryArr_Impl;
+ return *pObjFac;
+}
+
+
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
new file mode 100644
index 000000000000..39b4adaaa09c
--- /dev/null
+++ b/sfx2/source/doc/docfile.cxx
@@ -0,0 +1,3091 @@
+/*************************************************************************
+ *
+ * $RCSfile: docfile.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdio.h>
+
+#include <uno/mapping.hxx>
+#include <com/sun/star/task/XInteractionHandler.hpp>
+
+#ifndef _EXTATTR_HXX
+#include <svtools/extattr.hxx>
+#endif
+#define _SVSTDARR_ULONGS
+#include <svtools/svstdarr.hxx>
+
+#ifndef _EXCHANGE_HXX //autogen
+#include <vcl/exchange.hxx>
+#endif
+#ifndef _CACHESTR_HXX //autogen
+#include <tools/cachestr.hxx>
+#endif
+#ifndef _UNDO_HXX //autogen
+#include <svtools/undo.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _URLOBJ_HXX //autogen
+#include <tools/urlobj.hxx>
+#endif
+
+#ifndef _INET_CONFIG_HXX
+#include <inet/inetcfg.hxx>
+#endif
+
+#ifndef _UNOTOOLS_STREAMHELPER_HXX_
+#include <unotools/streamhelper.hxx>
+#endif
+
+#include <svtools/intitem.hxx>
+
+#include <tools/zcodec.hxx>
+#ifndef _TOOLS_TEMPFILE_HXX
+#include <tools/tempfile.hxx>
+#endif
+
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx>
+
+#ifndef _COM_SUN_STAR_UTIL_DISKFULLEXCEPTION_HPP_
+#include <com/sun/star/util/DiskFullException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_FILEIOEXCEPTION_HPP_
+#include <com/sun/star/util/FileIOException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XARCHIVER_HPP_
+#include <com/sun/star/util/XArchiver.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XCONNECTABLE_HPP_
+#include <com/sun/star/io/XConnectable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATAOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XDataOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HPP_
+#include <com/sun/star/io/XActiveDataControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATAINPUTSTREAM_HPP_
+#include <com/sun/star/io/XDataInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XMARKABLESTREAM_HPP_
+#include <com/sun/star/io/XMarkableStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XSTREAMLISTENER_HPP_
+#include <com/sun/star/io/XStreamListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASINK_HPP_
+#include <com/sun/star/io/XActiveDataSink.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UCB_INSERTCOMMANDARGUMENT_HPP_
+#include <com/sun/star/ucb/InsertCommandArgument.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_NAMECLASH_HPP_
+#include <com/sun/star/ucb/NameClash.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_TRANSFERINFO_HPP_
+#include <com/sun/star/ucb/TransferInfo.hpp>
+#endif
+
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include <unotools/processfactory.hxx>
+#endif
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/ucb/XContent.hpp>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+
+#include <svtools/lckbitem.hxx>
+
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "appdata.hxx"
+#include "app.hxx"
+#include "sfxtypes.hxx"
+#include "openflag.hxx"
+#include "docfile.hxx"
+#include "docfilt.hxx"
+#include "docfac.hxx"
+#include "fltfnc.hxx"
+#include "sfxresid.hxx"
+#include "doc.hrc"
+#include "progress.hxx"
+#include "doctempl.hxx"
+#include "request.hxx"
+#include "dataurl.hxx"
+#include "ucbhelp.hxx"
+#include "inimgr.hxx"
+#include "helper.hxx"
+
+#define MAX_REDIRECT 5
+
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XSEEKABLE_HPP_
+#include <com/sun/star/io/XSeekable.hpp>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+
+#define staruno ::com::sun::star::uno
+#define stario ::com::sun::star::io
+
+typedef ::cppu::WeakImplHelper2<com::sun::star::io::XInputStream, com::sun::star::io::XSeekable> InputStreamHelper_Base;
+class OInputStreamHelper : public InputStreamHelper_Base
+{
+ ::osl::Mutex m_aMutex;
+ SvLockBytesRef m_xLockBytes;
+ sal_uInt32 m_nActPos;
+ sal_Int32 m_nAvailable; // this is typically the chunk(buffer) size
+
+public:
+ OInputStreamHelper(const SvLockBytesRef& _xLockBytes,
+ sal_uInt32 _nAvailable,
+ sal_uInt32 _nPos = 0)
+ :m_xLockBytes(_xLockBytes)
+ ,m_nActPos(_nPos)
+ ,m_nAvailable(_nAvailable){}
+
+// stario::XInputStream
+ virtual sal_Int32 SAL_CALL readBytes( staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available( ) throw(stario::NotConnectedException, stario::IOException, staruno::RuntimeException);
+ virtual void SAL_CALL closeInput( ) throw (stario::NotConnectedException, stario::IOException, staruno::RuntimeException);
+
+// stario::XSeekable
+ virtual void SAL_CALL seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int64 SAL_CALL getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+};
+
+//------------------------------------------------------------------------------
+sal_Int32 SAL_CALL OInputStreamHelper::readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead)
+ throw(stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException)
+{
+ if (!m_xLockBytes.Is())
+ throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ if (nBytesToRead < 0)
+ throw stario::BufferSizeExceededException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ aData.realloc(nBytesToRead);
+
+ sal_uInt32 nRead;
+ ErrCode nError = m_xLockBytes->ReadAt(m_nActPos, (void*)aData.getArray(), nBytesToRead, &nRead);
+ m_nActPos += nRead;
+
+ if (nError != ERRCODE_NONE)
+ throw stario::IOException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ // adjust sequence if data read is lower than the desired data
+ if (nRead < (sal_uInt32)nBytesToRead)
+ aData.realloc( nRead );
+
+ return nRead;
+}
+
+void SAL_CALL OInputStreamHelper::seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_nActPos = location;
+}
+
+sal_Int64 SAL_CALL OInputStreamHelper::getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
+{
+ return m_nActPos;
+}
+
+sal_Int64 SAL_CALL OInputStreamHelper::getLength( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
+{
+ if (!m_xLockBytes.Is())
+ return 0;
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ SvLockBytesStat aStat;
+ m_xLockBytes->Stat( &aStat, SVSTATFLAG_DEFAULT );
+ m_nActPos = aStat.nSize;
+ return m_nActPos;
+}
+
+//------------------------------------------------------------------------------
+sal_Int32 SAL_CALL OInputStreamHelper::readSomeBytes(staruno::Sequence< sal_Int8 >& aData,
+ sal_Int32 nMaxBytesToRead)
+ throw (stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException)
+{
+ // read all data desired
+ return readBytes(aData, nMaxBytesToRead);
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 nBytesToSkip)
+ throw (stario::NotConnectedException, stario::BufferSizeExceededException, stario::IOException, staruno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if (!m_xLockBytes.Is())
+ throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ if (nBytesToSkip < 0)
+ throw stario::BufferSizeExceededException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ m_nActPos += nBytesToSkip;
+}
+
+//------------------------------------------------------------------------------
+sal_Int32 SAL_CALL OInputStreamHelper::available()
+ throw (stario::NotConnectedException, stario::IOException, staruno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if (!m_xLockBytes.Is())
+ throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ return m_nAvailable;
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInputStreamHelper::closeInput()
+ throw (stario::NotConnectedException, stario::IOException, staruno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if (!m_xLockBytes.Is())
+ throw stario::NotConnectedException(::rtl::OUString(), static_cast<staruno::XWeak*>(this));
+
+ m_xLockBytes = NULL;
+}
+
+
+
+
+class FileSource_Impl : public ::com::sun::star::lang::XTypeProvider ,
+ public ::com::sun::star::io::XActiveDataSource ,
+ public ::com::sun::star::io::XActiveDataControl ,
+ public ::com::sun::star::lang::XInitialization ,
+ public ::cppu::OWeakObject
+{
+private:
+ SvStream* pStream;
+ SfxMedium* pMedium;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > m_xListener;
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > m_xSink;
+
+public:
+
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ FileSource_Impl();
+ FileSource_Impl( SfxMedium* );
+ virtual ~FileSource_Impl();
+
+ void ResetMedium()
+ { pMedium = NULL; pStream = NULL;}
+ DECL_LINK( DataAvailableHdl, void* );
+
+ // ::com::sun::star::io::XActiveDataControl
+ virtual void SAL_CALL addListener(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > & aListener) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL start(void) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL terminate(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::io::XActiveDataSource
+ virtual void SAL_CALL setOutputStream(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > & aStream) throw( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL getOutputStream(void) throw( ::com::sun::star::uno::RuntimeException );
+
+ // ::com::sun::star::lang::XInitialization
+ virtual void SAL_CALL initialize(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+
+};
+
+class FileSink_Impl : public ::com::sun::star::lang::XTypeProvider ,
+ public ::com::sun::star::io::XOutputStream ,
+ public ::cppu::OWeakObject
+{
+private:
+ SvStream* pStream;
+ SfxMedium* pMedium;
+
+public:
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ FileSink_Impl( SfxMedium* );
+ virtual ~FileSink_Impl();
+
+ void ResetMedium()
+ { pMedium = NULL; pStream = NULL;}
+
+ // ::com::sun::star::io::XOutputStream
+ virtual void SAL_CALL writeBytes(const ::com::sun::star::uno::Sequence< sal_Int8 >& aData) throw( ::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL flush(void) throw( ::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL closeOutput(void) throw( ::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::uno::RuntimeException );
+};
+
+SFX_IMPL_XINTERFACE_1( FileSink_Impl, OWeakObject, ::com::sun::star::io::XOutputStream )
+SFX_IMPL_XTYPEPROVIDER_1( FileSink_Impl, ::com::sun::star::io::XOutputStream )
+
+FileSink_Impl::FileSink_Impl( SfxMedium* pMed )
+ : pMedium( pMed )
+ , pStream( NULL )
+{
+}
+
+FileSink_Impl::~FileSink_Impl()
+{
+ if ( pMedium )
+ {
+ pMedium->ResetDataSink();
+ pMedium->ReleaseRef();
+ }
+}
+
+void SAL_CALL FileSink_Impl::writeBytes(const ::com::sun::star::uno::Sequence< sal_Int8 >& Buffer) throw( ::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::uno::RuntimeException )
+{
+ if ( !pStream && pMedium )
+ pStream = pMedium->GetOutStream();
+
+ if ( pStream )
+ pStream->Write( Buffer.getConstArray(), (sal_uInt32) Buffer.getLength() );
+}
+
+void SAL_CALL FileSink_Impl::flush(void) throw( ::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::uno::RuntimeException )
+{
+ if ( pMedium )
+ pMedium->GetOutStream()->Flush();
+}
+
+void SAL_CALL FileSink_Impl::closeOutput(void) throw( ::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::uno::RuntimeException )
+{
+ if ( pMedium )
+ pMedium->Close();
+}
+
+SFX_IMPL_XINTERFACE_3( FileSource_Impl, OWeakObject, ::com::sun::star::io::XActiveDataSource, ::com::sun::star::io::XActiveDataControl, ::com::sun::star::lang::XInitialization )
+SFX_IMPL_XTYPEPROVIDER_3( FileSource_Impl, ::com::sun::star::io::XActiveDataSource, ::com::sun::star::io::XActiveDataControl, ::com::sun::star::lang::XInitialization )
+
+FileSource_Impl::FileSource_Impl()
+ : pMedium( NULL )
+ , pStream( NULL )
+{
+}
+
+void SAL_CALL FileSource_Impl::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+ const ::com::sun::star::uno::Any *pArr = Arguments.getConstArray();
+ ::rtl::OUString aName ;
+ pArr[0] >>= aName ;
+ if ( aName.len() )
+ {
+ pMedium = new SfxMedium( aName, STREAM_STD_READ, sal_True );
+ pMedium->SetTransferPriority( SFX_TFPRIO_SYNCHRON );
+ pMedium->SetDataAvailableLink( LINK( this, FileSource_Impl, DataAvailableHdl ) );
+ pMedium->SetDoneLink( LINK( this, FileSource_Impl, DataAvailableHdl ) );
+ pMedium->AddRef();
+ }
+}
+
+FileSource_Impl::FileSource_Impl( SfxMedium* pMed )
+ : pMedium( pMed )
+ , pStream( NULL )
+{
+}
+
+FileSource_Impl::~FileSource_Impl()
+{
+ if ( pMedium )
+ {
+ pMedium->ResetDataSource();
+ pMedium->ReleaseRef();
+ }
+}
+
+void SAL_CALL FileSource_Impl::addListener(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{
+ if( m_xListener.is() )
+ fprintf( stderr, "Warning: addSourceControllerListener called when already having a listener\n" );
+ m_xListener = aListener;
+}
+
+void SAL_CALL FileSource_Impl::removeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{
+ m_xListener = ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > ();
+}
+
+void SAL_CALL FileSource_Impl::setOutputStream( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > & Listener )throw( ::com::sun::star::uno::RuntimeException )
+{
+ m_xSink = Listener;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SAL_CALL FileSource_Impl::getOutputStream(void) throw( ::com::sun::star::uno::RuntimeException )
+{
+ return m_xSink;
+}
+
+IMPL_LINK( FileSource_Impl, DataAvailableHdl, void*, pVoid )
+{
+ if ( !pStream )
+ pStream = pMedium->GetInStream();
+
+ if ( pStream && m_xSink.is() )
+ {
+ sal_Int8 buf[ 65536 ];
+ sal_uInt32 nBytes = 1;
+ while( nBytes && pStream->GetError() != ERRCODE_IO_PENDING )
+ {
+ nBytes = pStream->Read( buf, (sal_uInt32) sizeof( buf ) );
+ if ( nBytes )
+ m_xSink->writeBytes( ::com::sun::star::uno::Sequence<sal_Int8>( buf, nBytes ) );
+ }
+
+ if ( pStream->GetError() == ERRCODE_IO_PENDING )
+ pStream->ResetError();
+ else
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > xRef( this );
+ m_xSink->closeOutput();
+ m_xSink = ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > ();
+ if( m_xListener.is() )
+ m_xListener->closed();
+ m_xListener = ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > ();
+ pMedium->GetItemSet()->ClearItem( SID_LOADENVIRONMENT );
+ }
+ }
+
+ return 0;
+}
+
+void SAL_CALL FileSource_Impl::start() throw( ::com::sun::star::uno::RuntimeException )
+{
+ pStream = pMedium->GetInStream();
+ if ( pStream && m_xSink.is() )
+ DataAvailableHdl( 0 );
+}
+
+void SAL_CALL FileSource_Impl::terminate() throw( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > xRef( this );
+ if ( m_xSink.is() )
+ m_xSink->closeOutput();
+
+ m_xSink = ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > ();
+ if( m_xListener.is() )
+ m_xListener->closed();
+ m_xListener = ::com::sun::star::uno::Reference< ::com::sun::star::io::XStreamListener > ();
+ pMedium->CancelTransfers();
+ pMedium->GetItemSet()->ClearItem( SID_LOADENVIRONMENT );
+ pMedium->Close();
+}
+
+String ConvertDateTime_Impl(const SfxStamp &rTime);
+
+//----------------------------------------------------------------
+SfxPoolCancelManager::SfxPoolCancelManager(
+ SfxCancelManager* pParent, const String& rName )
+ : SfxCancelManager( pParent ),
+ SfxCancellable( pParent ? pParent : this, rName ),
+ wParent( pParent )
+{
+ if( pParent )
+ {
+ StartListening( *this );
+ SetManager( 0 );
+ }
+}
+
+//----------------------------------------------------------------
+SfxPoolCancelManager::~SfxPoolCancelManager()
+{
+ for( sal_uInt16 nPos = GetCancellableCount(); nPos--; )
+ {
+ // nicht an Parent uebernehmen!
+ SfxCancellable* pCbl = GetCancellable( nPos );
+ if ( pCbl )
+ pCbl->SetManager( 0 );
+ }
+}
+
+
+//----------------------------------------------------------------
+void SfxPoolCancelManager::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ if( !GetCancellableCount() ) SetManager( 0 );
+ else if( !GetManager() )
+ {
+ if( !wParent.Is() ) wParent = SFX_APP()->GetCancelManager();
+ SetManager( wParent );
+ }
+}
+
+//----------------------------------------------------------------
+void SfxPoolCancelManager::Cancel()
+{
+ SfxPoolCancelManagerRef xThis = this;
+ for( sal_uInt16 nPos = GetCancellableCount(); nPos--; )
+ {
+ SfxCancellable* pCbl = GetCancellable( nPos );
+ // Wenn wir nicht im Button stehen
+ if( pCbl && pCbl != this )
+ pCbl->Cancel();
+ if( GetCancellableCount() < nPos )
+ nPos = GetCancellableCount();
+ }
+}
+
+//----------------------------------------------------------------
+class SfxMedium_Impl : public SvCompatWeakBase
+{
+public:
+ Reference < XContent > xContent;
+ sal_Bool bUpdatePickList : 1;
+ sal_Bool bIsTemp : 1;
+ sal_Bool bUsesCache : 1;
+ sal_Bool bForceSynchron : 1;
+ sal_Bool bDontCreateCancellable : 1;
+ sal_Bool bDownloadDone : 1;
+
+ sal_uInt16 nPrio;
+
+ SfxPoolCancelManagerRef xCancelManager;
+ SfxMedium* pAntiImpl;
+ SvEaMgr* pEaMgr;
+
+ long nFileVersion;
+
+ const SfxFilter* pOrigFilter;
+ String aOrigURL;
+ String aPreRedirectionURL;
+ String aReferer;
+ DateTime aExpireTime;
+ SfxFrameWeak wLoadTargetFrame;
+ LoadEnvironment_Impl* pLoadEnv;
+ SvKeyValueIteratorRef xAttributes;
+
+ AsynchronLink aDoneLink;
+ AsynchronLink aAvailableLink;
+ UCB_Link_HelperRef aLinkList;
+
+ DECL_LINK( Done_Impl, void* );
+ DECL_LINK( DataAvailable_Impl, void* );
+ DECL_LINK( Cancel_Impl, void* );
+
+ SfxVersionTableDtor* pVersions;
+ FileSource_Impl* pSource;
+ FileSink_Impl* pSink;
+ TempFile* pTempDir;
+ TempFile* pTempFile;
+
+ SfxPoolCancelManager* GetCancelManager();
+
+ SfxMedium_Impl( SfxMedium* pAntiImplP );
+ ~SfxMedium_Impl();
+};
+
+IMPL_LINK( SfxMedium_Impl, Done_Impl, void*, pVoid )
+{
+ bDownloadDone = sal_True;
+
+ if ( pAntiImpl->GetErrorCode() == ERRCODE_NONE )
+ pAntiImpl->GetInStream();
+
+ // Don't call because it will crash !!
+// if ( aAvailableLink.IsSet() )
+// aAvailableLink.Call( pVoid );
+
+ aDoneLink.ClearPendingCall();
+ aDoneLink.Call( pVoid );
+
+ return 0;
+}
+
+IMPL_LINK( SfxMedium_Impl, DataAvailable_Impl, void*, pVoid )
+{
+ // ???? why?
+ pAntiImpl->GetInStream();
+
+ aAvailableLink.ClearPendingCall();
+ aAvailableLink.Call( pVoid );
+
+ return 0;
+}
+
+IMPL_LINK( SfxMedium_Impl, Cancel_Impl, void*, pVoid )
+{
+ pAntiImpl->SetError( ERRCODE_IO_GENERAL );
+ return 0;
+}
+
+SfxPoolCancelManager* SfxMedium_Impl::GetCancelManager()
+{
+ if( !xCancelManager.Is() )
+ {
+ if( !bDontCreateCancellable )
+ xCancelManager = new SfxPoolCancelManager(
+ wLoadTargetFrame ? wLoadTargetFrame->GetCancelManager() :
+ SFX_APP()->GetCancelManager(),
+ pAntiImpl->GetURLObject().GetURLNoPass() );
+ else
+ xCancelManager = new SfxPoolCancelManager(
+ 0, pAntiImpl->GetURLObject().GetURLNoPass() );
+ }
+ return xCancelManager;
+}
+
+//------------------------------------------------------------------
+SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP )
+ :
+ SvCompatWeakBase( pAntiImplP ),
+ bUpdatePickList(sal_True), bIsTemp( sal_False ), pOrigFilter( 0 ),
+ bUsesCache(sal_True),
+ nPrio( 99 ), aExpireTime( Date() + 10, Time() ),
+ bForceSynchron( sal_False ),
+ pLoadEnv( 0 ), pAntiImpl( pAntiImplP ),
+ bDontCreateCancellable( sal_False ), pSource( NULL ), pSink( NULL ), pTempDir( NULL ),
+ bDownloadDone( sal_True ), nFileVersion( 0 ), pEaMgr( NULL ), pTempFile( NULL )
+{
+}
+
+//------------------------------------------------------------------
+SfxMedium_Impl::~SfxMedium_Impl()
+{
+ if ( aLinkList.Is() )
+ aLinkList->Clear();
+
+ aDoneLink.ClearPendingCall();
+ aAvailableLink.ClearPendingCall();
+
+ delete pEaMgr;
+ delete pVersions;
+
+ if ( pSource )
+ {
+ pSource->ResetMedium();
+ pSource->release();
+ }
+
+ if ( pSink )
+ {
+ pSink->ResetMedium();
+ pSink->release();
+ }
+
+ if ( pTempFile )
+ delete pTempFile;
+
+ if ( pTempDir )
+ delete pTempDir;
+}
+
+//================================================================
+
+#define IMPL_CTOR() \
+ eError( SVSTREAM_OK ), \
+ \
+ bDirect( sal_False ), \
+ bTriedStorage( sal_False ), \
+ bSetFilter( sal_False ), \
+ \
+ nStorOpenMode( SFX_STREAM_READWRITE ), \
+ pInStream(0), \
+ pOutStream( 0 )
+
+//------------------------------------------------------------------
+const SvGlobalName& SfxMedium::GetClassFilter()
+{
+ GetMedium_Impl();
+ if( GetError() )
+ return aFilterClass;
+ if( !bSetFilter && GetStorage() )
+ SetClassFilter( GetStorage()->GetClassName() );
+ return aFilterClass;
+}
+
+//------------------------------------------------------------------
+void SfxMedium::ResetError()
+{
+ eError = SVSTREAM_OK;
+ if( aStorage.Is() )
+ aStorage->ResetError();
+ if( pInStream )
+ pInStream->ResetError();
+ if( pOutStream )
+ pOutStream->ResetError();
+}
+
+//------------------------------------------------------------------
+sal_uInt32 SfxMedium::GetErrorCode() const
+{
+ sal_uInt32 lError=eError;
+ if(!lError && pInStream)
+ lError=pInStream->GetErrorCode();
+ if(!lError && pOutStream)
+ lError=pOutStream->GetErrorCode();
+ if(!lError && aStorage.Is())
+ lError=aStorage->GetErrorCode();
+ return lError;
+}
+
+//------------------------------------------------------------------
+long SfxMedium::GetFileVersion() const
+{
+ if ( !pImp->nFileVersion && pFilter )
+ return pFilter->GetVersion();
+ else
+ return pImp->nFileVersion;
+}
+
+//------------------------------------------------------------------
+Reference < XContent > SfxMedium::GetContent() const
+{
+ if ( !pImp->xContent.is() && GetName().Len() )
+ {
+ String aURL = GetURLObject().GetMainURL();
+ pImp->xContent = UCB_Helper::CreateContent( aURL );
+ }
+
+ if ( pImp->xContent.is() )
+ return pImp->xContent;
+ else
+ return NULL;
+}
+
+//------------------------------------------------------------------
+SvStream* SfxMedium::GetInStream()
+{
+ if ( pInStream )
+ return pInStream;
+
+ if ( pImp->pTempFile )
+ {
+ pInStream = new SvFileStream( aName, nStorOpenMode );
+
+ eError = pInStream->GetError();
+
+ if( !eError && (nStorOpenMode & STREAM_WRITE)
+ && ! pInStream->IsWritable() )
+ {
+ eError = ERRCODE_IO_ACCESSDENIED;
+ delete pInStream;
+ pInStream = NULL;
+ }
+ else
+ return pInStream;
+ }
+
+ GetMedium_Impl();
+
+ if ( !pInStream && eError == ERRCODE_IO_PENDING )
+ eError = SVSTREAM_OK;
+
+ return pInStream;
+}
+
+//------------------------------------------------------------------
+void SfxMedium::CloseInStream()
+{
+ CloseInStream_Impl();
+}
+
+void SfxMedium::CloseInStream_Impl()
+{
+ // if there is a storage based on the InStream, we have to
+ // close the storage, too, because otherwise the storage
+ // would use an invalid ( deleted ) stream.
+ if ( pInStream && aStorage.Is() )
+ {
+ const SvStream *pStorage = aStorage->GetSvStream();
+ if ( pStorage == pInStream )
+ {
+ CloseStorage();
+ }
+ }
+
+ delete pInStream;
+ pInStream = NULL;
+}
+
+//------------------------------------------------------------------
+SvStream* SfxMedium::GetOutStream()
+{
+ if ( !pOutStream )
+ {
+ // Create a temp. file if there is none because we always
+ // need one.
+ if ( !pImp->pTempFile )
+ CreateTempFile();
+
+ if ( pImp->pTempFile )
+ {
+ pOutStream = new SvFileStream( aName, STREAM_STD_READWRITE );
+ CloseStorage();
+ }
+ }
+
+ return pOutStream;
+}
+
+//------------------------------------------------------------------
+sal_Bool SfxMedium::CloseOutStream()
+{
+ CloseOutStream_Impl();
+ return sal_True;
+}
+
+sal_Bool SfxMedium::CloseOutStream_Impl()
+{
+ if ( pOutStream )
+ {
+ // if there is a storage based on the OutStream, we have to
+ // close the storage, too, because otherwise the storage
+ // would use an invalid ( deleted ) stream.
+
+ if ( aStorage.Is() )
+ {
+ const SvStream *pStorage = aStorage->GetSvStream();
+ if ( pStorage == pOutStream )
+ CloseStorage();
+ }
+
+ delete pOutStream;
+ pOutStream = NULL;
+ }
+
+ return sal_True;
+}
+
+//------------------------------------------------------------------
+const String& SfxMedium::GetPhysicalName() const
+{
+ if ( !pImp->pTempFile && (INET_PROT_FILE != GetURLObject().GetProtocol() ) )
+ (( SfxMedium*)this)->CreateFileStream();
+
+ // return the name then
+ return aName;
+}
+
+//------------------------------------------------------------------
+void SfxMedium::CreateFileStream()
+{
+ GetMedium_Impl();
+
+ if( pInStream && ! pImp->pTempFile )
+ {
+ DBG_WARNING( "W1: erzeuge FileStream" );
+
+ pImp->pTempFile = new TempFile;
+ pImp->pTempFile->EnableKillingFile( sal_True );
+
+ aName = pImp->pTempFile->GetName();
+
+ SvFileStream aTmpStream( aName, STREAM_STD_WRITE );
+ char *pBuf = new char [8192];
+ sal_uInt32 nErr = ERRCODE_NONE;
+
+ pInStream->Seek( 0L );
+
+ // Stream synchron downloaden
+ while( !pInStream->IsEof() &&
+ ( nErr == ERRCODE_NONE || nErr == ERRCODE_IO_PENDING ) )
+ {
+ sal_uInt32 nRead = pInStream->Read( pBuf, 8192 );
+ nErr = pInStream->GetError();
+ aTmpStream.Write( pBuf, nRead );
+ if( nErr == ERRCODE_IO_PENDING )
+ {
+ Application::Yield();
+ pInStream->ResetError();
+ }
+ }
+ delete pBuf;
+ pImp->bIsTemp = sal_True;
+
+ CloseInStream_Impl();
+ }
+}
+
+//------------------------------------------------------------------
+sal_Bool SfxMedium::Commit()
+{
+ if( aStorage.Is() )
+ {
+ // StorageStream immer direkt
+ if( !aStorage->Commit() )
+ eError = aStorage->GetError();
+ }
+ else if( pOutStream )
+ pOutStream->Flush();
+ else if( pInStream )
+ pInStream->Flush();
+
+ if ( ( GetError() == SVSTREAM_OK ) && pImp->pTempFile )
+ Transfer_Impl();
+
+ return GetError() == SVSTREAM_OK;
+}
+
+//------------------------------------------------------------------
+sal_Bool SfxMedium::IsStorage() const
+{
+ (const_cast< SfxMedium* > (this))->GetStorage();
+ (const_cast< SfxMedium* > (this))->ResetError();
+ return aStorage.Is();
+}
+
+//------------------------------------------------------------------
+Link SfxMedium::GetDataAvailableLink() const
+{
+ return pImp->aAvailableLink.GetLink();
+}
+
+//------------------------------------------------------------------
+Link SfxMedium::GetDoneLink() const
+{
+ return pImp->aDoneLink.GetLink();
+}
+
+//------------------------------------------------------------------
+sal_Bool SfxMedium::IsPreview_Impl()
+{
+ sal_Bool bPreview = sal_False;
+ SFX_ITEMSET_ARG( GetItemSet(), pPreview, SfxBoolItem, SID_PREVIEW, sal_False);
+ if ( pPreview )
+ bPreview = pPreview->GetValue();
+ else
+ {
+ SFX_ITEMSET_ARG( GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ if ( pFlags )
+ {
+ String aFileFlags = pFlags->GetValue();
+ aFileFlags.ToUpperAscii();
+ if ( STRING_NOTFOUND != aFileFlags.Search( 'B' ) )
+ bPreview = sal_True;
+ }
+ }
+
+ return bPreview;
+}
+
+//------------------------------------------------------------------
+sal_Bool SfxMedium::TryStorage()
+{
+ GetStorage();
+
+ if ( aStorage.Is() )
+ return sal_True;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr( ::utl::getProcessServiceFactory() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XArchiver >
+ xPacker( xSMgr->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.util.Archiver" ) ), ::com::sun::star::uno::UNO_QUERY );
+
+ if( !xPacker.is() )
+ return sal_False;
+
+ // extract extra data
+ ::rtl::OUString aPath = GetURLObject().PathToFileName();
+ ::rtl::OUString aExtraData = xPacker->getExtraData( aPath );
+ const ::rtl::OUString aSig1( DEFINE_CONST_UNICODE( "private:" ) );
+ String aTmp( '?' );
+ aTmp += pFilter->GetFilterContainer()->GetName();
+ const ::rtl::OUString aSig2( aTmp );
+ sal_Int32 nIndex1 = aExtraData.indexOf( aSig1 );
+ sal_Int32 nIndex2 = aExtraData.indexOf( aSig2 );
+
+ if( nIndex1 != 0 || nIndex2 == -1 )
+ return sal_False;
+
+ nIndex1 += aSig1.getLength();
+ ::rtl::OUString aTempDoku = aExtraData.copy( nIndex1, nIndex2 - nIndex1 );
+
+ // create a temp dir to unpack to
+ pImp->pTempDir = new TempFile( NULL, sal_True );
+ pImp->pTempDir->EnableKillingFile( sal_True );
+
+ // unpack all files to temp dir
+
+ com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xFactory = ::utl::getProcessServiceFactory();
+ com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > xInteractionHandler(
+ xFactory->createInstance( DEFINE_CONST_UNICODE("com.sun.star.uui.InteractionHandler") ), UNO_QUERY );
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs(1);
+ aArgs.getArray()[0].Name = DEFINE_CONST_UNICODE( "InteractionHandler" );
+ aArgs.getArray()[0].Value <<= xInteractionHandler ;
+
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > files(0);
+
+ if( !xPacker->unpack( pImp->pTempDir->GetName(), aPath, files, aArgs ) )
+ return sal_False;
+
+ String aNewName = pImp->pTempDir->GetName();
+ aNewName += '/';
+ aNewName += String( aTempDoku );
+ CloseInStream_Impl();
+ SetPhysicalName( aNewName );
+ GetStorage();
+
+ if ( aStorage.Is() )
+ {
+ const SfxFilter *pRealFilter = SFX_APP()->GetFilterMatcher().GetFilter4ClipBoardId( aStorage->GetFormat() );
+ if ( pRealFilter )
+ {
+ pImp->nFileVersion = pRealFilter->GetVersion();
+ aStorage->SetVersion( pImp->nFileVersion );
+ }
+
+ DBG_ASSERT( pRealFilter, "Unknown storage format!" );
+ }
+
+ return aStorage.Is();
+}
+
+ErrCode SfxMedium::Unpack_Impl( const String& rDest )
+{
+ ErrCode nRet = ERRCODE_NONE;
+ if ( pImp->pTempDir )
+ {
+/*
+ DirEntry aDestEntry( rDest );
+ Dir aDir( pImp->pTempDir->GetName(), FSYS_KIND_FILE );
+ sal_uInt16 nCount = aDir.Count();
+ for ( sal_uInt16 n=0; n<nCount; n++ )
+ {
+ DirEntry aDest( aDestEntry.GetPath() );
+ DirEntry aTmp = aDir[n];
+ aDest += aTmp.GetName();
+ if ( aDir[n] == DirEntry( GetPhysicalName() ) )
+ continue;
+
+ nRet = aTmp.CopyTo( aDest, FSYS_ACTION_COPYFILE );
+ if ( nRet != ERRCODE_NONE )
+ break;
+ }
+ */
+ }
+
+ return nRet;
+}
+
+//------------------------------------------------------------------
+SvStorage* SfxMedium::GetOutputStorage()
+{
+ if ( !pImp->pTempFile )
+ CreateTempFile();
+ return GetStorage();
+}
+
+SvStorage* SfxMedium::GetStorage()
+{
+ if ( aStorage.Is() || bTriedStorage )
+ return aStorage;
+
+ BOOL bResetSorage = FALSE;
+ SvStream *pStream;
+
+ INetURLObject aStorageName;
+ if ( pImp->pTempFile )
+ {
+ aStorageName.SetURL( pImp->pTempFile->GetName() );
+ pStream = GetOutStream();
+ }
+ else
+ {
+ aStorageName = GetURLObject();
+ pStream = GetInStream();
+ if ( pStream )
+ {
+ pStream->GetLockBytes()->SetSynchronMode( sal_True );
+ if ( !pImp->aDoneLink.IsSet() )
+ DownLoad();
+ }
+ }
+
+ bTriedStorage = sal_True;
+
+ if( !pStream || ( GetError() != SVSTREAM_OK ) )
+ return aStorage;
+
+ aStorage = new SvStorage( pStream, FALSE );
+ if ( INET_PROT_FILE == aStorageName.GetProtocol() )
+ aStorage->SetName( aStorageName.PathToFileName() );
+
+ if ( aStorage->GetError() == SVSTREAM_OK )
+ GetVersionList();
+
+ // ???? wird das noch gebraucht?
+// GetMedium_Impl();
+// if ( !aStorage.Is() )
+// CreateFileStream();
+
+ SFX_ITEMSET_ARG( pSet, pVersion, SfxInt16Item, SID_VERSION, sal_False);
+
+ if ( pVersion )
+ {
+ // Alle verf"ugbaren Versionen einlesen
+ if ( pImp->pVersions )
+ {
+ // Die zum Kommentar passende Version suchen
+ // Die Versionen sind von 1 an durchnumeriert, mit negativen
+ // Versionsnummern werden die Versionen von der aktuellen aus
+ // r"uckw"arts gez"ahlt
+ short nVersion = pVersion ? pVersion->GetValue() : 0;
+ if ( nVersion<0 )
+ nVersion = ( (short) pImp->pVersions->Count() ) + nVersion;
+ else if ( nVersion )
+ nVersion--;
+
+ SfxVersionInfo* pInfo = nVersion>=0 ? pImp->pVersions->GetObject( nVersion ) : NULL;
+ if ( pInfo )
+ {
+ String aVersionStream = pInfo->aName;
+
+ // SubStorage f"ur alle Versionen "offnen
+ SvStorageRef aSub =
+ aStorage->OpenStorage( DEFINE_CONST_UNICODE( "Versions" ), SFX_STREAM_READONLY );
+
+ DBG_ASSERT( aSub.Is() && !aSub->GetError(), "Versionsliste, aber keine Versionen!" );
+
+ // Dort ist die Version als gepackter Stream gespeichert
+ SvStorageStreamRef aStream =
+ aSub->OpenStream( aVersionStream, SFX_STREAM_READONLY );
+
+ if ( aStream.Is() && aStream->GetError() == SVSTREAM_OK )
+ {
+ // Stream ins TempDir auspacken
+ TempFile aTempFile;
+ String aTmpName = aTempFile.GetName();
+ SvFileStream aTmpStream( aTmpName, SFX_STREAM_READWRITE );
+
+ ZCodec aCodec;
+ aCodec.BeginCompression();
+ aCodec.Decompress( *aStream, aTmpStream );
+ aCodec.EndCompression();
+ aTmpStream.Close();
+
+ // Datei als Storage "offnen
+ nStorOpenMode = SFX_STREAM_READONLY;
+ aStorage = new SvStorage( aTmpName, nStorOpenMode );
+ SetPhysicalName( aTmpName );
+ pImp->bIsTemp = sal_True;
+ GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
+ DELETEZ( pImp->pVersions );
+ }
+ else
+ bResetSorage = TRUE;
+ }
+ else
+ bResetSorage = TRUE;
+ }
+ else
+ bResetSorage = TRUE;
+ }
+
+ if ( aStorage.Is() )
+ {
+ if( aStorage->GetError() != SVSTREAM_OK )
+ bResetSorage = TRUE;
+ else if ( GetFilter() )
+ aStorage->SetVersion( GetFilter()->GetVersion() );
+ }
+
+ if ( bResetSorage )
+ {
+ SetError( aStorage->GetError() );
+ aStorage.Clear();
+ pStream->Seek( 0L );
+ }
+
+ return aStorage;
+}
+
+//------------------------------------------------------------------
+void SfxMedium::CloseStorage()
+{
+ aStorage.Clear();
+ bTriedStorage = sal_False;
+}
+
+//------------------------------------------------------------------
+void SfxMedium::SetOpenMode( StreamMode nStorOpen,
+ sal_Bool bDirectP,
+ sal_Bool bDontClose )
+{
+ if ( nStorOpenMode != nStorOpen )
+ {
+ nStorOpenMode = nStorOpen;
+
+ if( !bDontClose )
+ Close();
+ }
+
+ bDirect = bDirectP;
+ bSetFilter = sal_False;
+}
+
+//------------------------------------------------------------------
+void SfxMedium::Transfer_Impl()
+{
+ if( pImp->pTempFile && !eError )
+ {
+ Reference < XContent > xContent = GetContent();
+ if ( ! xContent.is() )
+ return;
+
+ sal_Bool bSuccess;
+
+ // check wether the the temp file has the same protocol
+ // scheme as the destination, wether the destination supports
+ // the transfer command and wether or not the command
+ // executed successfully
+
+ BOOL bTryTransfer = FALSE;
+ String aName;
+ INetURLObject aDest = GetURLObject();
+ INetURLObject aSource( pImp->pTempFile->GetName() );
+
+ aName = GetLongName();
+ if ( !aName.Len() )
+ aName = aDest.getName( INetURLObject::LAST_SEGMENT, true,
+ INetURLObject::DECODE_WITH_CHARSET );
+
+ if ( aDest.GetProtocol() == aSource.GetProtocol() )
+ {
+ bTryTransfer = UCB_Helper::HasCommand( xContent,
+ WID_TRANSFER );
+ }
+
+ if ( bTryTransfer && aDest.removeSegment() )
+ {
+ TransferInfo aInfo;
+ String aParentURL = aDest.GetMainURL();
+ Any aAny;
+
+ aInfo.MoveData = sal_True;
+ aInfo.SourceURL = aSource.GetMainURL();
+ aInfo.NewTitle = aName;
+
+ SFX_ITEMSET_ARG( GetItemSet(), pRename, SfxBoolItem, SID_RENAME, sal_False );
+ SFX_ITEMSET_ARG( GetItemSet(), pOverWrite, SfxBoolItem, SID_OVERWRITE, sal_False );
+
+ if ( pOverWrite && !pOverWrite->GetValue() )
+ {
+ aInfo.NameClash = NameClash::ERROR;
+ }
+ else if ( pRename && pRename->GetValue() )
+ {
+ aInfo.NameClash = NameClash::RENAME;
+ }
+ else
+ {
+ aInfo.NameClash = NameClash::OVERWRITE;
+ }
+
+ aAny <<= aInfo;
+ Close();
+ UCB_Helper::ExecuteCommand( aParentURL, WID_TRANSFER,
+ aAny, &bSuccess );
+ if ( bSuccess )
+ {
+ // when the transfer command executed successful
+ // there will be no tempfile anymore so we have
+ // to get rid of it
+ pImp->pTempFile->EnableKillingFile( sal_False );
+ delete pImp->pTempFile;
+ pImp->pTempFile = NULL;
+ bDownLoad = TRUE;
+ return;
+ }
+ }
+
+ SvStream *pStream = GetOutStream();
+ SvLockBytesRef xLockBytes = new SvLockBytes( pStream );
+ Reference < ::com::sun::star::io::XInputStream > xStream
+ = new OInputStreamHelper( xLockBytes, 8192 );
+
+ Any aAny;
+ InsertCommandArgument aArg;
+
+ aArg.Data = xStream;
+ aArg.ReplaceExisting = sal_True;
+ aAny <<= aArg;
+
+ UCB_Helper::ExecuteCommand( xContent, WID_INSERT,
+ aAny, &bSuccess );
+
+ if ( !bSuccess )
+ eError = ERRCODE_IO_GENERAL;
+ }
+}
+
+//------------------------------------------------------------------
+void SfxMedium::DoBackup_Impl()
+{
+ INetURLObject aDest;
+ INetURLObject aSource = GetURLObject();
+ String aParentURL;
+ String aName;
+ String aBakDir = SFX_INIMANAGER()->Get(SFX_KEY_BACKUP_PATH);
+ BOOL bTryTransfer = FALSE;
+ sal_Bool bSuccess = sal_False;
+ Reference < XContent > xContent;
+
+ // Backup Path gesetzt ? Dann diesen benutzen.
+ if( aBakDir.Len() )
+ {
+ aDest.SetSmartProtocol( INET_PROT_FILE );
+ aDest.SetSmartURL( aBakDir );
+ aDest.insertName( aSource.getName() );
+ }
+ else
+ {
+ aDest = GetURLObject();
+ }
+
+ // Derzeit immer bak dranhaengen (MAC ???)
+#ifndef MAC
+ // *.bak
+ aDest.setExtension( DEFINE_CONST_UNICODE( "bak" ) );
+#else
+ // * Kopie
+ aDest.setName( aDest.getName( INetURLObject::LAST_SEGMENT,
+ true,
+ INetURLObject::DECODE_WITH_CHARSET )
+ + String(SfxResId(STR_BACKUP_COPY)) );
+#endif
+
+ aName = aDest.getName( INetURLObject::LAST_SEGMENT, true,
+ INetURLObject::DECODE_WITH_CHARSET );
+
+ // check wether the the temp file has the same protocol
+ // scheme as the destination, wether the destination supports
+ // the transfer command and wether or not the command
+ // executed successfully
+
+ if ( aDest.GetProtocol() == aSource.GetProtocol() )
+ {
+ INetURLObject aDestDir = aDest;
+ if ( aDestDir.removeSegment() )
+ {
+ aParentURL = aDestDir.GetMainURL();
+ xContent = UCB_Helper::CreateContent( aParentURL );
+ if ( xContent.is() )
+ {
+ bTryTransfer = UCB_Helper::HasCommand( xContent,
+ WID_TRANSFER );
+ }
+ }
+ }
+
+ if ( bTryTransfer )
+ {
+ TransferInfo aInfo;
+ Any aAny;
+
+ aInfo.MoveData = sal_True;
+ aInfo.SourceURL = aSource.GetMainURL();
+ aInfo.NewTitle = aName;
+ aInfo.NameClash = NameClash::OVERWRITE;
+
+ aAny <<= aInfo;
+ Close();
+ UCB_Helper::ExecuteCommand( xContent, WID_TRANSFER,
+ aAny, &bSuccess );
+ }
+
+ if ( !bSuccess )
+ {
+ xContent = UCB_Helper::CreateContent( aDest.GetMainURL() );
+ if ( xContent.is() )
+ {
+ SvStream *pStream = GetInStream();
+ SvLockBytesRef xLockBytes = new SvLockBytes( pStream );
+ Reference < ::com::sun::star::io::XInputStream > xStream
+ = new OInputStreamHelper( xLockBytes, 8192 );
+
+ Any aAny;
+ InsertCommandArgument aArg;
+
+ aArg.Data = xStream;
+ aArg.ReplaceExisting = sal_True;
+ aAny <<= aArg;
+
+ UCB_Helper::ExecuteCommand( xContent, WID_INSERT, aAny, &bSuccess );
+ }
+ }
+
+ if ( ! bSuccess )
+ WarningBox( NULL, SfxResId( MSG_WARNING_BACKUP ) ).Execute();
+}
+
+//----------------------------------------------------------------
+void SfxMedium::GetMedium_Impl()
+{
+ if ( !pInStream )
+ {
+ DBG_ASSERT( bDownLoad, "Medium without DownloadFlag!" );
+ pImp->bDownloadDone = sal_False;
+
+ SvLockBytesRef xLockBytes;
+ if ( !pImp->aLinkList.Is() )
+ {
+ pImp->aLinkList = new UCB_Link_Helper;
+ pImp->aLinkList->SetDoneLink( LINK( pImp, SfxMedium_Impl, Done_Impl ) );
+ pImp->aLinkList->SetDataAvailLink( LINK( pImp, SfxMedium_Impl, DataAvailable_Impl ) );
+ pImp->aLinkList->SetCancelLink( LINK( pImp, SfxMedium_Impl, Cancel_Impl ) );
+ }
+
+ SFX_ITEMSET_ARG( pSet, pStreamItem, SfxUsrAnyItem, SID_INPUTSTREAM, sal_False);
+
+ if ( pStreamItem )
+ {
+ Reference < ::com::sun::star::io::XInputStream > xStream;
+ if ( ( pStreamItem->GetValue() >>= xStream ) && xStream.is() )
+ xLockBytes = UCB_Helper::CreateInputLockBytes(
+ xStream, pImp->aLinkList,
+ pImp->GetCancelManager() );
+ }
+ else
+ {
+ xLockBytes = UCB_Helper::CreateInputLockBytes(
+ GetContent(),
+ pImp->aLinkList,
+ pImp->GetCancelManager() );
+ }
+
+ if ( xLockBytes.Is() )
+ {
+ if ( pImp->bForceSynchron || ! pImp->aDoneLink.IsSet() )
+ xLockBytes->SetSynchronMode( sal_True );
+ else
+ xLockBytes->SetSynchronMode( sal_False );
+
+ pInStream = new SvStream( xLockBytes );
+ }
+ }
+
+#ifdef OLD_CODE_FOR_POSTING
+
+ SFX_ITEMSET_ARG( pSet, pContentType, SfxStringItem, SID_CONTENTTYPE, sal_False);
+ if( pContentType ) pImp->xBinding->SetSendMimeType(
+ pContentType->GetValue() );
+ pImp->xBinding->SetReferer( pImp->aReferer );
+ pImp->xBinding->SetPriority( pImp->nPrio );
+ const SfxPoolItem *pItem = 0;
+ if( pSet )
+ {
+ pSet->GetItemState( SID_POSTSTRING, sal_False, &pItem );
+ if( !pItem )
+ pSet->GetItemState( SID_POSTLOCKBYTES, sal_False, &pItem );
+ }
+
+ if( pItem )
+ {
+ if( pItem->ISA( SfxStringItem ))
+ {
+ SvCacheStream* pCacheStr = new SvCacheStream( 8192 );
+ pCacheStr->WriteByteString( ((SfxStringItem*)pItem)->GetValue(), RTL_TEXTENCODING_UTF8 );
+ SvLockBytesRef xRef (new SvLockBytes(pCacheStr, sal_True));
+ pImp->xBinding->GetBindContext().SetPostLockBytes ( xRef);
+ }
+ else if( pItem->ISA( SfxRefItem ))
+ {
+ SvLockBytes* pBytes = new SvLockBytes;
+ int nDiff = (char*)pBytes - (char*)(SvRefBase*)pBytes;
+ SvLockBytes* pLB = (SvLockBytes*)(
+ (char*)(SvRefBase*)&((SfxRefItem*)pItem )->GetValue() + nDiff );
+ delete pBytes;
+ SvLockBytesRef rTmpLB ( pLB );
+ pImp->xBinding->GetBindContext().SetPostLockBytes ( rTmpLB );
+ }
+ else if( pItem->ISA( SfxLockBytesItem ))
+ {
+ // f"ur sp"ater ...
+ SvLockBytes* pBytes = ((SfxLockBytesItem*)pItem)->GetValue();
+ SvLockBytesRef rTmpLB ( pBytes );
+ pImp->xBinding->GetBindContext().SetPostLockBytes ( rTmpLB );
+ }
+ }
+#endif
+}
+
+//------------------------------------------------------------------
+SfxPoolCancelManager* SfxMedium::GetCancelManager_Impl() const
+{
+ return pImp->GetCancelManager();
+}
+
+//------------------------------------------------------------------
+void SfxMedium::SetCancelManager_Impl( SfxPoolCancelManager* pMgr )
+{
+ pImp->xCancelManager = pMgr;
+}
+
+//----------------------------------------------------------------
+void SfxMedium::CancelTransfers()
+{
+ if( pImp->xCancelManager.Is() )
+ pImp->xCancelManager->Cancel();
+}
+
+//----------------------------------------------------------------
+void AddNumber_Impl( String& aNumber, sal_uInt32 nArg )
+{
+ if ( nArg >= 10240 )
+ {
+ aNumber += String::CreateFromInt32( (sal_uInt16)( ( nArg + 512 ) / 1024 ) );
+ aNumber += ' ';
+ aNumber += SfxResId( STR_KB );
+ }
+ else
+ {
+ aNumber += String::CreateFromInt32( nArg );
+ aNumber += ' ';
+ aNumber += SfxResId( STR_BYTES );
+ }
+}
+
+//----------------------------------------------------------------
+
+String SfxMedium::GetStatusString( const SvProgressArg* pArg )
+{
+ String aString;
+/*
+ StringList_Impl aSL( SfxResId( RID_DLSTATUS2 ), (USHORT)pArg->eStatus );
+ USHORT nTotal = 0;
+
+ if ( pArg->eStatus == SVBINDSTATUS_ENDDOWNLOADDATA && nTotal <= 1 )
+ return aString;
+
+ if( aSL )
+ {
+ INetURLObject aObj( pArg->rStatus );
+ aString = aSL.GetString();
+ aString.SearchAndReplaceAscii( "$(HOST)", aObj.GetHost() );
+ String aTarget = aObj.GetFull();
+ if( aTarget.Len() <= 1 && pArg->eStatus != SVBINDSTATUS_CONNECTING )
+ aTarget = aObj.GetHost();
+ if( pArg->nMax )
+ {
+ aTarget += DEFINE_CONST_UNICODE( " (" );
+ AddNumber_Impl( aTarget, pArg->nMax );
+ aTarget += ')';
+ }
+
+ aString.SearchAndReplaceAscii( "$(TARGET)",aTarget );
+ String aNumber;
+ AddNumber_Impl( aNumber, pArg->nProgress );
+ if( pArg->nRate )
+ {
+ aNumber+= DEFINE_CONST_UNICODE( " (" );
+ AddNumber_Impl( aNumber, (ULONG)pArg->nRate );
+ aNumber+= DEFINE_CONST_UNICODE( "/s)" );
+ }
+ if( pArg->nMax && pArg->nProgress && pArg->nMax != pArg->nProgress )
+ {
+ aNumber += DEFINE_CONST_UNICODE( " [" );
+ float aPerc = pArg->nProgress / (float)pArg->nMax;
+ aNumber += String::CreateFromInt32( (USHORT)(aPerc * 100) );
+ aNumber += DEFINE_CONST_UNICODE( "%]" );
+ }
+ aString.SearchAndReplaceAscii( "$(BYTE)", aNumber );
+ }
+ */
+ return aString;
+}
+
+sal_Bool SfxMedium::IsRemote()
+{
+ return bRemote;
+}
+
+//------------------------------------------------------------------
+
+void SfxMedium::SetUpdatePickList(sal_Bool bVal)
+{
+ if(!pImp)
+ pImp = new SfxMedium_Impl( this );
+ pImp->bUpdatePickList = bVal;
+}
+//------------------------------------------------------------------
+
+sal_Bool SfxMedium::IsUpdatePickList() const
+{
+ return pImp? pImp->bUpdatePickList: sal_True;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetDoneLink( const Link& rLink )
+{
+ pImp->aDoneLink = rLink;
+}
+
+//----------------------------------------------------------------
+
+void SfxMedium::SetDataAvailableLink( const Link& rLink )
+{
+ pImp->aAvailableLink = rLink;
+}
+
+//----------------------------------------------------------------
+void SfxMedium::StartDownload()
+{
+ GetMedium_Impl();
+ GetInStream();
+}
+
+void SfxMedium::DownLoad( const Link& aLink )
+{
+ SetDoneLink( aLink );
+ GetInStream();
+ if ( !aLink.IsSet() )
+ {
+ while( !pImp->bDownloadDone )
+ Application::Yield();
+ }
+}
+
+//------------------------------------------------------------------
+void SfxMedium::Init_Impl()
+/* [Beschreibung]
+ Setzt in den Lo.Ischen Namen eine gueltige ::com::sun::star::util::URL (Falls zuvor ein Filename
+ drin war) und setzt den physikalschen Namen auf den Filenamen, falls
+ vorhanden.
+ */
+
+{
+ pImp->pVersions = NULL;
+ INetURLObject aUrl;
+ aUrl.SetSmartProtocol( INET_PROT_FILE );
+ aUrl.SetSmartURL( aLogicName );
+
+ // Ein leerer LogicName soll auch einen leeren Namen ergeben
+ if( aUrl.GetProtocol() == INET_PROT_FILE && aLogicName.Len() )
+ {
+ String aTemp( aUrl.GetMainURL() );
+ INetURLObject aObj( aTemp );
+ if ( INET_PROT_FTP == aObj.GetProtocol() )
+ {
+#if 0 //(dv)
+ CntINetConfig::load (NULL, NULL);
+ INetProxyConfig aProxyConfig;
+ if (CntINetConfig::shouldUseProxy (NULL, aTemp, aProxyConfig) &&
+ aProxyConfig.hasFtpProxy())
+ // ::com::sun::star::chaos::Anchor wird on demand erzeugt
+ aLogicName = aTemp;
+ else
+ pImp->xAnchor = xAnchor;
+#endif
+ }
+ else
+ {
+ aLogicName = aUrl.GetMainURL();
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ {
+ if( !pImp->bIsTemp )
+ aName = aUrl.PathToFileName();
+ else
+ DBG_ERROR( "What name ?!" );
+ }
+ else
+ {
+ if( aName == aLogicName || !aName.Len() )
+ aName = aUrl.PathToFileName();
+ }
+ }
+ }
+ else if( aLogicName.Len() )
+ // Falls ein FileName reinkam
+ aLogicName = aUrl.GetMainURL();
+
+ SetIsRemote_Impl();
+
+ // Recover-Files sind immer temp
+ SFX_ITEMSET_ARG( pSet, pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ if ( pSalvageItem )
+ pImp->bIsTemp = sal_True;
+}
+//------------------------------------------------------------------
+
+SfxMedium::SfxMedium()
+: IMPL_CTOR(),
+ bRoot( sal_False ),
+ pURLObj(0),
+ pSet(0),
+ pImp(new SfxMedium_Impl( this )),
+ pFilter(0)
+{
+ bDownLoad = sal_True;
+ Init_Impl();
+}
+//------------------------------------------------------------------
+
+SfxMedium::SfxMedium( const SfxMedium& rMedium, sal_Bool bTemporary )
+: IMPL_CTOR(),
+ bRoot(sal_True),
+ pURLObj( rMedium.pURLObj ? new INetURLObject(*rMedium.pURLObj) : 0 ),
+ pImp(new SfxMedium_Impl( this ))
+{
+ bDirect = rMedium.IsDirect();
+ nStorOpenMode = rMedium.GetOpenMode();
+ if ( bTemporary )
+ CreateTempFile();
+ else
+ aName = rMedium.GetName();
+
+ pImp->bIsTemp = bTemporary;
+ DBG_ASSERT( ! rMedium.pImp->bIsTemp,
+ "Temporaeres Medium darf nicht kopiert werden" );
+ aLogicName = rMedium.aLogicName;
+ pSet = rMedium.GetItemSet() ? new SfxItemSet(*rMedium.GetItemSet()) : 0;
+ pFilter = rMedium.pFilter;
+ Init_Impl();
+ if( bTemporary )
+ {
+ if ( !SfxContentHelper::CopyTo( rMedium.GetName(), GetPhysicalName() ) )
+ SetError( ERRCODE_IO_GENERAL );
+ }
+
+ bDownLoad = sal_True;
+
+ if ( rMedium.pImp->pEaMgr )
+ GetEaMgr();
+}
+//------------------------------------------------------------------
+
+void SfxMedium::SetFilter( const SfxObjectFactory& rFact, const String & rFilter )
+{
+ SetFilter( rFact.GetFilterContainer()->GetFilter(rFilter) );
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetFilter( const SfxFilter* pFilterP, sal_Bool bResetOrig )
+{
+ pFilter = pFilterP;
+ pImp->nFileVersion = 0;
+}
+//----------------------------------------------------------------
+
+const SfxFilter* SfxMedium::GetOrigFilter( sal_Bool bNotCurrent ) const
+{
+ return ( pImp->pOrigFilter || bNotCurrent ) ? pImp->pOrigFilter : pFilter;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetOrigFilter_Impl( const SfxFilter* pFilter )
+{
+ pImp->pOrigFilter = pFilter;
+}
+//------------------------------------------------------------------
+
+void SfxMedium::Close()
+{
+ if ( aStorage.Is() )
+ {
+ // don't close the streams if they belong to the
+ // storage
+
+ const SvStream *pStream = aStorage->GetSvStream();
+ if ( pStream == pInStream )
+ {
+ pInStream = NULL;
+ aStorage->SetDeleteStream( TRUE );
+ }
+ if ( pStream == pOutStream )
+ {
+ pOutStream = NULL;
+ aStorage->SetDeleteStream( TRUE );
+ }
+
+ CloseStorage();
+ }
+
+ if ( pInStream )
+ CloseInStream_Impl();
+
+ if ( pOutStream )
+ CloseOutStream_Impl();
+}
+
+#if SUPD<605
+sal_uInt32 SfxMedium::UrlToAbs( String& rAbsUrl, const String& rUrl,
+ SfxObjectShell* pSh )
+{
+ String aMedName( pSh->GetMedium()->GetName() );
+ INetURLObject aAktUrl;
+ INetURLObject aTargetUrl;
+ if ( aMedName.Len() )
+ {
+ aAktUrl.SetSmartProtocol( INET_PROT_FILE );
+ aAktUrl.SetSmartURL( aMedName );
+ }
+
+ sal_Bool bTargetSet = sal_False;
+ sal_uInt32 nErr = ERRCODE_NONE;
+
+ // Absolutes File Protokoll testen
+ bool bWasAbsolute = FALSE;
+ INetURLObject aFileObj( aAktUrl );
+ aFileObj.smartRel2Abs( rUrl, bWasAbsolute );
+
+ if( bWasAbsolute && SfxContentHelper::Exists( aFileObj.GetURLNoMark() ) )
+ {
+ rAbsUrl = aFileObj.GetMainURL();
+ return ERRCODE_NONE;
+ }
+
+ // Ist aktuelles Doc unbenamt?
+ if( !aMedName.Len() )
+ {
+ if( bWasAbsolute )
+ {
+ rAbsUrl = aFileObj.GetMainURL();
+ return ERRCODE_NONE;
+ }
+ else
+ {
+ rAbsUrl = rUrl;
+ return ERRCODE_SFX_ISRELATIVE;
+ }
+ }
+
+ // Falls File Protokoll, testen ob DirEntry vorhanden (relativ)
+ if( aAktUrl.GetProtocol() == INET_PROT_FILE )
+ {
+ INetURLObject aFileObj;
+ aFileObj.SetSmartProtocol( INET_PROT_FILE );
+ if( aAktUrl.GetNewAbsURL( rUrl, &aFileObj ) )
+ {
+ String aFileName = aFileObj.PathToFileName();
+ //Relativ zum Dokument testen!
+ if( SfxContentHelper::Exists( aFileName ) )
+ {
+ // File e.Istiert, also als FileUrl Parsen
+ rAbsUrl = aFileObj.GetMainURL();
+ return ERRCODE_NONE;
+ }
+ }
+ }
+
+ if( !aAktUrl.GetNewAbsURL( rUrl, &aTargetUrl ) )
+ nErr = ERRCODE_IO_GENERAL;
+ rAbsUrl = aTargetUrl.GetMainURL();
+ return nErr;
+}
+#endif
+
+//------------------------------------------------------------------
+
+void SfxMedium::RefreshName_Impl()
+{
+#if 0 //(dv)
+ if ( pImp->xContent.is() )
+ {
+ String aNameP = pImp->xAnchor->GetViewURL();
+ pImp->aOrigURL = aNameP;
+ aLogicName = aNameP;
+ DELETEZ( pURLObj );
+ if (aLogicName.Len())
+ aLogicName = GetURLObject().GetMainURL();
+ SetIsRemote_Impl();
+ }
+#endif //(dv)
+}
+
+void SfxMedium::SetIsRemote_Impl()
+{
+ INetURLObject aObj( GetName() );
+ switch( aObj.GetProtocol() )
+ {
+ case INET_PROT_FTP:
+ case INET_PROT_HTTP:
+ case INET_PROT_HTTPS:
+ case INET_PROT_POP3:
+ case INET_PROT_NEWS:
+ case INET_PROT_IMAP:
+// case INET_PROT_OUT:
+ case INET_PROT_VIM:
+ bRemote = TRUE; break;
+ default:
+ bRemote = ( GetName().CompareToAscii( "private:msgid", 13 ) == COMPARE_EQUAL );
+ break;
+ }
+
+ // Da Dateien, die Remote geschrieben werden zur Uebertragung auch
+ // gelesen werden koennen muessen
+ if( bRemote )
+ nStorOpenMode |= STREAM_READ;
+}
+
+
+
+void SfxMedium::SetName( const String& aNameP, sal_Bool bSetOrigURL )
+{
+ if( !pImp->aOrigURL.Len() )
+ pImp->aOrigURL = aLogicName;
+ if( bSetOrigURL )
+ pImp->aOrigURL = aNameP;
+ aLogicName = aNameP;
+ DELETEZ( pURLObj );
+
+//(dv) if ( pImp->xAnchor.Is() && aNameP != pImp->xAnchor->GetViewURL() )
+//(dv) pImp->xAnchor = NULL;
+
+ if ( aLogicName.Len() )
+ {
+ INetURLObject aUrl;
+ aUrl.SetSmartProtocol( INET_PROT_FILE );
+ aUrl.SetSmartURL( aLogicName );
+ String aTemp( aUrl.GetMainURL() );
+ INetURLObject aObj( aTemp );
+
+ if ( INET_PROT_FTP == aObj.GetProtocol() )
+ {
+#if 0 //(dv)
+ CntINetConfig::load (NULL, NULL);
+ INetProxyConfig aProxyConfig;
+ if (CntINetConfig::shouldUseProxy (NULL, aTemp, aProxyConfig))
+ if (aProxyConfig.hasFtpProxy())
+ aLogicName = aTemp;
+#endif //(dv)
+ }
+
+ aLogicName = GetURLObject().GetMainURL();
+ }
+
+ SetIsRemote_Impl();
+}
+
+//----------------------------------------------------------------
+const String& SfxMedium::GetOrigURL() const
+{
+ return !pImp->aOrigURL.Len() ? (String &)aLogicName : pImp->aOrigURL;
+}
+
+//----------------------------------------------------------------
+void SfxMedium::SetPhysicalName( const String& rNameP )
+{
+ if( pImp->pTempFile )
+ {
+ delete pImp->pTempFile;
+ pImp->pTempFile = NULL;
+ }
+
+ aName = rNameP;
+ bTriedStorage = sal_False;
+
+ if ( aName.Len() )
+ {
+ INetURLObject aURL;
+ Reference < XContent > xContent;
+
+ aURL.SetSmartProtocol( INET_PROT_FILE );
+ aURL.SetSmartURL( aName );
+
+ xContent = UCB_Helper::CreateContent( aURL.GetMainURL() );
+ if ( xContent.is() )
+ pImp->xContent = xContent;
+ }
+}
+
+//------------------------------------------------------------------
+void SfxMedium::SetTemporary( sal_Bool bTemp )
+{
+ pImp->bIsTemp = bTemp;
+}
+
+//------------------------------------------------------------------
+sal_Bool SfxMedium::IsTemporary() const
+{
+ return pImp->bIsTemp;
+}
+
+//------------------------------------------------------------------
+
+sal_Bool SfxMedium::Exists( sal_Bool bForceSession )
+{
+ DBG_ERROR( "Not implemented!" );
+ return sal_False;
+}
+
+//------------------------------------------------------------------
+
+void SfxMedium::ReOpen()
+{
+ DBG_ASSERT( pFilter, "Kein Filter, aber ReOpen!" );
+ if( pFilter )
+ {
+ if( pFilter->UsesStorage() )
+ GetStorage();
+ else
+ GetInStream();
+ }
+}
+//------------------------------------------------------------------
+SfxMedium::SfxMedium
+(
+ const String &rName, StreamMode nOpenMode, sal_Bool bDirectP,
+ sal_Bool bDownLoadP, const SfxFilter *pFlt, SfxItemSet *pInSet
+)
+: IMPL_CTOR(),
+ bRoot( sal_False ),
+ pFilter(pFlt),
+ pURLObj(0),
+ pImp(new SfxMedium_Impl( this )),
+ pSet( pInSet )
+{
+ aName = aLogicName = rName;
+ nStorOpenMode = nOpenMode;
+ bDirect = bDirectP;
+ bDownLoad = bDownLoadP;
+ Init_Impl();
+}
+//------------------------------------------------------------------
+
+SfxMedium::SfxMedium( SvStorage *pStorage, sal_Bool bRootP )
+: IMPL_CTOR(),
+ bRoot( bRootP ),
+ aStorage(pStorage),
+ pURLObj(0),
+ pImp( new SfxMedium_Impl( this )),
+ pSet(0)
+{
+ SfxApplication* pApp = SFX_APP();
+ sal_uInt32 nFormat = pStorage->GetFormat();
+ if( !nFormat )
+ {
+#ifdef DBG_UTIL
+ if( aLogicName.Len() )
+ DBG_ERROR( "Unbekanntes StorageFormat, versuche eigenes Format" );
+#endif
+ pFilter = SfxObjectFactory::GetDefaultFactory().GetFilterContainer()->
+ GetFilter( 0 );
+ }
+ else
+ pFilter = pApp->GetFilterMatcher().GetFilter4ClipBoardId( nFormat, 0, 0 );
+ if( pFilter )
+ pFilter = pApp->GetFilterMatcher().ResolveRedirection( pFilter, *this );
+ if( !pFilter && nFormat )
+ {
+#ifdef DBG_UTIL
+ ByteString aErr( U2S( Exchange::GetFormatName( nFormat ) ) );
+ aErr += " leider kein Filter vorhanden";
+ DBG_ERROR( aErr.GetBuffer() );
+#endif
+ pFilter = SfxObjectFactory::GetDefaultFactory().GetFilterContainer()->
+ GetFilter( 0 );
+ }
+
+ bDownLoad = sal_False;
+ Init_Impl();
+}
+//------------------------------------------------------------------
+
+SfxMedium::~SfxMedium()
+{
+// CancelTransfers();
+ Close();
+
+ delete pSet;
+
+ if( pImp->bIsTemp && GetPhysicalName().Len() )
+ {
+ INetURLObject aObj( GetPhysicalName(), INET_PROT_FILE );
+ SfxContentHelper::Kill( aObj.GetMainURL() );
+ }
+
+ pFilter = 0;
+
+ delete pURLObj;
+ delete pImp;
+}
+//------------------------------------------------------------------
+
+void SfxMedium::SetItemSet(SfxItemSet *pNewSet)
+{
+ delete pSet;
+ pSet = pNewSet;
+}
+//------------------------------------------------------------------
+
+void SfxMedium::SetClassFilter( const SvGlobalName & rFilterClass )
+{
+ bSetFilter = sal_True;
+ aFilterClass = rFilterClass;
+}
+//----------------------------------------------------------------
+
+#if defined SINIX && defined GCC && defined C272
+const INetURLObject& SfxMedium::GetURLObject()
+{
+ if( !pURLObj )
+ {
+ pURLObj = new INetURLObject();
+ if ( GetName().Len() )
+ {
+ pURLObj->SetSmartProtocol( INET_PROT_FILE );
+ pURLObj->SetSmartURL( GetName() );
+ }
+ }
+ return *pURLObj;
+}
+#else
+const INetURLObject& SfxMedium::GetURLObject() const
+{
+ if( !pURLObj )
+ {
+ SfxMedium* pThis = (SfxMedium*)this;
+ pThis->pURLObj = new INetURLObject();
+ if ( GetName().Len() )
+ {
+ pThis->pURLObj->SetSmartProtocol( INET_PROT_FILE );
+ pThis->pURLObj->SetSmartURL( GetName() );
+ }
+ }
+ return *pURLObj;
+}
+#endif
+//----------------------------------------------------------------
+
+const String& SfxMedium::GetPreRedirectedURL() const
+{
+ return pImp->aPreRedirectionURL;
+}
+//----------------------------------------------------------------
+
+sal_uInt32 SfxMedium::GetMIMEAndRedirect( String &rName )
+{
+/* dv !!!! not needed any longer ?
+ INetProtocol eProt = GetURLObject().GetProtocol();
+ if( eProt == INET_PROT_FTP && SvBinding::ShouldUseFtpProxy( GetURLObject().GetMainURL() ) )
+ {
+ Any aAny( UCB_Helper::GetProperty( GetContent(), WID_FLAG_IS_FOLDER ) );
+ sal_Bool bIsFolder = FALSE;
+ if ( ( aAny >>= bIsFolder ) && bIsFolder )
+ return ERRCODE_NONE;
+ }
+
+ GetMedium_Impl();
+ if( !eError && pImp->xBinding.Is() )
+ {
+ eError = pImp->xBinding->GetMimeType( rName );
+
+ // Wir koennen keine Parameter wie CharSets usw.
+ rName = rName.GetToken( 0, ';' );
+ if( !eError )
+ {
+ if( !pImp->aPreRedirectionURL.Len() )
+ pImp->aPreRedirectionURL = aLogicName;
+ SetName( pImp->xBinding->GetRedirectedURL() );
+ }
+ pImp->aExpireTime = pImp->xBinding->GetExpireDateTime();
+ }
+ return eError;
+*/
+ return 0;
+}
+
+//----------------------------------------------------------------
+
+void SfxMedium::SetUsesCache( sal_Bool bUse )
+{
+ pImp->bUsesCache = bUse;
+}
+//----------------------------------------------------------------
+
+sal_Bool SfxMedium::UsesCache() const
+{
+ return pImp->bUsesCache;
+}
+//----------------------------------------------------------------
+
+//----------------------------------------------------------------
+
+void SfxMedium::SetReferer( const String& rRefer )
+{
+ pImp->aReferer = rRefer;
+}
+//----------------------------------------------------------------
+
+const String& SfxMedium::GetReferer( ) const
+{
+ return pImp->aReferer;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetTransferPriority( sal_uInt16 nPrio )
+{
+ pImp->nPrio = nPrio;
+}
+//----------------------------------------------------------------
+
+sal_uInt16 SfxMedium::GetTransferPriority( ) const
+{
+ return pImp->nPrio;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetExpired_Impl( const DateTime& rDateTime )
+{
+ pImp->aExpireTime = rDateTime;
+}
+//----------------------------------------------------------------
+
+sal_Bool SfxMedium::IsExpired() const
+{
+ return pImp->aExpireTime.IsValid() && pImp->aExpireTime < DateTime();
+}
+//----------------------------------------------------------------
+
+ErrCode SfxMedium::CheckOpenMode_Impl( sal_Bool bSilent, sal_Bool bAllowModeChange )
+{
+ sal_uInt32 nErr = 0;
+ switch( GetURLObject().GetProtocol() )
+ {
+ case INET_PROT_FILE:
+ {
+ Any aAny( UCB_Helper::GetProperty( GetContent(), WID_FLAG_IS_FOLDER ) );
+ sal_Bool bIsFolder = FALSE;
+ if ( ( aAny >>= bIsFolder ) && bIsFolder )
+ break;
+#if 0 // Don't use FSYS !!!!
+ // first check if file is a directory
+ if ( IsDirectory )
+ return ERRCODE_IO_NOTEXISTS;
+#endif
+ sal_Bool bTriesCopy(sal_False);
+ sal_Bool bReadOnly = GetOpenMode() == SFX_STREAM_READONLY;
+ if( !bReadOnly )
+ {
+ // Fuer MS und FL und Konsorten noch ueber die
+ // Dokumente huehnern wg. w95 Bug auf Netware-Servern
+ // bereits zum Schreiben ge"offnete Dokumente lassen sich
+ // nochmal zum Schreiben "offnen
+ for( SfxObjectShell* pFirst = SfxObjectShell::GetFirst();
+ pFirst; pFirst = SfxObjectShell::GetNext( *pFirst ) )
+ {
+ SfxMedium* pMed = pFirst->GetMedium();
+ if( pMed->GetName() == GetName() && pMed->GetOpenMode() != SFX_STREAM_READONLY )
+ {
+ // ggf. r/o oeffnen
+ if ( bAllowModeChange )
+ {
+ bReadOnly = sal_True;
+ GetItemSet()->Put( SfxBoolItem(SID_DOC_READONLY, sal_True));
+ SetOpenMode(SFX_STREAM_READONLY, sal_False);
+ }
+ else
+ nErr = ERRCODE_IO_ACCESSDENIED;
+ break;
+ }
+ }
+ }
+ while(1)
+ {
+ // erst der Zugriff auf den Storage erzeugt den Fehlercode
+ SvStorageRef aStor;
+ if ( IsStorage() )
+ aStor = GetStorage();
+ else
+ GetInStream();
+
+ if( aStor.Is() && bReadOnly && !bTriesCopy && !pImp->bIsTemp )
+ {
+ SfxApplication *pSfxApp = SFX_APP();
+ const SfxFilter* pFilter = pSfxApp->GetFilterMatcher().
+ GetFilter4ClipBoardId( aStor->GetFormat() );
+ if ( pFilter )
+ pFilter = pSfxApp->GetFilterMatcher().
+ ResolveRedirection( pFilter, *this );
+ // Eigenes Storageformat readonly per Kopie oeffnen
+ if( pFilter && pFilter->IsOwnFormat() )
+ {
+ nErr = ERRCODE_IO_ACCESSDENIED;
+ Close();
+ }
+ else nErr = GetError();
+ }
+ else nErr = GetError();
+ switch ( nErr )
+ {
+ default: return nErr;
+ case ERRCODE_IO_LOCKVIOLATION:
+ // Wg. Win95 Netware
+ case ERRCODE_IO_NOTEXISTS:
+ case ERRCODE_IO_ACCESSDENIED:
+ {
+ // Zur Zeit soll nicht nachgefragt werden
+ bSilent = sal_True;
+ if(!bReadOnly )
+ {
+ if( bAllowModeChange )
+ {
+ QueryBox aBox( 0, SfxResId(MSG_OPEN_READONLY) );
+ if ( bSilent || RET_YES == aBox.Execute() )
+ {
+ bReadOnly = sal_True;
+ if( GetItemSet() )
+ GetItemSet()->Put(
+ SfxBoolItem(SID_DOC_READONLY, sal_True));
+ SetOpenMode(SFX_STREAM_READONLY, sal_False);
+ ResetError();
+ }
+ else
+ return ERRCODE_ABORT;
+ }
+ else
+ return nErr;
+ }
+ else
+ {
+ if( !bTriesCopy )
+ {
+ String aOldName( aName );
+ CreateTempFile();
+ if ( !SfxContentHelper::CopyTo( aOldName, aName ) )
+ nErr = ERRCODE_IO_GENERAL;
+ ResetError();
+ pImp->bIsTemp = sal_True;
+ bTriesCopy = sal_True;
+ CloseInStream_Impl();
+ }
+ else
+ return nErr;
+ }
+ }
+ }
+ }
+ break;
+ }
+
+ case INET_PROT_DATA:
+ case INET_PROT_PRIVATE:
+ {
+ // Images und Docinfo nicht editieren
+ const INetURLObject& rObj = GetURLObject();
+ String aPath = rObj.GetURLPath();
+ if( rObj.GetProtocol() == INET_PROT_PRIVATE &&
+ aPath.CompareIgnoreCaseToAscii( "image/", 6 ) !=
+ COMPARE_EQUAL &&
+ aPath.CompareIgnoreCaseToAscii( "docinfo/", 8 ) !=
+ COMPARE_EQUAL &&
+ aPath.CompareIgnoreCaseToAscii( "info/", 5 ) !=
+ COMPARE_EQUAL )
+ return 0;
+
+ if( GetOpenMode() & STREAM_WRITE )
+ {
+ if( bAllowModeChange )
+ SetOpenMode(SFX_STREAM_READONLY, sal_False);
+ else
+ return ERRCODE_IO_ACCESSDENIED;
+ }
+ }
+ }
+ return nErr;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::ForceSynchronStream_Impl( sal_Bool bForce )
+{
+ if( pInStream )
+ {
+ SvLockBytes* pBytes = pInStream->GetLockBytes();
+ if( pBytes )
+ pBytes->SetSynchronMode( bForce );
+ }
+ pImp->bForceSynchron = bForce;
+}
+//----------------------------------------------------------------
+/* Kann der URL ein MIME Type zugeordnent werden? */
+sal_Bool SfxMedium::SupportsMIME_Impl() const
+{
+ INetProtocol eProt = GetURLObject().GetProtocol();
+ if( eProt == INET_PROT_HTTPS || eProt == INET_PROT_HTTP )
+ return sal_True;
+
+ if( eProt == INET_PROT_NOT_VALID )
+ return sal_False;
+
+ if( eProt == INET_PROT_FTP )
+ {
+ Any aAny( UCB_Helper::GetProperty( GetContent(), WID_FLAG_IS_FOLDER ) );
+ sal_Bool bIsFolder = FALSE;
+ if ( ( aAny >>= bIsFolder ) && bIsFolder )
+ return SvBinding::ShouldUseFtpProxy( GetURLObject().GetMainURL() );
+ else
+ return sal_False;
+ }
+
+ return sal_False;
+}
+
+sal_Bool SfxMedium::IsAllowedForExternalBrowser() const
+{
+ if ( pFilter && !pFilter->GetFilterName().EqualsAscii( "ExternBrowser" ) )
+ return sal_False;
+
+ sal_Bool bCheckExternBrowser = SFX_APP()->ShouldUseExternalBrowser( aLogicName );
+ if ( bCheckExternBrowser )
+ {
+ // Wenn Reload eines mit dem Office geladenen Dokuments gemacht wird oder nicht readonly geladen wird,
+ // soll kein externer Browser benutzt werden
+ SFX_ITEMSET_ARG( GetItemSet(), pReloadItem, SfxBoolItem, SID_RELOAD, sal_False );
+ SFX_ITEMSET_ARG( GetItemSet(), pReadonlyItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
+ SFX_ITEMSET_ARG( GetItemSet(), pHidden, SfxBoolItem, SID_HIDDEN, sal_False);
+ if ( pReloadItem || ( pReadonlyItem && !pReadonlyItem->GetValue() ) || pHidden && pHidden->GetValue() )
+ bCheckExternBrowser = sal_False;
+ }
+
+ return bCheckExternBrowser;
+}
+
+//----------------------------------------------------------------
+
+/* Kann der URL eine lokale Datei zugeordnet werden? */
+
+sal_Bool SfxMedium::ProvidesFile_Impl() const
+{
+ INetProtocol eProt = GetURLObject().GetProtocol();
+ return eProt == INET_PROT_FILE;
+}
+//----------------------------------------------------------------
+
+/* Liefert die ::com::sun::star::util::URL direkt einen Storage oder Stream? Hierzu z"ahlen
+ nicht Executable Filter, die ja erst in der n"achsten Runde einen
+ Stream liefern */
+
+sal_Bool SfxMedium::ProvidesData_Impl() const
+{
+ // perhaps this medium was constructed for an embedded object
+ if ( aStorage.Is() )
+ return sal_True;
+
+ if( pFilter )
+ {
+ if ( pFilter->GetFilterContainer()->GetName().EqualsAscii( "plugin" ) )
+ return sal_True;
+
+ if ( ( pFilter->GetFilterFlags() & SFX_FILTER_EXECUTABLE ) || pFilter->GetFilterName().EqualsAscii( SFX_FILTER_DOWNLOAD ) )
+ return sal_False;
+ }
+ else
+ {
+ const SfxFilter* pProtoFilter = SFX_APP()->GetFilterMatcher().GetFilter4Protocol( *(SfxMedium*)this );
+ if( pProtoFilter && (pProtoFilter->GetFilterFlags() & SFX_FILTER_EXECUTABLE ) )
+ return sal_False;
+ }
+
+ INetProtocol eProt;
+ if ( GetContent().is() )
+ {
+ const INetURLObject& aObj= GetURLObject();
+ eProt = aObj.GetProtocol();
+ if ( INET_PROT_FTP == eProt )
+ {
+#if 0 // (dv)
+ const String &rUrl = aObj.GetMainURL();
+ CntINetConfig::load (NULL, NULL);
+ INetProxyConfig aProxyConfig;
+ if (CntINetConfig::shouldUseProxy (NULL, rUrl, aProxyConfig))
+ if (aProxyConfig.hasFtpProxy())
+#endif
+ return sal_True;
+ }
+ else if( eProt == INET_PROT_HTTPS || eProt == INET_PROT_HTTP )
+ return sal_True;
+
+ Any aAny( UCB_Helper::GetProperty( GetContent(), WID_FLAG_IS_FOLDER ) );
+ sal_Bool bIsFolder = FALSE;
+ if ( ( aAny >>= bIsFolder ) && bIsFolder )
+ return sal_False;
+ }
+ else
+ eProt = GetURLObject().GetProtocol();
+
+ if ( eProt == INET_PROT_FILE )
+ {
+ if ( aLogicName.Search('{') != STRING_NOTFOUND )
+ return sal_False;
+ else
+ return sal_True;
+ }
+ else if ( INET_PROT_FTP == eProt )
+ return sal_True;
+ else if ( eProt == INET_PROT_NOT_VALID )
+ return sal_False;
+
+ return sal_False;
+}
+
+//----------------------------------------------------------------
+SfxFrame* SfxMedium::GetLoadTargetFrame() const
+{
+ return pImp->wLoadTargetFrame;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetLoadTargetFrame(SfxFrame* pFrame )
+{
+ pImp->wLoadTargetFrame = pFrame;
+}
+//----------------------------------------------------------------
+
+SvStream* SfxMedium::RemoveStream_Impl()
+{
+ SvStream* pRet = GetInStream();
+ pInStream = 0;
+ return pRet;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetStream_Impl( SvStream* pStrm )
+{
+ CloseInStream_Impl();
+ pInStream = pStrm;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetStorage_Impl( SvStorage* pStor )
+{
+ aStorage = pStor;
+}
+//----------------------------------------------------------------
+
+SfxItemSet* SfxMedium::GetItemSet() const
+{
+ if( !pSet ) ((SfxMedium*)this)->pSet =
+ new SfxAllItemSet( SFX_APP()->GetPool() );
+ return pSet;
+}
+//----------------------------------------------------------------
+
+void SfxMedium::SetLoadEnvironment_Impl( LoadEnvironment_Impl* pEnv )
+{
+ pImp->pLoadEnv = pEnv;
+}
+//----------------------------------------------------------------
+
+LoadEnvironment_Impl* SfxMedium::GetLoadEnvironment_Impl() const
+{
+ return pImp->pLoadEnv;
+}
+//----------------------------------------------------------------
+
+SvKeyValueIterator* SfxMedium::GetHeaderAttributes_Impl()
+{
+ if( !pImp->xAttributes.Is() )
+/*!!!! if ( pImp->xBinding.Is() )
+ pImp->xAttributes = pImp->xBinding->GetHeaders();
+ else
+*/ pImp->xAttributes = SvKeyValueIteratorRef( new SvKeyValueIterator );
+
+ return pImp->xAttributes;
+}
+//----------------------------------------------------------------
+
+SvCompatWeakHdl* SfxMedium::GetHdl()
+{
+ return pImp->GetHdl();
+}
+
+sal_Bool SfxMedium::IsDownloadDone_Impl()
+{
+ return pImp->bDownloadDone;
+}
+
+SvEaMgr* SfxMedium::GetEaMgr()
+{
+ if ( !pImp->pEaMgr && ProvidesData_Impl() && pFilter )
+ {
+ /* the stream in the storage is probably not a filestream ( the stream is
+ closed anyway! ). Therefor we will always use GetPhysicalName to
+ create the SvEaMgr. */
+ // SvStream *pStream = aStorage.Is() ? aStorage->GetTargetSvStream() : NULL;
+ // if ( pStream && pStream->IsA() == ID_FILESTREAM )
+ // pImp->pEaMgr = new SvEaMgr(*(SvFileStream *)pStream);
+ // else
+ pImp->pEaMgr = new SvEaMgr( GetPhysicalName() );
+ }
+
+ return pImp->pEaMgr;
+}
+
+//----------------------------------------------------------------
+
+void SfxMedium::SetDontCreateCancellable( )
+{
+ pImp->bDontCreateCancellable = sal_True;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > SfxMedium::GetDataSource()
+{
+ if ( !pImp->pSource )
+ CreateDataSource();
+ return pImp->pSource;
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > SfxMedium::GetDataSink()
+{
+ if ( !pImp->pSink )
+ CreateDataSink();
+ return pImp->pSink;
+}
+
+void SfxMedium::CreateDataSource()
+{
+ if ( ProvidesData_Impl() )
+ {
+ SfxLoadEnvironment *pEnv = NULL;
+ if ( pImp->pLoadEnv )
+ {
+ pEnv = new SfxLoadEnvironment( pImp->pLoadEnv );
+ SfxRefItem aItem( SID_LOADENVIRONMENT, pEnv );
+ GetItemSet()->Put( aItem );
+ }
+
+ pImp->pSource = new FileSource_Impl( this );
+ pImp->pSource->acquire();
+ if ( pEnv )
+ pEnv->SetDataAvailableLink( LINK( pImp->pSource, FileSource_Impl, DataAvailableHdl ) );
+ }
+}
+
+void SfxMedium::CreateDataSink()
+{
+ pImp->pSink = new FileSink_Impl( this );
+ pImp->pSink->acquire();
+}
+
+void SfxMedium::ResetDataSource()
+{
+ if ( pImp->pSource )
+ {
+ pImp->pSource->ResetMedium();
+ pImp->pSource->release();
+ }
+}
+
+void SfxMedium::ResetDataSink()
+{
+ if ( pImp->pSink )
+ {
+ pImp->pSink->ResetMedium();
+ pImp->pSink->release();
+ }
+}
+
+const SfxVersionTableDtor* SfxMedium::GetVersionList()
+{
+ if ( !pImp->pVersions && IsStorage() )
+ {
+ SvStorageStreamRef aStream =
+ GetStorage()->OpenStream( DEFINE_CONST_UNICODE( "VersionList" ), SFX_STREAM_READONLY | STREAM_NOCREATE );
+ if ( aStream.Is() && aStream->GetError() == SVSTREAM_OK )
+ {
+ pImp->pVersions = new SfxVersionTableDtor;
+ pImp->pVersions->Read( *aStream );
+ }
+ }
+
+ return pImp->pVersions;
+}
+
+sal_uInt16 SfxMedium::AddVersion_Impl( SfxVersionInfo& rInfo )
+{
+ if ( IsStorage() )
+ {
+ if ( !pImp->pVersions )
+ pImp->pVersions = new SfxVersionTableDtor;
+
+ // Einen eindeutigen Namen f"ur den Stream ermitteln
+ SvULongs aLongs;
+ SfxVersionInfo* pInfo = pImp->pVersions->First();
+ while ( pInfo )
+ {
+ sal_uInt32 nVer = (sal_uInt32) pInfo->aName.Copy(7).ToInt32();
+ sal_uInt16 n;
+ for ( n=0; n<aLongs.Count(); n++ )
+ if ( nVer<aLongs[n] )
+ break;
+
+ aLongs.Insert( nVer, n );
+ pInfo = pImp->pVersions->Next();
+ }
+
+ sal_uInt16 nKey;
+ for ( nKey=0; nKey<aLongs.Count(); nKey++ )
+ if ( aLongs[nKey] > nKey+1 )
+ break;
+
+ rInfo.aName = DEFINE_CONST_UNICODE( "Version" );
+ rInfo.aName += String::CreateFromInt32( nKey + 1 );
+ pInfo = new SfxVersionInfo( rInfo );
+ pImp->pVersions->Insert( pInfo, LIST_APPEND );
+ return nKey;
+ }
+
+ return 0;
+}
+
+sal_Bool SfxMedium::RemoveVersion_Impl( const SfxVersionInfo& rInfo )
+{
+ if ( !pImp->pVersions )
+ return sal_False;
+
+ SfxVersionInfo* pInfo = pImp->pVersions->First();
+ while( pInfo )
+ {
+ if ( pInfo->aName == rInfo.aName )
+ {
+ pImp->pVersions->Remove( pInfo );
+ delete pInfo;
+ return sal_True;
+ }
+
+ pInfo = pImp->pVersions->Next();
+ }
+
+ return sal_False;
+}
+
+sal_Bool SfxMedium::TransferVersionList_Impl( SfxMedium& rMedium )
+{
+ if ( rMedium.pImp->pVersions )
+ {
+ delete pImp->pVersions;
+ pImp->pVersions = new SfxVersionTableDtor( *rMedium.pImp->pVersions );
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+sal_Bool SfxMedium::SaveVersionList_Impl()
+{
+ if ( IsStorage() )
+ {
+ if ( !pImp->pVersions )
+ return sal_True;
+
+ SvStorageStreamRef aStream =
+ GetStorage()->OpenStream( DEFINE_CONST_UNICODE( "Version.Ist" ), SFX_STREAM_READWRITE );
+ if ( aStream.Is() && aStream->GetError() == SVSTREAM_OK )
+ {
+ pImp->pVersions->Write( *aStream );
+ return sal_True;
+ }
+ }
+
+ return sal_False;
+}
+
+//----------------------------------------------------------------
+sal_Bool SfxMedium::IsReadOnly()
+{
+ sal_Bool bReadOnly = !( GetOpenMode() & STREAM_WRITE );
+/*(dv) if ( bReadOnly && pURLObj && CntAnchor::IsViewURL( pURLObj->GetMainURL() ) )
+ // Chaos-Storages sind niemals als readonly anzusehen!
+ return sal_False;
+*/
+ if ( !bReadOnly )
+ {
+ // lo.Isch readonly ge"offnet
+ SFX_ITEMSET_ARG( GetItemSet(), pItem, SfxBoolItem, SID_DOC_READONLY, sal_False);
+ if ( pItem )
+ bReadOnly = pItem->GetValue();
+ }
+
+ return bReadOnly;
+}
+
+//----------------------------------------------------------------
+void SfxMedium::CreateTempFile()
+{
+ if ( pImp->pTempFile )
+ delete pImp->pTempFile;
+
+ String aParentName;
+ INetURLObject aParent = GetURLObject();
+
+ if ( aParent.removeSegment() )
+ aParentName = aParent.GetMainURL();
+
+ pImp->pTempFile = new TempFile( &aParentName );
+ pImp->pTempFile->EnableKillingFile( sal_True );
+
+ aName = pImp->pTempFile->GetName();
+
+ CloseOutStream_Impl();
+ CloseStorage();
+}
+
+//----------------------------------------------------------------
+#define nActVersion 1
+
+SvStream& SfxVersionTableDtor::Read( SvStream& rStrm )
+{
+ sal_uInt16 nCount = 0, nVersion = 0;
+
+ rStrm >> nVersion;
+ rStrm >> nCount;
+
+ for( sal_uInt16 i=0; i<nCount; ++i )
+ {
+ SfxVersionInfo *pNew = new SfxVersionInfo;
+ rStrm.ReadByteString( pNew->aComment, RTL_TEXTENCODING_UTF8 );
+ rStrm.ReadByteString( pNew->aName, RTL_TEXTENCODING_UTF8 );
+ pNew->aCreateStamp.Load( rStrm );
+ Insert( pNew, LIST_APPEND );
+ }
+
+ return rStrm;
+}
+
+SvStream& SfxVersionTableDtor::Write( SvStream& rStream ) const
+{
+ rStream << (sal_uInt16) nActVersion;
+ rStream << (sal_uInt16) Count();
+
+ SfxVersionInfo* pInfo = ((SfxVersionTableDtor*)this)->First();
+ while( pInfo && rStream.GetError() == SVSTREAM_OK )
+ {
+ rStream.WriteByteString( pInfo->aComment, RTL_TEXTENCODING_UTF8 );
+ rStream.WriteByteString( pInfo->aName, RTL_TEXTENCODING_UTF8 );
+ pInfo->aCreateStamp.Save( rStream );
+ pInfo = ((SfxVersionTableDtor*)this)->Next();
+ }
+
+ return rStream;
+}
+
+void SfxVersionTableDtor::DelDtor()
+{
+ SfxVersionInfo* pTmp = First();
+ while( pTmp )
+ {
+ delete pTmp;
+ pTmp = Next();
+ }
+ Clear();
+}
+
+SfxVersionTableDtor& SfxVersionTableDtor::operator=( const SfxVersionTableDtor& rTbl )
+{
+ DelDtor();
+ SfxVersionInfo* pTmp = ((SfxVersionTableDtor&)rTbl).First();
+ while( pTmp )
+ {
+ SfxVersionInfo *pNew = new SfxVersionInfo( *pTmp );
+ Insert( pNew, LIST_APPEND );
+ pTmp = ((SfxVersionTableDtor&)rTbl).Next();
+ }
+ return *this;
+}
+
+//----------------------------------------------------------------
+//----------------------------------------------------------------
+//----------------------------------------------------------------
+SfxVersionInfo::SfxVersionInfo()
+{
+}
+
+SvStringsDtor* SfxVersionTableDtor::GetVersions() const
+{
+ SvStringsDtor *pList = new SvStringsDtor;
+ SfxVersionInfo* pInfo = ((SfxVersionTableDtor*) this)->First();
+ while ( pInfo )
+ {
+ String *pString = new String( pInfo->aComment );
+ (*pString) += DEFINE_CONST_UNICODE( "; " );
+ (*pString) += ConvertDateTime_Impl( pInfo->aCreateStamp );
+ pList->Insert( pString, pList->Count() );
+ pInfo = ((SfxVersionTableDtor*) this)->Next();
+ }
+
+ return pList;
+}
+
+//----------------------------------------------------------------
+//----------------------------------------------------------------
+//----------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxDataSourceFactory::createInstance(const ::rtl::OUString& ServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+ INetProtocol eProt = INetURLObject::CompareProtocolScheme( U2S( ServiceSpecifier ) );
+ switch ( eProt )
+ {
+ case INET_PROT_FTP :
+ case INET_PROT_HTTP :
+ case INET_PROT_FILE :
+ case INET_PROT_HTTPS :
+ case INET_PROT_NEWS :
+ case INET_PROT_PRIV_SOFFICE :
+ case INET_PROT_IMAP :
+ case INET_PROT_POP3 :
+ case INET_PROT_VIM :
+ break;
+ default:
+ return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ();
+ break;
+ }
+
+ return (::cppu::OWeakObject*) new FileSource_Impl;
+}
+
+SFX_IMPL_XINTERFACE_2( SfxDataSourceFactory, OWeakObject, ::com::sun::star::lang::XMultiServiceFactory, ::com::sun::star::lang::XServiceInfo )
+SFX_IMPL_XTYPEPROVIDER_2( SfxDataSourceFactory, ::com::sun::star::lang::XMultiServiceFactory, ::com::sun::star::lang::XServiceInfo )
+SFX_IMPL_XSERVICEINFO( SfxDataSourceFactory, "com.sun.star.frame.DataSourceFactory", "com.sun.star.comp.sfx2.DataSourceFactory" )
+SFX_IMPL_SINGLEFACTORY( SfxDataSourceFactory )
+
+SfxDataSourceFactory::SfxDataSourceFactory( com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory> const & )
+{
+ DBG_ERRORFILE( "NIJ!" );
+}
+
+SfxDataSourceFactory::~SfxDataSourceFactory()
+{
+}
+
+::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SfxDataSourceFactory::createInstanceWithArguments(const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
+{
+ INetProtocol eProt = INetURLObject::CompareProtocolScheme( U2S( ServiceSpecifier ) );
+ switch ( eProt )
+ {
+ case INET_PROT_FTP :
+ case INET_PROT_HTTP :
+ case INET_PROT_FILE :
+ case INET_PROT_HTTPS :
+ case INET_PROT_NEWS :
+ case INET_PROT_PRIV_SOFFICE :
+ case INET_PROT_IMAP :
+ case INET_PROT_POP3 :
+ case INET_PROT_VIM :
+ break;
+ default:
+ return ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ();
+ break;
+ }
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet;
+ FileSource_Impl* pSource = new FileSource_Impl();
+ xRet = (::cppu::OWeakObject*) pSource;
+ pSource->initialize( Arguments );
+ return xRet;
+}
+
+::com::sun::star::uno::Sequence< ::rtl::OUString > SfxDataSourceFactory::getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aRet(9);
+ ::rtl::OUString *pArr = aRet.getArray();
+ pArr[0] = DEFINE_CONST_UNICODE( "ftp:" );
+ pArr[1] = DEFINE_CONST_UNICODE( "http:" );
+ pArr[2] = DEFINE_CONST_UNICODE( "https:" );
+ pArr[3] = DEFINE_CONST_UNICODE( "file:" );
+ pArr[4] = DEFINE_CONST_UNICODE( "news:" );
+ pArr[5] = DEFINE_CONST_UNICODE( "staroffice.private:" );
+ pArr[6] = DEFINE_CONST_UNICODE( "imap:" );
+ pArr[7] = DEFINE_CONST_UNICODE( "pop3:" );
+ pArr[8] = DEFINE_CONST_UNICODE( "vim:" );
+
+ return aRet;
+}
+
+#if SUPD<604
+void SfxMedium::SetReloadAvailableLink( const Link& rLink )
+{
+}
+#endif
+
+
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
new file mode 100644
index 000000000000..e1d9edc6f42a
--- /dev/null
+++ b/sfx2/source/doc/docfilt.cxx
@@ -0,0 +1,322 @@
+/*************************************************************************
+ *
+ * $RCSfile: docfilt.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// INCLUDE ---------------------------------------------------------------
+
+#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+
+#ifndef _EXCHANGE_HXX //autogen
+#include <vcl/exchange.hxx>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINMODE_HPP_
+#include <com/sun/star/plugin/PluginMode.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINDESCRIPTION_HPP_
+#include <com/sun/star/plugin/PluginDescription.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINEXCEPTION_HPP_
+#include <com/sun/star/plugin/PluginException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_PLUGINVARIABLE_HPP_
+#include <com/sun/star/plugin/PluginVariable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_XPLUGIN_HPP_
+#include <com/sun/star/plugin/XPlugin.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_XPLUGINMANAGER_HPP_
+#include <com/sun/star/plugin/XPluginManager.hpp>
+#endif
+#ifndef _COM_SUN_STAR_PLUGIN_XPLUGINCONTEXT_HPP_
+#include <com/sun/star/plugin/XPluginContext.hpp>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include <unotools/processfactory.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "docfac.hxx"
+#include "docfilt.hxx"
+#include "fltfnc.hxx"
+#include "app.hxx"
+#include "sfxresid.hxx"
+#include "doc.hrc"
+#include "sfxuno.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxFilter);
+
+SfxFilter::SfxFilter( const String &rName,
+ const String &rWildCard,
+ SfxFilterFlags nType,
+ sal_uInt32 lFmt,
+ const String &rMacTyp,
+ const String &rTypNm,
+ sal_uInt16 nIcon,
+ const String &rMimeType,
+ const SfxFilterContainer* pContainerP,
+ const String &rUsrDat ):
+ lFormat(lFmt),
+ nFormatType(nType),
+ aWildCard(rWildCard, ';'),
+ aMacType(rMacTyp),
+ aTypeName(rTypNm),
+ nDocIcon(nIcon),
+ aUserData(rUsrDat),
+ aName( rName ),
+ aMimeType( rMimeType ),
+ aFilterName( rName ),
+ pContainer( pContainerP )
+{
+ InitMembers_Impl();
+ pContainer = pContainerP;
+ aFilterName = rName;
+ aMimeType = rMimeType;
+}
+
+
+SfxFilter::SfxFilter( const char* pName, const String &rWildCard,
+ SfxFilterFlags nType,
+ const SfxFilterContainer* pContainerP )
+ : lFormat(0),
+ nFormatType(nType),
+ aWildCard(rWildCard, ';'),
+ nDocIcon(0),
+ pContainer( pContainerP )
+{
+ aName = String::CreateFromAscii( pName );
+ aFilterName = String::CreateFromAscii( pName );
+ InitMembers_Impl();
+ pContainer = pContainerP;
+}
+
+SfxFilter::SfxFilter( const char* pName, const String &rWildCard,
+ SfxFilterFlags nType, const String &rTypeName,
+ const SfxFilterContainer* pContainerP )
+ : lFormat(0),
+ nFormatType(nType),
+ aWildCard(rWildCard, ';'),
+ aTypeName( rTypeName ),
+ nDocIcon(0),
+ pContainer( pContainerP )
+{
+ aName = String::CreateFromAscii( pName );
+ aFilterName = String::CreateFromAscii( pName );
+ InitMembers_Impl();
+ pContainer = pContainerP;
+}
+
+void SfxFilter::InitMembers_Impl()
+{
+ String aExts = GetWildcard()();
+ String aShort, aLong;
+ String aRet;
+ sal_uInt16 nMaxLength =
+#if defined( WIN ) || defined( OS2 )
+ 3
+#else
+ USHRT_MAX
+#endif
+ ;
+ String aTest;
+ sal_uInt16 nPos = 0;
+ while( ( aRet = aExts.GetToken( nPos++, ';' ) ).Len() )
+ {
+ aTest = aRet;
+ aTest.SearchAndReplace( DEFINE_CONST_UNICODE( "*." ), String() );
+ if( aTest.Len() <= nMaxLength )
+ {
+ if( aShort.Len() ) aShort += ';';
+ aShort += aRet;
+ }
+ else
+ {
+ if( aLong.Len() ) aLong += ';';
+ aLong += aRet;
+ }
+ }
+ if( aShort.Len() && aLong.Len() )
+ {
+ aShort += ';';
+ aShort += aLong;
+ }
+ aWildCard = aShort;
+
+ nVersion = SOFFICE_FILEFORMAT_NOW;
+ bPlugDataSearched = 0;
+ pPlugData = 0;
+
+ aName = pContainer->GetName();
+ aName += DEFINE_CONST_UNICODE( ": " );
+ aName += aFilterName;
+
+ aUIName = aFilterName;
+}
+
+SfxFilter::~SfxFilter()
+{
+ delete pPlugData;
+}
+
+const String& SfxFilter::GetTypeName() const
+{
+ return
+#ifdef MAC
+ aMacType;
+#else
+ aTypeName;
+#endif
+}
+
+const ::com::sun::star::plugin::PluginDescription* SfxFilter::GetPlugData()
+{
+ if( !bPlugDataSearched )
+ {
+ bPlugDataSearched = sal_True;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::plugin::XPluginManager >
+ xPlugMgr( xMan->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.plugin.PluginManager" ) ), ::com::sun::star::uno::UNO_QUERY );
+ DBG_ASSERT( xPlugMgr.is(), "### cannot create instance com.sun.star.plugin.PluginManager!" );
+ if( xPlugMgr.is() )
+ {
+ ::com::sun::star::uno::Sequence < ::com::sun::star::plugin::PluginDescription > aDescr = xPlugMgr->getPluginDescriptions();
+ const ::com::sun::star::plugin::PluginDescription *pArr = aDescr.getConstArray();
+ sal_uInt16 n;
+ for (n=0; n<aDescr.getLength(); n++ )
+ {
+ const ::com::sun::star::plugin::PluginDescription& rData = pArr[n];
+ String aTest = rData.Description;
+ aTest += DEFINE_CONST_UNICODE( " (PlugIn)" );
+ if( aTest == GetFilterName() )
+ break;
+ }
+
+ const ::com::sun::star::plugin::PluginDescription& rData = pArr[n];
+ ::com::sun::star::plugin::PluginDescription *pPlug = new ::com::sun::star::plugin::PluginDescription;
+ pPlug->PluginName = rData.PluginName;
+ pPlug->Mimetype = rData.Mimetype;
+ pPlug->Extension = rData.Extension;
+ pPlug->Description = rData.Description;
+
+ pPlugData = pPlug;
+ }
+ }
+
+ return pPlugData;
+}
+
+sal_Bool SfxFilter::IsFirstPlugin() const
+{
+ const ::com::sun::star::plugin::PluginDescription* pData = GetPlugData();
+ if( pData )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::plugin::XPluginManager >
+ xPlugMgr( xMan->createInstance( DEFINE_CONST_UNICODE( "com.sun.star.plugin.PluginManager" ) ), ::com::sun::star::uno::UNO_QUERY );
+ DBG_ASSERT( xPlugMgr.is(), "### cannot create instance com.sun.star.plugin.PluginManager!" );
+ if( xPlugMgr.is() )
+ {
+ ::com::sun::star::uno::Sequence < ::com::sun::star::plugin::PluginDescription > aDescr = xPlugMgr->getPluginDescriptions();
+ String aPlug;
+ const ::com::sun::star::plugin::PluginDescription *pArr = aDescr.getConstArray();
+ String aTest;
+ for ( sal_uInt16 n=0; n<aDescr.getLength(); n++ )
+ {
+ if( pArr[n].Description == pData->Description )
+ return sal_True;
+ else if( pArr[n].PluginName == pData->PluginName )
+ return sal_False;
+ }
+ }
+ }
+ return sal_False;
+}
+
+
+String SfxFilter::GetDefaultExtension() const
+{
+ return GetWildcard()().GetToken( 0, ';' );
+}
+
+
+String SfxFilter::GetSuffixes() const
+{
+ String aRet = GetWildcard()();
+ while( aRet.SearchAndReplaceAscii( "*.", String() ) != STRING_NOTFOUND );
+ while( aRet.SearchAndReplace( ';', ',' ) != STRING_NOTFOUND );
+ return aRet;
+}
+
+SfxOfficeFilter::SfxOfficeFilter( const SfxFilterContainer* pContainer ) :
+ SfxFilter(
+ String( SfxResId( RID_OFFICEFILTER ) ),
+ String( SfxResId( RID_OFFICEFILTER_WILDCARD ) ),
+ SFX_FILTER_IMPORT | SFX_FILTER_REDIRECT | SFX_FILTER_NOTINCHOOSER,
+ Exchange::RegisterFormatName( DEFINE_CONST_UNICODE("OfficeDocument") ),
+ String( SfxResId( RID_OFFICEFILTER_MACTYPE ) ),
+ String( SfxResId( RID_OFFICEFILTER_OS2TYPE ) ),
+ 0, String(), pContainer, String() )
+{
+}
+
+
diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
new file mode 100644
index 000000000000..82dd58b1fd12
--- /dev/null
+++ b/sfx2/source/doc/docinf.cxx
@@ -0,0 +1,1521 @@
+/*************************************************************************
+ *
+ * $RCSfile: docinf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _BIGINT_HXX //autogen wg. BigInt
+#include <tools/bigint.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#pragma hdrstop
+
+#include "docfilt.hxx"
+#include "fcontnr.hxx"
+#include "openflag.hxx"
+#include "app.hxx"
+#include "docinf.hxx"
+#include "docfile.hxx"
+#include "saveopt.hxx"
+#include "inimgr.hxx"
+#include "sfxtypes.hxx"
+
+//========================================================================
+
+static const char __FAR_DATA pDocInfoSlot[] = "SfxDocumentInfo";
+static const char __FAR_DATA pPropSlot[] = "\005SummaryInformation";
+static const char __FAR_DATA pDocInfoHeader[] = "SfxDocumentInfo";
+#define VERSION 11
+#define STREAM_BUFFER_SIZE 2048
+
+#define VT_I4 3
+#define VT_LPSTR 30
+#define VT_FILETIME 64
+
+#define PID_TITLE 0x02
+#define PID_SUBJECT 0x03
+#define PID_AUTHOR 0x04
+#define PID_KEYWORDS 0x05
+#define PID_COMMENTS 0x06
+#define PID_TEMPLATE 0x07
+#define PID_LASTAUTHOR 0x08
+#define PID_REVNUMBER 0x09
+#define PID_EDITTIME 0x0a
+#define PID_LASTPRINTED_DTM 0x0b
+#define PID_CREATE_DTM 0x0c
+#define PID_LASTSAVED_DTM 0x0d
+
+//=========================================================================
+
+IMPL_PTRHINT(SfxDocumentInfoHint, SfxDocumentInfo)
+
+//=========================================================================
+
+class SfxPSProperty_Impl
+{
+private:
+ UINT32 nId;
+ UINT32 nType;
+
+public:
+ SfxPSProperty_Impl( UINT32 nIdP, UINT32 nTypeP ) : nId( nIdP ), nType( nTypeP ) {}
+ virtual ~SfxPSProperty_Impl();
+
+ virtual ULONG Save( SvStream& rStream ) = 0;
+ virtual ULONG Load( SvStream& rStream );
+ virtual ULONG Len() = 0;
+
+ UINT32 GetId() const { return nId; }
+ UINT32 GetType() const { return nType; }
+};
+
+//-------------------------------------------------------------------------
+
+SfxPSProperty_Impl::~SfxPSProperty_Impl()
+{
+}
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSProperty_Impl::Load( SvStream& )
+{
+ return 0;
+}
+
+//=========================================================================
+
+class SfxPSStringProperty_Impl : public SfxPSProperty_Impl
+{
+private:
+ String aString;
+
+public:
+ SfxPSStringProperty_Impl( UINT32 nIdP, const String& aStr ) :
+ aString(aStr), SfxPSProperty_Impl( nIdP, VT_LPSTR ) {}
+ SfxPSStringProperty_Impl( UINT32 nIdP ) :
+ SfxPSProperty_Impl( nIdP, VT_LPSTR ) {}
+
+ virtual ULONG Save( SvStream& rStream );
+ virtual ULONG Load( SvStream& rStream );
+ virtual ULONG Len();
+
+ const String& GetString() { return aString; }
+};
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSStringProperty_Impl::Save( SvStream& rStream )
+{
+ ByteString aTemp( aString, rStream.GetStreamCharSet() );
+ UINT32 nLen = aTemp.Len();
+ rStream << (UINT32)( nLen + 1 );
+ rStream.Write( aTemp.GetBuffer(), nLen );
+ rStream << '\0';
+ return rStream.GetErrorCode();
+}
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSStringProperty_Impl::Load( SvStream& rStream )
+{
+ UINT32 nLen;
+ rStream >> nLen;
+ ByteString aTemp;
+ rStream.Read( aTemp.AllocBuffer( (xub_StrLen)( nLen - 1 ) ), nLen );
+ aString = String( aTemp, rStream.GetStreamCharSet() );
+ return rStream.GetErrorCode();
+}
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSStringProperty_Impl::Len()
+{
+ return aString.Len() + 5;
+}
+
+//=========================================================================
+
+class SfxDocumentInfo_Impl
+{
+public:
+ String aCopiesTo;
+ String aOriginal;
+ String aReferences;
+ String aRecipient;
+ String aReplyTo;
+ String aBlindCopies;
+ String aInReplyTo;
+ String aNewsgroups;
+ String aSpecialMimeType;
+ USHORT nPriority;
+ BOOL bUseUserData;
+
+ SfxDocumentInfo_Impl() : nPriority( 0 ), bUseUserData( 1 ) {}
+};
+
+//=========================================================================
+
+class SfxPSUINT32Property_Impl : public SfxPSProperty_Impl
+{
+private:
+ UINT32 aInt;
+
+ public:
+ SfxPSUINT32Property_Impl( UINT32 nIdP, UINT32 aIntP ) :
+ aInt( aIntP ), SfxPSProperty_Impl( nIdP, VT_I4 ) {}
+
+ virtual ULONG Save( SvStream& rStream );
+ virtual ULONG Len();
+};
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSUINT32Property_Impl::Save( SvStream& rStream )
+{
+ rStream << aInt;
+ return rStream.GetErrorCode();
+}
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSUINT32Property_Impl::Len()
+{
+ return 4;
+}
+
+//=========================================================================
+
+class SfxPSDateTimeProperty_Impl : public SfxPSProperty_Impl
+{
+private:
+ DateTime aDateTime;
+
+public:
+ SfxPSDateTimeProperty_Impl( UINT32 nIdP, const DateTime& rDateTime ) :
+ aDateTime( rDateTime ), SfxPSProperty_Impl( nIdP, VT_FILETIME ) {}
+ SfxPSDateTimeProperty_Impl( UINT32 nIdP ) :
+ SfxPSProperty_Impl( nIdP, VT_FILETIME ) {};
+
+ virtual ULONG Save( SvStream& rStream );
+ virtual ULONG Load( SvStream& rStream );
+ virtual ULONG Len();
+
+ const DateTime& GetDateTime() { return aDateTime; }
+};
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSDateTimeProperty_Impl::Save(SvStream &rStream)
+{
+ // Nicht Valid ist das gleiche, wie bei MS, nur nicht konvertiert
+ if( aDateTime.IsValid() )
+ aDateTime.ConvertToUTC();
+ BigInt a100nPerSecond(10000000L);
+ BigInt a100nPerDay=a100nPerSecond*BigInt(60L*60*24);
+ USHORT nYears=aDateTime.GetYear()-1601;
+ long nDays=
+ nYears*365+nYears/4-nYears/100+nYears/400+
+ aDateTime.GetDayOfYear()-1;
+ BigInt aTime=
+ a100nPerDay*BigInt(nDays)+a100nPerSecond*
+ BigInt((long)( aDateTime.GetSec() +
+ 60* aDateTime.GetMin() +
+ 60L*60* aDateTime.GetHour() ));
+
+ BigInt aUlongMax((ULONG)ULONG_MAX);
+ aUlongMax += 1;
+
+ rStream<<(UINT32)(aTime % aUlongMax) ;
+ rStream<<(UINT32)(aTime / aUlongMax);
+ return rStream.GetErrorCode();
+}
+
+//-------------------------------------------------------------------------
+
+ErrCode SfxPSDateTimeProperty_Impl::Load( SvStream& rStream )
+{
+ UINT32 nLow, nHigh;
+ rStream >> nLow;
+ rStream >> nHigh;
+ BigInt aUlongMax( (ULONG)ULONG_MAX );
+ aUlongMax += 1;
+ BigInt aTime = aUlongMax * BigInt( nHigh );
+ aTime += nLow;
+ BigInt a100nPerSecond(10000000L);
+ BigInt a100nPerDay = a100nPerSecond*BigInt( 60L * 60 * 24 );
+ ULONG nDays = aTime / a100nPerDay;
+ USHORT nYears = (USHORT)
+ (( nDays - ( nDays / ( 4 * 365 ) ) + ( nDays / ( 100 * 365 ) ) -
+ ( nDays / ( 400 * 365 ) ) ) / 365 );
+ nDays -= nYears * 365 + nYears / 4 - nYears / 100 + nYears / 400;
+ USHORT nMonths = 0;
+ for( long nDaysCount = nDays; nDaysCount >= 0; )
+ {
+ nDays = nDaysCount;
+ nMonths ++;
+ nDaysCount-= Date( 1, nMonths, 1601 + nYears ).GetDaysInMonth();
+ }
+ Date _aDate( (USHORT)( nDays + 1 ), nMonths, nYears + 1601 );
+ Time _aTime( ( aTime / ( a100nPerSecond * BigInt( 60 * 60 ) ) ) %
+ BigInt( 24 ),
+ ( aTime / ( a100nPerSecond * BigInt( 60 ) ) ) %
+ BigInt( 60 ),
+ ( aTime / ( a100nPerSecond ) ) %
+ BigInt( 60 ) );
+ aDateTime = DateTime( _aDate, _aTime );
+ aDateTime.ConvertToLocalTime();
+ return rStream.GetErrorCode();
+}
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSDateTimeProperty_Impl::Len()
+{
+ return 8;
+}
+
+//=========================================================================
+
+typedef SfxPSProperty_Impl *SfxPSPropertyPtr_Impl;
+SV_DECL_PTRARR_DEL(SfxPSPropertyArr_Impl, SfxPSPropertyPtr_Impl, 10, 10);
+SV_IMPL_PTRARR(SfxPSPropertyArr_Impl, SfxPSPropertyPtr_Impl);
+
+struct SfxPSSection_Impl
+{
+ SvGlobalName aId;
+ SfxPSPropertyArr_Impl aProperties;
+ ULONG Save(SvStream &rStream);
+ ULONG Load( SvStream& rStream );
+};
+
+//=========================================================================
+
+class SfxPS_Impl
+{
+ SfxPSSection_Impl aSection;
+ USHORT GetPos( UINT32 nId );
+
+ public:
+
+ void SetSectionName(const SvGlobalName& aIdP);
+ void AddProperty( SfxPSProperty_Impl* pProp);
+ SfxPSProperty_Impl* GetProperty( UINT32 nId );
+
+ ULONG Save(SvStream &rStream);
+ ULONG Load( SvStream& rStream );
+};
+
+
+USHORT SfxPS_Impl::GetPos( UINT32 nId )
+{
+ SfxPSPropertyArr_Impl& rProperties = aSection.aProperties;
+ USHORT nCount = rProperties.Count();
+ for( USHORT n = 0 ; n < nCount; n++ )
+ if( rProperties.GetObject( n )->GetId() == nId )
+ return n;
+ return USHRT_MAX;
+}
+
+
+void SfxPS_Impl::AddProperty( SfxPSProperty_Impl* pProp)
+{
+ USHORT nPos = GetPos( pProp->GetId() );
+ if( nPos != USHRT_MAX )
+ {
+ delete aSection.aProperties[ nPos ];
+ aSection.aProperties.Remove( nPos );
+ }
+ aSection.aProperties.Insert(pProp,0);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPS_Impl::SetSectionName(const SvGlobalName& aIdP)
+{
+ aSection.aId = aIdP;
+}
+
+
+ULONG SfxPS_Impl::Save(SvStream &rStream)
+{
+ SvGlobalName aName;
+ rStream << (UINT16) 0xfffe // ByteOrder
+ << (UINT16) 0 // version
+ << (UINT16) 1 // Os MinorVersion
+ << (UINT16) // Os Type
+#if defined(MAC)
+ 1
+#elif defined(WNT)
+ 2
+#else
+ 0
+#endif
+ << aName
+ << (UINT32)1; // Immer eine Section
+ return aSection.Save(rStream);
+}
+
+
+ULONG SfxPS_Impl::Load( SvStream& rStream )
+{
+ SvGlobalName aName;
+ UINT16 nByteOrder;
+ UINT16 nVersion;
+ UINT16 nOsMinor;
+ UINT16 nOsType;
+ UINT32 nSections;
+
+ rStream >> nByteOrder >> nVersion >> nOsMinor >> nOsType >> aName >> nSections;
+
+ if( nSections != 1 )
+ {
+ DBG_WARNINGFILE( "DocInfo enthaelt mehr als eine Section" );
+ return ERRCODE_IO_GENERAL;
+ }
+ SetSectionName( aName );
+ return aSection.Load( rStream );
+}
+
+ULONG SfxPSSection_Impl::Load( SvStream& rStream )
+{
+//Nur eine Section laden: ( Use of more than 1 section is discouraged
+//and will not be supported in future windows apis).
+
+ UINT32 nPos;
+ rStream >> aId;
+ rStream >> nPos;
+
+ rStream.Seek( nPos ); // SectionHeader
+ UINT32 nLen;
+ UINT32 nCount;
+ rStream >> nLen;
+ rStream >> nCount;
+ UINT32 *pKeyIds = new UINT32[ nCount ];
+ UINT32 *pPositions = new UINT32[ nCount ];
+ USHORT n;
+ ULONG nErr = 0;
+ for( n = 0; n < nCount && !rStream.GetErrorCode(); n++ )
+ {
+ rStream >> pKeyIds[ n ];
+ rStream >> pPositions[ n ];
+ }
+ for( n = 0; n < nCount && !nErr; n++ )
+ {
+ rStream.Seek( nPos + pPositions[ n ] );
+ UINT32 nId;
+ rStream >> nId;
+ SfxPSProperty_Impl* pProp = 0;
+ switch( nId )
+ {
+ case VT_LPSTR:
+ {
+ pProp = new SfxPSStringProperty_Impl( pKeyIds[ n ] );
+ break;
+ }
+ case VT_FILETIME:
+ {
+ pProp = new SfxPSDateTimeProperty_Impl( pKeyIds[ n ] );
+ break;
+ }
+ }
+ if( pProp )
+ {
+ nErr = pProp->Load( rStream );
+ aProperties.Insert( pProp, 0 );
+ }
+ }
+ delete[] pKeyIds;
+ delete[] pPositions;
+ return nErr;
+}
+
+//-------------------------------------------------------------------------
+
+ULONG SfxPSSection_Impl::Save(SvStream &rStream)
+{
+
+//Nur eine Section schreiben: ( Use of more than 1 section is discouraged
+//and will not be supported in future windows apis).
+
+ ULONG nPos = rStream.Tell();
+ nPos += 20;
+ rStream << aId << (UINT32)nPos; //Offset
+
+
+ //SectionHeader Schreiben
+ ULONG nLen=8;
+ USHORT n;
+ for(n=0;n<aProperties.Count();n++)
+ nLen+=(((aProperties[n]->Len() + 3) >> 2) << 2)+12;
+ rStream << (UINT32) nLen << (UINT32) aProperties.Count();
+
+ //PropertyId/Offsetpaare schreiben
+
+ nLen=8+aProperties.Count()*8;
+ for(n=0;n<aProperties.Count();n++)
+ {
+ rStream << aProperties[n]->GetId() << (UINT32)nLen;
+ nLen+=(((aProperties[n]->Len() + 3) >> 2) << 2) + 4;
+ }
+
+ //Inhalte schreiben
+ for(n=0;n<aProperties.Count();n++)
+ {
+ rStream << (UINT32) aProperties[n]->GetType();
+ aProperties[n]->Save(rStream);
+ nLen=aProperties[n]->Len();
+ while(nLen++%4) //Auffuellen auf DWORD Grenze
+ rStream << (UINT8) 0;
+ }
+
+ return rStream.GetErrorCode();
+}
+
+
+SfxPSProperty_Impl* SfxPS_Impl::GetProperty( UINT32 nId )
+{
+ USHORT nPos = GetPos( nId );
+ return nPos == USHRT_MAX ? 0 : aSection.aProperties.GetObject( nPos );
+}
+
+//========================================================================
+
+
+SvStream& PaddWithBlanks_Impl(SvStream &rStream, USHORT nCount)
+{
+ for ( USHORT n = nCount; n; --n )
+ rStream << ' ';
+ return rStream;
+}
+
+//-------------------------------------------------------------------------
+
+inline SvStream& Skip(SvStream &rStream, USHORT nCount)
+{
+ rStream.SeekRel(nCount);
+ return rStream;
+}
+
+//-------------------------------------------------------------------------
+
+struct FileHeader
+{
+ String aHeader;
+ USHORT nVersion;
+ BOOL bPasswd;
+
+ FileHeader( const char* pHeader, USHORT nV, BOOL bPass ) :
+ nVersion( nV ), bPasswd( bPass ) { aHeader = String::CreateFromAscii( pHeader ); }
+ FileHeader( SvStream& rStream );
+
+ void Save( SvStream& rStream ) const;
+};
+
+//-------------------------------------------------------------------------
+
+
+FileHeader::FileHeader( SvStream& rStream )
+{
+ BYTE b;
+ long nVer = rStream.GetVersion();
+ rStream.SetVersion( SOFFICE_FILEFORMAT_40 );
+ rStream.ReadByteString( aHeader ); //(dv??)
+ rStream >> nVersion >> b;
+ rStream.SetVersion( nVer );
+ bPasswd = (BOOL)b;
+}
+
+//-------------------------------------------------------------------------
+
+void FileHeader::Save( SvStream& rStream ) const
+{
+ long nVer = rStream.GetVersion();
+ rStream.SetVersion( SOFFICE_FILEFORMAT_40 );
+ rStream.WriteByteString( aHeader );
+ rStream.SetVersion( nVer );
+ rStream << nVersion;
+ rStream << (BYTE)bPasswd;
+}
+
+//*************************************************************************
+#if SUPD < 563
+
+//-------------------------------------------------------------------------
+
+void SfxStamp::AdjustName_Impl()
+{
+ if ( aModifiedByName.Len() > TIMESTAMP_MAXLENGTH )
+ aModifiedByName.Erase( TIMESTAMP_MAXLENGTH );
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxStamp::Load(SvStream &rStream)
+{
+ long d, t;
+ rStream >> aModifiedByName;
+ Skip(rStream, TIMESTAMP_MAXLENGTH - aModifiedByName.Len()) >> d >> t;
+ aModifiedDateTime = DateTime(Date(d), Time(t));
+ return rStream.GetError() == SVSTREAM_OK;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxStamp::Save(SvStream &rStream) const
+{
+ DBG_ASSERT(aModifiedByName.Len() <= TIMESTAMP_MAXLENGTH, "Max. Stringlaenge ueberschritten");
+ rStream << aModifiedByName;
+ PaddWithBlanks_Impl(rStream, TIMESTAMP_MAXLENGTH - aModifiedByName.Len())
+ << (long) aModifiedDateTime.GetDate()
+ << (long) aModifiedDateTime.GetTime();
+
+ return rStream.GetError() == SVSTREAM_OK;
+}
+
+//-------------------------------------------------------------------------
+SfxStamp::SfxStamp( const String& rName ) : aModifiedByName( rName )
+{
+ AdjustName_Impl();
+}
+//-------------------------------------------------------------------------
+SfxStamp::SfxStamp( const String& rName, const DateTime& rTime ) :
+ aModifiedByName( rName ), aModifiedDateTime( rTime )
+{
+ AdjustName_Impl();
+}
+//-------------------------------------------------------------------------
+const SfxStamp& SfxStamp::operator=( const SfxStamp& rCopy )
+{
+ aModifiedByName = rCopy.aModifiedByName;
+ aModifiedDateTime = rCopy.aModifiedDateTime;
+ AdjustName_Impl();
+ return *this;
+}
+//-------------------------------------------------------------------------
+void SfxStamp::SetName( const String&rName )
+{
+ aModifiedByName = rName;
+ AdjustName_Impl();
+}
+
+#endif // SUPD < 563
+//*************************************************************************
+
+//-------------------------------------------------------------------------
+void SfxDocUserKey::AdjustTitle_Impl()
+{
+ if ( aTitle.Len() > SFXDOCUSERKEY_LENMAX )
+ aTitle.Erase( SFXDOCUSERKEY_LENMAX );
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDocUserKey::Load(SvStream &rStream)
+{
+ rStream.ReadByteString( aTitle );
+ Skip(rStream, SFXDOCUSERKEY_LENMAX - aTitle.Len());
+ rStream.ReadByteString( aWord );
+ Skip(rStream, SFXDOCUSERKEY_LENMAX - aWord.Len());
+ return rStream.GetError() == SVSTREAM_OK;
+}
+
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDocUserKey::Save(SvStream &rStream) const
+{
+ DBG_ASSERT(aTitle.Len() <= SFXDOCUSERKEY_LENMAX, "Max. Stringlaenge ueberschritten");
+ DBG_ASSERT(aWord.Len() <= SFXDOCUSERKEY_LENMAX, "Max. Stringlaenge ueberschritten");
+ rStream.WriteByteString( aTitle );
+ PaddWithBlanks_Impl(rStream, SFXDOCUSERKEY_LENMAX - aTitle.Len());
+ rStream.WriteByteString( aWord );
+ PaddWithBlanks_Impl(rStream, SFXDOCUSERKEY_LENMAX - aWord.Len());
+ return rStream.GetError() == SVSTREAM_OK;
+}
+
+//-------------------------------------------------------------------------
+SfxDocUserKey::SfxDocUserKey( const String& rTitle, const String& rWord ) :
+ aTitle( rTitle ), aWord( rWord )
+{
+ AdjustTitle_Impl();
+}
+//------------------------------------------------------------------------
+const SfxDocUserKey& SfxDocUserKey::operator=(const SfxDocUserKey &rCopy)
+{
+ aTitle = rCopy.aTitle;
+ aWord = rCopy.aWord;
+ AdjustTitle_Impl();
+ return *this;
+}
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentInfo::Load( SvStream& rStream )
+{
+ long d, t;
+ USHORT nUS;
+ BYTE nByte;
+ FileHeader aHeader(rStream);
+ if( ! aHeader.aHeader.EqualsAscii( pDocInfoHeader ))
+ {
+ rStream.SetError(SVSTREAM_FILEFORMAT_ERROR);
+ return FALSE;
+ }
+ Free();
+ bPasswd = aHeader.bPasswd;
+ rStream >> nUS;
+ eFileCharSet = (CharSet)nUS;
+ // Einstellen an den Streams
+ rStream.SetStreamCharSet(eFileCharSet);
+
+ rStream >> nByte;
+ bPortableGraphics = nByte? 1: 0;
+ rStream >> nByte;
+ bQueryTemplate = nByte? 1: 0;
+
+ aCreated.Load(rStream);
+ aChanged.Load(rStream);
+ aPrinted.Load(rStream);
+
+ rStream.ReadByteString( aTitle );
+ Skip(rStream, SFXDOCINFO_TITLELENMAX - aTitle.Len());
+ rStream.ReadByteString( aTheme );
+ Skip(rStream, SFXDOCINFO_THEMELENMAX - aTheme.Len());
+ rStream.ReadByteString( aComment );
+ Skip(rStream, SFXDOCINFO_COMMENTLENMAX- aComment.Len());
+ rStream.ReadByteString( aKeywords );
+ Skip(rStream, SFXDOCINFO_KEYWORDLENMAX - aKeywords.Len());
+
+ USHORT i;
+ for(i = 0; i < MAXDOCUSERKEYS; ++i)
+ aUserKeys[i].Load(rStream);
+
+ rStream.ReadByteString( aTemplateName );
+ rStream.ReadByteString( aTemplateFileName );
+ rStream >> d >> t;
+ aTemplateDate = DateTime(Date(d), Time(t));
+
+ // wurde mal fuer MB in Panik eingebaut und dann doch nie benutzt :-)
+ if ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 )
+ {
+ USHORT nMailAddr;
+ rStream >> nMailAddr;
+ for( i = 0; i < nMailAddr; i++ )
+ {
+ String aDummyString;
+ USHORT nDummyFlags;
+ rStream.ReadByteString( aDummyString );
+ rStream >> nDummyFlags;
+ }
+ }
+
+ rStream >> lTime;
+ if(aHeader.nVersion > 4)
+ rStream >> nDocNo;
+ else
+ nDocNo = 1;
+ rStream >> nUserDataSize;
+ if(nUserDataSize) {
+ pUserData = new char[nUserDataSize];
+ rStream.Read(pUserData,nUserDataSize);
+ }
+
+ BOOL bOK = (rStream.GetError() == SVSTREAM_OK);
+ nByte = 0; // wg.Kompatibilitaet;
+ rStream >> nByte; // evtl. nicht in DocInfo enthalten
+ bTemplateConfig = nByte ? 1 : 0;
+ if( aHeader.nVersion > 5 )
+ {
+ rStream >> bReloadEnabled;
+ rStream.ReadByteString( aReloadURL );
+ rStream >> nReloadSecs;
+ rStream.ReadByteString( aDefaultTarget );
+ }
+ if ( aHeader.nVersion > 6 )
+ {
+ rStream >> nByte;
+ bSaveGraphicsCompressed = nByte? 1: 0;
+ }
+ if ( aHeader.nVersion > 7 )
+ {
+ rStream >> nByte;
+ bSaveOriginalGraphics = nByte? 1: 0;
+ }
+ if ( aHeader.nVersion > 8 )
+ {
+ rStream >> nByte;
+ bSaveVersionOnClose = nByte? 1: 0;
+
+ rStream.ReadByteString( pImp->aCopiesTo );
+ rStream.ReadByteString( pImp->aOriginal );
+ rStream.ReadByteString( pImp->aReferences );
+ rStream.ReadByteString( pImp->aRecipient );
+ rStream.ReadByteString( pImp->aReplyTo );
+ rStream.ReadByteString( pImp->aBlindCopies );
+ rStream.ReadByteString( pImp->aInReplyTo );
+ rStream.ReadByteString( pImp->aNewsgroups );
+ rStream >> pImp->nPriority;
+ }
+ if ( aHeader.nVersion > 9 )
+ {
+ rStream.WriteByteString( pImp->aSpecialMimeType, rStream.GetStreamCharSet() ); //(dv??)
+ }
+ if ( aHeader.nVersion > 10 )
+ {
+ rStream >> nByte;
+ pImp->bUseUserData = nByte ? TRUE : FALSE;
+ }
+ return bOK;
+}
+
+#pragma optimize ( "", off )
+
+ULONG SfxDocumentInfo::LoadPropertySet( SvStorage* pStorage )
+{
+ SvStorageStreamRef aStrPropSet = pStorage->OpenStream(
+ String::CreateFromAscii( pPropSlot ), STREAM_STD_READ );
+ if ( !aStrPropSet.Is() )
+ return ERRCODE_IO_ACCESSDENIED;
+ aStrPropSet->SetBufferSize( STREAM_BUFFER_SIZE );
+ SfxPS_Impl* pPS = new SfxPS_Impl;
+ ULONG nErr = pPS->Load( *aStrPropSet );
+
+ UINT32 aStrArr[] = { PID_TITLE, PID_SUBJECT, PID_KEYWORDS, PID_TEMPLATE, PID_COMMENTS, 0 };
+ UINT32 aLens[] = { SFXDOCINFO_TITLELENMAX, SFXDOCINFO_THEMELENMAX,
+ SFXDOCINFO_KEYWORDLENMAX, USHRT_MAX, SFXDOCINFO_COMMENTLENMAX };
+
+#if ( __GNUC__ == 2 ) && ( __GNUC_MINOR__ == 95 )
+ void ( SfxDocumentInfo::*pStrFuncs[] )( String& ) =
+#else
+ void ( SfxDocumentInfo::*pStrFuncs[] )( const String& ) =
+#endif
+ {
+ &SfxDocumentInfo::SetTitle,
+ &SfxDocumentInfo::SetTheme,
+ &SfxDocumentInfo::SetKeywords,
+ &SfxDocumentInfo::SetTemplateName,
+ &SfxDocumentInfo::SetComment
+ };
+
+ for( USHORT n = 0; aStrArr[ n ]; n++ )
+ {
+ SfxPSStringProperty_Impl* pStr = ( SfxPSStringProperty_Impl* )pPS->GetProperty( aStrArr[ n ] );
+ if( pStr )
+ {
+ USHORT nLen = (USHORT)aLens[ n ];
+ ( this->*pStrFuncs[ n ] )( pStr->GetString().Copy( 0, nLen ) );
+ }
+ }
+
+ String aName;
+ DateTime aTime;
+ SfxPSStringProperty_Impl* pStr;
+ SfxPSDateTimeProperty_Impl* pDate;
+
+ pStr = (SfxPSStringProperty_Impl*) pPS->GetProperty( PID_AUTHOR );
+ if( pStr ) aName = pStr->GetString();
+ else aName.Erase();
+ pDate = (SfxPSDateTimeProperty_Impl*) pPS->GetProperty( PID_CREATE_DTM );
+ if( pDate ) aTime = pDate->GetDateTime();
+ else aTime = DateTime();
+ SetCreated( SfxStamp( aName.Copy(0, TIMESTAMP_MAXLENGTH ), aTime ) );
+
+ pStr = (SfxPSStringProperty_Impl*) pPS->GetProperty( PID_LASTAUTHOR );
+ if( pStr ) aName = pStr->GetString();
+ else aName.Erase();
+ pDate = (SfxPSDateTimeProperty_Impl*) pPS->GetProperty( PID_LASTSAVED_DTM );
+ if( pDate ) aTime = pDate->GetDateTime();
+ else aTime = DateTime();
+ SetChanged( SfxStamp( aName.Copy(0, TIMESTAMP_MAXLENGTH ), aTime ) );
+
+ pDate = (SfxPSDateTimeProperty_Impl*) pPS->GetProperty( PID_LASTPRINTED_DTM );
+ if( pDate ) aTime = pDate->GetDateTime();
+ else aTime = DateTime();
+ DateTime aTmpTime = aTime;
+ aTmpTime.ConvertToUTC();
+ if( aTmpTime != DateTime( Date( 1, 1, 1601 ), Time( 0, 0, 0 ) ) )
+ SetPrinted( SfxStamp( String(), aTime ) );
+ else
+//-----------------------------------------------------------------------
+#if SUPD > 562
+ SetPrinted( SfxStamp( TIMESTAMP_INVALID_DATETIME ));
+#else
+ SetPrinted( SfxStamp( SFX_STAMP_INVALID ));
+#endif // SUPD > 562
+//-----------------------------------------------------------------------
+
+ pStr = (SfxPSStringProperty_Impl*) pPS->GetProperty( PID_REVNUMBER );
+ if( pStr )
+ SetDocumentNumber( pStr->GetString().ToInt32() );
+
+ pDate = (SfxPSDateTimeProperty_Impl*) pPS->GetProperty( PID_EDITTIME );
+ if( pDate )
+ {
+ DateTime aDateTime = pDate->GetDateTime();
+ aDateTime.ConvertToUTC();
+ SetTime( aDateTime.GetTime() );
+ }
+
+ delete pPS;
+ return ERRCODE_NONE;
+}
+
+#pragma optimize ( "", on )
+
+//-------------------------------------------------------------------------
+BOOL SfxDocumentInfo::SavePropertySet( SvStorage *pStorage) const
+{
+ SfxPS_Impl* pPS = new SfxPS_Impl;
+ SvStorageStreamRef aStrPropSet = pStorage->OpenStream(
+ String::CreateFromAscii( pPropSlot ), STREAM_TRUNC | STREAM_STD_WRITE );
+ if ( !aStrPropSet.Is() )
+ {
+ DBG_ERROR( "Konnte PropSet nicht oeffnen" );
+ return FALSE;
+ }
+ pPS->SetSectionName( SvGlobalName(
+ 0xf29f85e0, 0x4ff9, 0x1068, 0xab, 0x91, 0x08, 0x00, 0x2b, 0x27, 0xb3, 0xd9 ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_TITLE, GetTitle() ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_SUBJECT, GetTheme() ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_KEYWORDS, GetKeywords() ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_TEMPLATE, GetTemplateName() ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_COMMENTS, GetComment() ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_AUTHOR, GetCreated().GetName() ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl( PID_LASTAUTHOR, GetChanged().GetName() ) );
+ pPS->AddProperty( new SfxPSDateTimeProperty_Impl( PID_CREATE_DTM, GetCreated().GetTime() ) );
+ pPS->AddProperty( new SfxPSDateTimeProperty_Impl( PID_LASTSAVED_DTM, GetChanged().GetTime() ) );
+ if ( GetPrinted().GetTime() != GetCreated().GetTime() )
+ pPS->AddProperty( new SfxPSDateTimeProperty_Impl( PID_LASTPRINTED_DTM, GetPrinted().GetTime() ) );
+ DateTime aEditTime( Date( 1, 1, 1601 ), Time( GetTime() ) );
+ aEditTime.ConvertToLocalTime();
+ pPS->AddProperty( new SfxPSDateTimeProperty_Impl( PID_EDITTIME, aEditTime ) );
+ pPS->AddProperty( new SfxPSStringProperty_Impl(
+ PID_REVNUMBER, String::CreateFromInt32( GetDocumentNumber() ) ) );
+ pPS->Save( *aStrPropSet );
+ delete pPS;
+ return ( aStrPropSet->GetErrorCode() == 0 );
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDocumentInfo::Save( SvStream& rStream ) const
+{
+ FileHeader aHeader(pDocInfoHeader, VERSION, bPasswd? 1: 0);
+ aHeader.Save(rStream);
+ rStream << (USHORT)eFileCharSet;
+ rStream.SetStreamCharSet(eFileCharSet);
+ rStream << (bPortableGraphics? (BYTE)1: (BYTE)0)
+ << (bQueryTemplate? (BYTE)1: (BYTE)0);
+ aCreated.Save(rStream);
+ aChanged.Save(rStream);
+ aPrinted.Save(rStream);
+ DBG_ASSERT(aTitle.Len() <= SFXDOCINFO_TITLELENMAX , "Max. Stringlaenge ueberschritten");
+ DBG_ASSERT(aTheme.Len() <= SFXDOCINFO_THEMELENMAX , "Max. Stringlaenge ueberschritten");
+ DBG_ASSERT(aComment.Len() <= SFXDOCINFO_COMMENTLENMAX , "Max. Stringlaenge ueberschritten");
+ DBG_ASSERT(aKeywords.Len() <= SFXDOCINFO_KEYWORDLENMAX , "Max. Stringlaenge ueberschritten");
+ rStream.WriteByteString( aTitle );
+ PaddWithBlanks_Impl(rStream, SFXDOCINFO_TITLELENMAX - aTitle.Len());
+ rStream.WriteByteString( aTheme );
+ PaddWithBlanks_Impl(rStream, SFXDOCINFO_THEMELENMAX - aTheme.Len());
+ rStream.WriteByteString( aComment );
+ PaddWithBlanks_Impl(rStream, SFXDOCINFO_COMMENTLENMAX - aComment.Len());
+ rStream.WriteByteString( aKeywords );
+ PaddWithBlanks_Impl(rStream, SFXDOCINFO_KEYWORDLENMAX - aKeywords.Len());
+
+ for(USHORT i = 0; i < MAXDOCUSERKEYS; ++i)
+ aUserKeys[i].Save(rStream);
+ rStream.WriteByteString( aTemplateName );
+ rStream.WriteByteString( aTemplateFileName );
+ rStream << (long)aTemplateDate.GetDate()
+ << (long)aTemplateDate.GetTime();
+
+ // wurde mal fuer MB in Panik eingebaut und dann doch nie benutzt :-)
+ if ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_40 )
+ rStream << (USHORT) 0;
+
+ rStream << lTime << nDocNo;
+ rStream << nUserDataSize;
+ if(pUserData)
+ rStream.Write(pUserData, nUserDataSize);
+ rStream << (bTemplateConfig? (BYTE)1: (BYTE)0);
+ if( aHeader.nVersion > 5 )
+ {
+ rStream << bReloadEnabled;
+ rStream.WriteByteString( aReloadURL );
+ rStream << nReloadSecs;
+ rStream.WriteByteString( aDefaultTarget );
+ }
+ if ( aHeader.nVersion > 6 )
+ rStream << (bSaveGraphicsCompressed? (BYTE)1: (BYTE)0);
+ if ( aHeader.nVersion > 7 )
+ rStream << (bSaveOriginalGraphics? (BYTE)1: (BYTE)0);
+ if ( aHeader.nVersion > 8 )
+ {
+ rStream << (bSaveVersionOnClose? (BYTE)1: (BYTE)0);
+ rStream.WriteByteString( pImp->aCopiesTo );
+ rStream.WriteByteString( pImp->aOriginal );
+ rStream.WriteByteString( pImp->aReferences );
+ rStream.WriteByteString( pImp->aRecipient );
+ rStream.WriteByteString( pImp->aReplyTo );
+ rStream.WriteByteString( pImp->aBlindCopies );
+ rStream.WriteByteString( pImp->aInReplyTo );
+ rStream.WriteByteString( pImp->aNewsgroups );
+ rStream << pImp->nPriority;
+ }
+ if ( aHeader.nVersion > 9 )
+ {
+ rStream.WriteByteString( pImp->aSpecialMimeType );
+ }
+ if ( aHeader.nVersion > 10 )
+ {
+ rStream << ( pImp->bUseUserData ? (BYTE)1: (BYTE)0 );
+ }
+
+ return rStream.GetError() == SVSTREAM_OK;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDocumentInfo::Load(SvStorage* pStorage)
+{
+#ifdef DBG_UTIL
+ if(!pStorage->IsStream( String::CreateFromAscii( pDocInfoSlot )))
+ return FALSE;
+#endif
+ SvStorageStreamRef aStr = pStorage->OpenStream( String::CreateFromAscii( pDocInfoSlot ),STREAM_STD_READ);
+ if(!aStr.Is())
+ return FALSE;
+ aStr->SetVersion( pStorage->GetVersion() );
+ aStr->SetBufferSize(STREAM_BUFFER_SIZE);
+ return Load(*aStr);
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxDocumentInfo::Save(SvStorage* pStorage) const
+{
+ SvStorageStreamRef aStr = pStorage->OpenStream( String::CreateFromAscii( pDocInfoSlot ), STREAM_TRUNC | STREAM_STD_READWRITE);
+ if(!aStr.Is())
+ return FALSE;
+ aStr->SetVersion( pStorage->GetVersion() );
+ aStr->SetBufferSize(STREAM_BUFFER_SIZE);
+ if(!Save(*aStr))
+ return FALSE;
+ return SavePropertySet( pStorage );
+}
+
+//-------------------------------------------------------------------------
+
+const SfxDocUserKey& SfxDocumentInfo::GetUserKey( USHORT n ) const
+{
+ DBG_ASSERT(n < GetUserKeyCount(), "UserKeyArray ueberindiziert");
+ return aUserKeys[n];
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDocumentInfo::SetUserKey( const SfxDocUserKey& rKey, USHORT n )
+{
+ DBG_ASSERT(n < GetUserKeyCount(), "UserKeyArray ueberindiziert");
+ aUserKeys[n] = rKey;
+}
+
+
+//-------------------------------------------------------------------------
+
+SfxDocumentInfo::SfxDocumentInfo( const SfxDocumentInfo& rInf):
+ nUserDataSize(0),
+ pUserData(0)
+{
+ pImp = new SfxDocumentInfo_Impl;
+ bReadOnly = rInf.bReadOnly;
+ bReloadEnabled = FALSE;
+ nReloadSecs = 60;
+ *this = rInf;
+}
+
+BOOL SfxDocumentInfo::IsReloadEnabled() const
+{
+ return bReloadEnabled;
+}
+
+void SfxDocumentInfo::EnableReload( BOOL bEnable )
+{
+ bReloadEnabled = bEnable;
+}
+
+const String& SfxDocumentInfo::GetDefaultTarget() const
+{
+ return aDefaultTarget;
+}
+
+void SfxDocumentInfo::SetDefaultTarget( const String& rString )
+{
+ aDefaultTarget = rString;
+}
+
+const String& SfxDocumentInfo::GetReloadURL() const
+{
+ return aReloadURL;
+}
+
+void SfxDocumentInfo::SetReloadURL( const String& rString )
+{
+ aReloadURL = rString;
+}
+
+ULONG SfxDocumentInfo::GetReloadDelay() const
+{
+ return nReloadSecs;
+}
+
+void SfxDocumentInfo::SetReloadDelay( ULONG nSec )
+{
+ nReloadSecs = nSec;
+}
+
+//-------------------------------------------------------------------------
+void SfxDocumentInfo::Clear()
+{
+ BOOL _bReadOnly = bReadOnly;
+ BOOL _bPortableGraphics = bPortableGraphics;
+ BOOL _bSaveGraphicsCompressed = bSaveGraphicsCompressed;
+ BOOL _bSaveOriginalGraphics = bSaveOriginalGraphics;
+
+ (*this) = SfxDocumentInfo();
+
+ bReadOnly = _bReadOnly;
+ bPortableGraphics = _bPortableGraphics;
+ bSaveGraphicsCompressed = _bSaveGraphicsCompressed;
+ bSaveOriginalGraphics = _bSaveOriginalGraphics;
+}
+
+const SfxDocumentInfo& SfxDocumentInfo::operator=( const SfxDocumentInfo& rInf)
+{
+ if( this == &rInf ) return *this;
+
+ bReadOnly = rInf.bReadOnly;
+ bPasswd = rInf.bPasswd;
+ bPortableGraphics = rInf.bPortableGraphics;
+ bSaveGraphicsCompressed = rInf.bSaveGraphicsCompressed;
+ bSaveOriginalGraphics = rInf.bSaveOriginalGraphics;
+ bQueryTemplate = rInf.bQueryTemplate;
+ bTemplateConfig = rInf.bTemplateConfig;
+ eFileCharSet = rInf.eFileCharSet;
+
+ aCreated = rInf.aCreated;
+ aChanged = rInf.aChanged;
+ aPrinted = rInf.aPrinted;
+ aTitle = rInf.aTitle;
+ aTheme = rInf.aTheme;
+ aComment = rInf.aComment;
+ aKeywords = rInf.aKeywords;
+
+ for(USHORT i=0; i < MAXDOCUSERKEYS; ++i)
+ aUserKeys[i] = rInf.aUserKeys[i];
+
+ aTemplateName = rInf.aTemplateName;
+ aTemplateFileName = rInf.aTemplateFileName;
+ aTemplateDate = rInf.aTemplateDate;
+
+ aDefaultTarget = rInf.GetDefaultTarget();
+ aReloadURL = rInf.GetReloadURL();
+ bReloadEnabled = rInf.IsReloadEnabled();
+ nReloadSecs = rInf.GetReloadDelay();
+
+ Free();
+
+ nUserDataSize = rInf.nUserDataSize;
+ if(nUserDataSize) {
+ pUserData = new char[nUserDataSize];
+ memcpy(pUserData, rInf.pUserData, nUserDataSize);
+ }
+ lTime = rInf.lTime;
+ nDocNo = rInf.nDocNo;
+
+ bSaveVersionOnClose = rInf.bSaveVersionOnClose;
+ pImp->aCopiesTo = rInf.pImp->aCopiesTo;
+ pImp->aOriginal = rInf.pImp->aOriginal;
+ pImp->aReferences = rInf.pImp->aReferences;
+ pImp->aRecipient = rInf.pImp->aRecipient;
+ pImp->aReplyTo = rInf.pImp->aReplyTo;
+ pImp->aBlindCopies = rInf.pImp->aBlindCopies;
+ pImp->aInReplyTo = rInf.pImp->aInReplyTo;
+ pImp->aNewsgroups = rInf.pImp->aNewsgroups;
+ pImp->aSpecialMimeType = rInf.pImp->aSpecialMimeType;
+ pImp->nPriority = rInf.pImp->nPriority;
+ pImp->bUseUserData = rInf.pImp->bUseUserData;
+
+ return *this;
+}
+
+//-------------------------------------------------------------------------
+
+int SfxDocumentInfo::operator==( const SfxDocumentInfo& rCmp) const
+{
+ if(eFileCharSet != rCmp.eFileCharSet ||
+ bPasswd != rCmp.bPasswd ||
+ bPortableGraphics != rCmp.bPortableGraphics ||
+ bSaveGraphicsCompressed != rCmp.bSaveGraphicsCompressed ||
+ bSaveOriginalGraphics != rCmp.bSaveOriginalGraphics ||
+ bQueryTemplate != rCmp.bQueryTemplate ||
+ bTemplateConfig != rCmp.bTemplateConfig ||
+ aCreated != rCmp.aCreated ||
+ aChanged != rCmp.aChanged ||
+ aPrinted != rCmp.aPrinted ||
+ aTitle != rCmp.aTitle ||
+ aTheme != rCmp.aTheme ||
+ aComment != rCmp.aComment ||
+ aKeywords != rCmp.aKeywords ||
+ aTemplateName != rCmp.aTemplateName ||
+ aTemplateDate != rCmp.aTemplateDate ||
+ IsReloadEnabled() != rCmp.IsReloadEnabled() ||
+ GetReloadURL() != rCmp.GetReloadURL() ||
+ GetReloadDelay() != rCmp.GetReloadDelay() ||
+ GetDefaultTarget() != rCmp.GetDefaultTarget())
+ return FALSE;
+
+ for(USHORT i = 0; i < MAXDOCUSERKEYS; ++i) {
+ if(aUserKeys[i] != rCmp.aUserKeys[i])
+ return FALSE;
+ }
+ if(nUserDataSize != rCmp.nUserDataSize)
+ return FALSE;
+ if(nUserDataSize)
+ return 0 == memcmp(pUserData, rCmp.pUserData, nUserDataSize);
+
+ if ( pImp->aCopiesTo != rCmp.pImp->aCopiesTo ||
+ pImp->aOriginal != rCmp.pImp->aOriginal ||
+ pImp->aReferences != rCmp.pImp->aReferences ||
+ pImp->aRecipient != rCmp.pImp->aRecipient ||
+ pImp->aReplyTo != rCmp.pImp->aReplyTo ||
+ pImp->aBlindCopies != rCmp.pImp->aBlindCopies ||
+ pImp->aInReplyTo != rCmp.pImp->aInReplyTo ||
+ pImp->aNewsgroups != rCmp.pImp->aNewsgroups ||
+ pImp->aSpecialMimeType != rCmp.pImp->aSpecialMimeType ||
+ pImp->nPriority != rCmp.pImp->nPriority ||
+ pImp->bUseUserData != rCmp.pImp->bUseUserData ||
+ bSaveVersionOnClose != rCmp.bSaveVersionOnClose )
+ return FALSE;
+
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+const SfxDocumentInfo &SfxDocumentInfo::CopyUserData(const SfxDocumentInfo &rSource)
+{
+ bQueryTemplate = rSource.bQueryTemplate;
+ bTemplateConfig = rSource.bTemplateConfig;
+
+ SetReloadDelay( rSource.GetReloadDelay() );
+ SetReloadURL( rSource.GetReloadURL() );
+ EnableReload( rSource.IsReloadEnabled() );
+ SetDefaultTarget( rSource.GetDefaultTarget() );
+
+ aTitle = rSource.aTitle;
+ aTheme = rSource.aTheme;
+ aComment = rSource.aComment;
+ aKeywords = rSource.aKeywords;
+
+ aTemplateName = rSource.aTemplateName;
+ aTemplateFileName = rSource.aTemplateFileName;
+ aTemplateDate = rSource.aTemplateDate;
+
+ for(USHORT i = 0; i < MAXDOCUSERKEYS; ++i)
+ aUserKeys[i] = rSource.aUserKeys[i];
+
+ if(pUserData)
+ DELETEZ(pUserData);
+ nUserDataSize = rSource.nUserDataSize;
+ if(nUserDataSize) {
+ pUserData = new char[nUserDataSize];
+ memcpy(pUserData, rSource.pUserData, nUserDataSize);
+ }
+
+ pImp->aCopiesTo = rSource.pImp->aCopiesTo;
+ pImp->aOriginal = rSource.pImp->aOriginal;
+ pImp->aReferences = rSource.pImp->aReferences;
+ pImp->aRecipient = rSource.pImp->aRecipient;
+ pImp->aReplyTo = rSource.pImp->aReplyTo;
+ pImp->aBlindCopies = rSource.pImp->aBlindCopies;
+ pImp->aInReplyTo = rSource.pImp->aInReplyTo;
+ pImp->aNewsgroups = rSource.pImp->aNewsgroups;
+ pImp->aSpecialMimeType = rSource.pImp->aSpecialMimeType;
+ pImp->nPriority = rSource.pImp->nPriority;
+ pImp->bUseUserData = rSource.pImp->bUseUserData;
+
+ return *this;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDocumentInfo::Free()
+{
+ DELETEZ(pUserData);
+ nUserDataSize = 0;
+}
+
+//-------------------------------------------------------------------------
+
+String SfxDocumentInfo::AdjustTextLen_Impl( const String& rText, USHORT nMax )
+{
+ String aRet = rText;
+ if ( aRet.Len() > nMax )
+ aRet.Erase( nMax );
+ return aRet;
+}
+
+//-------------------------------------------------------------------------
+
+SfxDocumentInfo::SfxDocumentInfo() :
+ bPasswd(FALSE),
+ bQueryTemplate(FALSE),
+ bTemplateConfig(FALSE),
+ eFileCharSet(gsl_getSystemTextEncoding()),
+ nUserDataSize(0),
+ pUserData(0),
+ lTime(0),
+ nDocNo(1),
+ aChanged( TIMESTAMP_INVALID_DATETIME ),
+ aPrinted( TIMESTAMP_INVALID_DATETIME ),
+ bSaveVersionOnClose( FALSE )
+{
+ pImp = new SfxDocumentInfo_Impl;
+
+ bReadOnly = FALSE;
+ bReloadEnabled = FALSE;
+ nReloadSecs = 60;
+ SfxApplication *pSfxApp = SFX_APP();
+ bPortableGraphics = pSfxApp->GetOptions().IsIndepGrfFmt();
+ bSaveGraphicsCompressed = pSfxApp->GetOptions().IsSaveGraphicsCompressed();
+ bSaveOriginalGraphics = pSfxApp->GetOptions().IsSaveOriginalGraphics();
+
+ const String aInf( DEFINE_CONST_UNICODE( "Info " ) );
+ for( USHORT i = 0; i < MAXDOCUSERKEYS; ++i ) {
+ aUserKeys[i].aTitle = aInf;
+ aUserKeys[i].aTitle += String::CreateFromInt32(i);
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxDocumentInfo::~SfxDocumentInfo()
+{
+ Free();
+ delete pImp;
+}
+
+String SfxDocumentInfo::GetCopiesTo() const
+{
+ return pImp->aCopiesTo;
+}
+
+void SfxDocumentInfo::SetCopiesTo( const String& rStr )
+{
+ pImp->aCopiesTo = rStr;
+}
+
+String SfxDocumentInfo::GetOriginal() const
+{
+ return pImp->aOriginal;
+}
+
+void SfxDocumentInfo::SetOriginal( const String& rStr )
+{
+ pImp->aOriginal = rStr;
+}
+
+String SfxDocumentInfo::GetReferences() const
+{
+ return pImp->aReferences;
+}
+
+void SfxDocumentInfo::SetReferences( const String& rStr )
+{
+ pImp->aReferences = rStr;
+}
+
+String SfxDocumentInfo::GetRecipient() const
+{
+ return pImp->aRecipient;
+}
+
+void SfxDocumentInfo::SetRecipient( const String& rStr )
+{
+ pImp->aRecipient = rStr;
+}
+
+String SfxDocumentInfo::GetReplyTo() const
+{
+ return pImp->aReplyTo;
+}
+
+void SfxDocumentInfo::SetReplyTo( const String& rStr )
+{
+ pImp->aReplyTo = rStr;
+}
+
+String SfxDocumentInfo::GetBlindCopies() const
+{
+ return pImp->aBlindCopies;
+}
+
+void SfxDocumentInfo::SetBlindCopies( const String& rStr )
+{
+ pImp->aBlindCopies = rStr;
+}
+
+String SfxDocumentInfo::GetInReplyTo() const
+{
+ return pImp->aInReplyTo;
+}
+
+void SfxDocumentInfo::SetInReplyTo( const String& rStr )
+{
+ pImp->aInReplyTo = rStr;
+}
+
+String SfxDocumentInfo::GetNewsgroups() const
+{
+ return pImp->aNewsgroups;
+}
+
+void SfxDocumentInfo::SetNewsgroups( const String& rStr )
+{
+ pImp->aNewsgroups = rStr;
+}
+
+String SfxDocumentInfo::GetSpecialMimeType() const
+{
+ return pImp->aSpecialMimeType;
+}
+
+void SfxDocumentInfo::SetSpecialMimeType( const String& rStr )
+{
+ pImp->aSpecialMimeType = rStr;
+}
+
+USHORT SfxDocumentInfo::GetPriority() const
+{
+ return pImp->nPriority;
+}
+
+void SfxDocumentInfo::SetPriority( USHORT nPrio )
+{
+ pImp->nPriority = nPrio;
+}
+
+BOOL SfxDocumentInfo::IsUseUserData() const
+{
+ return pImp->bUseUserData;
+}
+
+void SfxDocumentInfo::SetUseUserData( BOOL bNew )
+{
+ pImp->bUseUserData = bNew;
+}
+
+//-----------------------------------------------------------------------------
+
+ErrCode SfxDocumentInfo::Load(const String& rName)
+{
+ SfxMedium aMedium( rName, SFX_STREAM_READONLY_MAKECOPY, TRUE );
+ if ( !aMedium.IsStorage() || SVSTREAM_OK != aMedium.GetError() )
+ // Datei existiert nicht oder ist kein Storage
+ return ERRCODE_IO_CANTREAD;
+
+ // Filter-Detection wegen FileFormat-Version
+ const SfxFilter *pFilter = 0;
+ if ( 0 != SFX_APP()->GetFilterMatcher().GuessFilter( aMedium, &pFilter ) || !pFilter )
+ // unbekanntes Dateiformat
+ return ERRCODE_IO_CANTREAD;
+
+ // Storage "offnen
+ SvStorageRef xStor = aMedium.GetStorage();
+ xStor->SetVersion( pFilter->GetVersion() );
+ return Load( xStor ) ? ERRCODE_NONE : ERRCODE_IO_CANTREAD;
+}
+
+//------------------------------------------------------------------------
+
+void SfxDocumentInfo::SetTitle( const String& rVal )
+{
+ aTitle = AdjustTextLen_Impl( rVal, SFXDOCINFO_TITLELENMAX );
+}
+//------------------------------------------------------------------------
+
+void SfxDocumentInfo::SetTheme( const String& rVal )
+{
+ aTheme = AdjustTextLen_Impl( rVal, SFXDOCINFO_THEMELENMAX );
+}
+//------------------------------------------------------------------------
+
+void SfxDocumentInfo::SetComment( const String& rVal )
+{
+ aComment = AdjustTextLen_Impl( rVal, SFXDOCINFO_COMMENTLENMAX );
+}
+//------------------------------------------------------------------------
+
+void SfxDocumentInfo::SetKeywords( const String& rVal )
+{
+ aKeywords = AdjustTextLen_Impl( rVal, SFXDOCINFO_KEYWORDLENMAX );
+}
+
+
diff --git a/sfx2/source/doc/doctdlg.cxx b/sfx2/source/doc/doctdlg.cxx
new file mode 100644
index 000000000000..5aae4f905a8d
--- /dev/null
+++ b/sfx2/source/doc/doctdlg.cxx
@@ -0,0 +1,262 @@
+/*************************************************************************
+ *
+ * $RCSfile: doctdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#pragma hdrstop
+
+#include "doctdlg.hxx"
+#include "docvor.hxx"
+#include "sfxresid.hxx"
+#include "sfxtypes.hxx"
+#include "dispatch.hxx"
+
+#include "sfx.hrc"
+#include "doc.hrc"
+#include "doctdlg.hrc"
+#include "basedlgs.hxx"
+
+//=========================================================================
+
+SfxDocumentTemplateDlg::SfxDocumentTemplateDlg(
+ Window * pParent, SfxDocumentTemplates* pTempl )
+: ModalDialog( pParent, SfxResId(DLG_DOC_TEMPLATE) ),
+ aRegionFt( this, ResId( FT_SECTION ) ),
+ aRegionLb( this, ResId( LB_SECTION ) ),
+ aTemplateFt( this, ResId( FT_STYLESHEETS ) ),
+ aTemplateLb( this, ResId( LB_STYLESHEETS ) ),
+ aNameEd( this, ResId( ED_NAME ) ),
+ aTemplateGb( this, ResId( GB_STYLESHEETS ) ),
+ aEditGb( this, ResId( GB_EDIT ) ),
+ aOkBt( this, ResId( BT_OK ) ),
+ aEditBt( this, ResId( BT_EDIT ) ),
+ aCancelBt( this, ResId( BT_CANCEL ) ),
+ aOrganizeBt( this, ResId( BT_ORGANIZE ) ),
+ aHelpBt( this, ResId( BT_HELP ) ),
+ pTemplates( pTempl )
+{
+ FreeResource();
+ pHelper = new SfxModalDefParentHelper( this );
+ aOrganizeBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, OrganizeHdl));
+ aNameEd.SetModifyHdl(LINK(this, SfxDocumentTemplateDlg, NameModify));
+ aOkBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, OkHdl));
+ aEditBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, EditHdl));
+ Init();
+}
+
+//-------------------------------------------------------------------------
+
+SfxDocumentTemplateDlg::~SfxDocumentTemplateDlg()
+{
+ delete pHelper;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentTemplateDlg, EditHdl, Button *, pBut )
+{
+
+ if ( !aRegionLb.GetSelectEntryCount() ||
+ !aTemplateLb.GetSelectEntryCount())
+ return 0;
+
+ const SfxStringItem aRegion( SID_TEMPLATE_REGIONNAME, aRegionLb.GetSelectEntry() );
+ const SfxStringItem aName( SID_TEMPLATE_NAME, aTemplateLb.GetSelectEntry() );
+ SFX_APP()->GetAppDispatcher_Impl()->Execute( SID_OPENTEMPLATE, SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD, &aRegion, &aName, 0L );
+ EndDialog(RET_EDIT_STYLE);
+
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDocumentTemplateDlg::Init()
+{
+ if(!pTemplates->IsConstructed())
+ pTemplates->Construct();
+
+ const USHORT nCount = pTemplates->GetRegionCount();
+ for(USHORT i = 0; i < nCount; ++i)
+ aRegionLb.InsertEntry(pTemplates->GetFullRegionName(i));
+ if(!nCount)
+ aRegionLb.InsertEntry(String(SfxResId(STR_STANDARD)));
+ aRegionLb.SelectEntryPos(0);
+ if(nCount)
+ {
+ aRegionLb.SetSelectHdl(LINK(this, SfxDocumentTemplateDlg, RegionSelect));
+ RegionSelect(&aRegionLb);
+ aTemplateLb.SetSelectHdl(LINK(this, SfxDocumentTemplateDlg, TemplateSelect));
+ aTemplateLb.SetDoubleClickHdl(LINK(this, SfxDocumentTemplateDlg, EditHdl));
+ }
+ else {
+ Link aLink;
+ aTemplateLb.SetSelectHdl(aLink);
+ aTemplateLb.SetDoubleClickHdl(aLink);
+ }
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentTemplateDlg, OrganizeHdl, Button *, pButton )
+{
+ SfxTemplateOrganizeDlg *pDlg =
+ new SfxTemplateOrganizeDlg(this, pTemplates);
+ const short nRet = pDlg->Execute();
+ delete pDlg;
+ if(RET_OK == nRet)
+ {
+ // View aktualisieren
+ aRegionLb.SetUpdateMode( FALSE );
+ aRegionLb.Clear();
+ Init();
+ aRegionLb.SetUpdateMode( TRUE );
+ aRegionLb.Invalidate();
+ aRegionLb.Update();
+ aCancelBt.SetText(String(SfxResId(STR_CLOSE)));
+ }
+ else if(RET_EDIT_STYLE == nRet)
+ EndDialog(RET_CANCEL);
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentTemplateDlg, OkHdl, Control *, pControl )
+{
+ // pruefen, ob eine Vorlage diesen Namens existiert
+ if(LISTBOX_ENTRY_NOTFOUND != aTemplateLb.GetEntryPos(
+ GetTemplateName())) {
+ QueryBox aQuery(this, SfxResId(MSG_CONFIRM_OVERWRITE_TEMPLATE));
+ if(RET_NO == aQuery.Execute())
+ return 0;
+ }
+ EndDialog(RET_OK);
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentTemplateDlg, RegionSelect, ListBox *, pBox )
+{
+ const USHORT nRegion = pBox->GetSelectEntryPos();
+ const USHORT nCount = pTemplates->GetCount(nRegion);
+ aTemplateLb.SetUpdateMode(FALSE);
+ aTemplateLb.Clear();
+ for(USHORT i = 0; i < nCount; ++i)
+ aTemplateLb.InsertEntry(pTemplates->GetName(nRegion, i));
+ aTemplateLb.SelectEntryPos(0);
+ aTemplateLb.SetUpdateMode(TRUE);
+ aTemplateLb.Invalidate();
+ aTemplateLb.Update();
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxDocumentTemplateDlg, TemplateSelect, ListBox *, pBox )
+{
+ aNameEd.SetText(pBox->GetSelectEntry());
+ NameModify(&aNameEd);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxDocumentTemplateDlg, TemplateSelect, ListBox *, pBox )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxDocumentTemplateDlg, NameModify, Edit *, pBox )
+{
+ const String &rText=pBox->GetText();
+ if(!rText.Len())
+ aEditBt.Enable();
+ else
+ {
+ aTemplateLb.SelectEntry(rText);
+ aEditBt.Enable( aTemplateLb.GetSelectEntry() == rText );
+ }
+
+ aOkBt.Enable( rText.Len() > 0 );
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+String SfxDocumentTemplateDlg::GetTemplatePath()
+{
+ const String& rPath=GetTemplateName();
+ if(pTemplates->GetRegionCount())
+ return pTemplates->GetTemplatePath(
+ aRegionLb.GetSelectEntryPos(), rPath);
+ return pTemplates->GetDefaultTemplatePath(rPath);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDocumentTemplateDlg::NewTemplate(const String &rPath)
+{
+ pTemplates->NewTemplate(
+ aRegionLb.GetSelectEntryPos(), GetTemplateName(), rPath);
+}
+
+
diff --git a/sfx2/source/doc/doctdlg.hrc b/sfx2/source/doc/doctdlg.hrc
new file mode 100644
index 000000000000..d987e10ae7a8
--- /dev/null
+++ b/sfx2/source/doc/doctdlg.hrc
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * $RCSfile: doctdlg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define FT_SECTION 1
+#define LB_SECTION 2
+#define FT_STYLESHEETS 3
+#define LB_STYLESHEETS 4
+#define BT_ORGANIZE 20
+#define BT_HELP 21
+#define GB_EDIT 5
+#define FT_NAME 6
+#define ED_NAME 7
+#define BT_OK 10
+#define BT_SECTION 11
+#define BT_EDIT 12
+#define BT_NEW 13
+#define BT_DELETE 15
+#define BT_CANCEL 16
+#define GB_STYLESHEETS 17
diff --git a/sfx2/source/doc/doctdlg.src b/sfx2/source/doc/doctdlg.src
new file mode 100644
index 000000000000..d5468f6553ab
--- /dev/null
+++ b/sfx2/source/doc/doctdlg.src
@@ -0,0 +1,298 @@
+/*************************************************************************
+ *
+ * $RCSfile: doctdlg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include --------------------------------------------------------------
+#include "sfx.hrc"
+#include "doc.hrc"
+#include "doctdlg.hrc"
+ // pragma ---------------------------------------------------------------
+
+ // DLG_DOC_TEMPLATE -----------------------------------------------------
+ModalDialog DLG_DOC_TEMPLATE
+{
+ HelpId = SID_DOCTEMPLATE ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 280 , 140 ) ;
+ Text = "Dokumentvorlagen" ;
+ Text [ ENGLISH ] = "document templates" ;
+ Text [ norwegian ] = "Rediger dokumetmal" ;
+ Text [ italian ] = "Modelli" ;
+ Text [ portuguese_brazilian ] = "Editar o modelo do documento" ;
+ Text [ portuguese ] = "Modelos de documentos" ;
+ Text [ finnish ] = "Muokkaa asiakirjamallia" ;
+ Text [ danish ] = "Rediger dokumentskabelon" ;
+ Text [ french ] = "Modles de document" ;
+ Text [ swedish ] = "Dokumentmallar" ;
+ Text [ dutch ] = "Sjablonen" ;
+ Text [ spanish ] = "Plantilla de documento" ;
+ Text [ english_us ] = "Templates" ;
+ Moveable = TRUE ;
+ Edit ED_NAME
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 200 , 12 ) ;
+ };
+ GroupBox GB_EDIT
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 212 , 29 ) ;
+ Text = "Neue Dokumentvorlage" ;
+ Text [ English ] = "New Template" ;
+ Text [ dutch ] = "Nieuw sjabloon" ;
+ Text [ english_us ] = "New template" ;
+ Text [ italian ] = "Nuovo modello" ;
+ Text [ spanish ] = "Nueva plantilla" ;
+ Text [ french ] = "Nouveau modle de document" ;
+ Text [ swedish ] = "Ny dokumentmall" ;
+ Text [ danish ] = "Ny dokumentskabelon" ;
+ Text [ portuguese_brazilian ] = "Neue Dokumentvorlage" ;
+ Text [ portuguese ] = "Novo modelo" ;
+ Text[ chinese_simplified ] = "½ĵʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Nowy szablon dokumentu";
+ Text[ japanese ] = "Vڰ";
+ Text[ chinese_traditional ] = "}ҷs˦";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Yeni belge ablonu";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_SECTION
+ {
+ Pos = MAP_APPFONT ( 12 , 49 ) ;
+ Size = MAP_APPFONT ( 97 , 10 ) ;
+ Text = "~Bereiche" ;
+ Text [ ENGLISH ] = "~Groups" ;
+ Text [ norwegian ] = "~Grupper" ;
+ Text [ italian ] = "~Categorie" ;
+ Text [ portuguese_brazilian ] = "~Grupos" ;
+ Text [ portuguese ] = "~Categorias" ;
+ Text [ finnish ] = "~Ryhmt" ;
+ Text [ danish ] = "Omrder" ;
+ Text [ french ] = "~Catgories" ;
+ Text [ swedish ] = "~Kategorier" ;
+ Text [ dutch ] = "~Bereiken" ;
+ Text [ spanish ] = "~reas" ;
+ Text [ english_us ] = "~Categories" ;
+ Text[ chinese_simplified ] = "(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Obszary";
+ Text[ japanese ] = "͈(~C)";
+ Text[ chinese_traditional ] = "(~C)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~C)";
+ Text[ turkish ] = "~Kategori";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_SECTION
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 62 ) ;
+ Size = MAP_APPFONT ( 97 , 66 ) ;
+ };
+ FixedText FT_STYLESHEETS
+ {
+ Pos = MAP_APPFONT ( 115 , 49 ) ;
+ Size = MAP_APPFONT ( 97 , 10 ) ;
+ Text = "~Vorlagen" ;
+ Text [ ENGLISH ] = "~Templates" ;
+ Text [ norwegian ] = "~Maler" ;
+ Text [ italian ] = "~Modelli" ;
+ Text [ portuguese_brazilian ] = "~Modelos" ;
+ Text [ portuguese ] = "Modelos" ;
+ Text [ finnish ] = "~Mallit" ;
+ Text [ danish ] = "Skabeloner" ;
+ Text [ french ] = "~Noms de modles" ;
+ Text [ swedish ] = "~Mallar" ;
+ Text [ dutch ] = "S~jablonen" ;
+ Text [ spanish ] = "P~lantillas" ;
+ Text [ english_us ] = "~Templates" ;
+ Text[ chinese_simplified ] = "ʽ(~T)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Szablony";
+ Text[ japanese ] = "ڰ(~T)";
+ Text[ chinese_traditional ] = "˦(~T)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = " (~T)";
+ Text[ turkish ] = "~ablon";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_STYLESHEETS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 115 , 62 ) ;
+ Size = MAP_APPFONT ( 97 , 66 ) ;
+ };
+ GroupBox GB_STYLESHEETS
+ {
+ Pos = MAP_APPFONT ( 6 , 38 ) ;
+ Size = MAP_APPFONT ( 212 , 96 ) ;
+ Text = "Vorlagen" ;
+ Text [ ENGLISH ] = "Templates" ;
+ Text [ norwegian ] = "Maler" ;
+ Text [ italian ] = "Modelli" ;
+ Text [ portuguese_brazilian ] = "Modelos" ;
+ Text [ portuguese ] = "Modelos" ;
+ Text [ finnish ] = "Mallit" ;
+ Text [ danish ] = "Skabeloner" ;
+ Text [ french ] = "Modles existants" ;
+ Text [ swedish ] = "Mallar" ;
+ Text [ dutch ] = "Sjablonen" ;
+ Text [ spanish ] = "Plantillas" ;
+ Text [ english_us ] = "Templates" ;
+ Text[ chinese_simplified ] = "ʽ";
+ Text[ russian ] = "";
+ Text[ polish ] = "Szablony";
+ Text[ japanese ] = "ڰ";
+ Text[ chinese_traditional ] = "˦";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "ablon";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BT_OK
+ {
+ Pos = MAP_APPFONT ( 224 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE ;
+ Disable = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 224 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ HelpButton BT_HELP
+ {
+ Pos = MAP_APPFONT ( 224 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ PushButton BT_EDIT
+ {
+ Pos = MAP_APPFONT ( 224 , 62 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "~Bearbeiten" ;
+ Text [ English ] = "~Edit" ;
+ Text [ english_us ] = "~Edit" ;
+ Text [ dutch ] = "Be~werken" ;
+ Text [ italian ] = "Modifica" ;
+ Text [ spanish ] = "~Editar" ;
+ Text [ french ] = "~Personnaliser" ;
+ Text [ swedish ] = "~Redigera" ;
+ Text [ danish ] = "Rediger" ;
+ Text [ portuguese ] = "~Editar" ;
+ Text [ portuguese_brazilian ] = "~Bearbeiten" ;
+ Text[ chinese_simplified ] = "༭(~E)";
+ Text[ russian ] = "~";
+ Text[ polish ] = "~Edytuj";
+ Text[ japanese ] = "ҏW(~Ej";
+ Text[ chinese_traditional ] = "s(~E)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~E)";
+ Text[ turkish ] = "~Dzenle";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BT_ORGANIZE
+ {
+ Pos = MAP_APPFONT ( 224 , 79 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ Text = "Ver~walten..." ;
+ Text [ English ] = "~Manage..." ;
+ Text [ norwegian ] = "~Styre..." ;
+ Text [ italian ] = "Gestisci..." ;
+ Text [ portuguese_brazilian ] = "~Gerenciar..." ;
+ Text [ portuguese ] = "~Gerir..." ;
+ Text [ finnish ] = "~Ksittele..." ;
+ Text [ danish ] = "Administrer..." ;
+ Text [ french ] = "~Grer..." ;
+ Text [ swedish ] = "~Frvalta..." ;
+ Text [ dutch ] = "Be~heren..." ;
+ Text [ spanish ] = "~Administrar..." ;
+ Text [ english_us ] = "~Organizer..." ;
+ Text[ chinese_simplified ] = "(~O)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Zarzdzaj...";
+ Text[ japanese ] = "Ǘ(~O)...";
+ Text[ chinese_traditional ] = "޲z(~O)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "...";
+ Text[ korean ] = "(~O)...";
+ Text[ turkish ] = "Ynet...";
+ Text[ language_user1 ] = " ";
+ };
+ Text[ chinese_simplified ] = "ĵʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Szablony dokumentu";
+ Text[ japanese ] = "޷Ăڰ";
+ Text[ chinese_traditional ] = "˦";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Belge ablonu";
+ Text[ language_user1 ] = " ";
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
new file mode 100644
index 000000000000..dda94e26e399
--- /dev/null
+++ b/sfx2/source/doc/doctempl.cxx
@@ -0,0 +1,2484 @@
+/*************************************************************************
+ *
+ * $RCSfile: doctempl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <limits.h>
+#if ! defined( MAC ) && ! defined( UNX )
+#include <io.h>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_ANY_H_
+#include <com/sun/star/uno/Any.h>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+#include <tools/fsys.hxx>
+#include <tools/string.hxx>
+
+#include "doctempl.hxx"
+#include "docfac.hxx"
+#include "docfile.hxx"
+#include "objsh.hxx"
+#include "inimgr.hxx"
+#include "sfxtypes.hxx"
+#include "app.hxx"
+#include "inimgr.hxx"
+#include "sfxresid.hxx"
+#include "docfilt.hxx"
+#include "fltfnc.hxx"
+#include "doc.hrc"
+#include "ucbhelp.hxx"
+#include "openflag.hxx"
+
+//========================================================================
+
+const char __FAR_DATA pHeader[] = "Sfx Document Template Directory";
+const char __FAR_DATA pFileFileName[] = "sfx.tpl";
+const char __FAR_DATA pDirFileName[] = "sfx.tlx";
+const char __FAR_DATA pBakExtension[] = "bak";
+const char pMGName[] = "mg.bad";
+const char* cDefExtension = "*.vor";
+const char cDefWildcard = '*';
+
+#define CTRL_Z ((char)26)
+
+#define VERSION 4
+
+// Wird nur noch gebraucht, um die Datein beim Scannen zu "uberspringen
+// LongNameList_Impl needs this function, too!
+const String FileName_Impl(BOOL bDir)
+{
+ return bDir ? String::CreateFromAscii( pDirFileName ) :
+ String::CreateFromAscii( pFileFileName );
+}
+
+// ------------------------------------------------------------------------
+class LongNameList_Impl : public List
+{
+ List* mpNames;
+
+public:
+ LongNameList_Impl( const String& rDirName );
+ ~LongNameList_Impl();
+
+ String GetLongName( const String& rShortName ) const;
+ BOOL ReadHeader( SvStream& rStream ) const;
+};
+
+//------------------------------------------------------------------------
+class OpenNotifier_Impl : public SfxListener
+{
+ BOOL bEnd;
+//(dv) CntAnchorRef xAnchor;
+//(dv) CntOpenMode eMode;
+
+public:
+ OpenNotifier_Impl( /*(dv)const CntAnchorRef& rAnchor, CntOpenMode eOpenMode */ )
+ : bEnd( FALSE )
+//(dv) , xAnchor( rAnchor )
+//(dv) , eMode( eOpenMode )
+ {
+#if 0 //(dv)
+ StartListening( *xAnchor );
+ xAnchor->Put( SfxVoidItem( WID_GETDATA ) );
+ xAnchor->MakeVisible( TRUE );
+ xAnchor->MarkAsRoot();
+ xAnchor->DontThread();
+ xAnchor->Put( CntOpenModeItem(WID_OPEN,eMode) );
+#endif //(dv)
+ }
+
+ virtual void Notify( SfxBroadcaster&, const SfxHint& );
+ BOOL IsComplete() const
+ { return bEnd; }
+};
+
+void OpenNotifier_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+#if 0 //(dv)
+ if( rHint.ISA(CntStatusHint) )
+ {
+ const CntStatusHint& rStatusHint = (const CntStatusHint&)rHint;
+ USHORT nWhich = rStatusHint.GetRequest() ? rStatusHint.GetRequest()->Which() : 0;
+ const CntStatus eStatus = rStatusHint.GetStatus();
+ if ( nWhich == WID_OPEN && ( eStatus == CNT_STATUS_DONE || eStatus == CNT_STATUS_ERROR ) )
+ {
+ bEnd = TRUE;
+ EndListening( *xAnchor );
+ }
+ }
+#endif //(dv)
+}
+
+class SfxTemplateDir;
+
+
+class SfxTemplateDirEntry
+{
+//(dv) CntAnchorRef xAnchor;
+ String aLongName; // logischer Name des Benutzers
+ String aFileName; // Dateiname (ohne Pfad)
+ SfxTemplateDir* pParent; // Parentverzeichnis
+ DirEntry* pPath; // vollstaendiger Pfad ohne Name, wenn Dir.
+ SfxTemplateDir* pContent;
+ SfxObjectShellLock xObjShell;
+ SvStorageRef xStor;
+ BOOL bDidConvert;
+ BOOL bIsOwner;
+ BOOL bDefault;
+ BOOL bIsRoot;
+
+public:
+ SfxTemplateDirEntry( const String &rName,
+ SfxTemplateDir &rParent );
+ SfxTemplateDirEntry( const String &rName,
+ const String &rFileName,
+ SfxTemplateDir &rParent );
+ SfxTemplateDirEntry( const String &rName,
+ const DirEntry &rPath );
+ SfxTemplateDirEntry( const String &rName,
+ const String &rFileName,
+ const DirEntry &rPath, BOOL bRoot = FALSE );
+ SfxTemplateDirEntry( const SfxTemplateDirEntry & );
+ ~SfxTemplateDirEntry();
+
+ BOOL IsLoaded(){ return pContent!= 0; }
+ BOOL IsDefault() { return bDefault; }
+ BOOL IsRoot() { return bIsRoot; }
+
+ const SfxTemplateDir& GetParent() const { return *pParent; }
+ SfxTemplateDir& GetParent() { return *pParent; }
+ SfxTemplateDir& GetContent();
+ void SetContent(SfxTemplateDir *pCnt);
+
+ const String& GetLongName() const { return aLongName; }
+ const String& GetFileName() const { return aFileName; }
+ void SetLongName(const String &rStr) {aLongName = rStr;}
+ BOOL SetLongAndFileName( const String &rLong);
+ void SetFileName(const String &rStr) { aFileName = rStr; }
+ DirEntry GetFull() const;
+ DirEntry GetPath() const;
+ SfxObjectShellRef CreateObjectShell();
+ SfxObjectShellRef GetObjectShell() const { return (SfxObjectShellRef)(SfxObjectShell*) xObjShell; }
+ void SetObjectShell( SfxObjectShell *pSh )
+ { xObjShell = pSh; }
+ BOOL DeleteObjectShell();
+#if 0 //(dv)
+ void SetAnchor( const CntAnchorRef& rAnchor )
+ { xAnchor = rAnchor; }
+#endif //(dv)
+};
+
+//------------------------------------------------------------------------
+
+typedef SfxTemplateDirEntry* SfxTemplateDirEntryPtr;
+SV_DECL_PTRARR_DEL(_SfxTemplateDir, SfxTemplateDirEntryPtr, 16, 8)
+SV_IMPL_PTRARR(_SfxTemplateDir, SfxTemplateDirEntryPtr)
+
+//------------------------------------------------------------------------
+
+class SfxTemplateDir: public _SfxTemplateDir
+{
+ DirEntry aPath; // vollstaendiger Pfad zum Verzeichnis
+ BOOL bDir; // Directory?
+
+public:
+ const SfxTemplateDirEntry* Find_Impl(const DirEntry &rDirEntry) const;
+
+ SfxTemplateDir()
+ : bDir ( FALSE )
+ {}
+
+ SfxTemplateDir( const DirEntry &rPath )
+ : aPath(rPath)
+ , bDir( FALSE )
+ {}
+
+ SfxTemplateDir( const DirEntry &rPath,
+ BOOL bDirectory, BOOL bScan=2 );
+ SfxTemplateDir( const SfxTemplateDir & );
+
+ void Scan(BOOL bDirectory, BOOL bSave = FALSE);
+ const DirEntry& GetPath() const { return aPath; }
+ DirEntry& GetPath() { return aPath; }
+
+ // anhand des neuen TemplateDirs aktualisieren
+ BOOL Freshen(const SfxTemplateDir &rNew);
+ BOOL IsDir()
+ {return bDir;}
+};
+
+//------------------------------------------------------------------------
+
+void MakeFileName_Impl(DirEntry &rEntry,
+ const String &rLongName, BOOL bDir)
+{
+ String aFName(rLongName);
+ if(!bDir)
+ aFName+= DEFINE_CONST_UNICODE( ".vor" );
+ rEntry.MakeShortName(aFName, FSYS_KIND_NONE);
+}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry::SfxTemplateDirEntry
+(
+ const String& rName,
+ SfxTemplateDir& rP
+)
+
+/* [Beschreibung]
+
+ Konstuktor;
+ der Dateiname und der logische Name sind identisch
+
+*/
+
+: aLongName(rName),
+ aFileName(rName),
+ pContent(0),
+ pPath(0),
+ pParent(&rP),
+ bIsRoot( FALSE ),
+ bDefault( FALSE )
+{}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry::SfxTemplateDirEntry
+(
+ const String& rName,
+ const String& rFileName,
+ SfxTemplateDir& rP
+)
+/* [Beschreibung]
+
+ Konstuktor;
+ der Dateiname und der logische Name sind unterschiedlich
+
+*/
+
+: aLongName(rName),
+ aFileName(rFileName),
+ pContent(0),
+ pPath(0),
+ pParent(&rP),
+ bIsRoot( FALSE ),
+ bDefault( FALSE )
+{}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry::SfxTemplateDirEntry
+(
+ const String &rName, // Der Stream, aus dem gelesen werden soll
+ const DirEntry &rP // Parentverzeichnis
+)
+
+/* [Beschreibung]
+
+ Konstuktor;
+ der Dateiname und der logische Name sind identisch
+*/
+
+: aLongName(rName),
+ aFileName(rName),
+ pContent(0),
+ pPath(new DirEntry(rP)),
+ pParent(0),
+ bIsRoot( FALSE ),
+ bDefault( FALSE )
+{}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry::SfxTemplateDirEntry
+(
+ const String& rName,
+ const String& rFileName,
+ const DirEntry& rP, // Parentverzeichnis
+ BOOL bRoot
+)
+
+/* [Beschreibung]
+
+ Konstuktor;
+ der Dateiname und der logische Name sind unterschiedlich
+*/
+
+: aLongName(rName),
+ aFileName(rFileName),
+ pContent(0),
+ pPath(new DirEntry(rP)),
+ pParent(0),
+ bIsRoot( bRoot ),
+ bDefault( FALSE )
+{}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry::SfxTemplateDirEntry(const SfxTemplateDirEntry &rCopy)
+
+/* [Beschreibung]
+
+ Copy Konstruktor
+
+*/
+
+: aLongName(rCopy.aLongName),
+ aFileName(rCopy.aFileName),
+ pParent(rCopy.pParent),
+ pPath(rCopy.pPath? new DirEntry(*rCopy.pPath): 0),
+ pContent(rCopy.pContent? new SfxTemplateDir(*rCopy.pContent): 0),
+ bDefault( rCopy.bDefault )
+{}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry::~SfxTemplateDirEntry()
+
+/* [Beschreibung]
+
+ Destruktor
+
+*/
+
+{
+ DeleteObjectShell();
+ delete pContent;
+ delete pPath;
+ pParent = 0;
+}
+
+//------------------------------------------------------------------------
+
+SfxObjectShellRef SfxTemplateDirEntry::CreateObjectShell()
+
+/* [Beschreibung]
+
+ Anlegen einer DokumentShell zu diesem Entry; das Entry beinhaltet
+ den Dateinamen.
+
+
+ [R"uckgabewert]
+
+ SfxObjectShellRef Referenz auf die DokumentShell
+
+
+ [Querverweise]
+
+ <SfxTemplateDirEntry::DeleteObjectShell()>
+*/
+
+{
+ if(!xObjShell.Is())
+ {
+ bIsOwner=FALSE;
+ BOOL bDum = FALSE;
+ SfxApplication *pSfxApp = SFX_APP();
+ xObjShell = pSfxApp->DocAlreadyLoaded(GetFull().GetFull(),TRUE,bDum);
+ if(!xObjShell.Is())
+ {
+ bIsOwner=TRUE;
+ SfxMedium *pMed=new SfxMedium(
+ GetFull().GetFull(),(STREAM_READ | STREAM_SHARE_DENYWRITE),
+ FALSE, TRUE, 0);
+ const SfxFilter* pFilter = NULL;
+ if( pSfxApp->GetFilterMatcher().GuessFilter(
+ *pMed, &pFilter, SFX_FILTER_TEMPLATE, 0 ) ||
+ pFilter && !pFilter->IsOwnFormat() ||
+ pFilter && !pFilter->UsesStorage() )
+ {
+ SfxErrorContext aEc(ERRCTX_SFX_LOADTEMPLATE,
+ GetFull().GetFull(
+ FSYS_STYLE_HOST,FALSE,20));
+ delete pMed;
+ bDidConvert=TRUE;
+ ULONG lErr;
+ if ( xObjShell.Is() )
+ if(lErr=(pSfxApp->LoadTemplate(
+ xObjShell,GetFull().GetFull())!=ERRCODE_NONE))
+ ErrorHandler::HandleError(lErr);
+
+ }
+ else
+ {
+ const SfxObjectFactory &rFactory =
+ ((SfxFactoryFilterContainer*)pFilter->GetFilterContainer())
+ ->GetFactory();
+ delete pMed;
+ bDidConvert=FALSE;
+ xStor = new SvStorage(
+ GetFull().GetFull(),
+ STREAM_READWRITE | STREAM_NOCREATE |
+ STREAM_SHARE_DENYALL, STORAGE_TRANSACTED);
+ if ( pFilter )
+ xStor->SetVersion( pFilter->GetVersion() );
+ if ( SVSTREAM_OK == xStor->GetError() )
+ {
+ xObjShell = (SfxObjectShell *)
+ rFactory.CreateObject(SFX_CREATE_MODE_ORGANIZER);
+ if ( xObjShell.Is() )
+ {
+ xObjShell->DoInitNew(0);
+ if(!xObjShell->LoadFrom(xStor))
+ xObjShell.Clear();
+ else
+ {
+ xObjShell->DoHandsOff();
+ xObjShell->DoSaveCompleted(xStor);
+ }
+ }
+ }
+ }
+ }
+ }
+ return (SfxObjectShellRef)(SfxObjectShell*) xObjShell;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxTemplateDirEntry::DeleteObjectShell()
+
+/* [Beschreibung]
+
+ "oschen der DokumentShell dieses Entrys, sofern eine DokumentShell
+ angelegt wurde
+
+
+ [R"uckgabewert]
+
+ BOOL FALSE: es ist ein Fehler beim Speichern aufgetreten;
+ TRUE: das Dokument wurde gespeichert
+
+
+ [Querverweise]
+
+ <SfxTemplateDirEntry::CreateObjectShell()>
+*/
+
+{
+ BOOL bRet = TRUE;
+ if ( xObjShell.Is() )
+ {
+ if( xObjShell->IsModified() )
+ {
+ //Hier speichern wir auch, falls die Vorlage in Bearbeitung ist...
+ bRet=FALSE;
+ if ( bIsOwner )
+ if( bDidConvert)
+ {
+ bRet=xObjShell->PreDoSaveAs_Impl(
+ GetFull().GetFull(),
+ xObjShell->GetFactory().GetFilter(0)->GetName(),0 );
+ }
+ else
+ {
+ if(xObjShell->Save())
+ bRet=xStor->Commit();
+ else
+ bRet=FALSE;
+ }
+ }
+ if(bRet)
+ {
+ xObjShell.Clear();
+ xStor.Clear();
+ }
+ }
+ return bRet;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxTemplateDirEntry::SetLongAndFileName(const String &rStr)
+
+/* [Beschreibung]
+
+ Setzen der logischen Namens; geschieht dies auf einem Device,
+ da"s lange Namen unterst"utzt, wird auch die Datei physikalisch
+ auf diesen logischen Namen umbenannt.
+
+
+ [Querverweise]
+ <SfxDocTemplateDirEntry::GetLongName()>
+*/
+
+{
+ if(aLongName==rStr)
+ return TRUE;
+ DirEntry aActName(GetFull());
+ DirEntry aNew(aActName.GetPath());
+
+ MakeFileName_Impl(aNew,rStr,!pParent || pParent->IsDir());
+
+ String aNewFileName(aNew.GetFull());
+
+ if(aNew==aActName)
+ {
+ aLongName=rStr;
+ aFileName = aNewFileName;
+ return TRUE;
+ }
+
+ FSysError eErr;
+ eErr=aActName.MoveTo(aNew);
+ if ( FSYS_ERR_OK == eErr )
+ {
+ aLongName = rStr;
+ aFileName = DirEntry( aNewFileName ).GetName();
+
+ // Pfade in den Verwaltungsdaten anpassen
+ if ( pContent )
+ {
+ const USHORT nCount = pContent->Count();
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ SfxTemplateDir *pParent = (*pContent)[i]->pParent;
+ if ( pParent )
+ pParent->GetPath().SetName(aFileName);
+ }
+ pContent->GetPath().SetName(aFileName);
+ }
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+DirEntry SfxTemplateDirEntry::GetPath() const
+
+/* [Beschreibung]
+
+ Liefert den Pfad zu diesem Eintry (Pfad + FileName == vollst"andiger
+ Pfad zu der diesem Entry zugeordneten Datei)
+
+ [Querverweise]
+ <SfxDocTemplateDirEntry::GetFull()>
+*/
+
+{
+ return pParent? pParent->GetPath(): *pPath;
+}
+
+//------------------------------------------------------------------------
+
+DirEntry SfxTemplateDirEntry::GetFull() const
+
+/* [Beschreibung]
+
+ Liefert den Pfad plus Dateiname zu diesem Eintry
+
+ [Querverweise]
+ <SfxDocTemplateDirEntry::GetPath()>
+*/
+
+{
+ DirEntry aEntry(GetPath());
+ aEntry += DirEntry(aFileName);
+ return aEntry;
+}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDir &SfxTemplateDirEntry::GetContent()
+
+/* [Beschreibung]
+
+ Zugriff auf den Inhalt eines Bereiches; der Bereich wird erst
+ bei Bedarf eingelesen.
+
+*/
+
+{
+ DBG_ASSERT(!pParent || pParent->IsDir(), "Ist kein Dir");
+ if ( !pContent )
+ pContent = new SfxTemplateDir(GetFull(), FALSE);
+ return *pContent;
+}
+
+
+
+//------------------------------------------------------------------------
+
+void SfxTemplateDirEntry::SetContent(SfxTemplateDir *pCnt)
+
+/* [Beschreibung]
+
+ Setzt den Inhalt eines Bereiches; der alte Bereich wird
+ gel"oscht
+
+*/
+
+{
+ delete pContent;
+ pContent = pCnt;
+}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDirEntry* SeekEntry_Impl(SfxTemplateDir &rDir, const String &rLongName, USHORT * = 0);
+
+SfxTemplateDirEntry* SeekEntry_Impl
+(
+ SfxTemplateDir& rDir, // Das Directory, in dem gesucht werden soll
+ const String& rLongName, /* der logische Name, dessen Eintrag gefunden
+ werden soll */
+
+ USHORT* pUS /* Optional, enth"alt, falls gefunden, den Index
+ des Eintrags in rDir. */
+
+)
+
+/* [Beschreibung]
+
+ Sucht einen Eintrag anhand seines logischen Namens
+
+
+ [R"uckgabewert]
+
+ SfxTemplateDirEntry* Pointer auf den gefundenen Eintrag oder NULL,
+ wenn nicht gefunden.
+
+*/
+
+{
+ BOOL bCaseSensitive = rDir.GetPath().IsCaseSensitive();
+ const USHORT nCount = rDir.Count();
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ const String& rName = rDir[i]->GetLongName();
+ if ( bCaseSensitive && rName == rLongName ||
+ !bCaseSensitive && rName.CompareIgnoreCaseToAscii( rLongName ) == COMPARE_EQUAL )
+ {
+ if ( pUS )
+ *pUS = i;
+ return rDir[i];
+ }
+ }
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDir::SfxTemplateDir
+(
+ const DirEntry& rPath,
+ BOOL bDirectory,
+ BOOL bScan
+)
+
+/* [Beschreibung]
+
+ Konstruktor
+ Wenn Directory, alle Verzeichnisse dieses Directories
+ sonst alle Vorlagen in diesem Directory
+
+ [Querverweise]
+ <SfxDocTemplateDir::Scan()>
+ <SfxDocTemplateDir::Load(const DirEntry &rFile, BOOL bDirectory)>
+*/
+
+: _SfxTemplateDir()
+ ,bDir(bDirectory)
+ ,aPath(rPath)
+{
+ if(!FileStat(rPath).IsKind(FSYS_KIND_DIR)) return;
+
+ if( bScan==2 || !bScan )
+ Scan(bDirectory, TRUE);
+ else
+ Scan(bDirectory, FALSE);
+}
+
+//------------------------------------------------------------------------
+
+void SfxTemplateDir::Scan
+(
+ BOOL bDirectory, // Flag, Directory oder Dateien in diesem Directory
+ BOOL bSave // Flag, speichern der sfx.tpl Files
+)
+
+/* [Beschreibung]
+
+ Liest ein Directory / den Inhalt eines Directorys von Platte ein
+*/
+
+{
+ LongNameList_Impl *pDirList = NULL;
+ DirEntry aActDir;
+ aActDir.ToAbs();
+ DirEntry aTmpPath(aPath);
+ aTmpPath.SetCWD();
+ const String aDirWild('*');
+ const String aDefDirWild(cDefWildcard);
+ const DirEntry aWild(bDirectory? aDirWild: aDefDirWild);
+ Dir aDir(aWild, bDirectory? FSYS_KIND_DIR: FSYS_KIND_FILE, FSYS_SORT_END);
+ DBG_ASSERT(aDir.Count() < USHRT_MAX, "zu viele DirEntraege");
+ const USHORT nCount = (USHORT)aDir.Count();
+ if(bDirectory)
+ {
+ const SfxTemplateDirEntryPtr pE=new SfxTemplateDirEntry(SfxResId(STR_STANDARD),String(),aTmpPath,TRUE);
+ Insert(pE, 0 );
+ pDirList = new LongNameList_Impl( aPath.GetFull( FSYS_STYLE_URL, TRUE ) );
+ }
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ const DirEntry aDirEntry(aDir[i]);
+ const String aFileName(aDirEntry.GetName());
+ if ( aFileName.Len() &&
+ aFileName.CompareIgnoreCaseToAscii(pFileFileName)!=COMPARE_EQUAL &&
+ aFileName.CompareIgnoreCaseToAscii(pDirFileName)!=COMPARE_EQUAL &&
+ aFileName.GetChar(0) != '.' )
+ {
+ const SfxFilter* ppFilter = NULL;
+
+ if ( !bDirectory )
+ {
+/*
+ SfxMedium aSfxMedium( aDirEntry.GetName(),
+ STREAM_READ | STREAM_SHARE_DENYNONE,
+ FALSE );
+ if( SFX_APP()->GetFilterMatcher().GuessFilter(
+ aSfxMedium,
+ &ppFilter,
+ SFX_FILTER_IMPORT | SFX_FILTER_TEMPLATE )
+ || !ppFilter
+ || !ppFilter->IsAllowedAsTemplate() )
+ continue;
+ */
+ }
+ else if ( aFileName.CompareIgnoreCaseToAscii( "wizard" ) == COMPARE_EQUAL ||
+ aFileName.CompareIgnoreCaseToAscii( "internal" ) == COMPARE_EQUAL )
+ // hide internal template folder
+ continue;
+
+ String aLongName;
+
+ // try to get the long name of the entry. To get the long name of files
+ // we have to look into these files by getting the document info. The
+ // long names of directories are stored in a file named sfx.tlx. The
+ // pDirList should contain the data of that file. When we haven't found
+ // a long name, the long name will be set to the file name.
+ if ( !bDirectory )
+ {
+ DirEntry aName( aPath );
+ aName += aFileName;
+ SvStorageRef aStor = new SvStorage( aName.GetFull(), SFX_STREAM_READONLY );
+ if ( aStor->GetError() == SVSTREAM_OK )
+ {
+ SfxDocumentInfo aInfo;
+ BOOL bOK = aInfo.Load( aStor );
+ if ( bOK )
+ aLongName = aInfo.GetTitle();
+ }
+
+ if ( !aLongName.Len() )
+ aLongName = aName.GetBase();
+ }
+ else
+ {
+ if ( pDirList )
+ aLongName = pDirList->GetLongName( aFileName );
+ if ( !aLongName.Len() )
+ aLongName = aFileName;
+ }
+
+ const SfxTemplateDirEntryPtr pEntry = bDirectory?
+ new SfxTemplateDirEntry(aLongName, aFileName, aTmpPath):
+ new SfxTemplateDirEntry(aLongName, aFileName, *this);
+ const String &rLongName = pEntry->GetLongName();
+ const International aInter(GetpApp()->GetAppInternational());
+ const USHORT nCount = Count();
+ // initial sortiert einfuegen
+ USHORT ii;
+ for ( ii = bDirectory ? 1 : 0; //Ist Standard mit drinnen?
+ ii < Count() && COMPARE_LESS ==
+ aInter.Compare( (*this)[ii]->GetLongName(), rLongName);
+ ++ii)
+ ;
+ Insert(pEntry, ii);
+ }
+ }
+
+ if ( bSave && Count() )
+ {
+ DirEntry aFile(aTmpPath);
+ }
+
+ DirEntry aDumDir(FSYS_FLAG_ABSROOT);
+ aDumDir.SetCWD();
+ aActDir.SetCWD();
+
+ delete pDirList;
+}
+
+//------------------------------------------------------------------------
+
+SfxTemplateDir::SfxTemplateDir ( const SfxTemplateDir &rCopy ) :
+
+/* [Beschreibung]
+
+ Copy- Konstruktor
+
+*/
+
+ _SfxTemplateDir( (BYTE)rCopy.Count(), 1 ),
+
+ bDir( rCopy.bDir ),
+ aPath( rCopy.aPath )
+{
+ const USHORT nCount = rCopy.Count();
+ for (USHORT i = 0; i < nCount; ++i)
+ {
+ const SfxTemplateDirEntryPtr pEntry =
+ new SfxTemplateDirEntry( *rCopy[i] );
+ Insert( pEntry, i );
+ }
+}
+
+//------------------------------------------------------------------------
+
+const SfxTemplateDirEntry *SfxTemplateDir::Find_Impl
+(
+ const DirEntry& rDirEntry /* der Dateiname, dessen zugeordneter Eintrag
+ gefunden werden soll. */
+
+) const
+
+/* [Beschreibung]
+
+ Sucht einen Eintrag anhand seines Dateinamens
+
+
+ [R"uckgabewert] Pointer auf den gefundenen Eintrag oder NULL,
+ wenn nicht gefunden.
+
+*/
+
+{
+ const USHORT nCount = Count();
+ for (USHORT i = 0; i < nCount; ++i)
+ {
+ const SfxTemplateDirEntry *pEntry = (*this)[i];
+// const DirEntry aFileName(pEntry->GetFileName());
+ if(pEntry->GetFull() == rDirEntry)
+ return pEntry;
+ }
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxTemplateDir::Freshen
+(
+ const SfxTemplateDir& rNew /* Das Directory, gegen das dieses Directoy
+ abgeglichen werden soll */
+
+)
+
+/* [Beschreibung]
+
+ Dieses Directory anhand des TemplateDirs rNew aktualisieren
+ (Aktualisieren aus Benutzersicht; das aktuelle Directory
+ wird gegen ein neu eingelesenes abgeglichen
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ wurde modifiziert
+
+ FALSE
+ wurde nicht modifiziert
+*/
+
+{
+ USHORT i = 0;
+ BOOL bModified = FALSE;
+ // alle die entfernen, wo die Datei physikalisch nicht
+ // mehr vorhanden ist
+ while(i < Count())
+ {
+ SfxTemplateDirEntry *pEntry = (*this)[i];
+ if(!rNew.Find_Impl(pEntry->GetFull()))
+ {
+ Remove(i, 1);
+ delete pEntry;
+ bModified = TRUE;
+ }
+ else
+ ++i;
+ }
+ // alle die aufnehmen, wo der Dateiname aus rNew in der aktuellen
+ // Version nicht vorhanden ist
+ const USHORT nCount = rNew.Count();
+ for(i = 0; i < nCount; ++i)
+ {
+ const SfxTemplateDirEntry *pEntry = rNew[i];
+ if(!Find_Impl(pEntry->GetFull()))
+ {
+ SfxTemplateDirEntry *pNew = new SfxTemplateDirEntry(*pEntry);
+/* if(&pEntry->GetParent())
+ pNew->GetParent()=*this;*/
+ Insert(pNew, Count());
+ bModified = TRUE;
+ }
+ }
+ return bModified;
+}
+
+//------------------------------------------------------------------------
+
+String SfxDocumentTemplates::GetFullRegionName
+(
+ USHORT nIdx // Index des Bereiches
+) const
+
+/* [Beschreibung]
+
+ Liefert den logischen Namen eines Bereiches Plus seinem Pfad
+
+
+ [R"uckgabewert] Referenz auf diesen Namen
+
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ String aName=(*pDirs)[nIdx]->GetLongName();
+
+ USHORT nCount=pDirs->Count();
+ for(USHORT i=0;i<nCount;i++)
+ {
+ if(i!=nIdx && (*pDirs)[i]->GetLongName()==aName)
+ {
+ DirEntry aParent( (*pDirs)[nIdx]->GetFull() );
+ if ( !(*pDirs)[nIdx]->IsRoot() )
+ aParent.CutName();
+ aName += DEFINE_CONST_UNICODE( " (" );
+ aName += aParent.GetFull( FSYS_STYLE_HOST, FALSE, 10 );
+ aName += DEFINE_CONST_UNICODE( ")" );
+ break;
+ }
+ }
+ return aName;
+}
+
+//------------------------------------------------------------------------
+
+const String& SfxDocumentTemplates::GetRegionName
+(
+ USHORT nIdx // Index des Bereiches
+) const
+
+/* [Beschreibung]
+
+ Liefert den logischen Namen eines Bereiches
+
+
+ [R"uckgabewert]
+
+ const String& Referenz auf diesen Namen
+
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ return (*pDirs)[nIdx]->GetLongName();
+}
+
+
+//------------------------------------------------------------------------
+
+USHORT SfxDocumentTemplates::GetRegionNo
+(
+ const String &rRegion // Name der Region
+) const
+
+/* [Beschreibung]
+
+ Liefert den Index f"ur einen logischen Namen eines Bereiches.
+
+
+ [R"uckgabewert]
+
+ USHORT Index von 'rRegion' oder USHRT_MAX falls unbekannt
+
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ for ( USHORT n = 0; n < pDirs->Count(); ++n )
+ if ( (*pDirs)[n]->GetLongName() == rRegion )
+ return n;
+ return USHRT_MAX;
+}
+
+
+//------------------------------------------------------------------------
+
+USHORT SfxDocumentTemplates::GetRegionCount() const
+
+/* [Beschreibung]
+
+ Liefert die Anzahl der Bereiche
+
+
+ [R"uckgabewert]
+
+ USHORT Anzahl der Bereiche
+
+*/
+{
+ return pDirs->Count();
+}
+
+//------------------------------------------------------------------------
+
+USHORT SfxDocumentTemplates::GetCount
+(
+ const String& rName /* Name des Bereiches, dessen Eintrags-
+ anzahl ermittelt werden soll */
+
+) const
+
+/* [Beschreibung]
+
+ Liefert die Anzahl der Eintr"age eines Bereiches
+
+
+ [R"uckgabewert]
+
+ USHORT Anzahl der Eintr"age
+
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+ SfxTemplateDirEntry *pEntry = SeekEntry_Impl(*pDirs, rName);
+ DBG_ASSERT(pEntry , "Eintrag nicht gefunden");
+ return pEntry? pEntry->GetContent().Count(): 0;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::IsRegionLoaded( USHORT nIdx ) const
+{
+ return (*pDirs)[nIdx]->IsLoaded();
+}
+
+//------------------------------------------------------------------------
+
+USHORT SfxDocumentTemplates::GetCount
+(
+ USHORT nRegion /* Index des Bereiches, dessen Eintrags-
+ anzahl ermittelt werden soll */
+
+) const
+
+/* [Beschreibung]
+
+ Liefert die Anzahl der Eintr"age eines Bereiches
+
+
+ [R"uckgabewert] Anzahl der Eintr"age
+
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ DBG_ASSERT(nRegion < GetRegionCount(), "Regions ueberindiziert");
+ return (*pDirs)[nRegion]->GetContent().Count();
+}
+
+//------------------------------------------------------------------------
+
+const String& SfxDocumentTemplates::GetName
+(
+ USHORT nRegion, // Index des Bereiches, in dem der Eintrag liegt
+ USHORT nIdx // Index des Eintrags
+) const
+
+/* [Beschreibung]
+
+ Liefert den logischen Namen eines Eintrags eines Bereiches
+
+
+ [R"uckgabewert]
+
+ const String& Name des Eintrags
+
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ return (*pDirs)[nRegion]->GetContent()[nIdx]->GetLongName();
+}
+
+//------------------------------------------------------------------------
+
+const String& SfxDocumentTemplates::GetFileName
+(
+ USHORT nRegion, // Index des Bereiches, in dem der Eintrag liegt
+ USHORT nIdx // Index des Eintrags
+) const
+
+/* [Beschreibung]
+
+ Liefert den Dateinamen eines Eintrags eines Bereiches
+
+ [R"uckgabewert] Dateiname des Eintrags
+
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ return (*pDirs)[nRegion]->GetContent()[nIdx]->GetFileName();
+}
+
+//------------------------------------------------------------------------
+
+String SfxDocumentTemplates::GetPath
+(
+ USHORT nRegion, // Index des Bereiches, in dem der Eintrag liegt
+ USHORT nIdx // Index des Eintrags
+) const
+
+/* [Beschreibung]
+
+ Liefert den Dateinamen mit vollst"andigem Pfad zu der einem
+ Eintrag zugeordneten Datei
+
+
+ [R"uckgabewert]
+
+ String Dateiname mit vollst"andigem Pfad
+
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ SfxTemplateDirEntry *pDirectory = (*pDirs)[nRegion];
+ SfxTemplateDirEntry *pEntry = pDirectory->GetContent()[nIdx];
+ return pEntry->GetFull().GetFull();
+}
+
+//------------------------------------------------------------------------
+
+String SfxDocumentTemplates::GetTemplatePath
+(
+ USHORT nRegion, // Index des Bereiches, in dem der Eintrag liegt
+ const String& rLongName // logischer Name des Eintrags
+) const
+
+/* [Beschreibung]
+
+ Liefert den Dateinamen mit vollst"andigem Pfad zu der einem
+ Eintrag zugeordneten Datei
+
+
+ [R"uckgabewert]
+
+ String Dateiname mit vollst"andigem Pfad
+
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ SfxTemplateDirEntry *pDirectory = (*pDirs)[nRegion];
+ DirEntry aPath(pDirectory->GetFull());
+ const SfxTemplateDirEntry *pEntry = SeekEntry_Impl(pDirectory->GetContent(), rLongName);
+
+ // Vorlage mit diesem Langnamen existiert bereits
+ // => deren Dateiname muss verwendet werden
+ if(pEntry)
+ aPath += DirEntry(pEntry->GetFileName());
+ else
+ // Dateiname generieren
+ MakeFileName_Impl(aPath, rLongName, pDirectory->GetContent().IsDir());
+ aPath.ToAbs();
+ return aPath.GetFull();
+}
+
+//------------------------------------------------------------------------
+
+String SfxDocumentTemplates::GetDefaultTemplatePath
+(
+ const String&
+ rLongName
+)
+
+/* [Beschreibung]
+
+ Liefert den Standardpfad zu Dokumentvorlagen
+
+
+ [R"uckgabewert]
+
+ String Standardpfad zu Dokumentvorlagen
+
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ const String aSep(';');
+ cDelim = aSep.GetChar(0);
+ DBG_ASSERT(aDirs.GetTokenCount(cDelim), "Keine Bereiche");
+ DirEntry aPath(aDirs.GetToken(0, cDelim));
+
+ // Verzeichnis anlegen
+ if(!aPath.MakeDir())
+ return String();
+ MakeFileName_Impl(aPath, rLongName, TRUE);
+ SfxTemplateDir *pEntry = new SfxTemplateDir;
+ SfxTemplateDirEntryPtr pDirEntry =
+ new SfxTemplateDirEntry( String( '.' ), aPath.GetPath() );
+ pDirEntry->SetContent(new SfxTemplateDir(aPath.GetPath()));
+ pEntry->Insert(pDirEntry, pEntry->Count());
+ pDirs->Insert(pEntry, pDirs->Count());
+ return aPath.GetFull();
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::SaveDir
+(
+ SfxTemplateDir& rDir // das zu speichernde Directory
+)
+
+/* [Beschreibung]
+
+ Speichert das Directory rDir
+
+
+ [R"uckgabewert]
+
+ BOOL FALSE,
+ Schreibfehler
+
+ TRUE
+ gespeichert
+
+*/
+
+{
+ return TRUE;
+}
+
+//------------------------------------------------------------------------
+
+void SfxDocumentTemplates::NewTemplate
+(
+ USHORT nRegion, /* Index des Bereiches, in dem die Vorlage
+ angelegt werden soll */
+
+ const String& rLongName, // logischer Name der neuen Vorlage
+ const String& rFileName // Dateiname der neuen Vorlage
+)
+
+/* [Beschreibung]
+
+ Eintragen einer neuen Dokumentvorlage in die Verwaltungsstrukturen
+ Das "Uberschreiben einer Vorlage gleichen Namens wird
+ verhindert (!! Fehlermeldung)
+
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ SfxTemplateDirEntry *pDirectory = (*pDirs)[nRegion];
+ SfxTemplateDir &rEntry = pDirectory->GetContent();
+
+ // Eintrag existiert bereits
+ if(SeekEntry_Impl(pDirectory->GetContent(), rLongName))
+ return;
+ const SfxTemplateDirEntryPtr pNewEntry =
+ new SfxTemplateDirEntry(rLongName, rFileName, rEntry);
+ rEntry.Insert(pNewEntry, rEntry.Count());
+ SaveDir(rEntry);
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::CopyOrMove
+(
+ USHORT nTargetRegion, // Index des Zielbereiches
+ USHORT nTargetIdx, // Index Zielposition
+ USHORT nSourceRegion, // Index des Quellbereiches
+ USHORT nSourceIdx, /* Index der zu kopierenden / zu verschiebenden
+ Dokumentvorlage */
+ BOOL bMove // kopieren / verschieben
+)
+
+/* [Beschreibung]
+
+ Kopieren oder Verschieben einer Dokumentvorlage
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef2uhrt werden
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::Move(USHORT,USHORT,USHORT,USHORT)>
+ <SfxDocumentTemplates::Copy(USHORT,USHORT,USHORT,USHORT)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ if(nSourceIdx == USHRT_MAX) // keine Verzeichnisse verschieben, kopieren
+ return FALSE ;
+ SfxTemplateDirEntry *pTargetDirectory = (*pDirs)[nTargetRegion];
+ SfxTemplateDirEntry *pSourceDirectory = (*pDirs)[nSourceRegion];
+ SfxTemplateDir &rTargetDir = pTargetDirectory->GetContent();
+ SfxTemplateDir &rSourceDir = pSourceDirectory->GetContent();
+ SfxTemplateDirEntry *pSourceEntry = rSourceDir[nSourceIdx];
+
+ // Verschieben einer Vorlage innerhalb eines Bereiches
+ // --> nur Verwaltungsdaten aktualisieren
+ if ( bMove && nTargetRegion == nSourceRegion && nSourceIdx != USHRT_MAX )
+ {
+ if(nTargetIdx == USHRT_MAX)
+ nTargetIdx = 0;
+ const SfxTemplateDirEntryPtr pEntry = rTargetDir[nSourceIdx];
+ rTargetDir.Insert(pEntry, nTargetIdx);
+ if(nTargetIdx < nSourceIdx)
+ ++nSourceIdx;
+ rTargetDir.Remove(nSourceIdx);
+ return SaveDir(rTargetDir);
+ }
+
+ if(nTargetIdx == USHRT_MAX)
+ nTargetIdx = rTargetDir.Count();
+ // Eintrag existiert bereits
+ if(SeekEntry_Impl(rTargetDir, pSourceEntry->GetLongName()))
+ return FALSE;
+ DirEntry aSource(pSourceEntry->GetFull());
+ DirEntry aDest(rTargetDir.GetPath());
+ MakeFileName_Impl(
+ aDest, rSourceDir[nSourceIdx]->GetLongName(), rTargetDir.IsDir());
+
+ // wenn aktuell das File geoeffnet ist,
+ // muss es hinterher wieder geoeffnet werden
+ SfxObjectShellRef xObjRef = pSourceEntry->GetObjectShell();
+ const BOOL bOpen = xObjRef.Is();
+ BOOL bOk = FALSE;
+ SvStorageRef aNewStor;
+ if(bOpen)
+ {
+ if(bMove)
+ {
+ xObjRef->DoHandsOff();
+ const FSysError eErrno = aSource.MoveTo(aDest);
+ bOk = FSYS_ERR_OK == eErrno;
+ }
+ else
+ {
+ // kopieren als speichern unter neuem Namen
+ aNewStor = new SvStorage(aDest.GetFull());
+ bOk = xObjRef->DoSaveAs(aNewStor);
+ // alten Storage wieder einsetzen -> Kopieren ist fertig
+ xObjRef->DoSaveCompleted( (SfxMedium*) 0 );
+ }
+ }
+ else
+ {
+ const FSysError eErrno =
+ bMove? aSource.MoveTo(aDest): aSource.CopyTo(aDest, FSYS_ACTION_COPYFILE);
+ bOk = FSYS_ERR_OK == eErrno;
+ }
+
+ if(bOk)
+ {
+ // neuen Eintrag einfuegen
+ // und Directory Eintraege schreiben
+ SfxTemplateDirEntryPtr pNewEntry = new SfxTemplateDirEntry(
+ rSourceDir[nSourceIdx]->GetLongName(),
+ aDest.GetName(),
+ rTargetDir);
+
+ rTargetDir.Insert(pNewEntry, nTargetIdx);
+ SaveDir(rTargetDir);
+
+ // gfs. alten Eintrag loeschen
+ if(bMove)
+ {
+ delete rSourceDir[nSourceIdx];
+ rSourceDir.Remove(nSourceIdx);
+ SaveDir(rSourceDir);
+
+ // Zielstorage einsetzen
+ if(bOpen)
+ {
+ // ObjectShell anlegen
+ const SfxObjectFactory &rFactory = SfxObjectFactory::GetDefaultFactory();
+ SfxObjectShellRef xObj =
+ rFactory.CreateObject(SFX_CREATE_MODE_ORGANIZER);
+ pNewEntry->SetObjectShell( xObj );
+ if ( xObj.Is() )
+ {
+ xObj->DoInitNew(0);
+ xObj->LoadFrom(aNewStor);
+ }
+ }
+ }
+ }
+ return bOk;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::Move
+(
+ USHORT nTargetRegion, // Index des Zielbereiches
+ USHORT nTargetIdx, // Index Zielposition
+ USHORT nSourceRegion, // Index des Quellbereiches
+ USHORT nSourceIdx /* Index der zu kopierenden / z uverschiebenden
+ Dokumentvorlage */
+)
+
+/* [Beschreibung]
+
+ Verschieben einer Dokumentvorlage
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef2uhrt werden
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::CopyOrMove(USHORT,USHORT,USHORT,USHORT,BOOL)>
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ return CopyOrMove(nTargetRegion, nTargetIdx, nSourceRegion, nSourceIdx, TRUE);
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::Copy
+(
+ USHORT nTargetRegion, // Index des Zielbereiches
+ USHORT nTargetIdx, // Index Zielposition
+ USHORT nSourceRegion, // Index des Quellbereiches
+ USHORT nSourceIdx /* Index der zu kopierenden / z uverschiebenden
+ Dokumentvorlage */
+)
+
+/* [Beschreibung]
+
+ Kopieren einer Dokumentvorlage
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::CopyOrMove(USHORT,USHORT,USHORT,USHORT,BOOL)>
+*/
+
+{
+ return CopyOrMove(nTargetRegion, nTargetIdx, nSourceRegion, nSourceIdx, FALSE);
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::CopyTo
+(
+ USHORT nRegion, /* Bereich der Vorlage, die exportiert werden
+ soll */
+ USHORT nIdx, /* Index der Vorlage, die exportiert werden
+ soll */
+ const String& rName /* Dateiname, unter dem die Vorlage angelegt
+ werden soll */
+) const
+
+/* [Beschreibung]
+
+ Exportieren einer Dokumentvorlage in das Dateisystem
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::CopyFrom(USHORT,USHORT,String&)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ SfxTemplateDirEntry *pSourceDirectory = (*pDirs)[nRegion];
+ SfxTemplateDir &rSourceDir = pSourceDirectory->GetContent();
+ SfxTemplateDirEntry *pSourceEntry = rSourceDir[nIdx];
+ DirEntry aSource(pSourceEntry->GetFull());
+ DirEntry aDest(rName);
+ FSysError eErr = aSource.CopyTo(aDest, FSYS_ACTION_COPYFILE);
+ return FSYS_ERR_OK == eErr;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::CopyFrom
+(
+ USHORT nRegion, /* Bereich, in den die Vorlage importiert
+ werden soll */
+ USHORT nIdx, // Index der neuen Vorlage in diesem Bereich
+ String& rName /* Dateiname der Vorlage, die importiert
+ werden soll, als out-Parameter der (auto-
+ matisch aus dem Dateinamen generierte)
+ logische Name der Vorlage */
+)
+
+/* [Beschreibung]
+
+ Importieren einer Dokumentvorlage aus dem Dateisystem
+
+
+ [R"uckgabewert] Erfolg (TRUE) oder Mi"serfpTargetDirectory->GetContent());
+}
+
+
+//------------------------------------------------------------------------
+#pragmaolg (FALSE)
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::CopyTo(USHORT,USHORT,const String&)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ // Datei kopieren auf temp. Namen
+ // automatischen Namen erzeugen
+ // Vorlage in die Struktur einfuegen
+ // Struktur speichern
+ // Vorlage in die Listbox einfuegen (geschieht in der rufenden Funktion)
+ DirEntry aSource(rName);
+ SfxTemplateDirEntry *pTargetDirectory = (*pDirs)[nRegion];
+ SfxTemplateDir &rTargetDir=pTargetDirectory->GetContent();
+ DirEntry aTarget(pTargetDirectory->GetFull());
+ rName=aSource.GetBase();
+ MakeFileName_Impl(aTarget, rName, FALSE);
+
+ FSysError eErr = aSource.CopyTo(aTarget, FSYS_ACTION_COPYFILE);
+ if(FSYS_ERR_OK != eErr)
+ return FALSE;
+ rName = aSource.GetBase();
+ const SfxTemplateDirEntryPtr pNewEntry = new SfxTemplateDirEntry(rName,
+ aTarget.GetFull(), aTarget.GetPath());
+ rTargetDir.Insert(pNewEntry, nIdx+1);
+ return SaveDir(rTargetDir);
+}
+
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::KillDir
+(
+ SfxTemplateDir& rDir // das zu l"oschen de Directory
+)
+
+/* [Beschreibung]
+
+ "oschen des Verzeichnisses rDir incl. seines Inhaltes;
+ dies geschieht sowohl auf der Platte als auch in den Verwaltungsdaten.
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+ // alle Vorlagen in dem Verzeichnis loeschen
+ USHORT i = 0;
+ BOOL bOk = TRUE;
+ while(i < rDir.Count())
+ {
+ SfxTemplateDirEntry *pEntry = rDir[i];
+ pEntry->DeleteObjectShell();
+ DirEntry aFile(pEntry->GetFull());
+ const FSysError eErr = aFile.Kill();
+ if(FSYS_ERR_OK == eErr || !aFile.Exists()) //! FSYS_ERR_NOTEXISTS == eErr)
+ {
+ rDir.Remove(i);
+ delete pEntry;
+ }
+ else
+ {
+ ++i;
+ bOk = FALSE;
+ }
+ }
+ if(bOk)
+ {
+ FSysError eErr = rDir.GetPath().Kill();
+ bOk = (FSYS_ERR_OK == eErr || !rDir.GetPath().Exists()); //!! FSYS_ERR_NOTEXISTS == eErr;
+ }
+ else
+ // bzw. im Fehlerfall aktualisieren
+ SaveDir(rDir);
+ return bOk;
+}
+
+//------------------------------------------------------------------------
+
+USHORT MakeRegionRelative_Impl
+(
+ USHORT* pDirCount, /* Array mit der Anzahl der Eintr"age eines
+ jeden Bereiches */
+ USHORT nRegion // der absolute Index
+)
+
+/* [Beschreibung]
+
+ Macht einen Eintrag relativ zu seinem Bereich
+
+
+ [R"uckgabewert]
+
+ USHORT der Index relativ zu seinem Bereich
+
+*/
+{
+ USHORT *pIter = pDirCount;
+ while(*pIter <= nRegion)
+ nRegion -= *pIter++;
+ return nRegion;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::Delete
+(
+ USHORT nRegion, // Index des Bereiches
+ USHORT nIdx /* Index des Eintrags oder USHRT_MAX,
+ wenn ein Verzeichnis gemeint ist. */
+)
+
+/* [Beschreibung]
+
+ "oschen eines Eintrags oder eines Verzeichnisses
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::InsertDir(const String&,USHORT)>
+ <SfxDocumentTemplates::KillDir(SfxTemplateDir&)>
+ <SfxDocumentTemplates::SaveDir(SfxTemplateDir&)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+ SfxTemplateDirEntry* pEntry = (*pDirs)[nRegion];
+ BOOL bOk = FALSE;
+
+ // handelt es sich im ein Verzeichnis?
+ if ( USHRT_MAX == nIdx )
+ {
+ bOk = KillDir( pEntry->GetContent() );
+ if ( bOk )
+ {
+/*!!! PB: #66330# nicht mehr n"otig, da jetzt die Template-Komponente verwendet wird
+ USHORT nIdx=nRegion;
+ USHORT *pIter = pDirCount;
+ while(*pIter <= nIdx)
+ nIdx -= *pIter++;
+ (*pIter)--;
+ DirEntry aFileName(pEntry->GetPath());
+ DirEntry aTplName( aFileName );
+ aTplName+=DirEntry(pDirFileName);
+ if( aTplName.Exists() )
+ {
+ SfxTemplateDir aDir(aFileName, TRUE);
+ SfxTemplateDirEntry *pTmpEntry = aDir[nIdx];
+ aDir.Remove(nIdx);
+ delete pTmpEntry;
+ bOk = SaveDir(aDir);
+ }
+ if ( bOk )
+*/
+ {
+ pDirs->Remove(nRegion);
+ delete pEntry;
+ }
+ }
+ }
+ else
+ {
+ // es handelt sich um eine einzelne Vorlage
+ SfxTemplateDir& rDir = pEntry->GetContent();
+ SfxTemplateDirEntry* pEntryToDelete = rDir[nIdx];
+ pEntryToDelete->DeleteObjectShell();
+ DirEntry aFile( pEntryToDelete->GetFull() );
+ const FSysError eErr = aFile.Kill();
+ if ( FSYS_ERR_OK == eErr || !aFile.Exists() ) //!!! FSYS_ERR_NOTEXISTS == eErr
+ {
+ rDir.Remove(nIdx);
+ bOk = SaveDir(rDir);
+ delete pEntryToDelete;
+ }
+ }
+ return bOk;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::InsertDir
+(
+ const String& rText, // der logische Name des neuen Bereiches
+ USHORT nRegion // Index des Bereiches
+)
+
+/* [Beschreibung]
+
+ Einf"ugen eines Verzeichnisses
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::KillDir(SfxTemplateDir&)>
+ <SfxDocumentTemplates::SaveDir(SfxTemplateDir&)>
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+ DirEntry aPath((*pDirs)[nRegion-1]->GetPath());
+ DirEntry aTmpName(aPath);
+ SfxTemplateDir aDir(aPath.GetFull(), TRUE);
+ MakeFileName_Impl(aTmpName, rText, TRUE);
+ String aName=aTmpName.GetName();
+ if( aName.GetChar(aName.Len()-1) == '.')
+ aName=String(aName,0,aName.Len()-1);
+ if(aTmpName.MakeDir())
+ {
+ SfxTemplateDirEntryPtr pEntry = new SfxTemplateDirEntry(
+ rText, aName, aTmpName.GetPath() );
+ pDirs->Insert(pEntry, nRegion);
+
+ // Directory-File im uebergeordneteten Directory aktualisieren
+
+ USHORT nLocalRegion=nRegion;
+ USHORT *pIter = pDirCount;
+ while(*pIter < nLocalRegion)
+ nLocalRegion -= *pIter++;
+
+ (*pIter)++;
+
+ aDir.Insert(pEntry, nLocalRegion);
+ SaveDir(pEntry->GetContent());
+
+ const BOOL bOk = SaveDir(aDir);
+
+
+ aDir.Remove(nLocalRegion);
+ if(!bOk)
+ {
+ pDirs->Remove(nRegion);
+ delete pEntry;
+ return FALSE;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::SetName
+(
+ const String& rName, // Der zu setzende Name
+ USHORT nRegion, // Index des Bereiches
+ USHORT nIdx /* Index des Eintrags oder USHRT_MAX,
+ wenn ein Verzeichnis gemeint ist. */
+)
+
+/* [Beschreibung]
+
+ "Andern des Namens eines Eintrags oder eines Verzeichnisses
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ SfxTemplateDirEntry *pEntry = (*pDirs)[nRegion];
+
+ // Vorlage wird umbenannt
+ if(USHRT_MAX != nIdx)
+ {
+ SfxTemplateDir &rDir = pEntry->GetContent();
+ pEntry = rDir[nIdx];
+ if(!pEntry->SetLongAndFileName(rName))
+ return FALSE;
+ SaveDir(rDir);
+ return TRUE;
+ }
+ else
+ {
+ if(!pEntry->SetLongAndFileName(rName))
+ return FALSE;
+
+ // Verzeichnis einlesen und mit den neuen Daten speichern
+ SfxTemplateDir aDir(pEntry->GetPath(), TRUE);
+ if(aDir.IsDir())
+ aDir[MakeRegionRelative_Impl(pDirCount, nRegion)]->SetLongName(rName);
+ aDir[MakeRegionRelative_Impl(pDirCount, nRegion)]->SetFileName(
+ pEntry->GetFileName());
+ SaveDir(aDir);
+ return TRUE;
+ }
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::Rescan()
+
+/* [Beschreibung]
+
+ Abgleich des Verwaltungsdaten mit dem aktuellen Zustand auf der Platte.
+ Die logischen Namen, zu denen keine Datei mit existiert, werden aus
+ der Verwaltungsstruktur entfernt; Dateien, zu denen kein Eintrag
+ existiert, werden aufgenommen.
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+
+ [Querverweise]
+
+ <SfxTemplateDir::Scan(BOOL bDirectory, BOOL bSave)>
+ <SfxTemplateDir::Freshen(const SfxTemplateDir &rNew)>
+*/
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+//(mba)/task SfxWaitCursor aWait;
+
+ const USHORT nCount = pDirs->Count();
+ BOOL bOk = TRUE;
+
+ USHORT i;
+ for(i = 0; i < nCount; ++i)
+ {
+ SfxTemplateDirEntry *pEntry = (*pDirs)[i];
+ SfxTemplateDir &rCntnt = pEntry->GetContent();
+ SfxTemplateDir aNew(rCntnt.GetPath());
+ aNew.Scan(FALSE);
+ if(rCntnt.Freshen(aNew))
+ bOk |= SaveDir(rCntnt);
+ }
+
+ USHORT nMax=aDirs.GetTokenCount(cDelim);
+ for(i=0;i<nMax;i++)
+ {
+ SfxTemplateDir *pOldDir = new SfxTemplateDir(
+ aDirs.GetToken(i, cDelim), TRUE, FALSE);
+ SfxTemplateDir *pNewDir = new SfxTemplateDir(
+ aDirs.GetToken(i, cDelim), TRUE, TRUE);
+ if(pOldDir->Freshen(*pNewDir))
+ bOk |= SaveDir(*pOldDir);
+ delete pNewDir;
+ delete pOldDir;
+ }
+
+ DELETEZ(pDirs);
+ DELETEZ(pDirCount);
+
+ Construct();
+
+ return bOk;
+}
+
+//------------------------------------------------------------------------
+
+SfxObjectShellRef SfxDocumentTemplates::CreateObjectShell
+(
+ USHORT nRegion, // Index des Bereiches
+ USHORT nIdx // Index des Eintrags
+)
+
+/* [Beschreibung]
+
+ Zugriff auf die DokumentShell eines Eintrags
+
+
+ [R"uckgabewert]
+
+ SfxObjectShellRef Referenz auf die ObjectShell
+
+
+ [Querverweise]
+
+ <SfxTemplateDirEntry::CreateObjectShell()>
+ <SfxDocumentTemplates::DeleteObjectShell(USHORT, USHORT)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ return (*pDirs)[nRegion]->GetContent()[nIdx]->CreateObjectShell();
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::DeleteObjectShell
+(
+ USHORT nRegion, // Index des Bereiches
+ USHORT nIdx // Index des Eintrags
+)
+
+/* [Beschreibung]
+
+ Freigeben der ObjectShell eines Eintrags
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+ [Querverweise]
+
+ <SfxTemplateDirEntry::DeleteObjectShell()>
+ <SfxDocumentTemplates::CreateObjectShell(USHORT, USHORT)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ return (*pDirs)[nRegion]->GetContent()[nIdx]->DeleteObjectShell();
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::GetFull
+(
+ const String &rRegion, // Der Name des Bereiches
+ const String &rName, // Der Name der Vorlage
+ String &rPath // Out: Pfad + Dateiname
+)
+
+/* [Beschreibung]
+
+ Liefert Pfad + Dateiname zu der durch rRegion und rName bezeichneten
+ Vorlage
+
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::GetLogicNames(const String&,String&,String&)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+ const SfxTemplateDirEntry* pEntry = NULL;
+ const USHORT nCount = pDirs->Count();
+ BOOL bFQ = FALSE;
+ USHORT nPos = rRegion.Len();
+ while( --nPos != USHRT_MAX && rRegion.GetChar( nPos ) != '(' )
+ ;
+ if ( nPos != USHRT_MAX && rRegion.GetChar( USHORT(rRegion.Len() - 1) ) == ')' )
+ bFQ = TRUE;
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ String aName;
+ if( bFQ )
+ aName = GetFullRegionName( i );
+ else
+ aName = GetRegionName( i );
+ if( aName == rRegion )
+ {
+ pEntry = (*pDirs)[i];
+ SfxTemplateDir& rDir = ( (SfxTemplateDirEntry*)pEntry )->GetContent();
+ pEntry = SeekEntry_Impl( rDir, rName );
+ if ( pEntry )
+ rPath = pEntry->GetFull().GetFull();
+ if ( pEntry || bFQ )
+ break;
+ }
+ }
+
+ return ( pEntry != NULL );
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxDocumentTemplates::GetLogicNames
+(
+ const String &rPath, // vollst"andiger Pfad zu der Vorlage
+ String &rRegion, // Out: der Bereichsname
+ String &rName // Out: der Vorlagenname
+) const
+
+/* [Beschreibung]
+
+ Liefert Pfad und logischen Namen zu der durch rPath bezeichneten
+ Vorlage
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Aktion konnte ausgef"uhrt werden
+
+ FALSE
+ Aktion konnte nicht ausgef"uhrt werden
+
+
+ [Querverweise]
+
+ <SfxDocumentTemplates::GetFull(const String&,const String&,DirEntry&)>
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ DirEntry aPath(rPath);
+ aPath.ToAbs();
+ const DirEntry aPathTo(aPath.GetPath());
+ const DirEntry aFileName(aPath.GetName());
+
+ const SfxTemplateDirEntry *pEntry = 0;
+ const USHORT nCount = pDirs->Count();
+ for(USHORT i = 0; i < nCount; ++i)
+ {
+ SfxTemplateDirEntry *p = (*pDirs)[i];
+ if (p->GetFull() == aPathTo ) // GetFull, da Directory
+ {
+ pEntry = p;
+ break;
+ }
+ }
+ if(!pEntry)
+ return FALSE;
+ rRegion = pEntry->GetLongName();
+ SfxTemplateDir &rDir = ((SfxTemplateDirEntry *)pEntry)->GetContent();
+ pEntry = rDir.Find_Impl(aPath.GetFull());
+ if(pEntry)
+ rName = pEntry->GetLongName();
+ return pEntry != 0;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentTemplates::SfxDocumentTemplates()
+
+/* [Beschreibung]
+
+ Konstruktor
+*/
+
+: aDirs(SFX_INIMANAGER()->Get(SFX_KEY_TEMPLATE_PATH)),
+ pDirs(0)
+{
+}
+
+//-------------------------------------------------------------------------
+
+void SfxDocumentTemplates::Construct()
+
+// verz"ogerter Aufbau der Verwaltungsdaten
+
+{
+ // schon von jemandem anders konstruiert?
+ if ( pDirs )
+ return;
+
+ pDirs = new SfxTemplateDir;
+ cDelim = ';'; // absichtlich hart verdrahtet
+ pDirCount = new USHORT [aDirs.GetTokenCount(cDelim)+1];
+ SfxTemplateDir *pTmp=CreateRootTemplateDir(pDirCount);
+ pDirs->Insert(pTmp,0);
+ pTmp->Remove(0, pTmp->Count()); // Loeschen der Pointer verhindern
+ delete pTmp;
+ DirEntry aDir(aDirs.GetToken(0,cDelim));
+ aDir+=DirEntry( String::CreateFromAscii( pMGName ) );
+ if(aDir.Exists())
+ {
+ if ( aDir.Kill() == ERRCODE_NONE )
+ Rescan();
+ }
+#if 0 //(dv)
+ CntAnchorRef xAnchor = new CntAnchor( NULL, ".component:Template/" );
+
+#ifdef TF_UCB
+ DBG_ERRORFILE( "GetInterface NIY!!!" );
+#else
+ if ( xAnchor->GetInterface() )
+ {
+ OpenNotifier_Impl aOpen( xAnchor, CNT_OPEN_FOLDERS );
+ while ( !aOpen.IsComplete() )
+ Application::Yield();
+ }
+#endif
+
+ for ( USHORT n=0; n<xAnchor->SubAnchorCount(); n++ )
+ {
+ CntAnchorRef xRegion = xAnchor->GetSubAnchor( n );
+ String aStr = xRegion->GetViewURL();
+ USHORT nPos = aStr.Search( '/' );
+ aStr.Cut(0,nPos+2); // .component:template/_ abschneiden
+
+ xRegion->Put( SfxVoidItem( WID_GETDATA ) );
+ const CntStringItem& rItem = (const CntStringItem&) xRegion->Get( WID_TITLE);
+
+ SfxTemplateDirEntry *pEntry = 0;
+ const USHORT nCount = pDirs->Count();
+ for( USHORT i = 0; i < nCount; ++i )
+ {
+ DirEntry aDir( (*pDirs)[i]->GetFull() );
+ String aName( aDir.GetFull( FSYS_STYLE_URL ) );
+ if( !aDir.IsCaseSensitive() )
+ aName.ToLower();
+
+ if ( aName == aStr )
+ {
+ pEntry = (*pDirs)[i];
+ break;
+ }
+ }
+
+ if( pEntry )
+ {
+ pEntry->SetLongName( rItem.GetValue() );
+ pEntry->SetAnchor( xRegion );
+ }
+ }
+#endif //(dv)
+}
+
+//------------------------------------------------------------------------
+SfxTemplateDir *SfxDocumentTemplates::CreateRootTemplateDir(USHORT *pIter, SfxTemplateDir **ppDirs, BOOL bScan ) const
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+
+ SfxTemplateDir *pDirs=new SfxTemplateDir;
+ const USHORT nRegions = aDirs.GetTokenCount(cDelim);
+ BOOL bDelPPDirs=FALSE;
+ if(!ppDirs)
+ {
+ ppDirs = new SfxTemplateDir *[nRegions];
+ bDelPPDirs = TRUE;
+ }
+
+ // rueckwaerts einfuegen,
+ // da AutoPiloten die Wizard-Templates vorne erwarten, jedoch in den
+ // Standard-Pfad reinschreiben wollen
+ for(USHORT i = 0; i < nRegions; ++i)
+ {
+ ppDirs[i] = new SfxTemplateDir(aDirs.GetToken(i, cDelim), TRUE, bScan);
+ if(!ppDirs[i]->Count())
+ {
+ const String aStd(SfxResId(STR_STANDARD));
+ const DirEntry aStdPath(aDirs.GetToken(i, cDelim));
+ DirEntry aStandard(aStdPath);
+ aStandard.MakeDir();
+
+ SfxTemplateDirEntryPtr pStd =
+ new SfxTemplateDirEntry(aStd, String(), aStdPath,TRUE);
+
+ ppDirs[i]->Insert( pStd, 0);
+
+ SaveDir(pStd->GetContent());
+
+ SaveDir(*ppDirs[i]);
+
+ }
+
+ pDirs->Insert( ppDirs[i], 0 );
+ *pIter++ = ppDirs[i]->Count();
+ }
+
+ if(bDelPPDirs)
+ delete[]ppDirs;
+ return pDirs;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentTemplates::~SfxDocumentTemplates()
+
+/* [Beschreibung]
+
+ Destruktor
+ Freigeben der Verwaltungsdaten
+*/
+
+{
+ DBG_ASSERT( pDirs, "not initialized" );
+ delete pDirs;
+ delete pDirCount;
+}
+
+// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------
+// ------------------------------------------------------------------------
+struct LongNameListRec
+{
+ String maShortName;
+ String maLongName;
+
+ LongNameListRec( const String& rShort,
+ const String& rLong )
+ : maShortName( rShort )
+ , maLongName( rLong )
+ {}
+};
+
+// ------------------------------------------------------------------------
+LongNameList_Impl::LongNameList_Impl( const String& rDirName )
+{
+ String aName = rDirName;
+
+ aName.Append( FileName_Impl( TRUE ) );
+
+ mpNames = 0;
+
+ SfxMedium aMedium( aName, STREAM_STD_READ, TRUE );
+ SvStream *pStream = aMedium.GetInStream();
+
+ if ( pStream )
+ {
+ char cDir;
+ USHORT nCount, i;
+ ByteString aLongName; // logischer Name des Benutzers
+ ByteString aFileName; // Dateiname (ohne Pfad)
+ LongNameListRec *pNew;
+
+ if ( ! ReadHeader( *pStream ) )
+ return;
+
+ *pStream >> cDir;
+ *pStream >> nCount;
+
+ mpNames = new List( nCount, 10 );
+
+ CharSet eCharSet = pStream->GetStreamCharSet();
+
+ for( i = 0; i < nCount; ++i )
+ {
+ pStream->ReadByteString( aLongName );
+ pStream->ReadByteString( aFileName );
+ pNew = new LongNameListRec( String( aFileName, eCharSet ),
+ String( aLongName, eCharSet ) );
+ mpNames->Insert( pNew );
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+LongNameList_Impl::~LongNameList_Impl()
+{
+ if ( mpNames )
+ {
+ LongNameListRec *pData = (LongNameListRec *) mpNames->First();
+
+ while ( pData )
+ {
+ delete pData;
+ pData = (LongNameListRec *) mpNames->Next();
+ }
+
+ delete mpNames;
+ }
+}
+
+// ------------------------------------------------------------------------
+String LongNameList_Impl::GetLongName( const String& rShortName ) const
+{
+ String aLongName;
+ LongNameListRec *pData;
+
+ if ( mpNames )
+ pData = (LongNameListRec *) mpNames->First();
+ else
+ pData = NULL;
+
+ while ( pData )
+ {
+ if ( pData->maShortName == rShortName )
+ {
+ aLongName = pData->maLongName;
+ break;
+ }
+ else
+ pData = (LongNameListRec *) mpNames->Next();
+ }
+
+ return aLongName;
+}
+
+// ------------------------------------------------------------------------
+BOOL LongNameList_Impl::ReadHeader( SvStream& rStream ) const
+{
+ ByteString aHeader;
+ USHORT nUS = strlen( pHeader );
+ USHORT nVersion;
+ CharSet eCharSet;
+ char c;
+
+ rStream.Read( aHeader.AllocBuffer( nUS ), nUS );
+ rStream >> c >> nVersion >> nUS;
+
+ // CharSet einlesen und am Stream setzen
+ eCharSet = (CharSet)nUS;
+ rStream.SetStreamCharSet(eCharSet);
+
+ if( aHeader != pHeader )
+ return FALSE;
+ if( nVersion != VERSION )
+ return FALSE;
+
+ return TRUE;
+}
+
+
diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx
new file mode 100644
index 000000000000..462ee1a9cd3a
--- /dev/null
+++ b/sfx2/source/doc/docvor.cxx
@@ -0,0 +1,1997 @@
+/*************************************************************************
+ *
+ * $RCSfile: docvor.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_PRNSETUP_HXX //autogen
+#include <svtools/prnsetup.hxx>
+#endif
+#ifndef _VCL_CMDEVT_HXX //autogen
+#include <vcl/cmdevt.hxx>
+#endif
+#ifndef _SV_MENUBTN_HXX //autogen
+#include <vcl/menubtn.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SV_DRAG_HXX //autogen
+#include <vcl/drag.hxx>
+#endif
+#ifndef _SV_PRINT_HXX //autogen
+#include <vcl/print.hxx>
+#endif
+#ifndef _SFXSTYLE_HXX //autogen
+#include <svtools/style.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+#include <tools/urlobj.hxx>
+#pragma hdrstop
+
+#include "helpid.hrc"
+#include "docvor.hxx"
+#include "docfac.hxx"
+#include "orgmgr.hxx"
+#include "doctempl.hxx"
+#include "templdlg.hxx"
+#include "sfxtypes.hxx"
+#include "app.hxx"
+#include "dispatch.hxx"
+#include "inimgr.hxx"
+#include "sfxresid.hxx"
+#include "iodlg.hxx"
+#include "doc.hrc"
+#include "sfx.hrc"
+#include "docvor.hrc"
+#include "docfilt.hxx"
+
+static const char cDelim = ':';
+BOOL SfxOrganizeListBox_Impl::bDropMoveOk=TRUE;
+
+//=========================================================================
+
+
+class SuspendAccel
+{
+public:
+ Accelerator* pAccel;
+
+ SuspendAccel( Accelerator* pA )
+ {
+ pAccel=pA;
+ GetpApp()->RemoveAccel( pAccel );
+ }
+ ~SuspendAccel()
+ {
+ GetpApp()->InsertAccel( pAccel );
+ }
+};
+
+//=========================================================================
+
+
+class SfxOrganizeDlg_Impl
+{
+friend class SfxTemplateOrganizeDlg;
+friend class SfxOrganizeListBox_Impl;
+
+ SuspendAccel *pSuspend;
+ SfxTemplateOrganizeDlg* pDialog;
+
+ SfxOrganizeListBox_Impl aLeftLb;
+ ListBox aLeftTypLb;
+
+ SfxOrganizeListBox_Impl aRightLb;
+ ListBox aRightTypLb;
+
+ OKButton aOkBtn;
+ MenuButton aEditBtn;
+ HelpButton aHelpBtn;
+ PushButton aFilesBtn;
+
+// FixedText aDefaultTemplateLabel;
+// FixedInfo aDefaultTemplate;
+
+ Accelerator aEditAcc;
+
+ String aLastDir;
+ SfxOrganizeMgr aMgr;
+ SfxOrganizeListBox_Impl*pFocusBox;
+ Printer* pPrt;
+
+ long Dispatch_Impl( USHORT nId );
+ String GetPath_Impl( BOOL bOpen, const String& rFileName );
+
+ DECL_LINK( GetFocus_Impl, SfxOrganizeListBox_Impl * );
+ DECL_LINK( LeftListBoxSelect_Impl, ListBox * );
+ DECL_LINK( RightListBoxSelect_Impl, ListBox * );
+ DECL_LINK( AccelSelect_Impl, Accelerator * );
+ DECL_LINK( MenuSelect_Impl, Menu * );
+ DECL_LINK( MenuActivate_Impl, Menu * );
+ DECL_LINK( AddFiles_Impl, Button * );
+ BOOL DontDelete_Impl( SvLBoxEntry *pEntry);
+ void OkHdl(Button *);
+
+public:
+ SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent,
+ SfxDocumentTemplates* pTempl );
+};
+
+//-------------------------------------------------------------------------
+
+SfxOrganizeDlg_Impl::SfxOrganizeDlg_Impl( SfxTemplateOrganizeDlg* pParent,
+ SfxDocumentTemplates* pTempl )
+: aHelpBtn( pParent, ResId( BTN_HELP ) ),
+ pDialog( pParent ),
+ aOkBtn( pParent, ResId( BTN_OK ) ),
+ aLeftTypLb( pParent, ResId( LB_LEFT_TYP ) ),
+ aRightTypLb( pParent, ResId( LB_RIGHT_TYP ) ),
+ aLeftLb( this, pParent, WB_BORDER | WB_TABSTOP | WB_HSCROLL, SfxOrganizeListBox_Impl::VIEW_TEMPLATES ),
+ aRightLb( this, pParent, WB_BORDER | WB_TABSTOP | WB_HSCROLL, SfxOrganizeListBox_Impl::VIEW_FILES ),
+ aFilesBtn( pParent, ResId( BTN_FILES ) ),
+ aEditAcc( ResId( ACC_EDIT ) ),
+ aEditBtn( pParent, ResId( BTN_EDIT ) ),
+ aMgr(&aLeftLb, &aRightLb, pTempl),
+ pFocusBox(0),
+ pPrt(0)
+{
+ aLeftLb.SetHelpId( HID_CTL_ORGANIZER_LEFT );
+ aRightLb.SetHelpId( HID_CTL_ORGANIZER_RIGHT );
+
+ SfxIniManager* pIniMgr = SFX_INIMANAGER();
+ String aWorkPath = pIniMgr->Get( SFX_KEY_WORK_PATH );
+ if ( aWorkPath.Len() )
+ {
+ INetURLObject aObj( aWorkPath, INET_PROT_FILE );
+ aObj.setFinalSlash();
+ aLastDir = aObj.GetMainURL();
+ }
+ else
+ {
+ // fallback
+ INetURLObject aObj( Application::GetAppFileName(), INET_PROT_FILE );
+ aObj.removeSegment();
+ aObj.setFinalSlash();
+ aLastDir = aObj.GetMainURL();
+ }
+
+ // die Ordner-Bitmaps haben als Maskenfarbe rot
+ Color aMaskColor( 0xFF, 0x00, 0x00 );
+ Bitmap aBitmapOpenedFolder(SfxResId( BMP_OPENED_FOLDER ));
+ Image aOpenedFolderBmp( aBitmapOpenedFolder, aMaskColor );
+ Bitmap aBitmapClosedFolder(SfxResId(BMP_CLOSED_FOLDER));
+ Image aClosedFolderBmp( aBitmapClosedFolder, aMaskColor );
+ // die Dokumenten-Bitmaps haben keine Maskenfarbe
+ Bitmap aBitmapOpenedDoc(SfxResId(BMP_OPENED_DOC) );
+ Image aOpenedDocBmp( aBitmapOpenedDoc );
+ Bitmap aBitmapClosedDoc(SfxResId( BMP_CLOSED_DOC) );
+ Image aClosedDocBmp( aBitmapClosedDoc );
+
+ aLeftLb.SetBitmaps(aOpenedFolderBmp, aClosedFolderBmp,
+ aOpenedDocBmp, aClosedDocBmp);
+ aRightLb.SetBitmaps(aOpenedFolderBmp, aClosedFolderBmp,
+ aOpenedDocBmp, aClosedDocBmp);
+
+ aEditBtn.GetPopupMenu()->SetSelectHdl( LINK( this, SfxOrganizeDlg_Impl, MenuSelect_Impl ) );
+ aEditBtn.GetPopupMenu()->SetActivateHdl( LINK( this, SfxOrganizeDlg_Impl, MenuActivate_Impl ) );
+ aEditAcc.SetSelectHdl( LINK( this, SfxOrganizeDlg_Impl, AccelSelect_Impl ) );
+ GetpApp()->InsertAccel( &aEditAcc );
+
+ aFilesBtn.SetClickHdl(
+ LINK(this,SfxOrganizeDlg_Impl, AddFiles_Impl));
+ aLeftTypLb.SetSelectHdl(
+ LINK(this, SfxOrganizeDlg_Impl, LeftListBoxSelect_Impl));
+ aRightTypLb.SetSelectHdl(
+ LINK(this, SfxOrganizeDlg_Impl, RightListBoxSelect_Impl));
+ aLeftLb.SetGetFocusHdl(
+ LINK(this, SfxOrganizeDlg_Impl, GetFocus_Impl));
+ aRightLb.SetGetFocusHdl(
+ LINK(this, SfxOrganizeDlg_Impl, GetFocus_Impl));
+ aLeftLb.SetPosSizePixel(pParent->LogicToPixel(Point(3, 6), MAP_APPFONT),
+ pParent->LogicToPixel(Size(94, 132), MAP_APPFONT));
+ aRightLb.SetPosSizePixel(pParent->LogicToPixel(Point(103, 6), MAP_APPFONT),
+ pParent->LogicToPixel(Size(94, 132), MAP_APPFONT));
+
+ Font aFont(aLeftLb.GetFont());
+ aFont.SetWeight(WEIGHT_NORMAL);
+ aLeftLb.SetFont(aFont);
+ aRightLb.SetFont(aFont);
+ const long nIndent = aLeftLb.GetIndent() / 2;
+ aLeftLb.SetIndent( (short)nIndent );
+ aRightLb.SetIndent( (short)nIndent );
+
+ aLeftLb.SetMgr(&aMgr);
+ aRightLb.SetMgr(&aMgr);
+ aLeftLb.Reset();
+ aRightLb.Reset();//SetModel(aLeftLb.GetModel());
+ aLeftLb.Show();
+ aRightLb.Show();
+ aLeftLb.EnableInplaceEditing(TRUE);
+ aRightLb.EnableInplaceEditing(TRUE);
+
+
+ aRightLb.SelectAll( FALSE );
+ aLeftLb.GrabFocus();
+}
+
+//=========================================================================
+
+BOOL QueryDelete_Impl(Window *pParent, // Parent der QueryBox
+ USHORT nId, // Resource Id
+ const String &rTemplateName) // Name der zu l"oschenden Vorlage
+/* [Beschreibung]
+
+ "oschabfrage
+
+*/
+{
+ SfxResId aResId( nId );
+ String aEntryText( aResId );
+ aEntryText.SearchAndReplaceAscii( "$1", rTemplateName );
+ QueryBox aBox( pParent, WB_YES_NO | WB_DEF_NO, aEntryText );
+ return RET_NO != aBox.Execute();
+}
+
+//-------------------------------------------------------------------------
+
+void ErrorDelete_Impl(Window *pParent, const String &rName)
+
+/* [Beschreibung]
+
+ Benutzerinformation, da"s die Vorlage rName nicht gel"oscht werden konnte
+
+*/
+{
+ String aText( SfxResId( STR_ERROR_DELETE_TEMPLATE ) );
+ aText.SearchAndReplaceAscii( "$1", rName );
+ ErrorBox( pParent, WB_OK, aText ).Execute();
+}
+
+
+//=========================================================================
+
+/* [Beschreibung]
+
+ Implementierungsklasse; Referenzklasse f"ur USHORT-Array
+
+*/
+
+struct ImpPath_Impl
+{
+ SvUShorts aUS;
+ USHORT nRef;
+
+ ImpPath_Impl();
+ ImpPath_Impl( const ImpPath_Impl& rCopy );
+};
+
+//-------------------------------------------------------------------------
+
+ImpPath_Impl::ImpPath_Impl() : aUS(5), nRef(1)
+{
+}
+
+//-------------------------------------------------------------------------
+
+ImpPath_Impl::ImpPath_Impl( const ImpPath_Impl& rCopy ) :
+
+ aUS ( (BYTE)rCopy.aUS.Count() ),
+ nRef( 1 )
+
+{
+ const USHORT nCount = rCopy.aUS.Count();
+
+ for ( USHORT i = 0; i < nCount; ++i )
+ aUS.Insert( rCopy.aUS[i], i );
+}
+
+//==========================================================================
+
+/* [Beschreibung]
+
+ Implementierungsklasse; Darstellung einer Position in der Outline-
+ Listbox als USHORT-Array; dieses beschreibt die Position jeweil
+ als relative Postion zum "ubergeordneten Eintrag
+
+*/
+class Path
+{
+ ImpPath_Impl *pData;
+ void NewImp();
+public:
+ Path(SvLBox *pBox, SvLBoxEntry *pEntry);
+ Path(const Path &rPath):
+ pData(rPath.pData)
+ {
+ ++pData->nRef;
+ }
+ const Path &operator=(const Path &rPath)
+ {
+ if(&rPath != this)
+ {
+ if(!--pData->nRef)
+ delete pData;
+ pData = rPath.pData;
+ pData->nRef++;
+ }
+ return *this;
+ }
+ ~Path()
+ {
+ if(!--pData->nRef)
+ delete pData;
+ }
+ USHORT Count() const { return pData->aUS.Count(); }
+ USHORT operator[]( USHORT i ) const
+ {
+ return i < Count()? pData->aUS[i]: INDEX_IGNORE;
+ }
+};
+
+//-------------------------------------------------------------------------
+
+Path::Path(SvLBox *pBox, SvLBoxEntry *pEntry) :
+ pData(new ImpPath_Impl)
+{
+ DBG_ASSERT(pEntry != 0, "EntryPtr ist NULL");
+ if(!pEntry)
+ return;
+ SvLBoxEntry *pParent = pBox->GetParent(pEntry);
+ do {
+ pData->aUS.Insert(pBox->GetModel()->GetRelPos(pEntry), 0);
+ if(0 == pParent)
+ break;
+ pEntry = pParent;
+ pParent = pBox->GetParent(pEntry);
+ } while(1);
+}
+
+//-------------------------------------------------------------------------
+
+void Path::NewImp()
+{
+ if(pData->nRef != 1)
+ {
+ pData->nRef--;
+ pData = new ImpPath_Impl(*pData);
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxOrganizeListBox_Impl::Command( const CommandEvent& rCEvt )
+{
+ if ( COMMAND_CONTEXTMENU == rCEvt.GetCommand())
+ {
+ PopupMenu* pMenu = pDlg->aEditBtn.GetPopupMenu();
+ pMenu->Execute( this, rCEvt.GetMousePosPixel() );
+ }
+ else
+ SvTreeListBox::Command(rCEvt);
+}
+
+BOOL SfxOrganizeListBox_Impl::NotifyQueryDrop(SvLBoxEntry *pEntry)
+
+/* [Beschreibung]
+
+ QueryDrop-Handler (SV); Funktionsweise kann der Wahrheits,
+ tabelle unten entnommen werden.
+
+
+ B D C1 C2 C3
+
+ Quelle 0 1 2 3 4
+ Ziel
+ 0 - +*** - - -
+ 1 - +*** [-]* + -
+ 2 - - [-] p=p +** -
+ 3 - - - p=p +** p=p && pp=pp +
+ 4 - - - - p=p && pp=pp +
+ ----
+ * Problem Move; logische Bereiche koennen nicht geloescht werden
+ ** p = Parent -> p=p: identische Parents
+ pp = ParentParent
+ *** geht bei Vorlagen
+*/
+{
+ if(!pEntry)
+ return FALSE;
+ SvLBox *pSource = GetSourceView();
+ SvLBoxEntry *pSourceEntry = pSource->FirstSelected();
+ if(pEntry == pSourceEntry)
+ return FALSE;
+ USHORT nSourceLevel = pSource->GetModel()->GetDepth(pSourceEntry);
+ if(VIEW_FILES == ((SfxOrganizeListBox_Impl *)pSource)->GetViewType())
+ ++nSourceLevel;
+ USHORT nTargetLevel = GetModel()->GetDepth(pEntry);
+ if(VIEW_FILES == GetViewType())
+ ++nTargetLevel;
+ Path aSource(pSource, pSourceEntry);
+ Path aTarget(this, pEntry);
+ const USHORT SL = ((SfxOrganizeListBox_Impl *)pSource)->GetDocLevel();
+ const USHORT TL = GetDocLevel();
+
+ return( (nSourceLevel == 1 && nTargetLevel == 0 &&
+ VIEW_TEMPLATES ==
+ ((SfxOrganizeListBox_Impl *)pSource)->GetViewType()) ||
+ (nSourceLevel == 1 && nTargetLevel == 1 &&
+ VIEW_TEMPLATES ==
+ ((SfxOrganizeListBox_Impl *)pSource)->GetViewType() &&
+ VIEW_TEMPLATES == GetViewType()) ||
+ (nSourceLevel == 3 && nTargetLevel == 1) ||
+ (nSourceLevel == 3 && nTargetLevel == 2 &&
+ aSource[1+SL] == aTarget[1+TL]) ||
+ (nSourceLevel == 3 && nTargetLevel == 3 &&
+ aSource[1+SL] == aTarget[1+TL]) ||
+ (nSourceLevel == 4 && nTargetLevel == 3 &&
+ aSource[1+SL] == aTarget[1+TL] &&
+ aSource[2+SL] == aTarget[2+TL]) ||
+ (nSourceLevel == 4 && nTargetLevel == 4 &&
+ aSource[1+SL] == aTarget[1+TL] &&
+ aSource[2+SL] == aTarget[2+TL]));
+}
+
+//-------------------------------------------------------------------------
+
+SvLBoxEntry *GetIndices_Impl(SvLBox *pBox,
+ SvLBoxEntry *pEntry,
+ USHORT &rRegion,
+ USHORT &rOffset)
+/* [Beschreibung]
+
+ Bereich und Position innerhalb eines Bereiches f"ur eine
+ Dokumentvorlage wird ermittelt.
+
+ [Parameter]
+
+ SvLBox *pBox Listbox, an der das Ereignis auftrat
+ SvLBoxEntry *pEntry Eintrag, dessen Position ermittelt werden soll
+ USHORT &rRegion der Bereich innerhalb der Bereiche der
+ Dokumentvorlagen (Out-Parameter)
+ USHORT &rOffset die Position innerhalb des Bereiches
+ Dokumentvorlagen (Out-Parameter)
+
+ [Querverweise]
+
+ <class Path> (unter Umst"anden kann auf diese Funktion zugunsten
+ von Path verzichtet werden.)
+
+*/
+
+{
+ if(!pEntry)
+ {
+ rRegion = rOffset = 0;
+ return pEntry;
+ }
+ if(0 == pBox->GetModel()->GetDepth(pEntry))
+ {
+ rRegion = (USHORT)pBox->GetModel()->GetRelPos(pEntry);
+ rOffset = USHRT_MAX;
+ return pEntry;
+ }
+ SvLBoxEntry *pParent = pBox->GetParent(pEntry);
+ rRegion = (USHORT)pBox->GetModel()->GetRelPos(pParent);
+ rOffset = (USHORT)pBox->GetModel()->GetRelPos(pEntry);
+ return pEntry;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+{
+ if(!bSelect)
+ return SvTreeListBox::Select(pEntry,bSelect);
+ USHORT nLevel = GetDocLevel();
+ if(GetModel()->GetDepth(pEntry)+nLevel<3)
+ return SvTreeListBox::Select(pEntry,bSelect);
+
+ Path aPath(this, pEntry);
+ GetObjectShell(aPath)->TriggerHelpPI(
+ aPath[nLevel+1], aPath[nLevel+2], aPath[nLevel+3]);
+ return SvTreeListBox::Select(pEntry,bSelect);
+}
+
+DragDropMode SfxOrganizeListBox_Impl::NotifyBeginDrag(SvLBoxEntry *pSourceEntry)
+/* [Beschreibung]
+
+ Was fuer DragActions sind an dieser Stelle erlaubt.
+ Fuer Dokumentinhalte darf nur kopiert, nicht verschoben werden.
+*/
+{
+ USHORT nSourceLevel = GetModel()->GetDepth(pSourceEntry);
+ if(VIEW_FILES == GetViewType())
+ ++nSourceLevel;
+ if(nSourceLevel>=2)
+ {
+ bDropMoveOk=FALSE;
+ return GetDragDropMode();
+ }
+ else
+ {
+ bDropMoveOk=TRUE;
+ return GetDragDropMode();
+ }
+
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::IsStandard_Impl( SvLBoxEntry *pEntry) const
+{
+ String aStd(SfxResId(STR_STANDARD));
+ aStd.ToUpperAscii();
+ String aEntry = GetEntryText(pEntry);
+ aEntry.ToUpperAscii();
+ return !GetModel()->GetDepth(pEntry) &&
+ aEntry.Match(aStd)>=aStd.Len();
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)
+/* [Beschreibung]
+
+ Verschieben oder Kopieren von Dokumentvorlagen
+
+ [Parameter]
+
+ SvLBox *pSourceBox Quell-Listbox, an der das Ereignis auftrat
+ SvLBoxEntry *pSource Quell-Eintrag, der kopiert / verschoben werden soll
+ SvLBoxEntry* pTarget Ziel-Eintrag, auf den verschoben werden soll
+ SvLBoxEntry *&pNewParent der Parent der an der Zielposition erzeugten
+ Eintrags (Out-Parameter)
+ ULONG &rIdx Index des Zieleintrags
+ BOOL bCopy Flag f"ur Kopieren / Verschieben
+
+
+ [Returnwert] BOOL: Erfolg oder Mi"serfolg
+
+ [Querverweise]
+
+ <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)>
+ <BOOL SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)>
+ <BOOL SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)>
+*/
+
+{
+ BOOL bOk = FALSE;
+
+ if(pSource)
+ {
+ USHORT nTargetRegion = 0, nTargetIndex = 0;
+ GetIndices_Impl(this, pTarget, nTargetRegion, nTargetIndex);
+
+ USHORT nSourceRegion = 0, nSourceIndex = 0;
+ GetIndices_Impl(pSourceBox, pSource, nSourceRegion, nSourceIndex);
+
+ bOk = bCopy ?
+ pMgr->Copy(nTargetRegion, nTargetIndex+1,
+ nSourceRegion, nSourceIndex):
+ pMgr->Move(nTargetRegion, nTargetIndex+1,
+ nSourceRegion, nSourceIndex);
+
+ if(bOk)
+ {
+ if(pSourceBox->GetModel()->GetDepth(pSource) == GetModel()->GetDepth(pTarget))
+ {
+ pNewParent = GetParent(pTarget);
+ rIdx = GetModel()->GetRelPos(pTarget)+1;
+ }
+ else
+ {
+ if(nTargetIndex == USHRT_MAX)
+ {
+ pNewParent = pTarget;
+ rIdx = 0;
+ }
+ else
+ SvLBox::NotifyCopying(
+ pTarget, pSource, pNewParent, rIdx);
+ }
+ }
+ else
+ {
+ String aText( SfxResId( bCopy ? STR_ERROR_COPY_TEMPLATE : STR_ERROR_MOVE_TEMPLATE ) );
+ aText.SearchAndReplaceAscii( "$1",
+ ( (SvTreeListBox *)pSourceBox )->GetEntryText( pSource ) );
+ ErrorBox( this, WB_OK, aText ).Execute();
+ }
+ }
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)
+/* [Beschreibung]
+
+ Verschieben oder Kopieren von Dokumentinhalten
+
+ [Parameter]
+
+ SvLBox *pSourceBox Quell-Listbox, an der das Ereignis auftrat
+ SvLBoxEntry *pSource Quell-Eintrag, der kopiert / verschoben werden soll
+ SvLBoxEntry* pTarget Ziel-Eintrag, auf den verschoben werden soll
+ SvLBoxEntry *&pNewParent der Parent der an der Zielposition erzeugten
+ Eintrags (Out-Parameter)
+ ULONG &rIdx Index des Zieleintrags
+ BOOL bCopy Flag f"ur Kopieren / Verschieben
+
+
+ [Returnwert] BOOL: Erfolg oder Mi"serfolg
+
+ [Querverweise]
+
+ <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)>
+ <BOOL SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)>
+ <BOOL SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)>
+*/
+
+{
+ SfxErrorContext aEc( ERRCTX_SFX_MOVEORCOPYCONTENTS, this);
+ BOOL bOk = FALSE, bKeepExpansion = FALSE;
+ Path aSource(pSourceBox, pSource);
+ Path aTarget(this, pTarget);
+ SfxObjectShellRef aSourceDoc =
+ ((SfxOrganizeListBox_Impl *)pSourceBox)->GetObjectShell(aSource);
+
+ SfxObjectShellRef aTargetDoc = GetObjectShell(aTarget);
+ const USHORT nSLevel =
+ ((SfxOrganizeListBox_Impl *)pSourceBox)->GetDocLevel();
+ const USHORT nTLevel = GetDocLevel();
+
+ if(aSourceDoc.Is() && aTargetDoc.Is())
+ {
+ if (aSourceDoc->GetStyleSheetPool())
+ aSourceDoc->GetStyleSheetPool()->SetSearchMask(
+ SFX_STYLE_FAMILY_ALL, SFXSTYLEBIT_USERDEF | SFXSTYLEBIT_USED);
+
+ if (aTargetDoc->GetStyleSheetPool())
+ aTargetDoc->GetStyleSheetPool()->SetSearchMask(
+ SFX_STYLE_FAMILY_ALL, SFXSTYLEBIT_USERDEF | SFXSTYLEBIT_USED);
+ USHORT p[3];
+ USHORT nIdxDeleted = INDEX_IGNORE;
+ p[0]=aTarget[nTLevel+1];
+ p[1]=aTarget[nTLevel+2];
+ if(p[1]!=INDEX_IGNORE)p[1]++;
+ p[2]=aTarget[nTLevel+3];
+
+ bOk = aTargetDoc->Insert(
+ *aSourceDoc, aSource[nSLevel+1],
+ aSource[nSLevel+2], aSource[nSLevel+3],
+ p[0], p[1], p[2], nIdxDeleted);
+ // Positionskorrektur auswerten
+ // a = Dokumentinhalt
+ // b = Position Sub-Inhalt 1
+ // c = Position Sub-Inhalt 2
+ // doppelte Eintraege loeschen
+ if(bOk)
+ {
+ SvLBoxEntry *pParentIter = pTarget;
+ // bis auf die DokumentEbene nach oben als
+ // allgemeiner Bezugspunkt
+ while(GetModel()->GetDepth(pParentIter) != nTLevel)
+ pParentIter = GetParent(pParentIter);
+ if(pParentIter->HasChildsOnDemand() &&
+ !GetModel()->HasChilds(pParentIter))
+ RequestingChilds(pParentIter);
+ SvLBoxEntry *pChildIter = 0;
+
+ USHORT i = 0;
+ while(i < 2 && p[i+1] != INDEX_IGNORE)
+ {
+ pChildIter = FirstChild(pParentIter);
+ // bis zum Index der aktuellen Ebene
+ for(USHORT j = 0; j < p[i]; ++j)
+ pChildIter = NextSibling(pChildIter);
+ // gfs Fuellen bei Items onDemand
+ ++i;
+ if(p[i+1] != INDEX_IGNORE &&
+ pChildIter->HasChildsOnDemand() &&
+ !GetModel()->HasChilds(pChildIter))
+ RequestingChilds(pChildIter);
+ pParentIter = pChildIter;
+ }
+ rIdx = p[i];
+ pNewParent = pParentIter;
+ if(!IsExpanded(pNewParent) &&
+ pNewParent->HasChildsOnDemand() &&
+ !GetModel()->HasChilds(pNewParent))
+ {
+ bOk = FALSE;
+ if(!bCopy)
+ pSourceBox->GetModel()->Remove(pSource);
+ }
+ // Geloeschte Eintraege entfernen
+ // (kann durch Ueberschreiben geschehen)
+ if(nIdxDeleted != INDEX_IGNORE)
+ {
+ pChildIter = FirstChild(pParentIter);
+ for(USHORT i = 0; i < nIdxDeleted; ++i)
+ pChildIter = NextSibling(pChildIter);
+ if( pChildIter && pChildIter != pSource )
+ {
+ bKeepExpansion = IsExpanded(pParentIter);
+ GetModel()->Remove(pChildIter);
+ }
+ else
+ bOk = FALSE;
+ }
+ if(!bCopy && &aSourceDoc != &aTargetDoc)
+ aSourceDoc->Remove(aSource[nSLevel+1],
+ aSource[nSLevel+2],
+ aSource[nSLevel+3]);
+ }
+ }
+// rIdx++;
+ return (rIdx != INDEX_IGNORE && bOk )
+ ? bKeepExpansion? (BOOL)2: TRUE: FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)
+
+/* [Beschreibung]
+
+ Benachrichtigung, da"s ein Eintrag verschoben werden soll
+ (SV-Handler)
+
+ [Parameter]
+
+ SvLBoxEntry* pTarget Ziel-Eintrag, auf den verschoben werden soll
+ SvLBoxEntry *pSource Quell-Eintrag, der verschoben werden soll
+ SvLBoxEntry *&pNewParent der Parent der an der Zielposition erzeugten
+ Eintrags (Out-Parameter)
+ ULONG &rIdx Index des Zieleintrags
+
+
+ [Returnwert] BOOL: Erfolg oder Mi"serfolg
+
+ [Querverweise]
+
+ <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)>
+ <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)>
+ <BOOL SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)>
+*/
+
+{
+ BOOL bOk = FALSE;
+ SvLBox *pSourceBox = GetSourceView();
+ if(pSourceBox->GetModel()->GetDepth(pSource) <= GetDocLevel() &&
+ GetModel()->GetDepth(pTarget) <= GetDocLevel())
+ bOk = MoveOrCopyTemplates(pSourceBox, pSource, pTarget,
+ pNewParent, rIdx, FALSE);
+ else
+ bOk = MoveOrCopyContents(pSourceBox, pSource, pTarget,
+ pNewParent, rIdx, FALSE);
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::NotifyCopying(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)
+/* [Beschreibung]
+
+ Benachrichtigung, da"s ein Eintrag kopiert werden soll
+ (SV-Handler)
+
+ [Parameter]
+
+ SvLBoxEntry* pTarget Ziel-Eintrag, auf den kopiert werden soll
+ SvLBoxEntry *pSource Quell-Eintrag, der kopiert werden soll
+ SvLBoxEntry *&pNewParent der Parent der an der Zielposition erzeugten
+ Eintrags (Out-Parameter)
+ ULONG &rIdx Index des Zieleintrags
+
+
+ [Returnwert] BOOL: Erfolg oder Mi"serfolg
+
+ [Querverweise]
+
+ <SfxOrganizeListBox_Impl::MoveOrCopyTemplates(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)>
+ <SfxOrganizeListBox_Impl::MoveOrCopyContents(SvLBox *pSourceBox,
+ SvLBoxEntry *pSource,
+ SvLBoxEntry* pTarget,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx,
+ BOOL bCopy)>
+ <BOOL SfxOrganizeListBox_Impl::NotifyMoving(SvLBoxEntry *pTarget,
+ SvLBoxEntry* pSource,
+ SvLBoxEntry *&pNewParent,
+ ULONG &rIdx)>
+*/
+{
+ BOOL bOk = FALSE;
+ SvLBox *pSourceBox = GetSourceView();
+ if(pSourceBox->GetModel()->GetDepth(pSource) <= GetDocLevel() &&
+ GetModel()->GetDepth(pTarget) <= GetDocLevel())
+ bOk = MoveOrCopyTemplates(pSourceBox, pSource, pTarget,
+ pNewParent, rIdx, TRUE);
+ else
+ bOk = MoveOrCopyContents(pSourceBox, pSource, pTarget,
+ pNewParent, rIdx, TRUE );
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::EditingEntry( SvLBoxEntry* pEntry, Selection& )
+
+/* [Beschreibung]
+
+ Nachfrage, ob ein Eintrag editierbar ist
+ (SV-Handler)
+
+ [Querverweise]
+ <SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const String& rText)>
+*/
+
+{
+ if( VIEW_TEMPLATES == eViewType &&
+ GetModel()->GetDepth(pEntry) < 2 && !IsStandard_Impl(pEntry))
+ {
+ pDlg->pSuspend=new SuspendAccel(&pDlg->aEditAcc);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::EditedEntry(SvLBoxEntry* pEntry, const String& rText)
+
+/* [Beschreibung]
+
+ Der Name eines Eintrags wurde bearbeitet; ist der eingegebene Name
+ ein g"ultiger Name ("ange > 0), wird das Model aktualisiert.
+ (SV-Handler)
+
+ [Returnwert]
+
+ BOOL TRUE: der Name soll in der Anzeige ge"andert werden
+ FALSE:der Name soll nicht ge"andert werden
+
+ [Querverweise]
+ <SfxOrganizeListBox_Impl::EditingEntry(SvLBoxEntry* pEntry, const String& rText)>
+*/
+
+{
+ DBG_ASSERT(pEntry, "kein Entry selektiert");
+ delete pDlg->pSuspend;
+ pDlg->pSuspend=0;
+ SvLBoxEntry* pParent = GetParent(pEntry);
+ if( !rText.Len() )
+ {
+ ErrorBox aBox( this, SfxResId( MSG_ERROR_EMPTY_NAME ) );
+ aBox.GrabFocus();
+ aBox.Execute();
+ return FALSE;
+ }
+ if ( !IsUniqName_Impl( rText, pParent, pEntry ) )
+ {
+ ErrorBox aBox( this, SfxResId( MSG_ERROR_UNIQ_NAME ) );
+ aBox.GrabFocus();
+ aBox.Execute();
+ return FALSE;
+ }
+ USHORT nRegion = 0, nIndex = 0;
+ GetIndices_Impl( this, pEntry, nRegion, nIndex );
+ String aOldName;
+ if ( USHRT_MAX != nIndex )
+ aOldName = pMgr->GetTemplates()->GetName( nRegion, nIndex );
+ else
+ aOldName = pMgr->GetTemplates()->GetRegionName( nRegion );
+
+ if ( !pMgr->SetName( rText, nRegion, nIndex ) )
+ {
+ SfxResId aResId( USHRT_MAX != nIndex ? MSG_ERROR_RENAME_TEMPLATE
+ : MSG_ERROR_RENAME_TEMPLATE_REGION );
+ ErrorBox( this, aResId ).Execute();
+ return FALSE;
+ }
+ else
+ {
+ SfxTemplateOrganizeDlg* pDlg = (SfxTemplateOrganizeDlg*)Window::GetParent();
+ }
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::Drop( DropEvent& rEvt )
+
+/* [Beschreibung]
+
+ Drop Handler; wird verwendet, um in der Dokumentenansicht weitere
+ Dokumente per Drag&Drop hinzuf"ugen zu k"onnen
+ (SV-Handler)
+
+ [Returnwert]
+
+ BOOL Erfolg oder Mi"serfolg
+
+ [Querverweise]
+ <SfxOrganizeListBox_Impl::QueryDrop(DropEvent& rEvt)>
+*/
+
+{
+ const USHORT nCount = DragServer::GetItemCount();
+ BOOL bSuccess = FALSE;
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ const String aFileName( DragServer::PasteFile(i) );
+ if ( !aFileName.Len() )
+ continue;
+ INetURLObject aObj( aFileName, INET_PROT_FILE );
+ bSuccess |= pMgr->InsertFile( this, aObj.GetMainURL() );
+ }
+ bDropMoveOk = TRUE;
+ return bSuccess ? bSuccess : SvTreeListBox::Drop( rEvt );
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::QueryDrop( DropEvent& rEvt )
+
+/* [Beschreibung]
+
+ QueryDrop Handler; wird verwendet, um in der Dokumentenansicht weitere
+ Dokumente per Drag&Drop hinzuf"ugen zu k"onnen
+ (SV-Handler)
+
+ [Returnwert]
+
+ BOOL Erfolg oder Mi"serfolg
+
+ [Querverweise]
+ <SfxOrganizeListBox_Impl::Drop(DropEvent& rEvt)>
+*/
+
+{
+
+/* if(rEvt.GetAction()==DROP_MOVE && !bDropMoveOk)
+ return FALSE;*/
+ if( rEvt.IsDefaultAction() )
+ rEvt.SetAction( DROP_COPY );
+ return eViewType == VIEW_FILES && DragServer::HasFormat(0, FORMAT_FILE)
+ ? TRUE : SvTreeListBox::QueryDrop(rEvt);
+}
+
+//-------------------------------------------------------------------------
+
+inline USHORT SfxOrganizeListBox_Impl::GetDocLevel() const
+
+/* [Beschreibung]
+
+ Ermittelt, auf welche Ebene sich Dokumente befinden (unterschiedlich
+ in der Dokumentvorlagensicht und der Dokumentensicht)
+
+ [Returnwert]
+
+ USHORT Die Ebene der Dokumente
+
+*/
+
+{
+ return eViewType == VIEW_FILES? 0: 1;
+}
+
+//-------------------------------------------------------------------------
+
+SfxObjectShellRef SfxOrganizeListBox_Impl::GetObjectShell(const Path &rPath)
+
+/* [Beschreibung]
+
+ Zugriff auf die ObjectShell, die dem aktuellen Eintrag zugeordnet
+ ist.
+
+ [Parameter]
+
+ const Path &rPath Beschreibung des aktuellen Eintrags
+
+ [Returnwert]
+
+ SfxObjectShellRef Referenz auf die ObjectShell
+
+ [Querverweise]
+
+ <class Path>
+
+*/
+
+{
+ SfxObjectShellRef aDoc;
+ if(eViewType == VIEW_FILES)
+ aDoc = pMgr->CreateObjectShell(rPath[0]);
+ else
+ aDoc = pMgr->CreateObjectShell(rPath[0], rPath[1]);
+ return aDoc;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxOrganizeListBox_Impl::RequestingChilds( SvLBoxEntry* pEntry )
+
+/* [Beschreibung]
+
+ Aufforderung, der Childs eines Eintrags einzuf"ugen
+ ist.
+ (SV-Handler)
+
+ [Parameter]
+
+ SvLBoxEntry* pEntry der Eintrag, dessen Childs erfragt werden
+
+
+*/
+
+{
+ // wenn keine Childs vorhanden sind, gfs. Childs
+ // einfuegen
+ if(!GetModel()->HasChilds(pEntry))
+ {
+ // hier sind alle initial eingefuegt
+ SfxErrorContext aEc(ERRCTX_SFX_CREATEOBJSH, pDlg->pDialog);
+ if(VIEW_TEMPLATES == GetViewType() && 0 == GetModel()->GetDepth(pEntry))
+ {
+ USHORT i = (USHORT)GetModel()->GetRelPos(pEntry);
+ const USHORT nEntryCount = pMgr->GetTemplates()->GetCount(i);
+ for(USHORT j = 0; j < nEntryCount; ++j)
+ InsertEntry( pMgr->GetTemplates()->GetName( i, j ),
+ aOpenedDocBmp, aClosedDocBmp, pEntry, TRUE );
+ }
+ else
+ {
+ const USHORT nDocLevel = GetDocLevel();
+ Path aPath(this, pEntry);
+ SfxObjectShellRef aRef = GetObjectShell(aPath);
+ if(aRef.Is())
+ {
+ const USHORT nCount = aRef->GetContentCount(
+ aPath[nDocLevel+1], aPath[nDocLevel+2]);
+ String aText;
+ Bitmap aClosedBmp, aOpenedBmp;
+ const BOOL bCanHaveChilds =
+ aRef->CanHaveChilds(aPath[nDocLevel+1],
+ aPath[nDocLevel+2]);
+ for(USHORT i = 0; i < nCount; ++i)
+ {
+ BOOL bDeletable;
+ aRef->GetContent(
+ aText, aClosedBmp, aOpenedBmp, bDeletable,
+ i, aPath[nDocLevel+1], aPath[nDocLevel+2]);
+ SvLBoxEntry *pNew=InsertEntry(
+ aText, aOpenedBmp, aClosedBmp,
+ pEntry, bCanHaveChilds);
+ pNew->SetUserData(bDeletable ? &bDeletable : 0);
+ }
+ }
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+long SfxOrganizeListBox_Impl::ExpandingHdl()
+
+/* [Beschreibung]
+
+ SV-Handler, der nach dem und vor dem Aufklappen eines Eintrags
+ gerufen wird.
+ Wird verwendet, um gfs. die ObjectShell wieder zu schlie"sen;
+ die Eintr"age mit den Inhalten dieser Shell werden ebenfalls
+ entfernt.
+
+*/
+
+{
+ if ( !(nImpFlags & SVLBOX_IS_EXPANDING) )
+ {
+ SvLBoxEntry* pEntry = GetHdlEntry();
+ const USHORT nLevel = GetModel()->GetDepth(pEntry);
+ if((eViewType == VIEW_FILES && nLevel == 0) ||
+ (eViewType == VIEW_TEMPLATES && nLevel == 1))
+ {
+ Path aPath(this, pEntry);
+ // Beim Schliessen des Files die ObjectShell freigeben
+ if(eViewType == VIEW_FILES && nLevel == 0)
+ pMgr->DeleteObjectShell(aPath[0]);
+ else
+ pMgr->DeleteObjectShell(aPath[0], aPath[1]);
+ // alle SubEntries loeschen
+ SvLBoxEntry *pToDel = SvLBox::GetEntry(pEntry, 0);
+ while(pToDel)
+ {
+ GetModel()->Remove(pToDel);
+ pToDel = SvLBox::GetEntry(pEntry, 0);
+ }
+ }
+ }
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeListBox_Impl::IsUniqName_Impl(const String &rText,
+ SvLBoxEntry* pParent, SvLBoxEntry *pEntry) const
+
+/* [Beschreibung]
+
+ Pr"uft, ob eine Name auf seiner Ebene eindeutig ist.
+
+ [Parameter]
+
+ const String & Name des zu suchenden Eintrags
+ SvLBoxEntry* pSibling Geschwister (bezeichnet die Ebene)
+
+ [Returnwert]
+
+ BOOL TRUE, wenn der Name eindeutig ist, sonst FALSE
+*/
+
+{
+ SvLBoxEntry* pChild = FirstChild(pParent);
+ while(pChild) {
+ const String aEntryText(GetEntryText(pChild));
+ if(COMPARE_EQUAL == aEntryText.CompareIgnoreCaseToAscii(rText)&&(!pEntry || pEntry!=pChild))
+ return FALSE;
+ pChild = NextSibling(pChild);
+ }
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+USHORT SfxOrganizeListBox_Impl::GetLevelCount_Impl(SvLBoxEntry* pParent) const
+{
+ SvLBoxEntry* pChild = FirstChild(pParent);
+ USHORT nCount = 0;
+ while(pChild) {
+ pChild = NextSibling(pChild);
+ ++nCount;
+ }
+ return nCount;
+}
+
+//-------------------------------------------------------------------------
+
+SfxOrganizeListBox_Impl::SfxOrganizeListBox_Impl(
+ SfxOrganizeDlg_Impl *pArgDlg, Window *pParent,
+ WinBits nBits, DataEnum eType)
+: SvTreeListBox(pParent, nBits), pMgr(0), eViewType(eType),
+ pDlg(pArgDlg)
+
+/* [Beschreibung]
+
+ Konstruktor SfxOrganizeListBox
+
+*/
+
+{
+ SetDragDropMode( SV_DRAGDROP_CTRL_MOVE |
+ SV_DRAGDROP_CTRL_COPY |
+ SV_DRAGDROP_APP_MOVE |
+ SV_DRAGDROP_APP_COPY |
+ SV_DRAGDROP_APP_DROP);
+// SetDragOptions(DROP_COPY);
+ SetEntryHeight( 16 );
+ SetSelectionMode(SINGLE_SELECTION);
+ EnableDrop();
+ GetModel()->SetSortMode(SortNone); // Bug in SvTools 303
+}
+
+//-------------------------------------------------------------------------
+
+void SfxOrganizeListBox_Impl::Reset()
+
+/* [Beschreibung]
+
+ Einf"ugen der Elemente in die ListBox
+
+*/
+
+{
+ DBG_ASSERT( pMgr != 0, "kein Manager" );
+ // Inhalte l"oschen
+ SetUpdateMode(FALSE);
+ Clear();
+ if ( VIEW_TEMPLATES == eViewType )
+ {
+ const USHORT nCount = pMgr->GetTemplates()->GetRegionCount();
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ SvLBoxEntry* pEntry = InsertEntry( pMgr->GetTemplates()->GetFullRegionName(i),
+ aOpenedFolderBmp, aClosedFolderBmp, 0, TRUE );
+ }
+ }
+ else
+ {
+ const SfxObjectList& rList = pMgr->GetObjectList();
+ const USHORT nCount = rList.Count();
+ for ( USHORT i = 0; i < nCount; ++i )
+ InsertEntry( rList.GetBaseName(i), aOpenedDocBmp, aClosedDocBmp, 0, TRUE );
+
+ }
+ SetUpdateMode(TRUE);
+ Invalidate();
+ Update();
+}
+
+//-------------------------------------------------------------------------
+
+const Image &SfxOrganizeListBox_Impl::GetClosedBmp(USHORT nLevel) const
+
+/* [Beschreibung]
+
+ Zugriff auf die Bitmap f"ur einen geschlossenen Eintrag
+ der jeweiligen Ebene
+
+ [Parameter]
+
+ USHORT nLevel Angabe der Ebene, 2 Ebenen sind erlaubt
+
+ [Returnwert]
+
+ const Image & das Image auf der Ebenen nLevel
+
+*/
+
+{
+ switch(nLevel) {
+ case 0: return aClosedFolderBmp;
+ case 1: return aClosedDocBmp;
+ }
+ DBG_ERROR("Bitmaps ueberindiziert");
+ return aClosedFolderBmp;
+}
+
+//-------------------------------------------------------------------------
+
+const Image &SfxOrganizeListBox_Impl::GetOpenedBmp(USHORT nLevel) const
+
+/* [Beschreibung]
+
+ Zugriff auf die Bitmap f"ur einen ge"offneten Eintrag
+ der jeweiligen Ebene
+
+ [Parameter]
+
+ USHORT nLevel Angabe der Ebene, 2 Ebenen sind erlaubt
+
+ [Returnwert]
+
+ const Image & das Image auf der Ebenen nLevel
+
+*/
+
+{
+ switch(nLevel)
+ {
+ case 0:
+ return aOpenedFolderBmp;
+ case 1:
+ return aOpenedDocBmp;
+ }
+ DBG_ERROR("Bitmaps ueberindiziert");
+ return aClosedFolderBmp;
+}
+
+//-------------------------------------------------------------------------
+
+String SfxOrganizeDlg_Impl::GetPath_Impl( BOOL bOpen, const String& rFileName )
+
+/* [Beschreibung]
+
+ Pfad per FileDialog erfragen, f"ur Import / Export von
+ Dokumentvorlagen
+
+ [Parameter]
+
+ BOOL bOpen Flag: "Offnen / Speichern
+ const String& rFileName aktueller Dateiname als Vorschlag
+
+ [R"uckgabewert] Dateiname mit Pfad oder Leerstring, wenn
+ der Benutzer 'Abbrechen' gedr"uckt hat
+*/
+
+{
+ String aPath;
+ ULONG nBits = bOpen ? WB_OPEN | WB_3DLOOK : WB_SAVEAS | WB_3DLOOK;
+ SfxSimpleFileDialog* pFileDlg = new SfxSimpleFileDialog( pDialog, nBits );
+ pFileDlg->SetDefaultExt( DEFINE_CONST_UNICODE( "vor" ) );
+ pFileDlg->AddFilter( String( SfxResId( STR_FILTERNAME_ALL ) ), DEFINE_CONST_UNICODE( FILEDIALOG_FILTER_ALL ) );
+ const String aFilter( SfxResId( STR_TEMPLATE_FILTER ) );
+ pFileDlg->AddFilter( aFilter, DEFINE_CONST_UNICODE( "*.vor" ) );
+ pFileDlg->SetCurFilter( aFilter );
+ if ( aLastDir.Len() || rFileName.Len() )
+ {
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( INET_PROT_FILE );
+ if ( aLastDir.Len() )
+ {
+ aObj.SetSmartURL( aLastDir );
+ if ( rFileName.Len() )
+ aObj.insertName( rFileName );
+ }
+ else
+ aObj.SetSmartURL( rFileName );
+ pFileDlg->SetPath( aObj.GetMainURL() );
+ }
+ if ( RET_OK == pFileDlg->Execute() )
+ {
+ aPath = pFileDlg->GetPath();
+ INetURLObject aObj( aPath );
+ aObj.removeSegment();
+ aLastDir = aObj.GetMainURL();
+ }
+ delete pFileDlg;
+ return aPath;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxOrganizeDlg_Impl::DontDelete_Impl( SvLBoxEntry *pEntry)
+{
+ USHORT nDepth = pFocusBox->GetModel()->GetDepth(pEntry);
+ if(SfxOrganizeListBox_Impl::VIEW_FILES ==
+ pFocusBox->GetViewType())
+ nDepth++;
+ if( nDepth > 2 && !pEntry->GetUserData() ||
+ //Delete ueber GetContent verboten
+ pFocusBox->IsStandard_Impl(pEntry) ||
+ //StandardVorlage nicht loeschen
+ nDepth==2 || //Vorlage / Konfigurtionsrubrik nicht loeshcen
+ (nDepth==1 && SfxOrganizeListBox_Impl::VIEW_FILES ==
+ pFocusBox->GetViewType()) || //Files nicht loeschen
+ (0 == nDepth && pFocusBox->GetLevelCount_Impl(0) < 2))
+ //Mindestens eine Vorlage behalten
+ return TRUE;
+ else
+ return FALSE;
+}
+
+long SfxOrganizeDlg_Impl::Dispatch_Impl(USHORT nId)
+
+/* [Beschreibung]
+
+ Verarbeiten der Events aus MenuButton oder Accelerator
+
+ [Parameter]
+
+ USHORT nId ID des Events
+
+ [R"uckgabewert] 1: Event wurde verarbeitet,
+ 0: Event wurde nicht verarbeitet (SV-Menu)
+
+*/
+
+{
+ SuspendAccel aTmp(&aEditAcc);
+ SvLBoxEntry *pEntry = pFocusBox? pFocusBox->FirstSelected(): 0;
+ switch(nId)
+ {
+ case ID_NEW:
+ {
+ if(!pEntry)
+ return 1;
+ if(pFocusBox->GetViewType() == SfxOrganizeListBox_Impl::VIEW_TEMPLATES)
+ {
+ if(0 == pFocusBox->GetModel()->GetDepth(pEntry))
+ {
+ const String aNoName( SfxResId(STR_NONAME) );
+ SvLBoxEntry* pParent = pFocusBox->GetParent(pEntry);
+ String aName(aNoName);
+ USHORT n = 1;
+ while(!pFocusBox->IsUniqName_Impl(aName, pParent))
+ {
+ aName = aNoName;
+ aName += String::CreateFromInt32( n++ );
+ }
+ aMgr.InsertDir( pFocusBox, aName,
+ (USHORT)pFocusBox->GetModel()->GetRelPos(pEntry)+1);
+ }
+ }
+ break;
+ }
+
+ case ID_DELETE:
+ {
+ if(!pEntry || DontDelete_Impl(pEntry))
+ return 1;
+ const USHORT nDepth = pFocusBox->GetModel()->GetDepth(pEntry);
+ if(nDepth < 2)
+ {
+ if(0 == nDepth && pFocusBox->GetLevelCount_Impl(0) < 2) return 1;
+ if(SfxOrganizeListBox_Impl::VIEW_TEMPLATES ==
+ pFocusBox->GetViewType())
+ {
+ USHORT nResId = nDepth? STR_DELETE_TEMPLATE :
+ STR_DELETE_REGION;
+ String aStd(SfxResId(STR_STANDARD));
+ aStd.ToUpperAscii();
+ String aStdText(pFocusBox->GetEntryText(pEntry));
+ aStdText.ToUpperAscii();
+ if(!nDepth && aStdText.Match(aStd)>=aStd.Len())
+ return 1;
+ if( !QueryDelete_Impl(
+ pDialog, nResId, pFocusBox->GetEntryText(pEntry)))
+ return 1;
+ if ( STR_DELETE_REGION == nResId &&
+ pFocusBox->GetChildCount(pEntry))
+ {
+ QueryBox aQBox(pDialog, SfxResId(MSG_REGION_NOTEMPTY));
+ if(RET_NO == aQBox.Execute())
+ return 1;
+ }
+ USHORT nRegion = 0, nIndex = 0;
+ GetIndices_Impl(pFocusBox, pEntry, nRegion, nIndex);
+ BOOL bResetDef=FALSE;
+
+ if ( !aMgr.Delete(
+ pFocusBox, nRegion,
+ STR_DELETE_REGION == nResId? USHRT_MAX: nIndex) )
+ ErrorDelete_Impl(
+ pDialog, pFocusBox->GetEntryText(pEntry));
+
+ }
+ }
+ // Inhaltsformen
+ else if(nDepth + pFocusBox->GetDocLevel() >= 2)
+ {
+ String aStd(SfxResId(STR_STANDARD));
+ aStd.ToUpperAscii();
+ String aStdText(pFocusBox->GetEntryText(pEntry));
+ aStdText.ToUpperAscii();
+ if(!nDepth && aStdText.Match(aStd)>=aStd.Len())
+ return 1;
+ if(!QueryDelete_Impl(pDialog, STR_DELETE_TEMPLATE, pFocusBox->GetEntryText(pEntry)))
+ return 1;
+ Path aPath(pFocusBox, pEntry);
+ SfxObjectShellRef aRef = pFocusBox->GetObjectShell(aPath);
+ if(aRef.Is() &&
+ aRef->Remove(aPath[1+pFocusBox->GetDocLevel()],
+ aPath[2+pFocusBox->GetDocLevel()],
+ aPath[3+pFocusBox->GetDocLevel()]))
+ pFocusBox->GetModel()->Remove(pEntry);
+ else
+ ErrorDelete_Impl(pDialog, pFocusBox->GetEntryText(pEntry));
+ }
+ break;
+ }
+
+ case ID_EDIT:
+ {
+ if(!pEntry)
+ return 1;
+ USHORT nRegion = 0, nIndex = 0;
+ GetIndices_Impl( pFocusBox, pEntry, nRegion, nIndex );
+ const SfxStringItem aName( SID_FILE_NAME, aMgr.GetTemplates()->GetPath( nRegion, nIndex ) );
+ const SfxStringItem aLongName( SID_FILE_LONGNAME, pFocusBox->GetEntryText( pEntry ) );
+ const SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE( "private:user" ) );
+
+ SFX_APP()->GetAppDispatcher_Impl()->Execute( SID_OPENTEMPLATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD,
+ &aName, &aLongName, &aReferer, 0L );
+ pDialog->EndDialog( RET_EDIT_STYLE );
+ break;
+ }
+
+ case ID_COPY_FROM:
+ {
+ if ( !pEntry )
+ return 1;
+ USHORT nRegion = 0, nIndex = 0;
+ GetIndices_Impl( pFocusBox, pEntry, nRegion, nIndex );
+ String aPath = GetPath_Impl( TRUE, String() );
+
+ if ( aPath.Len() && !aMgr.CopyFrom( pFocusBox, nRegion, nIndex, aPath ) )
+ {
+ String aText( SfxResId( STR_ERROR_COPY_TEMPLATE ) );
+ aText.SearchAndReplaceAscii( "$1", aPath );
+ ErrorBox( pDialog, WB_OK, aText ).Execute();
+ }
+ break;
+ }
+
+ case ID_COPY_TO:
+ {
+ if ( !pEntry )
+ return 1;
+ USHORT nRegion = 0, nIndex = 0;
+ GetIndices_Impl( pFocusBox, pEntry, nRegion, nIndex );
+ String aPath = GetPath_Impl( FALSE, aMgr.GetTemplates()->GetFileName( nRegion, nIndex ) );
+
+ if ( aPath.Len() && !aMgr.CopyTo( nRegion, nIndex, aPath ) )
+ {
+ String aText( SfxResId( STR_ERROR_COPY_TEMPLATE ) );
+ aText.SearchAndReplaceAscii( "$1", aPath );
+ ErrorBox( pDialog, WB_OK, aText ).Execute();
+ }
+ break;
+ }
+
+ case ID_RESCAN:
+ if ( !aMgr.Rescan() )
+ ErrorBox( pDialog, SfxResId( MSG_ERROR_RESCAN ) ).Execute();
+ if ( SfxOrganizeListBox_Impl::VIEW_TEMPLATES == aLeftLb.GetViewType() )
+ aLeftLb.Reset();
+ if ( SfxOrganizeListBox_Impl::VIEW_TEMPLATES == aRightLb.GetViewType() )
+ aRightLb.Reset();
+ break;
+
+ case ID_PRINT:
+ {
+ if ( !pEntry )
+ return 1;
+ Path aPath( pFocusBox, pEntry );
+ SfxObjectShellRef aRef = pFocusBox->GetObjectShell( aPath );
+ if ( aRef.Is() )
+ {
+ const USHORT nDocLevel = pFocusBox->GetDocLevel();
+ if ( !pPrt )
+ pPrt = new Printer;
+ SvLBoxEntry *pDocEntry = pEntry;
+ while ( pFocusBox->GetModel()->GetDepth( pDocEntry ) > nDocLevel )
+ pDocEntry = pFocusBox->GetParent( pDocEntry );
+ const String aName(pFocusBox->GetEntryText(pDocEntry));
+ if ( !aRef->Print( *pPrt, aPath[1+nDocLevel],
+ aPath[2+nDocLevel], aPath[3+nDocLevel], &aName ) )
+ ErrorBox( pDialog, SfxResId( MSG_PRINT_ERROR ) ).Execute();
+ }
+ break;
+ }
+
+ case ID_PRINTER_SETUP:
+ {
+ PrinterSetupDialog* pDlg = new PrinterSetupDialog( pDialog );
+ if ( !pPrt )
+ pPrt = new Printer;
+ pDlg->SetPrinter( pPrt );
+ pDlg->Execute();
+ delete pDlg;
+#ifdef MAC
+ // bei bestimmten Druckertreibern gibt es Probleme mit
+ // dem Repaint. Deshalb hier explizit Invalidate() rufen
+ pDialog->Invalidate();
+#endif
+ break;
+ }
+
+ default: return 0;
+ }
+ return 1;
+
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxOrganizeDlg_Impl, MenuSelect_Impl, Menu *, pMenu )
+
+/* [Beschreibung]
+
+ SelectHandler des Men"us des Men"ubuttons (SV)
+
+ [Parameter]
+
+ MenuButton *pBtn der das Event ausl"osende Button
+
+ [R"uckgabewert] 1: Event wurde verarbeitet,
+ 0: Event wurde nicht verarbeitet (SV-Menu)
+
+*/
+{
+ return Dispatch_Impl(pMenu->GetCurItemId());
+}
+IMPL_LINK_INLINE_END( SfxOrganizeDlg_Impl, MenuSelect_Impl, Menu *, pMenu )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxOrganizeDlg_Impl, AccelSelect_Impl, Accelerator *, pAccel )
+
+/* [Beschreibung]
+
+ SelectHandler des Accelerators (SV)
+
+ [Parameter]
+
+ Accelerator *pAccel der das Event ausl"osende Accelerator
+
+ [R"uckgabewert] 1: Event wurde verarbeitet,
+ 0: Event wurde nicht verarbeitet (SV)
+
+*/
+{
+ SvLBoxEntry *pEntry=pFocusBox && pFocusBox->GetSelectionCount()
+ ? pFocusBox->FirstSelected() : 0 ;
+ return pEntry && (pAccel->GetCurItemId() == ID_NEW ||
+ !DontDelete_Impl(pEntry)) ?
+ Dispatch_Impl(pAccel->GetCurItemId()): 0;
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxOrganizeDlg_Impl::OkHdl(Button *pButton)
+{
+ if(pFocusBox && pFocusBox->IsEditingActive())
+ pFocusBox->EndEditing(FALSE);
+ pButton->Click();
+}
+
+
+
+IMPL_LINK( SfxOrganizeDlg_Impl, MenuActivate_Impl, Menu *, pMenu )
+
+/* [Beschreibung]
+
+ ActivateHandler des Men"us des Men"ubuttons (SV)
+
+ [Parameter]
+
+ Menu *pMenu das das Event ausl"osende Men"u
+
+ [R"uckgabewert] 1: Event wurde verarbeitet,
+ 0: Event wurde nicht verarbeitet (SV-Menu)
+
+*/
+{
+ if ( pFocusBox && pFocusBox->IsEditingActive() )
+ pFocusBox->EndEditing( FALSE );
+ BOOL bEnable = ( pFocusBox && pFocusBox->GetSelectionCount() );
+ SvLBoxEntry* pEntry = bEnable ? pFocusBox->FirstSelected() : NULL;
+ const USHORT nDepth =
+ ( bEnable && pFocusBox->GetSelectionCount() ) ? pFocusBox->GetModel()->GetDepth( pEntry ) : 0;
+ const USHORT nDocLevel = bEnable ? pFocusBox->GetDocLevel() : 0;
+ int eVT = pFocusBox ? pFocusBox->GetViewType() : 0;
+ // nur Vorlagen anlegen
+ pMenu->EnableItem( ID_NEW, bEnable && 0 == nDepth && SfxOrganizeListBox_Impl::VIEW_TEMPLATES == eVT );
+ // Vorlagen: Loeschen Ebene 0,1,3ff
+ // ein Bereich mu"s mindestens erhalten bleiben
+ // Dateien : Loeschen Ebene > 2
+
+ pMenu->EnableItem( ID_DELETE, bEnable && !DontDelete_Impl( pEntry ) );
+ pMenu->EnableItem( ID_EDIT,
+ bEnable && eVT == SfxOrganizeListBox_Impl::VIEW_TEMPLATES && nDepth == nDocLevel );
+ pMenu->EnableItem( ID_COPY_FROM,
+ bEnable && eVT == SfxOrganizeListBox_Impl::VIEW_TEMPLATES &&
+ ( nDepth == nDocLevel || nDepth == nDocLevel - 1 ) );
+ pMenu->EnableItem( ID_COPY_TO,
+ bEnable && eVT == SfxOrganizeListBox_Impl::VIEW_TEMPLATES &&
+ nDepth == nDocLevel );
+ pMenu->EnableItem( ID_RESCAN,
+ SfxOrganizeListBox_Impl::VIEW_TEMPLATES == aRightLb.GetViewType() ||
+ SfxOrganizeListBox_Impl::VIEW_TEMPLATES == aLeftLb.GetViewType() );
+ BOOL bPrint = bEnable && nDepth > pFocusBox->GetDocLevel();
+ if ( bPrint && pPrt )
+ bPrint = !pPrt->IsPrinting() && !pPrt->IsJobActive();
+ if ( bPrint && bEnable )
+ {
+ // only styles printable
+ Path aPath( pFocusBox, pFocusBox->FirstSelected() );
+ USHORT nIndex = aPath[ nDocLevel + 1 ];
+ bPrint = ( nIndex == CONTENT_STYLE );
+ }
+ pMenu->EnableItem( ID_PRINT, bPrint );
+ pMenu->EnableItem( ID_RESET_DEFAULT_TEMPLATE, bEnable );
+ pMenu->EnableItem( ID_DEFAULT_TEMPLATE,
+ bEnable && eVT == SfxOrganizeListBox_Impl::VIEW_TEMPLATES && nDepth == nDocLevel );
+ return 1;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxOrganizeDlg_Impl, GetFocus_Impl, SfxOrganizeListBox_Impl *, pBox )
+
+/* [Beschreibung]
+
+ GetFocus-Handler, wird aus den Select-Handler der Listboxen
+ gerufen.
+ Wird verwendet, im die Listbox, die den Focus besitzt sowie
+ deren Zustand zu ermitteln.
+
+ [Parameter]
+
+ SfxOrganizeListBox *pBox die rufende Box
+
+*/
+
+{
+ if(pFocusBox && pFocusBox != pBox)
+ pFocusBox->SelectAll(FALSE);
+ pFocusBox = pBox;
+ aFilesBtn.Enable( SfxOrganizeListBox_Impl::VIEW_FILES ==
+ pFocusBox->GetViewType() );
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxOrganizeDlg_Impl, LeftListBoxSelect_Impl, ListBox *, pBox )
+
+/* [Beschreibung]
+
+ Select-Handler, wird aus den Select-Handler der Listboxen
+ gerufen.
+ Wenn sich der Modus der Boxen (Dokumentsicht, Dokumentvorlagensicht)
+ unterscheiden, werden die Models getrennt; andernfalls zusammengefa"st.
+
+ [Parameter]
+
+ ListBox *pBox die rufende Box
+
+*/
+{
+ const SfxOrganizeListBox_Impl::DataEnum
+ eViewType = pBox->GetSelectEntryPos() == 0 ?
+ SfxOrganizeListBox_Impl::VIEW_TEMPLATES : SfxOrganizeListBox_Impl::VIEW_FILES;
+ if(eViewType!= aLeftLb.GetViewType()) {
+ aLeftLb.SetViewType(eViewType);
+ if(aRightLb.GetViewType() == eViewType)
+ aLeftLb.SetModel(aRightLb.GetModel());
+ else {
+ // Models trennen
+ aLeftLb.DisconnectFromModel();
+ aLeftLb.Reset();
+ }
+ }
+ GetFocus_Impl(&aLeftLb);
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxOrganizeDlg_Impl, RightListBoxSelect_Impl, ListBox *, pBox )
+
+/* [Beschreibung]
+
+ Select-Handler, wird aus den Select-Handler der Listboxen
+ gerufen.
+ Wenn sich der Modus der Boxen (Dokumentsicht, Dokumentvorlagensicht)
+ unterscheiden, werden die Models getrennt; andernfalls zusammengefa"st.
+
+ [Parameter]
+
+ ListBox *pBox die rufende Box
+
+*/
+{
+ const SfxOrganizeListBox_Impl::DataEnum eViewType =
+ pBox->GetSelectEntryPos() == 0 ?
+ SfxOrganizeListBox_Impl::VIEW_TEMPLATES : SfxOrganizeListBox_Impl::VIEW_FILES;
+ if(eViewType!= aRightLb.GetViewType())
+ {
+ aRightLb.SetViewType(eViewType);
+ if(aLeftLb.GetViewType() == eViewType)
+ aRightLb.SetModel(aLeftLb.GetModel());
+ else
+ {
+ // Models trennen
+ aRightLb.DisconnectFromModel();
+ aRightLb.Reset();
+ }
+ }
+ aRightLb.GrabFocus();
+ GetFocus_Impl(&aRightLb);
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxOrganizeDlg_Impl, AddFiles_Impl, Button *, pButton )
+
+/* [Beschreibung]
+
+ Handler des Buttons f"ur das Hinzuf"ugen von Dateien per Dialog.
+
+ [Parameter]
+
+ Button * der Button, der dieses Events ausgel"ost hat.
+
+*/
+{
+ SfxSimpleFileDialog *pFileDlg = new SfxSimpleFileDialog( pDialog, WB_OPEN );
+ const SfxObjectFactory& rFact = SfxObjectFactory::GetDefaultFactory();
+ USHORT nMax = rFact.GetFilterCount();
+ for ( USHORT i = 0; i < nMax; ++i )
+ {
+ const SfxFilter* pFilter = rFact.GetFilter(i);
+ if ( pFilter->IsInternal() )
+ continue;
+ BOOL bIsImpFilter = pFilter->CanImport();
+ if (bIsImpFilter && pFilter->IsAllowedAsTemplate())
+ {
+ pFileDlg->AddFilter(
+ pFilter->GetUIName(), pFilter->GetWildcard()(),
+ pFilter->GetTypeName() );
+ }
+ }
+ pFileDlg->AddFilter( String(SfxResId(RID_STR_FILTCONFIG)), DEFINE_CONST_UNICODE( "*.cfg" ) );
+ pFileDlg->AddFilter( String(SfxResId(RID_STR_FILTBASIC)), DEFINE_CONST_UNICODE( "*.sbl" ) );
+
+ if ( aLastDir.Len() )
+ pFileDlg->SetPath( aLastDir );
+ if ( RET_OK == pFileDlg->Execute() )
+ {
+ String aPath = pFileDlg->GetPath();
+ aMgr.InsertFile( pFocusBox, aPath );
+ INetURLObject aObj( aPath );
+ aObj.removeSegment();
+ aObj.setFinalSlash();
+ aLastDir = aObj.GetMainURL();
+ }
+ delete pFileDlg;
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+short SfxTemplateOrganizeDlg::Execute()
+
+/* [Beschreibung]
+
+ "Uberladene Execute- Methode; speichert gfs. "Anderungen an den
+ Dokumentvorlagen
+ (SV-Methode)
+
+*/
+
+{
+ const short nRet = ModalDialog::Execute();
+ if(RET_CANCEL != nRet)
+ {
+ pImp->aMgr.SaveAll(this);
+ SfxTemplateDialog* pTemplDlg = SFX_APP()->GetTemplateDialog();
+ if(pTemplDlg)
+ pTemplDlg->Update();
+ }
+ return nRet;
+}
+
+
+//-------------------------------------------------------------------------
+
+SfxTemplateOrganizeDlg::SfxTemplateOrganizeDlg(Window * pParent,
+ SfxDocumentTemplates *pTempl)
+: ModalDialog( pParent, SfxResId(DLG_ORGANIZE)),
+ pImp( new SfxOrganizeDlg_Impl(this, pTempl) )
+
+/* [Beschreibung]
+
+ Konstruktor
+
+*/
+{
+ FreeResource();
+}
+
+//-------------------------------------------------------------------------
+
+SfxTemplateOrganizeDlg::~SfxTemplateOrganizeDlg()
+{
+ GetpApp()->RemoveAccel(&pImp->aEditAcc);
+ delete pImp->pPrt;
+ delete pImp;
+}
+
+
diff --git a/sfx2/source/doc/docvor.hrc b/sfx2/source/doc/docvor.hrc
new file mode 100644
index 000000000000..55579e7595d4
--- /dev/null
+++ b/sfx2/source/doc/docvor.hrc
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: docvor.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define BMP_OPENED_FOLDER 2
+#define BMP_CLOSED_FOLDER 1
+#define BMP_OPENED_DOC 3
+#define BMP_CLOSED_DOC 4
+#define ACC_EDIT 1
+#define ID_COPY 201
+#define ID_MOVE 202
+#define ID_DELETE 203
+#define ID_EDIT 204
+#define ID_COPY_FROM 211
+#define ID_EXPORT 221
+#define ID_RESCAN 220
+#define ID_COPY_TO 210
+#define ID_DEFAULT_TEMPLATE 230
+#define ID_RESET_DEFAULT_TEMPLATE 231
+#define ID_NEW 200
+#define ID_PRINT 240
+#define ID_PRINTER_SETUP 2341
+
+#define LB_RIGHT_TYP 11
+#define LB_RIGHT 10
+#define LB_LEFT_TYP 2
+#define BTN_EDIT 105
+#define BTN_FILES 3
+#define LB_LEFT 1
+#define FT_DEFAULT_TEMPLATE_LABEL 20
+#define FT_DEFAULT_TEMPLATE 21
+#define BTN_HELP 100
+#define BTN_OK 100
+#define BTN_CANCEL 101
diff --git a/sfx2/source/doc/docvor.src b/sfx2/source/doc/docvor.src
new file mode 100644
index 000000000000..91c41d28750c
--- /dev/null
+++ b/sfx2/source/doc/docvor.src
@@ -0,0 +1,775 @@
+/*************************************************************************
+ *
+ * $RCSfile: docvor.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "doc.hrc"
+#include "docvor.hrc"
+#include "helpid.hrc"
+ // pragma ----------------------------------------------------------------
+
+ // DLG_ORGANIZE ----------------------------------------------------------
+ModalDialog DLG_ORGANIZE
+{
+ HelpId = SID_ORGANIZER ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 271 , 162 ) ;
+ Text = "Dokumentvorlagen verwalten" ;
+ Text [ English ] = "Manage document templates" ;
+ Text [ norwegian ] = "Rediger dokumentmaler" ;
+ Text [ italian ] = "Gestione dei modelli" ;
+ Text [ portuguese_brazilian ] = "Editar os modelos do documento" ;
+ Text [ portuguese ] = "Gerir modelos de documentos" ;
+ Text [ finnish ] = "Muokkaa asiakirjamalleja" ;
+ Text [ danish ] = "Administrer dokumentskabeloner" ;
+ Text [ french ] = "Gestion des modles de documents" ;
+ Text [ swedish ] = "Frvalta dokumentmallar" ;
+ Text [ dutch ] = "Sjablonen beheren" ;
+ Text [ spanish ] = "Administrar plantillas" ;
+ Text [ english_us ] = "Template Management" ;
+ Moveable = TRUE ;
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( 205 , 43 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 205 , 6 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Schlieen : Schlieen */
+ /* ### ACHTUNG: Neuer Text in Resource? Schlieen : Schlieen */
+ Text = "Schlieen" ;
+ Text [ English ] = "Close" ;
+ Text [ norwegian ] = "Lukk" ;
+ Text [ italian ] = "Chiudi" ;
+ Text [ portuguese_brazilian ] = "Fechar" ;
+ Text [ portuguese ] = "Fechar" ;
+ Text [ finnish ] = "Sulje" ;
+ Text [ danish ] = "Luk" ;
+ Text [ french ] = "Fermer" ;
+ Text [ swedish ] = "Stng" ;
+ Text [ dutch ] = "Sluiten" ;
+ Text [ spanish ] = "Cerrar" ;
+ Text [ english_us ] = "Close" ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ Text[ chinese_simplified ] = "ر";
+ Text[ russian ] = "";
+ Text[ polish ] = "Zamknij";
+ Text[ japanese ] = "‚";
+ Text[ chinese_traditional ] = "";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "ݱ";
+ Text[ turkish ] = "Kapat";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton BTN_FILES
+ {
+ Pos = MAP_APPFONT ( 205 , 143 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ Text = "~Datei..." ;
+ Text [ English ] = "~Files..." ;
+ Text [ norwegian ] = "~Filer..." ;
+ Text [ italian ] = "~File..." ;
+ Text [ portuguese_brazilian ] = "~Arquivos..." ;
+ Text [ portuguese ] = "~Ficheiro..." ;
+ Text [ finnish ] = "~Tiedostot..." ;
+ Text [ danish ] = "~Fil..." ;
+ Text [ french ] = "~Fichier..." ;
+ Text [ swedish ] = "~Arkiv..." ;
+ Text [ dutch ] = "~Bestand..." ;
+ Text [ spanish ] = "~Archivo..." ;
+ Text [ english_us ] = "~File..." ;
+ TabStop = TRUE ;
+ Text[ chinese_simplified ] = "ļ(~F)...";
+ Text[ russian ] = "...";
+ Text[ polish ] = "Pli~k...";
+ Text[ japanese ] = "̧فi~F)...";
+ Text[ chinese_traditional ] = "ɮ(~F)...";
+ Text[ arabic ] = "...";
+ Text[ greek ] = "~...";
+ Text[ korean ] = "(~F)...";
+ Text[ turkish ] = "Dosya";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_LEFT_TYP
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 144 ) ;
+ Size = MAP_APPFONT ( 94 , 55 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ CurPos = 0 ;
+ StringList =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ English ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ norwegian ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ italian ] =
+ {
+ < "Modelli" ; Default ; > ;
+ < "Documenti" ; Default ; > ;
+ };
+ StringList [ portuguese_brazilian ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Arquivos" ; Default ; > ;
+ };
+ StringList [ portuguese ] =
+ {
+ < "Modelos de documentos" ; Default ; > ;
+ < "Documentos" ; Default ; > ;
+ };
+ StringList [ finnish ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ danish ] =
+ {
+ < "Dokumentskabelon" ; Default ; > ;
+ < "Dokumenter" ; Default ; > ;
+ };
+ StringList [ french ] =
+ {
+ < "Modles de document" ; Default ; > ;
+ < "Documents" ; Default ; > ;
+ };
+ StringList [ swedish ] =
+ {
+ < "Dokumentmallar" ; Default ; > ;
+ < "Dokument" ; Default ; > ;
+ };
+ StringList [ dutch ] =
+ {
+ < "Sjablonen" ; Default ; > ;
+ < "Documenten" ; Default ; > ;
+ };
+ StringList [ spanish ] =
+ {
+ < "Plantillas de documento" ; Default ; > ;
+ < "Documentos" ; Default ; > ;
+ };
+ StringList [ english_us ] =
+ {
+ < "Templates" ; Default ; > ;
+ < "Documents" ; Default ; > ;
+ };
+ StringList [ chinese_simplified ] =
+ {
+ < "ĵʽ" ; Default ; > ;
+ < "ĵ" ; Default ; > ;
+ };
+ StringList [ russian ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ polish ] =
+ {
+ < "Szablony dokumentw" ; Default ; > ;
+ < "Dokumenty" ; Default ; > ;
+ };
+ StringList [ japanese ] =
+ {
+ < "޷Ăڰ" ; Default ; > ;
+ < "޷" ; Default ; > ;
+ };
+ StringList [ chinese_traditional ] =
+ {
+ < "˦" ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ arabic ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ greek ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ korean ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ turkish ] =
+ {
+ < "Belge ablonlar" ; Default ; > ;
+ < "Belgeler" ; Default ; > ;
+ };
+ StringList [ language_user1 ] =
+ {
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ };
+ };
+ ListBox LB_RIGHT_TYP
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 103 , 144 ) ;
+ Size = MAP_APPFONT ( 94 , 55 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ CurPos = 1 ;
+ StringList =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ English ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ norwegian ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ italian ] =
+ {
+ < "Modelli" ; Default ; > ;
+ < "Documenti" ; Default ; > ;
+ };
+ StringList [ portuguese_brazilian ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Arquivos" ; Default ; > ;
+ };
+ StringList [ portuguese ] =
+ {
+ < "Modelos de documentos" ; Default ; > ;
+ < "Documentos" ; Default ; > ;
+ };
+ StringList [ finnish ] =
+ {
+ < "Dokumentvorlagen" ; Default ; > ;
+ < "Dokumente" ; Default ; > ;
+ };
+ StringList [ danish ] =
+ {
+ < "Dokumentskabeloner" ; Default ; > ;
+ < "Dokumenter" ; Default ; > ;
+ };
+ StringList [ french ] =
+ {
+ < "Modles de document" ; Default ; > ;
+ < "Documents" ; Default ; > ;
+ };
+ StringList [ swedish ] =
+ {
+ < "Dokumentmallar" ; Default ; > ;
+ < "Dokument" ; Default ; > ;
+ };
+ StringList [ dutch ] =
+ {
+ < "Sjablonen" ; Default ; > ;
+ < "Documenten" ; Default ; > ;
+ };
+ StringList [ spanish ] =
+ {
+ < "Plantillas de documento" ; Default ; > ;
+ < "Documentos" ; Default ; > ;
+ };
+ StringList [ english_us ] =
+ {
+ < "Templates" ; Default ; > ;
+ < "Documents" ; Default ; > ;
+ };
+ StringList [ chinese_simplified ] =
+ {
+ < "ĵʽ" ; Default ; > ;
+ < "ĵ" ; Default ; > ;
+ };
+ StringList [ russian ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ polish ] =
+ {
+ < "Szablony dokumentw" ; Default ; > ;
+ < "Dokumenty" ; Default ; > ;
+ };
+ StringList [ japanese ] =
+ {
+ < "޷Ăڰ" ; Default ; > ;
+ < "޷" ; Default ; > ;
+ };
+ StringList [ chinese_traditional ] =
+ {
+ < "˦" ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ arabic ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ greek ] =
+ {
+ < " " ; Default ; > ;
+ < "" ; Default ; > ;
+ };
+ StringList [ korean ] =
+ {
+ < " " ; Default ; > ;
+ < "ȼ" ; Default ; > ;
+ };
+ StringList [ turkish ] =
+ {
+ < "Belge ablonlar" ; Default ; > ;
+ < "Belgeler" ; Default ; > ;
+ };
+ StringList [ language_user1 ] =
+ {
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ };
+ };
+ Control LB_LEFT
+ {
+ HelpId = HID_CTL_ORGANIZER_LEFT ;
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 3 , 6 ) ;
+ Size = MAP_APPFONT ( 94 , 132 ) ;
+ TabStop = TRUE ;
+ ClipChildren = TRUE ;
+ };
+ Control LB_RIGHT
+ {
+ HelpId = HID_CTL_ORGANIZER_RIGHT ;
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 103 , 6 ) ;
+ Size = MAP_APPFONT ( 94 , 132 ) ;
+ TabStop = TRUE ;
+ ClipChildren = TRUE ;
+ };
+ Accelerator ACC_EDIT
+ {
+ ItemList =
+ {
+ AcceleratorItem
+ {
+ Identifier = ID_NEW ;
+ Key = KeyCode
+ {
+ Code = KEY_INSERT ;
+ };
+ };
+ AcceleratorItem
+ {
+ Identifier = ID_DELETE ;
+ Key = KeyCode
+ {
+ Code = KEY_DELETE ;
+ };
+ };
+ };
+ };
+ MenuButton BTN_EDIT
+ {
+ Pos = MAP_APPFONT ( 205 , 23 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ Text = "~Befehle" ;
+ Text [ English ] = "~Commands" ;
+ Text [ norwegian ] = "~Rediger" ;
+ Text [ italian ] = "Comandi" ;
+ Text [ portuguese_brazilian ] = "~Editar" ;
+ Text [ portuguese ] = "~Comandos" ;
+ Text [ finnish ] = "~Muokkaa" ;
+ Text [ danish ] = "Kommandoer" ;
+ Text [ french ] = "~Commandes" ;
+ Text [ swedish ] = "~Kommandon" ;
+ Text [ dutch ] = "~Opdrachten" ;
+ Text [ spanish ] = "~Comandos" ;
+ Text [ english_us ] = "Commands" ;
+ TabStop = TRUE ;
+ ButtonMenu = Menu
+ {
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = ID_NEW ;
+ HelpId = HID_ORGANIZE_NEW ;
+ Text = "~Neu" ;
+ Text [ English ] = "~New" ;
+ Text [ norwegian ] = "~New" ;
+ Text [ italian ] = "~Nuovo" ;
+ Text [ portuguese_brazilian ] = "~Novo" ;
+ Text [ portuguese ] = "~Novo" ;
+ Text [ finnish ] = "~Uusi" ;
+ Text [ danish ] = "~Ny(t)" ;
+ Text [ french ] = "~Nouveau" ;
+ Text [ swedish ] = "~Nytt" ;
+ Text [ dutch ] = "~Nieuw" ;
+ Text [ spanish ] = "~Nuevo" ;
+ Text [ english_us ] = "~New" ;
+ AccelKey = KeyCode
+ {
+ Code = KEY_INSERT ;
+ };
+ Text[ chinese_simplified ] = "½(~N)";
+ Text[ russian ] = "~";
+ Text[ polish ] = "Nowy";
+ Text[ japanese ] = "VK쐬(~N)";
+ Text[ chinese_traditional ] = "}ҷs(~N)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = " (~N)";
+ Text[ turkish ] = "Y~eni";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = ID_DELETE ;
+ HelpId = HID_ORGANIZE_DELETE ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Lschen : ~Lschen */
+ Text = "~Lschen" ;
+ Text [ English ] = "~Delete" ;
+ Text [ norwegian ] = "~Slett" ;
+ Text [ italian ] = "~Elimina" ;
+ Text [ portuguese_brazilian ] = "~Apagar" ;
+ Text [ portuguese ] = "E~liminar" ;
+ Text [ finnish ] = "~Poista" ;
+ Text [ danish ] = "~Slet" ;
+ Text [ french ] = "~Supprimer" ;
+ Text [ swedish ] = "~Radera" ;
+ Text [ dutch ] = "~Wissen" ;
+ Text [ spanish ] = "~Eliminar" ;
+ Text [ english_us ] = "~Delete" ;
+ AccelKey = KeyCode
+ {
+ Code = KEY_DELETE ;
+ };
+ Text[ chinese_simplified ] = "ɾ(~D)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Usu";
+ Text[ japanese ] = "폜(~D)";
+ Text[ chinese_traditional ] = "R(~D)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~D)";
+ Text[ turkish ] = "~Sil";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = ID_EDIT ;
+ HelpId = HID_ORGANIZE_EDIT ;
+ Text = "~Bearbeiten" ;
+ Text [ English ] = "~Edit" ;
+ Text [ norwegian ] = "~Rediger" ;
+ Text [ italian ] = "~Modifica" ;
+ Text [ portuguese_brazilian ] = "~Editar" ;
+ Text [ portuguese ] = "~Editar" ;
+ Text [ finnish ] = "~Muokkaa" ;
+ Text [ danish ] = "~Rediger" ;
+ Text [ french ] = "~Edition" ;
+ Text [ swedish ] = "~Redigera" ;
+ Text [ dutch ] = "~Bewerken" ;
+ Text [ spanish ] = "E~ditar" ;
+ Text [ english_us ] = "~Edit" ;
+ Text[ chinese_simplified ] = "༭(~E)";
+ Text[ russian ] = "~";
+ Text[ polish ] = "~Edytuj";
+ Text[ japanese ] = "ҏWi~dj";
+ Text[ chinese_traditional ] = "s(~E)";
+ Text[ arabic ] = "~";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~E)";
+ Text[ turkish ] = "~Dzenle";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE ;
+ };
+ MenuItem
+ {
+ Identifier = ID_COPY_FROM ;
+ HelpId = HID_ORGANIZE_COPY_FROM ;
+ Text = "Vorlage ~importieren..." ;
+ Text [ English ] = "Import from..." ;
+ Text [ norwegian ] = "Kopier til..." ;
+ Text [ italian ] = "~Importa modello..." ;
+ Text [ portuguese_brazilian ] = "Copiar para..." ;
+ Text [ portuguese ] = "I~mportar modelo..." ;
+ Text [ finnish ] = "Kopioi mihin..." ;
+ Text [ danish ] = "Importer skabelon..." ;
+ Text [ french ] = "I~mporter un modle..." ;
+ Text [ swedish ] = "~Importera mall..." ;
+ Text [ dutch ] = "Sjabloon ~importeren..." ;
+ Text [ spanish ] = "I~mportar plantilla..." ;
+ Text [ english_us ] = "Import Template..." ;
+ Text[ chinese_simplified ] = "ʽ(~M)...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Importuj szablon...";
+ Text[ japanese ] = "ڰĂ̲߰...";
+ Text[ chinese_traditional ] = "J˦(~M)...";
+ Text[ arabic ] = " ...";
+ Text[ greek ] = "~ ...";
+ Text[ korean ] = " ...";
+ Text[ turkish ] = "ablonu ie aktar...";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = ID_COPY_TO ;
+ HelpId = HID_ORGANIZE_COPY_TO ;
+ Text = "Vorlage ~exportieren..." ;
+ Text [ English ] = "Export to..." ;
+ Text [ norwegian ] = "Kopier fra..." ;
+ Text [ italian ] = "Esporta modello..." ;
+ Text [ portuguese_brazilian ] = "Copiar de..." ;
+ Text [ portuguese ] = "E~xportar modelo..." ;
+ Text [ finnish ] = "Kopioi mist..." ;
+ Text [ danish ] = "Eksporter skabelon..." ;
+ Text [ french ] = "E~xporter un modle..." ;
+ Text [ swedish ] = "~Exportera mall..." ;
+ Text [ dutch ] = "Sjabloon ~exporteren..." ;
+ Text [ spanish ] = "E~xportar plantilla..." ;
+ Text [ english_us ] = "Export Template..." ;
+ Text[ chinese_simplified ] = "ʽ(~X)...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Eksportuj szablon...";
+ Text[ japanese ] = "ڰĂ̴߰...";
+ Text[ chinese_traditional ] = "X˦(~X)...";
+ Text[ arabic ] = " ...";
+ Text[ greek ] = "~ ...";
+ Text[ korean ] = " ...";
+ Text[ turkish ] = "ablonu da aktar...";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE ;
+ };
+ MenuItem
+ {
+ Identifier = ID_PRINT ;
+ HelpId = HID_ORGANIZE_PRINT ;
+ Text = "~Drucken" ;
+ Text [ English ] = "~Print" ;
+ Text [ norwegian ] = "~Skriv ut" ;
+ Text [ italian ] = "Stam~pa" ;
+ Text [ portuguese_brazilian ] = "~Imprimir" ;
+ Text [ portuguese ] = "~Imprimir" ;
+ Text [ finnish ] = "Tul~osta" ;
+ Text [ danish ] = "~Udskriv" ;
+ Text [ french ] = "~Imprimer" ;
+ Text [ swedish ] = "Skriv ~ut" ;
+ Text [ dutch ] = "Af~drukken" ;
+ Text [ spanish ] = "~Imprimir" ;
+ Text [ english_us ] = "~Print" ;
+ Text[ chinese_simplified ] = "ӡ(~P)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Drukuj";
+ Text[ japanese ] = "(~P)";
+ Text[ chinese_traditional ] = "CL(~P)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "μ(~P)";
+ Text[ turkish ] = "~Yazdr";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = ID_PRINTER_SETUP ;
+ HelpId = HID_ORGANIZE_PRINTER_SETUP ;
+ Text = "Druckereinstellun~gen..." ;
+ Text [ English ] = "Printer ~Setup..." ;
+ Text [ norwegian ] = "~Printer Setup..." ;
+ Text [ italian ] = "I~mpostazioni stampante..." ;
+ Text [ portuguese_brazilian ] = "~Printer Setup..." ;
+ Text [ portuguese ] = "~Configurao da impressora..." ;
+ Text [ french ] = "~Paramtres de l'imprimante..." ;
+ Text [ dutch ] = "Printerinstellin~gen..." ;
+ Text [ spanish ] = "~Configuracin de la impresora..." ;
+ Text [ danish ] = "Udskriftsindstillin~ger..." ;
+ Text [ swedish ] = "~Skrivarinstllningar..." ;
+ Text [ finnish ] = "~Printer Setup..." ;
+ Text [ english_us ] = "Printer Settings..." ;
+ Text[ chinese_simplified ] = "趨ӡ...";
+ Text[ russian ] = " ...";
+ Text[ polish ] = "Ustawienia drukarki...";
+ Text[ japanese ] = "̐ݒ...";
+ Text[ chinese_traditional ] = "]wL...";
+ Text[ arabic ] = " ...";
+ Text[ greek ] = " ~...";
+ Text[ korean ] = " ...";
+ Text[ turkish ] = "Yazc ayarlar";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE ;
+ };
+ MenuItem
+ {
+ Identifier = ID_RESCAN ;
+ HelpId = HID_ORGANIZE_RESCAN ;
+ Text = "~Aktualisieren" ;
+ Text [ English ] = "~Update" ;
+ Text [ norwegian ] = "~Update" ;
+ Text [ italian ] = "~Aggiorna" ;
+ Text [ portuguese_brazilian ] = "~Atualizar" ;
+ Text [ portuguese ] = "~Actualizar" ;
+ Text [ finnish ] = "~Laske uudelleen" ;
+ Text [ danish ] = "Opdater" ;
+ Text [ french ] = "~Actualiser" ;
+ Text [ swedish ] = "Upp~datera" ;
+ Text [ dutch ] = "~Actualiseren" ;
+ Text [ spanish ] = "~Actualizar" ;
+ Text [ english_us ] = "Update" ;
+ Text[ chinese_simplified ] = "(~U)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Aktualizuj";
+ Text[ japanese ] = "XV";
+ Text[ chinese_traditional ] = "s(~U)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "Ʈ";
+ Text[ turkish ] = "Gncelle";
+ Text[ language_user1 ] = " ";
+ };
+ };
+ };
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Pole~cenia";
+ Text[ japanese ] = "";
+ Text[ chinese_traditional ] = "RO";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Komutlar";
+ Text[ language_user1 ] = " ";
+ };
+ Bitmap BMP_OPENED_FOLDER
+ {
+ File = "folderop.bmp" ;
+ };
+ Bitmap BMP_CLOSED_FOLDER
+ {
+ File = "foldercl.bmp" ;
+ };
+ Bitmap BMP_OPENED_DOC
+ {
+ File = "doccl.bmp" ;
+ };
+ Bitmap BMP_CLOSED_DOC
+ {
+ File = "doccl.bmp" ;
+ };
+ /* FixedText FT_DEFAULT_TEMPLATE_LABEL
+ {
+ Pos = MAP_APPFONT ( 3 , 161 ) ;
+ Size = MAP_APPFONT ( 61 , 10 ) ;
+ Text = "Standardvorlage:" ;
+ Text [ English ] = "Default template:" ;
+ Text [ norwegian ] = "Standardmal:" ;
+ Text [ italian ] = "Modello standard:" ;
+ Text [ portuguese_brazilian ] = "Modelo padro:" ;
+ Text [ portuguese ] = "Modelo padro:" ;
+ Text [ finnish ] = "Oletusmalli:" ;
+ Text [ danish ] = "Standardskabelon:" ;
+ Text [ french ] = "Modle par dfaut :" ;
+ Text [ swedish ] = "Standardmall:" ;
+ Text [ dutch ] = "Standaardsjabloon:" ;
+ Text [ spanish ] = "Plantilla estndar:" ;
+ Text [ english_us ] = "Default template:" ;
+ };
+ FixedText FT_DEFAULT_TEMPLATE
+ {
+ Pos = MAP_APPFONT ( 66 , 161 ) ;
+ Size = MAP_APPFONT ( 131 , 10 ) ;
+ };*/
+ Text[ chinese_simplified ] = "ĵʽ";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Zarzdzaj szablonami dokumentw";
+ Text[ japanese ] = "޷ڰĂ̊Ǘ";
+ Text[ chinese_traditional ] = "޲z˦";
+ Text[ arabic ] = " ";
+ Text[ greek ] = " ";
+ Text[ korean ] = " ";
+ Text[ turkish ] = "Belge ablonlar";
+ Text[ language_user1 ] = " ";
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
new file mode 100644
index 000000000000..7b65c5848bab
--- /dev/null
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -0,0 +1,1067 @@
+/*************************************************************************
+ *
+ * $RCSfile: frmdescr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <sot/object.hxx>
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#ifndef _SV_SPLITWIN_HXX //autogen
+#include <vcl/splitwin.hxx>
+#endif
+#ifndef _SFXITEMSET_HXX //autogen
+#include <svtools/itemset.hxx>
+#endif
+#pragma hdrstop
+
+#include "frmdescr.hxx"
+#include "app.hxx"
+
+DBG_NAME(SfxFrameSetDescriptor);
+DBG_NAME(SfxFrameDescriptor);
+
+#define VERSION (USHORT) 3
+
+struct SfxFrameSetDescriptor_Impl
+{
+ Wallpaper* pWallpaper;
+ Bitmap* pBitmap;
+ BOOL bNetscapeCompat;
+};
+
+struct SfxFrameDescriptor_Impl
+{
+ Wallpaper* pWallpaper;
+ SfxItemSet* pArgs;
+ BOOL bEditable;
+
+ SfxFrameDescriptor_Impl() : pWallpaper( NULL ), pArgs( NULL ), bEditable( TRUE ) {}
+ ~SfxFrameDescriptor_Impl()
+ {
+ delete pWallpaper;
+ delete pArgs;
+ }
+};
+
+SfxFrameSetDescriptor::SfxFrameSetDescriptor(SfxFrameDescriptor *pFrame) :
+ pParentFrame( pFrame ),
+ nFrameSpacing( SPACING_NOT_SET ),
+ bIsRoot( pParentFrame ? (pParentFrame->pParentFrameSet == 0) : TRUE ),
+ bRowSet( FALSE ),
+ nMaxId( 0 ),
+ nHasBorder( BORDER_YES )
+{
+ DBG_CTOR(SfxFrameSetDescriptor, 0);
+
+ pImp = new SfxFrameSetDescriptor_Impl;
+ pImp->pBitmap = NULL;
+ pImp->pWallpaper = NULL;
+ pImp->bNetscapeCompat = TRUE;
+ if ( pParentFrame )
+ pParentFrame->pFrameSet = this;
+ if ( bIsRoot )
+ nHasBorder |= BORDER_SET;
+}
+
+SfxFrameSetDescriptor::~SfxFrameSetDescriptor()
+{
+ DBG_DTOR(SfxFrameSetDescriptor, 0);
+
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ {
+ SfxFrameDescriptor *pFrame = aFrames[n];
+ pFrame->pParentFrameSet = NULL;
+ delete pFrame;
+ }
+ if ( pParentFrame )
+ pParentFrame->pFrameSet = NULL;
+ delete pImp;
+}
+
+SfxFrameDescriptor* SfxFrameSetDescriptor::SearchFrame( USHORT nId )
+{
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ {
+ SfxFrameDescriptor *pFrame = aFrames[n];
+ if ( pFrame->nItemId == nId )
+ return pFrame;
+ if ( pFrame->GetFrameSet() )
+ {
+ pFrame = pFrame->GetFrameSet()->SearchFrame( nId );
+ if ( pFrame )
+ return pFrame;
+ }
+ }
+
+ return NULL;
+}
+
+SfxFrameDescriptor* SfxFrameSetDescriptor::SearchFrame( const String& rName )
+{
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ {
+ SfxFrameDescriptor *pFrame = aFrames[n];
+ if ( pFrame->aName == rName )
+ return pFrame;
+ if ( pFrame->GetFrameSet() )
+ {
+ pFrame = pFrame->GetFrameSet()->SearchFrame( rName );
+ if ( pFrame )
+ return pFrame;
+ }
+ }
+
+ return NULL;
+}
+
+void SfxFrameSetDescriptor::InsertFrame
+(
+ SfxFrameDescriptor* pFrame,
+ USHORT nPos
+)
+{
+ // fucking SvPtrArrs ...
+ if ( nPos == 0xFFFF )
+ nPos = aFrames.Count();
+
+ aFrames.Insert( pFrame, nPos );
+ pFrame->pParentFrameSet = this;
+}
+
+void SfxFrameSetDescriptor::RemoveFrame( SfxFrameDescriptor* pFrame )
+{
+ USHORT nPos = aFrames.GetPos( pFrame );
+ DBG_ASSERT( nPos != 0xFFFF, "Unbekannter Frame!" );
+ aFrames.Remove( nPos );
+ pFrame->pParentFrameSet = 0L;
+}
+
+BOOL SfxFrameSetDescriptor::HasFrameBorder() const
+{
+ if ( pImp->bNetscapeCompat && !GetFrameSpacing() )
+ return FALSE;
+
+ if ( ( nHasBorder & BORDER_SET ) || bIsRoot )
+ return (nHasBorder & BORDER_YES) != 0;
+ else
+ return pParentFrame->HasFrameBorder();
+}
+
+//------------------------------------------------------------------------
+
+void SfxFrameSetDescriptor::SetNetscapeCompatibility( BOOL bCompat )
+// Frame-Spacing Verhalten wenn kein Border
+{
+ pImp->bNetscapeCompat = bCompat;
+}
+
+//------------------------------------------------------------------------
+
+BOOL SfxFrameSetDescriptor::GetNetscapeCompatibility() const
+// Frame-Spacing Verhalten wenn kein Border
+{
+ return pImp->bNetscapeCompat;
+}
+
+//------------------------------------------------------------------------
+
+long SfxFrameSetDescriptor::GetFrameSpacing() const
+{
+ if ( nFrameSpacing == SPACING_NOT_SET && !bIsRoot &&
+ pParentFrame && pParentFrame->pParentFrameSet )
+ {
+ return pParentFrame->pParentFrameSet->GetFrameSpacing();
+ }
+ else
+ return nFrameSpacing;
+}
+
+BOOL SfxFrameSetDescriptor::Store( SvStream& rStream ) const
+{
+ // Die "0" ist wg. Kompatibilit"at zu alten Versionen n"otig. Diese
+ // glauben dann, ein leeres Frameset zu lesen und st"urzen dann
+ // wenigstens nicht ab.
+ long lLength = 20;
+ rStream << VERSION << lLength << (USHORT) 0 << (USHORT) 0;
+ rStream << nHasBorder
+ << nFrameSpacing
+ << (USHORT) bRowSet
+ << aFrames.Count();
+
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ {
+ SfxFrameDescriptor* pFrame = aFrames[n];
+ pFrame->Store( rStream );
+ }
+ return TRUE;
+}
+
+BOOL SfxFrameSetDescriptor::Load( SvStream& rStream )
+{
+ long lPos = rStream.Tell(); // aktuelle Position merken
+ USHORT nCount=0, nHorizontal;
+ rStream >> nHasBorder
+ >> nFrameSpacing
+ >> nHorizontal
+ >> nCount;
+
+ if ( nCount == 0 )
+ {
+ // Das mu\s ein neues Format sein, da ein Frame normalerweise immer
+ // dabei ist
+ USHORT nVersion = nHasBorder;
+ rStream.Seek( lPos );
+ return Load( rStream, nVersion );
+ }
+
+ bRowSet = (BOOL) nHorizontal;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxFrameDescriptor *pFrame = new SfxFrameDescriptor( this );
+ pFrame->Load( rStream, 2 );
+ }
+ return TRUE;
+}
+
+BOOL SfxFrameSetDescriptor::Load( SvStream& rStream, USHORT nVersion )
+{
+ long lLength = 10; // in Version 2
+ long lPos = rStream.Tell(); // aktuelle Position merken
+
+ USHORT nCount=0, nHorizontal, nDummy1, nDummy2;
+ if ( nVersion > 2 )
+ // In der final Version
+ rStream >> nVersion >> lLength >> nDummy1 >> nDummy2;
+
+ rStream >> nHasBorder
+ >> nFrameSpacing
+ >> nHorizontal
+ >> nCount;
+
+ rStream.Seek( lPos + lLength );
+
+ bRowSet = (BOOL) nHorizontal;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxFrameDescriptor *pFrame = new SfxFrameDescriptor( this );
+ pFrame->Load( rStream, nVersion );
+ }
+ return TRUE;
+}
+
+void SfxFrameSetDescriptor::SetWallpaper( const Wallpaper& rWallpaper )
+{
+ DELETEZ( pImp->pWallpaper );
+
+ if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
+ pImp->pWallpaper = new Wallpaper( rWallpaper );
+}
+
+const Wallpaper* SfxFrameSetDescriptor::GetWallpaper() const
+{
+ return pImp->pWallpaper;
+}
+
+SfxFrameSetDescriptor* SfxFrameSetDescriptor::Clone(
+ SfxFrameDescriptor *pFrame, BOOL bWithIds ) const
+{
+ SfxFrameSetDescriptor *pSet = new SfxFrameSetDescriptor( pFrame );
+
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ SfxFrameDescriptor* pFrame = aFrames[n]->Clone( pSet, bWithIds );
+
+ pSet->aDocumentTitle = aDocumentTitle;
+ pSet->nFrameSpacing = nFrameSpacing;
+ pSet->nHasBorder = nHasBorder;
+ pSet->nMaxId = nMaxId;
+ pSet->bIsRoot = bIsRoot;
+ pSet->bRowSet = bRowSet;
+ if ( pImp->pWallpaper )
+ pSet->pImp->pWallpaper = new Wallpaper( *pImp->pWallpaper );
+ pSet->pImp->bNetscapeCompat = pImp->bNetscapeCompat;
+
+ return pSet;
+}
+
+BOOL SfxFrameSetDescriptor::CheckContent() const
+{
+ BOOL bRet=FALSE;
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ if ( bRet = aFrames[n]->CheckContent() )
+ break;
+ return bRet;
+}
+
+BOOL SfxFrameSetDescriptor::CompareOriginal(
+ SfxFrameSetDescriptor& rDescr ) const
+{
+ if( aFrames.Count() != rDescr.aFrames.Count() )
+ return FALSE;
+ else
+ for( USHORT nPos = aFrames.Count(); nPos--; )
+ if( !aFrames[ nPos ]->CompareOriginal(
+ *rDescr.aFrames[ nPos ] ) )
+ return FALSE;
+ return TRUE;
+}
+
+
+void SfxFrameSetDescriptor::UnifyContent( BOOL bTakeActual )
+{
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ aFrames[n]->UnifyContent( bTakeActual );
+}
+
+void SfxFrameSetDescriptor::CutRootSet()
+{
+ for ( USHORT n=0; n<aFrames.Count(); n++ )
+ {
+ SfxFrameDescriptor* pFrame = aFrames[n];
+ SfxFrameSetDescriptor *pSet = pFrame->GetFrameSet();
+ if ( pSet )
+ {
+ if ( pSet->bIsRoot )
+ {
+ delete pSet;
+ pFrame->pFrameSet = NULL;
+ }
+ else
+ pSet->CutRootSet();
+ }
+ }
+}
+
+USHORT SfxFrameSetDescriptor::MakeItemId()
+{
+ if ( pParentFrame && pParentFrame->pParentFrameSet )
+ return pParentFrame->pParentFrameSet->MakeItemId();
+ else
+ return ++nMaxId;
+}
+
+SfxFrameDescriptor::SfxFrameDescriptor( SfxFrameSetDescriptor *pParSet ) :
+ aMargin( -1, -1 ),
+ nWidth( 0L ),
+ nItemId( 0 ),
+ pFrameSet( 0L ),
+ pParentFrameSet( pParSet ),
+ eScroll( ScrollingAuto ),
+ eSizeSelector( SIZE_ABS ),
+ nHasBorder( BORDER_YES ),
+ bResizeHorizontal( TRUE ),
+ bResizeVertical( TRUE ),
+ bHasUI( TRUE ),
+ bReadOnly( FALSE )
+{
+ DBG_CTOR(SfxFrameDescriptor, 0);
+
+ pImp = new SfxFrameDescriptor_Impl;
+ if ( pParentFrameSet )
+ pParentFrameSet->InsertFrame( this );
+}
+
+SfxFrameDescriptor::~SfxFrameDescriptor()
+{
+ DBG_DTOR(SfxFrameDescriptor, 0);
+
+ if ( pFrameSet )
+ delete pFrameSet;
+ if ( pParentFrameSet )
+ pParentFrameSet->RemoveFrame( this );
+ delete pImp;
+}
+
+SfxItemSet* SfxFrameDescriptor::GetArgs()
+{
+ if( !pImp->pArgs )
+ pImp->pArgs = new SfxAllItemSet( SFX_APP()->GetPool() );
+ return pImp->pArgs;
+}
+
+void SfxFrameDescriptor::SetURL( const String& rURL )
+{
+ aURL = rURL;
+ SetActualURL( aURL );
+}
+
+void SfxFrameDescriptor::SetURL( const INetURLObject& rURL )
+{
+ aURL = rURL.GetMainURL();
+ SetActualURL( aURL );
+}
+
+void SfxFrameDescriptor::SetActualURL( const String& rURL )
+{
+ aActualURL = rURL;
+ if ( pImp->pArgs )
+ pImp->pArgs->ClearItem();
+}
+
+void SfxFrameDescriptor::SetActualURL( const INetURLObject& rURL )
+{
+ SetActualURL( rURL.GetMainURL() );
+}
+
+void SfxFrameDescriptor::SetEditable( BOOL bSet )
+{
+ pImp->bEditable = bSet;
+}
+
+BOOL SfxFrameDescriptor::IsEditable() const
+{
+ return pImp->bEditable;
+}
+
+BOOL SfxFrameDescriptor::CompareOriginal( SfxFrameDescriptor& rDescr ) const
+{
+ if( aURL != rDescr.aURL )
+ return FALSE;
+ else
+ // Zwei Descriptoren sind kompatibel, wenn einer keinen SetDescriptor
+ // und der andere einen RootDescriptor hat,
+ // wenn beide SetDescriptoren haben
+ // und diese kompatibel sind oder wenn beide keine
+ // SetDescriptoren haben.
+ return
+ !pFrameSet &&
+ ( !rDescr.pFrameSet || rDescr.pFrameSet->IsRootFrameSet() ) ||
+ !rDescr.pFrameSet && pFrameSet->IsRootFrameSet() ||
+ pFrameSet && rDescr.pFrameSet && pFrameSet->CompareOriginal(
+ *rDescr.pFrameSet );
+}
+
+BOOL SfxFrameDescriptor::CheckContent() const
+{
+ BOOL bRet = !( aURL == aActualURL );
+ if ( !bRet && pFrameSet )
+ bRet = pFrameSet->CheckContent();
+ return bRet;
+}
+
+void SfxFrameDescriptor::UnifyContent( BOOL bTakeActual )
+{
+ if ( bTakeActual )
+ aURL = aActualURL;
+ else
+ aActualURL = aURL;
+ if ( pFrameSet )
+ pFrameSet->UnifyContent( bTakeActual );
+}
+
+BOOL SfxFrameDescriptor::Store( SvStream& rStream ) const
+{
+ long lPos = rStream.Tell();
+ long lLength = 0L;
+ rStream << lLength << VERSION;
+
+ USHORT nFlags1 = 0;
+ USHORT nFlags2 = 0;
+ if ( bResizeHorizontal )
+ nFlags1 |= 0x01;
+ if ( bResizeVertical )
+ nFlags2 |= 0x01;
+ if ( !bHasUI ) // anders herum, damit kompatibel
+ nFlags1 |= 0x02;
+ if ( bReadOnly )
+ nFlags1 |= 0x04;
+
+ rStream.WriteByteString( INetURLObject::AbsToRel( aURL.GetMainURL() ), RTL_TEXTENCODING_UTF8 );
+ rStream.WriteByteString( aName, RTL_TEXTENCODING_UTF8 );
+ rStream << aMargin
+ << nWidth
+ << (USHORT) eSizeSelector
+ << (USHORT) eScroll
+ << (USHORT) nFlags1
+ << (USHORT) nFlags2
+ << (USHORT) (pFrameSet != 0)
+ << nHasBorder;
+
+ long lActPos = rStream.Tell();
+ lLength = lActPos - lPos;
+ rStream.Seek( lPos );
+ rStream << lLength;
+ rStream.Seek( lActPos );
+
+ if ( pFrameSet )
+ pFrameSet->Store(rStream);
+
+ return TRUE;
+}
+
+BOOL SfxFrameDescriptor::Load( SvStream& rStream, USHORT nVersion )
+{
+ String aURLName;
+ USHORT nFlags1, nFlags2, nScroll, nSet, nSelector;
+
+ long lLength = 0L;
+ long lPos = rStream.Tell(); // aktuelle Position merken
+
+ if ( nVersion > 2 )
+ rStream >> lLength >> nVersion;
+
+ rStream.ReadByteString( aURLName, RTL_TEXTENCODING_UTF8 );
+ rStream.ReadByteString( aName, RTL_TEXTENCODING_UTF8 );
+ rStream >> aMargin
+ >> nWidth
+ >> nSelector
+ >> nScroll
+ >> nFlags1
+ >> nFlags2
+ >> nSet
+ >> nHasBorder;
+
+ if ( nVersion > 2 )
+ rStream.Seek( lPos + lLength );
+
+ bResizeHorizontal = ( nFlags1 & 0x01 ) != 0;
+ bResizeVertical = ( nFlags2 & 0x01 ) != 0;
+ bHasUI = ( nFlags1 & 0x02 ) == 0;
+ bReadOnly = ( nFlags1 & 0x04 ) != 0;
+ eSizeSelector = (SizeSelector) nSelector;
+ aURL = INetURLObject::RelToAbs( aURLName );
+ eScroll = (ScrollingMode) nScroll;
+ aActualURL = aURL;
+
+ if ( nSet )
+ {
+ pFrameSet = new SfxFrameSetDescriptor( this );
+ pFrameSet->Load( rStream, nVersion );
+ }
+
+ return TRUE;
+}
+
+SfxFrameDescriptor* SfxFrameDescriptor::Clone(
+ SfxFrameSetDescriptor *pSet, BOOL bWithIds ) const
+{
+ SfxFrameDescriptor *pFrame =
+ new SfxFrameDescriptor( pSet );
+
+ pFrame->aURL = aURL;
+ pFrame->aActualURL = aActualURL;
+ pFrame->aName = aName;
+ pFrame->aMargin = aMargin;
+ pFrame->nWidth = nWidth;
+ pFrame->eSizeSelector = eSizeSelector;
+ pFrame->eScroll = eScroll;
+ pFrame->bResizeHorizontal = bResizeHorizontal;
+ pFrame->bResizeVertical = bResizeVertical;
+ pFrame->nHasBorder = nHasBorder;
+ pFrame->bHasUI = bHasUI;
+ pFrame->SetReadOnly( IsReadOnly() );
+ pFrame->SetEditable( IsEditable() );
+ if ( pImp->pWallpaper )
+ pFrame->pImp->pWallpaper = new Wallpaper( *pImp->pWallpaper );
+ if( pImp->pArgs )
+ {
+ // Aktuell ist im Clone von SfxAllItemSets noch ein Bug...
+ pFrame->pImp->pArgs = new SfxAllItemSet( SFX_APP()->GetPool() );
+ pFrame->pImp->pArgs->Put(*pImp->pArgs);
+ }
+
+ if ( bWithIds )
+ pFrame->nItemId = nItemId;
+ else
+ pFrame->nItemId = 0;
+
+ if ( pFrameSet )
+ pFrame->pFrameSet = pFrameSet->Clone( pFrame, bWithIds );
+
+ return pFrame;
+}
+
+
+SfxFrameDescriptor* SfxFrameDescriptor::Split( BOOL bHorizontal, BOOL bParent )
+{
+ DBG_ASSERT( pParentFrameSet, "Frames ohne Set koennen nicht gesplittet werden!" );
+
+ // Die Root holen, um neue Ids erzeugen zu k"onnen
+ SfxFrameSetDescriptor *pRoot = pParentFrameSet;
+ while ( pRoot->pParentFrame && pRoot->pParentFrame->pParentFrameSet )
+ pRoot = pRoot->pParentFrame->pParentFrameSet;
+
+ // Der Frame, hinter dem ein neuer eingef"ugt werden soll
+ SfxFrameDescriptor *pPrev = this;
+
+ // Dieser Descriptor soll gesplittet werden ...
+ SfxFrameDescriptor *pSplit = this;
+ SfxFrameSetDescriptor *pSplitSet = pParentFrameSet;
+
+ if ( bParent )
+ {
+ // Ein FrameSet suchen, das die gleiche Orientierung hat wie
+ // die "ubergebene
+ pSplit = pSplitSet->bIsRoot ? NULL : pSplitSet->pParentFrame;
+ while ( pSplit && pSplit->pParentFrameSet )
+ {
+ pSplitSet = pSplit->pParentFrameSet;
+ if ( pSplitSet->bRowSet == bHorizontal )
+ break;
+ pSplit = pSplitSet->pParentFrame;
+ }
+
+ // pSplit ist NULL oder TopLevel, wenn das Set das RootSet ist
+ pPrev = pSplit;
+ }
+ else
+ {
+ // Wenn das aktuelle FrameSet eine andere Orientierung hat, der
+ // zu splittende Frame aber der einzige ist, wird einfach die
+ // Orientierung des Sets umgedreht( k"urzt den Baum)
+ if ( pSplitSet->GetFrameCount() == 1 )
+ pSplitSet->bRowSet = bHorizontal;
+ }
+
+ if ( pSplitSet->bRowSet != bHorizontal )
+ {
+ BOOL bCreated = FALSE;
+ if ( !pSplit || !pSplit->pParentFrameSet )
+ {
+ // RootSet splitten: das Alignment wechselt
+ pSplitSet->bRowSet = bHorizontal;
+ bHorizontal = !bHorizontal;
+ pSplit = new SfxFrameDescriptor( pSplitSet );
+ bCreated = TRUE;
+ }
+
+ if ( bParent )
+ {
+ // "Unter pSplit wird ein FrameSet eingef"ugt
+ SfxFrameSetDescriptor *pSet = new SfxFrameSetDescriptor( NULL );
+ pSet->bIsRoot = FALSE;
+ pSet->bRowSet = bHorizontal;
+
+ // Die Frames unterhalb des alten Sets umh"angen
+ USHORT nCount = pSplitSet->aFrames.Count();
+ USHORT nPos = 0;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ SfxFrameDescriptor *pCur = pSplitSet->aFrames[0];
+ if ( pCur != pSplit )
+ {
+ pSplitSet->aFrames.Remove(nPos);
+ pSet->InsertFrame( pCur );
+ pCur->pParentFrameSet = pSet;
+ }
+ else
+ nPos++;
+ }
+
+ pPrev = pSplit;
+
+ if ( bCreated )
+ {
+ USHORT nID = pRoot->MakeItemId();
+ pSplit->SetItemId( nID );
+
+ // Neuer Frame erh"alt ganzen Platz
+ pPrev->nWidth = 100;
+ pPrev->eSizeSelector = SIZE_PERCENT;
+
+ // Verkettung herstellen
+ pSplit->pFrameSet = pSet;
+ pSet->pParentFrame = pSplit;
+ }
+ }
+ else
+ {
+ // Den gesplitteten Frame kopieren und moven
+ USHORT nPos = pSplitSet->aFrames.GetPos( pPrev );
+ pSplit = pPrev->Clone( pSplitSet );
+ pSplitSet->RemoveFrame( pSplit );
+ pSplitSet->InsertFrame( pSplit, nPos );
+
+ // Unter dem neuen Frame wird ein FrameSet eingef"ugt, das den
+ // alten Frame enth"alt, der anschlie\send geteilt wird
+ SfxFrameSetDescriptor *pSet = new SfxFrameSetDescriptor( pSplit );
+ pSet->bIsRoot = FALSE;
+ pSet->bRowSet = bHorizontal;
+
+ // Attribute des neu eingef"ugten Frames zur"ucksetzen und eine
+ // Id erzeugen
+ pSplit->aName.Erase();
+ pSplit->aMargin = Size( -1, -1 );
+ pSplit->aURL.SetURL( "" );
+ pSplit->aActualURL.SetURL( "" );
+ pSplit->SetItemId( pRoot->MakeItemId() );
+ bCreated = TRUE;
+
+ // Alter Frame erh"alt ganzen Platz im neu eingef"ugten Frameset
+ pPrev->nWidth = 100;
+ pPrev->eSizeSelector = SIZE_PERCENT;
+
+ // Alten Frame umh"angen
+ pSplitSet->RemoveFrame( pPrev );
+ pSet->InsertFrame( pPrev );
+ }
+ }
+
+ if ( !pPrev || !pPrev->pParentFrameSet )
+ return NULL;
+
+ // Hinter pPrev einen neuen Frame einf"ugen
+ SfxFrameDescriptor *pFrame = new SfxFrameDescriptor( NULL );
+ pSplitSet = pPrev->pParentFrameSet;
+ pSplitSet->InsertFrame( pFrame, pSplitSet->aFrames.GetPos( pPrev ) + 1 );
+ pFrame->pParentFrameSet = pSplitSet;
+
+ // Size und ID setzen
+ USHORT n = pRoot->MakeItemId();
+ pFrame->SetItemId( n );
+
+ // Platz zwischen beiden Frames aufteilen
+ long nSize = pPrev->nWidth / 2L;
+ pPrev->nWidth = nSize ? nSize : 1L;
+ pFrame->nWidth = pPrev->nWidth;
+ pFrame->eSizeSelector = pPrev->eSizeSelector;
+
+ return pFrame;
+}
+
+BOOL SfxFrameDescriptor::CanSplit( BOOL bHorizontal, BOOL bParent ) const
+{
+ DBG_ASSERT( pParentFrameSet, "Frames ohne Set koennen nicht gesplittet werden!" );
+
+ // Die Root holen, um neue Ids erzeugen zu k"onnen
+ const SfxFrameSetDescriptor *pRoot = pParentFrameSet;
+ while ( pRoot->pParentFrame && pRoot->pParentFrame->pParentFrameSet )
+ pRoot = pRoot->pParentFrame->pParentFrameSet;
+
+ // Der Frame, hinter dem ein neuer eingef"ugt werden soll
+ const SfxFrameDescriptor *pPrev = this;
+
+ // Dieser Descriptor soll gesplittet werden ...
+ const SfxFrameDescriptor *pSplit = this;
+ const SfxFrameSetDescriptor *pSplitSet = pParentFrameSet;
+ BOOL bRowSet = pSplitSet->bRowSet;
+
+ if ( bParent )
+ {
+ // Ein FrameSet suchen, das die gleiche Orientierung hat wie
+ // die "ubergebene
+ pSplit = pSplitSet->bIsRoot ? NULL : pSplitSet->pParentFrame;
+ while ( pSplit && pSplit->pParentFrameSet )
+ {
+ pSplitSet = pSplit->pParentFrameSet;
+ if ( pSplitSet->bRowSet == bHorizontal )
+ break;
+ pSplit = pSplitSet->pParentFrame;
+ }
+
+ // pSplit ist jetzt NULL oder TopLevel, wenn das Set das RootSet ist
+ pPrev = pSplit;
+ bRowSet = pSplitSet->bRowSet;
+ }
+ else
+ {
+ // Wenn das aktuelle FrameSet eine andere Orientierung hat, der
+ // zu splittende Frame aber der einzige ist, wird einfach die
+ // Orientierung des Sets umgedreht( k"urzt den Baum)
+ if ( pSplitSet->GetFrameCount() == 1 )
+ bRowSet = bHorizontal;
+ }
+
+ if ( bRowSet == bHorizontal && ( !pPrev || !pPrev->pParentFrameSet ) )
+ return FALSE;
+ return TRUE;
+}
+
+SfxFrameDescriptor* SfxFrameDescriptor::Next() const
+{
+ if ( !pParentFrameSet )
+ return NULL;
+
+ USHORT nPos = pParentFrameSet->aFrames.GetPos( (SfxFrameDescriptor*) this );
+ if ( nPos < pParentFrameSet->aFrames.Count() - 1 )
+ return pParentFrameSet->aFrames[nPos+1];
+ else
+ return NULL;
+}
+
+SfxFrameDescriptor* SfxFrameDescriptor::Prev() const
+{
+ if ( !pParentFrameSet )
+ return NULL;
+
+ USHORT nPos = pParentFrameSet->aFrames.GetPos( (SfxFrameDescriptor*) this );
+ if ( nPos > 0 )
+ return pParentFrameSet->aFrames[nPos-1];
+ else
+ return NULL;
+}
+
+USHORT SfxFrameDescriptor::GetParentSetId() const
+{
+ if ( !pParentFrameSet )
+ return USHRT_MAX;
+
+ SfxFrameDescriptor *pFrame = pParentFrameSet->pParentFrame;
+ if ( pFrame )
+ return pFrame->nItemId;
+ else
+ return 0;
+}
+
+USHORT SfxFrameDescriptor::GetWinBits() const
+{
+ USHORT nBits = 0;
+ if ( eSizeSelector == SIZE_REL )
+ nBits |= SWIB_RELATIVESIZE;
+ if ( eSizeSelector == SIZE_PERCENT )
+ nBits |= SWIB_PERCENTSIZE;
+ if ( !IsResizable() )
+ nBits |= SWIB_FIXED;
+ if ( pFrameSet && pFrameSet->IsColSet() )
+ nBits |= SWIB_COLSET;
+ if ( !nWidth )
+ nBits |= SWIB_INVISIBLE;
+ return nBits;
+}
+
+BOOL SfxFrameDescriptor::HasFrameBorder() const
+{
+ if ( pParentFrameSet )
+ {
+ if ( pParentFrameSet->pImp->bNetscapeCompat && !pParentFrameSet->GetFrameSpacing() )
+ return FALSE;
+ else if ( ( nHasBorder & BORDER_SET ) )
+ return (nHasBorder & BORDER_YES) != 0;
+ else
+ return pParentFrameSet->HasFrameBorder();
+ }
+ else
+ return (nHasBorder & BORDER_YES) != 0;
+}
+
+long SfxFrameDescriptor::GetSize() const
+{
+#if !defined ( VCL ) && ( defined (WIN) || defined (WNT) )
+ long nSize = nWidth;
+ if ( nSize && eSizeSelector == SIZE_ABS && System::GetGUIVersion() < 400 && HasFrameBorder() )
+ // SV zeichnet dann den Border um das Fenster herum
+ nSize += 1L;
+ return nSize;
+#endif
+
+ return nWidth;
+}
+
+void SfxFrameDescriptor::TakeProperties( const SfxFrameProperties& rProp )
+{
+ aURL = aActualURL = rProp.aURL;
+ aName = rProp.aName;
+ aMargin.Width() = rProp.lMarginWidth;
+ aMargin.Height() = rProp.lMarginHeight;
+ nWidth = rProp.lSize;
+ eScroll = rProp.eScroll;
+ eSizeSelector = rProp.eSizeSelector;
+ nHasBorder = rProp.bHasBorder ? BORDER_YES : BORDER_NO;
+ if ( rProp.bBorderSet )
+ nHasBorder |= BORDER_SET;
+ bResizeHorizontal = bResizeVertical = rProp.bResizable;
+ if ( pParentFrameSet )
+ {
+ SfxFrameDescriptor *pParent = pParentFrameSet->pParentFrame;
+ if ( pParent )
+ {
+ pParent->nWidth = rProp.lSetSize;
+ pParent->eSizeSelector = rProp.eSetSizeSelector;
+ pParent->bResizeHorizontal = pParent->bResizeVertical = rProp.bSetResizable;
+ }
+
+ pParentFrameSet->nFrameSpacing = rProp.lFrameSpacing;
+ }
+}
+
+void SfxFrameDescriptor::SetWallpaper( const Wallpaper& rWallpaper )
+{
+ DELETEZ( pImp->pWallpaper );
+
+ if ( rWallpaper.GetStyle() != WALLPAPER_NULL )
+ pImp->pWallpaper = new Wallpaper( rWallpaper );
+}
+
+const Wallpaper* SfxFrameDescriptor::GetWallpaper() const
+{
+ return pImp->pWallpaper;
+}
+
+USHORT SfxFrameDescriptor::GetItemPos() const
+{
+ if ( pParentFrameSet )
+ {
+ USHORT nRet = pParentFrameSet->aFrames.GetPos((SfxFrameDescriptor*)this);
+ for ( USHORT n=0; n<nRet; n++ )
+ if ( !pParentFrameSet->GetFrame(n)->nWidth )
+ nRet--;
+ return nRet;
+ }
+
+ return USHRT_MAX;
+}
+
+
+SfxFrameProperties::SfxFrameProperties( const SfxFrameDescriptor *pD )
+ : aURL( pD->GetURL().GetMainURL() )
+ , aName( pD->GetName() )
+ , lMarginWidth( pD->GetMargin().Width() )
+ , lMarginHeight( pD->GetMargin().Height() )
+ , lSize( pD->GetWidth() )
+ , lSetSize( SIZE_NOT_SET )
+ , lFrameSpacing( SPACING_NOT_SET )
+ , lInheritedFrameSpacing( SPACING_NOT_SET )
+ , eScroll( pD->GetScrollingMode() )
+ , eSizeSelector( pD->GetSizeSelector() )
+ , eSetSizeSelector( SIZE_REL )
+ , bHasBorder( pD->HasFrameBorder() )
+ , bHasBorderInherited( FALSE )
+ , bBorderSet( pD->IsFrameBorderSet() )
+ , bResizable( pD->IsResizable() )
+ , bIsInColSet( FALSE )
+ , bSetResizable( FALSE )
+ , bIsRootSet( FALSE )
+ , pFrame( pD->Clone() )
+{
+ SfxFrameSetDescriptor *pSet = pD->GetParent();
+ if ( pSet )
+ {
+ bIsRootSet = ( pSet->IsRootFrameSet() );
+ lFrameSpacing = pSet->GetFrameSpacing();
+ lSetSize = bIsRootSet ? SIZE_NOT_SET : pSet->GetParentFrame()->GetWidth();
+ eSetSizeSelector = bIsRootSet ? SIZE_ABS : pSet->GetParentFrame()->GetSizeSelector();
+ bSetResizable = bIsRootSet ? FALSE : pSet->GetParentFrame()->IsResizable();
+ bIsInColSet = pSet->IsColSet();
+ bHasBorderInherited = pSet->HasFrameBorder();
+ lInheritedFrameSpacing = bIsRootSet ? SPACING_NOT_SET : pSet->GetParentFrame()->GetParent()->GetFrameSpacing();
+ }
+ else
+ bBorderSet = TRUE;
+}
+
+SfxFrameProperties& SfxFrameProperties::operator =(
+ const SfxFrameProperties &rProp )
+{
+ aURL = rProp.aURL;
+ aName = rProp.aName;
+ lMarginWidth = rProp.lMarginWidth;
+ lMarginHeight = rProp.lMarginHeight;
+ lSize = rProp.lSize;
+ lSetSize = rProp.lSetSize;
+ lFrameSpacing = rProp.lFrameSpacing;
+ lInheritedFrameSpacing = rProp.lInheritedFrameSpacing;
+ eScroll = rProp.eScroll;
+ eSizeSelector = rProp.eSizeSelector;
+ eSetSizeSelector = rProp.eSetSizeSelector;
+ bHasBorder = rProp.bHasBorder;
+ bBorderSet = rProp.bBorderSet;
+ bResizable = rProp.bResizable;
+ bSetResizable = rProp.bSetResizable;
+ bIsRootSet = rProp.bIsRootSet;
+ bIsInColSet = rProp.bIsInColSet;
+ bHasBorderInherited = rProp.bHasBorderInherited;
+ pFrame = rProp.pFrame->Clone();
+ return *this;
+}
+
+int SfxFrameProperties::operator ==( const SfxFrameProperties& rProp ) const
+{
+ return aURL == rProp.aURL && aName == rProp.aName && lMarginWidth == rProp.lMarginWidth && lMarginHeight == rProp.lMarginHeight &&
+ lSize == rProp.lSize && eScroll == rProp.eScroll && eSizeSelector == rProp.eSizeSelector &&
+ lSetSize == rProp.lSetSize && lFrameSpacing == rProp.lFrameSpacing && eSetSizeSelector == rProp.eSetSizeSelector &&
+ bHasBorder == rProp.bHasBorder && bBorderSet == rProp.bBorderSet &&
+ bResizable == rProp.bResizable && bSetResizable == rProp.bSetResizable;
+}
+
+TYPEINIT1(SfxFrameDescriptorItem, SfxPoolItem);
+
+SfxFrameDescriptorItem::~SfxFrameDescriptorItem()
+{}
+
+int SfxFrameDescriptorItem::operator==( const SfxPoolItem& rAttr ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+
+ return aProperties == ((SfxFrameDescriptorItem&)rAttr).aProperties;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxFrameDescriptorItem::Clone( SfxItemPool* ) const
+{
+ return new SfxFrameDescriptorItem( *this );
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPresentation SfxFrameDescriptorItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit eCoreUnit,
+ SfxMapUnit ePresUnit,
+ XubString& rText,
+ const International *
+) const
+{
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+
diff --git a/sfx2/source/doc/makefile.mk b/sfx2/source/doc/makefile.mk
new file mode 100644
index 000000000000..be9da34394b0
--- /dev/null
+++ b/sfx2/source/doc/makefile.mk
@@ -0,0 +1,120 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=doc
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+SRCFILES = \
+ doc.src new.src doctdlg.src docvor.src
+
+SLOFILES = \
+ $(SLO)$/docfile.obj \
+ $(SLO)$/objuno.obj \
+ $(SLO)$/frmdescr.obj \
+ $(SLO)$/fsetobsh.obj \
+ $(SLO)$/docinf.obj \
+ $(SLO)$/interno.obj \
+ $(SLO)$/objxtor.obj \
+ $(SLO)$/objmisc.obj \
+ $(SLO)$/objstor.obj \
+ $(SLO)$/objcont.obj \
+ $(SLO)$/objserv.obj \
+ $(SLO)$/objitem.obj \
+ $(SLO)$/clientsh.obj \
+ $(SLO)$/docfac.obj \
+ $(SLO)$/docfilt.obj \
+ $(SLO)$/doctempl.obj \
+ $(SLO)$/docvor.obj \
+ $(SLO)$/new.obj \
+ $(SLO)$/doctdlg.obj \
+ $(SLO)$/frameobj.obj \
+ $(SLO)$/sfxbasemodel.obj
+
+EXCEPTIONSFILES=$(SLO)$/objuno.obj \
+ $(SLO)$/docfile.obj \
+# $(SLO)$/msgmodel.obj \
+ $(SLO)$/sfxbasemodel.obj \
+ $(SLO)$/objxtor.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+
+
+
+
+
+
diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
new file mode 100644
index 000000000000..8fbf975b4fd4
--- /dev/null
+++ b/sfx2/source/doc/new.cxx
@@ -0,0 +1,695 @@
+/*************************************************************************
+ *
+ * $RCSfile: new.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "new.hxx"
+
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _GDIMTF_HXX //autogen
+#include <vcl/gdimtf.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _MOREBTN_HXX //autogen
+#include <vcl/morebtn.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SVMEDIT_HXX
+#include <svtools/svmedit.hxx>
+#endif
+#include <svtools/itemset.hxx>
+#include <svtools/eitem.hxx>
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#include "new.hrc"
+#include "doc.hrc"
+#include "sfx.hrc"
+#include "helpid.hrc"
+#include "sfxtypes.hxx"
+#include "app.hxx"
+#include "docinf.hxx"
+#include "viewfrm.hxx"
+#include "docfac.hxx"
+#include "objsh.hxx"
+#include "fltfnc.hxx"
+#include "viewsh.hxx"
+#include "viewfac.hxx"
+#include "interno.hxx"
+#include "sfxresid.hxx"
+#include "docfile.hxx"
+#include "preview.hxx"
+
+//========================================================================
+
+#define MORE_BTN(x) pMoreBt->x
+
+//========================================================================
+
+void SfxPreviewBase_Impl::SetObjectShell( SfxObjectShell* pObj )
+{
+ GDIMetaFile* pFile = pObj ? pObj->GetPreviewMetaFile( ) : 0;
+ delete pMetaFile;
+ pMetaFile = pFile;
+ Invalidate();
+}
+
+SfxPreviewBase_Impl::SfxPreviewBase_Impl(
+ Window* pParent, const ResId& rResId )
+ : Window(pParent, rResId), pMetaFile( 0 )
+{
+}
+
+SfxPreviewBase_Impl::SfxPreviewBase_Impl( Window* pParent )
+ : Window(pParent, 0 ), pMetaFile( 0 )
+{
+ Resize();
+ Show();
+}
+
+SfxPreviewBase_Impl::~SfxPreviewBase_Impl()
+{
+ delete pMetaFile;
+}
+
+void SfxPreviewBase_Impl::Resize()
+{
+ Invalidate();
+}
+
+void SfxPreviewBase_Impl::SetGDIFile( GDIMetaFile* pFile )
+{
+ delete pMetaFile;
+ pMetaFile = pFile;
+ Invalidate();
+}
+
+SfxFrameWindow* SfxPreviewWin_Impl::PreviewFactory(
+ SfxFrame* pFrame, const String& rName )
+{
+ return new SfxFrameWindow( new SfxPreviewWin_Impl(
+ &pFrame->GetCurrentViewFrame()->GetWindow() ) );
+}
+
+void SfxPreviewWin_Impl::ImpPaint(
+ const Rectangle&, GDIMetaFile* pFile, Window* pWindow )
+{
+ Size aTmpSize = pFile ? pFile->GetPrefSize() : Size(1,1 );
+ DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(),
+ "size of first page is 0, overload GetFirstPageSize or set vis-area!" );
+#define FRAME 4
+ long nWidth = pWindow->GetOutputSize().Width() - 2*FRAME;
+ long nHeight = pWindow->GetOutputSize().Height() - 2*FRAME;
+ if( nWidth < 0 ) nWidth = 0;
+ if( nHeight < 0 ) nHeight = 0;
+
+ double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
+ double dRatioPreV=((double) nWidth ) / nHeight;
+ Size aSize;
+ Point aPoint;
+ if (dRatio>dRatioPreV)
+ {
+ aSize=Size(nWidth, (USHORT)(nWidth/dRatio));
+ aPoint=Point( 0, (USHORT)((nHeight-aSize.Height())/2));
+ }
+ else
+ {
+ aSize=Size((USHORT)(nHeight*dRatio), nHeight);
+ aPoint=Point((USHORT)((nWidth-aSize.Width())/2),0);
+ }
+ Point bPoint=Point(nWidth,nHeight)-aPoint;
+
+ pWindow->SetLineColor();
+ Color aLightGrayCol( COL_LIGHTGRAY );
+ pWindow->SetFillColor( aLightGrayCol );
+ pWindow->DrawRect( Rectangle( Point( 0,0 ), pWindow->GetOutputSize() ) );
+ if ( pFile )
+ {
+ Color aBlackCol( COL_BLACK );
+ Color aWhiteCol( COL_WHITE );
+ pWindow->SetLineColor( aBlackCol );
+ pWindow->SetFillColor( aWhiteCol );
+ pWindow->DrawRect( Rectangle( aPoint + Point( FRAME, FRAME ), bPoint + Point( FRAME, FRAME ) ) );
+//! pFile->Move( Point( FRAME, FRAME ) );
+//! pFile->Scale( Fraction( aTmpSize.Width(), aSize.Width() ),
+//! Fraction( aTmpSize.Height(), aSize.Height() ) );
+ pFile->WindStart();
+ pFile->Play( pWindow, aPoint + Point( FRAME, FRAME ), aSize );
+ }
+}
+
+void SfxPreviewWin_Impl::Paint( const Rectangle& rRect )
+{
+ ImpPaint( rRect, pMetaFile, this );
+}
+
+SfxPreviewWin::SfxPreviewWin(
+ Window* pParent, const ResId& rResId, SfxObjectShellLock &rDocSh )
+ : Window(pParent, rResId), rDocShell( rDocSh )
+{
+ SetHelpId( HID_PREVIEW_FRAME );
+}
+
+void SfxPreviewWin::Paint( const Rectangle& rRect )
+{
+ GDIMetaFile* pFile = rDocShell->GetPreviewMetaFile();
+ SfxPreviewWin_Impl::ImpPaint( rRect, pFile, this );
+ delete pFile;
+}
+
+
+class SfxNewFileDialog_Impl
+{
+ FixedText aRegionFt;
+ ListBox aRegionLb;
+ FixedText aTemplateFt;
+ ListBox aTemplateLb;
+
+ CheckBox aPreviewBtn;
+ SfxPreviewWin_Impl aPreviewWin;
+
+ FixedText aTitleFt;
+ Edit aTitleEd;
+ FixedText aThemaFt;
+ Edit aThemaEd;
+ FixedText aKeywordsFt;
+ Edit aKeywordsEd;
+ FixedText aDescFt;
+ MultiLineEdit aDescEd;
+ GroupBox aDocinfoGb;
+
+ OKButton aOkBt;
+ CancelButton aCancelBt;
+ HelpButton aHelpBt;
+ MoreButton* pMoreBt;
+ Timer aPrevTimer;
+ String aNone;
+
+ USHORT nFlags;
+ SfxDocumentTemplates aTemplates;
+ SfxObjectShellLock xDocShell;
+ SfxDocumentInfo *pDocInfo;
+ SfxNewFileDialog* pAntiImpl;
+
+ void ClearInfo();
+ DECL_LINK( Update, void * );
+
+ DECL_LINK( RegionSelect, ListBox * );
+ DECL_LINK( TemplateSelect, ListBox * );
+ DECL_LINK( DoubleClick, ListBox * );
+ void TogglePreview(CheckBox *);
+ DECL_LINK( Expand, MoreButton * );
+ DECL_LINK( PreviewClick, CheckBox * );
+ USHORT GetSelectedTemplatePos() const;
+
+public:
+
+ SfxNewFileDialog_Impl( SfxNewFileDialog* pAntiImplP, USHORT nFlags );
+ ~SfxNewFileDialog_Impl();
+
+ // Liefert FALSE, wenn '- Keine -' als Vorlage eingestellt ist
+ // Nur wenn IsTemplate() TRUE liefert, koennen Vorlagennamen
+ // erfragt werden
+ BOOL IsTemplate() const;
+ String GetTemplateRegion() const;
+ String GetTemplateName() const;
+ String GetTemplateFileName() const;
+};
+
+
+//-------------------------------------------------------------------------
+
+void SfxNewFileDialog_Impl::ClearInfo()
+{
+ const String aNo;
+ aTitleEd.SetText(aNo);
+ aThemaEd.SetText(aNo);
+ aKeywordsEd.SetText(aNo);
+ aDescEd.SetText(aNo);
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxNewFileDialog_Impl, Update, void *, EMPTYARG )
+{
+ if ( xDocShell.Is() )
+ {
+ if ( xDocShell->GetProgress() )
+ return FALSE;
+ xDocShell.Clear();
+ }
+
+ const USHORT nEntry = GetSelectedTemplatePos();
+ if(!nEntry)
+ {
+ ClearInfo();
+ aPreviewWin.Invalidate();
+ aPreviewWin.SetObjectShell( 0);
+ return 0;
+ }
+
+ if (nFlags & SFXWB_DOCINFO)
+ {
+ // DocInfo anzeigen
+ const String aFile(
+ aTemplates.GetPath(aRegionLb.GetSelectEntryPos(), nEntry-1) );
+
+ // Dokumentinfo lesen und anzeigen
+ if (pAntiImpl->FillDocumentInfo(aFile, *pDocInfo))
+ {
+ aTitleEd.SetText(pDocInfo->GetTitle());
+ aThemaEd.SetText(pDocInfo->GetTheme());
+ aKeywordsEd.SetText(pDocInfo->GetKeywords());
+ aDescEd.SetText(pDocInfo->GetComment());
+ }
+ else
+ ClearInfo();
+ }
+
+ if ( aPreviewBtn.IsChecked() && (nFlags & SFXWB_PREVIEW) == SFXWB_PREVIEW)
+ {
+
+ String aFileName = aTemplates.GetPath( aRegionLb.GetSelectEntryPos(), nEntry-1);
+ INetURLObject aObj( aFileName, INET_PROT_FILE );
+
+ for ( SfxObjectShell* pTmp = SfxObjectShell::GetFirst();
+ pTmp;
+ pTmp = SfxObjectShell::GetNext(*pTmp) )
+ {
+ //! fsys bug op==
+ if ( pTmp->GetMedium())
+ // ??? HasName() MM
+ if( INetURLObject( pTmp->GetMedium()->GetName(), INET_PROT_FILE ) == aObj )
+ {
+ xDocShell = pTmp;
+ break;
+ }
+ }
+
+ if ( !xDocShell.Is() )
+ {
+ Window *pParent = Application::GetDefDialogParent();
+ Application::SetDefDialogParent( pAntiImpl );
+ SfxErrorContext eEC(ERRCTX_SFX_LOADTEMPLATE,pAntiImpl);
+ SfxApplication *pSfxApp = SFX_APP();
+ ULONG lErr;
+ SfxItemSet* pSet = new SfxAllItemSet( pSfxApp->GetPool() );
+ pSet->Put( SfxBoolItem( SID_TEMPLATE, TRUE ) );
+ pSet->Put( SfxBoolItem( SID_PREVIEW, TRUE ) );
+ if( lErr = pSfxApp->LoadTemplate( xDocShell, aFileName, String(), TRUE, pSet ) )
+ ErrorHandler::HandleError(lErr);
+ Application::SetDefDialogParent( pParent );
+ if ( !xDocShell.Is() )
+ {
+ aPreviewWin.SetObjectShell( 0 );
+ return FALSE;
+ }
+ }
+
+ aPreviewWin.SetObjectShell( xDocShell );
+ }
+ return TRUE;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxNewFileDialog_Impl, RegionSelect, ListBox *, pBox )
+{
+ if ( xDocShell.Is() && xDocShell->GetProgress() )
+ return 0;
+
+ const USHORT nRegion = pBox->GetSelectEntryPos();
+ const USHORT nCount = aTemplates.GetRegionCount()? aTemplates.GetCount(nRegion): 0;
+ aTemplateLb.SetUpdateMode(FALSE);
+ aTemplateLb.Clear();
+ String aSel=aRegionLb.GetSelectEntry();
+ USHORT nc=aSel.Search('(');
+ if (nc-1&&nc!=STRING_NOTFOUND)
+ aSel.Erase(nc-1);
+ if (aSel.CompareIgnoreCaseToAscii( String(SfxResId(STR_STANDARD)) )==COMPARE_EQUAL)
+ aTemplateLb.InsertEntry(aNone);
+ for (USHORT i = 0; i < nCount; ++i)
+ aTemplateLb.InsertEntry(aTemplates.GetName(nRegion, i));
+ aTemplateLb.SelectEntryPos(0);
+ aTemplateLb.SetUpdateMode(TRUE);
+ aTemplateLb.Invalidate();
+ aTemplateLb.Update();
+ if (nFlags & SFXWB_DOCINFO && aTemplateLb.GetEntryCount() >= 1)
+ TemplateSelect(&aTemplateLb);
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxNewFileDialog_Impl, Expand, MoreButton *, pMoreButton )
+{
+ TemplateSelect(&aTemplateLb);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxNewFileDialog_Impl, Expand, MoreButton *, pMoreButton )
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxNewFileDialog_Impl, PreviewClick, CheckBox *, pBox )
+{
+ if ( xDocShell.Is() && xDocShell->GetProgress() )
+ return 0;
+
+ USHORT nEntry = GetSelectedTemplatePos();
+ if ( nEntry && pBox->IsChecked() )
+ {
+ if(!Update(0))
+ aPreviewWin.Invalidate();
+ }
+ else
+ {
+ if (xDocShell.Is())
+ xDocShell.Clear();
+ aPreviewWin.SetObjectShell( 0 );
+ }
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK( SfxNewFileDialog_Impl, TemplateSelect, ListBox *, pListBox )
+{
+
+ // noch am Laden
+ if ( xDocShell && xDocShell->GetProgress() )
+ return 0;
+
+ if ( !MORE_BTN(GetState()) )
+ // Dialog nicht aufgeklappt
+ return 0;
+
+ aPrevTimer.Start();
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxNewFileDialog_Impl, DoubleClick, ListBox *, pListBox )
+{
+ // noch am Laden
+ if ( !xDocShell.Is() || !xDocShell->GetProgress() )
+ pAntiImpl->EndDialog(RET_OK);
+ return 0;
+}
+IMPL_LINK_INLINE_END( SfxNewFileDialog_Impl, DoubleClick, ListBox *, pListBox )
+
+//-------------------------------------------------------------------------
+
+USHORT SfxNewFileDialog_Impl::GetSelectedTemplatePos() const
+{
+ USHORT nEntry=aTemplateLb.GetSelectEntryPos();
+ String aSel=aRegionLb.GetSelectEntry().Copy();
+ USHORT nc=aSel.Search('(');
+ if (nc-1&&nc!=STRING_NOTFOUND)
+ aSel.Erase(nc-1);
+ if (aSel.CompareIgnoreCaseToAscii(String(SfxResId(STR_STANDARD)))!=COMPARE_EQUAL)
+ nEntry++;
+ if (!aTemplateLb.GetSelectEntryCount())
+ nEntry=0;
+ return nEntry;
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxNewFileDialog_Impl::IsTemplate() const
+{
+ return GetSelectedTemplatePos()!=0;
+
+}
+
+//-------------------------------------------------------------------------
+
+String SfxNewFileDialog_Impl::GetTemplateFileName() const
+{
+ if(!IsTemplate() || !aTemplates.GetRegionCount())
+ return String();
+ return aTemplates.GetPath(aRegionLb.GetSelectEntryPos(),
+ GetSelectedTemplatePos()-1);
+}
+
+//-------------------------------------------------------------------------
+
+String SfxNewFileDialog_Impl::GetTemplateRegion() const
+{
+ if(!IsTemplate() || !aTemplates.GetRegionCount())
+ return String();
+ return aRegionLb.GetSelectEntry();
+}
+
+//-------------------------------------------------------------------------
+
+String SfxNewFileDialog_Impl::GetTemplateName() const
+{
+ if(!IsTemplate() || !aTemplates.GetRegionCount())
+ return String();
+ return aTemplateLb.GetSelectEntry();
+}
+
+//-------------------------------------------------------------------------
+
+void AdjustPosSize_Impl(Window *pWin, short nMoveOffset, short nSizeOffset)
+{
+ Point aPos(pWin->GetPosPixel());
+ Size aSize(pWin->GetSizePixel());
+ aPos.X() -= nMoveOffset;
+ aSize.Width() += nSizeOffset;
+ pWin->SetPosSizePixel(aPos, aSize);
+}
+
+//-------------------------------------------------------------------------
+
+SfxNewFileDialog_Impl::SfxNewFileDialog_Impl(
+ SfxNewFileDialog* pAntiImplP, USHORT nFl)
+ : aOkBt( pAntiImplP, ResId( BT_OK ) ),
+ aCancelBt( pAntiImplP, ResId( BT_CANCEL ) ),
+ aTemplateLb( pAntiImplP, ResId( LB_TEMPLATE ) ),
+ aRegionFt( pAntiImplP, ResId( FT_REGION ) ),
+ aThemaFt( pAntiImplP, ResId( FT_THEMA ) ),
+ aPreviewWin( pAntiImplP, ResId( WIN_PREVIEW ) ),
+ aTemplateFt( pAntiImplP, ResId( FT_TEMPLATE ) ),
+ aRegionLb( pAntiImplP, ResId( LB_REGION ) ),
+ aHelpBt( pAntiImplP, ResId( BT_HELP ) ),
+ aKeywordsEd( pAntiImplP, ResId( ED_KEYWORDS ) ),
+ aTitleEd( pAntiImplP, ResId( ED_TITLE ) ),
+ aThemaEd( pAntiImplP, ResId( ED_THEMA ) ),
+ pMoreBt( new MoreButton( pAntiImplP, ResId( BT_MORE ) ) ),
+ aPreviewBtn( pAntiImplP, ResId( BTN_PREVIEW ) ),
+ aDocinfoGb( pAntiImplP, ResId( GB_DOCINFO ) ),
+ aTitleFt( pAntiImplP, ResId( FT_TITLE ) ),
+ aKeywordsFt( pAntiImplP, ResId( FT_KEYWORDS ) ),
+ aDescFt( pAntiImplP, ResId( FT_DESC ) ),
+ aDescEd( pAntiImplP, ResId( ED_DESC ) ),
+ aNone( ResId(STR_NONE) ),
+ nFlags(nFl),
+ pDocInfo(0),
+ pAntiImpl( pAntiImplP )
+{
+ short nMoveOffset = *(short *)pAntiImplP->GetClassRes();
+ pAntiImplP->IncrementRes(sizeof(short));
+ short nExpandSize= *(short *)pAntiImplP->GetClassRes();
+ pAntiImplP->IncrementRes(sizeof(short));
+ pAntiImplP->FreeResource();
+ aTemplates.Construct();
+
+ if (!nFlags)
+ MORE_BTN(Hide());
+ else
+ {
+ MORE_BTN(SetClickHdl(LINK(this, SfxNewFileDialog_Impl, Expand)));
+ if(nFlags & SFXWB_DOCINFO)
+ {
+ MORE_BTN(AddWindow(&aTitleFt));
+ MORE_BTN(AddWindow(&aTitleEd));
+ MORE_BTN(AddWindow(&aThemaFt));
+ MORE_BTN(AddWindow(&aThemaEd));
+ MORE_BTN(AddWindow(&aKeywordsFt));
+ MORE_BTN(AddWindow(&aKeywordsEd));
+ MORE_BTN(AddWindow(&aDescFt));
+ MORE_BTN(AddWindow(&aDescEd));
+ MORE_BTN(AddWindow(&aDocinfoGb));
+ aTemplateLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, TemplateSelect));
+ pDocInfo = new SfxDocumentInfo;
+ }
+ if((nFlags & SFXWB_PREVIEW) == SFXWB_PREVIEW)
+ {
+ MORE_BTN(AddWindow(&aPreviewBtn));
+ MORE_BTN(AddWindow(&aPreviewWin));
+ aPreviewBtn.SetClickHdl(LINK(this, SfxNewFileDialog_Impl, PreviewClick));
+ }
+ else
+ {
+ aPreviewBtn.Hide();
+ aPreviewWin.Hide();
+ nMoveOffset = (short)pAntiImplP->LogicToPixel(
+ Size(nMoveOffset, nMoveOffset), MAP_APPFONT).Width();
+ nExpandSize = (short)pAntiImplP->LogicToPixel(
+ Size(nExpandSize, nExpandSize), MAP_APPFONT).Width();
+ AdjustPosSize_Impl(&aTitleFt, nMoveOffset, 0);
+ AdjustPosSize_Impl(&aTitleEd, nMoveOffset, nExpandSize);
+ AdjustPosSize_Impl(&aThemaFt, nMoveOffset, 0);
+ AdjustPosSize_Impl(&aThemaEd, nMoveOffset, nExpandSize);
+ AdjustPosSize_Impl(&aKeywordsFt, nMoveOffset, 0);
+ AdjustPosSize_Impl(&aKeywordsEd, nMoveOffset, nExpandSize);
+ AdjustPosSize_Impl(&aDescFt , nMoveOffset, 0);
+ AdjustPosSize_Impl(&aDescEd , nMoveOffset, nExpandSize);
+ AdjustPosSize_Impl(&aDocinfoGb, nMoveOffset, nExpandSize);
+ }
+ }
+
+ String &rExtra = pAntiImplP->GetExtraData();
+ USHORT nTokCount = rExtra.GetTokenCount( '|' );
+ if( nTokCount > 0 && nFlags )
+ MORE_BTN(SetState( rExtra.GetToken( 0, '|' ) == 'Y' ));
+ if( nTokCount > 1 && nFlags )
+ aPreviewBtn.Check( rExtra.GetToken( 1 ,'|' ) == 'Y' );
+
+ aTemplateLb.SetDoubleClickHdl(LINK(this, SfxNewFileDialog_Impl, DoubleClick));
+ const USHORT nCount = aTemplates.GetRegionCount();
+ if (nCount)
+ {
+ for(USHORT i = 0; i < nCount; ++i)
+ aRegionLb.InsertEntry(aTemplates.GetFullRegionName(i));
+ aRegionLb.SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, RegionSelect));
+ }
+
+ aPrevTimer.SetTimeout( 500 );
+ aPrevTimer.SetTimeoutHdl( LINK( this, SfxNewFileDialog_Impl, Update));
+
+// else
+// aRegionLb.InsertEntry(String(SfxResId(STR_STANDARD)));
+ aRegionLb.SelectEntryPos(0);
+ RegionSelect(&aRegionLb);
+}
+
+//-------------------------------------------------------------------------
+
+SfxNewFileDialog_Impl::~SfxNewFileDialog_Impl()
+{
+ String &rExtra = pAntiImpl->GetExtraData();
+ rExtra = MORE_BTN(GetState()) ? 'Y' : 'N';
+ rExtra += '|';
+ rExtra += aPreviewBtn.IsChecked() ? 'Y' : 'N';
+
+ delete pDocInfo;
+ delete pMoreBt;
+}
+
+
+SfxNewFileDialog::SfxNewFileDialog(Window *pParent, USHORT nFlags)
+ : SfxModalDialog( pParent, SfxResId( DLG_NEW_FILE ) )
+{
+ pImpl = new SfxNewFileDialog_Impl( this, nFlags );
+}
+
+SfxNewFileDialog::~SfxNewFileDialog()
+{
+ delete pImpl;
+}
+
+BOOL SfxNewFileDialog::IsTemplate() const
+{
+ return pImpl->IsTemplate();
+}
+
+String SfxNewFileDialog::GetTemplateRegion() const
+{
+ return pImpl->GetTemplateRegion();
+}
+
+String SfxNewFileDialog::GetTemplateName() const
+{
+ return pImpl->GetTemplateName();
+}
+
+String SfxNewFileDialog::GetTemplateFileName() const
+{
+ return pImpl->GetTemplateFileName();
+}
+
+BOOL SfxNewFileDialog::FillDocumentInfo
+(
+ const String &rFile, // Datei incl. Pfad, deren DocInfo gelesen werden soll
+ SfxDocumentInfo &rInfo // DocInfo, die gefuellt werden soll
+)
+{
+ SvStorageRef aStor = new SvStorage(
+ rFile, STREAM_READ |STREAM_NOCREATE | STREAM_SHARE_DENYWRITE, STORAGE_TRANSACTED );
+ if ( SVSTREAM_OK != aStor->GetError() )
+ return FALSE;
+ BOOL bLoadOk;
+ bLoadOk=rInfo.Load(aStor);
+ return bLoadOk;
+}
+
+
diff --git a/sfx2/source/doc/new.hrc b/sfx2/source/doc/new.hrc
new file mode 100644
index 000000000000..3294b4f6325a
--- /dev/null
+++ b/sfx2/source/doc/new.hrc
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * $RCSfile: new.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define BTN_PREVIEW 51
+#define WIN_PREVIEW 50
+#define GB_DOCCLASS 1
+#define LB_DOCCLASS 2
+#define GB_DESC 10
+#define FT_DESC 11
+#define FT_STYLESHEETS 19
+#define FT_REGION 20
+#define ED_TITLE 56
+#define ED_KEYWORDS 61
+#define FT_KEYWORDS 60
+#define FT_TITLE 55
+#define ED_DESC 71
+#define FT_DOCINFO 70
+#define LB_REGION 21
+#define BT_OK 30
+#define BT_CANCEL 31
+#define BT_HELP 32
+#define GB_DOCINFO 70
+#define ED_THEMA 55
+#define FT_THEMA 54
+#define FT_TEMPLATE 53
+#define LB_TEMPLATE 52
+#define BT_MORE 32
diff --git a/sfx2/source/doc/new.src b/sfx2/source/doc/new.src
new file mode 100644
index 000000000000..87686b977922
--- /dev/null
+++ b/sfx2/source/doc/new.src
@@ -0,0 +1,439 @@
+/*************************************************************************
+ *
+ * $RCSfile: new.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ // include ---------------------------------------------------------------
+#include "sfx.hrc"
+#include "doc.hrc"
+#include "new.hrc"
+ // pragma ----------------------------------------------------------------
+
+ // DLG_NEW_FILE ----------------------------------------------------------
+ModalDialog DLG_NEW_FILE
+{
+ HelpId = SID_NEWDOC ;
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 330 , 96 ) ;
+ Text = "Neu" ;
+ Text [ ENGLISH ] = "New" ;
+ Text [ norwegian ] = "Ny" ;
+ Text [ italian ] = "Nuovo" ;
+ Text [ portuguese_brazilian ] = "Novo" ;
+ Text [ portuguese ] = "Novo" ;
+ Text [ finnish ] = "Uusi" ;
+ Text [ danish ] = "Ny" ;
+ Text [ french ] = "Nouveau" ;
+ Text [ swedish ] = "Nytt" ;
+ Text [ dutch ] = "Nieuw" ;
+ Text [ spanish ] = "Nuevo" ;
+ Text [ english_us ] = "New" ;
+ Moveable = TRUE ;
+ OKButton BT_OK
+ {
+ Pos = MAP_APPFONT ( 274 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE ;
+ };
+ CancelButton BT_CANCEL
+ {
+ Pos = MAP_APPFONT ( 274 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ HelpButton BT_HELP
+ {
+ Pos = MAP_APPFONT ( 274 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ ListBox LB_REGION
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 18 ) ;
+ Size = MAP_APPFONT ( 127 , 72 ) ;
+ CurPos = 0 ;
+ };
+ FixedText FT_REGION
+ {
+ Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 97 , 10 ) ;
+ Text = "~Bereiche" ;
+ Text [ ENGLISH ] = "~Regions" ;
+ Text [ norwegian ] = "~Omrder" ;
+ Text [ italian ] = "~Categorie" ;
+ Text [ portuguese_brazilian ] = "~Regies" ;
+ Text [ portuguese ] = "~Categorias" ;
+ Text [ finnish ] = "~Alueet" ;
+ Text [ danish ] = "Omrder" ;
+ Text [ french ] = "~Catgories" ;
+ Text [ swedish ] = "~Kategorier" ;
+ Text [ dutch ] = "~Bereiken" ;
+ Text [ spanish ] = "~reas" ;
+ Text [ english_us ] = "~Categories" ;
+ Left = TRUE ;
+ Text[ chinese_simplified ] = "(~C)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Obszary";
+ Text[ japanese ] = "͈(~C)";
+ Text[ chinese_traditional ] = "(~C)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~C)";
+ Text[ turkish ] = "~Kategori";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_TEMPLATE
+ {
+ Pos = MAP_APPFONT ( 139 , 6 ) ;
+ Size = MAP_APPFONT ( 97 , 10 ) ;
+ Text = "~Vorlagen" ;
+ Text [ ENGLISH ] = "~Templates" ;
+ Text [ norwegian ] = "~Maler" ;
+ Text [ italian ] = "~Modelli" ;
+ Text [ portuguese_brazilian ] = "~Modelos" ;
+ Text [ portuguese ] = "~Modelos" ;
+ Text [ finnish ] = "~Mallit" ;
+ Text [ danish ] = "Skabeloner" ;
+ Text [ french ] = "~Modles" ;
+ Text [ swedish ] = "~Mallar" ;
+ Text [ dutch ] = "S~jablonen" ;
+ Text [ spanish ] = "P~lantillas" ;
+ Text [ english_us ] = "~Templates" ;
+ Left = TRUE ;
+ Text[ chinese_simplified ] = "ʽ(~T)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Szablony";
+ Text[ japanese ] = "ڰ(~T)";
+ Text[ chinese_traditional ] = "˦(~T)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = " (~T)";
+ Text[ turkish ] = "~ablon";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_TEMPLATE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 139 , 18 ) ;
+ Size = MAP_APPFONT ( 127 , 72 ) ;
+ CurPos = 0 ;
+ };
+ MoreButton BT_MORE
+ {
+ Pos = MAP_APPFONT ( 274 , 70 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Zustze : ~Zustze */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Zustze : ~Zustze */
+ Text = "~Zustze" ;
+ Text [ ENGLISH ] = "~More" ;
+ Text [ norwegian ] = "~Mer" ;
+ Text [ italian ] = "E~xtra" ;
+ Text [ portuguese_brazilian ] = "~Mais" ;
+ Text [ portuguese ] = "~Outros" ;
+ Text [ finnish ] = "~Enemmn" ;
+ Text [ danish ] = "Flere" ;
+ Text [ french ] = "O~ptions" ;
+ Text [ swedish ] = "~Fler" ;
+ Text [ dutch ] = "~Overige" ;
+ Text [ spanish ] = "~Opciones" ;
+ Text [ english_us ] = "~More" ;
+ Delta = 148 ;
+ MapUnit = MAP_APPFONT ;
+ Text[ chinese_simplified ] = "(~M)";
+ Text[ russian ] = "~";
+ Text[ polish ] = "~Dodatki";
+ Text[ japanese ] = "ڍ(~M)";
+ Text[ chinese_traditional ] = "[(~M)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~M)";
+ Text[ turkish ] = "~Aralar";
+ Text[ language_user1 ] = " ";
+ };
+ Window WIN_PREVIEW
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 110 ) ;
+ Size = MAP_APPFONT ( 127 , 129 ) ;
+ Hide = TRUE ;
+ SVLook = FALSE ;
+ };
+ CheckBox BTN_PREVIEW
+ {
+ Pos = MAP_APPFONT ( 6 , 96 ) ;
+ Size = MAP_APPFONT ( 97 , 10 ) ;
+ Text = "Vor~schau" ;
+ Text [ ENGLISH ] = "Pre~view" ;
+ Text [ norwegian ] = "For~hndsvisning" ;
+ Text [ italian ] = "Anteprima" ;
+ Text [ portuguese_brazilian ] = "E~xaminar" ;
+ Text [ portuguese ] = "~Previsualizao" ;
+ Text [ finnish ] = "~Esikatselu" ;
+ Text [ danish ] = "Eksempel" ;
+ Text [ french ] = "~Aperu" ;
+ Text [ swedish ] = "Frhandsvi~sning" ;
+ Text [ dutch ] = "~Voorbeeld" ;
+ Text [ spanish ] = "Pre~visualizacin" ;
+ Text [ english_us ] = "Pre~view" ;
+ Hide = TRUE ;
+ Text[ chinese_simplified ] = "Ԥ(~V)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Po~dgld";
+ Text[ japanese ] = "ޭ(~V)";
+ Text[ chinese_traditional ] = "˵(~V)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "̸ (~V)";
+ Text[ turkish ] = "~nizleme";
+ Text[ language_user1 ] = " ";
+ };
+ GroupBox GB_DOCINFO
+ {
+ Pos = MAP_APPFONT ( 139 , 97 ) ;
+ Size = MAP_APPFONT ( 186 , 143 ) ;
+ Text = "Beschreibung" ;
+ Text [ English ] = "Description" ;
+ Hide = TRUE ;
+ Text [ english_us ] = "Description" ;
+ Text [ italian ] = "Descrizione" ;
+ Text [ spanish ] = "Descripcin" ;
+ Text [ french ] = "Description" ;
+ Text [ dutch ] = "Beschrijving" ;
+ Text [ swedish ] = "Beskrivning" ;
+ Text [ danish ] = "Beskrivelse" ;
+ Text [ portuguese_brazilian ] = "Beschreibung" ;
+ Text [ portuguese ] = "Descrio" ;
+ Text[ chinese_simplified ] = "˵";
+ Text[ russian ] = "";
+ Text[ polish ] = "Opis";
+ Text[ japanese ] = "v";
+ Text[ chinese_traditional ] = "yz";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Tanm";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_TITLE
+ {
+ Pos = MAP_APPFONT ( 145 , 108 ) ;
+ Size = MAP_APPFONT ( 175 , 10 ) ;
+ Text = "~Titel" ;
+ Text [ ENGLISH ] = "T~itle" ;
+ Text [ norwegian ] = "Tittel" ;
+ Text [ italian ] = "~Titolo" ;
+ Text [ portuguese_brazilian ] = "Ttulo" ;
+ Text [ portuguese ] = "~Ttulo" ;
+ Text [ finnish ] = "Otsikko" ;
+ Text [ danish ] = "Titel" ;
+ Text [ french ] = "~Titre" ;
+ Text [ swedish ] = "~Rubrik" ;
+ Text [ dutch ] = "~Titel" ;
+ Text [ spanish ] = "~Ttulo" ;
+ Text [ english_us ] = "~Title" ;
+ Hide = TRUE ;
+ Text[ chinese_simplified ] = "(~T)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Tytu";
+ Text[ japanese ] = "(~T)";
+ Text[ chinese_traditional ] = "D(~T)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~T)";
+ Text[ turkish ] = "~Balk";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_TITLE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 145 , 121 ) ;
+ Size = MAP_APPFONT ( 175 , 12 ) ;
+ ReadOnly = TRUE ;
+ Hide = TRUE ;
+ };
+ FixedText FT_THEMA
+ {
+ Pos = MAP_APPFONT ( 145 , 135 ) ;
+ Size = MAP_APPFONT ( 175 , 10 ) ;
+ Text = "The~ma" ;
+ Text [ ENGLISH ] = "Th~eme" ;
+ Text [ norwegian ] = "Tema" ;
+ Text [ italian ] = "Argomento" ;
+ Text [ portuguese_brazilian ] = "Tema" ;
+ Text [ portuguese ] = "~Assunto" ;
+ Text [ finnish ] = "Aihe" ;
+ Text [ danish ] = "Emne" ;
+ Text [ french ] = "S~ujet" ;
+ Text [ swedish ] = "~Tema" ;
+ Text [ dutch ] = "~Onderwerp" ;
+ Text [ spanish ] = "~Tema" ;
+ Text [ english_us ] = "Subject" ;
+ Hide = TRUE ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "Temat";
+ Text[ japanese ] = "ð";
+ Text[ chinese_traditional ] = "DD";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Konu";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_THEMA
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 145 , 148 ) ;
+ Size = MAP_APPFONT ( 175 , 12 ) ;
+ ReadOnly = TRUE ;
+ Hide = TRUE ;
+ };
+ FixedText FT_KEYWORDS
+ {
+ Pos = MAP_APPFONT ( 145 , 162 ) ;
+ Size = MAP_APPFONT ( 175 , 10 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? S~chlsselworte : S~chlsselworte */
+ /* ### ACHTUNG: Neuer Text in Resource? S~chlsselworte : S~chlsselworte */
+ Text = "S~chlsselworte" ;
+ Text [ ENGLISH ] = "~Keywords" ;
+ Text [ norwegian ] = "Nkkelord" ;
+ Text [ italian ] = "Parole chiave" ;
+ Text [ portuguese_brazilian ] = "Palavras-chave" ;
+ Text [ portuguese ] = "~Palavras-chave" ;
+ Text [ finnish ] = "Avainsanat" ;
+ Text [ danish ] = "Ngleord" ;
+ Text [ french ] = "Mots-cl~s" ;
+ Text [ swedish ] = "~Nyckelord" ;
+ Text [ dutch ] = "S~leutelwoorden" ;
+ Text [ spanish ] = "Palabras ~clave" ;
+ Text [ english_us ] = "~Key words" ;
+ Hide = TRUE ;
+ Text[ chinese_simplified ] = "ؼ(~K)";
+ Text[ russian ] = " ";
+ Text[ polish ] = "Sowa kluczowe";
+ Text[ japanese ] = "ܰ(~K)";
+ Text[ chinese_traditional ] = "r(~K)";
+ Text[ arabic ] = " ";
+ Text[ greek ] = "-";
+ Text[ korean ] = "Ű(~K)";
+ Text[ turkish ] = "A~nahtar szckler";
+ Text[ language_user1 ] = " ";
+ };
+ Edit ED_KEYWORDS
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 145 , 175 ) ;
+ Size = MAP_APPFONT ( 175 , 12 ) ;
+ ReadOnly = TRUE ;
+ Hide = TRUE ;
+ };
+ FixedText FT_DESC
+ {
+ Pos = MAP_APPFONT ( 145 , 189 ) ;
+ Size = MAP_APPFONT ( 175 , 10 ) ;
+ Text = "B~eschreibung" ;
+ Text [ ENGLISH ] = "~Description" ;
+ Text [ norwegian ] = "Beskrivelse" ;
+ Text [ italian ] = "Descrizione" ;
+ Text [ portuguese_brazilian ] = "Descrio" ;
+ Text [ portuguese ] = "~Descrio" ;
+ Text [ finnish ] = "Kuvaus" ;
+ Text [ danish ] = "Beskrivelse" ;
+ Text [ french ] = "~Description" ;
+ Text [ swedish ] = "B~eskrivning" ;
+ Text [ dutch ] = "Be~schrijving" ;
+ Text [ spanish ] = "~Descripcin" ;
+ Text [ english_us ] = "~Description" ;
+ Hide = TRUE ;
+ Text[ chinese_simplified ] = "˵(~D)";
+ Text[ russian ] = "";
+ Text[ polish ] = "Opis";
+ Text[ japanese ] = "v(~D)";
+ Text[ chinese_traditional ] = "yz(~D)";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "(~D)";
+ Text[ turkish ] = "~Tanm";
+ Text[ language_user1 ] = " ";
+ };
+ MultiLineEdit ED_DESC
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 144 , 202 ) ;
+ Size = MAP_APPFONT ( 175 , 32 ) ;
+ IgnoreTab = TRUE ;
+ ReadOnly = TRUE ;
+ Hide = TRUE ;
+ };
+ ExtraData =
+ {
+ 103;
+ 44;
+ };
+ Text[ chinese_simplified ] = "½";
+ Text[ russian ] = "";
+ Text[ polish ] = "Nowy";
+ Text[ japanese ] = "VK쐬";
+ Text[ chinese_traditional ] = "}ҷs";
+ Text[ arabic ] = "";
+ Text[ greek ] = "";
+ Text[ korean ] = "";
+ Text[ turkish ] = "Yeni";
+ Text[ language_user1 ] = " ";
+};
+ // ********************************************************************** EOF
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
new file mode 100644
index 000000000000..0fc3dbd4390e
--- /dev/null
+++ b/sfx2/source/doc/objcont.cxx
@@ -0,0 +1,1669 @@
+/*************************************************************************
+ *
+ * $RCSfile: objcont.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "docfile.hxx"
+
+#ifndef _CACHESTR_HXX //autogen
+#include <tools/cachestr.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX //autogen wg. QueryBox
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXSTYLE_HXX //autogen
+#include <svtools/style.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+
+#pragma hdrstop
+
+#include <svtools/stritem.hxx>
+#include <svtools/intitem.hxx>
+#include <svtools/rectitem.hxx>
+#include <svtools/urihelper.hxx>
+
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+#ifndef _DATETIME_HXX
+#include <tools/datetime.hxx>
+#endif
+#include <math.h>
+
+#include "sfxresid.hxx"
+#include "saveopt.hxx"
+#include "stbmgr.hxx"
+#include "dinfdlg.hxx"
+#include "fltfnc.hxx"
+#include "docfac.hxx"
+#include "saveopt.hxx"
+#include "cfgmgr.hxx"
+#include "inimgr.hxx"
+#include "viewsh.hxx"
+#include "objsh.hxx"
+#include "objshimp.hxx"
+#include "cfgitem.hxx"
+#include "evntconf.hxx"
+#include "interno.hxx"
+#include "sfxhelp.hxx"
+#include "dispatch.hxx"
+#include "urlframe.hxx"
+#include "printer.hxx"
+#include "topfrm.hxx"
+#include "basmgr.hxx"
+#include "doctempl.hxx"
+#include "doc.hrc"
+
+//====================================================================
+
+#define SFX_WINDOWS_STREAM "SfxWindows"
+#define SFX_PREVIEW_STREAM "SfxPreview"
+
+//====================================================================
+
+GDIMetaFile* SfxObjectShell::GetPreviewMetaFile( ) const
+{
+ // Nur wenn gerade nicht gedruckt wird, darf DoDraw aufgerufen
+ // werden, sonst wird u.U. der Printer abgeschossen !
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( this );
+ if ( pFrame && pFrame->GetViewShell() &&
+ pFrame->GetViewShell()->GetPrinter() &&
+ pFrame->GetViewShell()->GetPrinter()->IsPrinting() )
+ return 0;
+
+ Size aTmpSize = ((SfxObjectShell*)this)->GetFirstPageSize();
+ GDIMetaFile* pFile = new GDIMetaFile;
+ pFile->SetPrefSize( aTmpSize );
+ DBG_ASSERT( aTmpSize.Height()*aTmpSize.Width(),
+ "size of first page is 0, overload GetFirstPageSize or set vis-area!" );
+#define FRAME 4
+
+ VirtualDevice aDevice;
+ aDevice.EnableOutput( FALSE );
+ SfxInPlaceObject* pObj = GetInPlaceObject();
+ if( pObj )
+ {
+ MapMode aMode( pObj->GetMapUnit() );
+ aDevice.SetMapMode( aMode );
+ }
+ pFile->Record( &aDevice );
+ SfxInPlaceObject* pInPlaceObj = GetInPlaceObject();
+ DBG_ASSERT( pInPlaceObj, "Ohne Inplace Objekt keine Grafik" );
+ if (pInPlaceObj)
+ pInPlaceObj->DoDraw(
+ &aDevice, Point(0,0), aTmpSize,
+ JobSetup(), ASPECT_THUMBNAIL );
+ pFile->Stop();
+ return pFile;
+}
+
+FASTBOOL SfxObjectShell::SaveWindows_Impl( SvStorage &rStor ) const
+{
+ SvStorageStreamRef xStream = rStor.OpenStream( DEFINE_CONST_UNICODE( SFX_WINDOWS_STREAM ),
+ STREAM_TRUNC | STREAM_STD_READWRITE);
+ if ( !xStream )
+ return FALSE;
+
+ xStream->SetBufferSize(1024);
+ xStream->SetVersion( rStor.GetVersion() );
+
+ // "uber alle Fenster iterieren (aber aktives Window zuletzt)
+ SfxViewFrame *pActFrame = SfxViewFrame::Current();
+ if ( pActFrame->GetObjectShell() != this )
+ pActFrame = SfxViewFrame::GetFirst(this);
+
+ String aActWinData;
+ for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame) ); pFrame;
+ pFrame = SfxViewFrame::GetNext(*pFrame, this, TYPE(SfxTopViewFrame) ) )
+ {
+ // Bei Dokumenten, die Outplace aktiv sind, kann beim Speichern auch schon die View weg sein!
+ if ( pFrame->GetViewShell() )
+ {
+ SfxTopFrame* pTop = (SfxTopFrame*) pFrame->GetFrame();
+ Window* pWin = pTop->GetTopWindow_Impl();
+
+ char cToken = SfxIniManager::GetToken();
+ const BOOL bActWin = pActFrame == pFrame;
+ String aUserData;
+ pFrame->GetViewShell()->WriteUserData(aUserData);
+
+ // assemble ini-data
+ String aWinData;
+ aWinData += pFrame->GetCurViewId();
+ aWinData += cToken;
+/*
+ if ( !pWin || pWin->IsMaximized() )
+ aWinData += SFX_WINSIZE_MAX;
+ else if ( pWin->IsMinimized() )
+ aWinData += SFX_WINSIZE_MIN;
+ else
+*/
+ aWinData += SfxIniManager::GetString( pWin->GetPosPixel(), pWin->GetSizePixel() );
+ aWinData += cToken;
+ aWinData += aUserData;
+
+ // aktives kennzeichnen
+ aWinData += cToken;
+ aWinData += bActWin ? '1' : '0';
+
+ // je nachdem merken oder abspeichern
+ if ( bActWin )
+ aActWinData = aWinData;
+ else
+ xStream->WriteByteString( aWinData );
+ }
+ }
+
+ // aktives Window hinterher
+ xStream->WriteByteString( aActWinData );
+ return !xStream->GetError();
+}
+
+//====================================================================
+
+SfxViewFrame* SfxObjectShell::LoadWindows_Impl( SfxTopFrame *pPreferedFrame )
+{
+ DBG_ASSERT( pPreferedFrame, "Can't be implemented in StarPortal!" );
+ if ( pImp->bLoadingWindows || !pPreferedFrame )
+ return NULL;
+
+ const SfxFilter* pFilter;
+ if( GetMedium() && ( pFilter = GetMedium()->GetFilter() ) && !pFilter->UsesStorage() )
+ return 0;
+
+ // Modus bestimmen
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxViewFrame *pPrefered = pPreferedFrame ? pPreferedFrame->GetCurrentViewFrame() : 0;
+ SfxOptions &rOpt = pSfxApp->GetOptions();
+ BOOL bLoadDocWins = rOpt.IsSaveDocWins() && !pPrefered;
+ BOOL bLoadDocView = rOpt.IsSaveDocView();
+
+ // In a StarPortal not possible at the moment
+ bLoadDocWins = FALSE;
+
+ // gar nichts laden?
+ if ( !bLoadDocView )
+ return 0;
+
+ // Sub-Stream "offnen
+ SvStorage *pStor = GetStorage();
+ SvStorageStreamRef xStream = pStor ? pStor->OpenStream( DEFINE_CONST_UNICODE( SFX_WINDOWS_STREAM ), STREAM_STD_READ ) : 0;
+ if ( !xStream )
+ return 0;
+
+ BOOL bOldFormat = TRUE;
+ xStream->SetVersion( pStor->GetVersion() );
+ xStream->SetBufferSize(1024);
+
+ // alle gespeicherten Fenster "offnen
+ SfxViewFrame *pActiveFrame = 0;
+ String aWinData;
+ char cToken = SfxIniManager::GetToken();
+ SfxItemSet *pSet = GetMedium()->GetItemSet();
+
+ pImp->bLoadingWindows = TRUE;
+ BOOL bLoaded = FALSE;
+ while ( xStream->ReadByteString( aWinData ), aWinData.Len() )
+ {
+ if ( aWinData.GetToken( 0, cToken ).EqualsAscii( "TASK" ) )
+ {
+ // doesn't make any sense with the new task handling using system tasks or browser windows
+ bOldFormat = FALSE;
+ }
+ else
+ {
+ USHORT nViewId = (USHORT) aWinData.GetToken( 0, cToken ).ToInt32();
+ FASTBOOL bActive=FALSE, bMaximized=FALSE;
+ String aUserData, aPosSize;
+ if ( bOldFormat )
+ {
+ // Old format
+ aPosSize = aWinData.GetToken( 1, cToken );
+ aPosSize.ToLowerAscii();
+ aUserData = aWinData.GetToken( 2, cToken );
+ bActive = aWinData.GetToken( 3, cToken ).ToInt32();
+
+ if ( aPosSize.EqualsAscii( SFX_WINSIZE_MAX ) )
+ bMaximized = TRUE;
+ else if ( aPosSize.EqualsAscii( SFX_WINSIZE_MIN ) )
+ {
+ bMaximized = TRUE;
+ bActive = FALSE;
+ }
+ else
+ bMaximized = FALSE;
+ }
+ else
+ {
+ // 5.0-Format, get activity state and UserData
+ USHORT nPos=0;
+ bActive = aWinData.GetToken( 3, cToken, nPos ).ToInt32();
+ aUserData = aWinData.Copy( nPos );
+ }
+
+ Point aPt;
+ Size aSz;
+ if ( !bMaximized )
+ SfxIniManager::GetPosSize( aPosSize, aPt, aSz );
+
+ // nur aktives soll geladen werden, es ist aber nicht das aktive?
+ if ( !bLoadDocWins && !bActive )
+ continue;
+
+ pSet->ClearItem( SID_USER_DATA );
+
+ SfxViewFrame *pFrame = 0;
+ if ( pPrefered )
+ {
+ // dann den mitgegebenen Frame verwenden, aber keine Gr"o\se
+ // am Window setzen
+ pFrame = pPrefered;
+ if ( pFrame->GetViewShell() || !pFrame->GetObjectShell() )
+ {
+ pSet->ClearItem( SID_VIEW_POS_SIZE );
+ pSet->ClearItem( SID_WIN_POSSIZE );
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
+
+ // Flackern vermeiden
+ SfxBindings &rBind = pFrame->GetBindings();
+ rBind.ENTERREGISTRATIONS();
+
+ // dann ausr"aumen und das eigene Doc reinsetzen
+ pPreferedFrame->InsertDocument( this );
+
+ // Updating reaktivieren
+ rBind.LEAVEREGISTRATIONS();
+ }
+ else
+ {
+ // sonst neue View erzeugen
+ pFrame->CreateView_Impl( nViewId );
+ }
+ }
+ else
+ {
+ if ( bLoadDocWins )
+ {
+ // Im Hintergrund "offnen
+ pSet->Put( SfxUInt16Item( SID_VIEW_ZOOM_MODE, 0 ) );
+ if ( !bMaximized )
+ pSet->Put( SfxRectangleItem( SID_VIEW_POS_SIZE, Rectangle( aPt, aSz ) ) );
+ }
+
+ pSet->Put( SfxUInt16Item( SID_VIEW_ID, nViewId ) );
+ pPreferedFrame->InsertDocument( this );
+ pFrame = pPreferedFrame->GetCurrentViewFrame();
+
+ // Wird nicht mehr gebraucht
+ pSet->ClearItem( SID_VIEW_POS_SIZE );
+ pSet->ClearItem( SID_WIN_POSSIZE );
+ pSet->ClearItem( SID_VIEW_ZOOM_MODE );
+ }
+
+ bLoaded = TRUE;
+
+ // UserData hier einlesen, da es ansonsten immer mit bBrowse=TRUE
+ // aufgerufen wird, beim Abspeichern wurde aber bBrowse=FALSE verwendet
+ if ( pFrame && pFrame->GetViewShell() )
+ pFrame->GetViewShell()->ReadUserData( aUserData, !bLoadDocWins );
+
+ // Evtl. sollen noch weitere Fenster geladen werden
+ pPreferedFrame = NULL;
+
+ if ( bActive )
+ pActiveFrame = pFrame;
+
+ if( pPrefered || !bLoadDocWins )
+ // Es sollte nur das aktive Window geladen werden
+ break;
+ }
+ }
+
+ if ( pActiveFrame )
+ {
+ if ( !pPrefered )
+ // Den zu aktivierenden Frame aktivieren
+ pActiveFrame->MakeActive_Impl( TRUE );
+ }
+
+ pImp->bLoadingWindows = FALSE;
+ return pPrefered && bLoaded ? pPrefered : pActiveFrame;
+}
+
+//====================================================================
+
+void SfxObjectShell::UpdateDocInfoForSave()
+{
+ SfxDocumentInfo &rDocInfo = GetDocInfo();
+ rDocInfo.SetTemplateConfig( HasTemplateConfig() );
+
+ if ( IsModified() )
+ {
+ // Keine Unterschiede mehr zwischen Save, SaveAs
+ String aUserName = SFX_INIMANAGER()->GetUserFullName();
+ if ( !rDocInfo.IsUseUserData() )
+ aUserName.Erase();
+
+ rDocInfo.SetChanged( aUserName );
+ if ( !HasName() || pImp->bIsSaving )
+ UpdateTime_Impl( rDocInfo );
+ }
+
+ if ( !pImp->bIsSaving )
+ {
+ // Flag fuer Passwort merken
+ rDocInfo.SetPasswd( pImp->bPasswd );
+
+ // ggf. DocInfo Dialog
+ if ( !pImp->bSilent && eCreateMode == SFX_CREATE_MODE_STANDARD &&
+ 0 == ( pImp->eFlags & SFXOBJECTSHELL_NODOCINFO ) && SFX_APP()->GetOptions().IsDocInfoSave() )
+ {
+//(mba)/task
+/*
+ Window* pWindow = Application::GetAppWindow();
+ if ( pWindow )
+ pWindow->EnterWait();
+ */
+ DocInfoDlg_Impl( rDocInfo );
+/*
+ if ( pWindow )
+ pWindow->LeaveWait();
+ */
+ }
+ }
+
+ Broadcast( SfxDocumentInfoHint( &rDocInfo ) );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxObjectShell::SaveInfoAndConfig_Impl( SvStorageRef pNewStg )
+{
+ //Demnaechst mal gemeinsame Teile zusammenfassen
+ UpdateDocInfoForSave();
+
+#if !defined( SFX_KEY_MAXPREVIEWSIZE ) && defined( TFPLUGCOMM )
+#define SFX_KEY_MAXPREVIEWSIZE SFX_KEY_ISFREE
+#endif
+
+#ifdef MI_doch_wieder_die_alte_preview
+ String aMaxSize = SFX_INIMANAGER()->Get( SFX_KEY_MAXPREVIEWSIZE );
+ ULONG nMaxSize = aMaxSize.Len() ? ULONG( aMaxSize ) : 50000;
+#else
+ ULONG nMaxSize = 0L;
+#endif
+ if( nMaxSize && !GetDocInfo().IsPasswd() &&
+ SFX_CREATE_MODE_STANDARD == eCreateMode )
+ {
+ GDIMetaFile* pFile = GetPreviewMetaFile();
+ if ( pFile )
+ {
+ SvCacheStream aStream;
+ long nVer = pNewStg->GetVersion();
+ aStream.SetVersion( nVer );
+ aStream << *pFile;
+ if( aStream.Tell() < nMaxSize )
+ {
+ SvStorageStreamRef xStream = pNewStg->OpenStream(
+ DEFINE_CONST_UNICODE( SFX_PREVIEW_STREAM ),
+ STREAM_TRUNC | STREAM_STD_READWRITE);
+ if( xStream.Is() && !xStream->GetError() )
+ {
+ long nVer = pNewStg->GetVersion();
+ xStream->SetVersion( nVer );
+ aStream.Seek( 0L );
+ *xStream << aStream;
+ }
+ }
+ delete pFile;
+ }
+ }
+
+ if( pImp->bIsSaving )
+ {
+ //!! kein Aufruf der Basisklasse wegen doppeltem Aufruf in Persist
+ //if(!SfxObjectShell::Save())
+ // return FALSE;
+ SvStorageRef aRef = GetMedium()->GetStorage();
+ if ( aRef.Is() )
+ {
+ SfxDocumentInfo& rDocInfo = GetDocInfo();
+ rDocInfo.Save(pNewStg);
+
+ // wenn es sich um ein Dokument lokales Basic handelt, dieses
+ // schreiben
+ if ( pImp->pBasicMgr )
+ pImp->pBasicMgr->Store( *pNewStg );
+ else
+ {
+ String aURL;
+ if( HasName() )
+ aURL = GetMedium()->GetName();
+ else
+ {
+ aURL = GetDocInfo().GetTemplateFileName();
+ // Bei Templates keine URL...
+ aURL = URIHelper::SmartRelToAbs( aURL );
+ }
+#ifndef TFPLUGCOMM
+ SfxBasicManager::CopyBasicData( GetStorage(), aURL, pNewStg );
+#endif
+ }
+
+ // Windows-merken
+ if ( TRUE ) HACK(aus config)
+ SaveWindows_Impl( *pNewStg );
+
+ // Konfiguration schreiben
+ if ( GetConfigManager() )
+ {
+ if ( rDocInfo.HasTemplateConfig() )
+ {
+ const String aTemplFileName( rDocInfo.GetTemplateFileName() );
+ if ( aTemplFileName.Len() )
+ {
+ INetURLObject aURL( aTemplFileName, INET_PROT_FILE );
+ SvStorageRef aStor = new SvStorage( aURL.GetMainURL() );
+ if ( SVSTREAM_OK == aStor->GetError() )
+ {
+ GetConfigManager()->SaveConfig(aStor);
+ if (aRef->IsStream(SfxConfigManager::GetStreamName()))
+ aRef->Remove(SfxConfigManager::GetStreamName());
+ }
+ }
+ }
+ else
+ {
+ GetConfigManager()->SetModified( TRUE );
+ GetConfigManager()->SaveConfig(pNewStg);
+ }
+ }
+ }
+ return TRUE;
+ }
+ else
+ {
+ //!! kein Aufruf der Basisklasse wegen doppeltem Aufruf in Persist
+ //if(!SfxObjectShell::SaveAs(pNewStg))
+ // return FALSE;
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxMedium *pActMed = GetMedium();
+
+ // alte DocInfo laden
+ SfxDocumentInfo &rDocInfo = GetDocInfo();
+
+ // DocInfo speichern
+ rDocInfo.Save( pNewStg );
+
+ // wenn es sich um ein Dokument lokales Basic handelt, dieses schreiben
+ if ( pImp->pBasicMgr )
+ pImp->pBasicMgr->Store( *pNewStg );
+#ifndef MI_NONOS
+ else
+ {
+ String aURL;
+ if( HasName() )
+ aURL = GetMedium()->GetName();
+ else
+ {
+ aURL = GetDocInfo().GetTemplateFileName();
+ // Bei Templates keine URL...
+ aURL = URIHelper::SmartRelToAbs( aURL );
+ }
+#ifndef TFPLUGCOMM
+ SfxBasicManager::CopyBasicData( GetStorage(), aURL, pNewStg );
+#endif
+ }
+#endif
+ // Windows-merken
+ if ( TRUE ) HACK(aus config)
+ SaveWindows_Impl( *pNewStg );
+
+ // Konfiguration schreiben
+ if (GetConfigManager())
+ {
+ if ( rDocInfo.HasTemplateConfig() )
+ {
+ const String aTemplFileName( rDocInfo.GetTemplateFileName() );
+ if ( aTemplFileName.Len() )
+ {
+ INetURLObject aURL( aTemplFileName, INET_PROT_FILE );
+ SvStorageRef aStor = new SvStorage( aURL.GetMainURL() );
+ if ( SVSTREAM_OK == aStor->GetError() )
+ {
+ GetConfigManager()->SaveConfig(aStor);
+ if (pNewStg->IsStream(SfxConfigManager::GetStreamName()))
+ pNewStg->Remove(SfxConfigManager::GetStreamName());
+ }
+ }
+ }
+ else
+ {
+ GetConfigManager()->SetModified( TRUE );
+ GetConfigManager()->SaveConfig(pNewStg);
+ }
+ }
+
+ return TRUE;
+ }
+}
+
+//--------------------------------------------------------------------
+
+// Bearbeitungszeit aktualisieren
+SfxDocumentInfo& SfxObjectShell::UpdateTime_Impl(SfxDocumentInfo &rInfo)
+{
+ // Get old time from documentinfo
+ Time aOldTime(rInfo.GetTime());
+
+ // Initialize some local member! Its neccessary for wollow operations!
+ DateTime aNow ; // Date and time at current moment
+ Time n24Time (24,0,0,0) ; // Time-value for 24 hours - see follow calculation
+ ULONG nDays = 0 ; // Count of days between now and last editing
+ Time nAddTime (0) ; // Value to add on aOldTime
+
+ // Safe impossible cases!
+ // User has changed time to the past between last editing and now ... its not possible!!!
+ DBG_ASSERT( !(aNow.GetDate()<pImp->nTime.GetDate()), "Timestamp of last change is in the past ?!..." );
+
+ // Do the follow only, if user has NOT changed time to the past.
+ // Else add a time of 0 to aOldTime ... !!!
+ if (aNow.GetDate()>=pImp->nTime.GetDate())
+ {
+ // Get count of days last editing.
+ nDays = aNow.GetSecFromDateTime(pImp->nTime.GetDate())/86400 ;
+
+ if (nDays==0)
+ {
+ // If no day between now and last editing - calculate time directly.
+ nAddTime = aNow-pImp->nTime ;
+ }
+ else
+ // If time of working without save greater then 1 month (!) ....
+ // we add 0 to aOldTime!
+ if (nDays<=31)
+ {
+ // If 1 or up to 31 days between now and last editing - calculate time indirectly.
+ // nAddTime = (24h - nTime) + (nDays * 24h) + aNow
+ --nDays;
+ nAddTime = nDays*n24Time.GetTime() ;
+ nAddTime += n24Time-pImp->nTime ;
+ nAddTime += aNow ;
+ }
+
+ aOldTime += nAddTime;
+ }
+
+ rInfo.SetTime(aOldTime.GetTime());
+ pImp->nTime = aNow;
+ rInfo.IncDocumentNumber();
+ //! DocumentNummer
+#if 0
+ const String aDocNo(rInfo.GetUserKey(0).GetWord());
+ const String aTitle(rInfo.GetUserKey(0).GetTitle());
+ USHORT nNo = 1;
+ if ( aDocNo.Len() )
+ {
+ nNo = (USHORT)aDocNo;
+ if(nNo)
+ ++nNo;
+ else
+ nNo = 1;
+ }
+ rInfo.SetUserKey(SfxDocUserKey(aTitle, nNo), 0);
+#endif
+ return rInfo;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::DocInfoDlg_Impl( SfxDocumentInfo &rDocInfo )
+{
+ // anzuzeigenden Dokumentnamen ermitteln
+ String aURL, aTitle;
+ if ( HasName() && !pImp->aNewName.Len() )
+ {
+ aURL = GetMedium()->GetName();
+ aTitle = GetTitle();
+ }
+ else
+ {
+ if ( !pImp->aNewName.Len() )
+ {
+ aURL = DEFINE_CONST_UNICODE( "private:factory/" );
+ aURL += String::CreateFromAscii( GetFactory().GetShortName() );
+ // aTitle = String( SfxResId( STR_NONAME ) );
+ }
+ else
+ {
+ aURL = DEFINE_CONST_UNICODE( "[private:factory/" );
+ aURL += String::CreateFromAscii( GetFactory().GetShortName() );
+ aURL += DEFINE_CONST_UNICODE( "]" );
+ INetURLObject aURLObj( pImp->aNewName );
+ aURL += aURLObj.GetMainURL();
+ // aTitle = aURLObj.GetBase();
+ }
+ aTitle = GetTitle();
+ }
+
+ // Itemset f"ur Dialog aufbereiten
+ SfxDocumentInfoItem aDocInfoItem( aURL, rDocInfo );
+ if ( !GetSlotState( SID_DOCTEMPLATE ) )
+ aDocInfoItem.SetTemplate(FALSE);
+ SfxItemSet aSet(GetPool(), SID_DOCINFO, SID_DOCINFO,
+ SID_EXPLORER_PROPS_START, SID_EXPLORER_PROPS_START,
+ 0L );
+ aSet.Put( aDocInfoItem );
+ aSet.Put( SfxStringItem( SID_EXPLORER_PROPS_START, aTitle ) );
+
+ // Dialog via Factory erzeugen und ausf"uhren
+ SfxDocumentInfoDialog *pDlg = CreateDocumentInfoDialog(0, aSet);
+ if ( RET_OK == pDlg->Execute() )
+ {
+ // neue DocInfo aus Dialog holen
+ const SfxPoolItem *pItem = 0;
+ if ( SFX_ITEM_SET ==
+ pDlg->GetOutputItemSet()->GetItemState( SID_DOCINFO, TRUE, &pItem ) )
+ {
+ rDocInfo = (*(const SfxDocumentInfoItem *)pItem)();
+
+ // ggf. den Titel des Dokuments neu setzen
+ String aNewTitle = rDocInfo.GetTitle();
+ aNewTitle.EraseLeadingChars();
+ aNewTitle.EraseTrailingChars();
+ if ( aTitle != aNewTitle && aNewTitle.Len() )
+ SetTitle( aNewTitle );
+ }
+ }
+ delete pDlg;
+}
+
+//------------------------------------------------------------------------
+
+SfxDocumentInfoDialog* SfxObjectShell::CreateDocumentInfoDialog
+(
+ Window* pParent,
+ const SfxItemSet& rSet
+)
+{
+ return new SfxDocumentInfoDialog(pParent, rSet);
+}
+
+//--------------------------------------------------------------------
+
+SvEmbeddedInfoObject* SfxObjectShell::InsertObject
+(
+ SvEmbeddedObject* pObj,
+ const String& rName
+)
+
+{
+ // Objekt erzeugen ist fehlgeschlagen?
+ if ( !pObj )
+ HACK(Fehlermeldung fehlt)
+ return 0;
+
+ String aName( rName );
+ if( !aName.Len() )
+ {
+ aName = DEFINE_CONST_UNICODE( "Object " );
+ String aStr;
+ USHORT i = 1;
+ HACK(Wegen Storage Bug 46033)
+ // for-Schleife wegen Storage Bug 46033
+ for( USHORT n = 0; n < 100; n++ )
+ {
+ do
+ {
+ aStr = aName;
+ aStr += String::CreateFromInt32( i );
+ i++;
+ } while ( Find( aStr ) );
+
+ SvInfoObjectRef xSub = new SvEmbeddedInfoObject( pObj, aStr );
+ if ( Move( xSub, aStr ) ) // Eigentuemer Uebergang
+ return (SvEmbeddedInfoObject*) &xSub;
+ }
+ }
+ else
+ {
+ SvInfoObjectRef xSub = new SvEmbeddedInfoObject( pObj, aName );
+ if ( Move( xSub, aName ) ) // Eigentuemer Uebergang
+ return (SvEmbeddedInfoObject*) &xSub;
+ }
+ return 0;
+}
+
+//-------------------------------------------------------------------------
+
+SfxConfigManager* SfxObjectShell::GetConfigManager() const
+{
+ return pImp->pCfgMgr;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetConfigManager(SfxConfigManager *pMgr)
+{
+ if (pImp->pCfgMgr == SFX_CFGMANAGER() && pMgr)
+ pMgr->Activate(pImp->pCfgMgr);
+
+ if (pImp->pCfgMgr)
+ delete pImp->pCfgMgr;
+
+ pImp->pCfgMgr = pMgr;
+ pMgr->SetObjectShell(this);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetTemplateConfig(BOOL bTplConf)
+{
+// pImp->bTemplateConfig = bTplConf;
+// DBG_ASSERT(pImp->pCfgMgr || !bTplConf,"Keine Konfiguration in der Vorlage!");
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxObjectShell::HasTemplateConfig() const
+{
+// return pImp->bTemplateConfig;
+ return FALSE;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::TransferConfig(SfxObjectShell& rObjSh)
+{
+ SfxConfigManager *pNewCfgMgr=0, *pOldCfgMgr=0;
+ pOldCfgMgr = pImp->pCfgMgr;
+ pImp->pCfgMgr = 0;
+
+ pNewCfgMgr = rObjSh.pImp->pCfgMgr;
+ rObjSh.pImp->pCfgMgr=0;
+
+ SetConfigManager(pNewCfgMgr);
+ rObjSh.SetConfigManager(pOldCfgMgr);
+}
+
+//--------------------------------------------------------------------
+
+SfxStyleSheetBasePool* SfxObjectShell::GetStyleSheetPool()
+{
+ return 0;
+}
+
+void SfxObjectShell::SetOrganizerSearchMask(
+ SfxStyleSheetBasePool* pPool) const
+{
+ pPool->SetSearchMask(SFX_STYLE_FAMILY_ALL,
+ SFXSTYLEBIT_USERDEF | SFXSTYLEBIT_USED);
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxObjectShell::GetContentCount(USHORT nIdx1,
+ USHORT nIdx2)
+{
+ switch(nIdx1)
+ {
+ case INDEX_IGNORE:
+ return DEF_CONTENT_COUNT;
+ case CONTENT_STYLE:
+ {
+ SfxStyleSheetBasePool *pPool = GetStyleSheetPool();
+ if(!pPool)
+ return 0;
+ SetOrganizerSearchMask(pPool);
+ return pPool->Count();
+ }
+ case CONTENT_MACRO:
+ break;
+
+ case CONTENT_CONFIG:
+ return (GetConfigManager() && !HasTemplateConfig()) ?
+ GetConfigManager()->GetItemCount() : 0;
+ break;
+ }
+ return 0;
+}
+
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::TriggerHelpPI(USHORT nIdx1, USHORT nIdx2, USHORT nIdx3)
+{
+ if(nIdx1==CONTENT_STYLE && nIdx2 != INDEX_IGNORE) //StyleSheets
+ {
+ SfxStyleSheetBasePool *pPool = GetStyleSheetPool();
+ SetOrganizerSearchMask(pPool);
+ SfxStyleSheetBase *pStyle = (*pPool)[nIdx2];
+#ifdef WIR_KOENNEN_WIEDER_HILFE_FUER_STYLESHEETS
+ if(pStyle)
+ {
+ String aHelpFile;
+ ULONG nHelpId=pStyle->GetHelpId(aHelpFile);
+ SfxHelpPI* pHelpPI = SFX_APP()->GetHelpPI();
+ if ( pHelpPI && nHelpId )
+ pHelpPI->LoadTopic( nHelpId );
+ }
+#endif
+ }
+}
+
+BOOL SfxObjectShell::CanHaveChilds(USHORT nIdx1,
+ USHORT nIdx2)
+{
+ switch(nIdx1) {
+ case INDEX_IGNORE:
+ return TRUE;
+ case CONTENT_STYLE:
+ return INDEX_IGNORE == nIdx2 || !GetStyleSheetPool()? FALSE: TRUE;
+ case CONTENT_MACRO:
+//!! return INDEX_IGNORE == nIdx2? FALSE: TRUE;
+ return FALSE;
+ case CONTENT_CONFIG:
+ return INDEX_IGNORE == nIdx2 ? FALSE : TRUE;
+ }
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::GetContent(String &rText,
+ Bitmap &rClosedBitmap,
+ Bitmap &rOpenedBitmap,
+ BOOL &bCanDel,
+ USHORT i,
+ USHORT nIdx1,
+ USHORT nIdx2)
+{
+ bCanDel=TRUE;
+
+ switch(nIdx1)
+ {
+ case INDEX_IGNORE:
+ {
+ USHORT nTextResId = 0;
+ USHORT nClosedBitmapResId; // evtl. sp"ater mal unterschiedliche
+ USHORT nOpenedBitmapResId; // " " " "
+ switch(i)
+ {
+ case CONTENT_STYLE:
+ nTextResId = STR_STYLES;
+ nClosedBitmapResId= BMP_STYLES_CLOSED;
+ nOpenedBitmapResId= BMP_STYLES_OPENED;
+ break;
+ case CONTENT_MACRO:
+ nTextResId = STR_MACROS;
+ nClosedBitmapResId= BMP_STYLES_CLOSED;
+ nOpenedBitmapResId= BMP_STYLES_OPENED;
+ break;
+ case CONTENT_CONFIG:
+ nTextResId = STR_CONFIG;
+ nClosedBitmapResId= BMP_STYLES_CLOSED;
+ nOpenedBitmapResId= BMP_STYLES_OPENED;
+ break;
+ }
+
+ if ( nTextResId )
+ {
+ rText = String(SfxResId(nTextResId));
+ rClosedBitmap = Bitmap(SfxResId(nClosedBitmapResId));
+ rOpenedBitmap = Bitmap(SfxResId(nOpenedBitmapResId));
+ }
+ break;
+ }
+
+ case CONTENT_STYLE:
+ {
+ SfxStyleSheetBasePool *pPool = GetStyleSheetPool();
+ SetOrganizerSearchMask(pPool);
+ SfxStyleSheetBase *pStyle = (*pPool)[i];
+ rText = pStyle->GetName();
+ bCanDel=((pStyle->GetMask() & SFXSTYLEBIT_USERDEF)
+ == SFXSTYLEBIT_USERDEF);
+ rClosedBitmap = rOpenedBitmap =
+ GetStyleFamilyBitmap(pStyle->GetFamily());
+ }
+ break;
+ case CONTENT_MACRO:
+ break;
+ case CONTENT_CONFIG:
+ if ( GetConfigManager() && !HasTemplateConfig())
+ {
+ rText = GetConfigManager()->GetItem(i);
+ bCanDel = GetConfigManager()->CanDelete(i);
+ }
+ else
+ rText = String();
+ rClosedBitmap = Bitmap(SfxResId(BMP_STYLES_CLOSED));
+ rOpenedBitmap = Bitmap(SfxResId(BMP_STYLES_OPENED));
+ break;
+ }
+}
+
+//--------------------------------------------------------------------
+
+Bitmap SfxObjectShell::GetStyleFamilyBitmap(SfxStyleFamily eFamily)
+{
+ USHORT nResId = 0;
+ switch(eFamily)
+ {
+ case SFX_STYLE_FAMILY_CHAR:
+ nResId = BMP_STYLES_FAMILY1;
+ break;
+ case SFX_STYLE_FAMILY_PARA:
+ nResId = BMP_STYLES_FAMILY2;
+ break;
+ case SFX_STYLE_FAMILY_FRAME:
+ nResId = BMP_STYLES_FAMILY3;
+ break;
+ case SFX_STYLE_FAMILY_PAGE :
+ nResId = BMP_STYLES_FAMILY4;
+ break;
+ }
+
+ if ( nResId )
+ return Bitmap(SfxResId(nResId));
+ else
+ return Bitmap();
+}
+
+
+//--------------------------------------------------------------------
+
+BOOL SfxObjectShell::Insert(SfxObjectShell &rSource,
+ USHORT nSourceIdx1,
+ USHORT nSourceIdx2,
+ USHORT nSourceIdx3,
+ USHORT &nIdx1,
+ USHORT &nIdx2,
+ USHORT &nIdx3,
+ USHORT &nDeleted)
+{
+ BOOL bRet = FALSE;
+
+ if (INDEX_IGNORE == nIdx1 && CONTENT_STYLE == nSourceIdx1)
+ nIdx1 = CONTENT_STYLE;
+
+ if (CONTENT_STYLE == nSourceIdx1 && CONTENT_STYLE == nIdx1)
+ {
+ SfxStyleSheetBasePool* pHisPool = rSource.GetStyleSheetPool();
+ SfxStyleSheetBasePool* pMyPool = GetStyleSheetPool();
+ SetOrganizerSearchMask(pHisPool);
+ SetOrganizerSearchMask(pMyPool);
+
+ SfxStyleSheetBase* pHisSheet = (*pHisPool)[nSourceIdx2];
+
+ // Einfuegen ist nur dann noetig, wenn ein StyleSheet
+ // zwischen unterschiedlichen(!) Pools bewegt wird
+
+ if (pMyPool != pHisPool)
+ {
+ if (INDEX_IGNORE == nIdx2)
+ {
+ nIdx2 = pMyPool->Count();
+ }
+
+ // wenn so eine Vorlage schon existiert: loeschen!
+ String aOldName(pHisSheet->GetName());
+ SfxStyleFamily eOldFamily = pHisSheet->GetFamily();
+
+ SfxStyleSheetBase* pExist = pMyPool->Find(aOldName, eOldFamily);
+ // USHORT nOldHelpId = pExist->GetHelpId(??? VB ueberlegt sich was);
+ BOOL bUsedOrUserDefined;
+ if( pExist )
+ {
+ bUsedOrUserDefined =
+ pExist->IsUsed() || pExist->IsUserDefined();
+ if( ErrorHandler::HandleError(
+ *new MessageInfo( ERRCODE_SFXMSG_STYLEREPLACE, aOldName ) )
+ != ERRCODE_BUTTON_OK )
+ return FALSE;
+ else
+ {
+ pMyPool->Replace( *pHisSheet, *pExist );
+ SetModified( TRUE );
+ nIdx2 = nIdx1 = INDEX_IGNORE;
+ return TRUE;
+ }
+ }
+
+ SfxStyleSheetBase& rNewSheet = pMyPool->Make(
+ aOldName, eOldFamily,
+ pHisSheet->GetMask(), nIdx2);
+
+ // ItemSet der neuen Vorlage fuellen
+ rNewSheet.GetItemSet().Set(pHisSheet->GetItemSet());
+
+ // wer bekommt den Neuen als Parent? wer benutzt den Neuen als Follow?
+ SfxStyleSheetBase* pTestSheet = pMyPool->First();
+ while (pTestSheet)
+ {
+ if (pTestSheet->GetFamily() == eOldFamily &&
+ pTestSheet->HasParentSupport() &&
+ pTestSheet->GetParent() == aOldName)
+ {
+ pTestSheet->SetParent(aOldName);
+ // Verknuepfung neu aufbauen
+ }
+
+ if (pTestSheet->GetFamily() == eOldFamily &&
+ pTestSheet->HasFollowSupport() &&
+ pTestSheet->GetFollow() == aOldName)
+ {
+ pTestSheet->SetFollow(aOldName);
+ // Verknuepfung neu aufbauen
+ }
+
+ pTestSheet = pMyPool->Next();
+ }
+ bUsedOrUserDefined =
+ rNewSheet.IsUsed() || rNewSheet.IsUserDefined();
+
+
+ // hat der Neue einen Parent? wenn ja, mit gleichem Namen bei uns suchen
+ if (pHisSheet->HasParentSupport())
+ {
+ const String& rParentName = pHisSheet->GetParent();
+ if (0 != rParentName.Len())
+ {
+ SfxStyleSheetBase* pParentOfNew =
+ pMyPool->Find(rParentName, eOldFamily);
+ if (pParentOfNew)
+ rNewSheet.SetParent(rParentName);
+ }
+ }
+
+ // hat der Neue einen Follow? wenn ja, mit gleichem
+ // Namen bei uns suchen
+ if (pHisSheet->HasFollowSupport())
+ {
+ const String& rFollowName = pHisSheet->GetFollow();
+ if (0 != rFollowName.Len())
+ {
+ SfxStyleSheetBase* pFollowOfNew =
+ pMyPool->Find(rFollowName, eOldFamily);
+ if (pFollowOfNew)
+ rNewSheet.SetFollow(rFollowName);
+ }
+ }
+
+ SetModified( TRUE );
+ if( !bUsedOrUserDefined ) nIdx2 = nIdx1 = INDEX_IGNORE;
+
+ bRet = TRUE;
+ }
+ else
+ bRet = FALSE;
+ }
+ else if (nSourceIdx1 == CONTENT_CONFIG)
+ {
+ nIdx1 = CONTENT_CONFIG;
+
+ SfxConfigManager *pCfgMgr = SFX_CFGMANAGER();
+ if (!GetConfigManager() || HasTemplateConfig())
+ {
+ SetConfigManager(new SfxConfigManager(0, pCfgMgr));
+ SetTemplateConfig(FALSE);
+ if (this == Current())
+ GetConfigManager()->Activate(pCfgMgr);
+ }
+
+ if (GetConfigManager()->CopyItem(
+ nSourceIdx2, nIdx2, rSource.GetConfigManager()))
+ {
+ SetModified(TRUE);
+ bRet = TRUE;
+ SFX_APP()->GetDispatcher_Impl()->Update_Impl(TRUE);
+ }
+ }
+
+ return bRet;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxObjectShell::Remove
+(
+ USHORT nIdx1,
+ USHORT nIdx2,
+ USHORT nIdx3
+)
+{
+ BOOL bRet = FALSE;
+
+ if (CONTENT_STYLE == nIdx1)
+ {
+ SfxStyleSheetBasePool* pMyPool = GetStyleSheetPool();
+
+ SetOrganizerSearchMask(pMyPool);
+
+ SfxStyleSheetBase* pMySheet = (*pMyPool)[nIdx2];
+ String aName(pMySheet->GetName());
+ String aEmpty;
+ SfxStyleFamily eFamily = pMySheet->GetFamily();
+ if (pMySheet)
+ {
+ pMyPool->Erase(pMySheet);
+ bRet = TRUE;
+ }
+
+ SfxStyleSheetBase* pTestSheet = pMyPool->First();
+ while (pTestSheet)
+ {
+ if (pTestSheet->GetFamily() == eFamily &&
+ pTestSheet->HasParentSupport() &&
+ pTestSheet->GetParent() == aName)
+ {
+ pTestSheet->SetParent(aEmpty); // Verknuepfung aufloesen
+ }
+
+ if (pTestSheet->GetFamily() == eFamily &&
+ pTestSheet->HasFollowSupport() &&
+ pTestSheet->GetFollow() == aName)
+ {
+ pTestSheet->SetFollow(aEmpty); // Verknuepfung aufloesen
+ }
+
+ pTestSheet = pMyPool->Next();
+ }
+ if(bRet)
+ SetModified( TRUE );
+ }
+ else if (nIdx1 == CONTENT_CONFIG)
+ {
+ if (GetConfigManager()->RemoveItem(nIdx2))
+ {
+ SetModified(TRUE);
+ bRet = TRUE;
+ SFX_APP()->GetDispatcher_Impl()->Update_Impl(TRUE);
+ }
+ }
+ return bRet;
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxObjectShell::Print
+(
+ Printer& rPrt,
+ USHORT nIdx1,
+ USHORT nIdx2,
+ USHORT nIdx3,
+ const String* pObjectName
+)
+
+/* [Beschreibung]
+*/
+
+{
+ switch(nIdx1)
+ {
+ case CONTENT_STYLE:
+ {
+ SfxStyleSheetBasePool *pPool = GetStyleSheetPool();
+ SetOrganizerSearchMask(pPool);
+ SfxStyleSheetIterator* pIter = pPool->CreateIterator(
+ pPool->GetSearchFamily(), pPool->GetSearchMask() );
+ USHORT nStyles = pIter->Count();
+ SfxStyleSheetBase *pStyle = pIter->First();
+ if ( !pStyle )
+ return TRUE;
+
+ if ( !rPrt.StartJob(String(SfxResId(STR_STYLES))) )
+ {
+ delete pIter;
+ return FALSE;
+ }
+ if ( !rPrt.StartPage() )
+ {
+ delete pIter;
+ return FALSE;
+ }
+ SfxStatusBarManager* pStbMgr = SFX_APP()->GetStatusBarManager();
+ if ( pStbMgr )
+ pStbMgr->StartProgressMode(String(SfxResId(STR_PRINT_STYLES)), nStyles);
+ rPrt.SetMapMode(MapMode(MAP_10TH_MM));
+ Font aFont( DEFINE_CONST_UNICODE( "Arial" ), Size(0, 64)); // 18pt
+ aFont.SetWeight(WEIGHT_BOLD);
+ rPrt.SetFont(aFont);
+ const Size aPageSize(rPrt.GetOutputSize());
+ const USHORT nXIndent = 200;
+ USHORT nYIndent = 200;
+ Point aOutPos(nXIndent, nYIndent);
+ String aHeader(SfxResId(STR_PRINT_STYLES_HEADER));
+ if ( pObjectName )
+ aHeader += *pObjectName;
+ else
+ aHeader += GetTitle();
+ ULONG nTextHeight( rPrt.GetTextHeight() );
+ rPrt.DrawText(aOutPos, aHeader);
+ aOutPos.Y() += nTextHeight;
+ aOutPos.Y() += nTextHeight/2;
+ aFont.SetSize(Size(0, 35)); // 10pt
+ nStyles = 1;
+ while(pStyle)
+ {
+ if(pStbMgr)
+ pStbMgr->SetProgressState(nStyles++);
+ // Ausgabe des Vorlagennamens
+ String aStr(pStyle->GetName());
+ aFont.SetWeight(WEIGHT_BOLD);
+ rPrt.SetFont(aFont);
+ nTextHeight = rPrt.GetTextHeight();
+ // Seitenwechsel
+ if ( aOutPos.Y() + nTextHeight*2 >
+ aPageSize.Height() - nYIndent )
+ {
+ rPrt.EndPage();
+ rPrt.StartPage();
+ aOutPos.Y() = nYIndent;
+ }
+ rPrt.DrawText(aOutPos, aStr);
+ aOutPos.Y() += nTextHeight;
+
+ // Ausgabe der Vorlagenbeschreibung
+ aFont.SetWeight(WEIGHT_NORMAL);
+ rPrt.SetFont(aFont);
+ aStr = pStyle->GetDescription();
+ const char cDelim = ' ';
+ USHORT nStart = 0, nIdx = 0;
+
+ nTextHeight = rPrt.GetTextHeight();
+ // wie viele Worte passen auf eine Zeile
+ while(nIdx < aStr.Len())
+ {
+ USHORT nOld = nIdx;
+ ULONG nTextWidth;
+ nIdx = aStr.Search(cDelim, nStart);
+ nTextWidth = rPrt.GetTextWidth(aStr, nStart, nIdx-nStart);
+ while(nIdx != STRING_NOTFOUND &&
+ aOutPos.X() + nTextWidth <
+ aPageSize.Width() - nXIndent)
+ {
+ nOld = nIdx;
+ nIdx = aStr.Search(cDelim, nIdx+1);
+ nTextWidth = rPrt.GetTextWidth(aStr, nStart, nIdx-nStart);
+ }
+ String aTmp(aStr, nStart, nIdx == STRING_NOTFOUND?
+ STRING_LEN :
+ nOld-nStart);
+ if ( aTmp.Len() )
+ {
+ nStart = nOld+1; // wegen trailing space
+ }
+ else
+ {
+ USHORT nChar = 1;
+ while(
+ nStart + nChar < aStr.Len() &&
+ aOutPos.X() + rPrt.GetTextWidth(
+ aStr, nStart, nChar) <
+ aPageSize.Width() - nXIndent)
+ ++nChar;
+ aTmp = String(aStr, nStart, nChar-1);
+ nIdx = nStart + nChar;
+ nStart = nIdx;
+ }
+ if ( aOutPos.Y() + nTextHeight*2 >
+ aPageSize.Height() - nYIndent )
+ {
+ rPrt.EndPage();
+ rPrt.StartPage();
+ aOutPos.Y() = nYIndent;
+ }
+ rPrt.DrawText(aOutPos, aTmp);
+ aOutPos.Y() += rPrt.GetTextHeight();
+ }
+ pStyle = pIter->Next();
+ }
+ rPrt.EndPage();
+ rPrt.EndJob();
+ if ( pStbMgr )
+ pStbMgr->EndProgressMode();
+ delete pIter;
+ break;
+ }
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::LoadStyles
+(
+ SfxObjectShell &rSource /* die Dokument-Vorlage, aus der
+ die Styles geladen werden sollen */
+)
+
+/* [Beschreibung]
+
+ Diese Methode wird vom SFx gerufen, wenn aus einer Dokument-Vorlage
+ Styles nachgeladen werden sollen. Bestehende Styles soll dabei
+ "uberschrieben werden. Das Dokument mu"s daher neu formatiert werden.
+ Daher werden die Applikationen in der Regel diese Methode "uberladen
+ und in ihrer Implementierung die Implementierung der Basisklasse
+ rufen.
+*/
+
+{
+ struct Styles_Impl
+ {
+ SfxStyleSheetBase *pSource;
+ SfxStyleSheetBase *pDest;
+// Styles_Impl () : pSource(0), pDest(0) {}
+ };
+
+ SfxStyleSheetBasePool *pSourcePool = rSource.GetStyleSheetPool();
+ DBG_ASSERT(pSourcePool, "Source-DocumentShell ohne StyleSheetPool");
+ SfxStyleSheetBasePool *pMyPool = GetStyleSheetPool();
+ DBG_ASSERT(pMyPool, "Dest-DocumentShell ohne StyleSheetPool");
+ pSourcePool->SetSearchMask(SFX_STYLE_FAMILY_ALL, 0xffff);
+ Styles_Impl *pFound = new Styles_Impl[pSourcePool->Count()];
+ USHORT nFound = 0;
+
+ SfxStyleSheetBase *pSource = pSourcePool->First();
+ while ( pSource )
+ {
+ SfxStyleSheetBase *pDest =
+ pMyPool->Find( pSource->GetName(), pSource->GetFamily() );
+ if ( !pDest )
+ {
+ pDest = &pMyPool->Make( pSource->GetName(),
+ pSource->GetFamily(), pSource->GetMask());
+ // Setzen des Parents, der Folgevorlage
+ }
+ pFound[nFound].pSource = pSource;
+ pFound[nFound].pDest = pDest;
+ ++nFound;
+ pSource = pSourcePool->Next();
+ }
+
+ for ( USHORT i = 0; i < nFound; ++i )
+ {
+ pFound[i].pDest->GetItemSet().PutExtended(pFound[i].pSource->GetItemSet(), SFX_ITEM_DONTCARE, SFX_ITEM_DEFAULT);
+// pFound[i].pDest->SetHelpId(pFound[i].pSource->GetHelpId());
+ if(pFound[i].pSource->HasParentSupport())
+ pFound[i].pDest->SetParent(pFound[i].pSource->GetParent());
+ if(pFound[i].pSource->HasFollowSupport())
+ pFound[i].pDest->SetFollow(pFound[i].pSource->GetParent());
+ }
+ delete pFound;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::UpdateFromTemplate_Impl( )
+
+/* [Beschreibung]
+
+ Diese interne Methode pr"uft, ob das Dokument aus einem Template
+ erzeugt wurde, und ob dieses neuer ist als das Dokument. Ist dies
+ der Fall, wird der Benutzer gefragt, ob die Vorlagen (StyleSheets)
+ updated werden sollen. Wird dies positiv beantwortet, werden die
+ StyleSheets updated.
+*/
+
+{
+ // Storage-medium?
+ SfxMedium *pFile = GetMedium();
+ DBG_ASSERT( pFile, "cannot UpdateFromTemplate without medium" );
+
+ // only for own storage formats
+ SvStorageRef xDocStor = pFile && pFile->IsStorage() ? pFile->GetStorage() : 0;
+ if ( !xDocStor.Is() || !pFile->GetFilter() || !pFile->GetFilter()->IsOwnFormat() )
+ return;
+
+ // created from template?
+ SfxDocumentInfo *pInfo = &GetDocInfo();
+ String aTemplName( pInfo->GetTemplateName() );
+ String aTemplFileName( pInfo->GetTemplateFileName() );
+ String aFoundName;
+ SvStorageRef aTemplStor;
+ if ( aTemplName.Len() || aTemplFileName.Len() )
+ {
+ // try to locate template, first using filename
+ // this must be done because writer global document uses this "great" idea to manage the templates of all parts
+ // in the master document
+ // but it is NOT an error if the template filename points not to a valid file
+ SfxDocumentTemplates aTempl;
+ aTempl.Construct();
+ if ( aTemplFileName.Len() && !IsReadOnly() )
+ {
+ INetURLObject aURL( aTemplFileName, INET_PROT_FILE );
+ aTemplStor = new SvStorage( aURL.GetMainURL(),
+ STREAM_READ | STREAM_NOCREATE |
+ STREAM_SHARE_DENYWRITE, STORAGE_TRANSACTED );
+ if ( aTemplStor->GetError() )
+ aTemplStor.Clear();
+ else
+ aFoundName = aTemplFileName;
+ }
+
+ // if the template filename did not lead to success, try the template logical name
+ if( !aFoundName.Len() && aTempl.GetFull( String(), aTemplName, aFoundName ) && !IsReadOnly() )
+ {
+ // template found, check if comparing filenames is enabled
+ if( (USHORT)SFX_INIMANAGER()->Get( SFX_KEY_SEARCHTEMPLATE ).ToInt32() && aTemplFileName != aFoundName )
+ {
+ // template with given template name was found but with a different filename
+ SfxMedium aSfxMedium( aFoundName, STREAM_READ | STREAM_SHARE_DENYNONE, FALSE );
+ const SfxFilter* pFilter = NULL;
+ SFX_APP()->GetFilterMatcher().GuessFilter( aSfxMedium, &pFilter, SFX_FILTER_IMPORT | SFX_FILTER_TEMPLATE );
+ if ( pFilter && pFilter->GetFilterContainer() == pFile->GetFilter()->GetFilterContainer() )
+ {
+ String aMsg( SfxResId( STR_TEMPL_MOVED ) );
+ aMsg.SearchAndReplace( DEFINE_CONST_UNICODE( "$(TEMPLATE)" ), aTemplName );
+ aMsg.SearchAndReplace( DEFINE_CONST_UNICODE( "$(FOUND)" ), aFoundName );
+ if( QueryBox( 0, WB_YES_NO, aMsg ).Execute() == RET_YES )
+ {
+ pInfo->SetTemplateFileName( aFoundName );
+ FlushDocInfo();
+ SetModified( TRUE );
+ }
+ else
+ aFoundName.Erase();
+ }
+ else
+ aFoundName.Erase();
+ }
+ }
+ else if ( !IsReadOnly() )
+ {
+ // template not found, ask user for removing template link
+ String aMsg( SfxResId( STR_TEMPL_RESET ) );
+ aMsg.SearchAndReplace( DEFINE_CONST_UNICODE( "$(TEMPLATE)" ), aTemplName );
+ if( QueryBox( 0, WB_YES_NO, aMsg ).Execute() == RET_NO )
+ {
+ String aStr;
+ pInfo->SetTemplateFileName( aStr );
+ pInfo->SetTemplateName( aStr );
+ FlushDocInfo();
+ SetModified( TRUE );
+ }
+ }
+ }
+
+ if ( aFoundName.Len() )
+ {
+ aTemplFileName = aFoundName;
+ BOOL bLoad = FALSE;
+ INetURLObject aURL( aTemplFileName, INET_PROT_FILE );
+ if ( !aTemplStor.Is() )
+ aTemplStor = new SvStorage( aURL.GetMainURL(),
+ STREAM_READ | STREAM_NOCREATE |
+ STREAM_SHARE_DENYWRITE, STORAGE_TRANSACTED );
+
+ if ( !aTemplStor->GetError() )
+ {
+ // Template-DocInfo laden
+ SfxDocumentInfo *pTemplInfo = new SfxDocumentInfo;
+ DateTime aTemplDate;
+ if ( pTemplInfo->Load(aTemplStor) )
+ aTemplDate = pTemplInfo->GetChanged().GetTime();
+
+ // soll der Benutzer gefragt werden?
+ if ( pInfo->IsQueryLoadTemplate() )
+ {
+ // ist das Template neuer?
+ const DateTime aInfoDate( pInfo->GetTemplateDate(),
+ pInfo->GetTemplateDate() );
+ if ( aTemplDate > aInfoDate )
+ {
+ // Benutzer fragen, ob update
+ QueryBox aBox( 0, SfxResId(MSG_QUERY_LOAD_TEMPLATE) );
+ if ( RET_YES == aBox.Execute() )
+ bLoad = TRUE;
+ else
+ {
+ // nein => am Doc merken, da\s nie wieder gefragt wird
+ pInfo->SetQueryLoadTemplate(FALSE);
+ pInfo->Save(xDocStor);
+ }
+ }
+ }
+
+ // StyleSheets aus Template updaten?
+ SfxConfigManager *pCfgMgr = SFX_CFGMANAGER();
+ if ( bLoad )
+ {
+ // Document-Instanz f"ur das Template erzeugen und laden
+ SfxObjectShellLock xTemplDoc =
+ GetFactory().CreateObject(SFX_CREATE_MODE_ORGANIZER);
+ xTemplDoc->DoInitNew(0);
+ String aOldBaseURL = INetURLObject::GetBaseURL();
+ INetURLObject::SetBaseURL( INetURLObject( aTemplFileName, INET_PROT_FILE ).GetMainURL() );
+ if ( xTemplDoc->LoadFrom(aTemplStor) )
+ {
+ // StyleSheets ins eigene Doc laden
+ LoadStyles(*xTemplDoc);
+
+ // Update im Doc merken
+ pInfo->SetTemplateDate(aTemplDate);
+ pInfo->Save(xDocStor);
+ }
+
+ INetURLObject::SetBaseURL( aOldBaseURL );
+ }
+/*
+ // Config aus Template laden?
+ BOOL bConfig = pInfo->HasTemplateConfig();
+ {
+ // Config-Manager aus Template-Storage erzeugen
+ SfxConfigManager *pTemplCfg = new SfxConfigManager(aTemplStor, pCfgMgr);
+ SetConfigManager(pTemplCfg);
+ SetTemplateConfig(TRUE);
+
+ // Falls der gerade zerst"orte CfgMgr des Dokuments der
+ // aktive war, pCfgMgr lieber neu holen
+ pCfgMgr = SFX_CFGMANAGER();
+
+ // ggf. den neuen ConfigManager aktivieren
+ if ( this == SfxObjectShell::Current() )
+ pTemplCfg->Activate(pCfgMgr);
+ }
+*/
+ // Template und Template-DocInfo werden nicht mehr gebraucht
+ delete pTemplInfo;
+ }
+ }
+}
+
+SfxEventConfigItem_Impl* SfxObjectShell::GetEventConfig_Impl( BOOL bForce )
+{
+ SfxApplication *pApp = SFX_APP();
+
+ if ( bForce || pImp->pCfgMgr )
+ {
+ // Wenn kein bForce, aber es eine DocConfig gibt, mu\s auch eine
+ // EventConfig angelegt werden
+ if ( !pImp->pCfgMgr )
+ {
+ // Es soll eine EventConfig konfiguriert werden, dazu mu\s sie am
+ // ConfigManager des Dokuments h"angen
+ SfxConfigManager *pMgr = pApp->GetConfigManager();
+ SetConfigManager( new SfxConfigManager( 0, pMgr ) );
+ if ( this == SfxObjectShell::Current() )
+ pImp->pCfgMgr->Activate( pMgr );
+ }
+
+ // Gegebenenfalls EventConfig erzeugen und ans Dokument konfigurieren
+ if ( !pImp->pEventConfig )
+ {
+ pImp->pEventConfig =
+ new SfxEventConfigItem_Impl( SFX_ITEMTYPE_DOCEVENTCONFIG,
+ pApp->GetEventConfig() );
+ pImp->pEventConfig->Init( pImp->pCfgMgr );
+ }
+ }
+
+ return pImp->pEventConfig;
+}
+
+
diff --git a/sfx2/source/doc/objitem.cxx b/sfx2/source/doc/objitem.cxx
new file mode 100644
index 000000000000..0293bdb69e28
--- /dev/null
+++ b/sfx2/source/doc/objitem.cxx
@@ -0,0 +1,116 @@
+/*************************************************************************
+ *
+ * $RCSfile: objitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "objsh.hxx"
+//#include "objshimp.hxx"
+#include "objitem.hxx"
+
+//====================================================================
+
+TYPEINIT1(SfxObjectShellItem,SfxPoolItem)
+TYPEINIT1_AUTOFACTORY(SfxObjectItem,SfxPoolItem)
+
+//=========================================================================
+
+int SfxObjectShellItem::operator==( const SfxPoolItem &rItem ) const
+{
+ return PTR_CAST(SfxObjectShellItem, &rItem)->pObjSh == pObjSh;
+}
+
+//--------------------------------------------------------------------
+
+String SfxObjectShellItem::GetValueText() const
+{
+ return String();
+}
+
+//--------------------------------------------------------------------
+
+SfxPoolItem* SfxObjectShellItem::Clone( SfxItemPool *) const
+{
+ return new SfxObjectShellItem( Which(), pObjSh );
+}
+
+//=========================================================================
+
+SfxObjectItem::SfxObjectItem( USHORT nWhich, SfxShell *pSh )
+: SfxPoolItem( nWhich ),
+ _pSh( pSh )
+{}
+
+//--------------------------------------------------------------------
+
+int SfxObjectItem::operator==( const SfxPoolItem &rItem ) const
+{
+ SfxObjectItem *pOther = PTR_CAST(SfxObjectItem, &rItem);
+ return pOther->_pSh == _pSh;
+}
+
+//--------------------------------------------------------------------
+
+SfxPoolItem* SfxObjectItem::Clone( SfxItemPool *) const
+{
+ return new SfxObjectItem( Which(), _pSh );
+}
+
+
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
new file mode 100644
index 000000000000..73a67c4dc930
--- /dev/null
+++ b/sfx2/source/doc/objmisc.cxx
@@ -0,0 +1,1452 @@
+/*************************************************************************
+ *
+ * $RCSfile: objmisc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _INETMSG_HXX //autogen
+#include <svtools/inetmsg.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _SV_DRAG_HXX //autogen
+#include <vcl/drag.hxx>
+#endif
+#include <so3/inetbnd.hxx>
+#include <vos/mutex.hxx>
+
+#pragma hdrstop
+
+#ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
+#include <com/sun/star/script/XTypeConverter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_FINISHENGINEEVENT_HPP_
+#include <com/sun/star/script/FinishEngineEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_INTERRUPTREASON_HPP_
+#include <com/sun/star/script/InterruptReason.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XENGINELISTENER_HPP_
+#include <com/sun/star/script/XEngineListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XDEBUGGING_HPP_
+#include <com/sun/star/script/XDebugging.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XINVOKATION_HPP_
+#include <com/sun/star/script/XInvocation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_CONTEXTINFORMATION_HPP_
+#include <com/sun/star/script/ContextInformation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_FINISHREASON_HPP_
+#include <com/sun/star/script/FinishReason.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XENGINE_HPP_
+#include <com/sun/star/script/XEngine.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_INTERRUPTENGINEEVENT_HPP_
+#include <com/sun/star/script/InterruptEngineEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SCRIPT_XLIBRARYACCESS_HPP_
+#include <com/sun/star/script/XLibraryAccess.hpp>
+#endif
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/Any.h>
+#include <com/sun/star/ucb/XContent.hpp>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+
+#ifndef _SB_SBUNO_HXX
+#include <basic/sbuno.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _SB_BASMGR_HXX
+#include <basic/basmgr.hxx>
+#endif
+#ifndef _VCL_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SBXCLASS_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#include "appdata.hxx"
+#include "request.hxx"
+#include "bindings.hxx"
+#include "sfxresid.hxx"
+#include "docfile.hxx"
+#include "docinf.hxx"
+#include "docfilt.hxx"
+#include "interno.hxx"
+#include "objsh.hxx"
+#include "objshimp.hxx"
+#include "event.hxx"
+#include "fltfnc.hxx"
+#include "sfx.hrc"
+#include "dispatch.hxx"
+#include "viewfrm.hxx"
+#include "viewsh.hxx"
+#include "ctrlitem.hxx"
+#include "arrdecl.hxx"
+#include "module.hxx"
+#include "macrconf.hxx"
+#include "docfac.hxx"
+#include "inimgr.hxx"
+#include "ucbhelp.hxx"
+#include "helper.hxx"
+
+// class SfxHeaderAttributes_Impl ----------------------------------------
+
+class SfxHeaderAttributes_Impl : public SvKeyValueIterator
+{
+private:
+ SfxObjectShell* pDoc;
+ SvKeyValueIteratorRef xIter;
+ sal_Bool bAlert;
+
+public:
+ SfxHeaderAttributes_Impl( SfxObjectShell* pSh ) :
+ pDoc( pSh ), SvKeyValueIterator(),
+ xIter( pSh->GetMedium()->GetHeaderAttributes_Impl() ),
+ bAlert( sal_False ) {}
+
+ virtual sal_Bool GetFirst( SvKeyValue& rKV ) { return xIter->GetFirst( rKV ); }
+ virtual sal_Bool GetNext( SvKeyValue& rKV ) { return xIter->GetNext( rKV ); }
+ virtual void Append( const SvKeyValue& rKV );
+
+ void ClearForSourceView() { xIter = new SvKeyValueIterator; bAlert = sal_False; }
+ void SetAttributes();
+ void SetAttribute( const SvKeyValue& rKV );
+};
+
+//=========================================================================
+
+sal_uInt16 __READONLY_DATA aTitleMap_Impl[3][2] =
+{
+ // local remote
+ /* SFX_TITLE_CAPTION */ { SFX_TITLE_FILENAME, SFX_TITLE_TITLE },
+#ifdef MAC
+ /* SFX_TITLE_PICKLIST */ { SFX_TITLE_FILENAME, SFX_TITLE_FULLNAME },
+#else
+ /* SFX_TITLE_PICKLIST */ { 32, SFX_TITLE_FULLNAME },
+#endif
+ /* SFX_TITLE_HISTORY */ { 32, SFX_TITLE_FULLNAME }
+};
+
+//=========================================================================
+
+void SfxObjectShell::AbortImport()
+{
+ pImp->bIsAbortingImport = sal_True;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsAbortingImport() const
+{
+ return pImp->bIsAbortingImport;
+}
+
+//-------------------------------------------------------------------------
+
+#if SUPD<604
+void SfxObjectShell::NotifyReloadAvailable()
+{
+}
+#endif
+
+//-------------------------------------------------------------------------
+
+SfxDocumentInfo& SfxObjectShell::GetDocInfo()
+{
+ if( !pImp->pDocInfo )
+ {
+ pImp->pDocInfo = new SfxDocumentInfo;
+ pImp->pDocInfo->SetReadOnly( IsReadOnly() );
+ }
+
+ return *pImp->pDocInfo;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::FlushDocInfo()
+{
+ SetModified(sal_True);
+ SfxDocumentInfo &rInfo = GetDocInfo();
+ Broadcast( SfxDocumentInfoHint( &rInfo ) );
+ SetAutoLoad( rInfo.GetReloadURL(), rInfo.GetReloadDelay() * 1000,
+ rInfo.IsReloadEnabled() );
+
+ // bitte beachten:
+ // 1. Titel in DocInfo aber nicht am Doc (nach HTML-Import)
+ // => auch am Doc setzen
+ // 2. Titel in DocInfo leer (Briefumschlagsdruck)
+ // => nicht am Doc setzen, da sonst "unbenanntX" daraus wird
+ String aDocInfoTitle = GetDocInfo().GetTitle();
+ if ( aDocInfoTitle.Len() )
+ SetTitle( aDocInfoTitle );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetError(sal_uInt32 lErr)
+{
+ if(pImp->lErr==ERRCODE_NONE)
+ pImp->lErr=lErr;
+}
+
+//-------------------------------------------------------------------------
+
+sal_uInt32 SfxObjectShell::GetError() const
+{
+ return ERRCODE_TOERROR(GetErrorCode());
+}
+
+//-------------------------------------------------------------------------
+
+sal_uInt32 SfxObjectShell::GetErrorCode() const
+{
+ sal_uInt32 lError=pImp->lErr;
+ if(!lError && GetMedium())
+ lError=GetMedium()->GetErrorCode();
+ if(!lError && HasStorage())
+ lError= GetStorage()->GetErrorCode();
+ return lError;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::ResetError()
+{
+ pImp->lErr=0;
+ SfxMedium * pMed = GetMedium();
+ if( pMed )
+ pMed->ResetError();
+ SvStorage *pStor= HasStorage() ? GetStorage() : 0;
+ if( pStor )
+ pStor->ResetError();
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsTemplate() const
+{
+ return pImp->bIsTemplate;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetTemplate(sal_Bool bIs)
+{
+ pImp->bIsTemplate=bIs;
+ SfxFilterMatcher aMatcher( GetFactory().GetFilterContainer() );
+ SfxFilterMatcherIter aIter( &aMatcher, SFX_FILTER_TEMPLATEPATH );
+ SfxMedium* pMed = GetMedium();
+ if( pMed ) pMed->SetFilter( aIter.First() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::ModifyChanged()
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode wird aus der virtuellen Basisklasse SvPersist
+ gerufen, wenn sich das Modified-Flag ge"andert hat. Diese Querverbindung
+ ist notwendig, da aus einem Zweig einer virtuellen Vererbung nicht
+ quer un den anderen gerufen werden kann.
+*/
+
+{
+ if ( pImp->bClosing )
+ // SetModified aus dem dispose des Models!
+ return;
+
+ {DBG_CHKTHIS(SfxObjectShell, 0);}
+ SfxObjectShell *pDoc;
+ for ( pDoc = SfxObjectShell::GetFirst(); pDoc;
+ pDoc = SfxObjectShell::GetNext(*pDoc) )
+ if( pDoc->IsModified() )
+ break;
+ SfxApplication *pSfxApp = SFX_APP();
+ Timer *pTimer = pSfxApp->GetAutoSaveTimer_Impl();
+ if( pDoc )
+ {
+ if( !pTimer->IsActive() )
+ pTimer->Start();
+ }
+ else
+ pTimer->Stop();
+
+ SfxViewFrame* pViewFrame = SfxViewFrame::Current();
+ if ( pViewFrame )
+ pViewFrame->GetBindings().Invalidate( SID_SAVEDOCS );
+
+ pSfxApp->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, this ) );
+}
+
+//--------------------------------------------------------------------
+
+SfxInPlaceObject* SfxObjectShell::GetInPlaceObject() const
+{
+ if( !pImp->pInPlaceObj && !pImp->bSetInPlaceObj )
+ {
+ // try to cast
+ SvInPlaceObjectRef xSvIP( (SfxObjectShell *)this );
+ if ( xSvIP.Is() )
+ pImp->pInPlaceObj = (SfxInPlaceObject*) &xSvIP;
+ pImp->bSetInPlaceObj = sal_True;
+ }
+ return pImp->pInPlaceObj;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsReadOnlyUI() const
+
+/* [Beschreibung]
+
+ Liefert sal_True, wenn das Dokument fuer die UI wie r/o behandelt werden
+ soll. Dieses ist unabhaengig vom tatsaechlichen r/o, welches per
+ <IsReadOnly()> erfragbar ist.
+*/
+
+{
+ return pImp->bReadOnlyUI;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsReadOnlyMedium() const
+
+/* [Beschreibung]
+
+ Liefert sal_True, wenn das Medium r/o ist bzw. r/o geoeffnet wurde.
+*/
+
+{
+ if ( !pMedium )
+ return sal_True;
+ return pMedium->IsReadOnly();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetReadOnlyUI( sal_Bool bReadOnly )
+
+/* [Beschreibung]
+
+ Schaltet das Dokument in einen r/o bzw. r/w Zustand ohne es neu
+ zu laden und ohne die Open-Modi des Mediums zu aendern.
+*/
+
+{
+ sal_Bool bWasRO = IsReadOnly();
+ pImp->bReadOnlyUI = bReadOnly;
+ if ( bWasRO != IsReadOnly() )
+ {
+ Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ if ( pImp->pDocInfo )
+ pImp->pDocInfo->SetReadOnly( IsReadOnly() );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsReadOnly() const
+{
+ return pImp->bReadOnlyUI || IsReadOnlyMedium();
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsInModalMode() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert sal_True, falls in einer ::com::sun::star::sdbcx::View auf dieses Dokument
+ ein modaler Dialog exitiert, sonst sal_False.
+*/
+
+{
+ return pImp->bModalMode;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsInAPICall() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert sal_True, falls z.B. ein zur Zeit durchzufuehrendes
+ ConvertFrom (oder andere Callbacks) von der API gerufen werden. Dann
+ duefen keine Dialoge gestartet werden.
+*/
+
+{
+ return pImp->bSilent;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetModalMode_Impl( sal_Bool bModal )
+{
+ // nur Broadcasten wenn modifiziert, sonst ggf. Endlosrekursion
+ if ( !pImp->bModalMode != !bModal )
+ {
+ // zentral mitz"ahlen
+ sal_uInt16 &rDocModalCount = SFX_APP()->Get_Impl()->nDocModalMode;
+ if ( bModal )
+ ++rDocModalCount;
+ else
+ --rDocModalCount;
+
+ // umschalten
+ pImp->bModalMode = bModal;
+ Broadcast( SfxSimpleHint( SFX_HINT_MODECHANGED ) );
+ }
+}
+
+//--------------------------------------------------------------------
+
+Size SfxObjectShell::GetFirstPageSize()
+{
+ Size aRet;
+ SfxInPlaceObject *pIpObj = GetInPlaceObject();
+ if ( pIpObj )
+ aRet = pIpObj->GetVisArea(ASPECT_THUMBNAIL).GetSize();
+ return aRet;
+}
+
+
+//--------------------------------------------------------------------
+
+IndexBitSet& SfxObjectShell::GetNoSet_Impl()
+{
+ return pImp->aBitSet;
+}
+
+//--------------------------------------------------------------------
+// changes the title of the document
+
+void SfxObjectShell::SetTitle
+(
+ const String& rTitle // der neue Titel des Dokuments
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode kann der Titel des Dokuments gesetzt werden.
+ Dieser entspricht initial dem kompletten Dateinamen. Ein Setzen
+ des Titels wirkt jedoch nicht zu"uck auf den Dateinamen; er wird
+ jedoch in den Caption-Bars der MDI-Fenster angezeigt.
+*/
+
+{
+ DBG_CHKTHIS(SfxObjectShell, 0);
+
+ // nix zu tun?
+ if ( ( HasName() && pImp->aTitle == rTitle ) ||
+ ( !HasName() && GetTitle() == rTitle ) )
+ return;
+
+ SfxApplication *pSfxApp = SFX_APP();
+#if 0
+ // wird 'unbenannt#' als Titel gesetzt
+ String aNoName(SfxResId(STR_NONAME));
+ if ( rTitle.Match(aNoName) <= aNoName.Len() )
+ {
+ // er ist es selbst => ignorieren
+ pSfxApp->ReleaseIndex(pImp->nVisualDocumentNumber);
+ pImp->bIsNamedVisible=0;
+ }
+#endif
+
+ // ggf. die unbenannt-Nummer freigeben
+ if ( pImp->bIsNamedVisible && USHRT_MAX != pImp->nVisualDocumentNumber )
+ {
+ pSfxApp->ReleaseIndex(pImp->nVisualDocumentNumber);
+ pImp->bIsNamedVisible = 0;
+ }
+
+ // Title setzen
+ pImp->aTitle = rTitle;
+// Wieso denn in der DocInfo?
+// GetDocInfo().SetTitle( rTitle );
+// FlushDocInfo();
+
+ // Benachrichtigungen
+ SfxShell::SetName( GetTitle(SFX_TITLE_APINAME) );
+ Broadcast( SfxSimpleHint(SFX_HINT_TITLECHANGED) );
+}
+
+//--------------------------------------------------------------------
+
+#ifdef DEBUG
+String X(const String &rRet)
+{
+ if ( !rRet.Len() )
+ return DEFINE_CONST_UNICODE( "-empty-" );
+ return rRet;
+}
+#else
+#define X(ret) ret
+#endif
+
+//--------------------------------------------------------------------
+String SfxObjectShell::GetTitle
+(
+ sal_uInt16 nMaxLength /* 0 (default)
+ der Titel selbst, so wie er ist
+
+ 1 (==SFX_TITLE_FILENAME)
+ liefert den logischen Dateinamen ohne Pfad
+ (unter WNT je nach Systemeinstellung ohne
+ Extension)
+
+ 2 (==SFX_TITLE_FULLNAME)
+ liefert den mit komplettem logischen Dateinamen
+ mit Pfad (remote => ::com::sun::star::util::URL)
+
+ 3 (==SFX_TITLE_APINAME)
+ liefert den logischen Dateinamen ohne Pfad
+ und Extension
+
+ 4 (==SFX_TITLE_DETECT)
+ liefert den kompletten Titel, falls noch
+ nicht gesetzt wird aber aus DocInfo oder
+ dem Namen des Medium erzeugt
+
+ 5 (==SFX_TITLE_CAPTION)
+ liefert den Titel so, wie MB ihn heute in
+ der CaptionBar anzeigen m"ochte
+
+ 6 (==SFX_TITLE_PICKLIST)
+ liefert den Titel so, wie MB ihn heute in
+ der PickList anzeigen m"ochte
+
+ 7 (==SFX_TITLE_HISTORY)
+ liefert den Titel so, wie MB ihn heute in
+ der History anzeigen m"ochte
+
+ 10 bis USHRT_MAX
+ liefert maximal 'nMaxLength' Zeichen vom logischen
+ Dateinamen inkl. Pfad (remote => ::com::sun::star::util::URL)
+ */
+) const
+
+/* [Beschreibung]
+
+ Liefert den Titel bzw. logischen Dateinamen des Dokuments, je nach
+ 'nMaxLength'.
+
+ Falls der Dateiname mit Pfad verwendet wird, wird die Namensk"urzung durch
+ Ersetzung eines oder mehrerer Directory-Namen durch "..." durchgef"uhrt,
+ URLs werden z.Zt. immer komplett geliefert.
+*/
+
+{
+// if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+// return String();
+
+ // Titel erzeugen?
+ if ( SFX_TITLE_DETECT == nMaxLength && !pImp->aTitle.Len() )
+ {
+ static sal_Bool bRecur = sal_False;
+ if ( bRecur )
+ return DEFINE_CONST_UNICODE( "-not available-" );
+ bRecur = sal_True;
+
+ // evtl. ist Titel aus DocInfo verwendbar
+ SfxObjectShell *pThis = (SfxObjectShell*) this;
+ String aTitle = pThis->GetDocInfo().GetTitle();
+ aTitle.EraseLeadingChars();
+ aTitle.EraseTrailingChars();
+ if ( !aTitle.Len() )
+ // sonst wie SFX_TITLE_FILENAME
+ aTitle = GetTitle( SFX_TITLE_FILENAME );
+ pThis->SetTitle( aTitle );
+ bRecur = sal_False;
+ return X(aTitle);
+ }
+ else if (SFX_TITLE_APINAME == nMaxLength )
+ return X(GetAPIName());
+
+ // Sonderfall Vorlagen:
+ if( IsTemplate() && pImp->aTitle.Len() &&
+ ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) )
+ return X(pImp->aTitle);
+
+ // Picklist/Caption wird gemappt
+ SfxMedium *pMed = GetMedium();
+ if ( pMed && ( nMaxLength == SFX_TITLE_CAPTION || nMaxLength == SFX_TITLE_PICKLIST ) )
+ {
+ // Wenn ein spezieller Titel beim "Offnen mitgegebent wurde;
+ // wichtig bei URLs, die INET_PROT_FILE verwenden, denn bei denen
+ // wird der gesetzte Titel nicht beachtet.
+ // (s.u., Auswertung von aTitleMap_Impl)
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_DOCINFO_TITLE, sal_False );
+
+ // Demn"achst nur noch SID_FILE_LONGNAME statt SID_DOCINFO_TITLE
+ if ( !pNameItem )
+ SFX_ITEMSET_ARG( pMed->GetItemSet(), pNameItem, SfxStringItem, SID_FILE_LONGNAME, sal_False );
+
+ if ( pNameItem )
+ {
+ return X( pNameItem->GetValue() );
+ }
+ }
+
+ if ( nMaxLength >= SFX_TITLE_CAPTION && nMaxLength <= SFX_TITLE_HISTORY )
+ {
+ sal_uInt16 nRemote;
+ if( !pMed || pMed->GetURLObject().GetProtocol() == INET_PROT_FILE )
+ nRemote = 0;
+ else nRemote = 1;
+ nMaxLength = aTitleMap_Impl[nMaxLength-SFX_TITLE_CAPTION][nRemote];
+ }
+
+ // noch unbenannt?
+ DBG_ASSERT( !HasName() || pMed, "HasName() aber kein Medium?!?" );
+ if ( !HasName() || !pMed )
+ {
+ // schon Titel gesezt?
+ if ( pImp->aTitle.Len() )
+ return X(pImp->aTitle);
+
+ // mu\s es durchnumeriert werden?
+ String aNoName( SfxResId( STR_NONAME ) );
+ if ( pImp->bIsNamedVisible )
+ // Nummer hintenanh"angen
+ aNoName += String::CreateFromInt32( pImp->nVisualDocumentNumber );
+
+ // Dokument hei\st vorerst 'unbenannt#'
+ return X(aNoName);
+ }
+
+
+ // lokale Datei?
+ const INetURLObject& aURL = pMed->GetURLObject();
+ if ( aURL.GetProtocol() == INET_PROT_FILE )
+ {
+ String aName( aURL.HasMark() ? INetURLObject( aURL.GetURLNoMark() ).PathToFileName() : aURL.PathToFileName() );
+
+// if ( nMaxLength > SFX_TITLE_MAXLEN )
+// return X( DirEntry( aName ).GetFull( FSYS_STYLE_HOST, sal_False, nMaxLength ) );
+ /* else*/ if ( nMaxLength == SFX_TITLE_FULLNAME )
+ return X( aName );
+
+ if ( !pImp->aTitle.Len() )
+ {
+ INetURLObject aPath( aName, INET_PROT_FILE );
+ if ( nMaxLength == SFX_TITLE_FILENAME )
+ return X( aPath.GetName() );
+
+ // sonst Titel aus Dateiname generieren
+ pImp->aTitle = aPath.GetBase();
+ }
+ }
+ else
+ {
+ // ::com::sun::star::util::URL-Versionen
+ if ( nMaxLength >= SFX_TITLE_MAXLEN )
+ {
+ String aComplete( pMed->GetName() );
+ if( aComplete.Len() > nMaxLength )
+ {
+ String aRet( DEFINE_CONST_UNICODE( "..." ) );
+ aRet += aComplete.Copy( aComplete.Len() - nMaxLength + 3, nMaxLength - 3 );
+ return X( aRet );
+ }
+ else
+ return X( pMed->GetName() );
+ }
+ else if ( nMaxLength == SFX_TITLE_FILENAME )
+ {
+ String aName( aURL.GetLastName() );
+ aName = INetURLObject::decode( aName, INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET );
+ if( !aName.Len() )
+ aName = aURL.GetURLNoPass();
+ return X(aName);
+ }
+ else if ( nMaxLength == SFX_TITLE_FULLNAME )
+ return X(aURL.GetMainURL());
+
+ // ggf. Titel aus Dateiname generieren
+ if ( !pImp->aTitle.Len() )
+ pImp->aTitle = aURL.GetBase();
+ }
+
+ // ganzer Titel
+ return X(pImp->aTitle);
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::InvalidateName()
+
+/* [Beschreibung]
+
+ Ermittelt den Titel des Dokuments neu aus 'unbenannt', DocInfo-Titel
+ bzw. Dateinamen. Wird nach Laden aus Template oder SaveAs ben"otigt.
+*/
+
+{
+ // Title neu erzeugen
+ pImp->aTitle.Erase();
+// pImp->nVisualDocumentNumber = USHRT_MAX;
+ GetTitle( SFX_TITLE_DETECT );
+ SetName( GetTitle( SFX_TITLE_APINAME ) );
+
+ // Benachrichtigungen
+ Broadcast( SfxSimpleHint(SFX_HINT_TITLECHANGED) );
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::SetNamedVisibility_Impl()
+{
+ if ( !pImp->bIsNamedVisible )
+ {
+ // Nummer verpassen
+ pImp->bIsNamedVisible = sal_True;
+ // ggf. neue Nummer verpassen
+ if ( !HasName() && USHRT_MAX == pImp->nVisualDocumentNumber && !pImp->aTitle.Len() )
+ {
+ pImp->nVisualDocumentNumber = SFX_APP()->GetFreeIndex();
+ Broadcast( SfxSimpleHint(SFX_HINT_TITLECHANGED) );
+ }
+ }
+
+ SetName( GetTitle(SFX_TITLE_APINAME) );
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::MemoryError()
+{
+}
+
+//--------------------------------------------------------------------
+
+SfxProgress* SfxObjectShell::GetProgress() const
+{
+ return pImp->pProgress;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::SetProgress_Impl
+(
+ SfxProgress *pProgress /* zu startender <SfxProgress> oder 0, falls
+ der Progress zur"uckgesetzt werden soll */
+)
+
+/* [Beschreibung]
+
+ Interne Methode zum setzen oder zur"ucksetzen des Progress-Modes
+ f"ur diese SfxObjectShell.
+*/
+
+{
+ DBG_ASSERT( ( !pImp->pProgress && pProgress ) ||
+ ( pImp->pProgress && !pProgress ),
+ "Progress activation/deacitivation mismatch" );
+ pImp->pProgress = pProgress;
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::PostActivateEvent_Impl()
+{
+ SfxApplication* pSfxApp = SFX_APP();
+ if ( !pSfxApp->IsDowning() && !IsLoading() )
+ {
+ if (pImp->nEventId)
+ {
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem,
+ SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ sal_uInt16 nId = pImp->nEventId;
+ pImp->nEventId = 0;
+ if ( !pSalvageItem )
+ pSfxApp->NotifyEvent(SfxEventHint( nId, this, pImp->bAddToHistory), sal_False);
+ }
+
+ if ( GetFrame() )
+ pSfxApp->NotifyEvent(SfxEventHint(SFX_EVENT_ACTIVATEDOC, this), sal_False);
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::SetActivateEvent_Impl(sal_uInt16 nId, sal_Bool bAddToHistory)
+{
+ if ( GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC )
+ {
+ pImp->nEventId = nId;
+ pImp->bAddToHistory = bAddToHistory;
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::RegisterTransfer( SfxMedium& rMedium )
+/* [Beschreibung ]
+ Alle Medien, die aufgesetzt werden, um Teile eines Dokumentes zu
+ laden, muessen an der zugehoerigen SfxObjectShell angemeldet
+ werden. So kann dokumentweise abgebrochen werden. */
+{
+ rMedium.SetCancelManager_Impl( GetMedium()->GetCancelManager_Impl() );
+ if( IsReloading() )
+ rMedium.SetUsesCache( sal_False );
+ rMedium.SetReferer( GetMedium()->GetName() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::PrepareReload( )
+/* [Beschreibung ]
+ Wird vor dem Reload gerufen und gibt die Moeglichkeit,
+ etwaige Caches zu leeren. */
+{
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsReloading() const
+/* [Beschreibung ]
+ Wird beim Aufsetzen neuer Downloads abgefragt, um gegebenenfalls
+ am SfxMedium SetUsesCache( sal_False ) zu rufen. */
+
+{
+ return !GetMedium()->UsesCache();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::LockAutoLoad( sal_Bool bLock )
+
+/* Verhindert ein evtl. eintreffendes AutoLoad. Wird auch vor AutoLoad
+ eines umgebenden FrameSet beruecksichtigt.
+*/
+
+{
+ if ( bLock )
+ ++pImp->nAutoLoadLocks;
+ else
+ --pImp->nAutoLoadLocks;
+}
+
+//-------------------------------------------------------------------------
+
+// kann nach frame.cxx gemoved werden, wenn 358+36x-Stand gemerged sind
+
+sal_Bool SfxFrame::IsAutoLoadLocked_Impl() const
+{
+ // sein einges Doc gelockt?
+ const SfxObjectShell* pObjSh = GetCurrentDocument();
+ if ( !pObjSh || !pObjSh->IsAutoLoadLocked() )
+ return sal_False;
+
+ // seine Childs gelockt?
+ for ( sal_uInt16 n = GetChildFrameCount(); n--; )
+ if ( !GetChildFrame(n)->IsAutoLoadLocked_Impl() )
+ return sal_False;
+
+ // sonst ist AutoLoad erlaubt
+ return sal_True;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsAutoLoadLocked() const
+
+/* Liefert, ob ein eintreffendes AutoLoad ausgefuehrt werden darf. Wird auch
+ vor AutoLoad eines umgebenden FrameSet beruecksichtigt.
+*/
+
+{
+ return !IsReadOnly() || pImp->nAutoLoadLocks > 0;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetAutoLoad(
+ const INetURLObject& rUrl, sal_uInt32 nTime, sal_Bool bReload )
+/* [Beschreibung ]
+ Hiermit wird automatisches Laden der Url rUrl nTime
+ Millisekunden nach Aufruf von FinishedLoading angefordert. bReload
+ bestimmt, ob das Dokument aus dem Cache geladen werden soll oder
+ nicht. */
+{
+ if ( pImp->pReloadTimer )
+ DELETEZ(pImp->pReloadTimer);
+ if ( bReload )
+ {
+ pImp->pReloadTimer = new AutoReloadTimer_Impl(
+ rUrl.GetMainURL(), nTime, bReload, this );
+ pImp->pReloadTimer->Start();
+ }
+}
+
+void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
+{
+ sal_Bool bSetModifiedTRUE = sal_False;
+ if( ( nFlags & SFX_LOADED_MAINDOCUMENT ) &&
+ !(pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ))
+ {
+ ((SfxHeaderAttributes_Impl*)GetHeaderAttributes())->SetAttributes();
+ pImp->bImportDone = sal_True;
+ const SfxFilter* pFilter = GetMedium()->GetFilter();
+ if( !IsAbortingImport() )
+ {
+ if( pFilter && !pFilter->UsesStorage() &&
+ !(GetMedium()->GetOpenMode() & STREAM_WRITE ) )
+ GetMedium()->Close();
+ PositionView_Impl();
+ }
+ // Salvage
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem,
+ SfxStringItem, SID_DOC_SALVAGE, sal_False );
+ if ( pSalvageItem )
+ bSetModifiedTRUE = sal_True;
+ }
+
+ if( ( nFlags & SFX_LOADED_IMAGES ) &&
+ !(pImp->nLoadedFlags & SFX_LOADED_IMAGES ) )
+ {
+ SfxDocumentInfo& rInfo = GetDocInfo();
+ SetAutoLoad( rInfo.GetReloadURL(), rInfo.GetReloadDelay() * 1000,
+ rInfo.IsReloadEnabled() );
+ if( !bSetModifiedTRUE && IsEnableSetModified() )
+ SetModified( sal_False );
+ Invalidate( SID_SAVEASDOC );
+ SfxFrame* pFrame = GetMedium()->GetLoadTargetFrame();
+ if( pFrame ) pFrame->SetLoadCancelable_Impl( 0 );
+ }
+
+ pImp->nLoadedFlags |= nFlags;
+
+ if( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT &&
+ pImp->nLoadedFlags & SFX_LOADED_IMAGES )
+ GetMedium()->SetUsesCache( sal_True );
+
+ if ( bSetModifiedTRUE )
+ SetModified( sal_True );
+ if ( pImp->nEventId )
+ {
+ // Falls noch kein OnLoad ausgel"ost wurde, weil beim Erzeugen der ::com::sun::star::sdbcx::View der Frame nicht aktiv war,
+ // mu\s das jetzt nachgeholt werden, indem der Frame benachrichtigt wird.
+ Broadcast( SfxEventHint( SFX_EVENT_LOADFINISHED, this, sal_False ) );
+
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pHiddenItem, SfxBoolItem, SID_HIDDEN, sal_False );
+ if ( pHiddenItem && pHiddenItem->GetValue() )
+ {
+ sal_uInt16 nId = pImp->nEventId;
+ pImp->nEventId = 0;
+ SFX_APP()->NotifyEvent(SfxEventHint( nId, this, pImp->bAddToHistory), sal_False);
+ }
+ }
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::PositionView_Impl()
+{
+ MarkData_Impl *pMark = Get_Impl()->pMarkData;
+ if( pMark )
+ {
+ SfxViewShell* pSh = pMark->pFrame->GetViewShell();
+ if( pMark->aUserData.Len() )
+ pSh->ReadUserData( pMark->aUserData, sal_True );
+ else if( pMark->aMark.Len() )
+ pSh->JumpToMark( pMark->aMark );
+ DELETEZ( Get_Impl()->pMarkData );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsLoading() const
+/* [Beschreibung ]
+ Wurde bereits FinishedLoading aufgerufeb? */
+{
+ return !( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::CancelTransfers()
+/* [Beschreibung ]
+ Hier koennen Transfers gecanceled werden, die nicht mit
+ RegisterTransfer registiert wurden */
+{
+ GetMedium()->CancelTransfers();
+ if( ( pImp->nLoadedFlags & SFX_LOADED_ALL ) != SFX_LOADED_ALL )
+ {
+ AbortImport();
+ if( IsLoading() )
+ FinishedLoading( SFX_LOADED_ALL );
+
+/*
+ SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this );
+ while( pFrame )
+ {
+ pFrame->CancelTransfers();
+ pFrame = SfxViewFrame::GetNext( *pFrame, this );
+ }*/
+ }
+}
+
+//-------------------------------------------------------------------------
+
+AutoReloadTimer_Impl::AutoReloadTimer_Impl(
+ const String& rURL, sal_uInt32 nTime, sal_Bool bReloadP, SfxObjectShell* pSh )
+ : aUrl( rURL ), bReload( bReloadP ), pObjSh( pSh )
+{
+ SetTimeout( nTime );
+}
+
+//-------------------------------------------------------------------------
+
+void AutoReloadTimer_Impl::Timeout()
+{
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst( pObjSh );
+
+ if ( pFrame )
+ {
+ // momentan nicht m"oglich/sinnvoll?
+ if ( !pObjSh->CanReload_Impl() || pObjSh->IsAutoLoadLocked() || DragManager::GetDragManager() )
+ {
+ // erneuten Versuch erlauben
+ Start();
+ return;
+ }
+
+ SfxAllItemSet aSet( SFX_APP()->GetPool() );
+ aSet.Put( SfxBoolItem( SID_AUTOLOAD, sal_True ) );
+ if ( aUrl.Len() )
+ aSet.Put( SfxStringItem( SID_FILE_NAME, aUrl ) );
+ SfxRequest aReq( SID_RELOAD, 0, aSet );
+ pObjSh->Get_Impl()->pReloadTimer = 0;
+ delete this;
+ pFrame->ExecReload_Impl( aReq );
+ return;
+ }
+
+ pObjSh->Get_Impl()->pReloadTimer = 0;
+ delete this;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetActualSize( const Size &rSize )
+{
+ pImp->aViewSize = rSize;
+}
+
+//-------------------------------------------------------------------------
+
+Size SfxObjectShell::GetActualSize() const
+{
+ return pImp->aViewSize;
+}
+
+sal_Bool SfxObjectShell::IsInFrame() const
+{
+ return pImp->bInFrame;
+}
+
+void SfxObjectShell::SetInFrame( sal_Bool bOn )
+{
+ pImp->bInFrame = bOn;
+}
+
+SfxModule* SfxObjectShell::GetModule() const
+{
+ return GetFactory().GetModule();
+}
+
+sal_Bool SfxObjectShell::IsBasic(
+ const String & rCode, SbxObject * pVCtrl )
+{
+ if( !rCode.Len() ) return sal_False;
+ if( !pImp->bIsBasicDefault )
+ return sal_False;
+ return SfxMacroConfig::IsBasic( pVCtrl, rCode, GetBasicManager() );
+}
+
+ErrCode SfxObjectShell::CallBasic( const String& rMacro,
+ const String& rBasic, SbxObject* pVCtrl, SbxArray* pArgs,
+ SbxValue* pRet )
+{
+ if ( !IsSecure() )
+ return ERRCODE_IO_ACCESSDENIED;
+
+ SfxApplication* pApp = SFX_APP();
+ pApp->EnterBasicCall();
+ BasicManager *pMgr = GetBasicManager();
+ if( pApp->GetName() == rBasic )
+ pMgr = pApp->GetBasicManager();
+ ErrCode nRet = SfxMacroConfig::Call( pVCtrl, rMacro, pMgr, pArgs, pRet );
+ pApp->LeaveBasicCall();
+ return nRet;
+}
+
+ErrCode SfxObjectShell::Call( const String & rCode, sal_Bool bIsBasicReturn, SbxObject * pVCtrl )
+{
+ ErrCode nErr = ERRCODE_NONE;
+ if ( bIsBasicReturn )
+ CallBasic( rCode, String(), pVCtrl );
+ return nErr;
+}
+
+extern ::com::sun::star::uno::Any sbxToUnoValue( SbxVariable* pVar );
+
+ErrCode SfxObjectShell::CallScript(
+ const String & rScriptType,
+ const String & rCode,
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rSource,
+ void *pArgs,
+ void *pRet
+)
+{
+ ::vos::OClearableGuard aGuard( Application::GetSolarMutex() );
+ ErrCode nErr = ERRCODE_NONE;
+ if( rScriptType.EqualsAscii( "StarBasic" ) )
+ {
+
+ SbxArrayRef xArray;
+ String aTmp;
+ if( pArgs )
+ {
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > * pTmpArgs = (::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > *)pArgs;
+ sal_Int32 nCnt = pTmpArgs->getLength();
+
+ if( nCnt )
+ {
+ xArray = new SbxArray;
+ const ::com::sun::star::uno::Any *pArgs = pTmpArgs->getConstArray();
+ for( sal_Int32 i = 0; i < nCnt; i++ )
+ xArray->Put( GetSbUnoObject( aTmp, pArgs[i] ), i+1 );
+ }
+ }
+
+ SbxVariableRef xValue = pRet ? new SbxVariable : 0;
+ nErr = CallBasic( rCode, aTmp, NULL, xArray, xValue );
+ if ( pRet )
+ *((::com::sun::star::uno::Any*)pRet) = sbxToUnoValue( xValue );
+
+ if ( nErr == ERRCODE_BASIC_PROC_UNDEFINED )
+ {
+ aTmp = SFX_APP()->GetName();
+ nErr = CallBasic( rCode, aTmp, 0, xArray );
+ }
+ }
+ else if( rScriptType.EqualsAscii( "JavaScript" ) )
+ {
+ DBG_ERROR( "JavaScript not allowed" );
+ return 0;
+ }
+ else
+ {
+ DBG_ERROR( "StarScript not allowed" );
+ }
+ return nErr;
+}
+
+SfxFrame* SfxObjectShell::GetSmartSelf( SfxFrame* pSelf, SfxMedium& rMedium )
+{
+ return pSelf;
+}
+
+SfxObjectShellFlags SfxObjectShell::GetFlags() const
+{
+ if( pImp->eFlags == SFXOBJECTSHELL_UNDEFINED )
+ pImp->eFlags = GetFactory().GetFlags();
+ return pImp->eFlags;
+}
+
+void SfxObjectShell::SetFlags( SfxObjectShellFlags eFlags )
+{
+ pImp->eFlags = eFlags;
+}
+
+void SfxObjectShell::SetBaseURL( const String& rURL )
+{
+ pImp->aBaseURL = rURL;
+}
+
+const String& SfxObjectShell::GetBaseURL() const
+{
+ if ( pImp->aBaseURL.Len() )
+ return pImp->aBaseURL;
+ else if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_PACKED ) )
+ return pMedium->GetPhysicalName();
+ else
+ return pMedium->GetName();
+}
+
+String SfxObjectShell::QueryTitle( SfxTitleQuery eType ) const
+{
+ String aRet;
+
+ switch( eType )
+ {
+ case SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL:
+ {
+ SfxMedium* pMed = GetMedium();
+ const INetURLObject& rObj = pMed->GetURLObject();
+ aRet = rObj.GetMainURL();
+ if ( !aRet.Len() )
+ aRet = GetTitle( SFX_TITLE_CAPTION );
+ break;
+ }
+ }
+ return aRet;
+}
+
+void SfxHeaderAttributes_Impl::SetAttributes()
+{
+ bAlert = sal_True;
+ SvKeyValue aPair;
+ for( sal_Bool bCont = xIter->GetFirst( aPair ); bCont;
+ bCont = xIter->GetNext( aPair ) )
+ SetAttribute( aPair );
+}
+
+void SfxHeaderAttributes_Impl::SetAttribute( const SvKeyValue& rKV )
+{
+ String aValue = rKV.GetValue();
+ if( rKV.GetKey().CompareIgnoreCaseToAscii( "refresh" ) == COMPARE_EQUAL && rKV.GetValue().Len() )
+ {
+ sal_uInt32 nTime = aValue.GetToken( 0, ';' ).ToInt32() ;
+ String aURL = aValue.GetToken( 1, ';' );
+ aURL.EraseTrailingChars().EraseLeadingChars();
+ SfxDocumentInfo& rInfo = pDoc->GetDocInfo();
+ if( aURL.Copy(0, 4).CompareIgnoreCaseToAscii( "url=" ) == COMPARE_EQUAL )
+ {
+ INetURLObject aObj;
+ pDoc->GetMedium()->GetURLObject().GetNewAbsURL(
+ aURL.Copy( 4 ), &aObj );
+ rInfo.SetReloadURL( aObj.GetMainURL() );
+ }
+ rInfo.EnableReload( sal_True );
+ rInfo.SetReloadDelay( nTime );
+ pDoc->FlushDocInfo();
+ }
+ else if( rKV.GetKey().CompareIgnoreCaseToAscii( "expires" ) == COMPARE_EQUAL )
+ {
+ DateTime aDateTime;
+ if( INetRFC822Message::ParseDateField( rKV.GetValue(), aDateTime ) )
+ {
+ aDateTime.ConvertToLocalTime();
+ pDoc->GetMedium()->SetExpired_Impl( aDateTime );
+ }
+ else
+ {
+// DBG_ERROR( "Schlechtes ::com::sun::star::util::DateTime fuer Expired" );
+ pDoc->GetMedium()->SetExpired_Impl( Date( 1, 1, 1970 ) );
+ }
+ }
+}
+
+void SfxHeaderAttributes_Impl::Append( const SvKeyValue& rKV )
+{
+ xIter->Append( rKV );
+ if( bAlert ) SetAttribute( rKV );
+}
+
+SvKeyValueIterator* SfxObjectShell::GetHeaderAttributes()
+{
+ if( !pImp->xHeaderAttributes.Is() )
+ {
+ DBG_ASSERT( pMedium, "Kein Medium" );
+ pImp->xHeaderAttributes = new SfxHeaderAttributes_Impl( this );
+ }
+ return ( SvKeyValueIterator*) &pImp->xHeaderAttributes;
+}
+
+void SfxObjectShell::ClearHeaderAttributesForSourceViewHack()
+{
+ ((SfxHeaderAttributes_Impl*)GetHeaderAttributes())
+ ->ClearForSourceView();
+}
+
+
+void SfxObjectShell::SetHeaderAttributesForSourceViewHack()
+{
+ ((SfxHeaderAttributes_Impl*)GetHeaderAttributes())
+ ->SetAttributes();
+}
+
+void SfxObjectShell::StartLoading_Impl()
+{
+ pImp->nLoadedFlags = 0;
+}
+
+sal_Bool SfxObjectShell::IsPreview() const
+{
+ if ( !pMedium )
+ return sal_False;
+
+ sal_Bool bPreview = sal_False;
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFlags, SfxStringItem, SID_OPTIONS, sal_False);
+ if ( pFlags )
+ {
+ // Werte auf einzelne Items verteilen
+ String aFileFlags = pFlags->GetValue();
+ aFileFlags.ToUpperAscii();
+ if ( STRING_NOTFOUND != aFileFlags.Search( 'B' ) )
+ bPreview = sal_True;
+ }
+
+ if ( !bPreview )
+ {
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pItem, SfxBoolItem, SID_PREVIEW, sal_False);
+ if ( pItem )
+ bPreview = pItem->GetValue();
+ }
+
+ return bPreview;
+}
+
+sal_Bool SfxObjectShell::IsSecure()
+{
+ // Wenn globale Warnung an ist, nach Secure-Referer-Liste gehen
+ String aReferer = GetMedium()->GetName();
+ if ( !aReferer.Len() )
+ {
+ // bei neuen Dokumenten das Template als Referer nehmen
+ String aTempl( GetDocInfo().GetTemplateFileName() );
+ if ( aTempl.Len() )
+ aReferer = INetURLObject( aTempl, INET_PROT_FILE ).GetMainURL();
+ else
+ // Da leider ein noch nicht gespeichertes Dokument zwar als "lokal"
+ // zu gelten hat, aber kein ::com::sun::star::util::URL hat: ( !!HACK!! )
+ aReferer = DEFINE_CONST_UNICODE( "file://" );
+ }
+
+ INetURLObject aURL( "macro:" );
+ if ( SFX_APP()->IsSecureURL( aURL, &aReferer ) )
+ {
+ if ( GetMedium()->GetContent().is() )
+ {
+ Any aAny( UCB_Helper::GetProperty( GetMedium()->GetContent(), WID_IS_PROTECTED ) );
+ sal_Bool bIsProtected = FALSE;
+ if ( ( aAny >>= bIsProtected ) && bIsProtected )
+ return sal_False;
+ else
+ return sal_True;
+ }
+ else
+ return sal_True;
+ }
+ else
+ return sal_False;
+}
+
+void SfxObjectShell::SetWaitCursor( BOOL bSet ) const
+{
+ for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, this ) )
+ {
+ if ( bSet )
+ pFrame->GetFrame()->GetWindow().EnterWait();
+ else
+ pFrame->GetFrame()->GetWindow().LeaveWait();
+ }
+}
+
+String SfxObjectShell::GetAPIName() const
+{
+ INetURLObject aURL( GetMedium()->GetName() );
+ String aName( aURL.GetBase() );
+ if( !aName.Len() )
+ aName = aURL.GetURLNoPass();
+ if ( !aName.Len() )
+ aName = GetTitle( SFX_TITLE_DETECT );
+ return aName;
+}
+
+void SfxObjectShell::Invalidate( USHORT nId )
+{
+ for( SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); pFrame; pFrame = SfxViewFrame::GetNext( *pFrame, this ) )
+ Invalidate_Impl( pFrame->GetBindings(), nId );
+}
+
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
new file mode 100644
index 000000000000..ac3a47b470f1
--- /dev/null
+++ b/sfx2/source/doc/objserv.cxx
@@ -0,0 +1,1173 @@
+/*************************************************************************
+ *
+ * $RCSfile: objserv.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <so3/svstor.hxx>
+
+#ifndef _URLOBJ_HXX //autogen
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _SFX_INIMGR_HXX //autogen
+#include <inimgr.hxx>
+#endif
+#ifndef _SFX_WHITER_HXX //autogen
+#include <svtools/whiter.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXINTITEM_HXX //autogen
+#include <svtools/intitem.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#include <vcl/wrkwin.hxx>
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#include <svtools/sbx.hxx>
+
+#pragma hdrstop
+
+#include "sfxresid.hxx"
+#include "event.hxx"
+#include "request.hxx"
+#include "printer.hxx"
+#include "viewsh.hxx"
+#include "doctdlg.hxx"
+#include "docfilt.hxx"
+#include "docfile.hxx"
+#include "docinf.hxx"
+#include "dispatch.hxx"
+#include "dinfdlg.hxx"
+#include "objitem.hxx"
+#include "objsh.hxx"
+#include "objshimp.hxx"
+#include "sfxtypes.hxx"
+#include "interno.hxx"
+#include "module.hxx"
+#include "topfrm.hxx"
+#include "versdlg.hxx"
+#include "doc.hrc"
+#include "docfac.hxx"
+
+//====================================================================
+
+BOOL ShallSetBaseURL_Impl( SfxMedium &rMed );
+
+#define SfxObjectShell
+#include "sfxslots.hxx"
+
+AsynchronLink* pPendingCloser = 0;
+
+//=========================================================================
+
+SFX_IMPL_INTERFACE(SfxObjectShell,SfxShell,SfxResId(0))
+{
+}
+
+long SfxObjectShellClose_Impl( void* pObj, void* pArg )
+{
+ SfxObjectShell *pObjSh = (SfxObjectShell*) pArg;
+ if ( pObjSh->Get_Impl()->bHiddenLockedByAPI )
+ {
+ pObjSh->Get_Impl()->bHiddenLockedByAPI = FALSE;
+ pObjSh->OwnerLock(FALSE);
+ }
+ else if ( !pObjSh->Get_Impl()->bClosing )
+ // GCC stuerzt ab, wenn schon im dtor, also vorher Flag abfragen
+ pObjSh->DoClose();
+ return 0;
+}
+
+//=========================================================================
+
+void SfxObjectShell::PrintExec_Impl(SfxRequest &rReq)
+{
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this);
+ if ( pFrame )
+ {
+ rReq.SetSlot( SID_PRINTDOC );
+ pFrame->GetViewShell()->ExecuteSlot(rReq);
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::PrintState_Impl(SfxItemSet &rSet)
+{
+ FASTBOOL bPrinting = FALSE;
+ SfxViewFrame *pFrame = SfxViewFrame::GetFirst(this, TYPE(SfxTopViewFrame));
+ if ( pFrame )
+ {
+ SfxPrinter *pPrinter = pFrame->GetViewShell()->GetPrinter();
+ bPrinting = pPrinter && pPrinter->IsPrinting();
+ }
+ rSet.Put( SfxBoolItem( SID_PRINTOUT, bPrinting ) );
+}
+
+//--------------------------------------------------------------------
+void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
+{
+ {DBG_CHKTHIS(SfxObjectShell, 0);}
+
+ pImp->bSetStandardName=FALSE;
+ USHORT nId = rReq.GetSlot();
+ if ( !GetMedium() && nId != SID_CLOSEDOC )
+ return;
+
+ if( nId == SID_SAVEDOC || nId == SID_UPDATEDOC )
+ {
+ // Embedded?
+ SfxInPlaceObject *pObj=GetInPlaceObject();
+ if( pObj && pObj->GetProtocol().IsEmbed() )
+ {
+ BOOL bRet = pObj->GetClient()->SaveObject();
+ rReq.SetReturnValue( SfxBoolItem(0, bRet) );
+ rReq.Done();
+ return;
+ }
+
+ // not-modified => nichts tun, kein BASIC-Laufzeitfehler (API)
+ if ( !IsModified() )
+ {
+ rReq.SetReturnValue( SfxBoolItem(0, FALSE) );
+ rReq.Done();
+ return;
+ }
+ }
+
+ // API-Call => suppress dialogs
+ SfxBoolResetter aSilentReset( pImp->bSilent );
+ if ( rReq.IsAPI() )
+ pImp->bSilent = TRUE;
+
+ const SfxFilter *pCurFilter = GetMedium()->GetFilter();
+ const SfxFilter *pDefFilter = GetFactory().GetFilter(0);
+ if ( nId == SID_SAVEDOC &&
+ pCurFilter && !pCurFilter->CanExport() &&
+ pDefFilter && pDefFilter->IsInternal() )
+ nId = SID_SAVEASDOC;
+
+ // interaktiv speichern via (nicht-Default) Filter?
+ if ( !rReq.IsAPI() && GetMedium()->GetFilter() && HasName() &&
+ (nId == SID_SAVEDOC || nId == SID_UPDATEDOC) )
+ {
+ // aktuellen und Default-Filter besorgen
+
+ // Filter kann nicht exportieren und Default-Filter ist verf"ugbar?
+ if ( !pCurFilter->CanExport() &&
+ !pDefFilter->IsInternal() )
+ {
+ // fragen, ob im default-Format gespeichert werden soll
+ String aWarn(SfxResId(STR_QUERY_MUSTOWNFORMAT));
+ aWarn = SearchAndReplace( aWarn, DEFINE_CONST_UNICODE( "$(FORMAT)" ),
+ GetMedium()->GetFilter()->GetFilterName() );
+ aWarn = SearchAndReplace( aWarn, DEFINE_CONST_UNICODE( "$(OWNFORMAT)" ),
+ GetFactory().GetFilter(0)->GetFilterName() );
+ QueryBox aWarnBox(0,WB_OK_CANCEL|WB_DEF_OK,aWarn);
+ if ( aWarnBox.Execute() == RET_OK )
+ {
+ // ja: Save-As in eigenem Foramt
+ rReq.SetSlot(nId = SID_SAVEASDOC);
+ pImp->bSetStandardName=TRUE;
+ }
+ else
+ {
+ // nein: Abbruch
+ rReq.Ignore();
+ return;
+ }
+ }
+ else
+ {
+ // fremdes Format mit m"oglichem Verlust (aber nicht per API) wenn noch nicht gewarnt und anschlieend im
+ // alien format gespeichert wurde
+ if ( !( pCurFilter->IsOwnFormat() && pCurFilter->GetVersion() == SOFFICE_FILEFORMAT_NOW || ( pCurFilter->GetFilterFlags() & SFX_FILTER_SILENTEXPORT ) )
+ && ( !pImp->bDidWarnFormat || !pImp->bDidDangerousSave ) )
+ {
+ // Default-Format verf"ugbar?
+ if ( !pDefFilter->IsInternal() && pCurFilter != pDefFilter )
+ {
+ // fragen, ob im default-Format gespeichert werden soll
+ String aWarn(SfxResId(STR_QUERY_SAVEOWNFORMAT));
+ aWarn = SearchAndReplace( aWarn, DEFINE_CONST_UNICODE( "$(FORMAT)" ),
+ GetMedium()->GetFilter()->GetFilterName());
+ aWarn = SearchAndReplace( aWarn, DEFINE_CONST_UNICODE( "$(OWNFORMAT)" ),
+ GetFactory().GetFilter(0)->GetFilterName());
+
+ SfxViewFrame *pFrame = SfxObjectShell::Current() == this ?
+ SfxViewFrame::Current() : SfxViewFrame::GetFirst( this );
+ while ( pFrame && (pFrame->GetFrameType() & SFXFRAME_SERVER ) )
+ pFrame = SfxViewFrame::GetNext( *pFrame, this );
+
+ if ( pFrame )
+ {
+ SfxFrame* pTop = pFrame->GetTopFrame();
+ SFX_APP()->SetViewFrame( pTop->GetCurrentViewFrame() );
+ pFrame->GetFrame()->Appear();
+
+ QueryBox aWarnBox(&pFrame->GetWindow(),WB_YES_NO_CANCEL|WB_DEF_YES,aWarn);
+ switch(aWarnBox.Execute())
+ {
+ case RET_YES:
+ {
+ // ja: in Save-As umsetzen
+ rReq.SetSlot(nId = SID_SAVEASDOC);
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPassItem, SfxStringItem, SID_PASSWORD, FALSE );
+ if ( pPassItem )
+ rReq.AppendItem( *pPassItem );
+ pImp->bSetStandardName = TRUE;
+ break;
+ }
+
+ case RET_CANCEL:
+ // nein: Abbruch
+ rReq.Ignore();
+ return;
+ }
+
+ pImp->bDidWarnFormat=TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ // Speichern eines namenslosen oder readonly Dokumentes
+ BOOL bMediumRO = IsReadOnlyMedium();
+ if ( ( nId == SID_SAVEDOC || nId == SID_UPDATEDOC ) &&
+ ( !HasName() || bMediumRO ) )
+ {
+ if ( rReq.IsAPI() )
+ {
+ // FALSE zur"uckliefern
+ rReq.SetReturnValue( SfxBoolItem( 0, FALSE ) );
+ rReq.Done();
+ return;
+ }
+ else
+ {
+ // in SaveAs umwandlen
+ rReq.SetSlot(nId = SID_SAVEASDOC);
+ if ( SFX_APP()->IsPlugin() && !HasName() )
+ {
+ SFX_REQUEST_ARG( rReq, pWarnItem, SfxBoolItem, SID_FAIL_ON_WARNING, FALSE);
+ if ( pWarnItem && pWarnItem->GetValue() )
+ {
+ INetURLObject aObj( SFX_INIMANAGER()->Get(SFX_KEY_WORK_PATH), INET_PROT_FILE );
+ aObj.insertName( GetTitle(), false, INetURLObject::LAST_SEGMENT, true, INetURLObject::ENCODE_ALL );
+ const SfxFilter* pFilter = GetFactory().GetFilter(0);
+ String aExtension( pFilter->GetDefaultExtension().Copy(2) );
+ aObj.setExtension( aExtension, INetURLObject::LAST_SEGMENT, true, INetURLObject::ENCODE_ALL );
+ rReq.AppendItem( SfxStringItem( SID_FILE_NAME, aObj.GetMainURL() ) );
+ rReq.AppendItem( SfxBoolItem( SID_RENAME, TRUE ) );
+ }
+ }
+ }
+ }
+
+ switch(nId)
+ {
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_VERSION:
+ {
+ SfxViewFrame* pFrame = GetFrame();
+ if ( !pFrame )
+ pFrame = SfxViewFrame::GetFirst( this );
+ if ( !pFrame )
+ return;
+
+ if ( !rReq.IsAPI() )
+ {
+ if ( pFrame->GetFrame()->GetParentFrame() )
+ {
+ pFrame->GetTopViewFrame()->GetObjectShell()->ExecuteSlot( rReq );
+ return;
+ }
+ }
+
+ if ( !IsOwnStorageFormat_Impl( *GetMedium() ) )
+ return;
+
+ SfxVersionDialog *pDlg = new SfxVersionDialog( pFrame, NULL );
+ pDlg->Execute();
+ delete pDlg;
+ rReq.Done();
+ break;
+ }
+
+ case SID_LOAD_LIBRARY:
+ case SID_UNLOAD_LIBRARY:
+ case SID_REMOVE_LIBRARY:
+ case SID_ADD_LIBRARY:
+ {
+ // Diese Funktionen sind nur f"ur Aufrufe aus dem Basic gedacht
+ SfxApplication *pApp = SFX_APP();
+ if ( pApp->IsInBasicCall() )
+ pApp->BasicLibExec_Impl( rReq, GetBasicManager() );
+ break;
+ }
+
+ case SID_SAVEDOC:
+ {
+ //!! detaillierte Auswertung eines Fehlercodes
+ SfxObjectShellRef xLock( this );
+ SfxErrorContext aEc(ERRCTX_SFX_SAVEDOC,GetTitle());
+ SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_SAVEDOC,this));
+
+ BOOL bOk = Save_Impl( rReq.GetArgs() );
+
+ ULONG lErr=GetErrorCode();
+ if( !lErr && !bOk )
+ lErr=ERRCODE_IO_GENERAL;
+
+ if ( lErr && bOk )
+ {
+ SFX_REQUEST_ARG( rReq, pWarnItem, SfxBoolItem, SID_FAIL_ON_WARNING, FALSE);
+ if ( pWarnItem && pWarnItem->GetValue() )
+ bOk = FALSE;
+ }
+
+ if( !ErrorHandler::HandleError( lErr ) )
+ SFX_APP()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEFINISHED, this ) );
+ ResetError();
+
+ rReq.SetReturnValue( SfxBoolItem(0, bOk) );
+ if ( bOk )
+ SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_SAVEDOCDONE,this));
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_UPDATEDOC:
+ {
+ return;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_DOCINFO:
+ {
+ SFX_REQUEST_ARG(rReq, pDocInfItem, SfxDocumentInfoItem, SID_DOCINFO, FALSE);
+
+ // keine Parameter vorhanden?
+ if ( !pDocInfItem )
+ {
+ // Dialog ausf"uhren
+ SfxDocumentInfo *pOldInfo = new SfxDocumentInfo;
+ if ( pImp->pDocInfo )
+ // r/o-flag korrigieren falls es zu frueh gesetzt wurde
+ pImp->pDocInfo->SetReadOnly( IsReadOnly() );
+ *pOldInfo = GetDocInfo();
+ DocInfoDlg_Impl( GetDocInfo() );
+
+ // ge"andert?
+ if( !(*pOldInfo == GetDocInfo()) )
+ {
+ // Dokument gilt als ver"andert
+ FlushDocInfo();
+ rReq.Done();
+ }
+ else
+ rReq.Ignore();
+
+ delete pOldInfo;
+ }
+ else
+ {
+ // DocInfo aus Parameter anwenden
+ GetDocInfo() = (*pDocInfItem)();
+ FlushDocInfo();
+ }
+
+ return;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_SAVEASURL:
+ case SID_SAVEASDOC:
+ {
+ //!! detaillierte Auswertung eines Fehlercodes
+ SfxObjectShellRef xLock( this );
+ SfxErrorContext aEc(ERRCTX_SFX_SAVEASDOC,GetTitle());
+ SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_SAVEASDOC,this));
+
+ // Bei Calls "uber StarOne OverWrite-Status checken
+ SFX_REQUEST_ARG( rReq, pOverwriteItem, SfxBoolItem, SID_OVERWRITE, FALSE );
+ if ( pOverwriteItem )
+ {
+ // because there is no "exist" function, the overwrite handling is done in the SfxMedium
+ INetURLObject aURL;
+ aURL.SetSmartProtocol( INET_PROT_FILE );
+ SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, SID_FILE_NAME, FALSE );
+ if ( !pItem )
+ // In diesem Falle mu\s ein Dateiname mitkommen
+ SetError( ERRCODE_IO_INVALIDPARAMETER );
+ }
+
+ BOOL bWasReadonly = IsReadOnly();
+ BOOL bOk = SaveAs_Impl(nId == SID_SAVEASURL, &rReq);
+ ULONG lErr=GetErrorCode();
+ if ( !lErr && !bOk )
+ lErr=ERRCODE_IO_GENERAL;
+
+ if ( lErr && bOk )
+ {
+ SFX_REQUEST_ARG( rReq, pWarnItem, SfxBoolItem, SID_FAIL_ON_WARNING, FALSE );
+ if ( pWarnItem && pWarnItem->GetValue() )
+ bOk = FALSE;
+ }
+
+ if ( lErr!=ERRCODE_IO_ABORT )
+ ErrorHandler::HandleError(lErr);
+
+ ResetError();
+ rReq.SetReturnValue( SfxBoolItem(0, bOk) );
+ if ( bOk )
+ {
+ SFX_APP()->NotifyEvent(SfxEventHint(SFX_EVENT_SAVEASDOCDONE,this));
+
+ // Daten am Medium updaten
+ SfxItemSet *pSet = GetMedium()->GetItemSet();
+ pSet->ClearItem( SID_POSTSTRING );
+ pSet->ClearItem( SID_POSTLOCKBYTES );
+ pSet->ClearItem( SID_TEMPLATE );
+ pSet->ClearItem( SID_DOC_READONLY );
+ pSet->ClearItem( SID_CONTENTTYPE );
+ pSet->ClearItem( SID_CHARSET );
+ pSet->ClearItem( SID_FILTER_NAME );
+ pSet->ClearItem( SID_OPTIONS );
+ pSet->ClearItem( SID_FILE_FILTEROPTIONS );
+ pSet->ClearItem( SID_VERSION );
+ SFX_REQUEST_ARG( rReq, pFilterItem, SfxStringItem, SID_FILTER_NAME, FALSE );
+ if ( pFilterItem )
+ pSet->Put( *pFilterItem );
+ SFX_REQUEST_ARG( rReq, pOptionsItem, SfxStringItem, SID_OPTIONS, FALSE );
+ if ( pOptionsItem )
+ pSet->Put( *pOptionsItem );
+ SFX_REQUEST_ARG( rReq, pFilterOptItem, SfxStringItem, SID_FILE_FILTEROPTIONS, FALSE );
+ if ( pFilterOptItem )
+ pSet->Put( *pFilterOptItem );
+ if ( bWasReadonly )
+ Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ }
+
+ Invalidate();
+ break;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_CLOSEDOC:
+ {
+ if ( !rReq.IsAPI() )
+ {
+ SfxViewFrame *pFrame = GetFrame();
+ if ( pFrame && pFrame->GetFrame()->GetParentFrame() )
+ {
+ // Wenn SID_CLOSEDOC "uber Menue etc. ausgef"uhrt wird, das
+ // aktuelle Dokument aber in einem Frame liegt, soll eigentlich
+ // das FrameSetDocument geclosed werden
+ pFrame->GetTopViewFrame()->GetObjectShell()->ExecuteSlot( rReq );
+ return;
+ }
+
+ BOOL bInFrameSet = FALSE;
+ pFrame = SfxViewFrame::GetFirst( this );
+ while ( pFrame )
+ {
+ if ( pFrame->GetFrame()->GetParentFrame() )
+ {
+ // Auf dieses Dokument existiert noch eine Sicht, die
+ // in einem FrameSet liegt; diese darf nat"urlich nicht
+ // geclosed werden
+ bInFrameSet = TRUE;
+ }
+
+ pFrame = SfxViewFrame::GetNext( *pFrame, this );
+ }
+
+ if ( bInFrameSet )
+ {
+ // Alle Sichten, die nicht in einem FrameSet liegen, closen
+ pFrame = SfxViewFrame::GetFirst( this );
+ while ( pFrame )
+ {
+ if ( !pFrame->GetFrame()->GetParentFrame() )
+ pFrame->GetFrame()->DoClose();
+ pFrame = SfxViewFrame::GetNext( *pFrame, this );
+ }
+ }
+ }
+
+ // Parameter auswerten
+ SFX_REQUEST_ARG(rReq, pSaveItem, SfxBoolItem, SID_CLOSEDOC_SAVE, FALSE);
+ SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_CLOSEDOC_FILENAME, FALSE);
+ if ( pSaveItem )
+ {
+ if ( pSaveItem->GetValue() )
+ {
+ if ( !pNameItem )
+ {
+ SbxBase::SetError( SbxERR_WRONG_ARGS );
+ rReq.Ignore();
+ return;
+ }
+ SfxAllItemSet aArgs( GetPool() );
+ SfxStringItem aTmpItem( SID_FILE_NAME, pNameItem->GetValue() );
+ aArgs.Put( aTmpItem, aTmpItem.Which() );
+ SfxRequest aSaveAsReq( SID_SAVEASDOC, SFX_CALLMODE_API, aArgs );
+ ExecFile_Impl( aSaveAsReq );
+ if ( !aSaveAsReq.IsDone() )
+ {
+ rReq.Ignore();
+ return;
+ }
+ }
+ else
+ SetModified(FALSE);
+ }
+ else if ( rReq.IsAPI() )
+ {
+ SbxBase::SetError( SbxERR_WRONG_ARGS );
+ rReq.Ignore();
+ return;
+ }
+
+ // Benutzer bricht ab?
+ if ( !PrepareClose( !rReq.IsAPI() ) )
+ {
+ rReq.SetReturnValue( SfxBoolItem(0, FALSE) );
+ rReq.Done();
+ return;
+ }
+
+ ULONG lErr = GetErrorCode();
+ ErrorHandler::HandleError(lErr);
+
+ rReq.SetReturnValue( SfxBoolItem(0, TRUE) );
+ rReq.Done();
+ rReq.ReleaseArgs(); // da der Pool in Close zerst"ort wird
+ if ( rReq.IsAPI() )
+ // falls Handler eines Controls dies ruft, sonst GPF nach return
+ {
+ if( !pImp->pCloser )
+ {
+
+ if ( pPendingCloser )
+ pPendingCloser->ForcePendingCall();
+ pImp->pCloser = new AsynchronLink(
+ Link( 0, SfxObjectShellClose_Impl ) );
+ pImp->pCloser->Call( this );
+ pPendingCloser = pImp->pCloser;
+ }
+ }
+ else
+ DoClose();
+ return;
+ }
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_DOCTEMPLATE:
+ {
+ // speichern als Dokumentvorlagen
+ SfxDocumentTemplateDlg *pDlg = 0;
+ SfxErrorContext aEc(ERRCTX_SFX_DOCTEMPLATE,GetTitle());
+ SfxDocumentTemplates *pTemplates = new SfxDocumentTemplates;
+ pTemplates->Construct();
+
+ if ( !rReq.GetArgs() )
+ {
+ pDlg = new SfxDocumentTemplateDlg(0, pTemplates);
+ if ( RET_OK == pDlg->Execute() && pDlg->GetTemplateName().Len())
+ {
+ rReq.AppendItem(SfxStringItem(
+ SID_FILE_NAME, pTemplates->GetTemplatePath(
+ pDlg->GetRegion(),
+ pDlg->GetTemplateName())));
+
+ rReq.AppendItem(SfxStringItem(
+ SID_TEMPLATE_NAME, pDlg->GetTemplateName()));
+ rReq.AppendItem(SfxUInt16Item(
+ SID_TEMPLATE_REGION, pDlg->GetRegion()));
+ }
+ else
+ {
+ delete pDlg;
+ rReq.Ignore();
+ return;
+ }
+ }
+
+ // Region und Name aus Parameter holen
+ SFX_REQUEST_ARG(rReq, pRegionItem, SfxStringItem, SID_TEMPLATE_REGIONNAME, FALSE);
+ SFX_REQUEST_ARG(rReq, pNameItem, SfxStringItem, SID_TEMPLATE_NAME, FALSE);
+ SFX_REQUEST_ARG(rReq, pRegionNrItem, SfxUInt16Item, SID_TEMPLATE_REGION, FALSE);
+ if ( (!pRegionItem && !pRegionNrItem ) || !pNameItem )
+ {
+ DBG_ASSERT( rReq.IsAPI(), "non-API call without Arguments" );
+ SbxBase::SetError( SbxERR_WRONG_ARGS );
+ rReq.Ignore();
+ return;
+ }
+ String aTemplateName = pNameItem->GetValue();
+
+ // Region-Nr besorgen
+ USHORT nRegion;
+ if( pRegionItem )
+ {
+ // Region-Name finden (eigentlich nicht unbedingt eindeutig)
+ nRegion = pTemplates->GetRegionNo( pRegionItem->GetValue() );
+ if ( nRegion == USHRT_MAX )
+ {
+ SbxBase::SetError( ERRCODE_IO_INVALIDPARAMETER );
+ rReq.Ignore();
+ return;
+ }
+ }
+ if ( pRegionNrItem )
+ nRegion = pRegionNrItem->GetValue();
+
+ // kein File-Name angegeben?
+ if ( SFX_ITEM_SET != rReq.GetArgs()->GetItemState( SID_FILE_NAME ) )
+ {
+ // TemplatePath nicht angebgeben => aus Region+Name ermitteln
+ // Dateiname zusammenbauen lassen
+ String aTemplPath = pTemplates->GetTemplatePath(
+ nRegion, aTemplateName );
+ rReq.AppendItem(
+ SfxStringItem(SID_FILE_NAME, aTemplPath) );
+ rReq.AppendItem( SfxStringItem(SID_FILE_NAME, aTemplPath) );
+ }
+
+
+ // Dateiname
+ SFX_REQUEST_ARG(rReq, pFileItem, SfxStringItem, SID_FILE_NAME, FALSE);
+ const String aFileName(((const SfxStringItem *)pFileItem)->GetValue());
+
+ // Filter
+ const SfxFilter* pFilter;
+ const SfxObjectFactory& rFactory = GetFactory();
+ USHORT nFilterCount = rFactory.GetFilterCount();
+ int n;
+ for( n=0; n<nFilterCount; n++)
+ {
+ pFilter = rFactory.GetFilter( n );
+ if( pFilter && pFilter->IsOwnFormat() &&
+ pFilter->IsOwnTemplateFormat() )
+ break;
+ }
+ DBG_ASSERT( n < nFilterCount && pFilter, "Template Filter nicht gefunden" );
+ if( !pFilter || n == nFilterCount )
+ pFilter = rFactory.GetFilter(0);
+
+ // Medium zusammenbauen
+ SfxItemSet* pSet = new SfxAllItemSet( *rReq.GetArgs() );
+ pSet->Put( SfxStringItem( SID_DOCTEMPLATE, aTemplateName ) );
+ SfxMedium aMedium( aFileName, STREAM_STD_READWRITE | STREAM_TRUNC,
+ FALSE, FALSE, pFilter, pSet);
+
+ // als Vorlage speichern
+ BOOL bModified = IsModified();
+ BOOL bHasTemplateConfig = HasTemplateConfig();
+ SetTemplateConfig( FALSE );
+ BOOL bOK = FALSE;
+ const String aOldURL( INetURLObject::GetBaseURL() );
+ if( ShallSetBaseURL_Impl( aMedium ) )
+ INetURLObject::SetBaseURL(
+ aMedium.GetURLObject().GetMainURL() );
+ else
+ INetURLObject::SetBaseURL( String() );
+
+ aMedium.CreateTempFile();
+
+ // Because we can't save into a storage directly ( only using tempfile ), we must save the DocInfo first, then
+ // we can call SaveTo_Impl and Commit
+ if ( pFilter->UsesStorage() )
+ {
+ SfxDocumentInfo *pInfo = new SfxDocumentInfo;
+ pInfo->CopyUserData(GetDocInfo());
+ pInfo->SetTitle( aTemplateName );
+ pInfo->SetChanged( SfxStamp(SFX_INIMANAGER()->GetUserFullName()));
+ SvStorageRef aRef = aMedium.GetStorage();
+ if ( aRef.Is() )
+ {
+ pInfo->SetTime(0L);
+ pInfo->Save(aRef);
+ }
+
+ delete pInfo;
+ }
+
+ if ( SaveTo_Impl(aMedium) )
+ {
+ bOK = TRUE;
+ aMedium.Commit();
+ pTemplates->NewTemplate( nRegion, aTemplateName, aFileName );
+ }
+
+ INetURLObject::SetBaseURL( aOldURL );
+
+ DELETEX(pDlg);
+
+ SetError(aMedium.GetErrorCode());
+ ULONG lErr=GetErrorCode();
+ if(!lErr && !bOK)
+ lErr=ERRCODE_IO_GENERAL;
+ ErrorHandler::HandleError(lErr);
+ ResetError();
+ delete pTemplates;
+ HACK(warum qualifiziert? SfxObjectShell::) DoSaveCompleted();
+ SetTemplateConfig( bHasTemplateConfig );
+ SetModified(bModified);
+ rReq.SetReturnValue( SfxBoolItem( 0, bOK ) );
+ if ( !bOK )
+ return;
+ break;
+ }
+ }
+
+ // Picklisten-Eintrag verhindern
+ if ( rReq.IsAPI() )
+ GetMedium()->SetUpdatePickList( FALSE );
+ else if ( rReq.GetArgs() )
+ {
+ SFX_ITEMSET_GET( *rReq.GetArgs(), pPicklistItem, SfxBoolItem, SID_PICKLIST, FALSE );
+ if ( pPicklistItem )
+ GetMedium()->SetUpdatePickList( pPicklistItem->GetValue() );
+ }
+
+ // Ignore()-Zweige haben schon returnt
+ rReq.Done();
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
+{
+ DBG_CHKTHIS(SfxObjectShell, 0);
+ SfxWhichIter aIter( rSet );
+ SfxInPlaceObject *pObj=GetInPlaceObject();
+ for ( USHORT nWhich = aIter.FirstWhich(); nWhich; nWhich = aIter.NextWhich() )
+ {
+ switch ( nWhich )
+ {
+ case SID_DOCTEMPLATE :
+ {
+ if ( !GetFactory().GetTemplateFilter() )
+ rSet.DisableItem( nWhich );
+ break;
+ }
+
+ case SID_VERSION:
+ {
+ SfxObjectShell *pDoc = this;
+ SfxViewFrame* pFrame = GetFrame();
+ if ( !pFrame )
+ pFrame = SfxViewFrame::GetFirst( this );
+ if ( pFrame )
+ {
+ if ( pFrame->GetFrame()->GetParentFrame() )
+ {
+ pFrame = pFrame->GetTopViewFrame();
+ pDoc = pFrame->GetObjectShell();
+ }
+ }
+
+ if ( !pFrame || !pDoc->HasName() ||
+ !IsOwnStorageFormat_Impl( *pDoc->GetMedium() ) ||
+ pDoc->GetMedium()->GetStorage()->GetVersion() < SOFFICE_FILEFORMAT_50 )
+ rSet.DisableItem( nWhich );
+ break;
+ }
+ case SID_SAVEDOC:
+ case SID_UPDATEDOC:
+ if (pObj && pObj->GetProtocol().IsEmbed())
+ {
+ String aEntry (SfxResId(STR_UPDATEDOC));
+ aEntry += ' ';
+ aEntry += GetInPlaceObject()->GetDocumentName();
+ rSet.Put(SfxStringItem(nWhich, aEntry));
+ }
+ else
+ {
+ BOOL bMediumRO = IsReadOnlyMedium();
+ if ( !bMediumRO && GetMedium() && IsModified() )
+ rSet.Put(SfxStringItem(
+ nWhich, String(SfxResId(STR_SAVEDOC))));
+ else
+ rSet.DisableItem(nWhich);
+ }
+ break;
+
+ case SID_DOCINFO:
+ if ( 0 != ( pImp->eFlags & SFXOBJECTSHELL_NODOCINFO ) )
+ rSet.DisableItem( nWhich );
+ else
+ rSet.Put( SfxDocumentInfoItem( GetTitle(), GetDocInfo() ) );
+ break;
+
+ case SID_CLOSEDOC:
+ {
+ SfxObjectShell *pDoc = this;
+ SfxViewFrame *pFrame = GetFrame();
+ if ( pFrame && pFrame->GetFrame()->GetParentFrame() )
+ {
+ // Wenn SID_CLOSEDOC "uber Menue etc. ausgef"uhrt wird, das
+ // aktuelle Dokument aber in einem Frame liegt, soll eigentlich
+ // das FrameSetDocument geclosed werden
+ pDoc = pFrame->GetTopViewFrame()->GetObjectShell();
+ }
+
+ if ( pDoc->GetFlags() & SFXOBJECTSHELL_DONTCLOSE )
+ rSet.DisableItem(nWhich);
+ else if ( pObj && pObj->GetProtocol().IsEmbed() )
+ {
+ String aEntry (SfxResId(STR_CLOSEDOC_ANDRETURN));
+ aEntry += pObj->GetDocumentName();
+ rSet.Put( SfxStringItem(nWhich, aEntry) );
+ }
+ else
+ rSet.Put(SfxStringItem(nWhich, String(SfxResId(STR_CLOSEDOC))));
+ break;
+ }
+
+ case SID_SAVEASDOC:
+ {
+ if( ( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) != SFX_LOADED_MAINDOCUMENT )
+ {
+ rSet.DisableItem( nWhich );
+ break;
+ }
+
+ if ( !GetMedium() )
+ rSet.DisableItem(nWhich);
+ else if ( pObj && pObj->GetProtocol().IsEmbed() )
+ rSet.Put( SfxStringItem( nWhich, String( SfxResId( STR_SAVECOPYDOC ) ) ) );
+ else
+ rSet.Put( SfxStringItem( nWhich, String( SfxResId( STR_SAVEASDOC ) ) ) );
+ break;
+ }
+
+ case SID_DOC_MODIFIED:
+ {
+ rSet.Put( SfxStringItem( SID_DOC_MODIFIED, IsModified() ? '*' : ' ' ) );
+ break;
+ }
+
+ case SID_MODIFIED:
+ {
+ rSet.Put( SfxBoolItem( SID_MODIFIED, IsModified() ) );
+ break;
+ }
+
+ case SID_DOCINFO_TITLE:
+ {
+ rSet.Put( SfxStringItem(
+ SID_DOCINFO_TITLE, GetDocInfo().GetTitle() ) );
+ break;
+ }
+ case SID_FILE_NAME:
+ {
+ if( GetMedium() && HasName() )
+ rSet.Put( SfxStringItem(
+ SID_FILE_NAME, GetMedium()->GetName() ) );
+ break;
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::ExecProps_Impl(SfxRequest &rReq)
+{
+ switch ( rReq.GetSlot() )
+ {
+ case SID_MODIFIED:
+ {
+ SetModified( ( (SfxBoolItem&) rReq.GetArgs()->Get(SID_MODIFIED)).GetValue() );
+ rReq.Done();
+ break;
+ }
+
+ case SID_DOCTITLE:
+ SetTitle( ( (SfxStringItem&) rReq.GetArgs()->Get(SID_DOCTITLE)).GetValue() );
+ rReq.Done();
+ break;
+
+ case SID_ON_CREATEDOC:
+ case SID_ON_OPENDOC:
+ case SID_ON_PREPARECLOSEDOC:
+ case SID_ON_CLOSEDOC:
+ case SID_ON_SAVEDOC:
+ case SID_ON_SAVEASDOC:
+ case SID_ON_ACTIVATEDOC:
+ case SID_ON_DEACTIVATEDOC:
+ case SID_ON_PRINTDOC:
+ case SID_ON_SAVEDOCDONE:
+ case SID_ON_SAVEASDOCDONE:
+ SFX_APP()->EventExec_Impl( rReq, this );
+ break;
+
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ case SID_PLAYMACRO:
+ {
+ SFX_APP()->PlayMacro_Impl( rReq, GetBasic() );
+ break;
+ }
+
+ case SID_DOCINFO_AUTHOR :
+ {
+ String aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
+ SfxStamp aStamp( GetDocInfo().GetCreated() );
+ aStamp.SetName( aStr );
+ GetDocInfo().SetCreated( aStamp );
+ break;
+ }
+
+ case SID_DOCINFO_COMMENTS :
+ {
+ String aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
+ GetDocInfo().SetComment( aStr );
+ break;
+ }
+
+ case SID_DOCINFO_KEYWORDS :
+ {
+ String aStr = ( (SfxStringItem&)rReq.GetArgs()->Get(rReq.GetSlot())).GetValue();
+ GetDocInfo().SetKeywords( aStr );
+ break;
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet)
+{
+ SfxWhichIter aIter(rSet);
+ for ( USHORT nSID = aIter.FirstWhich(); nSID; nSID = aIter.NextWhich() )
+ {
+ switch ( nSID )
+ {
+ case SID_DOCINFO_AUTHOR :
+ {
+ String aStr = GetDocInfo().GetCreated().GetName();
+ rSet.Put( SfxStringItem( nSID, aStr ) );
+ break;
+ }
+
+ case SID_DOCINFO_COMMENTS :
+ {
+ String aStr = GetDocInfo().GetComment();
+ rSet.Put( SfxStringItem( nSID, aStr ) );
+ break;
+ }
+
+ case SID_DOCINFO_KEYWORDS :
+ {
+ String aStr = GetDocInfo().GetKeywords();
+ rSet.Put( SfxStringItem( nSID, aStr ) );
+ break;
+ }
+
+ case SID_DOCPATH:
+ {
+ String aPath;
+ if ( GetMedium() )
+ {
+ INetURLObject aURL( GetMedium()->GetName() );
+ if ( INET_PROT_FILE == aURL.GetProtocol() )
+ aURL.removeSegment();
+ aPath = aURL.PathToFileName();
+ }
+ rSet.Put( SfxStringItem( SID_DOCPATH, aPath ) );
+ break;
+ }
+
+ case SID_DOCFULLNAME:
+ {
+ rSet.Put( SfxStringItem( SID_DOCFULLNAME, GetTitle(SFX_TITLE_FULLNAME) ) );
+ break;
+ }
+
+ case SID_DOCTITLE:
+ {
+ rSet.Put( SfxStringItem( SID_DOCTITLE, GetTitle() ) );
+ break;
+ }
+
+ case SID_DOC_READONLY:
+ {
+ rSet.Put( SfxBoolItem( SID_DOC_READONLY, IsReadOnly() ) );
+ break;
+ }
+
+ case SID_DOC_SAVED:
+ {
+ rSet.Put( SfxBoolItem( SID_DOC_SAVED, !IsModified() ) );
+ break;
+ }
+
+ case SID_CLOSING:
+ {
+ rSet.Put( SfxBoolItem( SID_CLOSING, Get_Impl()->bInCloseEvent ) );
+ break;
+ }
+
+ case SID_THISDOCUMENT:
+ {
+ rSet.Put( SfxObjectItem( SID_THISDOCUMENT, this ) );
+ break;
+ }
+
+ case SID_THISWINDOW:
+ {
+ rSet.Put( SfxObjectItem( SID_THISWINDOW, SfxViewFrame::GetFirst(this) ) );
+ break;
+ }
+
+ case SID_ON_CREATEDOC:
+ case SID_ON_OPENDOC:
+ case SID_ON_PREPARECLOSEDOC:
+ case SID_ON_CLOSEDOC:
+ case SID_ON_SAVEDOC:
+ case SID_ON_SAVEASDOC:
+ case SID_ON_ACTIVATEDOC:
+ case SID_ON_DEACTIVATEDOC:
+ case SID_ON_PRINTDOC:
+ case SID_ON_SAVEDOCDONE:
+ case SID_ON_SAVEASDOCDONE:
+ SFX_APP()->EventState_Impl( nSID, rSet, this );
+ break;
+
+ case SID_DOC_LOADING:
+ rSet.Put( SfxBoolItem( nSID, SFX_LOADED_MAINDOCUMENT !=
+ ( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) ) );
+ break;
+
+ case SID_IMG_LOADING:
+ rSet.Put( SfxBoolItem( nSID, SFX_LOADED_IMAGES !=
+ ( pImp->nLoadedFlags & SFX_LOADED_IMAGES ) ) );
+ break;
+
+ case SID_ACTIVEMODULE:
+ {
+ SfxShell *pSh = GetModule();
+ if ( !pSh )
+ pSh = this;
+ rSet.Put( SfxObjectItem( SID_ACTIVEMODULE, pSh ) );
+ break;
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::ExecView_Impl(SfxRequest &rReq)
+{
+ switch ( rReq.GetSlot() )
+ {
+ case SID_ACTIVATE:
+ {
+ SfxViewFrame *pFrame =
+ SfxViewFrame::GetFirst( this, TYPE(SfxTopViewFrame), TRUE );
+ if ( pFrame )
+ pFrame->GetFrame()->Appear();
+ rReq.SetReturnValue( SfxObjectItem( 0, pFrame ) );
+ rReq.Done();
+ break;
+ }
+ case SID_NEWWINDOWFOREDIT:
+ {
+ SfxViewFrame* pFrame = SfxViewFrame::Current();
+ if( pFrame->GetObjectShell() == this &&
+ ( pFrame->GetFrameType() & SFXFRAME_HASTITLE ) )
+ pFrame->ExecuteSlot( rReq );
+ else
+ {
+ String aFileName( GetObjectShell()->GetMedium()->GetName() );
+ if ( aFileName.Len() )
+ {
+ SfxStringItem aName( SID_FILE_NAME, aFileName );
+ SfxBoolItem aCreateView( SID_OPEN_NEW_VIEW, TRUE );
+ SFX_APP()->GetAppDispatcher_Impl()->Execute(
+ SID_OPENDOC, SFX_CALLMODE_ASYNCHRON, &aName,
+ &aCreateView, 0L);
+ }
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::StateView_Impl(SfxItemSet &rSet)
+{
+}
+
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
new file mode 100644
index 000000000000..88d97cacf076
--- /dev/null
+++ b/sfx2/source/doc/objstor.cxx
@@ -0,0 +1,2044 @@
+/*************************************************************************
+ *
+ * $RCSfile: objstor.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SVSTOR_HXX //autogen
+#include <so3/svstor.hxx>
+#endif
+#ifndef _EXTATTR_HXX //autogen
+#include <svtools/extattr.hxx>
+#endif
+#ifndef _ZCODEC_HXX //autogen
+#include <tools/zcodec.hxx>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSTORABLE_HPP_
+#include <com/sun/star/frame/XStorable.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_DATATRANSFEREVENT_HPP_
+#include <com/sun/star/io/DataTransferEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HPP_
+#include <com/sun/star/io/XDataImporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HPP_
+#include <com/sun/star/io/XDataTransferEventListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATAEXPORTER_HPP_
+#include <com/sun/star/io/XDataExporter.hpp>
+#endif
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#pragma hdrstop
+
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include <unotools/processfactory.hxx>
+#endif
+
+#ifndef _SO_CLSIDS_HXX
+#include <so3/clsids.hxx>
+#endif
+#ifndef _CACHESTR_HXX
+#include <tools/cachestr.hxx>
+#endif
+
+#include "objsh.hxx"
+#include "childwin.hxx"
+#include "inimgr.hxx"
+#include "sfxdir.hxx"
+#include "request.hxx"
+#include "saveopt.hxx"
+#include "sfxresid.hxx"
+#include "iodlg.hxx"
+#include "docfile.hxx"
+#include "fltfnc.hxx"
+#include "docfilt.hxx"
+#include "docinf.hxx"
+#include "docfac.hxx"
+#include "cfgmgr.hxx"
+#include "objshimp.hxx"
+#include "sfxtypes.hxx"
+#include "appdata.hxx"
+#include "doc.hrc"
+#include "sfxsids.hrc"
+#include "interno.hxx"
+#include "module.hxx"
+#include "dispatch.hxx"
+#include "openflag.hxx"
+#include "helper.hxx"
+
+#define S2BS(s) ByteString( s, RTL_TEXTENCODING_MS_1252 )
+
+class DataTransferEventListener_Impl : public ::com::sun::star::io::XDataTransferEventListener ,
+ public ::com::sun::star::lang::XTypeProvider ,
+ public ::cppu::OWeakObject
+{
+private:
+ SfxObjectShellRef xDoc;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xTransfer;
+
+public:
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ DataTransferEventListener_Impl( SfxObjectShell *pDoc, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xRef )
+ : xDoc( pDoc )
+ , xTransfer( xRef )
+ {}
+
+ ~DataTransferEventListener_Impl();
+
+ void Finish();
+ virtual void SAL_CALL finished(const ::com::sun::star::io::DataTransferEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL cancelled(const ::com::sun::star::io::DataTransferEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject &) throw( ::com::sun::star::uno::RuntimeException );
+};
+
+SFX_IMPL_XINTERFACE_2( DataTransferEventListener_Impl, OWeakObject, ::com::sun::star::io::XDataTransferEventListener, ::com::sun::star::lang::XEventListener )
+SFX_IMPL_XTYPEPROVIDER_2( DataTransferEventListener_Impl, ::com::sun::star::io::XDataTransferEventListener, ::com::sun::star::lang::XEventListener )
+
+void DataTransferEventListener_Impl::Finish()
+{
+ if ( xDoc.Is() )
+ {
+ if ( !xDoc->Get_Impl()->nLoadedFlags )
+ xDoc->FinishedLoading();
+ xDoc.Clear();
+ }
+
+ xTransfer = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > ();
+}
+
+DataTransferEventListener_Impl::~DataTransferEventListener_Impl()
+{
+ Finish();
+}
+
+void SAL_CALL DataTransferEventListener_Impl::disposing(const ::com::sun::star::lang::EventObject &) throw( ::com::sun::star::uno::RuntimeException )
+{
+ Finish();
+}
+
+void SAL_CALL DataTransferEventListener_Impl::finished(const ::com::sun::star::io::DataTransferEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException )
+{
+ Finish();
+}
+
+void SAL_CALL DataTransferEventListener_Impl::cancelled(const ::com::sun::star::io::DataTransferEvent& aEvent) throw( ::com::sun::star::uno::RuntimeException )
+{
+ Finish();
+}
+
+extern sal_uInt32 CheckPasswd_Impl( Window*, SfxItemPool&, SfxMedium* );
+
+//=========================================================================
+
+sal_Bool ShallSetBaseURL_Impl( SfxMedium &rMed )
+{
+ SfxOptions &rOpt = SFX_APP()->GetOptions();
+ sal_Bool bIsRemote = rMed.IsRemote();
+ return rOpt.IsSaveRelINet() && bIsRemote ||
+ rOpt.IsSaveRelFSys() && !bIsRemote;
+}
+
+//=========================================================================
+
+sal_Bool SfxObjectShell::Save()
+{
+ return SaveInfoAndConfig_Impl( GetMedium()->GetStorage() );
+}
+
+//--------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::SaveAs( SvStorage* pNewStg )
+{
+ return SaveInfoAndConfig_Impl( pNewStg );
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool GetPasswd_Impl( const SfxItemSet* pSet, String& rPasswd )
+{
+ const SfxPoolItem* pItem = NULL;
+ if ( pSet && SFX_ITEM_SET == pSet->GetItemState( SID_PASSWORD, sal_True, &pItem ) )
+ {
+ DBG_ASSERT( pItem->IsA( TYPE(SfxStringItem) ), "wrong item type" );
+ rPasswd = ( (const SfxStringItem*)pItem )->GetValue();
+ return sal_True;
+ }
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+sal_Bool SfxObjectShell::DoInitNew_Impl( const String& rName )
+
+/* [Beschreibung]
+*/
+
+{
+ if ( rName.Len() )
+ {
+ ModifyBlocker_Impl aBlock( this );
+ pMedium = new SfxMedium( rName, SFX_STREAM_READONLY_MAKECOPY, sal_False );
+ if ( InitNew( pMedium->GetStorage() ) )
+ {
+ bIsTmp = !( pMedium->GetStorage() );
+ if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode )
+ SetTitle( String( SfxResId( STR_NONAME ) ));
+ return sal_True;
+ }
+ return sal_False;
+ }
+ else
+ return DoInitNew(0);
+}
+
+
+sal_Bool SfxObjectShell::DoInitNew( SvStorage * pStor )
+
+/* [Beschreibung]
+
+ Diese von SvPersist geerbte virtuelle Methode wird gerufen, um
+ die SfxObjectShell-Instanz aus einem Storage (pStor != 0) bzw.
+ (pStor == 0) ganz neu zu initialisieren.
+
+ Wie alle Do...-Methoden liegt hier eine Steuerung vor, die eigentliche
+ Implementierung erfolgt, indem die ebenfalls virtuellen Methode
+ InitNew(SvStorate*) von der SfxObjectShell-Subclass implementiert wird.
+
+ F"ur pStor == 0 wird ein die SfxObjectShell-Instanz mit einem leeren
+ SfxMedium verbunden, sonst mit einem SfxMedium, welches auf den
+ als Parameter "ubergeben SvStorage verweist.
+
+ Erst nach InitNew() oder Load() ist das Objekt korrekt initialisiert.
+
+ [R"uckgabewert]
+ sal_True Das Objekt wurde initialisiert.
+ sal_False Das Objekt konnte nicht initialisiert werden
+*/
+
+{
+ ModifyBlocker_Impl aBlock( this );
+ if ( pStor )
+ pMedium = new SfxMedium( pStor );
+ else
+ {
+ bIsTmp = sal_True;
+ pMedium = new SfxMedium;
+ }
+
+ if ( InitNew( pStor ) )
+ {
+ if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode )
+ SetTitle( String( SfxResId( STR_NONAME ) ));
+ return sal_True;
+ }
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::DoHandsOff()
+
+/* [Beschreibung]
+
+ Diese von SvPersist geerbte virtuelle Methode wird gerufen, um
+ das Objekt aufzufordern, den ihm zugeteilten SvStorage freizugeben,
+ insbesondere Substorages und Streams zu schlie"sen.
+
+ Als Do...-Methode liegt hier nur die Steuerung. Der Implementierer
+ von Subclasses kann die ebenfalls virtuelle Methode HandsOff()
+ implementieren, um seine Substorages und Streams zu schlie"sen.
+
+ Nach dem Aufruf dieser Methode, ist dem Objekt kein SfxMedium mehr
+ zugeordnet, bis SaveCompleted() durchlaufen ist.
+*/
+
+{
+ const SfxFilter *pFilter = pMedium->GetFilter();
+ if( !pFilter || pFilter->IsOwnFormat() || ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) )
+ HandsOff();
+ pMedium->Close();
+// DELETEZ( pMedium );
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoLoad(
+ const String& rFileName, StreamMode nStreamMode, StorageMode nStorageMode)
+{
+ // Es wird nur die IPersistStorage-Schnittstelle angeboten
+ ModifyBlocker_Impl aBlock( this );
+ SvStorageRef xStor = new SvStorage( rFileName, nStreamMode | STREAM_WRITE, nStorageMode );
+ if( !xStor.Is() )
+ xStor = new SvStorage( rFileName, nStreamMode, nStorageMode );
+
+ if ( SVSTREAM_OK == xStor->GetError() )
+ {
+ SfxMedium* pMedium = new SfxMedium( xStor );
+ pMedium->SetName( rFileName );
+ pMedium->Init_Impl();
+
+ // Muss !!!
+ SetFileName( rFileName );
+
+ if( DoLoad( pMedium ) )
+ {
+ if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode )
+ SetTitle( rFileName );
+ return sal_True;
+ }
+ }
+ return sal_False;
+}
+
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoLoad( SvStorage * pStor )
+
+/* [Beschreibung]
+
+ Diese von SvPersist geerbte virtuelle Methode steuert das Laden
+ des Objektes aus einem Storage. Dabei wird der SvStorage zun"achst
+ in einem SfxMedium verpackt und SfxObjectShell::DoLoad(SfxMedium*)
+ mit diesem gerufen.
+
+ [R"uckgabewert]
+ sal_True Das Objekt wurde initialisiert.
+ sal_False Das Objekt konnte nicht initialisiert werden
+*/
+
+{
+ pMedium = new SfxMedium( pStor );
+ if ( DoLoad(pMedium) )
+ {
+ if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode )
+ {
+ ModifyBlocker_Impl aBlock( this );
+ // bei Embedded Objekten setzt sonst keiner den Namen
+// DBG_ASSERT( pStor->GetName().Len(),
+// "StorageName hat Laenge Null" );
+ SetTitle( pStor->GetName() );
+ }
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed )
+
+/* [Beschreibung]
+
+ Diese Methode steuert das Laden des Objektes aus dem von dem
+ "ubergebenen SfxMedium beschriebenen Medium. Hinterher ist das Objekt
+ mit diesem SfxMedium verbunden.
+
+ Handelt es sich bei dem SfxMedium um einen Storage im eigenen Format,
+ wird die virtuelle Methode SvPersit::Load(SvStorage*) gerufen, welche
+ die Implementierer von Subclasses "uberladen m"ussen, um das Objekt
+ aus einem eigenen Storage zu laden (=> Swapping m"oeglich).
+
+ Handelt es sich bei dem SfxMedium um einen Storage in einem fremden
+ Format, oder um ein Flat-File, dann wird die virtuelle Methode
+ <SfxObjectShell::ConvertFrom(SfxMedium*)> gerufen, welche die
+ Implementierer von Subclasses "uberladen m"ussen, um das Objekt
+ aus dem SfxMedium zu konvertieren. W"ahrend der Bearbeitung ist
+ das Objekt dann mit einem tempor"aren SvStorage verbunden.
+
+ Erst nach InitNew() oder Load() ist das Objekt korrekt
+ initialisiert.
+
+ [R"uckgabewert]
+ sal_True Das Objekt wurde geladen.
+ sal_False Das Objekt konnte nicht geladen werden
+*/
+
+{
+ SfxApplication *pSfxApp = SFX_APP();
+ ModifyBlocker_Impl aBlock( this );
+
+ if ( SFX_CREATE_MODE_EMBEDDED != eCreateMode )
+ GetpApp()->ShowStatusText( SfxResId(STR_DOC_LOADING) );
+
+ pMedium = pMed;
+ sal_Bool bOk = sal_False;
+ const SfxFilter* pFilter = pMed->GetFilter();
+ SfxItemSet* pSet = pMedium->GetItemSet();
+ if( !pImp->nEventId )
+ {
+ SFX_ITEMSET_ARG(
+ pSet, pTemplateItem, SfxBoolItem,
+ SID_TEMPLATE, sal_False);
+ SFX_ITEMSET_ARG(
+ pSet, pBrowsingItem, SfxBoolItem, SID_BROWSING, sal_False );
+ SetActivateEvent_Impl(
+ ( pTemplateItem && pTemplateItem->GetValue() )
+ ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC,
+ pBrowsingItem && pBrowsingItem->GetValue() );
+ }
+
+
+ SFX_ITEMSET_ARG( pSet, pBaseItem, SfxStringItem,
+ SID_BASEURL, sal_False);
+ String aBaseURL;
+ if( pBaseItem ) aBaseURL = pBaseItem->GetValue();
+ else
+ {
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
+ {
+ aBaseURL = INetURLObject::GetBaseURL();
+ SetBaseURL( aBaseURL );
+ }
+ else if ( pSalvageItem )
+ {
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( INET_PROT_FILE );
+ aObj.SetSmartURL( pMed->GetPhysicalName() );
+ aBaseURL = aObj.GetMainURL();
+ }
+ else
+ aBaseURL = pMed->GetName();
+ }
+
+ SfxApplication* pApp = SFX_APP();
+ pImp->nLoadedFlags = 0;
+ sal_Bool bProvidesData = pMedium->ProvidesData_Impl();
+ sal_Bool bHasStorage = !pFilter || ( pFilter->IsOwnFormat() && pFilter->UsesStorage() && !(pFilter->GetFilterFlags() & SFX_FILTER_PLUGIN ) );
+ if ( !bHasStorage && pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) )
+ {
+ bHasStorage = pMed->TryStorage();
+ if ( bHasStorage )
+ {
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( INET_PROT_FILE );
+ aObj.SetSmartURL( pMed->GetPhysicalName() );
+ aBaseURL = aObj.GetMainURL();
+ }
+ }
+
+ if ( bHasStorage )
+ {
+ SvStorageRef xStor( pMed->GetStorage() );
+ // Undoobjekte aufraeumen, muss vor dem eigentlichen Laden erfolgen
+ if(xStor.Is() && !xStor->GetError() )
+ {
+ SvEmbeddedObjectRef xThis = this;
+ SvPersistRef xPer;
+ if ( xThis.Is() )
+ xPer = new SvEmbeddedObject;
+ else
+ xPer = new SvPersist;
+
+ xPer->DoOwnerLoad(xStor);
+ xPer->CleanUp();
+ xPer->DoSave();
+ xPer->DoSaveCompleted( 0 );
+ }
+
+ // Load
+ const String aOldURL( INetURLObject::GetBaseURL() );
+ if( aBaseURL.Len() ) INetURLObject::SetBaseURL( aBaseURL );
+ pImp->nLoadedFlags = 0;
+ bOk = xStor.Is() && LoadOwnFormat( *pMed );
+ INetURLObject::SetBaseURL( aOldURL );
+
+ if ( bOk )
+ {
+ GetDocInfo().Load(xStor);
+ bHasName = sal_True;
+ }
+ else
+ SetError( ERRCODE_ABORT );
+ }
+ else if ( InitNew(0) )
+ {
+ // Name vor ConvertFrom setzen, damit GetSbxObject() schon funktioniert
+ bHasName = sal_True;
+ SetName( SfxResId( STR_NONAME ) );
+
+ // Importieren
+ const String aOldURL( INetURLObject::GetBaseURL() );
+ if( aBaseURL.Len() ) INetURLObject::SetBaseURL( aBaseURL );
+ if( bProvidesData && !pMedium->GetFilter()->UsesStorage() )
+ pMedium->GetInStream();
+
+ pImp->nLoadedFlags = 0;
+ if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
+ {
+ bOk = ImportFrom(*pMedium);
+ }
+ else
+ {
+ bOk = ConvertFrom(*pMedium);
+ }
+
+ INetURLObject::SetBaseURL( aOldURL );
+
+ if( bProvidesData && bOk && pMedium->GetOpenMode() & STREAM_WRITE )
+ //Medium offen halten um andere Zugriffe zu verhindern
+ {
+ if(pMedium->GetFilter() && pMedium->GetFilter()->UsesStorage())
+ pMedium->GetStorage();
+ else
+ pMedium->GetInStream();
+ if(pMedium->GetError())
+ bOk = sal_False;
+ }
+ }
+
+ if ( bOk )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel ( GetModel(), ::com::sun::star::uno::UNO_QUERY );
+ if ( xModel.is() )
+ {
+ ::rtl::OUString aURL = GetMedium()->GetOrigURL();
+ SfxItemSet *pSet = GetMedium()->GetItemSet();
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs;
+ TransformItems( SID_OPENDOC, *pSet, aArgs );
+ xModel->attachResource( aURL, aArgs );
+ }
+
+ GetTitle( SFX_TITLE_DETECT );
+
+ // Falls nicht asynchron geladen wird selbst FinishedLoading aufrufen
+ if ( !( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) &&
+ ( !bProvidesData || !pMedium->GetFilter() ||
+ pMedium->GetFilter()->UsesStorage() ||
+ pMedium->GetInStream() && pMedium->GetInStream()->GetLockBytes() &&
+ pMedium->GetInStream()->GetLockBytes()->IsSynchronMode() ) )
+ FinishedLoading( SFX_LOADED_MAINDOCUMENT );
+
+ if(bProvidesData && IsOwnStorageFormat_Impl(*pMed) && pMed->GetFilter())
+ {
+//???? dv DirEntry aDirEntry( pMed->GetPhysicalName() );
+//???? dv SetFileName( aDirEntry.GetFull() );
+ }
+ Broadcast( SfxSimpleHint(SFX_HINT_NAMECHANGED) );
+ }
+
+ if( bOk )
+ {
+ String aFacName = String::CreateFromAscii( GetFactory().GetShortName() );
+ if( ! aFacName.EqualsAscii( "swriter" ) &&
+ ! aFacName.EqualsAscii( "FrameSet" ) &&
+ ! aFacName.EqualsAscii( "swriter/web" ) )
+ {
+#ifdef DBG_UTIL
+ if( pImp->nLoadedFlags != SFX_LOADED_ALL )
+ {
+ ByteString aError( U2S( aFacName ) );
+ aError += " hat uralte Mussaenderung nicht gemacht. TLX fragen";
+ DBG_ERROR( aError.GetBuffer() );
+ }
+#endif
+ FinishedLoading( SFX_LOADED_ALL );
+ }
+ }
+
+ if ( SFX_CREATE_MODE_EMBEDDED != eCreateMode )
+ GetpApp()->HideStatusText();
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsOwnStorageFormat_Impl(const SfxMedium &rMedium) const
+{
+ return !rMedium.GetFilter() || // Embedded
+ ( rMedium.GetFilter()->IsOwnFormat() &&
+ rMedium.GetFilter()->UsesStorage() );
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoSave()
+// DoSave wird nur noch ueber OLE aufgerufen. Sichern eigener Dokument
+// laeuft uber SaveAs, um das Anlegen von Backups zu ermoeglichen.
+// Save in eigenes Format jetzt auch wieder Hierueber
+{
+ sal_Bool bOk = sal_False ;
+ {
+ ModifyBlocker_Impl aBlock( this );
+ SfxForceLinkTimer_Impl aFLT( this );
+ pImp->bIsSaving = sal_True;
+ String aPasswd;
+ if ( IsOwnStorageFormat_Impl( *GetMedium() ) &&
+ GetPasswd_Impl( GetMedium()->GetItemSet(), aPasswd ) )
+ GetMedium()->GetStorage()->SetKey( S2BS( aPasswd ) ); //!!! (pb) needs new implementation
+ GetStorage()->SetVersion( GetMedium()->GetFilter()->GetVersion() );
+ bOk = Save();
+ }
+
+ if ( bOk )
+ SetModified( sal_False );
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::SaveTo_Impl
+(
+ SfxMedium &rMedium, // Medium, in das gespeichert werden soll
+ const SfxItemSet* pSet
+)
+
+/* [Beschreibung]
+
+ Schreibt den aktuellen Inhalt in das Medium rMedium.
+ Ist das Zielmedium kein Storage, so wird ueber ein temporaeres
+ Medium gespeichert, sonst direkt, da das Medium transacted
+ geschaltet ist, wenn wir es selbst geoeffnet haben und falls wir
+ Server sind entweder der Container einen transacted Storage zur
+ Verfuegung stellt oder selbst einen temporaeren Storage erzeugt hat.
+*/
+
+{
+ sal_Bool bOk = sal_False;
+ SfxForceLinkTimer_Impl aFLT( this );
+ ModifyBlocker_Impl aBlock( this );
+ const SfxFilter *pFilter = rMedium.GetFilter();
+ if ( !pFilter )
+ {
+ pFilter = GetFactory().GetFilter(0);
+ rMedium.SetFilter(pFilter);
+ }
+ sal_Bool bStorage = pFilter->UsesStorage();
+ if( bStorage )
+ rMedium.GetStorage();
+ else
+ rMedium.GetOutStream();
+ if( rMedium.GetErrorCode() )
+ return sal_False;
+
+#ifdef DBG_UTILx
+ SvStorageRef xRef;
+ if( bStorage )
+ {
+ xRef = rMedium.GetStorage();
+ if( xRef.Is() )
+ xRef->EnableRootCommit( sal_False );
+ }
+#endif
+
+ sal_Bool bOldStat = pImp->bForbidReload;
+ pImp->bForbidReload = sal_True;
+
+ SfxViewFrame *pFrame= SfxViewFrame::GetFirst(this);
+ while ( pFrame )
+ {
+ pFrame->GetDispatcher()->Lock( sal_True );
+ pFrame->Enable( sal_False );
+ pFrame = SfxViewFrame::GetNext(*pFrame, this);
+ }
+
+ if(IsOwnStorageFormat_Impl(rMedium))
+ {
+ SvStorageRef aMedRef = rMedium.GetStorage();
+ if ( !aMedRef.Is() )
+ return sal_False;
+ String aPasswd;
+ if ( GetPasswd_Impl( rMedium.GetItemSet(), aPasswd ) )
+ aMedRef->SetKey( S2BS( aPasswd ) ); //!!! (pb) needs new implementation
+
+ // Speichern
+ const SfxFilter* pFilter = rMedium.GetFilter();
+ if( ((SvStorage *)aMedRef) == ((SvStorage *)GetStorage() ) )
+ {
+ aMedRef->SetVersion( pFilter->GetVersion() );
+ bOk = Save();
+ }
+ else
+ bOk = SaveAsOwnFormat( rMedium );
+
+ // Soll als Version gespeichert werden ?
+
+ const SfxStringItem *pVersionItem = pSet ? (const SfxStringItem*)
+ SfxRequest::GetItem( pSet, SID_VERSION, sal_False, TYPE(SfxStringItem) ) : NULL;
+
+ const SfxStringItem *pAuthorItem = pSet ? (const SfxStringItem*)
+ SfxRequest::GetItem( pSet, SID_DOCINFO_AUTHOR, sal_False, TYPE(SfxStringItem) ) : NULL;
+
+ if ( pVersionItem )
+ {
+ // Versionskommentar und Author der Version
+ SfxVersionInfo aInfo;
+ aInfo.aComment = pVersionItem->GetValue();
+ String aAuthor;
+ if ( pAuthorItem )
+ aAuthor = pAuthorItem->GetValue();
+ else
+ aAuthor = SFX_INIMANAGER()->GetUserFullName();
+
+ aInfo.aCreateStamp.SetName( aAuthor );
+
+ // Version in die Liste aufnehmen; diese mu\s vorher schon vom
+ // "alten" Medium "ubertragen worden sein
+ rMedium.AddVersion_Impl( aInfo );
+ rMedium.SaveVersionList_Impl();
+
+ // Den Storage f"ur die Versionen "offnen
+ SvStorageRef xVersion = aMedRef->OpenStorage( DEFINE_CONST_UNICODE( "Versions" ) );
+
+ // Ggf. alle schon vorhandenen Versionen kopieren
+ SvStorageRef xOldVersions = GetStorage()->OpenStorage( DEFINE_CONST_UNICODE( "Versions" ), SFX_STREAM_READONLY );
+ if ( xOldVersions.Is() && xOldVersions->GetError() == SVSTREAM_OK )
+ {
+ const SfxVersionTableDtor *pList = rMedium.GetVersionList();
+ sal_uInt32 n=0;
+ SfxVersionInfo* pInfo = pList->GetObject(n++);
+ while( pInfo )
+ {
+ const String& rName = pInfo->aName;
+ if ( xOldVersions->IsStream( rName ) )
+ xOldVersions->CopyTo( rName, xVersion, rName );
+ pInfo = pList->GetObject(n++);
+ }
+ }
+
+ // Einen Stream aufmachen, auf den dann der Storage gesetzt wird,
+ // in den gespeichert wird
+ SvMemoryStream aTmp;
+ SvStorageRef xTmp = new SvStorage( aTmp );
+ rMedium.SetStorage_Impl( xTmp );
+
+ // Version speichern
+ if ( aPasswd.Len() )
+ xTmp->SetKey( S2BS( aPasswd ) ); //!!! (pb) needs new implementation
+ if( ((SvStorage*) xTmp ) == ((SvStorage*) GetStorage()) )
+ {
+ xTmp->SetVersion( pFilter->GetVersion() );
+ bOk = Save();
+ }
+ else
+ bOk = SaveAsOwnFormat( rMedium );
+
+ xTmp->Commit();
+
+ // Den Stream mit dem Storage komprimiert abspeichern
+ SvStorageStreamRef xStrm = xVersion->OpenStream( aInfo.aName );
+ aTmp.Seek(0);
+ ZCodec aCodec;
+ aCodec.BeginCompression( ZCODEC_BEST_COMPRESSION );
+ aCodec.Compress( aTmp, *xStrm );
+ aCodec.EndCompression();
+
+ // Versionen-Storage committen
+ xVersion->Commit();
+
+ // Medium wieder auf den alten Storage setzen
+ rMedium.SetStorage_Impl( aMedRef );
+ }
+ else if ( pImp->bIsSaving )
+ {
+ rMedium.SaveVersionList_Impl();
+ const SfxVersionTableDtor *pList = rMedium.GetVersionList();
+ if ( pList && pList->Count() )
+ {
+ SvStorageRef xVersion = aMedRef->OpenStorage( DEFINE_CONST_UNICODE( "Versions" ) );
+ SvStorageRef xOldVersions = GetStorage()->OpenStorage( DEFINE_CONST_UNICODE( "Versions" ), SFX_STREAM_READONLY );
+ if ( xOldVersions.Is() && xOldVersions->GetError() == SVSTREAM_OK )
+ {
+ sal_uInt32 n=0;
+ SfxVersionInfo* pInfo = pList->GetObject(n++);
+ while( pInfo )
+ {
+ const String& rName = pInfo->aName;
+ if ( xOldVersions->IsStream( rName ) )
+ xOldVersions->CopyTo( rName, xVersion, rName );
+ pInfo = pList->GetObject(n++);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ if ( rMedium.GetFilter() && ( rMedium.GetFilter()->GetFilterFlags() & SFX_FILTER_STARONEFILTER ) )
+ bOk = ExportTo( rMedium );
+ else
+ bOk=ConvertTo( rMedium );
+
+ if( bOk )
+ bOk = SaveChilds();
+ }
+
+
+#ifdef DBG_UTILx
+ if( bStorage )
+ {
+ if( xRef.Is() )
+ xRef->EnableRootCommit( sal_True );
+ }
+#endif
+
+ if(bOk)
+ {
+ /* When the new medium ( rMedium ) has the same name as the
+ current one, we need to call DoHandsOff() so Commit() can
+ overwrite the old version. This is a good time to check
+ wether we want a backup copy, too.
+ (dv) We have to call DoHandsOff wether or not the names
+ are the same
+ */
+
+ sal_Bool bCopyTo = sal_False;
+ SfxItemSet *pSet = rMedium.GetItemSet();
+
+ if( pSet )
+ {
+ SFX_ITEMSET_ARG( pSet, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
+ bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
+ pSaveToItem && pSaveToItem->GetValue();
+ }
+
+ if ( ! bCopyTo )
+ DoHandsOff();
+
+ if ( pMedium &&
+ ( rMedium.GetName() == pMedium->GetName() ) )
+ {
+ const sal_Bool bDoBackup = SFX_APP()->GetOptions().IsBackup();
+ if ( bDoBackup )
+ pMedium->DoBackup_Impl();
+ }
+
+ RegisterTransfer( rMedium );
+ bOk=rMedium.Commit();
+ }
+ else
+ return sal_False;
+
+ pFrame = SfxViewFrame::GetFirst(this);
+ while ( pFrame )
+ {
+ pFrame->GetDispatcher()->Lock( sal_False );
+ pFrame->Enable( sal_True );
+ pFrame = SfxViewFrame::GetNext(*pFrame, this);
+ }
+
+ pImp->bForbidReload = bOldStat;
+
+ if(bOk && pFilter)
+ if(pFilter->IsAlienFormat())
+ pImp->bDidDangerousSave=sal_True;
+ else
+ pImp->bDidDangerousSave=sal_False;
+
+ if ( bOk )
+ SetEAs_Impl(rMedium);
+
+ return bOk;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::ConnectTmpStorage_Impl( SvStorage* pStg)
+
+/* [Beschreibung]
+
+ Arbeitet die Applikation auf einem temporaeren Storage,
+ so darf der temporaere Storage nicht aus dem SaveCompleted
+ genommen werden. Daher wird in diesem Fall schon hier an
+ den neuen Storage connected. SaveCompleted tut dann nichts.
+
+ */
+
+{
+ // wenn es kein temp. Storage ist, einen anlegen
+ SvStorageRef aTmpMed = new SvStorage(String());
+ // nach HandsOff muss der alte Storage wieder eingesetzt werden
+ if ( !pStg->CopyTo(aTmpMed) )
+ {
+ SetError(aTmpMed->GetErrorCode());
+ aTmpMed.Clear();
+ return sal_False;
+ }
+
+ SetError(GetMedium()->GetErrorCode());
+ SaveCompleted(aTmpMed); // neuer temp. Storage; gibt alten frei
+ return sal_True;
+}
+
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoSaveAs( SvStorage * pNewStor )
+{
+ sal_Bool bOk;
+ {
+ SfxForceLinkTimer_Impl aFLT( this );
+ ModifyBlocker_Impl aBlock( this );
+ //Abwehr gegen feindlich gesinnte Applikationen.
+ if ( !pNewStor->GetFormat() )
+ SetupStorage( pNewStor );
+
+ pImp->bIsSaving = sal_False;
+ SfxMedium* pNewMed = new SfxMedium( pNewStor );
+ const String aOldURL( INetURLObject::GetBaseURL() );
+
+ bOk = SaveAsOwnFormat( *pNewMed );
+ INetURLObject::SetBaseURL( aOldURL );
+ delete pNewMed;
+ }
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoSaveAs( SfxMedium &rMedium )
+{
+ // hier kommen nur Root-Storages rein, die via Temp-File gespeichert werden
+ const String aOldURL( INetURLObject::GetBaseURL() );
+ if( GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+ if ( ShallSetBaseURL_Impl( rMedium ) )
+ INetURLObject::SetBaseURL( rMedium.GetName() );
+ else
+ INetURLObject::SetBaseURL( String() );
+
+ rMedium.CreateTempFile();
+
+ sal_Bool bRet = SaveTo_Impl(rMedium);
+ INetURLObject::SetBaseURL( aOldURL );
+ if( bRet )
+ DoHandsOff();
+ else
+ SetError(rMedium.GetErrorCode());
+ return bRet;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoSaveCompleted( SfxMedium * pNewMed )
+{
+ sal_Bool bOk = sal_True;
+ sal_Bool bMedChanged = pNewMed && pNewMed!=pMedium;
+/* sal_Bool bCreatedTempStor = pNewMed && pMedium &&
+ IsOwnStorageFormat_Impl(*pMedium) &&
+ !IsOwnStorageFormat_Impl(*pNewMed) &&
+ pMedium->GetName().Len();
+*/
+ if ( bMedChanged )
+ {
+ delete pMedium;
+ pMedium = pNewMed;
+ Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+ //MI? DELETEZ(pImp->pDocInfo);
+ }
+
+ const SfxFilter *pFilter = pMedium ? pMedium->GetFilter() : 0;
+ if ( pNewMed )
+ {
+ if( bMedChanged )
+ {
+ if( pNewMed->GetName().Len() )
+ bHasName = sal_True;
+ String aBase = GetBaseURL();
+ if( Current() == this && aBase.Len() )
+ INetURLObject::SetBaseURL( aBase );
+ Broadcast( SfxSimpleHint(SFX_HINT_NAMECHANGED) );
+ }
+ if ( !pFilter || pFilter->IsOwnFormat())
+ bOk = SaveCompleted( pMedium->GetStorage() );
+ else if( pFilter->UsesStorage() )
+ pMedium->GetStorage();
+ else if( pMedium->GetOpenMode() & STREAM_WRITE )
+ pMedium->GetInStream();
+ }
+ else
+ {
+ if( pMedium )
+ {
+ const SfxFilter* pFilter = pMedium->GetFilter();
+ if( pFilter && !pFilter->IsOwnFormat() &&
+ (pMedium->GetOpenMode() & STREAM_WRITE ))
+ pMedium->ReOpen();
+ else
+ SaveCompleted( 0 );
+ }
+ // entweder Save oder ConvertTo
+ else
+ bOk = SaveCompleted( NULL );
+ }
+
+ if ( bOk && pNewMed )
+ {
+ if( bMedChanged )
+ {
+ // Titel neu setzen
+ if ( pNewMed->GetName().Len() &&
+ SFX_CREATE_MODE_EMBEDDED != eCreateMode )
+ InvalidateName();
+ SetModified(sal_False); // nur bei gesetztem Medium zur"ucksetzen
+ }
+
+ // ggf. Notify, dass im FileSystem was passiert ist
+ if ( eCreateMode != SFX_CREATE_MODE_EMBEDDED )
+ {
+ SfxMedium *pMed = pNewMed ? pNewMed : pMedium;
+ if ( INET_PROT_FILE == pMed->GetURLObject().GetProtocol() && pMed->GetName().Len() )
+ SFX_APP()->Broadcast( SfxDirEntryHint( 0, pMed->GetURLObject().GetMainURL() ) );
+ }
+ }
+
+ return bOk;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoSaveCompleted( SvStorage * pNewStor )
+{
+ return DoSaveCompleted(pNewStor? new SfxMedium( pNewStor ): 0);
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::ConvertFrom
+(
+ SfxMedium& rMedium /* <SfxMedium>, welches die Quell-Datei beschreibt
+ (z.B. Dateiname, <SfxFilter>, Open-Modi etc.) */
+)
+
+/* [Beschreibung]
+
+ Diese Methode wird zum Laden von Dokumenten "uber alle Filter gerufen,
+ die nicht SFX_FILTER_OWN sind oder f"ur die kein Clipboard-Format
+ registriert wurde (also kein Storage-Format benutzen). Mit anderen Worten:
+ mit dieser Methode wird importiert.
+
+ Das hier zu "offende File sollte "uber 'rMedium' ge"offnet werden,
+ um die richtigen Open-Modi zu gew"ahrleisten. Insbesondere wenn das
+ Format beibehalten wird (nur m"oglich bei SFX_FILTER_SIMULATE oder
+ SFX_FILTER_ONW) mu\s die Datei STREAM_SHARE_DENYWRITE ge"offnet werden.
+
+
+ [R"uckgabewert]
+
+ sal_Bool sal_True
+ Das Dokument konnte geladen werden.
+
+ sal_False
+ Das Dokument konnte nicht geladen werden, ein
+ Fehlercode ist mit <SvMedium::GetError()const> zu
+ erhalten.
+
+
+ [Beispiel]
+
+ sal_Bool DocSh::ConvertFrom( SfxMedium &rMedium )
+ {
+ SvStreamRef xStream = rMedium.GetInStream();
+ if( xStream.is() )
+ {
+ xStream->SetBufferSize(4096);
+ *xStream >> ...;
+
+ // NICHT 'rMedium.CloseInStream()' rufen! File gelockt halten!
+ return SVSTREAM_OK == rMedium.GetError();
+ }
+
+ return sal_False;
+ }
+
+
+ [Querverweise]
+
+ <SfxObjectShell::ConvertTo(SfxMedium&)>
+ <SFX_FILTER_REGISTRATION>
+*/
+{
+ return sal_False;
+}
+
+sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium )
+{
+ String aName( GetMedium()->GetFilter()->GetFilterName() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XDataImporter > xLoader( xMan->createInstance( aName ), ::com::sun::star::uno::UNO_QUERY );
+ if ( xLoader.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( GetModel(), ::com::sun::star::uno::UNO_QUERY );
+ xLoader->importData( GetMedium()->GetDataSource(), xComp, new DataTransferEventListener_Impl( this, xLoader ) );
+ pImp->xFilter = ::com::sun::star::uno::Reference< ::com::sun::star::io::XDataExporter > ( xLoader, ::com::sun::star::uno::UNO_QUERY );
+ if ( pImp->xFilter.is() )
+ pImp->aStarOneFilterName = aName;
+ else
+ pImp->aStarOneFilterName.Erase();
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
+{
+ String aName( rMedium.GetFilter()->GetFilterName() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XDataExporter > xExport;
+ if ( pImp->aStarOneFilterName == aName )
+ xExport = pImp->xFilter;
+ else
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMan = ::utl::getProcessServiceFactory();
+ xExport = ::com::sun::star::uno::Reference< ::com::sun::star::io::XDataExporter > ( xMan->createInstance( aName ), ::com::sun::star::uno::UNO_QUERY );
+ }
+
+ if ( xExport.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( GetModel(), ::com::sun::star::uno::UNO_QUERY );
+ xExport->exportData( rMedium.GetDataSink(), xComp, new DataTransferEventListener_Impl( this, xExport ) );
+ return sal_True;
+ }
+
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::ConvertTo
+(
+ SfxMedium& rMedium /* <SfxMedium>, welches die Ziel-Datei beschreibt
+ (z.B. Dateiname, <SfxFilter>, Open-Modi etc.) */
+)
+
+/* [Beschreibung]
+
+ Diese Methode wird zum Speichern von Dokumenten "uber alle Filter gerufen,
+ die nicht SFX_FILTER_OWN sind oder f"ur die kein Clipboard-Format
+ registriert wurde (also kein Storage-Format benutzen). Mit anderen Worten:
+ mit dieser Methode wird exportiert.
+
+ Das hier zu "offende File sollte "uber 'rMedium' ge"offnet werden,
+ um die richtigen Open-Modi zu gew"ahrleisten. Insbesondere wenn das
+ Format beibehalten wird (nur m"oglich bei SFX_FILTER_SIMULATE oder
+ SFX_FILTER_ONW) mu\s die Datei auch nach dem Speichern im Modus
+ STREAM_SHARE_DENYWRITE ge"offnet bleiben.
+
+
+ [R"uckgabewert]
+
+ sal_Bool sal_True
+ Das Dokument konnte gespeichert werden.
+
+ sal_False
+ Das Dokument konnte nicht gespeichert werden, ein
+ Fehlercode ist mit <SvMedium::GetError()const> zu
+ erhalten.
+
+
+ [Beispiel]
+
+ sal_Bool DocSh::ConvertTo( SfxMedium &rMedium )
+ {
+ SvStreamRef xStream = rMedium.GetOutStream();
+ if ( xStream.is() )
+ {
+ xStream->SetBufferSize(4096);
+ *xStream << ...;
+
+ rMedium.CloseOutStream(); // "offnet automatisch wieder den InStream
+ return SVSTREAM_OK == rMedium.GetError();
+ }
+ return sal_False ;
+ }
+
+
+ [Querverweise]
+
+ <SfxObjectShell::ConvertFrom(SfxMedium&)>
+ <SFX_FILTER_REGISTRATION>
+*/
+
+{
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetEAs_Impl( SfxMedium &rMedium )
+{
+ //!! wenn OV eine entsprechende Funktionalitaet zur Verfuegung stellt,
+ // besser auf der geoeffneten Datei arbeiten
+ SvEaMgr *pMgr = rMedium.GetEaMgr();
+ SvEaMgr *pOld = GetMedium()->GetEaMgr();
+ if ( !pMgr )
+ return;
+
+ if ( pOld )
+ pOld->Clone( *pMgr );
+
+ String aBuffer;
+ pMgr->SetComment( GetDocInfo().GetComment() );
+
+ pMgr->SetFileType( rMedium.GetFilter()->GetTypeName().GetToken( 0, ';' ) );
+ if ( SvEaMgr::GetAppCreator(aBuffer) )
+ pMgr->SetCreator(aBuffer);
+
+ if ( rMedium.GetLongName().Len() )
+ pMgr->SetLongName(rMedium.GetLongName());
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
+
+//Hier jetzt mal eine Einordnung der einzelnen Save Funktionen
+//
+//DoSave / DoSaveAs: Werden ausschliesslich ueber OLE gerufen
+//DoSave_Impl : Einfaches Speichern mit allem OLE Protokoll SchnickSchnack
+//Save_Impl : Bearbeitungsfunktion fuer SAVEDOC
+
+{
+ sal_Bool bSaved = sal_False;
+ SfxMedium *pMedium = GetMedium();
+
+// Save jetzt in jedem Fall ueber SaveAs in temporaeres Medium
+// Ausser, wenn kein Backup gewuensch ist und wir ins eigene
+// Storageformat schreiben und wir nicht in SaveAs sind.
+
+ // Backup will be created in SaveTo_Impl()
+ // const sal_Bool bDoBackup=SFX_APP()->GetOptions().IsBackup();
+ const sal_Bool bIsOwn=IsOwnStorageFormat_Impl(*pMedium);
+
+// Zur Zeit wirder immer ueber temporaere Datei, um Storages schrumpfen
+// zu lassen.
+//
+ {
+ const StreamMode nFlags = pMedium->GetOpenMode();
+ const sal_Bool bDirect = pMedium->IsDirect();
+ const String aLongName(pMedium->GetLongName());
+
+ SfxItemSet *pSet =
+ pMedium->GetItemSet()?
+ new SfxAllItemSet(*pMedium->GetItemSet()): 0;
+
+ const SfxFilter *pFilter = GetMedium()->GetFilter();
+ SfxMedium *pMediumTmp = new SfxMedium( pMedium->GetName(), nFlags, bDirect, sal_False, pFilter, pSet );
+ pMediumTmp->CreateTempFile();
+ pMediumTmp->SetLongName( aLongName );
+
+ // Nat"urlich keine Version in einem neuen Medium!
+ pMediumTmp->GetItemSet()->ClearItem( SID_VERSION );
+ pMediumTmp->GetItemSet()->Put( SfxStringItem( SID_DOCTEMPLATE, pMedium->GetURLObject().GetBase()) );
+
+ const String aOldURL( INetURLObject::GetBaseURL() );
+ if( GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+ if ( ShallSetBaseURL_Impl(*pMedium) )
+ INetURLObject::SetBaseURL( pMedium->GetName() );
+ else
+ INetURLObject::SetBaseURL( String() );
+
+ pMediumTmp->TransferVersionList_Impl( *pMedium );
+
+ if ( pFilter && ( pFilter->GetFilterFlags() & SFX_FILTER_PACKED ) )
+ SetError( GetMedium()->Unpack_Impl( pMedium->GetPhysicalName() ) );
+
+ if( !GetError() && SaveTo_Impl(*pMediumTmp, pArgs) )
+ {
+ INetURLObject::SetBaseURL( aOldURL );
+ ByteString aKey;
+ if ( IsOwnStorageFormat_Impl( *pMediumTmp ) )
+ aKey = pMediumTmp->GetStorage()->GetKey();
+
+ DoHandsOff();
+ SfxItemSet *pSet = pMediumTmp->GetItemSet();
+ if(pSet)
+ pMedium->GetItemSet()->Put(*pSet);
+
+ pMedium->TransferVersionList_Impl( *pMediumTmp );
+ SetError(pMediumTmp->GetErrorCode());
+ pMediumTmp->Close();
+ bSaved=sal_True;
+ delete pMediumTmp;
+
+ sal_Bool bOpen = DoSaveCompleted(pMedium);
+ if ( bOpen && aKey.Len() )
+ pMedium->GetStorage()->SetKey( aKey );
+ DBG_ASSERT(bOpen,"Fehlerbehandlung fuer DoSaveCompleted nicht implementiert");
+ }
+ else
+ {
+ INetURLObject::SetBaseURL( aOldURL );
+ SetError( pMediumTmp->GetError() );
+ String aTmp( pMediumTmp->GetPhysicalName() );
+ delete pMediumTmp;
+ SfxContentHelper::Kill( aTmp );
+ DoSaveCompleted( (SvStorage*)0 );
+ }
+ }
+
+ SetModified(!bSaved);
+ return bSaved;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet )
+{
+ DBG_CHKTHIS(SfxObjectShell, 0);
+ SfxApplication *pSfxApp = SFX_APP();
+
+ pImp->bIsSaving = sal_True;
+ sal_Bool bSaved;
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, sal_False);
+ if ( pSalvageItem )
+ {
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME, sal_False);
+ const SfxFilter *pFilter = pFilterItem
+ ? GetFactory().GetFilterContainer()->GetFilter(pFilterItem->GetValue())
+ : 0;
+ SfxMedium *pMed = new SfxMedium(
+ pSalvageItem->GetValue(), STREAM_READWRITE | STREAM_SHARE_DENYWRITE,
+ sal_False, sal_False, pFilter );
+
+ SFX_ITEMSET_ARG( GetMedium()->GetItemSet(), pPasswordItem, SfxStringItem, SID_PASSWORD, sal_False);
+ if ( pPasswordItem )
+ pMed->GetItemSet()->Put( *pPasswordItem );
+
+ bSaved = DoSaveAs( *pMed );
+ if ( bSaved )
+ bSaved = DoSaveCompleted( pMed );
+ else
+ delete pMed;
+ }
+ else
+ bSaved = DoSave_Impl( pSet );
+ if ( bSaved && pSfxApp->GetOptions().IsAutoSave() )
+ pSfxApp->GetAutoSaveTimer_Impl()->Start();
+ return bSaved;
+}
+
+//-------------------------------------------------------------------------
+
+class SfxSaveAsContext_Impl
+{
+ String& _rNewNameVar;
+ String _aNewName;
+
+public:
+ SfxSaveAsContext_Impl( String &rNewNameVar,
+ const String &rNewName )
+ : _rNewNameVar( rNewNameVar ),
+ _aNewName( rNewName )
+ { rNewNameVar = rNewName; }
+ ~SfxSaveAsContext_Impl()
+ { _rNewNameVar.Erase(); }
+};
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::SaveAs_Impl(sal_Bool bUrl, SfxRequest *pRequest)
+{
+ // must we ask the user for the filename?
+ INetURLObject aURL;
+ aURL.SetSmartProtocol( INET_PROT_FILE );
+ sal_uInt16 nActFilt = 0;
+ const SfxFilter* pFilt;
+ for( pFilt = GetFactory().GetFilter( 0 );
+ pFilt && ( !pFilt->CanExport() || pFilt->IsInternal() );
+ pFilt = GetFactory().GetFilter( ++nActFilt ) );
+
+ DBG_ASSERT( pFilt, "Kein Filter zum Speichern" );
+
+ String aFilterName;
+ if( pFilt )
+ aFilterName = pFilt->GetName();
+
+ SfxItemSet *pParams = new SfxAllItemSet( SFX_APP()->GetPool() );
+ SFX_REQUEST_ARG( (*pRequest), pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
+ if ( pRequest->GetArgs() )
+ pParams->Put( *pRequest->GetArgs() );
+
+ if ( !pFileNameItem )
+ {
+ if(! bUrl )
+ {
+ // get the filename by dialog
+ ISfxModule *pMod = GetModule();
+ if ( !pMod )
+ pMod = SFX_APP()->GetISfxModule();
+
+ SfxFileDialog* pDlg = pMod->CreateDocFileDialog( WB_SAVEAS | WB_3DLOOK, GetFactory(), pParams );
+ if ( HasName() )
+ {
+ String aLastName = QueryTitle(
+ SFX_TITLE_QUERY_SAVE_NAME_PROPOSAL );
+ const SfxFilter* pMedFilter = GetMedium()->GetFilter();
+ if( pImp->bSetStandardName && !IsTemplate() || !pMedFilter ||
+ !pMedFilter->CanExport() ||
+ pMedFilter->GetVersion() != SOFFICE_FILEFORMAT_NOW )
+ {
+ if( aLastName.Len() )
+ {
+ String aPath( aLastName );
+
+ bool bWasAbsolute = FALSE;
+ INetURLObject aObj( SFX_INIMANAGER()->Get( SFX_KEY_WORK_PATH ) );
+ aObj.smartRel2Abs( aPath, bWasAbsolute );
+
+ aObj.SetExtension( pFilt->GetDefaultExtension().Copy(2) );
+ pDlg->SetSmartPath( aObj.GetMainURL() );
+ }
+
+ pDlg->SetCurFilter( pFilt->GetName() );
+ }
+ else
+ {
+ if( aLastName.Len() )
+ {
+ String aPath( pDlg->GetPath() );
+ aPath += aLastName;
+ pDlg->SetSmartPath( aPath );
+ }
+
+ pDlg->SetCurFilter( pMedFilter->GetName() );
+ }
+ }
+ else
+ {
+ pDlg->SetSmartPath( SFX_INIMANAGER()->Get(SFX_KEY_WORK_PATH) );
+ }
+
+ if ( pDlg->Execute() == RET_CANCEL )
+ {
+ delete pDlg;
+ SetError(ERRCODE_IO_ABORT);
+ return sal_False;
+ }
+
+ aURL.SetSmartURL( pDlg->GetPath() );
+
+ // gibt es schon ein Doc mit dem Namen?
+ const String aName(aURL.GetMainURL());
+ SfxObjectShell* pDoc = 0;
+ for ( SfxObjectShell* pTmp = SfxObjectShell::GetFirst();
+ pTmp && !pDoc;
+ pTmp = SfxObjectShell::GetNext(*pTmp) )
+ //! fsys bug op==
+ if ( pTmp->GetMedium() )
+ // ??? HasName() MM
+ if(pTmp != this && pTmp->GetMedium()->GetName() == aName )
+ pDoc = pTmp;
+ if ( pDoc )
+ {
+ // dann Fehlermeldeung: "schon offen"
+ SetError(ERRCODE_SFX_ALREADYOPEN);
+ delete pDlg;
+ return sal_False;
+ }
+
+ // Parameter aus Dialog holen
+ const String aFilter(pDlg->GetCurFilter());
+ if(aFilter.Len())
+ aFilterName = aFilter;
+ pParams->Put( *pDlg->GetItemSet() );
+ delete pDlg;
+ }
+ else
+ {
+ SfxUrlDialog aDlg( 0 );
+ if( aDlg.Execute() == RET_OK )
+ aURL.SetURL( aDlg.GetUrl() );
+ else
+ {
+ SetError(ERRCODE_IO_ABORT);
+ return sal_False;
+ }
+ }
+
+ // Request mit Dateiname und Filter vervollst"andigen
+ pRequest->AppendItem(SfxStringItem( SID_FILE_NAME, aURL.GetMainURL()) );
+ pRequest->AppendItem(SfxStringItem( SID_FILTER_NAME, aFilterName));
+ const SfxPoolItem* pItem=0;
+ pRequest->GetArgs()->GetItemState( SID_FILE_NAME, sal_False, &pItem );
+ pFileNameItem = PTR_CAST( SfxStringItem, pItem );
+ }
+
+ // neuen Namen an der Object-Shell merken
+ SfxSaveAsContext_Impl aSaveAsCtx( pImp->aNewName, aURL.GetMainURL() );
+
+ // now we can get the filename from the SfxRequest
+ DBG_ASSERT( pRequest->GetArgs() != 0, "fehlerhafte Parameter");
+ SFX_REQUEST_ARG( (*pRequest), pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
+ FASTBOOL bSaveTo = pSaveToItem ? pSaveToItem->GetValue() : sal_False;
+ if ( !pFileNameItem && bSaveTo )
+ {
+ // SaveTo auch ohne Filenamen m"oglich -> dann FileDialog "offnen
+ ISfxModule *pMod = GetModule();
+ if ( !pMod )
+ pMod = SFX_APP()->GetISfxModule();
+
+ SfxFileDialog* pDlg = pMod->CreateDocFileDialog( WB_SAVEAS | WB_3DLOOK, GetFactory(), pRequest->GetArgs() );
+ if ( pDlg->Execute() == RET_CANCEL )
+ {
+ // Speichern abbrechen
+ delete pDlg;
+ SetError(ERRCODE_IO_ABORT);
+ return sal_False;
+ }
+ else
+ {
+ // Einstellungen aus dem FileDialog "ubernehmen
+ aURL.SetURL( pDlg->GetPath() );
+ aFilterName = pDlg->GetCurFilter();
+ delete pDlg;
+ }
+ }
+ else if ( pFileNameItem )
+ {
+ aURL.SetSmartURL(((const SfxStringItem *)pFileNameItem)->GetValue() );
+ const SfxPoolItem* pFilterNameItem=0;
+ const SfxItemState eState = pRequest->GetArgs()->GetItemState(SID_FILTER_NAME, sal_True, &pFilterNameItem);
+ if ( SFX_ITEM_SET == eState )
+ {
+ DBG_ASSERT(pFilterNameItem->IsA( TYPE(SfxStringItem) ), "Fehler Parameter");
+ aFilterName = ((const SfxStringItem *)pFilterNameItem)->GetValue();
+ }
+ }
+ else
+ {
+ SetError( ERRCODE_IO_INVALIDPARAMETER );
+ return sal_False;
+ }
+
+ const SfxFilter* pFilter = GetFactory().GetFilterContainer()->GetFilter( aFilterName );
+ if ( !pFilter )
+ {
+ SetError( ERRCODE_IO_INVALIDPARAMETER );
+ return sal_False;
+ }
+
+ pImp->bPasswd = pParams && SFX_ITEM_SET == pParams->GetItemState(SID_PASSWORD);
+
+ // unter gleichem Namen speichern?
+ SfxMedium *pActMed = GetMedium();
+ const INetURLObject aActName(pActMed->GetName());
+
+ if ( aURL == aActName )
+ {
+ if ( IsReadOnly() )
+ {
+ SetError(ERRCODE_SFX_DOCUMENTREADONLY);
+ return sal_False;
+ }
+ // gleicher Filter? -> Save()
+ const SfxFilter *pFilter = pActMed->GetFilter();
+ if ( pFilter && pFilter->GetName() == aFilterName )
+ {
+ pImp->bIsSaving=sal_False;
+ if ( pParams )
+ {
+ SfxItemSet* pSet = pMedium->GetItemSet();
+ pSet->ClearItem( SID_PASSWORD );
+ pSet->Put( *pParams );
+ }
+ return DoSave_Impl();
+ }
+ }
+
+ if( aURL.HasError() )
+ {
+ SetError( ERRCODE_IO_INVALIDPARAMETER );
+ return sal_False;
+ }
+
+// former code using fsys, must be handled in UCB
+// if( aURL.GetProtocol() == INET_PROT_FILE && !aURL.GetPath().Exists() )
+// {
+// SetError( ERRCODE_IO_NOTEXISTSPATH );
+// return sal_False;
+// }
+
+ if ( PreDoSaveAs_Impl(aURL.GetMainURL(),aFilterName,pParams))
+ {
+ pImp->bWaitingForPicklist = sal_True;
+ if (!pImp->bSetStandardName)
+ pImp->bDidWarnFormat=sal_False;
+ // Muss !!!
+ if ( IsOwnStorageFormat_Impl(*GetMedium()))
+ {
+ SetFileName( GetMedium()->GetPhysicalName() );
+ }
+
+ return sal_True;
+ }
+ else
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::PreDoSaveAs_Impl
+(
+ const String& rFileName,
+ const String& aFilterName,
+ SfxItemSet* pParams
+)
+{
+ if ( pParams )
+ pParams->Put(
+ SfxStringItem(
+ SID_DOCTEMPLATE, INetURLObject( rFileName ).GetBase()) );
+ SfxAllItemSet* pMergedParams = new SfxAllItemSet(
+ *pMedium->GetItemSet() );
+ pMergedParams->ClearItem( SID_PASSWORD );
+ pMergedParams->ClearItem( SID_DOCINFO_TITLE );
+
+ if( pParams )
+ pMergedParams->Put( *pParams );
+ delete pParams;
+ pMergedParams->ClearItem( SID_DOC_SALVAGE );
+ pParams = pMergedParams;
+
+// SfxItemSet *pSet = pParams ? new SfxAllItemSet(*pParams) : 0;
+
+ SfxMedium *pNewFile = new SfxMedium(
+ rFileName, STREAM_READWRITE | STREAM_SHARE_DENYWRITE, sal_False,
+ sal_False, 0, pParams );
+
+ SFX_ITEMSET_ARG(
+ pParams, pSaveToItem, SfxBoolItem, SID_SAVETO, sal_False );
+
+ sal_Bool bCopyTo =
+ GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
+ pSaveToItem && pSaveToItem->GetValue();
+
+ SfxDocumentInfo aSavedInfo;
+ if ( bCopyTo )
+ aSavedInfo = GetDocInfo();
+
+ pNewFile->SetFilter( GetFactory(), aFilterName);
+ pNewFile->CreateTempFile();
+
+ sal_Bool bOk;
+
+ SfxMedium *pMediumTmp;
+
+ const String aOldURL( INetURLObject::GetBaseURL() );
+ if( GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
+ if ( ShallSetBaseURL_Impl(*pNewFile) )
+ INetURLObject::SetBaseURL( pNewFile->GetName() );
+ else
+ INetURLObject::SetBaseURL( String() );
+
+ pMediumTmp = pNewFile;
+
+ // Nat"urlich keine Version in einem neuen Medium!
+ pMediumTmp->GetItemSet()->ClearItem( SID_VERSION );
+
+ if ( aFilterName.Len() )
+ pMediumTmp->SetFilter( GetFactory(), aFilterName );
+ else
+ pMediumTmp->SetFilter( GetFactory().GetFilterContainer()->GetFilter(0) );
+
+ pImp-> bIsSaving = sal_False;
+ bOk = sal_False;
+
+ if ( IsOwnStorageFormat_Impl(*pNewFile) )
+ {
+ long nFormat = pMediumTmp->GetFilter()->GetFormat();
+ SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
+ const SfxFilter *pFilt = rMatcher.GetFilter4ClipBoardId( nFormat );
+ if ( pFilt )
+ {
+ pFilt = rMatcher.ResolveRedirection( pFilt, *pMediumTmp );
+ if ( pFilt->GetFilterContainer() != pMediumTmp->GetFilter()->GetFilterContainer() )
+ pMediumTmp->GetStorage()->SetClass( SvFactory::GetServerName( nFormat ), nFormat, pFilt->GetTypeName() );
+ }
+ }
+
+ if ( GetMedium()->GetFilter() && ( GetMedium()->GetFilter()->GetFilterFlags() & SFX_FILTER_PACKED ) )
+ {
+ SfxMedium *pMed = bCopyTo ? pMedium : pNewFile;
+ pMediumTmp->SetError( GetMedium()->Unpack_Impl( pMed->GetPhysicalName() ) );
+ }
+
+ sal_Bool bCouldNotConnect = sal_False;
+ sal_Bool bNeedsStorage;
+ SvStorageRef xNewTempRef;
+
+ if ( !pMediumTmp->GetErrorCode() )
+ {
+
+ // Falls jetzt in ein Fremdformat gespeichert wird, darf nicht der
+ // Objektstorage weiterverwendet werden, wenn das alte Format das
+ // eigene war. Daher wird hier eine temporaerer erzeugt.
+ // Damit DoHandsOff gerufen werden kann, merken wir uns den
+ // Storage und rufen anschliessend von Hand SaveCompleted
+
+ bNeedsStorage = !bCopyTo && IsOwnStorageFormat_Impl(*pMedium) &&
+ !IsOwnStorageFormat_Impl(*pNewFile);
+
+ if ( bNeedsStorage && pMedium->GetName().Len() )
+ {
+ if(!ConnectTmpStorage_Impl( pMedium->GetStorage() ))
+ bCouldNotConnect = sal_True;
+ }
+ if( bNeedsStorage )
+ xNewTempRef = GetStorage();
+ }
+
+ if ( !pMediumTmp->GetErrorCode() && SaveTo_Impl( *pMediumTmp ) )
+ {
+ bOk = sal_True;
+ INetURLObject::SetBaseURL( aOldURL );
+
+ if ( bCouldNotConnect )
+ bOk = sal_False;
+
+#ifdef DONT_NEEDED_ANY_LONGER
+ // Auf die Platte
+ if( !bRemote )
+ {
+ // Options vorhanden?
+ SfxItemSet *pOptions = pMediumTmp->GetItemSet();
+ if ( pOptions )
+ // Options "ubernehmen
+ pNewFile->SetItemSet( new SfxAllItemSet( *pOptions ) );
+
+ // Falls jetzt in ein Fremdformat gespeichert wird, darf nicht der
+ // Objektstorage weiterverwendet werden, wenn das alte Format das
+ // eigene war. Daher wird hier eine temporaerer erzeugt.
+
+ // Damit DoHandsOff gerufen werden kann, merken wir uns den
+ // Storage und rufen anschliessend von Hand SaveCompleted
+
+ sal_Bool bNeedsStorage =
+ !bCopyTo && IsOwnStorageFormat_Impl(*pMedium) &&
+ !IsOwnStorageFormat_Impl(*pNewFile);
+
+ // Sind wir embedded, so war es Save Copy to
+ SvStorageRef xNewTempRef;
+ if ( bNeedsStorage && pMedium->GetName().Len())
+ {
+ if(!ConnectTmpStorage_Impl( pMedium->GetStorage() ))
+ bOk = sal_False;
+ }
+ if( bNeedsStorage )
+ xNewTempRef = GetStorage();
+ if( !bCopyTo ) // Braucht kein HandsOff, da nicht ueber sich selbst
+ DoHandsOff(); //gespeichert wird.
+
+ ErrCode nErr = aFileName.Exists() ? aFileName.Kill() : 0;
+ if( !nErr )
+ {
+ SetError(pMediumTmp->GetErrorCode());
+ pMediumTmp->Close();
+ nErr = aTmpFile.MoveTo(pNewFile->GetPhysicalName() );
+ if( nErr != ERRCODE_NONE )
+ {
+ // Extrabehandlung HS Fall: man kann schreiben, aber nicht
+ // moven
+ nErr = aTmpFile.CopyTo( pNewFile->GetPhysicalName(),
+ FSYS_ACTION_COPYFILE );
+ if( nErr != ERRCODE_NONE )
+ {
+ SetError( nErr );
+ DoSaveCompleted( pMediumTmp );
+ DBG_ERROR("Fall der Faelle" );
+ return sal_False;
+ }
+ else aTmpFile.Kill();
+ }
+ else if( bNeedsStorage )
+ SaveCompleted( xNewTempRef );
+ }
+ else bOk = sal_False;
+ }
+#endif
+ if( bNeedsStorage )
+ SaveCompleted( xNewTempRef );
+
+ SfxMedium *pMed = bCopyTo ? pMedium : pNewFile;
+
+ if ( ! bCopyTo )
+ bOk = DoSaveCompleted( pMed );
+
+ //! Vorsich. Muss nicht immer klappen.
+ DBG_ASSERT( bOk, "DoSaveCompleted nicht geklappt "
+ "und keine Fehlerbehandlung");
+
+ if( bOk )
+ {
+ if( bCopyTo )
+ {
+// if ( !bRemote )
+// DELETEZ( pNewFile );
+ }
+ else
+ {
+ SetModified(sal_False);
+ bOk=sal_True;
+ }
+ }
+ else
+ {
+ SetError( pNewFile->GetErrorCode() );
+ DoSaveCompleted( pMedium );
+ DELETEZ( pNewFile );
+ }
+
+ String aPasswd;
+ if ( IsOwnStorageFormat_Impl( *GetMedium() ) && GetPasswd_Impl( GetMedium()->GetItemSet(), aPasswd ) )
+ GetMedium()->GetStorage()->SetKey( S2BS( aPasswd ) ); //!!! (pb) needs new implementation
+ }
+ else
+ {
+ INetURLObject::SetBaseURL( aOldURL );
+ SetError(pMediumTmp->GetErrorCode());
+// aTmpFile.Kill();
+ DoSaveCompleted( (SvStorage*)0 );
+ }
+// if( !bRemote )
+// delete pMediumTmp;
+
+ if(!bOk)
+ SetModified(sal_True);
+
+ if ( bCopyTo )
+ {
+ SfxDocumentInfo &rDocInfo = GetDocInfo();
+ rDocInfo = aSavedInfo;
+ }
+
+ return bOk;
+}
+
+//------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::LoadFrom( SvStorage *pStor )
+{
+ if (pStor->IsStream(SfxConfigManager::GetStreamName()))
+ SetConfigManager (new SfxConfigManager( pStor, 0));
+ GetDocInfo().Load(pStor);
+ return sal_True;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::CanReload_Impl()
+
+/* [Beschreibung]
+
+ Interne Methode zum Feststellen, ob eine erneutes Laden des
+ Dokuments (auch als RevertToSaved oder LastVersion bekannt)
+ m"oglich ist.
+*/
+
+{
+ const SfxMedium *pMedium = GetMedium();
+ const SfxFilter *pFilter = pMedium ? pMedium->GetFilter() : 0;
+ return pMedium && HasName() &&
+ ( !pFilter || ! pFilter->GetFilterName().EqualsAscii( SFX_FILTER_DOWNLOAD ) ) &&
+ !IsInModalMode() && !Application::IsInModalMode() &&
+ !pImp->bForbidReload;
+ // Fuer AutoLoad muss Reload immer enabled sein, also NICHT:
+ // ( IsModified() || GetMedium()->IsRemote()
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::LoadLayout() const
+{
+ return pImp->bLoadLayout;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxObjectShell::SetLoadLayout_Impl( sal_Bool bLoadLayout )
+{
+ pImp->bLoadLayout = bLoadLayout;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsInformationLost()
+{
+ const SfxFilter *pFilt = GetMedium()->GetFilter();
+ return pFilt && pFilt->IsAlienFormat() && pImp->bDidDangerousSave && !(pFilt->GetFilterFlags() & SFX_FILTER_SILENTEXPORT);
+}
+
+sal_Bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
+{
+ SvStorageRef xStor = rMedium.GetStorage();
+ if ( xStor.Is() )
+ {
+ // Config
+ if ( xStor->IsStream(SfxConfigManager::GetStreamName()) )
+ SetConfigManager (new SfxConfigManager( xStor, SFX_CFGMANAGER()));
+ if ( rMedium.GetFileVersion() )
+ xStor->SetVersion( rMedium.GetFileVersion() );
+
+ // Password
+ SFX_ITEMSET_ARG( rMedium.GetItemSet(), pPasswdItem,
+ SfxStringItem, SID_PASSWORD, sal_False );
+ SfxApplication *pApp = SFX_APP();
+ if ( pPasswdItem || ERRCODE_IO_ABORT != CheckPasswd_Impl( 0, pApp->GetPool(), pMedium ) )
+ {
+ String aPasswd;
+ if ( GetPasswd_Impl(pMedium->GetItemSet(), aPasswd) )
+ xStor->SetKey( S2BS( aPasswd ) ); //!!! (pb) needs new implementation
+
+ // load document
+ return Load( xStor );
+ }
+ return sal_False;
+ }
+ else
+ return sal_False;
+}
+
+sal_Bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
+{
+ SvStorageRef xStor = rMedium.GetStorage();
+ if( xStor.Is() )
+ {
+ xStor->SetVersion( rMedium.GetFilter()->GetVersion() );
+ const SfxFilter* pFilter = rMedium.GetFilter();
+ return SaveAs( xStor );
+ }
+ else return sal_False;
+}
+
+
+void SfxObjectShell::AddXMLAsZipToTheStorage( SvStorage& rRoot )
+{
+ static struct _ObjExpType {
+ const char* pModuleNm;
+ // GlobalNameId
+ UINT32 n1;
+ USHORT n2, n3;
+ BYTE b8, b9, b10, b11, b12, b13, b14, b15;
+ } aArr[] = {
+ { "Writer", SO3_SW_CLASSID_50 },
+ { "Calc", SO3_SC_CLASSID_50 },
+ { "Impress", SO3_SIMPRESS_CLASSID_50 },
+ { "Draw", SO3_SDRAW_CLASSID_50 },
+ { 0 }
+ };
+
+ for( const _ObjExpType* pArr = aArr; pArr->pModuleNm; ++pArr )
+ {
+ SvGlobalName aGlbNm( pArr->n1, pArr->n2, pArr->n3,
+ pArr->b8, pArr->b9, pArr->b10, pArr->b11,
+ pArr->b12, pArr->b13, pArr->b14, pArr->b15 );
+ if( *GetSvFactory() == aGlbNm )
+ {
+ // 1. check if the option is set and unequal 0 or is not set
+ String sStr( String::CreateFromAscii( "Add_XML_to_Storage_" ));
+ sStr.AppendAscii( pArr->pModuleNm );
+ String sCfgEntry( SFX_APP()->GetIniManager()->Get(
+ SFX_GROUP_WORKINGSET_IMPL, sStr ));
+ if( sCfgEntry.Len() && 0 != sCfgEntry.ToInt32() )
+ {
+ // the flag is set
+ sStr.AssignAscii( "StarOffice XML (" );
+ sStr.AppendAscii( pArr->pModuleNm );
+ sStr += ')';
+ // 2. exist the XML filter? "StarOffice XML (<Application>)"?
+ const SfxFilter* pFilter = GetFactory().GetFilterContainer()->
+ GetFilter4FilterName( sStr );
+ if( pFilter )
+ {
+ // 3. create a temp stream and write the XML format into it
+ SvCacheStream aTmp;
+ SvStorageRef xTmp = new SvStorage( aTmp );
+ SfxMedium aMed( xTmp, TRUE );
+
+ aMed.SetFilter( pFilter );
+
+ if( ConvertTo( aMed ) )
+ {
+ // 4. zip the XML and put it into the root storage.
+ // The name of the stream is XMLFormat
+ SvStorageStreamRef xStrm( rRoot.OpenStream(
+ String::CreateFromAscii( "XMLFormat" ) ));
+ SvStream* pOutStrm = aMed.GetOutStream();
+ pOutStrm->Seek( 0 );
+
+ ZCodec aCodec;
+ aCodec.BeginCompression( ZCODEC_BEST_COMPRESSION );
+ aCodec.Compress( *pOutStrm, *xStrm );
+ aCodec.EndCompression();
+ }
+ }
+ }
+ // that's all
+ break;
+ }
+ }
+}
diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx
new file mode 100644
index 000000000000..348ce72e4ca9
--- /dev/null
+++ b/sfx2/source/doc/objuno.cxx
@@ -0,0 +1,911 @@
+/*************************************************************************
+ *
+ * $RCSfile: objuno.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
+#include <com/sun/star/lang/DisposedException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_DATETIME_HPP_
+#include <com/sun/star/util/DateTime.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
+#include <cppuhelper/interfacecontainer.hxx>
+#endif
+#ifndef _COM_SUN_STAR_IO_IOEXCEPTION_HPP_
+#include <com/sun/star/io/IOException.hpp>
+#endif
+
+#include <tools/errcode.hxx>
+#include <so3/svstor.hxx>
+#include <svtools/cntwids.hrc>
+#include <svtools/itemset.hxx>
+#include <svtools/stritem.hxx>
+#include <svtools/intitem.hxx>
+#include <svtools/eitem.hxx>
+#include <svtools/adrparse.hxx>
+
+#include "objuno.hxx"
+#include "sfx.hrc"
+#include "sfxsids.hrc"
+#include "viewsh.hxx"
+#include "viewfrm.hxx"
+#include "printer.hxx"
+#include "objsh.hxx"
+#include "docinf.hxx"
+#include "docfile.hxx"
+#include "dispatch.hxx"
+#include "openflag.hxx"
+#include "app.hxx"
+#include "fcontnr.hxx"
+#include "request.hxx"
+#include "sfxuno.hxx"
+#include <objshimp.hxx>
+
+#include <osl/mutex.hxx>
+#ifdef _USE_NAMESPACE
+using namespace vos;
+#endif
+
+#define SfxIOException_Impl( nErr ) ::com::sun::star::io::IOException()
+
+//=============================================================================
+
+#define PROPERTY_UNBOUND 0
+SfxItemPropertyMap aDocInfoPropertyMap_Impl[] =
+{
+ { "Author" , 6 , WID_FROM, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "AutoloadEnabled" , 15, MID_DOCINFO_AUTOLOADENABLED, &::getBooleanCppuType(), PROPERTY_UNBOUND, 0 },
+ { "AutoloadSecs" , 12, MID_DOCINFO_AUTOLOADSECS, &::getCppuType((const sal_Int16*)0), PROPERTY_UNBOUND, 0 },
+ { "AutoloadURL" , 11, MID_DOCINFO_AUTOLOADURL, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "BlindCopiesTo" , 13, WID_BCC, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "CopyTo" , 6 , WID_CC, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "CreationDate" , 12, WID_DATE_CREATED, &::getCppuType((const ::com::sun::star::util::DateTime*)0),PROPERTY_UNBOUND, 0 },
+ { "DefaultTarget" , 13, MID_DOCINFO_DEFAULTTARGET, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "Description" , 11, MID_DOCINFO_DESCRIPTION, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "EditingCycles" , 13, MID_DOCINFO_REVISION, &::getCppuType((const sal_Int16*)0), PROPERTY_UNBOUND, 0 },
+ { "EditingDuration" , 15, MID_DOCINFO_EDITTIME, &::getCppuType((const sal_Int32*)0), PROPERTY_UNBOUND, 0 },
+ { "InReplyTo" , 9 , WID_IN_REPLY_TO, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "IsEncrypted" , 11, MID_DOCINFO_ENCRYPTED, &::getBooleanCppuType(), PROPERTY_UNBOUND | ::com::sun::star::beans::PropertyAttribute::READONLY, 0 },
+ { "Keywords" , 8 , WID_KEYWORDS, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "MIMEType" , 8 , WID_CONTENT_TYPE, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND | ::com::sun::star::beans::PropertyAttribute::READONLY, 0 },
+ { "ModifiedBy" , 10, MID_DOCINFO_MODIFICATIONAUTHOR, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "ModifyDate" , 10, WID_DATE_MODIFIED, &::getCppuType((const ::com::sun::star::util::DateTime*)0),PROPERTY_UNBOUND, 0 },
+ { "Newsgroups" , 10, WID_NEWSGROUPS, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "Original" , 8 , WID_MESSAGE_ID, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "PrintDate" , 9 , MID_DOCINFO_PRINTDATE, &::getCppuType((const ::com::sun::star::util::DateTime*)0),PROPERTY_UNBOUND, 0 },
+ { "PrintedBy" , 9 , MID_DOCINFO_PRINTEDBY, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "Priority" , 8 , WID_PRIORITY, &::getCppuType((const sal_Int16*)0), PROPERTY_UNBOUND, 0 },
+ { "Recipient" , 9 , WID_TO, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "References" , 10, WID_REFERENCES, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "ReplyTo" , 7 , WID_REPLY_TO, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "Template" , 8 , MID_DOCINFO_TEMPLATE, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "TemplateFileName", 16, SID_TEMPLATE_NAME, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "TemplateDate" , 12, MID_DOCINFO_TEMPLATEDATE, &::getCppuType((const ::com::sun::star::util::DateTime*)0),PROPERTY_UNBOUND, 0 },
+ { "Theme" , 5 , MID_DOCINFO_SUBJECT, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ { "Title" , 5 , WID_TITLE, &::getCppuType((const ::rtl::OUString*)0), PROPERTY_UNBOUND, 0 },
+ {0,0,0,0,0}
+};
+
+//-----------------------------------------------------------------------------
+SFX_IMPL_XINTERFACE_5( SfxDocumentInfoObject, OWeakObject, ::com::sun::star::document::XDocumentInfo, ::com::sun::star::lang::XComponent, ::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XFastPropertySet, ::com::sun::star::beans::XPropertyAccess )
+SFX_IMPL_XTYPEPROVIDER_5( SfxDocumentInfoObject, ::com::sun::star::document::XDocumentInfo, ::com::sun::star::lang::XComponent, ::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XFastPropertySet, ::com::sun::star::beans::XPropertyAccess )
+/*
+::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > SfxDocumentInfoObject::getStaticIdlClass()
+{
+ // Global Method, must be guarded (multithreading)
+ MutexGuard aGuard( Mutex::getGlobalMutex() );
+ {
+ // use the standard class implementation of the usr library
+ static ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > xClass =
+ createStandardClass(
+ "com.sun.star.comp.sfx2.DocumentInfo",
+ OWeakObject::getStaticIdlClass(),
+ 4,
+ ::getCppuType((const ::com::sun::star::lang::XComponent*)0),
+ ::getCppuType((const ::com::sun::star::document::XDocumentInfo*)0),
+ ::getCppuType((const ::com::sun::star::beans::XPropertyAccess*)0),
+ ::getCppuType((const ::com::sun::star::beans::XPropertySet*)0),
+ ::getCppuType((const ::com::sun::star::beans::XFastPropertySet*)0) );
+
+ return xClass;
+ }
+}
+*/
+//-----------------------------------------------------------------------------
+struct SfxDocumentInfoObject_Impl
+{
+ SfxObjectShell* _pObjSh;
+ ::osl::Mutex _aMutex;
+ ::cppu::OInterfaceContainerHelper _aDisposeContainer;
+
+ SfxDocumentInfoObject_Impl( SfxObjectShell* pObjSh )
+ : _pObjSh( pObjSh )
+ , _aDisposeContainer( _aMutex )
+ {
+ }
+};
+
+//-----------------------------------------------------------------------------
+
+SfxDocumentInfoObject::SfxDocumentInfoObject( sal_Bool bStandalone )
+ : _aPropSet( aDocInfoPropertyMap_Impl )
+ , _pInfo( NULL )
+ , _pFilter( NULL )
+ , _bStandalone( bStandalone )
+ , _pImp( new SfxDocumentInfoObject_Impl( NULL ) )
+{
+}
+
+//-----------------------------------------------------------------------------
+
+SfxDocumentInfoObject::SfxDocumentInfoObject( SfxObjectShell *pObjSh )
+ : _aPropSet( aDocInfoPropertyMap_Impl )
+ , _pInfo( 0 )
+ , _pFilter( NULL )
+ , _bStandalone( sal_False )
+ , _pImp( new SfxDocumentInfoObject_Impl( pObjSh ) )
+{
+ if ( pObjSh )
+ {
+ SfxDocumentInfo &rDocInfo = pObjSh->GetDocInfo();
+ _pInfo = &rDocInfo;
+ _pFilter = pObjSh->GetMedium()->GetFilter();
+ _xObjSh = pObjSh;
+ }
+}
+
+//-----------------------------------------------------------------------------
+
+SfxDocumentInfoObject::~SfxDocumentInfoObject()
+{
+ if ( _bStandalone )
+ delete _pInfo;
+ delete _pImp;
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::dispose() throw( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::lang::EventObject aEvent( (::cppu::OWeakObject *)this );
+ _pImp->_aDisposeContainer.disposeAndClear( aEvent );
+
+/*
+ _xCurrent = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > ();
+ for ( sal_uInt32 n = _aControllers.ge.getLength(); n; --n )
+ SequenceRemoveElementAt( _aControllers, n-1 );
+*/
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{
+ _pImp->_aDisposeContainer.addInterface( aListener );
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{
+ _pImp->_aDisposeContainer.removeInterface( aListener );
+}
+//-----------------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL SfxDocumentInfoObject::getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException )
+{
+ return _aPropSet.getPropertySetInfo();
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::setPropertyValue(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue) throw( ::com::sun::star::uno::RuntimeException )
+{
+ const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName(
+ aDocInfoPropertyMap_Impl,
+ aPropertyName );
+ if ( pMap )
+ setFastPropertyValue( pMap->nWID, aValue );
+}
+
+//-----------------------------------------------------------------------------
+
+::com::sun::star::uno::Any SAL_CALL SfxDocumentInfoObject::getPropertyValue(const ::rtl::OUString& aPropertyName) throw( ::com::sun::star::uno::RuntimeException )
+{
+ const SfxItemPropertyMap* pMap = SfxItemPropertyMap::GetByName( aDocInfoPropertyMap_Impl,
+ aPropertyName );
+ if ( pMap )
+ return getFastPropertyValue( pMap->nWID );
+ else
+ return ::com::sun::star::uno::Any();
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::addPropertyChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::removePropertyChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::addVetoableChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::removeVetoableChangeListener(const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener) throw( ::com::sun::star::uno::RuntimeException )
+{}
+
+::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL SfxDocumentInfoObject::getPropertyValues( void ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > xInfo = getPropertySetInfo();
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > aProps = xInfo->getProperties();
+
+ const ::com::sun::star::beans::Property* pProps = aProps.getConstArray();
+ sal_uInt32 nCount = aProps.getLength();
+
+ ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >aSeq( nCount );
+ ::com::sun::star::beans::PropertyValue* pValues = aSeq.getArray();
+
+ for ( sal_uInt32 n = 0; n < nCount; ++n )
+ {
+ ::com::sun::star::beans::PropertyValue& rCurrValue = pValues[n];
+ const ::com::sun::star::beans::Property& rCurrProp = pProps[n];
+
+ rCurrValue.Name = rCurrProp.Name;
+ rCurrValue.Handle = rCurrProp.Handle;
+ rCurrValue.Value = getPropertyValue( rCurrProp.Name );
+ }
+
+ return aSeq;
+}
+
+void SAL_CALL SfxDocumentInfoObject::setPropertyValues( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps )
+ throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException )
+{
+ const ::com::sun::star::beans::PropertyValue* pProps = aProps.getConstArray();
+ sal_uInt32 nCount = aProps.getLength();
+
+ for ( sal_uInt32 n = 0; n < nCount; ++n )
+ {
+ const ::com::sun::star::beans::PropertyValue& rProp = pProps[n];
+ setPropertyValue( rProp.Name, rProp.Value );
+ }
+}
+
+::com::sun::star::util::DateTime SfxDocumentInfoObject::impl_DateTime_Object2Struct( const ::DateTime& aDateTimeObject )
+{
+ // Attention!
+ // We can't use a DateTime-object as type of any property with new UNO!
+ // We must use a DateTime-struct and convert the values.
+
+ ::com::sun::star::util::DateTime aDateTimeStruct ; // com/sun/star/util/DateTime !!!
+
+ // ... and convert DateTime-object to struct ! (copy values)
+ aDateTimeStruct.HundredthSeconds = aDateTimeObject.Get100Sec () ;
+ aDateTimeStruct.Seconds = aDateTimeObject.GetSec () ;
+ aDateTimeStruct.Minutes = aDateTimeObject.GetMin () ;
+ aDateTimeStruct.Hours = aDateTimeObject.GetHour () ;
+ aDateTimeStruct.Day = aDateTimeObject.GetDay () ;
+ aDateTimeStruct.Month = aDateTimeObject.GetMonth () ;
+ aDateTimeStruct.Year = aDateTimeObject.GetYear () ;
+
+ // Return ricght type with right values.
+ return aDateTimeStruct ;
+}
+
+::DateTime SfxDocumentInfoObject::impl_DateTime_Struct2Object ( const ::com::sun::star::util::DateTime& aDateTimeStruct )
+{
+ // Attention!
+ // We can't use a DateTime-object as type of any property with new UNO!
+ // We must use a DateTime-struct and convert the values.
+
+ // Get values from DateTime-struct and create a date and time instance ...
+ ::Date aDate ( aDateTimeStruct.Day , aDateTimeStruct.Month , aDateTimeStruct.Year ) ;
+ ::Time aTime ( aDateTimeStruct.Hours, aDateTimeStruct.Minutes , aDateTimeStruct.Seconds, aDateTimeStruct.HundredthSeconds ) ;
+
+ // ... to use it for creation of a DateTime-object ...
+ ::DateTime aDateTimeObject ( aDate, aTime ) ;
+
+ // Return converted values.
+ return aDateTimeObject ;
+}
+
+
+void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue) throw( ::com::sun::star::uno::RuntimeException )
+{
+ sal_Bool bModified = sal_True;
+
+ if ( _pInfo && aValue.getValueType() == ::getCppuType((const ::rtl::OUString*)0) )
+ {
+ ::rtl::OUString sTemp ;
+ aValue >>= sTemp ;
+ String aStrVal( sTemp );
+ switch ( nHandle )
+ {
+ case WID_FROM :
+ {
+ const SfxStamp& rStamp = _pInfo->GetCreated();
+ if ( aStrVal.Len() > TIMESTAMP_MAXLENGTH )
+ {
+ SvAddressParser aParser( aStrVal );
+ if ( aParser.Count() > 0 )
+ {
+ String aEmail = aParser.GetEmailAddress(0);
+ String aRealname = aParser.GetRealName(0);
+
+ if ( aRealname.Len() <= TIMESTAMP_MAXLENGTH )
+ aStrVal = aRealname;
+ else if ( aEmail.Len() <= TIMESTAMP_MAXLENGTH )
+ aStrVal = aEmail;
+ }
+ }
+ _pInfo->SetCreated( SfxStamp( aStrVal, rStamp.GetTime() ) );
+ break;
+ }
+ case MID_DOCINFO_PRINTEDBY:
+ {
+ const SfxStamp& rStamp = _pInfo->GetPrinted();
+ _pInfo->SetPrinted( SfxStamp( aStrVal, rStamp.GetTime() ) );
+ }
+ case MID_DOCINFO_MODIFICATIONAUTHOR:
+ {
+ const SfxStamp& rStamp = _pInfo->GetChanged();
+ _pInfo->SetChanged( SfxStamp( aStrVal, rStamp.GetTime() ) );
+ break;
+ }
+ case WID_TITLE :
+ _pInfo->SetTitle( aStrVal );
+ if ( _xObjSh )
+ {
+ _xObjSh->InvalidateName();
+ _xObjSh->Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) );
+ }
+ break;
+ case MID_DOCINFO_SUBJECT :
+ _pInfo->SetTheme( aStrVal );
+ break;
+ case WID_KEYWORDS :
+ _pInfo->SetKeywords( aStrVal );
+ break;
+ case WID_CC :
+ _pInfo->SetCopiesTo( aStrVal );
+ break;
+ case WID_MESSAGE_ID :
+ _pInfo->SetOriginal( aStrVal );
+ break;
+ case WID_REFERENCES :
+ _pInfo->SetReferences( aStrVal );
+ break;
+ case WID_TO :
+ _pInfo->SetRecipient( aStrVal );
+ break;
+ case WID_REPLY_TO :
+ _pInfo->SetReplyTo( aStrVal );
+ break;
+ case MID_DOCINFO_TEMPLATE:
+ _pInfo->SetTemplateName( aStrVal );
+ break;
+ case SID_TEMPLATE_NAME:
+ _pInfo->SetTemplateFileName( aStrVal );
+ break;
+ case WID_BCC :
+ _pInfo->SetBlindCopies( aStrVal );
+ break;
+ case WID_IN_REPLY_TO :
+ _pInfo->SetInReplyTo( aStrVal );
+ break;
+ case WID_NEWSGROUPS :
+ _pInfo->SetNewsgroups( aStrVal );
+ break;
+ case MID_DOCINFO_DESCRIPTION:
+ _pInfo->SetComment( aStrVal );
+ break;
+ case MID_DOCINFO_AUTOLOADURL:
+ _pInfo->SetReloadURL( aStrVal );
+ break;
+ case MID_DOCINFO_DEFAULTTARGET:
+ _pInfo->SetDefaultTarget( aStrVal );
+ break;
+ default:
+ bModified = sal_False;
+ break;
+ }
+ }
+ else if ( _pInfo && aValue.getValueType() == ::getCppuType((const ::com::sun::star::util::DateTime*)0) )
+ {
+ switch ( nHandle )
+ {
+ case WID_DATE_CREATED :
+ {
+ const SfxStamp& rStamp = _pInfo->GetCreated();
+ ::com::sun::star::util::DateTime aDateTime ;
+ aValue >>= aDateTime ;
+ _pInfo->SetCreated( SfxStamp( rStamp.GetName(), impl_DateTime_Struct2Object(aDateTime) ) );
+ break;
+ }
+ case WID_DATE_MODIFIED :
+ {
+ const SfxStamp& rStamp = _pInfo->GetChanged();
+ ::com::sun::star::util::DateTime aDateTime ;
+ aValue >>= aDateTime ;
+ _pInfo->SetChanged( SfxStamp( rStamp.GetName(), impl_DateTime_Struct2Object(aDateTime) ) );
+ break;
+ }
+ case MID_DOCINFO_PRINTDATE :
+ {
+ const SfxStamp& rStamp = _pInfo->GetPrinted();
+ ::com::sun::star::util::DateTime aDateTime ;
+ aValue >>= aDateTime ;
+ _pInfo->SetPrinted( SfxStamp( rStamp.GetName(), impl_DateTime_Struct2Object(aDateTime) ) );
+ break;
+ }
+ default:
+ bModified = sal_False;
+ break;
+ }
+ }
+ else if ( _pInfo && aValue.getValueType() == ::getBooleanCppuType() )
+ {
+ sal_Bool bBoolVal ;
+ aValue >>= bBoolVal ;
+ switch ( nHandle )
+ {
+ case MID_DOCINFO_AUTOLOADENABLED:
+ _pInfo->EnableReload( bBoolVal );
+ break;
+ default:
+ bModified = sal_False;
+ }
+ }
+ else if ( _pInfo && aValue.getValueType() == ::getCppuType((const sal_Int32*)0) )
+ {
+ long nIntVal ;
+ aValue >>= nIntVal ;
+ switch ( nHandle )
+ {
+ case MID_DOCINFO_AUTOLOADSECS:
+ _pInfo->SetReloadDelay( nIntVal );
+ break;
+ case MID_DOCINFO_EDITTIME:
+ _pInfo->SetTime( nIntVal );
+ default:
+ bModified = sal_False;
+ }
+ }
+ else if ( _pInfo && aValue.getValueType() == ::getCppuType((const sal_Int16*)0) )
+ {
+ short nIntVal ;
+ aValue >>= nIntVal ;
+ switch ( nHandle )
+ {
+ case MID_DOCINFO_REVISION:
+ _pInfo->SetDocumentNumber( nIntVal );
+ case WID_PRIORITY :
+ _pInfo->SetPriority( nIntVal );
+ break;
+ default:
+ bModified = sal_False;
+ break;
+ }
+ }
+
+ if ( bModified && _pImp->_pObjSh )
+ _pImp->_pObjSh->SetModified( sal_True );
+}
+
+//-----------------------------------------------------------------------------
+
+::com::sun::star::uno::Any SAL_CALL SfxDocumentInfoObject::getFastPropertyValue(sal_Int32 nHandle) throw( ::com::sun::star::uno::RuntimeException )
+{
+ ::com::sun::star::uno::Any aValue;
+ if ( nHandle == WID_CONTENT_TYPE )
+ {
+ if ( _pInfo && _pInfo->GetSpecialMimeType().Len() )
+ {
+ ::rtl::OUString sTemp ( _pInfo->GetSpecialMimeType() );
+ aValue <<= sTemp ;
+ }
+ else if ( _pFilter )
+ {
+ ::rtl::OUString sTemp ( _pFilter->GetMimeType() );
+ aValue <<= sTemp ;
+ }
+ else
+ aValue <<= ::rtl::OUString() ;
+ }
+ else if ( _pInfo )
+ {
+ switch ( nHandle )
+ {
+ case MID_DOCINFO_REVISION :
+ aValue <<= _pInfo->GetDocumentNumber() ;
+ break;
+ case MID_DOCINFO_EDITTIME :
+ aValue <<= _pInfo->GetTime();
+ break;
+ case WID_FROM :
+ {
+ const SfxStamp& rStamp = _pInfo->GetCreated();
+ if ( rStamp.IsValid() )
+ aValue <<= ::rtl::OUString( rStamp.GetName() );
+ else
+ aValue <<= ::rtl::OUString() ;
+ break;
+ }
+ case WID_DATE_CREATED :
+ {
+ const SfxStamp& rStamp = _pInfo->GetCreated();
+ if ( rStamp.IsValid() )
+ aValue <<= impl_DateTime_Object2Struct(rStamp.GetTime());
+ break;
+ }
+ case WID_TITLE :
+ aValue <<= ::rtl::OUString( _pInfo->GetTitle() );
+ break;
+ case MID_DOCINFO_SUBJECT:
+ aValue <<= ::rtl::OUString( _pInfo->GetTheme() );
+ break;
+ case MID_DOCINFO_MODIFICATIONAUTHOR:
+ {
+ const SfxStamp& rStamp = _pInfo->GetChanged();
+ if ( rStamp.IsValid() )
+ aValue <<= ::rtl::OUString( rStamp.GetName() );
+ else
+ aValue <<= ::rtl::OUString() ;
+ break;
+ }
+ case WID_DATE_MODIFIED :
+ {
+ const SfxStamp& rStamp = _pInfo->GetChanged();
+ if ( rStamp.IsValid() )
+ aValue <<= impl_DateTime_Object2Struct(rStamp.GetTime());
+ break;
+ }
+ case MID_DOCINFO_PRINTEDBY:
+ {
+ const SfxStamp& rStamp = _pInfo->GetPrinted();
+ if ( rStamp.IsValid() )
+ aValue <<= ::rtl::OUString( rStamp.GetName() );
+ else
+ aValue <<= ::rtl::OUString() ;
+ break;
+ }
+ case MID_DOCINFO_PRINTDATE:
+ {
+ const SfxStamp& rStamp = _pInfo->GetPrinted();
+ if ( rStamp.IsValid() )
+ aValue <<= impl_DateTime_Object2Struct(rStamp.GetTime());
+ break;
+ }
+ case WID_KEYWORDS :
+ aValue <<= rtl::OUString( _pInfo->GetKeywords() );
+ break;
+ case WID_PRIORITY :
+ aValue <<= _pInfo->GetPriority() ;
+ break;
+ case WID_CC :
+ aValue <<= rtl::OUString( _pInfo->GetCopiesTo() );
+ break;
+ case WID_MESSAGE_ID :
+ aValue <<= rtl::OUString( _pInfo->GetOriginal() );
+ break;
+ case WID_REFERENCES :
+ aValue <<= rtl::OUString( _pInfo->GetReferences() );
+ break;
+ case WID_TO :
+ aValue <<= rtl::OUString( _pInfo->GetRecipient() );
+ break;
+ case WID_REPLY_TO :
+ aValue <<= rtl::OUString( _pInfo->GetReplyTo() );
+ break;
+ case WID_BCC :
+ aValue <<= rtl::OUString( _pInfo->GetBlindCopies() );
+ break;
+ case WID_IN_REPLY_TO :
+ aValue <<= rtl::OUString( _pInfo->GetInReplyTo() );
+ break;
+ case WID_NEWSGROUPS :
+ aValue <<= rtl::OUString( _pInfo->GetNewsgroups() );
+ break;
+ case MID_DOCINFO_DESCRIPTION:
+ aValue <<= rtl::OUString( _pInfo->GetComment() );
+ break;
+ case MID_DOCINFO_TEMPLATE:
+ aValue <<= rtl::OUString( _pInfo->GetTemplateName() );
+ break;
+ case SID_TEMPLATE_NAME:
+ aValue <<= rtl::OUString( _pInfo->GetTemplateFileName() );
+ break;
+ case MID_DOCINFO_TEMPLATEDATE:
+ aValue <<= impl_DateTime_Object2Struct(_pInfo->GetTemplateDate());
+ break;
+ case MID_DOCINFO_AUTOLOADENABLED:
+ aValue <<= _pInfo->IsReloadEnabled() ;
+ break;
+ case MID_DOCINFO_AUTOLOADURL:
+ aValue <<= rtl::OUString( _pInfo->GetReloadURL() );
+ break;
+ case MID_DOCINFO_AUTOLOADSECS:
+ aValue <<= _pInfo->GetReloadDelay() ;
+ break;
+ case MID_DOCINFO_DEFAULTTARGET:
+ aValue <<= rtl::OUString( _pInfo->GetDefaultTarget() );
+ break;
+ default:
+ aValue <<= ::rtl::OUString();
+ break;
+ }
+ }
+
+ return aValue;
+}
+
+//-----------------------------------------------------------------------------
+
+sal_Int16 SAL_CALL SfxDocumentInfoObject::getUserFieldCount() throw( ::com::sun::star::uno::RuntimeException )
+{
+ return _pInfo->GetUserKeyCount();
+}
+
+//-----------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL SfxDocumentInfoObject::getUserFieldName(sal_Int16 nIndex) throw( ::com::sun::star::uno::RuntimeException )
+{
+ if ( _pInfo && nIndex < _pInfo->GetUserKeyCount() )
+ return _pInfo->GetUserKey( nIndex ).GetTitle();
+ else
+ return ::rtl::OUString();
+}
+
+//-----------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL SfxDocumentInfoObject::getUserFieldValue(sal_Int16 nIndex) throw( ::com::sun::star::uno::RuntimeException )
+{
+ if ( _pInfo && nIndex < _pInfo->GetUserKeyCount() )
+ return _pInfo->GetUserKey( nIndex ).GetWord();
+ else
+ return ::rtl::OUString();
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::setUserFieldName(sal_Int16 nIndex, const ::rtl::OUString& aName ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ if ( _pInfo && nIndex < _pInfo->GetUserKeyCount() )
+ {
+ const SfxDocUserKey& rKey = _pInfo->GetUserKey( nIndex );
+ _pInfo->SetUserKey( SfxDocUserKey( aName, rKey.GetWord() ), nIndex );
+ if ( _pImp->_pObjSh )
+ _pImp->_pObjSh->SetModified( sal_True );
+ }
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxDocumentInfoObject::setUserFieldValue( sal_Int16 nIndex, const ::rtl::OUString& aValue ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ if ( _pInfo && nIndex < _pInfo->GetUserKeyCount() )
+ {
+ const SfxDocUserKey& rKey = _pInfo->GetUserKey( nIndex );
+ _pInfo->SetUserKey( SfxDocUserKey( rKey.GetTitle(), aValue ), nIndex );
+ if ( _pImp->_pObjSh )
+ _pImp->_pObjSh->SetModified( sal_True );
+ }
+}
+
+//-----------------------------------------------------------------------------
+SFX_IMPL_XINTERFACE_1( SfxStandaloneDocumentInfoObject, SfxDocumentInfoObject, ::com::sun::star::document::XStandaloneDocumentInfo )
+SFX_IMPL_XTYPEPROVIDER_6( SfxStandaloneDocumentInfoObject, ::com::sun::star::document::XDocumentInfo, ::com::sun::star::lang::XComponent, ::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XFastPropertySet, ::com::sun::star::beans::XPropertyAccess, ::com::sun::star::document::XStandaloneDocumentInfo )
+SFX_IMPL_XSERVICEINFO( SfxStandaloneDocumentInfoObject, "com.sun.star.document.StandaloneDocumentInfo", "com.sun.star.comp.sfx2.StandaloneDocumentInfo" )
+SFX_IMPL_SINGLEFACTORY( SfxStandaloneDocumentInfoObject )
+
+SfxStandaloneDocumentInfoObject::SfxStandaloneDocumentInfoObject( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory )
+ : SfxDocumentInfoObject( sal_True )
+ , _pMedium( NULL )
+{
+}
+
+//-----------------------------------------------------------------------------
+
+SfxStandaloneDocumentInfoObject::~SfxStandaloneDocumentInfoObject()
+{
+ delete _pMedium;
+}
+
+//-----------------------------------------------------------------------------
+
+SvStorage* SfxStandaloneDocumentInfoObject::GetStorage_Impl( const String& rName, sal_Bool bWrite )
+{
+ // Medium erstellen
+ if ( _pMedium )
+ delete _pMedium;
+
+ _pMedium = new SfxMedium( rName, bWrite ? SFX_STREAM_READWRITE : SFX_STREAM_READONLY, sal_True );
+ if ( !_pMedium->IsStorage() || SVSTREAM_OK != _pMedium->GetError() )
+ // Datei existiert nicht oder ist kein Storage
+ return NULL;
+
+ // Filter-Detection wegen FileFormat-Version
+ _pFilter = 0;
+ if ( 0 != SFX_APP()->GetFilterMatcher().GuessFilter( *_pMedium, &_pFilter )
+ || !bWrite && !_pFilter )
+ // unbekanntes Dateiformat
+ return NULL;
+
+ // Storage "offnen
+ SvStorageRef xStor = _pMedium->GetStorage();
+ DBG_ASSERT( xStor.Is(), "no storage" );
+ xStor->SetVersion( _pFilter ? _pFilter->GetVersion() : SOFFICE_FILEFORMAT_NOW );
+ return xStor;
+}
+
+//-----------------------------------------------------------------------------
+
+sal_Int16 SAL_CALL SfxStandaloneDocumentInfoObject::getUserFieldCount() throw( ::com::sun::star::uno::RuntimeException )
+{
+ return SfxDocumentInfoObject::getUserFieldCount();
+}
+
+//-----------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL SfxStandaloneDocumentInfoObject::getUserFieldName(sal_Int16 nIndex) throw( ::com::sun::star::uno::RuntimeException )
+{
+ return SfxDocumentInfoObject::getUserFieldName(nIndex);
+}
+
+//-----------------------------------------------------------------------------
+
+::rtl::OUString SAL_CALL SfxStandaloneDocumentInfoObject::getUserFieldValue(sal_Int16 nIndex) throw( ::com::sun::star::uno::RuntimeException )
+{
+ return SfxDocumentInfoObject::getUserFieldValue(nIndex);
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxStandaloneDocumentInfoObject::setUserFieldName(sal_Int16 nIndex, const ::rtl::OUString& aName ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ SfxDocumentInfoObject::setUserFieldName( nIndex, aName );
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxStandaloneDocumentInfoObject::setUserFieldValue( sal_Int16 nIndex, const ::rtl::OUString& aValue ) throw( ::com::sun::star::uno::RuntimeException )
+{
+ SfxDocumentInfoObject::setUserFieldValue( nIndex, aValue );
+}
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxStandaloneDocumentInfoObject::loadFromURL(const ::rtl::OUString& aURL) throw( ::com::sun::star::uno::RuntimeException )
+{
+ sal_Bool bOK = sal_False;
+ String aName( aURL );
+ SvStorage* pStor = GetStorage_Impl( aName, sal_False );
+ if ( pStor )
+ {
+ if ( !_pInfo )
+ _pInfo = new SfxDocumentInfo;
+
+ // DocInfo laden
+ bOK = _pInfo->Load( pStor );
+ }
+
+ DELETEZ( _pMedium );
+ if ( !bOK )
+ throw SfxIOException_Impl( ERRCODE_IO_CANTREAD );
+}
+
+//-----------------------------------------------------------------------------
+
+void SAL_CALL SfxStandaloneDocumentInfoObject::storeIntoURL(const ::rtl::OUString& aURL) throw( ::com::sun::star::uno::RuntimeException )
+{
+ sal_Bool bOK = sal_False;
+ String aName( aURL );
+ SvStorage* pStor = GetStorage_Impl( aName, sal_True );
+ if ( pStor )
+ {
+ if ( !_pInfo )
+ _pInfo = new SfxDocumentInfo;
+
+ // DocInfo speichern
+ bOK = _pInfo->Save( pStor ) && pStor->Commit();
+ }
+
+ DELETEZ( _pMedium );
+ if ( !bOK )
+ throw SfxIOException_Impl( ERRCODE_IO_CANTREAD );
+}
+
+//=============================================================================
+/* ASMUSS
+#ifdef TEST_CODE
+ // Testcode fuer DocumentInfoObject
+ // Einmal zum Holen
+ ::com::sun::star::uno::Reference< XServiceManager > xMan = getGlobalServiceManager();
+ ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Uik > aIfaces( 2 );
+ aIfaces.getArray()[0] = ::getCppuType((const Reference< ::com::sun::star::document::XDocumentInfo >*)0);
+ aIfaces.getArray()[1] = ::getCppuType((const Reference< ::com::sun::star::beans::XFastPropertySet >*)0);
+ ::com::sun::star::uno::Reference< XServiceProvider > xSSI = xMan->getServiceProvider(
+ "com.sun.star.document.DocumentInfo", aIfaces, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Uik >() );
+// automatisch auskommentiert - [getIdlClass(es) or queryInterface] - Bitte XTypeProvider benutzen!
+// ::com::sun::star::uno::Reference< ::com::sun::star::document::XDocumentInfo > xInfo = (::com::sun::star::document::XDocumentInfo*) xSSI->newInstance()->queryInterface( ::getCppuType((const Reference< ::com::sun::star::document::XDocumentInfo >*)0) );
+
+// automatisch auskommentiert - [getIdlClass(es) or queryInterface] - Bitte XTypeProvider benutzen!
+// ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > xProps = (::com::sun::star::beans::XFastPropertySet*) xInfo->queryInterface( ::getCppuType((const Reference< ::com::sun::star::beans::XFastPropertySet >*)0) );
+
+
+ // Laden und Werte auslesen
+ xInfo->load( StringToOUString( aURL, CHARSET_SYSTEM ) );
+ ::com::sun::star::uno::Any aValue = xProps->getFastPropertyValue( WID_FROM );
+ String aAuthor = OUStringToString( aValue.getString(), CHARSET_SYSTEM );
+#endif
+*/
+
+
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
new file mode 100644
index 000000000000..4d447764b907
--- /dev/null
+++ b/sfx2/source/doc/objxtor.cxx
@@ -0,0 +1,762 @@
+/*************************************************************************
+ *
+ * $RCSfile: objxtor.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "arrdecl.hxx"
+
+#ifndef _MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _RTTI_HXX //autogen
+#include <tools/rtti.hxx>
+#endif
+#ifndef _SFXLSTNER_HXX //autogen
+#include <svtools/lstner.hxx>
+#endif
+#ifndef _SB_SBSTAR_HXX //autogen
+#include <basic/sbstar.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX
+#include <svtools/stritem.hxx>
+#endif
+#pragma hdrstop
+
+#ifndef _SBXCLASS_HXX //autogen
+#include <svtools/sbx.hxx>
+#endif
+#ifndef _SFXINIMGR_HXX //autogen
+#include <svtools/iniman.hxx>
+#endif
+
+#include "objsh.hxx"
+
+#ifndef _BASIC_SBUNO_HXX
+#include <basic/sbuno.hxx>
+#endif
+
+#ifndef _SFXECODE_HXX
+#include <svtools/sfxecode.hxx>
+#endif
+#ifndef _EHDL_HXX
+#include <svtools/ehdl.hxx>
+#endif
+
+#include <svtools/urihelper.hxx>
+
+#include "picklist.hxx"
+#include "docfac.hxx"
+#include "docfile.hxx"
+#include "event.hxx"
+#include "cfgmgr.hxx"
+#include "dispatch.hxx"
+#include "viewsh.hxx"
+#include "interno.hxx"
+#include "sfxresid.hxx"
+#include "objshimp.hxx"
+#include "appbas.hxx"
+#include "sfxtypes.hxx"
+#include "evntconf.hxx"
+#include "request.hxx"
+#include "doc.hrc"
+#include "docinf.hxx"
+#include "objuno.hxx"
+#include "appdata.hxx"
+#include "appuno.hxx"
+#include "sfxsids.hrc"
+#include "basmgr.hxx"
+
+#ifndef _UNO_MAPPING_HXX_
+#include <uno/mapping.hxx>
+#endif
+
+//====================================================================
+
+DBG_NAME(SfxObjectShell);
+
+#define DocumentInfo
+#include "sfxslots.hxx"
+
+extern AsynchronLink* pPendingCloser;
+
+//=========================================================================
+
+TYPEINIT1(SfxObjectShell, SfxShell);
+
+//--------------------------------------------------------------------
+
+SfxObjectShell_Impl::~SfxObjectShell_Impl()
+{
+ if ( pPendingCloser == pCloser )
+ pPendingCloser = 0;
+ delete pCloser;
+}
+
+// initializes a document from a file-description
+
+SfxObjectShell::SfxObjectShell
+(
+ SfxObjectCreateMode eMode /* Zweck, zu dem die SfxObjectShell
+ erzeugt wird:
+
+ SFX_CREATE_MODE_EMBEDDED (default)
+ als SO-Server aus einem anderen
+ Dokument heraus
+
+ SFX_CREATE_MODE_STANDARD,
+ als normales, selbst"aendig ge"offnetes
+ Dokument
+
+ SFX_CREATE_MODE_PREVIEW
+ um ein Preview durchzuf"uhren,
+ ggf. werden weniger Daten ben"otigt
+
+ SFX_CREATE_MODE_ORGANIZER
+ um im Organizer dargestellt zu
+ werden, hier werden keine Inhalte
+ ben"otigt */
+)
+
+/* [Beschreibung]
+
+ Konstruktor der Klasse SfxObjectShell.
+*/
+
+: pImp( new SfxObjectShell_Impl ),
+ _pFactory( 0 ),
+ eCreateMode(eMode),
+ pStyleSheetPool(0),
+ pMedium(0)
+{
+ DBG_CTOR(SfxObjectShell, 0);
+
+ bHasName = sal_False;
+ SfxShell::SetName( GetTitle() );
+ nViewNo = 0;
+
+ // Aggregation InPlaceObject+Automation
+//(mba) AddInterface( SvDispatch::ClassFactory() );
+
+ SfxObjectShell *pThis = this;
+ SfxObjectShellArr_Impl &rArr = SFX_APP()->GetObjectShells_Impl();
+ rArr.C40_INSERT( SfxObjectShell, pThis, rArr.Count() );
+ pImp->bInList = sal_True;
+ pImp->nLoadedFlags = SFX_LOADED_ALL;
+}
+
+//--------------------------------------------------------------------
+
+// virtual dtor of typical base-class SfxObjectShell
+
+SfxObjectShell::~SfxObjectShell()
+{
+ DBG_DTOR(SfxObjectShell, 0);
+
+ if ( IsEnableSetModified() )
+ EnableSetModified( sal_False );
+
+ // Niemals GetInPlaceObject() aufrufen, der Zugriff auf den
+ // Ableitungszweig SfxInternObject ist wegen eines Compiler Bugs nicht
+ // erlaubt
+ SfxObjectShell::Close();
+
+ DELETEX(pMedium);
+ DELETEX(pImp->pEventConfig);
+ DELETEX(pImp->pCfgMgr);
+ DELETEX( pImp->pReloadTimer );
+
+ SfxApplication *pSfxApp = SFX_APP();
+ if ( USHRT_MAX != pImp->nVisualDocumentNumber )
+ pSfxApp->ReleaseIndex(pImp->nVisualDocumentNumber);
+
+ // Basic-Manager zerst"oren
+ if ( pImp->pBasicMgr )
+ DELETEX(pImp->pBasicMgr);
+
+ if ( pSfxApp->GetDdeService() )
+ pSfxApp->RemoveDdeTopic( this );
+
+ delete pImp->pDocInfo;
+ if ( pImp->xModel.is() )
+ pImp->xModel = ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > ();
+
+ delete pImp;
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectFactory& SfxObjectShell::GetFactory() const
+{
+ return *_pFactory;
+}
+//--------------------------------------------------------------------
+
+void SfxObjectShell::ViewAssigned()
+
+/* [Beschreibung]
+
+ Diese Methode wird gerufen, wenn eine ::com::sun::star::sdbcx::View zugewiesen wird.
+*/
+
+{
+ // Spaetestens jetzt die Factory initialisieren (wegen HelpFileName)
+ GetFactory().DoInitFactory();
+}
+
+//--------------------------------------------------------------------
+// closes the Object and all its views
+
+sal_Bool SfxObjectShell::Close()
+{
+ {DBG_CHKTHIS(SfxObjectShell, 0);}
+ if ( !pImp->bClosing )
+ {
+ // falls noch ein Progress l"auft, nicht schlie\sen
+ if ( GetProgress() )
+ return sal_False;
+
+ // aus Document-Liste austragen
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxObjectShellArr_Impl &rDocs = pSfxApp->GetObjectShells_Impl();
+ const SfxObjectShell *pThis = this;
+ sal_uInt16 nPos = rDocs.GetPos(pThis);
+ if ( nPos < rDocs.Count() )
+ rDocs.Remove( nPos );
+ pImp->bInList = sal_False;
+
+ // Broadcasten (w"ahrend dessen festhalten)
+ pImp->bClosing = sal_True;
+ SfxObjectShellRef aRef(this);
+/*
+ // Ist leider zu sp"at, da kaum noch Macros laufen, wenn keine ::com::sun::star::sdbcx::View
+ // mehr da ist!
+ if ( _pFactory && _pFactory->GetFlags() & SFXOBJECTSHELL_HASOPENDOC )
+ // Event nur bei echten Dokumenten
+ pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, this) );
+*/
+ Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
+ //pImp->bClosing = sal_False;
+
+ if ( pImp->xModel.is() )
+ pImp->xModel->dispose();
+ }
+
+ return sal_True;
+}
+
+//--------------------------------------------------------------------
+
+// returns a pointer the first SfxDocument of specified type
+
+SfxObjectShell* SfxObjectShell::GetFirst
+(
+ const TypeId* pType ,
+ sal_Bool bOnlyVisible
+)
+{
+ SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl();
+
+ // seach for a SfxDocument of the specified type
+ for ( sal_uInt16 nPos = 0; nPos < rDocs.Count(); ++nPos )
+ {
+ SfxObjectShell* pSh = rDocs.GetObject( nPos );
+ if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
+ continue;
+
+ if ( ( !pType || pSh->IsA(*pType) ) &&
+ ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True )))
+ return pSh;
+ }
+
+ return 0;
+}
+//--------------------------------------------------------------------
+
+// returns a pointer to the next SfxDocument of specified type behind *pDoc
+
+SfxObjectShell* SfxObjectShell::GetNext
+(
+ const SfxObjectShell& rPrev,
+ const TypeId* pType,
+ sal_Bool bOnlyVisible
+)
+{
+ SfxObjectShellArr_Impl &rDocs = SFX_APP()->GetObjectShells_Impl();
+
+ // refind the specified predecessor
+ sal_uInt16 nPos;
+ for ( nPos = 0; nPos < rDocs.Count(); ++nPos )
+ if ( rDocs.GetObject(nPos) == &rPrev )
+ break;
+
+ // search for the next SfxDocument of the specified type
+ for ( ++nPos; nPos < rDocs.Count(); ++nPos )
+ {
+ SfxObjectShell* pSh = rDocs.GetObject( nPos );
+ if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
+ continue;
+
+ if ( ( !pType || pSh->IsA(*pType) ) &&
+ ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh, 0, sal_True )))
+ return pSh;
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectShell* SfxObjectShell::Current()
+{
+ SfxViewFrame *pFrame = SFX_APP()->GetViewFrame();
+ return pFrame ? pFrame->GetObjectShell() : 0;
+}
+
+//-------------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::IsInPrepareClose() const
+
+/* [Beschreibung]
+
+ Diese Methode liefert sal_True, falls gerade ein PrepareClose laeuft.
+*/
+
+{
+ return pImp->bInPrepareClose;
+}
+
+//------------------------------------------------------------------------
+
+struct BoolEnv_Impl
+{
+ SfxObjectShell_Impl* pImp;
+ BoolEnv_Impl( SfxObjectShell_Impl* pImpP) : pImp( pImpP )
+ { pImpP->bInPrepareClose = sal_True; }
+ ~BoolEnv_Impl() { pImp->bInPrepareClose = sal_False; }
+};
+
+
+sal_uInt16 SfxObjectShell::PrepareClose
+(
+ sal_Bool bUI, // sal_True: Dialoge etc. erlaubt, sal_False: silent-mode
+ sal_Bool bForBrowsing
+)
+{
+ if( pImp->bInPrepareClose || pImp->bPreparedForClose )
+ return sal_True;
+ BoolEnv_Impl aBoolEnv( pImp );
+
+ // DocModalDialog?
+ if ( IsInModalMode() )
+ return sal_False;
+
+ SfxViewFrame* pFirst = SfxViewFrame::GetFirst( this );
+ if( pFirst && !pFirst->GetFrame()->PrepareClose_Impl( bUI, bForBrowsing ) )
+ return sal_False;
+
+ // prepare views for closing
+ for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst(
+ this, TYPE(SfxViewFrame));
+ pFrm; pFrm = SfxViewFrame::GetNext( *pFrm, this ) )
+ {
+ DBG_ASSERT(pFrm->GetViewShell(),"KeineShell");
+ if ( pFrm->GetViewShell() )
+ {
+ sal_uInt16 nRet = pFrm->GetViewShell()->PrepareClose( bUI, bForBrowsing );
+ if ( nRet != sal_True )
+ return nRet;
+ }
+ }
+
+ if( GetInPlaceObject() && GetInPlaceObject()->GetClient())
+ {
+ pImp->bPreparedForClose = sal_True;
+ return sal_True;
+ }
+
+ // ggf. nachfragen, ob gespeichert werden soll
+ // nur fuer in sichtbaren Fenstern dargestellte Dokumente fragen
+ SfxViewFrame *pFrame = SfxObjectShell::Current() == this
+ ? SfxViewFrame::Current() : SfxViewFrame::GetFirst( this );
+ while ( pFrame && (pFrame->GetFrameType() & SFXFRAME_SERVER ) )
+ pFrame = SfxViewFrame::GetNext( *pFrame, this );
+
+ SfxApplication *pSfxApp = SFX_APP();
+ pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, this) );
+ sal_Bool bClose = sal_False;
+ if ( bUI && IsModified() )
+ {
+ if ( pFrame )
+ {
+ // minimierte restoren
+ SfxFrame* pTop = pFrame->GetTopFrame();
+ pSfxApp->SetViewFrame( pTop->GetCurrentViewFrame() );
+ pFrame->GetFrame()->Appear();
+
+ // fragen, ob gespeichert werden soll
+ String aText( SfxResId( STR_QUERY_SAVE_DOCUMENT ) );
+ aText.SearchAndReplace( DEFINE_CONST_UNICODE( "$(DOC)" ),
+ GetTitle( SFX_TITLE_PICKLIST ) );
+ /*HACK for plugin::destroy()*/
+ // Don't show SAVE dialog in plugin mode! We save our document in every way.
+ short nRet = RET_YES;
+ if( SfxApplication::IsPlugin() == sal_False )
+ {
+ QueryBox aQBox( &pFrame->GetWindow(), WB_YES_NO_CANCEL | WB_DEF_YES, aText );
+ aQBox.SetButtonText( BUTTONID_NO, SfxResId( STR_NOSAVEANDCLOSE ) );
+ aQBox.SetButtonText( BUTTONID_YES, SfxResId( STR_SAVEDOC ) );
+ //(mba)/task if ( bForBrowsing )
+ // aQBox.AddButton( String( SfxResId( RID_STR_NEW_TASK ) ), RET_NEWTASK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON );
+ nRet = aQBox.Execute();
+ }
+ /*HACK for plugin::destroy()*/
+
+ if ( RET_YES == nRet )
+ {
+ sal_Bool bVersion = GetDocInfo().IsSaveVersionOnClose();
+
+ // per Dispatcher speichern
+ const SfxPoolItem *pPoolItem;
+ if ( bVersion )
+ {
+ SfxStringItem aItem( SID_VERSION, String( SfxResId( STR_AUTOMATICVERSION ) ) );
+ SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, TRUE );
+ const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, 0 };
+ pPoolItem = pFrame->GetDispatcher()->Execute( SID_SAVEDOC, SFX_CALLMODE_SYNCHRON, ppArgs, 0 );
+ }
+ else
+ {
+ SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, TRUE );
+ const SfxPoolItem* ppArgs[] = { &aWarnItem, 0 };
+ pPoolItem = pFrame->GetDispatcher()->Execute( SID_SAVEDOC, SFX_CALLMODE_SYNCHRON, ppArgs, 0 );
+ }
+
+ if ( !pPoolItem || !pPoolItem->ISA(SfxBoolItem) || !( (const SfxBoolItem*) pPoolItem )->GetValue() )
+ return sal_False;
+ else
+ bClose = sal_True;
+ }
+ else if ( RET_CANCEL == nRet )
+ // abgebrochen
+ return sal_False;
+ else if ( RET_NEWTASK == nRet )
+ {
+ return RET_NEWTASK;
+ }
+ else
+ {
+ // Bei Nein nicht noch Informationlost
+ bClose = sal_True;
+
+ // nicht mehr aus Cache nachladen
+ MemCache_Impl &rCache = SfxPickList_Impl::Get()->GetMemCache();
+ rCache.RemoveObject( this );
+ }
+ }
+ }
+
+ // ggf. hinweisen, da\s unter Fremdformat gespeichert
+ if( pMedium )
+ {
+ SFX_ITEMSET_ARG( pMedium->GetItemSet(), pIgnoreInformationLost,
+ SfxBoolItem, SID_DOC_IGNOREINFORMATIONLOST, sal_False);
+ if( pIgnoreInformationLost && pIgnoreInformationLost->GetValue() )
+ bUI = sal_False;
+ }
+ if ( bUI && !bClose && IsInformationLost() )
+ {
+ // minimierte restoren
+ SfxFrame* pTop = pFrame->GetTopFrame();
+ pSfxApp->SetViewFrame( pTop->GetCurrentViewFrame() );
+ pFrame->GetFrame()->Appear();
+ QueryBox aBox( &pFrame->GetWindow(), SfxResId(MSG_CONFIRM_FILTER));
+ if ( RET_NO == aBox.Execute() )
+ return sal_False;
+ }
+
+ pImp->bPreparedForClose = sal_True;
+ return sal_True;
+}
+
+//--------------------------------------------------------------------
+
+BasicManager* SfxObjectShell::GetBasicManager() const
+{
+ return HasBasic() ? pImp->pBasicMgr : SFX_APP()->GetBasicManager();
+}
+
+sal_Bool SfxObjectShell::HasBasic() const
+{
+ if ( !pImp->bBasicInitialized )
+ {
+ String aName( GetMedium()->GetName() );
+ ((SfxObjectShell*)this)->InitBasicManager_Impl( GetStorage(), aName.Len() ? &aName : NULL );
+ }
+ return pImp->pBasicMgr != NULL;
+}
+
+//--------------------------------------------------------------------
+
+StarBASIC* SfxObjectShell::GetBasic() const
+{
+ return GetBasicManager()->GetLib(0);
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::InitBasicManager_Impl
+(
+ SvStorage* pStor /* Storage, aus dem das Dokument geladen wird
+ (aus <SvPersist::Load()>) bzw. 0, falls es
+ sich um ein neues Dokument handelt
+ (aus <SvPersist::InitNew()>). */
+ , const String* pName
+)
+/* [Beschreibung]
+
+ Erzeugt einen Dokument-BasicManager und l"adt diesen ggf. (pStor != 0)
+ aus dem Storage.
+
+
+ [Anmerkung]
+
+ Diese Methode mu"s aus den "Uberladungen von <SvPersist::Load()> (mit
+ dem pStor aus dem Parameter von Load()) sowie aus der "Uberladung
+ von <SvPersist::InitNew()> (mit pStor = 0) gerufen werden.
+*/
+
+{
+ StarBASIC *pAppBasic = SFX_APP()->GetBasic();
+ DBG_ASSERT( !pImp->bBasicInitialized && !pImp->pBasicMgr, "Lokaler BasicManager bereits vorhanden");
+
+ pImp->bBasicInitialized = TRUE;
+ if ( pStor )
+ {
+ String aOldURL = INetURLObject::GetBaseURL();
+ String aNewURL;
+ if( HasName() )
+ aNewURL = GetMedium()->GetName();
+ else
+ {
+ aNewURL = GetDocInfo().GetTemplateFileName();
+ // Bei Templates keine ::com::sun::star::util::URL...
+ aNewURL = URIHelper::SmartRelToAbs( aNewURL );
+ }
+ INetURLObject::SetBaseURL( aNewURL );
+
+ // load BASIC-manager
+ SfxErrorContext aErrContext( ERRCTX_SFX_LOADBASIC, GetTitle() );
+ SfxIniManager *pIniMgr = SFX_APP()->GetIniManager();
+ String aAppBasicDir( pIniMgr->Get(SFX_KEY_BASIC_PATH) );
+ pImp->pBasicMgr = new SfxBasicManager( *pStor, pAppBasic, &aAppBasicDir );
+ if ( pImp->pBasicMgr->HasErrors() )
+ {
+ // handle errors
+ BasicError *pErr = pImp->pBasicMgr->GetFirstError();
+ while ( pErr )
+ {
+ // show message to user
+ if ( ERRCODE_BUTTON_CANCEL ==
+ ErrorHandler::HandleError( pErr->GetErrorId() ) )
+ {
+ // user wants to break loading of BASIC-manager
+ delete pImp->pBasicMgr;
+ pStor = 0;
+ break;
+ }
+ pErr = pImp->pBasicMgr->GetNextError();
+ }
+ }
+
+ INetURLObject::SetBaseURL( aOldURL );
+ }
+
+ // not loaded?
+ if ( !pStor )
+ {
+ // create new BASIC-manager
+ StarBASIC *pBas = new StarBASIC(pAppBasic);
+ pBas->SetFlag( SBX_EXTSEARCH );
+ pImp->pBasicMgr = new SfxBasicManager( pBas );
+ }
+
+ // damit auch Dialoge etc. 'qualifiziert' angesprochen werden k"onnen
+ StarBASIC *pBas = pImp->pBasicMgr->GetLib(0);
+ // Initialize Uno
+ //pBas->setRoot( GetModel() );
+ sal_Bool bWasModified = pBas->IsModified();
+ pBas->SetParent( pAppBasic );
+
+ // Properties im Doc-BASIC
+ // ThisComponent
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInterface ( GetModel(), ::com::sun::star::uno::UNO_QUERY );
+ ::com::sun::star::uno::Any aComponent;
+ aComponent <<= xInterface;
+ SbxObjectRef xUnoObj = GetSbUnoObject( DEFINE_CONST_UNICODE("ThisComponent"), aComponent );
+ xUnoObj->SetFlag( SBX_DONTSTORE );
+ pBas->Insert( xUnoObj );
+
+ // Modify-Flag wird bei MakeVariable gesetzt
+ pBas->SetModified( bWasModified );
+}
+
+//--------------------------------------------------------------------
+#if 0 //(mba)
+SotObjectRef SfxObjectShell::CreateAggObj( const SotFactory* pFact )
+{
+ // SvDispatch?
+ SotFactory* pDispFact = SvDispatch::ClassFactory();
+ if( pFact == pDispFact )
+ return( (SfxShellObject*)GetSbxObject() );
+
+ // sonst unbekannte Aggregation
+ DBG_ERROR("unkekannte Factory");
+ SotObjectRef aSvObjectRef;
+ return aSvObjectRef;
+}
+#endif
+
+//--------------------------------------------------------------------
+
+sal_uInt16 SfxObjectShell::Count()
+{
+ return SFX_APP()->GetObjectShells_Impl().Count();
+}
+
+//--------------------------------------------------------------------
+
+sal_Bool SfxObjectShell::DoClose()
+{
+ return Close();
+}
+
+//--------------------------------------------------------------------
+
+void SfxObjectShell::SetLastMark_Impl( const String &rMark )
+{
+ pImp->aMark = rMark;
+}
+
+//--------------------------------------------------------------------
+
+const String& SfxObjectShell::GetLastMark_Impl() const
+{
+ return pImp->aMark;
+}
+
+//--------------------------------------------------------------------
+
+SfxObjectShell* SfxObjectShell::GetObjectShell()
+{
+ return this;
+}
+
+//--------------------------------------------------------------------
+/* ASDBG
+void SfxObjectShell::SetModel( SfxModel* pModel )
+{
+ if ( pImp->xModel.is() )
+ DBG_WARNING( "Model already set!" );
+ pImp->xModel = pModel;
+}
+
+//--------------------------------------------------------------------
+
+XModel* SfxObjectShell::GetModel()
+{
+ return pImp->xModel;
+}
+*/
+//--------------------------------------------------------------------
+
+void SfxObjectShell::SetModel( SfxBaseModel* pModel )
+{
+ if ( pImp->xModel.is() )
+ DBG_WARNING( "Model already set!" );
+
+ pImp->xModel = pModel;
+}
+
+//--------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetModel()
+{
+ return pImp->xModel;
+}
+
+void SfxObjectShell::SetBaseModel( SfxBaseModel* pModel )
+{
+ if ( pImp->xModel.is() )
+ DBG_WARNING( "Model already set!" );
+
+ pImp->xModel = pModel;
+}
+
+//--------------------------------------------------------------------
+
+::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > SfxObjectShell::GetBaseModel()
+{
+ return pImp->xModel;
+}
+
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
new file mode 100644
index 000000000000..cd9299dd852a
--- /dev/null
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -0,0 +1,1483 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxbasemodel.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:32 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+//________________________________________________________________________________________________________
+// my own includes
+//________________________________________________________________________________________________________
+
+#ifndef _SFX_SFXBASEMODEL_HXX_
+#include <sfxbasemodel.hxx>
+#endif
+
+//________________________________________________________________________________________________________
+// include of other projects
+//________________________________________________________________________________________________________
+
+#ifndef _COM_SUN_STAR_VIEW_XSELECTIONSUPPLIER_HPP_
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_SIZE_HPP_
+#include <com/sun/star/awt/Size.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
+#include <com/sun/star/lang/DisposedException.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
+#include <com/sun/star/lang/IllegalArgumentException.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_VIEW_PAPERFORMAT_HPP_
+#include <com/sun/star/view/PaperFormat.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_VIEW_PAPERORIENTATION_HPP_
+#include <com/sun/star/view/PaperOrientation.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_VIEW_PAPERORIENTATION_HPP_
+#include <com/sun/star/view/PaperOrientation.hpp>
+#endif
+
+#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
+#include <cppuhelper/interfacecontainer.hxx>
+#endif
+
+//ASDBG #ifndef _USR_SMARTCONV_HXX_
+//ASDBG #include <usr/smartconv.hxx>
+//ASDBG #endif
+
+#ifndef _UNO_MAPPING_HXX_
+#include <uno/mapping.hxx>
+#endif
+
+#ifndef _SFXITEMSET_HXX
+#include <svtools/itemset.hxx>
+#endif
+
+#ifndef _SFXSTRITEM_HXX
+#include <svtools/stritem.hxx>
+#endif
+
+#ifndef _SFXINTITEM_HXX
+#include <svtools/intitem.hxx>
+#endif
+
+#ifndef _SFXENUMITEM_HXX
+#include <svtools/eitem.hxx>
+#endif
+
+//________________________________________________________________________________________________________
+// includes of my own project
+//________________________________________________________________________________________________________
+
+#ifndef _SFX_SFXUNO_HXX
+#include <sfxuno.hxx>
+#endif
+
+#ifndef _SFX_OBJSHIMP_HXX
+#include <objshimp.hxx>
+#endif
+
+#ifndef _SFXVIEWFRM_HXX
+#include <viewfrm.hxx>
+#endif
+
+#ifndef _SFXVIEWSH_HXX
+#include <viewsh.hxx>
+#endif
+
+#ifndef _SFXDOCFILE_HXX
+#include <docfile.hxx>
+#endif
+
+#ifndef _SFXDISPATCH_HXX
+#include <dispatch.hxx>
+#endif
+
+#ifndef _SFXREQUEST_HXX
+#include <request.hxx>
+#endif
+
+#ifndef _SFX_OBJUNO_HXX
+#include <objuno.hxx>
+#endif
+
+#ifndef _SFX_PRINTER_HXX
+#include <printer.hxx>
+#endif
+
+#include <vos/mutex.hxx>
+
+#include "sfxsids.hrc"
+
+//________________________________________________________________________________________________________
+// defines
+//________________________________________________________________________________________________________
+
+#define SfxIOException_Impl( nErr ) ::com::sun::star::io::IOException()
+
+#define XFRAME ::com::sun::star::frame::XFrame
+#define XINTERFACE ::com::sun::star::uno::XInterface
+#define OMULTITYPEINTERFACECONTAINERHELPER ::cppu::OMultiTypeInterfaceContainerHelper
+#define UNO_QUERY ::com::sun::star::uno::UNO_QUERY
+#define DISPOSEDEXCEPTION ::com::sun::star::lang::DisposedException
+#define MAPPING ::com::sun::star::uno::Mapping
+#define XSELECTIONSUPPLIER ::com::sun::star::view::XSelectionSupplier
+#define ANY ::com::sun::star::uno::Any
+#define ILLEGALARGUMENTEXCEPTION ::com::sun::star::lang::IllegalArgumentException
+#define OINTERFACECONTAINERHELPER ::cppu::OInterfaceContainerHelper
+#define OINTERFACEITERATORHELPER ::cppu::OInterfaceIteratorHelper
+#define SIZE ::com::sun::star::awt::Size
+#define PAPERFORMAT ::com::sun::star::view::PaperFormat
+#define PAPERORIENTATION ::com::sun::star::view::PaperOrientation
+#define OTYPECOLLECTION ::cppu::OTypeCollection
+#define OIMPLEMENTATIONID ::cppu::OImplementationId
+#define MUTEXGUARD ::osl::MutexGuard
+
+//________________________________________________________________________________________________________
+// namespaces
+//________________________________________________________________________________________________________
+
+//using namespace ::osl ;
+//using namespace ::rtl ;
+//using namespace ::cppu ;
+//using namespace ::com::sun::star::uno ;
+//using namespace ::com::sun::star::container ;
+//using namespace ::com::sun::star::frame ;
+//using namespace ::com::sun::star::document ;
+//using namespace ::com::sun::star::lang ;
+//using namespace ::com::sun::star::util ;
+//using namespace ::com::sun::star::view ;
+//using namespace ::com::sun::star::beans ;
+
+//________________________________________________________________________________________________________
+// impl. declarations
+//________________________________________________________________________________________________________
+
+struct IMPL_SfxBaseModel_DataContainer
+{
+ SfxObjectShell* m_pObjectShell ;
+ OUSTRING m_sURL ;
+ sal_uInt16 m_nControllerLockCount ;
+ OMULTITYPEINTERFACECONTAINERHELPER m_aInterfaceContainer ;
+ REFERENCE< XINTERFACE > m_xParent ;
+ REFERENCE< XCONTROLLER > m_xCurrent ;
+ REFERENCE< XDOCUMENTINFO > m_xDocumentInfo ;
+ SEQUENCE< PROPERTYVALUE> m_seqArguments ;
+ SEQUENCE< REFERENCE< XCONTROLLER > > m_seqControllers ;
+
+ IMPL_SfxBaseModel_DataContainer::IMPL_SfxBaseModel_DataContainer( MUTEX& aMutex ,
+ SfxObjectShell* pObjectShell )
+ : m_pObjectShell ( pObjectShell )
+ , m_sURL ( String() )
+ , m_nControllerLockCount ( 0 )
+ , m_aInterfaceContainer ( aMutex )
+ {
+ }
+
+} ;
+
+/* ASDBG
+//________________________________________________________________________________________________________
+// methods for bridging smart<->uno3
+// Please don't use! Will be deleted in ... days :-)
+//________________________________________________________________________________________________________
+
+REFERENCE< XMODEL > impl_Smart2Uno3_XModel( XModel* pSmart )
+{
+ MAPPING aConverter( "smart" , CPPU_CURRENT_LANGUAGE_BINDING_NAME ) ;
+
+ XMODEL* pUno3 = SAL_STATIC_CAST(XMODEL*,(aConverter.mapInterface( pSmart, ::getCppuType((const REFERENCE< XMODEL >*)0) ))) ;
+ REFERENCE< XMODEL > xUno3 = pUno3 ;
+
+ xUno3->release() ;
+
+ return xUno3 ;
+}
+
+REFERENCE< XCONTROLLER > impl_Smart2Uno3_XController( XController* pSmart )
+{
+ MAPPING aConverter( "smart" , CPPU_CURRENT_LANGUAGE_BINDING_NAME ) ;
+
+ XCONTROLLER* pUno3 = SAL_STATIC_CAST(XCONTROLLER*,(aConverter.mapInterface( pSmart, ::getCppuType((const REFERENCE< XCONTROLLER >*)0) ))) ;
+ REFERENCE< XCONTROLLER > xUno3 = pUno3 ;
+
+ xUno3->release() ;
+
+ return xUno3 ;
+}
+
+REFERENCE< XDOCUMENTINFO > impl_Smart2Uno3_XDocumentInfo( XDocumentInfo* pSmart )
+{
+ MAPPING aConverter( "smart" , CPPU_CURRENT_LANGUAGE_BINDING_NAME ) ;
+
+ XDOCUMENTINFO* pUno3 = SAL_STATIC_CAST(XDOCUMENTINFO*,(aConverter.mapInterface( pSmart, ::getCppuType((const REFERENCE< XDOCUMENTINFO >*)0) ))) ;
+ REFERENCE< XDOCUMENTINFO > xUno3 = pUno3 ;
+
+ xUno3->release() ;
+
+ return xUno3 ;
+}
+
+SEQUENCE< PROPERTYVALUE > impl_Smart2Uno3_seqPropertyValue( const Sequence< PropertyValue >& seqSmart )
+{
+ sal_Int32 nCount = seqSmart.getLen() ;
+ const PropertyValue* pSmartProperty = seqSmart.getConstArray() ;
+ sal_Int32 nPosition = 0 ;
+
+ SEQUENCE< PROPERTYVALUE > seqUno3 ( nCount ) ;
+ PROPERTYVALUE* pUno3Property = seqUno3.getArray() ;
+
+ for ( nPosition=0; nPosition<nCount; nPosition++ )
+ {
+ pUno3Property[nPosition].Name = pSmartProperty[nPosition].Name ;
+ pUno3Property[nPosition].Handle = pSmartProperty[nPosition].Handle ;
+ switch ( pSmartProperty[nPosition].State )
+ {
+ case PropertyState_DIRECT_VALUE : pUno3Property[nPosition].State = ::com::sun::star::beans::PropertyState_DIRECT_VALUE ;
+ break;
+ case PropertyState_DEFAULT_VALUE : pUno3Property[nPosition].State = ::com::sun::star::beans::PropertyState_DEFAULT_VALUE ;
+ break;
+ case PropertyState_AMBIGUOUS_VALUE : pUno3Property[nPosition].State = ::com::sun::star::beans::PropertyState_AMBIGUOUS_VALUE ;
+ break;
+ default: DBG_ASSERT ( sal_False, "SfxBaseModel::impl_Smart2Uno3_sePropertyValue()\nPropertyState unknown!\n" ) ;
+ }
+ ::usr::convertUsr2UnoAny( pUno3Property[nPosition].Value, pSmartProperty[nPosition].Value ) ;
+ }
+
+ return seqUno3 ;
+}
+*/
+SIZE impl_Size_Object2Struct( const Size& aSize )
+{
+ SIZE aReturnValue;
+
+ aReturnValue.Width = aSize.Width() ;
+ aReturnValue.Height = aSize.Height() ;
+
+ return aReturnValue ;
+}
+
+Size impl_Size_Struct2Object( const SIZE& aSize )
+{
+ Size aReturnValue;
+
+ aReturnValue.Width() = aSize.Width ;
+ aReturnValue.Height() = aSize.Height ;
+
+ return aReturnValue ;
+}
+
+//________________________________________________________________________________________________________
+// constructor
+//________________________________________________________________________________________________________
+
+SfxBaseModel::SfxBaseModel( SfxObjectShell *pObjectShell ) : IMPL_SfxBaseModel_MutexContainer ( )
+ , m_pData ( new IMPL_SfxBaseModel_DataContainer( m_aMutex, pObjectShell ) )
+{
+ if ( pObjectShell != NULL )
+ {
+ StartListening( *pObjectShell ) ;
+ }
+}
+
+//________________________________________________________________________________________________________
+// destructor
+//________________________________________________________________________________________________________
+
+SfxBaseModel::~SfxBaseModel()
+{
+ delete m_pData ;
+}
+
+//________________________________________________________________________________________________________
+// XInterface
+//________________________________________________________________________________________________________
+
+ANY SAL_CALL SfxBaseModel::queryInterface( const UNOTYPE& rType ) throw( RUNTIMEEXCEPTION )
+{
+ // Attention:
+ // Don't use mutex or guard in this method!!! Is a method of XInterface.
+
+ // Ask for my own supported interfaces ...
+ ANY aReturn( ::cppu::queryInterface( rType ,
+ static_cast< XTYPEPROVIDER* > ( this ) ,
+ static_cast< XCHILD* > ( this ) ,
+ static_cast< XDOCUMENTINFOSUPPLIER* > ( this ) ,
+ static_cast< XEVENTLISTENER* > ( this ) ,
+ static_cast< XMODEL* > ( this ) ,
+ static_cast< XMODIFIABLE* > ( this ) ,
+ static_cast< XMODIFYBROADCASTER* > ( this ) ,
+ static_cast< XCOMPONENT* > ( this ) ,
+ static_cast< XPRINTABLE* > ( this ) ,
+ static_cast< XSTORABLE* > ( this ) ) ) ;
+
+ // If searched interface supported by this class ...
+ if ( aReturn.hasValue() == sal_True )
+ {
+ // ... return this information.
+ return aReturn ;
+ }
+ else
+ {
+ // Else; ... ask baseclass for interfaces!
+ return OWeakObject::queryInterface( rType ) ;
+ }
+}
+
+//________________________________________________________________________________________________________
+// XInterface
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::acquire() throw( RUNTIMEEXCEPTION )
+{
+ // Attention:
+ // Don't use mutex or guard in this method!!! Is a method of XInterface.
+
+ // Forward to baseclass
+ OWeakObject::acquire() ;
+}
+
+//________________________________________________________________________________________________________
+// XInterface
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::release() throw( RUNTIMEEXCEPTION )
+{
+ // Attention:
+ // Don't use mutex or guard in this method!!! Is a method of XInterface.
+
+ // Forward to baseclass
+ OWeakObject::release() ;
+}
+
+//________________________________________________________________________________________________________
+// XTypeProvider
+//________________________________________________________________________________________________________
+
+SEQUENCE< UNOTYPE > SAL_CALL SfxBaseModel::getTypes() throw( RUNTIMEEXCEPTION )
+{
+ // Optimize this method !
+ // We initialize a static variable only one time. And we don't must use a mutex at every call!
+ // For the first call; pTypeCollection is NULL - for the second call pTypeCollection is different from NULL!
+ static OTYPECOLLECTION* pTypeCollection = NULL ;
+
+ if ( pTypeCollection == NULL )
+ {
+ // Ready for multithreading; get global mutex for first call of this method only! see before
+ MUTEXGUARD aGuard( MUTEX::getGlobalMutex() ) ;
+
+ // Control these pointer again ... it can be, that another instance will be faster then these!
+ if ( pTypeCollection == NULL )
+ {
+ // Create a static typecollection ...
+ static OTYPECOLLECTION aTypeCollection( ::getCppuType(( const REFERENCE< XTYPEPROVIDER >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XCHILD >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XDOCUMENTINFOSUPPLIER >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XEVENTLISTENER >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XMODEL >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XMODIFIABLE >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XPRINTABLE >*)NULL ) ,
+ ::getCppuType(( const REFERENCE< XSTORABLE >*)NULL ) ) ;
+
+ // ... and set his address to static pointer!
+ pTypeCollection = &aTypeCollection ;
+ }
+ }
+
+ return pTypeCollection->getTypes() ;
+}
+
+//________________________________________________________________________________________________________
+// XTypeProvider
+//________________________________________________________________________________________________________
+
+SEQUENCE< sal_Int8 > SAL_CALL SfxBaseModel::getImplementationId() throw( RUNTIMEEXCEPTION )
+{
+ // Create one Id for all instances of this class.
+ // Use ethernet address to do this! (sal_True)
+
+ // Optimize this method
+ // We initialize a static variable only one time. And we don't must use a mutex at every call!
+ // For the first call; pID is NULL - for the second call pID is different from NULL!
+ static OIMPLEMENTATIONID* pID = NULL ;
+
+ if ( pID == NULL )
+ {
+ // Ready for multithreading; get global mutex for first call of this method only! see before
+ MUTEXGUARD aGuard( MUTEX::getGlobalMutex() ) ;
+
+ // Control these pointer again ... it can be, that another instance will be faster then these!
+ if ( pID == NULL )
+ {
+ // Create a new static ID ...
+ static OIMPLEMENTATIONID aID( sal_False ) ;
+ // ... and set his address to static pointer!
+ pID = &aID ;
+ }
+ }
+
+ return pID->getImplementationId() ;
+}
+
+//________________________________________________________________________________________________________
+// XChild
+//________________________________________________________________________________________________________
+
+REFERENCE< XINTERFACE > SAL_CALL SfxBaseModel::getParent() throw( RUNTIMEEXCEPTION )
+{
+/* #77222#
+ AS->MBA: There is one view only at the moment. We don't must search for other parents in other frames ...!?
+
+ if ( !m_pData->m_xParent.is() && m_pData->m_xCurrent.is() )
+ {
+ // If no parent is set get the parent by view hierarchy
+ REFERENCE< XFRAME > xParentFrame( m_pData->m_xCurrent->getFrame()->getCreator(), UNO_QUERY );
+ if ( xParentFrame.is() )
+ {
+ REFERENCE< XCONTROLLER > xCtrl( xParentFrame->getController() );
+ if ( xCtrl.is() )
+ return xCtrl->getModel();
+ }
+ }
+*/
+ return m_pData->m_xParent;
+}
+
+//________________________________________________________________________________________________________
+// XChild
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::setParent(const REFERENCE< XINTERFACE >& Parent) throw(NOSUPPORTEXCEPTION, RUNTIMEEXCEPTION)
+{
+ if ( Parent.is() && getParent().is() )
+ // only set parent when no parent is available
+ throw NOSUPPORTEXCEPTION();
+
+ m_pData->m_xParent = Parent;
+}
+
+//________________________________________________________________________________________________________
+// XChild
+//________________________________________________________________________________________________________
+
+long SfxObjectShellClose_Impl( void* pObj, void* pArg );
+
+void SAL_CALL SfxBaseModel::dispose()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ EVENTOBJECT aEvent( (XMODEL *)this );
+ m_pData->m_aInterfaceContainer.disposeAndClear( aEvent );
+
+ // is an object shell assigned?
+ if ( m_pData->m_pObjectShell )
+ {
+ // Rekursion vermeiden
+ SfxObjectShell *pShell;
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ pShell = m_pData->m_pObjectShell;
+ EndListening( *pShell );
+ m_pData->m_pObjectShell = NULL;
+ }
+
+ // Bei dispose keine Speichern-R"uckfrage
+ if ( pShell->IsEnableSetModified() && !pShell->Get_Impl()->bClosing )
+ pShell->SetModified( sal_False );
+ SfxObjectShellClose_Impl( 0, (void*) pShell );
+ }
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_pData->m_xCurrent = REFERENCE< XCONTROLLER > ();
+//ASDBG for ( sal_uInt32 n = m_pData->m_seqControllers.getLength(); n; --n )
+//ASDBG SEQUENCERemoveElementAt( m_pData->m_seqControllers, n-1 );
+ m_pData->m_seqControllers = SEQUENCE< REFERENCE< XCONTROLLER > > () ;
+}
+
+//________________________________________________________________________________________________________
+// XChild
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::addEventListener( const REFERENCE< XEVENTLISTENER >& aListener )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const REFERENCE< XEVENTLISTENER >*)0), aListener );
+}
+
+//________________________________________________________________________________________________________
+// XChild
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::removeEventListener( const REFERENCE< XEVENTLISTENER >& aListener )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const REFERENCE< XEVENTLISTENER >*)0), aListener );
+}
+
+//________________________________________________________________________________________________________
+// XDOCUMENTINFOSupplier
+//________________________________________________________________________________________________________
+
+REFERENCE< XDOCUMENTINFO > SAL_CALL SfxBaseModel::getDocumentInfo()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( !m_pData->m_xDocumentInfo.is() && m_pData->m_pObjectShell )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ ((SfxBaseModel*)this)->m_pData->m_xDocumentInfo = new SfxDocumentInfoObject( m_pData->m_pObjectShell ) ;
+ }
+
+ return m_pData->m_xDocumentInfo;
+}
+
+//________________________________________________________________________________________________________
+// XEVENTLISTENER
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::disposing( const EVENTOBJECT& aObject )
+{
+ REFERENCE< XMODIFYLISTENER > xMod( aObject.Source, UNO_QUERY );
+ REFERENCE< XEVENTLISTENER > xListener( aObject.Source, UNO_QUERY );
+ if ( xMod.is() )
+ m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const REFERENCE< XMODIFYLISTENER >*)0), xMod );
+ else if ( xListener.is() )
+ m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const REFERENCE< XEVENTLISTENER >*)0), xListener );
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ sal_uInt32 nCount = m_pData->m_seqControllers.getLength();
+ for ( sal_uInt32 n = 0; n < nCount; n++ )
+ {
+ if( m_pData->m_seqControllers.getConstArray()[n] == aObject.Source )
+ {
+ m_pData->m_seqControllers.getArray()[n] = REFERENCE< XCONTROLLER > () ;
+ break;
+ }
+//ASDBG if( m_pData->m_seqControllers.getConstArray()[n] == aObject.Source )
+//ASDBG {
+//ASDBG SequenceRemoveElementAt( m_pData->m_seqControllers, n );
+//ASDBG break;
+//ASDBG }
+ }
+
+ if ( m_pData->m_xCurrent.is() && m_pData->m_xCurrent == aObject.Source )
+ m_pData->m_xCurrent = REFERENCE< XCONTROLLER > ();
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+sal_Bool SAL_CALL SfxBaseModel::attachResource( const OUSTRING& rURL ,
+ const SEQUENCE< PROPERTYVALUE >& rArgs )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_pData->m_sURL = rURL ;
+ m_pData->m_seqArguments = rArgs ;
+ return sal_True ;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+OUSTRING SAL_CALL SfxBaseModel::getURL()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_pData->m_sURL ;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+SEQUENCE< PROPERTYVALUE > SAL_CALL SfxBaseModel::getArgs()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_pData->m_seqArguments ;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::connectController( const REFERENCE< XCONTROLLER >& xController )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ sal_uInt32 nOldCount = m_pData->m_seqControllers.getLength();
+ SEQUENCE<REFERENCE< XCONTROLLER > > aNewSeq( nOldCount + 1 );
+ for ( sal_uInt32 n = 0; n < nOldCount; n++ )
+ aNewSeq.getArray()[n] = m_pData->m_seqControllers.getConstArray()[n];
+ aNewSeq.getArray()[nOldCount] = xController;
+ m_pData->m_seqControllers = aNewSeq;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::disconnectController( const REFERENCE< XCONTROLLER >& xController )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ sal_uInt32 nOldCount = m_pData->m_seqControllers.getLength();
+ SEQUENCE<REFERENCE< XCONTROLLER > > aNewSeq( nOldCount - 1 );
+ for ( sal_uInt32 nOld = 0, nNew = 0; nOld < nOldCount; ++nOld )
+ if ( xController != m_pData->m_seqControllers.getConstArray()[nOld] )
+ {
+ aNewSeq.getArray()[nNew] = m_pData->m_seqControllers.getConstArray()[nOld];
+ ++nNew;
+ }
+ m_pData->m_seqControllers = aNewSeq;
+
+ if ( xController == m_pData->m_xCurrent )
+ m_pData->m_xCurrent = REFERENCE< XCONTROLLER > ();
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::lockControllers()
+{
+ ++m_pData->m_nControllerLockCount ;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::unlockControllers()
+{
+ --m_pData->m_nControllerLockCount ;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+sal_Bool SAL_CALL SfxBaseModel::hasControllersLocked()
+{
+ return ( m_pData->m_nControllerLockCount != 0 ) ;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+REFERENCE< XCONTROLLER > SAL_CALL SfxBaseModel::getCurrentController()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ // is the active controller a controller of this model?
+ SfxViewFrame *pCurViewFrame = SfxViewFrame::Current();
+
+//ASDBG XCONTROLLER *pController = pCurViewFrame &&
+//ASDBG pCurViewFrame->GetObjectShell()->GetModel() == (XMODEL*) this
+//ASDBG ? pCurViewFrame->GetFrame()->GetController()
+//ASDBG : 0;
+
+ REFERENCE< XMODEL > xShellModel = pCurViewFrame->GetObjectShell()->GetModel() ;
+ REFERENCE< XMODEL > xMyModel (SAL_STATIC_CAST(XMODEL*,this)) ;
+ REFERENCE< XCONTROLLER > xController ;
+
+ if ( pCurViewFrame && ( xShellModel == xMyModel ) )
+ {
+ xController = pCurViewFrame->GetFrame()->GetController() ;
+ }
+
+ if ( xController.is() )
+ return xController;
+
+ // get the least active controller of this model
+ ::osl::MutexGuard aGuard( m_aMutex );
+ if ( m_pData->m_xCurrent.is() )
+ return m_pData->m_xCurrent;
+
+ // get the first controller of this model
+ return m_pData->m_seqControllers.getLength() ? m_pData->m_seqControllers.getConstArray()[0] : m_pData->m_xCurrent;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::setCurrentController( const REFERENCE< XCONTROLLER >& xCurrentController )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_pData->m_xCurrent = xCurrentController;
+}
+
+//________________________________________________________________________________________________________
+// XMODEL
+//________________________________________________________________________________________________________
+
+REFERENCE< XINTERFACE > SAL_CALL SfxBaseModel::getCurrentSelection()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ REFERENCE< XINTERFACE > xReturn;
+ REFERENCE< XCONTROLLER > xController = getCurrentController() ;
+
+ if ( xController.is() )
+ {
+ REFERENCE< XSELECTIONSUPPLIER > xDocView( xController, UNO_QUERY );
+ if ( xDocView.is() )
+ {
+ ANY xSel = xDocView->getSelection();
+ // automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+ // return xSel.getReflection() == XINTERFACE_getReflection()
+ // return xSel.getValueType() == ::getCppuType((const XINTERFACE*)0)
+ // ? *(REFERENCE< XINTERFACE > *) xSel.get() : REFERENCE< XINTERFACE > ();
+ xSel >>= xReturn ;
+ }
+ }
+
+ return xReturn ;
+}
+
+//________________________________________________________________________________________________________
+// XModifiable
+//________________________________________________________________________________________________________
+
+sal_Bool SAL_CALL SfxBaseModel::isModified()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ ::osl::MutexGuard aGuard( m_aMutex );
+ return m_pData->m_pObjectShell ? m_pData->m_pObjectShell->IsModified() : sal_False;
+}
+
+//________________________________________________________________________________________________________
+// XModifiable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::setModified( sal_Bool bModified )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ if ( m_pData->m_pObjectShell )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_pData->m_pObjectShell->SetModified(bModified);
+ }
+}
+
+//________________________________________________________________________________________________________
+// XModifiable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::addModifyListener(const REFERENCE< XMODIFYLISTENER >& xListener) throw(RUNTIMEEXCEPTION )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ m_pData->m_aInterfaceContainer.addInterface( ::getCppuType((const REFERENCE< XMODIFYLISTENER >*)0),xListener );
+}
+
+//________________________________________________________________________________________________________
+// XModifiable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::removeModifyListener(const REFERENCE< XMODIFYLISTENER >& xListener) throw(RUNTIMEEXCEPTION )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ m_pData->m_aInterfaceContainer.removeInterface( ::getCppuType((const REFERENCE< XMODIFYLISTENER >*)0), xListener );
+}
+
+//________________________________________________________________________________________________________
+// XPrintable
+//________________________________________________________________________________________________________
+
+SEQUENCE< PROPERTYVALUE > SAL_CALL SfxBaseModel::getPrinter()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ // Printer beschaffen
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SfxViewFrame *pViewFrm = m_pData->m_pObjectShell ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ if ( !pViewFrm )
+ return SEQUENCE<PROPERTYVALUE>();
+ const SfxPrinter *pPrinter = pViewFrm->GetViewShell()->GetPrinter(sal_True);
+ if ( !pPrinter )
+ return SEQUENCE<PROPERTYVALUE>();
+
+ // Printer Eigenschaften uebertragen
+ SEQUENCE<PROPERTYVALUE> aPrinter(8);
+
+ aPrinter.getArray()[7].Name = DEFINE_CONST_UNICODE( "CanSetPaperSize" );
+//ASDBG aPrinter.getArray()[7].Value.setBOOL( pPrinter->HasSupport( SUPPORT_SET_PAPERSIZE ) );
+ aPrinter.getArray()[7].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPERSIZE ) );
+
+ aPrinter.getArray()[6].Name = DEFINE_CONST_UNICODE( "CanSetPaperFormat" );
+//ASDBG aPrinter.getArray()[6].Value.setBOOL( pPrinter->HasSupport( SUPPORT_SET_PAPER ) );
+ aPrinter.getArray()[6].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_PAPER ) );
+
+ aPrinter.getArray()[5].Name = DEFINE_CONST_UNICODE( "CanSetPaperOrientation" );
+//ASDBG aPrinter.getArray()[5].Value.setBOOL( pPrinter->HasSupport( SUPPORT_SET_ORIENTATION ) );
+ aPrinter.getArray()[5].Value <<= ( pPrinter->HasSupport( SUPPORT_SET_ORIENTATION ) );
+
+ aPrinter.getArray()[4].Name = DEFINE_CONST_UNICODE( "IsBusy" );
+//ASDBG aPrinter.getArray()[4].Value.setBOOL( pPrinter->IsJobActive() );
+ aPrinter.getArray()[4].Value <<= ( pPrinter->IsJobActive() );
+
+ aPrinter.getArray()[3].Name = DEFINE_CONST_UNICODE( "PaperSize" );
+ SIZE aSize = impl_Size_Object2Struct(pPrinter->GetPaperSize() );
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// aPrinter.getArray()[3].Value.set( &aSize, Size_getReflection() );
+ aPrinter.getArray()[3].Value <<= aSize;
+
+ aPrinter.getArray()[2].Name = DEFINE_CONST_UNICODE( "PaperFormat" );
+ PAPERFORMAT eFormat = (PAPERFORMAT)pPrinter->GetPaper();
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// aPrinter.getArray()[2].Value.set( &eFormat, PaperFormat_getReflection() );
+ aPrinter.getArray()[2].Value <<= eFormat;
+
+ aPrinter.getArray()[1].Name = DEFINE_CONST_UNICODE( "PaperOrientation" );
+ PAPERORIENTATION eOrient = (PAPERORIENTATION)pPrinter->GetOrientation();
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// aPrinter.getArray()[1].Value.set( &eOrient, PaperOrientation_getReflection() );
+ aPrinter.getArray()[1].Value <<= eOrient;
+
+ aPrinter.getArray()[0].Name = DEFINE_CONST_UNICODE( "Name" );
+// aPrinter.getArray()[0].Value <<= ( S2U(pPrinter->GetName()) );
+ String sStringTemp = pPrinter->GetName() ;
+ aPrinter.getArray()[0].Value <<= ::rtl::OUString( sStringTemp );
+
+ return aPrinter;
+}
+
+//________________________________________________________________________________________________________
+// XPrintable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::setPrinter(const SEQUENCE< PROPERTYVALUE >& rPrinter)
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ // alten Printer beschaffen
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SfxViewFrame *pViewFrm = m_pData->m_pObjectShell ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ if ( !pViewFrm )
+ return;
+ SfxViewShell *pViewSh = pViewFrm->GetViewShell();
+ SfxPrinter *pPrinter = pViewSh->GetPrinter(sal_True);
+ if ( !pPrinter )
+ return;
+
+ // new Printer-Name available?
+ sal_uInt16 nChangeFlags = 0;
+ for ( int n = 0; n < rPrinter.getLength(); ++n )
+ {
+ // get Property-Value from printer description
+ const PROPERTYVALUE &rProp = rPrinter.getConstArray()[n];
+
+ // Name-Property?
+ if ( rProp.Name.compareToAscii( "Name" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() != OOUSTRING_getReflection() )
+ if ( rProp.Value.getValueType() != ::getCppuType((const OUSTRING*)0) )
+
+ throw ILLEGALARGUMENTEXCEPTION();
+
+// String aPrinterName( U2S( rProp.Value.getString() ) );
+ OUSTRING sTemp;
+ rProp.Value >>= sTemp ;
+ String aPrinterName( sTemp ) ;
+
+ pPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(),
+ aPrinterName );
+ nChangeFlags = SFX_PRINTER_PRINTER;
+ break;
+ }
+ }
+
+ Size aSetPaperSize( 0, 0);
+ sal_Int32 nPaperFormat = PAPER_USER;
+ // other properties
+ for ( int i = 0; i < rPrinter.getLength(); ++i )
+ {
+ // get Property-Value from printer description
+ const PROPERTYVALUE &rProp = rPrinter.getConstArray()[i];
+// IMPL_SmartAny aValue( rProp.Value );
+
+ // PaperOrientation-Property?
+ if ( rProp.Name.compareToAscii( "PaperOrientation" ) == 0 )
+ {
+ sal_Int32 nOrient;
+// if ( !aValue.queryEnum( nOrient ) )
+ if ( ( rProp.Value >>= nOrient ) == sal_False )
+ throw ILLEGALARGUMENTEXCEPTION();
+
+ pPrinter->SetOrientation( (Orientation) nOrient );
+ nChangeFlags |= SFX_PRINTER_CHG_ORIENTATION;
+ }
+
+ // PaperFormat-Property?
+ if ( rProp.Name.compareToAscii( "PaperFormat" ) == 0 )
+ {
+// if ( !aValue.queryEnum( nPaperFormat ) )
+ if ( ( rProp.Value >>= nPaperFormat ) == sal_False )
+ throw ILLEGALARGUMENTEXCEPTION();
+
+ pPrinter->SetPaper( (Paper) nPaperFormat );
+ nChangeFlags |= SFX_PRINTER_CHG_SIZE;
+ }
+
+ // PaperSize-Property?
+ if ( rProp.Name.compareToAscii( "PaperSize" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() != Size_getReflection() )
+// if ( rProp.Value.getValueType() != ::getCppuType((const Size*)0) )
+// throw( ILLEGALARGUMENTEXCEPTION() );
+//
+// aSetPaperSize = ( *(const Size*) rProp.Value.get() );
+ SIZE aTempSize ;
+ if ( ( rProp.Value >>= aTempSize ) == sal_False )
+ {
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+ else
+ {
+ aSetPaperSize = impl_Size_Struct2Object(aTempSize);
+ }
+ }
+ }
+ //os 12.11.98: die PaperSize darf nur gesetzt werden, wenn tatsaechlich
+ //PAPER_USER gilt, sonst koennte vom Treiber ein falsches Format gewaehlt werden
+ if(nPaperFormat == PAPER_USER &&
+ aSetPaperSize.Width())
+ {
+ //JP 23.09.98 - Bug 56929 - MapMode von 100mm in die am
+ // Device gesetzten umrechnen. Zusaetzlich nur dann
+ // setzen, wenn sie wirklich veraendert wurden.
+ aSetPaperSize = pPrinter->LogicToPixel( aSetPaperSize, MAP_100TH_MM );
+ if( aSetPaperSize != pPrinter->GetPaperSizePixel() )
+ {
+ pPrinter->SetPaperSizeUser( pPrinter->PixelToLogic( aSetPaperSize ) );
+ nChangeFlags |= SFX_PRINTER_CHG_SIZE;
+ }
+ }
+
+ // set new printer
+ pViewSh->SetPrinter( pPrinter, nChangeFlags );
+}
+
+//________________________________________________________________________________________________________
+// XPrintable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::print(const SEQUENCE< PROPERTYVALUE >& rOptions)
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ // get view for sfx printing capabilities
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ SfxViewFrame *pViewFrm = m_pData->m_pObjectShell ? SfxViewFrame::GetFirst( m_pData->m_pObjectShell, 0, sal_False ) : 0;
+ if ( !pViewFrm )
+ return;
+ SfxViewShell* pView = pViewFrm->GetViewShell();
+ if ( !pView )
+ return;
+
+ SfxAllItemSet aArgs( pView->GetPool() );
+ sal_Bool bMonitor = sal_False;
+
+ sal_Bool bWaitUntilEnd = sal_False;
+ for ( int n = 0; n < rOptions.getLength(); ++n )
+ {
+ // get Property-Value from options
+ const PROPERTYVALUE &rProp = rOptions.getConstArray()[n];
+// IMPL_SmartAny aValue( rProp.Value );
+
+ // FileName-Property?
+ if ( rProp.Name.compareToAscii( "FileName" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() == OOUSTRING_getReflection() )
+ if ( rProp.Value.getValueType() == ::getCppuType((const OUSTRING*)0) )
+ {
+// aArgs.Put( SfxStringItem( SID_FILE_NAME, U2S( rProp.Value.getString() ) ) );
+ OUSTRING sTemp;
+ rProp.Value >>= sTemp;
+ aArgs.Put( SfxStringItem( SID_FILE_NAME, String( sTemp ) ) );
+ }
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// else if ( rProp.Value.getReflection() != Void_getReflection() )
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // CopyCount-Property
+ else if ( rProp.Name.compareToAscii( "CopyCount" ) == 0 )
+ {
+ sal_Int32 nCopies = 0;
+// if ( !aValue.queryINT32( nCopies ) )
+ if ( ( rProp.Value >>= nCopies ) == sal_False )
+ throw ILLEGALARGUMENTEXCEPTION();
+ aArgs.Put( SfxInt16Item( SID_PRINT_COPIES, nCopies ) );
+ }
+
+ // Collate-Property
+ else if ( rProp.Name.compareToAscii( "Collate" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() == BOOL_getReflection() )
+ if ( rProp.Value.getValueType() == ::getCppuBooleanType() )
+ {
+ sal_Bool bTemp ;
+ rProp.Value >>= bTemp ;
+ aArgs.Put( SfxBoolItem( SID_PRINT_COLLATE, bTemp ) );
+ }
+ else
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Sort-Property
+ else if ( rProp.Name.compareToAscii( "Sort" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() == BOOL_getReflection() )
+ if ( rProp.Value.getValueType() == ::getCppuBooleanType() )
+ {
+ sal_Bool bTemp ;
+ rProp.Value >>= bTemp ;
+ aArgs.Put( SfxBoolItem( SID_PRINT_SORT, bTemp ) );
+ }
+ else
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Pages-Property
+ else if ( rProp.Name.compareToAscii( "Pages" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() == OOUSTRING_getReflection() )
+ if ( rProp.Value.getValueType() == ::getCppuType((const OUSTRING*)0) )
+ {
+ OUSTRING sTemp;
+ rProp.Value >>= sTemp;
+ aArgs.Put( SfxStringItem( SID_PRINT_PAGES, String( sTemp ) ) );
+ }
+ else
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // MonitorVisible
+ else if ( rProp.Name.compareToAscii( "MonitorVisible" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() == BOOL_getReflection() )
+ if ( rProp.Value.getValueType() == ::getCppuBooleanType() )
+ rProp.Value >>= bMonitor ;
+ else
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // MonitorVisible
+ else if ( rProp.Name.compareToAscii( "Wait" ) == 0 )
+ {
+// automatisch auskommentiert - Wird von UNO III nicht weiter untersttzt!
+// if ( rProp.Value.getReflection() == BOOL_getReflection() )
+ if ( rProp.Value.getValueType() == ::getCppuBooleanType() )
+ rProp.Value >>= bWaitUntilEnd ;
+ else
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+ }
+
+ aArgs.Put( SfxBoolItem( SID_SILENT, !bMonitor ) );
+ if ( bWaitUntilEnd )
+ aArgs.Put( SfxBoolItem( SID_ASYNCHRON, sal_False ) );
+ SfxRequest aReq( SID_PRINTDOC, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_API, pView->GetPool() );
+ aReq.SetArgs( aArgs );
+ pView->ExecuteSlot( aReq );
+}
+
+//________________________________________________________________________________________________________
+// XStorable
+//________________________________________________________________________________________________________
+
+sal_Bool SAL_CALL SfxBaseModel::hasLocation()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ return m_pData->m_pObjectShell ? m_pData->m_pObjectShell->HasName() : sal_False;
+}
+
+//________________________________________________________________________________________________________
+// XStorable
+//________________________________________________________________________________________________________
+
+OUSTRING SAL_CALL SfxBaseModel::getLocation()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ return m_pData->m_pObjectShell ? OUSTRING(m_pData->m_pObjectShell->GetMedium()->GetName()) : m_pData->m_sURL;
+}
+
+//________________________________________________________________________________________________________
+// XStorable
+//________________________________________________________________________________________________________
+
+sal_Bool SAL_CALL SfxBaseModel::isReadonly()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ return m_pData->m_pObjectShell ? m_pData->m_pObjectShell->IsReadOnly() : sal_True;
+}
+
+//________________________________________________________________________________________________________
+// XStorable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::store()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ if ( m_pData->m_pObjectShell )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ m_pData->m_pObjectShell->Save_Impl();
+ }
+}
+
+//________________________________________________________________________________________________________
+// XStorable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::storeAsURL( const OUSTRING& rURL ,
+ const SEQUENCE< PROPERTYVALUE >& rArgs )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ if ( m_pData->m_pObjectShell )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ impl_store( m_pData->m_pObjectShell, rURL, rArgs, sal_False );
+
+ SEQUENCE< PROPERTYVALUE > aSequence ;
+ TransformItems( SID_OPENDOC, *m_pData->m_pObjectShell->GetMedium()->GetItemSet(), aSequence );
+ attachResource( rURL, aSequence );
+ }
+}
+
+//________________________________________________________________________________________________________
+// XStorable
+//________________________________________________________________________________________________________
+
+void SAL_CALL SfxBaseModel::storeToURL( const OUSTRING& rURL ,
+ const SEQUENCE< PROPERTYVALUE >& rArgs )
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ throw DISPOSEDEXCEPTION();
+
+ if ( m_pData->m_pObjectShell )
+ {
+ ::vos::OGuard aGuard( Application::GetSolarMutex() );
+ impl_store( m_pData->m_pObjectShell, rURL, rArgs, sal_True );
+ }
+}
+
+//________________________________________________________________________________________________________
+// SfxListener
+//________________________________________________________________________________________________________
+
+void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
+ const SfxHint& rHint )
+{
+ if ( &rBC == m_pData->m_pObjectShell )
+ {
+ SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
+ if ( pHint && pHint->GetId() == SFX_HINT_DOCCHANGED )
+ changing();
+ }
+}
+
+//________________________________________________________________________________________________________
+// public impl.
+//________________________________________________________________________________________________________
+
+void SfxBaseModel::changing()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ return;
+
+ OINTERFACECONTAINERHELPER* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const REFERENCE< XMODIFYLISTENER >*)0) );
+ if( pIC )
+
+ {
+ EVENTOBJECT aEvent( (XMODEL *)this );
+ OINTERFACEITERATORHELPER aIt( *pIC );
+ while( aIt.hasMoreElements() )
+ ((XMODIFYLISTENER *)aIt.next())->modified( aEvent );
+ }
+}
+
+void SfxBaseModel::impl_change()
+{
+ // object already disposed?
+ if ( impl_isDisposed() )
+ return;
+
+ OINTERFACECONTAINERHELPER* pIC = m_pData->m_aInterfaceContainer.getContainer( ::getCppuType((const REFERENCE< XMODIFYLISTENER >*)0) );
+ if( pIC )
+
+ {
+ EVENTOBJECT aEvent( (XMODEL *)this );
+ OINTERFACEITERATORHELPER aIt( *pIC );
+ while( aIt.hasMoreElements() )
+ ((XMODIFYLISTENER *)aIt.next())->modified( aEvent );
+ }
+}
+
+//________________________________________________________________________________________________________
+// public impl.
+//________________________________________________________________________________________________________
+
+SfxObjectShell* SfxBaseModel::GetObjectShell() const
+{
+ return m_pData ? m_pData->m_pObjectShell : 0;
+}
+
+SfxObjectShell* SfxBaseModel::impl_getObjectShell() const
+{
+ return m_pData ? m_pData->m_pObjectShell : 0;
+}
+
+//________________________________________________________________________________________________________
+// public impl.
+//________________________________________________________________________________________________________
+
+sal_Bool SfxBaseModel::IsDisposed() const
+{
+ return ( m_pData == NULL ) ;
+}
+
+sal_Bool SfxBaseModel::impl_isDisposed() const
+{
+ return ( m_pData == NULL ) ;
+}
+
+//________________________________________________________________________________________________________
+// private impl.
+//________________________________________________________________________________________________________
+
+void SfxBaseModel::impl_store( SfxObjectShell* pObjectShell ,
+ const OUSTRING& sURL ,
+ const SEQUENCE<PROPERTYVALUE>& seqArguments ,
+ sal_Bool bSaveTo )
+{
+ SfxRequest aReq( SID_SAVEASDOC, SFX_CALLMODE_SYNCHRON, pObjectShell->GetPool() );
+ aReq.AppendItem( SfxStringItem( SID_FILE_NAME, String(sURL) ) );
+ if ( bSaveTo )
+ aReq.AppendItem( SfxBoolItem( SID_SAVETO, sal_True ) );
+
+ // Parameter auswerten
+ for ( int n = 0; n < seqArguments.getLength(); ++n )
+ {
+ // get Property-Value from args
+ const PROPERTYVALUE &rProp = seqArguments.getConstArray()[n];
+
+ // FilterName-Property?
+ if ( rProp.Name.compareToAscii( "FilterName" ) == 0 )
+ {
+ OUSTRING sTemp;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_FILTER_NAME, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // FilterFlags-Property?
+ else if ( rProp.Name.compareToAscii( "FilterOptions" ) == 0 )
+ {
+ OUSTRING sTemp;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_FILE_FILTEROPTIONS, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Version-Property?
+ else if ( rProp.Name.compareToAscii( "Version" ) == 0 )
+ {
+ OUSTRING sTemp ;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_VERSION, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Author-Property?
+ else if ( rProp.Name.compareToAscii( "Author" ) == 0 )
+ {
+ OUSTRING sTemp ;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_DOCINFO_AUTHOR, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Password-Property?
+ else if ( rProp.Name.compareToAscii( "Password" ) == 0 )
+ {
+ OUSTRING sTemp ;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_PASSWORD, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Overwrite-Property?
+ else if ( rProp.Name.compareToAscii( "Overwrite" ) == 0 )
+ {
+ sal_Bool bTemp ;
+ if ( ( rProp.Value >>= bTemp ) == sal_True )
+ aReq.AppendItem( SfxBoolItem( SID_OVERWRITE, bTemp ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // TemplateRegion-Property?
+ else if ( rProp.Name.compareToAscii( "TemplateRegion" ) == 0 )
+ {
+ aReq.SetSlot( SID_DOCTEMPLATE );
+ OUSTRING sTemp ;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_TEMPLATE_REGIONNAME, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ // Template-Property?
+ else if ( rProp.Name.compareToAscii( "TemplateName" ) == 0 )
+ {
+ aReq.SetSlot( SID_DOCTEMPLATE );
+ OUSTRING sTemp ;
+ if ( ( rProp.Value >>= sTemp ) == sal_True )
+ aReq.AppendItem( SfxStringItem( SID_TEMPLATE_NAME, String( sTemp ) ) );
+ else if ( rProp.Value.getValueType() != ::getCppuVoidType() )
+ throw ILLEGALARGUMENTEXCEPTION();
+ }
+
+ else
+ {
+ throw ::com::sun::star::beans::UnknownPropertyException(
+ rProp.Name, *this );
+ }
+ }
+
+ const SfxBoolItem *pRet = (const SfxBoolItem*) pObjectShell->ExecuteSlot( aReq );
+ if ( !pRet || !pRet->GetValue() )
+ throw SfxIOException_Impl( ERRCODE_IO_CANTWRITE );
+}
diff --git a/sfx2/source/explorer/makefile.mk b/sfx2/source/explorer/makefile.mk
new file mode 100644
index 000000000000..11943408a7bd
--- /dev/null
+++ b/sfx2/source/explorer/makefile.mk
@@ -0,0 +1,112 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=explorer
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+IMGLST_SRS=$(SRS)$/explorer.srs
+BMP_IN=$(PRJ)$/win/res
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = \
+ $(SLO)$/ucbhelp.obj \
+ $(SLO)$/nochaos.obj \
+ $(SLO)$/expfile.obj \
+ $(SLO)$/explorer.obj \
+ $(SLO)$/exptypes.obj \
+ $(SLO)$/infodlgs.obj \
+ $(SLO)$/iodlg.obj \
+ $(SLO)$/iodlgimp.obj \
+ $(SLO)$/sfxdir.obj \
+ $(SLO)$/fileview.obj
+
+.IF "$(GUI)"=="WNT"
+CXXFILES += goffline.cxx
+SLOFILES += $(SLO)$/goffline.obj
+.ENDIF
+
+EXCEPTIONSFILES = \
+ $(SLO)$/ucbhelp.obj
+
+SRCFILES = \
+ explorer.src \
+ iodlg.src \
+ fileview.src
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/explorer/nochaos.cxx b/sfx2/source/explorer/nochaos.cxx
new file mode 100644
index 000000000000..e4c9111d3261
--- /dev/null
+++ b/sfx2/source/explorer/nochaos.cxx
@@ -0,0 +1,247 @@
+/*************************************************************************
+ *
+ * $RCSfile: nochaos.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <svtools/itempool.hxx>
+#include <svtools/poolitem.hxx>
+#include <svtools/stritem.hxx>
+#include <nochaos.hxx>
+#include "sfxuno.hxx"
+
+
+#define WID_CHAOS_START 500
+//=========================================================================
+//
+// class CntStaticPoolDefaults_Impl
+//
+//=========================================================================
+
+class CntItemPool;
+
+class CntStaticPoolDefaults_Impl
+{
+ sal_uInt32 m_nItems;
+ SfxPoolItem** m_ppDefaults;
+ SfxItemInfo* m_pItemInfos;
+
+private:
+ // Forbidden and not implemented...
+ CntStaticPoolDefaults_Impl( const CntStaticPoolDefaults_Impl& );
+ CntStaticPoolDefaults_Impl& operator=( const CntStaticPoolDefaults_Impl& );
+
+ inline void Insert( SfxPoolItem* pItem, sal_uInt16 nSID, sal_uInt16 nFlags );
+
+public:
+ CntStaticPoolDefaults_Impl( CntItemPool* pPool );
+ ~CntStaticPoolDefaults_Impl();
+
+ SfxPoolItem** GetDefaults() const { return m_ppDefaults; }
+ const SfxItemInfo* GetItemInfos() const { return m_pItemInfos; }
+};
+
+//----------------------------------------------------------------------------
+
+//=========================================================================
+
+class CntItemPool: public SfxItemPool
+{
+ static CntItemPool* _pThePool;
+ USHORT _nRefs;
+
+protected:
+ CntItemPool();
+ virtual ~CntItemPool();
+
+public:
+ static CntItemPool* Acquire();
+ static USHORT Release();
+};
+
+//----------------------------------------------------------------------------
+
+//----------------------------------------------------------------------------
+// static
+SfxItemPool* NoChaos::GetItemPool()
+{
+ // Get and hold CHAOS item pool.
+ return CntItemPool::Acquire();
+}
+
+//----------------------------------------------------------------------------
+// static
+USHORT NoChaos::ReleaseItemPool()
+{
+ // Release CHAOS item pool.
+ return CntItemPool::Release();
+}
+
+//=========================================================================
+//
+// CntItemPool implementation
+//
+//=========================================================================
+
+static CntStaticPoolDefaults_Impl* pPoolDefs_Impl = NULL;
+
+// static member!
+CntItemPool* CntItemPool::_pThePool = NULL;
+
+//-------------------------------------------------------------------------
+CntItemPool::CntItemPool()
+: SfxItemPool( DEFINE_CONST_UNICODE("chaos"), WID_CHAOS_START, WID_CHAOS_START, NULL ),
+ _nRefs( 0 )
+{
+ SetFileFormatVersion( SOFFICE_FILEFORMAT_NOW );
+
+ FreezeIdRanges();
+
+ // Create static defaults.
+ pPoolDefs_Impl = new CntStaticPoolDefaults_Impl( this );
+
+ // Set item infos.
+ SetItemInfos( pPoolDefs_Impl->GetItemInfos() );
+
+ // Set static pool default items.
+ SetDefaults( pPoolDefs_Impl->GetDefaults() );
+}
+
+//-------------------------------------------------------------------------
+//virtual
+CntItemPool::~CntItemPool()
+{
+ // Release static pool default items.
+ ReleaseDefaults( sal_False );
+}
+
+//-------------------------------------------------------------------------
+// static
+CntItemPool* CntItemPool::Acquire()
+{
+ if ( !_pThePool )
+ _pThePool = new CntItemPool;
+
+ _pThePool->_nRefs++;
+
+ return _pThePool;
+}
+
+//-------------------------------------------------------------------------
+// static
+sal_uInt16 CntItemPool::Release()
+{
+ if ( !_pThePool )
+ return 0;
+
+ sal_uInt16& nRefs = _pThePool->_nRefs;
+
+ if ( nRefs )
+ --nRefs;
+
+ if ( !nRefs )
+ {
+ DELETEZ( _pThePool );
+ DELETEZ( pPoolDefs_Impl );
+ return 0;
+ }
+
+ return nRefs;
+}
+
+//=========================================================================
+//
+// CntStaticPoolDefaults_Impl implementation.
+//
+//=========================================================================
+
+inline void CntStaticPoolDefaults_Impl::Insert(
+ SfxPoolItem* pItem, /* Static Pool Default Item */
+ sal_uInt16 nSID, sal_uInt16 nFlags /* Item Info */ )
+{
+ sal_uInt16 nPos = pItem->Which() - WID_CHAOS_START;
+
+ m_ppDefaults[ nPos ] = pItem;
+ m_pItemInfos[ nPos ]._nSID = nSID;
+ m_pItemInfos[ nPos ]._nFlags = nFlags;
+}
+
+//-------------------------------------------------------------------------
+CntStaticPoolDefaults_Impl::~CntStaticPoolDefaults_Impl()
+{
+ for ( sal_uInt32 n = 0; n < m_nItems; ++n )
+ delete m_ppDefaults[ n ];
+
+ delete [] m_ppDefaults;
+ delete [] m_pItemInfos;
+}
+
+//-------------------------------------------------------------------------
+CntStaticPoolDefaults_Impl::CntStaticPoolDefaults_Impl( CntItemPool* pPool )
+: m_nItems( 1 ),
+ m_ppDefaults( new SfxPoolItem* [ m_nItems ] ),
+ m_pItemInfos( new SfxItemInfo [ m_nItems ] )
+{
+ rtl_zeroMemory( m_ppDefaults, sizeof( m_ppDefaults ) * m_nItems );
+ rtl_zeroMemory( m_pItemInfos, sizeof( m_pItemInfos ) * m_nItems );
+
+ Insert(
+ new SfxStringItem( WID_CHAOS_START, String() ),
+ 0,
+ SFX_ITEM_POOLABLE );
+}
diff --git a/sfx2/source/inc/acccfg.hxx b/sfx2/source/inc/acccfg.hxx
new file mode 100644
index 000000000000..ca8d33496a31
--- /dev/null
+++ b/sfx2/source/inc/acccfg.hxx
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: acccfg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _ACCCFG_HXX
+#define _ACCCFG_HXX
+
+// #include *****************************************************************
+
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _LSTBOX_HXX //autogen
+#include <vcl/lstbox.hxx>
+#endif
+#include "minarray.hxx"
+
+// forward ******************************************************************
+
+class SfxAcceleratorManager;
+
+// class SfxAcceleratorConfigListBox *************************************************
+
+class SfxAcceleratorConfigListBox : public ListBox
+{
+ void KeyInput( const KeyEvent &rKEvt );
+
+public:
+
+ SfxAcceleratorConfigListBox( Window *pParent, ResId &rResId ) :
+ ListBox( pParent, rResId ) {}
+
+ void ReplaceEntry( USHORT nPos, const String &rStr );
+ void ExpandEntry ( USHORT nPos, const String &rStr );
+};
+
+// class USHORTArr **********************************************************
+
+#if !defined(_MNUCFG_HXX) && !defined(_TBXCFG_HXX)
+DECL_2BYTEARRAY(USHORTArr, USHORT, 10, 10);
+#endif
+
+// class SfxAcceleratorConfigDialog **************************************************
+
+class SfxAcceleratorConfigDialog : public ModalDialog
+{
+ OKButton aOKButton;
+ CancelButton aCancelButton;
+ PushButton aChangeButton;
+ PushButton aRemoveButton;
+ SfxAcceleratorConfigListBox aEntriesBox;
+ FixedText aDescriptionTextText;
+ FixedText aDescriptionInfoText;
+ GroupBox aKeyboardGroup;
+ FixedText aGroupText;
+ ListBox aGroupBox;
+ FixedText aFunctionText;
+ ListBox aFunctionBox;
+ FixedText aKeyText;
+ ListBox aKeyBox;
+ GroupBox aFunctionsGroup;
+
+ SfxAcceleratorManager *pMgr;
+
+ USHORTArr aAccelArr;
+ USHORTArr aFunctionArr;
+ USHORTArr aKeyArr;
+
+ void OKHdl ( Button * );
+ void ChangeHdl( Button * );
+ void RemoveHdl( Button * );
+ void SelectHdl( ListBox *pListBox );
+
+ KeyCode PosToKeyCode ( USHORT nPos ) const;
+ USHORT KeyCodeToPos ( const KeyCode &rCode ) const;
+ String GetFunctionName( KeyFuncType eType ) const;
+
+public:
+
+ SfxAcceleratorConfigDialog( Window *pParent );
+};
+
+#endif
+
diff --git a/sfx2/source/inc/appbas.hxx b/sfx2/source/inc/appbas.hxx
new file mode 100644
index 000000000000..2eca845b995d
--- /dev/null
+++ b/sfx2/source/inc/appbas.hxx
@@ -0,0 +1,80 @@
+/*************************************************************************
+ *
+ * $RCSfile: appbas.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_APPBAS_HXX
+#define _SFX_APPBAS_HXX
+
+
+#ifndef _SBXDEF_HXX //autogen
+#include <svtools/sbxdef.hxx>
+#endif
+
+class StarBASIC;
+class SbxObject;
+
+//=========================================================================
+
+SbxVariable* MakeVariable( StarBASIC *pBas, SbxObject *pObject,
+ const char *pName, ULONG nSID, SbxDataType eType=SbxOBJECT,
+ SbxClassType = SbxCLASS_PROPERTY );
+
+
+#endif
+
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
new file mode 100644
index 000000000000..9f1976ff4a30
--- /dev/null
+++ b/sfx2/source/inc/appdata.hxx
@@ -0,0 +1,301 @@
+/*************************************************************************
+ *
+ * $RCSfile: appdata.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_APPDATA_HXX
+#define _SFX_APPDATA_HXX
+
+#include <tools/link.hxx>
+#include <tools/list.hxx>
+#include <svtools/lstner.hxx>
+#include <bitset.hxx>
+#include <objsh.hxx>
+
+class SfxTaskManager;
+
+class SfxApplication;
+class SvBindingTransportFactory;
+class SvLockBytesFactory;
+class SfxIniDefaultManager;
+class DataLockByteFactory_Impl;
+class SvStrings;
+class Config;
+class PopupMenu;
+class SfxBmkMenu;
+class SvVerbList;
+class SfxProgress;
+class SfxConfigManager;
+class SfxChildWinFactArr_Impl;
+class SfxToolBoxConfig;
+class SfxMacro;
+class SfxDdeDocTopics_Impl;
+class DdeService;
+class SfxEventConfiguration;
+class SfxMacroConfig;
+class SvFactory;
+class SotFactory;
+class SfxItemPool;
+class SfxInitLinkList;
+class SfxFilterMatcher;
+class DemoData_Impl;
+class SfxExplorer;
+class SfxMenuBarManager;
+class StopButtonTimer_Impl;
+class SvUShorts;
+class SfxNodeData_Impl;
+class SfxSIDList_Impl;
+struct SfxFrameObjectFactoryPtr;
+struct SfxPluginObjectFactoryPtr;
+struct SfxPluginObjectFactoryPtr;
+class ISfxTemplateCommon;
+class SfxAnchorJobList_Impl;
+class SfxFilterMatcher;
+class INetConnection;
+class SfxINetPlugInService;
+class SfxTrash;
+class SfxSimpleLockBytesFactoryMemberList;
+class CntUpdateResults_Impl;
+class SfxIniDefaultManager;
+class SfxFolderCfgList_Impl;
+class SfxCancelManager;
+class ISfxModule;
+struct SfxDownload_Impl;
+class SvBindStatusCallback;
+class SfxStatusDispatcher;
+class SfxDesktop;
+class SfxDdeTriggerTopic_Impl;
+class OfaMiscCfg;
+class SvLibrary;
+class SfxDocumentTemplates;
+
+DECLARE_LIST( ConnectionList_Impl, INetConnection * );
+
+class StopButtonTimer_Impl : public Timer
+{
+ BOOL bState;
+protected:
+ virtual void Timeout();
+public:
+ StopButtonTimer_Impl();
+ void SetButtonState( BOOL bStateP );
+ BOOL GetButtonState() const { return bState; }
+};
+
+
+//=========================================================================
+// SfxFolderState
+//=========================================================================
+
+/*
+ [Beschreibung]
+ Elemente dieser Aufzaehlung geben den Zustand eines Ordners an:
+ SFX_FOLDERSTATE_EMPTY der Ordner hat keine Unterordner
+ SFX_FOLDERSTATE_CONTENT der Ordner hat Unterordner
+ SFX_FOLDERSTATE_UNKNOWN es ist nicht bekannt, ob Unterordner vorhanden sind
+ */
+
+enum SfxFolderState
+{
+ SFX_FOLDERSTATE_EMPTY = 0,
+ SFX_FOLDERSTATE_CONTENT = 1,
+ SFX_FOLDERSTATE_UNKNOWN = 2
+};
+
+
+//=========================================================================
+// SfxAppData_Impl
+//=========================================================================
+
+class SfxFrameArr_Impl;
+
+class SfxAppData_Impl : public SfxListener
+{
+public:
+ SfxConfigManager* pAppCfg;
+ SfxProgress* pProgress;
+ SfxItemPool* pPool;
+ SfxChildWinFactArr_Impl* pFactArr;
+ SfxMacro* pMacro;
+ SvLibrary* pODKLib;
+ String aLastDir;
+ String aLastFilter;
+ char nConfigManagerAvailable;
+ IndexBitSet aIndexBitSet;
+ DdeService* pDdeService; // wollen wir DDE machen?
+ SfxDdeDocTopics_Impl* pDocTopics;
+ SfxEventConfiguration* pEventConfig;
+ SotFactory* pSfxApplicationObjectFactory;
+ USHORT nAsynchronCalls;
+ SvVerbList* pVerbs;
+ USHORT nBasicCallLevel;
+ USHORT nRescheduleLocks;
+ USHORT nInReschedule;
+ DemoData_Impl* pDemoData;
+ SfxInitLinkList* pInitLinkList;
+ Timer aLateInitTimer;
+ SfxFilterMatcher* pMatcher;
+ SfxExplorer* pExplorer;
+ String aSaveAsTarget;
+ String aUserEMailAddr;
+ ConnectionList_Impl aConnectionList;
+ SfxObjectFactory* pSfxPlugInObjectShellFactory;
+ Window* pDefFocusWin;
+ SfxMenuBarManager* pAppManager;
+ SfxFrameObjectFactoryPtr* pSfxFrameObjectFactoryPtr;
+ List aPendingInitFactories;
+ SfxIniDefaultManager* pIniDefMgr;
+ String aLogicAppName;
+ SfxINetPlugInService* pPlugService;
+ StopButtonTimer_Impl* pStopButtonTimer;
+ SfxCancelManager* pCancelMgr;
+ USHORT nDocModalMode;
+ SvUShorts* pDisabledSlotList;
+ Config* pFilterIni;
+ ISfxModule* pISfxModule;
+ String aLastNewURL;
+ SfxPluginObjectFactoryPtr* pSfxPluginObjectFactoryPtr;
+ SfxNodeData_Impl* pNodeData_Impl;
+ SfxSIDList_Impl* pSIDList_Impl;
+ ISfxTemplateCommon* pTemplateCommon;
+ Window* pActiveInplaceWindow;
+ SfxAnchorJobList_Impl* pAnchorJobList;
+ ResMgr* pLabelResMgr;
+ USHORT nDemoKind;
+ SfxFrameArr_Impl* pTopFrames;
+ SfxTrash* pTrash;
+ SvStrings* pSecureURLs;
+ USHORT nAutoTabPageId;
+ DataLockByteFactory_Impl* pDataLockBytesFactory;
+ USHORT nExecutingSID;
+ CntUpdateResults_Impl* pNewMessages;
+ USHORT nNewMessages;
+ SvLockBytesFactory* pImageLockBytesFactory;
+ SvLockBytesFactory* pInfoLockBytesFactory;
+ SfxBmkMenu* pNewMenu;
+ SfxBmkMenu* pBookmarkMenu;
+ SfxBmkMenu* pAutoPilotMenu;
+ SfxBmkMenu* pStartMenu;
+ SfxStatusDispatcher* pAppDispatch;
+ SfxDdeTriggerTopic_Impl* pTriggerTopic;
+ DdeService* pDdeService2;
+ SvStrings* pExtBrwOnExceptionList;
+ SvStrings* pExtBrwOffExceptionList;
+ OfaMiscCfg* pMiscConfig;
+ SfxObjectShell* pThisDocument;
+ BYTE bMultiQuickSearch;
+ BYTE bShowFsysExtension;
+ BYTE bUseExternBrowser;
+ BOOL bAccelEnabled : 1;
+ BOOL bIBMTitle : 1;
+ BOOL bOLEResize : 1;
+ BOOL bDirectAliveCount : 1;
+ BOOL bInQuit : 1;
+ BOOL bStbWasVisible : 1;
+ BOOL bSessionFailed : 1;
+ BOOL bOLEAutomation : 1;
+ BOOL bInvalidateOnUnlock : 1;
+ BOOL bBean : 1;
+ BOOL bMinimized : 1;
+ BOOL bInvisible : 1;
+ BOOL bSmartBeamer : 1;
+ BOOL bInException : 1;
+ BOOL bNewMessagesBlinker : 1;
+ BOOL bNewTaskForNewMessages : 1;
+ BOOL bBeamerSwitchedOn : 1;
+ BOOL bLateInit_BrowseRegistrationPage : 1;
+ USHORT nAppEvent;
+ SfxDocumentTemplates* pTemplates;
+ String aOpenList;
+ String aPrintList;
+ String aUcbUrl;
+
+ SfxAppData_Impl( SfxApplication* pApp );
+ ~SfxAppData_Impl();
+
+ PopupMenu* GetPopupMenu( USHORT nSid, BOOL bBig=FALSE, BOOL bNew=FALSE );
+ virtual void Notify( SfxBroadcaster &rBC, const SfxHint &rHint );
+ DECL_STATIC_LINK( SfxAppData_Impl, CreateDataLockBytesFactory, void* );
+ void ResetNewMessages( const String &rFolderULR );
+ void LoadNewMessages();
+ void SaveNewMessages();
+ void UpdateApplicationSettings( BOOL bDontHide );
+ SfxDocumentTemplates* GetDocumentTemplates();
+};
+
+extern void FATToVFat_Impl( String& );
+
+#include <svtools/poolitem.hxx>
+
+class SfxPtrItem : public SfxPoolItem
+{
+ void* pPtr;
+public:
+ TYPEINFO();
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const
+ { return new SfxPtrItem( *this ); }
+ virtual int operator==( const SfxPoolItem& rL) const
+ { return ((SfxPtrItem&)rL).pPtr == pPtr; }
+ SfxPtrItem( USHORT nWhich, void * pValue ) : SfxPoolItem( nWhich )
+ { pPtr = pValue; }
+ void* GetValue() const { return pPtr; }
+};
+
+#endif // #ifndef _SFX_APPDATA_HXX
+
+
diff --git a/sfx2/source/inc/cfg.hxx b/sfx2/source/inc/cfg.hxx
new file mode 100644
index 000000000000..d7e0f6f7a04b
--- /dev/null
+++ b/sfx2/source/inc/cfg.hxx
@@ -0,0 +1,435 @@
+/*************************************************************************
+ *
+ * $RCSfile: cfg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:33 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXCFG_HXX
+#define _SFXCFG_HXX
+
+#ifndef _SV_LSTBOX_HXX //autogen
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _SV_FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _SVTABBX_HXX //autogen
+#include <svtools/svtabbx.hxx>
+#endif
+#ifndef _SVTREEBOX_HXX //autogen
+#include <svtools/svtreebx.hxx>
+#endif
+
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_STRINGSDTOR
+#include <svtools/svstdarr.hxx> // SvUShorts
+#include "minarray.hxx"
+#include "tabdlg.hxx"
+
+class SfxMenuManager;
+class SfxAcceleratorManager;
+class SfxMacroInfoArr_Impl;
+class SfxMacroInfoItem;
+class SfxMacroInfo;
+class SfxConfigManager;
+
+#define SFX_CFGGROUP_FUNCTION 1
+#define SFX_CFGGROUP_BASICMGR 2
+#define SFX_CFGGROUP_DOCBASICMGR 3
+#define SFX_CFGGROUP_BASICLIB 4
+#define SFX_CFGGROUP_BASICMOD 5
+#define SFX_CFGFUNCTION_MACRO 6
+#define SFX_CFGFUNCTION_SLOT 7
+
+struct SfxGroupInfo_Impl
+{
+ USHORT nKind;
+ USHORT nOrd;
+ void* pObject;
+ BOOL bWasOpened;
+
+ SfxGroupInfo_Impl( USHORT n, USHORT nr, void* pObj = 0 ) :
+ nKind( n ), nOrd( nr ), pObject( pObj ), bWasOpened(FALSE) {}
+};
+
+typedef SfxGroupInfo_Impl* SfxGroupInfoPtr;
+SV_DECL_PTRARR_DEL(SfxGroupInfoArr_Impl, SfxGroupInfoPtr, 5, 5);
+DECL_2BYTEARRAY(USHORTArr, USHORT, 10, 10);
+
+class SfxConfigFunctionListBox_Impl : public SvTreeListBox
+{
+friend class SfxConfigGroupListBox_Impl;
+ Timer aTimer;
+ SvLBoxEntry* pCurEntry;
+ SfxGroupInfoArr_Impl aArr;
+
+ DECL_LINK( TimerHdl, Timer* );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+
+public:
+ SfxConfigFunctionListBox_Impl( Window*, const ResId& );
+ ~SfxConfigFunctionListBox_Impl();
+ void ClearAll();
+ SvLBoxEntry* GetEntry_Impl( USHORT nId );
+ SvLBoxEntry* GetEntry_Impl( const String& );
+ USHORT GetId( SvLBoxEntry *pEntry );
+ String GetHelpText( SvLBoxEntry *pEntry );
+ USHORT GetCurId()
+ { return GetId( FirstSelected() ); }
+ SfxMacroInfo* GetMacroInfo();
+ void FunctionSelected();
+};
+
+class SfxConfigGroupListBox_Impl : public SvTreeListBox
+{
+ SfxConfigFunctionListBox_Impl* pFunctionListBox;
+ SfxGroupInfoArr_Impl aArr;
+ ULONG nMode;
+ String aScriptType;
+
+protected:
+ virtual void RequestingChilds( SvLBoxEntry *pEntry);
+#if SUPD>=527
+ virtual BOOL Expand( SvLBoxEntry* pParent );
+#endif
+
+public:
+ SfxConfigGroupListBox_Impl ( Window* pParent,
+ const ResId&, ULONG nConfigMode = 0 );
+ ~SfxConfigGroupListBox_Impl();
+
+ void Init( SvStringsDtor *pArr = 0 );
+ void SetFunctionListBox( SfxConfigFunctionListBox_Impl *pBox )
+ { pFunctionListBox = pBox; }
+ void Open( SvLBoxEntry*, BOOL );
+ void GroupSelected();
+ void SelectMacro( const SfxMacroInfoItem* );
+ void SelectMacro( const String&, const String& );
+ String GetGroup();
+ void SetScriptType( const String& rScriptType );
+};
+
+class SfxMenuConfigEntry
+{
+private:
+ USHORT nId;
+ BOOL bPopUp;
+ String aHelpText;
+ String aStr;
+
+public:
+ SfxMenuConfigEntry( USHORT nInitId, const String& rInitStr,
+ const String& rHelpText, BOOL bPopup = FALSE );
+ SfxMenuConfigEntry() : nId( 0 ), bPopUp( FALSE ) {}
+ ~SfxMenuConfigEntry();
+
+ USHORT GetId() const { return nId; }
+ void SetId( USHORT nNew );
+ const String& GetName() const { return aStr; }
+ void SetName( const String& rStr ) { aStr = rStr; }
+ const String& GetHelpText() const { return aHelpText; }
+ void SetHelpText( const String& rStr ) { aHelpText = rStr; }
+ void SetPopup( BOOL bOn = TRUE ) { bPopUp = bOn; }
+ BOOL IsBinding() const { return nId != 0 && !bPopUp; }
+ BOOL IsSeparator() const { return nId == 0; }
+ BOOL IsPopup() const { return bPopUp; }
+};
+
+// class SfxMenuConfigEntryArr *************************************************
+
+SV_DECL_PTRARR_DEL(SfxMenuConfigEntryArr, SfxMenuConfigEntry *, 16, 16)
+
+class SfxMenuConfigPage;
+class SfxMenuCfgTabListBox_Impl : public SvTabListBox
+{
+ SfxMenuConfigPage* pPage;
+ SfxMenuConfigEntryArr aMenuArr;
+ Timer aTimer;
+ SfxMenuConfigEntry* pCurEntry;
+
+ DECL_LINK( TimerHdl, Timer* );
+
+public :
+ SfxMenuCfgTabListBox_Impl( Window *pParent, const ResId& rResId );
+ ~SfxMenuCfgTabListBox_Impl();
+
+ virtual long PreNotify( NotifyEvent& );
+ virtual void ModelIsRemoving( SvListEntry* pEntry );
+ void EntryInserted( SvListEntry* pEntry );
+ virtual void ModelHasCleared();
+ virtual void EditingRequest( SvLBoxEntry* pEntry,
+ SvLBoxItem* pItem, const Point& rMousePos );
+ virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const String& rNewText );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual BOOL QueryDrop( DropEvent& );
+ virtual BOOL NotifyMoving(SvLBoxEntry*, SvLBoxEntry*, SvLBoxEntry*&, ULONG& );
+ void Apply( SfxMenuManager* pMgr, SvLBoxEntry *pParent = NULL );
+};
+
+// class SfxMenuConfigPage -----------------------------------------------
+
+class SfxMenuConfigPage : public SfxTabPage
+{
+private:
+ SfxMenuCfgTabListBox_Impl aEntriesBox;
+ GroupBox aMenuGroup;
+ PushButton aNewButton;
+ PushButton aNewPopupButton;
+ PushButton aChangeButton;
+ PushButton aRemoveButton;
+ ImageButton aUpButton;
+ ImageButton aDownButton;
+ FixedText aGroupText;
+ SfxConfigGroupListBox_Impl aGroupBox;
+ FixedText aFunctionText;
+ SfxConfigFunctionListBox_Impl aFunctionBox;
+ GroupBox aFunctionsGroup;
+ PushButton aLoadButton;
+ PushButton aSaveButton;
+ PushButton aResetButton;
+
+ SfxMenuManager* pMgr;
+
+ BOOL bModified;
+ BOOL bDefault;
+
+ DECL_LINK( MoveHdl, Button * );
+ DECL_LINK( NewHdl, Button * );
+ DECL_LINK( NewPopupHdl, Button * );
+ DECL_LINK( ChangeHdl, Button * );
+ DECL_LINK( RemoveHdl, Button * );
+ DECL_LINK( SelectHdl, Control* );
+
+ void CheckEntry( Control* );
+ USHORT GetCurId();
+ String MakeEntry( const SfxMenuConfigEntry &rEntry ) const;
+ String Trim( const String &rStr ) const;
+
+ void Init();
+ void ResetConfig();
+
+ BOOL TryMove_Impl( Button*, SvLBoxEntry** pEntry=NULL, ULONG* pPos=NULL );
+
+ DECL_LINK( Default, PushButton * );
+ DECL_LINK( Save, Button * );
+ DECL_LINK( Load, Button * );
+
+public:
+ SfxMenuConfigPage( Window *pParent, const SfxItemSet& rItemSet );
+ virtual ~SfxMenuConfigPage();
+
+ virtual BOOL FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+ void Apply();
+ void SetModified( BOOL bSet ) { bModified = bSet; }
+ void SetDefault( BOOL bSet ) { bDefault = bSet; }
+};
+
+
+class SfxAcceleratorManager;
+
+// class SfxAcceleratorConfigListBox *************************************************
+
+class SfxAccCfgTabListBox_Impl : public SfxMenuCfgTabListBox_Impl
+{
+ void KeyInput( const KeyEvent &rKEvt );
+
+public:
+ SfxAccCfgTabListBox_Impl( Window *pParent,
+ const ResId &rResId ) :
+ SfxMenuCfgTabListBox_Impl( pParent, rResId )
+ {}
+
+ void ReplaceEntry( USHORT nPos, const String &rStr );
+};
+
+// class SfxAcceleratorConfigPage ----------------------------------------
+
+class SfxAcceleratorConfigPage : public SfxTabPage
+{
+private:
+ SfxAccCfgTabListBox_Impl aEntriesBox;
+ GroupBox aKeyboardGroup;
+ PushButton aChangeButton;
+ PushButton aRemoveButton;
+ FixedText aGroupText;
+ SfxConfigGroupListBox_Impl aGroupBox;
+ FixedText aFunctionText;
+ SfxConfigFunctionListBox_Impl aFunctionBox;
+ FixedText aKeyText;
+ ListBox aKeyBox;
+ GroupBox aFunctionsGroup;
+ PushButton aLoadButton;
+ PushButton aSaveButton;
+ PushButton aResetButton;
+
+ SfxAcceleratorManager* pMgr;
+
+ USHORTArr aAccelArr;
+ USHORTArr aKeyArr;
+ BOOL bModified;
+ BOOL bDefault;
+
+ DECL_LINK( ChangeHdl, Button * );
+ DECL_LINK( RemoveHdl, Button * );
+ DECL_LINK( SelectHdl, Control * );
+ DECL_LINK( Save, Button * );
+ DECL_LINK( Load, Button * );
+ DECL_LINK( Default, PushButton * );
+
+ KeyCode PosToKeyCode ( USHORT nPos ) const;
+ USHORT KeyCodeToPos ( const KeyCode &rCode ) const;
+ String GetFunctionName( KeyFuncType eType ) const;
+
+ void Init();
+ void ResetConfig();
+
+public:
+ SfxAcceleratorConfigPage( Window *pParent, const SfxItemSet& rItemSet );
+ virtual ~SfxAcceleratorConfigPage();
+
+ virtual BOOL FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+
+ void SelectMacro(const SfxMacroInfoItem*);
+ void Apply();
+};
+
+class SfxConfigDialog : public SfxTabDialog
+{
+ const SfxMacroInfoItem* pMacroInfo;
+ USHORT nObjectBar;
+
+public:
+ SfxConfigDialog( Window*, const SfxItemSet* );
+ ~SfxConfigDialog();
+
+ void ActivateToolBoxConfig( USHORT nId );
+ void ActivateMacroConfig( const SfxMacroInfoItem* );
+
+ virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
+ virtual short Ok();
+
+ static String FileDialog_Impl( Window *pParent, WinBits nBits, const String& rTitle );
+ static SfxConfigManager* MakeCfgMgr_Impl( const String& rName, BOOL& bCreated );
+};
+
+class SfxStatusBarManager;
+class SfxStbInfoArr_Impl;
+
+class SfxStatusBarConfigListBox : public SvTreeListBox
+{
+friend class SfxStatusBarConfigPage;
+ SvLBoxButtonData* pButton;
+ BOOL bModified;
+ BOOL bDefault;
+ SvLBoxEntry* pCurEntry;
+ Timer aTimer;
+
+ DECL_LINK( TimerHdl, Timer* );
+
+public:
+
+ SfxStatusBarConfigListBox( Window* pParent,
+ const ResId& );
+
+ virtual BOOL NotifyQueryDrop( SvLBoxEntry* pEntry );
+ virtual BOOL NotifyMoving(SvLBoxEntry*,
+ SvLBoxEntry*,SvLBoxEntry*&,ULONG&);
+ virtual void CheckButtonHdl();
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKeyEvent );
+};
+
+// class SfxStatusBarConfigPage ------------------------------------------
+
+class SfxStatusBarConfigPage : public SfxTabPage
+{
+private:
+ SfxStatusBarConfigListBox aEntriesBox;
+ GroupBox aStatusBarGroup;
+ PushButton aLoadButton;
+ PushButton aSaveButton;
+ PushButton aResetButton;
+
+ SvUShorts aListOfIds;
+ SfxStatusBarManager* pMgr;
+ SfxStbInfoArr_Impl* pArr;
+
+ DECL_LINK( SelectHdl, SvTreeListBox * );
+ DECL_LINK( Save, Button * );
+ DECL_LINK( Load, Button * );
+ DECL_LINK( Default, PushButton * );
+
+ void Init();
+ void ResetConfig();
+
+public:
+ SfxStatusBarConfigPage( Window *pParent, const SfxItemSet& rItemSet );
+ virtual ~SfxStatusBarConfigPage();
+
+ virtual BOOL FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+ void Apply();
+};
+
+
+#endif
+
diff --git a/sfx2/source/inc/eventdlg.hxx b/sfx2/source/inc/eventdlg.hxx
new file mode 100644
index 000000000000..c5d79cbf2765
--- /dev/null
+++ b/sfx2/source/inc/eventdlg.hxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: eventdlg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _EVENTDLG_HXX
+#define _EVENTDLG_HXX
+
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _MENUBTN_HXX //autogen
+#include <vcl/menubtn.hxx>
+#endif
+
+#include "evntconf.hxx"
+#include "macropg.hxx"
+
+class Menu;
+class SfxMacroInfoItem;
+class SvxMacroItem;
+
+class SfxEventConfigPage : public _SfxMacroTabPage
+{
+ RadioButton aStarOfficeRB;
+ RadioButton aDocumentRB;
+// CheckBox aWarningCB;
+ CheckBox aAlwaysWarningCB;
+ GroupBox aSafetyGb;
+
+ SvxMacroItem* pAppItem;
+ SvxMacroItem* pDocItem;
+ BOOL bModified;
+ BOOL bAppConfig;
+
+ DECL_LINK( ButtonHdl, Button* );
+ DECL_LINK( SelectHdl_Impl, RadioButton* );
+
+public:
+ SfxEventConfigPage( Window *pParent, const SfxItemSet& rSet );
+ ~SfxEventConfigPage();
+
+ void Init();
+ void SelectMacro( const SfxMacroInfoItem* );
+ void SelectMacro( const SvxMacro* );
+ void Apply();
+
+ virtual BOOL FillItemSet( SfxItemSet& );
+ virtual void Reset( const SfxItemSet& );
+};
+
+
+#endif
+
diff --git a/sfx2/source/inc/fltfnc.hxx b/sfx2/source/inc/fltfnc.hxx
new file mode 100644
index 000000000000..4217c4e1fba3
--- /dev/null
+++ b/sfx2/source/inc/fltfnc.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltfnc.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXFLTFNC_HXX
+#define _SFXFLTFNC_HXX
+
+#include "fcontnr.hxx"
+
+BOOL SfxIsHelpEntryURL( const String &rURL, const String &rExtMask );
+
+#endif
+
diff --git a/sfx2/source/inc/helper.hxx b/sfx2/source/inc/helper.hxx
new file mode 100644
index 000000000000..28c316127108
--- /dev/null
+++ b/sfx2/source/inc/helper.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: helper.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_HELPER_HXX
+#define _SFX_HELPER_HXX
+
+// include ---------------------------------------------------------------
+
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UCB_NAMECLASH_HPP_
+#include <com/sun/star/ucb/NameClash.hpp>
+#endif
+
+#include <tools/string.hxx>
+#include <tools/errcode.hxx>
+#include <tools/bigint.hxx>
+
+// class SfxContentHelper ------------------------------------------------
+
+class SfxContentHelper
+{
+private:
+ static sal_Bool Transfer_Impl( const String& rSource, const String& rDest, sal_Bool bMoveData,
+ sal_Int32 nNameClash );
+
+public:
+ static sal_Bool IsDocument( const String& rContent );
+ static sal_Bool IsFolder( const String& rContent );
+ static sal_Bool GetTitle( const String& rContent, String& rTitle );
+ static sal_Bool Kill( const String& rContent );
+
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ GetFolderContents( const String& rFolder, sal_Bool bFolder );
+ static ::com::sun::star::uno::Sequence< ::rtl::OUString >
+ GetFolderContentProperties( const String& rFolder, sal_Bool bFolder );
+
+ static sal_Bool CopyTo( const String& rSource, const String& rDest );
+ static sal_Bool MoveTo( const String& rSource, const String& rDest, sal_Int32 nNameClash = com::sun::star::ucb::NameClash::ERROR );
+
+ static sal_Bool MakeFolder( const String& rFolder );
+ static ErrCode QueryDiskSpace( const String& rPath, sal_Int64& rFreeBytes );
+ static ULONG GetSize( const String& rContent );
+ static sal_Bool IsYounger( const String& rIsYoung, const String& rIsOlder );
+
+ // please don't use this!
+ static sal_Bool Exists( const String& rContent );
+ static sal_Bool Find( const String& rFolder, const String& rName, String& rFile );
+};
+
+#endif // #ifndef _SFX_HELPER_HXX
+
+
diff --git a/sfx2/source/inc/helpid.hrc b/sfx2/source/inc/helpid.hrc
new file mode 100644
index 000000000000..bd98f5f07b22
--- /dev/null
+++ b/sfx2/source/inc/helpid.hrc
@@ -0,0 +1,344 @@
+/*************************************************************************
+ *
+ * $RCSfile: helpid.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_HELPID_HRC
+#define _SFX_HELPID_HRC
+
+// include ------------------------------------------------------------------
+
+#include <svtools/solar.hrc>
+
+// Help-Ids -----------------------------------------------------------------
+
+#define HID_FILTER_SELECT (HID_SFX_START + 0)
+#define HID_USERDEFBMP (HID_SFX_START + 1)
+#define HID_DOCINFO_EDT (HID_SFX_START + 2)
+#define HID_PASSWD (HID_SFX_START + 3)
+#define HID_PRINTMONITOR (HID_SFX_START + 4)
+#define HID_CONFIG_OBJECTBAR (HID_SFX_START + 5)
+#define HID_MANAGE_STYLES (HID_SFX_START + 6)
+#define HID_CONFIG_EVENT (HID_SFX_START + 7)
+#define HID_DOCINFODESC (HID_SFX_START + 8)
+#define HID_DOCINFODOC (HID_SFX_START + 9)
+#define HID_DOCINFOUSER (HID_SFX_START + 10)
+#define HID_CONFIG_MENU (HID_SFX_START + 11)
+#define HID_CONFIG_ACCEL (HID_SFX_START + 12)
+#define HID_CONFIG_STATBAR (HID_SFX_START + 13)
+#define HID_BOOKMARKPROPS (HID_SFX_START + 14)
+#define HID_BOOKGROUPPROPS (HID_SFX_START + 15)
+#define HID_BOOKFILEPROPS (HID_SFX_START + 16)
+#define HID_NEWS_SERVERPROPS (HID_SFX_START + 20)
+#define HID_NEWS_RULEPAGE (HID_SFX_START + 21)
+#define HID_MAILINTRAYPROPS (HID_SFX_START + 23)
+#define HID_DOCINFORELOAD (HID_SFX_START + 24)
+#define HID_NEWS_GROUPPAGE (HID_SFX_START + 25)
+#define HID_NEWS_SERVERPAGE (HID_SFX_START + 26)
+#define HID_FILEDLG_STANDARD (HID_SFX_START + 27)
+#define HID_FILEDLG_MANAGER (HID_SFX_START + 28)
+#define HID_FILEDLG_URL (HID_SFX_START + 29)
+#define HID_FILEDLG_FILE (HID_SFX_START + 30)
+#define HID_FILEDLG_USE_PASSWD (HID_SFX_START + 31)
+#define HID_FILEDLG_READ_ONLY (HID_SFX_START + 32)
+#define HID_EXPLORERCONTROL (HID_SFX_START + 33)
+#define HID_BROWSERCONTROL (HID_SFX_START + 34)
+#define HID_CTL_ORGANIZER_LEFT (HID_SFX_START + 35)
+#define HID_CTL_ORGANIZER_RIGHT (HID_SFX_START + 36)
+#define HID_EXPLMAILSRV_GENERAL_PAGE (HID_SFX_START + 37)
+#define HID_EXPLMAILSRV_PROTOCOL_PAGE (HID_SFX_START + 38)
+#define HID_EXPLMAILSRV_DATAMATCH_PAGE (HID_SFX_START + 39)
+#define HID_EXPLMAILSRV_SENDJOURNAL_PAGE (HID_SFX_START + 40)
+#define HID_EXPLMAIL_GENERAL_PAGE (HID_SFX_START + 41)
+#define HID_NEWS_CTL_RULES (HID_SFX_START + 42)
+#define HID_NEWS_CTL_GROUPS (HID_SFX_START + 43)
+#define HID_CONFIG_OBJECTBAR_CTL (HID_SFX_START + 44)
+#define HID_NEWS_QUICKSEARCH (HID_SFX_START + 45)
+#define HID_NEWS_SERVERVIEWPROPS (HID_SFX_START + 46)
+#define HID_NEWS_SHOWARTICLEPROPS (HID_SFX_START + 47)
+#define HID_NEWS_SHOWGROUPPROPS (HID_SFX_START + 48)
+#define HID_NEWS_USER (HID_SFX_START + 49)
+#define HID_MULTISELECTION_GENERAL_PAGE (HID_SFX_START + 50)
+#define HID_LINK_GENERAL_PAGE (HID_SFX_START + 51)
+#define HID_LINK_ADDRESS_PAGE (HID_SFX_START + 52)
+#define HID_FOLDER_GENERAL_PAGE (HID_SFX_START + 53)
+#define HID_FILE_GENERAL_PAGE (HID_SFX_START + 54)
+#define HID_FTP_GENERAL_PAGE (HID_SFX_START + 55)
+#define HID_PRINT_OPTIONS (HID_SFX_START + 56)
+#define HID_PREVIEW_FRAME (HID_SFX_START + 57)
+#define HID_DOCINFO_FRAME (HID_SFX_START + 58)
+#define HID_EXPLORER_FRAME (HID_SFX_START + 59)
+#define HID_APP_WIN (HID_SFX_START + 60)
+#define HID_TEMPLATE_FMT (HID_SFX_START + 61)
+#define HID_TEMPLATE_FILTER (HID_SFX_START + 62)
+#define HID_FTPSERVER_PAGE (HID_SFX_START + 63)
+#define HID_MACRO_LB_EVENT (HID_SFX_START + 64)
+#define HID_DLG_SFX_EXP_SEARCH (HID_SFX_START + 65)
+#define HID_TP_SFX_EXP_SEARCH_CRITERIA (HID_SFX_START + 66)
+#define HID_TP_SFX_EXP_SEARCH_PLACE (HID_SFX_START + 67)
+#define HID_SEARCH_DLG_TABLB (HID_SFX_START + 68)
+#define HID_TEMPLDLG_NEWBYEXAMPLE (HID_SFX_START + 69)
+#define HID_TEMPLDLG_UPDATEBYEXAMPLE (HID_SFX_START + 70)
+#define HID_TEMPLDLG_WATERCAN (HID_SFX_START + 71)
+#define HID_CONFIGFUNCTION_LISTBOX (HID_SFX_START + 72)
+#define HID_CONFIGGROUP_LISTBOX (HID_SFX_START + 73)
+#define HID_STATUSBARCONFIG_LISTBOX (HID_SFX_START + 74)
+#define HID_ACCELCONFIG_LISTBOX (HID_SFX_START + 75)
+#define HID_MENUCONFIG_LISTBOX (HID_SFX_START + 76)
+#define HID_TOOLBOXCONFIG_LISTBOX (HID_SFX_START + 77)
+#define HID_DESKTOP (HID_SFX_START + 78)
+#define HID_EXPLORERTOOLSTOOLBOX (HID_SFX_START + 79)
+#define HID_EXPLOREROBJECTTOOLBOX (HID_SFX_START + 80)
+#define HID_RECORDINGTOOLBOX (HID_SFX_START + 81)
+#define HID_FULLSCREENTOOLBOX (HID_SFX_START + 82)
+#define HID_HELPBAR (HID_SFX_START + 83)
+#define HID_ENVTOOLBOX (HID_SFX_START + 84)
+#define HID_FRAMESETEDIT_TOOLBOX (HID_SFX_START + 85)
+#define HID_NAVIGATOR_WINDOW (HID_SFX_START + 86)
+#define HID_MACRO_GROUP (HID_SFX_START + 87)
+#define HID_MACRO_MACROS (HID_SFX_START + 88)
+#define HID_TABDLG_RESET_BTN (HID_SFX_START + 89)
+#define HID_TABDLG_STANDARD_BTN (HID_SFX_START + 90)
+#define HID_HELPAGENT_TIP_BOX (HID_SFX_START + 91)
+#define HID_TEMPLDLG_TOOLBOX_LEFT (HID_SFX_START + 92)
+#define HID_TEMPLDLG_TOOLBOX_RIGHT (HID_SFX_START + 93)
+#define HID_EXPLORER_SRCH_COUNT (HID_SFX_START + 94)
+#define HID_BEAMER_SORT_ASCENDING (HID_SFX_START + 95)
+#define HID_BEAMER_SORT_DESCENDING (HID_SFX_START + 96)
+#define HID_EXPLORER_SRCH_LATEST_COUNT (HID_SFX_START + 97)
+#define HID_CONFIG_EVENT_OFFICE_BASED (HID_SFX_START + 98)
+#define HID_CONFIG_EVENT_DOCUMENT_BASED (HID_SFX_START + 99)
+#define HID_ORGANIZE_NEW (HID_SFX_START + 100)
+#define HID_ORGANIZE_DELETE (HID_SFX_START + 101)
+#define HID_ORGANIZE_EDIT (HID_SFX_START + 102)
+#define HID_ORGANIZE_COPY_FROM (HID_SFX_START + 103)
+#define HID_ORGANIZE_COPY_TO (HID_SFX_START + 104)
+#define HID_ORGANIZE_PRINT (HID_SFX_START + 105)
+#define HID_ORGANIZE_PRINTER_SETUP (HID_SFX_START + 106)
+#define HID_ORGANIZE_RESCAN (HID_SFX_START + 107)
+#define HID_STYLIST_NEW (HID_SFX_START + 108)
+#define HID_STYLIST_EDIT (HID_SFX_START + 109)
+#define HID_STYLIST_DELETE (HID_SFX_START + 110)
+#define HID_EXPLORERMENU_ARRANGEICONS (HID_SFX_START + 111)
+#define HID_EXPLORERMENU_ARRANGEICONS_ONGRID (HID_SFX_START + 112)
+#define HID_EXPLORERMENU_FIXEDICONPOS (HID_SFX_START + 113)
+#define HID_EXPLORERMENU_OPEN (HID_SFX_START + 114)
+#define HID_EXPLORERMENU_PRINT (HID_SFX_START + 115)
+#define HID_EXPLORERMENU_SEARCH (HID_SFX_START + 116)
+#define HID_EXPLORERMENU_COPY (HID_SFX_START + 117)
+#define HID_EXPLORERMENU_DELETE (HID_SFX_START + 118)
+#define HID_EXPLORERMENU_CREATELINK (HID_SFX_START + 119)
+#define HID_EXPLORERMENU_EDITPROPERTIES (HID_SFX_START + 120)
+#define HID_EXPLORERMENU_DOWNLOAD (HID_SFX_START + 121)
+#define HID_EXPLORERMENU_STDTEMPLATE (HID_SFX_START + 122)
+#define HID_EXPLORERDLG_FILE (HID_SFX_START + 123)
+#define HID_EXPLORERDLG_FILELIST (HID_SFX_START + 124)
+#define HID_PDFOLDERS_WORKPLACE (HID_SFX_START + 125)
+#define HID_PDFOLDERS_EXPLORER (HID_SFX_START + 126)
+#define HID_PDFOLDERS_STANDARD (HID_SFX_START + 127)
+#define HID_PDFOLDERS_ROOT (HID_SFX_START + 128)
+#define HID_PDFOLDERS_DESKTOP (HID_SFX_START + 129)
+#define HID_CNTMENU_REMOVE_GROUP (HID_SFX_START + 130)
+#define HID_CNTMENU_CLEAR_CACHE (HID_SFX_START + 131)
+#define HID_CNT_SYNC_INFO_DLG (HID_SFX_START + 132)
+#define HID_CNT_REMOVE_REMOVEDLIST (HID_SFX_START + 133)
+#define HID_CNT_ABORT_DIALOG (HID_SFX_START + 134)
+#define HID_CNT_PAGE_PRJ_DATAEXCHANGE (HID_SFX_START + 135)
+#define HID_CHAOSDOC_OBJECTBAR_FILE (HID_SFX_START + 136)
+#define HID_CHAOSDOC_OBJECTBAR_MESSAGE (HID_SFX_START + 137)
+#define HID_CHAOSDOC_MN_PART_OPEN (HID_SFX_START + 138)
+#define HID_CHAOSDOC_MN_PART_DELETE (HID_SFX_START + 139)
+#define HID_CHAOSDOC_MN_PART_RENAME (HID_SFX_START + 140)
+#define HID_CHAOSDOC_MN_PART_SAVEAS (HID_SFX_START + 141)
+#define HID_EXPLORER_DOCVIEW_ICON (HID_SFX_START + 142)
+#define HID_EXPLORER_DOCVIEW_DETAILS (HID_SFX_START + 143)
+#define HID_CHAOSDOC_WIN (HID_SFX_START + 144)
+#define HID_CHAOSDOC_WIN_HEADER (HID_SFX_START + 145)
+#define HID_CHAOSDOC_WIN_PARTS (HID_SFX_START + 146)
+#define HID_CHAOSDOC_WIN_BODY (HID_SFX_START + 147)
+#define HID_CNT_INSERT_COLUMN (HID_SFX_START + 148)
+#define HID_CNT_REMOVE_COLUMN (HID_SFX_START + 149)
+#define HID_CNT_OPT_WIDTH (HID_SFX_START + 150)
+#define HID_CNT_SORT_ASC (HID_SFX_START + 151)
+#define HID_CNT_SORT_DESC (HID_SFX_START + 152)
+#define HID_CNT_RULEPG_OPEN_DIR (HID_SFX_START + 153)
+#define HID_CHAOSDOC_MN_HEADER_ADDRESSBOOK (HID_SFX_START + 154)
+#define HID_CHAOSDOC_MN_HEADER_COPYLINK (HID_SFX_START + 155)
+#define HID_CLEAN_CACHE (HID_SFX_START + 156)
+#define HID_SBOX_LOCATION (HID_SFX_START + 157)
+#define HID_SBOX_SUBSCRIBTION (HID_SFX_START + 158)
+#define HID_SBOX_CDF_SUBSCRIBTION (HID_SFX_START + 159)
+#define HID_SBOX_SCHEDULE (HID_SFX_START + 160)
+#define HID_SBOX_NOTIFICATION (HID_SFX_START + 161)
+#define HID_SBOX_SDC_GENERAL (HID_SFX_START + 162)
+#define HID_BRWBOX_HEADERBAR (HID_SFX_START + 163)
+#define HID_CANNOT_CREATE_BMK_HERE (HID_SFX_START + 164)
+#define HID_CREATE_BOOKMARK (HID_SFX_START + 165)
+#define HID_TASKBAR (HID_SFX_START + 166)
+#define HID_TASKBUTTONBAR (HID_SFX_START + 167)
+#define HID_TASKTOOLBAR (HID_SFX_START + 168)
+#define HID_CHAOSDOC_SHOW_FSYS_EXTENSION (HID_SFX_START + 169)
+#define HID_CNT_FILE (HID_SFX_START + 170)
+#define HID_CHAOSDOC_MN_BODY_OPENLINK (HID_SFX_START + 171)
+#define HID_CHAOSDOC_MN_BODY_OPENLINK_BLANK (HID_SFX_START + 172)
+#define HID_CHAOSDOC_MN_BODY_DOWNLOAD (HID_SFX_START + 173)
+#define HID_CHAOSDOC_MN_BODY_ADDBOOKMARK (HID_SFX_START + 174)
+#define HID_OPEN_MENU_CNT (HID_SFX_START + 175)
+#define HID_CNT_OPEN_AS_TEMPLATE (HID_SFX_START + 176)
+#define HID_CNT_OPEN_AS_DOC (HID_SFX_START + 177)
+#define HID_PDFOLDERS_TEMPLATE (HID_SFX_START + 178)
+#define HID_EXPLORER_ROOT (HID_SFX_START + 179)
+#define HID_RESET_URL (HID_SFX_START + 180)
+#define HID_PHONE_DIALOG (HID_SFX_START + 181)
+#define HID_QB_RESOLVE_LINK (HID_SFX_START + 182)
+#define HID_CHAOSDOC_MN_HEADER_FLAG_BOLD (HID_SFX_START + 183)
+#define HID_CHAOSDOC_MN_HEADER_FLAG_ITALIC (HID_SFX_START + 184)
+#define HID_CHAOSDOC_MN_HEADER_BIG_HEADER (HID_SFX_START + 185)
+#define HID_CHAOSDOC_MN_HEADER_TEMPLATE_HEADER (HID_SFX_START + 186)
+#define HID_CNT_MARK_THREAD_MARKED (HID_SFX_START + 187)
+#define HID_CNT_MARK_THREAD_UNMARKED (HID_SFX_START + 188)
+#define HID_CNT_DLG_SEARCH_BT_SHOW (HID_SFX_START + 189)
+#define HID_CNT_DLG_SEARCH_BT_UPDATE (HID_SFX_START + 190)
+#define HID_CNT_DLG_SEARCH_BT_SYNCHRONIZE (HID_SFX_START + 191)
+#define HID_CNT_DLG_SEARCH_BT_STOP (HID_SFX_START + 192)
+#define HID_CNT_PAGE_HEADER (HID_SFX_START + 193)
+#define HID_CNT_DLG_ADDRESS (HID_SFX_START + 194)
+#define HID_EXPLORERMENU_AUTO_ARRANGEICONS (HID_SFX_START + 195)
+#define HID_EXPLORERMENU_AUTO_ADJUSTICONS (HID_SFX_START + 196)
+#define HID_EXPLORERMENU_FREE_POSITIONING (HID_SFX_START + 197)
+#define HID_CNT_TARGET_MENU (HID_SFX_START + 198)
+#define HID_CNT_PAGE_DESCRIPTION (HID_SFX_START + 199)
+#define HID_CNT_LB_HEADER (HID_SFX_START + 200)
+#define HID_CNT_LB_DESCRIPTION (HID_SFX_START + 201)
+#define HID_GROUPVIEW_BIG_SYMBOLS (HID_SFX_START + 202)
+#define HID_GROUPVIEW_SMALL_SYMBOLS (HID_SFX_START + 203)
+#define HID_GROUPVIEW_ADD_GROUP (HID_SFX_START + 204)
+#define HID_GROUPVIEW_REMOVE_GROUP (HID_SFX_START + 205)
+#define HID_GROUPVIEW_RENAME_GROUP (HID_SFX_START + 206)
+#define HID_GROUPVIEW_ADD_BOOKMARK (HID_SFX_START + 207)
+#define HID_GROUPVIEW_TREE (HID_SFX_START + 208)
+#define HID_GROUPVIEW_ADD_AS_FOLDER (HID_SFX_START + 209)
+#define HID_GROUPVIEW_ADD_AS_BMK (HID_SFX_START + 210)
+#define HID_GROUPVIEW_REMOVE_BMK (HID_SFX_START + 211)
+#define HID_GROUPVIEW_CONTENT_BIG (HID_SFX_START + 212)
+#define HID_GROUPVIEW_CONTENT_SMALL (HID_SFX_START + 213)
+#define HID_GROUPVIEW_CONTENT_TREE (HID_SFX_START + 214)
+#define HID_GROUPVIEW_SHOW_DOCS (HID_SFX_START + 215)
+#define HID_EDIT_TEMPLATE (HID_SFX_START + 216)
+#define HID_PDFOLDERS_GRAPHICS (HID_SFX_START + 217)
+#define HID_FILEDLG_AUTOCOMPLETEBOX (HID_SFX_START + 218)
+#define HID_FILEDLG_SAVE_BTN (HID_SFX_START + 219)
+#define HID_FILEDLG_SAVE_FILENAME (HID_SFX_START + 220)
+#define HID_FILEDLG_SAVE_FILETYPE (HID_SFX_START + 221)
+#define HID_FILEDLG_INSERT_BTN (HID_SFX_START + 222)
+#define HID_FILEDLG_PATH_BTN (HID_SFX_START + 223)
+#define HID_FILEDLG_PATH_FILENAME (HID_SFX_START + 224)
+#define HID_FILEDLG_FOLDER_BTN (HID_SFX_START + 225)
+#define HID_FILEDLG_FOLDER_FILENAME (HID_SFX_START + 226)
+#define HID_FILEDLG_SRCHFOLDER_BTN (HID_SFX_START + 227)
+#define HID_PDFOLDERS_GROUPS (HID_SFX_START + 228)
+#define HID_OPEN_CHOOSE_FILTER (HID_SFX_START + 229)
+#define HID_PDFOLDERS_BOOKMARKS (HID_SFX_START + 230)
+#define HID_PDFOLDERS_FAVORITES_ADD (HID_SFX_START + 231)
+#define HID_PDFOLDERS_FAVORITES_REMOVE (HID_SFX_START + 232)
+#define HID_PDFOLDERS_HISTORY (HID_SFX_START + 233)
+#define HID_FILEDLG_EDIT_FAVORITES (HID_SFX_START + 234)
+#define HID_FILEDLG_NEW_FAVORITE (HID_SFX_START + 235)
+#define HID_FILEDLG_EDIT_FAVORITES_LISTBOX (HID_SFX_START + 236)
+#define HID_FILEDLG_EDIT_FAVORITES_HEADERBAR (HID_SFX_START + 237)
+#define HID_CONFIGFUNCTION_ACC_LISTBOX (HID_SFX_START + 238)
+#define HID_CONFIGGROUP_ACC_LISTBOX (HID_SFX_START + 239)
+#define HID_CNT_CB_FORCE_BODY_EXPORT (HID_SFX_START + 240)
+#define HID_CNT_PAGE_REPSTATE_CONTROL (HID_SFX_START + 241)
+#define HID_TASKSTATUSBAR (HID_SFX_START + 242)
+#define HID_STATUSBAR (HID_SFX_START + 243)
+#define HID_CNT_PAGE_HEADER_TABBAR (HID_SFX_START + 244)
+#define HID_CNT_PAGE_SUBSCR_TABBAR (HID_SFX_START + 245)
+#define HID_CHAOSDOC_MN_PART_PRINT (HID_SFX_START + 246)
+#define HID_STATUSINDICATOR_TEXT (HID_SFX_START + 247)
+#define HID_STATUSINDICATOR_PROGRESS (HID_SFX_START + 248)
+#define HID_CNT_VALUE_ADDED_NONE (HID_SFX_START + 249)
+#define HID_CNT_VALUE_ADDED_DOCINFO (HID_SFX_START + 250)
+#define HID_CNT_VALUE_ADDED_FULL (HID_SFX_START + 251)
+#define HID_CNT_MESSAGE_STOREMODE_REMOTE (HID_SFX_START + 252)
+#define HID_CNT_MESSAGE_STOREMODE_LOCAL (HID_SFX_START + 253)
+#define HID_CNT_VIEW_ALL_ARTICLES (HID_SFX_START + 254)
+#define HID_CNT_VIEW_UNREAD_ARTICLES (HID_SFX_START + 255)
+#define HID_CNT_VIEW_READ_ARTICLES (HID_SFX_START + 256)
+#define HID_CNT_VIEW_MARKED_ARTICLES (HID_SFX_START + 257)
+#define HID_CNT_VIEW_MARKED_AND_UNREAD_ARTICLES (HID_SFX_START + 258)
+#define HID_CNT_VIEW_ALL_FOLDERS (HID_SFX_START + 259)
+#define HID_CNT_VIEW_SUBSCRIBED_FOLDERS (HID_SFX_START + 260)
+#define HID_CNT_VIEW_ACTIVE_FOLDERS (HID_SFX_START + 261)
+#define HID_CNT_SENT_VIEW_ALL_ARTICLES (HID_SFX_START + 262)
+#define HID_CNT_SENT_VIEW_SENT_ARTICLES (HID_SFX_START + 263)
+#define HID_CNT_SENT_VIEW_UNSENT_ARTICLES (HID_SFX_START + 264)
+#define HID_CNT_SENT_VIEW_MARKED_ARTICLES (HID_SFX_START + 265)
+
+#define ACT_SFX_HID_END HID_CNT_SENT_VIEW_MARKED_ARTICLES
+
+// "Uberlaufpr"ufung --------------------------------------------------------
+
+#if ACT_SFX_HID_END > HID_SFX_END
+#error Resource-Ueberlauf in #line, #file
+#endif
+
+#endif // #ifndef _SFX_HELPID_HRC
+
+// ******************************************************************* EOF
+
diff --git a/sfx2/source/inc/hexplwnd.hxx b/sfx2/source/inc/hexplwnd.hxx
new file mode 100644
index 000000000000..e2888930d333
--- /dev/null
+++ b/sfx2/source/inc/hexplwnd.hxx
@@ -0,0 +1,173 @@
+/*************************************************************************
+ *
+ * $RCSfile: hexplwnd.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _HEXPLWND_HXX
+#define _HEXPLWND_HXX
+
+// includes --------------------------------------------------------------
+
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_
+#include <com/sun/star/beans/PropertyValues.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
+#include <com/sun/star/beans/PropertyState.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_
+#include <com/sun/star/beans/XFastPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HPP_
+#include <com/sun/star/beans/XVetoableChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
+#include <com/sun/star/util/URL.hpp>
+#endif
+#include "childwin.hxx"
+#include "dockwin.hxx"
+
+// forward ---------------------------------------------------------------
+
+class SfxBeamerUnoFrame_Impl;
+
+// class SfxExplorerHorizChildWnd_Impl -----------------------------------
+
+class SfxExplorerHorizChildWnd_Impl : public SfxChildWindow
+{
+public:
+ SfxExplorerHorizChildWnd_Impl( Window* pParent, sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW(SfxExplorerHorizChildWnd_Impl);
+
+
+ virtual sal_Bool QueryClose();
+};
+
+// class SfxExplorerDockWnd_Impl -----------------------------------------
+
+class SfxExplorerHorizDockWnd_Impl : public SfxDockingWindow
+{
+private:
+ SfxBeamerUnoFrame_Impl* _pFrame;
+
+protected:
+ virtual void GetFocus();
+ virtual long Notify( NotifyEvent& rNEvt );
+
+public:
+ SfxExplorerHorizDockWnd_Impl( SfxBindings* pBindings,
+ SfxChildWindow* pChildWin,
+ Window* pParent, const ResId& rResId );
+ ~SfxExplorerHorizDockWnd_Impl();
+
+ virtual void FillInfo( SfxChildWinInfo& ) const;
+ virtual void FadeIn( sal_Bool );
+ sal_Bool QueryClose();
+ void SetURL( const ::com::sun::star::util::URL& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rArgs );
+ const ::com::sun::star::util::URL& GetURL() const;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrameInterface();
+ const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& GetArgs() const;
+};
+
+
+#endif
+
diff --git a/sfx2/source/inc/intro.hxx b/sfx2/source/inc/intro.hxx
new file mode 100644
index 000000000000..a8d48e30b4b2
--- /dev/null
+++ b/sfx2/source/inc/intro.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: intro.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_INTRO_HXX
+#define _SFX_INTRO_HXX
+
+// include ---------------------------------------------------------------
+
+#ifndef _SV_WRKWIN_HXX
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SV_BITMAP_HXX
+#include <vcl/bitmap.hxx>
+#endif
+
+// class IntroWindow_Impl ------------------------------------------------
+
+class IntroWindow_Impl : public WorkWindow
+{
+private:
+ Bitmap aIntroBmp;
+
+ void Init();
+
+public:
+ IntroWindow_Impl( const Bitmap& rBmp );
+ ~IntroWindow_Impl();
+
+ virtual void Paint( const Rectangle& );
+
+ void Slide();
+};
+
+#endif // #ifndef _SFX_INTRO_HXX
+
+
diff --git a/sfx2/source/inc/mnucfga.hxx b/sfx2/source/inc/mnucfga.hxx
new file mode 100644
index 000000000000..0209fba527b6
--- /dev/null
+++ b/sfx2/source/inc/mnucfga.hxx
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * $RCSfile: mnucfga.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXMNUCFGA_HXX
+#define _SFXMNUCFGA_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _SFXMINARRAY_HXX
+#include "minarray.hxx"
+#endif
+
+//==================================================================
+
+class SfxMenuCfgItemArr;
+
+struct SfxMenuCfgItem
+{
+ USHORT nId; // id of the binding or 0 if none
+ String aTitle; // title of the item
+ String aHelpText; // Hilfetext
+ SfxMenuCfgItemArr* pPopup; // pointer to a popup menu (if any)
+};
+
+DECL_PTRARRAY(SfxMenuCfgItemArr, SfxMenuCfgItem*, 4, 4 );
+
+
+#endif
+
diff --git a/sfx2/source/inc/nfltdlg.hxx b/sfx2/source/inc/nfltdlg.hxx
new file mode 100644
index 000000000000..66f8fb0e7f37
--- /dev/null
+++ b/sfx2/source/inc/nfltdlg.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * $RCSfile: nfltdlg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXNFLTDLG_HXX
+#define _SFXNFLTDLG_HXX
+
+
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _LSTBOX_HXX //autogen
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+class SfxFilterMatcher;
+
+class SfxMedium;
+class SfxFilterDialog : public ModalDialog
+{
+private:
+ GroupBox aGroupType;
+ FixedText aMIMEType;
+ FixedText aExtension;
+ ListBox aListbox;
+ GroupBox aGroupFrm;
+ OKButton aOkBtn;
+ CancelButton aCancelBtn;
+ HelpButton aHelpBtn;
+ String aDefFilter;
+ const SfxFilterMatcher& rMatcher;
+ DECL_LINK( OkHdl, Control * );
+
+public:
+ SfxFilterDialog( Window * pParent,
+ SfxMedium* pMed,
+ const SfxFilterMatcher &rMatcher,
+ const String *pDefFilter, BOOL bShowConvert = TRUE );
+
+ String GetSelectEntry() const;
+};
+
+
+#endif
diff --git a/sfx2/source/inc/nochaos.hxx b/sfx2/source/inc/nochaos.hxx
new file mode 100644
index 000000000000..089ad04b3f7b
--- /dev/null
+++ b/sfx2/source/inc/nochaos.hxx
@@ -0,0 +1,74 @@
+/*************************************************************************
+ *
+ * $RCSfile: nochaos.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_NOCHAOS_HXX
+#define _SFX_NOCHAOS_HXX
+
+class SfxItemPool;
+
+class NoChaos
+{
+public:
+ static SfxItemPool* GetItemPool();
+ static USHORT ReleaseItemPool();
+};
+
+#endif
+
diff --git a/sfx2/source/inc/objmnctl.hxx b/sfx2/source/inc/objmnctl.hxx
new file mode 100644
index 000000000000..b5a06f3104de
--- /dev/null
+++ b/sfx2/source/inc/objmnctl.hxx
@@ -0,0 +1,90 @@
+/*************************************************************************
+ *
+ * $RCSfile: objmnctl.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_OBJMNCTL_HXX
+#define _SFX_OBJMNCTL_HXX
+
+
+#ifndef _SFX_HXX
+#include "mnuitem.hxx"
+#endif
+
+class SfxBindings;
+class PopupMenu;
+class Menu;
+
+class SfxObjectVerbsControl: public SfxMenuControl
+{
+ PopupMenu* pMenu;
+ Menu& rParent;
+
+private:
+ void FillMenu();
+ DECL_LINK( MenuSelect, Menu * );
+ virtual void StateChanged( USHORT, SfxItemState, const SfxPoolItem* pState );
+
+public:
+ SfxObjectVerbsControl(USHORT, Menu&, SfxBindings&);
+ ~SfxObjectVerbsControl();
+ virtual PopupMenu* GetPopup() const;
+ SFX_DECL_MENU_CONTROL();
+};
+
+#endif
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
new file mode 100644
index 000000000000..4eea3381fbb7
--- /dev/null
+++ b/sfx2/source/inc/objshimp.hxx
@@ -0,0 +1,237 @@
+/*************************************************************************
+ *
+ * $RCSfile: objshimp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_OBJSHIMP_HXX
+#define _SFX_OBJSHIMP_HXX
+
+#include "objsh.hxx"
+#include "bitset.hxx"
+#ifndef _COM_SUN_STAR_IO_DATATRANSFEREVENT_HPP_
+#include <com/sun/star/io/DataTransferEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATAIMPORTER_HPP_
+#include <com/sun/star/io/XDataImporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATATRANSFEREVENTLISTENER_HPP_
+#include <com/sun/star/io/XDataTransferEventListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XDATAEXPORTER_HPP_
+#include <com/sun/star/io/XDataExporter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+#ifndef _DATETIME_HXX
+#include <tools/datetime.hxx>
+#endif
+class AsynchronLink;
+
+//====================================================================
+
+DBG_NAMEEX(SfxObjectShell);
+
+class SfxViewFrame;
+struct MarkData_Impl
+{
+ String aMark;
+ String aUserData;
+ SfxViewFrame* pFrame;
+};
+
+class SfxFrame;
+#if SUPD<582
+class SfxJSDocument;
+class SfxJSDocumentManager;
+#endif
+class SvIPCClient;
+struct SfxObjectShell_Impl
+{
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XDataExporter > xFilter;
+ String aStarOneFilterName;
+ SfxDocumentInfo* pDocInfo;
+ SfxConfigManager* pCfgMgr;
+ SfxInPlaceObject* pInPlaceObj; // das dazugeh"orige SO2-Objekt, falls this ein SfxInPlaceObject ist
+ BasicManager* pBasicMgr; // Doc-BASIC oder 0
+ SfxProgress* pProgress;
+ String aTitle;
+ DateTime nTime;
+ sal_uInt16 nVisualDocumentNumber;
+ sal_Bool bTemplateConfig:1,
+ bInList:1, // ob per First/Next erreichbar
+ bClosing:1, // sal_True w"aehrend Close(), um Benachrichtigungs-Rekursionen zu verhindern
+ bSetInPlaceObj:1, // sal_True, falls bereits versucht wurde pInPlaceObject zu casten
+ bIsSaving:1,
+ bPasswd:1,
+ bIsTmp:1,
+ bIsNamedVisible:1,
+ bLoadLayout:1,
+ bDidWarnFormat:1, // sal_True, falls schon wg. speichern in Fremformat gewarnt wurde
+ bSetStandardName:1, // sal_True, falls im FileSave Dialog xxxx.sdw im Standardverzeichnis vorgeschlagen werden soll.
+ bDidDangerousSave:1, // sal_True, falls ein Save in ein Alienformat durchgefuehrt wurde
+ bIsTemplate:1,
+ bIsAbortingImport:1, // Importvorgang soll abgebrochen werden.
+ bImportDone : 1, //Import schon fertig? Fuer AutoReload von Docs.
+ bInPrepareClose : 1,
+ bPreparedForClose : 1,
+ bWaitingForPicklist : 1,// Muss noch in die Pickliste
+ bModuleSearched : 1,
+ bIsBasicDefault : 1,
+ bIsHelpObjSh : 1,
+ bForbidCaching : 1,
+ bForbidReload : 1,
+ bSupportsEventMacros: 1,
+ bLoadingWindows: 1,
+ bBasicInitialized :1;
+
+
+ String aNewName; // Der Name, unter dem das Doc gespeichert
+ // werden soll
+ IndexBitSet aBitSet;
+ sal_uInt32 lErr;
+ sal_uInt16 nEventId; // falls vor Activate noch ein
+ // Open/Create gesendet werden mu/s
+ sal_Bool bAddToHistory; // nicht per Forward/Backward
+ sal_Bool bSilent; // e.g. in API-Call => no dialogs
+
+ AutoReloadTimer_Impl *pReloadTimer;
+ MarkData_Impl* pMarkData;
+ sal_uInt16 nLoadedFlags;
+ String aMark;
+ Size aViewSize; // wird leider vom Writer beim
+ sal_Bool bInFrame; // HTML-Import gebraucht
+ sal_Bool bModalMode;
+ sal_Bool bReloadAvailable;
+ sal_uInt16 nAutoLoadLocks;
+ SfxModule* pModule;
+ SfxFrame* pFrame;
+ SfxEventConfigItem_Impl* pEventConfig;
+ SfxObjectShellFlags eFlags;
+ AsynchronLink* pCloser;
+ String aBaseURL;
+ sal_Bool bReadOnlyUI;
+ SvRefBaseRef xHeaderAttributes;
+ sal_Bool bHiddenLockedByAPI;
+ sal_Bool bInCloseEvent;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel;
+ sal_uInt16 nStyleFilter;
+
+ SfxObjectShell_Impl() :
+ nTime(),
+ bIsTmp( sal_False),
+ bClosing( sal_False),
+ bSetInPlaceObj( sal_False),
+ bPasswd( sal_False),
+ pInPlaceObj( 0),
+ pBasicMgr( 0),
+ pProgress( 0),
+ nVisualDocumentNumber( USHRT_MAX),
+ bIsSaving( sal_False),
+ bIsNamedVisible( sal_False),
+ bLoadLayout( sal_True),
+ pCfgMgr( 0),
+ bTemplateConfig( sal_False),
+ bDidWarnFormat( sal_False),
+ bDidDangerousSave(sal_False),
+ bIsBasicDefault( sal_True ),
+ bIsTemplate(sal_False),
+ lErr(ERRCODE_NONE),
+ nEventId ( 0),
+ bAddToHistory ( sal_True),
+ pDocInfo ( 0),
+ bIsAbortingImport ( sal_False),
+ bInList ( sal_False),
+ bImportDone ( sal_False),
+ pReloadTimer ( 0),
+ nLoadedFlags ( SFX_LOADED_MAINDOCUMENT ),
+ pMarkData( 0 ),
+ bInFrame( sal_False ),
+ bModalMode( sal_False ),
+ bReloadAvailable( sal_False ),
+ nAutoLoadLocks( 0 ),
+ bInPrepareClose( sal_False ),
+ bPreparedForClose( sal_False ),
+ bWaitingForPicklist( sal_False ),
+ pModule( 0 ),
+ bModuleSearched( sal_False ),
+ pFrame( 0 ),
+ pEventConfig(NULL),
+ bIsHelpObjSh( sal_False ),
+ bForbidCaching( sal_False ),
+ bSilent(sal_False),
+ bForbidReload( sal_False ),
+ bBasicInitialized( sal_False ),
+ eFlags( SFXOBJECTSHELL_UNDEFINED ),
+ pCloser( 0 ),
+ bSupportsEventMacros( sal_True ),
+ bReadOnlyUI( sal_False ),
+ bHiddenLockedByAPI( sal_False ),
+ bInCloseEvent( sal_False ),
+ bLoadingWindows( sal_False )
+ , nStyleFilter( 0 )
+ {}
+ ~SfxObjectShell_Impl();
+
+};
+
+extern void GetFileTitle_Impl( String& aName );
+
+
+#endif
+
diff --git a/sfx2/source/inc/openflag.hxx b/sfx2/source/inc/openflag.hxx
new file mode 100644
index 000000000000..6161ac3722f6
--- /dev/null
+++ b/sfx2/source/inc/openflag.hxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * $RCSfile: openflag.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_OPENFLAG_HXX
+#define _SFX_OPENFLAG_HXX
+
+// Datei zum Bearbeiten "offnen, anschliessend funktioniert nur noch
+// die dritte Variante (Lesen einer Kopie)
+#define SFX_STREAM_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYWRITE)
+// Ich arbeite roh auf dem Original, keine Kopie
+// -> Datei kann anschliessend nicht zum Bearbeiten ge"offnet werden
+#define SFX_STREAM_READONLY (STREAM_READ | STREAM_SHARE_DENYWRITE) // + !bDirect
+// Jemand anders bearbeitet das File, es wird eine Kopie erstellt
+// -> Datei kann anschliessend zum Bearbeiten ge"offnet werden
+#define SFX_STREAM_READONLY_MAKECOPY (STREAM_READ | STREAM_SHARE_DENYNONE)
+
+
+#endif
diff --git a/sfx2/source/inc/partwnd.hxx b/sfx2/source/inc/partwnd.hxx
new file mode 100644
index 000000000000..28ebeb489e85
--- /dev/null
+++ b/sfx2/source/inc/partwnd.hxx
@@ -0,0 +1,169 @@
+/*************************************************************************
+ *
+ * $RCSfile: partwnd.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _PARTWND_HXX
+#define _PARTWND_HXX
+
+// includes --------------------------------------------------------------
+/* ASDBG
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_
+#include <com/sun/star/beans/PropertyValues.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
+#include <com/sun/star/beans/PropertyState.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_
+#include <com/sun/star/beans/XFastPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HPP_
+#include <com/sun/star/beans/XVetoableChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_
+#include <com/sun/star/frame/XFrame.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_URL_HPP_
+#include <com/sun/star/util/URL.hpp>
+#endif
+*/
+#include "childwin.hxx"
+#include "dockwin.hxx"
+
+// forward ---------------------------------------------------------------
+
+class SfxPartwinFrame_Impl;
+
+// class SfxPartChildWnd_Impl -----------------------------------
+
+class SfxPartChildWnd_Impl : public SfxChildWindow
+{
+public:
+ SfxPartChildWnd_Impl( Window* pParent, sal_uInt16 nId,
+ SfxBindings* pBindings,
+ SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW(SfxPartChildWnd_Impl);
+
+ virtual sal_Bool QueryClose();
+};
+
+// class SfxExplorerDockWnd_Impl -----------------------------------------
+
+class SfxPartDockWnd_Impl : public SfxDockingWindow
+{
+private:
+ SfxPartwinFrame_Impl* _pFrame;
+
+protected:
+ virtual void Resize();
+ virtual long Notify( NotifyEvent& rNEvt );
+
+public:
+ SfxPartDockWnd_Impl( SfxBindings* pBindings,
+ SfxChildWindow* pChildWin,
+ Window* pParent,
+ WinBits nBits );
+
+ ~SfxPartDockWnd_Impl();
+ sal_Bool QueryClose();
+ virtual void FillInfo(SfxChildWinInfo&) const;
+};
+
+
+#endif
+
diff --git a/sfx2/source/inc/preview.hxx b/sfx2/source/inc/preview.hxx
new file mode 100644
index 000000000000..1fade8d62200
--- /dev/null
+++ b/sfx2/source/inc/preview.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: preview.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXPREVIEW_HXX
+#define _SFXPREVIEW_HXX
+
+
+#include "doctempl.hxx"
+#include "basedlgs.hxx"
+
+class SfxObjectShell;
+class SvStorageRef;
+class SfxFrameWindow;
+
+class SfxFrame;
+class GDIMetaFile;
+
+class SfxPreviewBase_Impl : public Window
+{
+protected:
+ GDIMetaFile* pMetaFile;
+public:
+ SfxPreviewBase_Impl( Window* pParent,
+ const ResId& rResId );
+ SfxPreviewBase_Impl( Window* pParent );
+ ~SfxPreviewBase_Impl( );
+ void SetObjectShell( SfxObjectShell* pObj );
+ void SetGDIFile( GDIMetaFile* pFile );
+ virtual void Resize();
+};
+
+
+
+class SfxPreviewWin_Impl: public SfxPreviewBase_Impl
+{
+protected:
+ virtual void Paint( const Rectangle& rRect );
+public:
+ SfxPreviewWin_Impl( Window* pParent,
+ const ResId& rResId )
+ : SfxPreviewBase_Impl( pParent, rResId ){};
+ SfxPreviewWin_Impl( Window* pParent )
+ : SfxPreviewBase_Impl( pParent ){};
+ static void ImpPaint(
+ const Rectangle& rRect, GDIMetaFile* pFile, Window* pWindow );
+ static SfxFrameWindow*
+ PreviewFactory( SfxFrame* pFrame, const String& rName );
+};
+
+#endif
diff --git a/sfx2/source/inc/referers.hxx b/sfx2/source/inc/referers.hxx
new file mode 100644
index 000000000000..4a9301811a34
--- /dev/null
+++ b/sfx2/source/inc/referers.hxx
@@ -0,0 +1,70 @@
+/*************************************************************************
+ *
+ * $RCSfile: referers.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_REFERERS_HXX
+#define _SFX_REFERERS_HXX
+
+#define SFX_REFERER_USER "private:user"
+#define SFX_REFERER_APPEVENT "private:appevent"
+#define SFX_REFERER_EXPLORER "private:explorer"
+#define SFX_REFERER_NEWMENU "private:newmenu"
+
+
+#endif
diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc
new file mode 100644
index 000000000000..be879cb7b04e
--- /dev/null
+++ b/sfx2/source/inc/sfxlocal.hrc
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxlocal.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+//============================================================================
+// Lokale Resourcen
+//
+// (C) 1996 - 2000 Star Division GmbH, Hamburg, Germany
+// $Author: hr $ $Date: 2000-09-18 16:52:34 $ $Revision: 1.1.1.1 $
+// $Logfile: T:/sfx2/source/inc/sfxlocal.hrv $ $Workfile: SFXLOCAL.HRC $
+//----------------------------------------------------------------------------
+#ifndef _SFXLOCAL_HRC
+#define _SFXLOCAL_HRC
+
+#include <sfx.hrc>
+
+// Strings ---------------------------------------------------------------
+
+#define STR_SFX_NEWOFFICEDOC (RID_SFX_SFXLOCAL_START + 0)
+#define STR_MENU_NEWMAIL (RID_SFX_SFXLOCAL_START + 1)
+
+// MessBoxen -------------------------------------------------------------
+
+#define ERRBOX_SFX_INVALID_MERGEOPT (RID_SFX_SFXLOCAL_START + 0)
+#define MSG_ERROR_PASSWD (RID_SFX_SFXLOCAL_START + 1)
+#define ERRBOX_SFX_NO_OUTBOX (RID_SFX_SFXLOCAL_START + 2)
+#define INFOBOX_NO_SUBSCRIBED (RID_SFX_SFXLOCAL_START + 3)
+
+
+#endif
+
diff --git a/sfx2/source/inc/sfxtypes.hxx b/sfx2/source/inc/sfxtypes.hxx
new file mode 100644
index 000000000000..b685951fbaca
--- /dev/null
+++ b/sfx2/source/inc/sfxtypes.hxx
@@ -0,0 +1,271 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxtypes.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_SFXTYPES_HXX
+#define _SFX_SFXTYPES_HXX
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _RC_HXX //autogen
+#include <vcl/rc.hxx>
+#endif
+#ifndef _RCID_H //autogen
+#include <vcl/rcid.h>
+#endif
+#ifndef _RESID_HXX //autogen
+#include <vcl/resid.hxx>
+#endif
+#ifndef _LINK_HXX //autogen
+#include <tools/link.hxx>
+#endif
+#ifndef _APP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <vcl/wrkwin.hxx>
+#endif
+
+#ifndef _VOS_MUTEX_HXX //autogen
+#include <vos/mutex.hxx>
+#endif
+
+#ifndef DELETEZ
+#define DELETEZ(pPtr) ( delete pPtr, pPtr = 0 )
+#endif
+
+#ifndef DELETEX
+#ifdef DBG_UTIL
+#define DELETEX(pPtr) ( delete pPtr, (void*&) pPtr = (void*) 0xFFFFFFFF )
+#else
+#define DELETEX(pPtr) delete pPtr
+#endif
+#endif
+
+class SfxShell;
+class Timer;
+
+#if !defined(_SFX_APPCTOR_CXX) && defined(WNT)
+#ifndef _DLL_
+#error _DLL_ mal wieder nicht defined => GetpApp() == 0
+#endif
+#endif
+
+//------------------------------------------------------------------------
+
+// Macro fuer den Call-Profiler unter WinNT
+// mit S_CAP kann eine Messung gestarted, mit E_CAP wieder gestoppt werden
+#if defined( WNT ) && defined( PROFILE )
+
+extern "C" {
+ void StartCAP();
+ void StopCAP();
+ void DumpCAP();
+};
+
+#define S_CAP() StartCAP();
+#define E_CAP() StopCAP(); DumpCAP();
+
+struct _Capper
+{
+ _Capper() { S_CAP(); }
+ ~_Capper() { E_CAP(); }
+};
+
+#define CAP _Capper _aCap_
+
+#else
+
+#define S_CAP()
+#define E_CAP()
+#define CAP
+
+#endif
+
+#ifdef DBG_UTIL
+#ifndef DBG
+#define DBG(statement) statement
+#endif
+#define DBG_OUTF(x) DbgOutf x
+#else
+#ifndef DBG
+#define DBG(statement)
+#endif
+#define DBG_OUTF(x)
+#endif
+
+#define TRIM(s) s.EraseLeadingChars().EraseTrailingChars()
+
+//------------------------------------------------------------------------
+
+String SfxShellIdent_Impl( const SfxShell *pSh );
+
+//------------------------------------------------------------------------
+
+#if defined(DBG_UTIL) && ( defined(WNT) || defined(OS2) )
+
+class SfxStack
+{
+ static unsigned nLevel;
+
+public:
+ SfxStack( const char *pName )
+ {
+ ++nLevel;
+ DbgOutf( "STACK: enter %3d %s", nLevel, pName );
+ }
+ ~SfxStack()
+ {
+ DbgOutf( "STACK: leave %3d", nLevel );
+ --nLevel;
+ }
+};
+
+#define SFX_STACK(s) SfxStack aSfxStack_( #s )
+#else
+#define SFX_STACK(s)
+#endif
+
+//------------------------------------------------------------------------
+
+String SearchAndReplace( const String &rSource,
+ const String &rToReplace,
+ const String &rReplacement );
+
+#define SFX_PASSWORD_CODE "_:;*?()/&[&"
+String SfxStringEncode( const String &rSource,
+ const char *pKey = SFX_PASSWORD_CODE );
+String SfxStringDecode( const String &rSource,
+ const char *pKey = SFX_PASSWORD_CODE );
+
+
+class NAMESPACE_VOS( OMutex );
+class AsynchronLink
+{
+ Link _aLink;
+ ULONG _nEventId;
+ Timer* _pTimer;
+ BOOL _bInCall;
+ BOOL* _pDeleted;
+ void* _pArg;
+ NAMESPACE_VOS( OMutex )* _pMutex;
+
+ DECL_STATIC_LINK( AsynchronLink, HandleCall, void* );
+ void Call_Impl( void* pArg );
+public:
+ AsynchronLink( const Link& rLink ) :
+ _pTimer( 0 ), _aLink( rLink ), _nEventId( 0 ), _bInCall( FALSE ),
+ _pDeleted( 0 ), _pMutex( 0 ){}
+ AsynchronLink() : _nEventId( 0 ), _pTimer( 0 ), _bInCall( FALSE ),
+ _pDeleted( 0 ), _pMutex( 0 ){}
+ ~AsynchronLink();
+
+ void CreateMutex();
+ void operator=( const Link& rLink ) { _aLink = rLink; }
+ void Call( void* pObj, BOOL bAllowDoubles = FALSE,
+ BOOL bUseTimer = FALSE );
+ void ForcePendingCall( );
+ void ClearPendingCall( );
+ BOOL IsSet() const { return _aLink.IsSet(); }
+ Link GetLink() const { return _aLink; }
+};
+
+
+struct StringList_Impl : private Resource
+{
+
+ ResId aResId;
+
+ StringList_Impl( const ResId& rErrIdP, USHORT nId)
+ : Resource( rErrIdP ),aResId(nId){}
+ ~StringList_Impl() { FreeResource(); }
+
+ String GetString(){ return String( aResId ); }
+ operator BOOL(){return IsAvailableRes(aResId.SetRT(RSC_STRING));}
+
+};
+
+#define SFX_DEL_PTRARR(pArr) \
+ { \
+ for ( USHORT n = (pArr)->Count(); n--; ) \
+ delete (pArr)->GetObject(n); \
+ DELETEX(pArr); \
+ }
+
+class SfxBoolResetter
+{
+ BOOL& _rVar;
+ BOOL _bOld;
+
+public:
+ SfxBoolResetter( BOOL &rVar )
+ : _rVar( rVar ),
+ _bOld( rVar )
+ {}
+
+ ~SfxBoolResetter()
+ { _rVar = _bOld; }
+};
+
+#define GPF() *(int*)0 = 0
+
+#endif // #ifndef _SFX_SFXTYPES_HXX
+
+
diff --git a/sfx2/source/inc/slotserv.hxx b/sfx2/source/inc/slotserv.hxx
new file mode 100644
index 000000000000..ed184539c930
--- /dev/null
+++ b/sfx2/source/inc/slotserv.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: slotserv.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXSLOTSERV_HXX
+#define _SFXSLOTSERV_HXX
+
+#include <tools/solar.h>
+
+class SfxSlot;
+
+class SfxSlotServer
+{
+private:
+ const SfxSlot* _pSlot;
+ USHORT _nShellLevel;
+
+public:
+ SfxSlotServer( const SfxSlot &rSlot, USHORT nShell );
+ SfxSlotServer();
+
+ USHORT GetShellLevel() const;
+ void SetShellLevel(USHORT nLevel) { _nShellLevel = nLevel; }
+ void SetSlot(const SfxSlot* pSlot) {
+ _pSlot = pSlot;
+ }
+ const SfxSlot* GetSlot() const;
+ void Invalidate() { _pSlot = 0; }
+};
+
+//--------------------------------------------------------------------
+
+inline SfxSlotServer::SfxSlotServer( const SfxSlot &rSlot, USHORT nShell ):
+ _pSlot( &rSlot),
+ _nShellLevel( nShell )
+{
+}
+
+//--------------------------------------------------------------------
+
+inline SfxSlotServer::SfxSlotServer():
+ _pSlot(0),
+ _nShellLevel(0)
+{
+}
+
+//--------------------------------------------------------------------
+
+inline USHORT SfxSlotServer::GetShellLevel() const
+{
+ return _nShellLevel;
+}
+
+//--------------------------------------------------------------------
+
+inline const SfxSlot* SfxSlotServer::GetSlot() const
+{
+ return _pSlot;
+}
+
+
+#endif
diff --git a/sfx2/source/inc/speakerdlg.hxx b/sfx2/source/inc/speakerdlg.hxx
new file mode 100644
index 000000000000..1bde13d69def
--- /dev/null
+++ b/sfx2/source/inc/speakerdlg.hxx
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: speakerdlg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SPEAKERDLG_HXX
+#define _SPEAKERDLG_HXX
+
+#ifndef _GOODIES_RECOGNIZER_HXX_
+#include <goodies/recognizer.hxx>
+#endif
+
+#ifndef _DIALOG_HXX
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+
+// ---------------
+// - SfxSpeakerDlg -
+// ---------------
+
+class SfxSpeakerDlg: public ModalDialog
+{
+ OKButton aBtnOK;
+ CancelButton aBtnCancel;
+ ListBox aListBox;
+ CharSet aCharSet;
+
+ OSpeakerManagerRef m_aSpeakerMgr;
+
+public:
+
+ SfxSpeakerDlg(Window *pParent, OSpeakerManagerRef& aSpeakerMgr);
+ ~SfxSpeakerDlg();
+
+ virtual short Execute();
+};
+
+
+#endif // _SPEAKER_HXX
diff --git a/sfx2/source/inc/splitwin.hxx b/sfx2/source/inc/splitwin.hxx
new file mode 100644
index 000000000000..6f14af1018b7
--- /dev/null
+++ b/sfx2/source/inc/splitwin.hxx
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: splitwin.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:34 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXSPLITWIN_HXX
+#define _SFXSPLITWIN_HXX
+
+#ifndef _SPLITWIN_HXX //autogen
+#include <vcl/splitwin.hxx>
+#endif
+#include "childwin.hxx"
+
+class SfxWorkWindow;
+class SfxDockingWindow;
+class SfxDockArr_Impl;
+struct SfxDock_Impl;
+
+class SfxSplitWindow : public SplitWindow
+{
+friend class SfxEmptySplitWin_Impl;
+
+private:
+ SfxChildAlignment eAlign;
+ SfxWorkWindow* pWorkWin;
+ SfxDockArr_Impl* pDockArr;
+ BOOL bLocked;
+ BOOL bPinned;
+ SfxEmptySplitWin_Impl* pEmptyWin;
+ SfxDockingWindow* pActive;
+
+ void InsertWindow_Impl( SfxDock_Impl* pDockWin,
+ const Size& rSize,
+ USHORT nLine,
+ USHORT nPos,
+ BOOL bNewLine=FALSE );
+
+ DECL_LINK( TimerHdl, Timer* );
+ BOOL CursorIsOverRect( BOOL bForceAdding = FALSE ) const;
+ void SetPinned_Impl( BOOL );
+ void SetFadeIn_Impl( BOOL );
+
+protected:
+
+ virtual void StartSplit();
+ virtual void SplitResize();
+ virtual void Split();
+ virtual void Command ( const CommandEvent& rCEvt );
+ virtual void MouseButtonDown ( const MouseEvent& );
+ virtual BOOL QueryDrop( DropEvent& rEvt );
+
+public:
+ SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
+ SfxWorkWindow *pW, BOOL bWithButtons,
+ WinBits nBits = WB_BORDER | WB_SIZEABLE | WB_3DLOOK );
+
+ ~SfxSplitWindow();
+
+ void ReleaseWindow_Impl(SfxDockingWindow *pWin);
+
+ void InsertWindow( SfxDockingWindow* pDockWin,
+ const Size& rSize);
+
+ void InsertWindow( SfxDockingWindow* pDockWin,
+ const Size& rSize,
+ USHORT nLine,
+ USHORT nPos,
+ BOOL bNewLine=FALSE );
+
+ void MoveWindow( SfxDockingWindow* pDockWin,
+ const Size& rSize,
+ USHORT nLine,
+ USHORT nPos,
+ BOOL bNewLine=FALSE );
+
+ void RemoveWindow( SfxDockingWindow* pDockWin, BOOL bHide=TRUE);
+
+ void Lock( BOOL bLock=TRUE )
+ {
+ bLocked = bLock;
+ SetUpdateMode( !bLock );
+ }
+ BOOL IsLocked() const { return bLocked; }
+ BOOL GetWindowPos( const SfxDockingWindow* pWindow,
+ USHORT& rLine, USHORT& rPos ) const;
+ BOOL GetWindowPos( const Point& rTestPos,
+ USHORT& rLine, USHORT& rPos ) const;
+ USHORT GetLineCount() const;
+ long GetLineSize( USHORT ) const;
+ USHORT GetWindowCount(USHORT nLine) const;
+ USHORT GetWindowCount() const;
+
+ BOOL IsPinned() const { return bPinned; }
+ BOOL IsFadeIn() const;
+ BOOL IsAutoHide( BOOL bSelf = FALSE ) const;
+ SplitWindow* GetSplitWindow();
+ static void EndAutoShow_Impl();
+
+ virtual void AutoHide();
+ virtual void FadeOut();
+ virtual void FadeIn();
+ void Show_Impl();
+ void Pin_Impl( BOOL bPinned );
+ BOOL ActivateNextChild_Impl( BOOL bForward = TRUE );
+ void SetActiveWindow_Impl( SfxDockingWindow* pWin );
+};
+
+#endif // #ifndef _SFXSPLITWIN_HXX
+
+
diff --git a/sfx2/source/inc/statcach.hxx b/sfx2/source/inc/statcach.hxx
new file mode 100644
index 000000000000..dbf6bd6cffbe
--- /dev/null
+++ b/sfx2/source/inc/statcach.hxx
@@ -0,0 +1,220 @@
+/*************************************************************************
+ *
+ * $RCSfile: statcach.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXSTATCACH_HXX
+#define _SFXSTATCACH_HXX
+
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTOR_HPP_
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
+#include <com/sun/star/frame/XDispatch.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDER_HPP_
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XSTATUSLISTENER_HPP_
+#include <com/sun/star/frame/XStatusListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FRAMESEARCHFLAG_HPP_
+#include <com/sun/star/frame/FrameSearchFlag.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCHPROVIDERINTERCEPTION_HPP_
+#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_FEATURESTATEEVENT_HPP_
+#include <com/sun/star/frame/FeatureStateEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_FRAME_DISPATCHDESCRIPTOR_HPP_
+#include <com/sun/star/frame/DispatchDescriptor.hpp>
+#endif
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+
+#ifndef _SFXBINDINGS_HXX
+#include "bindings.hxx"
+#endif
+
+#ifndef _SFXMSGSERV_HXX
+#include "slotserv.hxx"
+#endif
+
+#include "sfxuno.hxx"
+
+class SfxControllerItem;
+class SfxDispatcher;
+class BindDispatch_Impl : public ::com::sun::star::frame::XStatusListener ,
+ public ::com::sun::star::lang::XTypeProvider ,
+ public ::cppu::OWeakObject
+{
+friend class SfxStateCache;
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDisp;
+ ::com::sun::star::util::URL aURL;
+ ::com::sun::star::frame::FeatureStateEvent aStatus;
+ SfxStateCache* pCache;
+
+public:
+ BindDispatch_Impl(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > & rDisp,
+ const ::com::sun::star::util::URL& rURL,
+ SfxStateCache* pStateCache );
+
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER
+
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ void Release();
+ const ::com::sun::star::frame::FeatureStateEvent& GetStatus() const;
+ void Dispatch( sal_Bool bForceSynchron = sal_False );
+};
+
+class SfxStateCache
+{
+friend class BindDispatch_Impl;
+ BindDispatch_Impl* pDispatch;
+ sal_uInt16 nId; // Slot-Id
+ SfxControllerItem* pController; // Ptr auf 1. gebundenen Controller (untereinander verkettet)
+ SfxSlotServer aSlotServ; // SlotServer, SlotPtr = 0 -> Nicht auf Stack
+ SfxPoolItem* pLastItem; // zuletzt verschicktes Item, nie -1
+ SfxItemState eLastState; // zuletzt verschickter State
+ sal_Bool bCtrlDirty:1; // Controller aktualisiert?
+ sal_Bool bSlotDirty:1; // Funktion gfs. vorhanden, muss aktualisiert werden
+ sal_Bool bItemDirty; // G"ultigkeit von pLastItem
+
+private:
+ SfxStateCache( const SfxStateCache& rOrig ); // n.i.
+ void SetState_Impl( SfxItemState, const SfxPoolItem * );
+ sal_Bool UpdateDispatch( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & xProv );
+
+public:
+ SfxStateCache( sal_uInt16 nFuncId );
+ ~SfxStateCache();
+
+ sal_uInt16 GetId() const;
+
+ const SfxSlotServer* GetSlotServer( SfxDispatcher &rDispat, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > & xProv );
+ const SfxSlotServer* GetSlotServer( SfxDispatcher &rDispat )
+ { return GetSlotServer( rDispat, ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProvider > () ); }
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > GetDispatch() const;
+ void Dispatch( sal_Bool bForceSynchron = sal_False );
+ sal_Bool IsControllerDirty() const
+ { return bCtrlDirty ? sal_True : sal_False; }
+ SfxPoolItem* GetItem() const { return pLastItem; }
+ void ClearCache();
+
+ void SetState( SfxItemState, const SfxPoolItem * );
+ void SetCachedState();
+ void DeleteFloatingWindows();
+ void Invalidate( sal_Bool bWithSlot );
+
+ SfxControllerItem* ChangeItemLink( SfxControllerItem* pNewBinding );
+ SfxControllerItem* GetItemLink() const;
+};
+
+//--------------------------------------------------------------------
+
+// checks wheather this function is in the stack of active SfxObjectInterface
+
+//inline sal_Bool SfxStateCache::IsCallable( SfxDispatcher &rDispat )
+//{
+// return GetSlotServer(rDispat) != 0;
+//}
+//--------------------------------------------------------------------
+
+// clears Cached-Item
+
+inline void SfxStateCache::ClearCache()
+{
+ bItemDirty = sal_True;
+}
+
+//--------------------------------------------------------------------
+
+// registeres a item representing this function
+
+inline SfxControllerItem* SfxStateCache::ChangeItemLink( SfxControllerItem* pNewBinding )
+{
+ SfxControllerItem* pOldBinding = pController;
+ pController = pNewBinding;
+ if ( pNewBinding )
+ {
+ bCtrlDirty = sal_True;
+ bItemDirty = sal_True;
+ }
+ return pOldBinding;
+}
+//--------------------------------------------------------------------
+
+// returns the func binding which becomes called on spreading states
+
+inline SfxControllerItem* SfxStateCache::GetItemLink() const
+{
+ return pController;
+}
+//--------------------------------------------------------------------
+
+inline sal_uInt16 SfxStateCache::GetId() const
+{
+ return nId;
+}
+
+#endif
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
new file mode 100644
index 000000000000..3e4bec379d46
--- /dev/null
+++ b/sfx2/source/inc/templdgi.hxx
@@ -0,0 +1,377 @@
+/*************************************************************************
+ *
+ * $RCSfile: templdgi.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_TEMPDLGI_HXX
+#define _SFX_TEMPDLGI_HXX
+
+class SfxTemplateControllerItem;
+
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _TOOLBOX_HXX //autogen
+#include <vcl/toolbox.hxx>
+#endif
+#ifndef _LSTBOX_HXX //autogen
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _SFXLSTNER_HXX //autogen
+#include <svtools/lstner.hxx>
+#endif
+#ifndef _SVTREEBOX_HXX //autogen
+#include <svtools/svtreebx.hxx>
+#endif
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+
+#define _SVSTDARR_USHORTS
+#include <svtools/svstdarr.hxx> // SvUShorts
+
+#include <rsc/rscsfx.hxx>
+#include <tools/rtti.hxx>
+
+#include "childwin.hxx"
+#include "templdlg.hxx"
+
+class SfxStyleFamilies;
+class SfxStyleFamilyItem;
+class SfxTemplateItem;
+class SfxBindings;
+class SfxStyleSheetBasePool;
+class SvTreeListBox ;
+class StyleTreeListBox_Impl;
+class SfxTemplateDialog_Impl;
+class SfxCommonTemplateDialog_Impl;
+class SfxTemplateDialogWrapper;
+class SfxDockingWindow;
+
+// class DropListBox_Impl ------------------------------------------------
+
+class DropListBox_Impl : public SvTreeListBox
+{
+protected:
+ SvLBoxEntry* pPreDropEntry;
+ SfxCommonTemplateDialog_Impl* pDialog;
+ USHORT nModifier;
+
+public:
+ DropListBox_Impl( Window* pParent, const ResId& rId, SfxCommonTemplateDialog_Impl* pD ) :
+ SvTreeListBox( pParent, rId ), pDialog( pD ), pPreDropEntry( NULL )
+ { EnableDrop( TRUE ); }
+ DropListBox_Impl( Window* pParent, WinBits nWinBits, SfxCommonTemplateDialog_Impl* pD ) :
+ SvTreeListBox( pParent, nWinBits ), pDialog( pD ), pPreDropEntry( NULL )
+ { EnableDrop( TRUE ); }
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual BOOL Drop( const DropEvent& rEvt );
+ virtual BOOL QueryDrop( DropEvent& rEvt );
+
+ USHORT GetModifier() const { return nModifier; }
+ SvLBoxEntry* GetPreDropEntry() const { return pPreDropEntry; }
+};
+
+// class SfxActionListBox ------------------------------------------------
+
+class SfxActionListBox : public DropListBox_Impl
+{
+protected:
+ virtual void Command( const CommandEvent& rMEvt );
+
+public:
+ SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent, WinBits nWinBits );
+ SfxActionListBox( SfxCommonTemplateDialog_Impl* pParent, const ResId &rResId );
+};
+
+// class SfxCommonTemplateDialog_Impl ------------------------------------
+
+class SfxCommonTemplateDialog_Impl : public SfxListener
+{
+private:
+ class ISfxTemplateCommon_Impl : public ISfxTemplateCommon
+ {
+ private:
+ SfxCommonTemplateDialog_Impl* pDialog;
+ public:
+ ISfxTemplateCommon_Impl( SfxCommonTemplateDialog_Impl* pDialogP ) : pDialog( pDialogP ) {}
+ virtual SfxStyleFamily GetActualFamily() const { return pDialog->GetActualFamily(); }
+ virtual String GetSelectedEntry() const { return pDialog->GetSelectedEntry(); }
+ };
+
+ ISfxTemplateCommon_Impl aISfxTemplateCommon;
+
+ void ReadResource();
+ void ClearResource();
+
+protected:
+#define MAX_FAMILIES 5
+#define COUNT_BOUND_FUNC 13
+
+#define UPDATE_FAMILY_LIST 0x0001
+#define UPDATE_FAMILY 0x0002
+
+ friend class DropListBox_Impl;
+ friend class SfxTemplateControllerItem;
+ friend class SfxTemplateDialogWrapper;
+
+ SfxBindings* pBindings;
+ SfxTemplateControllerItem* pBoundItems[COUNT_BOUND_FUNC];
+
+ Window* pWindow;
+ SfxModule* pModule;
+ Timer* pTimer;
+
+ SfxStyleFamilies* pStyleFamilies;
+ SfxTemplateItem* pFamilyState[MAX_FAMILIES];
+ SfxStyleSheetBasePool* pStyleSheetPool;
+ SvTreeListBox* pTreeBox;
+ SfxObjectShell* pCurObjShell;
+
+ SfxActionListBox aFmtLb;
+ ListBox aFilterLb;
+ Size aSize;
+
+ USHORT nActFamily; // Id in der ToolBox = Position - 1
+ USHORT nActFilter; // FilterIdx
+ USHORT nAppFilter; // Filter, den die Applikation gesetzt hat (fuer automatisch)
+
+ BOOL bDontUpdate :1,
+ bIsWater :1,
+ bEnabled :1,
+ bUpdate :1,
+ bUpdateFamily :1,
+ bCanEdit :1,
+ bCanDel :1,
+ bCanNew :1,
+ bWaterDisabled :1,
+ bNewByExampleDisabled :1,
+ bUpdateByExampleDisabled:1,
+ bTreeDrag :1,
+ bHierarchical :1,
+ bBindingUpdate :1;
+
+ DECL_LINK( FilterSelectHdl, ListBox * );
+ DECL_LINK( FmtSelectHdl, SvTreeListBox * );
+ DECL_LINK( ApplyHdl, Control * );
+ DECL_LINK( DropHdl, StyleTreeListBox_Impl * );
+ DECL_LINK( TimeOut, Timer * );
+
+ // Rechnet von den SFX_STYLE_FAMILY Ids auf 1-5 um
+ static USHORT SfxFamilyIdToNId( USHORT nFamily );
+
+ virtual void EnableItem( USHORT nMesId, BOOL bCheck = TRUE ) {}
+ virtual void CheckItem( USHORT nMesId, BOOL bCheck = TRUE ) {}
+ virtual BOOL IsCheckedItem( USHORT nMesId ) { return TRUE; }
+ virtual void Resize() {}
+ virtual void Update() { UpdateStyles_Impl(UPDATE_FAMILY_LIST); }
+ virtual void InvalidateBindings();
+ virtual void InsertFamilyItem( USHORT nId, const SfxStyleFamilyItem* pIten ) = 0;
+ virtual void EnableFamilyItem( USHORT nId, BOOL bEnabled = TRUE ) = 0;
+ virtual void ClearFamilyList() = 0;
+
+ void NewHdl( void* );
+ void EditHdl( void* );
+ void DeleteHdl( void* );
+
+ BOOL Execute_Impl( USHORT nId, const String& rStr, const String& rRefStr,
+ USHORT nFamily, USHORT nMask = 0,
+ USHORT* pIdx = NULL, const USHORT* pModifier = NULL );
+
+ void UpdateStyles_Impl(USHORT nFlags);
+ const SfxStyleFamilyItem* GetFamilyItem_Impl() const;
+ BOOL IsInitialized() { return nActFamily != 0xffff; }
+ void ResetFocus();
+ void EnableDelete();
+ void Initialize();
+
+ void FilterSelect( USHORT nFilterIdx, BOOL bForce = FALSE );
+ void SetFamilyState( USHORT nSlotId, const SfxTemplateItem* );
+ void SetWaterCanState( const SfxBoolItem* pItem );
+
+ void SelectStyle( const String& rStyle );
+ BOOL HasSelectedStyle() const;
+ void FillTreeBox();
+ void Update_Impl();
+ void UpdateFamily_Impl();
+
+ // In welchem FamilyState muss ich nachsehen, um die Info der i-ten
+ // Family in der pStyleFamilies zu bekommen.
+ USHORT StyleNrToInfoOffset( USHORT i );
+ USHORT InfoOffsetToStyleNr( USHORT i );
+
+ void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType );
+
+ void FamilySelect( USHORT nId );
+ void SetFamily( USHORT nId );
+ void ActionSelect( USHORT nId );
+
+public:
+ TYPEINFO();
+
+ SfxCommonTemplateDialog_Impl( SfxBindings* pB, SfxDockingWindow* );
+ SfxCommonTemplateDialog_Impl( SfxBindings* pB, ModalDialog* );
+ ~SfxCommonTemplateDialog_Impl();
+
+ DECL_LINK( MenuSelectHdl, Menu * );
+
+ virtual void EnableEdit( BOOL b = TRUE ) { bCanEdit = b; }
+ virtual void EnableDel( BOOL b = TRUE ) { bCanDel = b; }
+ virtual void EnableNew( BOOL b = TRUE ) { bCanNew = b; }
+
+ ISfxTemplateCommon* GetISfxTemplateCommon() { return &aISfxTemplateCommon; }
+ Window* GetWindow() { return pWindow; }
+
+ void EnableTreeDrag( BOOL b = TRUE );
+ void ExecuteContextMenu_Impl( const Point& rPos, Window* pWin );
+ void EnableExample_Impl( USHORT nId, BOOL bEnable );
+ SfxStyleFamily GetActualFamily() const;
+ String GetSelectedEntry() const;
+ SfxObjectShell* GetObjectShell() const { return pCurObjShell; }
+};
+
+// class SfxTemplateDialog_Impl ------------------------------------------
+
+class SfxTemplateDialog_Impl : public SfxCommonTemplateDialog_Impl
+{
+private:
+ friend class SfxTemplateControllerItem;
+ friend class SfxTemplateDialogWrapper;
+
+ SfxTemplateDialog* pFloat;
+ BOOL bZoomIn;
+ ToolBox aActionTbL;
+ ToolBox aActionTbR;
+
+ DECL_LINK( ToolBoxLSelect, ToolBox * );
+ DECL_LINK( ToolBoxRSelect, ToolBox * );
+
+protected:
+ virtual void Command( const CommandEvent& rMEvt );
+ virtual void EnableEdit( BOOL = TRUE );
+ virtual void EnableItem( USHORT nMesId, BOOL bCheck = TRUE );
+ virtual void CheckItem( USHORT nMesId, BOOL bCheck = TRUE );
+ virtual BOOL IsCheckedItem( USHORT nMesId );
+ virtual void InsertFamilyItem( USHORT nId, const SfxStyleFamilyItem* pIten );
+ virtual void EnableFamilyItem( USHORT nId, BOOL bEnabled = TRUE );
+ virtual void ClearFamilyList();
+
+ void Resize();
+ Size GetMinOutputSizePixel();
+
+public:
+ friend class SfxTemplateDialog;
+ TYPEINFO();
+
+ SfxTemplateDialog_Impl( Window* pParent, SfxBindings*, SfxTemplateDialog* pWindow );
+ ~SfxTemplateDialog_Impl();
+};
+
+// class SfxTemplateCatalog_Impl -----------------------------------------
+
+class SfxTemplateCatalog_Impl : public SfxCommonTemplateDialog_Impl
+{
+private:
+ friend class SfxTemplateControllerItem;
+ friend class SfxCommonTemplateDialog_Impl;
+
+ ListBox aFamList;
+ OKButton aOkBtn;
+ CancelButton aCancelBtn;
+ PushButton aNewBtn;
+ PushButton aChangeBtn;
+ PushButton aDelBtn;
+ PushButton aOrgBtn;
+ HelpButton aHelpBtn;
+
+ SfxTemplateCatalog* pReal;
+ SvUShorts aFamIds;
+ SfxModalDefParentHelper aHelper;
+
+protected:
+ virtual void EnableItem( USHORT nMesId, BOOL bCheck = TRUE );
+ virtual void CheckItem( USHORT nMesId, BOOL bCheck = TRUE );
+ virtual BOOL IsCheckedItem( USHORT nMesId );
+ virtual void InsertFamilyItem( USHORT nId, const SfxStyleFamilyItem* pIten );
+ virtual void EnableFamilyItem( USHORT nId, BOOL bEnabled = TRUE );
+ virtual void ClearFamilyList();
+ virtual void EnableEdit( BOOL = TRUE );
+ virtual void EnableDel( BOOL = TRUE );
+ virtual void EnableNew( BOOL = TRUE );
+
+ DECL_LINK( FamListSelect, ListBox * );
+ DECL_LINK( OkHdl, Button * );
+ DECL_LINK( CancelHdl, Button * );
+ DECL_LINK( NewHdl, Button * );
+ DECL_LINK( ChangeHdl, Button * );
+ DECL_LINK( DelHdl, Button * );
+ DECL_LINK( OrgHdl, Button * );
+
+public:
+ TYPEINFO();
+ SfxTemplateCatalog_Impl( Window* pParent, SfxBindings*, SfxTemplateCatalog* pWindow );
+ ~SfxTemplateCatalog_Impl();
+
+friend class SfxTemplateCatalog;
+};
+
+#endif // #ifndef _SFX_TEMPDLGI_HXX
+
+
diff --git a/sfx2/source/inc/tplcitem.hxx b/sfx2/source/inc/tplcitem.hxx
new file mode 100644
index 000000000000..eaaeaee84147
--- /dev/null
+++ b/sfx2/source/inc/tplcitem.hxx
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: tplcitem.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _TPLCITEM_HXX
+#define _TPLCITEM_HXX
+
+#include "ctrlitem.hxx"
+
+class SfxCommonTemplateDialog_Impl;
+
+class SfxTemplateControllerItem: public SfxControllerItem {
+ SfxCommonTemplateDialog_Impl &rTemplateDlg;
+protected:
+ virtual void StateChanged( USHORT, SfxItemState, const SfxPoolItem* pState );
+
+public:
+ SfxTemplateControllerItem( USHORT nId, SfxCommonTemplateDialog_Impl &rDlg, SfxBindings &);
+};
+
+
+#endif
diff --git a/sfx2/source/inc/tplcomp.hxx b/sfx2/source/inc/tplcomp.hxx
new file mode 100644
index 000000000000..f6d1879d92c3
--- /dev/null
+++ b/sfx2/source/inc/tplcomp.hxx
@@ -0,0 +1,313 @@
+/*************************************************************************
+ *
+ * $RCSfile: tplcomp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TPLCOMP_HXX
+#define _TPLCOMP_HXX
+
+#include <osl/mutex.hxx>
+//ASDBG #ifndef _USR_UNO_HXX
+//ASDBG #include <usr/uno.hxx>
+//ASDBG #endif
+//ASDBG #ifndef _USR_LSTCOMP_HXX
+//ASDBG #include <usr/iterhlp.hxx>
+//ASDBG #endif
+//ASDBG #ifndef _USR_SERVICES_HXX
+//ASDBG #include <usr/services.hxx>
+//ASDBG #endif
+#ifndef _DTRANS_HXX
+#include <so3/dtrans.hxx>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_XCOMMANDEXECUTOR_HPP_
+#include <com/sun/star/chaos/XCommandExecutor.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_XSTATUSCALLBACK_HPP_
+#include <com/sun/star/chaos/XStatusCallback.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_UNKNOWNCOMMANDEXCEPTION_HPP_
+#include <com/sun/star/chaos/UnknownCommandException.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_STATUSCALLBACKEVENT_HPP_
+#include <com/sun/star/chaos/StatusCallbackEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_XURLCONTENT_HPP_
+#include <com/sun/star/chaos/XURLContent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_XEXPLOREREXCHANGE_HPP_
+#include <com/sun/star/chaos/XExplorerExchange.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_
+#include <com/sun/star/beans/PropertyValues.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
+#include <com/sun/star/beans/PropertyValue.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATE_HPP_
+#include <com/sun/star/beans/PropertyState.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include <com/sun/star/beans/XPropertySetInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_
+#include <com/sun/star/beans/XMultiPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XFASTPROPERTYSET_HPP_
+#include <com/sun/star/beans/XFastPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XVETOABLECHANGELISTENER_HPP_
+#include <com/sun/star/beans/XVetoableChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
+#include <com/sun/star/beans/XPropertyState.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATECHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTIESCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertiesChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCHANGELISTENER_HPP_
+#include <com/sun/star/beans/XPropertyChangeListener.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYCONTAINER_HPP_
+#include <com/sun/star/beans/XPropertyContainer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYSTATECHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYCHANGEEVENT_HPP_
+#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_
+#include <cppuhelper/interfacecontainer.hxx>
+#endif
+
+class CntAnchor;
+
+class TplAnchorListener;
+
+// -----------------
+// - TplComponent -
+// -----------------
+
+class TplComponent : public ::com::sun::star::chaos::XURLContent, public ::com::sun::star::chaos::XCommandExecutor,
+ public ::com::sun::star::beans::XPropertySet, public ::com::sun::star::chaos::XExplorerExchange,
+ public ::cppu::OWeakObject, public ::com::sun::star::lang::XServiceInfo
+{
+private:
+
+ void HandleNewEvt( const ::rtl::OUString& rCommand,
+ const ::com::sun::star::uno::Any& rAny );
+ void CreatePopupMenu( ::com::sun::star::uno::Any& rAny ) const;
+
+protected:
+
+ ::rtl::OUString maURL;
+ ::rtl::OUString maName;
+ ::osl::Mutex aMutex;
+ ::cppu::OInterfaceContainerHelper maListeners;
+ TplAnchorListener* mpListener;
+ short mnOpenMode;
+
+public:
+
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO
+
+ TplComponent();
+ ~TplComponent();
+
+ // interface ::com::sun::star::ucb::XContent
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent() throw ( ::com::sun::star::uno::RuntimeException )
+ { ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > aRef; return aRef; }
+ virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Parent ) throw ( ::com::sun::star::uno::RuntimeException )
+ {}
+
+ // interface ::com::sun::star::chaos::XURLContent
+ virtual ::rtl::OUString SAL_CALL getURL() throw ( ::com::sun::star::uno::RuntimeException )
+ { return maURL; }
+ virtual sal_Bool SAL_CALL initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XURLContent > & aParent, const ::rtl::OUString& aURL ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // interface ::com::sun::star::chaos::XCommandExecutor
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL queryCommands() throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL cancel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rCommandId ) throw ( ::com::sun::star::uno::RuntimeException )
+ {}
+ virtual void SAL_CALL execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Any& rArgs,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XStatusCallback > & rCallback ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // interface ::com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& aPropertyName ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener > & aListener ) throw ( ::com::sun::star::uno::RuntimeException );
+ // interface ::com::sun::star::chaos::XExplorerExchange
+ virtual ::com::sun::star::uno::Any SAL_CALL createDataObject( sal_uInt16& nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_uInt16 SAL_CALL insertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr,
+ sal_uInt16 nUserAction,
+ sal_uInt16 nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL queryInsertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr,
+ sal_uInt16 nUserAction,
+ sal_uInt16 nSourceOptions,
+ sal_uInt16& nResultingAction,
+ sal_uInt16& nDefaultAction ) throw ( ::com::sun::star::uno::RuntimeException );
+
+
+ // -------------------------------------------------------------
+
+ void CreateNewChild( CntAnchor* pAnchor,
+ const String& rTitle );
+ void RemoveChild( CntAnchor* pAnchor );
+ void StopListening( CntAnchor* pAnchor );
+ void HandleOpenEvt();
+};
+
+// ------------------------
+// - TplContentsComponent -
+// ------------------------
+
+class TplContentsListener;
+
+class TplContentsComponent : public TplComponent
+{
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XURLContent > _xParent;
+ TplContentsListener* _pListener;
+ SvDataObjectRef _xObject;
+ sal_uInt16 _nLayout;
+
+ void HandleOpenEvt( const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XStatusCallback > & rJob,
+ const ::com::sun::star::chaos::StatusCallbackEvent& rEvt );
+ void HandleNewEvt( const ::rtl::OUString& rCommand,
+ const ::com::sun::star::uno::Any& rAny );
+ void HandleInitEvt();
+
+ void CreateFileName( String& rName,
+ String& rDirURL );
+ void CreateNewTpl( const String& rFilter,
+ const String& rParentDir,
+ const String& rFileName,
+ const String& rDocName );
+protected:
+
+ void CreatePopupMenu( ::com::sun::star::uno::Any& rAny ) const;
+
+public:
+
+ SFX_DECL_XINTERFACE_XTYPEPROVIDER_XSERVICEINFO
+
+ TplContentsComponent();
+ ~TplContentsComponent();
+
+ virtual sal_Bool SAL_CALL initialize( const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XURLContent > & aParent, const ::rtl::OUString& aURL ) throw ( ::com::sun::star::uno::RuntimeException );
+
+
+ // interface ::com::sun::star::chaos::XCommandExecutor
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL queryCommands() throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL execute( const ::rtl::OUString& rCommand, const ::com::sun::star::uno::Any& rArgs,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chaos::XStatusCallback > & rCallback ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // interface ::com::sun::star::beans::XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw ( ::com::sun::star::uno::RuntimeException );
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& aPropertyName ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // interface ::com::sun::star::chaos::XExplorerExchange
+ virtual ::com::sun::star::uno::Any SAL_CALL createDataObject( sal_uInt16& nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_uInt16 SAL_CALL insertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr,
+ sal_uInt16 nUserAction,
+ sal_uInt16 nSourceOptions ) throw ( ::com::sun::star::uno::RuntimeException );
+ virtual sal_Bool SAL_CALL queryInsertDataObject( const ::com::sun::star::uno::Any& pSotDataObjectPtr,
+ sal_uInt16 nUserAction,
+ sal_uInt16 nSourceOptions,
+ sal_uInt16& nResultingAction,
+ sal_uInt16& nDefaultAction ) throw ( ::com::sun::star::uno::RuntimeException );
+
+ // -------------------------------------------------------------
+
+ void CreateNewChild( CntAnchor* pAnchor );
+ void HandleDeleteEvt();
+ void SetURL( const ::rtl::OUString& rURL);
+ void SetName( const ::rtl::OUString& rNewName );
+};
+
+
+#endif
+
diff --git a/sfx2/source/inc/versdlg.hxx b/sfx2/source/inc/versdlg.hxx
new file mode 100644
index 000000000000..0bf6cdfdd6fc
--- /dev/null
+++ b/sfx2/source/inc/versdlg.hxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: versdlg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _VERSDLG_HXX
+#define _VERSDLG_HXX
+
+// #include *****************************************************************
+
+#ifndef _BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SVTREEBOX_HXX //autogen
+#include <svtools/svtabbx.hxx>
+#endif
+#ifndef _SV_GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+#ifndef _SVEDIT_HXX //autogen
+#include <svtools/svmedit.hxx>
+#endif
+#include "basedlgs.hxx"
+
+class SfxObjectShell;
+struct SfxVersionInfo;
+
+class SfxVersionsTabListBox_Impl : public SvTabListBox
+{
+ virtual void KeyInput( const KeyEvent& rKeyEvent );
+
+public:
+ SfxVersionsTabListBox_Impl(
+ Window* pParent, const ResId& );
+};
+
+class SfxVersionDialog : public SfxModalDialog
+{
+ GroupBox aNewGroup;
+ PushButton aSaveButton;
+ CheckBox aSaveCheckBox;
+ GroupBox aExistingGroup;
+ FixedText aDateTimeText;
+ FixedText aSavedByText;
+ FixedText aCommentText;
+ SfxVersionsTabListBox_Impl aVersionBox;
+ PushButton aCloseButton;
+ PushButton aOpenButton;
+ PushButton aViewButton;
+ PushButton aDeleteButton;
+ PushButton aCompareButton;
+ HelpButton aHelpButton;
+ SfxViewFrame* pViewFrame;
+
+ DECL_LINK( DClickHdl_Impl, Control* );
+ DECL_LINK( SelectHdl_Impl, Control* );
+ DECL_LINK( ButtonHdl_Impl, Button* );
+ void Init_Impl();
+ void Open_Impl();
+
+public:
+ SfxVersionDialog ( SfxViewFrame* pFrame,
+ Window *pParent );
+ virtual ~SfxVersionDialog ();
+};
+
+class SfxViewVersionDialog_Impl : public SfxModalDialog
+{
+ FixedText aDateTimeText;
+ FixedText aSavedByText;
+ MultiLineEdit aEdit;
+ OKButton aOKButton;
+ CancelButton aCancelButton;
+ PushButton aCloseButton;
+ HelpButton aHelpButton;
+ SfxVersionInfo* pInfo;
+
+ DECL_LINK( ButtonHdl, Button* );
+
+public:
+ SfxViewVersionDialog_Impl( Window *pParent,
+ SfxVersionInfo& rInfo, BOOL bEdit );
+};
+
+#endif
diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx
new file mode 100644
index 000000000000..df2e96c692bb
--- /dev/null
+++ b/sfx2/source/inc/virtmenu.hxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: virtmenu.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXVIRTMENU_HXX
+#define _SFXVIRTMENU_HXX
+
+
+#ifndef _SVARRAY_HXX //autogen
+#include <svtools/svarray.hxx>
+#endif
+#ifndef _SFXMNUITEM_HXX
+#include "mnuitem.hxx"
+#endif
+
+#ifndef _SFXMNUCFGA_HXX
+#include "mnucfga.hxx"
+#endif
+
+class SfxBindings;
+class Timer;
+
+SV_DECL_PTRARR_DEL( SfxMenuCtrlArr_Impl, SfxMenuControl*, 2, 2 );
+
+class SfxVirtualMenu
+{
+friend class SfxMenuControl;
+
+private:
+ Menu* pSVMenu;
+ SfxVirtualMenu* pParent;
+ SfxMenuCtrlArr_Impl* pAppCtrl;
+ SfxMenuControl* pItems;
+ SfxBindings* pBindings;
+ ResMgr* pResMgr;
+ PopupMenu* pWindowMenu;
+ PopupMenu* pPickMenu;
+ Timer* pAutoDeactivate; // Hack fuer QAP-Bug
+ USHORT nVisibleItems;
+ USHORT nId;
+ USHORT nCount;
+ USHORT nLocks;
+ BOOL bResCtor : 1; // SV Menu created from resource
+ BOOL bOLE : 1; // InPlaceMenu
+ BOOL bHelpInitialized : 1;
+ BOOL bIsActive : 1;
+ BOOL bControllersUnBound : 1;
+ BOOL bRemoveDisabledEntries: 1;
+
+private:
+ void Construct_Impl();
+ FASTBOOL Bind_Impl( Menu *pMenu );
+ inline SfxMenuCtrlArr_Impl& GetAppCtrl_Impl()
+ {
+ return pAppCtrl? *pAppCtrl: *(pAppCtrl = new SfxMenuCtrlArr_Impl) ;
+ }
+ void UnbindControllers();
+ void BindControllers();
+
+protected:
+ SfxVirtualMenu( USHORT nOwnId, SfxVirtualMenu* pParent, Menu& rMenu, BOOL bWithHelp,
+ SfxBindings &rBind, BOOL bOLEServer=FALSE, BOOL bRes=FALSE );
+
+ void CreateFromSVMenu();
+ DECL_LINK( Highlight, Menu * );
+ DECL_LINK( Activate, Menu * );
+ DECL_LINK( Deactivate, Menu * );
+ DECL_LINK( Select, Menu * );
+
+public:
+ ~SfxVirtualMenu();
+ SfxVirtualMenu( Menu *pStarViewMenu, BOOL bWithHelp,
+ SfxBindings &rBind, BOOL bOLEServer=FALSE, BOOL bRes=FALSE );
+ void CheckItem( USHORT nItemId, BOOL bCheck );
+ void EnableItem( USHORT nItemId, BOOL bEnable );
+ void SetItemText( USHORT nItemId, const String& rText );
+
+ USHORT GetItemPos( USHORT nItemId ) const;
+
+ USHORT GetItemCount() const;
+ Menu* GetSVMenu() const;
+ SfxMenuControl& operator[]( USHORT nPos ) const;
+ USHORT GetItemId( USHORT nPos ) const;
+ SfxVirtualMenu* GetPopupMenu( USHORT nId ) const;
+ SfxVirtualMenu* GetParentMenu() const { return pParent; }
+ void SetParentMenu( SfxVirtualMenu* pNewParent )
+ { pParent = pNewParent; }
+ String GetItemText( USHORT nId ) const;
+ String GetItemHelpText( USHORT nId ) const;
+ void InvalidateKeyCodes();
+
+ void SetPopupMenu( USHORT nId, PopupMenu *pMenu );
+ BOOL IsFromResource() const
+ { return bResCtor; }
+ void InitPopup(USHORT nPos, BOOL bOLE = TRUE);
+ void InitializeHelp();
+ void SetResMgr(ResMgr* pMgr) {pResMgr = pMgr; }
+ ResMgr* GetResMgr() { return pResMgr; }
+ void SetHelpIds( ResMgr* );
+ void RemoveDisabledEntries();
+ void SetRemoveDisabledEntries();
+};
+
+//--------------------------------------------------------------------
+
+// return the number of virtual items in this menu
+
+inline USHORT SfxVirtualMenu::GetItemCount() const
+{
+ return nCount;
+}
+//--------------------------------------------------------------------
+
+//
+
+inline SfxMenuControl& SfxVirtualMenu::operator[]( USHORT nPos ) const
+{
+ return *(pItems+nPos);
+}
+//--------------------------------------------------------------------
+
+// returns the item id at position nPos in the menu (or 0 if sep.)
+
+inline USHORT SfxVirtualMenu::GetItemId( USHORT nPos ) const
+{
+ return pItems ? pItems[nPos].GetId() : 0;
+}
+
+
+#endif
diff --git a/sfx2/source/inc/workwin.hxx b/sfx2/source/inc/workwin.hxx
new file mode 100644
index 000000000000..5f6141d697cd
--- /dev/null
+++ b/sfx2/source/inc/workwin.hxx
@@ -0,0 +1,400 @@
+/*************************************************************************
+ *
+ * $RCSfile: workwin.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXWORKWIN_HXX
+#define _SFXWORKWIN_HXX
+
+#ifndef _COM_SUN_STAR_FRAME_XDISPATCH_HPP_
+#include <com/sun/star/frame/XDispatch.hpp>
+#endif
+
+#define _SVSTDARR_USHORTS
+#include <svtools/svstdarr.hxx> // SvUShorts
+
+#ifndef _IFACE_HXX //autogen
+#include <so3/iface.hxx>
+#endif
+
+#include "sfx.hrc"
+#include "childwin.hxx"
+#include "shell.hxx"
+#include "minarray.hxx"
+#include "ctrlitem.hxx"
+
+class SfxToolBoxManager;
+class SfxInPlaceEnv_Impl;
+class SfxPlugInEnv_Impl;
+class SfxSplitWindow;
+class SfxWorkWindow;
+class XDispatch;
+
+//====================================================================
+// Dieser struct h"alt alle relevanten Informationen "uber Toolboxen bereit.
+
+struct SfxObjectBar_Impl
+{
+ USHORT nId; // Resource - und ConfigId der Toolbox
+ USHORT nMode; // spezielle Sichtbarkeitsflags
+ SfxToolBoxManager* pTbx;
+ String aName;
+ ResMgr* pResMgr;
+ SfxInterface* pIFace;
+
+ SfxObjectBar_Impl() :
+ nId(0),
+ nMode(0),
+ pTbx(0),
+ pResMgr(0),
+ pIFace(0)
+ {}
+};
+
+//------------------------------------------------------------------------------
+// Dieser struct h"alt alle relevanten Informationen "uber die Statuszeile bereit.
+struct SfxStatBar_Impl
+{
+ ResMgr* pResMgr;
+ SfxShell* pShell;
+ SfxBindings* pBindings;
+ USHORT nId;
+ SfxStatusBarManager* pStatusBar;
+ BOOL bOn;
+ BOOL bTemp;
+
+ SfxStatBar_Impl() :
+ nId(0),
+ pResMgr(0),
+ pShell(0),
+ pBindings(0),
+ pStatusBar(0),
+ bOn(TRUE),
+ bTemp(FALSE)
+ {}
+};
+
+//------------------------------------------------------------------------------
+
+#define CHILD_NOT_VISIBLE 0
+#define CHILD_ACTIVE 1 // nicht durch HidePopups ausgeschaltet
+#define CHILD_NOT_HIDDEN 2 // nicht durch HideChildWindow ausgeschaltet
+#define CHILD_FITS_IN 4 // nicht zu gro\s f"ur OutputSize des parent
+#define CHILD_VISIBLE (CHILD_NOT_HIDDEN | CHILD_ACTIVE | CHILD_FITS_IN)
+#define CHILD_ISVISIBLE (CHILD_NOT_HIDDEN | CHILD_ACTIVE)
+
+struct SfxChild_Impl
+{
+ Window* pWin;
+ Size aSize;
+ SfxChildAlignment eAlign;
+ USHORT nVisible;
+ BOOL bResize;
+ BOOL bCanGetFocus;
+
+ SfxChild_Impl( Window& rChild, const Size& rSize,
+ SfxChildAlignment eAlignment, BOOL bIsVisible ):
+ pWin(&rChild), aSize(rSize), eAlign(eAlignment), bResize(FALSE),
+ bCanGetFocus( FALSE )
+ {
+ nVisible = bIsVisible ? CHILD_VISIBLE : CHILD_NOT_VISIBLE;
+ }
+};
+
+//--------------------------------------------------------------------
+class SfxChildWinController_Impl : public SfxControllerItem
+{
+ SfxWorkWindow* pWorkwin;
+
+ public:
+ SfxChildWinController_Impl( USHORT nId, SfxWorkWindow *pWin );
+ virtual void StateChanged( USHORT nSID, SfxItemState eState,
+ const SfxPoolItem* pState );
+};
+
+struct SfxChildWin_Impl
+{
+ USHORT nSaveId; // die ChildWindow-Id
+ USHORT nInterfaceId; // der aktuelle Context
+ USHORT nId; // aktuelle Id
+ SfxChildWindow* pWin;
+ BOOL bCreate;
+ SfxChildWinInfo aInfo;
+ SfxChild_Impl* pCli; // != 0 bei direkten Children
+ USHORT nVisibility;
+ BOOL bEnable;
+ SfxChildWinController_Impl* pControl;
+ BOOL bDisabled;
+
+ SfxChildWin_Impl( ULONG nID ) :
+ nSaveId((USHORT) (nID & 0xFFFF) ),
+ nInterfaceId((USHORT) (nID >> 16)),
+ nId(nSaveId),
+ pWin(0),
+ bCreate(FALSE),
+ pCli(0),
+ nVisibility( FALSE ),
+ bEnable( TRUE ),
+ bDisabled( FALSE ),
+ pControl( 0 )
+ {}
+};
+
+enum SfxChildIdentifier
+{
+ SFX_CHILDWIN_STATBAR,
+ SFX_CHILDWIN_OBJECTBAR,
+ SFX_CHILDWIN_DOCKINGWINDOW,
+ SFX_CHILDWIN_SPLITWINDOW
+};
+
+enum SfxDockingConfig
+{
+ SFX_SETDOCKINGRECTS,
+ SFX_ALIGNDOCKINGWINDOW,
+ SFX_TOGGLEFLOATMODE,
+ SFX_MOVEDOCKINGWINDOW
+};
+
+DECL_PTRARRAY( SfxChildList_Impl, SfxChild_Impl*, 2, 2 );
+DECL_PTRARRAY( SfxChildWindows_Impl, SfxChildWin_Impl*, 2, 2 );
+
+SV_DECL_OBJARR( SfxObjectBarArr_Impl, SfxObjectBar_Impl, 1, 2 );
+
+struct SfxObjectBarList_Impl
+{
+ SfxObjectBarArr_Impl aArr;
+ USHORT nAct;
+
+ SfxObjectBar_Impl operator[] ( USHORT n )
+ { return aArr[n]; }
+ SfxObjectBar_Impl Actual()
+ { return aArr[nAct]; }
+};
+
+struct SfxSplitWin_Impl
+{
+ SfxSplitWindow* pSplitWin;
+ SfxChildWindows_Impl* pChildWins;
+};
+
+#define SFX_SPLITWINDOWS_LEFT 0
+#define SFX_SPLITWINDOWS_TOP 2
+#define SFX_SPLITWINDOWS_RIGHT 1
+#define SFX_SPLITWINDOWS_BOTTOM 3
+#define SFX_SPLITWINDOWS_MAX 4
+
+//--------------------------------------------------------------------
+
+class SfxWorkWindow
+{
+protected:
+ SfxStatBar_Impl aStatBar;
+ SfxWorkWindow* pParent;
+ SvUShorts aSortedList;
+ SfxObjectBar_Impl aObjBars[SFX_OBJECTBAR_MAX];
+ SfxObjectBarList_Impl aObjBarLists[SFX_OBJECTBAR_MAX];
+ SfxSplitWindow* pSplit[SFX_SPLITWINDOWS_MAX];
+ SfxChildList_Impl* pChilds;
+ SfxChildWindows_Impl* pChildWins;
+ SfxBindings* pBindings;
+ Window* pWorkWin;
+ USHORT nUpdateMode;
+ USHORT nChilds;
+ BOOL bSorted;
+ USHORT nOrigMode;
+ Rectangle aClientArea;
+ BOOL bDockingAllowed;
+ BOOL bAllChildsVisible;
+ SfxShell* pConfigShell;
+ Window* pActiveChild;
+
+protected:
+ void CreateChildWin_Impl(SfxChildWin_Impl*);
+ void RemoveChildWin_Impl(SfxChildWin_Impl*);
+ void Sort_Impl();
+ void AlignChild_Impl( Window& rWindow, const Size& rNewSize,
+ SfxChildAlignment eAlign );
+ SfxChild_Impl* FindChild_Impl( const Window& rWindow ) const;
+ virtual BOOL RequestTopToolSpacePixel_Impl( SvBorder aBorder );
+ virtual Rectangle GetTopRect_Impl();
+ SvBorder Arrange_Impl( Rectangle & rRect);
+ virtual void SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&);
+
+public:
+ SfxWorkWindow( Window *pWin, SfxBindings& rBindings, SfxWorkWindow* pParent = NULL);
+ ~SfxWorkWindow();
+ SystemWindow* GetTopWindow() const;
+ SfxBindings& GetBindings()
+ { return *pBindings; }
+ Window* GetWindow() const
+ { return pWorkWin; }
+ Rectangle GetFreeArea( BOOL bAutoHide ) const;
+ void SetDockingAllowed(BOOL bSet)
+ { bDockingAllowed = bSet; }
+ BOOL IsDockingAllowed() const
+ { return bDockingAllowed; }
+ SfxWorkWindow* GetParent_Impl() const
+ { return pParent; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > CreateDispatch( const String& );
+
+ // Methoden f"ur alle Child-Fenster
+ void ReleaseChild_Impl( Window& rWindow );
+ SfxChild_Impl* RegisterChild_Impl( Window& rWindow, SfxChildAlignment eAlign, BOOL bCanGetFocus=FALSE );
+ void ShowChilds_Impl();
+ void HideChilds_Impl();
+ void Close_Impl();
+ BOOL PrepareClose_Impl();
+ virtual void ArrangeChilds_Impl();
+ void DeleteControllers_Impl();
+ void HidePopups_Impl(BOOL bHide, BOOL bParent=FALSE, USHORT nId=0);
+ void ConfigChild_Impl(SfxChildIdentifier,
+ SfxDockingConfig, USHORT);
+ void MakeChildsVisible_Impl( BOOL bVis );
+ void ArrangeAutoHideWindows( SfxSplitWindow *pSplit );
+ BOOL IsAutoHideMode( const SfxSplitWindow *pSplit );
+ void EndAutoShow_Impl();
+
+ // Methoden f"ur Objectbars
+ virtual void UpdateObjectBars_Impl();
+ void ResetObjectBars_Impl();
+ void SetObjectBar_Impl( USHORT nPos, const ResId& rId,
+ SfxInterface *pIFace, const String* pName=0 );
+ Window* GetObjectBar_Impl( USHORT nPos, ResId& rResId );
+ FASTBOOL KnowsObjectBar_Impl( USHORT nPos ) const;
+ void SetObjectBarVisibility_Impl( USHORT nVis );
+ BOOL IsContainer_Impl() const;
+ void NextObjectBar_Impl( USHORT nPos );
+ USHORT HasNextObjectBar_Impl( USHORT nPos, String* pStr=0 );
+
+ // Methoden f"ur ChildWindows
+ void UpdateChildWindows_Impl();
+ void ResetChildWindows_Impl();
+ void SetChildWindowVisible_Impl( ULONG, BOOL, USHORT );
+ void ToggleChildWindow_Impl(USHORT);
+ BOOL HasChildWindow_Impl(USHORT);
+ BOOL KnowsChildWindow_Impl(USHORT);
+ void ShowChildWindow_Impl(USHORT, BOOL bVisible=TRUE);
+ void SetChildWindow_Impl(USHORT, BOOL bOn);
+ SfxChildWindow* GetChildWindow_Impl(USHORT);
+ virtual void InitializeChild_Impl(SfxChildWin_Impl*);
+ SfxSplitWindow* GetSplitWindow_Impl(SfxChildAlignment);
+
+ BOOL IsVisible_Impl( USHORT nMode ) const;
+ void DisableChildWindow_Impl( USHORT nId, BOOL bDisable );
+ BOOL IsFloating( USHORT nId );
+ void ChangeWindow_Impl( Window *pNew );
+ void SetActiveChild_Impl( Window *pChild );
+ Window* GetActiveChild_Impl();
+ virtual BOOL ActivateNextChild_Impl( BOOL bForward = TRUE );
+
+ // Methoden f"ur StatusBar
+ void SetTempStatusBar_Impl( BOOL bSet );
+ void ResetStatusBar_Impl();
+ void SetStatusBar_Impl(const ResId&, SfxShell *pShell, SfxBindings& );
+ void UpdateStatusBar_Impl();
+ SfxStatusBarManager* GetStatusBarManager_Impl();
+};
+
+class SfxPIWorkWin_Impl : public SfxWorkWindow
+{
+ SfxPlugInEnv_Impl* pEnv;
+ Window* pDialogParent;
+
+public:
+ SfxPIWorkWin_Impl(
+ Window *pWin, SfxBindings &rBindings,
+ SfxPlugInEnv_Impl* pE);
+ virtual Window* GetModalDialogParent() const;
+
+private:
+ virtual void ArrangeChilds_Impl();
+ virtual void UpdateObjectBars_Impl();
+ virtual void SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&);
+ virtual void InitializeChild_Impl(SfxChildWin_Impl*);
+ virtual Rectangle GetTopRect_Impl();
+};
+
+
+class SfxIPWorkWin_Impl : public SfxWorkWindow
+{
+ SfxInPlaceEnv_Impl* pEnv;
+
+public:
+ SfxIPWorkWin_Impl( WorkWindow *pWin, SfxBindings &rBindings,
+ SfxInPlaceEnv_Impl* pE);
+private:
+ virtual BOOL RequestTopToolSpacePixel_Impl( SvBorder aBorder );
+ virtual void UpdateObjectBars_Impl();
+ virtual Rectangle GetTopRect_Impl();
+ virtual void ArrangeChilds_Impl();
+ virtual void SaveStatus_Impl(SfxChildWindow*, const SfxChildWinInfo&);
+};
+
+class SfxFrameWorkWin_Impl : public SfxWorkWindow
+{
+ SfxFrame* pFrame;
+public:
+ SfxFrameWorkWin_Impl( Window* pWin, SfxFrame* pTask );
+ virtual void ArrangeChilds_Impl();
+ virtual void UpdateObjectBars_Impl();
+ virtual Rectangle GetTopRect_Impl();
+};
+
+
+#endif
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
new file mode 100644
index 000000000000..a5d9668e0d88
--- /dev/null
+++ b/sfx2/source/inet/inettbc.cxx
@@ -0,0 +1,1053 @@
+/*************************************************************************
+ *
+ * $RCSfile: inettbc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "inettbc.hxx"
+
+#pragma hdrstop
+
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#ifndef _SFXCANCEL_HXX //autogen
+#include <svtools/cancel.hxx>
+#endif
+#include <vcl/toolbox.hxx>
+#ifndef _VOS_THREAD_HXX //autogen
+#include <vos/thread.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX //autogen
+#include <vos/mutex.hxx>
+#endif
+
+#include <svtools/urihelper.hxx>
+
+#include "picklist.hxx"
+#include "sfx.hrc"
+#include "dispatch.hxx"
+#include "viewfrm.hxx"
+#include "objsh.hxx"
+#include "referers.hxx"
+#include "sfxtypes.hxx"
+#include "helper.hxx"
+
+// -----------------------------------------------------------------------
+class SfxMatchContext_Impl : public ::vos::OThread
+{
+ static ::vos::OMutex* pDirMutex;
+
+ SvStringsDtor aPickList;
+ SvStringsDtor aCompletions;
+ SvStringsDtor aURLs;
+ AsynchronLink aLink;
+ String aBaseURL;
+ String aText;
+ SfxURLBox* pBox;
+ SfxCancellable* pCancel;
+ BOOL bStop; // Abbruch erwuenscht
+ BOOL bOnlyDirectories;
+
+ DECL_STATIC_LINK( SfxMatchContext_Impl, Select_Impl, void* );
+
+ virtual void SAL_CALL onTerminated( );
+ virtual void SAL_CALL run();
+ virtual void SAL_CALL Cancel();
+ void Insert( const String& rCompletion, const String& rURL, BOOL bForce = FALSE);
+ void ReadFolder( const String& rURL, const String& rMatch );
+public:
+ static ::vos::OMutex* GetMutex();
+
+ SfxMatchContext_Impl( SfxURLBox* pBoxP, const String& rText, BOOL bSelectFirst );
+ ~SfxMatchContext_Impl();
+ void Stop();
+};
+
+void SAL_CALL SfxMatchContext_Impl::Cancel()
+{
+ terminate();
+}
+
+::vos::OMutex* SfxMatchContext_Impl::pDirMutex = 0;
+
+::vos::OMutex* SfxMatchContext_Impl::GetMutex()
+{
+ ::vos::OGuard aGuard( ::vos::OMutex::getGlobalMutex() );
+ if( !pDirMutex )
+ pDirMutex = new ::vos::OMutex;
+ return pDirMutex;
+}
+
+SfxMatchContext_Impl::SfxMatchContext_Impl(
+ SfxURLBox* pBoxP, const String& rText, BOOL bSelectFirst )
+ : aText( rText )
+ , pBox( pBoxP )
+ , aLink( STATIC_LINK( this, SfxMatchContext_Impl, Select_Impl ) )
+ , bStop( FALSE )
+ , pCancel( new SfxCancellable( SFX_APP()->GetCancelManager(), rText ) )
+ , bOnlyDirectories( pBoxP->bOnlyDirectories )
+ , aBaseURL( pBoxP->aBaseURL )
+{
+ // Pickliste abziehen wg. konkurrierender Zugriffe
+ SfxPickList_Impl& rList = *SfxPickList_Impl::Get();
+ USHORT nCount = (USHORT)rList.HistoryPickEntryCount();
+ // Uber char* casten fuer getrennte Impdaten
+ for( USHORT nPos = 0; nPos < nCount; nPos++ )
+ {
+ const StringPtr pStr = new String(rList.GetHistoryPickEntry( nPos )->aTitle );
+ aPickList.Insert(pStr, nPos );
+ }
+
+ // Thread starten
+// Application::EnterMultiThread();
+ create();
+}
+
+SfxMatchContext_Impl::~SfxMatchContext_Impl()
+{
+ aLink.ClearPendingCall();
+ delete pCancel;
+// Application::EnterMultiThread( FALSE );
+}
+
+void SfxMatchContext_Impl::Stop()
+{
+ if( isRunning() )
+ {
+ bStop = TRUE;
+ terminate();
+ }
+}
+
+// Select l"auft im Mainthread, da "uber einen asynchronen Link gecalled wird.
+// Es wird immer erst gerufen, wenn der Thread mit seiner Arbeit fertig ist.
+// Falls inzwischen der MatchContext zerst"ort wurde, fliegt auch der asynchrone Link
+// ab, da er ja ein member des MatchContexts ist, d.h. der Link wird dann auch nicht gecalled
+IMPL_STATIC_LINK( SfxMatchContext_Impl, Select_Impl, void*, pArg )
+{
+ if( pArg )
+ {
+ DELETEZ( pThis->pCancel );
+ if( pThis->bStop )
+ {
+ delete pThis;
+ return 0;
+ }
+ }
+
+ SfxURLBox* pBox = pThis->pBox;
+ pBox->bAutoCompleteMode = TRUE;
+
+ pBox->Clear();
+ for( USHORT nPos = 0; nPos<pThis->aCompletions.Count(); nPos++ )
+ {
+ String aMatchString( pThis->aText );
+ aMatchString += *pThis->aCompletions[nPos];
+ pBox->InsertEntry( aMatchString );
+ }
+
+ if( pThis->aCompletions.Count() )
+ {
+ String aTmp( pBox->GetEntry(0) );
+ pBox->SetText( aTmp );
+ pBox->SetSelection( Selection( pThis->aText.Len(), aTmp.Len() ) );
+ }
+
+ pBox->Resize();
+ return 0;
+}
+
+void SfxMatchContext_Impl::Insert( const String& rCompletion, const String& rURL, BOOL bForce )
+{
+ if( !bForce )
+ for( USHORT nPos = aCompletions.Count(); nPos--; )
+ if( *aCompletions[ nPos ] == rCompletion )
+ return;
+
+ const StringPtr pCompletion = new String( rCompletion );
+ aCompletions.Insert( pCompletion, aCompletions.Count() );
+ const StringPtr pURL = new String( rURL );
+ aURLs.Insert( pURL, aURLs.Count() );
+}
+
+void SfxMatchContext_Impl::ReadFolder( const String& rURL, const String& rMatch )
+{
+ if( !SfxContentHelper::IsFolder( rURL ) )
+ return;
+
+ INetURLObject aMatchObj( rMatch, INET_PROT_FILE );
+ String aMatchName;
+ if ( rURL != aMatchObj.GetMainURL() )
+ {
+ aMatchName = aMatchObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
+ aMatchName.ToLowerAscii();
+ }
+
+ xub_StrLen nMatchLen = aMatchName.Len();
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aEntries =
+ SfxContentHelper::GetFolderContentProperties( rURL, sal_True );
+ const ::rtl::OUString* pEntries = aEntries.getConstArray();
+ UINT32 nCount = aEntries.getLength();
+ for ( UINT32 i=0; schedule() && i < nCount; i++ )
+ {
+ String aRow( pEntries[i] );
+ String aTitle = aRow.GetToken( 0, '\t' );
+ aTitle.ToLowerAscii();
+ String aURL = aRow.GetToken( 3, '\t' );
+ sal_Bool bIsFolder = ( '1' == aRow.GetToken( 4, '\t' ).GetChar(0) );
+
+ if( !nMatchLen || aMatchName.CompareTo( aTitle, nMatchLen ) == COMPARE_EQUAL )
+ {
+ // all names fit if matchstring is empty
+ INetURLObject aObj( aURL );
+ if ( bIsFolder )
+ aObj.setFinalSlash();
+ String aMatch = aObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
+ if ( nMatchLen )
+ aMatch.Erase( 0, nMatchLen );
+ Insert( aMatch, aObj.GetMainURL(), TRUE );
+ }
+ }
+}
+
+void SfxMatchContext_Impl::run()
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ // Reset match lists
+ aCompletions.Remove( 0, aCompletions.Count() );
+ aURLs.Remove( 0, aURLs.Count() );
+
+ // check for input
+ USHORT nTextLen = aText.Len();
+ if ( !nTextLen )
+ return;
+
+ if( aText.Search( '*' ) != STRING_NOTFOUND || aText.Search( '?' ) != STRING_NOTFOUND )
+ // no autocompletion for wildcards
+ return;
+
+ String aMatch( aText );
+ INetURLObject aURLObject( aMatch, INET_PROT_FILE );
+ INetProtocol eProt = INetURLObject::CompareProtocolScheme( aText );
+ INetProtocol eSmartProt = pBox->GetSmartProtocol();
+
+ // check if it is or may be file protocol
+ if( !aURLObject.HasError() && ( eProt == INET_PROT_FILE || eProt == INET_PROT_NOT_VALID ) && ( eSmartProt == INET_PROT_FILE || eSmartProt == INET_PROT_NOT_VALID ) )
+ {
+ // not stopped yet ?
+ if( schedule() )
+ {
+ USHORT nPos = aText.Search( ':' );
+ if( nPos != STRING_NOTFOUND && ( nPos != 1 || aText.Len() < 3 || aText.GetChar( 2 ) != '\\' ) )
+ // cannot be handled correctly by generic URLObject
+ return;
+
+ if( aBaseURL.Len() )
+ {
+ // if a base URL is set the string may be parsed relative
+ if( aText.Search( '/' ) == 0 )
+ {
+ // text starting with slashes means absolute file URLs
+ String aTmp = String::CreateFromAscii( "file://" );
+ aTmp += aMatch;
+ aURLObject.SetURL( aTmp );
+ aMatch = aTmp;
+ }
+ else
+ {
+ INetURLObject aObj( aBaseURL );
+ if( aText.Search( '\\' ) == 0 )
+ {
+ // cut to first segment
+ String aTmp = String::CreateFromAscii( "file:///" );
+ aTmp += aObj.getName( 0, true, INetURLObject::DECODE_WITH_CHARSET );
+ aObj.SetURL( aTmp );
+ aMatch.Erase(0,1);
+ }
+
+ // base URL must be a directory !
+ aObj.setFinalSlash();
+
+ // take base URL and append current input
+ bool bWasAbsolute = FALSE;
+ INetURLObject aTmp( aObj.smartRel2Abs( aMatch, bWasAbsolute ) );
+ if ( aText.GetChar( aText.Len() - 1 ) == '.' )
+ // INetURLObject appends a final slash for the directories "." and "..", this is a bug!
+ // Remove it as a workaround
+ aTmp.removeFinalSlash();
+
+ aMatch = aTmp.GetMainURL();
+ aURLObject.SetURL( aMatch );
+ }
+ }
+
+ // if text input is a directory, it must be part of the match list! Until then it is scanned
+ if ( SfxContentHelper::IsFolder( aURLObject.GetMainURL()) && aURLObject.hasFinalSlash() )
+ Insert( String(), aMatch );
+ else
+ // otherwise the parent folder will be taken
+ aURLObject.removeSegment();
+
+ // scan directory and insert all matches
+ ReadFolder( aURLObject.GetMainURL(), aMatch );
+ }
+ }
+
+ if ( bOnlyDirectories )
+ // don't scan history picklist if only directories are allowed, picklist contains only files
+ return;
+
+ BOOL bFull = FALSE;
+ int nCount = aPickList.Count();
+
+ INetURLObject aCurObj;
+ String aEmpty, aCurString, aCurMainURL;
+ INetURLObject aObj;
+ aObj.SetSmartProtocol( eSmartProt == INET_PROT_NOT_VALID ? INET_PROT_HTTP : eSmartProt );
+ for( ;; )
+ {
+ for( USHORT nPos = 0; schedule() && nPos < nCount; nPos++ )
+ {
+ aCurObj.SetURL( *aPickList.GetObject( nPos ) );
+ aCurObj.SetSmartURL( aCurObj.GetURLNoPass());
+ aCurMainURL = aCurObj.GetMainURL();
+ if( eProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eProt )
+ continue;
+
+ if( eSmartProt != INET_PROT_NOT_VALID && aCurObj.GetProtocol() != eSmartProt )
+ continue;
+
+ switch( aCurObj.GetProtocol() )
+ {
+ case INET_PROT_HTTP:
+ case INET_PROT_HTTPS:
+ case INET_PROT_FTP:
+ {
+ // Wenn schon mehr, als der Pfad da ist, kein kurzes Matchen
+ if( eProt == INET_PROT_NOT_VALID && !bFull )
+ {
+ aObj.SetSmartURL( aText );
+ if( aObj.GetURLPath().Len() > 1 )
+ continue;
+ }
+
+ aCurString = aCurMainURL;
+ if( eProt == INET_PROT_NOT_VALID )
+ {
+ // try if text matches the scheme
+ String aScheme( INetURLObject::GetScheme( aCurObj.GetProtocol() ) );
+ if ( aText.CompareTo( aScheme, aText.Len() ) == COMPARE_EQUAL && aText.Len() < aScheme.Len() )
+ {
+ if( bFull )
+ aMatch = aCurObj.GetMainURL();
+ else
+ {
+ aCurObj.SetMark( aEmpty );
+ aCurObj.SetParam( aEmpty );
+ aCurObj.SetURLPath( aEmpty );
+ aMatch = aCurObj.GetMainURL();
+ }
+
+ String aTmp( aMatch );
+ aTmp.Erase( 0, aText.Len() );
+ Insert( aTmp, aMatch );
+ }
+
+ // now try smart matching
+ aCurString.Erase( 0, aScheme.Len() );
+ }
+
+ if( aText.CompareTo( aCurString, aText.Len() )== COMPARE_EQUAL )
+ {
+ if( bFull )
+ aMatch = aCurObj.GetMainURL();
+ else
+ {
+ aCurObj.SetMark( aEmpty );
+ aCurObj.SetParam( aEmpty );
+ aCurObj.SetURLPath( aEmpty );
+ aMatch = aCurObj.GetMainURL();
+ }
+
+ String aURL( aMatch );
+ if( eProt == INET_PROT_NOT_VALID )
+ aMatch.Erase( 0, INetURLObject::GetScheme( aCurObj.GetProtocol() ).Len() );
+
+ if( aText.Len() < aMatch.Len() )
+ {
+ String aTmp( aMatch );
+ aTmp.Erase( 0, aText.Len() );
+ Insert( aTmp, aURL );
+ }
+
+ continue;
+ }
+ break;
+ }
+ default:
+ {
+ // Dateien matchen sofort den gesamten Namen
+ if( bFull )
+ continue;
+
+ if( aText.CompareTo( aCurMainURL, aText.Len() ) == COMPARE_EQUAL )
+ {
+ if( aText.Len() < aCurMainURL.Len() )
+ {
+ String aTmp( aCurMainURL );
+ aTmp.Erase( 0, aText.Len() );
+ Insert( aTmp, aCurMainURL );
+ }
+
+ continue;
+ }
+/* // PathToFileName is forbidden for generic parsing !
+ if( eProt == INET_PROT_NOT_VALID )
+ {
+ // Noch keine erkennbares Protocol
+ // Bei File-Protocol auch als Pfadname versuchen
+ if( aCurObj.GetProtocol() == INET_PROT_FILE &&
+ aText.CompareTo( aCurObj.PathToFileName(), aText.Len() ) == COMPARE_EQUAL )
+ {
+ if( aText.Len() < aCurObj.PathToFileName().Len() )
+ {
+ String aTmp( aCurObj.PathToFileName() );
+ aTmp.Erase( 0, aText.Len() );
+ Insert( aTmp, aCurMainURL );
+ }
+ }
+ }
+*/
+ break;
+ }
+ }
+ }
+
+ if( !bFull )
+ bFull = TRUE;
+ else
+ break;
+ }
+
+ return;
+}
+
+void SfxMatchContext_Impl::onTerminated( )
+{
+ aLink.CreateMutex();
+ aLink.Call( this );
+}
+
+void SfxURLBox::TryAutoComplete( BOOL bForward, BOOL bForce )
+{
+ if( Application::AnyInput( INPUT_KEYBOARD ) ) return;
+
+ String aMatchString;
+ String aCurText = GetText();
+ Selection aSelection( GetSelection() );
+ if( aSelection.Max() != aCurText.Len() && !bForce )
+ return;
+ USHORT nLen = (USHORT)aSelection.Min();
+ aCurText.Erase( nLen );
+ if( aCurText.Len() )
+ pCtx = new SfxMatchContext_Impl( this, aCurText, bForward );
+}
+
+SfxURLBox::SfxURLBox( Window* pParent, INetProtocol eSmart )
+ : ComboBox( pParent , WB_DROPDOWN | WB_AUTOSIZE | WB_AUTOHSCROLL ),
+ bTryAutoComplete( FALSE ),
+ bAutoCompleteMode( FALSE ),
+ bOnlyDirectories( FALSE ),
+ bCtrlClick( FALSE ),
+ pCtx( 0 ),
+ eSmartProtocol( eSmart )
+{
+ SetHelpId( SID_OPENURL );
+ EnableAutocomplete( FALSE );
+ EnableDrop();
+ if ( GetDesktopRectPixel().GetWidth() > 800 )
+ SetSizePixel( Size( 300, 240 ) );
+ else
+ SetSizePixel( Size( 225, 240 ) );
+ SetText( String() );
+
+ GetSubEdit()->SetAutocompleteHdl( LINK( this, SfxURLBox, AutoCompleteHdl_Impl ) );
+ UpdatePicklistForSmartProtocol_Impl();
+}
+
+void SfxURLBox::SetSmartProtocol( INetProtocol eProt )
+{
+ if ( eSmartProtocol != eProt )
+ {
+ eSmartProtocol = eProt;
+ UpdatePicklistForSmartProtocol_Impl();
+ }
+}
+
+void SfxURLBox::UpdatePicklistForSmartProtocol_Impl()
+{
+ Clear();
+ SfxPickList_Impl* pPickList = SfxPickList_Impl::Get();
+ const ULONG nCount = pPickList->HistoryPickEntryCount();
+ INetURLObject aCurObj;
+ for( USHORT nPos = 0; nPos < nCount; nPos++ )
+ {
+ String aEntry = pPickList->GetHistoryPickEntry( nPos )->aTitle;
+ if ( eSmartProtocol != INET_PROT_NOT_VALID )
+ {
+ aCurObj.SetURL( aEntry );
+ if( aCurObj.GetProtocol() != eSmartProtocol )
+ continue;
+ }
+
+ InsertEntry( aEntry );
+ }
+}
+
+// **************************************************************************
+
+BOOL SfxURLBox::QueryDrop( DropEvent &rEvt )
+{
+ return SFX_APP()->QueryDrop( rEvt );
+}
+
+// **************************************************************************
+
+BOOL SfxURLBox::Drop( const DropEvent &rEvt )
+{
+ return SFX_APP()->Drop( (DropEvent&) rEvt );
+}
+
+// **************************************************************************
+
+void SfxURLBox::OpenURL( SfxPickEntry_Impl* pEntry, const String& rName, BOOL bNew ) const
+{
+ String aName;
+ String aFilter;
+ String aOptions;
+ if ( pEntry )
+ {
+ aName = pEntry->aName;
+ String aFilter = pEntry->aFilter;
+ USHORT nPos = aFilter.Search( '|' );
+ if( nPos != STRING_NOTFOUND )
+ {
+ aOptions = aFilter.Copy( nPos + 1 );
+ aFilter.Erase( nPos + 1 );
+ }
+ }
+ else
+ {
+ if ( rName.CompareToAscii( "vnd.sun.star.webdav:", 20 ) == 0 )
+ {
+ aName = String::CreateFromAscii("http:");
+ aName += rName.Copy(20);
+ }
+ else
+ aName = URIHelper::SmartRelToAbs( rName );
+ }
+
+ SfxStringItem aUrl( SID_FILE_NAME, aName );
+ SfxViewFrame *pViewFrame = bNew ? 0 : SfxViewFrame::Current();
+ if ( pViewFrame )
+ pViewFrame = pViewFrame->GetTopViewFrame();
+ SfxFrameItem aView( SID_DOCFRAME , pViewFrame ? pViewFrame->GetFrame() : 0 );
+ SfxBoolItem aBrowsing( SID_BROWSING, TRUE );
+ SfxStringItem aReferer( SID_REFERER, DEFINE_CONST_UNICODE(SFX_REFERER_USER) );
+ SfxStringItem aFilterItem( SID_FILTER_NAME, aFilter );
+ SfxStringItem aOptionItem( SID_FILE_FILTEROPTIONS, aOptions );
+
+ const SfxPoolItem* pFilterItem = NULL;
+ const SfxPoolItem* pOptionItem = NULL;
+
+ if ( aFilter.Len() )
+ {
+ pFilterItem = &aFilterItem;
+ pOptionItem = &aOptionItem;
+ }
+
+ SFX_APP()->GetAppDispatcher_Impl()->Execute( SID_OPENURL, SFX_CALLMODE_RECORD, &aUrl, &aBrowsing, &aReferer, &aView,
+ pFilterItem, pOptionItem, 0L );
+}
+
+// **************************************************************************
+
+BOOL SfxURLBox::ProcessKey( const KeyCode& rKey )
+{
+ // laufende Completion abbrechen
+ if( pCtx )
+ {
+ pCtx->Stop();
+ pCtx = 0;
+ }
+
+ KeyCode aCode( rKey.GetCode() );
+ if ( aCode == KEY_RETURN && GetText().Len() )
+ {
+ // warten bis Thread beendet (OS/2 stuerzt uns sonst ab...)
+ ::vos::OGuard aGuard( SfxMatchContext_Impl::GetMutex() );
+
+ if ( bAutoCompleteMode )
+ {
+ bAutoCompleteMode = FALSE;
+ Selection aSelection( GetSelection() );
+ SetSelection( Selection( aSelection.Min(), aSelection.Min() ) );
+ if ( bOnlyDirectories )
+ Clear();
+ else
+ UpdatePicklistForSmartProtocol_Impl();
+ Resize();
+ }
+
+ String aInput = GetText();
+ aInput.EraseLeadingChars();
+ aInput.EraseTrailingChars();
+
+ bCtrlClick = rKey.IsMod1();
+ BOOL bHandled = FALSE;
+ if ( GetOpenHdl().IsSet() )
+ {
+ bHandled = TRUE;
+ GetOpenHdl().Call(this);
+ }
+ else if ( GetSelectHdl().IsSet() )
+ {
+ bHandled = TRUE;
+ GetSelectHdl().Call(this);
+ }
+
+ bCtrlClick = FALSE;
+
+ ClearModifyFlag();
+ return bHandled;
+ }
+ else if ( aCode == KEY_RETURN && !GetText().Len() && GetOpenHdl().IsSet() )
+ {
+ // FileDialog: LeerString + Enter behandeln
+ bAutoCompleteMode = FALSE;
+ GetOpenHdl().Call(this);
+ return TRUE;
+ }
+ else if( aCode == KEY_ESCAPE )
+ {
+ Selection aSelection( GetSelection() );
+ if ( bAutoCompleteMode || aSelection.Min() != aSelection.Max() )
+ {
+ SetSelection( Selection( aSelection.Min(), aSelection.Min() ) );
+ if ( bOnlyDirectories )
+ Clear();
+ else
+ UpdatePicklistForSmartProtocol_Impl();
+ Resize();
+ }
+ else if ( Application::IsInModalMode() )
+ {
+ return FALSE;
+ }
+ else
+ {
+ SfxViewFrame* pFrm = SfxViewFrame::Current();
+ if( pFrm )
+ pFrm->GetTopViewFrame()->GetFrame()->GrabFocusOnComponent_Impl();
+ }
+
+ bAutoCompleteMode = FALSE;
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+// **************************************************************************
+
+void SfxURLBox::Modify()
+{
+ ComboBox::Modify();
+}
+
+// **************************************************************************
+
+long SfxURLBox::PreNotify( NotifyEvent& rNEvt )
+{
+ if( rNEvt.GetWindow() == GetSubEdit() && rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ const KeyEvent& rEvent = *rNEvt.GetKeyEvent();
+ const KeyCode& rKey = rEvent.GetKeyCode();
+ KeyCode aCode( rKey.GetCode() );
+ if( ProcessKey( rKey ) )
+ {
+ return TRUE;
+ }
+ else if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
+ {
+ Selection aSelection( GetSelection() );
+ USHORT nLen = (USHORT)aSelection.Min();
+ GetSubEdit()->KeyInput( rEvent );
+ SetSelection( Selection( nLen, GetText().Len() ) );
+ return TRUE;
+ }
+ }
+
+ return ComboBox::PreNotify( rNEvt );
+}
+
+IMPL_LINK( SfxURLBox, AutoCompleteHdl_Impl, void*, pVoid )
+{
+ if ( GetSubEdit()->GetAutocompleteAction() == AUTOCOMPLETE_KEYINPUT )
+ {
+ TryAutoComplete( TRUE, FALSE );
+ return 1L;
+ }
+
+ return 0L;
+}
+
+// **************************************************************************
+
+long SfxURLBox::Notify( NotifyEvent &rEvt )
+/*
+ [Beschreibung]
+ Aktualisierung der Combobox mit dem aktuellen Picklisteninhalt
+*/
+{
+ if ( EVENT_GETFOCUS == rEvt.GetType() )
+ {
+ SetSelection( Selection( 0, GetText().Len() ) );
+ }
+ else if ( EVENT_LOSEFOCUS == rEvt.GetType() )
+ {
+ if( !GetText().Len() )
+ ClearModifyFlag();
+ if ( pCtx )
+ {
+ pCtx->Stop();
+ pCtx = 0;
+ }
+ }
+
+ return ComboBox::Notify( rEvt );
+}
+
+// **************************************************************************
+
+void SfxURLBox::Select()
+/*
+ [Beschreibung]
+ Die Methode laedt das selektierte Element ein.
+*/
+{
+ ComboBox::Select();
+ ClearModifyFlag();
+}
+
+// **************************************************************************
+
+void SfxURLBox::SetOnlyDirectories( BOOL bDir )
+
+/* [Beschreibung]
+
+ Die Methode setzt das Flag, ob nur auf Verzeichnisse ergnzt werden soll.
+ Wenn das Flag auf TRUE gesetzt wird, wird die Liste gel"oscht.
+*/
+
+{
+ bOnlyDirectories = bDir;
+ if ( bOnlyDirectories )
+ Clear();
+}
+
+//***************************************************************************
+// SfxURLToolBoxControl_Impl
+//***************************************************************************
+
+SFX_IMPL_TOOLBOX_CONTROL(SfxURLToolBoxControl_Impl,SfxStringItem)
+
+SfxURLToolBoxControl_Impl::SfxURLToolBoxControl_Impl( USHORT nId ,
+ ToolBox& rBox ,
+ SfxBindings& rBindings )
+ : SfxToolBoxControl( nId , rBox , rBindings )
+ , aURLForwarder( SID_CURRENT_URL, *this )
+{
+// Application::EnterMultiThread();
+}
+
+SfxURLBox* SfxURLToolBoxControl_Impl::GetURLBox() const
+{
+ return (SfxURLBox*) GetToolBox().GetItemWindow(GetId());
+}
+
+//***************************************************************************
+
+Window* SfxURLToolBoxControl_Impl::CreateItemWindow( Window* pParent )
+{
+ DBG_ASSERT( pParent , "CreateItemWindow:invalider Parentpointer" );
+
+ SfxURLBox* pURLBox = new SfxURLBox( pParent );
+ pURLBox->SetOpenHdl( LINK( this, SfxURLToolBoxControl_Impl, OpenHdl ) );
+ pURLBox->SetSelectHdl( LINK( this, SfxURLToolBoxControl_Impl, SelectHdl ) );
+
+ DBG_ASSERT( pURLBox , "CreateItemWindow:Itemwindow nicht erstellt" );
+ return pURLBox;
+}
+
+IMPL_LINK( SfxURLToolBoxControl_Impl, SelectHdl, void*, pVoid )
+{
+ SfxURLBox* pURLBox = GetURLBox();
+ String aName( pURLBox->GetText() );
+
+ if ( !pURLBox->IsTravelSelect() && aName.Len() )
+ {
+ aName = URIHelper::SmartRelToAbs( aName );
+ SfxPickList_Impl* pPickList = SfxPickList_Impl::Get();
+ SfxPickEntry_Impl* pEntry = pPickList->GetHistoryPickEntryFromTitle( aName );
+ if ( !pEntry )
+ pPickList->SetCurHistoryPos( pURLBox->GetEntryPos( aName ) );
+ pURLBox->OpenURL( pEntry, aName, FALSE );
+ }
+
+ return 1L;
+}
+
+IMPL_LINK( SfxURLToolBoxControl_Impl, OpenHdl, void*, pVoid )
+{
+ SfxURLBox* pURLBox = GetURLBox();
+ SfxPickEntry_Impl* pEntry = SfxPickList_Impl::Get()->GetHistoryPickEntryFromTitle( pURLBox->GetText() );
+ pURLBox->OpenURL( pEntry, pURLBox->GetText(), pURLBox->IsCtrlOpen() );
+ SfxViewFrame* pFrm = SfxViewFrame::Current();
+ if( pFrm )
+ pFrm->GetFrame()->GrabFocusOnComponent_Impl();
+ return 1L;
+}
+
+//***************************************************************************
+
+void SfxURLToolBoxControl_Impl::StateChanged
+(
+ USHORT nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState
+)
+
+/* [Beschreibung]
+
+ Hier wird die URL des aktiven Dokuments angezeigt.
+*/
+
+{
+ if( nSID == SID_FOCUSURLBOX )
+ {
+ if ( GetURLBox()->IsVisible() )
+ GetURLBox()->GrabFocus();
+ }
+ else if ( !GetURLBox()->IsModified() && SFX_ITEM_AVAILABLE == eState )
+ {
+ SfxURLBox* pURLBox = GetURLBox();
+
+ // in VCL hier die URLBox updaten
+ SfxPickList_Impl* pPickList = SfxPickList_Impl::Get();
+ DBG_ASSERT( pPickList , "Pickliste invalid" );
+ pURLBox->Clear();
+ const ULONG nPickEntryCount = pPickList->HistoryPickEntryCount();
+ ULONG nPickEntry;
+ for ( nPickEntry = 0; nPickEntry < nPickEntryCount; ++nPickEntry )
+ {
+ DBG_ASSERT( pPickList->GetHistoryPickEntry( nPickEntry ),
+ "Pickentry ist invalid" );
+ pURLBox->InsertEntry(
+ pPickList->GetHistoryPickEntry( nPickEntry )->aTitle );
+ }
+
+ const SfxStringItem *pURL = PTR_CAST(SfxStringItem,pState);
+ String aRep( pURL->GetValue() );
+ INetURLObject aURL( aRep );
+ INetProtocol eProt = aURL.GetProtocol();
+ if ( eProt == INET_PROT_FILE ||
+ eProt == INET_PROT_FTP ||
+ eProt == INET_PROT_NEWS ||
+ eProt == INET_PROT_POP3 ||
+ eProt == INET_PROT_IMAP ||
+ eProt == INET_PROT_OUT ||
+ eProt == INET_PROT_HTTP ||
+ eProt == INET_PROT_HTTPS )
+ pURLBox->SetText( aURL.GetURLNoPass() );
+ else
+ pURLBox->SetText( String() );
+ }
+}
+
+//***************************************************************************
+// SfxCancelToolBoxControl_Impl
+//***************************************************************************
+
+SFX_IMPL_TOOLBOX_CONTROL(SfxCancelToolBoxControl_Impl,SfxBoolItem)
+
+//***************************************************************************
+
+SfxCancelToolBoxControl_Impl::SfxCancelToolBoxControl_Impl
+(
+ USHORT nId,
+ ToolBox& rBox,
+ SfxBindings& rBindings
+)
+: SfxToolBoxControl( nId, rBox, rBindings )
+{
+}
+
+//***************************************************************************
+
+SfxPopupWindowType SfxCancelToolBoxControl_Impl::GetPopupWindowType() const
+{
+ return SFX_POPUPWINDOW_ONTIMEOUT;
+}
+
+//***************************************************************************
+
+SfxPopupWindow* SfxCancelToolBoxControl_Impl::CreatePopupWindow()
+{
+ // Menu erzeugen und mit allen cancellables fuellen
+ PopupMenu aMenu;
+ BOOL bExecute = FALSE, bSeparator = FALSE;
+ USHORT nIndex = 1;
+ for ( SfxCancelManager *pCancelMgr = SfxViewFrame::Current()->GetTopViewFrame()->GetCancelManager();
+ pCancelMgr;
+ pCancelMgr = pCancelMgr->GetParent() )
+ {
+ for ( USHORT n=0; n<pCancelMgr->GetCancellableCount(); ++n )
+ {
+ if ( !n && bSeparator )
+ {
+ aMenu.InsertSeparator();
+ bSeparator = FALSE;
+ }
+ String aItemText = pCancelMgr->GetCancellable(n)->GetTitle();
+ if ( aItemText.Len() > 50 )
+ {
+ aItemText.Erase( 48 );
+ aItemText += DEFINE_CONST_UNICODE("...");
+ }
+ aMenu.InsertItem( nIndex++, aItemText );
+ bExecute = TRUE;
+ bSeparator = TRUE;
+ }
+ }
+
+ // Menu ausfuehren
+ ToolBox& rToolBox = GetToolBox();
+ USHORT nId = bExecute ? nId = aMenu.Execute( &rToolBox, rToolBox.GetPointerPosPixel() ) : 0;
+ GetToolBox().EndSelection();
+ ClearCache();
+ UpdateSlot();
+ if ( nId )
+ {
+ // den selektierten canceln
+ String aSearchText = aMenu.GetItemText(nId);
+ for ( SfxCancelManager *pCancelMgr = SfxViewFrame::Current()->GetTopViewFrame()->GetCancelManager();
+ pCancelMgr;
+ pCancelMgr = pCancelMgr->GetParent() )
+ {
+ for ( USHORT n = 0; n < pCancelMgr->GetCancellableCount(); ++n )
+ {
+ SfxCancellable *pCancel = pCancelMgr->GetCancellable(n);
+ String aItemText = pCancel->GetTitle();
+ if ( aItemText.Len() > 50 )
+ {
+ aItemText.Erase( 48 );
+ aItemText += DEFINE_CONST_UNICODE("...");
+ }
+
+ if ( aItemText == aSearchText )
+ {
+ pCancel->Cancel();
+ return 0;
+ }
+ }
+ }
+
+ }
+
+ return 0;
+}
+
+//***************************************************************************
+
+void SfxCancelToolBoxControl_Impl::StateChanged
+(
+ USHORT nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState
+)
+
+/* [Beschreibung]
+
+ Hier wird angezeigt, ob cancelbare Jobs laufen.
+*/
+
+{
+ SfxVoidItem aVoidItem( nSID );
+ //SfxToolBoxControl::StateChanged( nSID, eState, pState ? &aVoidItem : 0 );
+ SfxToolBoxControl::StateChanged( nSID, eState, pState );
+}
+
+
diff --git a/sfx2/source/inet/makefile.mk b/sfx2/source/inet/makefile.mk
new file mode 100644
index 000000000000..1eaf30fdcffa
--- /dev/null
+++ b/sfx2/source/inet/makefile.mk
@@ -0,0 +1,98 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=sfx2
+TARGET=inet
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# w.g. compilerbugs
+#!IF "$(GUI)"=="WNT"
+#CFLAGS=$(CFLAGS) -Od
+#!ENDIF
+
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ inettbc.cxx \
+ inetslot.cxx \
+ $(PROJECTPCHSOURCE).cxx
+
+
+SLOFILES = \
+ $(SLO)$/inettbc.obj \
+ $(SLO)$/inetslot.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/menu/makefile.mk b/sfx2/source/menu/makefile.mk
new file mode 100644
index 000000000000..cdd44c5d0c1f
--- /dev/null
+++ b/sfx2/source/menu/makefile.mk
@@ -0,0 +1,106 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+
+PRJNAME=sfx2
+TARGET=menu
+ENABLE_EXCEPTIONS=TRUE
+.INCLUDE : $(PRJ)$/util$/makefile.pmk
+AUTOSEG=true
+
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- ImageList ----------------------------------------------------
+
+IMGLST_SRS=$(SRS)$/menu.srs
+BMP_IN=$(PRJ)$/win/res
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ bmkmenu.cxx \
+ mnumgr.cxx \
+ virtmenu.cxx \
+ mnuitem.cxx \
+ objmnctl.cxx \
+ $(PROJECTPCHSOURCE).cxx
+
+SRCFILES = menu.src
+
+SLOFILES = \
+ $(SLO)$/bmkmenu.obj \
+ $(SLO)$/mnumgr.obj \
+ $(SLO)$/virtmenu.obj \
+ $(SLO)$/objmnctl.obj \
+ $(SLO)$/mnuitem.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/sfx2/source/menu/menu.hrc b/sfx2/source/menu/menu.hrc
new file mode 100644
index 000000000000..60dfa45c6f52
--- /dev/null
+++ b/sfx2/source/menu/menu.hrc
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: menu.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MNUCFG_HRC
+#define _MNUCFG_HRC
+
+#include "sfx.hrc"
+
+// #defines *****************************************************************
+
+#define DLG_MENUCONFIG (RID_SFX_MENU_START+1)
+#define IBX_MNUCFG_ALREADY_INCLUDED (RID_SFX_MENU_START+2)
+#define QBX_MNUCFG_UNDEFINED_FUNCTIONS (RID_SFX_MENU_START+3)
+#define QBX_MNUCFG_POPUP_FUNCTIONS (RID_SFX_MENU_START+4)
+#define RID_IMGLST_SMALL (RID_SFX_MENU_START+5)
+#define RID_IMGLST_BIG (RID_SFX_MENU_START+6)
+
+#define BTN_OK 1
+#define BTN_CANCEL 2
+#define BTN_UP 3
+#define BTN_LEFT 4
+#define BTN_RIGHT 5
+#define BTN_DOWN 6
+#define BTN_NEW 7
+#define BTN_CHANGE 8
+#define BTN_REMOVE 9
+#define BOX_ENTRIES 10
+#define TXT_TEXT 11
+#define EDT_TEXT 12
+#define TXT_FUNCTIONTEXT 13
+#define TXT_FUNCTIONINFO 14
+#define TXT_DESCRIPTIONTEXT 15
+#define TXT_DESCRIPTIONINFO 16
+#define GRP_MENU 17
+#define TXT_GROUP 18
+#define BOX_GROUP 19
+#define TXT_FUNCTION 20
+#define BOX_FUNCTION 21
+#define GRP_FUNCTIONS 22
+
+#define STR_MENU_CFGITEM RID_SFX_MENU_START+1
+
+#define MN_CLIPBOARDFUNCS RID_SFX_MENU_START+1
+#endif
+
diff --git a/sfx2/source/menu/menu.src b/sfx2/source/menu/menu.src
new file mode 100644
index 000000000000..8540af820d95
--- /dev/null
+++ b/sfx2/source/menu/menu.src
@@ -0,0 +1,344 @@
+/*************************************************************************
+ *
+ * $RCSfile: menu.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "menu.hrc"
+#include "cntimage.hrc"
+
+String STR_MENU_CFGITEM
+{
+ TEXT = "Men" ;
+ TEXT [ English ] = "Menu" ;
+ TEXT [ norwegian ] = "Konfigurasjonsmeny" ;
+ TEXT [ italian ] = "Menu" ;
+ TEXT [ portuguese_brazilian ] = "Menu de Configurao" ;
+ TEXT [ portuguese ] = "Menu de configurao" ;
+ TEXT [ finnish ] = "Mritysvalikko" ;
+ TEXT [ danish ] = "Menu" ;
+ TEXT [ french ] = "Menu" ;
+ TEXT [ swedish ] = "Meny" ;
+ TEXT [ dutch ] = "Menu" ;
+ TEXT [ spanish ] = "Men" ;
+ TEXT [ english_us ] = "Configuration Menu" ;
+ TEXT[ chinese_simplified ] = "˵";
+ TEXT[ russian ] = "";
+ TEXT[ polish ] = "Menu";
+ TEXT[ japanese ] = "ƭ";
+ TEXT[ chinese_traditional ] = "\\";
+ TEXT[ arabic ] = "";
+ TEXT[ dutch ] = "Menu";
+ TEXT[ chinese_simplified ] = "˵";
+ TEXT[ greek ] = "";
+ TEXT[ korean ] = "޴";
+ TEXT[ turkish ] = "Mn";
+};
+
+Menu MN_CLIPBOARDFUNCS
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = SID_CUT ;
+ HelpID = SID_CUT ;
+ Text = "~Ausschneiden" ;
+ Text [ English ] = "Cu~t" ;
+ Text [ norwegian ] = "Klipp~ut" ;
+ Text [ italian ] = "Ta~glia" ;
+ Text [ portuguese_brazilian ] = "Co~rtar" ;
+ Text [ portuguese ] = "Co~rtar" ;
+ Text [ finnish ] = "~Leikkaa" ;
+ Text [ danish ] = "~Klip" ;
+ Text [ french ] = "~Couper" ;
+ Text [ swedish ] = "~Klipp ut" ;
+ Text [ dutch ] = "Kn~ippen" ;
+ Text [ spanish ] = "C~ortar" ;
+ Text [ english_us ] = "Cu~t" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "~Wytnij";
+ Text[ japanese ] = "؂(~T)";
+ Text[ chinese_traditional ] = "ŤU(~T)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "Kn~ippen";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "߶ (~T)";
+ Text[ turkish ] = "Kes";
+ };
+ MenuItem
+ {
+ Identifier = SID_COPY ;
+ HelpID = SID_COPY ;
+ Text = "~Kopieren" ;
+ Text [ English ] = "~Copy" ;
+ Text [ norwegian ] = "~Kopier" ;
+ Text [ italian ] = "~Copia" ;
+ Text [ portuguese_brazilian ] = "~Copiar" ;
+ Text [ portuguese ] = "~Copiar" ;
+ Text [ finnish ] = "~Kopioi" ;
+ Text [ danish ] = "K~opier" ;
+ Text [ french ] = "Co~pier" ;
+ Text [ swedish ] = "K~opiera" ;
+ Text [ dutch ] = "~Kopiren" ;
+ Text [ spanish ] = "~Copiar" ;
+ Text [ english_us ] = "~Copy" ;
+ Text[ chinese_simplified ] = "";
+ Text[ russian ] = "";
+ Text[ polish ] = "~Kopiuj";
+ Text[ japanese ] = "߰(~C)";
+ Text[ chinese_traditional ] = "ƻs(~C)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Kopiren";
+ Text[ chinese_simplified ] = "";
+ Text[ greek ] = "~";
+ Text[ korean ] = "(~C)";
+ Text[ turkish ] = "Kopyala";
+ };
+ MenuItem
+ {
+ Identifier = SID_PASTE ;
+ HelpID = SID_PASTE ;
+ Text = "E~infgen" ;
+ Text [ English ] = "~Paste" ;
+ Text [ norwegian ] = "~Paste" ;
+ Text [ italian ] = "~Incolla" ;
+ Text [ portuguese_brazilian ] = "~Colar" ;
+ Text [ portuguese ] = "Co~lar" ;
+ Text [ finnish ] = "L~iit" ;
+ Text [ danish ] = "St i~nd" ;
+ Text [ french ] = "C~oller" ;
+ Text [ swedish ] = "K~listra in" ;
+ Text [ dutch ] = "~Plakken" ;
+ Text [ spanish ] = "~Pegar" ;
+ Text [ english_us ] = "~Paste" ;
+ Text[ russian ] = "";
+ Text[ polish ] = "~Wklej";
+ Text[ japanese ] = "\\t(~P)";
+ Text[ chinese_simplified ] = "(~P)";
+ Text[ chinese_traditional ] = "J(~P)";
+ Text[ arabic ] = "";
+ Text[ dutch ] = "~Plakken";
+ Text[ chinese_simplified ] = "(~P)";
+ Text[ greek ] = "~";
+ Text[ korean ] = "ٿ ֱ(~P)";
+ Text[ turkish ] = "Yaptr";
+ };
+ };
+};
+
+#define CNT_IMAGELIST \
+ CNT_IMG_CHECKMARK ; \
+ CNT_IMG_OPENED_FOLDER ; \
+ CNT_IMG_CLOSED_FOLDER ; \
+ CNT_IMG_IS_READ ; \
+ CNT_IMG_IS_UNREAD ; \
+ CNT_IMG_IS_MARKED ; \
+ CNT_IMG_IS_UNMARKED ; \
+ CNT_IMG_BOX_POP3 ; \
+ CNT_IMG_DOC_NEWS ; \
+ CNT_IMG_FOLDER_NEWS ; \
+ CNT_IMG_FOLDER_SEARCH ; \
+ CNT_IMG_BOX_NEWS ; \
+ CNT_IMG_DOC_NEWS_READ ; \
+ CNT_IMG_FOLDER_NEWS_SUBSCR ; \
+ CNT_IMG_DOC_POP3 ; \
+ CNT_IMG_DOC_POP3_READ ; \
+ CNT_IMG_BOX_TRASH ; \
+ CNT_IMG_DOC_OUT_COMPLETE_LOC_SENT ; \
+ CNT_IMG_DOC_OUT_PART_LOC_SENT ; \
+ CNT_IMG_DOC_OUT_WRITTEN ; \
+ CNT_IMG_DOC_OUT_RECOV_LOC_ERROR ; \
+ CNT_IMG_DOC_OUT_NONRECOV_LOC_ERROR ; \
+ CNT_IMG_DOC_OUT_EXT_ERROR ; \
+ CNT_IMG_DOC_OUT_CONFIRMED ; \
+ CNT_IMG_BOX_IMAP ; \
+ CNT_IMG_FOLDER_SOMEREADNEWS ; \
+ CNT_IMG_DEV_FIXED ; \
+ CNT_IMG_DEV_REMOVEABLE ; \
+ CNT_IMG_DEV_CDROM ; \
+ CNT_IMG_DEV_NETWORK ; \
+ CNT_IMG_DEV_RAM ; \
+ CNT_IMG_BOX_VIM ; \
+ CNT_IMG_FOLDER_VIM_BBOARD ; \
+ CNT_IMG_FOLDER_VIM_INBOX ; \
+ CNT_IMG_BOX_FSYS ; \
+ CNT_IMG_BOX_SUBSCRIBE ; \
+ CNT_IMG_BOX_FTP ; \
+ CNT_IMG_BOX_OUT ; \
+ CNT_IMG_BMK_SUBSCR_DEFAULT ; \
+ CNT_IMG_BMK_SUBSCR_ERROR ; \
+ CNT_IMG_BMK_SUBSCR_IN_PROGRESS ; \
+ CNT_IMG_BOX_PROJECT ; \
+ CNT_IMG_FILE_TEXTFILE ; \
+ CNT_IMG_FILE_APP ; \
+ CNT_IMG_FILE_BITMAP ; \
+ CNT_IMG_FILE_TABLE ; \
+ CNT_IMG_FILE_WORD ; \
+ CNT_IMG_FILE_DXF ; \
+ CNT_IMG_FILE_GIF ; \
+ CNT_IMG_FILE_HELP ; \
+ CNT_IMG_FILE_HTML ; \
+ CNT_IMG_FILE_JPG ; \
+ CNT_IMG_FILE_MET ; \
+ CNT_IMG_FILE_PCD ; \
+ CNT_IMG_FILE_PCT ; \
+ CNT_IMG_FILE_PCX ; \
+ CNT_IMG_FILE_PNG ; \
+ CNT_IMG_FILE_MACROLIB ; \
+ CNT_IMG_FILE_DRAW ; \
+ CNT_IMG_FILE_DATABASE ; \
+ CNT_IMG_FILE_CALC ; \
+ CNT_IMG_FILE_IMPRESS ; \
+ CNT_IMG_FILE_CHART ; \
+ CNT_IMG_FILE_WRITER ; \
+ CNT_IMG_FILE_FRAMESET ; \
+ CNT_IMG_FILE_GALLERY ; \
+ CNT_IMG_FILE_SGF ; \
+ CNT_IMG_FILE_GLOBAL_DOC ; \
+ CNT_IMG_FILE_SGV ; \
+ CNT_IMG_FILE_SIM ; \
+ CNT_IMG_FILE_MESSAGE ; \
+ CNT_IMG_FILE_MATH ; \
+ CNT_IMG_FILE_SVHELP ; \
+ CNT_IMG_FILE_SVM ; \
+ CNT_IMG_FILE_TIFF ; \
+ CNT_IMG_FILE_WRITERTEMPLATE ; \
+ CNT_IMG_FILE_WMF ; \
+ CNT_IMG_FILE_EXCEL ; \
+ CNT_IMG_FILE_EXCELTEMPLATE ; \
+ CNT_IMG_IS_LINK ; \
+ CNT_IMG_FILE_SCHEDULE_CMBVIEW ; \
+ CNT_IMG_FILE_SCHEDULE_TVIEW ; \
+ CNT_IMG_FILE_SCHEDULE_EFORM ; \
+ CNT_IMG_FILE_SCHEDULE_TFORM ; \
+ CNT_IMG_DOC_POP3_SOMEREAD ; \
+ CNT_IMG_EXPLORERROOT ; \
+ CNT_IMG_DESKTOP ; \
+ CNT_IMG_DESKTOP_ACTIVE ; \
+ CNT_IMG_GALLERY ; \
+ CNT_IMG_GALLERY_THEME ; \
+ CNT_IMG_CDF_ITEM ; \
+ CNT_IMG_CDF_CHANNEL ; \
+ CNT_IMG_CDF_SUBCHANNEL ; \
+ CNT_IMG_SDC_CHANNEL ; \
+ CNT_IMG_DEFAULT ; \
+ CNT_IMG_BOX_SCHEDULE ; \
+ CNT_IMG_FLD_SCHEDULE_TASK ; \
+ CNT_IMG_FLD_SCHEDULE_EVT ; \
+ CNT_IMG_SCHEDULE_EVT ; \
+ CNT_IMG_SCHEDULE_TASK ; \
+ CNT_IMG_FILE_VOR ; \
+ CNT_IMG_BOOKMARKS ; \
+ CNT_IMG_USER2 ; \
+ CNT_IMG_USER3 ; \
+ CNT_IMG_USER4 ; \
+ CNT_IMG_USER5 ; \
+ CNT_IMG_USER6 ; \
+ CNT_IMG_USER7 ; \
+ CNT_IMG_USER8 ; \
+ CNT_IMG_USER9 ; \
+ CNT_IMG_USER10 ; \
+ CNT_IMG_USER11 ; \
+ CNT_IMG_USER12 ; \
+ CNT_IMG_SCHEDULE_SERVERS ; \
+ CNT_IMG_SCHEDULE_SERVER ; \
+ CNT_IMG_SCHEDULE_USER ; \
+ CNT_IMG_FILE_POWERPOINT ; \
+ CNT_IMG_DOC_POP3_NO_BODY_READ ; \
+ CNT_IMG_DOC_NEWS_NO_BODY ; \
+ CNT_IMG_DOC_POP3_NO_BODY ; \
+ CNT_IMG_DOC_NEWS_NO_BODY_READ ; \
+ CNT_IMG_FOLDER_SOMEREADNEWS_NO_BODY ; \
+ CNT_IMG_DOC_POP3_SOMEREAD_NO_BODY ; \
+ CNT_IMG_FOLDER_FAVORITE ; \
+ CNT_IMG_MARKFLAG ; \
+ CNT_IMG_FILE_IMPRESSPACKED ;
+
+ImageList RID_IMGLST_SMALL
+{
+ ImageBitmap = Bitmap { File = "sn_cnt.bmp" ; };
+ MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
+ IdList =
+ {
+ CNT_IMAGELIST
+ };
+ IdCount =
+ {
+ 126;
+ };
+};
+
+ImageList RID_IMGLST_BIG
+{
+ ImageBitmap = Bitmap { File = "ln_cnt.bmp" ; };
+ MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
+ IdList =
+ {
+ CNT_IMAGELIST
+ };
+ IdCount =
+ {
+ 126;
+ };
+};
+
+// ******************************************************************* EOF
+
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
new file mode 100644
index 000000000000..a79f6e27b3b2
--- /dev/null
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -0,0 +1,460 @@
+/*************************************************************************
+ *
+ * $RCSfile: mnuitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string> // HACK: prevent conflict between STLPORT and Workshop includes
+
+#ifndef _SFXENUMITEM_HXX //autogen
+#include <svtools/eitem.hxx>
+#endif
+#ifndef _SFXSTRITEM_HXX //autogen
+#include <svtools/stritem.hxx>
+#endif
+#pragma hdrstop
+
+#include "appdata.hxx"
+#include "sfx.hrc"
+#include "msgpool.hxx"
+#include "msgdescr.hxx"
+#include "msg.hxx"
+#include "bindings.hxx"
+#include "dispatch.hxx"
+#include "idpool.hxx"
+#include "sfxtypes.hxx"
+#include "macrconf.hxx"
+#include "virtmenu.hxx"
+#include "mnuitem.hxx"
+#include "tbxctrl.hxx"
+#include "arrdecl.hxx"
+#include "module.hxx"
+
+//====================================================================
+
+class SfxEnumMenu: public PopupMenu
+{
+ USHORT nSlot;
+ SfxEnumItem *pItem;
+ SfxBindings* pBindings;
+
+protected:
+ virtual void Select();
+
+public:
+ SfxEnumMenu( USHORT nSlot, SfxBindings* pBind, const SfxEnumItem &rItem );
+ ~SfxEnumMenu();
+};
+
+//=========================================================================
+
+SfxEnumMenu::SfxEnumMenu( USHORT nSlotId, SfxBindings* pBind, const SfxEnumItem &rItem ):
+ nSlot( nSlotId ),
+ pItem( (SfxEnumItem*) rItem.Clone() ),
+ pBindings( pBind )
+{
+ for ( USHORT nVal = 0; nVal < pItem->GetValueCount(); ++nVal )
+ InsertItem( nVal+1, pItem->GetValueTextByPos(nVal) );
+ CheckItem( pItem->GetValue() + 1, TRUE );
+}
+
+//-------------------------------------------------------------------------
+
+SfxEnumMenu::~SfxEnumMenu()
+{
+ delete pItem;
+}
+
+//-------------------------------------------------------------------------
+
+void SfxEnumMenu::Select()
+{
+ pItem->SetValue( GetCurItemId()-1 );
+ pBindings->GetDispatcher()->Execute( nSlot,
+ SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD,
+ pItem, 0L, 0L );
+}
+
+//--------------------------------------------------------------------
+
+void SfxMenuControl::SetOwnMenu( SfxVirtualMenu* pMenu )
+{
+ pOwnMenu = pMenu;
+ if ( pSubMenu )
+ pSubMenu->SetParentMenu( pMenu );
+}
+
+
+//--------------------------------------------------------------------
+
+// binds the instance to the specified id and assignes the title
+
+void SfxMenuControl::Bind( SfxVirtualMenu* pOwn,
+ USHORT nId, const String& rTitle,
+ const String &rHelpText,
+ SfxBindings &rBindings )
+{
+ DBG_MEMTEST();
+
+ aTitle = rTitle;
+ aHelpText = rHelpText;
+ pOwnMenu = pOwn;
+ pSubMenu = 0;
+ if ( pOwn )
+ SfxControllerItem::Bind(nId, &rBindings);
+ else
+ SetId( nId );
+
+ DBG( CheckConfigure_Impl(SFX_SLOT_MENUCONFIG) );
+}
+
+
+//--------------------------------------------------------------------
+
+// binds the item to the specified menu and assignes the title
+
+void SfxMenuControl::Bind( SfxVirtualMenu* pOwn,
+ USHORT nId, SfxVirtualMenu& rMenu,
+ const String& rTitle, const String &rHelpText,
+ SfxBindings &rBindings )
+{
+ DBG_MEMTEST();
+ if ( nId == SID_NONE )
+ nId = SFX_SLOTPOOL().GetIdPool().Get();
+ SetId( nId );
+ SetBindings(rBindings);
+ pOwnMenu = pOwn;
+ pSubMenu = &rMenu;
+ aTitle = rTitle;
+ aHelpText = rHelpText;
+}
+
+//--------------------------------------------------------------------
+
+// ctor for explicit registration
+
+SfxMenuControl::SfxMenuControl( BOOL bShowStrings )
+: pOwnMenu(0),
+ pSubMenu(0),
+ b_ShowStrings(bShowStrings)
+{
+ DBG_MEMTEST();
+}
+
+//--------------------------------------------------------------------
+
+// ctor for array
+
+SfxMenuControl::SfxMenuControl():
+ pOwnMenu(0),
+ pSubMenu(0),
+ b_ShowStrings(FALSE)
+{
+ DBG_MEMTEST();
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuControl::SfxMenuControl(USHORT nId, SfxBindings& rBindings):
+ SfxControllerItem(nId, rBindings),
+ pOwnMenu(0),
+ pSubMenu(0),
+ b_ShowStrings(FALSE)
+{
+ DBG_MEMTEST();
+
+ // Dieser Ctor soll es erm"oglichen, w"ahrend der Konstruktion schon
+ // auf die Bindings zur"uckgreifen zu k"onnen, aber gebunden wird
+ // wie immer erst sp"ater. Anwendung z.B. wenn im ctor der abgeleiteten
+ // Klasse z.B. ein StatusForwarder erzeugt werden soll.
+ UnBind();
+}
+
+
+//--------------------------------------------------------------------
+
+// dtor
+
+SfxMenuControl::~SfxMenuControl()
+{
+ if ( SfxMacroConfig::IsMacroSlot( GetId() ) )
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId(GetId());
+ delete pSubMenu;
+}
+
+void SfxMenuControl::RemovePopup()
+{
+ DELETEZ( pSubMenu );
+}
+
+//--------------------------------------------------------------------
+
+// changes the state in the virtual menu
+
+void SfxMenuControl::StateChanged
+(
+ USHORT nSID,
+ SfxItemState eState,
+ const SfxPoolItem* pState
+)
+{
+ DBG_MEMTEST();
+ DBG_ASSERT( nSID == GetId(), "strange SID" );
+ DBG_ASSERT( pOwnMenu != 0, "setting state to dangling SfxMenuControl" );
+
+ FASTBOOL bIsObjMenu =
+ GetId() >= SID_OBJECTMENU0 && GetId() < SID_OBJECTMENU_LAST;
+
+ // enabled/disabled-Flag pauschal korrigieren
+ pOwnMenu->EnableItem( GetId(), bIsObjMenu
+ ? 0 != pOwnMenu->GetSVMenu()->GetPopupMenu( GetId() )
+ : eState != SFX_ITEM_DISABLED );
+
+ if ( eState != SFX_ITEM_AVAILABLE )
+ {
+ // checken nur bei nicht-Object-Menus
+ if ( !bIsObjMenu )
+ pOwnMenu->CheckItem( GetId(), FALSE );
+
+ // SetItemText flackert in MenuBar insbes. unter OS/2 (Bug #20658)
+ if ( // !bIsObjMenu && nicht wegen "Format/Datenbank"
+ pOwnMenu->GetSVMenu()->GetItemText( GetId() ) != GetTitle() )
+ pOwnMenu->SetItemText( GetId(), GetTitle() );
+
+ return;
+ }
+
+ // ggf. das alte Enum-Menu entfernen/loeschen
+ //! delete pOwnMenu->GetMenu().ChangePopupMenu( GetId(), 0 );
+
+ FASTBOOL bCheck = FALSE;
+ if ( pState->ISA(SfxBoolItem) )
+ {
+ // BoolItem fuer checken
+ DBG_ASSERT( GetId() < SID_OBJECTMENU0 || GetId() > SID_OBJECTMENU_LAST,
+ "SfxBoolItem not allowed for SID_OBJECTMENUx" );
+ bCheck = ((const SfxBoolItem*)pState)->GetValue();
+ }
+ else if ( pState->ISA(SfxEnumItemInterface) &&
+ ((SfxEnumItemInterface *)pState)->HasBoolValue() )
+ {
+ // EnumItem wie Bool behandeln
+ DBG_ASSERT( GetId() < SID_OBJECTMENU0 || GetId() > SID_OBJECTMENU_LAST,
+ "SfxEnumItem not allowed for SID_OBJECTMENUx" );
+ bCheck = ((SfxEnumItemInterface *)pState)->GetBoolValue();
+ }
+ else if ( ( b_ShowStrings || bIsObjMenu ) && pState->ISA(SfxStringItem) )
+ // MenuText aus SfxStringItem holen
+ pOwnMenu->SetItemText( GetId(), ((const SfxStringItem*)pState)->GetValue());
+
+#ifdef enum_item_menu_ok
+ else if ( aType == TYPE(SfxEnumItem) )
+ {
+ DBG_ASSERT( GetId() < SID_OBJECTMENU0 || GetId() > SID_OBJECTMENU_LAST,
+ "SfxEnumItem not allowed for SID_OBJECTMENUx" );
+ pOwnMenu->GetMenu().ChangePopupMenu( GetId(), &GetBindings(),
+ new SfxEnumMenu( GetId(), *(const SfxEnumItem*)pState ) );
+ }
+#endif
+
+ pOwnMenu->CheckItem( GetId(), bCheck );
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuControl* SfxMenuControl::CreateImpl( USHORT nId, Menu &rMenu, SfxBindings &rBindings )
+{
+ return new SfxMenuControl( TRUE );
+}
+
+//--------------------------------------------------------------------
+
+void SfxMenuControl::RegisterControl( USHORT nSlotId, SfxModule *pMod )
+{
+ SFX_APP()->RegisterMenuControl( pMod, new SfxMenuCtrlFactory(
+ SfxMenuControl::CreateImpl, TYPE(SfxStringItem), nSlotId ) );
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuControl* SfxMenuControl::CreateControl( USHORT nId, Menu &rMenu, SfxBindings &rBindings )
+{
+ TypeId aSlotType = SFX_SLOTPOOL().GetSlotType(nId);
+ if ( aSlotType )
+ {
+ SfxApplication *pApp = SFX_APP();
+ SfxDispatcher *pDisp = rBindings.GetDispatcher_Impl();
+ SfxModule *pMod = pDisp ? pApp->GetActiveModule( pDisp->GetFrame() ) :0;
+ if ( pMod )
+ {
+ SfxMenuCtrlFactArr_Impl *pFactories = pMod->GetMenuCtrlFactories_Impl();
+ if ( pFactories )
+ {
+ SfxMenuCtrlFactArr_Impl &rFactories = *pFactories;
+ for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ ( ( rFactories[nFactory]->nSlotId == 0 ) ||
+ ( rFactories[nFactory]->nSlotId == nId) ) )
+ return rFactories[nFactory]->pCtor( nId, rMenu, rBindings );
+ }
+ }
+
+ SfxMenuCtrlFactArr_Impl &rFactories = pApp->GetMenuCtrlFactories_Impl();
+
+ for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ ( ( rFactories[nFactory]->nSlotId == 0 ) ||
+ ( rFactories[nFactory]->nSlotId == nId) ) )
+ return rFactories[nFactory]->pCtor( nId, rMenu, rBindings );
+ }
+ return 0;
+}
+
+
+
+BOOL SfxMenuControl::IsSpecialControl( USHORT nId, SfxBindings& rBindings )
+{
+ TypeId aSlotType = SFX_SLOTPOOL().GetSlotType( nId );
+ if ( aSlotType )
+ {
+ SfxApplication *pApp = SFX_APP();
+ SfxDispatcher *pDisp = rBindings.GetDispatcher_Impl();
+ SfxModule *pMod = pDisp ? pApp->GetActiveModule( pDisp->GetFrame() ) :0;
+ if ( pMod )
+ {
+ SfxMenuCtrlFactArr_Impl *pFactories = pMod->GetMenuCtrlFactories_Impl();
+ if ( pFactories )
+ {
+ SfxMenuCtrlFactArr_Impl &rFactories = *pFactories;
+ for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ ( ( rFactories[nFactory]->nSlotId == 0 ) ||
+ ( rFactories[nFactory]->nSlotId == nId) ) )
+ return TRUE;
+ }
+ }
+
+ SfxMenuCtrlFactArr_Impl &rFactories = pApp->GetMenuCtrlFactories_Impl();
+
+ for ( USHORT nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ if ( rFactories[nFactory]->nTypeId == aSlotType &&
+ ( ( rFactories[nFactory]->nSlotId == 0 ) ||
+ ( rFactories[nFactory]->nSlotId == nId) ) )
+ return TRUE;
+ }
+ return 0;
+}
+
+//--------------------------------------------------------------------
+
+PopupMenu* SfxMenuControl::GetPopup () const
+{
+ if (GetPopupMenu())
+ return (PopupMenu*)GetPopupMenu()->GetSVMenu();
+ else
+ return 0;
+}
+
+SFX_IMPL_MENU_CONTROL( SfxAppMenuControl_Impl, SfxStringItem );
+
+SfxAppMenuControl_Impl::SfxAppMenuControl_Impl(
+ USHORT nPos, Menu& rMenu, SfxBindings& rBindings )
+ : SfxMenuControl( nPos, rBindings ), pMenu(0)
+{
+ String aText = rMenu.GetItemText( nPos );
+ SfxApplication* pApp = SFX_APP();
+ SfxAppData_Impl* pImpl = pApp->Get_Impl();
+ PopupMenu* pView = pImpl->GetPopupMenu( nPos );
+ if ( pView )
+ rMenu.SetPopupMenu( nPos, pView );
+}
+
+SfxAppMenuControl_Impl::~SfxAppMenuControl_Impl()
+{
+}
+
+SfxUnoMenuControl* SfxMenuControl::CreateControl( const String& rCmd,
+ USHORT nId, Menu& rMenu, SfxBindings &rBindings, SfxVirtualMenu* pVirt )
+{
+ return new SfxUnoMenuControl( rCmd, nId, rMenu, rBindings, pVirt );
+}
+
+SfxUnoMenuControl::SfxUnoMenuControl( const String& rCmd, USHORT nId,
+ Menu& rMenu, SfxBindings& rBindings, SfxVirtualMenu* pVirt )
+ : SfxMenuControl( nId, rBindings )
+{
+ Bind( pVirt, nId, rMenu.GetItemText(nId),
+ rMenu.GetHelpText(nId), rBindings);
+ UnBind();
+ pUnoCtrl = new SfxUnoControllerItem( this, rBindings, rCmd );
+ pUnoCtrl->acquire();
+ pUnoCtrl->GetNewDispatch();
+}
+
+SfxUnoMenuControl::~SfxUnoMenuControl()
+{
+ pUnoCtrl->UnBind();
+ pUnoCtrl->release();
+}
+
+void SfxUnoMenuControl::Select()
+{
+ pUnoCtrl->Execute();
+}
+
+
diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
new file mode 100644
index 000000000000..34794d03cac2
--- /dev/null
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -0,0 +1,1426 @@
+/*************************************************************************
+ *
+ * $RCSfile: mnumgr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:52:35 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string> // HACK: prevent conflict between STLPORT and Workshop headers
+#include <cstdarg> // std::va_list
+
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _PSEUDO_HXX //autogen
+#include <so3/pseudo.hxx>
+#endif
+#ifndef _POINTR_HXX //autogen
+#include <vcl/pointr.hxx>
+#endif
+#pragma hdrstop
+
+#include "mnumgr.hxx"
+
+#define _SVSTDARR_USHORTS
+#include <svtools/svstdarr.hxx>
+
+#include "virtmenu.hxx"
+#include "msg.hxx"
+#include "dispatch.hxx"
+#include "minstack.hxx"
+#include "app.hxx"
+#include "sfxtypes.hxx"
+#include "bindings.hxx"
+#include "mnucfga.hxx"
+#include "sfxresid.hxx"
+#include "macrconf.hxx"
+#include "msgpool.hxx"
+
+// SFX_INIMANAGER()
+#include "inimgr.hxx"
+
+#include "sfx.hrc"
+#include "menu.hrc"
+
+static const USHORT nCompatVersion = 4;
+static const USHORT nVersion = 5;
+
+//=========================================================================
+
+DECL_PTRSTACK(SfxMenuCfgItemArrStack, SfxMenuCfgItemArr*, 4, 4 );
+
+//-------------------------------------------------------------------------
+
+void TryToHideDisabledEntries_Impl( Menu* pMenu )
+{
+ DBG_ASSERT( pMenu, "invalid menu" );
+ if ( !SFX_INIMANAGER()->IsDontHideDisabledEntries() )
+ pMenu->SetMenuFlags( pMenu->GetMenuFlags() | MENU_FLAG_HIDEDISABLEDENTRIES );
+}
+
+//-------------------------------------------------------------------------
+
+class SfxMenuIter_Impl
+
+/* [Beschreibung]
+
+ Mit solchen Instanzen wird beim Auslesen des Men"us f"ur die
+ Konfiguration ein Stack gebildet, um die Iterator-Position zu
+ bestimmen.
+
+ Die Instanzen l"oschen sich selbst, wenn der Stack abgebaut wird.
+*/
+
+{
+ SfxMenuIter_Impl* _pPrev; // der vorherige auf dem Stack
+ Menu* _pMenu; // das Men"u "uber das gerade iteriert wird
+ Menu* _pPopup; // Popup an dieser Pos falls noch zu durchl.
+ USHORT _nPos; // die Position des Iterators in 'pMenu'
+ USHORT _nId; // Id an Position '_nPos'
+ USHORT _nLevel; // Schachteltiefe
+
+ SfxMenuIter_Impl( Menu *pMenu,
+ SfxMenuIter_Impl *pPrev = 0 );
+
+ ~SfxMenuIter_Impl()
+ {}
+
+public:
+ static SfxMenuIter_Impl* Create( Menu *pMenu )
+ { return ( pMenu && pMenu->GetItemCount() )
+ ? new SfxMenuIter_Impl( pMenu )
+ : 0; }
+
+ USHORT GetLevel() const
+ { return _nLevel; }
+
+ Menu* GetMenu() const
+ { return _pMenu; }
+
+ USHORT GetItemId() const
+ { return _nId; }
+
+ MenuItemType GetItemType() const
+ { return _pMenu->GetItemType( _nPos ); }
+
+ Menu* GetPopupMenu() const
+ { return _pPopup; }
+
+ String GetItemText() const
+ { return _pMenu->GetItemText( _nId ); }
+
+ String GetItemHelpText() const
+ { return _pMenu->GetHelpText( _nId ); }
+
+ BOOL IsSeparator() const
+ { return MENUITEM_SEPARATOR == GetItemType(); }
+
+ SfxMenuIter_Impl* NextItem();
+
+ void RemovePopup()
+ { _pPopup = NULL; }
+};
+
+//=========================================================================
+
+SfxMenuIter_Impl::SfxMenuIter_Impl
+(
+ Menu* pMenu,
+ SfxMenuIter_Impl* pPrev
+)
+: _pPrev( pPrev ),
+ _pMenu( pMenu ),
+ _nPos( 0 ),
+ _nId( pMenu->GetItemId(0) ),
+ _nLevel( pPrev ? ( pPrev->_nLevel + 1 ) : 0 )
+{
+ _pPopup = pMenu->GetPopupMenu( _nId );
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuIter_Impl* SfxMenuIter_Impl::NextItem()
+{
+ // noch nicht durchlaufenes Popup vorhanden
+ if ( _pPopup )
+ {
+ // dann bevor es weitergeht, das Popup durchlaufen
+ Menu *pSub = _pPopup;
+ _pPopup = 0; // als durchlaufen markieren
+ if ( pSub->GetItemCount() )
+ return new SfxMenuIter_Impl( pSub, this );
+ }
+
+ // zur n"achsten Position in diesem Men"u
+ if ( ++_nPos >=_pMenu->GetItemCount() )
+ {
+ // Men"u zuende => eine Stack-Etage hoch
+ SfxMenuIter_Impl *pPrev = _pPrev;
+ delete this;
+ return pPrev ? pPrev->NextItem() : 0;
+ }
+
+ // bleibt in diesem Menu
+ _nId = _pMenu->GetItemId(_nPos);
+ _pPopup = _pMenu->GetPopupMenu(_nId);
+
+ // nicht alles wird angezeigt
+ if ( _nId >= SID_PICK1 && _nId <= SID_PICK9 )
+ return NextItem();
+
+ // nicht alle Popups werden durchlaufen
+ if ( _nId == SID_OBJECT ||
+ ( _nId >= SID_OBJECTMENU0 && _nId <= SID_OBJECTMENU_LAST ) )
+ _pPopup = 0;
+
+ // diesen Eintrag nehmen
+ return this;
+}
+
+//=========================================================================
+
+void SfxMenuManager::Construct( SfxVirtualMenu& rMenu )
+{
+ DBG_MEMTEST();
+ pMenu = &rMenu;
+
+ // set the handlers
+ Menu *pSvMenu = pMenu->GetSVMenu();
+ pSvMenu->SetSelectHdl( LINK(this, SfxMenuManager, Select) );
+ TryToHideDisabledEntries_Impl( pSvMenu );
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuManager::SfxMenuManager( const ResId& rResId, SfxBindings &rBindings, BOOL bBar )
+: SfxConfigItem(rResId.GetId()),
+ bMenuBar(bBar),
+ pMenu(0),
+ pOldMenu(0),
+ pResMgr(rResId.GetResMgr()),
+ pBindings(&rBindings)
+{
+ bOLE = FALSE;
+ bAddClipboardFuncs = FALSE;
+ DBG_MEMTEST();
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuManager::~SfxMenuManager()
+{
+ DBG_MEMTEST();
+ pBindings->ENTERREGISTRATIONS();
+ delete pMenu;
+ pBindings->LEAVEREGISTRATIONS();
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxMenuManager::Initialize(BOOL bOLEServer)
+{
+ BOOL bRet;
+ if (!bOLEServer)
+ {
+ bRet = SfxConfigItem::Initialize();
+ }
+ else
+ {
+ bOLE = TRUE;
+ bRet = SfxConfigItem::Initialize();
+ }
+
+ return bRet;
+}
+
+//--------------------------------------------------------------------
+
+// executes the function for the selected item
+
+IMPL_LINK( SfxMenuManager, Select, Menu *, pMenu )
+{
+ DBG_MEMTEST();
+
+ USHORT nId = (USHORT) pMenu->GetCurItemId();
+ if ( pBindings->IsBound(nId) )
+ // normal function
+ pBindings->Execute( nId );
+ else
+ // special menu function
+ pBindings->GetDispatcher_Impl()->Execute( nId );
+
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+// resets the item iterator, FALSE if none
+
+BOOL SfxMenuManager::FirstItem()
+{
+ pIterator = SfxMenuIter_Impl::Create( pMenu->GetSVMenu() );
+ return 0 != pIterator;
+}
+
+//--------------------------------------------------------------------
+
+// skips to the next item, FALSE if no more
+
+BOOL SfxMenuManager::NextItem()
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ pIterator = pIterator->NextItem();
+ return 0 != pIterator;
+}
+
+//--------------------------------------------------------------------
+
+// TRUE if current item is a binding
+
+BOOL SfxMenuManager::IsBinding() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ USHORT nId = pIterator->GetItemId();
+ if ( pIterator->GetPopupMenu() && nId > SID_SFX_START )
+ if ( !SfxMenuControl::IsSpecialControl( nId, *pBindings ) )
+ // "Unechtes" Binding: Popup mit SlotId
+ return FALSE;
+ return nId >= SID_SFX_START;
+}
+
+//--------------------------------------------------------------------
+
+// TRUE if current item is a separator
+
+BOOL SfxMenuManager::IsSeparator() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ return pIterator->IsSeparator();
+}
+
+//--------------------------------------------------------------------
+
+// TRUE if current item is a popup; may be also a binding
+
+BOOL SfxMenuManager::IsPopup() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ return 0 != pIterator->GetPopupMenu();
+}
+
+//--------------------------------------------------------------------
+
+// returns sub-menu-level
+
+USHORT SfxMenuManager::GetLevel() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ return pIterator->GetLevel();
+}
+
+//--------------------------------------------------------------------
+
+// id of binding if IsBinding()
+
+USHORT SfxMenuManager::GetItemId() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+#ifdef DBG_UTIL
+ ByteString aStr( U2S(pIterator->GetItemText()) );
+#endif
+
+ USHORT nId = pIterator->GetItemId();
+
+#ifdef DBG_UTIL
+ const SfxSlot *pSlot = nId ? SFX_SLOTPOOL().GetSlot( nId ) : NULL;
+ if ( pSlot && !pSlot->IsMode( SFX_SLOT_MENUCONFIG ) && nId != SID_MDIWINDOWLIST )
+ {
+ ByteString aStr( "Slot ");
+ aStr += ByteString::CreateFromInt32( nId );
+ aStr += ByteString( " : MenuConfig fehlt!" );
+ DBG_ERROR( aStr.GetBuffer() );
+ }
+#endif
+
+ if ( pIterator->GetPopupMenu() )
+ {
+#if defined( DBG_UTIL ) && !defined( WIN )
+ aStr += ByteString( " : Popups muessen Ids != 0 haben!" );
+ DBG_ASSERT( nId, aStr.GetBuffer() );
+#endif
+ return nId;
+ }
+ else
+ {
+#if defined( DBG_UTIL ) && !defined( WIN )
+ aStr += ByteString( " : Menue-Entries muessen Ids > SID_SFX_START haben!" );
+ DBG_ASSERT( nId > SID_SFX_START || pIterator->IsSeparator(), aStr.GetBuffer() );
+#endif
+ return nId > SID_SFX_START ? nId : SID_NONE;
+ }
+}
+
+//--------------------------------------------------------------------
+
+// title of popup if IsPopup()
+
+String SfxMenuManager::GetTitle() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ return pIterator->GetItemText();
+}
+
+//--------------------------------------------------------------------
+
+String SfxMenuManager::GetHelpText() const
+{
+ DBG_ASSERT( pIterator, "invalid iterator state" );
+
+ return pIterator->GetItemHelpText();
+}
+
+//--------------------------------------------------------------------
+
+// call this before reconfiguring
+
+void SfxMenuManager::Clear()
+{
+ pBindings->ENTERREGISTRATIONS();
+ pOldMenu = pMenu;
+
+ // create the root config and a stack for the current sub-configs
+ pCfg = new SfxMenuCfgItemArr;
+ pCfgStack = new SfxMenuCfgItemArrStack;
+ pCfgStack->Push( pCfg );
+}
+
+//--------------------------------------------------------------------
+
+// call this after reconfiguring
+
+void SfxMenuManager::Reconfigure()
+{
+ SfxVirtualMenu *pVMenu;
+ Menu *pSVMenu;
+ if (bMenuBar )
+ {
+ pSVMenu = new MenuBar;
+ }
+ else
+ pSVMenu = new PopupMenu;
+
+ TryToHideDisabledEntries_Impl( pSVMenu );
+ ConstructSvMenu( pSVMenu, *pCfg );
+
+ pVMenu = new SfxVirtualMenu( pSVMenu, FALSE, *pBindings, FALSE );
+ Construct(*pVMenu);
+ if ( bMenuBar && pOldMenu )
+ {
+ SfxMenuBarManager *pBar = (SfxMenuBarManager*) this;
+ MenuBar* pOldBar = (MenuBar*) pOldMenu->GetSVMenu();
+ MenuBar* pSvBar = (MenuBar*) GetMenu()->GetSVMenu();
+ if ( pBar->GetWindow()->GetMenuBar() == pOldBar )
+ //! jetzt im VirtMenu: InvalidateKeyCodes();
+ pBar->GetWindow()->SetMenuBar( pSvBar );
+ }
+
+ delete pOldMenu;
+ pOldMenu = 0;
+ pBindings->LEAVEREGISTRATIONS();
+ SetDefault( FALSE );
+}
+
+//--------------------------------------------------------------------
+
+// Baut aus einem ConfigItemArray rekursiv das StarView-Menu auf
+
+void SfxMenuManager::ConstructSvMenu( Menu* pSuper, SfxMenuCfgItemArr& rCfg)
+{
+ USHORT nCount = rCfg.Count();
+ for ( USHORT n = 0; n < rCfg.Count(); ++n )
+ {
+ SfxMenuCfgItem *pmIt=rCfg[n];
+ if ( rCfg[n]->pPopup )
+ {
+ pSuper->InsertItem( rCfg[n]->nId, rCfg[n]->aTitle );
+ pSuper->SetHelpId( rCfg[n]->nId, (ULONG) rCfg[n]->nId );
+ PopupMenu *pPopupMenu;
+ pPopupMenu = new PopupMenu;
+ pSuper->SetPopupMenu( rCfg[n]->nId, pPopupMenu );
+ ConstructSvMenu( pPopupMenu, *(rCfg[n]->pPopup) );
+ }
+ else if ( rCfg[n]->nId )
+ {
+ pSuper->InsertItem( rCfg[n]->nId, rCfg[n]->aTitle );
+ pSuper->SetHelpId( rCfg[n]->nId, (ULONG) rCfg[n]->nId );
+ }
+ else
+ {
+ pSuper->InsertSeparator();
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+// Baut aus einem ConfigStream rekursiv das StarView-Menu auf
+
+void SfxMenuManager::ConstructSvMenu( Menu* pSuper, SvStream& rStream,
+ BOOL bWithHelp, BOOL bCompat )
+{
+ SvUShorts aShorts;
+
+ USHORT nCount = 0xFFFF;
+ if ( bCompat )
+ {
+ // Alte Eintr"age wg. Kompatibilit"at einlesen
+ USHORT nCtrls,nId;
+ rStream >> nCtrls;
+ for (USHORT i=0; i<nCtrls; i++)
+ rStream >> nId;
+ rStream >> nCount;
+ }
+
+ char cTag;
+ for ( USHORT n=0; n<nCount; n++ )
+ {
+ rStream >> cTag;
+ String aTitle;
+ USHORT nId;
+
+ switch ( cTag )
+ {
+ case 'S':
+ pSuper->InsertSeparator();
+ break;
+
+ case 'I':
+ {
+ rStream >> nId;
+ rStream.ReadByteString( aTitle, RTL_TEXTENCODING_UTF8 );
+
+ String aHelpText;
+ if ( bWithHelp )
+ rStream.ReadByteString( aHelpText, RTL_TEXTENCODING_UTF8 );
+
+ if (nId >= SID_MACRO_START && nId <= SID_MACRO_END)
+ {
+ SfxMacroInfo aInfo;
+ rStream >> aInfo;
+ nId = aInfo.GetSlotId();
+ }
+
+ pSuper->InsertItem( nId, aTitle );
+ pSuper->SetHelpId( nId, (ULONG) nId );
+ if ( bWithHelp )
+ pSuper->SetHelpText( nId, aHelpText );
+ break;
+ }
+
+ case 'P':
+ {
+ rStream >> nId;
+ rStream.ReadByteString( aTitle, RTL_TEXTENCODING_UTF8 );
+
+ if ( nId >= SID_MACRO_START && nId <= SID_MACRO_END ||
+ nId < SID_SFX_START )
+ {
+ // Bug im Cfg-Dialog: Popups mit Macro-SlotIds
+ USHORT i;
+ for ( i=0; i<aShorts.Count(); i++ )
+ {
+ // Erste Id nehmen, deren Wert gr"o\ser ist als die Position
+ if ( aShorts[i] > i+1 )
+ break;
+ }
+
+ nId = i+1;
+ aShorts.Insert( nId, i );
+ }
+
+ String aHelpText;
+ if ( bWithHelp )
+ rStream.ReadByteString( aHelpText, RTL_TEXTENCODING_UTF8 );
+
+ pSuper->InsertItem( nId, aTitle );
+ pSuper->SetHelpId( nId, (ULONG) nId );
+ if ( bWithHelp )
+ pSuper->SetHelpText( nId, aHelpText );
+
+ PopupMenu *pPopupMenu;
+ pPopupMenu = new PopupMenu;
+ pSuper->SetPopupMenu( nId, pPopupMenu );
+ ConstructSvMenu( pPopupMenu, rStream, bWithHelp, bCompat );
+ break;
+ }
+
+ case 'E':
+ {
+ n = nCount-1; // Ende
+ break;
+ }
+
+ default:
+ {
+ // Wenn ein Fehler aufgetreten ist, sollte man besser aufh"oren
+ DBG_ERROR( "invalid item type in menu-config" );
+ n = nCount-1; // Ende
+ break;
+ }
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+// append a binding by function-id
+
+void SfxMenuManager::AppendItem(const String &rText,
+ const String &rHelpText, USHORT nId )
+{
+ SfxMenuCfgItem* pItem = new SfxMenuCfgItem;
+ pItem->nId = nId;
+ if (nId >= SID_MACRO_START && nId <= SID_MACRO_END)
+ SFX_APP()->GetMacroConfig()->RegisterSlotId(nId);
+ pItem->aTitle = rText;
+ pItem->aHelpText = rHelpText;
+ pItem->pPopup = 0;
+ pCfgStack->Top()->Append( pItem );
+}
+
+//--------------------------------------------------------------------
+
+// append a separator
+
+void SfxMenuManager::AppendSeparator()
+{
+ SfxMenuCfgItem* pItem = new SfxMenuCfgItem;
+ pItem->nId = 0;
+ pItem->pPopup = 0;
+ pCfgStack->Top()->Append( pItem );
+}
+
+//--------------------------------------------------------------------
+
+// append a popup (sub)-menu
+
+void SfxMenuManager::EnterPopup(const String& rTitle,
+ const String& rHelpText, USHORT nId )
+{
+ SfxMenuCfgItem* pItem = new SfxMenuCfgItem;
+ pItem->nId = nId;
+ pItem->aTitle = rTitle;
+ pItem->aHelpText = rHelpText;
+ pItem->pPopup = new SfxMenuCfgItemArr;
+ pCfgStack->Top()->Append( pItem );
+ pCfgStack->Push( pItem->pPopup );
+}
+
+//--------------------------------------------------------------------
+
+// end a sub-menu
+
+void SfxMenuManager::LeavePopup()
+{
+ SfxMenuCfgItemArr* pArr = pCfgStack->Top();
+ SvUShorts aShorts;
+
+ USHORT n;
+ for ( n=0; n<pArr->Count(); n++ )
+ {
+ USHORT nId = (*pArr)[n]->nId;
+ if ( nId < SID_SFX_START )
+ {
+ // Alle vewendeten Popup-Ids < 5000 merken
+ USHORT i;
+ for ( i=0; i<aShorts.Count(); i++ )
+ {
+ if ( aShorts[i] > nId )
+ break;
+ }
+
+ aShorts.Insert( nId, i );
+ }
+ }
+
+ for ( n=0; n<pArr->Count(); n++ )
+ {
+ SfxMenuCfgItem* pItem = (*pArr)[n];
+ if ( pItem->pPopup && pItem->nId >= SID_MACRO_START && pItem->nId <= SID_MACRO_END )
+ {
+ // Weil in dem Fucking-ConfigDialog Entries und Popups bunt
+ // vermischt sind, kann auch ein Popup eine Macro-Id haben, die
+ // mu\s nat"urlich weg
+ SFX_APP()->GetMacroConfig()->ReleaseSlotId( pItem->nId );
+
+ // Nun noch eine erlaubte Id suchen
+ USHORT nCount = aShorts.Count();
+ USHORT i;
+ for ( i=0; i<nCount; i++ )
+ {
+ if ( aShorts[i] > i+1 )
+ // Erste Id nehmen, deren Wert gr"o\ser ist als die Position
+ break;
+ }
+
+ pItem->nId = i+1;
+ aShorts.Insert( i+1, i );
+ }
+ }
+
+ pCfgStack->Pop();
+}
+
+//--------------------------------------------------------------------
+
+// reload all KeyCodes
+
+void SfxMenuManager::InvalidateKeyCodes()
+{
+ if ( pMenu )
+ pMenu->InvalidateKeyCodes();
+}
+
+//====================================================================
+
+// creates a menu-manager and loads it from resource RID_DEFAULTMENU or RID_DEFAULTPLUGINMENU
+
+SfxMenuBarManager::SfxMenuBarManager( SfxBindings& rBindings, BOOL bPlugin ) :
+
+ SfxMenuManager( bPlugin ? RID_DEFAULTPLUGINMENU : RID_DEFAULTMENU, rBindings, TRUE ),
+
+ pWindow( rBindings.GetSystemWindow() )
+
+{
+ DBG_MEMTEST();
+
+ // initialize ObjectMenus
+ for ( int n = 0; n < 4; ++n )
+ {
+ aObjMenus[n].nId = 0;
+ aObjMenus[n].pPMMgr = NULL;
+ aObjMenus[n].pResMgr = NULL;
+ }
+}
+
+//--------------------------------------------------------------------
+
+// creates a menu-manager and loads it from a resource
+
+SfxMenuBarManager::SfxMenuBarManager( const ResId& rResId, SfxBindings &rBindings ) :
+
+ SfxMenuManager( rResId, rBindings, TRUE ),
+
+ pWindow( rBindings.GetSystemWindow() )
+
+{
+ DBG_MEMTEST();
+
+ // initialize ObjectMenus
+ for ( int n = 0; n < 4; ++n )
+ {
+ aObjMenus[n].nId = 0;
+ aObjMenus[n].pPMMgr = NULL;
+ aObjMenus[n].pResMgr = NULL;
+ }
+}
+
+//--------------------------------------------------------------------
+
+SfxMenuBarManager::~SfxMenuBarManager()
+{
+ DBG_MEMTEST();
+
+ DBG_ASSERT(!aObjMenus[0].pPMMgr || !aObjMenus[1].pPMMgr ||
+ !aObjMenus[2].pPMMgr || !aObjMenus[3].pPMMgr,
+ "da sind noch ObjectMenus" );
+
+ ResetObjectMenus();
+ UpdateObjectMenus();
+
+ MenuBar* pSvBar = (MenuBar*) GetMenu()->GetSVMenu();
+ if ( pWindow && pWindow->GetMenuBar() == pSvBar )
+ pWindow->SetMenuBar( 0 );
+}
+
+//====================================================================
+
+// creates a menu-manager and loads it from a stream
+
+SfxPopupMenuManager::SfxPopupMenuManager(const ResId& rResId, SfxBindings &rBindings )
+ : SfxMenuManager( rResId, rBindings, FALSE )
+ , pSVMenu( NULL )
+{
+ DBG_MEMTEST();
+ SetInternal(TRUE);
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::RemoveDisabledEntries()
+{
+ if ( pSVMenu )
+ TryToHideDisabledEntries_Impl( pSVMenu );
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxPopupMenuManager::Execute( const Point& rPos, Window* pWindow )
+{
+ DBG_MEMTEST();
+ return ( (PopupMenu*) GetMenu()->GetSVMenu() )->Execute( pWindow, rPos );
+}
+
+//--------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( SfxPopupMenuManager, SelectHdl, void *, pvoid )
+{
+ return 1;
+}
+IMPL_LINK_INLINE_END( SfxPopupMenuManager, SelectHdl, void *, pvoid )
+
+
+//--------------------------------------------------------------------
+
+USHORT SfxPopupMenuManager::Execute( Window* pWindow, va_list pArgs, const SfxPoolItem *pArg1 )
+{
+ DBG_MEMTEST();
+
+ PopupMenu* pMenu = ( (PopupMenu*)GetMenu()->GetSVMenu() );
+ pMenu->SetSelectHdl( LINK( this, SfxPopupMenuManager, SelectHdl ) );
+ USHORT nId = pMenu->Execute( pWindow, pWindow->GetPointerPosPixel() );
+ pMenu->SetSelectHdl( Link() );
+
+ if ( nId )
+ GetBindings().GetDispatcher()->_Execute( nId, SFX_CALLMODE_RECORD, pArgs, pArg1 );
+
+ return nId;
+}
+
+//--------------------------------------------------------------------
+
+USHORT SfxPopupMenuManager::Execute( Window* pWindow, const SfxPoolItem *pArg1, ... )
+{
+ DBG_MEMTEST();
+
+ va_list pArgs;
+ va_start(pArgs, pArg1);
+
+ return (Execute( pWindow, pArgs, pArg1 ));
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::StartInsert()
+{
+ ResId aResId(GetType());
+ aResId.SetRT(RSC_MENU);
+ aResId.SetResMgr(pResMgr);
+ pSVMenu = new PopupMenu( aResId );
+ TryToHideDisabledEntries_Impl( pSVMenu );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::EndInsert()
+{
+ pBindings->ENTERREGISTRATIONS();
+ pMenu = new SfxVirtualMenu( pSVMenu, FALSE, *pBindings, TRUE, TRUE );
+ Construct( *pMenu );
+ pBindings->LEAVEREGISTRATIONS();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::InsertSeparator( USHORT nPos )
+{
+ pSVMenu->InsertSeparator( nPos );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::InsertItem( USHORT nId, const String& rName, MenuItemBits nBits, USHORT nPos )
+{
+ pSVMenu->InsertItem( nId, rName, nBits,nPos );
+ pSVMenu->SetHelpId( nId, (ULONG) nId );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::RemoveItem( USHORT nId )
+{
+ pSVMenu->RemoveItem( nId );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxPopupMenuManager::CheckItem( USHORT nId, BOOL bCheck )
+{
+ pSVMenu->CheckItem( nId, bCheck );
+}
+
+
+//--------------------------------------------------------------------
+
+// stores the complete menu-configuration
+
+BOOL SfxMenuManager::Store( SvStream& rStream )
+{
+ DBG_MEMTEST();
+ return StreamMenu( pMenu->GetSVMenu(), rStream, FALSE );
+/*
+ LanguageType eLangType = SFX_APP()->GetAppInternational().GetLanguage();
+ if (eLangType == LANGUAGE_SYSTEM)
+ {
+ eLangType = System::GetLanguage();
+ }
+
+ rStream << nVersion
+ << (USHORT) eLangType;
+
+ FirstItem();
+ USHORT nLevel = GetLevel();
+ do
+ {
+ while ( GetLevel() < nLevel )
+ {
+ // Ein Popup wurde verlassen
+ // Ende-Markierung setzen
+ rStream << 'E';
+ nLevel--;
+ }
+
+ nLevel = GetLevel();
+
+ if ( IsSeparator() )
+ {
+ rStream << 'S';
+ }
+ else
+ {
+ USHORT nId = GetItemId();
+ String aTitle = GetTitle();
+ if( !IsPopup() )
+ {
+ rStream << 'I';
+ rStream << nId << aTitle;
+ if (nId >= SID_MACRO_START && nId <= SID_MACRO_END)
+ // MacroInfo speichern
+ rStream << *(SFX_APP()->GetMacroConfig()->GetMacroInfo(nId));
+ }
+ else
+ {
+ rStream << 'P';
+ rStream << nId << aTitle;
+ if ( !pIterator->GetPopupMenu()->GetItemCount() )
+ rStream << 'E';
+ }
+ }
+ }
+ while ( NextItem() );
+
+ // Letzte Ende-Markierung setzen
+ rStream << 'E';
+
+ // Ende-Markierung f"ur MenuBar setzen
+ rStream << 'E';
+*/
+}
+
+//-------------------------------------------------------------------------
+
+void SfxMenuManager::SetForceCtrlCreateMode( BOOL bCreate )
+{
+ bOLE = TRUE;
+}
+
+//--------------------------------------------------------------------
+
+int SfxMenuManager::Load_Impl( SvStream& rStream, BOOL bForPlugComm )
+{
+ DBG_MEMTEST();
+
+ // Config-Version und Sprache der Menuetexte
+ USHORT nFileVersion, nLanguage;
+ rStream >> nFileVersion;
+ if(nFileVersion < nCompatVersion)
+ return SfxConfigItem::WARNING_VERSION;
+
+ rStream >> nLanguage;
+ LanguageType eLangType = Application::GetAppInternational().GetLanguage();
+ if (eLangType == LANGUAGE_SYSTEM)
+ {
+ eLangType = System::GetLanguage();
+ }
+
+ if ( eLangType != (LanguageType) nLanguage && !bForPlugComm )
+ {
+ // Wenn die Text f"ur eine andere Sprache sind, Default-Config
+ // verwenden. Fehlermeldung ??
+ UseDefault();
+ return SfxConfigItem::ERR_OK;
+ }
+
+ SfxVirtualMenu *pOldVirtMenu=0;
+ if (pMenu)
+ {
+ // Es wird umkonfiguriert
+ pOldVirtMenu = pMenu;
+ pBindings->ENTERREGISTRATIONS();
+ }
+
+ BOOL bCompat = FALSE;
+ if ( nFileVersion == nCompatVersion )
+ bCompat = TRUE;
+ BOOL bWithHelp = FALSE;
+ if ( bCompat || bForPlugComm )
+ bWithHelp = TRUE;
+
+ Menu *pSVMenu;
+ if (bMenuBar )
+ {
+ pSVMenu = new MenuBar;
+ TryToHideDisabledEntries_Impl( pSVMenu );
+ }
+ else
+ pSVMenu = new PopupMenu;
+
+ ConstructSvMenu( pSVMenu, rStream, bWithHelp, bCompat );
+
+ SfxVirtualMenu *pVMenu = new SfxVirtualMenu( pSVMenu, bWithHelp, *pBindings, bOLE );
+ Construct(*pVMenu);
+
+ if ( bMenuBar && pOldVirtMenu )
+ {
+ SfxMenuBarManager *pBar = (SfxMenuBarManager*) this;
+ MenuBar* pOldBar = (MenuBar*) pOldVirtMenu->GetSVMenu();
+ MenuBar* pSvBar = (MenuBar*) GetMenu()->GetSVMenu();
+ if ( pBar->GetWindow()->GetMenuBar() == pOldBar )
+ //! jetzt im VirtMenu: InvalidateKeyCodes();
+ pBar->GetWindow()->SetMenuBar( pSvBar );
+ }
+
+ if (pOldVirtMenu)
+ {
+ delete pOldVirtMenu;
+ pBindings->LEAVEREGISTRATIONS();
+ }
+
+ return SfxConfigItem::ERR_OK;
+}
+
+//-------------------------------------------------------------------------
+
+int SfxMenuManager::Load( SvStream& rStream )
+{
+ return Load_Impl( rStream, FALSE );
+}
+
+//--------------------------------------------------------------------
+
+void SfxMenuManager::UseDefault()
+{
+ DBG_MEMTEST();
+
+ SfxApplication *pSfxApp = SFX_APP();
+ SfxVirtualMenu *pOldVirtMenu=0;
+ if (pMenu)
+ {
+ pOldVirtMenu = pMenu;
+ pBindings->ENTERREGISTRATIONS();
+ }
+
+ SfxVirtualMenu *pVMenu = 0;
+ if ( bMenuBar )
+ {
+ ResId aId( GetType(), pResMgr );
+ aId.SetRT(RSC_MENU);
+ if ( Resource::GetResManager()->IsAvailable( aId ) )
+ {
+ MenuBar *pSvMenu = new MenuBar( ResId(GetType(), pResMgr) );
+ TryToHideDisabledEntries_Impl( pSvMenu );
+ pVMenu = new SfxVirtualMenu( pSvMenu, FALSE, *pBindings, bOLE, TRUE );
+ }
+ else
+ {
+ MenuBar *pSvMenu = new MenuBar;
+ pVMenu = new SfxVirtualMenu( pSvMenu, FALSE, *pBindings, bOLE, TRUE );
+ }
+ }
+ else
+ {
+ ResId aResId(GetType());
+ aResId.SetRT(RSC_MENU);