LibreOffice Module dbaccess (master) 1
indexes.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
22#include <sal/config.h>
23
24#include <rtl/ustring.hxx>
25
26#include <vector>
27
28namespace dbaui
29{
30 // OIndexField
32 {
33 OUString sFieldName;
35
37 };
38
39 typedef std::vector<OIndexField> IndexFields;
40
41 // OIndex
43 {
44 friend class OIndexCollection;
45 private:
47 };
48
49 struct OIndex final
50 {
51 OUString sOriginalName;
53
54 public:
55 OUString sName;
56 OUString sDescription;
58 bool bUnique;
60
61 OIndex(const OUString& _rOriginalName)
62 : sOriginalName(_rOriginalName), bModified(false), sName(_rOriginalName), bPrimaryKey(false), bUnique(false)
63 {
64 }
65
66 const OUString& getOriginalName() const { return sOriginalName; }
67
68 bool isModified() const { return bModified; }
69 void setModified(bool _bModified) { bModified = _bModified; }
70 void clearModified() { setModified(false); }
71
72 bool isNew() const { return getOriginalName().isEmpty(); }
73 void flagAsNew(const GrantIndexAccess&) { sOriginalName.clear(); }
75 };
76
77 typedef std::vector<OIndex> Indexes;
78
79} // namespace dbaui
80
81/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< OIndexField > IndexFields
Definition: indexes.hxx:39
std::vector< OIndex > Indexes
Definition: indexes.hxx:77
OUString sFieldName
Definition: indexes.hxx:33
OIndex(const OUString &_rOriginalName)
Definition: indexes.hxx:61
IndexFields aFields
Definition: indexes.hxx:59
bool bUnique
Definition: indexes.hxx:58
OUString sName
Definition: indexes.hxx:55
void setModified(bool _bModified)
Definition: indexes.hxx:69
bool isModified() const
Definition: indexes.hxx:68
void flagAsNew(const GrantIndexAccess &)
Definition: indexes.hxx:73
bool bPrimaryKey
Definition: indexes.hxx:57
void flagAsCommitted(const GrantIndexAccess &)
Definition: indexes.hxx:74
const OUString & getOriginalName() const
Definition: indexes.hxx:66
OUString sOriginalName
Definition: indexes.hxx:51
void clearModified()
Definition: indexes.hxx:70
OUString sDescription
Definition: indexes.hxx:56
bool isNew() const
Definition: indexes.hxx:72
bool bModified
Definition: indexes.hxx:52