1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: bibconfig.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BIBCONFIG_HXX
32 #define _BIBCONFIG_HXX
34 #include <unotools/configitem.hxx>
37 //-----------------------------------------------------------------------------
38 #define COLUMN_COUNT 31
39 #define IDENTIFIER_POS 0
40 #define AUTHORITYTYPE_POS 1
45 #define BOOKTITLE_POS 6
49 #define HOWPUBLISHED_POS 10
50 #define INSTITUTION_POS 11
51 #define JOURNAL_POS 12
56 #define ORGANIZATIONS_POS 17
58 #define PUBLISHER_POS 19
59 #define ADDRESS_POS 20
62 #define REPORTTYPE_POS 23
65 #define CUSTOM1_POS 26
66 #define CUSTOM2_POS 27
67 #define CUSTOM3_POS 28
68 #define CUSTOM4_POS 29
69 #define CUSTOM5_POS 30
70 //-----------------------------------------------------------------------------
73 rtl::OUString sRealColumnName
;
74 rtl::OUString sLogicalColumnName
;
76 //-----------------------------------------------------------------------------
79 rtl::OUString sTableName
;
81 sal_Int16 nCommandType
;
82 StringPair aColumnPairs
[COLUMN_COUNT
];
87 //-----------------------------------------------------------------------------
88 struct BibDBDescriptor
90 rtl::OUString sDataSource
;
91 rtl::OUString sTableOrQuery
;
92 sal_Int32 nCommandType
;
94 //-----------------------------------------------------------------------------
96 class BibConfig
: public utl::ConfigItem
98 rtl::OUString sDataSource
;
99 rtl::OUString sTableOrQuery
;
100 sal_Int32 nTblOrQuery
;
102 rtl::OUString sQueryField
;
103 rtl::OUString sQueryText
;
104 MappingArray
* pMappingsArr
;
107 sal_Bool bShowColumnAssignmentWarning
;
109 rtl::OUString aColumnDefaults
[COLUMN_COUNT
];
111 com::sun::star::uno::Sequence
<rtl::OUString
> GetPropertyNames();
116 virtual void Commit();
118 BibDBDescriptor
GetBibliographyURL();
119 void SetBibliographyURL(const BibDBDescriptor
& rDesc
);
121 const Mapping
* GetMapping(const BibDBDescriptor
& rDesc
) const;
122 void SetMapping(const BibDBDescriptor
& rDesc
, const Mapping
* pMapping
);
124 const rtl::OUString
& GetDefColumnName(sal_uInt16 nIndex
) const
125 {return aColumnDefaults
[nIndex
];}
128 void setBeamerSize(long nSize
) {SetModified(); nBeamerSize
= nSize
;}
129 long getBeamerSize()const {return nBeamerSize
;}
130 void setViewSize(long nSize
) {SetModified(); nViewSize
= nSize
;}
131 long getViewSize() {return nViewSize
;}
133 const rtl::OUString
& getQueryField() const {return sQueryField
;}
134 void setQueryField(const rtl::OUString
& rSet
) {SetModified(); sQueryField
= rSet
;}
136 const rtl::OUString
& getQueryText() const {return sQueryText
;}
137 void setQueryText(const rtl::OUString
& rSet
) {SetModified(); sQueryText
= rSet
;}
139 sal_Bool
IsShowColumnAssignmentWarning() const
140 { return bShowColumnAssignmentWarning
;}
141 void SetShowColumnAssignmentWarning(sal_Bool bSet
)
142 { bShowColumnAssignmentWarning
= bSet
;}
144 /* -----------------------------20.11.00 11:47--------------------------------
146 ---------------------------------------------------------------------------*/
147 class DBChangeDialogConfig_Impl
149 com::sun::star::uno::Sequence
<rtl::OUString
> aSourceNames
;
151 DBChangeDialogConfig_Impl();
152 ~DBChangeDialogConfig_Impl();
154 const com::sun::star::uno::Sequence
<rtl::OUString
>& GetDataSourceNames();