Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sfx2 / doctempl.hxx
blobe44040f9d8723597a45c0afadaca2decff0981f2
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: doctempl.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SFXDOCTEMPL_HXX
31 #define _SFXDOCTEMPL_HXX
33 #ifndef _REF_HXX //autogen
34 #include <tools/ref.hxx>
35 #endif
36 #ifndef _STRING_HXX //autogen
37 #include <tools/string.hxx>
38 #endif
39 namespace binfilter {
41 // CLASS -----------------------------------------------------------------
43 class SfxObjectShell;
45 #ifndef SFX_DECL_OBJECTSHELL_DEFINED
46 #define SFX_DECL_OBJECTSHELL_DEFINED
47 SV_DECL_REF(SfxObjectShell)
48 SV_DECL_LOCK(SfxObjectShell)
49 #endif
51 class SfxDocTemplate_Impl;
53 #ifndef SFX_DECL_DOCTEMPLATES_DEFINED
54 #define SFX_DECL_DOCTEMPLATES_DEFINED
55 SV_DECL_REF(SfxDocTemplate_Impl)
56 #endif
58 // class SfxDocumentTemplates --------------------------------------------
60 class SfxDocumentTemplates
62 private:
63 SfxDocTemplate_ImplRef pImp;
65 public:
66 SfxDocumentTemplates();
67 SfxDocumentTemplates(const SfxDocumentTemplates &);
68 ~SfxDocumentTemplates();
70 BOOL IsConstructed() { return pImp != NULL; }
71 void Construct();
73 static BOOL SaveDir( /*SfxTemplateDir &rEntry */ ) ;
74 const SfxDocumentTemplates &operator=(const SfxDocumentTemplates &);
77 BOOL IsRegionLoaded( USHORT nIdx ) const;
78 USHORT GetRegionCount() const;
79 const String& GetRegionName(USHORT nIdx) const; //dv!
80 String GetFullRegionName(USHORT nIdx) const;
81 USHORT GetRegionNo( const String &rRegionName ) const;
83 USHORT GetCount(USHORT nRegion) const;
84 USHORT GetCount( const String &rName) const;
85 const String& GetName(USHORT nRegion, USHORT nIdx) const; //dv!
86 String GetFileName(USHORT nRegion, USHORT nIdx) const;
87 String GetPath(USHORT nRegion, USHORT nIdx) const;
89 String GetDefaultTemplatePath(const String &rLongName);
91 // Pfad zur Vorlage geben lassen; logischer Name muss angegeben
92 // werden, damit beim Ueberschreiben einer Vorlage der
93 // richtige Dateiname gefunden werden kann
94 String GetTemplatePath(USHORT nRegion, const String &rLongName) const;
96 // Speichern als Vorlage hat geklappt -> Aktualisieren
97 void NewTemplate(USHORT nRegion,
98 const String &rLongName,
99 const String &rFileName);
104 BOOL GetLogicNames( const String& rPath, String& rRegion, String& rName ) const;
106 /** updates the configuration where the document templates structure is stored.
108 <p>The info about the document templates (which files, which groups etc.) is stored in the
109 configuration. This means that just by copying files into OOo's template directories, this
110 change is not reflected in the SfxDocumentTemplates - 'cause the configuration is not synchronous with
111 the file system. This can be enforced with this method.</p>
113 @param _bSmart
114 The update of the configuration is rather expensive - nothing you want to do regulary if you don't really
115 need it. So you have the possibility to do a smart update - it first checks if the update if necessary.
116 In case the update is needed, the additional check made it somewhat more expensive. In case it's not
117 necessary (which should be the usual case), the check alone is (much) less expensive than the real update.
118 <br/>
119 So set <arg>_bSmart</arg> to <TRUE/> to do a check for necessity first.
123 }//end of namespace binfilter
124 #endif // #ifndef _SFXDOCTEMPL_HXX