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 "bibview.hxx"
28 : #include "bibresid.hxx"
29 : #include "datman.hxx"
30 : #include "bibconfig.hxx"
31 : static PtrBibModul pBibModul=NULL;
32 : static sal_uInt32 nBibModulCount=0;
33 : #include <ucbhelper/content.hxx>
34 :
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;
40 :
41 0 : HdlBibModul OpenBibModul()
42 : {
43 0 : if(pBibModul==NULL)
44 : {
45 0 : pBibModul=new BibModul();
46 : }
47 0 : nBibModulCount++;
48 0 : return &pBibModul;
49 : }
50 :
51 0 : void CloseBibModul(HdlBibModul ppBibModul)
52 : {
53 0 : nBibModulCount--;
54 0 : if(nBibModulCount==0 && ppBibModul!=NULL)
55 : {
56 0 : delete pBibModul;
57 0 : pBibModul=NULL;
58 : }
59 0 : }
60 :
61 0 : BibResId::BibResId( sal_uInt16 nId ) :
62 0 : ResId( nId, *pBibModul->GetResMgr() )
63 : {
64 0 : }
65 : BibConfig* BibModul::pBibConfig = 0;
66 0 : BibModul::BibModul()
67 : {
68 0 : pResMgr = ResMgr::CreateResMgr( "bib" );
69 0 : }
70 :
71 0 : BibModul::~BibModul()
72 : {
73 0 : delete pResMgr;
74 0 : if (pBibConfig && pBibConfig->IsModified())
75 0 : pBibConfig->Commit();
76 0 : delete pBibConfig;
77 0 : pBibConfig = 0;
78 0 : }
79 :
80 0 : BibDataManager* BibModul::createDataManager()
81 : {
82 0 : return new BibDataManager();
83 : }
84 :
85 0 : BibConfig* BibModul::GetConfig()
86 : {
87 0 : if(! pBibConfig)
88 0 : pBibConfig = new BibConfig;
89 0 : return pBibConfig;
90 : }
91 :
92 :
93 : // PropertyNames
94 : #define STATIC_USTRING(a,b) OUString a(b)
95 2 : STATIC_USTRING(FM_PROP_LABEL,"Label");
96 2 : STATIC_USTRING(FM_PROP_CONTROLSOURCE,"DataField");
97 2 : STATIC_USTRING(FM_PROP_NAME,"Name");
98 2 : STATIC_USTRING(FM_PROP_FORMATKEY,"FormatKey");
99 2 : STATIC_USTRING(FM_PROP_EDITMODE,"RecordMode");
100 2 : STATIC_USTRING(FM_PROP_CURSORSOURCETYPE,"DataSelectionType");
101 2 : STATIC_USTRING(FM_PROP_CURSORSOURCE,"DataSelection");
102 2 : STATIC_USTRING(FM_PROP_DATASOURCE, "DataSource");
103 2 : STATIC_USTRING(FM_PROP_VALUE,"Value");
104 6 : STATIC_USTRING(FM_PROP_TEXT,"Text");
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|