Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
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>
25 :
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>
33 :
34 : using namespace ::com::sun::star;
35 : using namespace ::com::sun::star::uno;
36 : using namespace ::com::sun::star::util;
37 : using namespace ::com::sun::star::lang;
38 : using namespace ::com::sun::star::ucb;
39 :
40 0 : HdlBibModul OpenBibModul()
41 : {
42 0 : if(pBibModul==NULL)
43 : {
44 0 : pBibModul=new BibModul();
45 : }
46 0 : nBibModulCount++;
47 0 : return &pBibModul;
48 : }
49 :
50 0 : void CloseBibModul(HdlBibModul ppBibModul)
51 : {
52 0 : nBibModulCount--;
53 0 : if(nBibModulCount==0 && ppBibModul!=NULL)
54 : {
55 0 : delete pBibModul;
56 0 : pBibModul=NULL;
57 : }
58 0 : }
59 :
60 0 : BibResId::BibResId( sal_uInt16 nId ) :
61 0 : ResId( nId, *pBibModul->GetResMgr() )
62 : {
63 0 : }
64 : BibConfig* BibModul::pBibConfig = 0;
65 0 : BibModul::BibModul()
66 : {
67 0 : pResMgr = ResMgr::CreateResMgr( "bib" );
68 0 : }
69 :
70 0 : BibModul::~BibModul()
71 : {
72 0 : delete pResMgr;
73 0 : delete pBibConfig;
74 0 : pBibConfig = 0;
75 0 : }
76 :
77 0 : BibDataManager* BibModul::createDataManager()
78 : {
79 0 : return new BibDataManager();
80 : }
81 :
82 0 : BibConfig* BibModul::GetConfig()
83 : {
84 0 : if(! pBibConfig)
85 0 : pBibConfig = new BibConfig;
86 0 : return pBibConfig;
87 : }
88 :
89 :
90 : // PropertyNames
91 : #define STATIC_USTRING(a,b) OUString a(b)
92 4 : STATIC_USTRING(FM_PROP_LABEL,"Label");
93 4 : STATIC_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
94 4 : STATIC_USTRING(FM_PROP_NAME,"Name");
95 4 : STATIC_USTRING(FM_PROP_FORMATKEY,"FormatKey");
96 4 : STATIC_USTRING(FM_PROP_EDITMODE,"RecordMode");
97 4 : STATIC_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
98 4 : STATIC_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
99 4 : STATIC_USTRING(FM_PROP_DATASOURCE, "DataSource");
100 4 : STATIC_USTRING(FM_PROP_VALUE,"Value");
101 12 : STATIC_USTRING(FM_PROP_TEXT,"Text");
102 :
103 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|