2010-10-27 12:33:13 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-14 17:39:53 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2001-03-19 05:02:34 +00:00
|
|
|
|
2013-11-05 02:18:53 +01:00
|
|
|
#ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXES_HXX
|
|
|
|
#define INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXES_HXX
|
2001-03-19 05:02:34 +00:00
|
|
|
|
|
|
|
#include <comphelper/stl_types.hxx>
|
|
|
|
|
|
|
|
namespace dbaui
|
|
|
|
{
|
2013-08-17 23:43:14 +02:00
|
|
|
// OIndexField
|
2001-03-19 05:02:34 +00:00
|
|
|
struct OIndexField
|
|
|
|
{
|
2013-09-26 12:17:53 +02:00
|
|
|
OUString sFieldName;
|
2001-03-19 05:02:34 +00:00
|
|
|
sal_Bool bSortAscending;
|
|
|
|
|
|
|
|
OIndexField() : bSortAscending(sal_True) { }
|
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_STL_VECTOR( OIndexField, IndexFields );
|
|
|
|
|
2013-08-17 23:43:14 +02:00
|
|
|
// OIndex
|
2001-03-19 05:02:34 +00:00
|
|
|
struct GrantIndexAccess
|
|
|
|
{
|
|
|
|
friend class OIndexCollection;
|
|
|
|
private:
|
|
|
|
GrantIndexAccess() { }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct OIndex
|
|
|
|
{
|
|
|
|
protected:
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sOriginalName;
|
2001-03-19 05:02:34 +00:00
|
|
|
sal_Bool bModified;
|
|
|
|
|
|
|
|
public:
|
2013-04-07 12:06:47 +02:00
|
|
|
OUString sName;
|
|
|
|
OUString sDescription;
|
2001-03-19 05:02:34 +00:00
|
|
|
sal_Bool bPrimaryKey;
|
|
|
|
sal_Bool bUnique;
|
|
|
|
IndexFields aFields;
|
|
|
|
|
|
|
|
public:
|
2013-04-07 12:06:47 +02:00
|
|
|
OIndex(const OUString& _rOriginalName)
|
2006-06-20 02:17:40 +00:00
|
|
|
: sOriginalName(_rOriginalName), bModified(sal_False), sName(_rOriginalName), bPrimaryKey(sal_False), bUnique(sal_False)
|
2001-03-19 05:02:34 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2013-04-07 12:06:47 +02:00
|
|
|
const OUString& getOriginalName() const { return sOriginalName; }
|
2001-03-19 05:02:34 +00:00
|
|
|
|
|
|
|
sal_Bool isModified() const { return bModified; }
|
|
|
|
void setModified(sal_Bool _bModified) { bModified = _bModified; }
|
|
|
|
void clearModified() { setModified(sal_False); }
|
|
|
|
|
2011-12-19 18:10:37 -02:00
|
|
|
sal_Bool isNew() const { return getOriginalName().isEmpty(); }
|
2013-04-07 12:06:47 +02:00
|
|
|
void flagAsNew(const GrantIndexAccess&) { sOriginalName = OUString(); }
|
2001-03-19 05:02:34 +00:00
|
|
|
void flagAsCommitted(const GrantIndexAccess&) { sOriginalName = sName; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
OIndex(); // not implemented
|
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_STL_VECTOR( OIndex, Indexes );
|
|
|
|
|
|
|
|
} // namespace dbaui
|
|
|
|
|
2013-11-05 02:18:53 +01:00
|
|
|
#endif // INCLUDED_DBACCESS_SOURCE_UI_INC_INDEXES_HXX
|
2001-03-19 05:02:34 +00:00
|
|
|
|
2010-10-27 12:33:13 +01:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|