1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <unotools/configitem.hxx>
23 #include <tools/long.hxx>
28 typedef std::vector
<std::unique_ptr
<Mapping
> > MappingArray
;
31 #define COLUMN_COUNT 32
32 #define IDENTIFIER_POS 0
33 #define AUTHORITYTYPE_POS 1
38 #define BOOKTITLE_POS 6
42 #define HOWPUBLISHED_POS 10
43 #define INSTITUTION_POS 11
44 #define JOURNAL_POS 12
49 #define ORGANIZATIONS_POS 17
51 #define PUBLISHER_POS 19
52 #define ADDRESS_POS 20
55 #define REPORTTYPE_POS 23
58 #define CUSTOM1_POS 26
59 #define CUSTOM2_POS 27
60 #define CUSTOM3_POS 28
61 #define CUSTOM4_POS 29
62 #define CUSTOM5_POS 30
63 #define LOCAL_URL_POS 31
67 OUString sRealColumnName
;
68 OUString sLogicalColumnName
;
75 sal_Int16 nCommandType
;
76 StringPair aColumnPairs
[COLUMN_COUNT
];
82 struct BibDBDescriptor
85 OUString sTableOrQuery
;
86 sal_Int32 nCommandType
;
90 class BibConfig
: public utl::ConfigItem
93 OUString sTableOrQuery
;
94 sal_Int32 nTblOrQuery
;
98 MappingArray mvMappings
;
99 tools::Long nBeamerSize
;
100 tools::Long nViewSize
;
101 bool bShowColumnAssignmentWarning
;
103 OUString aColumnDefaults
[COLUMN_COUNT
];
105 static css::uno::Sequence
<OUString
> const & GetPropertyNames();
107 virtual void ImplCommit() override
;
111 virtual ~BibConfig() override
;
113 virtual void Notify( const css::uno::Sequence
<OUString
>& aPropertyNames
) override
;
115 BibDBDescriptor
GetBibliographyURL();
116 void SetBibliographyURL(const BibDBDescriptor
& rDesc
);
118 const Mapping
* GetMapping(const BibDBDescriptor
& rDesc
) const;
119 void SetMapping(const BibDBDescriptor
& rDesc
, const Mapping
* pMapping
);
121 const OUString
& GetDefColumnName(sal_uInt16 nIndex
) const
122 {return aColumnDefaults
[nIndex
];}
125 void setBeamerSize(tools::Long nSize
) {SetModified(); nBeamerSize
= nSize
;}
126 tools::Long
getBeamerSize()const {return nBeamerSize
;}
127 void setViewSize(tools::Long nSize
) {SetModified(); nViewSize
= nSize
;}
128 tools::Long
getViewSize() const {return nViewSize
;}
130 const OUString
& getQueryField() const {return sQueryField
;}
131 void setQueryField(const OUString
& rSet
) {SetModified(); sQueryField
= rSet
;}
133 const OUString
& getQueryText() const {return sQueryText
;}
134 void setQueryText(const OUString
& rSet
) {SetModified(); sQueryText
= rSet
;}
136 bool IsShowColumnAssignmentWarning() const
137 { return bShowColumnAssignmentWarning
;}
138 void SetShowColumnAssignmentWarning(bool bSet
)
139 { bShowColumnAssignmentWarning
= bSet
;}
142 class DBChangeDialogConfig_Impl
144 css::uno::Sequence
<OUString
> aSourceNames
;
146 DBChangeDialogConfig_Impl();
147 ~DBChangeDialogConfig_Impl();
149 const css::uno::Sequence
<OUString
>& GetDataSourceNames();
153 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */