Bump for 3.6-28
[LibreOffice.git] / extensions / source / bibliography / bibconfig.hxx
blob982430bdacdb0c790d66f74ab37298cc6fb664de
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>
33 class MappingArray;
35 //-----------------------------------------------------------------------------
36 #define COLUMN_COUNT 31
37 #define IDENTIFIER_POS 0
38 #define AUTHORITYTYPE_POS 1
39 #define AUTHOR_POS 2
40 #define TITLE_POS 3
41 #define YEAR_POS 4
42 #define ISBN_POS 5
43 #define BOOKTITLE_POS 6
44 #define CHAPTER_POS 7
45 #define EDITION_POS 8
46 #define EDITOR_POS 9
47 #define HOWPUBLISHED_POS 10
48 #define INSTITUTION_POS 11
49 #define JOURNAL_POS 12
50 #define MONTH_POS 13
51 #define NOTE_POS 14
52 #define ANNOTE_POS 15
53 #define NUMBER_POS 16
54 #define ORGANIZATIONS_POS 17
55 #define PAGES_POS 18
56 #define PUBLISHER_POS 19
57 #define ADDRESS_POS 20
58 #define SCHOOL_POS 21
59 #define SERIES_POS 22
60 #define REPORTTYPE_POS 23
61 #define VOLUME_POS 24
62 #define URL_POS 25
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 //-----------------------------------------------------------------------------
69 struct StringPair
71 rtl::OUString sRealColumnName;
72 rtl::OUString sLogicalColumnName;
74 //-----------------------------------------------------------------------------
75 struct Mapping
77 rtl::OUString sTableName;
78 rtl::OUString sURL;
79 sal_Int16 nCommandType;
80 StringPair aColumnPairs[COLUMN_COUNT];
82 Mapping() :
83 nCommandType(0){}
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;
103 long nBeamerSize;
104 long nViewSize;
105 sal_Bool bShowColumnAssignmentWarning;
107 rtl::OUString aColumnDefaults[COLUMN_COUNT];
109 com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
110 public:
111 BibConfig();
112 ~BibConfig();
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;
147 public:
148 DBChangeDialogConfig_Impl();
149 ~DBChangeDialogConfig_Impl();
151 const com::sun::star::uno::Sequence<rtl::OUString>& GetDataSourceNames();
154 #endif
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */