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

« back to all changes in this revision

Viewing changes to kexi/plugins/tables/kexitabledesignerview_p.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
1
/* This file is part of the KDE project
2
 
   Copyright (C) 2004-2006 Jarosław Staniek <staniek@kde.org>
 
2
   Copyright (C) 2004-2012 Jarosław Staniek <staniek@kde.org>
3
3
 
4
4
   This program is free software; you can redistribute it and/or
5
5
   modify it under the terms of the GNU Library General Public
22
22
 
23
23
#include "kexitabledesignerview.h"
24
24
#include <QList>
25
 
#include <K3Command>
 
25
#include <kundo2command.h>
26
26
#include <QByteArray>
27
27
 
28
28
class KexiDataAwarePropertySet;
29
29
 
 
30
namespace KexiTableDesignerCommands
 
31
{
 
32
class Command;
 
33
}
 
34
 
30
35
//! @internal indices for table columns
31
36
#define COLUMN_ID_ICON 0
32
37
#define COLUMN_ID_CAPTION 1
33
38
#define COLUMN_ID_TYPE 2
34
39
#define COLUMN_ID_DESC 3
35
40
 
36
 
/*! @internal
37
 
 Command group, reimplemented to get access to commands().
38
 
 We need it to iterate through commands so we can perform a set of ALTER TABLE atomic actions. */
39
 
class CommandGroup : public K3MacroCommand
40
 
{
41
 
public:
42
 
    CommandGroup(const QString & name)
43
 
            : K3MacroCommand(name) {}
44
 
    virtual ~CommandGroup() {}
45
 
    const QList<K3Command*> commands() const {
46
 
        return K3MacroCommand::commands();
47
 
    }
48
 
};
49
 
 
50
 
/*! @internal
51
 
 Command history, reimplemented to get access to commands().
52
 
 We need it to iterate through commands so we can perform a set of ALTER TABLE atomic actions. */
53
 
class CommandHistory : public K3CommandHistory
54
 
{
55
 
    Q_OBJECT
56
 
public:
57
 
    CommandHistory(KActionCollection *actionCollection, bool withMenus = true);
58
 
 
59
 
    const QList<K3Command*>& commands() const {
60
 
        return m_commandsToUndo;
61
 
    }
62
 
 
63
 
    void addCommand(K3Command *command, bool execute = true);
64
 
 
65
 
    void clear();
66
 
 
67
 
public slots:
68
 
    virtual void undo();
69
 
    virtual void redo();
70
 
 
71
 
protected:
72
 
    QList<K3Command*> m_commandsToUndo, m_commandsToRedo;
73
 
};
74
 
 
75
 
//----------------------------------------------
76
 
 
77
41
//! @internal
78
42
class KexiTableDesignerViewPrivate
79
43
{
102
66
     addHistoryCommand_in_slotPropertyChanged_enabled is then set back to the original state.
103
67
     */
104
68
    void setPropertyValueIfNeeded(const KoProperty::Set& set, const QByteArray& propertyName,
105
 
                                  const QVariant& newValue, CommandGroup* commandGroup,
 
69
                                  const QVariant& newValue, KexiTableDesignerCommands::Command* commandGroup,
106
70
                                  bool forceAddCommand = false, bool rememberOldValue = true,
107
71
                                  QStringList* const slist = 0, QStringList* const nlist = 0);
108
72
 
109
73
    /*! Like above but allows to specify \a oldValue. */
110
74
    void setPropertyValueIfNeeded(
111
75
        const KoProperty::Set& set, const QByteArray& propertyName,
112
 
        const QVariant& newValue, const QVariant& oldValue, CommandGroup* commandGroup,
 
76
        const QVariant& newValue, const QVariant& oldValue, KexiTableDesignerCommands::Command* commandGroup,
113
77
        bool forceAddCommand = false, bool rememberOldValue = true,
114
78
        QStringList* const slist = 0, QStringList* const nlist = 0);
115
79
 
119
83
     otherwise sets changed to true and sets visibility of property \a prop to \a visible.
120
84
    */
121
85
    void setVisibilityIfNeeded(const KoProperty::Set& set, KoProperty::Property* prop,
122
 
                               bool visible, bool &changed, CommandGroup *commandGroup);
 
86
                               bool visible, bool &changed, KexiTableDesignerCommands::Command *commandGroup);
123
87
 
124
88
    bool updatePropertiesVisibility(KexiDB::Field::Type fieldType, KoProperty::Set &set,
125
 
                                    CommandGroup *commandGroup = 0);
 
89
                                    KexiTableDesignerCommands::Command *commandGroup = 0);
126
90
 
127
91
    /*! \return message used to ask user for accepting saving the design.
128
92
     \a emptyTable is set to true if the table designed contains no rows.
176
140
    bool slotBeforeCellChanged_enabled : 1;
177
141
 
178
142
//! @todo temp; remove this:
179
 
    //! Temporary flag, used for testingu the Alter Table machinery. Affects storeData()
 
143
    //! Temporary flag, used for testing the Alter Table machinery. Affects storeData()
180
144
    //! Used in slotExecuteRealAlterTable() to switch on real alter table for a while.
181
145
    bool tempStoreDataUsingRealAlterTable : 1;
182
146
 
186
150
    tristate recentResultOfStoreData;
187
151
 
188
152
    KActionCollection* historyActionCollection;
189
 
    CommandHistory* history;
 
153
    KUndo2Stack* history;
190
154
 
191
155
    //! A set used in KexiTableDesignerView::buildField() to quickly identify
192
156
    //! properties internal to the designer