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 .
20 #ifndef _BIBCONFIG_HXX
21 #define _BIBCONFIG_HXX
23 #include <unotools/configitem.hxx>
24 #include <boost/ptr_container/ptr_vector.hpp>
27 typedef boost::ptr_vector
<Mapping
> MappingArray
;
30 //-----------------------------------------------------------------------------
31 #define COLUMN_COUNT 31
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 //-----------------------------------------------------------------------------
66 rtl::OUString sRealColumnName
;
67 rtl::OUString sLogicalColumnName
;
69 //-----------------------------------------------------------------------------
72 rtl::OUString sTableName
;
74 sal_Int16 nCommandType
;
75 StringPair aColumnPairs
[COLUMN_COUNT
];
80 //-----------------------------------------------------------------------------
81 struct BibDBDescriptor
83 rtl::OUString sDataSource
;
84 rtl::OUString sTableOrQuery
;
85 sal_Int32 nCommandType
;
87 //-----------------------------------------------------------------------------
89 class BibConfig
: public utl::ConfigItem
91 rtl::OUString sDataSource
;
92 rtl::OUString sTableOrQuery
;
93 sal_Int32 nTblOrQuery
;
95 rtl::OUString sQueryField
;
96 rtl::OUString sQueryText
;
97 MappingArray
* pMappingsArr
;
100 sal_Bool bShowColumnAssignmentWarning
;
102 rtl::OUString aColumnDefaults
[COLUMN_COUNT
];
104 com::sun::star::uno::Sequence
<rtl::OUString
> GetPropertyNames();
109 virtual void Commit();
110 virtual void Notify( const com::sun::star::uno::Sequence
<rtl::OUString
>& aPropertyNames
);
112 BibDBDescriptor
GetBibliographyURL();
113 void SetBibliographyURL(const BibDBDescriptor
& rDesc
);
115 const Mapping
* GetMapping(const BibDBDescriptor
& rDesc
) const;
116 void SetMapping(const BibDBDescriptor
& rDesc
, const Mapping
* pMapping
);
118 const rtl::OUString
& GetDefColumnName(sal_uInt16 nIndex
) const
119 {return aColumnDefaults
[nIndex
];}
122 void setBeamerSize(long nSize
) {SetModified(); nBeamerSize
= nSize
;}
123 long getBeamerSize()const {return nBeamerSize
;}
124 void setViewSize(long nSize
) {SetModified(); nViewSize
= nSize
;}
125 long getViewSize() {return nViewSize
;}
127 const rtl::OUString
& getQueryField() const {return sQueryField
;}
128 void setQueryField(const rtl::OUString
& rSet
) {SetModified(); sQueryField
= rSet
;}
130 const rtl::OUString
& getQueryText() const {return sQueryText
;}
131 void setQueryText(const rtl::OUString
& rSet
) {SetModified(); sQueryText
= rSet
;}
133 sal_Bool
IsShowColumnAssignmentWarning() const
134 { return bShowColumnAssignmentWarning
;}
135 void SetShowColumnAssignmentWarning(sal_Bool bSet
)
136 { bShowColumnAssignmentWarning
= bSet
;}
139 class DBChangeDialogConfig_Impl
141 com::sun::star::uno::Sequence
<rtl::OUString
> aSourceNames
;
143 DBChangeDialogConfig_Impl();
144 ~DBChangeDialogConfig_Impl();
146 const com::sun::star::uno::Sequence
<rtl::OUString
>& GetDataSourceNames();
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */