Impress Remote 1.0.5, tag sdremote-1.0.5
[LibreOffice.git] / extensions / source / bibliography / bibmod.cxx
blob7b0f01bf0eb96499e9da0ff973970934f6bdfdac
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <tools/resmgr.hxx>
21 #include <svl/urihelper.hxx>
22 #include <com/sun/star/container/XNameAccess.hpp>
23 #include <com/sun/star/util/XLocalizedAliases.hpp>
24 #include <com/sun/star/lang/XLocalizable.hpp>
26 #include "bibmod.hxx"
27 #include "bibresid.hxx"
28 #include "datman.hxx"
29 #include "bibconfig.hxx"
30 static PtrBibModul pBibModul=NULL;
31 static sal_uInt32 nBibModulCount=0;
32 #include <ucbhelper/content.hxx>
34 using namespace ::rtl;
35 using namespace ::com::sun::star;
36 using namespace ::com::sun::star::uno;
37 using namespace ::com::sun::star::util;
38 using namespace ::com::sun::star::lang;
39 using namespace ::com::sun::star::ucb;
41 #define C2U(cChar) OUString::createFromAscii(cChar)
42 #define C2S(cChar) String::CreateFromAscii(cChar)
44 HdlBibModul OpenBibModul()
46 if(pBibModul==NULL)
48 pBibModul=new BibModul();
50 nBibModulCount++;
51 return &pBibModul;
54 void CloseBibModul(HdlBibModul ppBibModul)
56 nBibModulCount--;
57 if(nBibModulCount==0 && ppBibModul!=NULL)
59 delete pBibModul;
60 pBibModul=NULL;
64 BibResId::BibResId( sal_uInt16 nId ) :
65 ResId( nId, *pBibModul->GetResMgr() )
68 BibConfig* BibModul::pBibConfig = 0;
69 BibModul::BibModul()
71 pResMgr = ResMgr::CreateResMgr( "bib" );
74 BibModul::~BibModul()
76 delete pResMgr;
77 delete pBibConfig;
78 pBibConfig = 0;
81 BibDataManager* BibModul::createDataManager()
83 return new BibDataManager();
85 //-----------------------------------------------------------------------------
86 BibConfig* BibModul::GetConfig()
88 if(! pBibConfig)
89 pBibConfig = new BibConfig;
90 return pBibConfig;
94 // PropertyNames
95 #define STATIC_USTRING(a,b) rtl::OUString a(b)
96 STATIC_USTRING(FM_PROP_LABEL,C2U("Label"));
97 STATIC_USTRING(FM_PROP_CONTROLSOURCE,C2U("DataField"));
98 STATIC_USTRING(FM_PROP_NAME,C2U("Name"));
99 STATIC_USTRING(FM_PROP_FORMATKEY,C2U("FormatKey"));
100 STATIC_USTRING(FM_PROP_EDITMODE,C2U("RecordMode"));
101 STATIC_USTRING(FM_PROP_CURSORSOURCETYPE,C2U("DataSelectionType"));
102 STATIC_USTRING(FM_PROP_CURSORSOURCE,C2U("DataSelection"));
103 STATIC_USTRING(FM_PROP_DATASOURCE, C2U("DataSource"));
104 STATIC_USTRING(FM_PROP_VALUE,C2U("Value"));
105 STATIC_USTRING(FM_PROP_TEXT,C2U("Text"));
107 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */