~smartboyhw/ubuntu/raring/calligra/2.6.0-0ubuntu1

« back to all changes in this revision

Viewing changes to libs/db/schemadata.h

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-10-23 21:09:16 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20121023210916-m82w6zxnxhaxz7va
Tags: 1:2.5.90-0ubuntu1
* New upstream alpha release (LP: #1070436)
  - Add libkactivities-dev and libopenimageio-dev to build-depends
  - Add kubuntu_build_calligraactive.diff to build calligraactive by default
  - Add package for calligraauthor and move files that are shared between
    calligrawords and calligraauthor to calligrawords-common
* Document the patches
* Remove numbers from patches so they follow the same naming scheme as
  the rest of our patches.
* calligra-data breaks replaces krita-data (<< 1:2.5.3) (LP: #1071686)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2003 Jarosław Staniek <staniek@kde.org>
 
3
 
 
4
   This library is free software; you can redistribute it and/or
 
5
   modify it under the terms of the GNU Library General Public
 
6
   License as published by the Free Software Foundation; either
 
7
   version 2 of the License, or (at your option) any later version.
 
8
 
 
9
   This library is distributed in the hope that it will be useful,
 
10
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
   Library General Public License for more details.
 
13
 
 
14
   You should have received a copy of the GNU Library General Public License
 
15
   along with this library; see the file COPYING.LIB.  If not, write to
 
16
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
 * Boston, MA 02110-1301, USA.
 
18
*/
 
19
 
 
20
#ifndef KEXIDB_SCHEMADATA_H
 
21
#define KEXIDB_SCHEMADATA_H
 
22
 
 
23
#include "global.h"
 
24
#include "field.h"
 
25
 
 
26
namespace KexiDB
 
27
{
 
28
 
 
29
/*! Container class that stores common kexi object schema's properties like
 
30
 id, name, caption, help text.
 
31
 By kexi object we mean in-db storable object like table schema or query schema.
 
32
*/
 
33
 
 
34
class CALLIGRADB_EXPORT SchemaData
 
35
{
 
36
public:
 
37
    SchemaData(int obj_type = KexiDB::UnknownObjectType);
 
38
    virtual ~SchemaData();
 
39
 
 
40
    int type() const {
 
41
        return m_type;
 
42
    }
 
43
    int id() const {
 
44
        return m_id;
 
45
    }
 
46
    QString name() const {
 
47
        return m_name;
 
48
    }
 
49
    void setName(const QString& n) {
 
50
        m_name = n;
 
51
    }
 
52
    QString caption() const {
 
53
        return m_caption;
 
54
    }
 
55
    void setCaption(const QString& c) {
 
56
        m_caption = c;
 
57
    }
 
58
    QString captionOrName() const {
 
59
        return m_caption.isEmpty() ? m_name : m_caption;
 
60
    }
 
61
    QString description() const {
 
62
        return m_desc;
 
63
    }
 
64
    void setDescription(const QString& desc) {
 
65
        m_desc = desc;
 
66
    }
 
67
 
 
68
    /*! \return debug string useful for debugging */
 
69
    virtual QString schemaDataDebugString() const;
 
70
 
 
71
    /*! \return true if this is schema of native database object,
 
72
     like, for example like, native table. This flag
 
73
     is set when object schema (currently -- database table)
 
74
     is not retrieved using kexi__* schema storage system,
 
75
     but just based on the information about native table.
 
76
 
 
77
     By native object we mean the one that has no additional
 
78
     data like caption, description, etc. properties (no kexidb extensions).
 
79
 
 
80
     Native objects schemas are used mostly for representing
 
81
     kexi system (kexi__*) tables in memory for later reference;
 
82
     see Connection::tableNames().
 
83
 
 
84
     By default (on allocation) SchemaData objects are not native.
 
85
    */
 
86
    virtual bool isNative() const {
 
87
        return m_native;
 
88
    }
 
89
 
 
90
    /* Sets native flag */
 
91
    virtual void setNative(bool set) {
 
92
        m_native = set;
 
93
    }
 
94
 
 
95
protected:
 
96
    //! Clears all properties except 'type'.
 
97
    void clear();
 
98
 
 
99
    int m_type;
 
100
    int m_id;
 
101
    QString m_name;
 
102
    QString m_caption;
 
103
    QString m_desc;
 
104
    bool m_native : 1;
 
105
 
 
106
    friend class Connection;
 
107
};
 
108
 
 
109
} //namespace KexiDB
 
110
 
 
111
#endif