LibreOffice Module dbaccess (master) 1
indexcollection.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 <com/sun/star/container/XNameAccess.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include "indexes.hxx"
25
26namespace dbaui
27{
28
29 // OIndexCollection
31 {
32 css::uno::Reference< css::container::XNameAccess >
34
35 // cached information
37
38 public:
39 // construction
41 OIndexCollection(const OIndexCollection& _rSource);
42 // OIndexCollection(const css::uno::Reference< css::container::XNameAccess >& _rxIndexes);
43
45
46 // iterating through the collection
47 typedef OIndex* iterator;
48 typedef OIndex const* const_iterator;
49
51 Indexes::const_iterator begin() const { return m_aIndexes.begin(); }
53 Indexes::iterator begin() { return m_aIndexes.begin(); }
55 Indexes::const_iterator end() const { return m_aIndexes.end(); }
57 Indexes::iterator end() { return m_aIndexes.end(); }
58
59 // searching
60 Indexes::const_iterator find(const OUString& _rName) const;
61 Indexes::iterator find(const OUString& _rName);
62 Indexes::const_iterator findOriginal(const OUString& _rName) const;
63 Indexes::iterator findOriginal(const OUString& _rName);
64
65 // inserting without committing
66 // the OriginalName of the newly inserted index will be empty, thus indicating that it's new
67 Indexes::iterator insert(const OUString& _rName);
68 // commit a new index, which is already part if the collection, but does not have an equivalent in the
69 // data source, yet
70 void commitNewIndex(const Indexes::iterator& _rPos);
71
72 // reset the data for the given index
73 void resetIndex(const Indexes::iterator& _rPos);
74
75 // attach to a new key container
76 void attach(const css::uno::Reference< css::container::XNameAccess >& _rxIndexes);
77 // detach from the container
78 void detach();
79
81 bool drop(const Indexes::iterator& _rPos);
83 bool dropNoRemove(const Indexes::iterator& _rPos);
84
85 protected:
86 void implConstructFrom(const css::uno::Reference< css::container::XNameAccess >& _rxIndexes);
87 static void implFillIndexInfo(OIndex& _rIndex, const css::uno::Reference< css::beans::XPropertySet >& _rxDescriptor);
88 void implFillIndexInfo(OIndex& _rIndex);
89 };
90
91} // namespace dbaui
92
93/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Indexes::iterator end()
get access to the (last + 1st) element of the index collection
void attach(const css::uno::Reference< css::container::XNameAccess > &_rxIndexes)
void resetIndex(const Indexes::iterator &_rPos)
Indexes::iterator insert(const OUString &_rName)
OIndexCollection & operator=(const OIndexCollection &_rSource)
css::uno::Reference< css::container::XNameAccess > m_xIndexes
bool drop(const Indexes::iterator &_rPos)
drop an index, and remove it from the collection
Indexes::const_iterator begin() const
get access to the first element of the index collection
void commitNewIndex(const Indexes::iterator &_rPos)
static void implFillIndexInfo(OIndex &_rIndex, const css::uno::Reference< css::beans::XPropertySet > &_rxDescriptor)
void implConstructFrom(const css::uno::Reference< css::container::XNameAccess > &_rxIndexes)
bool dropNoRemove(const Indexes::iterator &_rPos)
simply drop the index described by the name, but don't remove the descriptor from the collection
Indexes::const_iterator findOriginal(const OUString &_rName) const
Indexes::const_iterator find(const OUString &_rName) const
Indexes::iterator begin()
get access to the first element of the index collection
Indexes::const_iterator end() const
get access to the (last + 1st) element of the index collection
OIndex const * const_iterator
std::vector< OIndex > Indexes
Definition: indexes.hxx:77