merge the formfield patch from ooo-build
[ooovba.git] / extensions / source / bibliography / bibconfig.hxx
blob64fbc9c34b3388c5761baf29d690a3e4bb23271a
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: bibconfig.hxx,v $
10 * $Revision: 1.10 $
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>
35 class MappingArray;
37 //-----------------------------------------------------------------------------
38 #define COLUMN_COUNT 31
39 #define IDENTIFIER_POS 0
40 #define AUTHORITYTYPE_POS 1
41 #define AUTHOR_POS 2
42 #define TITLE_POS 3
43 #define YEAR_POS 4
44 #define ISBN_POS 5
45 #define BOOKTITLE_POS 6
46 #define CHAPTER_POS 7
47 #define EDITION_POS 8
48 #define EDITOR_POS 9
49 #define HOWPUBLISHED_POS 10
50 #define INSTITUTION_POS 11
51 #define JOURNAL_POS 12
52 #define MONTH_POS 13
53 #define NOTE_POS 14
54 #define ANNOTE_POS 15
55 #define NUMBER_POS 16
56 #define ORGANIZATIONS_POS 17
57 #define PAGES_POS 18
58 #define PUBLISHER_POS 19
59 #define ADDRESS_POS 20
60 #define SCHOOL_POS 21
61 #define SERIES_POS 22
62 #define REPORTTYPE_POS 23
63 #define VOLUME_POS 24
64 #define URL_POS 25
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 //-----------------------------------------------------------------------------
71 struct StringPair
73 rtl::OUString sRealColumnName;
74 rtl::OUString sLogicalColumnName;
76 //-----------------------------------------------------------------------------
77 struct Mapping
79 rtl::OUString sTableName;
80 rtl::OUString sURL;
81 sal_Int16 nCommandType;
82 StringPair aColumnPairs[COLUMN_COUNT];
84 Mapping() :
85 nCommandType(0){}
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;
105 long nBeamerSize;
106 long nViewSize;
107 sal_Bool bShowColumnAssignmentWarning;
109 rtl::OUString aColumnDefaults[COLUMN_COUNT];
111 com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
112 public:
113 BibConfig();
114 ~BibConfig();
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;
150 public:
151 DBChangeDialogConfig_Impl();
152 ~DBChangeDialogConfig_Impl();
154 const com::sun::star::uno::Sequence<rtl::OUString>& GetDataSourceNames();
157 #endif