1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _BIBCONFIG_HXX
30 #define _BIBCONFIG_HXX
32 #include <unotools/configitem.hxx>
35 //-----------------------------------------------------------------------------
36 #define COLUMN_COUNT 31
37 #define IDENTIFIER_POS 0
38 #define AUTHORITYTYPE_POS 1
43 #define BOOKTITLE_POS 6
47 #define HOWPUBLISHED_POS 10
48 #define INSTITUTION_POS 11
49 #define JOURNAL_POS 12
54 #define ORGANIZATIONS_POS 17
56 #define PUBLISHER_POS 19
57 #define ADDRESS_POS 20
60 #define REPORTTYPE_POS 23
63 #define CUSTOM1_POS 26
64 #define CUSTOM2_POS 27
65 #define CUSTOM3_POS 28
66 #define CUSTOM4_POS 29
67 #define CUSTOM5_POS 30
68 //-----------------------------------------------------------------------------
71 rtl::OUString sRealColumnName
;
72 rtl::OUString sLogicalColumnName
;
74 //-----------------------------------------------------------------------------
77 rtl::OUString sTableName
;
79 sal_Int16 nCommandType
;
80 StringPair aColumnPairs
[COLUMN_COUNT
];
85 //-----------------------------------------------------------------------------
86 struct BibDBDescriptor
88 rtl::OUString sDataSource
;
89 rtl::OUString sTableOrQuery
;
90 sal_Int32 nCommandType
;
92 //-----------------------------------------------------------------------------
94 class BibConfig
: public utl::ConfigItem
96 rtl::OUString sDataSource
;
97 rtl::OUString sTableOrQuery
;
98 sal_Int32 nTblOrQuery
;
100 rtl::OUString sQueryField
;
101 rtl::OUString sQueryText
;
102 MappingArray
* pMappingsArr
;
105 sal_Bool bShowColumnAssignmentWarning
;
107 rtl::OUString aColumnDefaults
[COLUMN_COUNT
];
109 com::sun::star::uno::Sequence
<rtl::OUString
> GetPropertyNames();
114 virtual void Commit();
115 virtual void Notify( const com::sun::star::uno::Sequence
<rtl::OUString
>& aPropertyNames
);
117 BibDBDescriptor
GetBibliographyURL();
118 void SetBibliographyURL(const BibDBDescriptor
& rDesc
);
120 const Mapping
* GetMapping(const BibDBDescriptor
& rDesc
) const;
121 void SetMapping(const BibDBDescriptor
& rDesc
, const Mapping
* pMapping
);
123 const rtl::OUString
& GetDefColumnName(sal_uInt16 nIndex
) const
124 {return aColumnDefaults
[nIndex
];}
127 void setBeamerSize(long nSize
) {SetModified(); nBeamerSize
= nSize
;}
128 long getBeamerSize()const {return nBeamerSize
;}
129 void setViewSize(long nSize
) {SetModified(); nViewSize
= nSize
;}
130 long getViewSize() {return nViewSize
;}
132 const rtl::OUString
& getQueryField() const {return sQueryField
;}
133 void setQueryField(const rtl::OUString
& rSet
) {SetModified(); sQueryField
= rSet
;}
135 const rtl::OUString
& getQueryText() const {return sQueryText
;}
136 void setQueryText(const rtl::OUString
& rSet
) {SetModified(); sQueryText
= rSet
;}
138 sal_Bool
IsShowColumnAssignmentWarning() const
139 { return bShowColumnAssignmentWarning
;}
140 void SetShowColumnAssignmentWarning(sal_Bool bSet
)
141 { bShowColumnAssignmentWarning
= bSet
;}
144 class DBChangeDialogConfig_Impl
146 com::sun::star::uno::Sequence
<rtl::OUString
> aSourceNames
;
148 DBChangeDialogConfig_Impl();
149 ~DBChangeDialogConfig_Impl();
151 const com::sun::star::uno::Sequence
<rtl::OUString
>& GetDataSourceNames();
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */