~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to kexi/formeditor/connectiondialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
 
3
   Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
 
4
 
 
5
   This library is free software; you can redistribute it and/or
 
6
   modify it under the terms of the GNU Library General Public
 
7
   License as published by the Free Software Foundation; either
 
8
   version 2 of the License, or (at your option) any later version.
 
9
 
 
10
   This library is distributed in the hope that it will be useful,
 
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
13
   Library General Public License for more details.
 
14
 
 
15
   You should have received a copy of the GNU Library General Public License
 
16
   along with this library; see the file COPYING.LIB.  If not, write to
 
17
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
18
   Boston, MA 02111-1307, USA.
 
19
*/
 
20
 
 
21
#ifndef FORMCONNECTIONDIALOG_H
 
22
#define FORMCONNECTIONDIALOG_H
 
23
 
 
24
#include <qintdict.h>
 
25
#include <kdialogbase.h>
 
26
 
 
27
namespace KexiDB {
 
28
        class ResultInfo;
 
29
}
 
30
 
 
31
class QLabel;
 
32
class QButton;
 
33
class KexiTableView;
 
34
class KexiTableViewData;
 
35
class KexiTableItem;
 
36
 
 
37
namespace KFormDesigner {
 
38
 
 
39
class Form;
 
40
class ConnectionBuffer;
 
41
class Connection;
 
42
 
 
43
 
 
44
/*! This dialog is used to edit the connections of a form. It uses KexiTableView for this. There is also a details widget (icon + text)) that shows correctness
 
45
  of current connection.  */
 
46
class KFORMEDITOR_EXPORT ConnectionDialog : public KDialogBase
 
47
{
 
48
        Q_OBJECT
 
49
 
 
50
        public:
 
51
                ConnectionDialog(QWidget *parent);
 
52
                ~ConnectionDialog() {;}
 
53
 
 
54
                /*! Displays as modal dialog, to edit connections in \ref Form::connectionBuffer(). */
 
55
                void exec(Form *form);
 
56
 
 
57
        protected:
 
58
                /*! Used when connection is ok. Displays a message in details widget and changes icon in 'OK?' column. */
 
59
                void setStatusOk(KexiTableItem *item = 0);
 
60
                /*! Used when connection is wrong. Displays a message in details widget and changes icon in 'OK?' column. \a msg is
 
61
                  the message explaining what's wrong. */
 
62
                void setStatusError(const QString &msg, KexiTableItem *item = 0);
 
63
                //! Inits table data, columns, etc.
 
64
                void initTable();
 
65
                /*! Updates the widget list (shown in receiver and sender columns). Then fill in the table with the connections in m_buffer. */
 
66
                void updateTableData();
 
67
                /*! Updates the slot list, according to the receiver name, and only shows those who are compatible with signal args. */
 
68
                void updateSlotList(KexiTableItem *item);
 
69
                //! Updates the signal list, according to the sender name.
 
70
                void updateSignalList(KexiTableItem *item);
 
71
 
 
72
        protected slots:
 
73
                /*! Slot called when the user modifies a cell. Signal and/or slot cells are cleared if necessary (not valid anymore). */
 
74
                void slotCellChanged(KexiTableItem*, int, QVariant&, KexiDB::ResultInfo*);
 
75
                /*! This function checks if the connection represented by KexiTableItem \a item is valid. It checks if all args (sender, receiver, signal and slot)
 
76
                 are given, and then if signal/slot args are compatible (should be always true, as we don't show non-compatible slots). It calls \ref setStatusOk()
 
77
                 or \ref setStatusError() following the result of checks. */
 
78
                void checkConnection(KexiTableItem *item);
 
79
 
 
80
                /*! Hides the dialog and allow the user to create the Connection by drag-and-drop in the Form itself. Currently disabled in the GUI.
 
81
                 \sa FormManager::startCreatingConnection()  */
 
82
                void newItemByDragnDrop();
 
83
                /*! Creates a new item. It just moves the cursor to the last empty row. */
 
84
                void newItem();
 
85
                void removeItem();
 
86
 
 
87
                /*! This slot is called when the user ends connection creation (when in drag-and-drop mode). The dialog is restored,
 
88
                  and the created connection is added to the list. */
 
89
                void slotConnectionCreated(KFormDesigner::Form *form, KFormDesigner::Connection &connection);
 
90
                /*! This slot is called when the user aborts connection creation (when in drag-and-drop mode). The dialog is restored,
 
91
                  and an empty connection is created. */
 
92
                void slotConnectionAborted(KFormDesigner::Form *form);
 
93
 
 
94
                void slotCellSelected(int col, int row);
 
95
                void slotRowInserted(KexiTableItem*,bool);
 
96
 
 
97
                /*! Slot called when the user presses 'Ok' button. The \ref Form::connectionBuffer() is deleted, created again and filled with Connection.
 
98
                 If the user presses 'Cancel', nothing happens. */
 
99
                virtual void slotOk();
 
100
 
 
101
        protected:
 
102
                enum {BAdd = 10, BRemove};
 
103
                Form    *m_form;
 
104
                ConnectionBuffer *m_buffer;
 
105
                KexiTableView  *m_table;
 
106
                KexiTableViewData  *m_data;
 
107
                KexiTableViewData *m_widgetsColumnData, *m_slotsColumnData, *m_signalsColumnData;
 
108
                QLabel  *m_pixmapLabel, *m_textLabel;
 
109
                QIntDict<QButton>  m_buttons;  //! dict of button (for disabling them)
 
110
};
 
111
 
 
112
}
 
113
 
 
114
#endif