LibreOffice Module extensions (master) 1
bibconfig.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include <tools/long.hxx>
24#include <vector>
25#include <memory>
26
27struct Mapping;
28typedef std::vector<std::unique_ptr<Mapping> > MappingArray;
29
30
31#define COLUMN_COUNT 32
32#define IDENTIFIER_POS 0
33#define AUTHORITYTYPE_POS 1
34#define AUTHOR_POS 2
35#define TITLE_POS 3
36#define YEAR_POS 4
37#define ISBN_POS 5
38#define BOOKTITLE_POS 6
39#define CHAPTER_POS 7
40#define EDITION_POS 8
41#define EDITOR_POS 9
42#define HOWPUBLISHED_POS 10
43#define INSTITUTION_POS 11
44#define JOURNAL_POS 12
45#define MONTH_POS 13
46#define NOTE_POS 14
47#define ANNOTE_POS 15
48#define NUMBER_POS 16
49#define ORGANIZATIONS_POS 17
50#define PAGES_POS 18
51#define PUBLISHER_POS 19
52#define ADDRESS_POS 20
53#define SCHOOL_POS 21
54#define SERIES_POS 22
55#define REPORTTYPE_POS 23
56#define VOLUME_POS 24
57#define URL_POS 25
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#define LOCAL_URL_POS 31
64
66{
69};
70
71struct Mapping
72{
73 OUString sTableName;
74 OUString sURL;
75 sal_Int16 nCommandType;
77
79 nCommandType(0){}
80};
81
83{
84 OUString sDataSource;
85 OUString sTableOrQuery;
86 sal_Int32 nCommandType;
87};
88
89
91{
92 OUString sDataSource;
93 OUString sTableOrQuery;
94 sal_Int32 nTblOrQuery;
95
96 OUString sQueryField;
97 OUString sQueryText;
102
104
105 static css::uno::Sequence<OUString> const & GetPropertyNames();
106
107 virtual void ImplCommit() override;
108
109public:
110 BibConfig();
111 virtual ~BibConfig() override;
112
113 virtual void Notify( const css::uno::Sequence<OUString>& aPropertyNames) override;
114
116 void SetBibliographyURL(const BibDBDescriptor& rDesc);
117
118 const Mapping* GetMapping(const BibDBDescriptor& rDesc) const;
119 void SetMapping(const BibDBDescriptor& rDesc, const Mapping* pMapping);
120
121 const OUString& GetDefColumnName(sal_uInt16 nIndex) const
122 {return aColumnDefaults[nIndex];}
123
124
129
130 const OUString& getQueryField() const {return sQueryField;}
131 void setQueryField(const OUString& rSet) {SetModified(); sQueryField = rSet;}
132
133 const OUString& getQueryText() const {return sQueryText;}
134 void setQueryText(const OUString& rSet) {SetModified(); sQueryText = rSet;}
135
140};
141
143{
144 css::uno::Sequence<OUString> aSourceNames;
145public:
148
149 const css::uno::Sequence<OUString>& GetDataSourceNames();
150
151};
152
153/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< std::unique_ptr< Mapping > > MappingArray
Definition: bibconfig.hxx:27
#define COLUMN_COUNT
Definition: bibconfig.hxx:31
const Mapping * GetMapping(const BibDBDescriptor &rDesc) const
Definition: bibconfig.cxx:250
tools::Long getViewSize() const
Definition: bibconfig.hxx:128
OUString aColumnDefaults[COLUMN_COUNT]
Definition: bibconfig.hxx:103
OUString sDataSource
Definition: bibconfig.hxx:92
OUString sQueryField
Definition: bibconfig.hxx:96
const OUString & GetDefColumnName(sal_uInt16 nIndex) const
Definition: bibconfig.hxx:121
static css::uno::Sequence< OUString > const & GetPropertyNames()
Definition: bibconfig.cxx:39
tools::Long nBeamerSize
Definition: bibconfig.hxx:99
OUString sQueryText
Definition: bibconfig.hxx:97
void SetMapping(const BibDBDescriptor &rDesc, const Mapping *pMapping)
Definition: bibconfig.cxx:262
tools::Long getBeamerSize() const
Definition: bibconfig.hxx:126
virtual ~BibConfig() override
Definition: bibconfig.cxx:177
void setBeamerSize(tools::Long nSize)
Definition: bibconfig.hxx:125
void setViewSize(tools::Long nSize)
Definition: bibconfig.hxx:127
void SetShowColumnAssignmentWarning(bool bSet)
Definition: bibconfig.hxx:138
OUString sTableOrQuery
Definition: bibconfig.hxx:93
tools::Long nViewSize
Definition: bibconfig.hxx:100
const OUString & getQueryField() const
Definition: bibconfig.hxx:130
void setQueryText(const OUString &rSet)
Definition: bibconfig.hxx:134
MappingArray mvMappings
Definition: bibconfig.hxx:98
const OUString & getQueryText() const
Definition: bibconfig.hxx:133
virtual void ImplCommit() override
Definition: bibconfig.cxx:203
void SetBibliographyURL(const BibDBDescriptor &rDesc)
Definition: bibconfig.cxx:191
bool bShowColumnAssignmentWarning
Definition: bibconfig.hxx:101
bool IsShowColumnAssignmentWarning() const
Definition: bibconfig.hxx:136
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: bibconfig.cxx:199
void setQueryField(const OUString &rSet)
Definition: bibconfig.hxx:131
sal_Int32 nTblOrQuery
Definition: bibconfig.hxx:94
BibDBDescriptor GetBibliographyURL()
Definition: bibconfig.cxx:182
const css::uno::Sequence< OUString > & GetDataSourceNames()
Definition: bibconfig.cxx:286
css::uno::Sequence< OUString > aSourceNames
Definition: bibconfig.hxx:144
sal_Int32 nIndex
long Long
static SfxItemSet & rSet
OUString sDataSource
Definition: bibconfig.hxx:84
OUString sTableOrQuery
Definition: bibconfig.hxx:85
sal_Int32 nCommandType
Definition: bibconfig.hxx:86
OUString sTableName
Definition: bibconfig.hxx:73
OUString sURL
Definition: bibconfig.hxx:74
sal_Int16 nCommandType
Definition: bibconfig.hxx:75
StringPair aColumnPairs[COLUMN_COUNT]
Definition: bibconfig.hxx:76
OUString sRealColumnName
Definition: bibconfig.hxx:67
OUString sLogicalColumnName
Definition: bibconfig.hxx:68